This commit is contained in:
Mathieu Lagace
2019-10-19 13:11:42 -04:00
parent 498c80f404
commit 799261a7d5
10 changed files with 233 additions and 399 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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