mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
3.2.4
This commit is contained in:
@@ -50,7 +50,14 @@ class EventController extends Controller
|
||||
$event->is_mandatory = 0;
|
||||
}
|
||||
$event->desc = request('desc');
|
||||
$event->msg = request('msg');
|
||||
if(\request('msg'))
|
||||
{
|
||||
$event->msg = request('msg');
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->msg = "";
|
||||
}
|
||||
$event->date_msg = request('date_msg');
|
||||
$event->save();
|
||||
|
||||
|
||||
@@ -43,90 +43,22 @@ class JobController extends Controller
|
||||
{
|
||||
$job = new Job;
|
||||
|
||||
$job->name = request('name');
|
||||
$job->acces_level = request('acces_level');
|
||||
$job->desc = request('desc');
|
||||
|
||||
if (null !==(request('schedule_see'))) {
|
||||
$job->schedule_see = request('schedule_see');
|
||||
} else {
|
||||
$job->schedule_see = false;
|
||||
}
|
||||
|
||||
if (null !==(request('schedule_edit'))) {
|
||||
$job->schedule_edit = 1;
|
||||
} else {
|
||||
$job->schedule_edit = false;
|
||||
}
|
||||
if (null !==(request('schedule_notify'))) {
|
||||
$job->schedule_notify = 1;
|
||||
} else {
|
||||
$job->schedule_notify = false;
|
||||
}
|
||||
if (null !==(request('message_see'))) {
|
||||
$job->message_see = 1;
|
||||
} else {
|
||||
$job->message_see = false;
|
||||
}
|
||||
if (null !==(request('message_edit'))) {
|
||||
$job->message_edit = 1;
|
||||
} else {
|
||||
$job->message_edit = false;
|
||||
}
|
||||
if (null !==(request('message_notify'))) {
|
||||
$job->message_notify = 1;
|
||||
} else {
|
||||
$job->message_notify = false;
|
||||
}
|
||||
if (null !==(request('paper_edit'))) {
|
||||
$job->paper_edit = 1;
|
||||
} else {
|
||||
$job->paper_edit = false;
|
||||
}
|
||||
if (null !==(request('paper_publish'))) {
|
||||
$job->paper_publish = 1;
|
||||
} else {
|
||||
$job->paper_publish = false;
|
||||
}
|
||||
if (null !==(request('paper_notify'))) {
|
||||
$job->paper_notify = 1;
|
||||
} else {
|
||||
$job->paper_notify = false;
|
||||
}
|
||||
if (null !==(request('inventory_see'))) {
|
||||
$job->inventory_see = 1;
|
||||
} else {
|
||||
$job->inventory_see = false;
|
||||
}
|
||||
if (null !==(request('inventory_edit'))) {
|
||||
$job->inventory_edit = 1;
|
||||
} else {
|
||||
$job->inventory_edit = false;
|
||||
}
|
||||
if (null !==(request('inventory_notify'))) {
|
||||
$job->inventory_notify = 1;
|
||||
} else {
|
||||
$job->inventory_notify = false;
|
||||
}
|
||||
if (null !==(request('user_see'))) {
|
||||
$job->user_see = 1;
|
||||
} else {
|
||||
$job->user_see = false;
|
||||
}
|
||||
if (null !==(request('user_edit'))) {
|
||||
$job->user_edit = 1;
|
||||
} else {
|
||||
$job->user_edit = false;
|
||||
}
|
||||
if (null !==(request('user_notify'))) {
|
||||
$job->user_notify = 1;
|
||||
} else {
|
||||
$job->user_notify = false;
|
||||
$job->name = $request->name;
|
||||
$job->desc = $request->desc;
|
||||
|
||||
$tpermission = [];
|
||||
|
||||
foreach (\App\Permission::all() as $perm)
|
||||
{
|
||||
$tkey = $perm->ckey;
|
||||
$tpermission[$tkey] = $request->$tkey;
|
||||
}
|
||||
|
||||
$job->permissions = json_encode($tpermission);
|
||||
$job->save();
|
||||
|
||||
return redirect('/admin/config/job/'.$job->id);
|
||||
clog('add','success','Poste ajouté avec succès');
|
||||
return redirect('/admin/config/jobs')->with('success','Poste ajouté avec succès');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,9 +94,26 @@ class JobController extends Controller
|
||||
* @param \App\Job $job
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Job $job)
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
$job = Job::find($id);
|
||||
|
||||
$job->name = $request->name;
|
||||
$job->desc = $request->desc;
|
||||
|
||||
$tpermission = [];
|
||||
|
||||
foreach (\App\Permission::all() as $perm)
|
||||
{
|
||||
$tkey = $perm->ckey;
|
||||
$tpermission[$tkey] = $request->$tkey;
|
||||
}
|
||||
|
||||
$job->permissions = json_encode($tpermission);
|
||||
$job->save();
|
||||
|
||||
clog('add','success','Poste modifié avec succès');
|
||||
return redirect('/admin/config/jobs')->with('success','Poste modifié avec succès');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,7 +70,7 @@ class UserController extends Controller
|
||||
|
||||
$user->avatar = rand(1,16);
|
||||
$user->rank_id = request('rank');
|
||||
$user->job = request('job');
|
||||
$user->job_id = request('job');
|
||||
$user->password = bcrypt(request('psw'));
|
||||
$user->api_token = str_random(60);
|
||||
|
||||
@@ -142,7 +142,7 @@ class UserController extends Controller
|
||||
}
|
||||
|
||||
$user->rank_id = request('rank');
|
||||
$user->job = request('job');
|
||||
$user->job_id = request('job');
|
||||
if (request('psw') != null) {
|
||||
$user->password = bcrypt(request('psw'));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class News extends Model
|
||||
|
||||
foreach (\App\Event::future() as $event)
|
||||
{
|
||||
if($event->type = 1)
|
||||
if($event->type == 1 && $event->msg != "")
|
||||
{
|
||||
if (date('U',strtotime($event->date_msg)) <= time())
|
||||
{
|
||||
|
||||
4
public/js/app.js
vendored
4
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js",
|
||||
"/css/app.css": "/css/app.css",
|
||||
"/css/material-dashboard.css": "/css/material-dashboard.css",
|
||||
"/css/custom.css": "/css/custom.css"
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
@if($rank->id == 1)
|
||||
<button disabled class="btn btn-danger btn-just-icon"><i class="fa fa-close"></i></button>
|
||||
@else
|
||||
<button class="btn btn-danger btn-just-icon"><i class="fa fa-close"></i></button>
|
||||
<button class="btn btn-danger btn-just-icon" onclick="deleteRanks({{$rank->id}})"><i class="fa fa-close"></i></button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,3 +46,43 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
function deleteRanks(pid){
|
||||
swal({
|
||||
title: 'Êtes vous certain ?',
|
||||
html:
|
||||
'Vous ne pourrez annuler cette action! <br>' +
|
||||
'<strong>Veuillez donner un nouveau grade a tous les utilisateurs posédant présentement le grade que vous voulez supprimer</strong>',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/config/rank/delete?api_token='+api_token, { id: pid } , function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"Le grade a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -1,167 +1,87 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Ajouter un poste <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="/admin/config/job/add" method="post">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Ajouter un poste</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<form method="post" action="/admin/config/jobs/add">
|
||||
@csrf
|
||||
|
||||
@csrf
|
||||
|
||||
<div id="myTabContent">
|
||||
<div id="name" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="name">Nom du poste</label>
|
||||
<input type="text" class="form-control" name="name" id="name" aria-describedby="helpId" placeholder="" required>
|
||||
<small id="helpId" class="form-text text-muted">Nom du poste</small>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-12"><textarea name="desc" id="desc" rows="9" class="form-control" required></textarea>
|
||||
<small class="form-text text-muted">Description du poste</small></div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Niveau d'accès</label></div>
|
||||
<div class="col col-md-3">
|
||||
<select name="acces_level" id="acces_level" class="form-control" required>
|
||||
<option value="0">Cadet</option>
|
||||
<option value="regular">Staff</option>
|
||||
<option value="pilotage">Officer</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Horaire détaillé</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter les détails de l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="schedule_see" name="schedule_see" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification horaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des événements a l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="schedule_edit" name="schedule_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation horaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements a l'horaire.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="schedule_notify" name="schedule_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter les messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="message_see" name="message_see" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="message_edit" name="message_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les messages.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="message_notify" name="message_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification article</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="paper_edit" name="paper_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Publication articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste peux t-il autoriser la publication ou appouver des changements a un articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="paper_publish" name="paper_publish" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="paper_notify" name="paper_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="inventory_see" name="inventory_see" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="inventory_edit" name="inventory_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="inventory_notify" name="inventory_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des utilisateurs</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="user_edit" name="user_edit" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les utilisateurs.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="user_notify" name="user_notify" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<label>Nom</label>
|
||||
<input class="form-control" type="text" name="name">
|
||||
<small class="form-text text-muted">Nom du poste</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-dot-circle-o"></i> Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<textarea id="desc" name="desc"></textarea>
|
||||
<small class="form-text text-muted">Description du poste</small>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="col-md-12">
|
||||
<h3>Permissions du poste</h3>
|
||||
<p>
|
||||
Choisissez quels permissions doivent être associé avec ce poste.
|
||||
</p>
|
||||
<div id="accordion" role="tablist">
|
||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="headingOne">
|
||||
<h5 class="mb-0">
|
||||
<a class="text-capitalize" data-toggle="collapse" href="#coll-{{$key}}" @if ($loop->first) aria-expanded="true" @endif aria-controls="collapseOne">
|
||||
{{$key}}
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
@section('breadcrumb')
|
||||
<div class="breadcrumbs">
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header float-left">
|
||||
<div class="page-title">
|
||||
<h1>{{ trans('admin/dashboard.page_title')}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header float-right">
|
||||
<div class="page-title">
|
||||
<ol class="breadcrumb text-right">
|
||||
<li class="active">{{ trans('admin/dashboard.breadcrumb')}}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div id="coll-{{$key}}" class="collapse @if ($loop->first) show @endif" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($cat as $r)
|
||||
<div class="col text-center">
|
||||
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
|
||||
<h5>{{$r['communName']}}</h5>
|
||||
<div class="btn-group">
|
||||
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fa fa-close"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<p>
|
||||
<small>{{$r['desc']}}</small>
|
||||
</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-5">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
|
||||
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=r82pabvd9arn3fjb1e2fsolf2xpixuv4hwfwart4cf1fb7mx"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#desc',
|
||||
branding: false,
|
||||
menubar: 'edit view format'
|
||||
<script src="/js/permissions.js"></script>
|
||||
<script>
|
||||
$('#desc').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endsection
|
||||
</script>
|
||||
@endsection
|
||||
@@ -1,167 +1,87 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Modification du poste : {{$job->name}}<a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<div class="tab-content pl-3 p-1" id="myTabContent">
|
||||
<div id="{{$job->name}}" role="tabpanel" aria-labelledby="{{$job->name}}-tab">
|
||||
<div class="row form-group">
|
||||
<div class="col-12"><textarea name="{{$job->id}}_desc" name="{{$job->id}}_desc" rows="9" class="form-control"></textarea>
|
||||
<small class="form-text text-muted">Description du poste</small></div>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Configuration du poste {{$job->name}}</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<form method="post" action="">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Nom</label>
|
||||
<input class="form-control" type="text" name="name" value="{{$job->name}}">
|
||||
<small class="form-text text-muted">Nom du poste</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<textarea id="desc" name="desc">{!! $job->desc !!}</textarea>
|
||||
<small class="form-text text-muted">Description du poste</small>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Niveau d'accès</label></div>
|
||||
<div class="col col-md-3">
|
||||
<select name="{{$job->id}}_event_type" name="{{$job->id}}_event_type" class="form-control">
|
||||
@switch($job->acces_level)
|
||||
@case(1)
|
||||
<option value="1">Staff</option>
|
||||
@break
|
||||
@case(2)
|
||||
<option value="2">Officer</option>
|
||||
@break
|
||||
@default
|
||||
<option value="0">Cadet</option>
|
||||
@endswitch
|
||||
<option value="0">Cadet</option>
|
||||
<option value="1">Staff</option>
|
||||
<option value="2">Officer</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Horaire détaillé</label><small class="form-text text-muted">|| {{$job->schedule_see}} || L'utilisateur avec ce poste peut t'il consulter les détails de l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_schedule_see" name="{{$job->id}}_schedule_see" class="switch-input" @if($job->schedule_see == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification horaire</label><small class="form-text text-muted">|| {{$job->schedule_edit}} || L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des événements a l'horaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_schedule_edit" name="{{$job->id}}_schedule_edit" class="switch-input" @if($job->schedule_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation horaire</label><small class="form-text text-muted">|| {{$job->schedule_notify}} || L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements a l'horaire.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_schedule_notify" name="{{$job->id}}_schedule_notify" class="switch-input" @if($job->schedule_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation messages</label><small class="form-text text-muted">|| {{$job->message_see}} || L'utilisateur avec ce poste peut t'il consulter les messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_message_see" name="{{$job->id}}_message_see" class="switch-input" @if($job->message_see == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des messages</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_message_edit" name="{{$job->id}}_message_edit" class="switch-input" @if($job->message_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation messages</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les messages.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_message_notify" name="{{$job->id}}_message_notify" class="switch-input" @if($job->message_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification article</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_paper_edit" name="{{$job->id}}_paper_edit" class="switch-input" @if($job->paper_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Publication articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste peux t-il autoriser la publication ou appouver des changements a un articles</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_paper_publish" name="{{$job->id}}_paper_publish" class="switch-input" @if($job->paper_publish == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation articles</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_paper_notify" name="{{$job->id}}_paper_notify" class="switch-input" @if($job->paper_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Consultation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il consulter l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_inventory_see" name="{{$job->id}}_inventory_see" class="switch-input" @if($job->inventory_see == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer l'inventaire</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_inventory_edit" name="{{$job->id}}_inventory_edit" class="switch-input" @if($job->inventory_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation inventaire</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les articles.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_inventory_notify" name="{{$job->id}}_inventory_notify" class="switch-input" @if($job->inventory_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Modification utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste peut t'il ajouter, modifier et supprimer des utilisateurs</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_user_edit" name="{{$job->id}}_user_edit" class="switch-input" @if($job->user_edit == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
<div class="col col-md-3"><label for="text-input" class=" form-control-label">Notifiation utilisateur</label><small class="form-text text-muted"> L'utilisateur avec ce poste doit t-il recevoir des notifiation pour tous les changements en lien avec les utilisateurs.</small></div>
|
||||
<div class="col col-md-3" style="margin: auto;">
|
||||
<label for="disabled-input" class=" form-control-label"></label>
|
||||
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input name="{{$job->id}}_user_notify" name="{{$job->id}}_user_notify" class="switch-input" @if($job->user_notify == "1") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-dot-circle-o"></i> Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<div class="col-md-12">
|
||||
<h3>Permissions du poste</h3>
|
||||
<p>
|
||||
Choisissez quels permissions doivent être associé avec ce poste.
|
||||
</p>
|
||||
<div id="accordion" role="tablist">
|
||||
@foreach(\App\Permission::allToArray() as $key => $cat)
|
||||
<div class="card card-collapse">
|
||||
<div class="card-header" role="tab" id="headingOne">
|
||||
<h5 class="mb-0">
|
||||
<a class="text-capitalize" data-toggle="collapse" href="#coll-{{$key}}" @if ($loop->first) aria-expanded="true" @endif aria-controls="collapseOne">
|
||||
{{$key}}
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
@section('breadcrumb')
|
||||
<div class="breadcrumbs">
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header float-left">
|
||||
<div class="page-title">
|
||||
<h1>{{ trans('admin/dashboard.page_title')}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header float-right">
|
||||
<div class="page-title">
|
||||
<ol class="breadcrumb text-right">
|
||||
<li class="active">{{ trans('admin/dashboard.breadcrumb')}}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div id="coll-{{$key}}" class="collapse @if ($loop->first) show @endif" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($cat as $r)
|
||||
<div class="col text-center">
|
||||
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}" value="{{$job->p($r['ckey'])}}">
|
||||
<h5>{{$r['communName']}}</h5>
|
||||
<div class="btn-group">
|
||||
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon @if($job->p($r['ckey']) != -1) btn-outline-danger @else btn-danger @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fa fa-close"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon @if($job->p($r['ckey']) == 0) btn-warning @else btn-outline-warning @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>
|
||||
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon @if($job->p($r['ckey']) != 1) btn-outline-success @else btn-success @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<p>
|
||||
<small>{{$r['desc']}}</small>
|
||||
</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-5">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=r82pabvd9arn3fjb1e2fsolf2xpixuv4hwfwart4cf1fb7mx"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#<?php echo $job->id?>_desc',
|
||||
branding: false,
|
||||
menubar: 'edit view format'
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
<script src="/js/permissions.js"></script>
|
||||
<script>
|
||||
$('#desc').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -107,7 +107,7 @@
|
||||
<div class="form-group">
|
||||
<label for="job">Poste</label>
|
||||
<select class="form-control" name="job" id="job" required>
|
||||
<option value={{$user->job}}>{{\App\Job::find($user->job)->name}}</option>
|
||||
<option value={{$user->job->id}}>{{$user->job->name}}</option>
|
||||
@foreach ($JobsList as $job)
|
||||
<option value="{{$job->id}}">{{$job->name}}</option>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user