mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
Working schedule v2
This commit is contained in:
@@ -59,19 +59,27 @@ class Course extends Model
|
||||
|
||||
public function instructor()
|
||||
{
|
||||
if (\App\User::find($this->user_id))
|
||||
{
|
||||
if (\App\User::find($this->user_id)) {
|
||||
return \App\User::find($this->user_id)->fullname();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return $this->user_id;
|
||||
}
|
||||
}
|
||||
|
||||
public function ocom()
|
||||
{
|
||||
if ($this->ocom != null) {
|
||||
$ocom = \App\OCOM::findByOCOM($this->ocom);
|
||||
if ($ocom != null) {
|
||||
return $ocom;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo('App\Event');
|
||||
return $this->belongsTo('App\Event');
|
||||
}
|
||||
|
||||
public function logs()
|
||||
@@ -92,10 +100,8 @@ class Course extends Model
|
||||
public static function allFuture()
|
||||
{
|
||||
$courses = Course::all();
|
||||
foreach ($courses as $key => $course)
|
||||
{
|
||||
if (date('c',strtotime($course->event->date_begin)) <= date('c'))
|
||||
{
|
||||
foreach ($courses as $key => $course) {
|
||||
if (date('c', strtotime($course->event->date_begin)) <= date('c')) {
|
||||
$courses->forget($key);
|
||||
}
|
||||
}
|
||||
@@ -105,14 +111,11 @@ class Course extends Model
|
||||
public static function allThisYear()
|
||||
{
|
||||
$courses = Course::all();
|
||||
foreach ($courses as $key => $course)
|
||||
{
|
||||
if (date('c',strtotime($course->event->date_begin)) <= date('c',strtotime(\App\Config::getData('instruction_year_begin'))))
|
||||
{
|
||||
foreach ($courses as $key => $course) {
|
||||
if (date('c', strtotime($course->event->date_begin)) <= date('c', strtotime(\App\Config::getData('instruction_year_begin')))) {
|
||||
$courses->forget($key);
|
||||
}
|
||||
if (date('c',strtotime($course->event->date_begin)) >= date('c',strtotime(\App\Config::getData('instruction_year_end'))))
|
||||
{
|
||||
if (date('c', strtotime($course->event->date_begin)) >= date('c', strtotime(\App\Config::getData('instruction_year_end')))) {
|
||||
$courses->forget($key);
|
||||
}
|
||||
}
|
||||
@@ -122,10 +125,8 @@ class Course extends Model
|
||||
public static function allForUser($user_id)
|
||||
{
|
||||
$courses = Course::all();
|
||||
foreach ($courses as $key => $course)
|
||||
{
|
||||
if ($course->user_id != $user_id)
|
||||
{
|
||||
foreach ($courses as $key => $course) {
|
||||
if ($course->user_id != $user_id) {
|
||||
$courses->forget($key);
|
||||
}
|
||||
}
|
||||
@@ -140,14 +141,11 @@ class Course extends Model
|
||||
public static function allFutureForUser($user_id)
|
||||
{
|
||||
$courses = Course::all();
|
||||
foreach ($courses as $key => $course)
|
||||
{
|
||||
if (date('c',strtotime($course->event->date_begin)) <= date('c'))
|
||||
{
|
||||
foreach ($courses as $key => $course) {
|
||||
if (date('c', strtotime($course->event->date_begin)) <= date('c')) {
|
||||
$courses->forget($key);
|
||||
}
|
||||
if ($course->user_id != $user_id)
|
||||
{
|
||||
if ($course->user_id != $user_id) {
|
||||
$courses->forget($key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,11 @@ class Event extends Model
|
||||
return $this->hasMany('App\Course');
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
return \App\EventType::find($this->type);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
@@ -129,73 +134,13 @@ class Event extends Model
|
||||
return $events;
|
||||
}
|
||||
|
||||
public static function checkForError()
|
||||
public function nbPeriode()
|
||||
{
|
||||
$events = Event::all();
|
||||
return (count($this->schedule["periodes"]));
|
||||
}
|
||||
|
||||
$warning = [];
|
||||
$danger = [];
|
||||
|
||||
foreach ($events as $event)
|
||||
{
|
||||
if($event->date_begin == null)
|
||||
{
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "date_begin", Incorrect');
|
||||
}
|
||||
if($event->date_end == null)
|
||||
{
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "date_end", Incorrect');
|
||||
}
|
||||
if($event->type == null || $event->type == "" || !\App\EventType::all()->has($event->type))
|
||||
{
|
||||
$event->type = 1;
|
||||
//$event->save();
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "type", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "type", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->is_mandatory == null && $event->is_mandatory != 0)
|
||||
{
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "is_mandatory", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "is_mandatory", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->use_weekly_msg == null && $event->use_weekly_msg != 0)
|
||||
{
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "use_weekly_msg", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "use_weekly_msg", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->use_schedule == null && $event->use_schedule != 0)
|
||||
{
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "use_schedule", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "use_schedule", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->schedule == null)
|
||||
{
|
||||
$event->schedule = '{"periodes":[{"name":"Periode 1","begin_time":"19:00","end_time":"20:10"},{"name":"Periode 2","begin_time":"20:30","end_time":"21:20"}],"niveaux":[{"name":"Niveau 1"},{"name":"Niveau 2"},{"name":"Niveau 3"}]}';
|
||||
$event->save();
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "schedule", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "schedule", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->location == null || $event->location == "")
|
||||
{
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "location", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "location", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->calendar_color == null || $event->calendar_color == "")
|
||||
{
|
||||
$event->calendar_color = '#A4A4A4';
|
||||
$event->save();
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "calendar_color", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "calendar_color", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
if($event->calendar_icon == null || $event->calendar_icon == "")
|
||||
{
|
||||
$event->calendar_icon = 'fas fa-book';
|
||||
$event->save();
|
||||
array_push($warning,'Évènement ID:'.$event->id.' - "calendar_icon", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
clog('error','danger','Évènement ID:'.$event->id.' - "calendar_icon", Incorrect... Réinitialisé à la valeur par défaut');
|
||||
}
|
||||
}
|
||||
|
||||
return [$warning,$danger];
|
||||
public function nbNiveau()
|
||||
{
|
||||
return count($this->schedule["niveaux"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,13 @@ class CourseController extends Controller
|
||||
{
|
||||
$courses = Course::allFuture();
|
||||
}
|
||||
foreach ($courses as $course)
|
||||
{
|
||||
if($course->ocom() != null)
|
||||
{
|
||||
$course->ocom()->updateWasGiven();
|
||||
}
|
||||
}
|
||||
return view('admin.course.index',['courses' => $courses,'mode' => $mode]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Event;
|
||||
use App\EventType;
|
||||
use App\GoogleDriveFile;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -57,6 +58,8 @@ class EventController extends Controller
|
||||
{
|
||||
$event->weekly_msg_file = [''];
|
||||
}
|
||||
} else {
|
||||
$event->weekly_msg_file = [''];
|
||||
}
|
||||
|
||||
$event->name = request('name');
|
||||
@@ -77,11 +80,13 @@ class EventController extends Controller
|
||||
if(\request("use_weekly_msg"))
|
||||
{
|
||||
$event->use_weekly_msg = 1;
|
||||
$event->weekly_msg_publication_time = \request('date_msg');
|
||||
$event->msg = request('admin_desc');
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->use_weekly_msg = 0;
|
||||
$event->weekly_msg_publication_time = null;
|
||||
$event->msg = "";
|
||||
}
|
||||
|
||||
@@ -203,7 +208,7 @@ class EventController extends Controller
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('admin.schedule.event.edit',['activity' => \App\Event::find($id)]);
|
||||
return view('admin.schedule.event.edit',['event' => \App\Event::find($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,52 +220,101 @@ class EventController extends Controller
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$event = Event::find($id);
|
||||
$event = Event::findOrFail($id);
|
||||
|
||||
// if (\App\GoogleDriveFile::checkConfig())
|
||||
// {
|
||||
// if (\request()->hasFile('files'))
|
||||
// {
|
||||
// $dir = \App\GoogleDriveFile::findByPath('.Systeme/.Fichier/.MessageDeLaSemaine');
|
||||
// $files = [];
|
||||
// foreach (\request()->file('files') as $f)
|
||||
// {
|
||||
// $name = urlencode(pathinfo($f->getClientOriginalName())['filename'].'_'.uniqid().'.'.$f->getClientOriginalExtension());
|
||||
// \Storage::cloud()->putFileAs($dir->id,$f,$name);
|
||||
// array_push($files,$name);
|
||||
// }
|
||||
// $event->weekly_msg_file = $files;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $event->weekly_msg_file = [''];
|
||||
// }
|
||||
// } else {
|
||||
// $event->weekly_msg_file = [''];
|
||||
// }
|
||||
|
||||
$event->name = request('name');
|
||||
$event->date_begin = request('begin');
|
||||
$event->date_end = request('end');
|
||||
$event->date_begin = request('begin_time');
|
||||
$event->date_end = request('end_time');
|
||||
$event->user_id = \Auth::user()->id;
|
||||
$event->location = request('location');
|
||||
|
||||
if(request('is_mandatory') != null){
|
||||
$event->is_mandatory = 1;
|
||||
} else {
|
||||
$event->is_mandatory = 0;
|
||||
}
|
||||
$event->desc = request('desc');
|
||||
if(\request('msg'))
|
||||
|
||||
$event->desc = \request('admin_desc');
|
||||
|
||||
if(\request("use_weekly_msg"))
|
||||
{
|
||||
$event->msg = request('msg');
|
||||
$event->use_weekly_msg = 1;
|
||||
$event->weekly_msg_publication_time = \request('date_msg');
|
||||
$event->msg = request('admin_desc');
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->use_weekly_msg = 0;
|
||||
$event->weekly_msg_publication_time = null;
|
||||
$event->msg = "";
|
||||
}
|
||||
if(\request('date_msg'))
|
||||
|
||||
if(\request("use_schedule"))
|
||||
{
|
||||
$event->date_msg = request('date_msg');
|
||||
$event->use_schedule = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->date_msg = "";
|
||||
$event->use_schedule = 0;
|
||||
}
|
||||
|
||||
$event->calendar_color = \request('calendar_color');
|
||||
$event->calendar_icon = \request('calendar_icon');
|
||||
|
||||
$nbLevel = 1;
|
||||
$niveaux = [];
|
||||
while (\request('level_name_'.$nbLevel))
|
||||
{
|
||||
array_push($niveaux,['name' => \request('level_name_'.$nbLevel)]);
|
||||
$nbLevel++;
|
||||
}
|
||||
|
||||
$nbPeriode = 1;
|
||||
$periodes = [];
|
||||
while (\request('periode_name_'.$nbPeriode))
|
||||
{
|
||||
array_push($periodes,[
|
||||
'name' => \request('periode_name_'.$nbPeriode),
|
||||
'begin_time' => \request('periode_begin_time_'.$nbPeriode),
|
||||
'end_time' => \request('periode_end_time_'.$nbPeriode)
|
||||
]);
|
||||
$nbPeriode++;
|
||||
}
|
||||
$event->schedule = [
|
||||
'periodes' => $periodes,
|
||||
'niveaux' => $niveaux,
|
||||
'courses' => []
|
||||
];
|
||||
|
||||
$event->save();
|
||||
|
||||
if ($event->type == 1) {
|
||||
for ($l=1; $l <= \App\Config::getData('admin_level_in_schedule_nb'); $l++) {
|
||||
for ($p=1; $p <= \App\Config::getData('admin_periode_nb'); $p++) {
|
||||
if ($event->use_schedule) {
|
||||
for ($l=1; $l < $nbLevel; $l++) {
|
||||
for ($p=1; $p < $nbPeriode; $p++) {
|
||||
|
||||
$course = new \App\Course();
|
||||
|
||||
foreach ($event->courses as $c)
|
||||
{
|
||||
if ($c->periode == $p)
|
||||
{
|
||||
if ($c->level == $l)
|
||||
{
|
||||
$course = $c;
|
||||
}
|
||||
}
|
||||
}
|
||||
$course = $event->course($p,$l);
|
||||
|
||||
$users = \App\User::all();
|
||||
$instructor = request('instruc_n'.$l.'_p'.$p);
|
||||
@@ -272,22 +326,48 @@ class EventController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$course->name = request('name_n'.$l.'_p'.$p);
|
||||
$course->user_id = $instructor;
|
||||
$course->ocom = request('ocom_n'.$l.'_p'.$p);
|
||||
$course->location = request('loc_n'.$l.'_p'.$p);
|
||||
$course->location = request('location_n'.$l.'_p'.$p);
|
||||
$course->periode = $p;
|
||||
$course->level = $l;
|
||||
$course->comment_officer = "";
|
||||
$course->comment = "";
|
||||
|
||||
$course->event_id = $event->id;
|
||||
|
||||
if(\request("use_course_n".$l."_p".$p) == 'on')
|
||||
{
|
||||
$course->name = request('name_n'.$l.'_p'.$p);
|
||||
$course->ocom = request('ocom_n'.$l.'_p'.$p);
|
||||
$course->desc = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$course->name = "";
|
||||
$course->ocom = "";
|
||||
if (request('desc_n'.$l.'_p'.$p) == null)
|
||||
{
|
||||
$course->desc = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$course->desc = request('desc_n'.$l.'_p'.$p);
|
||||
}
|
||||
}
|
||||
$course->comment_officer = "";
|
||||
$course->comment = "";
|
||||
$course->save();
|
||||
|
||||
$ocom = \App\OCOM::where('ocom','=',request('ocom_n'.$l.'_p'.$p))->first();
|
||||
if ($ocom != null)
|
||||
{
|
||||
$foo = $ocom->courses();
|
||||
$foo->push($course);
|
||||
$ocom->saveCourses($foo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
clog('edit','success','a modifié un évènement',null,'App\Event',$event->id);
|
||||
return redirect('/admin/schedule')->with('success','Modification à l\'événement sauvegarder à l\'horaire');
|
||||
clog('add','success','a modifier un évènement',null,'App\Event',$event->id);
|
||||
return redirect('/admin/schedule')->with('success','Événement modifier à l\'horaire');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,4 +385,35 @@ class EventController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function toJson($id)
|
||||
{
|
||||
$event = Event::findOrFail($id);
|
||||
$model = $event->schedule;
|
||||
$default_value = [];
|
||||
foreach ($model['periodes'] as $periode_index => $periode)
|
||||
{
|
||||
$niveau_array = [];
|
||||
foreach ($model['niveaux'] as $niveau_index => $niveau)
|
||||
{
|
||||
$course = $event->course($periode_index+1,$niveau_index+1);
|
||||
$use_course = "on";
|
||||
if ($course->name == null) {
|
||||
$use_course = "off";
|
||||
}
|
||||
array_push($niveau_array,[
|
||||
'ocom' => $course->ocom,
|
||||
'name' => $course->name,
|
||||
'location' => $course->location,
|
||||
'instructor' => $course->instructor(),
|
||||
'desc' => $course->desc,
|
||||
'use_course' => $use_course
|
||||
]);
|
||||
}
|
||||
array_push($default_value,$niveau_array);
|
||||
}
|
||||
$model['default_value'] = $default_value;
|
||||
$event->schedule_model = $model;
|
||||
return $event->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ class OCOMController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
OCOM::wasUpdateGivenAll();
|
||||
return view('admin.ocom.index',['ocoms' => OCOM::all()]);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,53 +63,4 @@ class ScheduleEditorController extends Controller
|
||||
{
|
||||
return view('admin.schedule.editor.levelHeader',['level_id' => $id,'level_name' => 'Niveau '.$id]);
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$evenType = new \App\EventType();
|
||||
|
||||
$evenType->name = "Soirée d'instruction régulière";
|
||||
$evenType->admin_desc = "Veuillez modifier la description admin par défaut";
|
||||
$evenType->calendar_color = "orange";
|
||||
$evenType->calendar_icon = "fas fa-book";
|
||||
$evenType->begin_time = "12:00";
|
||||
$evenType->end_time = "18:00";
|
||||
$evenType->location = "Escadron";
|
||||
$evenType->is_mandatory = true;
|
||||
$evenType->use_weekly_msg = true;
|
||||
$evenType->weekly_msg_publication_time = "-5days";
|
||||
$evenType->use_schedule = true;
|
||||
$evenType->schedule_model = [
|
||||
"periodes" => [
|
||||
0 => [
|
||||
"name" => "Periode 1",
|
||||
"begin_time" => "19:00",
|
||||
"end_time" => "20:10"
|
||||
],
|
||||
1 => [
|
||||
"name" => "Pause",
|
||||
"begin_time" => "20:10",
|
||||
"end_time" => "20:30"
|
||||
],
|
||||
2 => [
|
||||
"name" => "Periode 2",
|
||||
"begin_time" => "20:30",
|
||||
"end_time" => "21:20"
|
||||
]
|
||||
],
|
||||
"niveaux" => [
|
||||
0 => [
|
||||
"name" => "Niveau 1"
|
||||
],
|
||||
1 => [
|
||||
"name" => "Niveau 2"
|
||||
],
|
||||
2 => [
|
||||
"name" => "Niveau 3"
|
||||
]
|
||||
]
|
||||
];
|
||||
$evenType->is_promoted = true;
|
||||
//$evenType->save();
|
||||
}
|
||||
}
|
||||
|
||||
40
app/OCOM.php
40
app/OCOM.php
@@ -3,6 +3,7 @@
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use function GuzzleHttp\Promise\all;
|
||||
|
||||
/**
|
||||
* App\OCOM
|
||||
@@ -72,40 +73,47 @@ class OCOM extends Model
|
||||
|
||||
public function wasGiven()
|
||||
{
|
||||
$courses = $this->courses();
|
||||
$courses = Course::where('ocom',$this->ocom)->get();
|
||||
$result = collect();
|
||||
|
||||
$from = strtotime(\App\Config::getData('instruction_year_begin'));
|
||||
$to = strtotime(\App\Config::getData('instruction_year_end'));
|
||||
|
||||
foreach ($courses as $course)
|
||||
{
|
||||
$event = null;
|
||||
try {
|
||||
$event = $course->event;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
// Nettoyer ?
|
||||
break;
|
||||
}
|
||||
$event = $course->event;
|
||||
if (strtotime($event->date_begin) >= $from)
|
||||
{
|
||||
if (strtotime($event->date_begin) <= $to)
|
||||
{
|
||||
$result->push($event);
|
||||
$result->push($course->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($result->isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updateWasGiven()
|
||||
{
|
||||
$this->course_id = implode(",",$this->wasGiven()->toArray());
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public static function wasUpdateGivenAll()
|
||||
{
|
||||
$ocoms = OCOM::all();
|
||||
foreach ($ocoms as $o)
|
||||
{
|
||||
$o->updateWasGiven();
|
||||
}
|
||||
}
|
||||
|
||||
public static function findByOCOM($ocom)
|
||||
{
|
||||
return OCOM::where('ocom','=',$ocom)->first();
|
||||
}
|
||||
|
||||
public function getDurationInMin()
|
||||
{
|
||||
return $this->nbPeriode * 30;
|
||||
}
|
||||
}
|
||||
|
||||
71
app/Providers/TelescopeServiceProvider.php
Normal file
71
app/Providers/TelescopeServiceProvider.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Telescope\IncomingEntry;
|
||||
use Laravel\Telescope\Telescope;
|
||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
||||
|
||||
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// Telescope::night();
|
||||
|
||||
$this->hideSensitiveRequestDetails();
|
||||
|
||||
Telescope::filter(function (IncomingEntry $entry) {
|
||||
if ($this->app->environment('local')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $entry->isReportableException() ||
|
||||
$entry->isFailedRequest() ||
|
||||
$entry->isFailedJob() ||
|
||||
$entry->isScheduledTask() ||
|
||||
$entry->hasMonitoredTag();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent sensitive request details from being logged by Telescope.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function hideSensitiveRequestDetails()
|
||||
{
|
||||
if ($this->app->environment('local')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Telescope::hideRequestParameters(['_token']);
|
||||
|
||||
Telescope::hideRequestHeaders([
|
||||
'cookie',
|
||||
'x-csrf-token',
|
||||
'x-xsrf-token',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Telescope gate.
|
||||
*
|
||||
* This gate determines who can access Telescope in non-local environments.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function gate()
|
||||
{
|
||||
Gate::define('viewTelescope', function ($user) {
|
||||
return in_array($user->email, [
|
||||
//
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
"laravel/framework": "^7.0",
|
||||
"laravel/helpers": "^1.1",
|
||||
"laravel/nexmo-notification-channel": "^2.2",
|
||||
"laravel/telescope": "^3.5",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "^2.0",
|
||||
"nao-pon/flysystem-google-drive": "^1.1",
|
||||
|
||||
175
composer.lock
generated
175
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "e2dc7086eb67a56fb816e262934a3a2a",
|
||||
"content-hash": "1039ad9d19c53cf0ed27db80f8923088",
|
||||
"packages": [
|
||||
{
|
||||
"name": "barryvdh/laravel-dompdf",
|
||||
@@ -2310,6 +2310,69 @@
|
||||
],
|
||||
"time": "2019-12-10T16:54:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/telescope",
|
||||
"version": "v3.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/telescope.git",
|
||||
"reference": "a8d2e1106ba655006fde47a0b7ed53851c6398f5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/telescope/zipball/a8d2e1106ba655006fde47a0b7ed53851c6398f5",
|
||||
"reference": "a8d2e1106ba655006fde47a0b7ed53851c6398f5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"laravel/framework": "^6.0|^7.0",
|
||||
"moontoast/math": "^1.1",
|
||||
"php": "^7.2",
|
||||
"symfony/var-dumper": "^4.4|^5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-gd": "*",
|
||||
"orchestra/testbench": "^4.0|^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.x-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Telescope\\TelescopeServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Telescope\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
},
|
||||
{
|
||||
"name": "Mohamed Said",
|
||||
"email": "mohamed@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "An elegant debug assistant for the Laravel framework.",
|
||||
"keywords": [
|
||||
"debugging",
|
||||
"laravel",
|
||||
"monitoring"
|
||||
],
|
||||
"time": "2020-07-28T19:12:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
"version": "v2.4.0",
|
||||
@@ -2822,6 +2885,57 @@
|
||||
],
|
||||
"time": "2020-05-22T08:12:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "moontoast/math",
|
||||
"version": "1.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ramsey/moontoast-math.git",
|
||||
"reference": "5f47d34c87767dbcc08b30377a9827df71de91fa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/5f47d34c87767dbcc08b30377a9827df71de91fa",
|
||||
"reference": "5f47d34c87767dbcc08b30377a9827df71de91fa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"phpseclib/bcmath_compat": ">=1.0.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "^0.9.0",
|
||||
"phpunit/phpunit": "^4.8 || ^5.5 || ^6.5 || ^7.0",
|
||||
"satooshi/php-coveralls": "^0.6.1",
|
||||
"squizlabs/php_codesniffer": "^2.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Moontoast\\Math\\": "src/Moontoast/Math",
|
||||
"Moontoast\\Math\\Exception\\": "src/Moontoast/Math/Exception"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ben Ramsey",
|
||||
"email": "ben@benramsey.com",
|
||||
"homepage": "https://benramsey.com"
|
||||
}
|
||||
],
|
||||
"description": "A mathematics library, providing functionality for large numbers",
|
||||
"homepage": "https://github.com/ramsey/moontoast-math",
|
||||
"keywords": [
|
||||
"bcmath",
|
||||
"math"
|
||||
],
|
||||
"abandoned": "brick/math",
|
||||
"time": "2020-01-05T04:49:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nao-pon/flysystem-cached-extra",
|
||||
"version": "1.0.3",
|
||||
@@ -3783,6 +3897,63 @@
|
||||
],
|
||||
"time": "2020-06-07T10:40:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/bcmath_compat",
|
||||
"version": "1.0.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/bcmath_compat.git",
|
||||
"reference": "89cbb63742a32730b7187773a60b6b12b9db4479"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/bcmath_compat/zipball/89cbb63742a32730b7187773a60b6b12b9db4479",
|
||||
"reference": "89cbb63742a32730b7187773a60b6b12b9db4479",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"phpseclib/phpseclib": ">=2.0.19"
|
||||
},
|
||||
"provide": {
|
||||
"ext-bcmath": "7.3.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gmp": "Will enable faster math operations"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/bcmath.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"bcmath_compat\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jim Wigginton",
|
||||
"email": "terrafrost@php.net",
|
||||
"homepage": "http://phpseclib.sourceforge.net"
|
||||
}
|
||||
],
|
||||
"description": "PHP 5.x/7.x polyfill for bcmath extension",
|
||||
"keywords": [
|
||||
"BigInteger",
|
||||
"bcmath",
|
||||
"bigdecimal",
|
||||
"math",
|
||||
"polyfill"
|
||||
],
|
||||
"time": "2020-04-26T16:34:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "2.0.27",
|
||||
@@ -9321,7 +9492,7 @@
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "^7.2"
|
||||
"php": "^7.4"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "1.1.0"
|
||||
|
||||
@@ -173,6 +173,7 @@ return [
|
||||
App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\TelescopeServiceProvider::class,
|
||||
App\Providers\GoogleDriveServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
163
config/telescope.php
Normal file
163
config/telescope.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
use Laravel\Telescope\Http\Middleware\Authorize;
|
||||
use Laravel\Telescope\Watchers;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the subdomain where Telescope will be accessible from. If the
|
||||
| setting is null, Telescope will reside under the same domain as the
|
||||
| application. Otherwise, this value will be used as the subdomain.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('TELESCOPE_DOMAIN', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the URI path where Telescope will be accessible from. Feel free
|
||||
| to change this path to anything you like. Note that the URI will not
|
||||
| affect the paths of its internal API that aren't exposed to users.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => env('TELESCOPE_PATH', 'telescope'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Storage Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration options determines the storage driver that will
|
||||
| be used to store Telescope's data. In addition, you may set any
|
||||
| custom options as needed by the particular driver you choose.
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('TELESCOPE_DRIVER', 'database'),
|
||||
|
||||
'storage' => [
|
||||
'database' => [
|
||||
'connection' => env('DB_CONNECTION', 'mysql'),
|
||||
'chunk' => 1000,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Master Switch
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option may be used to disable all Telescope watchers regardless
|
||||
| of their individual configuration, which simply provides a single
|
||||
| and convenient way to enable or disable Telescope data storage.
|
||||
|
|
||||
*/
|
||||
|
||||
'enabled' => env('TELESCOPE_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Route Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These middleware will be assigned to every Telescope route, giving you
|
||||
| the chance to add your own middleware to this list or change any of
|
||||
| the existing middleware. Or, you can simply stick with this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'web',
|
||||
Authorize::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignored Paths & Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the URI paths and Artisan commands that will
|
||||
| not be watched by Telescope. In addition to this list, some Laravel
|
||||
| commands, like migrations and queue commands, are always ignored.
|
||||
|
|
||||
*/
|
||||
|
||||
'ignore_paths' => [
|
||||
'nova-api*',
|
||||
],
|
||||
|
||||
'ignore_commands' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Watchers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the "watchers" that will be registered with
|
||||
| Telescope. The watchers gather the application's profile data when
|
||||
| a request or task is executed. Feel free to customize this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'watchers' => [
|
||||
Watchers\CacheWatcher::class => env('TELESCOPE_CACHE_WATCHER', true),
|
||||
|
||||
Watchers\CommandWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_COMMAND_WATCHER', true),
|
||||
'ignore' => [],
|
||||
],
|
||||
|
||||
Watchers\DumpWatcher::class => env('TELESCOPE_DUMP_WATCHER', true),
|
||||
|
||||
Watchers\EventWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_EVENT_WATCHER', true),
|
||||
'ignore' => [],
|
||||
],
|
||||
|
||||
Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true),
|
||||
Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
|
||||
Watchers\LogWatcher::class => env('TELESCOPE_LOG_WATCHER', true),
|
||||
Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true),
|
||||
|
||||
Watchers\ModelWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_MODEL_WATCHER', true),
|
||||
'events' => ['eloquent.*'],
|
||||
],
|
||||
|
||||
Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true),
|
||||
|
||||
Watchers\QueryWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
|
||||
'ignore_packages' => true,
|
||||
'slow' => 100,
|
||||
],
|
||||
|
||||
Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true),
|
||||
|
||||
Watchers\RequestWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_REQUEST_WATCHER', true),
|
||||
'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64),
|
||||
],
|
||||
|
||||
Watchers\GateWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_GATE_WATCHER', true),
|
||||
'ignore_abilities' => [],
|
||||
'ignore_packages' => true,
|
||||
],
|
||||
|
||||
Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true),
|
||||
|
||||
Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true),
|
||||
],
|
||||
];
|
||||
@@ -5,7 +5,7 @@ current:
|
||||
major: 3
|
||||
minor: 2
|
||||
patch: 5
|
||||
prerelease: 8-gc16d1e7e
|
||||
prerelease: 10-g8d22092e
|
||||
buildmetadata: ''
|
||||
commit: 41845
|
||||
timestamp:
|
||||
|
||||
@@ -30,6 +30,7 @@ class CreateEventsTable extends Migration
|
||||
$table->text('schedule');
|
||||
$table->string('calendar_color');
|
||||
$table->string('calendar_icon');
|
||||
$table->string('weekly_msg_publication_time')->default('-5day');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
25
public/css/custom.css
vendored
25
public/css/custom.css
vendored
@@ -1869,3 +1869,28 @@ tfoot > tr {
|
||||
.iconpicker-popover {
|
||||
z-index: 15 !important;
|
||||
}
|
||||
|
||||
.schedule-level-header {
|
||||
border-right: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.schedule-periode-container {
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.schedule-body>.row:nth-of-type(odd) {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.schedule-course-container {
|
||||
border-right: 1px solid #dddddd;
|
||||
margin-left: -2px;
|
||||
}
|
||||
|
||||
.schedule-container {
|
||||
min-width: 1500px;
|
||||
}
|
||||
|
||||
.overflow-auto {
|
||||
overflow: auto;
|
||||
}
|
||||
34
public/js/calendar.js
vendored
34
public/js/calendar.js
vendored
@@ -1,5 +1,13 @@
|
||||
function initFullCalendar(authToken) {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
let urlParam = new URLSearchParams(window.location.search);
|
||||
let initDate = urlParam.get("d");
|
||||
if (initDate == null) {
|
||||
initDate = moment().format("YYYY-MM-DD");
|
||||
urlParam.set("d",initDate.toString());
|
||||
}
|
||||
history.pushState({id: 'schedule'},'Horaire - C-CMS', '/admin/schedule?'+urlParam.toString());
|
||||
|
||||
var calendarEl = document.getElementById('fullCalendar');
|
||||
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
@@ -10,6 +18,7 @@ function initFullCalendar(authToken) {
|
||||
center: 'dayGridMonth,listWeek',
|
||||
right: 'prev,next'
|
||||
},
|
||||
defaultDate: initDate,
|
||||
events: '/api/schedule/events',
|
||||
eventRender: function(event, element) {
|
||||
if (event.event.extendedProps.icon && event.view.type == 'dayGridMonth')
|
||||
@@ -28,9 +37,16 @@ function initFullCalendar(authToken) {
|
||||
eventClick: function (info) {
|
||||
$.get("/api/schedule/events/modal/full/" + info.event.id + "/"+ info.event.extendedProps.extraParams.db_type + "?api_token="+authToken, function (data) {
|
||||
$("#modal-content").html(data);
|
||||
let urlParams = new URLSearchParams(window.location.search);
|
||||
urlParams.set("e",info.event.id);
|
||||
history.pushState({id: 'schedule'},'Horaire - C-CMS', '/admin/schedule?'+urlParams.toString());
|
||||
});
|
||||
$('#schedulemodal').modal('toggle')
|
||||
},
|
||||
datesRender(arg) {
|
||||
urlParam.set("d",moment(arg.view.currentStart).format("YYYY-MM-DD"));
|
||||
history.pushState({id: 'schedule'},'Horaire - C-CMS', '/admin/schedule?'+urlParam.toString());
|
||||
},
|
||||
dateClick: function (info) {
|
||||
var date = moment(info.date).format("YYYY-MM-DD");
|
||||
Swal.fire({
|
||||
@@ -47,12 +63,28 @@ function initFullCalendar(authToken) {
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
if (urlParam.get('e') != null) {
|
||||
$.get("/api/schedule/events/modal/full/" + urlParam.get('e')+ "/event?api_token="+authToken, function (data) {
|
||||
$("#modal-content").html(data);
|
||||
$('#schedulemodal').modal('toggle')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function closeScheduleModal() {
|
||||
let urlParams = new URLSearchParams(window.location.search);
|
||||
urlParams.delete("e");
|
||||
if (urlParams.entries().next().done) {
|
||||
history.pushState({id: 'schedule'},'Horaire - C-CMS', '/admin/schedule');
|
||||
} else {
|
||||
history.pushState({id: 'schedule'},'Horaire - C-CMS', '/admin/schedule?'+urlParams.toString());
|
||||
}
|
||||
$('#schedulemodal').modal('toggle');
|
||||
}
|
||||
|
||||
function switchType(date) {
|
||||
|
||||
var selectInput = $('#type')
|
||||
|
||||
152
public/js/plugins/schedule/editorv2.js
vendored
152
public/js/plugins/schedule/editorv2.js
vendored
@@ -8,16 +8,30 @@ function initEditor(event_id = 1, mode = 'schedule')
|
||||
let editor = $('#editor');
|
||||
editorMode = mode;
|
||||
eventType = null;
|
||||
let eventTypePromise = $.ajax({
|
||||
type: 'GET',
|
||||
url: '/api/eventType/'+event_id+'?api_token='+api_token,
|
||||
success: function (template) {
|
||||
eventType = template;
|
||||
},
|
||||
error: function () {
|
||||
showNotification('error','Impossible d\'initialiser l\'éditeur d\'horaire ...','top', 'center')
|
||||
}
|
||||
});
|
||||
let eventTypePromise = null;
|
||||
if (mode == "schedule-edit") {
|
||||
eventTypePromise = $.ajax({
|
||||
type: 'GET',
|
||||
url: '/api/event/'+event_id+'?api_token='+api_token,
|
||||
success: function (template) {
|
||||
eventType = template;
|
||||
},
|
||||
error: function () {
|
||||
showNotification('error','Impossible d\'initialiser l\'éditeur d\'horaire ...','top', 'center')
|
||||
}
|
||||
});
|
||||
} else {
|
||||
eventTypePromise = $.ajax({
|
||||
type: 'GET',
|
||||
url: '/api/eventType/'+event_id+'?api_token='+api_token,
|
||||
success: function (template) {
|
||||
eventType = template;
|
||||
},
|
||||
error: function () {
|
||||
showNotification('error','Impossible d\'initialiser l\'éditeur d\'horaire ...','top', 'center')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$.when(eventTypePromise).done(function () {
|
||||
console.log(eventType);
|
||||
@@ -45,7 +59,7 @@ function initEditor(event_id = 1, mode = 'schedule')
|
||||
['fullscreen']
|
||||
]
|
||||
});
|
||||
if (mode == 'eventType' || mode == 'schedule-add')
|
||||
if (mode == 'eventType' || mode == 'schedule-add' || mode == "schedule-edit")
|
||||
{
|
||||
let scheduleModel = eventType['schedule_model'];
|
||||
if (scheduleModel['default_value'])
|
||||
@@ -566,6 +580,116 @@ function loadEventType(date,id = 1)
|
||||
})
|
||||
}
|
||||
|
||||
function loadEvent(date,id)
|
||||
{
|
||||
initEditor(id,'schedule-edit').done(function () {
|
||||
|
||||
if (eventType['is_mandatory'] == 1)
|
||||
{
|
||||
$('#is_mandatory').prop('checked',true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#is_mandatory').removeAttr('checked');
|
||||
}
|
||||
|
||||
if (eventType['use_schedule'] == 1)
|
||||
{
|
||||
$('#use_schedule').prop('checked',true);
|
||||
switchUseSchedule();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#use_schedule').removeAttr('checked');
|
||||
switchUseSchedule();
|
||||
}
|
||||
|
||||
if (eventType['use_weekly_msg'] == 1)
|
||||
{
|
||||
$('#use_weekly_msg').prop('checked',true);
|
||||
switchUseWeeklyMsg();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#use_weekly_msg').removeAttr('checked');
|
||||
switchUseWeeklyMsg();
|
||||
}
|
||||
let begin_time = $('#begin_time');
|
||||
begin_time.datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(moment(eventType['date_begin'],"MM/DD/YYYY HH:mm A"))
|
||||
});
|
||||
let end_time = $('#end_time');
|
||||
end_time.datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(moment(eventType['date_end'],"MM/DD/YYYY HH:mm A"))
|
||||
});
|
||||
let weekly_msg_publication_time = $('#weekly_msg_publication_time');
|
||||
if (eventType['use_schedule'])
|
||||
{
|
||||
weekly_msg_publication_time.datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(moment(eventType['weekly_msg_publication_time'],"MM/DD/YYYY HH:mm A"))
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
weekly_msg_publication_time.datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(moment(eventType['date_begin'],"MM/DD/YYYY HH:mm A").subtract(1,'days'))
|
||||
});
|
||||
}
|
||||
$('#location').val(eventType['location']);
|
||||
$('#name').val(eventType['name']);
|
||||
$('#admin_desc').trumbowyg('html', eventType['desc']);
|
||||
$('#calendar_color').val(eventType['calendar_color']);
|
||||
pickr.setColor(eventType['calendar_color']);
|
||||
$('#calendar_icon').val(eventType['calendar_icon']);
|
||||
$('#calendar_icon_display').removeAttr('class');
|
||||
$('#calendar_icon_display').addClass(eventType['calendar_icon']);
|
||||
})
|
||||
}
|
||||
|
||||
function switchUseSchedule()
|
||||
{
|
||||
if($('#use_schedule').is(":checked"))
|
||||
@@ -591,3 +715,9 @@ function switchUseWeeklyMsg()
|
||||
$('#collmessagedelasemaine').addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
function removeFile(file) {
|
||||
document.getElementById("removedfile").setAttribute("value",document.getElementById("removedfile").getAttribute("value")+"|"+file);
|
||||
document.getElementById(file).remove();
|
||||
console.log(file);
|
||||
}
|
||||
25
resources/custom.css
vendored
25
resources/custom.css
vendored
@@ -1869,3 +1869,28 @@ tfoot > tr {
|
||||
.iconpicker-popover {
|
||||
z-index: 15 !important;
|
||||
}
|
||||
|
||||
.schedule-level-header {
|
||||
border-right: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.schedule-periode-container {
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.schedule-body>.row:nth-of-type(odd) {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.schedule-course-container {
|
||||
border-right: 1px solid #dddddd;
|
||||
margin-left: -2px;
|
||||
}
|
||||
|
||||
.schedule-container {
|
||||
min-width: 1500px;
|
||||
}
|
||||
|
||||
.overflow-auto {
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -20,7 +20,13 @@
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<label>OCOM</label>
|
||||
<p>{{$course->ocom}}</p>
|
||||
<p>
|
||||
@if(\App\OCOM::findByOCOM($course->ocom) != null)
|
||||
<a href="/admin/ocom/{{\App\OCOM::findByOCOM($course->ocom)->id}}">{{$course->ocom}}</a>
|
||||
@else
|
||||
{{$course->ocom}}
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Date</label>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
@foreach($ocoms as $ocom)
|
||||
<tr class="cursor">
|
||||
<td class="text-center" onclick="navigate({{$ocom->id}})">
|
||||
@if($ocom->wasGiven() != false)
|
||||
@if($ocom->course_id != "")
|
||||
<div data-toggle="tooltip" data-placement="right" title="Le cours a été donné cette année">
|
||||
<p class="d-none">1</p>
|
||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-1 text-center align-middle p-3">
|
||||
@if($ocom->wasGiven() != false)
|
||||
@if($ocom->course_id != "")
|
||||
<div data-toggle="tooltip" data-placement="right" title="Le cours a été donné cette année">
|
||||
<p class="d-none">1</p>
|
||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
||||
@@ -64,7 +64,7 @@
|
||||
<tbody>
|
||||
@foreach($ocom->courses() as $course)
|
||||
<tr>
|
||||
<th>{{$course->id}}</th>
|
||||
<th> <a href="/admin/course/{{$course->id}}">{{$course->id}}</a> </th>
|
||||
<td>{{$course->event->date_begin}}</td>
|
||||
<td>{{$course->instructor()}}</td>
|
||||
<td>{{$course->level}}</td>
|
||||
|
||||
@@ -1,239 +1,274 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="card ">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4 class="card-title">Ajouter un événement à l'horaire</h4>
|
||||
</div>
|
||||
<div class="card-body ">
|
||||
<form action="/admin/schedule/event/edit/{{$activity->id}}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="type">Type d'événement</label>
|
||||
<select class="form-control selectpicker" data-style="btn btn-link" name="type" id="type" disabled required>
|
||||
@foreach (\App\ComplementaryActivity::all() as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<form action="/admin/schedule/event/edit/{{$event->id}}" method="POST" enctype="multipart/form-data">
|
||||
<div class="row">
|
||||
@csrf
|
||||
<div class="col-9">
|
||||
<div class="card ">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4 class="card-title">Modifier un événement à l'horaire</h4>
|
||||
</div>
|
||||
<div class="row" id="container">
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Information Générale</h4>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom de l'événement</label>
|
||||
<input type="text" name="name" id="name" class="form-control" placeholder="" aria-describedby="nameHelp" value="{{$activity->name}}" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de début</label>
|
||||
<input name="begin" type="text" id="datetimepickerbegin" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de fin</label>
|
||||
<input name="end" type="text" id="datetimepickerend" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="name">Lieux</label>
|
||||
<input type="text" name="location" id="location" class="form-control" placeholder="" aria-describedby="nameHelp" value="{{$activity->location}}" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le lieu de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 my-auto text-center">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" name="is_mandatory" type="checkbox" value="1"
|
||||
@if ($activity->is_mandatory == 1)
|
||||
checked
|
||||
@endif>
|
||||
L'événement est t-il obligatoire pour tous les cadets ?
|
||||
<span class="form-check-sign">
|
||||
<span class="check"></span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Options Supplémentaires</h4>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4">
|
||||
<ul class="nav nav-pills mb-3 justify-content-center" id="pills-tab" role="tablist">
|
||||
<li class="nav-item w-25">
|
||||
<a class="nav-link active w-100" id="pills-home-tab" data-toggle="pill" href="#comment" role="tab" aria-controls="pills-home" aria-selected="true">Description</a>
|
||||
</li>
|
||||
<li class="nav-item w-25">
|
||||
<a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#msg" role="tab" aria-controls="pills-profile" aria-selected="false">Message de la semaine</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="comment" role="tabpanel" aria-labelledby="pills-home-tab">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control richeditor" name="desc" id="desc" rows="6" required>{{$activity->desc}}</textarea>
|
||||
<div class="card-body ">
|
||||
<div class="row" id="container">
|
||||
<div id="accordion" class="col-12" role="tablist">
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="headingOne">
|
||||
<h5 class="mb-0">
|
||||
<a data-toggle="collapse" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
||||
<b>Information générale</b>
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="msg" role="tabpanel" aria-labelledby="pills-profile-tab">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et heure de publication des messages de la semaine</label>
|
||||
<input name="date_msg" type="text" id="datetimepickermsg" class="form-control datetimepicker"/>
|
||||
<div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom de l'événement</label>
|
||||
<input type="text" name="name" id="name" class="form-control" placeholder="" aria-describedby="nameHelp" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control richeditor" name="msg" id="msg" rows="6">{{$activity->msg}}</textarea>
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de début</label>
|
||||
<input name="begin_time" type="text" id="begin_time" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($activity->type == 1)
|
||||
<div class="col-md-12 mt-4 text-center">
|
||||
<h4>Horaire d'instruction</h4>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="accordion" role="tablist">
|
||||
@for ($i = 1; $i <= \App\Config::getData('admin_level_in_schedule_nb'); $i++)
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="heading{{$i}}">
|
||||
<h5 class="mb-0">
|
||||
<a data-toggle="collapse" href="#collapse{{$i}}" aria-expanded="true" aria-controls="collapse{{$i}}">
|
||||
Horaire Niveau {{$i}}
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
<div class="col-lg-3 col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et Heure de fin</label>
|
||||
<input name="end_time" type="text" id="end_time" class="form-control datetimepicker" required/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="collapse{{$i}}" class="collapse" role="tabpanel" aria-labelledby="heading{{$i}}" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
@for ($p = 1; $p <= \App\Config::getData('admin_periode_nb'); $p++)
|
||||
<h4 class="mt-3" >Période {{$p}}</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom du cours</label>
|
||||
<input type="text" name="name_n{{$i}}_p{{$p}}" id="name_n{{$i}}_p{{$p}}" class="form-control" aria-describedby="nameHelp" required @if($activity->course($p,$i) != null) value="{{$activity->course($p,$i)->name}}" @endif>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom du cours</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label for="name">Instructeur</label>
|
||||
<div class="autocomplete">
|
||||
<input type="text" name="instruc_n{{$i}}_p{{$p}}" id="instruc_n{{$i}}_p{{$p}}" class="form-control AutoComplete" aria-describedby="nameHelp" autocomplete="off" required @if($activity->course($p,$i) != null) value="@if(is_numeric($activity->course($p,$i)->user_id)){{\App\User::find($activity->course($p,$i)->user_id)->fullname()}} @else {{$activity->course($p,$i)->user_id}} @endif" @endif>
|
||||
</div>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le nom de l'instructeur</small>
|
||||
<div class="col-lg-6 col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="name">Lieux</label>
|
||||
<input type="text" name="location" id="location" class="form-control" placeholder="" aria-describedby="nameHelp" required>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le lieu de l'événement</small>
|
||||
</div>
|
||||
</div>
|
||||
<div id="collmessagedelasemaine" class="col-12 d-none">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="label-control">Date et heure de publication des messages de la semaine</label>
|
||||
<input name="date_msg" type="text" id="weekly_msg_publication_time" class="form-control datetimepicker"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-outline-primary btn-block" disabled type="button" data-toggle="collapse" data-target="#collapseFiles" aria-expanded="false" aria-controls="collapseExample">
|
||||
Joindre des fichiers avec les messages de la semaine
|
||||
</button>
|
||||
<div class="collapse" id="collapseFiles">
|
||||
<ul class="list-group">
|
||||
@foreach($event->weekly_msg_file as $file)
|
||||
<li id="{{$file}}" class="list-group-item">{{ $file }} <a class="btn btn-primary btn-fab btn-fab-mini btn-round float-right text-white" onclick="removeFile('{{$file}}')"><i class="material-icons">delete</i> </a></li>
|
||||
@endforeach
|
||||
<input class="d-none" type="text" name="removedfile" id="removedfile" value="">
|
||||
</ul>
|
||||
<hr>
|
||||
<div class="form-group bmd-form-group is-filled">
|
||||
<label class="label-control bmd-label-static">Ajouter des fichiers</label>
|
||||
<div class="fileinput fileinput-new input-group" data-provides="fileinput" style="display: flex !important;">
|
||||
<div class="form-control" data-trigger="fileinput">
|
||||
<span class="fileinput-filename"></span>
|
||||
</div>
|
||||
<span class="input-group-append">
|
||||
<span class="input-group-text fileinput-exists cursor" data-dismiss="fileinput">Remove</span>
|
||||
<span class="input-group-text btn-file">
|
||||
<span class="fileinput-new cursor">Select file</span>
|
||||
<span class="fileinput-exists cursor">Change</span>
|
||||
<input type="file" name="files[]" multiple>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="form-group">
|
||||
<label for="name">OCOM</label>
|
||||
<input type="text" name="ocom_n{{$i}}_p{{$p}}" id="ocom_n{{$i}}_p{{$p}}" class="form-control" aria-describedby="nameHelp" required @if($activity->course($p,$i) != null) value="{{$activity->course($p,$i)->ocom}}" @endif>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer l'OCOM</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="form-group">
|
||||
<label for="name">Lieux</label>
|
||||
<input type="text" name="loc_n{{$i}}_p{{$p}}" id="loc_n{{$i}}_p{{$p}}" class="form-control" placeholder="" aria-describedby="nameHelp" required @if($activity->course($p,$i) != null) value="{{$activity->course($p,$i)->location}}" @endif>
|
||||
<small id="nameHelp" class="text-muted">Veuillez entrer le lieux</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Réservation de materiel (Disponible une fois l'événement sauvegarder)</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@endfor
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-4">
|
||||
<label class="mb-0" for="desc">Description</label>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control richeditor" name="admin_desc" id="admin_desc" rows="6" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endfor
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-collapse d-none" id="collschedule">
|
||||
<div class="card-header" role="tab" id="headingThree">
|
||||
<h5 class="mb-0">
|
||||
<a class="collapsed" data-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
|
||||
<b>Horaire</b>
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapseThree" class="collapse" role="tabpanel" aria-labelledby="headingThree" data-parent="#accordion">
|
||||
<div class="card-body" style="overflow: scroll">
|
||||
<div id="editor" class="m-3" style="width: 110vw">
|
||||
@loaderDot
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-5">Sauvegarder</button>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-5">Sauvegarder</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="card ">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4 class="card-title">Options</h4>
|
||||
</div>
|
||||
<div class="card-body ">
|
||||
<div class="form-group">
|
||||
<label for="type">Type d'événement</label>
|
||||
<small class="text-muted d-block">Choisir le type d'activité supprimera vos modification actuel</small>
|
||||
<select disabled class="form-control selectpicker" data-style="btn btn-link" name="type" id="type" required>
|
||||
@foreach (\App\EventType::all() as $item)
|
||||
<option value="{{$item->id}}">{{$item->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="m-0" for="type">Activité obligatoire</label>
|
||||
<small class="text-muted d-block">L'activité est-elle obligatoire pour tout les cadets ?</small>
|
||||
<div class="togglebutton">
|
||||
<label>
|
||||
<input id="is_mandatory" name="is_mandatory" type="checkbox">
|
||||
<span class="toggle"></span>
|
||||
L'activité est obligatoire
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="m-0" for="type">Message de la semaine</label>
|
||||
<small class="text-muted d-block">Inclure des messages de la semaine avec l'activité ?</small>
|
||||
<div class="togglebutton">
|
||||
<label>
|
||||
<input id="use_weekly_msg" type="checkbox" name="use_weekly_msg" onchange="switchUseWeeklyMsg()">
|
||||
<span class="toggle"></span>
|
||||
Avec message de la semaine
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="m-0" for="type">Horaire</label>
|
||||
<small class="text-muted d-block">Inclure un horaire avec l'activité ?</small>
|
||||
<div class="togglebutton">
|
||||
<label>
|
||||
<input type="checkbox" id="use_schedule" name="use_schedule" checked onchange="switchUseSchedule()">
|
||||
<span class="toggle"></span>
|
||||
Avec horaire
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="accordion-apparence" role="tablist">
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="heading-apparence">
|
||||
<h5 class="mb-0">
|
||||
<a data-toggle="collapse" href="#col-apparence" aria-expanded="false" aria-controls="col-apparence">
|
||||
Apparence
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="col-apparence" class="collapse" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion-apparence">
|
||||
<div class="card-body">
|
||||
<div class="form-group iconpicker-container">
|
||||
<label for="type">Icone</label>
|
||||
<small class="text-muted d-block">Icone de l'activité</small>
|
||||
<div class="input-group iconpicker-container">
|
||||
<input id="calendar_icon" name="calendar_icon" data-placement="bottomRight" class="form-control icp icp-auto iconpicker-element iconpicker-input" value="fas fa-archive" type="text">
|
||||
<span class="input-group-addon"><i id="calendar_icon_display" class="fas fa-assistive-listening-systems"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="type">Couleur</label>
|
||||
<small class="text-muted d-block">Couleur de l'activité</small>
|
||||
<div class="input-group iconpicker-container">
|
||||
<input class="form-control" type="text" name="calendar_color" id="calendar_color" value="#2196F3" onclick="pickr.show()">
|
||||
<span class="color-picker"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.min.js"></script>
|
||||
<script src="/js/plugins/fontawesome-icon-picker/fontawesome-iconpicker.js"></script>
|
||||
<script>
|
||||
$('.icp-auto').iconpicker({ placement: 'left',animation: 'false'});
|
||||
const pickr = Pickr.create({
|
||||
el: '.color-picker',
|
||||
theme: 'monolith', // or 'monolith', or 'nano'
|
||||
|
||||
swatches: [
|
||||
'rgba(244, 67, 54, 1)',
|
||||
'rgba(233, 30, 99, 1)',
|
||||
'rgba(156, 39, 176, 1)',
|
||||
'rgba(103, 58, 183, 1)',
|
||||
'rgba(63, 81, 181, 1)',
|
||||
'rgba(33, 150, 243, 1)',
|
||||
'rgba(3, 169, 244, 1)',
|
||||
'rgba(0, 188, 212, 1)',
|
||||
'rgba(0, 150, 136, 1)',
|
||||
'rgba(76, 175, 80, 1)',
|
||||
'rgba(139, 195, 74, 1)',
|
||||
'rgba(205, 220, 57, 1)',
|
||||
'rgba(255, 235, 59, 1)',
|
||||
'rgba(255, 193, 7, 1)'
|
||||
],
|
||||
comparison: false,
|
||||
default: '#2196F3',
|
||||
components: {
|
||||
|
||||
// Main components
|
||||
preview: true,
|
||||
opacity: false,
|
||||
hue: true,
|
||||
|
||||
// Input / output Options
|
||||
interaction: {
|
||||
hex: true,
|
||||
rgba: false,
|
||||
hsla: false,
|
||||
hsva: false,
|
||||
cmyk: false,
|
||||
input: true,
|
||||
clear: false,
|
||||
save: false
|
||||
}
|
||||
}
|
||||
});
|
||||
pickr.on('change', (color,instance) => {
|
||||
$('#calendar_color').val(color.toHEXA().toString());
|
||||
});
|
||||
</script>
|
||||
<script src="/js/calendar.js"></script>
|
||||
<script src="/js/plugins/schedule/editorv2.js"></script>
|
||||
<script src="/js/plugins/autocomplete.js"></script>
|
||||
<script>
|
||||
var countries = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua & Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia & Herzegovina","Botswana","Brazil","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central Arfrican Republic","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica","Cote D Ivoire","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","Guinea Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauro","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","North Korea","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russia","Rwanda","Saint Pierre & Miquelon","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","South Sudan","Spain","Sri Lanka","St Kitts & Nevis","St Lucia","St Vincent","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor L'Este","Togo","Tonga","Trinidad & Tobago","Tunisia","Turkey","Turkmenistan","Turks & Caicos","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States of America","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Virgin Islands (US)","Yemen","Zambia","Zimbabwe"];
|
||||
var begin = "<?php echo $activity->date_begin ?>";
|
||||
var end = "<?php echo $activity->date_end ?>";
|
||||
var msg = "<?php echo $activity->date_msg ?>";
|
||||
$('#datetimepickerbegin').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(begin)
|
||||
});
|
||||
$('#datetimepickerend').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(end)
|
||||
});
|
||||
$('#datetimepickermsg').datetimepicker({
|
||||
icons: {
|
||||
time: "fa fa-clock-o",
|
||||
date: "fa fa-calendar",
|
||||
up: "fa fa-chevron-up",
|
||||
down: "fa fa-chevron-down",
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
},
|
||||
date: new Date(msg)
|
||||
});
|
||||
$('.richeditor').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
initAutoComplete("AutoComplete");
|
||||
$(function () {
|
||||
console.log('Document READY loading schedule editor');
|
||||
loadEvent('{{$event->date_begin}}',{{$event->id}});
|
||||
})
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
Du <strong>{{$event->date_begin}}</strong> au <strong>{{$event->date_end}}</strong><br>
|
||||
<small>{{$event->location}} </small>
|
||||
Du <strong>{{$event->date_begin}}</strong> au <strong>{{$event->date_end}}</strong><br>
|
||||
<small>{{$event->location}} </small>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
@if ($event->is_mandatory)
|
||||
@@ -13,95 +13,87 @@
|
||||
@else
|
||||
<span class="badge badge-pill badge-info">Optionnel</span>
|
||||
@endif
|
||||
@if (is_int($event->type))
|
||||
<span class="badge badge-pill badge-default">{{$event->type}}</span>
|
||||
@else
|
||||
<span class="badge badge-pill" style="background-color: {{\App\ComplementaryActivity::find($event->type)->calendar_color}}">{{\App\ComplementaryActivity::find($event->type)->name}}</span>
|
||||
@if($event->type() != null)
|
||||
<span class="badge badge-pill" style="background-color: {{$event->type()->calendar_color}}">{{$event->type()->name}}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12">
|
||||
{!!$event->desc!!}
|
||||
</div>
|
||||
</div>
|
||||
@if (!$event->courses->isEmpty())
|
||||
@if ($event->use_schedule)
|
||||
<hr>
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12">
|
||||
<h4 class="title text-center">Horaire</h4>
|
||||
<div class="row d-none d-md-flex">
|
||||
<div class="col-md-2 m-3"></div>
|
||||
@for ($p = 1; $p <= \App\Config::getData('admin_periode_nb'); $p++)
|
||||
<div class="col-md m-3">
|
||||
Période {{$p}} <small>{{\App\Config::all()->where('name','admin_periode_begin')->first()->data[$p]}} à {{\App\Config::all()->where('name','admin_periode_end')->first()->data[$p]}} </small>
|
||||
<h4 class="text-center thead-dark m-0 p-2"><b>Horaire</b></h4>
|
||||
<div class="overflow-auto">
|
||||
<div class="schedule-container">
|
||||
<div class="row d-none d-md-flex thead-dark">
|
||||
<div class="col-md-2"></div>
|
||||
@foreach ($event->schedule["periodes"] as $periode)
|
||||
<div class="col-md">
|
||||
<h4>{{$periode["name"]}}</h4> <small>{{ $periode["begin_time"] }}
|
||||
à {{ $periode["end_time"] }} </small>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endfor
|
||||
</div>
|
||||
@for ($l = 1; $l <= \App\Config::getData('admin_level_in_schedule_nb'); $l++)
|
||||
<div class="row">
|
||||
<div class="col-md-2 m-3">
|
||||
Niveau {{$l}}
|
||||
</div>
|
||||
@for ($p = 1; $p <= \App\Config::getData('admin_periode_nb'); $p++)
|
||||
<div class="col-md m-3">
|
||||
@foreach ($event->courses as $course)
|
||||
@if ($course->periode == $p && $course->level == $l)
|
||||
<div class="row">
|
||||
<div class="col-sm-6 my-2">
|
||||
{{$course->name}}
|
||||
</div>
|
||||
<div class="col-sm-6 my-2 text-sm-right">
|
||||
@if(\App\User::find($course->user_id))
|
||||
{{\App\User::find($course->user_id)->fullname()}}
|
||||
@else
|
||||
{{$course->user_id}}
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-6 my-2">
|
||||
{{$course->ocom}}
|
||||
</div>
|
||||
<div class="col-sm-6 my-2 text-sm-right">
|
||||
{{$course->location}}
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<a class="btn btn-primary btn-sm btn-block" data-toggle="collapse" href="#collapse{{$l.$p}}" aria-expanded="false" aria-controls="collapse{{$l.$p}}">Réservation de materiel</a>
|
||||
<div class="collapse" id="collapse{{$l.$p}}">
|
||||
<div class="m-3">
|
||||
@if (!$course->bookings->isEmpty())
|
||||
<div class="row">
|
||||
<div class="col-sm-8 p-2">
|
||||
<strong>Item</strong>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right p-2">
|
||||
<strong>Quantité</strong>
|
||||
</div>
|
||||
<hr>
|
||||
@foreach ($course->bookings as $booking)
|
||||
<div class="col-sm-8 p-2">
|
||||
<a href="/admin/item/{{$booking->item->id}}">{{$booking->item->name}}</a>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right p-2">
|
||||
{{$booking->amount}}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<p class="text-center">
|
||||
<strong>Aucune réservation</strong>
|
||||
</p>
|
||||
@endif
|
||||
<hr>
|
||||
<a class="btn btn-primary btn-sm btn-block mt-2" href="/admin/booking/course/{{$course->id}}" role="button">Modifier les réservation</a>
|
||||
<div class="schedule-body">
|
||||
@foreach($event->schedule["niveaux"] as $niveauIndex => $niveau)
|
||||
<div class="row">
|
||||
<div class="col-md-2 schedule-level-header px-3 pb-3">
|
||||
<h4 class="title pl-3">{{ $niveau["name"] }}</h4>
|
||||
</div>
|
||||
@foreach ($event->schedule["periodes"] as $periodeIndex => $periode)
|
||||
@php
|
||||
$course = $event->course($periodeIndex+1,$niveauIndex+1);
|
||||
@endphp
|
||||
<div class="col-md px-3 pb-3 schedule-course-container">
|
||||
<div class="row">
|
||||
<div class="col-12 p-1 bg-dark">
|
||||
<div class="row">
|
||||
<div class="col-5 m-auto">
|
||||
<a class="text-white pl-3" href="/admin/course/{{$course->id}}">
|
||||
<b>Cours #{{$course->id}}</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-5 m-auto text-white">
|
||||
@if(\App\OCOM::findByOCOM($course->ocom) != null) {{\App\OCOM::findByOCOM($course->ocom)->getDurationInMin()}} min @endif
|
||||
</div>
|
||||
<div class="col m-auto text-right">
|
||||
@if($course->lessonPlan)
|
||||
@if($course->lessonPlan->approved == 1)
|
||||
<i class="fas fa-check-circle text-success fa-2x" data-toggle="tooltip" data-placement="top" title="Plan de cours remis et vérifié"></i>
|
||||
@else
|
||||
<i class="fas fa-exclamation-circle text-warning fa-2x" data-toggle="tooltip" data-placement="top" title="Plan de cours remis mais non vérifié"></i>
|
||||
@endif
|
||||
@else
|
||||
<i class="fas fa-times-circle text-danger fa-2x" data-toggle="tooltip" data-placement="top" title="Plan de cours non remis"></i>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($course->desc != null)
|
||||
<div class="col-12 pb-4 pt-3">{{ $course->desc }}</div>
|
||||
@else
|
||||
<div class="col-12 pb-4 pt-3">
|
||||
<a class="text-dark" @if(\App\OCOM::findByOCOM($course->ocom) != null) href="/admin/ocom/{{\App\OCOM::findByOCOM($course->ocom)->id}}" @endif>
|
||||
<b>{{ $course->ocom }}</b> - {{ $course->name }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-6">{{ $course->instructor() }}</div>
|
||||
<div class="col-6">{{ $course->location }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endfor
|
||||
@endforeach
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endfor
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">{{$event->name}}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<button type="button" class="close" onclick="closeScheduleModal()" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="col-sm-4 m-0 text-right">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="closeScheduleModal()">Fermer</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,6 +38,9 @@ Route::middleware('auth:api')->group(function () {
|
||||
Route::get('/eventType/{id}','EventTypeController@toJson');
|
||||
Route::delete('/eventType/{id}','EventTypeController@destroy');
|
||||
|
||||
/** Event */
|
||||
Route::get('/event/{id}','EventController@toJson');
|
||||
|
||||
/** Message Route */
|
||||
Route::post('/message/delete', 'MessageController@destroy')->middleware('perm:msg_delete');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user