50 Commits

Author SHA1 Message Date
Mathieu Lagacé 2f9e6d4d15 Update Picture to S3 2020-10-24 19:28:09 -04:00
Mathieu Lagacé 4f83774200 File systeme V3 2020-10-19 18:45:05 -04:00
Mathieu Lagacé 1664bb06aa Merge branch 'master' into file-v3
# Conflicts:
#	config/version.yml
2020-10-13 14:48:50 -04:00
Mathieu Lagace 1bec8805a7 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!116
2020-10-06 23:05:17 +00:00
Mathieu Lagace 5b69a9943e Merge branch 'hide-event' into 'dev'
Hide event

See merge request TheGamecraft/c-cms!115
2020-10-06 22:59:11 +00:00
Mathieu Lagacé f7845d8f1b hide event 2020-10-06 18:54:56 -04:00
Mathieu Lagace 63301aec97 Merge branch 'schedule-table' into 'master'
Schedule Table view update & permissions update

See merge request TheGamecraft/c-cms!114
2020-10-02 22:09:26 +00:00
Mathieu Lagacé 9cdd47a6f4 Schedule Table view update & permissions update 2020-10-02 18:05:03 -04:00
Mathieu Lagace 6eb517a0cb Merge branch 'schedule-table' into 'master'
Update app/Event.php

See merge request TheGamecraft/c-cms!113
2020-10-02 18:19:38 +00:00
Mathieu Lagace 95a088ddc6 Update app/Event.php 2020-10-02 18:15:24 +00:00
Mathieu Lagace f1df0ee562 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!112
2020-10-02 17:50:43 +00:00
Mathieu Lagace ef66ed3d69 Merge branch 'schedule-table' into 'dev'
Schedule table

See merge request TheGamecraft/c-cms!111
2020-10-02 17:06:02 +00:00
Mathieu Lagace f45bc5522e Merge branch 'dev' into 'schedule-table'
# Conflicts:
#   config/version.yml
2020-10-02 17:02:03 +00:00
Mathieu Lagacé 60c5a995f2 Add table view for calendar 2020-10-02 12:38:07 -04:00
Mathieu Lagacé 2a8178c6f3 Fix edit event bug 2020-09-12 10:44:15 -04:00
Mathieu Lagacé 60f0e1c7ec filesysteme 2020-09-12 10:14:10 -04:00
Mathieu Lagacé b3f471e6e9 filesysteme 2020-09-12 10:13:21 -04:00
Mathieu Lagace ae00c9e7e0 Update .gitlab-ci.yml 2020-08-03 15:50:53 +00:00
Mathieu Lagace d730f358fe Update .gitlab-ci.yml 2020-08-03 15:49:18 +00:00
Mathieu Lagace ba1d56c7d3 Merge branch 'update-profil' into 'dev'
update profil

See merge request TheGamecraft/c-cms!109
2020-08-03 15:48:08 +00:00
Mathieu Lagace 6d50d2c57a update profil 2020-08-03 11:44:07 -04:00
Mathieu Lagace 465bac0e94 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!108
2020-07-31 22:11:30 +00:00
Mathieu Lagace ec7a6c57f5 Update Envoy.blade.php 2020-07-31 21:59:54 +00:00
Mathieu Lagace efd70e3fea Merge branch 'update-profil' into 'dev'
fix bug in news when user is delete

See merge request TheGamecraft/c-cms!107
2020-07-31 21:40:50 +00:00
Mathieu Lagace d8e36b8479 fix bug in news when user is delete 2020-07-31 17:36:46 -04:00
Mathieu Lagace 2b3b64362a Merge branch 'update-profil' into 'dev'
add first login logic

See merge request TheGamecraft/c-cms!106
2020-07-31 21:33:48 +00:00
Mathieu Lagace 8158f8a8aa add first login logic 2020-07-31 17:29:47 -04:00
Mathieu Lagace 039b09b681 Update Envoy.blade.php 2020-07-31 00:20:52 +00:00
Mathieu Lagace c703ade5cb Merge branch 'update-schedule' into 'dev'
Update schedule

See merge request TheGamecraft/c-cms!105
2020-07-30 22:46:56 +00:00
Mathieu Lagace 143ccc3750 Merge branch '3.2.4' into 'master'
3.2.4

See merge request TheGamecraft/c-cms!86
2019-12-10 15:32:42 +00:00
Mathieu Lagace 31e26b6747 Merge branch '3.2.4' into 'master'
Fix for mobile

See merge request TheGamecraft/c-cms!85
2019-11-09 01:05:52 +00:00
Mathieu Lagace 5c61b124f8 Merge branch '3.2.4' into 'master'
Fix for mobile

See merge request TheGamecraft/c-cms!83
2019-11-08 22:25:19 +00:00
Mathieu Lagace 7f032f5fa7 Merge branch '3.2.4' into 'master'
Hotfix

See merge request TheGamecraft/c-cms!82
2019-11-07 22:08:09 +00:00
Mathieu Lagace 5585b8a8a7 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!81
2019-11-07 20:59:07 +00:00
Mathieu Lagace 21111ae622 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!79
2019-10-19 20:38:52 +00:00
Mathieu Lagace 44a4035f42 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!76
2019-10-19 20:08:47 +00:00
Mathieu Lagace 14cdc8b880 Merge branch '3.2.3' into 'master'
3.2.3

See merge request TheGamecraft/c-cms!68
2019-09-13 20:51:47 +00:00
Mathieu Lagace 0f28be3218 Merge branch '3.2.3' into 'master'
3.2.3

See merge request TheGamecraft/c-cms!67
2019-09-13 20:48:50 +00:00
Mathieu Lagace dccc76d7e7 Merge branch '3.2.3' into 'master'
3.2.3

See merge request TheGamecraft/c-cms!66
2019-09-13 20:42:42 +00:00
Mathieu Lagace 037b3b4c47 Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!65
2019-09-13 20:33:08 +00:00
Mathieu Lagace f4dd3ed742 Merge branch 'dev' into 'master'
3.2.1

See merge request TheGamecraft/c-cms!60
2019-09-11 12:39:39 +00:00
Mathieu Lagace 9a65920265 Merge branch 'dev' into 'master'
Fix 3.2.1c

See merge request TheGamecraft/c-cms!58
2019-09-04 01:33:44 +00:00
Mathieu Lagace 245c357b7a Merge branch 'dev' into 'master'
Fix 3.2.1b

See merge request TheGamecraft/c-cms!56
2019-09-03 21:41:39 +00:00
Mathieu Lagace 3a05ddfb0d Merge branch 'dev' into 'master'
Fix 3.2.1a

See merge request TheGamecraft/c-cms!54
2019-09-03 21:25:39 +00:00
Mathieu Lagace 8fb24e1605 Merge branch 'dev' into 'master'
Mise a jour 3.2.1

See merge request TheGamecraft/c-cms!52
2019-09-03 20:51:53 +00:00
Mathieu Lagace 1462c4d16d Merge branch '3.2.1' into 'master'
Update CI/CD

See merge request TheGamecraft/c-cms!48
2019-08-28 14:29:23 +00:00
Mathieu Lagace daba93bcfc Merge branch '3.2.1' into 'master'
Update CI/CD

See merge request TheGamecraft/c-cms!47
2019-08-28 14:16:01 +00:00
Mathieu Lagace f9bf70d7d3 Merge branch '3.2.1' into 'master'
3.2.1

See merge request TheGamecraft/c-cms!46
2019-08-28 14:04:52 +00:00
Mathieu Lagace 7c95145459 Merge branch 'dev' into 'master'
Version 3.2.0

See merge request TheGamecraft/c-cms!44
2019-08-26 19:00:52 +00:00
Mathieu Lagace 82b5ef34bf Merge branch 'dev' into 'master'
Dev

