mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
Merge branch 'hide-event' into 'dev'
Hide event See merge request TheGamecraft/c-cms!115
This commit is contained in:
@@ -90,6 +90,7 @@
|
|||||||
cd {{ $app_dir_697 }}/current/
|
cd {{ $app_dir_697 }}/current/
|
||||||
yes|php artisan migrate
|
yes|php artisan migrate
|
||||||
yes|php artisan db:seed --class=ConfigsTableSeeder
|
yes|php artisan db:seed --class=ConfigsTableSeeder
|
||||||
|
php artisan update
|
||||||
|
|
||||||
@endtask
|
@endtask
|
||||||
|
|
||||||
@@ -127,6 +128,7 @@
|
|||||||
cd {{ $app_dir_736 }}/current/
|
cd {{ $app_dir_736 }}/current/
|
||||||
yes|php artisan migrate
|
yes|php artisan migrate
|
||||||
yes|php artisan db:seed --class=ConfigsTableSeeder
|
yes|php artisan db:seed --class=ConfigsTableSeeder
|
||||||
|
php artisan update
|
||||||
|
|
||||||
@endtask
|
@endtask
|
||||||
|
|
||||||
@@ -164,6 +166,7 @@
|
|||||||
cd {{ $app_dir_dev }}/current/
|
cd {{ $app_dir_dev }}/current/
|
||||||
yes|php artisan migrate
|
yes|php artisan migrate
|
||||||
yes|php artisan db:seed --class=ConfigsTableSeeder
|
yes|php artisan db:seed --class=ConfigsTableSeeder
|
||||||
|
php artisan update
|
||||||
|
|
||||||
@endtask
|
@endtask
|
||||||
|
|
||||||
@@ -206,6 +209,7 @@ echo 'Migrate DB'
|
|||||||
cd {{ $app_dir_227 }}/current/
|
cd {{ $app_dir_227 }}/current/
|
||||||
yes|php artisan migrate
|
yes|php artisan migrate
|
||||||
yes|php artisan db:seed --class=ConfigsTableSeeder
|
yes|php artisan db:seed --class=ConfigsTableSeeder
|
||||||
|
php artisan update
|
||||||
|
|
||||||
@endtask
|
@endtask
|
||||||
|
|
||||||
@@ -243,5 +247,6 @@ echo 'Migrate DB'
|
|||||||
cd {{ $app_dir_117 }}/current/
|
cd {{ $app_dir_117 }}/current/
|
||||||
yes|php artisan migrate
|
yes|php artisan migrate
|
||||||
yes|php artisan db:seed --class=ConfigsTableSeeder
|
yes|php artisan db:seed --class=ConfigsTableSeeder
|
||||||
|
php artisan update
|
||||||
|
|
||||||
@endtask
|
@endtask
|
||||||
|
|||||||
81
app/Console/Commands/update.php
Normal file
81
app/Console/Commands/update.php
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class update extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'update';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Update C-CMS';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->info('Starting update ...');
|
||||||
|
|
||||||
|
$this->updateDatabase();
|
||||||
|
|
||||||
|
$this->info('Update completed !');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateDatabase()
|
||||||
|
{
|
||||||
|
$this->info('Updating database ...');
|
||||||
|
|
||||||
|
// Check event table
|
||||||
|
if (!Schema::hasColumn('events','hidden'))
|
||||||
|
{
|
||||||
|
$this->info('Updating events table ...');
|
||||||
|
Schema::table('events', function ($table) {
|
||||||
|
$table->boolean('hidden')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->info('Events table is up to date ...');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check event_type table
|
||||||
|
if (!Schema::hasColumn('event_types','hidden'))
|
||||||
|
{
|
||||||
|
$this->info('Updating event_types table ...');
|
||||||
|
Schema::table('event_types', function ($table) {
|
||||||
|
$table->boolean('hidden')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->info('Event_types table is up to date ...');
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -94,8 +94,18 @@ class Event extends Model
|
|||||||
return $c;
|
return $c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$error = new \App\Course();
|
||||||
return false;
|
$error->name = "Cours manquant dans la BD";
|
||||||
|
$error->ocom = "ERREUR";
|
||||||
|
$error->periode = $p;
|
||||||
|
$error->level = $l;
|
||||||
|
$error->location = "";
|
||||||
|
$error->desc = "";
|
||||||
|
$error->comment = "Le cours est manquant dans la base de données";
|
||||||
|
$error->comment_officier = "Le cours est manquant dans la base de données";
|
||||||
|
$error->event_id = $this->id;
|
||||||
|
$error->user_id = 1;
|
||||||
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logs()
|
public function logs()
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ class CalendarController extends Controller
|
|||||||
|
|
||||||
public function indexTable()
|
public function indexTable()
|
||||||
{
|
{
|
||||||
return view('admin.schedule.table.index',['events' => \App\Event::allThisYear()]);
|
$event = \App\Event::allThisYear()->sortBy('date_begin')->filter(function ($value,$key) {
|
||||||
|
return $value->hidden != 1;
|
||||||
|
});
|
||||||
|
return view('admin.schedule.table.index',['events' => $event]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ class EventController extends Controller
|
|||||||
$event->use_schedule = 0;
|
$event->use_schedule = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(\request("hidden"))
|
||||||
|
{
|
||||||
|
$event->hidden = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$event->hidden = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$event->calendar_color = \request('calendar_color');
|
$event->calendar_color = \request('calendar_color');
|
||||||
$event->calendar_icon = \request('calendar_icon');
|
$event->calendar_icon = \request('calendar_icon');
|
||||||
|
|
||||||
@@ -225,7 +234,15 @@ class EventController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
return view('admin.schedule.event.edit',['event' => \App\Event::find($id)]);
|
$event = \App\Event::find($id);
|
||||||
|
if ($event->hidden == 1)
|
||||||
|
{
|
||||||
|
if (\Auth::user()->p('instruction_see_hidden_event') != 1)
|
||||||
|
{
|
||||||
|
return redirect('/admin/schedule')->with('error','Modification non authorisé');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return view('admin.schedule.event.edit',['event' => $event]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -238,6 +255,13 @@ class EventController extends Controller
|
|||||||
public function update($id)
|
public function update($id)
|
||||||
{
|
{
|
||||||
$event = Event::findOrFail($id);
|
$event = Event::findOrFail($id);
|
||||||
|
if ($event->hidden == 1)
|
||||||
|
{
|
||||||
|
if (\Auth::user()->p('instruction_see_hidden_event') != 1)
|
||||||
|
{
|
||||||
|
return redirect('/admin/schedule')->with('error','Modification non authorisé');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (\App\GoogleDriveFile::checkConfig())
|
// if (\App\GoogleDriveFile::checkConfig())
|
||||||
// {
|
// {
|
||||||
@@ -297,6 +321,15 @@ class EventController extends Controller
|
|||||||
$event->use_schedule = 0;
|
$event->use_schedule = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(\request("hidden"))
|
||||||
|
{
|
||||||
|
$event->hidden = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$event->hidden = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$event->calendar_color = \request('calendar_color');
|
$event->calendar_color = \request('calendar_color');
|
||||||
$event->calendar_icon = \request('calendar_icon');
|
$event->calendar_icon = \request('calendar_icon');
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ class EventTypeController extends Controller
|
|||||||
{
|
{
|
||||||
$eventType->use_schedule = 0;
|
$eventType->use_schedule = 0;
|
||||||
}
|
}
|
||||||
|
if(\request("hidden"))
|
||||||
|
{
|
||||||
|
$eventType->hidden = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$eventType->hidden = 0;
|
||||||
|
}
|
||||||
if ($request->is_mandatory == 'on')
|
if ($request->is_mandatory == 'on')
|
||||||
{
|
{
|
||||||
$eventType->is_mandatory = 1;
|
$eventType->is_mandatory = 1;
|
||||||
@@ -174,6 +182,14 @@ class EventTypeController extends Controller
|
|||||||
{
|
{
|
||||||
$eventType->use_schedule = 0;
|
$eventType->use_schedule = 0;
|
||||||
}
|
}
|
||||||
|
if(\request("hidden"))
|
||||||
|
{
|
||||||
|
$eventType->hidden = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$eventType->hidden = 0;
|
||||||
|
}
|
||||||
if ($request->is_mandatory == 'on')
|
if ($request->is_mandatory == 'on')
|
||||||
{
|
{
|
||||||
$eventType->is_mandatory = 1;
|
$eventType->is_mandatory = 1;
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ class ScheduleController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($allevents as $event) {
|
foreach ($allevents as $event) {
|
||||||
|
if ($event->hidden == 1) {
|
||||||
|
if (\Auth::check())
|
||||||
|
{
|
||||||
|
if (\Auth::user()->p('instruction_see_hidden_event') == 1)
|
||||||
|
{
|
||||||
if(strtotime($event->date_begin) >= $start && strtotime($event->date_begin) <= $end) {
|
if(strtotime($event->date_begin) >= $start && strtotime($event->date_begin) <= $end) {
|
||||||
array_push($events,$event);
|
array_push($events,$event);
|
||||||
}
|
}
|
||||||
@@ -53,6 +58,18 @@ class ScheduleController extends Controller
|
|||||||
array_push($events,$event);
|
array_push($events,$event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(strtotime($event->date_begin) >= $start && strtotime($event->date_begin) <= $end) {
|
||||||
|
array_push($events,$event);
|
||||||
|
}
|
||||||
|
else if(strtotime($event->date_end) >= $start && strtotime($event->date_end) <= $end) {
|
||||||
|
array_push($events,$event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($schedules as $schedule) {
|
foreach ($schedules as $schedule) {
|
||||||
@@ -90,8 +107,16 @@ class ScheduleController extends Controller
|
|||||||
$icon = $event->calendar_icon;
|
$icon = $event->calendar_icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$name = $event->name;
|
||||||
|
|
||||||
|
if ($event->hidden == 1) {
|
||||||
|
$color = $this->hex2rgba($color,0.5);
|
||||||
|
$icon = 'fas fa-eye-slash';
|
||||||
|
$name = 'Caché - '.$name;
|
||||||
|
}
|
||||||
|
|
||||||
$myevent = [
|
$myevent = [
|
||||||
'title' => $event->name,
|
'title' => $name,
|
||||||
'start' => date('c',strtotime($event->date_begin)),
|
'start' => date('c',strtotime($event->date_begin)),
|
||||||
'end' => date('c',strtotime($event->date_end)),
|
'end' => date('c',strtotime($event->date_end)),
|
||||||
'color' => $color,
|
'color' => $color,
|
||||||
@@ -106,6 +131,45 @@ class ScheduleController extends Controller
|
|||||||
return json_encode($jsonevents);
|
return json_encode($jsonevents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hex2rgba($color, $opacity = false) {
|
||||||
|
|
||||||
|
$default = 'rgb(0,0,0)';
|
||||||
|
|
||||||
|
//Return default if no color provided
|
||||||
|
if(empty($color))
|
||||||
|
return $default;
|
||||||
|
|
||||||
|
//Sanitize $color if "#" is provided
|
||||||
|
if ($color[0] == '#' ) {
|
||||||
|
$color = substr( $color, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if color has 6 or 3 characters and get values
|
||||||
|
if (strlen($color) == 6) {
|
||||||
|
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
|
||||||
|
} elseif ( strlen( $color ) == 3 ) {
|
||||||
|
$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
|
||||||
|
} else {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Convert hexadec to rgb
|
||||||
|
$rgb = array_map('hexdec', $hex);
|
||||||
|
|
||||||
|
//Check if opacity is set(rgba or rgb)
|
||||||
|
if($opacity){
|
||||||
|
if(abs($opacity) > 1)
|
||||||
|
$opacity = 1.0;
|
||||||
|
$output = 'rgba('.implode(",",$rgb).','.$opacity.')';
|
||||||
|
} else {
|
||||||
|
$output = 'rgb('.implode(",",$rgb).')';
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return rgb(a) color string
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function loadModal($id,$db_type)
|
public function loadModal($id,$db_type)
|
||||||
{
|
{
|
||||||
if($db_type == "event")
|
if($db_type == "event")
|
||||||
@@ -216,6 +280,13 @@ class ScheduleController extends Controller
|
|||||||
public function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
$event = \App\Event::find($id);
|
$event = \App\Event::find($id);
|
||||||
|
if ($event->hidden == 1)
|
||||||
|
{
|
||||||
|
if (\Auth::user()->p('instruction_see_hidden_event') != 1)
|
||||||
|
{
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach ($event->courses as $course)
|
foreach ($event->courses as $course)
|
||||||
{
|
{
|
||||||
$course->delete();
|
$course->delete();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use Illuminate\Support\Arr;
|
|||||||
class Permission extends Model
|
class Permission extends Model
|
||||||
{
|
{
|
||||||
const PERMISSIONS = [
|
const PERMISSIONS = [
|
||||||
'news' => [
|
'Nouvelle' => [
|
||||||
'news_see' => [
|
'news_see' => [
|
||||||
'ckey' => 'news_see',
|
'ckey' => 'news_see',
|
||||||
'communName' => 'Voir les nouvelles',
|
'communName' => 'Voir les nouvelles',
|
||||||
@@ -46,7 +46,7 @@ class Permission extends Model
|
|||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'inventory' => [
|
'Inventaire' => [
|
||||||
'inventory_see' => [
|
'inventory_see' => [
|
||||||
'ckey' => 'inventory_see',
|
'ckey' => 'inventory_see',
|
||||||
'communName' => 'Voir l\'inventaire',
|
'communName' => 'Voir l\'inventaire',
|
||||||
@@ -76,7 +76,7 @@ class Permission extends Model
|
|||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'user' => [
|
'Utilisateur' => [
|
||||||
'user_see' => [
|
'user_see' => [
|
||||||
'ckey' => 'user_see',
|
'ckey' => 'user_see',
|
||||||
'communName' => 'Voir la liste des utilisateurs',
|
'communName' => 'Voir la liste des utilisateurs',
|
||||||
@@ -106,7 +106,7 @@ class Permission extends Model
|
|||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'config' => [
|
'Configuration' => [
|
||||||
'config_see' => [
|
'config_see' => [
|
||||||
'ckey' => 'config_see',
|
'ckey' => 'config_see',
|
||||||
'communName' => 'Voir les configurations',
|
'communName' => 'Voir les configurations',
|
||||||
@@ -116,13 +116,48 @@ class Permission extends Model
|
|||||||
],
|
],
|
||||||
'config_edit' => [
|
'config_edit' => [
|
||||||
'ckey' => 'config_edit',
|
'ckey' => 'config_edit',
|
||||||
'communName' => 'Modifier les configurations',
|
'communName' => 'Modifier les configurations générales',
|
||||||
'desc' => 'L\'utilisateur peut-il modifier les configurations',
|
'desc' => 'L\'utilisateur peut-il modifier les configurations générales',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'config_edit_instruction' => [
|
||||||
|
'ckey' => 'config_edit_instruction',
|
||||||
|
'communName' => 'Modifier les configurations de l\'instruction',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les configurations de l\'instruction',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'config_edit_administration' => [
|
||||||
|
'ckey' => 'config_edit_administration',
|
||||||
|
'communName' => 'Modifier les configurations de l\'administration',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les configurations de l\'administration',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'config_edit_rank' => [
|
||||||
|
'ckey' => 'config_edit_rank',
|
||||||
|
'communName' => 'Modifier les configurations des grades',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les configurations des grades',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'config_edit_job' => [
|
||||||
|
'ckey' => 'config_edit_job',
|
||||||
|
'communName' => 'Modifier les configurations des postes',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les configurations des postes',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'config_edit_customization' => [
|
||||||
|
'ckey' => 'config_edit_customization',
|
||||||
|
'communName' => 'Modifier les configurations de l\'apparence du site',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les configurations de l\'apparence du site',
|
||||||
'icon' => 'fa-eye',
|
'icon' => 'fa-eye',
|
||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'statistique' => [
|
'Statistique' => [
|
||||||
'stats_see' => [
|
'stats_see' => [
|
||||||
'ckey' => 'stats_see',
|
'ckey' => 'stats_see',
|
||||||
'communName' => 'Voir les statistiques',
|
'communName' => 'Voir les statistiques',
|
||||||
@@ -195,6 +230,20 @@ class Permission extends Model
|
|||||||
'icon' => 'fa-eye',
|
'icon' => 'fa-eye',
|
||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
|
'stats_instruction_see' => [
|
||||||
|
'ckey' => 'stats_instruction_see',
|
||||||
|
'communName' => 'Voir les statistiques de l\'instruction',
|
||||||
|
'desc' => 'L\'utilisateur peut-il voir les statistiques de l\'instruction',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'instruction_see_hidden_event' => [
|
||||||
|
'ckey' => 'instruction_see_hidden_event',
|
||||||
|
'communName' => 'Voir les évenements cachés',
|
||||||
|
'desc' => 'L\'utilisateur peut-il voir les évenements cachés',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'Administration' => [
|
'Administration' => [
|
||||||
'cadet_list_see' => [
|
'cadet_list_see' => [
|
||||||
@@ -235,7 +284,7 @@ class Permission extends Model
|
|||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'article' => [
|
'Articles' => [
|
||||||
'article_see' => [
|
'article_see' => [
|
||||||
'ckey' => 'article_see',
|
'ckey' => 'article_see',
|
||||||
'communName' => 'Voir les articles',
|
'communName' => 'Voir les articles',
|
||||||
@@ -265,7 +314,7 @@ class Permission extends Model
|
|||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'picture' => [
|
'Photos & Images' => [
|
||||||
'picture_see' => [
|
'picture_see' => [
|
||||||
'ckey' => 'picture_see',
|
'ckey' => 'picture_see',
|
||||||
'communName' => 'Voir les images',
|
'communName' => 'Voir les images',
|
||||||
@@ -295,7 +344,7 @@ class Permission extends Model
|
|||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'file' => [
|
'Fichiers' => [
|
||||||
'file_see' => [
|
'file_see' => [
|
||||||
'ckey' => 'file_see',
|
'ckey' => 'file_see',
|
||||||
'communName' => 'Voir les fichiers publiques',
|
'communName' => 'Voir les fichiers publiques',
|
||||||
@@ -346,6 +395,11 @@ class Permission extends Model
|
|||||||
return self::PERMISSIONS;
|
return self::PERMISSIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function allToJSON()
|
||||||
|
{
|
||||||
|
return self::all()->toJson();
|
||||||
|
}
|
||||||
|
|
||||||
public static function allToString($value = null)
|
public static function allToString($value = null)
|
||||||
{
|
{
|
||||||
$perm = [];
|
$perm = [];
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ current:
|
|||||||
major: 3
|
major: 3
|
||||||
minor: 2
|
minor: 2
|
||||||
patch: 5
|
patch: 5
|
||||||
prerelease: 41-g465bac0e
|
prerelease: 54-g63301aec
|
||||||
buildmetadata: ''
|
buildmetadata: ''
|
||||||
commit: 41845
|
commit: 41845
|
||||||
timestamp:
|
timestamp:
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class CreateEventsTable extends Migration
|
|||||||
$table->string('calendar_color');
|
$table->string('calendar_color');
|
||||||
$table->string('calendar_icon');
|
$table->string('calendar_icon');
|
||||||
$table->string('weekly_msg_publication_time')->default('-5day');
|
$table->string('weekly_msg_publication_time')->default('-5day');
|
||||||
|
$table->boolean('hidden')->default(0);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class CreateEventTypesTable extends Migration
|
|||||||
$table->boolean('use_schedule')->default(false);
|
$table->boolean('use_schedule')->default(false);
|
||||||
$table->text('schedule_model');
|
$table->text('schedule_model');
|
||||||
$table->boolean('is_promoted')->default(false);
|
$table->boolean('is_promoted')->default(false);
|
||||||
|
$table->boolean('hidden')->default(false);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
26
public/js/calendar.js
vendored
26
public/js/calendar.js
vendored
@@ -19,7 +19,7 @@ function initFullCalendar(authToken) {
|
|||||||
right: 'prev,next'
|
right: 'prev,next'
|
||||||
},
|
},
|
||||||
defaultDate: initDate,
|
defaultDate: initDate,
|
||||||
events: '/api/schedule/events',
|
events: '/api/schedule/events/auth?api_token='+authToken,
|
||||||
eventRender: function(event, element) {
|
eventRender: function(event, element) {
|
||||||
if (event.event.extendedProps.icon && event.view.type == 'dayGridMonth')
|
if (event.event.extendedProps.icon && event.view.type == 'dayGridMonth')
|
||||||
{
|
{
|
||||||
@@ -130,13 +130,7 @@ function deleteEvent(pid){
|
|||||||
if (result.value) {
|
if (result.value) {
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
$.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data) {
|
$.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data, status, xhr) {
|
||||||
console.log('Delete');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
|
|
||||||
swal(
|
swal(
|
||||||
'Supprimé!',
|
'Supprimé!',
|
||||||
"L'évenement a été supprimé",
|
"L'évenement a été supprimé",
|
||||||
@@ -146,6 +140,22 @@ function deleteEvent(pid){
|
|||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}).fail(function (data, status, xhr) {
|
||||||
|
if (xhr == 'Forbidden') {
|
||||||
|
swal(
|
||||||
|
'Oups!',
|
||||||
|
"Vous n'avez pas les permissions nécessaires...",
|
||||||
|
'error'
|
||||||
|
).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
18
public/js/plugins/schedule/editorv2.js
vendored
18
public/js/plugins/schedule/editorv2.js
vendored
@@ -488,6 +488,15 @@ function loadEventType(date,id = 1)
|
|||||||
switchUseSchedule();
|
switchUseSchedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (eventType['hidden'] == 1)
|
||||||
|
{
|
||||||
|
$('#hidden').prop('checked',true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#hidden').removeAttr('checked');
|
||||||
|
}
|
||||||
|
|
||||||
if (eventType['use_weekly_msg'] == 1)
|
if (eventType['use_weekly_msg'] == 1)
|
||||||
{
|
{
|
||||||
$('#use_weekly_msg').prop('checked',true);
|
$('#use_weekly_msg').prop('checked',true);
|
||||||
@@ -604,6 +613,15 @@ function loadEvent(date,id)
|
|||||||
switchUseSchedule();
|
switchUseSchedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (eventType['hidden'] == 1)
|
||||||
|
{
|
||||||
|
$('#hidden').prop('checked',true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#hidden').removeAttr('checked');
|
||||||
|
}
|
||||||
|
|
||||||
if (eventType['use_weekly_msg'] == 1)
|
if (eventType['use_weekly_msg'] == 1)
|
||||||
{
|
{
|
||||||
$('#use_weekly_msg').prop('checked',true);
|
$('#use_weekly_msg').prop('checked',true);
|
||||||
|
|||||||
@@ -31,41 +31,34 @@
|
|||||||
<p>
|
<p>
|
||||||
Choisissez quels permissions doivent être associé avec ce grade.
|
Choisissez quels permissions doivent être associé avec ce grade.
|
||||||
</p>
|
</p>
|
||||||
<div id="accordion" role="tablist">
|
<table id="permission-table" class="table table-bordered" style="width:100%">
|
||||||
|
<thead class="d-none">
|
||||||
|
<th class="d-none">Cat</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
<div class="card card-collapse">
|
|
||||||
<div class="card-header" role="tab" id="headingOne">
|
|
||||||
<h5 class="mb-0">
|
|
||||||
<a class="text-capitalize" data-toggle="collapse" href="#coll-{{$key}}" @if ($loop->first) aria-expanded="true" @endif aria-controls="collapseOne">
|
|
||||||
{{$key}}
|
|
||||||
<i class="material-icons">keyboard_arrow_down</i>
|
|
||||||
</a>
|
|
||||||
</h5>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="coll-{{$key}}" class="collapse @if ($loop->first) show @endif" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="row">
|
|
||||||
@foreach($cat as $r)
|
@foreach($cat as $r)
|
||||||
<div class="col-3 text-center">
|
<tr>
|
||||||
|
<td class="d-none">{{$key}}</td>
|
||||||
|
<td>
|
||||||
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
|
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
|
||||||
<h5>{{$r['communName']}}</h5>
|
{{$r['communName']}}<br>
|
||||||
|
<small>{{$r['desc']}}</small>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
|
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
|
||||||
<!--<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>-->
|
<!--<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>-->
|
||||||
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
</td>
|
||||||
<small>{{$r['desc']}}</small>
|
</tr>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 mt-5">
|
<div class="col-md-12 mt-5">
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||||
@@ -83,5 +76,17 @@
|
|||||||
$('#desc').trumbowyg({
|
$('#desc').trumbowyg({
|
||||||
lang: 'fr'
|
lang: 'fr'
|
||||||
});
|
});
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#permission-table').DataTable({
|
||||||
|
rowGroup: {
|
||||||
|
dataSrc: 0
|
||||||
|
},
|
||||||
|
pageLength: 100,
|
||||||
|
lengthChange: false,
|
||||||
|
columnDefs: [
|
||||||
|
{ "visible": false, "targets": [0] }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
} );
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
@@ -31,7 +31,41 @@
|
|||||||
<p>
|
<p>
|
||||||
Choisissez quels permissions doivent être associé avec ce grade.
|
Choisissez quels permissions doivent être associé avec ce grade.
|
||||||
</p>
|
</p>
|
||||||
<div id="accordion" role="tablist">
|
<table id="permission-table" class="table table-bordered" style="width:100%">
|
||||||
|
<thead class="d-none">
|
||||||
|
<th class="d-none">Cat</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
|
@foreach($cat as $r)
|
||||||
|
<tr>
|
||||||
|
<td class="d-none">{{$key}}</td>
|
||||||
|
<td>
|
||||||
|
<input class="d-none" type="text" id="{{$r['ckey']}}"
|
||||||
|
name="{{$r['ckey']}}" value="{{$rank->p($r['ckey'])}}">
|
||||||
|
{{$r['communName']}}<br>
|
||||||
|
<small>{{$r['desc']}}</small>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" id="{{$r['ckey']}}-close"
|
||||||
|
class="btn btn-just-icon @if($rank->p($r['ckey']) != -1) btn-outline-danger @else btn-danger @endif"
|
||||||
|
onclick="switchPermissionSwitch('{{$r['ckey']}}','close')">
|
||||||
|
<i class="fas fa-times"></i></button>
|
||||||
|
<button type="button" id="{{$r['ckey']}}-plus"
|
||||||
|
class="btn btn-just-icon @if($rank->p($r['ckey']) != 1) btn-outline-success @else btn-success @endif"
|
||||||
|
onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')">
|
||||||
|
<i class="fa fa-plus"></i></button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{--<div id="accordion" role="tablist">
|
||||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h3 class="text-capitalize">{{$key}}</h3>
|
<h3 class="text-capitalize">{{$key}}</h3>
|
||||||
@@ -56,12 +90,11 @@
|
|||||||
<i class="fa fa-plus"></i></button>
|
<i class="fa fa-plus"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>--}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 mt-5">
|
<div class="col-md-12 mt-5">
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||||
@@ -79,5 +112,17 @@
|
|||||||
$('#desc').trumbowyg({
|
$('#desc').trumbowyg({
|
||||||
lang: 'fr'
|
lang: 'fr'
|
||||||
});
|
});
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#permission-table').DataTable({
|
||||||
|
rowGroup: {
|
||||||
|
dataSrc: 0
|
||||||
|
},
|
||||||
|
pageLength: 100,
|
||||||
|
lengthChange: false,
|
||||||
|
columnDefs: [
|
||||||
|
{ "visible": false, "targets": [0] }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
} );
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
@else
|
@else
|
||||||
@foreach ($futureEvent as $event)
|
@foreach ($futureEvent as $event)
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="alert" style="background-color: @if($event->calendar_color == null){{ \App\ComplementaryActivity::find($event->type)->calendar_color}} @else {{$event->calendar_color}} @endif">
|
<div class="alert cursor" style="background-color: @if($event->calendar_color == null){{ \App\ComplementaryActivity::find($event->type)->calendar_color}} @else {{$event->calendar_color}} @endif" onclick="navigate('schedule?e={{$event->id}}')">
|
||||||
<div class="row text-white">
|
<div class="row text-white">
|
||||||
<div class="col-md-2 text-capitalize m-auto d-none d-md-flex">
|
<div class="col-md-2 text-capitalize m-auto d-none d-md-flex">
|
||||||
<h3 class="m-0 p-0" style="margin-top: -0.5rem !important;">@if($event->calendar_icon == null) {!! \App\ComplementaryActivity::find($event->type)->calendar_icon !!} @else <i class="{{$event->calendar_icon}}"></i> @endif</h3>
|
<h3 class="m-0 p-0" style="margin-top: -0.5rem !important;">@if($event->calendar_icon == null) {!! \App\ComplementaryActivity::find($event->type)->calendar_icon !!} @else <i class="{{$event->calendar_icon}}"></i> @endif</h3>
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-5">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-control">Nom</label>
|
<label class="label-control">Nom</label>
|
||||||
<input type="text" class="form-control" name="name" required/>
|
<input type="text" class="form-control" name="name" required/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-control">Emplacement</label>
|
<label class="label-control">Emplacement</label>
|
||||||
<input type="text" class="form-control" name="location" required/>
|
<input type="text" class="form-control" name="location" required/>
|
||||||
@@ -32,6 +32,15 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="togglebutton">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="hidden">
|
||||||
|
<span class="toggle"></span>
|
||||||
|
Évenement caché
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-control">Heure de début</label>
|
<label class="label-control">Heure de début</label>
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
@method('PATCH')
|
@method('PATCH')
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-5">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-control">Nom</label>
|
<label class="label-control">Nom</label>
|
||||||
<input type="text" class="form-control" value="{{$event_type->name}}" name="name" />
|
<input type="text" class="form-control" value="{{$event_type->name}}" name="name" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-control">Emplacement</label>
|
<label class="label-control">Emplacement</label>
|
||||||
<input type="text" class="form-control" value="{{$event_type->location}}" name="location" />
|
<input type="text" class="form-control" value="{{$event_type->location}}" name="location" />
|
||||||
@@ -33,6 +33,15 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="togglebutton">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="hidden" @if($event_type->hidden == 1) checked @endif>
|
||||||
|
<span class="toggle"></span>
|
||||||
|
Évenement caché
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-control">Heure de début</label>
|
<label class="label-control">Heure de début</label>
|
||||||
|
|||||||
@@ -31,7 +31,35 @@
|
|||||||
<p>
|
<p>
|
||||||
Choisissez quels permissions doivent être associé avec ce poste.
|
Choisissez quels permissions doivent être associé avec ce poste.
|
||||||
</p>
|
</p>
|
||||||
<div id="accordion" role="tablist">
|
<table id="permission-table" class="table table-bordered" style="width:100%">
|
||||||
|
<thead class="d-none">
|
||||||
|
<th class="d-none">Cat</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
|
@foreach($cat as $r)
|
||||||
|
<tr>
|
||||||
|
<td class="d-none">{{$key}}</td>
|
||||||
|
<td>
|
||||||
|
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
|
||||||
|
{{$r['communName']}}<br>
|
||||||
|
<small>{{$r['desc']}}</small>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
|
||||||
|
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>
|
||||||
|
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{--<div id="accordion" role="tablist">
|
||||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
<div class="card card-collapse">
|
<div class="card card-collapse">
|
||||||
<div class="card-header" role="tab" id="headingOne">
|
<div class="card-header" role="tab" id="headingOne">
|
||||||
@@ -65,7 +93,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>--}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 mt-5">
|
<div class="col-md-12 mt-5">
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||||
@@ -83,5 +111,17 @@
|
|||||||
$('#desc').trumbowyg({
|
$('#desc').trumbowyg({
|
||||||
lang: 'fr'
|
lang: 'fr'
|
||||||
});
|
});
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#permission-table').DataTable({
|
||||||
|
rowGroup: {
|
||||||
|
dataSrc: 0
|
||||||
|
},
|
||||||
|
pageLength: 100,
|
||||||
|
lengthChange: false,
|
||||||
|
columnDefs: [
|
||||||
|
{ "visible": false, "targets": [0] }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
} );
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
@@ -31,7 +31,35 @@
|
|||||||
<p>
|
<p>
|
||||||
Choisissez quels permissions doivent être associé avec ce poste.
|
Choisissez quels permissions doivent être associé avec ce poste.
|
||||||
</p>
|
</p>
|
||||||
<div id="accordion" role="tablist">
|
<table id="permission-table" class="table table-bordered" style="width:100%">
|
||||||
|
<thead class="d-none">
|
||||||
|
<th class="d-none">Cat</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
|
@foreach($cat as $r)
|
||||||
|
<tr>
|
||||||
|
<td class="d-none">{{$key}}</td>
|
||||||
|
<td>
|
||||||
|
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}" value="{{$job->p($r['ckey'])}}">
|
||||||
|
{{$r['communName']}}<br>
|
||||||
|
<small>{{$r['desc']}}</small>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon @if($job->p($r['ckey']) != -1) btn-outline-danger @else btn-danger @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
|
||||||
|
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon @if($job->p($r['ckey']) == 0) btn-warning @else btn-outline-warning @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fas fa-slash"></i></button>
|
||||||
|
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon @if($job->p($r['ckey']) != 1) btn-outline-success @else btn-success @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fas fa-plus"></i></button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{-- <div id="accordion" role="tablist">
|
||||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||||
<div class="card card-collapse">
|
<div class="card card-collapse">
|
||||||
<div class="card-header" role="tab" id="headingOne">
|
<div class="card-header" role="tab" id="headingOne">
|
||||||
@@ -65,7 +93,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>--}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 mt-5">
|
<div class="col-md-12 mt-5">
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||||
@@ -83,5 +111,17 @@
|
|||||||
$('#desc').trumbowyg({
|
$('#desc').trumbowyg({
|
||||||
lang: 'fr'
|
lang: 'fr'
|
||||||
});
|
});
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#permission-table').DataTable({
|
||||||
|
rowGroup: {
|
||||||
|
dataSrc: 0
|
||||||
|
},
|
||||||
|
pageLength: 100,
|
||||||
|
lengthChange: false,
|
||||||
|
columnDefs: [
|
||||||
|
{ "visible": false, "targets": [0] }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
} );
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
@@ -157,6 +157,17 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="m-0" for="type">Évenement caché</label>
|
||||||
|
<small class="text-muted d-block">L'évenement doit t-il être caché?</small>
|
||||||
|
<div class="togglebutton">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="hidden" name="hidden">
|
||||||
|
<span class="toggle"></span>
|
||||||
|
Caché
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="accordion-apparence" role="tablist">
|
<div id="accordion-apparence" role="tablist">
|
||||||
<div class="card card-collapse">
|
<div class="card card-collapse">
|
||||||
<div class="card-header" role="tab" id="heading-apparence">
|
<div class="card-header" role="tab" id="heading-apparence">
|
||||||
|
|||||||
@@ -170,6 +170,17 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="m-0" for="type">Évenement caché</label>
|
||||||
|
<small class="text-muted d-block">L'évenement doit t-il être caché?</small>
|
||||||
|
<div class="togglebutton">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="hidden" name="hidden">
|
||||||
|
<span class="toggle"></span>
|
||||||
|
Caché
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="accordion-apparence" role="tablist">
|
<div id="accordion-apparence" role="tablist">
|
||||||
<div class="card card-collapse">
|
<div class="card card-collapse">
|
||||||
<div class="card-header" role="tab" id="heading-apparence">
|
<div class="card-header" role="tab" id="heading-apparence">
|
||||||
|
|||||||
@@ -65,15 +65,16 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="row" style="width: 29rem">
|
<div class="row" style="width: 29rem">
|
||||||
<div class="col-2 text-center m-auto">
|
<div class="col-2 text-center m-auto">
|
||||||
1
|
{{ $loop->iteration }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 m-auto">
|
<div class="col-4 m-auto">
|
||||||
{{$event->name}}
|
{{$event->name}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 m-auto">
|
<div class="col-3 m-auto">
|
||||||
{{$event->date_begin}}
|
{{$event->date_begin}} à {{ $event->date_end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 m-auto pr-0">
|
<div class="col-3 m-auto pr-0">
|
||||||
|
@if($event->use_schedule == 1)
|
||||||
@foreach($event->schedule["periodes"] as $periode)
|
@foreach($event->schedule["periodes"] as $periode)
|
||||||
<table class="table-borderless">
|
<table class="table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -83,9 +84,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@if($event->use_schedule == 1)
|
||||||
@for($n = 1;$n <= $event->nbNiveau();$n++)
|
@for($n = 1;$n <= $event->nbNiveau();$n++)
|
||||||
<td style="padding: 0px;">
|
<td style="padding: 0px;">
|
||||||
@for($p = 1;$p <= $event->nbPeriode();$p++)
|
@for($p = 1;$p <= $event->nbPeriode();$p++)
|
||||||
@@ -118,6 +121,12 @@
|
|||||||
@endfor
|
@endfor
|
||||||
</td>
|
</td>
|
||||||
@endfor
|
@endfor
|
||||||
|
@else
|
||||||
|
<td colspan="{{\App\Event::getMaxLevels($events)}}">
|
||||||
|
{!! $event->desc !!}
|
||||||
|
</td>
|
||||||
|
@endif
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ $sidebar = [
|
|||||||
'Configuration' => [
|
'Configuration' => [
|
||||||
'route' => null,
|
'route' => null,
|
||||||
'icon' => 'menu_book',
|
'icon' => 'menu_book',
|
||||||
'perm' => 'config_edit',
|
'perm' => 'config_see',
|
||||||
'child' => [
|
'child' => [
|
||||||
'Général' => [
|
'Général' => [
|
||||||
'route' => 'admin.config.general',
|
'route' => 'admin.config.general',
|
||||||
@@ -136,7 +136,7 @@ $sidebar = [
|
|||||||
'Apparence' => [
|
'Apparence' => [
|
||||||
'route' => 'admin.config.customisation',
|
'route' => 'admin.config.customisation',
|
||||||
'icon' => 'fas fa-palette',
|
'icon' => 'fas fa-palette',
|
||||||
'perm' => 'config_edit_instruction',
|
'perm' => 'config_edit_customization',
|
||||||
'child' => null
|
'child' => null
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
@if($event->hidden == 1)
|
||||||
|
<div class="alert alert-danger text-center" role="alert" style="margin-top:-4rem">
|
||||||
|
<b>Évenement caché</b>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="exampleModalLabel">{{$event->name}}</h5>
|
<h5 class="modal-title" id="exampleModalLabel">{{$event->name}}</h5>
|
||||||
<button type="button" class="close" onclick="closeScheduleModal()" aria-label="Close">
|
<button type="button" class="close" onclick="closeScheduleModal()" aria-label="Close">
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ Route::get('/schedule/events/modal/{id}/{db_type}','ScheduleController@loadModal
|
|||||||
|
|
||||||
Route::middleware('auth:api')->group(function () {
|
Route::middleware('auth:api')->group(function () {
|
||||||
|
|
||||||
|
Route::get('/schedule/events/auth','ScheduleController@apiIndex');
|
||||||
Route::get('/schedule/events/modal/full/{id}/{db_type}','ScheduleController@loadModalFull')->middleware('perm:schedule_see');
|
Route::get('/schedule/events/modal/full/{id}/{db_type}','ScheduleController@loadModalFull')->middleware('perm:schedule_see');
|
||||||
Route::get('/schedule/events/add/modal/{type}/{date}','ScheduleController@loadModalDefautType')->middleware('perm:schedule_add');
|
Route::get('/schedule/events/add/modal/{type}/{date}','ScheduleController@loadModalDefautType')->middleware('perm:schedule_add');
|
||||||
Route::get('/schedule/editor/init/{id}','ScheduleEditorController@getTemplate')->middleware('perm:schedule_edit');
|
Route::get('/schedule/editor/init/{id}','ScheduleEditorController@getTemplate')->middleware('perm:schedule_edit');
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
|
|||||||
|
|
||||||
/** Statistique */
|
/** Statistique */
|
||||||
Route::get('/admin/stats/log', 'LogController@index')->middleware('perm:stats_see')->name('stats.log');
|
Route::get('/admin/stats/log', 'LogController@index')->middleware('perm:stats_see')->name('stats.log');
|
||||||
Route::get('/admin/stats/instruction', 'StatsController@instruction')->middleware('perm:stats_see')->name('stats.instruction');
|
Route::get('/admin/stats/instruction', 'StatsController@instruction')->middleware('perm:stats_instruction_see')->name('stats.instruction');
|
||||||
|
|
||||||
/** Message */
|
/** Message */
|
||||||
Route::get('/admin/message', 'MessageController@index')->middleware('perm:msg_see')->name('message');
|
Route::get('/admin/message', 'MessageController@index')->middleware('perm:msg_see')->name('message');
|
||||||
@@ -75,39 +75,39 @@ Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
|
|||||||
Route::post('/admin/user/edit/{id}', 'UserController@update')->middleware('perm:user_edit');
|
Route::post('/admin/user/edit/{id}', 'UserController@update')->middleware('perm:user_edit');
|
||||||
|
|
||||||
/** Config */
|
/** Config */
|
||||||
Route::get('/admin/config/instruction', 'ScheduleController@index')->middleware('perm:config_edit')->name('config.schedule');
|
Route::get('/admin/config/instruction', 'ScheduleController@index')->middleware('perm:config_edit_instruction')->name('config.schedule');
|
||||||
Route::get('/admin/config/instruction/event_type/create', 'EventTypeController@create')->middleware('perm:config_edit')->name('config.schedule.event_type.create');
|
Route::get('/admin/config/instruction/event_type/create', 'EventTypeController@create')->middleware('perm:config_edit_instruction')->name('config.schedule.event_type.create');
|
||||||
Route::post('/admin/config/instruction/event_type/create', 'EventTypeController@store')->middleware('perm:config_edit');
|
Route::post('/admin/config/instruction/event_type/create', 'EventTypeController@store')->middleware('perm:config_edit_instruction');
|
||||||
Route::get('/admin/config/instruction/event_type/{id}', 'EventTypeController@show')->middleware('perm:config_edit')->name('config.schedule.event_type');
|
Route::get('/admin/config/instruction/event_type/{id}', 'EventTypeController@show')->middleware('perm:config_edit_instruction')->name('config.schedule.event_type');
|
||||||
Route::patch('/admin/config/instruction/event_type/{id}', 'EventTypeController@update')->middleware('perm:config_edit');
|
Route::patch('/admin/config/instruction/event_type/{id}', 'EventTypeController@update')->middleware('perm:config_edit_instruction');
|
||||||
Route::patch('/admin/config/instruction', 'ScheduleController@update')->middleware('perm:config_edit');
|
Route::patch('/admin/config/instruction', 'ScheduleController@update')->middleware('perm:config_edit_instruction');
|
||||||
Route::get('/admin/config/activity', 'ComplementaryActivityController@index')->middleware('perm:config_edit')->name('config.complementary-activity');
|
Route::get('/admin/config/activity', 'ComplementaryActivityController@index')->middleware('perm:config_edit_administration')->name('config.complementary-activity');
|
||||||
Route::get('/admin/config/activity/add', 'ComplementaryActivityController@create')->middleware('perm:config_edit')->name('config.complementary-activity.add');
|
Route::get('/admin/config/activity/add', 'ComplementaryActivityController@create')->middleware('perm:config_edit_administration')->name('config.complementary-activity.add');
|
||||||
Route::post('/admin/config/activity/add', 'ComplementaryActivityController@store')->middleware('perm:config_edit');
|
Route::post('/admin/config/activity/add', 'ComplementaryActivityController@store')->middleware('perm:config_edit_administration');
|
||||||
Route::get('/admin/config/activity/edit/{id}', 'ComplementaryActivityController@edit')->middleware('perm:config_edit')->name('config.complementary-activity.edit');
|
Route::get('/admin/config/activity/edit/{id}', 'ComplementaryActivityController@edit')->middleware('perm:config_edit_administration')->name('config.complementary-activity.edit');
|
||||||
Route::post('/admin/config/activity/edit/{id}', 'ComplementaryActivityController@update')->middleware('perm:config_edit');
|
Route::post('/admin/config/activity/edit/{id}', 'ComplementaryActivityController@update')->middleware('perm:config_edit_administration');
|
||||||
Route::post('/admin/config/general/edit', 'ConfigController@update')->middleware('perm:config_edit');
|
Route::post('/admin/config/general/edit', 'ConfigController@update')->middleware('perm:config_edit');
|
||||||
Route::get('/admin/config/', 'ConfigController@index')->middleware('perm:config_edit')->name('config.general');
|
Route::get('/admin/config/', 'ConfigController@index')->middleware('perm:config_edit')->name('config.general');
|
||||||
Route::get('/admin/config/customisation', 'ConfigController@customisation')->middleware('perm:config_edit')->name('config.customisation');
|
Route::get('/admin/config/customisation', 'ConfigController@customisation')->middleware('perm:config_edit_customization')->name('config.customisation');
|
||||||
Route::post('/admin/config/customisation', 'ConfigController@customisationUpdate')->middleware('perm:config_edit');
|
Route::post('/admin/config/customisation', 'ConfigController@customisationUpdate')->middleware('perm:config_edit_customization');
|
||||||
|
|
||||||
Route::get('/admin/config/ranks', 'RankController@index')->middleware('perm:config_edit')->name('config.rank');
|
Route::get('/admin/config/ranks', 'RankController@index')->middleware('perm:config_edit_rank')->name('config.rank');
|
||||||
Route::get('/admin/config/ranks/add', 'RankController@create')->middleware('perm:config_edit')->name('config.rank.add');
|
Route::get('/admin/config/ranks/add', 'RankController@create')->middleware('perm:config_edit_rank')->name('config.rank.add');
|
||||||
Route::post('/admin/config/ranks/add', 'RankController@store')->middleware('perm:config_edit');
|
Route::post('/admin/config/ranks/add', 'RankController@store')->middleware('perm:config_edit_rank');
|
||||||
Route::get('/admin/config/ranks/{id}', 'RankController@show')->middleware('perm:config_edit')->name('config.rank.edit');
|
Route::get('/admin/config/ranks/{id}', 'RankController@show')->middleware('perm:config_edit_rank')->name('config.rank.edit');
|
||||||
Route::post('/admin/config/ranks/{id}', 'RankController@update')->middleware('perm:config_edit');
|
Route::post('/admin/config/ranks/{id}', 'RankController@update')->middleware('perm:config_edit_rank');
|
||||||
Route::get('/admin/config/jobs', 'JobController@index')->middleware('perm:config_edit')->name('config.jobs');
|
Route::get('/admin/config/jobs', 'JobController@index')->middleware('perm:config_edit_job')->name('config.jobs');
|
||||||
Route::get('/admin/config/jobs/add', 'JobController@create')->middleware('perm:config_edit')->name('config.jobs.add');
|
Route::get('/admin/config/jobs/add', 'JobController@create')->middleware('perm:config_edit_job')->name('config.jobs.add');
|
||||||
Route::post('/admin/config/jobs/add', 'JobController@store')->middleware('perm:config_edit');
|
Route::post('/admin/config/jobs/add', 'JobController@store')->middleware('perm:config_edit_job');
|
||||||
Route::get('/admin/config/jobs/{id}', 'JobController@edit')->middleware('perm:config_edit')->name('config.jobs.edit');
|
Route::get('/admin/config/jobs/{id}', 'JobController@edit')->middleware('perm:config_edit_job')->name('config.jobs.edit');
|
||||||
Route::post('/admin/config/jobs/{id}', 'JobController@update')->middleware('perm:config_edit');
|
Route::post('/admin/config/jobs/{id}', 'JobController@update')->middleware('perm:config_edit_job');
|
||||||
|
|
||||||
Route::get('/admin/config/files', 'ConfigController@showfilesConfig')->middleware('perm:config_edit')->name('config.files');
|
Route::get('/admin/config/files', 'ConfigController@showfilesConfig')->middleware('perm:config_edit')->name('config.files');
|
||||||
Route::post('/admin/config/files', 'ConfigController@editfilesConfig')->middleware('perm:config_edit');
|
Route::post('/admin/config/files', 'ConfigController@editfilesConfig')->middleware('perm:config_edit');
|
||||||
|
|
||||||
/** Public page */
|
/** Public page */
|
||||||
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit');
|
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit_customization');
|
||||||
Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit');
|
Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit_customization');
|
||||||
|
|
||||||
/** Picture */
|
/** Picture */
|
||||||
Route::get('/admin/picture', 'PictureController@indexAdmin')->middleware('perm:picture_see')->name('picture');
|
Route::get('/admin/picture', 'PictureController@indexAdmin')->middleware('perm:picture_see')->name('picture');
|
||||||
|
|||||||
Reference in New Issue
Block a user