mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-05-15 04:38:23 -04:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f9e6d4d15 | |||
| 4f83774200 | |||
| 1664bb06aa | |||
| 1bec8805a7 | |||
| 5b69a9943e | |||
| 60f0e1c7ec | |||
| b3f471e6e9 |
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Contracts\Filesystem\Cloud;
|
||||||
|
|
||||||
|
class initDrive extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'drive:init';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Initialize drive';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
\Storage::cloud()->createDir('Systeme');
|
||||||
|
\Storage::cloud()->createDir('Systeme/Fichier');
|
||||||
|
\Storage::cloud()->createDir('Systeme/Fichier/PlanDeCours');
|
||||||
|
\Storage::cloud()->createDir('Systeme/Fichier/MessageDeLaSemaine');
|
||||||
|
\Storage::cloud()->createDir('Prive');
|
||||||
|
\Storage::cloud()->createDir('Prive/Cadet');
|
||||||
|
\Storage::cloud()->createDir('Prive/ETAMAS');
|
||||||
|
\Storage::cloud()->createDir('Prive/Officier');
|
||||||
|
\Storage::cloud()->createDir('Prive/Staff');
|
||||||
|
\Storage::cloud()->createDir('Prive/Staff/Guide');
|
||||||
|
\Storage::cloud()->createDir('Prive/Staff/Instruction');
|
||||||
|
\Storage::cloud()->createDir('Publique');
|
||||||
|
\Storage::cloud()->createDir('Publique/Fichier');
|
||||||
|
\Storage::cloud()->createDir('Publique/Image');
|
||||||
|
|
||||||
|
return "Drive is initialized";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -78,9 +78,4 @@ class AdminController extends Controller
|
|||||||
return view('admin.status.index',['alerts' => $alerts]);
|
return view('admin.status.index',['alerts' => $alerts]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function instruction()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,43 +140,9 @@ class ConfigController extends Controller
|
|||||||
|
|
||||||
public function editfilesConfig()
|
public function editfilesConfig()
|
||||||
{
|
{
|
||||||
$configList = [
|
if (\request()->file('nominativeList') != null)
|
||||||
'cadet_list',
|
|
||||||
];
|
|
||||||
|
|
||||||
$configListEncrypt = [
|
|
||||||
'GOOGLE_DRIVE_CLIENT_ID',
|
|
||||||
'GOOGLE_DRIVE_CLIENT_SECRET',
|
|
||||||
'GOOGLE_DRIVE_REFRESH_TOKEN',
|
|
||||||
'GOOGLE_DRIVE_FOLDER_ID'
|
|
||||||
];
|
|
||||||
|
|
||||||
if (\request('is_active') == 'on')
|
|
||||||
{
|
{
|
||||||
$config = \App\Config::find('is_Google_Drive_enabled');
|
\Storage::putFileAs('Systeme/Fichier',\request()->file('nominativeList'),'ListeNominative.pdf');
|
||||||
$config->data = ['true'];
|
|
||||||
$config->save();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$config = \App\Config::find('is_Google_Drive_enabled');
|
|
||||||
$config->data = ['false'];
|
|
||||||
$config->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($configList as $configName)
|
|
||||||
{
|
|
||||||
$config = \App\Config::find($configName);
|
|
||||||
$config->data = [\request($configName)];
|
|
||||||
$config->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($configListEncrypt as $configName)
|
|
||||||
{
|
|
||||||
$config = \App\Config::find($configName);
|
|
||||||
$config->data = [\Crypt::encryptString(\request($configName))];
|
|
||||||
$config->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clog('edit','success','a modifié la configuration des fichiers');
|
clog('edit','success','a modifié la configuration des fichiers');
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class CourseController extends Controller
|
|||||||
{
|
{
|
||||||
$name = $user->fullname();
|
$name = $user->fullname();
|
||||||
}
|
}
|
||||||
return view('admin.course.show',['course' => $course,'username' => $name,'lessonPlanDir' => \App\GoogleDriveFile::findByPath('.Systeme/.Fichier/.PlanDeCours')->id]);
|
return view('admin.course.show',['course' => $course,'username' => $name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,31 +136,21 @@ class CourseController extends Controller
|
|||||||
public function updateLessonPlan(Request $request, $id)
|
public function updateLessonPlan(Request $request, $id)
|
||||||
{
|
{
|
||||||
$course = Course::findOrFail($id);
|
$course = Course::findOrFail($id);
|
||||||
$name = $course->ocom.'_'.$course->instructor().'_'.$course->event->date_begin.'_'.'v'.date('c').'.'.\request()->file('file')->getClientOriginalExtension();
|
$name = $course->ocom.'_'.$course->instructor().'_'.date('c',strtotime($course->event->date_begin)).'.'.\request()->file('file')->getClientOriginalExtension();
|
||||||
$name = urlencode($name);
|
$dirID = 'Systeme/Fichier/PlanDeCours';
|
||||||
$dirID = \App\GoogleDriveFile::findByPath('.Systeme/.Fichier/.PlanDeCours')->id;
|
|
||||||
|
|
||||||
if ($course->lessonPlan != null)
|
if ($course->lessonPlan != null)
|
||||||
{
|
{
|
||||||
$lessonPlan = $course->lessonPlan;
|
$lessonPlan = $course->lessonPlan;
|
||||||
$contents = collect(\Storage::cloud()->listContents($dirID, false));
|
|
||||||
|
|
||||||
$file = $contents
|
|
||||||
->where('type', '=', 'file')
|
|
||||||
->where('filename', '=', pathinfo($course->lessonPlan->file, PATHINFO_FILENAME))
|
|
||||||
->where('extension', '=', pathinfo($course->lessonPlan->file, PATHINFO_EXTENSION))
|
|
||||||
->first(); // there can be duplicate file names!
|
|
||||||
\Storage::cloud()->delete($file['path']);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$lessonPlan = new \App\LessonPlan();
|
$lessonPlan = new \App\LessonPlan();
|
||||||
}
|
}
|
||||||
\Storage::cloud()->putFileAs($dirID,\request()->file('file'),$name);
|
\Storage::putFileAs($dirID,\request()->file('file'),$name);
|
||||||
$metadata = \Storage::cloud()->getMetadata($dirID.'/'.$name);
|
|
||||||
|
|
||||||
$lessonPlan->user_id = \Auth::user()->id;
|
$lessonPlan->user_id = \Auth::user()->id;
|
||||||
$lessonPlan->file = $metadata['name'];
|
$lessonPlan->file = $name;
|
||||||
$lessonPlan->course_id = $course->id;
|
$lessonPlan->course_id = $course->id;
|
||||||
$lessonPlan->desc = "";
|
$lessonPlan->desc = "";
|
||||||
$lessonPlan->comment = "";
|
$lessonPlan->comment = "";
|
||||||
@@ -169,6 +159,18 @@ class CourseController extends Controller
|
|||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function downloadLessonPlan($name)
|
||||||
|
{
|
||||||
|
if (\Storage::exists('Systeme/Fichier/PlanDeCours/'.$name))
|
||||||
|
{
|
||||||
|
return \Storage::download('Systeme/Fichier/PlanDeCours/'.$name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use App\GoogleDriveFile;
|
use App\GoogleDriveFile;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use function Symfony\Component\VarDumper\Dumper\esc;
|
||||||
|
|
||||||
class FilesController extends Controller
|
class FilesController extends Controller
|
||||||
{
|
{
|
||||||
@@ -41,12 +42,83 @@ class FilesController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param $path
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show(String $path)
|
||||||
{
|
{
|
||||||
//
|
$all_rules = collect(\DB::table('acl_rules')->get()->all());
|
||||||
|
|
||||||
|
foreach ($all_rules as $rule)
|
||||||
|
{
|
||||||
|
if ($rule->path == "*")
|
||||||
|
{
|
||||||
|
if (\Auth::check())
|
||||||
|
{
|
||||||
|
if (\Auth::user()->checkACLRules($rule) > 0)
|
||||||
|
{
|
||||||
|
if (\Storage::exists($path))
|
||||||
|
{
|
||||||
|
return \Storage::download($path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$path_array = explode('/',$path);
|
||||||
|
$checkedPath = $path_array[0];
|
||||||
|
unset($path_array[0]);
|
||||||
|
$path_array = array_values($path_array);
|
||||||
|
|
||||||
|
while ($checkedPath != $path)
|
||||||
|
{
|
||||||
|
$rules = $all_rules->where('path','=',$checkedPath.'/*');
|
||||||
|
if ($rules->isNotEmpty())
|
||||||
|
{
|
||||||
|
$access_level = 0;
|
||||||
|
foreach ($rules as $r)
|
||||||
|
{
|
||||||
|
if (\Auth::check())
|
||||||
|
{
|
||||||
|
$temp_access_level = \Auth::user()->checkACLRules($r);
|
||||||
|
if ($temp_access_level > $access_level)
|
||||||
|
{
|
||||||
|
$access_level = $temp_access_level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($r->user_id == '*')
|
||||||
|
{
|
||||||
|
if ($r->access > $access_level)
|
||||||
|
{
|
||||||
|
$access_level = $r->access;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($access_level > 0)
|
||||||
|
{
|
||||||
|
if (\Storage::exists($path))
|
||||||
|
{
|
||||||
|
return \Storage::download($path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$checkedPath = $checkedPath.'/'.$path_array[0];
|
||||||
|
unset($path_array[0]);
|
||||||
|
$path_array = array_values($path_array);
|
||||||
|
}
|
||||||
|
abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,67 +157,63 @@ class FilesController extends Controller
|
|||||||
|
|
||||||
public function guide()
|
public function guide()
|
||||||
{
|
{
|
||||||
if (\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Prive/Staff/Guide');
|
||||||
{
|
|
||||||
$dirID = \App\GoogleDriveFile::findByPath('.Privé/.Staff/.Guide');
|
|
||||||
$dir = collect(\Storage::cloud()->listContents($dirID->id,false))->sortBy('name');
|
|
||||||
return view('admin.files.guide',['dir' => $dir]);
|
|
||||||
}
|
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function instruction()
|
public function instruction()
|
||||||
{
|
{
|
||||||
if (\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Prive/Staff/Instruction');
|
||||||
{
|
|
||||||
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff/.Instruction')->first()->id, 'mode' => 'folder']);
|
|
||||||
}
|
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cadet()
|
public function cadet()
|
||||||
{
|
{
|
||||||
if (!\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Prive/Cadet');
|
||||||
{
|
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
|
||||||
}
|
|
||||||
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Cadet')->first()->id, 'mode' => 'folder']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function staff()
|
public function staff()
|
||||||
{
|
{
|
||||||
if (!\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Prive/Staff');
|
||||||
{
|
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
|
||||||
}
|
|
||||||
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff')->first()->id, 'mode' => 'folder']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function etamas()
|
public function etamas()
|
||||||
{
|
{
|
||||||
if (!\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Prive/ETAMAS');
|
||||||
{
|
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
|
||||||
}
|
|
||||||
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.ETAMAS')->first()->id, 'mode' => 'folder']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function officier()
|
public function officier()
|
||||||
{
|
{
|
||||||
if (!\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Prive/Officier');
|
||||||
{
|
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
|
||||||
}
|
|
||||||
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Officier')->first()->id, 'mode' => 'folder']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function publique()
|
public function publique()
|
||||||
{
|
{
|
||||||
if (!\App\GoogleDriveFile::checkConfig())
|
return redirect('/admin/files?leftPath=Publique');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show_nominativeList()
|
||||||
{
|
{
|
||||||
return redirect('/admin')->with('error','Google Drive n\'est pas configuré');
|
return view('admin.files.list.index');
|
||||||
}
|
}
|
||||||
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Publique')->first()->id, 'mode' => 'folder']);
|
|
||||||
|
public function download_nominativeList()
|
||||||
|
{
|
||||||
|
if (\Storage::exists('/Systeme/Fichier/ListeNominative.pdf'))
|
||||||
|
{
|
||||||
|
return \Storage::download('/Systeme/Fichier/ListeNominative.pdf');
|
||||||
|
}
|
||||||
|
return view('admin.files.list.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit_nominativeList()
|
||||||
|
{
|
||||||
|
return view('admin.files.list.edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_nominativeList()
|
||||||
|
{
|
||||||
|
\Storage::putFileAs('Systeme/Fichier',\request()->file('nominativeList'),'ListeNominative.pdf');
|
||||||
|
|
||||||
|
clog('edit','success','a modifié la liste nominative');
|
||||||
|
return redirect('/admin/nominativelist')->with('success','Modification sauvegarder avec succès !');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ class JobController extends Controller
|
|||||||
$job->permissions = json_encode($tpermission);
|
$job->permissions = json_encode($tpermission);
|
||||||
$job->save();
|
$job->save();
|
||||||
|
|
||||||
|
$job->updateACLRules();
|
||||||
|
|
||||||
clog('add','success','Poste ajouté avec succès');
|
clog('add','success','Poste ajouté avec succès');
|
||||||
return redirect('/admin/config/jobs')->with('success','Poste ajouté avec succès');
|
return redirect('/admin/config/jobs')->with('success','Poste ajouté avec succès');
|
||||||
}
|
}
|
||||||
@@ -112,6 +114,8 @@ class JobController extends Controller
|
|||||||
$job->permissions = json_encode($tpermission);
|
$job->permissions = json_encode($tpermission);
|
||||||
$job->save();
|
$job->save();
|
||||||
|
|
||||||
|
$job->updateACLRules();
|
||||||
|
|
||||||
clog('add','success','Poste modifié avec succès');
|
clog('add','success','Poste modifié avec succès');
|
||||||
return redirect('/admin/config/jobs')->with('success','Poste modifié avec succès');
|
return redirect('/admin/config/jobs')->with('success','Poste modifié avec succès');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,12 +43,18 @@ class PictureController extends Controller
|
|||||||
$pic = new Picture();
|
$pic = new Picture();
|
||||||
|
|
||||||
$pic->title = request('title');
|
$pic->title = request('title');
|
||||||
$pic->url = request('url');
|
$pic->url = "";
|
||||||
$pic->desc = request('desc');
|
$pic->desc = request('desc');
|
||||||
$pic->pictureable_id = 0;
|
$pic->pictureable_id = 0;
|
||||||
$pic->pictureable_type = "";
|
$pic->pictureable_type = "";
|
||||||
|
|
||||||
$pic->save();
|
$pic->save();
|
||||||
|
|
||||||
|
$filename = $pic->title.'-'.$pic->id.'.'.\request()->file('file')->getClientOriginalExtension();
|
||||||
|
\Storage::putFileAs('Publique/Image',\request()->file('file'),$filename);
|
||||||
|
|
||||||
|
$pic->url = '/api/files/Publique/Image/'.$filename;
|
||||||
|
$pic->save();
|
||||||
|
|
||||||
clog('add','success','a ajouté une image',null,'App\Picture',$pic->id);
|
clog('add','success','a ajouté une image',null,'App\Picture',$pic->id);
|
||||||
return redirect('/admin/picture')->with('success','Image ajoutée avec succès');
|
return redirect('/admin/picture')->with('success','Image ajoutée avec succès');
|
||||||
|
|
||||||
@@ -87,9 +93,15 @@ class PictureController extends Controller
|
|||||||
public function update($id)
|
public function update($id)
|
||||||
{
|
{
|
||||||
$pic = Picture::find($id);
|
$pic = Picture::find($id);
|
||||||
|
if (\request()->hasFile('file'))
|
||||||
|
{
|
||||||
|
\Storage::delete(str_replace('/api/files/','',$pic->url));
|
||||||
|
$filename = \request('title').'-'.$pic->id.'.'.\request()->file('file')->getClientOriginalExtension();
|
||||||
|
\Storage::putFileAs('Publique/Image',\request()->file('file'),$filename);
|
||||||
|
|
||||||
|
$pic->url = '/api/files/Publique/Image/'.$filename;
|
||||||
|
}
|
||||||
$pic->title = request('title');
|
$pic->title = request('title');
|
||||||
$pic->url = request('url');
|
|
||||||
$pic->desc = request('desc');
|
$pic->desc = request('desc');
|
||||||
|
|
||||||
$pic->save();
|
$pic->save();
|
||||||
@@ -113,7 +125,7 @@ class PictureController extends Controller
|
|||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
$pic = Picture::find($id);
|
$pic = Picture::find($id);
|
||||||
|
\Storage::delete(str_replace('/api/files/','',$pic->url));
|
||||||
$pic->delete();
|
$pic->delete();
|
||||||
clog('delete','success','a supprimé une image',null,'App\Picture',$id);
|
clog('delete','success','a supprimé une image',null,'App\Picture',$id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ class RankController extends Controller
|
|||||||
$r->permissions = json_encode($tpermission);
|
$r->permissions = json_encode($tpermission);
|
||||||
$r->save();
|
$r->save();
|
||||||
|
|
||||||
|
$r->updateACLRules();
|
||||||
|
|
||||||
clog('add','success','Grade ajouté avec succès');
|
clog('add','success','Grade ajouté avec succès');
|
||||||
return redirect('/admin/config/ranks')->with('success','Grade ajouté avec succès');
|
return redirect('/admin/config/ranks')->with('success','Grade ajouté avec succès');
|
||||||
}
|
}
|
||||||
@@ -99,10 +101,11 @@ class RankController extends Controller
|
|||||||
$tkey = $perm->ckey;
|
$tkey = $perm->ckey;
|
||||||
$tpermission[$tkey] = $request->$tkey;
|
$tpermission[$tkey] = $request->$tkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r->permissions = json_encode($tpermission);
|
$r->permissions = json_encode($tpermission);
|
||||||
$r->save();
|
$r->save();
|
||||||
|
|
||||||
|
$r->updateACLRules();
|
||||||
|
|
||||||
clog('edit','success','Grade modifié avec succès');
|
clog('edit','success','Grade modifié avec succès');
|
||||||
return redirect('/admin/config/ranks')->with('success','Grade modifié avec succès');
|
return redirect('/admin/config/ranks')->with('success','Grade modifié avec succès');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,4 +48,9 @@ class Job extends Model
|
|||||||
{
|
{
|
||||||
return $this->permission($perm);
|
return $this->permission($perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateACLRules()
|
||||||
|
{
|
||||||
|
\App\Permission::updateACLRules($this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,4 +116,11 @@ class OCOM extends Model
|
|||||||
{
|
{
|
||||||
return $this->nbPeriode * 30;
|
return $this->nbPeriode * 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function niveau()
|
||||||
|
{
|
||||||
|
$niveau = -1;
|
||||||
|
preg_match('/[^0\D]/',$this->oren,$niveau);
|
||||||
|
return $niveau[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+294
-8
@@ -4,6 +4,7 @@ namespace App;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App\Permission
|
* App\Permission
|
||||||
@@ -15,6 +16,150 @@ use Illuminate\Support\Arr;
|
|||||||
*/
|
*/
|
||||||
class Permission extends Model
|
class Permission extends Model
|
||||||
{
|
{
|
||||||
|
const ACLRULES = [
|
||||||
|
'files_cadets' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Cadet',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Cadet/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Cadet',
|
||||||
|
'access' => '2'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Cadet/*',
|
||||||
|
'access' => '2'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'files_staff' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff',
|
||||||
|
'access' => '2'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff/*',
|
||||||
|
'access' => '2'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'files_etamas' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/ETAMAS',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/ETAMAS/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/ETAMAS',
|
||||||
|
'access' => '2'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/ETAMAS/*',
|
||||||
|
'access' => '2'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'files_officier' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Officier',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Officier/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Officier',
|
||||||
|
'access' => '2'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Officier/*',
|
||||||
|
'access' => '2'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'files_systeme' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Systeme',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Systeme/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
// Vide
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'files_instruction' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff/Instruction',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff/Instruction/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
// Vide
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'instruction_guide' => [
|
||||||
|
'_see' => [
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff/Guide',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'path' => 'Prive/Staff/Guide/*',
|
||||||
|
'access' => '1'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'_edit' => [
|
||||||
|
// Vide
|
||||||
|
]
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
const PERMISSIONS = [
|
const PERMISSIONS = [
|
||||||
'Nouvelle' => [
|
'Nouvelle' => [
|
||||||
'news_see' => [
|
'news_see' => [
|
||||||
@@ -149,6 +294,13 @@ class Permission extends Model
|
|||||||
'icon' => 'fa-eye',
|
'icon' => 'fa-eye',
|
||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
|
'config_edit_files' => [
|
||||||
|
'ckey' => 'config_edit_files',
|
||||||
|
'communName' => 'Modifier les configurations de fichier',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les configurations de fichier',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
'config_edit_customization' => [
|
'config_edit_customization' => [
|
||||||
'ckey' => 'config_edit_customization',
|
'ckey' => 'config_edit_customization',
|
||||||
'communName' => 'Modifier les configurations de l\'apparence du site',
|
'communName' => 'Modifier les configurations de l\'apparence du site',
|
||||||
@@ -253,6 +405,13 @@ class Permission extends Model
|
|||||||
'icon' => 'fa-eye',
|
'icon' => 'fa-eye',
|
||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
|
'cadet_list_edit' => [
|
||||||
|
'ckey' => 'cadet_list_edit',
|
||||||
|
'communName' => 'Modifier la liste nominative',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier la liste nominative',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'Horaire' => [
|
'Horaire' => [
|
||||||
'schedule_see' => [
|
'schedule_see' => [
|
||||||
@@ -345,23 +504,150 @@ class Permission extends Model
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'Fichiers' => [
|
'Fichiers' => [
|
||||||
'file_see' => [
|
'files_cadets_see' => [
|
||||||
'ckey' => 'file_see',
|
'ckey' => 'files_cadets_see',
|
||||||
'communName' => 'Voir les fichiers publiques',
|
'communName' => 'Consulter les fichiers des cadets',
|
||||||
'desc' => 'L\'utilisateur peut-il consulter les fichiers publiques',
|
'desc' => 'L\'utilisateur peut-il consulter les fichiers des cadets',
|
||||||
'icon' => 'fa-eye',
|
'icon' => 'fa-eye',
|
||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
'drive_see' => [
|
'files_cadets_edit' => [
|
||||||
'ckey' => 'drive_see',
|
'ckey' => 'files_cadets_edit',
|
||||||
'communName' => 'Voir l\'explorateur de fichier',
|
'communName' => 'Modifier les fichiers des cadets',
|
||||||
'desc' => 'L\'utilisateur peut-il consulter l\'explorateur de fichier',
|
'desc' => 'L\'utilisateur peut-il modifier les fichiers des cadets',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_staff_see' => [
|
||||||
|
'ckey' => 'files_staff_see',
|
||||||
|
'communName' => 'Consulter les fichiers des staffs',
|
||||||
|
'desc' => 'L\'utilisateur peut-il consulter les fichiers des staffs',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_staff_edit' => [
|
||||||
|
'ckey' => 'files_staff_edit',
|
||||||
|
'communName' => 'Modifier les fichiers des staffs',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les fichiers des staffs',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_etamas_see' => [
|
||||||
|
'ckey' => 'files_etamas_see',
|
||||||
|
'communName' => 'Consulter les fichiers de l\'ETAMAS',
|
||||||
|
'desc' => 'L\'utilisateur peut-il consulter les fichiers de l\'ETAMAS',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_etamas_edit' => [
|
||||||
|
'ckey' => 'files_etamas_edit',
|
||||||
|
'communName' => 'Mo
|
||||||
|
difier les fichiers de l\'ETAMAS',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les fichiers de l\'ETAMAS',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_officier_see' => [
|
||||||
|
'ckey' => 'files_officier_see',
|
||||||
|
'communName' => 'Consulter les fichiers des officiers',
|
||||||
|
'desc' => 'L\'utilisateur peut-il consulter les fichiers des officiers',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_officier_edit' => [
|
||||||
|
'ckey' => 'files_officier_edit',
|
||||||
|
'communName' => 'Modifier les fichiers des officiers',
|
||||||
|
'desc' => 'L\'utilisateur peut-il modifier les fichiers des officiers',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_systeme_see' => [
|
||||||
|
'ckey' => 'files_systeme_see',
|
||||||
|
'communName' => 'Voir les fichiers systemes',
|
||||||
|
'desc' => 'L\'utilisateur peut-il consulter les fichiers systemes',
|
||||||
|
'icon' => 'fa-eye',
|
||||||
|
'valeur' => 0
|
||||||
|
],
|
||||||
|
'files_instruction_see' => [
|
||||||
|
'ckey' => 'files_instruction_see',
|
||||||
|
'communName' => 'Voir les fichiers de l\'instruction',
|
||||||
|
'desc' => 'L\'utilisateur peut-il consulter les fichiers de l\'instruction',
|
||||||
'icon' => 'fa-eye',
|
'icon' => 'fa-eye',
|
||||||
'valeur' => 0
|
'valeur' => 0
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static function updateACLRules($o)
|
||||||
|
{
|
||||||
|
$user_id = '0';
|
||||||
|
$rank_id = '0';
|
||||||
|
$job_id = '0';
|
||||||
|
|
||||||
|
switch ($o->table) {
|
||||||
|
case 'users':
|
||||||
|
$user_id = $o->id;
|
||||||
|
break;
|
||||||
|
case 'ranks':
|
||||||
|
$rank_id = $o->id;
|
||||||
|
break;
|
||||||
|
case 'jobs':
|
||||||
|
$job_id = $o->id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (self::ACLRULES as $key => $rule)
|
||||||
|
{
|
||||||
|
if ($o->p($key.'_see') == 1) {
|
||||||
|
if ($o->p($key.'_edit') == 1) {
|
||||||
|
foreach ($rule['_edit'] as $acl) {
|
||||||
|
self::updateOrInsertACLRules($user_id,$rank_id,$job_id,'storage',$acl['path'],$acl['access']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
foreach ($rule['_see'] as $acl) {
|
||||||
|
self::updateOrInsertACLRules($user_id,$rank_id,$job_id,'storage',$acl['path'],$acl['access']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
foreach ($rule['_see'] as $acl) {
|
||||||
|
self::removeACLRules($user_id,$rank_id,$job_id,'storage',$acl['path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function removeACLRules($userId,$rankId,$jobId,$disk,$path)
|
||||||
|
{
|
||||||
|
$rules = DB::table('acl_rules')->where([
|
||||||
|
['user_id',$userId],
|
||||||
|
['rank_id',$rankId],
|
||||||
|
['job_id',$jobId],
|
||||||
|
['disk',$disk],
|
||||||
|
['path',$path]
|
||||||
|
]);
|
||||||
|
$rules->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function updateOrInsertACLRules($userId,$rankId,$jobId,$disk,$path,$access)
|
||||||
|
{
|
||||||
|
DB::table('acl_rules')->updateOrInsert(
|
||||||
|
['user_id' => $userId, 'rank_id' => $rankId, 'job_id' => $jobId, 'disk' => $disk, 'path' => $path],
|
||||||
|
['access' => $access]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function addACLRules($userId,$rankId,$jobId,$disk,$path,$access)
|
||||||
|
{
|
||||||
|
DB::table('acl_rules')->insertOrIgnore([
|
||||||
|
'user_id' => $userId,
|
||||||
|
'rank_id' => $rankId,
|
||||||
|
'job_id' => $jobId,
|
||||||
|
'disk' => $disk,
|
||||||
|
'path' => $path,
|
||||||
|
'access' => $access
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public static function all($value = null,$columns = null)
|
public static function all($value = null,$columns = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -50,4 +50,9 @@ class Rank extends Model
|
|||||||
{
|
{
|
||||||
return $this->permission($perm);
|
return $this->permission($perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateACLRules()
|
||||||
|
{
|
||||||
|
\App\Permission::updateACLRules($this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
use Alexusmai\LaravelFileManager\Services\ACLService\ACLRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class DBACLRepository
|
||||||
|
*
|
||||||
|
* @package Alexusmai\LaravelFileManager\Services\ACLService
|
||||||
|
*/
|
||||||
|
class DBACLRepository implements ACLRepository
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get user ID
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getUserID()
|
||||||
|
{
|
||||||
|
return \Auth::id();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserRank()
|
||||||
|
{
|
||||||
|
return \Auth::user()->rank_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserJobs()
|
||||||
|
{
|
||||||
|
return \Auth::user()->job_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ACL rules list for user
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getRules(): array
|
||||||
|
{
|
||||||
|
$rules = \DB::table('acl_rules')
|
||||||
|
->where('user_id', $this->getUserID())
|
||||||
|
->get(['disk', 'path', 'access'])
|
||||||
|
->map(function ($item) {
|
||||||
|
return get_object_vars($item);
|
||||||
|
})
|
||||||
|
->all();
|
||||||
|
$rank_rules = \DB::table('acl_rules')
|
||||||
|
->where('rank_id', $this->getUserRank())
|
||||||
|
->get(['disk', 'path', 'access'])
|
||||||
|
->map(function ($item) {
|
||||||
|
return get_object_vars($item);
|
||||||
|
})
|
||||||
|
->all();
|
||||||
|
$job_rules = \DB::table('acl_rules')
|
||||||
|
->where('job_id', $this->getUserJobs())
|
||||||
|
->get(['disk', 'path', 'access'])
|
||||||
|
->map(function ($item) {
|
||||||
|
return get_object_vars($item);
|
||||||
|
})
|
||||||
|
->all();
|
||||||
|
$all_rules = \DB::table('acl_rules')
|
||||||
|
->where('user_id', '=','*')
|
||||||
|
->get(['disk', 'path', 'access'])
|
||||||
|
->map(function ($item) {
|
||||||
|
return get_object_vars($item);
|
||||||
|
})
|
||||||
|
->all();
|
||||||
|
$rules = array_merge($rules,$rank_rules,$job_rules,$all_rules);
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -387,4 +387,30 @@ class User extends Authenticatable
|
|||||||
return Carbon::parse($val->created_at)->format('Y-m-d');
|
return Carbon::parse($val->created_at)->format('Y-m-d');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkACLRules($rule)
|
||||||
|
{
|
||||||
|
if ($rule->user_id == $this->id || $rule->user_id == '*')
|
||||||
|
{
|
||||||
|
return $rule->access;
|
||||||
|
}
|
||||||
|
if ($rule->job_id == $this->job_id || $rule->job_id == '*')
|
||||||
|
{
|
||||||
|
return $rule->access;
|
||||||
|
}
|
||||||
|
if ($rule->rank_id == $this->rank_id || $rule->rank_id == '*')
|
||||||
|
{
|
||||||
|
return $rule->access;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkACLRulesVisitor($rule)
|
||||||
|
{
|
||||||
|
if ($rule->user_id == '*')
|
||||||
|
{
|
||||||
|
return $rule->access;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -6,6 +6,7 @@
|
|||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4",
|
"php": "^7.4",
|
||||||
|
"alexusmai/laravel-file-manager": "^2.5",
|
||||||
"barryvdh/laravel-dompdf": "^0.8.4",
|
"barryvdh/laravel-dompdf": "^0.8.4",
|
||||||
"barryvdh/laravel-ide-helper": "2.7.0",
|
"barryvdh/laravel-ide-helper": "2.7.0",
|
||||||
"davejamesmiller/laravel-breadcrumbs": "5.3.2",
|
"davejamesmiller/laravel-breadcrumbs": "5.3.2",
|
||||||
@@ -18,7 +19,7 @@
|
|||||||
"laravel/telescope": "^3.5",
|
"laravel/telescope": "^3.5",
|
||||||
"laravel/tinker": "^2.0",
|
"laravel/tinker": "^2.0",
|
||||||
"laravel/ui": "^2.0",
|
"laravel/ui": "^2.0",
|
||||||
"nao-pon/flysystem-google-drive": "^1.1",
|
"league/flysystem-aws-s3-v3": "^1.0",
|
||||||
"nexmo/client": "^2.0",
|
"nexmo/client": "^2.0",
|
||||||
"pragmarx/version": "^1.2",
|
"pragmarx/version": "^1.2",
|
||||||
"pusher/pusher-php-server": "~4.0"
|
"pusher/pusher-php-server": "~4.0"
|
||||||
|
|||||||
Generated
+1496
-1013
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -63,7 +63,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'version' => "3.2.5.",
|
'version' => "3.2.6.",
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,168 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Alexusmai\LaravelFileManager\Services\ConfigService\DefaultConfigRepository;
|
||||||
|
use Alexusmai\LaravelFileManager\Services\ACLService\ConfigACLRepository;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Config repository
|
||||||
|
*
|
||||||
|
* Default - DefaultConfigRepository get config from this file
|
||||||
|
*/
|
||||||
|
'configRepository' => DefaultConfigRepository::class,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ACL rules repository
|
||||||
|
*
|
||||||
|
* Default - ConfigACLRepository (see rules in - aclRules)
|
||||||
|
*/
|
||||||
|
'aclRepository' => \App\Services\DBACLRepository::class,
|
||||||
|
|
||||||
|
//********* Default configuration for DefaultConfigRepository **************
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LFM Route prefix
|
||||||
|
* !!! WARNING - if you change it, you should compile frontend with new prefix(baseUrl) !!!
|
||||||
|
*/
|
||||||
|
'routePrefix' => 'file-manager',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of disk names that you want to use
|
||||||
|
* (from config/filesystems)
|
||||||
|
*/
|
||||||
|
'diskList' => ['storage'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default disk for left manager
|
||||||
|
*
|
||||||
|
* null - auto select the first disk in the disk list
|
||||||
|
*/
|
||||||
|
'leftDisk' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default disk for right manager
|
||||||
|
*
|
||||||
|
* null - auto select the first disk in the disk list
|
||||||
|
*/
|
||||||
|
'rightDisk' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default path for left manager
|
||||||
|
*
|
||||||
|
* null - root directory
|
||||||
|
*/
|
||||||
|
'leftPath' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default path for right manager
|
||||||
|
*
|
||||||
|
* null - root directory
|
||||||
|
*/
|
||||||
|
'rightPath' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Image cache ( Intervention Image Cache )
|
||||||
|
*
|
||||||
|
* set null, 0 - if you don't need cache (default)
|
||||||
|
* if you want use cache - set the number of minutes for which the value should be cached
|
||||||
|
*/
|
||||||
|
'cache' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File manager modules configuration
|
||||||
|
*
|
||||||
|
* 1 - only one file manager window
|
||||||
|
* 2 - one file manager window with directories tree module
|
||||||
|
* 3 - two file manager windows
|
||||||
|
*/
|
||||||
|
'windowsConfig' => 2,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File upload - Max file size in KB
|
||||||
|
*
|
||||||
|
* null - no restrictions
|
||||||
|
*/
|
||||||
|
'maxUploadFileSize' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File upload - Allow these file types
|
||||||
|
*
|
||||||
|
* [] - no restrictions
|
||||||
|
*/
|
||||||
|
'allowFileTypes' => [],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show / Hide system files and folders
|
||||||
|
*/
|
||||||
|
'hiddenFiles' => true,
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Middleware
|
||||||
|
*
|
||||||
|
* Add your middleware name to array -> ['web', 'auth', 'admin']
|
||||||
|
* !!!! RESTRICT ACCESS FOR NON ADMIN USERS !!!!
|
||||||
|
*/
|
||||||
|
'middleware' => ['web','auth'],
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* ACL mechanism ON/OFF
|
||||||
|
*
|
||||||
|
* default - false(OFF)
|
||||||
|
*/
|
||||||
|
'acl' => true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide files and folders from file-manager if user doesn't have access
|
||||||
|
*
|
||||||
|
* ACL access level = 0
|
||||||
|
*/
|
||||||
|
'aclHideFromFM' => true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ACL strategy
|
||||||
|
*
|
||||||
|
* blacklist - Allow everything(access - 2 - r/w) that is not forbidden by the ACL rules list
|
||||||
|
*
|
||||||
|
* whitelist - Deny anything(access - 0 - deny), that not allowed by the ACL rules list
|
||||||
|
*/
|
||||||
|
'aclStrategy' => 'whitelist',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ACL Rules cache
|
||||||
|
*
|
||||||
|
* null or value in minutes
|
||||||
|
*/
|
||||||
|
'aclRulesCache' => null,
|
||||||
|
|
||||||
|
//********* Default configuration for DefaultConfigRepository END **********
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* ACL rules list - used for default ACL repository (ConfigACLRepository)
|
||||||
|
*
|
||||||
|
* 1 it's user ID
|
||||||
|
* null - for not authenticated user
|
||||||
|
*
|
||||||
|
* 'disk' => 'disk-name'
|
||||||
|
*
|
||||||
|
* 'path' => 'folder-name'
|
||||||
|
* 'path' => 'folder1*' - select folder1, folder12, folder1/sub-folder, ...
|
||||||
|
* 'path' => 'folder2/*' - select folder2/sub-folder,... but not select folder2 !!!
|
||||||
|
* 'path' => 'folder-name/file-name.jpg'
|
||||||
|
* 'path' => 'folder-name/*.jpg'
|
||||||
|
*
|
||||||
|
* * - wildcard
|
||||||
|
*
|
||||||
|
* access: 0 - deny, 1 - read, 2 - read/write
|
||||||
|
*/
|
||||||
|
'aclRules' => [
|
||||||
|
null => [
|
||||||
|
//['disk' => 'public', 'path' => '/', 'access' => 2],
|
||||||
|
],
|
||||||
|
1 => [
|
||||||
|
//['disk' => 'public', 'path' => 'images/arch*.jpg', 'access' => 2],
|
||||||
|
//['disk' => 'public', 'path' => 'files/*', 'access' => 1],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
+9
-16
@@ -26,7 +26,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'cloud' => env('FILESYSTEM_CLOUD', 'google'),
|
'cloud' => env('FILESYSTEM_CLOUD', 'storage'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -48,22 +48,15 @@ return [
|
|||||||
'root' => storage_path('app'),
|
'root' => storage_path('app'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'public' => [
|
'storage' => [
|
||||||
'driver' => 'local',
|
'driver' => 's3',
|
||||||
'root' => storage_path('app/public'),
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
'url' => env('APP_URL').'/storage',
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
'visibility' => 'public',
|
'region' => env('AWS_DEFAULT_REGION'),
|
||||||
|
'bucket' => env('AWS_BUCKET'),
|
||||||
|
'url' => env('AWS_URL'),
|
||||||
|
'endpoint' => env('AWS_ENDPOINT'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'google' => [
|
|
||||||
'driver' => 'google',
|
|
||||||
'clientId' => '',
|
|
||||||
'clientSecret' => '',
|
|
||||||
'refreshToken' => '',
|
|
||||||
'folderId' => '',
|
|
||||||
// 'teamDriveId' => env('GOOGLE_DRIVE_TEAM_DRIVE_ID'),
|
|
||||||
],
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
+11
-11
@@ -1,20 +1,20 @@
|
|||||||
mode: absorb
|
mode: increment
|
||||||
blade-directive: version
|
blade-directive: version
|
||||||
current:
|
current:
|
||||||
label: ''
|
label: ''
|
||||||
major: 3
|
major: 3
|
||||||
minor: 2
|
minor: 2
|
||||||
patch: 5
|
patch: 6
|
||||||
prerelease: 54-g63301aec
|
prerelease: ''
|
||||||
buildmetadata: ''
|
buildmetadata: ''
|
||||||
commit: 41845
|
commit: '41847'
|
||||||
timestamp:
|
timestamp:
|
||||||
year: 2020
|
year: 2020
|
||||||
month: 6
|
month: 10
|
||||||
day: 21
|
day: 13
|
||||||
hour: 18
|
hour: 14
|
||||||
minute: 44
|
minute: 50
|
||||||
second: 55
|
second: 31
|
||||||
timezone: America/New_York
|
timezone: America/New_York
|
||||||
commit:
|
commit:
|
||||||
mode: git-local
|
mode: git-local
|
||||||
@@ -44,10 +44,10 @@ format:
|
|||||||
prerelease: '{$prerelease}'
|
prerelease: '{$prerelease}'
|
||||||
buildmetadata: '{$buildmetadata}'
|
buildmetadata: '{$buildmetadata}'
|
||||||
commit: '{$commit}'
|
commit: '{$commit}'
|
||||||
version: 'v {$major}.{$minor}.{$patch} (commit {$commit})'
|
version: 'v {$major}.{$minor}.{$patch}'
|
||||||
version-only: 'version {$major}.{$minor}.{$patch}'
|
version-only: 'version {$major}.{$minor}.{$patch}'
|
||||||
full: '{$version-only}[.?={$prerelease}][+?={$buildmetadata}] (commit {$commit})'
|
full: '{$version-only}[.?={$prerelease}][+?={$buildmetadata}] (commit {$commit})'
|
||||||
compact: 'v{$major}.{$minor}.{$patch}-{$commit}'
|
compact: 'v{$major}.{$minor}.{$patch}'
|
||||||
timestamp-year: '{$timestamp.year}'
|
timestamp-year: '{$timestamp.year}'
|
||||||
timestamp-month: '{$timestamp.month}'
|
timestamp-month: '{$timestamp.month}'
|
||||||
timestamp-day: '{$timestamp.day}'
|
timestamp-day: '{$timestamp.day}'
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class MakeAclRulesTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('acl_rules', function (Blueprint $table) {
|
||||||
|
$table->increments('id');
|
||||||
|
$table->string('user_id')->nullable();
|
||||||
|
$table->string('rank_id')->nullable();
|
||||||
|
$table->string('job_id')->nullable();
|
||||||
|
$table->string('disk');
|
||||||
|
$table->string('path');
|
||||||
|
$table->tinyInteger('access');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('acl_rules');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class ACLTableSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
DB::table('acl_rules')->insert([
|
||||||
|
[
|
||||||
|
'user_id' => '*',
|
||||||
|
'rank_id' => '0',
|
||||||
|
'job_id' => '0',
|
||||||
|
'disk' => 'storage',
|
||||||
|
'path' => '/',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'user_id' => '*',
|
||||||
|
'rank_id' => '0',
|
||||||
|
'job_id' => '0',
|
||||||
|
'disk' => 'storage',
|
||||||
|
'path' => 'Publique',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'user_id' => '*',
|
||||||
|
'rank_id' => '0',
|
||||||
|
'job_id' => '0',
|
||||||
|
'disk' => 'storage',
|
||||||
|
'path' => 'Publique/*',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'user_id' => '0',
|
||||||
|
'rank_id' => '1',
|
||||||
|
'job_id' => '0',
|
||||||
|
'disk' => 'storage',
|
||||||
|
'path' => '*',
|
||||||
|
'access' => '1'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -232,26 +232,6 @@ class ConfigsTableSeeder extends Seeder
|
|||||||
'state' => 0,
|
'state' => 0,
|
||||||
'data' => '["#"]'
|
'data' => '["#"]'
|
||||||
],
|
],
|
||||||
[
|
|
||||||
'name' => 'GOOGLE_DRIVE_CLIENT_ID',
|
|
||||||
'state' => 0,
|
|
||||||
'data' => '["'.\Crypt::encryptString('').'"]'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'name' => 'GOOGLE_DRIVE_CLIENT_SECRET',
|
|
||||||
'state' => 0,
|
|
||||||
'data' => '["'.\Crypt::encryptString('').'"]'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'name' => 'GOOGLE_DRIVE_REFRESH_TOKEN',
|
|
||||||
'state' => 0,
|
|
||||||
'data' => '["'.\Crypt::encryptString('').'"]'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'name' => 'GOOGLE_DRIVE_FOLDER_ID',
|
|
||||||
'state' => 0,
|
|
||||||
'data' => '["'.\Crypt::encryptString('null').'"]'
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
'name' => 'is_Google_Drive_enabled',
|
'name' => 'is_Google_Drive_enabled',
|
||||||
'state' => 0,
|
'state' => 0,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
UsersTableSeeder::class,
|
UsersTableSeeder::class,
|
||||||
ComplementaryActivitiesSeeder::class,
|
ComplementaryActivitiesSeeder::class,
|
||||||
EventTypeSeeder::class,
|
EventTypeSeeder::class,
|
||||||
|
ACLTableSeeder::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,84 +7,10 @@
|
|||||||
<h4>Configuration du système de fichier</h4>
|
<h4>Configuration du système de fichier</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body mt-5">
|
<div class="card-body mt-5">
|
||||||
<form action="/admin/config/files" method="POST">
|
<form action="/admin/config/files" method="post" enctype="multipart/form-data">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row ml-2">
|
<div class="row ml-2">
|
||||||
<h3 class="col-12">Google Drive</h3>
|
<p class="col-12">Il n'y a rien ici pour le moment</h3>
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="alert alert-info" role="alert">
|
|
||||||
Vous pouvez suivre un <a class="alert-link" target="_blank" href="https://github.com/ivanvermeyen/laravel-google-drive-demo/blob/master/README/1-getting-your-dlient-id-and-secret.md">tutoriel (Anglais) <i class="fas fa-external-link-square-alt text-white"></i></a> pour trouver c'est information.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div id="google-drive-status" class="alert alert-primary" role="alert">
|
|
||||||
<div class="row pb-1">
|
|
||||||
<div class="col-10" id="google-drive-status-text">
|
|
||||||
Google Drive est initialisé correctement
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<div id="loaderDot" class="float-right d-none" style="margin-top: -30px;height: 41px">
|
|
||||||
@loaderDot
|
|
||||||
</div>
|
|
||||||
<div class="float-right" id="btn-sync">
|
|
||||||
<button type="button" class="btn btn-round btn-fab" style="margin-top: -0.55rem" onclick="checkFileSystem()">
|
|
||||||
<i class="fas fa-sync"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-8 p-2">
|
|
||||||
<div class="togglebutton">
|
|
||||||
<label>
|
|
||||||
<input id="is_active" type="checkbox" data-toggle="switch" name="is_active">
|
|
||||||
<span class="toggle"></span>
|
|
||||||
Activer Google Drive
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 p-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1">GOOGLE_DRIVE_CLIENT_ID</label>
|
|
||||||
<input type="text" class="form-control" id="GOOGLE_DRIVE_CLIENT_ID" name="GOOGLE_DRIVE_CLIENT_ID" aria-describedby="emailHelp" value="{{Crypt::decryptString(\App\Config::getData('GOOGLE_DRIVE_CLIENT_ID')) }}">
|
|
||||||
<small id="emailHelp" class="form-text text-muted">ID de client Google Drive</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 p-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1">GOOGLE_DRIVE_CLIENT_SECRET</label>
|
|
||||||
<input type="text" class="form-control" id="GOOGLE_DRIVE_CLIENT_SECRET" name="GOOGLE_DRIVE_CLIENT_SECRET" aria-describedby="emailHelp" value="{{Crypt::decryptString(\App\Config::getData('GOOGLE_DRIVE_CLIENT_SECRET'))}}">
|
|
||||||
<small id="emailHelp" class="form-text text-muted">ID secret du disque Google Drive</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 p-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1">GOOGLE_DRIVE_REFRESH_TOKEN</label>
|
|
||||||
<input type="text" class="form-control" id="GOOGLE_DRIVE_REFRESH_TOKEN" name="GOOGLE_DRIVE_REFRESH_TOKEN" aria-describedby="emailHelp" value="{{Crypt::decryptString(\App\Config::getData('GOOGLE_DRIVE_REFRESH_TOKEN'))}}">
|
|
||||||
<small id="emailHelp" class="form-text text-muted">Token de rafraichissement du disque Google Drive</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 p-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1">GOOGLE_DRIVE_FOLDER_ID</label>
|
|
||||||
<input type="text" class="form-control" id="GOOGLE_DRIVE_FOLDER_ID" name="GOOGLE_DRIVE_FOLDER_ID" aria-describedby="emailHelp" value="{{Crypt::decryptString(\App\Config::getData('GOOGLE_DRIVE_FOLDER_ID'))}}">
|
|
||||||
<small id="emailHelp" class="form-text text-muted">ID du dossier Google Drive, "null" pour la racine</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<h3 class="col-12">Configuration de la liste nominale</h3>
|
|
||||||
<div class="col-md-6 p-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1">Liste nominative des cadets</label>
|
|
||||||
<input type="text" class="form-control" id="cadet_list" name="cadet_list" aria-describedby="emailHelp" value="{{\App\Config::getData('cadet_list')}}">
|
|
||||||
<small id="emailHelp" class="form-text text-muted">Url vers la liste nominative des cadets</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-12 p-2">
|
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,8 +54,16 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@foreach($courses as $course)
|
@foreach($courses as $course)
|
||||||
<tr class="cursor">
|
<tr class="cursor">
|
||||||
<td>{{$course->ocom}}</td>
|
<td>
|
||||||
<td>{{$course->name}}</td>
|
{{ $course->ocom }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($course->name != "")
|
||||||
|
{{$course->name}}
|
||||||
|
@else
|
||||||
|
{{$course->desc }}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
<td>{{$course->instructor()}}</td>
|
<td>{{$course->instructor()}}</td>
|
||||||
<td>{{$course->event->date_begin}}</td>
|
<td>{{$course->event->date_begin}}</td>
|
||||||
<td class="text-center">{{$course->level}}</td>
|
<td class="text-center">{{$course->level}}</td>
|
||||||
|
|||||||
@@ -12,7 +12,11 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label>Nom</label>
|
<label>Nom</label>
|
||||||
|
@if($course->name != "")
|
||||||
<p>{{$course->name}}</p>
|
<p>{{$course->name}}</p>
|
||||||
|
@else
|
||||||
|
<p>{{$course->desc}}</p>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Instructeur</label>
|
<label>Instructeur</label>
|
||||||
@@ -111,7 +115,7 @@
|
|||||||
<div class="col-md-1 text-center">
|
<div class="col-md-1 text-center">
|
||||||
<label>Télécharger</label>
|
<label>Télécharger</label>
|
||||||
<p>
|
<p>
|
||||||
<a target="_blank" href="/file/get?d={{urlencode($lessonPlanDir)}}&f={{urlencode($course->lessonPlan->file)}}" class="btn btn-primary btn-fab btn-fab-mini btn-round m-0">
|
<a target="_blank" href="/admin/lessonPlan/{{$course->lessonPlan->file}}" class="btn btn-primary btn-fab btn-fab-mini btn-round m-0">
|
||||||
<i class="material-icons">cloud_download</i>
|
<i class="material-icons">cloud_download</i>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
<table class="table table-hover table-responsive dt-responsive material-datatables w-100 d-sm-table" id="table">
|
|
||||||
<thead class="thead-dark">
|
|
||||||
<tr>
|
|
||||||
<td class="text-center explorerType"><strong>#</strong></td>
|
|
||||||
<td class="text-left">Nom</td>
|
|
||||||
<td class="text-center">Dernière modification</td>
|
|
||||||
<td class="td-actions text-right">
|
|
||||||
@if($permission['p'])
|
|
||||||
<div class="dropdown">
|
|
||||||
<div id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
<i class="fas fa-ellipsis-v fa-2x ml-3 text-gray" style="margin-right: .8rem !important;cursor: pointer;margin-top: -10px;margin-bottom: -6px"></i>
|
|
||||||
</div>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
||||||
<a class="dropdown-item" href="/admin/drive/{{$currentDir}}/permission">
|
|
||||||
<i class="fas fa-lock mr-2"></i></i>Permission
|
|
||||||
</a>
|
|
||||||
<a class="dropdown-item text-danger" onclick="deleteFolder('{{ $currentDir }}')">
|
|
||||||
<i class="fas fa-trash-alt mr-2"></i>Supprimer
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-lock text-danger mr-2" data-toggle="tooltip" data-placement="left" title="Vous n'avez pas les permissions nécessaires pour modifier ce dossier"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach($directories as $directory)
|
|
||||||
@php
|
|
||||||
$read = \App\GoogleDriveFile::getPermForAuthUser($directory['basename'],'r');
|
|
||||||
$manage = \App\GoogleDriveFile::getPermForAuthUser($directory['basename'],'p');
|
|
||||||
@endphp
|
|
||||||
<tr class="context-menu-one">
|
|
||||||
@if($read)
|
|
||||||
<td onclick="loadFolder('{{$directory['basename']}}')" style="cursor: pointer;" >
|
|
||||||
<i class="fas fa-folder fa-2x"></i>
|
|
||||||
</td>
|
|
||||||
@else
|
|
||||||
<td>
|
|
||||||
<i class="fas fa-folder fa-2x text-muted"></i>
|
|
||||||
</td>
|
|
||||||
@endif
|
|
||||||
<td @if($read) onclick="loadFolder('{{$directory['basename']}}')" style="cursor: pointer;" @else class="text-muted" @endif>{{$directory['name']}}</td>
|
|
||||||
<td @if($read) class="text-center" onclick="loadFolder('{{$directory['basename']}}')" style="cursor: pointer;" @else class="text-center text-muted" @endif ><span data-toggle="tooltip" data-placement="bottom" title="{{date('r',$directory['timestamp'])}}">{{strftime('%e %b %Y',$directory['timestamp'])}}</span></td>
|
|
||||||
<td class="td-actions text-right">
|
|
||||||
@if($manage)
|
|
||||||
<div class="dropdown">
|
|
||||||
<div id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
<i class="fas fa-ellipsis-v fa-2x ml-3 text-gray" style="margin-right: .8rem !important;cursor: pointer;"></i>
|
|
||||||
</div>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
||||||
<a class="dropdown-item" href="/admin/drive/{{$directory['basename']}}/permission">
|
|
||||||
<i class="fas fa-lock mr-2"></i>Permission
|
|
||||||
</a>
|
|
||||||
<a class="dropdown-item text-danger" onclick="deleteFolder('{{ $directory['basename'] }}')">
|
|
||||||
<i class="fas fa-trash-alt mr-2"></i>Supprimer
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
@if(!$read)
|
|
||||||
<i class="fas fa-lock text-danger mr-2" data-toggle="tooltip" data-placement="left" title="Vous n'avez pas les permissions nécessaires pour modifier ce dossier"></i>
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
@foreach($files as $file)
|
|
||||||
<tr onclick="showfile('{{$file['basename']}}')" style="cursor: pointer;">
|
|
||||||
<td><i class="{{ \App\GoogleDriveFile::icon($file['extension']) }} fa-2x"></i></td>
|
|
||||||
<td>{{$file['name']}}</td>
|
|
||||||
<td class="text-center"><span data-toggle="tooltip" data-placement="bottom" title="{{date('r',$file['timestamp'])}}">{{strftime('%e %b %Y',$file['timestamp'])}}</span></td>
|
|
||||||
<td class="td-actions text-right">
|
|
||||||
<i id="fa-{{$file['basename']}}" class="fas fa-angle-down fa-2x pr-2 text-gray"></i>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr id="{{$file['basename']}}" class="d-none">
|
|
||||||
<td style="border-top: none" colspan="4">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-2">
|
|
||||||
Type : {{$file['type']}} / {{$file['extension']}}
|
|
||||||
</div>
|
|
||||||
<div class="col-md-2">
|
|
||||||
Taille : {{GetSizeName($file['size'])}}
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
Permission : rw
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4 text-right">
|
|
||||||
<a href="/file/get?f={{urlencode($file['name'])}}&d={{$file['dirname']}}" rel="tooltip" class="btn btn-info">
|
|
||||||
<i class="material-icons">cloud_download</i>
|
|
||||||
</a>
|
|
||||||
<button onclick="deleteFile('{{$file['name']}}','{{$file['dirname']}}')" rel="tooltip" class="btn btn-danger text-white">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
@if(count($directories) == 0 && count($files) == 0)
|
|
||||||
<tr>
|
|
||||||
<td colspan="4" class="text-center m-2">
|
|
||||||
Le dossier est vide
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endif
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<small class="float-right mr-4">Dernière mise à jour {{date('r')}}</small>
|
|
||||||
<script>
|
|
||||||
updateHeader('{{$permission['p']}}');
|
|
||||||
</script>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
...
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
||||||
<button type="button" class="btn btn-primary">Save changes</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
@extends('layouts.admin.main')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<div class="card">
|
|
||||||
<div class="progress progress-bar-top">
|
|
||||||
<div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>
|
|
||||||
</div>
|
|
||||||
<div class="row ml-3 mr-3 mt-3">
|
|
||||||
<div class="col-sm-1 d-inline-flex">
|
|
||||||
<button id="backbtn" type="button" onclick="goBack()" class="btn btn-secondary" style="border-radius: 50% !important; width: 3.5rem;height: 3.5rem;margin-bottom: -10px;margin-top: -2px" disabled><i class="fas fa-arrow-left fa-2x" aria-hidden="true" style="margin-left: -0.6rem;"></i></button>
|
|
||||||
<button id="refreshbtn" type="button" onclick="refreshFolder()" class="border-0 bg-transparent ml-3 hover-spin cursor active-spin no-outline" style="margin-bottom: -10px;margin-top: -2px;font-size: 1.1rem"><i class="fas fa-sync-alt"></i></button>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4 col-sm d-flex justify-content-end offset-md-7 mt-2 mt-sm-0">
|
|
||||||
<div class="dropdown mr-md-2 d-none" id="createDropdown">
|
|
||||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
<i class="fas fa-plus"></i> Nouveau
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
||||||
<a class="dropdown-item" data-toggle="modal" data-target="#createFolderModal"><i class="fas fa-folder mr-3"></i> Dossier</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="dropdown d-none" id="uploadDropdown">
|
|
||||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
<i class="fas fa-upload"></i> Téléverser
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
||||||
<a class="dropdown-item" data-toggle="modal" data-target="#uploadFileModal"><i class="fas fa-file mr-3"></i> Fichier</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="loader" class="w-100 h-100" style="background-color: #0000007a;position: absolute; z-index: 5;display: none;border-radius: 6px">
|
|
||||||
<div class="d-flex h-100" style="justify-content: center; align-items: center;">
|
|
||||||
@loaderDot
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="card-body mt-0">
|
|
||||||
<div class="drive-explorer" style="min-height: 10rem"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="createFileModal" id="createFileModal" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Créer un fichier</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="/file/create" method="post">
|
|
||||||
@csrf
|
|
||||||
<input class="d-none currentDir" type="text" name="currentDir">
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleFormControlInput1">Nom du fichier</label>
|
|
||||||
<input type="text" class="form-control" id="name" name="name" placeholder="fichier.txt">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-primary">Créer</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="createFolderModal" id="createFolderModal" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Créer un dossier</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="/folder/create" method="post">
|
|
||||||
@csrf
|
|
||||||
<input class="d-none currentDir" type="text" name="currentDir">
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleFormControlInput1">Nom du dossier</label>
|
|
||||||
<input type="text" class="form-control" id="name" name="name">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-primary">Créer</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="uploadFileModal" id="uploadFileModal" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Téléverser une fichier</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="/file/upload" method="POST" enctype="multipart/form-data">
|
|
||||||
@csrf
|
|
||||||
<input class="d-none currentDir" type="text" name="currentDir">
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="form-group bmd-form-group is-filled">
|
|
||||||
<label class="label-control bmd-label-static">Fichier à téléverser (Max 50Mo)</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" data-dismiss="fileinput">Supprimer</span>
|
|
||||||
<span class="input-group-text btn-file">
|
|
||||||
<span class="fileinput-new">Parcourir</span>
|
|
||||||
<span class="fileinput-exists">Modifier</span>
|
|
||||||
<input type="file" name="fichier">
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-primary">Téléverser</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@section('breadcrumb')
|
|
||||||
Fichier / Google Drive
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@section('custom_scripts')
|
|
||||||
<script src="/js/plugins/jquery.ui.position.min.js"></script>
|
|
||||||
<script src="/js/plugins/jquery.contextMenu.min.js"></script>
|
|
||||||
<script src="/js/plugins/drive-explorer.js"></script>
|
|
||||||
<script>
|
|
||||||
@if(isset($mode))
|
|
||||||
init("{{$folder}}","{{$mode}}");
|
|
||||||
@else
|
|
||||||
init("{{$folder}}");
|
|
||||||
@endif
|
|
||||||
</script>
|
|
||||||
@endsection
|
|
||||||
@@ -1,266 +0,0 @@
|
|||||||
@extends('layouts.admin.main')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h4 class="card-title">Permission du dossier: {{$dir->name}}</h4>
|
|
||||||
<p class="category">/{{$dir->path}}</p>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<h5>Permission des grades</h5>
|
|
||||||
<table class="table table-striped table-responsive w-100">
|
|
||||||
<thead class="table-dark">
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left" style="width: 25%">Grade</td>
|
|
||||||
<td >Lecture</td>
|
|
||||||
<td>Écriture</td>
|
|
||||||
<td>Gestion</td>
|
|
||||||
<td style="width: 6rem;">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round m-0" onclick="addPermission('{{$dir->id}}','rank')">
|
|
||||||
<i class="material-icons">add</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left">
|
|
||||||
Utilisateur non authentifié
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(isset($dir->rank_permission[0]))
|
|
||||||
@if(strpos($dir->rank_permission[0],'r') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(isset($dir->rank_permission[0]))
|
|
||||||
@if(strpos($dir->rank_permission[0],'w') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(isset($dir->rank_permission[0]))
|
|
||||||
@if(strpos($dir->rank_permission[0],'p') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td class="text-right">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round" onclick="editPermission('{{$dir->id}}','rank','0')">
|
|
||||||
<i class="material-icons">edit</i>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-danger btn-fab btn-fab-mini btn-round no-cursor" disabled data-toggle="tooltip" data-placement="bottom" title="Vous ne pouvez pas supprimer les permissions des utilisteurs non authentifié">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@foreach($dir->rank_permission as $key => $rank)
|
|
||||||
@if($key != 0)
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left">
|
|
||||||
{{\App\Rank::find($key)->name}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'r') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'w') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'p') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td class="text-right">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round" onclick="editPermission('{{$dir->id}}','rank','{{$key}}')">
|
|
||||||
<i class="material-icons">edit</i>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-danger btn-fab btn-fab-mini btn-round" onclick="deletePermission('{{$dir->id}}','rank','{{$key}}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<h5 class="mt-5">Permission des postes</h5>
|
|
||||||
<table class="table table-striped table-responsive w-100">
|
|
||||||
<thead class="table-dark">
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left" style="width: 25%">Poste</td>
|
|
||||||
<td >Lecture</td>
|
|
||||||
<td>Écriture</td>
|
|
||||||
<td>Gestion</td>
|
|
||||||
<td style="width: 6rem;">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round m-0" onclick="addPermission('{{$dir->id}}','job')">
|
|
||||||
<i class="material-icons">add</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@if(count($dir->job_permission) < 1)
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-center">
|
|
||||||
Aucune permission de poste
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endif
|
|
||||||
@foreach($dir->job_permission as $key => $rank)
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left">
|
|
||||||
{{\App\Job::find($key)->name}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'r') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'w') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'p') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td class="text-right">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round" onclick="editPermission('{{$dir->id}}','job','{{$key}}')">
|
|
||||||
<i class="material-icons">edit</i>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-danger btn-fab btn-fab-mini btn-round" onclick="deletePermission('{{$dir->id}}','job','{{$key}}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<h5 class="mt-5">Permission des utilisateurs</h5>
|
|
||||||
<table class="table table-striped table-responsive w-100">
|
|
||||||
<thead class="table-dark">
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left" style="width: 25%">Utilisateurs</td>
|
|
||||||
<td >Lecture</td>
|
|
||||||
<td>Écriture</td>
|
|
||||||
<td>Gestion</td>
|
|
||||||
<td style="width: 6rem;">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round m-0" onclick="addPermission('{{$dir->id}}','user')">
|
|
||||||
<i class="material-icons">add</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@if(count($dir->user_permission) < 1)
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-center">
|
|
||||||
Aucune permission d'utilisateur
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endif
|
|
||||||
@foreach($dir->user_permission as $key => $rank)
|
|
||||||
<tr class="text-center">
|
|
||||||
<td class="text-left">
|
|
||||||
{{\App\User::find($key)->fullname()}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'r') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'w') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(strpos($rank,'p') !== false)
|
|
||||||
<i class="fas fa-check-circle fa-2x text-success"></i>
|
|
||||||
@else
|
|
||||||
<i class="fas fa-times-circle fa-2x text-danger"></i>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td class="text-right">
|
|
||||||
<button class="btn btn-primary btn-fab btn-fab-mini btn-round" onclick="editPermission('{{$dir->id}}','user','{{$key}}')">
|
|
||||||
<i class="material-icons">edit</i>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-danger btn-fab btn-fab-mini btn-round" onclick="deletePermission('{{$dir->id}}','user','{{$key}}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@csrf
|
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Large modal</button>
|
|
||||||
|
|
||||||
<div id="permissionModal" class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content" id="permissionModalHtml">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Chargement ...</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
@loaderDot
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-primary" disabled>Sauvegarder</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@section('custom_scripts')
|
|
||||||
<script src="/js/plugins/jquery.ui.position.min.js"></script>
|
|
||||||
<script src="/js/plugins/jquery.contextMenu.min.js"></script>
|
|
||||||
<script src="/js/plugins/drive-explorer.js"></script>
|
|
||||||
@endsection
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Modification des permissions</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="/admin/drive/{{$folder->id}}/addpermission/{{$s}}" method="post">
|
|
||||||
<input id="csrf" type="hidden" name="_token" value="">
|
|
||||||
@method('patch')
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3">
|
|
||||||
@if($s == 'rank')
|
|
||||||
<select class="selectpicker" name="id" data-style="btn btn-primary btn-round" title="Grade" required>
|
|
||||||
@foreach($list as $l)
|
|
||||||
<option value="{{$l->id}}">{{$l->name}}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
@elseif($s == 'job')
|
|
||||||
<select class="selectpicker" name="id" data-style="btn btn-primary btn-round" title="Poste" required>
|
|
||||||
@foreach($list as $l)
|
|
||||||
<option value="{{$l->id}}">{{$l->name}}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
@else
|
|
||||||
<select class="selectpicker" name="id" data-style="btn btn-primary btn-round" title="Utilisateur" required>
|
|
||||||
@foreach($list as $l)
|
|
||||||
<option value="{{$l->id}}">{{$l->fullname()}}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="togglebutton row">
|
|
||||||
<div class="col-3">
|
|
||||||
<label>
|
|
||||||
<input name="read" type="checkbox">
|
|
||||||
<span class="toggle"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<label>Peux consulter les fichiers a l'intérieur du dossier</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="togglebutton row">
|
|
||||||
<div class="col-3">
|
|
||||||
<label>
|
|
||||||
<input name="write" type="checkbox">
|
|
||||||
<span class="toggle"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<label>Peux modifier les fichiers a l'intérieur du dossier</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="togglebutton row">
|
|
||||||
<div class="col-3">
|
|
||||||
<label>
|
|
||||||
<input name="perm" type="checkbox">
|
|
||||||
<span class="toggle"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<label>Peux gérer le dossier</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
$('select').selectpicker();
|
|
||||||
</script>
|
|
||||||
</form>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Modification des permissions</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="/admin/drive/{{$folder->id}}/permission/{{$s}}/{{$subject->id}}" method="post">
|
|
||||||
<input id="csrf" type="hidden" name="_token" value="">
|
|
||||||
@method('patch')
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3">
|
|
||||||
@switch($s)
|
|
||||||
@case('rank')
|
|
||||||
Grade : {{$subject->name}}
|
|
||||||
@break
|
|
||||||
@case('job')
|
|
||||||
Poste : {{$subject->name}}
|
|
||||||
@break
|
|
||||||
@case('user')
|
|
||||||
Utilisateur : {{$subject->fullname()}}
|
|
||||||
@break
|
|
||||||
@endswitch
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="togglebutton row">
|
|
||||||
<div class="col-3">
|
|
||||||
<label>
|
|
||||||
<input name="read" type="checkbox" @if(strpos($perm,'r') !== false) checked @endif>
|
|
||||||
<span class="toggle"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<label>Peux consulter les fichiers a l'intérieur du dossier</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="togglebutton row">
|
|
||||||
<div class="col-3">
|
|
||||||
<label>
|
|
||||||
<input name="write" type="checkbox" @if(strpos($perm,'w') !== false) checked @endif>
|
|
||||||
<span class="toggle"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<label>Peux modifier les fichiers a l'intérieur du dossier</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="togglebutton row">
|
|
||||||
<div class="col-3">
|
|
||||||
<label>
|
|
||||||
<input name="perm" type="checkbox" @if(strpos($perm,'p') !== false) checked @endif>
|
|
||||||
<span class="toggle"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<label>Peux gérer le dossier</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
@@ -1,154 +1,17 @@
|
|||||||
@extends('layouts.admin.main')
|
@extends('layouts.admin.main')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div style="height: 600px;">
|
||||||
<strong class="card-title">Fichiers <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
<div id="fm"></div>
|
||||||
</a></strong>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="content">
|
|
||||||
<p>Les fichiers si dessous sont disponible autant dans l'espace administration que dans l'espace cadet cadre.</p>
|
|
||||||
<table class="table table-striped dt-responsive material-datatables" id="table" style="width:100%">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Nom</th>
|
|
||||||
<th>Catégorie</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>Plan de cours Vierge</td>
|
|
||||||
<td>Plan de cours</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1i1a0sjI8I3nzt4mlcLvznjqYF-12JgfQ">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Mini Ordre Operation Projet Soirée Journée Vierge</td>
|
|
||||||
<td>Ordre d'opération</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1sqkeUp-djZDjltitGvjR0efMQgyB_sos">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Mini Ordre Operation Vierge</td>
|
|
||||||
<td>Ordre d'opération</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1RjSSwK9NIVUFbHKlu0hbkK5IeTnAFWq9">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Liste des tenues</td>
|
|
||||||
<td>Tenues</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1JUXaPQhHGJffE7CTnB1BAkqwM8g9t8ef">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cadet commandant</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1DdI9eOptKarpApsUdO-6gkDFYtD6DHi8">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cadet commandant adjoint</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1jDuKQzY3Dam0J9mSGDWiv2I1agDYacRm">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Chef entrainement</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=12p8rGhSZloPFurD--RZO9KQVoRmXAEnE">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Instructeur sénior</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=13fNufhR2hYhKgeiHUo0W_V-vF_W8SPkC">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Instructeur</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1Y1gEsNP7mz2SmJPwxi7YUfpxgioJKvR0">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Assistant Instructeur</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1BxKj0J20QZ5hVQ1womwS8GUWvuq-VsJy">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Commandant de section</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1jOmyNFZ2rSOwCFjcoABx6VFcvEMKCf73">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Commandant de la garde</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=18T3rQQ-RN551meOGGPD8Ni2wbpvKNfYz">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Commandant adjoint de section</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1A5NkPhSJ5E-bIPiLRwa7VAOXQrrHIzn6">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Commandant adjoint de garde</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1ncphhTpBm9uhq0isGFNzDs_-TRPrxfKw">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cadet cadre de la logistique</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1PcmlegtAqmdX2ufGQMubkNxfkrCcSIge">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cadet cadre de l'administration</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1haEG9jSabp10VtI7EV2OyLctn9-63T8G">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Commandant adjoint de section</td>
|
|
||||||
<td>Énoncé de fonction</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1A5NkPhSJ5E-bIPiLRwa7VAOXQrrHIzn6">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Information NECPC</td>
|
|
||||||
<td>Divers</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1KG0IoPxpqctqqVwCfM0WyKq4y6RDBtUJ">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Évaluation pratique sur la coordination d’un ordre d’opération sur le terrain</td>
|
|
||||||
<td>Divers</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=1AAPB7IdpIw8UGJwIoTNQZ3cg9ODfWrAp">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>RENCONTRE PRÉILIMINAIRE D’INSTRUCTION</td>
|
|
||||||
<td>Divers</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=16lT4YzNjGWd2SFmgSbmj1LcPG9cDkkyo">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Liste nominal des cadets</td>
|
|
||||||
<td>Divers</td>
|
|
||||||
<td><a class="btn btn-primary btn-block" href="{{\App\Config::getData('cadet_list')}}">Télécharger</a></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('breadcrumb')
|
@section('breadcrumb')
|
||||||
Fichier / Autres
|
Fichier / Explorer
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('custom_scripts')
|
@section('custom_scripts')
|
||||||
<script>
|
<script src="{{ asset('vendor/file-manager/js/file-manager.js') }}"></script>
|
||||||
$(document).ready(function() {
|
|
||||||
$('#table').DataTable({
|
|
||||||
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
|
|
||||||
"ordering" : false,
|
|
||||||
"rowGroup": {
|
|
||||||
dataSrc: 1
|
|
||||||
},
|
|
||||||
"columnDefs": [
|
|
||||||
{ "visible": false, "targets": 1 }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
} );
|
|
||||||
</script>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
@extends('layouts.admin.main')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header card-header-primary">
|
||||||
|
<h4>Mettre à jour la liste nominative</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-body mt-5">
|
||||||
|
<form method="post" enctype="multipart/form-data">
|
||||||
|
@csrf
|
||||||
|
<div class="row ml-2">
|
||||||
|
<div class="col-md-6 p-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="exampleInputEmail1">Liste nominative des cadets</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" required name="nominativeList" accept="application/pdf"></span></span>
|
||||||
|
</div>
|
||||||
|
<small id="emailHelp" class="form-text text-muted">Veuillez choisir un pdf</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 p-2">
|
||||||
|
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('custom_scripts')
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
@extends('layouts.admin.main')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">Liste nominative</h4>
|
||||||
|
<p class="category">Télécharger ici la liste nominative</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<a href="/admin/nominativelist/download" target="_blank" class="btn btn-info">Télécharger</a>
|
||||||
|
@if(\Auth::user()->p('cadet_list_edit') == 1)
|
||||||
|
<a href="/admin/nominativelist/edit" class="btn btn-warning">Modifier</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('custom_scripts')
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
<th style="width: 4.5rem">Status</th>
|
<th style="width: 4.5rem">Status</th>
|
||||||
<th style="width: 4.5rem">OREN</th>
|
<th style="width: 4.5rem">OREN</th>
|
||||||
<th style="width: 4.5rem">OCOM</th>
|
<th style="width: 4.5rem">OCOM</th>
|
||||||
|
<th style="width: 4.5rem">Niveau</th>
|
||||||
<th style="width: 7rem">Nb Periode</th>
|
<th style="width: 7rem">Nb Periode</th>
|
||||||
<th>Objectif de rendement</th>
|
<th>Objectif de rendement</th>
|
||||||
<th>Objectif de compétence</th>
|
<th>Objectif de compétence</th>
|
||||||
@@ -56,6 +57,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td onclick="navigate({{$ocom->id}})">{{$ocom->oren}}</td>
|
<td onclick="navigate({{$ocom->id}})">{{$ocom->oren}}</td>
|
||||||
<td onclick="navigate({{$ocom->id}})">{{$ocom->ocom}}</td>
|
<td onclick="navigate({{$ocom->id}})">{{$ocom->ocom}}</td>
|
||||||
|
<td onclick="navigate({{$ocom->id}})">{{$ocom->niveau()}}</td>
|
||||||
<td onclick="navigate({{$ocom->id}})">{{$ocom->nbPeriode}}</td>
|
<td onclick="navigate({{$ocom->id}})">{{$ocom->nbPeriode}}</td>
|
||||||
<td onclick="navigate({{$ocom->id}})">{{$ocom->objectif_rendement}}</td>
|
<td onclick="navigate({{$ocom->id}})">{{$ocom->objectif_rendement}}</td>
|
||||||
<td onclick="navigate({{$ocom->id}})">{{$ocom->objectif_competence}}</td>
|
<td onclick="navigate({{$ocom->id}})">{{$ocom->objectif_competence}}</td>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<td>{{$course->level}}</td>
|
<td>{{$course->level}}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
@if($course->lessonPlan)
|
@if($course->lessonPlan)
|
||||||
<a href="/file/get?d={{urlencode(\App\GoogleDriveFile::findByPath('.Systeme/.Fichier/.PlanDeCours')->id)}}&f={{urlencode($course->lessonPlan->file)}}">
|
<a href="/admin/lessonPlan/{{$course->lessonPlan->file}}">
|
||||||
@if($course->lessonPlan->approved == 1)
|
@if($course->lessonPlan->approved == 1)
|
||||||
<i class="fas fa-check-circle text-success fa-2x" data-toggle="tooltip"
|
<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>
|
data-placement="top" title="Plan de cours remis et vérifié"></i>
|
||||||
|
|||||||
@@ -7,26 +7,31 @@
|
|||||||
<h4>Ajouter une images</h4>
|
<h4>Ajouter une images</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body mt-5">
|
<div class="card-body mt-5">
|
||||||
<form action="/admin/picture/add" method="post">
|
<form action="/admin/picture/add" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Nom de l'image</label>
|
<label>Nom de l'image</label>
|
||||||
<input name="title" type="text" class="form-control">
|
<input name="title" type="text" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="form-group">
|
<div class="form-group bmd-form-group is-filled">
|
||||||
<label>URL de l'image</label>
|
<label class="label-control bmd-label-static">Choisir l'image</label>
|
||||||
<input name="url" type="text" class="form-control">
|
<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="file" required accept="image/*"></span></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<label for="desc">Description de l'image</label>
|
<label for="desc">Description de l'image</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea name="desc" id="desc" class="form-control"></textarea>
|
<textarea name="desc" id="desc" class="form-control" required></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
@@ -44,20 +49,5 @@
|
|||||||
$('#desc').trumbowyg({
|
$('#desc').trumbowyg({
|
||||||
lang: 'fr'
|
lang: 'fr'
|
||||||
});
|
});
|
||||||
function saveChange(pPerm) {
|
|
||||||
(function($) {
|
|
||||||
var myswitch = document.getElementById(pPerm);
|
|
||||||
$.post('/api/config/general/save?api_token='+api_token, { value: myswitch.checked,perm: pPerm } , function(data) {
|
|
||||||
swal({
|
|
||||||
title: 'Modification enregistré !',
|
|
||||||
type: 'success',
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.value) {
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
})(jQuery);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<h4>Ajouter une images</h4>
|
<h4>Ajouter une images</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body mt-5">
|
<div class="card-body mt-5">
|
||||||
<form action="/admin/picture/edit/{{$picture->id}}" method="post">
|
<form action="/admin/picture/edit/{{$picture->id}}" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
@@ -18,9 +18,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="form-group">
|
<div class="form-group bmd-form-group is-filled">
|
||||||
<label>URL de l'image</label>
|
<label class="label-control bmd-label-static">Choisir l'image</label>
|
||||||
<input name="url" type="text" class="form-control" value="{{$picture->url}}">
|
<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="file" accept="image/*"></span></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
|
|||||||
@@ -31,13 +31,13 @@
|
|||||||
<button class="btn btn-danger" onclick="Delete({{$picture->id}})"><i class="fas fa-times"></i></button>
|
<button class="btn btn-danger" onclick="Delete({{$picture->id}})"><i class="fas fa-times"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if($picture->pictureable)
|
{{-- @if($picture->pictureable)
|
||||||
<div class="col-xl-5 m-auto text-right">
|
<div class="col-xl-5 m-auto text-right">
|
||||||
<a href="/activity/{{$picture->pictureable->id}}" target="_blank">
|
<a href="/activity/{{$picture->pictureable->id}}" target="_blank">
|
||||||
<span class="badge badge-primary">{{$picture->pictureable->name}}</span>
|
<span class="badge badge-primary">{{$picture->pictureable->name}}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif--}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,13 +2,136 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h3 class="card-title">3.2.6</h3>
|
||||||
|
<p class="category">2020-10-19</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6 text-right">
|
||||||
|
<span class="badge badge-pill badge-success">STABLE</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<p>
|
||||||
|
Nouveauté
|
||||||
|
</p>
|
||||||
|
<ul class="list-group list-group-flush ml-3">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-plus"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Ajout d'un affichage en table pour l'horaire
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-plus"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Ajout d'une colonne niveau dans la BD des cours
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-coffee"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Mise à jour du système de fichier
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-coffee"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
De la gestion de plan de cours
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-coffee"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Mise à jour de la gestion de la liste nominative
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-coffee"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Mise à jour de l'affichage des permissions pour les postes et grades
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-coffee"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Mise à jour du profil d'utilisateur
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<p>
|
||||||
|
Bug
|
||||||
|
</p>
|
||||||
|
<ul class="list-group list-group-flush ml-3">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-bug"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Correction de multiples bugs
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||||
|
<i class="fas fa-bug"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col m-auto text-left">
|
||||||
|
Correction d'un bug d'affichage des cours
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h3 class="card-title">3.2.5</h3>
|
<h3 class="card-title">3.2.5</h3>
|
||||||
<p class="category">2019-10-19</p>
|
<p class="category">2020-10-01</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6 text-right">
|
<div class="col-sm-6 text-right">
|
||||||
<span class="badge badge-pill badge-success">STABLE</span>
|
<span class="badge badge-pill badge-success">STABLE</span>
|
||||||
|
|||||||
@@ -38,7 +38,13 @@
|
|||||||
@foreach($courses as $course)
|
@foreach($courses as $course)
|
||||||
<tr class="cursor">
|
<tr class="cursor">
|
||||||
<td>{{$course->ocom}}</td>
|
<td>{{$course->ocom}}</td>
|
||||||
<td>{{$course->name}}</td>
|
<td>
|
||||||
|
@if($course->name != "")
|
||||||
|
{{$course->name}}
|
||||||
|
@else
|
||||||
|
{{$course->desc }}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
<td>{{$course->instructor()}}</td>
|
<td>{{$course->instructor()}}</td>
|
||||||
<td>{{$course->event->date_begin}}</td>
|
<td>{{$course->event->date_begin}}</td>
|
||||||
<td class="text-center">{{$course->level}}</td>
|
<td class="text-center">{{$course->level}}</td>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
<link rel="stylesheet" href="/js/plugins/fontawesome-icon-picker/fontawesome-iconpicker.css">
|
<link rel="stylesheet" href="/js/plugins/fontawesome-icon-picker/fontawesome-iconpicker.css">
|
||||||
<link rel="stylesheet" href="/css/monolith.min.css"/>
|
<link rel="stylesheet" href="/css/monolith.min.css"/>
|
||||||
<link rel="stylesheet" href="/css/contextLoader.min.css">
|
<link rel="stylesheet" href="/css/contextLoader.min.css">
|
||||||
|
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
|
||||||
|
|
||||||
<!-- Custom CSS -->
|
<!-- Custom CSS -->
|
||||||
<link rel="stylesheet" href="/css/custom.css">
|
<link rel="stylesheet" href="/css/custom.css">
|
||||||
|
|||||||
@@ -60,24 +60,24 @@ $sidebar = [
|
|||||||
// 'perm' => 'article_see',
|
// 'perm' => 'article_see',
|
||||||
// 'child' => null
|
// 'child' => null
|
||||||
//],
|
//],
|
||||||
//'Images' => [
|
|
||||||
// 'route' => 'admin.picture',
|
|
||||||
// 'icon' => 'fas fa-images',
|
|
||||||
// 'perm' => 'picture_see',
|
|
||||||
// 'child' => null
|
|
||||||
//],
|
|
||||||
'Utilisateurs' => [
|
'Utilisateurs' => [
|
||||||
'route' => 'admin.users',
|
'route' => 'admin.users',
|
||||||
'icon' => 'fas fa-users',
|
'icon' => 'fas fa-users',
|
||||||
'perm' => 'user_see',
|
'perm' => 'user_see',
|
||||||
'child' => null
|
'child' => null
|
||||||
],
|
],
|
||||||
//'Liste nominative' => [
|
'Liste nominative' => [
|
||||||
// 'route' => 'admin.users',
|
'route' => 'admin.admin.list',
|
||||||
// 'icon' => 'fas fa-address-book',
|
'icon' => 'fas fa-address-book',
|
||||||
// 'perm' => 'cadet_list_see',
|
'perm' => 'cadet_list_see',
|
||||||
// 'child' => null
|
'child' => null
|
||||||
//],
|
],
|
||||||
|
'Images' => [
|
||||||
|
'route' => 'admin.picture',
|
||||||
|
'icon' => 'fas fa-images',
|
||||||
|
'perm' => 'picture_see',
|
||||||
|
'child' => null
|
||||||
|
],
|
||||||
'Logs' => [
|
'Logs' => [
|
||||||
'route' => 'admin.stats.log',
|
'route' => 'admin.stats.log',
|
||||||
'icon' => 'fas fa-stream',
|
'icon' => 'fas fa-stream',
|
||||||
@@ -86,12 +86,49 @@ $sidebar = [
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
//'Fichiers' => [
|
'Fichiers' => [
|
||||||
// 'route' => null,
|
'route' => null,
|
||||||
// 'icon' => 'folder',
|
'icon' => 'folder',
|
||||||
// 'perm' => 'file_see',
|
'perm' => null,
|
||||||
// 'child' => \App\GoogleDriveFile::getSidebarFile(),
|
'child' => [
|
||||||
//],
|
'Publique' => [
|
||||||
|
'route' => 'admin.files.publique',
|
||||||
|
'icon' => 'fas fa-folder-open',
|
||||||
|
'perm' => null,
|
||||||
|
'child' => null
|
||||||
|
],
|
||||||
|
'Cadets' => [
|
||||||
|
'route' => 'admin.files.cadet',
|
||||||
|
'icon' => 'fas fa-folder-open',
|
||||||
|
'perm' => 'files_cadets_see',
|
||||||
|
'child' => null
|
||||||
|
],
|
||||||
|
'Staff' => [
|
||||||
|
'route' => 'admin.files.staff',
|
||||||
|
'icon' => 'fas fa-folder-open',
|
||||||
|
'perm' => 'files_staff_see',
|
||||||
|
'child' => null
|
||||||
|
],
|
||||||
|
'Instruction' => [
|
||||||
|
'route' => 'admin.instruction.files',
|
||||||
|
'icon' => 'fas fa-folder-open',
|
||||||
|
'perm' => 'files_instruction_see',
|
||||||
|
'child' => null
|
||||||
|
],
|
||||||
|
'ETAMAS' => [
|
||||||
|
'route' => 'admin.files.etamas',
|
||||||
|
'icon' => 'fas fa-folder-open',
|
||||||
|
'perm' => 'files_etamas_see',
|
||||||
|
'child' => null
|
||||||
|
],
|
||||||
|
'Officiers' => [
|
||||||
|
'route' => 'admin.files.officier',
|
||||||
|
'icon' => 'fas fa-folder-open',
|
||||||
|
'perm' => 'files_officier_see',
|
||||||
|
'child' => null
|
||||||
|
]
|
||||||
|
],
|
||||||
|
],
|
||||||
'Configuration' => [
|
'Configuration' => [
|
||||||
'route' => null,
|
'route' => null,
|
||||||
'icon' => 'menu_book',
|
'icon' => 'menu_book',
|
||||||
@@ -127,12 +164,12 @@ $sidebar = [
|
|||||||
'perm' => 'config_edit_job',
|
'perm' => 'config_edit_job',
|
||||||
'child' => null
|
'child' => null
|
||||||
],
|
],
|
||||||
//'Fichier' => [
|
'Fichier' => [
|
||||||
// 'route' => 'admin.config.files',
|
'route' => 'admin.config.files',
|
||||||
// 'icon' => 'fas fa-folder',
|
'icon' => 'fas fa-folder',
|
||||||
// 'perm' => 'config_edit_files',
|
'perm' => 'config_edit_files',
|
||||||
// 'child' => null
|
'child' => null
|
||||||
//],
|
],
|
||||||
'Apparence' => [
|
'Apparence' => [
|
||||||
'route' => 'admin.config.customisation',
|
'route' => 'admin.config.customisation',
|
||||||
'icon' => 'fas fa-palette',
|
'icon' => 'fas fa-palette',
|
||||||
|
|||||||
@@ -76,12 +76,6 @@ Route::middleware('auth:api')->group(function () {
|
|||||||
Route::post('/course/{id}/plan/validate','CourseController@validatePlan')->middleware('courseperm:validate_plan');;
|
Route::post('/course/{id}/plan/validate','CourseController@validatePlan')->middleware('courseperm:validate_plan');;
|
||||||
|
|
||||||
/** File Exlorer Route */
|
/** File Exlorer Route */
|
||||||
Route::get('/drive/{folder}/permission/{subject}/{id}','GoogleDriveController@editPermissionModal')->middleware('perm:file_see');
|
|
||||||
Route::get('/drive/{folder}/addpermission/{subject}','GoogleDriveController@addPermissionModal')->middleware('perm:file_see');
|
|
||||||
Route::get('/drive/folders/{folder?}','GoogleDriveController@list')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/drive/path/{folder}','GoogleDriveController@getPath')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/drive/patharray','GoogleDriveController@getPathArray')->middleware('perm:file_see');
|
|
||||||
Route::get('/drive/files/{dir}/{file}','GoogleDriveController@showMetadata')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/drive/checkfilestructure','GoogleDriveController@checkFileSystem')->middleware('perm:config_edit');;
|
Route::get('/drive/checkfilestructure','GoogleDriveController@checkFileSystem')->middleware('perm:config_edit');;
|
||||||
|
|
||||||
Route::get('/user/perm/{id}', function($id) {
|
Route::get('/user/perm/{id}', function($id) {
|
||||||
|
|||||||
+13
-1
@@ -341,10 +341,22 @@ Breadcrumbs::for('admin.stats.instruction', function ($trail) {
|
|||||||
$trail->push('Statistique de l\'instruction', route('admin.stats.instruction'));
|
$trail->push('Statistique de l\'instruction', route('admin.stats.instruction'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Admin > List
|
||||||
|
Breadcrumbs::for('admin.admin.list', function ($trail) {
|
||||||
|
$trail->parent('admin.dashboard');
|
||||||
|
$trail->push('Liste Nominative', route('admin.admin.list'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Admin > List
|
||||||
|
Breadcrumbs::for('admin.admin.list.update', function ($trail) {
|
||||||
|
$trail->parent('admin.admin.list');
|
||||||
|
$trail->push('Mettre à jour la liste Nominative', route('admin.admin.list.update'));
|
||||||
|
});
|
||||||
|
|
||||||
// Admin > Files
|
// Admin > Files
|
||||||
Breadcrumbs::for('admin.files', function ($trail) {
|
Breadcrumbs::for('admin.files', function ($trail) {
|
||||||
$trail->parent('admin.dashboard');
|
$trail->parent('admin.dashboard');
|
||||||
$trail->push('Mes fichier', route('admin.files'));
|
$trail->push('Fichiers', route('admin.files'));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Admin > Files > Cadet
|
// Admin > Files > Cadet
|
||||||
|
|||||||
+15
-20
@@ -30,7 +30,8 @@ Route::get('/activity/{id}', 'ComplementaryActivityController@show');
|
|||||||
Route::get('/picture/{id}', 'PictureController@show');
|
Route::get('/picture/{id}', 'PictureController@show');
|
||||||
Route::get('/pictures', 'PictureController@index');
|
Route::get('/pictures', 'PictureController@index');
|
||||||
|
|
||||||
Route::get('/file/get', 'GoogleDriveController@getFile')->middleware('fileperm:file,r');
|
Route::get('/api/files/{path}', 'FilesController@show')->where('path','.*');
|
||||||
|
|
||||||
|
|
||||||
/** Setup */
|
/** Setup */
|
||||||
Route::get('/admin/setup', 'AdminController@setup')->middleware('auth')->name('admin.setup');
|
Route::get('/admin/setup', 'AdminController@setup')->middleware('auth')->name('admin.setup');
|
||||||
@@ -177,7 +178,7 @@ Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
|
|||||||
/** Instruction */
|
/** Instruction */
|
||||||
Route::get('/admin/instruction', 'AdminController@instruction')->name('instruction');
|
Route::get('/admin/instruction', 'AdminController@instruction')->name('instruction');
|
||||||
Route::get('/admin/instruction/guide', 'FilesController@guide')->middleware('perm:instruction_guide_see')->name('instruction.guide');
|
Route::get('/admin/instruction/guide', 'FilesController@guide')->middleware('perm:instruction_guide_see')->name('instruction.guide');
|
||||||
Route::get('/admin/instruction/files', 'FilesController@instruction')->middleware('perm:file_see')->name('instruction.files');
|
Route::get('/admin/instruction/files', 'FilesController@instruction')->middleware('perm:files_instruction_see')->name('instruction.files');
|
||||||
|
|
||||||
/** Courses */
|
/** Courses */
|
||||||
Route::get('/admin/course', 'CourseController@index')->name('course');
|
Route::get('/admin/course', 'CourseController@index')->name('course');
|
||||||
@@ -187,27 +188,21 @@ Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
|
|||||||
Route::patch('/admin/course/{id}/plan/commentOfficer', 'CourseController@updateCommentOfficerPlan')->middleware('courseperm:comment_plan_officer');
|
Route::patch('/admin/course/{id}/plan/commentOfficer', 'CourseController@updateCommentOfficerPlan')->middleware('courseperm:comment_plan_officer');
|
||||||
Route::patch('/admin/course/{id}/plan/comment', 'CourseController@updateCommentPlan')->middleware('courseperm:edit');
|
Route::patch('/admin/course/{id}/plan/comment', 'CourseController@updateCommentPlan')->middleware('courseperm:edit');
|
||||||
Route::post('/admin/course/{id}/lessonPlan', 'CourseController@updateLessonPlan')->middleware('courseperm:edit');
|
Route::post('/admin/course/{id}/lessonPlan', 'CourseController@updateLessonPlan')->middleware('courseperm:edit');
|
||||||
|
Route::get('/admin/lessonPlan/{name}','CourseController@downloadLessonPlan')->where('name','.*');
|
||||||
|
|
||||||
/** Files */
|
/** Files */
|
||||||
Route::post('/file/create', 'GoogleDriveController@createFile')->middleware('fileperm:folder,w');
|
Route::get('/admin/files', 'FilesController@index')->name('files');
|
||||||
Route::post('/file/upload', 'GoogleDriveController@uploadFile')->middleware('fileperm:folder,w');
|
Route::get('/admin/files/cadet', 'FilesController@cadet')->middleware('perm:files_cadets_see')->name('files.cadet');
|
||||||
Route::post('/folder/create', 'GoogleDriveController@createFolder')->middleware('fileperm:folder,w');
|
Route::get('/admin/files/staff', 'FilesController@staff')->middleware('perm:files_staff_see')->name('files.staff');
|
||||||
Route::get('/file/delete', 'GoogleDriveController@deleteFile')->middleware('perm:file_delete')->middleware('fileperm:folder,w');
|
Route::get('/admin/files/etamas', 'FilesController@etamas')->middleware('perm:files_etamas_see')->name('files.etamas');
|
||||||
Route::get('/folder/delete', 'GoogleDriveController@deleteDir')->middleware('perm:file_delete')->middleware('fileperm:folder,w');
|
Route::get('/admin/files/officier', 'FilesController@officier')->middleware('perm:files_officier_see')->name('files.officier');
|
||||||
Route::get('/admin/files', 'FilesController@index')->middleware('perm:file_see')->name('files');
|
Route::get('/admin/files/publique', 'FilesController@publique')->name('files.publique');
|
||||||
Route::get('/admin/files/cadet', 'FilesController@cadet')->middleware('perm:file_see')->name('files.cadet')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/admin/files/staff', 'FilesController@staff')->middleware('perm:file_see')->name('files.staff')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/admin/files/etamas', 'FilesController@etamas')->middleware('perm:file_see')->name('files.etamas')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/admin/files/officier', 'FilesController@officier')->middleware('perm:file_see')->name('files.officier')->middleware('fileperm:folder,r');
|
|
||||||
Route::get('/admin/files/publique', 'FilesController@publique')->middleware('perm:file_see')->name('files.publique')->middleware('fileperm:folder,r');
|
|
||||||
|
|
||||||
Route::get('/admin/drive/{folder?}', 'GoogleDriveController@index')->middleware('fileperm:folder,r', 'perm:drive_see')->name('drive');
|
|
||||||
Route::get('/admin/folder/{folder?}', 'GoogleDriveController@index')->middleware('fileperm:folder,r')->name('drive');
|
|
||||||
Route::get('/admin/drive/{folder}/permission', 'GoogleDriveController@editPermission')->middleware('fileperm:folder,p')->name('drive.permission');
|
|
||||||
Route::patch('/admin/drive/{folder}/permission/{subject}/{id}', 'GoogleDriveController@patchPermission')->middleware('perm:file_see', 'fileperm:folder,p');
|
|
||||||
Route::get('/admin/drive/{folder}/deletepermission/{subject}/{id}', 'GoogleDriveController@deletePermission')->middleware('perm:file_see', 'fileperm:folder,p');
|
|
||||||
Route::patch('/admin/drive/{folder}/addpermission/{subject}', 'GoogleDriveController@addPermission')->middleware('perm:file_see', 'fileperm:folder,p');
|
|
||||||
|
|
||||||
|
/** List Cadet */
|
||||||
|
Route::get('/admin/nominativelist','FilesController@show_nominativeList')->middleware('perm:cadet_list_see')->name('admin.list');
|
||||||
|
Route::get('/admin/nominativelist/edit','FilesController@edit_nominativeList')->middleware('perm:cadet_list_edit')->name('admin.list.update');
|
||||||
|
Route::post('/admin/nominativelist/edit','FilesController@update_nominativeList')->middleware('perm:cadet_list_edit');
|
||||||
|
Route::get('/admin/nominativelist/download','FilesController@download_nominativeList')->middleware('perm:cadet_list_see');
|
||||||
|
|
||||||
/** OCOM */
|
/** OCOM */
|
||||||
Route::get('/admin/ocom', 'OCOMController@index')->name('ocom')->middleware('perm:instruction_db_ocom_see');
|
Route::get('/admin/ocom', 'OCOMController@index')->name('ocom')->middleware('perm:instruction_db_ocom_see');
|
||||||
|
|||||||
Reference in New Issue
Block a user