forked from dbarzin/deming
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
458 changed files
with
418,471 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// $schedule->command('inspire')->hourly(); | ||
} | ||
|
||
/** | ||
* Register the commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands() | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
|
||
include base_path('routes/console.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class Control extends Model | ||
{ | ||
|
||
public static $searchable = [ | ||
'name', | ||
'clause', | ||
'objective', | ||
'attributes', | ||
'model' | ||
]; | ||
|
||
protected $dates = [ | ||
'created_at', | ||
'updated_at', | ||
'deleted_at', | ||
]; | ||
|
||
protected $fillable = [ | ||
]; | ||
|
||
// return the domain associated to this Control | ||
public function domain(int $id) | ||
{ | ||
return Domain::find($id); | ||
} | ||
|
||
// check if there is a measuremetn associated with this control | ||
|
||
public function isActive(int $id) | ||
{ | ||
return DB::table('measurements') | ||
->where('control_id', $id) | ||
->whereNull('realisation_date') | ||
->exists(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Document extends Model | ||
{ | ||
// | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Domain extends Model | ||
{ | ||
// | ||
public static $searchable = [ | ||
'title', | ||
'description', | ||
]; | ||
|
||
protected $dates = [ | ||
'created_at', | ||
'updated_at', | ||
'deleted_at', | ||
]; | ||
|
||
protected $fillable = [ | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
use Throwable; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that are not reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
// | ||
]; | ||
|
||
/** | ||
* A list of the inputs that are never flashed for validation exceptions. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontFlash = [ | ||
'password', | ||
'password_confirmation', | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* @param \Throwable $exception | ||
* @return void | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function report(Throwable $exception) | ||
{ | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Throwable $exception | ||
* @return \Symfony\Component\HttpFoundation\Response | ||
* | ||
* @throws \Throwable | ||
*/ | ||
public function render($request, Throwable $exception) | ||
{ | ||
return parent::render($request, $exception); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
|
||
namespace App\Exports; | ||
|
||
use App\Control; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
use Maatwebsite\Excel\Concerns\FromCollection; | ||
use Maatwebsite\Excel\Concerns\FromQuery; | ||
use Maatwebsite\Excel\Concerns\WithMapping; | ||
use Maatwebsite\Excel\Concerns\WithStyles; | ||
use Maatwebsite\Excel\Concerns\WithHeadings; | ||
use Maatwebsite\Excel\Concerns\WithColumnWidths; | ||
|
||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; | ||
|
||
class ControlsExport implements FromQuery, WithMapping, WithHeadings, WithStyles, WithColumnWidths | ||
{ | ||
public function headings(): array | ||
{ | ||
return [ | ||
'Clause', | ||
'Nom', | ||
'Objctif', | ||
'Attributs', | ||
'Modèle', | ||
'Indicateur', | ||
'Plan d\'action', | ||
'Responsable', | ||
'Périodicité' | ||
]; | ||
} | ||
|
||
public function styles(Worksheet $sheet) | ||
{ | ||
return [ | ||
// Style the first row as bold text. | ||
1 => ['font' => ['bold' => true], | ||
'alignment' => [ | ||
'wrapText' => true, | ||
'vertical' => 'top' | ||
], | ||
] | ||
]; | ||
} | ||
|
||
public function columnWidths(): array | ||
{ | ||
return [ | ||
'A' => 10, // Clause | ||
'B' => 30, // Nom | ||
'C' => 50, // Objectif | ||
'D' => 50, // Attibuts | ||
'E' => 50, // Modele | ||
'F' => 50, // Indicateur | ||
'G' => 50, // Plan d'action | ||
'H' => 20, // Responsable | ||
'I' => 20 // Period | ||
]; | ||
} | ||
|
||
/** | ||
* @var Control $control | ||
*/ | ||
public function map($control): array | ||
{ | ||
return [ | ||
[ | ||
$control->clause, | ||
$control->name, | ||
$control->objective, | ||
$control->attributes, | ||
$control->model, | ||
$control->indicator, | ||
$control->action_plan, | ||
$control->owner, | ||
$control->periodicity | ||
] | ||
]; | ||
} | ||
|
||
/** | ||
* @return \Illuminate\Support\Collection | ||
*/ | ||
public function query() | ||
{ | ||
// return Domain::all(); | ||
return DB::table('controls')->orderBy("clause"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace App\Exports; | ||
|
||
use App\Domain; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
use Maatwebsite\Excel\Concerns\FromCollection; | ||
use Maatwebsite\Excel\Concerns\FromQuery; | ||
use Maatwebsite\Excel\Concerns\WithMapping; | ||
use Maatwebsite\Excel\Concerns\WithStyles; | ||
use Maatwebsite\Excel\Concerns\WithHeadings; | ||
use Maatwebsite\Excel\Concerns\WithColumnWidths; | ||
use Maatwebsite\Excel\Concerns\ShouldAutoSize; | ||
|
||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; | ||
|
||
class DomainsExport implements FromQuery, WithMapping, WithHeadings, WithStyles, WithColumnWidths, ShouldAutoSize | ||
{ | ||
public function headings(): array | ||
{ | ||
return [ | ||
'#', | ||
'Description' | ||
]; | ||
} | ||
|
||
public function styles(Worksheet $sheet) | ||
{ | ||
return [ | ||
// Style the first row as bold text. | ||
1 => ['font' => ['bold' => true]] | ||
]; | ||
} | ||
|
||
public function columnWidths(): array | ||
{ | ||
return [ | ||
'A' => 5, | ||
'B' => 50, | ||
]; | ||
} | ||
|
||
/** | ||
* @var Domain $domain | ||
*/ | ||
public function map($domain): array | ||
{ | ||
return [ | ||
[ | ||
$domain->title, $domain->description | ||
] | ||
]; | ||
} | ||
|
||
/** | ||
* @return \Illuminate\Support\Collection | ||
*/ | ||
public function query() | ||
{ | ||
// return Domain::all(); | ||
return DB::table('domains')->orderBy("id"); | ||
} | ||
} |
Oops, something went wrong.