See merge request TheGamecraft/c-cms!40
2019-08-23 19:50:27 +00:00
94 changed files with 4426 additions and 3577 deletions
+5
View File
@@ -44,6 +44,7 @@ deploy_697:
environment: environment:
name: escadron697 name: escadron697
url: http://escadron697.ca url: http://escadron697.ca
when: manual
only: only:
- master - master
@@ -60,6 +61,7 @@ deploy_736:
environment: environment:
name: escadron736 name: escadron736
url: http://736.exvps.ca url: http://736.exvps.ca
when: manual
only: only:
- master - master
@@ -76,6 +78,7 @@ deploy_227:
environment: environment:
name: CCMRC227 name: CCMRC227
url: http://227.exvps.ca url: http://227.exvps.ca
when: manual
only: only:
- master - master
@@ -92,6 +95,7 @@ deploy_117:
environment: environment:
name: CCMRC117 name: CCMRC117
url: http://117.exvps.ca url: http://117.exvps.ca
when: manual
only: only:
- master - master
@@ -108,5 +112,6 @@ deploy_dev:
environment: environment:
name: dev name: dev
url: http://dev.exvps.ca url: http://dev.exvps.ca
when: manual
only: only:
- dev - dev
+117 -102
View File
@@ -1,169 +1,178 @@
@servers(['web' => 'deployer@vps188754.vps.ovh.ca']) @servers(['web' => 'deployer@vps188754.vps.ovh.ca'])
@setup @setup
$repository = 'git@gitlab.com:TheGamecraft/c-cms.git'; $repository = 'git@gitlab.com:TheGamecraft/c-cms.git';
$release = date('YmdHis'); $release = date('YmdHis');
$releases_dir_697 = '/var/www/c-cms/escadron697/releases'; $releases_dir_697 = '/var/www/c-cms/escadron697/releases';
$app_dir_697 = '/var/www/c-cms/escadron697'; $app_dir_697 = '/var/www/c-cms/escadron697';
$new_release_dir_697 = $releases_dir_697 .'/'. $release; $new_release_dir_697 = $releases_dir_697 .'/'. $release;
$releases_dir_736 = '/var/www/c-cms/escadron736/releases'; $releases_dir_736 = '/var/www/c-cms/escadron736/releases';
$app_dir_736 = '/var/www/c-cms/escadron736'; $app_dir_736 = '/var/www/c-cms/escadron736';
$new_release_dir_736 = $releases_dir_736 .'/'. $release; $new_release_dir_736 = $releases_dir_736 .'/'. $release;
$releases_dir_dev = '/var/www/c-cms/dev/releases'; $releases_dir_dev = '/var/www/c-cms/dev/releases';
$app_dir_dev = '/var/www/c-cms/dev'; $app_dir_dev = '/var/www/c-cms/dev';
$new_release_dir_dev = $releases_dir_dev .'/'. $release; $new_release_dir_dev = $releases_dir_dev .'/'. $release;
$releases_dir_227 = '/var/www/c-cms/ccmrc227/releases'; $releases_dir_227 = '/var/www/c-cms/ccmrc227/releases';
$app_dir_227 = '/var/www/c-cms/ccmrc227'; $app_dir_227 = '/var/www/c-cms/ccmrc227';
$new_release_dir_227 = $releases_dir_227 .'/'. $release; $new_release_dir_227 = $releases_dir_227 .'/'. $release;
$releases_dir_117 = '/var/www/c-cms/ccmrc117/releases'; $releases_dir_117 = '/var/www/c-cms/ccmrc117/releases';
$app_dir_117 = '/var/www/c-cms/ccmrc117'; $app_dir_117 = '/var/www/c-cms/ccmrc117';
$new_release_dir_117 = $releases_dir_117 .'/'. $release; $new_release_dir_117 = $releases_dir_117 .'/'. $release;
@endsetup @endsetup
@story('deploy_697') @story('deploy_697')
clone_repository_697 clone_repository_697
run_composer_697 run_composer_697
update_symlinks_697 update_symlinks_697
@endstory @endstory
@story('deploy_736') @story('deploy_736')
clone_repository_736 clone_repository_736
run_composer_736 run_composer_736
update_symlinks_736 update_symlinks_736
@endstory @endstory
@story('deploy_dev') @story('deploy_dev')
clone_repository_dev clone_repository_dev
run_composer_dev run_composer_dev
update_symlinks_dev update_symlinks_dev
remove_old_release_dev remove_old_release_dev
@endstory @endstory
@story('deploy_227') @story('deploy_227')
clone_repository_227 clone_repository_227
run_composer_227 run_composer_227
update_symlinks_227 update_symlinks_227
@endstory @endstory
@story('deploy_117') @story('deploy_117')
clone_repository_117 clone_repository_117
run_composer_117 run_composer_117
update_symlinks_117 update_symlinks_117
@endstory @endstory
@task('clone_repository_697') @task('clone_repository_697')
echo 'Cloning repository' echo 'Cloning repository'
[ -d {{ $releases_dir_697 }} ] || mkdir {{ $releases_dir_697 }} [ -d {{ $releases_dir_697 }} ] || mkdir {{ $releases_dir_697 }}
git clone --depth 1 {{ $repository }} {{ $new_release_dir_697 }} git clone --depth 1 {{ $repository }} {{ $new_release_dir_697 }}
cd {{ $new_release_dir_697 }} cd {{ $new_release_dir_697 }}
git reset --hard {{ $commit }} git reset --hard {{ $commit }}
@endtask @endtask
@task('run_composer_697') @task('run_composer_697')
echo "Starting deployment ({{ $release }})" echo "Starting deployment ({{ $release }})"
cd {{ $new_release_dir_697 }} cd {{ $new_release_dir_697 }}
composer install --prefer-dist --no-scripts -q -o --no-dev composer install --prefer-dist --no-scripts -q -o --no-dev
npm install
npm run production
@endtask @endtask
@task('update_symlinks_697') @task('update_symlinks_697')
echo "Linking storage directory" echo "Linking storage directory"
rm -rf {{ $new_release_dir_697 }}/storage rm -rf {{ $new_release_dir_697 }}/storage
ln -nfs {{ $app_dir_697 }}/storage {{ $new_release_dir_697 }}/storage ln -nfs {{ $app_dir_697 }}/storage {{ $new_release_dir_697 }}/storage
echo 'Linking .env file' echo 'Linking .env file'
ln -nfs {{ $app_dir_697 }}/.env {{ $new_release_dir_697 }}/.env ln -nfs {{ $app_dir_697 }}/.env {{ $new_release_dir_697 }}/.env
echo 'Linking current release' echo 'Linking current release'
ln -nfs {{ $new_release_dir_697 }} {{ $app_dir_697 }}/current ln -nfs {{ $new_release_dir_697 }} {{ $app_dir_697 }}/current
echo 'Setting permission' echo 'Setting permission'
chmod -R 777 {{ $app_dir_697 }}/current/bootstrap/ chmod -R 777 {{ $app_dir_697 }}/current/bootstrap/
echo 'Migrate DB' echo 'Migrate DB'
cd {{ $app_dir_697 }}/current/ cd {{ $app_dir_697 }}/current/
php artisan migrate yes|php artisan migrate
php artisan db:seed --class=ConfigsTableSeeder yes|php artisan db:seed --class=ConfigsTableSeeder
php artisan update
@endtask @endtask
@task('clone_repository_736') @task('clone_repository_736')
echo 'Cloning repository' echo 'Cloning repository'
[ -d {{ $releases_dir_736 }} ] || mkdir {{ $releases_dir_736 }} [ -d {{ $releases_dir_736 }} ] || mkdir {{ $releases_dir_736 }}
git clone --depth 1 {{ $repository }} {{ $new_release_dir_736 }} git clone --depth 1 {{ $repository }} {{ $new_release_dir_736 }}
cd {{ $new_release_dir_736 }} cd {{ $new_release_dir_736 }}
git reset --hard {{ $commit }} git reset --hard {{ $commit }}
@endtask @endtask
@task('run_composer_736') @task('run_composer_736')
echo "Starting deployment ({{ $release }})" echo "Starting deployment ({{ $release }})"
cd {{ $new_release_dir_736 }} cd {{ $new_release_dir_736 }}
composer install --prefer-dist --no-scripts -q -o --no-dev composer install --prefer-dist --no-scripts -q -o --no-dev
npm install
npm run production
@endtask @endtask
@task('update_symlinks_736') @task('update_symlinks_736')
echo "Linking storage directory" echo "Linking storage directory"
rm -rf {{ $new_release_dir_736 }}/storage rm -rf {{ $new_release_dir_736 }}/storage
ln -nfs {{ $app_dir_736 }}/storage {{ $new_release_dir_736 }}/storage ln -nfs {{ $app_dir_736 }}/storage {{ $new_release_dir_736 }}/storage
echo 'Linking .env file' echo 'Linking .env file'
ln -nfs {{ $app_dir_736 }}/.env {{ $new_release_dir_736 }}/.env ln -nfs {{ $app_dir_736 }}/.env {{ $new_release_dir_736 }}/.env
echo 'Linking current release' echo 'Linking current release'
ln -nfs {{ $new_release_dir_736 }} {{ $app_dir_736 }}/current ln -nfs {{ $new_release_dir_736 }} {{ $app_dir_736 }}/current
echo 'Setting permission' echo 'Setting permission'
chmod -R 777 {{ $app_dir_736 }}/current/bootstrap/ chmod -R 777 {{ $app_dir_736 }}/current/bootstrap/
echo 'Migrate DB' echo 'Migrate DB'
cd {{ $app_dir_736 }}/current/ cd {{ $app_dir_736 }}/current/
php artisan migrate yes|php artisan migrate
php artisan db:seed --class=ConfigsTableSeeder yes|php artisan db:seed --class=ConfigsTableSeeder
php artisan update
@endtask @endtask
@task('clone_repository_dev') @task('clone_repository_dev')
echo 'Cloning repository' echo 'Cloning repository'
[ -d {{ $releases_dir_dev }} ] || mkdir {{ $releases_dir_dev }} [ -d {{ $releases_dir_dev }} ] || mkdir {{ $releases_dir_dev }}
git clone --depth 1 --single-branch -b dev {{ $repository }} {{ $new_release_dir_dev }} git clone --depth 1 --single-branch -b dev {{ $repository }} {{ $new_release_dir_dev }}
cd {{ $new_release_dir_dev }} cd {{ $new_release_dir_dev }}
git reset --hard {{ $commit }} git reset --hard {{ $commit }}
@endtask @endtask
@task('run_composer_dev') @task('run_composer_dev')
echo "Starting deployment ({{ $release }})" echo "Starting deployment ({{ $release }})"
cd {{ $new_release_dir_dev }} cd {{ $new_release_dir_dev }}
composer install --prefer-dist --no-scripts -q -o --no-dev composer install --prefer-dist --no-scripts -q -o --no-dev
npm install
npm run production
@endtask @endtask
@task('update_symlinks_dev') @task('update_symlinks_dev')
echo "Linking storage directory" echo "Linking storage directory"
rm -rf {{ $new_release_dir_dev }}/storage rm -rf {{ $new_release_dir_dev }}/storage
ln -nfs {{ $app_dir_dev }}/storage {{ $new_release_dir_dev }}/storage ln -nfs {{ $app_dir_dev }}/storage {{ $new_release_dir_dev }}/storage
echo 'Linking .env file' echo 'Linking .env file'
ln -nfs {{ $app_dir_dev }}/.env {{ $new_release_dir_dev }}/.env ln -nfs {{ $app_dir_dev }}/.env {{ $new_release_dir_dev }}/.env
echo 'Linking current release' echo 'Linking current release'
ln -nfs {{ $new_release_dir_dev }} {{ $app_dir_dev }}/current ln -nfs {{ $new_release_dir_dev }} {{ $app_dir_dev }}/current
echo 'Setting permission' echo 'Setting permission'
chmod -R 777 {{ $app_dir_dev }}/current/bootstrap/ chmod -R 777 {{ $app_dir_dev }}/current/bootstrap/
echo 'Migrate DB' echo 'Migrate DB'
cd {{ $app_dir_dev }}/current/ cd {{ $app_dir_dev }}/current/
php artisan migrate yes|php artisan migrate
php artisan db:seed --class=ConfigsTableSeeder yes|php artisan db:seed --class=ConfigsTableSeeder
php artisan update
@endtask @endtask
@task('remove_old_release_dev') @task('remove_old_release_dev')
cd {{ $releases_dir_dev }} cd {{ $releases_dir_dev }}
rm -fr $(ls -t1 | tail -n +3) rm -fr $(ls -t1 | tail -n +3)
@endtask @endtask
@task('clone_repository_227') @task('clone_repository_227')
@@ -178,6 +187,8 @@ git reset --hard {{ $commit }}
echo "Starting deployment ({{ $release }})" echo "Starting deployment ({{ $release }})"
cd {{ $new_release_dir_227 }} cd {{ $new_release_dir_227 }}
composer install --prefer-dist --no-scripts -q -o --no-dev composer install --prefer-dist --no-scripts -q -o --no-dev
npm install
npm run production
@endtask @endtask
@task('update_symlinks_227') @task('update_symlinks_227')
@@ -196,8 +207,9 @@ chmod -R 777 {{ $app_dir_227 }}/current/bootstrap/
echo 'Migrate DB' echo 'Migrate DB'
cd {{ $app_dir_227 }}/current/ cd {{ $app_dir_227 }}/current/
php artisan migrate yes|php artisan migrate
php artisan db:seed --class=ConfigsTableSeeder yes|php artisan db:seed --class=ConfigsTableSeeder
php artisan update
@endtask @endtask
@@ -213,6 +225,8 @@ git reset --hard {{ $commit }}
echo "Starting deployment ({{ $release }})" echo "Starting deployment ({{ $release }})"
cd {{ $new_release_dir_117 }} cd {{ $new_release_dir_117 }}
composer install --prefer-dist --no-scripts -q -o --no-dev composer install --prefer-dist --no-scripts -q -o --no-dev
npm install
npm run production
@endtask @endtask
@task('update_symlinks_117') @task('update_symlinks_117')
@@ -231,7 +245,8 @@ chmod -R 777 {{ $app_dir_117 }}/current/bootstrap/
echo 'Migrate DB' echo 'Migrate DB'
cd {{ $app_dir_117 }}/current/ cd {{ $app_dir_117 }}/current/
php artisan migrate yes|php artisan migrate
php artisan db:seed --class=ConfigsTableSeeder yes|php artisan db:seed --class=ConfigsTableSeeder
php artisan update
@endtask @endtask
+58
View File
@@ -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";
}
}
+81
View File
@@ -0,0 +1,81 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;
class update extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update C-CMS';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->info('Starting update ...');
$this->updateDatabase();
$this->info('Update completed !');
}
private function updateDatabase()
{
$this->info('Updating database ...');
// Check event table
if (!Schema::hasColumn('events','hidden'))
{
$this->info('Updating events table ...');
Schema::table('events', function ($table) {
$table->boolean('hidden')->default(0);
});
}
else
{
$this->info('Events table is up to date ...');
}
// Check event_type table
if (!Schema::hasColumn('event_types','hidden'))
{
$this->info('Updating event_types table ...');
Schema::table('event_types', function ($table) {
$table->boolean('hidden')->default(0);
});
}
else
{
$this->info('Event_types table is up to date ...');
}
return 0;
}
}
+5 -1
View File
@@ -62,7 +62,11 @@ class Course extends Model
if (\App\User::find($this->user_id)) { if (\App\User::find($this->user_id)) {
return \App\User::find($this->user_id)->fullname(); return \App\User::find($this->user_id)->fullname();
} else { } else {
return $this->user_id; if (is_numeric($this->user_id)) {
return 'Utilisateur inconnu';
} else {
return $this->user_id;
}
} }
} }
+25 -2
View File
@@ -94,8 +94,18 @@ class Event extends Model
return $c; return $c;
} }
} }
$error = new \App\Course();
return false; $error->name = "Cours manquant dans la BD";
$error->ocom = "ERREUR";
$error->periode = $p;
$error->level = $l;
$error->location = "";
$error->desc = "";
$error->comment = "Le cours est manquant dans la base de données";
$error->comment_officier = "Le cours est manquant dans la base de données";
$error->event_id = $this->id;
$error->user_id = 1;
return $error;
} }
public function logs() public function logs()
@@ -143,4 +153,17 @@ class Event extends Model
{ {
return count($this->schedule["niveaux"]); return count($this->schedule["niveaux"]);
} }
static function getMaxLevels($events)
{
$maxlevel = 0;
foreach ($events as $e)
{
if ($e->nbNiveau() > $maxlevel)
{
$maxlevel = $e->nbNiveau();
}
}
return $maxlevel;
}
} }
+37 -6
View File
@@ -2,8 +2,11 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use \App\Log; use \App\Log;
use Illuminate\View\View;
class AdminController extends Controller class AdminController extends Controller
{ {
@@ -20,7 +23,7 @@ class AdminController extends Controller
/** /**
* Show the application dashboard. * Show the application dashboard.
* *
* @return \Illuminate\Http\Response * @return Application|Factory|View
*/ */
public function index() public function index()
{ {
@@ -29,6 +32,39 @@ class AdminController extends Controller
return view('admin.dashboard',['futureEvent' => \App\Event::future()->take(3),'userClasse' => \Auth::user()->futureCourses()->forPage(1,6)]); return view('admin.dashboard',['futureEvent' => \App\Event::future()->take(3),'userClasse' => \Auth::user()->futureCourses()->forPage(1,6)]);
} }
public function setup()
{
if (\Auth::user()->use_default_psw == true)
{
return view('admin.user.profil.setup');
}
return redirect('/admin');
}
public function saveSetup()
{
$user = \Auth::user();
$user->firstname = \request('firstname');
$user->lastname = \request('lastname');
$user->password = bcrypt(request('psw'));
if (\request('address') != null)
{
$user->adress = \request('address');
}
if (\request('telephone') != null)
{
$user->telephone = \request('telephone');
}
if (\request('sexe') != null)
{
$user->sexe = \request('sexe');
}
$user->use_default_psw = false;
$user->save();
return redirect('/admin');
}
public function update() public function update()
{ {
clog('navigate','success','consulte les notes de mise à jours'); clog('navigate','success','consulte les notes de mise à jours');
@@ -42,9 +78,4 @@ class AdminController extends Controller
return view('admin.status.index',['alerts' => $alerts]); return view('admin.status.index',['alerts' => $alerts]);
} }
public function instruction()
{
}
} }
+5 -706
View File
@@ -32,715 +32,14 @@ class CalendarController extends Controller
*/ */
public function index() public function index()
{ {
$this->listClass();
return view('admin.calendar.calendar_display'); return view('admin.calendar.calendar_display');
} }
public function generate() public function indexTable()
{ {
$lang = str_replace('_', '-', app()->getLocale()); $event = \App\Event::allThisYear()->sortBy('date_begin')->filter(function ($value,$key) {
setlocale(LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra'); return $value->hidden != 1;
});
$month = request('month'); return view('admin.schedule.table.index',['events' => $event]);
$year = request('year');
$nextMonth = $month + 1;
$nextYear = $year;
if ($nextMonth > 12) {
$nextMonth = 1;
$nextYear = $nextYear + 1;
}
$prevMonth = $month - 1;
$prevYear = $year;
if ($prevMonth < 1) {
$prevMonth = 12;
$prevYear = $prevYear - 1;
}
$calendar = array();
$dayinmonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$firstdaymonth = date("w", strtotime("01-".$month."-".$year));
$addingday = 0;
for ($i=$firstdaymonth ; $addingday < $dayinmonth ; $i++) {
$addingday = $addingday + 1;
$calendar[$i] = $addingday;
}
echo '<div class="table calendar">';
echo '<div class="thead-dark">';
echo '<div class="row"><div class="col-2"><a class="btn" onclick="generate('.$prevMonth.','.$prevYear.')"><i class="fa fa-chevron-left" aria-hidden="true"></i></a></div><div class="col-8">'.ucfirst(strftime("%B %Y", strtotime("01-".$month."-".$year))).'</div><div class="col-2"><a class="btn" onclick="generate('.$nextMonth.','.$nextYear.')"><i class="fa fa-chevron-right" aria-hidden="true"></i></a></div></div>';
echo '<div class="row calendar-head"><div style="width:14%;">Dimanche</div><div style="width:14%;">Lundi</div><div style="width:14%;">Mardi</div><div style="width:14%;">Mercredi</div><div style="width:14%;">Jeudi</div><div style="width:14%;">Vendredi</div><div style="width:14%;">Samedi</div></div>';
echo '</div>';
echo '<div class="card-body">';
for ($i=0; $i < 6 ; $i++)
{
echo '<div class="row">';
for ($a=0; $a < 7 ; $a++)
{
if (isset($calendar[(($i*7) + $a)]))
{
/** Date info */
$today = date("Y-m-d", strtotime($year."-".$month."-".$calendar[(($i*7) + $a)]));
$activityToday = Schedule::where('date','=',$today)->get();
/** If nothing today */
if ($activityToday->isEmpty()) {
echo '<a class="calendar-container calendar-empty" name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div></a>';
} else {
echo '<a class="calendar-container" name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div>';
$text = "";
foreach ($activityToday as $activity) {
echo '<div class="calendar-text" style="width:90%;height:3rem;">';
switch ($activity->type) {
case 'regular':
echo '<div class="row" style="color:orange;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-book fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'pilotage':
echo '<div class="row" style="color:#58D3F7;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-plane fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'drill':
echo '<div class="row" style="color:blue;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-trophy fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'music':
echo '<div class="row" style="color:green;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-music fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'biathlon':
echo '<div class="row" style="color:red;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-snowflake-o fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'marksmanship':
echo '<div class="row" style="color:grey;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-star fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'founding':
echo '<div class="row" style="color:#00FF40;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-usd fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'volunteer':
echo '<div class="row" style="color:#DF0174;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-handshake-o fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
case 'other':
echo '<div class="row" style="color:#DF0174;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-handshake-o fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
default:
echo '<div class="row" style="color:'.\App\ComplementaryActivity::find($activity->type)->calendar_color.';"><span class="fa-stack fa-lg col-md-2">'.\App\ComplementaryActivity::find($activity->type)->calendar_icon.'</span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
break;
}
echo '</div>';
}
echo '</a>';
}
} else {
echo '<div class="calendar-container¸calendar-empty" style="border:none !important; width:14%;"></div>';
}
}
echo '</div>';
}
}
public function load()
{
$lang = str_replace('_', '-', app()->getLocale());
setlocale(LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra');
$Requestdate = request('date');
$url = str_replace("-","_", $Requestdate);
$today = Schedule::where('date','=',$Requestdate)->get();
$isEmpty = $today->isEmpty();
echo '<div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="scrollmodalLabel">'.ucfirst(strftime("%A le %e %B %Y", strtotime($Requestdate))).'</h5><button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span></button></div><div class="modal-body">';
foreach ($today as $date) {
if ($date->data['is_event_mandatory'] == "on") {
$is_mandatory = "<div class='btn btn-block btn-warning m-l-10 m-b-10 float-right'>Activité obligatoire</div>";
} else {
$is_mandatory = "<div class='btn btn-block btn-primary m-l-10 m-b-10 float-right'>Activité n'est pas obligatoire</div>";
}
echo(
'<div class="row">'.
'<div class="col-7">'.
'<p>'.$date->data['event_name'].trans('calendar.begin_at').$date->data['event_begin_time'].trans('calendar.end_at').$date->data['event_end_time'].'</p>'.
'</div>'.
'<div class="col-3">'.
$is_mandatory.
'</div>'.
'<div class="col-1">'.
'<a href="/admin/calendar/edit/'.$date->id.'" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i>&nbsp; Modifier</a>'.
'</div>'.
'<div class="col-1">'.
'<a type="button" class="btn btn-danger" onclick="deleteEvent('.$date->id.');"><i class="fa fa-times-circle" style="color:white;"></i></a>'.
'</div>'.
'</div>'.
'<p>'.$date->data['event_desc'].
'</p>'
);
if ($date->type == "regular") {
if($date->data['n1_p1_plandone'] == "on")
{
$isdone_n1_p1 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n1_p1 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n1_p2_plandone'] == "on")
{
$isdone_n1_p2 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n1_p2 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n2_p1_plandone'] == "on")
{
$isdone_n2_p1 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n2_p1 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n2_p2_plandone'] == "on")
{
$isdone_n2_p2 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n2_p2 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n3_p1_plandone'] == "on")
{
$isdone_n3_p1 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n3_p1 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n3_p2_plandone'] == "on")
{
$isdone_n3_p2 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n3_p2 = '<span class="badge badge-danger">Non remis</span>';
}
echo '<table class="table">
<thead class="thead-dark">
<tr>
<th>Niveau</th>
<th style="width:45%">1er Période</th>
<th style="width:45%">2e Période</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none; width:80%">'.User::find($date->data['n1_p1_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n1_p1.'</td>
<td style="border:none;"><a href="/admin/inventory/'.$date->id.'/1/1" type="button" class="btn btn-info"><i class="fa fa-archive" style="color:white;"></i></a></td>
</tr>
<tr style="border:none;">
<td style="border:none;width:80%">'.$date->data['n1_p1_ocom'].' - '.$date->data['n1_p1_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n1_p1_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;width:80%">'.User::find($date->data['n1_p2_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n1_p2.'</td>
<td style="border:none;"><a href="/admin/inventory/'.$date->id.'/2/1" type="button" class="btn btn-info"><i class="fa fa-archive" style="color:white;"></i></a></td>
</tr>
<tr style="border:none;">
<td style="border:none;width:80%">'.$date->data['n1_p2_ocom'].' - '.$date->data['n1_p2_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n1_p2_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th>2</th>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;width:80%">'.User::find($date->data['n2_p1_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n2_p1.'</td>
<td style="border:none;"><a href="/admin/inventory/'.$date->id.'/1/2" type="button" class="btn btn-info"><i class="fa fa-archive" style="color:white;"></i></a></td>
</tr>
<tr style="border:none;">
<td style="border:none;width:80%">'.$date->data['n2_p1_ocom'].' - '.$date->data['n2_p1_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n2_p1_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;width:80%">'.User::find($date->data['n2_p2_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n2_p2.'</td>
<td style="border:none;"><a href="/admin/inventory/'.$date->id.'/2/2" type="button" class="btn btn-info"><i class="fa fa-archive" style="color:white;"></i></a></td>
</tr>
<tr style="border:none;">
<td style="border:none;width:80%">'.$date->data['n2_p2_ocom'].' - '.$date->data['n2_p2_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n2_p2_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th>3</th>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;width:80%">'.User::find($date->data['n3_p1_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n3_p1.'</td>
<td style="border:none;"><a href="/admin/inventory/'.$date->id.'/1/3" type="button" class="btn btn-info"><i class="fa fa-archive" style="color:white;"></i></a></td>
</tr>
<tr style="border:none;">
<td style="border:none;width:80%">'.$date->data['n3_p1_ocom'].' - '.$date->data['n3_p1_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n3_p1_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;width:80%">'.User::find($date->data['n3_p2_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n3_p2.'</td>
<td style="border:none;"><a href="/admin/inventory/'.$date->id.'/2/3" type="button" class="btn btn-info"><i class="fa fa-archive" style="color:white;"></i></a></td>
</tr>
<tr style="border:none;">
<td style="border:none;width:80%">'.$date->data['n3_p2_ocom'].' - '.$date->data['n3_p2_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n3_p2_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>';
}
echo '<br><hr><br>';
}
echo '<a href="/admin/calendar/add/'.$url.'" type="button" class="btn btn-primary btn-lg btn-block">'.trans('calendar.add_to_schedule').'</a></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-dismiss="modal">'.trans('pagination.close').'</button></div></div>';
}
public function add($date)
{
$lang = str_replace('_', '-', app()->getLocale());
setlocale(LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra');
$date = str_replace("_", "-", $date);
$UserList = User::all();
$LocalList = Local::all();
return view('admin.calendar.calendar_add' ,[
'RequestDate' => $date,
'Userslist' => $UserList,
'LocalsList' => $LocalList,
'ComplementaryActivity' => \App\ComplementaryActivity::all()]);
}
public function edit($id)
{
$schedule = Schedule::find($id);
$UserList = User::all();
$LocalList = Local::all();
return view('admin.calendar.calendar_edit' ,['RequestSchedule' => $schedule, 'Userslist' => $UserList, 'LocalsList' => $LocalList]);
}
public function store()
{
$schedule = new Schedule;
$schedule->date = request('event_date');
$schedule->type = request('event_type');
if(request('event_type') == "regular")
{
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
"n1_p1_name" => request('n1_p1_name'),
"n1_p1_ocom" => request('n1_p1_ocom'),
"n1_p1_instructor" => request('n1_p1_instructor'),
"n1_p1_local" => request('n1_p1_local'),
"n1_p1_plandone" => request('n1_p1_plandone'),
"n1_p2_name" => request('n1_p2_name'),
"n1_p2_ocom" => request('n1_p2_ocom'),
"n1_p2_instructor" => request('n1_p2_instructor'),
"n1_p2_local" => request('n1_p2_local'),
"n1_p2_plandone" => request('n1_p2_plandone'),
"n2_p1_name" => request('n2_p1_name'),
"n2_p1_ocom" => request('n2_p1_ocom'),
"n2_p1_instructor" => request('n2_p1_instructor'),
"n2_p1_local" => request('n2_p1_local'),
"n2_p1_plandone" => request('n2_p1_plandone'),
"n2_p2_name" => request('n2_p2_name'),
"n2_p2_ocom" => request('n2_p2_ocom'),
"n2_p2_instructor" => request('n2_p2_instructor'),
"n2_p2_local" => request('n2_p2_local'),
"n2_p2_plandone" => request('n2_p2_plandone'),
"n3_p1_name" => request('n3_p1_name'),
"n3_p1_ocom" => request('n3_p1_ocom'),
"n3_p1_instructor" => request('n3_p1_instructor'),
"n3_p1_local" => request('n3_p1_local'),
"n3_p1_plandone" => request('n3_p1_plandone'),
"n3_p2_name" => request('n3_p2_name'),
"n3_p2_ocom" => request('n3_p2_ocom'),
"n3_p2_instructor" => request('n3_p2_instructor'),
"n3_p2_local" => request('n3_p2_local'),
"n3_p2_plandone" => request('n3_p2_plandone'),
];
} else {
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
];
}
$schedule->data = $eventData;
$schedule->save();
$userToNotify = $schedule->getUserToNotify();
\Notification::send($userToNotify, new Alert(\Auth::User()->id,"Ajout de l'activité, ".$schedule->data['event_name']." à l'horaire le ".$schedule->date,"/admin/calendar"));
if(\App\Config::where('name','is_schedule_build')->first()->state == 1)
{
\Notification::send($userToNotify, new mail(\Auth::User(),"Ajout d'une activité a l'horaire",\Auth::User()->fullname()." à ajouté l'activité, ".$schedule->data['event_name']." à l'horaire le ".$schedule->date));
}
return redirect('/admin/calendar');
}
public function patch($id)
{
$schedule = Schedule::find($id);
$original = clone($schedule);
$schedule->date = request('event_date');
$schedule->type = request('event_type');
if(request('event_type') == "regular")
{
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
"n1_p1_name" => request('n1_p1_name'),
"n1_p1_ocom" => request('n1_p1_ocom'),
"n1_p1_instructor" => request('n1_p1_instructor'),
"n1_p1_local" => request('n1_p1_local'),
"n1_p1_plandone" => request('n1_p1_plandone'),
"n1_p2_name" => request('n1_p2_name'),
"n1_p2_ocom" => request('n1_p2_ocom'),
"n1_p2_instructor" => request('n1_p2_instructor'),
"n1_p2_local" => request('n1_p2_local'),
"n1_p2_plandone" => request('n1_p2_plandone'),
"n2_p1_name" => request('n2_p1_name'),
"n2_p1_ocom" => request('n2_p1_ocom'),
"n2_p1_instructor" => request('n2_p1_instructor'),
"n2_p1_local" => request('n2_p1_local'),
"n2_p1_plandone" => request('n2_p1_plandone'),
"n2_p2_name" => request('n2_p2_name'),
"n2_p2_ocom" => request('n2_p2_ocom'),
"n2_p2_instructor" => request('n2_p2_instructor'),
"n2_p2_local" => request('n2_p2_local'),
"n2_p2_plandone" => request('n2_p2_plandone'),
"n3_p1_name" => request('n3_p1_name'),
"n3_p1_ocom" => request('n3_p1_ocom'),
"n3_p1_instructor" => request('n3_p1_instructor'),
"n3_p1_local" => request('n3_p1_local'),
"n3_p1_plandone" => request('n3_p1_plandone'),
"n3_p2_name" => request('n3_p2_name'),
"n3_p2_ocom" => request('n3_p2_ocom'),
"n3_p2_instructor" => request('n3_p2_instructor'),
"n3_p2_local" => request('n3_p2_local'),
"n3_p2_plandone" => request('n3_p2_plandone'),
];
} else {
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
];
}
$schedule->data = $eventData;
$schedule->save();
/** Notification */
$asChange = false;
$userToNotify = $schedule->getUserToNotify();
$changes = [];
$found = false;
if ($schedule->type == "regular") {
for ($p=1; $p < 3; $p++) {
for ($n=1; $n < 4; $n++) {
$pUser = \App\User::find($schedule->data['n'.$n.'_p'.$p.'_instructor']);
foreach ($userToNotify as $user) {
if ($user->id == $pUser->id) {
$found = true;
}
}
if (!$found) {
$userToNotify->push($pUser);
}
}
}
}
if ($schedule->data['event_begin_time'] != $original->data['event_begin_time']) {
array_push($changes,"L'heure de début a été modifié de ".$original->data['event_begin_time']." à ".$schedule->data['event_begin_time']);
}
if ($schedule->data['event_end_time'] != $original->data['event_end_time']) {
array_push($changes,"L'heure de fin a été modifié de ".$original->data['event_end_time']." à ".$schedule->data['event_end_time']);
}
if ($schedule->type != $original->type) {
array_push($changes,"Le type d'évenement a été modifié de ".$original->type." à ".$schedule->type);
}
if ($schedule->data['event_name'] != $original->data['event_name']) {
array_push($changes,"Le nom de l'évenement a été modifié de ".$original->data['event_name']." à ".$schedule->data['event_name']);
}
if ($schedule->data['is_event_mandatory'] != $original->data['is_event_mandatory']) {
if ($schedule->data['is_event_mandatory'] == "on") {
array_push($changes,"L'évenement est maintenant obligatoire");
} else {
array_push($changes,"L'évenement n'est plus obligatoire");
}
}
if ($schedule->data['event_location'] != $original->data['event_location']) {
array_push($changes,"Le lieu de l'évenement a été modifié de ".$original->data['event_location']." à ".$schedule->data['event_location']);
}
if ($schedule->data['event_desc'] != $original->data['event_desc']) {
array_push($changes,"La description de l'évenement a été modifié de ".$original->data['event_desc']." à ".$schedule->data['event_desc']);
}
if ($schedule->type == "regular") {
/** Check Instructor */
if ($schedule->data['n1_p1_instructor'] != $original->data['n1_p1_instructor']) {
array_push($changes,"L'instructeur du niveau 1 pour la première période a été changé de ".\App\User::find($original->data['n1_p1_instructor'])->fullname()." à ".\App\User::find($schedule->data['n1_p1_instructor'])->fullname());
\Notification::send(\App\User::find($original->data['n1_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$original->data['n1_p1_name']." du ".$original->date." vous a été retiré."));
\Notification::send(\App\User::find($schedule->data['n1_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$schedule->data['n1_p1_name']." du ".$schedule->date." vous a été ajouté."));
}
if ($schedule->data['n1_p2_instructor'] != $original->data['n1_p2_instructor']) {
array_push($changes,"L'instructeur du niveau 1 pour la deuxième période a été changé de ".\App\User::find($original->data['n1_p2_instructor'])->fullname()." à ".\App\User::find($schedule->data['n1_p2_instructor'])->fullname());
\Notification::send(\App\User::find($original->data['n1_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$original->data['n1_p2_name']." du ".$original->date." vous a été retiré."));
\Notification::send(\App\User::find($schedule->data['n1_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$schedule->data['n1_p2_name']." du ".$schedule->date." vous a été ajouté."));
}
if ($schedule->data['n2_p1_instructor'] != $original->data['n2_p1_instructor']) {
array_push($changes,"L'instructeur du niveau 2 pour la première période a été changé de ".\App\User::find($original->data['n2_p1_instructor'])->fullname()." à ".\App\User::find($schedule->data['n2_p1_instructor'])->fullname());
\Notification::send(\App\User::find($original->data['n2_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$original->data['n2_p1_name']." du ".$original->date." vous a été retiré."));
\Notification::send(\App\User::find($schedule->data['n2_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$schedule->data['n2_p1_name']." du ".$schedule->date." vous a été ajouté."));
}
if ($schedule->data['n2_p2_instructor'] != $original->data['n2_p2_instructor']) {
array_push($changes,"L'instructeur du niveau 2 pour la deuxième période a été changé de ".\App\User::find($original->data['n2_p2_instructor'])->fullname()." à ".\App\User::find($schedule->data['n2_p2_instructor'])->fullname());
\Notification::send(\App\User::find($original->data['n2_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$original->data['n2_p2_name']." du ".$original->date." vous a été retiré."));
\Notification::send(\App\User::find($schedule->data['n2_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$schedule->data['n2_p2_name']." du ".$schedule->date." vous a été ajouté."));
}
if ($schedule->data['n3_p1_instructor'] != $original->data['n3_p1_instructor']) {
array_push($changes,"L'instructeur du niveau 3 pour la première période a été changé de ".\App\User::find($original->data['n3_p1_instructor'])->fullname()." à ".\App\User::find($schedule->data['n3_p1_instructor'])->fullname());
\Notification::send(\App\User::find($original->data['n3_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$original->data['n3_p1_name']." du ".$original->date." vous a été retiré."));
\Notification::send(\App\User::find($schedule->data['n3_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$schedule->data['n3_p1_name']." du ".$schedule->date." vous a été ajouté."));
}
if ($schedule->data['n3_p2_instructor'] != $original->data['n3_p2_instructor']) {
array_push($changes,"L'instructeur du niveau 3 pour la deuxième période a été changé de ".\App\User::find($original->data['n3_p2_instructor'])->fullname()." à ".\App\User::find($schedule->data['n3_p2_instructor'])->fullname());
\Notification::send(\App\User::find($original->data['n3_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$original->data['n3_p2_name']." du ".$original->date." vous a été retiré."));
\Notification::send(\App\User::find($schedule->data['n3_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le cours ".$schedule->data['n3_p2_name']." du ".$schedule->date." vous a été ajouté."));
}
/** Check OCOM */
if ($schedule->data['n1_p1_ocom'] != $original->data['n1_p1_ocom']) {
array_push($changes,"L'OCOM du niveau 1 pour la première période a été changé de ".$original->data['n1_p1_ocom']." à ".$schedule->data['n1_p1_ocom']);
\Notification::send(\App\User::find($schedule->data['n1_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","L'ocom du cours ".$schedule->data['n1_p1_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n1_p1_ocom']));
}
if ($schedule->data['n1_p2_ocom'] != $original->data['n1_p2_ocom']) {
array_push($changes,"L'OCOM du niveau 1 pour la deuxième période a été changé de ".$original->data['n1_p2_ocom']." à ".$schedule->data['n1_p2_ocom']);
\Notification::send(\App\User::find($schedule->data['n1_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","L'ocom du cours ".$schedule->data['n1_p2_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n1_p2_ocom']));
}
if ($schedule->data['n2_p1_ocom'] != $original->data['n2_p1_ocom']) {
array_push($changes,"L'OCOM du niveau 2 pour la première période a été changé de ".$original->data['n2_p1_ocom']." à ".$schedule->data['n2_p1_ocom']);
\Notification::send(\App\User::find($schedule->data['n2_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","L'ocom du cours ".$schedule->data['n2_p1_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n2_p1_ocom']));
}
if ($schedule->data['n2_p2_ocom'] != $original->data['n2_p2_ocom']) {
array_push($changes,"L'OCOM du niveau 2 pour la deuxième période a été changé de ".$original->data['n2_p2_ocom']." à ".$schedule->data['n2_p2_ocom']);
\Notification::send(\App\User::find($schedule->data['n2_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","L'ocom du cours ".$schedule->data['n2_p2_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n2_p2_ocom']));
}
if ($schedule->data['n3_p1_ocom'] != $original->data['n3_p1_ocom']) {
array_push($changes,"L'OCOM du niveau 3 pour la première période a été changé de ".$original->data['n3_p1_ocom']." à ".$schedule->data['n3_p1_ocom']);
\Notification::send(\App\User::find($schedule->data['n3_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","L'ocom du cours ".$schedule->data['n3_p1_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n3_p1_ocom']));
}
if ($schedule->data['n3_p2_ocom'] != $original->data['n3_p2_ocom']) {
array_push($changes,"L'OCOM du niveau 3 pour la deuxième période a été changé de ".$original->data['n3_p2_ocom']." à ".$schedule->data['n3_p2_ocom']);
\Notification::send(\App\User::find($schedule->data['n3_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","L'ocom du cours ".$schedule->data['n3_p2_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n3_p2_ocom']));
}
/** Check Local */
if ($schedule->data['n1_p1_local'] != $original->data['n1_p1_local']) {
array_push($changes,"Le local du niveau 1 pour la première période a été changé de ".$original->data['n1_p1_local']." à ".$schedule->data['n1_p1_local']);
}
if ($schedule->data['n1_p2_local'] != $original->data['n1_p2_local']) {
array_push($changes,"Le local du niveau 1 pour la deuxième période a été changé de ".$original->data['n1_p2_local']." à ".$schedule->data['n1_p2_local']);
}
if ($schedule->data['n2_p1_local'] != $original->data['n2_p1_local']) {
array_push($changes,"Le local du niveau 2 pour la première période a été changé de ".$original->data['n2_p1_local']." à ".$schedule->data['n2_p1_local']);
}
if ($schedule->data['n2_p2_local'] != $original->data['n2_p2_local']) {
array_push($changes,"Le local du niveau 2 pour la deuxième période a été changé de ".$original->data['n2_p2_local']." à ".$schedule->data['n2_p2_local']);
}
if ($schedule->data['n3_p1_local'] != $original->data['n3_p1_local']) {
array_push($changes,"Le local du niveau 3 pour la première période a été changé de ".$original->data['n3_p1_local']." à ".$schedule->data['n3_p1_local']);
}
if ($schedule->data['n3_p2_local'] != $original->data['n3_p2_local']) {
array_push($changes,"Le local du niveau 3 pour la deuxième période a été changé de ".$original->data['n3_p2_local']." à ".$schedule->data['n3_p2_local']);
}
/** Check Name */
if ($schedule->data['n1_p1_name'] != $original->data['n1_p1_name']) {
array_push($changes,"Le nom du cours niveau 1 pour la première période a été changé de ".$original->data['n1_p1_name']." à ".$schedule->data['n1_p1_name']);
\Notification::send(\App\User::find($schedule->data['n1_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le nom du cours ".$original->data['n1_p1_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n1_p1_name']));
}
if ($schedule->data['n1_p2_name'] != $original->data['n1_p2_name']) {
array_push($changes,"Le nom du cours niveau 1 pour la deuxième période a été changé de ".$original->data['n1_p2_name']." à ".$schedule->data['n1_p2_name']);
\Notification::send(\App\User::find($schedule->data['n1_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le nom du cours ".$original->data['n1_p2_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n1_p2_name']));
}
if ($schedule->data['n2_p1_name'] != $original->data['n2_p1_name']) {
array_push($changes,"Le nom du cours niveau 2 pour la première période a été changé de ".$original->data['n2_p1_name']." à ".$schedule->data['n2_p1_name']);
\Notification::send(\App\User::find($schedule->data['n2_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le nom du cours ".$original->data['n2_p1_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n2_p1_name']));
}
if ($schedule->data['n2_p2_name'] != $original->data['n2_p2_name']) {
array_push($changes,"Le nom du cours niveau 2 pour la deuxième période a été changé de ".$original->data['n2_p2_name']." à ".$schedule->data['n2_p2_name']);
\Notification::send(\App\User::find($schedule->data['n2_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le nom du cours ".$original->data['n2_p2_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n2_p2_name']));
}
if ($schedule->data['n3_p1_name'] != $original->data['n3_p1_name']) {
array_push($changes,"Le nom du cours niveau 3 pour la première période a été changé de ".$original->data['n3_p1_name']." à ".$schedule->data['n3_p1_name']);
\Notification::send(\App\User::find($schedule->data['n3_p1_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le nom du cours ".$original->data['n3_p1_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n3_p1_name']));
}
if ($schedule->data['n3_p2_name'] != $original->data['n3_p2_name']) {
array_push($changes,"Le nom du cours niveau 3 pour la deuxième période a été changé de ".$original->data['n3_p2_name']." à ".$schedule->data['n3_p2_name']);
\Notification::send(\App\User::find($schedule->data['n3_p2_instructor']), new mail(\Auth::User(),"Modification d'un de vos cours","Le nom du cours ".$original->data['n3_p2_name']." du ".$schedule->date." a été changé pour ".$schedule->data['n3_p2_name']));
}
}
\Notification::send($userToNotify, new Alert(\Auth::User()->id,"Modification de l'activité, ".$schedule->data['event_name']." à l'horaire le ".$schedule->date,"/admin/calendar"));
$string_Change = "<ul>";
foreach ($changes as $value) {
$string_Change = $string_Change."<li>".$value."</li>";
}
$string_Change = $string_Change."</ul>";
if(\App\Config::where('name','is_schedule_build')->first()->state == 1)
{
\Notification::send($userToNotify, new mail(\Auth::User(),"Modification d'une activité a l'horaire",\Auth::User()->fullname()." à modifié l'activité, ".$schedule->data['event_name']." à l'horaire le ".$schedule->date."<br>".$string_Change));
}
return redirect('/admin/calendar');
}
public function delete()
{
$id = request('id');
$schedule = Schedule::find($id);
$schedule->delete();
\Notification::send($userToNotify, new Alert(\Auth::User()->id,"Suppresion de l'activité, ".$schedule->data['event_name']." à l'horaire le ".$schedule->date,"/admin/calendar"));
if(\App\Config::where('name','is_schedule_build')->first()->state == 1)
{
\Notification::send($userToNotify, new mail(\Auth::User(),"Suppression d'une activité a l'horaire",\Auth::User()->fullname()." à supprimé l'activité, ".$schedule->data['event_name']." à l'horaire le ".$schedule->date));
}
}
private function listClass()
{
$schedules = \App\Schedule::all();
$filtered_schedules = collect();
$classes = [];
foreach($schedules as $schedule)
{
if($schedule->type == "regular")
{
$filtered_schedules->push($schedule);
}
}
foreach($filtered_schedules as $schedule)
{
array_push($classes,$schedule->data['n1_p1_ocom']);
array_push($classes,$schedule->data['n1_p2_ocom']);
array_push($classes,$schedule->data['n2_p1_ocom']);
array_push($classes,$schedule->data['n2_p2_ocom']);
array_push($classes,$schedule->data['n3_p1_ocom']);
array_push($classes,$schedule->data['n3_p2_ocom']);
}
$filtered_classes = array_unique($classes);
return $filtered_classes;
}
public function show()
{
$date = request('date');
return view('admin.calendar.modal.show',['schedules' => \App\Schedule::all()->where('date',$date),'date' => $date]);
} }
} }
+2 -36
View File
@@ -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');
+17 -15
View File
@@ -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.
* *
+64 -7
View File
@@ -100,6 +100,15 @@ class EventController extends Controller
$event->use_schedule = 0; $event->use_schedule = 0;
} }
if(\request("hidden"))
{
$event->hidden = 1;
}
else
{
$event->hidden = 0;
}
$event->calendar_color = \request('calendar_color'); $event->calendar_color = \request('calendar_color');
$event->calendar_icon = \request('calendar_icon'); $event->calendar_icon = \request('calendar_icon');
@@ -146,8 +155,16 @@ class EventController extends Controller
} }
} }
$course->user_id = $instructor; if ($instructor == null) {
$course->location = request('location_n'.$l.'_p'.$p); $course->user_id = '';
} else {
$course->user_id = $instructor;
}
if (request('location_n'.$l.'_p'.$p) != null) {
$course->location = request('location_n'.$l.'_p'.$p);
} else {
$course->location = "";
}
$course->periode = $p; $course->periode = $p;
$course->level = $l; $course->level = $l;
@@ -155,8 +172,16 @@ class EventController extends Controller
if(\request("use_course_n".$l."_p".$p) == 'on') if(\request("use_course_n".$l."_p".$p) == 'on')
{ {
$course->name = request('name_n'.$l.'_p'.$p); if (request('name_n'.$l.'_p'.$p) == null) {
$course->ocom = request('ocom_n'.$l.'_p'.$p); $course->name = "";
} else {
$course->name = request('name_n'.$l.'_p'.$p);
}
if (request('ocom_n'.$l.'_p'.$p) == null) {
$course->ocom = "";
} else {
$course->ocom = request('ocom_n'.$l.'_p'.$p);
}
$course->desc = ""; $course->desc = "";
} }
else else
@@ -209,7 +234,15 @@ class EventController extends Controller
*/ */
public function edit($id) public function edit($id)
{ {
return view('admin.schedule.event.edit',['event' => \App\Event::find($id)]); $event = \App\Event::find($id);
if ($event->hidden == 1)
{
if (\Auth::user()->p('instruction_see_hidden_event') != 1)
{
return redirect('/admin/schedule')->with('error','Modification non authorisé');
}
}
return view('admin.schedule.event.edit',['event' => $event]);
} }
/** /**
@@ -222,6 +255,13 @@ class EventController extends Controller
public function update($id) public function update($id)
{ {
$event = Event::findOrFail($id); $event = Event::findOrFail($id);
if ($event->hidden == 1)
{
if (\Auth::user()->p('instruction_see_hidden_event') != 1)
{
return redirect('/admin/schedule')->with('error','Modification non authorisé');
}
}
// if (\App\GoogleDriveFile::checkConfig()) // if (\App\GoogleDriveFile::checkConfig())
// { // {
@@ -281,6 +321,15 @@ class EventController extends Controller
$event->use_schedule = 0; $event->use_schedule = 0;
} }
if(\request("hidden"))
{
$event->hidden = 1;
}
else
{
$event->hidden = 0;
}
$event->calendar_color = \request('calendar_color'); $event->calendar_color = \request('calendar_color');
$event->calendar_icon = \request('calendar_icon'); $event->calendar_icon = \request('calendar_icon');
@@ -330,8 +379,16 @@ class EventController extends Controller
$instructor = $user->id; $instructor = $user->id;
} }
} }
$course->user_id = $instructor; if ($instructor == null) {
$course->location = request('location_n'.$l.'_p'.$p); $course->user_id = "";
} else {
$course->user_id = $instructor;
}
if (request('location_n'.$l.'_p'.$p) == null) {
$course->location = "";
} else {
$course->location = request('location_n'.$l.'_p'.$p);
}
$course->periode = $p; $course->periode = $p;
$course->level = $l; $course->level = $l;
@@ -62,6 +62,14 @@ class EventTypeController extends Controller
{ {
$eventType->use_schedule = 0; $eventType->use_schedule = 0;
} }
if(\request("hidden"))
{
$eventType->hidden = 1;
}
else
{
$eventType->hidden = 0;
}
if ($request->is_mandatory == 'on') if ($request->is_mandatory == 'on')
{ {
$eventType->is_mandatory = 1; $eventType->is_mandatory = 1;
@@ -174,6 +182,14 @@ class EventTypeController extends Controller
{ {
$eventType->use_schedule = 0; $eventType->use_schedule = 0;
} }
if(\request("hidden"))
{
$eventType->hidden = 1;
}
else
{
$eventType->hidden = 0;
}
if ($request->is_mandatory == 'on') if ($request->is_mandatory == 'on')
{ {
$eventType->is_mandatory = 1; $eventType->is_mandatory = 1;
+108 -40
View File
@@ -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 view('admin.files.list.index');
}
public function download_nominativeList()
{
if (\Storage::exists('/Systeme/Fichier/ListeNominative.pdf'))
{ {
return redirect('/admin')->with('error','Google Drive n\'est pas configuré'); return \Storage::download('/Systeme/Fichier/ListeNominative.pdf');
} }
return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Publique')->first()->id, 'mode' => 'folder']); 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 !');
} }
} }
+4
View File
@@ -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');
} }
+16 -4
View File
@@ -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);
} }
+4 -1
View File
@@ -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');
} }
+80 -6
View File
@@ -46,11 +46,28 @@ class ScheduleController extends Controller
} }
foreach ($allevents as $event) { foreach ($allevents as $event) {
if(strtotime($event->date_begin) >= $start && strtotime($event->date_begin) <= $end) { if ($event->hidden == 1) {
array_push($events,$event); if (\Auth::check())
{
if (\Auth::user()->p('instruction_see_hidden_event') == 1)
{
if(strtotime($event->date_begin) >= $start && strtotime($event->date_begin) <= $end) {
array_push($events,$event);
}
else if(strtotime($event->date_end) >= $start && strtotime($event->date_end) <= $end) {
array_push($events,$event);
}
}
}
} }
else if(strtotime($event->date_end) >= $start && strtotime($event->date_end) <= $end) { else
array_push($events,$event); {
if(strtotime($event->date_begin) >= $start && strtotime($event->date_begin) <= $end) {
array_push($events,$event);
}
else if(strtotime($event->date_end) >= $start && strtotime($event->date_end) <= $end) {
array_push($events,$event);
}
} }
} }
@@ -90,8 +107,16 @@ class ScheduleController extends Controller
$icon = $event->calendar_icon; $icon = $event->calendar_icon;
} }
$name = $event->name;
if ($event->hidden == 1) {
$color = $this->hex2rgba($color,0.5);
$icon = 'fas fa-eye-slash';
$name = 'Caché - '.$name;
}
$myevent = [ $myevent = [
'title' => $event->name, 'title' => $name,
'start' => date('c',strtotime($event->date_begin)), 'start' => date('c',strtotime($event->date_begin)),
'end' => date('c',strtotime($event->date_end)), 'end' => date('c',strtotime($event->date_end)),
'color' => $color, 'color' => $color,
@@ -106,6 +131,45 @@ class ScheduleController extends Controller
return json_encode($jsonevents); return json_encode($jsonevents);
} }
function hex2rgba($color, $opacity = false) {
$default = 'rgb(0,0,0)';
//Return default if no color provided
if(empty($color))
return $default;
//Sanitize $color if "#" is provided
if ($color[0] == '#' ) {
$color = substr( $color, 1 );
}
//Check if color has 6 or 3 characters and get values
if (strlen($color) == 6) {
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
} elseif ( strlen( $color ) == 3 ) {
$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
} else {
return $default;
}
//Convert hexadec to rgb
$rgb = array_map('hexdec', $hex);
//Check if opacity is set(rgba or rgb)
if($opacity){
if(abs($opacity) > 1)
$opacity = 1.0;
$output = 'rgba('.implode(",",$rgb).','.$opacity.')';
} else {
$output = 'rgb('.implode(",",$rgb).')';
}
//Return rgb(a) color string
return $output;
}
public function loadModal($id,$db_type) public function loadModal($id,$db_type)
{ {
if($db_type == "event") if($db_type == "event")
@@ -216,7 +280,17 @@ class ScheduleController extends Controller
public function delete($id) public function delete($id)
{ {
$event = \App\Event::find($id); $event = \App\Event::find($id);
if ($event->hidden == 1)
{
if (\Auth::user()->p('instruction_see_hidden_event') != 1)
{
abort(403);
}
}
foreach ($event->courses as $course)
{
$course->delete();
}
$event->delete(); $event->delete();
} }
} }
+22 -6
View File
@@ -49,13 +49,13 @@ class UserController extends Controller
$user->email = request('email'); $user->email = request('email');
if (request('adresse') == null) { if (request('adresse') == null) {
$user->adress = "Inconnu"; $user->adress = "";
} else { } else {
$user->adress = request('adresse'); $user->adress = request('adresse');
} }
if (request('telephone') == null) { if (request('telephone') == null) {
$user->telephone = "Inconnu"; $user->telephone = "";
} else { } else {
$user->telephone = request('telephone'); $user->telephone = request('telephone');
} }
@@ -63,7 +63,7 @@ class UserController extends Controller
$user->sexe = request('sexe'); $user->sexe = request('sexe');
if (request('age') == null) { if (request('age') == null) {
$user->age = "Inconnu"; $user->age = "";
} else { } else {
$user->age = request('age'); $user->age = request('age');
} }
@@ -122,13 +122,13 @@ class UserController extends Controller
$user->email = request('email'); $user->email = request('email');
if (request('adresse') == null) { if (request('adresse') == null) {
$user->adress = "Inconnu"; $user->adress = "";
} else { } else {
$user->adress = request('adresse'); $user->adress = request('adresse');
} }
if (request('telephone') == null) { if (request('telephone') == null) {
$user->telephone = "Inconnu"; $user->telephone = "";
} else { } else {
$user->telephone = request('telephone'); $user->telephone = request('telephone');
} }
@@ -136,7 +136,7 @@ class UserController extends Controller
$user->sexe = request('sexe'); $user->sexe = request('sexe');
if (request('age') == null) { if (request('age') == null) {
$user->age = "Inconnu"; $user->age = "";
} else { } else {
$user->age = request('age'); $user->age = request('age');
} }
@@ -250,6 +250,22 @@ class UserController extends Controller
return redirect('/admin/profil')->with('success', 'Modification enregistré'); return redirect('/admin/profil')->with('success', 'Modification enregistré');
} }
public function UserTelephone()
{
return view('admin.user.profil.telephone');
}
public function editUserTelephone()
{
$user = \Auth::user();
$user->telephone = request('telephone');
$user->save();
return redirect('/admin/profil')->with('success', 'Modification enregistré');
}
public function apiList() public function apiList()
{ {
$users = \App\User::all(); $users = \App\User::all();
+1
View File
@@ -64,5 +64,6 @@ class Kernel extends HttpKernel
'perm' => \App\Http\Middleware\CheckPerm::class, 'perm' => \App\Http\Middleware\CheckPerm::class,
'fileperm' => \App\Http\Middleware\CheckFilePerm::class, 'fileperm' => \App\Http\Middleware\CheckFilePerm::class,
'courseperm' => \App\Http\Middleware\CheckCoursePerm::class, 'courseperm' => \App\Http\Middleware\CheckCoursePerm::class,
'firstlogin' => \App\Http\Middleware\FirstLogin::class
]; ];
} }
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class FirstLogin
{
/**
* Handle an incoming request.
*
* @param Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($request->isMethod('get'))
{
if (\Auth::user()->use_default_psw == true)
{
return redirect('/admin/setup');
}
}
return $next($request);
}
}
+5
View File
@@ -48,4 +48,9 @@ class Job extends Model
{ {
return $this->permission($perm); return $this->permission($perm);
} }
public function updateACLRules()
{
\App\Permission::updateACLRules($this);
}
} }
+7
View File
@@ -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];
}
} }
+358 -18
View File
@@ -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,8 +16,152 @@ 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 = [
'news' => [ 'Nouvelle' => [
'news_see' => [ 'news_see' => [
'ckey' => 'news_see', 'ckey' => 'news_see',
'communName' => 'Voir les nouvelles', 'communName' => 'Voir les nouvelles',
@@ -46,7 +191,7 @@ class Permission extends Model
'valeur' => 0 'valeur' => 0
] ]
], ],
'inventory' => [ 'Inventaire' => [
'inventory_see' => [ 'inventory_see' => [
'ckey' => 'inventory_see', 'ckey' => 'inventory_see',
'communName' => 'Voir l\'inventaire', 'communName' => 'Voir l\'inventaire',
@@ -76,7 +221,7 @@ class Permission extends Model
'valeur' => 0 'valeur' => 0
], ],
], ],
'user' => [ 'Utilisateur' => [
'user_see' => [ 'user_see' => [
'ckey' => 'user_see', 'ckey' => 'user_see',
'communName' => 'Voir la liste des utilisateurs', 'communName' => 'Voir la liste des utilisateurs',
@@ -106,7 +251,7 @@ class Permission extends Model
'valeur' => 0 'valeur' => 0
], ],
], ],
'config' => [ 'Configuration' => [
'config_see' => [ 'config_see' => [
'ckey' => 'config_see', 'ckey' => 'config_see',
'communName' => 'Voir les configurations', 'communName' => 'Voir les configurations',
@@ -116,13 +261,55 @@ class Permission extends Model
], ],
'config_edit' => [ 'config_edit' => [
'ckey' => 'config_edit', 'ckey' => 'config_edit',
'communName' => 'Modifier les configurations', 'communName' => 'Modifier les configurations générales',
'desc' => 'L\'utilisateur peut-il modifier les configurations', 'desc' => 'L\'utilisateur peut-il modifier les configurations générales',
'icon' => 'fa-eye',
'valeur' => 0
],
'config_edit_instruction' => [
'ckey' => 'config_edit_instruction',
'communName' => 'Modifier les configurations de l\'instruction',
'desc' => 'L\'utilisateur peut-il modifier les configurations de l\'instruction',
'icon' => 'fa-eye',
'valeur' => 0
],
'config_edit_administration' => [
'ckey' => 'config_edit_administration',
'communName' => 'Modifier les configurations de l\'administration',
'desc' => 'L\'utilisateur peut-il modifier les configurations de l\'administration',
'icon' => 'fa-eye',
'valeur' => 0
],
'config_edit_rank' => [
'ckey' => 'config_edit_rank',
'communName' => 'Modifier les configurations des grades',
'desc' => 'L\'utilisateur peut-il modifier les configurations des grades',
'icon' => 'fa-eye',
'valeur' => 0
],
'config_edit_job' => [
'ckey' => 'config_edit_job',
'communName' => 'Modifier les configurations des postes',
'desc' => 'L\'utilisateur peut-il modifier les configurations des postes',
'icon' => 'fa-eye',
'valeur' => 0
],
'config_edit_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' => [
'ckey' => 'config_edit_customization',
'communName' => 'Modifier les configurations de l\'apparence du site',
'desc' => 'L\'utilisateur peut-il modifier les configurations de l\'apparence du site',
'icon' => 'fa-eye', 'icon' => 'fa-eye',
'valeur' => 0 'valeur' => 0
] ]
], ],
'statistique' => [ 'Statistique' => [
'stats_see' => [ 'stats_see' => [
'ckey' => 'stats_see', 'ckey' => 'stats_see',
'communName' => 'Voir les statistiques', 'communName' => 'Voir les statistiques',
@@ -195,6 +382,20 @@ class Permission extends Model
'icon' => 'fa-eye', 'icon' => 'fa-eye',
'valeur' => 0 'valeur' => 0
], ],
'stats_instruction_see' => [
'ckey' => 'stats_instruction_see',
'communName' => 'Voir les statistiques de l\'instruction',
'desc' => 'L\'utilisateur peut-il voir les statistiques de l\'instruction',
'icon' => 'fa-eye',
'valeur' => 0
],
'instruction_see_hidden_event' => [
'ckey' => 'instruction_see_hidden_event',
'communName' => 'Voir les évenements cachés',
'desc' => 'L\'utilisateur peut-il voir les évenements cachés',
'icon' => 'fa-eye',
'valeur' => 0
],
], ],
'Administration' => [ 'Administration' => [
'cadet_list_see' => [ 'cadet_list_see' => [
@@ -204,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' => [
@@ -235,7 +443,7 @@ class Permission extends Model
'valeur' => 0 'valeur' => 0
] ]
], ],
'article' => [ 'Articles' => [
'article_see' => [ 'article_see' => [
'ckey' => 'article_see', 'ckey' => 'article_see',
'communName' => 'Voir les articles', 'communName' => 'Voir les articles',
@@ -265,7 +473,7 @@ class Permission extends Model
'valeur' => 0 'valeur' => 0
], ],
], ],
'picture' => [ 'Photos & Images' => [
'picture_see' => [ 'picture_see' => [
'ckey' => 'picture_see', 'ckey' => 'picture_see',
'communName' => 'Voir les images', 'communName' => 'Voir les images',
@@ -295,24 +503,151 @@ class Permission extends Model
'valeur' => 0 'valeur' => 0
], ],
], ],
'file' => [ '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)
{ {
@@ -346,6 +681,11 @@ class Permission extends Model
return self::PERMISSIONS; return self::PERMISSIONS;
} }
public static function allToJSON()
{
return self::all()->toJson();
}
public static function allToString($value = null) public static function allToString($value = null)
{ {
$perm = []; $perm = [];
+1 -1
View File
@@ -64,7 +64,7 @@ class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
{ {
Gate::define('viewTelescope', function ($user) { Gate::define('viewTelescope', function ($user) {
return in_array($user->email, [ return in_array($user->email, [
// 'admin@exvps.ca'
]); ]);
}); });
} }
+5
View File
@@ -50,4 +50,9 @@ class Rank extends Model
{ {
return $this->permission($perm); return $this->permission($perm);
} }
public function updateACLRules()
{
\App\Permission::updateACLRules($this);
}
} }
+72
View File
@@ -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;
}
}
+26
View File
@@ -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
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -63,7 +63,7 @@ return [
| |
*/ */
'version' => "3.2.5.", 'version' => "3.2.6.",
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
+168
View File
@@ -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
View File
@@ -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'),
],
], ],
]; ];
+3 -2
View File
@@ -29,7 +29,7 @@ return [
| |
*/ */
'path' => env('TELESCOPE_PATH', 'telescope'), 'path' => env('TELESCOPE_PATH', 'admin/telescope'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -62,7 +62,7 @@ return [
| |
*/ */
'enabled' => env('TELESCOPE_ENABLED', true), 'enabled' => env('TELESCOPE_ENABLED', false),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -77,6 +77,7 @@ return [
'middleware' => [ 'middleware' => [
'web', 'web',
'auth',
Authorize::class, Authorize::class,
], ],
+11 -11
View File
@@ -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: 11-g4c5d635d 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}'
@@ -20,12 +20,13 @@ class CreateUsersTable extends Migration
$table->string('email')->unique(); $table->string('email')->unique();
$table->string('password'); $table->string('password');
$table->string('rank_id')->default(1); $table->string('rank_id')->default(1);
$table->string('adress')->default('unknown'); $table->string('adress')->default('');
$table->string('telephone')->default('unknown'); $table->string('telephone')->default('');
$table->string('age'); $table->string('age');
$table->string('avatar')->default('1'); $table->string('avatar')->default('1');
$table->string('sexe'); $table->string('sexe');
$table->string('job_id')->default(6); $table->string('job_id')->default(6);
$table->boolean('use_default_psw')->default(true);
$table->string('api_token', 60)->unique()->default(str_shuffle(str_random(60))); $table->string('api_token', 60)->unique()->default(str_shuffle(str_random(60)));
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();
@@ -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');
}
}
@@ -31,6 +31,7 @@ class CreateEventsTable extends Migration
$table->string('calendar_color'); $table->string('calendar_color');
$table->string('calendar_icon'); $table->string('calendar_icon');
$table->string('weekly_msg_publication_time')->default('-5day'); $table->string('weekly_msg_publication_time')->default('-5day');
$table->boolean('hidden')->default(0);
$table->timestamps(); $table->timestamps();
}); });
} }
@@ -28,6 +28,7 @@ class CreateEventTypesTable extends Migration
$table->boolean('use_schedule')->default(false); $table->boolean('use_schedule')->default(false);
$table->text('schedule_model'); $table->text('schedule_model');
$table->boolean('is_promoted')->default(false); $table->boolean('is_promoted')->default(false);
$table->boolean('hidden')->default(false);
$table->timestamps(); $table->timestamps();
}); });
} }
+49
View File
@@ -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'
],
]);
}
}
-20
View File
@@ -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,
+1
View File
@@ -18,6 +18,7 @@ class DatabaseSeeder extends Seeder
UsersTableSeeder::class, UsersTableSeeder::class,
ComplementaryActivitiesSeeder::class, ComplementaryActivitiesSeeder::class,
EventTypeSeeder::class, EventTypeSeeder::class,
ACLTableSeeder::class,
]); ]);
} }
} }
+2 -2
View File
@@ -18,7 +18,7 @@ class UsersTableSeeder extends Seeder
'email' => 'visiteur@exvps.ca', 'email' => 'visiteur@exvps.ca',
'password' => bcrypt('f329er8kl2jHJGHdEj12567'), 'password' => bcrypt('f329er8kl2jHJGHdEj12567'),
'rank_id' => '1', 'rank_id' => '1',
'adress' => 'Inconnu', 'adress' => '',
'age' => '99', 'age' => '99',
'avatar' => '3', 'avatar' => '3',
'sexe' => 'm', 'sexe' => 'm',
@@ -31,7 +31,7 @@ class UsersTableSeeder extends Seeder
'email' => 'admin@exvps.ca', 'email' => 'admin@exvps.ca',
'password' => bcrypt('SuperAdmin'), 'password' => bcrypt('SuperAdmin'),
'rank_id' => '1', 'rank_id' => '1',
'adress' => 'Inconnu', 'adress' => '',
'age' => '99', 'age' => '99',
'avatar' => '3', 'avatar' => '3',
'sexe' => 'm', 'sexe' => 'm',
+27
View File
@@ -243,6 +243,19 @@
height: 3rem; height: 3rem;
overflow: hidden; overflow: hidden;
} }
.schedule-table-ocom {
width: 200rem;
}
.table-borderless > tbody > tr > td {
border: none !important;
}
.schedule-table-week > td {
border: lightgrey 2px solid;
}
.autocomplete-items { .autocomplete-items {
position: absolute; position: absolute;
border: 1px solid #d4d4d4; border: 1px solid #d4d4d4;
@@ -1894,3 +1907,17 @@ tfoot > tr {
.overflow-auto { .overflow-auto {
overflow: auto; overflow: auto;
} }
.parsley-errors-list {
list-style: none;
padding: 0px;
color: #f44336;
}
.form-control {
padding-top: 15px;
}
.bootstrap-select {
margin-top: -12px;
}
+23 -13
View File
@@ -19,7 +19,7 @@ function initFullCalendar(authToken) {
right: 'prev,next' right: 'prev,next'
}, },
defaultDate: initDate, defaultDate: initDate,
events: '/api/schedule/events', events: '/api/schedule/events/auth?api_token='+authToken,
eventRender: function(event, element) { eventRender: function(event, element) {
if (event.event.extendedProps.icon && event.view.type == 'dayGridMonth') if (event.event.extendedProps.icon && event.view.type == 'dayGridMonth')
{ {
@@ -130,22 +130,32 @@ function deleteEvent(pid){
if (result.value) { if (result.value) {
(function($) { (function($) {
$.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data) { $.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data, status, xhr) {
console.log('Delete'); swal(
'Supprimé!',
"L'évenement a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}).fail(function (data, status, xhr) {
if (xhr == 'Forbidden') {
swal(
'Oups!',
"Vous n'avez pas les permissions nécessaires...",
'error'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
}); });
})(jQuery); })(jQuery);
swal(
'Supprimé!',
"L'évenement a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
} }
}) })
} }
+55
View File
@@ -0,0 +1,55 @@
// Validation errors messages for Parsley
// Load this after Parsley
Parsley.addMessages('fr', {
defaultMessage: "Cette valeur semble non valide.",
type: {
email: "Cette valeur n'est pas une adresse email valide.",
url: "Cette valeur n'est pas une URL valide.",
number: "Cette valeur doit être un nombre.",
integer: "Cette valeur doit être un entier.",
digits: "Cette valeur doit être numérique.",
alphanum: "Cette valeur doit être alphanumérique."
},
notblank: "Cette valeur ne peut pas être vide.",
required: "Ce champ est requis.",
pattern: "Cette valeur semble non valide.",
min: "Cette valeur ne doit pas être inférieure à %s.",
max: "Cette valeur ne doit pas excéder %s.",
range: "Cette valeur doit être comprise entre %s et %s.",
minlength: "Cette chaîne est trop courte. Elle doit avoir au minimum %s caractères.",
maxlength: "Cette chaîne est trop longue. Elle doit avoir au maximum %s caractères.",
length: "Cette valeur doit contenir entre %s et %s caractères.",
mincheck: "Vous devez sélectionner au moins %s choix.",
maxcheck: "Vous devez sélectionner %s choix maximum.",
check: "Vous devez sélectionner entre %s et %s choix.",
equalto: "Cette valeur devrait être identique."
});
Parsley.setLocale('fr');
window.Parsley
.addValidator('password', {
requirementType: 'boolean',
validateString: function(value, requirement) {
console.log(/^(?=.*[\d])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*])[\w!@#$%^&*]{8,}$/.test(value));
return /^(?=.*[\d])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*])[\w!@#$%^&*]{8,}$/.test(value);
},
messages: {
fr: 'Le mot de passe doit contenir au moins 8 caractères, une lettre majuscule, une lettre minuscule, un chiffre et un caractères spécial'
}
});
window.Parsley.on('field:error', function (fieldInstance) {
var messages = ParsleyUI.getErrorsMessages(fieldInstance);
var errorMsg = messages.join(';');
fieldInstance.$element.parent().addClass('has-danger');
fieldInstance.$element.parent().removeClass('has-success');
});
window.Parsley.on('field:success', function (fieldInstance) {
if (fieldInstance.$element.val() != "") {
fieldInstance.$element.parent().removeClass('has-danger');
fieldInstance.$element.parent().addClass('has-success');
}
});
File diff suppressed because one or more lines are too long
+18
View File
@@ -488,6 +488,15 @@ function loadEventType(date,id = 1)
switchUseSchedule(); switchUseSchedule();
} }
if (eventType['hidden'] == 1)
{
$('#hidden').prop('checked',true);
}
else
{
$('#hidden').removeAttr('checked');
}
if (eventType['use_weekly_msg'] == 1) if (eventType['use_weekly_msg'] == 1)
{ {
$('#use_weekly_msg').prop('checked',true); $('#use_weekly_msg').prop('checked',true);
@@ -604,6 +613,15 @@ function loadEvent(date,id)
switchUseSchedule(); switchUseSchedule();
} }
if (eventType['hidden'] == 1)
{
$('#hidden').prop('checked',true);
}
else
{
$('#hidden').removeAttr('checked');
}
if (eventType['use_weekly_msg'] == 1) if (eventType['use_weekly_msg'] == 1)
{ {
$('#use_weekly_msg').prop('checked',true); $('#use_weekly_msg').prop('checked',true);
+27
View File
@@ -243,6 +243,19 @@
height: 3rem; height: 3rem;
overflow: hidden; overflow: hidden;
} }
.schedule-table-ocom {
width: 200rem;
}
.table-borderless > tbody > tr > td {
border: none !important;
}
.schedule-table-week > td {
border: lightgrey 2px solid;
}
.autocomplete-items { .autocomplete-items {
position: absolute; position: absolute;
border: 1px solid #d4d4d4; border: 1px solid #d4d4d4;
@@ -1894,3 +1907,17 @@ tfoot > tr {
.overflow-auto { .overflow-auto {
overflow: auto; overflow: auto;
} }
.parsley-errors-list {
list-style: none;
padding: 0px;
color: #f44336;
}
.form-control {
padding-top: 15px;
}
.bootstrap-select {
margin-top: -12px;
}
@@ -1,6 +1,11 @@
@extends('layouts.admin.main') @extends('layouts.admin.main')
@section('content') @section('content')
<div class="col-sm-12 col-lg-12 text-right">
<a class="btn btn-primary btn-round" href="/admin/schedule/table">
<i class="material-icons">table_view</i> Vue Tableau
</a>
</div>
<div class="col-sm-12 col-lg-12"> <div class="col-sm-12 col-lg-12">
<div class="card"> <div class="card">
<div class="card-body pb-0"> <div class="card-body pb-0">
+2 -76
View File
@@ -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>
@@ -14,14 +14,14 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label>Nom</label> <label>Nom</label>
<input class="form-control" type="text" name="name"> <input class="form-control" type="text" name="name" required>
<small class="form-text text-muted">Nom du grade</small> <small class="form-text text-muted">Nom du grade</small>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label>Description</label> <label>Description</label>
<textarea id="desc" name="desc"></textarea> <textarea id="desc" name="desc" required></textarea>
<small class="form-text text-muted">Description du grade</small> <small class="form-text text-muted">Description du grade</small>
</div> </div>
</div> </div>
@@ -31,41 +31,34 @@
<p> <p>
Choisissez quels permissions doivent être associé avec ce grade. Choisissez quels permissions doivent être associé avec ce grade.
</p> </p>
<div id="accordion" role="tablist"> <table id="permission-table" class="table table-bordered" style="width:100%">
<thead class="d-none">
<th class="d-none">Cat</th>
<th>Nom</th>
<th></th>
</thead>
<tbody>
@foreach(\App\Permission::allToArray() as $key => $cat) @foreach(\App\Permission::allToArray() as $key => $cat)
<div class="card card-collapse"> @foreach($cat as $r)
<div class="card-header" role="tab" id="headingOne"> <tr>
<h5 class="mb-0"> <td class="d-none">{{$key}}</td>
<a class="text-capitalize" data-toggle="collapse" href="#coll-{{$key}}" @if ($loop->first) aria-expanded="true" @endif aria-controls="collapseOne"> <td>
{{$key}} <input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
<i class="material-icons">keyboard_arrow_down</i> {{$r['communName']}}<br>
</a> <small>{{$r['desc']}}</small>
</h5> </td>
</div> <td class="text-center">
<div class="btn-group">
<div id="coll-{{$key}}" class="collapse @if ($loop->first) show @endif" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion"> <button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
<div class="card-body"> <!--<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>-->
<div class="row"> <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>
@foreach($cat as $r)
<div class="col-3 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="fas fa-times"></i></button>
<!--<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>-->
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
</div>
<p>
<small>{{$r['desc']}}</small>
</p>
</div>
@endforeach
</div> </div>
</div> </td>
</div> </tr>
</div> @endforeach
@endforeach @endforeach
</div> </tbody>
</table>
</div> </div>
<div class="col-md-12 mt-5"> <div class="col-md-12 mt-5">
<button type="submit" class="btn btn-primary">Sauvegarder</button> <button type="submit" class="btn btn-primary">Sauvegarder</button>
@@ -83,5 +76,17 @@
$('#desc').trumbowyg({ $('#desc').trumbowyg({
lang: 'fr' lang: 'fr'
}); });
$(document).ready(function() {
$('#permission-table').DataTable({
rowGroup: {
dataSrc: 0
},
pageLength: 100,
lengthChange: false,
columnDefs: [
{ "visible": false, "targets": [0] }
]
});
} );
</script> </script>
@endsection @endsection
@@ -31,7 +31,41 @@
<p> <p>
Choisissez quels permissions doivent être associé avec ce grade. Choisissez quels permissions doivent être associé avec ce grade.
</p> </p>
<div id="accordion" role="tablist"> <table id="permission-table" class="table table-bordered" style="width:100%">
<thead class="d-none">
<th class="d-none">Cat</th>
<th>Nom</th>
<th></th>
</thead>
<tbody>
@foreach(\App\Permission::allToArray() as $key => $cat)
@foreach($cat as $r)
<tr>
<td class="d-none">{{$key}}</td>
<td>
<input class="d-none" type="text" id="{{$r['ckey']}}"
name="{{$r['ckey']}}" value="{{$rank->p($r['ckey'])}}">
{{$r['communName']}}<br>
<small>{{$r['desc']}}</small>
</td>
<td class="text-center">
<div class="btn-group">
<button type="button" id="{{$r['ckey']}}-close"
class="btn btn-just-icon @if($rank->p($r['ckey']) != -1) btn-outline-danger @else btn-danger @endif"
onclick="switchPermissionSwitch('{{$r['ckey']}}','close')">
<i class="fas fa-times"></i></button>
<button type="button" id="{{$r['ckey']}}-plus"
class="btn btn-just-icon @if($rank->p($r['ckey']) != 1) btn-outline-success @else btn-success @endif"
onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')">
<i class="fa fa-plus"></i></button>
</div>
</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
{{--<div id="accordion" role="tablist">
@foreach(\App\Permission::allToArray() as $key => $cat) @foreach(\App\Permission::allToArray() as $key => $cat)
<div class="mb-4"> <div class="mb-4">
<h3 class="text-capitalize">{{$key}}</h3> <h3 class="text-capitalize">{{$key}}</h3>
@@ -56,12 +90,11 @@
<i class="fa fa-plus"></i></button> <i class="fa fa-plus"></i></button>
</div> </div>
</div> </div>
<hr>
@endforeach @endforeach
</div> </div>
</div> </div>
@endforeach @endforeach
</div> </div>--}}
</div> </div>
<div class="col-md-12 mt-5"> <div class="col-md-12 mt-5">
<button type="submit" class="btn btn-primary">Sauvegarder</button> <button type="submit" class="btn btn-primary">Sauvegarder</button>
@@ -79,5 +112,17 @@
$('#desc').trumbowyg({ $('#desc').trumbowyg({
lang: 'fr' lang: 'fr'
}); });
$(document).ready(function() {
$('#permission-table').DataTable({
rowGroup: {
dataSrc: 0
},
pageLength: 100,
lengthChange: false,
columnDefs: [
{ "visible": false, "targets": [0] }
]
});
} );
</script> </script>
@endsection @endsection
+10 -2
View File
@@ -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>
+6 -2
View File
@@ -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>
<p>{{$course->name}}</p> @if($course->name != "")
<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 -1
View File
@@ -69,7 +69,7 @@
@else @else
@foreach ($futureEvent as $event) @foreach ($futureEvent as $event)
<div class="col-md-12"> <div class="col-md-12">
<div class="alert" style="background-color: @if($event->calendar_color == null){{ \App\ComplementaryActivity::find($event->type)->calendar_color}} @else {{$event->calendar_color}} @endif"> <div class="alert cursor" style="background-color: @if($event->calendar_color == null){{ \App\ComplementaryActivity::find($event->type)->calendar_color}} @else {{$event->calendar_color}} @endif" onclick="navigate('schedule?e={{$event->id}}')">
<div class="row text-white"> <div class="row text-white">
<div class="col-md-2 text-capitalize m-auto d-none d-md-flex"> <div class="col-md-2 text-capitalize m-auto d-none d-md-flex">
<h3 class="m-0 p-0" style="margin-top: -0.5rem !important;">@if($event->calendar_icon == null) {!! \App\ComplementaryActivity::find($event->type)->calendar_icon !!} @else <i class="{{$event->calendar_icon}}"></i> @endif</h3> <h3 class="m-0 p-0" style="margin-top: -0.5rem !important;">@if($event->calendar_icon == null) {!! \App\ComplementaryActivity::find($event->type)->calendar_icon !!} @else <i class="{{$event->calendar_icon}}"></i> @endif</h3>
@@ -11,13 +11,13 @@
<form method="post"> <form method="post">
@csrf @csrf
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label class="label-control">Nom</label> <label class="label-control">Nom</label>
<input type="text" class="form-control" name="name" required/> <input type="text" class="form-control" name="name" required/>
</div> </div>
</div> </div>
<div class="col-md-5"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label class="label-control">Emplacement</label> <label class="label-control">Emplacement</label>
<input type="text" class="form-control" name="location" required/> <input type="text" class="form-control" name="location" required/>
@@ -32,6 +32,15 @@
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-2">
<div class="togglebutton">
<label>
<input type="checkbox" name="hidden">
<span class="toggle"></span>
Évenement caché
</label>
</div>
</div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label class="label-control">Heure de début</label> <label class="label-control">Heure de début</label>
@@ -12,13 +12,13 @@
@method('PATCH') @method('PATCH')
@csrf @csrf
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label class="label-control">Nom</label> <label class="label-control">Nom</label>
<input type="text" class="form-control" value="{{$event_type->name}}" name="name" /> <input type="text" class="form-control" value="{{$event_type->name}}" name="name" />
</div> </div>
</div> </div>
<div class="col-md-5"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label class="label-control">Emplacement</label> <label class="label-control">Emplacement</label>
<input type="text" class="form-control" value="{{$event_type->location}}" name="location" /> <input type="text" class="form-control" value="{{$event_type->location}}" name="location" />
@@ -33,6 +33,15 @@
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-2">
<div class="togglebutton">
<label>
<input type="checkbox" name="hidden" @if($event_type->hidden == 1) checked @endif>
<span class="toggle"></span>
Évenement caché
</label>
</div>
</div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label class="label-control">Heure de début</label> <label class="label-control">Heure de début</label>
@@ -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">&times;</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">&times;</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">&times;</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">&times;</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">&times;</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">&times;</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">&times;</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>
+4 -141
View File
@@ -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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;id=1KG0IoPxpqctqqVwCfM0WyKq4y6RDBtUJ">Télécharger</a></td>
</tr>
<tr>
<td>Évaluation pratique sur la coordination dun ordre dopération sur le terrain</td>
<td>Divers</td>
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&amp;id=1AAPB7IdpIw8UGJwIoTNQZ3cg9ODfWrAp">Télécharger</a></td>
</tr>
<tr>
<td>RENCONTRE PRÉILIMINAIRE DINSTRUCTION</td>
<td>Divers</td>
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&amp;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
+42 -2
View File
@@ -31,7 +31,35 @@
<p> <p>
Choisissez quels permissions doivent être associé avec ce poste. Choisissez quels permissions doivent être associé avec ce poste.
</p> </p>
<div id="accordion" role="tablist"> <table id="permission-table" class="table table-bordered" style="width:100%">
<thead class="d-none">
<th class="d-none">Cat</th>
<th>Nom</th>
<th></th>
</thead>
<tbody>
@foreach(\App\Permission::allToArray() as $key => $cat)
@foreach($cat as $r)
<tr>
<td class="d-none">{{$key}}</td>
<td>
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}">
{{$r['communName']}}<br>
<small>{{$r['desc']}}</small>
</td>
<td class="text-center">
<div class="btn-group">
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon btn-outline-danger" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon btn-warning" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fa fa-slash"></i></button>
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon btn-outline-success" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fa fa-plus"></i></button>
</div>
</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
{{--<div id="accordion" role="tablist">
@foreach(\App\Permission::allToArray() as $key => $cat) @foreach(\App\Permission::allToArray() as $key => $cat)
<div class="card card-collapse"> <div class="card card-collapse">
<div class="card-header" role="tab" id="headingOne"> <div class="card-header" role="tab" id="headingOne">
@@ -65,7 +93,7 @@
</div> </div>
</div> </div>
@endforeach @endforeach
</div> </div>--}}
</div> </div>
<div class="col-md-12 mt-5"> <div class="col-md-12 mt-5">
<button type="submit" class="btn btn-primary">Sauvegarder</button> <button type="submit" class="btn btn-primary">Sauvegarder</button>
@@ -83,5 +111,17 @@
$('#desc').trumbowyg({ $('#desc').trumbowyg({
lang: 'fr' lang: 'fr'
}); });
$(document).ready(function() {
$('#permission-table').DataTable({
rowGroup: {
dataSrc: 0
},
pageLength: 100,
lengthChange: false,
columnDefs: [
{ "visible": false, "targets": [0] }
]
});
} );
</script> </script>
@endsection @endsection
+44 -4
View File
@@ -14,14 +14,14 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label>Nom</label> <label>Nom</label>
<input class="form-control" type="text" name="name" value="{{$job->name}}"> <input class="form-control" type="text" name="name" value="{{$job->name}}" required>
<small class="form-text text-muted">Nom du poste</small> <small class="form-text text-muted">Nom du poste</small>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label>Description</label> <label>Description</label>
<textarea id="desc" name="desc">{!! $job->desc !!}</textarea> <textarea id="desc" name="desc" required>{!! $job->desc !!}</textarea>
<small class="form-text text-muted">Description du poste</small> <small class="form-text text-muted">Description du poste</small>
</div> </div>
</div> </div>
@@ -31,7 +31,35 @@
<p> <p>
Choisissez quels permissions doivent être associé avec ce poste. Choisissez quels permissions doivent être associé avec ce poste.
</p> </p>
<div id="accordion" role="tablist"> <table id="permission-table" class="table table-bordered" style="width:100%">
<thead class="d-none">
<th class="d-none">Cat</th>
<th>Nom</th>
<th></th>
</thead>
<tbody>
@foreach(\App\Permission::allToArray() as $key => $cat)
@foreach($cat as $r)
<tr>
<td class="d-none">{{$key}}</td>
<td>
<input class="d-none" type="text" id="{{$r['ckey']}}" name="{{$r['ckey']}}" value="{{$job->p($r['ckey'])}}">
{{$r['communName']}}<br>
<small>{{$r['desc']}}</small>
</td>
<td class="text-center">
<div class="btn-group">
<button type="button" id="{{$r['ckey']}}-close" class="btn btn-just-icon @if($job->p($r['ckey']) != -1) btn-outline-danger @else btn-danger @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','close')"><i class="fas fa-times"></i></button>
<button type="button" id="{{$r['ckey']}}-slash" class="btn btn-just-icon @if($job->p($r['ckey']) == 0) btn-warning @else btn-outline-warning @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','slash')"><i class="fas fa-slash"></i></button>
<button type="button" id="{{$r['ckey']}}-plus" class="btn btn-just-icon @if($job->p($r['ckey']) != 1) btn-outline-success @else btn-success @endif" onclick="switchPermissionSwitch('{{$r['ckey']}}','plus')"><i class="fas fa-plus"></i></button>
</div>
</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
{{-- <div id="accordion" role="tablist">
@foreach(\App\Permission::allToArray() as $key => $cat) @foreach(\App\Permission::allToArray() as $key => $cat)
<div class="card card-collapse"> <div class="card card-collapse">
<div class="card-header" role="tab" id="headingOne"> <div class="card-header" role="tab" id="headingOne">
@@ -65,7 +93,7 @@
</div> </div>
</div> </div>
@endforeach @endforeach
</div> </div>--}}
</div> </div>
<div class="col-md-12 mt-5"> <div class="col-md-12 mt-5">
<button type="submit" class="btn btn-primary">Sauvegarder</button> <button type="submit" class="btn btn-primary">Sauvegarder</button>
@@ -83,5 +111,17 @@
$('#desc').trumbowyg({ $('#desc').trumbowyg({
lang: 'fr' lang: 'fr'
}); });
$(document).ready(function() {
$('#permission-table').DataTable({
rowGroup: {
dataSrc: 0
},
pageLength: 100,
lengthChange: false,
columnDefs: [
{ "visible": false, "targets": [0] }
]
});
} );
</script> </script>
@endsection @endsection
+1 -1
View File
@@ -25,7 +25,7 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h4 class="card-title news-title">{{$n->title}}</h4> <h4 class="card-title news-title">{{$n->title}}</h4>
<p class="category">{{$n->user->fullname()}} - {{$n->created_at}} <p class="category">@if($n->user){{$n->user->fullname()}} -@endif {{$n->created_at}}
<div class="news-tags"> <div class="news-tags">
@if($n->tags != []) @if($n->tags != [])
@foreach($n->tags as $tag) @foreach($n->tags as $tag)
@@ -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>
+1 -1
View File
@@ -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>
+11 -21
View File
@@ -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
+9 -4
View File
@@ -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>
@@ -157,6 +157,17 @@
</label> </label>
</div> </div>
</div> </div>
<div class="form-group">
<label class="m-0" for="type">Évenement caché</label>
<small class="text-muted d-block">L'évenement doit t-il être caché?</small>
<div class="togglebutton">
<label>
<input type="checkbox" id="hidden" name="hidden">
<span class="toggle"></span>
Caché
</label>
</div>
</div>
<div id="accordion-apparence" role="tablist"> <div id="accordion-apparence" role="tablist">
<div class="card card-collapse"> <div class="card card-collapse">
<div class="card-header" role="tab" id="heading-apparence"> <div class="card-header" role="tab" id="heading-apparence">
@@ -170,6 +170,17 @@
</label> </label>
</div> </div>
</div> </div>
<div class="form-group">
<label class="m-0" for="type">Évenement caché</label>
<small class="text-muted d-block">L'évenement doit t-il être caché?</small>
<div class="togglebutton">
<label>
<input type="checkbox" id="hidden" name="hidden">
<span class="toggle"></span>
Caché
</label>
</div>
</div>
<div id="accordion-apparence" role="tablist"> <div id="accordion-apparence" role="tablist">
<div class="card card-collapse"> <div class="card card-collapse">
<div class="card-header" role="tab" id="heading-apparence"> <div class="card-header" role="tab" id="heading-apparence">
@@ -0,0 +1,140 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-sm-12 col-lg-12 text-right">
<a class="btn btn-primary btn-round" href="/admin/schedule">
<i class="material-icons">today</i> Vue Horaire
</a>
</div>
<div class="col-sm-12 col-lg-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Horaire tableau</h3>
</div>
<div class="card-body" style="overflow: scroll;max-height: 79vh">
<div>
<table class="table table-bordered">
<thead class="table-dark">
<tr>
<th></th>
@for($i = 1;$i <= \App\Event::getMaxLevels($events); $i++)
<th>
Niveau {{$i}}
</th>
@endfor
</tr>
<tr>
<td>
<div class="row" style="width: 29rem">
<div class="col-2 pr-0">
Semaine
</div>
<div class="col-4">
Nom
</div>
<div class="col-3">
Date
</div>
<div class="col-3">
Période
</div>
</div>
</td>
@for($i = 1;$i <= \App\Event::getMaxLevels($events); $i++)
<td>
<div class="row" style="width: 35rem">
<div class="col-5">
OCOM - Description
</div>
<div class="col-3">
Instructeur
</div>
<div class="col-2">
Salle
</div>
<div class="col-2">
Materiel
</div>
</div>
</td>
@endfor
</tr>
</thead>
@foreach($events as $event)
<tr class="schedule-table-week">
<td>
<div class="row" style="width: 29rem">
<div class="col-2 text-center m-auto">
{{ $loop->iteration }}
</div>
<div class="col-4 m-auto">
{{$event->name}}
</div>
<div class="col-3 m-auto">
{{$event->date_begin}} à {{ $event->date_end }}
</div>
<div class="col-3 m-auto pr-0">
@if($event->use_schedule == 1)
@foreach($event->schedule["periodes"] as $periode)
<table class="table-borderless">
<tr>
<td style="height: 6rem;vertical-align: middle">
P{{$loop->iteration}} - {{ $periode['begin_time'] }} à {{ $periode['end_time'] }}
</td>
</tr>
</table>
@endforeach
@endif
</div>
</div>
</td>
@if($event->use_schedule == 1)
@for($n = 1;$n <= $event->nbNiveau();$n++)
<td style="padding: 0px;">
@for($p = 1;$p <= $event->nbPeriode();$p++)
<table class="table-borderless">
<tr @if($p != $event->nbPeriode())class="border-bottom"@endif>
<td style="height: 6rem;">
<div class="row" style="width: 35rem">
@php($course = $event->course($p,$n))
<div class="col-5 m-auto">
@if(!$course->use_course())
<b>{{ $course->ocom }}</b> - {{ $course->name }}
@else
{{ $course->desc }}
@endif
</div>
<div class="col-3">
{{ $course->instructor() }}
</div>
<div class="col-2">
{{ $course->location }}
</div>
<div class="col-2">
NA
</div>
@php($course = null)
</div>
</td>
</tr>
</table>
@endfor
</td>
@endfor
@else
<td colspan="{{\App\Event::getMaxLevels($events)}}">
{!! $event->desc !!}
</td>
@endif
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
@endsection
+128 -12
View File
@@ -7,8 +7,8 @@
<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.6</h3>
<p class="category">2019-10-19</p> <p class="category">2020-10-19</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>
@@ -16,6 +16,132 @@
</div> </div>
</div> </div>
<div class="card-body"> <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="card">
<div class="card-header">
<div class="row">
<div class="col-sm-6">
<h3 class="card-title">3.2.5</h3>
<p class="category">2020-10-01</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="alert alert-danger" role="alert">
<i class="fas fa-exclamation-triangle text-white fa-2x mr-3"></i>Plusieurs fonctionnalité sont <strong>DÉSACTIVÉ</strong> le temps de les moderniser
</div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<p> <p>
@@ -41,16 +167,6 @@
</div> </div>
</div> </div>
</li> </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'un lien avec Google Drive
</div>
</div>
</li>
<li class="list-group-item"> <li class="list-group-item">
<div class="row"> <div class="row">
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem"> <div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
+125 -121
View File
@@ -1,140 +1,144 @@
@extends('layouts.admin.main') @extends('layouts.admin.main')
@section('content') @section('content')
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<strong class="card-title">Ajouter un utilisateur <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i> <strong class="card-title">Ajouter un utilisateur <a href="#"><i class="fa fa-question-circle"
</a></strong> aria-hidden="true"></i>
</div> </a></strong>
<div class="card-body"> </div>
<form action="/admin/user/add" method="post"> <div class="card-body">
@csrf <form id="form" action="/admin/user/add" method="post">
<div class="row"> @csrf
<div class="col-6"> <div class="row">
<div class="form-group"> <div class="col-6">
<label for="firstname">Prénom</label> <div class="form-group">
<input type="text" class="form-control" name="firstname" id="firstname" aria-describedby="helpId" placeholder="John" required> <label for="firstname">Prénom</label>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> <input type="text" class="form-control" name="firstname" id="firstname"
aria-describedby="helpId" placeholder="John" required>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="lastname">Nom de famille</label>
<input type="text" class="form-control" name="lastname" id="lastname"
aria-describedby="helpId" placeholder="Doe" required>
</div>
</div> </div>
</div> </div>
<div class="col-6"> <div class="alert alert-warning" id="email_alert" role="alert" style="display:none;">
<div class="form-group"> Les adresses email doivent être identique
<label for="lastname">Nom de famille</label> </div>
<input type="text" class="form-control" name="lastname" id="lastname" aria-describedby="helpId" placeholder="Doe" required> <div class="row">
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> <div class="col-6">
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" name="email" id="email"
aria-describedby="emailHelp" placeholder="exemple@exvps.ca" required>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="email">Confirmer l'addresse email</label>
<input type="email" class="form-control" name="emailc" id="emailc"
aria-describedby="emailHelp" placeholder="exemple@exvps.ca"
data-parsley-equalto="#email" required
data-parsley-error-message="Les emails ne sont pas identique">
</div>
</div> </div>
</div> </div>
</div> <div class="row">
<div class="alert alert-warning" id="email_alert" role="alert" style="display:none;"> <div class="col-6">
Les adresses email doivent être identique <div class="form-group">
</div> <label for="adresse">Adresse</label>
<div class="row"> <input type="text" class="form-control" name="adresse" id="adresse"
<div class="col-6"> aria-describedby="helpId" placeholder="14 ave Des Rue, Rimouski">
<div class="form-group"> <small id="helpId" class="form-text text-muted"></small>
<label for="email">Email</label> </div>
<input type="email" class="form-control" name="email" id="email" aria-describedby="emailHelp" placeholder="exemple@c-cms.cf" onkeyup="checkEmail()" required> </div>
<small id="emailHelp" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> <div class="col-6">
<div class="form-group">
<label for="telephone">Telephone</label>
<input type="tel"
class="form-control" name="telephone" id="telephone" aria-describedby="helpId"
placeholder="213-546-5401" pattern="([0-9]{3}-[0-9]{3}-[0-9]{4})*"
data-parsley-error-message="Le numéro de téléphone est invalide">
</div>
</div> </div>
</div> </div>
<div class="col-6"> <div class="row mb-4">
<div class="form-group"> <div class="col-3">
<label for="email">Confirmer l'addresse email</label> <div class="form-group">
<input type="email" class="form-control" name="emailc" id="emailc" aria-describedby="emailHelp" placeholder="exemple@c-cms.cf" onkeyup="checkEmail()" required> <label for="sexe">Sexe</label>
<small id="emailHelp" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> <select class="form-control selectpicker" data-style="btn btn-link" name="sexe"
id="sexe" required>
<option value="m">Homme</option>
<option value="f">Femme</option>
<option value="a">Autre</option>
</select>
</div>
</div>
<div class="col-3">
<div class="form-group" style="margin-top: 26px;">
<label for="age" style="margin-top: -7px;">Age</label>
<input type="number" class="form-control" name="age" id="age" aria-describedby="helpId"
placeholder="Age" min="0" max="100" style="padding-top: 17px;">
<small id="helpId" class="form-text text-muted"></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="rank">Grade</label>
<select class="form-control selectpicker" data-style="btn btn-link" name="rank"
id="rank" required>
@foreach ($RankList as $rank)
<option value="{{$rank->id}}">{{$rank->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="job">Poste</label>
<select class="form-control selectpicker" data-style="btn btn-link" name="job" id="job"
required>
@foreach ($JobsList as $job)
<option value="{{$job->id}}">{{$job->name}}</option>
@endforeach
</select>
</div>
</div> </div>
</div> </div>
</div> <div class="alert alert-warning" id="psw_alert" role="alert" style="display:none;">
<div class="row"> Les mot de passe doivent être identique
<div class="col-6"> </div>
<div class="form-group"> <div class="row">
<label for="adresse">Adresse</label> <div class="col-6">
<input type="text" class="form-control" name="adresse" id="adresse" aria-describedby="helpId" placeholder="14 ave Des Rue, Rimouski"> <div class="form-group">
<small id="helpId" class="form-text text-muted"></small> <label for="psw">Mot de passe</label>
<input type="password" class="form-control" name="psw" id="psw"
placeholder="Supermotdepasse" data-parsley-password required>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="pswc">Confirmer le mot de passe</label>
<input type="password" class="form-control" name="pswc" id="pswc"
placeholder="Supermotdepasse" data-parsley-equalto="#psw"
data-parsley-error-message="Les mot de passe ne sont pas identique" required>
</div>
</div> </div>
</div> </div>
<div class="col-6"> <button type="submit" id="submit" class="btn btn-primary">Submit</button>
<div class="form-group"> </form>
<label for="telephone">Telephone</label> </div>
<input type="tel"
class="form-control" name="telephone" id="telephone" aria-describedby="helpId" placeholder="(XXX) XXX-XXXX">
<small id="helpId" class="form-text text-muted"><span class="badge badge-info">Si vous souhaiter recevoir des notifications par SMS</span></small>
</div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="form-group">
<label for="sexe">Sexe</label>
<select class="form-control" name="sexe" id="sexe" required>
<option value="m">Homme</option>
<option value="f">Femme</option>
<option value="a">Autre</option>
</select>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="age">Age</label>
<input type="number" class="form-control" name="age" id="age" aria-describedby="helpId" placeholder="Age" min="0" max="100">
<small id="helpId" class="form-text text-muted"></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="rank">Grade</label>
<select class="form-control" name="rank" id="rank" required>
@foreach ($RankList as $rank)
<option value="{{$rank->id}}">{{$rank->name}}</option>
@endforeach
</select>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="job">Poste</label>
<select class="form-control" name="job" id="job" required>
@foreach ($JobsList as $job)
<option value="{{$job->id}}">{{$job->name}}</option>
@endforeach
</select>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
</div>
<hr>
<div class="alert alert-warning" id="psw_alert" role="alert" style="display:none;">
Les mot de passe doivent être identique
</div>
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="psw">Mot de passe</label>
<input type="password" class="form-control" name="psw" id="psw" placeholder="Supermotdepasse" onkeyup="checkPassword()">
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="pswc">Confirmer le mot de passe</label>
<input type="password" class="form-control" name="pswc" id="pswc" placeholder="Supermotdepasse" onkeyup="checkPassword()">
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
</div>
<button type="submit" id="submit" class="btn btn-primary">Submit</button>
</form>
</div> </div>
</div> </div>
</div>
@endsection
@section('breadcrumb')
Utilisateur / Ajouter
@endsection @endsection
@section('custom_scripts') @section('custom_scripts')
<script src="/assets/admin/assets/js/user.js"></script> <script>
$('#form').parsley();
</script>
@endsection @endsection
+72 -87
View File
@@ -14,125 +14,112 @@
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="firstname">Prénom</label> <label for="firstname">Prénom</label>
<input type="text" class="form-control" name="firstname" id="firstname" aria-describedby="helpId" placeholder="John" required value={{$user->firstname}}> <input type="text" class="form-control" name="firstname" id="firstname"
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> aria-describedby="helpId" placeholder="John" required value="{{$user->firstname}}">
</div> </div>
</div> </div>
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="lastname">Nom de famille</label> <label for="lastname">Nom de famille</label>
<input type="text" class="form-control" name="lastname" id="lastname" aria-describedby="helpId" placeholder="Doe" required value={{$user->lastname}}> <input type="text" class="form-control" name="lastname" id="lastname"
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> aria-describedby="helpId" placeholder="Doe" required value="{{$user->lastname}}">
</div> </div>
</div> </div>
</div> </div>
<div class="alert alert-warning" id="email_alert" role="alert" style="display:none;">
Les adresses email doivent être identique
</div>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="email">Email</label> <label for="email">Email</label>
<input type="email" class="form-control" name="email" id="email" aria-describedby="emailHelp" placeholder="exemple@c-cms.cf" onkeyup="checkEmail()" required value={{$user->email}}> <input type="email" class="form-control" name="email" id="email"
<small id="emailHelp" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> aria-describedby="emailHelp" placeholder="exemple@exvps.ca" value="{{$user->email}}" required>
</div> </div>
</div> </div>
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="email">Confirmer l'addresse email</label> <label for="email">Confirmer l'addresse email</label>
<input type="email" class="form-control" name="emailc" id="emailc" aria-describedby="emailHelp" placeholder="exemple@c-cms.cf" onkeyup="checkEmail()" required value={{$user->email}}> <input type="email" class="form-control" name="emailc" id="emailc"
<small id="emailHelp" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> aria-describedby="emailHelp" placeholder="exemple@exvps.ca"
data-parsley-equalto="#email" required
data-parsley-error-message="Les emails ne sont pas identique" value="{{$user->email}}">
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="adresse">Adresse</label> <label for="adresse">Adresse</label>
<input type="text" class="form-control" name="adresse" id="adresse" aria-describedby="helpId" placeholder="14 ave Des Rue, Rimouski" value={{$user->adress}}> <input type="text" class="form-control" name="adresse" id="adresse"
<small id="helpId" class="form-text text-muted"></small> aria-describedby="helpId" placeholder="14 ave Des Rue, Rimouski" value="{{$user->adress}}">
<small id="helpId" class="form-text text-muted"></small>
</div> </div>
</div> </div>
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="telephone">Telephone</label> <label for="telephone">Telephone</label>
<input type="tel" <input type="tel"
class="form-control" name="telephone" id="telephone" aria-describedby="helpId" placeholder="(XXX) XXX-XXXX" value={{$user->telephone}}> class="form-control" name="telephone" id="telephone" aria-describedby="helpId"
<small id="helpId" class="form-text text-muted"><span class="badge badge-info">Si vous souhaiter recevoir des notifications par SMS</span></small> placeholder="213-546-5401" pattern="([0-9]{3}-[0-9]{3}-[0-9]{4})*"
data-parsley-error-message="Le numéro de téléphone est invalide" value="{{$user->telephone}}">
</div>
</div>
</div>
<div class="row mb-4">
<div class="col-3">
<div class="form-group">
<label for="sexe">Sexe</label>
<select class="form-control selectpicker" data-style="btn btn-link" name="sexe"
id="sexe" required>
<option value="m" @if($user->sexe == 'm') selected @endif >Homme</option>
<option value="f" @if($user->sexe == 'm') selected @endif >Femme</option>
<option value="a" @if($user->sexe == 'm') selected @endif >Autre</option>
</select>
</div>
</div>
<div class="col-3">
<div class="form-group" style="margin-top: 26px;">
<label for="age" style="margin-top: -7px;">Age</label>
<input type="number" class="form-control" name="age" id="age" aria-describedby="helpId"
placeholder="Age" min="0" max="100" style="padding-top: 17px;">
<small id="helpId" class="form-text text-muted"></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="rank">Grade</label>
<select class="form-control selectpicker" data-style="btn btn-link" name="rank"
id="rank" required>
@foreach ($RankList as $rank)
<option value="{{$rank->id}}" @if($user->rank_id == $rank->id) selected @endif >{{$rank->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="job">Poste</label>
<select class="form-control selectpicker" data-style="btn btn-link" name="job" id="job"
required>
@foreach ($JobsList as $job)
<option value="{{$job->id}}" @if($user->job_id == $job->id) selected @endif>{{$job->name}}</option>
@endforeach
</select>
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-3">
<div class="form-group">
<label for="sexe">Sexe</label>
<select class="form-control" name="sexe" id="sexe" required>
@switch($user->sexe)
@case("m")
<option value="m">Homme</option>
@break
@case("f")
<option value="f">Femme</option>
@break
@default
<option value="a">Autre</option>
@endswitch
<option value="m">Homme</option>
<option value="f">Femme</option>
<option value="a">Autre</option>
</select>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="age">Age</label>
<input type="number" class="form-control" name="age" id="age" aria-describedby="helpId" placeholder="Age" min="0" max="100" value={{$user->age}}>
<small id="helpId" class="form-text text-muted"></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="rank">Grade</label>
<select class="form-control" name="rank" id="rank" required>
<option value={{$user->rank->id}}>{{$user->rank->name}}</option>
@foreach ($RankList as $rank)
<option value="{{$rank->id}}">{{$rank->name}}</option>
@endforeach
</select>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="job">Poste</label>
<select class="form-control" name="job" id="job" required>
<option value={{$user->job->id}}>{{$user->job->name}}</option>
@foreach ($JobsList as $job)
<option value="{{$job->id}}">{{$job->name}}</option>
@endforeach
</select>
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small>
</div>
</div>
</div>
<hr>
<div class="alert alert-warning" id="psw_alert" role="alert" style="display:none;">
Les mot de passe doivent être identique
</div>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="psw">Mot de passe</label> <label for="psw">Mot de passe</label>
<input type="password" class="form-control" name="psw" id="psw" placeholder="Supermotdepasse" onkeyup="checkPassword()"> <input type="password" class="form-control" name="psw" id="psw"
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> placeholder="Supermotdepasse" data-parsley-password>
</div> </div>
</div> </div>
<div class="col-6"> <div class="col-6">
<div class="form-group"> <div class="form-group">
<label for="pswc">Confirmer le mot de passe</label> <label for="pswc">Confirmer le mot de passe</label>
<input type="password" class="form-control" name="pswc" id="pswc" placeholder="Supermotdepasse" onkeyup="checkPassword()"> <input type="password" class="form-control" name="pswc" id="pswc"
<small id="helpId" class="form-text text-muted"><span class="badge badge-warning">Requis</span></small> placeholder="Supermotdepasse" data-parsley-equalto="#psw"
data-parsley-error-message="Les mot de passe ne sont pas identique">
</div> </div>
</div> </div>
</div> </div>
@@ -143,10 +130,8 @@
</div> </div>
@endsection @endsection
@section('breadcrumb')
Utilisateur / Modifier
@endsection
@section('custom_scripts') @section('custom_scripts')
<script src="/assets/admin/assets/js/user.js"></script> <script>
$('#form').parsley();
</script>
@endsection @endsection
+2 -13
View File
@@ -43,18 +43,7 @@
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<p>Téléphone<br> <p>Téléphone<br>
@if ($user->telephone != "Inconnu") {{ $user->telephone }}
@php
$data = '+'.$user->telephone;
if(preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/',$data,$matches))
{
$result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
echo $result;
}
@endphp
@else
Inconnu
@endif
</p> </p>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
@@ -96,7 +85,7 @@
<div class="card-body"> <div class="card-body">
<a name="changepsw" id="changepsw" class="btn btn-warning btn-block" href="/admin/profil/password" role="button">Modifier mon mot de passe</a> <a name="changepsw" id="changepsw" class="btn btn-warning btn-block" href="/admin/profil/password" role="button">Modifier mon mot de passe</a>
<a class="btn btn-secondary btn-block" href="/admin/profil/avatar" role="button">Modifier ma photo de profil</a> <a class="btn btn-secondary btn-block" href="/admin/profil/avatar" role="button">Modifier ma photo de profil</a>
<button disabled class="btn btn-secondary btn-block" href="/admin/profil/phone" role="button">Modifier mon numéro de téléphone</button> <a class="btn btn-secondary btn-block" href="/admin/profil/telephone" role="button">Modifier mon numéro de téléphone</a>
<a class="btn btn-secondary btn-block" href="/admin/profil/adress" role="button">Modifier mon adresse</a> <a class="btn btn-secondary btn-block" href="/admin/profil/adress" role="button">Modifier mon adresse</a>
<button disabled class="btn btn-primary btn-block" href="/admin/profil/preference" role="button">Modifier mes préférences</button> <button disabled class="btn btn-primary btn-block" href="/admin/profil/preference" role="button">Modifier mes préférences</button>
<a class="btn btn-danger btn-block" href="/logout" role="button">Déconnexion</a> <a class="btn btn-danger btn-block" href="/logout" role="button">Déconnexion</a>
@@ -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>
@@ -0,0 +1,103 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-md-8 col-12 mr-auto ml-auto">
<!-- Wizard container -->
<div class="wizard-container">
<div class="card card-wizard active" data-color="primary">
<form id="form" action="/admin/setup" method="post" data-parsley-validate novalidate>
<div class="card-header text-center">
<h3 class="card-title">
Bienvenue {{ Auth::user()->fullname() }},
</h3>
<h5 class="card-description">Avant de pouvoir continer vous devez répondre a quelques
questions</h5>
</div>
<div class="card-body">
<h5>Renseignement personnel</h5>
@csrf
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="">Nom <sup class="text-danger">*</sup></label>
<input type="text" class="form-control" name="lastname"
value="{{Auth::user()->lastname}}" id="" aria-describedby="helpId" required
placeholder="Doe">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Prenom <sup class="text-danger">*</sup></label>
<input type="text" class="form-control" name="firstname" id=""
value="{{Auth::user()->firstname}}" aria-describedby="helpId"
placeholder="John" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Adresse</label>
<input type="text" class="form-control" name="address" id=""
value="{{Auth::user()->adress}}" aria-describedby="helpId"
placeholder="16 ave DesRoche, Montréal, QC G0L 1B0">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Téléphone</label>
<input type="tel" class="form-control" name="telephone" id=""
value="{{Auth::user()->telephone}}" aria-describedby="helpId"
placeholder="213-546-5401" pattern="([0-9]{3}-[0-9]{3}-[0-9]{4})*"
data-parsley-error-message="Le numéro de téléphone est invalide">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Sexe</label>
<select class="form-control selectpicker" data-style="btn btn-link" name="sexe" id="">
<option @if(Auth::user()->sexe == 'm') selected @endif value="m">Homme</option>
<option @if(Auth::user()->sexe == 'f') selected @endif value="f">Femme</option>
<option @if(Auth::user()->sexe == 'a') selected @endif value="a">Autre</option>
</select>
</div>
</div>
</div>
<h5 class="mt-5">Sécurité</h5>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="psw">Nouveau mot de passe <sup class="text-danger">*</sup></label>
<input type="password" class="form-control" name="psw" id="psw"
aria-describedby="helpId" placeholder="" data-parsley-password required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="psw">Confimer le nouveau mot de passe <sup class="text-danger">*</sup></label>
<input type="password" class="form-control" name="psw" id="psw"
aria-describedby="helpId" placeholder="" data-parsley-equalto="#psw" required
data-parsley-error-message="Les mot de passe ne sont pas identique">
</div>
</div>
<div class="col-12">
<sup class="text-danger">*</sup> <small>Champ requis</small>
</div>
</div>
</div>
<div class="card-footer">
<input type="submit" class="btn btn-primary btn-block" value="Continuer">
</div>
</form>
</div>
</div>
</div>
@endsection
@section('breadcrumb')
Dashboard
@endsection
@section('scripts')
<script>
$('#form').parsley();
</script>
@endsection
@@ -0,0 +1,28 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<strong class="card-title">Modification de mon numéro de téléphone </strong>
</div>
<div class="card-body">
<form autocomplete="off" action="/admin/profil/edit/telephone" method="POST" data-parsley-validate novalidate>
@csrf
<div class="form-group">
<label for="adress">Entrer votre nouveau numero de téléphone</label>
<input type="text" class="form-control" name="telephone" id="telephone" placeholder="213-546-5401" pattern="([0-9]{3}-[0-9]{3}-[0-9]{4})*"
data-parsley-error-message="Le numéro de téléphone est invalide" required>
</div>
<button type="submit" id="submit" class="btn btn-primary">Enregistrer</button>
</form>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
<script>
$('#form').parsley();
</script>
@endsection
@@ -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">
@@ -29,6 +29,9 @@
<script src="/js/plugins/Chart.min.js"></script> <script src="/js/plugins/Chart.min.js"></script>
<!-- Notifications Plugin --> <!-- Notifications Plugin -->
<script src="/js/plugins/bootstrap-notify.js"></script> <script src="/js/plugins/bootstrap-notify.js"></script>
<!-- Parsley Plugin -->
<script src="/js/plugins/parsley.min.js"></script>
<script src="/js/plugins/parsley-extra.min.js"></script>
<script src="/js/plugins/trumbowyg/trumbowyg.min.js"></script> <script src="/js/plugins/trumbowyg/trumbowyg.min.js"></script>
<script src="/js/plugins/trumbowyg/langs/fr.js"></script> <script src="/js/plugins/trumbowyg/langs/fr.js"></script>
+179 -142
View File
@@ -1,147 +1,184 @@
@php @php
$sidebar = [ $sidebar = [
'Nouvelle' => [ 'Nouvelle' => [
'route' => 'admin.news', 'route' => 'admin.news',
'icon' => 'new_releases', 'icon' => 'new_releases',
'perm' => 'news_see', 'perm' => 'news_see',
'child' => null 'child' => null
], ],
'Horaire' => [ 'Horaire' => [
'route' => 'admin.schedule', 'route' => 'admin.schedule',
'icon' => 'calendar_today', 'icon' => 'calendar_today',
'perm' => 'schedule_see', 'perm' => 'schedule_see',
'child' => null 'child' => null
], ],
'Instruction' => [ 'Instruction' => [
'route' => null, 'route' => null,
'icon' => 'menu_book', 'icon' => 'menu_book',
'perm' => null, 'perm' => null,
'child' => [ 'child' => [
'Guide et NQP' => [ 'Guide et NQP' => [
'route' => 'admin.instruction.guide', 'route' => 'admin.instruction.guide',
'icon' => 'fas fa-book', 'icon' => 'fas fa-book',
'perm' => 'instruction_guide_see', 'perm' => 'instruction_guide_see',
'child' => null 'child' => null
], ],
'BD des cours' => [ 'BD des cours' => [
'route' => 'admin.ocom', 'route' => 'admin.ocom',
'icon' => 'fas fa-database', 'icon' => 'fas fa-database',
'perm' => 'instruction_db_ocom_see', 'perm' => 'instruction_db_ocom_see',
'child' => null 'child' => null
], ],
'Liste des cours' => [ 'Liste des cours' => [
'route' => 'admin.course', 'route' => 'admin.course',
'icon' => 'fas fa-list', 'icon' => 'fas fa-list',
'perm' => 'course_see_all', 'perm' => 'course_see_all',
'child' => null 'child' => null
], ],
//'Fichier' => [ //'Fichier' => [
// 'route' => 'admin.instruction.files', // 'route' => 'admin.instruction.files',
// 'icon' => 'fas fa-folder', // 'icon' => 'fas fa-folder',
// 'perm' => null, // 'perm' => null,
// 'child' => null // 'child' => null
//], //],
'Statistiques' => [ 'Statistiques' => [
'route' => 'admin.stats.instruction', 'route' => 'admin.stats.instruction',
'icon' => 'fas fa-chart-line', 'icon' => 'fas fa-chart-line',
'perm' => 'stats_instruction_see', 'perm' => 'stats_instruction_see',
'child' => null 'child' => null
], ],
]
],
'Administration' => [
'route' => null,
'icon' => 'recent_actors',
'perm' => null,
'child' => [
//'Articles' => [
// 'route' => 'admin.article',
// 'icon' => 'fas fa-newspaper',
// 'perm' => 'article_see',
// 'child' => null
//],
//'Images' => [
// 'route' => 'admin.picture',
// 'icon' => 'fas fa-images',
// 'perm' => 'picture_see',
// 'child' => null
//],
'Utilisateurs' => [
'route' => 'admin.users',
'icon' => 'fas fa-users',
'perm' => 'user_see',
'child' => null
],
//'Liste nominative' => [
// 'route' => 'admin.users',
// 'icon' => 'fas fa-address-book',
// 'perm' => 'cadet_list_see',
// 'child' => null
//],
'Logs' => [
'route' => 'admin.stats.log',
'icon' => 'fas fa-stream',
'perm' => 'stats_see',
'child' => null
],
]
],
//'Fichiers' => [
// 'route' => null,
// 'icon' => 'folder',
// 'perm' => 'file_see',
// 'child' => \App\GoogleDriveFile::getSidebarFile(),
//],
'Configuration' => [
'route' => null,
'icon' => 'menu_book',
'perm' => 'config_edit',
'child' => [
'Général' => [
'route' => 'admin.config.general',
'icon' => 'fas fa-cogs',
'perm' => 'config_edit',
'child' => null
],
'Instruction' => [
'route' => 'admin.config.schedule',
'icon' => 'fas fa-book-open',
'perm' => 'config_edit_instruction',
'child' => null
],
'Administration' => [
'route' => 'admin.config.complementary-activity',
'icon' => 'fas fa-file-alt',
'perm' => 'config_edit_administration',
'child' => null
],
'Grade' => [
'route' => 'admin.config.rank',
'icon' => 'fas fa-user-shield',
'perm' => 'config_edit_rank',
'child' => null
],
'Poste' => [
'route' => 'admin.config.jobs',
'icon' => 'fas fa-user-tag',
'perm' => 'config_edit_job',
'child' => null
],
//'Fichier' => [
// 'route' => 'admin.config.files',
// 'icon' => 'fas fa-folder',
// 'perm' => 'config_edit_files',
// 'child' => null
//],
'Apparence' => [
'route' => 'admin.config.customisation',
'icon' => 'fas fa-palette',
'perm' => 'config_edit_instruction',
'child' => null
] ]
] ],
], 'Administration' => [
] 'route' => null,
'icon' => 'recent_actors',
'perm' => null,
'child' => [
//'Articles' => [
// 'route' => 'admin.article',
// 'icon' => 'fas fa-newspaper',
// 'perm' => 'article_see',
// 'child' => null
//],
'Utilisateurs' => [
'route' => 'admin.users',
'icon' => 'fas fa-users',
'perm' => 'user_see',
'child' => null
],
'Liste nominative' => [
'route' => 'admin.admin.list',
'icon' => 'fas fa-address-book',
'perm' => 'cadet_list_see',
'child' => null
],
'Images' => [
'route' => 'admin.picture',
'icon' => 'fas fa-images',
'perm' => 'picture_see',
'child' => null
],
'Logs' => [
'route' => 'admin.stats.log',
'icon' => 'fas fa-stream',
'perm' => 'stats_see',
'child' => null
],
]
],
'Fichiers' => [
'route' => null,
'icon' => 'folder',
'perm' => null,
'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' => [
'route' => null,
'icon' => 'menu_book',
'perm' => 'config_see',
'child' => [
'Général' => [
'route' => 'admin.config.general',
'icon' => 'fas fa-cogs',
'perm' => 'config_edit',
'child' => null
],
'Instruction' => [
'route' => 'admin.config.schedule',
'icon' => 'fas fa-book-open',
'perm' => 'config_edit_instruction',
'child' => null
],
'Administration' => [
'route' => 'admin.config.complementary-activity',
'icon' => 'fas fa-file-alt',
'perm' => 'config_edit_administration',
'child' => null
],
'Grade' => [
'route' => 'admin.config.rank',
'icon' => 'fas fa-user-shield',
'perm' => 'config_edit_rank',
'child' => null
],
'Poste' => [
'route' => 'admin.config.jobs',
'icon' => 'fas fa-user-tag',
'perm' => 'config_edit_job',
'child' => null
],
'Fichier' => [
'route' => 'admin.config.files',
'icon' => 'fas fa-folder',
'perm' => 'config_edit_files',
'child' => null
],
'Apparence' => [
'route' => 'admin.config.customisation',
'icon' => 'fas fa-palette',
'perm' => 'config_edit_customization',
'child' => null
]
]
],
]
@endphp @endphp
<div class="sidebar" data-color="white" data-background-color="black" data-image="/images/sidebar.png"> <div class="sidebar" data-color="white" data-background-color="black" data-image="/images/sidebar.png">
<div class="logo"> <div class="logo">
@@ -1,3 +1,8 @@
@if($event->hidden == 1)
<div class="alert alert-danger text-center" role="alert" style="margin-top:-4rem">
<b>Évenement caché</b>
</div>
@endif
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{$event->name}}</h5> <h5 class="modal-title" id="exampleModalLabel">{{$event->name}}</h5>
<button type="button" class="close" onclick="closeScheduleModal()" aria-label="Close"> <button type="button" class="close" onclick="closeScheduleModal()" aria-label="Close">
@@ -11,7 +11,7 @@
<div class="col-md-4"> <div class="col-md-4">
<h3 class="news-title mb-4">{{ $new->title }}</h3> <h3 class="news-title mb-4">{{ $new->title }}</h3>
<div class="news-body-small"> {!! $new->body !!}</div> <div class="news-body-small"> {!! $new->body !!}</div>
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{$new->created_at}}</span> <span class="news-small">@if(\App\User::find($new->user_id)){{ \App\User::find($new->user_id)->fullname()}},@endif {{$new->created_at}}</span>
<div class="news-tags"> <div class="news-tags">
@if($new->tags != []) @if($new->tags != [])
@foreach($new->tags as $tag) @foreach($new->tags as $tag)
+1 -1
View File
@@ -26,7 +26,7 @@
<div class="news-body-small"> <div class="news-body-small">
{!! $new->body !!} {!! $new->body !!}
</div> </div>
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span> <span class="news-small">@if(\App\User::find($new->user_id)){{ \App\User::find($new->user_id)->fullname()}},@endif {{ $new->created_at }}</span>
<div class="news-tags"> <div class="news-tags">
@if($new->tags != []) @if($new->tags != [])
@foreach($new->tags as $tag) @foreach($new->tags as $tag)
+1 -1
View File
@@ -27,7 +27,7 @@
<p> <p>
{!! $new->body !!} {!! $new->body !!}
</p> </p>
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span> <span class="news-small">@if(\App\User::find($new->user_id)){{ \App\User::find($new->user_id)->fullname()}},@endif {{ $new->created_at }}</span>
<div class="news-tags"> <div class="news-tags">
@if($new->tags != []) @if($new->tags != [])
@foreach($new->tags as $tag) @foreach($new->tags as $tag)
+1 -6
View File
@@ -17,6 +17,7 @@ Route::get('/schedule/events/modal/{id}/{db_type}','ScheduleController@loadModal
Route::middleware('auth:api')->group(function () { Route::middleware('auth:api')->group(function () {
Route::get('/schedule/events/auth','ScheduleController@apiIndex');
Route::get('/schedule/events/modal/full/{id}/{db_type}','ScheduleController@loadModalFull')->middleware('perm:schedule_see'); Route::get('/schedule/events/modal/full/{id}/{db_type}','ScheduleController@loadModalFull')->middleware('perm:schedule_see');
Route::get('/schedule/events/add/modal/{type}/{date}','ScheduleController@loadModalDefautType')->middleware('perm:schedule_add'); Route::get('/schedule/events/add/modal/{type}/{date}','ScheduleController@loadModalDefautType')->middleware('perm:schedule_add');
Route::get('/schedule/editor/init/{id}','ScheduleEditorController@getTemplate')->middleware('perm:schedule_edit'); Route::get('/schedule/editor/init/{id}','ScheduleEditorController@getTemplate')->middleware('perm:schedule_edit');
@@ -75,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) {
+33 -3
View File
@@ -13,6 +13,12 @@ Breadcrumbs::for('admin.dashboard', function ($trail) {
$trail->push('Dashboard', route('admin.dashboard')); $trail->push('Dashboard', route('admin.dashboard'));
}); });
// Admin > Setup
Breadcrumbs::for('admin.setup', function ($trail) {
$trail->parent('admin.dashboard');
$trail->push('Configuration initiale', route('admin.setup'));
});
// Admin > Update // Admin > Update
Breadcrumbs::for('admin.update', function ($trail) { Breadcrumbs::for('admin.update', function ($trail) {
$trail->parent('admin.dashboard'); $trail->parent('admin.dashboard');
@@ -31,6 +37,12 @@ Breadcrumbs::for('admin.schedule', function ($trail) {
$trail->push('Horaire', route('admin.schedule')); $trail->push('Horaire', route('admin.schedule'));
}); });
// Admin > Schedule > Table
Breadcrumbs::for('admin.schedule.tableview', function ($trail) {
$trail->parent('admin.schedule');
$trail->push('Tableau', route('admin.schedule.tableview'));
});
// Admin > Schedule > Add // Admin > Schedule > Add
Breadcrumbs::for('admin.schedule.add', function ($trail,$date) { Breadcrumbs::for('admin.schedule.add', function ($trail,$date) {
$trail->parent('admin.schedule'); $trail->parent('admin.schedule');
@@ -64,7 +76,7 @@ Breadcrumbs::for('admin.user', function ($trail, $id) {
// Admin > User > Add // Admin > User > Add
Breadcrumbs::for('admin.user.add', function ($trail) { Breadcrumbs::for('admin.user.add', function ($trail) {
$trail->parent('admin.user'); $trail->parent('admin.users');
$trail->push('Ajouter un utilisateur', route('admin.user.add')); $trail->push('Ajouter un utilisateur', route('admin.user.add'));
}); });
@@ -263,6 +275,12 @@ Breadcrumbs::for('admin.profil.adress', function ($trail) {
$trail->push('Adresse', route('admin.profil.adress')); $trail->push('Adresse', route('admin.profil.adress'));
}); });
// Admin > Profil > Telephone
Breadcrumbs::for('admin.profil.telephone', function ($trail) {
$trail->parent('admin.profil');
$trail->push('Téléphone', route('admin.profil.telephone'));
});
// Admin > Profil > Password // Admin > Profil > Password
Breadcrumbs::for('admin.profil.psw', function ($trail) { Breadcrumbs::for('admin.profil.psw', function ($trail) {
$trail->parent('admin.profil'); $trail->parent('admin.profil');
@@ -275,7 +293,7 @@ Breadcrumbs::for('admin.profil.courses', function ($trail) {
$trail->push('Mes cours', route('admin.profil.courses')); $trail->push('Mes cours', route('admin.profil.courses'));
}); });
// Admin > Profil > Adress // Admin > Profil > Notification
Breadcrumbs::for('admin.profil.notifications', function ($trail) { Breadcrumbs::for('admin.profil.notifications', function ($trail) {
$trail->parent('admin.profil'); $trail->parent('admin.profil');
$trail->push('Mes notifications', route('admin.profil.notifications')); $trail->push('Mes notifications', route('admin.profil.notifications'));
@@ -323,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
+159 -156
View File
@@ -1,7 +1,9 @@
<?php <?php
use \App\Notifications\sms; use \App\Notifications\sms;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Web Routes | Web Routes
@@ -16,8 +18,7 @@ use Illuminate\Support\Facades\Storage;
/* Basic Auth Route */ /* Basic Auth Route */
Auth::routes(); Auth::routes();
Route::get('logout', 'Auth\LoginController@logout')->name('logout'); Route::get('logout', 'Auth\LoginController@logout')->name('logout');
Route::get('/ocom/create','OCOMController@updateOCOMDB'); Route::get('/ocom/create', 'OCOMController@updateOCOMDB');
/** Public Route */ /** Public Route */
@@ -29,187 +30,189 @@ 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','.*');
@
Route::middleware(['auth'])->name('admin.')->group(function () {
/** Setup */
Route::get('/admin/setup', 'AdminController@setup')->middleware('auth')->name('admin.setup');
Route::post('/admin/setup', 'AdminController@saveSetup')->middleware('auth');
Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
/* Espace Administration Route */ /* Espace Administration Route */
/** Dashboard & General */ /** Dashboard & General */
Route::get('/admin', 'AdminController@index')->name('dashboard'); Route::get('/admin', 'AdminController@index')->name('dashboard');
Route::get('/admin/update', 'AdminController@update')->name('update'); Route::get('/admin/update', 'AdminController@update')->name('update');
Route::get('/admin/status','AdminController@status')->name('status'); Route::get('/admin/status', 'AdminController@status')->name('status');
/** Schedule */
Route::get('/admin/schedule', 'CalendarController@index')->middleware('perm:schedule_see')->name('schedule');
Route::get('/admin/schedule/pdf/event/{id}','ScheduleController@printtopdf')->middleware('perm:schedule_see')->name('schedule.pdf');
Route::get('/admin/schedule/add/{date}','ScheduleController@create')->middleware('perm:schedule_add')->name('schedule.add');
Route::get('/admin/schedule/edit/{id}','EventController@edit')->middleware('perm:schedule_edit')->name('schedule.edit');
Route::post('/admin/schedule/event/add','EventController@Store')->middleware('perm:schedule_add');
Route::post('/admin/schedule/event/edit/{id}','EventController@update')->middleware('perm:schedule_edit');
/** Statistique */ /** Schedule */
Route::get('/admin/stats/log' , 'LogController@index')->middleware('perm:stats_see')->name('stats.log'); Route::get('/admin/schedule', 'CalendarController@index')->middleware('perm:schedule_see')->name('schedule');
Route::get('/admin/stats/instruction' , 'StatsController@instruction')->middleware('perm:stats_see')->name('stats.instruction'); Route::get('/admin/schedule/table', 'CalendarController@indexTable')->middleware('perm:schedule_see')->name('schedule.tableview');
Route::get('/admin/schedule/pdf/event/{id}', 'ScheduleController@printtopdf')->middleware('perm:schedule_see')->name('schedule.pdf');
Route::get('/admin/schedule/add/{date}', 'ScheduleController@create')->middleware('perm:schedule_add')->name('schedule.add');
Route::get('/admin/schedule/edit/{id}', 'EventController@edit')->middleware('perm:schedule_edit')->name('schedule.edit');
Route::post('/admin/schedule/event/add', 'EventController@Store')->middleware('perm:schedule_add');
Route::post('/admin/schedule/event/edit/{id}', 'EventController@update')->middleware('perm:schedule_edit');
/** Message */ /** Statistique */
Route::get('/admin/message' , 'MessageController@index')->middleware('perm:msg_see')->name('message'); Route::get('/admin/stats/log', 'LogController@index')->middleware('perm:stats_see')->name('stats.log');
Route::get('/admin/message/add' , 'MessageController@create')->middleware('perm:msg_add')->name('message.add'); Route::get('/admin/stats/instruction', 'StatsController@instruction')->middleware('perm:stats_instruction_see')->name('stats.instruction');
Route::post('/admin/message/add' , 'MessageController@store')->middleware('perm:msg_add');
Route::get('/admin/message/{id}', ['uses' =>'MessageController@show'])->middleware('perm:msg_see')->name('message.show');
/** User */ /** Message */
Route::get('/admin/user' , 'UserController@index')->middleware('perm:user_see')->name('users'); Route::get('/admin/message', 'MessageController@index')->middleware('perm:msg_see')->name('message');
Route::get('/admin/user/{id}' , 'UserController@show')->middleware('perm:user_see')->name('user'); Route::get('/admin/message/add', 'MessageController@create')->middleware('perm:msg_add')->name('message.add');
Route::get('/admin/user/{id}/course','UserController@showCourses')->name('user.courses'); Route::post('/admin/message/add', 'MessageController@store')->middleware('perm:msg_add');
Route::get('/admin/user/add' , 'UserController@create')->middleware('perm:user_add')->name('user.add'); Route::get('/admin/message/{id}', ['uses' => 'MessageController@show'])->middleware('perm:msg_see')->name('message.show');
Route::post('/admin/user/add' , 'UserController@store')->middleware('perm:user_add');
Route::get('/admin/user/edit/{id}' , 'UserController@edit')->middleware('perm:user_edit')->name('user.edit');
Route::post('/admin/user/edit/{id}' , 'UserController@update')->middleware('perm:user_edit');
/** Config */ /** User */
Route::get('/admin/config/instruction', 'ScheduleController@index')->middleware('perm:config_edit')->name('config.schedule'); Route::get('/admin/user', 'UserController@index')->middleware('perm:user_see')->name('users');
Route::get('/admin/config/instruction/event_type/create', 'EventTypeController@create')->middleware('perm:config_edit')->name('config.schedule.event_type.create'); Route::get('/admin/user/add', 'UserController@create')->middleware('perm:user_add')->name('user.add');
Route::post('/admin/config/instruction/event_type/create', 'EventTypeController@store')->middleware('perm:config_edit'); Route::post('/admin/user/add', 'UserController@store')->middleware('perm:user_add');
Route::get('/admin/config/instruction/event_type/{id}', 'EventTypeController@show')->middleware('perm:config_edit')->name('config.schedule.event_type'); Route::get('/admin/user/{id}', 'UserController@show')->middleware('perm:user_see')->name('user');
Route::patch('/admin/config/instruction/event_type/{id}', 'EventTypeController@update')->middleware('perm:config_edit'); Route::get('/admin/user/{id}/course', 'UserController@showCourses')->name('user.courses');
Route::patch('/admin/config/instruction' , 'ScheduleController@update')->middleware('perm:config_edit'); Route::get('/admin/user/edit/{id}', 'UserController@edit')->middleware('perm:user_edit')->name('user.edit');
Route::get('/admin/config/activity' , 'ComplementaryActivityController@index')->middleware('perm:config_edit')->name('config.complementary-activity'); Route::post('/admin/user/edit/{id}', 'UserController@update')->middleware('perm:user_edit');
Route::get('/admin/config/activity/add' , 'ComplementaryActivityController@create')->middleware('perm:config_edit')->name('config.complementary-activity.add');
Route::post('/admin/config/activity/add' , 'ComplementaryActivityController@store')->middleware('perm:config_edit');
Route::get('/admin/config/activity/edit/{id}' , 'ComplementaryActivityController@edit')->middleware('perm:config_edit')->name('config.complementary-activity.edit');
Route::post('/admin/config/activity/edit/{id}' , 'ComplementaryActivityController@update')->middleware('perm:config_edit');
Route::post('/admin/config/general/edit','ConfigController@update')->middleware('perm:config_edit');
Route::get('/admin/config/' , 'ConfigController@index')->middleware('perm:config_edit')->name('config.general');
Route::get('/admin/config/customisation','ConfigController@customisation')->middleware('perm:config_edit')->name('config.customisation');
Route::post('/admin/config/customisation','ConfigController@customisationUpdate')->middleware('perm:config_edit');
Route::get('/admin/config/ranks','RankController@index')->middleware('perm:config_edit')->name('config.rank'); /** Config */
Route::get('/admin/config/ranks/add','RankController@create')->middleware('perm:config_edit')->name('config.rank.add'); Route::get('/admin/config/instruction', 'ScheduleController@index')->middleware('perm:config_edit_instruction')->name('config.schedule');
Route::post('/admin/config/ranks/add','RankController@store')->middleware('perm:config_edit'); Route::get('/admin/config/instruction/event_type/create', 'EventTypeController@create')->middleware('perm:config_edit_instruction')->name('config.schedule.event_type.create');
Route::get('/admin/config/ranks/{id}','RankController@show')->middleware('perm:config_edit')->name('config.rank.edit'); Route::post('/admin/config/instruction/event_type/create', 'EventTypeController@store')->middleware('perm:config_edit_instruction');
Route::post('/admin/config/ranks/{id}','RankController@update')->middleware('perm:config_edit'); Route::get('/admin/config/instruction/event_type/{id}', 'EventTypeController@show')->middleware('perm:config_edit_instruction')->name('config.schedule.event_type');
Route::get('/admin/config/jobs','JobController@index')->middleware('perm:config_edit')->name('config.jobs'); Route::patch('/admin/config/instruction/event_type/{id}', 'EventTypeController@update')->middleware('perm:config_edit_instruction');
Route::get('/admin/config/jobs/add','JobController@create')->middleware('perm:config_edit')->name('config.jobs.add'); Route::patch('/admin/config/instruction', 'ScheduleController@update')->middleware('perm:config_edit_instruction');
Route::post('/admin/config/jobs/add','JobController@store')->middleware('perm:config_edit'); Route::get('/admin/config/activity', 'ComplementaryActivityController@index')->middleware('perm:config_edit_administration')->name('config.complementary-activity');
Route::get('/admin/config/jobs/{id}','JobController@edit')->middleware('perm:config_edit')->name('config.jobs.edit'); Route::get('/admin/config/activity/add', 'ComplementaryActivityController@create')->middleware('perm:config_edit_administration')->name('config.complementary-activity.add');
Route::post('/admin/config/jobs/{id}','JobController@update')->middleware('perm:config_edit'); Route::post('/admin/config/activity/add', 'ComplementaryActivityController@store')->middleware('perm:config_edit_administration');
Route::get('/admin/config/activity/edit/{id}', 'ComplementaryActivityController@edit')->middleware('perm:config_edit_administration')->name('config.complementary-activity.edit');
Route::post('/admin/config/activity/edit/{id}', 'ComplementaryActivityController@update')->middleware('perm:config_edit_administration');
Route::post('/admin/config/general/edit', 'ConfigController@update')->middleware('perm:config_edit');
Route::get('/admin/config/', 'ConfigController@index')->middleware('perm:config_edit')->name('config.general');
Route::get('/admin/config/customisation', 'ConfigController@customisation')->middleware('perm:config_edit_customization')->name('config.customisation');
Route::post('/admin/config/customisation', 'ConfigController@customisationUpdate')->middleware('perm:config_edit_customization');
Route::get('/admin/config/files' , 'ConfigController@showfilesConfig')->middleware('perm:config_edit')->name('config.files'); Route::get('/admin/config/ranks', 'RankController@index')->middleware('perm:config_edit_rank')->name('config.rank');
Route::post('/admin/config/files' , 'ConfigController@editfilesConfig')->middleware('perm:config_edit'); Route::get('/admin/config/ranks/add', 'RankController@create')->middleware('perm:config_edit_rank')->name('config.rank.add');
Route::post('/admin/config/ranks/add', 'RankController@store')->middleware('perm:config_edit_rank');
Route::get('/admin/config/ranks/{id}', 'RankController@show')->middleware('perm:config_edit_rank')->name('config.rank.edit');
Route::post('/admin/config/ranks/{id}', 'RankController@update')->middleware('perm:config_edit_rank');
Route::get('/admin/config/jobs', 'JobController@index')->middleware('perm:config_edit_job')->name('config.jobs');
Route::get('/admin/config/jobs/add', 'JobController@create')->middleware('perm:config_edit_job')->name('config.jobs.add');
Route::post('/admin/config/jobs/add', 'JobController@store')->middleware('perm:config_edit_job');
Route::get('/admin/config/jobs/{id}', 'JobController@edit')->middleware('perm:config_edit_job')->name('config.jobs.edit');
Route::post('/admin/config/jobs/{id}', 'JobController@update')->middleware('perm:config_edit_job');
/** Public page */ Route::get('/admin/config/files', 'ConfigController@showfilesConfig')->middleware('perm:config_edit')->name('config.files');
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit'); Route::post('/admin/config/files', 'ConfigController@editfilesConfig')->middleware('perm:config_edit');
Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit');
/** Picture */ /** Public page */
Route::get('/admin/picture','PictureController@indexAdmin')->middleware('perm:picture_see')->name('picture'); Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit_customization');
Route::get('/admin/picture/add','PictureController@create')->middleware('perm:picture_add')->name('picture.add'); Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit_customization');
Route::post('/admin/picture/add','PictureController@store')->middleware('perm:picture_add');
Route::get('/admin/picture/edit/{id}','PictureController@edit')->middleware('perm:picture_edit')->name('picture.edit');
Route::post('/admin/picture/edit/{id}','PictureController@update')->middleware('perm:picture_edit');
/** Inventory */ /** Picture */
Route::get('/admin/inventory' , 'InventoryController@index')->middleware('perm:inventory_see')->name('inv'); Route::get('/admin/picture', 'PictureController@indexAdmin')->middleware('perm:picture_see')->name('picture');
Route::get('/admin/inventory/management','InventoryController@management')->middleware('perm:inventory_edit')->name('inv.management'); Route::get('/admin/picture/add', 'PictureController@create')->middleware('perm:picture_add')->name('picture.add');
Route::post('/admin/picture/add', 'PictureController@store')->middleware('perm:picture_add');
Route::get('/admin/picture/edit/{id}', 'PictureController@edit')->middleware('perm:picture_edit')->name('picture.edit');
Route::post('/admin/picture/edit/{id}', 'PictureController@update')->middleware('perm:picture_edit');
/** Item Category */ /** Inventory */
Route::get('/admin/inventory/management/category','ItemCategoryController@index')->middleware('perm:inventory_edit')->name('inv.management.category'); Route::get('/admin/inventory', 'InventoryController@index')->middleware('perm:inventory_see')->name('inv');
Route::get('/admin/inventory/management/category/add','ItemCategoryController@create')->middleware('perm:inventory_add')->name('inv.management.category.add'); Route::get('/admin/inventory/management', 'InventoryController@management')->middleware('perm:inventory_edit')->name('inv.management');
Route::post('/admin/inventory/management/category/add','ItemCategoryController@store')->middleware('perm:inventory_add');
Route::get('/admin/inventory/management/category/edit/{id}','ItemCategoryController@edit')->middleware('perm:inventory_edit')->name('inv.management.category.edit');
Route::post('/admin/inventory/management/category/edit/{id}','ItemCategoryController@update')->middleware('perm:inventory_edit');
/** News */ /** Item Category */
Route::get('/admin/news','NewsController@indexAdmin')->middleware('perm:news_see')->name('news'); Route::get('/admin/inventory/management/category', 'ItemCategoryController@index')->middleware('perm:inventory_edit')->name('inv.management.category');
Route::get('/admin/news/add','NewsController@create')->middleware('perm:news_add')->name('news.add'); Route::get('/admin/inventory/management/category/add', 'ItemCategoryController@create')->middleware('perm:inventory_add')->name('inv.management.category.add');
Route::post('/admin/news/add','NewsController@store')->middleware('perm:news_add'); Route::post('/admin/inventory/management/category/add', 'ItemCategoryController@store')->middleware('perm:inventory_add');
Route::get('/admin/news/edit/{id}','NewsController@edit')->middleware('perm:news_edit')->name('news.edit'); Route::get('/admin/inventory/management/category/edit/{id}', 'ItemCategoryController@edit')->middleware('perm:inventory_edit')->name('inv.management.category.edit');
Route::post('/admin/news/edit/{id}','NewsController@update')->middleware('perm:news_edit'); Route::post('/admin/inventory/management/category/edit/{id}', 'ItemCategoryController@update')->middleware('perm:inventory_edit');
/** Articles */ /** News */
Route::get('/admin/article','ArticleController@index')->middleware('perm:article_see')->name('article'); Route::get('/admin/news', 'NewsController@indexAdmin')->middleware('perm:news_see')->name('news');
Route::get('/admin/article/activity/edit/{id}','ArticleController@editActivity')->middleware('perm:article_edit')->name('article.edit'); Route::get('/admin/news/add', 'NewsController@create')->middleware('perm:news_add')->name('news.add');
Route::post('/admin/article/activity/edit/{id}','ArticleController@updateActivity')->middleware('perm:article_edit'); Route::post('/admin/news/add', 'NewsController@store')->middleware('perm:news_add');
Route::get('/admin/article/activity/picture/{id}','ArticleController@pictureActivity')->middleware('perm:article_edit'); Route::get('/admin/news/edit/{id}', 'NewsController@edit')->middleware('perm:news_edit')->name('news.edit');
Route::get('/admin/article/activity/picture/{id}/add','ArticleController@pictureActivityCreate')->middleware('perm:article_edit'); Route::post('/admin/news/edit/{id}', 'NewsController@update')->middleware('perm:news_edit');
Route::post('/admin/article/activity/picture/{id}/add','ArticleController@pictureActivityStore')->middleware('perm:article_edit');
/** Booking */ /** Articles */
Route::get('/admin/booking','BookingController@index')->middleware('perm:booking_see'); Route::get('/admin/article', 'ArticleController@index')->middleware('perm:article_see')->name('article');
Route::get('/admin/booking/{id}','BookingController@show')->middleware('perm:booking_see'); Route::get('/admin/article/activity/edit/{id}', 'ArticleController@editActivity')->middleware('perm:article_edit')->name('article.edit');
Route::get('/admin/booking/{type}/{id}','BookingController@index')->middleware('perm:booking_see'); Route::post('/admin/article/activity/edit/{id}', 'ArticleController@updateActivity')->middleware('perm:article_edit');
Route::get('/admin/booking/{type}/{id}/add','BookingController@create')->middleware('perm:booking_add'); Route::get('/admin/article/activity/picture/{id}', 'ArticleController@pictureActivity')->middleware('perm:article_edit');
Route::post('/admin/booking/{type}/{id}/add','BookingController@store')->middleware('perm:booking_add'); Route::get('/admin/article/activity/picture/{id}/add', 'ArticleController@pictureActivityCreate')->middleware('perm:article_edit');
Route::get('/admin/inventory/booking' , 'InventoryController@booking')->middleware('perm:inventory_see'); Route::post('/admin/article/activity/picture/{id}/add', 'ArticleController@pictureActivityStore')->middleware('perm:article_edit');
Route::post('/admin/booking/edit','BookingController@update')->middleware('perm:booking_see')->middleware('perm:booking_edit');
/** Item */ /** Booking */
Route::get('/admin/item/add' , 'ItemController@create')->middleware('perm:inventory_add'); Route::get('/admin/booking', 'BookingController@index')->middleware('perm:booking_see');
Route::get('/admin/item/edit/{id}' , 'ItemController@edit')->middleware('perm:inventory_edit'); Route::get('/admin/booking/{id}', 'BookingController@show')->middleware('perm:booking_see');
Route::post('/admin/item/add' , 'ItemController@store')->middleware('perm:inventory_add'); Route::get('/admin/booking/{type}/{id}', 'BookingController@index')->middleware('perm:booking_see');
Route::post('/admin/item/edit/{id}' , 'ItemController@update')->middleware('perm:inventory_edit'); Route::get('/admin/booking/{type}/{id}/add', 'BookingController@create')->middleware('perm:booking_add');
Route::post('/admin/booking/{type}/{id}/add', 'BookingController@store')->middleware('perm:booking_add');
Route::get('/admin/inventory/booking', 'InventoryController@booking')->middleware('perm:inventory_see');
Route::post('/admin/booking/edit', 'BookingController@update')->middleware('perm:booking_see')->middleware('perm:booking_edit');
/** Notification */ /** Item */
Route::get('/admin/notication/mark','UserController@notificationmarkALL'); Route::get('/admin/item/add', 'ItemController@create')->middleware('perm:inventory_add');
Route::post('/admin/notication/mark/{id}','UserController@notificationmark'); Route::get('/admin/item/edit/{id}', 'ItemController@edit')->middleware('perm:inventory_edit');
Route::post('/admin/item/add', 'ItemController@store')->middleware('perm:inventory_add');
Route::post('/admin/item/edit/{id}', 'ItemController@update')->middleware('perm:inventory_edit');
/** Profil */ /** Notification */
Route::get('/admin/profil/courses' , 'ProfilController@courses')->name('profil.courses'); Route::get('/admin/notication/mark', 'UserController@notificationmarkALL');
Route::get('/admin/profil/avatar' , 'UserController@UserAvatar')->name('profil.avatar'); Route::post('/admin/notication/mark/{id}', 'UserController@notificationmark');
Route::get('/admin/profil/password' , 'UserController@UserPassword')->name('profil.psw');
Route::get('/admin/profil/adress' , 'UserController@UserAdress')->name('profil.adress');
Route::get('/admin/profil/notifications','UserController@userNotification')->name('profil.notifications');
Route::post('/admin/profil/edit/adress' , 'UserController@editUserAdress');
Route::post('/admin/profil/edit/password' , 'UserController@editUserPassword');
Route::get('/admin/profil/edit/avatar/{id}' , 'UserController@editUserAvatar');
Route::get('/admin/profil/{id?}' , 'UserController@showUserProfil')->name('profil');
/** Instruction */ /** Profil */
Route::get('/admin/instruction','AdminController@instruction')->name('instruction'); Route::get('/admin/profil/courses', 'ProfilController@courses')->name('profil.courses');
Route::get('/admin/instruction/guide','FilesController@guide')->middleware('perm:instruction_guide_see')->name('instruction.guide'); Route::get('/admin/profil/avatar', 'UserController@UserAvatar')->name('profil.avatar');
Route::get('/admin/instruction/files','FilesController@instruction')->middleware('perm:file_see')->name('instruction.files'); Route::get('/admin/profil/password', 'UserController@UserPassword')->name('profil.psw');
Route::get('/admin/profil/adress', 'UserController@UserAdress')->name('profil.adress');
Route::get('/admin/profil/telephone', 'UserController@UserTelephone')->name('profil.telephone');
Route::get('/admin/profil/notifications', 'UserController@userNotification')->name('profil.notifications');
Route::post('/admin/profil/edit/adress', 'UserController@editUserAdress');
Route::post('/admin/profil/edit/telephone', 'UserController@editUserTelephone');
Route::post('/admin/profil/edit/password', 'UserController@editUserPassword');
Route::get('/admin/profil/edit/avatar/{id}', 'UserController@editUserAvatar');
Route::get('/admin/profil/{id?}', 'UserController@showUserProfil')->name('profil');
/** Courses */ /** Instruction */
Route::get('/admin/course','CourseController@index')->name('course'); Route::get('/admin/instruction', 'AdminController@instruction')->name('instruction');
Route::get('/admin/course/{id}','CourseController@show')->name('course.show')->middleware('courseperm:see'); Route::get('/admin/instruction/guide', 'FilesController@guide')->middleware('perm:instruction_guide_see')->name('instruction.guide');
Route::patch('/admin/course/{id}/commentOfficer','CourseController@updateCommentOfficer')->middleware('courseperm:comment_officer'); Route::get('/admin/instruction/files', 'FilesController@instruction')->middleware('perm:files_instruction_see')->name('instruction.files');
Route::patch('/admin/course/{id}/comment','CourseController@updateComment')->middleware('courseperm:edit');
Route::patch('/admin/course/{id}/plan/commentOfficer','CourseController@updateCommentOfficerPlan')->middleware('courseperm:comment_plan_officer'); /** Courses */
Route::patch('/admin/course/{id}/plan/comment','CourseController@updateCommentPlan')->middleware('courseperm:edit'); Route::get('/admin/course', 'CourseController@index')->name('course');
Route::post('/admin/course/{id}/lessonPlan','CourseController@updateLessonPlan')->middleware('courseperm:edit'); Route::get('/admin/course/{id}', 'CourseController@show')->name('course.show')->middleware('courseperm:see');
Route::patch('/admin/course/{id}/commentOfficer', 'CourseController@updateCommentOfficer')->middleware('courseperm:comment_officer');
Route::patch('/admin/course/{id}/comment', 'CourseController@updateComment')->middleware('courseperm:edit');
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::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');
Route::get('/admin/ocom/generate','OCOMController@showgenerate')->name('ocom.generate')->middleware('perm:instruction_db_ocom_edit'); Route::get('/admin/ocom/generate', 'OCOMController@showgenerate')->name('ocom.generate')->middleware('perm:instruction_db_ocom_edit');
Route::put('/admin/ocom/generate','OCOMController@generate')->middleware('perm:instruction_db_ocom_edit'); Route::put('/admin/ocom/generate', 'OCOMController@generate')->middleware('perm:instruction_db_ocom_edit');
Route::get('/admin/ocom/add','OCOMController@create')->name('ocom.add')->middleware('perm:instruction_db_ocom_add'); Route::get('/admin/ocom/add', 'OCOMController@create')->name('ocom.add')->middleware('perm:instruction_db_ocom_add');
Route::put('/admin/ocom/add','OCOMController@store')->middleware('perm:instruction_db_ocom_add'); Route::put('/admin/ocom/add', 'OCOMController@store')->middleware('perm:instruction_db_ocom_add');
Route::get('/admin/ocom/{id}/edit','OCOMController@edit')->name('ocom.edit')->middleware('perm:instruction_db_ocom_edit'); Route::get('/admin/ocom/{id}/edit', 'OCOMController@edit')->name('ocom.edit')->middleware('perm:instruction_db_ocom_edit');
Route::patch('/admin/ocom/{id}/edit','OCOMController@update')->middleware('perm:instruction_db_ocom_edit'); Route::patch('/admin/ocom/{id}/edit', 'OCOMController@update')->middleware('perm:instruction_db_ocom_edit');
Route::get('/admin/ocom/{id}','OCOMController@show')->name('ocom.show')->middleware('perm:instruction_db_ocom_see'); Route::get('/admin/ocom/{id}', 'OCOMController@show')->name('ocom.show')->middleware('perm:instruction_db_ocom_see');
}); });