diff --git a/apps/maarch_entreprise/Views/parameter-administration.component.html b/apps/maarch_entreprise/Views/parameter-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..f22e8b2562a991b28df3389e30c3169edba0b801 --- /dev/null +++ b/apps/maarch_entreprise/Views/parameter-administration.component.html @@ -0,0 +1,71 @@ +<div id="resultInfo" class="fade" style="display:none;"> + {{resultInfo}} +</div> +<div *ngIf="loading"> + <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> +</div> +<div *ngIf="!loading" class="container-fluid"> + <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" routerLink="/administration/parameters" style="cursor: pointer"> + <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> + </a> + </div> + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div> + </div> + </nav> + <h1 style="margin-top: 0"><i class="fa fa-check-wrench fa-2x"></i> {{pageTitle}}</h1> + <div class="container-fluid" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> + <div class="col-md-6 col-md-offset-3"> + <form class="form-horizontal" (ngSubmit)="onSubmit()" #parameterFormUp="ngForm"> + <div class="form-group"> + <div class="col-sm-12"> + <div class="input-group"> + <span class="input-group-addon"><i aria-hidden="true" class="fa fa-hashtag" title="{{this.lang.identifier}}"></i><sup class="mandatory" title="champ requis">*</sup></span> + <input [(ngModel)]="parameter.id" [disabled]="!creationMode" required class="form-control" name="id" id="id" title="{{lang.desc}}" type="text" placeholder="{{this.lang.identifier}}" required> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <div class="input-group"> + <span class="input-group-addon"><i aria-hidden="true" class="fa fa-tag" title="{{this.lang.description}}"></i><sup class="mandatory" title="champ requis"></sup></span> + <input [(ngModel)]="parameter.description" class="form-control" name="description" id="description" title="{{lang.description}}" type="text" placeholder="{{this.lang.description}}"> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <div class="input-group"> + <span class="input-group-addon"><i aria-hidden="true" class="fa fa-bullseye" title="{{this.lang.type}}"></i><sup class="mandatory" title="champ requis"></sup></span> + <select name="type" id="type" [disabled]="!creationMode" [(ngModel)]="type" class="forms-select form-control" #selectType> + <option value="string" [(ngValue)]="string">{{this.lang.string}}</option> + <option value="int" [(ngValue)]="int">{{this.lang.integer}}</option> + <option value="date" [(ngValue)]="date">{{this.lang.date}}</option> + </select> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <div class="input-group"> + <span class="input-group-addon"><i aria-hidden="true" class="fa fa-code" title="{{this.lang.value}}"></i><sup class="mandatory" title="champ requis">*</sup></span> + <input *ngIf = "type == 'string'" [(ngModel)]="parameter.param_value_string" class="form-control" name="paramValue" id="paramValue" title="{{this.lang.value}}" type="text" placeholder="{{this.lang.value}}" required> + <input *ngIf = "type == 'int'" [(ngModel)]="parameter.param_value_int" class="form-control" name="paramValue" id="paramValue" title="{{this.lang.value}}" type="number" placeholder="{{this.lang.value}}" required> + <input *ngIf = "type == 'date'" [(ngModel)]="parameter.param_value_date" class="form-control" name="paramValue" id="paramValue" title="{{this.lang.value}}" type="date" placeholder="{{this.lang.value}}" required> + </div> + </div> + </div> + <div class="col-sm-12" style="text-align:center;"> + <button class="btn btn-default" type="submit" [disabled]="!parameterFormUp.form.valid" >{{lang.validate}}</button> + <button class="btn btn-default" routerLink='/administration/parameters'>{{lang.cancel}}</button> + </div> + </form> + </div> + </div> +</div> diff --git a/apps/maarch_entreprise/Views/parameter.component.html b/apps/maarch_entreprise/Views/parameter.component.html deleted file mode 100644 index 6c711612a571ba91183ef75ae034b96fc81cda4d..0000000000000000000000000000000000000000 --- a/apps/maarch_entreprise/Views/parameter.component.html +++ /dev/null @@ -1,51 +0,0 @@ -<div id="resultInfo" class="fade" style="display:none;"> - {{resultInfo}} -</div> - -<div class="block"> - <div id="parameter" class="forms" style="width:400px;margin:auto;"> - <form (ngSubmit)="submitParameter()" #signatureForm="ngForm"> - - <div id="create" *ngIf="mode == 'create' "> - <p> - <label for="id" >{{this.lang.identifier}}</label> - <input name="id" id="id" type="text" [(ngModel)]="parameter.id" required><span class="red_asterisk"><i class="fa fa-star"></i></span> - </p> - </div> - <div id = "update" *ngIf = "mode == 'update'"> - <p> - <label for="id" >{{this.lang.identifier}}</label> - <input name="id" id="id" type="text" [(ngModel)]="parameter.id" required disabled><span class="red_asterisk"><i class="fa fa-star"></i></span> - </p> - </div> - - <p> - <label for="type">{{this.lang.type}}</label> - <select name="type" id="type" [(ngModel)]="type" > - <option value="string" [(ngValue)]="string">{{this.lang.string}}</option> - <option value="int" [(ngValue)]="int">{{this.lang.integer}}</option> - <option value="date" [(ngValue)]="date">{{this.lang.date}}</option> - </select> - <span class="red_asterisk"><i class="fa fa-star"></i></span> - </p> - <p> - <label *ngIf="type == 'string'" for="param_value_string">{{this.lang.value}}</label> - <label *ngIf="type == 'int'" for="param_value_int">{{this.lang.value}}</label> - <label *ngIf="type == 'date'" for="param_value_date">{{this.lang.value}}</label> - - <input *ngIf = "type == 'string'" name="param_value_string" id="param_value_string" style="display: block;" type="text" [(ngModel)]="parameter.param_value_string"> - <input *ngIf = "type == 'int'" name="param_value_int" id="param_value_int" style="display:block" type="text" [(ngModel)]="parameter.param_value_int" > - <input *ngIf = "type == 'date'" name="param_value_date" id="param_value_date" style="display:block" onclick="showCalender(this);" type="text" [(ngModel)]="parameter.param_value_date"> - </p> - <p> - <label for="description">{{this.lang.description}}</label> - <textarea name="description" id="description" [(ngModel)]="parameter.description" ></textarea> - </p> - <p class="button" style="text-align:center"> - <button class="btn btn-success" type="submit">{{this.lang.validate}}</button> - <button class="btn btn-warning" routerLink='/administration/parameters'>{{this.lang.cancel}}</button> - </p> - - </form> - </div> -</div> diff --git a/apps/maarch_entreprise/Views/parameters-administration.component.html b/apps/maarch_entreprise/Views/parameters-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..39989cb7db27feeacae2405149cd687242fabf82 --- /dev/null +++ b/apps/maarch_entreprise/Views/parameters-administration.component.html @@ -0,0 +1,54 @@ +<div id="resultInfo" class="fade" style="display:none;"> + {{resultInfo}} +</div> +<div *ngIf="loading"> + <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> +</div> +<div *ngIf="!loading" class="container-fluid"> + <h1 style="margin-top: 0"><i class="fa fa-wrench fa-2x"></i> {{lang.admin}} {{lang.parameters}} : {{parametersList.length}} {{lang.parameter}}(s)</h1> + <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" routerLink="/administration" style="cursor: pointer"> + <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> + </a> + </div> + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> + <ul class="nav navbar-nav navbar-right"> + <li style="cursor: pointer" routerLink="/administration/parameters/new"> + <a title="{{lang.new_parameter}}"><i class="fa fa-wrench"></i><sup><i class="fa fa-plus"></i></sup></a> + </li> + </ul> + </div> + </div> + </nav> + <div class="col-md-12"> + <table id ="paramsTable" class="display" style="display:none;"> + <thead> + <tr> + <th style="width:10%;"><span>{{lang.identifier}}</span></th> + <th style="width:30%;"><span>{{lang.description}}</span></th> + <th style="width:30%;"><span>{{lang.value}}</span></th> + <th style="width:30%;"><span> </span></th> + </tr> + </thead> + <tbody> + <tr *ngFor="let parameter of parametersList" id="{{parameter.id}}"> + <td style="width:10%;"> {{parameter.id}} </td> + <td style="width:30%;"> {{parameter.description}} </td> + <td style="width:30%;"> {{parameter.param_value_string || parameter.param_value_int || parameter.param_value_date}} </td> + <td style="text-align:right;width:30%;"> + <div class="btn-group" role="group"> + <button routerLink="/administration/parameters/{{parameter.id}}" type="button" class="btn btn-default" title="{{lang.modify}}"> + <a><i style="cursor:pointer" class="fa fa-edit"></i></a> + </button> + <button type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteParameter(parameter.id)"> + <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> + </button> + </div> + </td> + </tr> + </tbody> + </table> + </div> +</div> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/parameters.component.html b/apps/maarch_entreprise/Views/parameters.component.html deleted file mode 100644 index ea5ed819edd6243a7df14bcf8fa9b5342feb0334..0000000000000000000000000000000000000000 --- a/apps/maarch_entreprise/Views/parameters.component.html +++ /dev/null @@ -1,27 +0,0 @@ -<div id="resultInfo" class="fade" style="display:none;"> - {{resultInfo}} -</div> -<div> - <input style="margin : 10px" class="btn btn-default" value="{{lang.controlTechnicalParams}}" (click)="goUrl()" type="button"> - <table id ="paramsTable" class="display" style="width: 100%; min-width: 900px;" width="100%" cellspacing="0" border="0"> - <thead> - <tr> - <th style="width:20%;" valign="bottom" align="left"><span> {{lang.identifier}}</span></th> - <th style="width:30%;" valign="bottom" align="left"><span> {{lang.description}} </span></th> - <th style="width:30%;" valign="bottom" align="left"><span> {{lang.value}} </span></th> - <th><span></span></th> - <th><span></span></th> - </tr> - </thead> - <tbody> - <tr *ngFor="let parameter of parametersList" id="{{parameter.id}}"> - <td> {{parameter.id}} </td> - <td> {{parameter.description}} </td> - <td> {{parameter.param_value_string || parameter.param_value_int || parameter.param_value_date}} </td> - <td><a routerLink="/administration/parameter/update/{{parameter.id}}"><i style ="cursor:pointer" class="fa fa-edit fa-2x" title="{{lang.modifyParameter}}"></i></a></td> - <td><i (click)="deleteParameter(parameter.id)" style ="cursor:pointer; color: #D9534F" class="fa fa-trash fa-2x" title="{{lang.deleteParameter}} {{parameter.id}}"></i></td> - </tr> - </tbody> - </table> - <i routerLink="/administration/parameter/create" class="fa fa-plus-square fa-3x" style="cursor:pointer; position: absolute; right: 25px; color : #337AB7" title="Nouveau paramètre"></i> -</div> \ No newline at end of file diff --git a/apps/maarch_entreprise/css/parameter.component.css b/apps/maarch_entreprise/css/parameter.component.css deleted file mode 100644 index b27b6742f3f807503010d6455eb8cb5cbf4f66a7..0000000000000000000000000000000000000000 --- a/apps/maarch_entreprise/css/parameter.component.css +++ /dev/null @@ -1,14 +0,0 @@ -#resultInfo{ - top :10px; - text-align: center; - position: absolute; - width: 30%; - right: 10px; - z-index: 1051; - height: 40px; - -moz-box-shadow: 0px 0px 5px 0px #656565; - -webkit-box-shadow: 0px 0px 5px 0px #656565; - -o-box-shadow: 0px 0px 5px 0px #656565; - box-shadow: 0px 0px 5px 0px #656565; - filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=NaN, Strength=5); -} \ No newline at end of file diff --git a/apps/maarch_entreprise/css/parameters-administration.component.css b/apps/maarch_entreprise/css/parameters-administration.component.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/apps/maarch_entreprise/js/angular/app/action-administration.component.ts b/apps/maarch_entreprise/js/angular/app/action-administration.component.ts index a222b2e7cbc97de95e0dac8caeb518d2bdcce411..bd1110429901a50b8dce79c8f0ecf0dac5ce1dc4 100644 --- a/apps/maarch_entreprise/js/angular/app/action-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/action-administration.component.ts @@ -124,45 +124,16 @@ export class ActionAdministrationComponent implements OnInit { } - selectAll(event){ + selectAll(event:any){ var target = event.target.getAttribute("data-target"); $j('#' + target + ' option').prop('selected', true); $j('#' + target).trigger('chosen:updated'); } - unselectAll(event){ + unselectAll(event:any){ var target = event.target.getAttribute("data-target"); $j('#' + target + ' option').prop('selected', false); $j('#' + target).trigger('chosen:updated'); } - - /*createAction() { - delete this.action.id; - delete this.action.coll_categories; - this.http.post(this.coreUrl + 'rest/actions', this.action) - .map(res => res.json()) - .subscribe((data) => { - if (data.errors) { - - } else { - this.router.navigate(['/administration/actions']); - this.resultInfo = this.lang.action_added; - setTimeout(() => { - $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); - $j("#resultInfo").text(this.lang.action_added); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - }, 0); - } - }, (errors) => { - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").text(JSON.parse(errors._body).errors); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - }); - }*/ - } \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/actions-administration.component.js b/apps/maarch_entreprise/js/angular/app/actions-administration.component.js index ac92a88c9c5fd16f52baaec0112a6aada4feb936..72805326169575b33835941847de7f4bbe9805e3 100644 --- a/apps/maarch_entreprise/js/angular/app/actions-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/actions-administration.component.js @@ -20,7 +20,6 @@ var ActionsAdministrationComponent = (function () { this.lang = {}; this.resultInfo = ""; this.loading = false; - this.coreUrl = angularGlobals.coreUrl; } ActionsAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { if ($j('#ariane')[0]) { @@ -29,6 +28,7 @@ var ActionsAdministrationComponent = (function () { }; ActionsAdministrationComponent.prototype.ngOnInit = function () { var _this = this; + this.coreUrl = angularGlobals.coreUrl; this.loading = true; this.updateBreadcrumb(angularGlobals.applicationName); $j('#inner_content').remove(); @@ -81,7 +81,7 @@ var ActionsAdministrationComponent = (function () { var _this = this; var r = confirm(this.lang.deleteMsg + ' ?'); if (r) { - this.http.delete(this.coreUrl + 'rest/actions/' + id, this.actions) + this.http.delete(this.coreUrl + 'rest/actions/' + id) .map(function (res) { return res.json(); }) .subscribe(function (data) { if (data.errors) { diff --git a/apps/maarch_entreprise/js/angular/app/actions-administration.component.ts b/apps/maarch_entreprise/js/angular/app/actions-administration.component.ts index 322251252a1104f986c2f2b05bdf666f12c278d0..96454236d93e927889ecb0d873e31fc7a5ea32e1 100644 --- a/apps/maarch_entreprise/js/angular/app/actions-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/actions-administration.component.ts @@ -24,7 +24,6 @@ export class ActionsAdministrationComponent implements OnInit { loading : boolean = false; constructor(public http: Http) { - this.coreUrl = angularGlobals.coreUrl; } updateBreadcrumb(applicationName: string) { @@ -34,6 +33,8 @@ export class ActionsAdministrationComponent implements OnInit { } ngOnInit(): void { + this.coreUrl = angularGlobals.coreUrl; + this.loading = true; this.updateBreadcrumb(angularGlobals.applicationName); @@ -90,7 +91,7 @@ export class ActionsAdministrationComponent implements OnInit { let r = confirm(this.lang.deleteMsg+' ?'); if (r) { - this.http.delete(this.coreUrl + 'rest/actions/' + id, this.actions) + this.http.delete(this.coreUrl + 'rest/actions/' + id) .map(res => res.json()) .subscribe((data) => { if (data.errors) { diff --git a/apps/maarch_entreprise/js/angular/app/app.module.js b/apps/maarch_entreprise/js/angular/app/app.module.js index 198e917437f41d848bd9de0f2887d8327d1998a2..461901f98021e5f1c98b65496963f5a3f9c527f2 100644 --- a/apps/maarch_entreprise/js/angular/app/app.module.js +++ b/apps/maarch_entreprise/js/angular/app/app.module.js @@ -21,8 +21,8 @@ var status_administration_component_1 = require("./status-administration.compone var actions_administration_component_1 = require("./actions-administration.component"); var action_administration_component_1 = require("./action-administration.component"); var profile_component_1 = require("./profile.component"); -var parameter_component_1 = require("./parameter.component"); -var parameters_component_1 = require("./parameters.component"); +var parameter_administration_component_1 = require("./parameter-administration.component"); +var parameters_administration_component_1 = require("./parameters-administration.component"); var priorities_component_1 = require("./priorities.component"); var priority_component_1 = require("./priority.component"); var signature_book_component_1 = require("./signature-book.component"); @@ -47,9 +47,9 @@ AppModule = __decorate([ { path: 'administration/status/new', component: status_administration_component_1.StatusAdministrationComponent }, { path: 'administration/status/:identifier', component: status_administration_component_1.StatusAdministrationComponent }, { path: 'profile', component: profile_component_1.ProfileComponent }, - { path: 'administration/parameter/create', component: parameter_component_1.ParameterComponent }, - { path: 'administration/parameter/update/:id', component: parameter_component_1.ParameterComponent }, - { path: 'administration/parameters', component: parameters_component_1.ParametersComponent }, + { path: 'administration/parameters/new', component: parameter_administration_component_1.ParameterAdministrationComponent }, + { path: 'administration/parameters/:id', component: parameter_administration_component_1.ParameterAdministrationComponent }, + { path: 'administration/parameters', component: parameters_administration_component_1.ParametersAdministrationComponent }, { path: 'administration/reports', component: reports_component_1.ReportsComponent }, { path: 'administration/priorities', component: priorities_component_1.PrioritiesComponent }, { path: 'administration/priority/update/:id', component: priority_component_1.PriorityComponent }, @@ -74,8 +74,8 @@ AppModule = __decorate([ status_list_administration_component_1.StatusListAdministrationComponent, priorities_component_1.PrioritiesComponent, priority_component_1.PriorityComponent, - parameters_component_1.ParametersComponent, - parameter_component_1.ParameterComponent, + parameters_administration_component_1.ParametersAdministrationComponent, + parameter_administration_component_1.ParameterAdministrationComponent, profile_component_1.ProfileComponent, signature_book_component_1.SignatureBookComponent, signature_book_component_1.SafeUrlPipe diff --git a/apps/maarch_entreprise/js/angular/app/app.module.ts b/apps/maarch_entreprise/js/angular/app/app.module.ts index 17609a4d180719b67e03abe0348b193141e5fb8b..a25c16c1148f9988c68a6b7de2f0b147ea7005e2 100644 --- a/apps/maarch_entreprise/js/angular/app/app.module.ts +++ b/apps/maarch_entreprise/js/angular/app/app.module.ts @@ -14,8 +14,8 @@ import { StatusAdministrationComponent } from './status-administration.co import { ActionsAdministrationComponent } from './actions-administration.component'; import { ActionAdministrationComponent } from './action-administration.component'; import { ProfileComponent } from './profile.component'; -import { ParameterComponent } from './parameter.component'; -import { ParametersComponent } from './parameters.component'; +import { ParameterAdministrationComponent } from './parameter-administration.component'; +import { ParametersAdministrationComponent } from './parameters-administration.component'; import { PrioritiesComponent } from './priorities.component'; import { PriorityComponent } from './priority.component'; @@ -36,9 +36,9 @@ import { ReportsComponent } from './reports.component'; { path: 'administration/status/new', component: StatusAdministrationComponent }, { path: 'administration/status/:identifier', component: StatusAdministrationComponent }, { path: 'profile', component: ProfileComponent }, - { path: 'administration/parameter/create', component: ParameterComponent }, - { path: 'administration/parameter/update/:id', component: ParameterComponent }, - { path: 'administration/parameters', component: ParametersComponent }, + { path: 'administration/parameters/new', component: ParameterAdministrationComponent }, + { path: 'administration/parameters/:id', component: ParameterAdministrationComponent }, + { path: 'administration/parameters', component: ParametersAdministrationComponent }, { path: 'administration/reports', component : ReportsComponent}, { path: 'administration/priorities', component : PrioritiesComponent }, { path: 'administration/priority/update/:id', component : PriorityComponent }, @@ -63,8 +63,8 @@ import { ReportsComponent } from './reports.component'; StatusListAdministrationComponent, PrioritiesComponent, PriorityComponent, - ParametersComponent, - ParameterComponent, + ParametersAdministrationComponent, + ParameterAdministrationComponent, ProfileComponent, SignatureBookComponent, SafeUrlPipe diff --git a/apps/maarch_entreprise/js/angular/app/parameter-administration.component.js b/apps/maarch_entreprise/js/angular/app/parameter-administration.component.js new file mode 100644 index 0000000000000000000000000000000000000000..d8cd4361619551a9df96b9c3e583a13ce92146f6 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/parameter-administration.component.js @@ -0,0 +1,144 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = require("@angular/core"); +var http_1 = require("@angular/http"); +require("rxjs/add/operator/map"); +var router_1 = require("@angular/router"); +var ParameterAdministrationComponent = (function () { + function ParameterAdministrationComponent(http, route, router) { + this.http = http; + this.route = route; + this.router = router; + this.creationMode = true; + this.parameter = {}; + this.lang = ""; + this.resultInfo = ""; + this.loading = false; + } + ParameterAdministrationComponent.prototype.ngOnInit = function () { + var _this = this; + this.loading = true; + this.coreUrl = angularGlobals.coreUrl; + this.prepareParameter(); + this.updateBreadcrumb(angularGlobals.applicationName); + this.route.params.subscribe(function (params) { + if (typeof params['id'] == "undefined") { + _this.creationMode = true; + _this.http.get(_this.coreUrl + 'rest/administration/parameters/new') + .map(function (res) { return res.json(); }) + .subscribe(function (data) { + _this.lang = data.lang; + _this.type = 'string'; + _this.pageTitle = _this.lang.newParameter; + _this.loading = false; + setTimeout(function () { + //$j("select").chosen({width:"100%",disable_search_threshold: 10, search_contains: true}); + }, 0); + }, function () { + location.href = "index.php"; + }); + } + else { + _this.creationMode = false; + _this.http.get(_this.coreUrl + 'rest/administration/parameters/' + params['id']) + .map(function (res) { return res.json(); }) + .subscribe(function (data) { + _this.parameter = data.parameter; + _this.lang = data.lang; + _this.type = data.type; + _this.loading = false; + setTimeout(function () { + //$j("select").chosen({width:"100%",disable_search_threshold: 10, search_contains: true}); + }, 0); + }, function () { + location.href = "index.php"; + }); + } + }); + }; + ParameterAdministrationComponent.prototype.prepareParameter = function () { + $j('#inner_content').remove(); + }; + ParameterAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>Paramètres</a> > Modification"; + } + }; + ParameterAdministrationComponent.prototype.onSubmit = function () { + if (this.type == 'date') { + this.parameter.param_value_date = $j("#paramValue").val(); + this.parameter.param_value_int = null; + this.parameter.param_value_string = null; + } + else if (this.type == 'int') { + this.parameter.param_value_date = null; + this.parameter.param_value_string = null; + } + else if (this.type == 'string') { + this.parameter.param_value_date = null; + this.parameter.param_value_int = null; + } + /*if(this.mode == 'create'){ + this.http.post(this.coreUrl + 'rest/parameters', this.parameter) + .map(res => res.json()) + .subscribe((data) => { + if(data.errors) { + this.resultInfo = data.errors; + $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + this.parameter.param_value_date=null; + this.parameter.param_value_int=null; + this.parameter.param_value_string=null; + } else { + this.resultInfo = this.lang.paramCreatedSuccess; + $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + this.router.navigate(['administration/parameters']); + } + + }); + } else if(this.mode == "update"){ + + this.http.put(this.coreUrl+'rest/parameters/'+this.paramId,this.parameter) + .map(res => res.json()) + .subscribe((data) => { + if(data.errors){ + this.resultInfo = data.errors; + $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + } else { + this.resultInfo = this.lang.paramUpdatedSuccess; + $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + this.router.navigate(['administration/parameters']); + } + }); + }*/ + }; + return ParameterAdministrationComponent; +}()); +ParameterAdministrationComponent = __decorate([ + core_1.Component({ + templateUrl: angularGlobals['parameter-administrationView'], + styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + }), + __metadata("design:paramtypes", [http_1.Http, router_1.ActivatedRoute, router_1.Router]) +], ParameterAdministrationComponent); +exports.ParameterAdministrationComponent = ParameterAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/parameter.component.ts b/apps/maarch_entreprise/js/angular/app/parameter-administration.component.ts similarity index 51% rename from apps/maarch_entreprise/js/angular/app/parameter.component.ts rename to apps/maarch_entreprise/js/angular/app/parameter-administration.component.ts index ed20a5435d97e025df74771b72d26be3ab164d5a..bb163c2fac179da2aaba6aa8a1576bd4e6414336 100644 --- a/apps/maarch_entreprise/js/angular/app/parameter.component.ts +++ b/apps/maarch_entreprise/js/angular/app/parameter-administration.component.ts @@ -7,51 +7,65 @@ declare function $j(selector: any) : any; declare var angularGlobals : any; @Component({ - templateUrl : angularGlobals.parameterView, - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css','css/parameter.component.css'] + templateUrl : angularGlobals['parameter-administrationView'], + styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] }) -export class ParameterComponent implements OnInit { - coreUrl : string; - pageTitle : string ; - mode : string = null; - paramId : string; - type : string; - parametersList : any = null; - parameter : any = { - id : null, - param_value_string : null, - param_value_int : null, - param_value_date : null, - description : null - }; - paramDateTemp :string; - lang : any = ""; - - resultInfo : string = ""; +export class ParameterAdministrationComponent implements OnInit { + coreUrl : string; + pageTitle : string; + creationMode : boolean = true; + type : string; + parameter : any = {}; + paramDateTemp : string; + lang : any = ""; + resultInfo : string = ""; + loading : boolean = false; constructor(public http: Http, private route: ActivatedRoute, private router: Router) { } ngOnInit(): void { + this.loading = true; this.coreUrl = angularGlobals.coreUrl; this.prepareParameter(); - this.http.get(this.coreUrl + 'rest/parameters/lang') - .map(res => res.json()) - .subscribe((data) => { - this.lang = data; - }); + this.updateBreadcrumb(angularGlobals.applicationName); this.route.params.subscribe((params) => { - if(this.route.toString().includes('update')){ - this.mode='update'; - this.paramId = params['id']; - this.getParameterInfos(this.paramId); - } else if (this.route.toString().includes('create')){ - this.mode = 'create'; - this.pageTitle = '<i class=\"fa fa-wrench fa-2x\"></i> Paramètre'; - $j('#pageTitle').html(this.pageTitle); - this.type = 'string'; + if (typeof params['id'] == "undefined"){ + this.creationMode = true; + + this.http.get(this.coreUrl + 'rest/administration/parameters/new') + .map(res => res.json()) + .subscribe((data) => { + this.lang = data.lang; + this.type = 'string'; + this.pageTitle = this.lang.newParameter; + + this.loading = false; + setTimeout(() => { + //$j("select").chosen({width:"100%",disable_search_threshold: 10, search_contains: true}); + }, 0); + }, () => { + location.href = "index.php"; + }); + } else { + this.creationMode = false; + this.http.get(this.coreUrl + 'rest/administration/parameters/'+params['id']) + .map(res => res.json()) + .subscribe((data) => { + this.parameter = data.parameter; + this.lang = data.lang + this.type = data.type; + + this.loading = false; + setTimeout(() => { + //$j("select").chosen({width:"100%",disable_search_threshold: 10, search_contains: true}); + }, 0); + + }, () => { + location.href = "index.php"; + }); } }); @@ -62,44 +76,15 @@ export class ParameterComponent implements OnInit { } updateBreadcrumb(applicationName: string){ - $j('#ariane').html("<a href='index.php?reinit=true'>" + applicationName + "</a> ><a href='index.php?page=admin&reinit=true'> Administration</a> > Paramètres"); + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>Paramètres</a> > Modification"; + } } - getParameterInfos(paramId : string){ - this.http.get(this.coreUrl + 'rest/parameters/'+paramId) - .map(res => res.json()) - .subscribe((data) => { - if(data.errors){ - this.resultInfo = data.errors; - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - } else{ - var infoParam=data; - this.parameter.id = infoParam[0].id; - if(infoParam[0].param_value_string != null){ - this.parameter.param_value_string = infoParam[0].param_value_string - this.type = "string"; - } else if(infoParam[0].param_value_int != null){ - this.parameter.param_value_int = infoParam[0].param_value_int; - this.type = "int"; - } else if(infoParam[0].param_value_date != null) { - this.parameter.param_value_date = infoParam[0].param_value_date; - this.type = "date"; - } - this.parameter.description = infoParam[0].description; - this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i> Paramètre : "+this.parameter.id; - $j('#pageTitle').html(this.pageTitle); - } - }); - } - submitParameter() { - + onSubmit() { if(this.type=='date'){ - //Résolution bug calendrier - this.parameter.param_value_date = $j("#param_value_date").val(); + this.parameter.param_value_date = $j("#paramValue").val(); this.parameter.param_value_int=null; this.parameter.param_value_string=null; } @@ -112,7 +97,7 @@ export class ParameterComponent implements OnInit { this.parameter.param_value_int=null; } - if(this.mode == 'create'){ + /*if(this.mode == 'create'){ this.http.post(this.coreUrl + 'rest/parameters', this.parameter) .map(res => res.json()) .subscribe((data) => { @@ -155,7 +140,6 @@ export class ParameterComponent implements OnInit { this.router.navigate(['administration/parameters']); } }); - } + }*/ } - } diff --git a/apps/maarch_entreprise/js/angular/app/parameter.component.js b/apps/maarch_entreprise/js/angular/app/parameter.component.js index 88489f5408893e6699314c2ca48d3310ba0eb7ec..f79089db4bc1503eb9ee00b07478f21b393221c1 100644 --- a/apps/maarch_entreprise/js/angular/app/parameter.component.js +++ b/apps/maarch_entreprise/js/angular/app/parameter.component.js @@ -29,9 +29,11 @@ var ParameterComponent = (function () { }; this.lang = ""; this.resultInfo = ""; + this.loading = false; } ParameterComponent.prototype.ngOnInit = function () { var _this = this; + this.loading = true; this.coreUrl = angularGlobals.coreUrl; this.prepareParameter(); this.http.get(this.coreUrl + 'rest/parameters/lang') @@ -40,17 +42,21 @@ var ParameterComponent = (function () { _this.lang = data; }); this.route.params.subscribe(function (params) { - if (_this.route.toString().includes('update')) { + if (_this.route.toString().includes('parameters/new')) { + _this.http.get(_this.coreUrl + 'rest/parameters/new') + .map(function (res) { return res.json(); }) + .subscribe(function (data) { + _this.lang = data['lang']; + _this.mode = 'create'; + _this.pageTitle = _this.lang.newParameter; + _this.updateBreadcrumb(angularGlobals.applicationName); + }); + } + else { _this.mode = 'update'; _this.paramId = params['id']; _this.getParameterInfos(_this.paramId); } - else if (_this.route.toString().includes('create')) { - _this.mode = 'create'; - _this.pageTitle = '<i class=\"fa fa-wrench fa-2x\"></i> Paramètre'; - $j('#pageTitle').html(_this.pageTitle); - _this.type = 'string'; - } }); }; ParameterComponent.prototype.prepareParameter = function () { @@ -64,32 +70,24 @@ var ParameterComponent = (function () { this.http.get(this.coreUrl + 'rest/parameters/' + paramId) .map(function (res) { return res.json(); }) .subscribe(function (data) { - if (data.errors) { - _this.resultInfo = data.errors; - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { - $j("#resultInfo").slideUp(500); - }); + var infoParam = data; + console.log(infoParam); + _this.parameter.id = infoParam[0].id; + if (infoParam[0].param_value_string != null) { + _this.parameter.param_value_string = infoParam[0].param_value_string; + _this.type = "string"; } - else { - var infoParam = data; - _this.parameter.id = infoParam[0].id; - if (infoParam[0].param_value_string != null) { - _this.parameter.param_value_string = infoParam[0].param_value_string; - _this.type = "string"; - } - else if (infoParam[0].param_value_int != null) { - _this.parameter.param_value_int = infoParam[0].param_value_int; - _this.type = "int"; - } - else if (infoParam[0].param_value_date != null) { - _this.parameter.param_value_date = infoParam[0].param_value_date; - _this.type = "date"; - } - _this.parameter.description = infoParam[0].description; - _this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i> Paramètre : " + _this.parameter.id; - $j('#pageTitle').html(_this.pageTitle); + else if (infoParam[0].param_value_int != null) { + _this.parameter.param_value_int = infoParam[0].param_value_int; + _this.type = "int"; + } + else if (infoParam[0].param_value_date != null) { + _this.parameter.param_value_date = infoParam[0].param_value_date; + _this.type = "date"; } + _this.parameter.description = infoParam[0].description; + _this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i> Paramètre : " + _this.parameter.id; + $j('#pageTitle').html(_this.pageTitle); }); }; ParameterComponent.prototype.submitParameter = function () { @@ -158,8 +156,8 @@ var ParameterComponent = (function () { }()); ParameterComponent = __decorate([ core_1.Component({ - templateUrl: angularGlobals.parameterView, - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/parameter.component.css'] + templateUrl: angularGlobals['parameter-administrationView'], + styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] }), __metadata("design:paramtypes", [http_1.Http, router_1.ActivatedRoute, router_1.Router]) ], ParameterComponent); diff --git a/apps/maarch_entreprise/js/angular/app/parameters-administration.component.js b/apps/maarch_entreprise/js/angular/app/parameters-administration.component.js new file mode 100644 index 0000000000000000000000000000000000000000..e4cc0d6f43680a47491c5475d194788360820397 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/parameters-administration.component.js @@ -0,0 +1,124 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = require("@angular/core"); +var http_1 = require("@angular/http"); +require("rxjs/add/operator/map"); +var ParametersAdministrationComponent = (function () { + function ParametersAdministrationComponent(http) { + this.http = http; + this.lang = ""; + this.resultInfo = ""; + this.loading = false; + } + ParametersAdministrationComponent.prototype.prepareParameter = function () { + $j('#inner_content').remove(); + }; + ParametersAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Paramètres"; + }; + ParametersAdministrationComponent.prototype.ngOnInit = function () { + var _this = this; + this.coreUrl = angularGlobals.coreUrl; + this.prepareParameter(); + this.updateBreadcrumb(angularGlobals.applicationName); + this.http.get(this.coreUrl + 'rest/administration/parameters') + .map(function (res) { return res.json(); }) + .subscribe(function (data) { + if (data.errors) { + $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { + $j("#resultInfo").slideUp(500); + }); + } + else { + _this.parametersList = data.parametersList; + _this.lang = data.lang; + setTimeout(function () { + _this.table = $j('#paramsTable').DataTable({ + "dom": '<"datatablesLeft"l><"datatablesRight"f><"datatablesCenter"p>rt<"datatablesCenter"i><"clear">', + "lengthMenu": [10, 25, 50, 75, 100], + "oLanguage": { + "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", + "sZeroRecords": _this.lang.noResult, + "sInfo": "_START_ - _END_ / _TOTAL_ " + _this.lang.record, + "sSearch": "", + "oPaginate": { + "sFirst": "<<", + "sLast": ">>", + "sNext": _this.lang.next + " <i class='fa fa-caret-right'></i>", + "sPrevious": "<i class='fa fa-caret-left'></i> " + _this.lang.previous + }, + "sInfoEmpty": _this.lang.noRecord, + "sInfoFiltered": "(filtré de _MAX_ " + _this.lang.record + ")" + }, + "order": [[0, "asc"]], + "columnDefs": [ + { "orderable": false, "targets": 3 } + ], + "fnInitComplete": function () { + $j('#paramsTable').show(); + }, + stateSave: true + }); + $j('.dataTables_filter input').attr("placeholder", _this.lang.search); + $j('dataTables_filter input').addClass('form-control'); + $j(".datatablesLeft").css({ "float": "left" }); + $j(".datatablesCenter").css({ "text-align": "center" }); + $j(".datatablesRight").css({ "float": "right" }); + }, 0); + _this.loading = false; + } + }); + }; + ParametersAdministrationComponent.prototype.goUrl = function () { + location.href = 'index.php?admin=parameters&page=control_param_technic'; + }; + ParametersAdministrationComponent.prototype.deleteParameter = function (paramId) { + var _this = this; + var resp = confirm(this.lang.deleteConfirm + ' ' + paramId + '?'); + if (resp) { + this.http.delete(this.coreUrl + 'rest/parameters/' + paramId) + .map(function (res) { return res.json(); }) + .subscribe(function (data) { + if (data.errors) { + _this.resultInfo = data.errors; + $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { + $j("#resultInfo").slideUp(500); + }); + } + else { + for (var i = 0; i < _this.parametersList.length; i++) { + if (_this.parametersList[i].id == paramId) { + _this.parametersList.splice(i, 1); + } + } + _this.table.row($j("#" + paramId)).remove().draw(); + _this.resultInfo = "Paramètre supprimé avec succès"; + $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { + $j("#resultInfo").slideUp(500); + }); + } + }); + } + }; + return ParametersAdministrationComponent; +}()); +ParametersAdministrationComponent = __decorate([ + core_1.Component({ + templateUrl: angularGlobals["parameters-administrationView"], + styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/parameters-administration.component.css'] + }), + __metadata("design:paramtypes", [http_1.Http]) +], ParametersAdministrationComponent); +exports.ParametersAdministrationComponent = ParametersAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/parameters-administration.component.ts b/apps/maarch_entreprise/js/angular/app/parameters-administration.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..228963cfeca24abc73835084875302e10d3c5e82 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/parameters-administration.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit } from '@angular/core'; +import { Http } from '@angular/http'; +import 'rxjs/add/operator/map'; + +declare function $j(selector: any) : any; + +declare var angularGlobals : any; + +@Component({ + templateUrl : angularGlobals["parameters-administrationView"], + styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css','css/parameters-administration.component.css'] +}) + +export class ParametersAdministrationComponent implements OnInit { + coreUrl : string; + + parametersList : any; + pageTitle : string; + lang : any = ""; + table : any; + + + resultInfo : string = ""; + loading : boolean = false; + + + constructor(public http: Http) { + } + + prepareParameter() { + $j('#inner_content').remove(); + } + + updateBreadcrumb(applicationName: string){ + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Paramètres"; + } + + ngOnInit(): void { + this.coreUrl = angularGlobals.coreUrl; + + this.prepareParameter(); + this.updateBreadcrumb(angularGlobals.applicationName); + + this.http.get(this.coreUrl + 'rest/administration/parameters') + .map(res => res.json()) + .subscribe((data) => { + if(data.errors){ + $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + } else { + this.parametersList = data.parametersList; + this.lang = data.lang; + setTimeout(() => { + this.table = $j('#paramsTable').DataTable({ + "dom": '<"datatablesLeft"l><"datatablesRight"f><"datatablesCenter"p>rt<"datatablesCenter"i><"clear">', + "lengthMenu": [ 10, 25, 50, 75, 100 ], + "oLanguage": { + "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", + "sZeroRecords": this.lang.noResult, + "sInfo": "_START_ - _END_ / _TOTAL_ "+this.lang.record, + "sSearch": "", + "oPaginate": { + "sFirst": "<<", + "sLast": ">>", + "sNext": this.lang.next+" <i class='fa fa-caret-right'></i>", + "sPrevious": "<i class='fa fa-caret-left'></i> "+this.lang.previous + }, + "sInfoEmpty": this.lang.noRecord, + "sInfoFiltered": "(filtré de _MAX_ "+this.lang.record+")" + }, + "order": [[ 0, "asc" ]], + "columnDefs": [ + { "orderable": false, "targets": 3 } + ], + "fnInitComplete": function () { + $j('#paramsTable').show(); + }, + stateSave: true + }); + $j('.dataTables_filter input').attr("placeholder", this.lang.search); + $j('dataTables_filter input').addClass('form-control'); + $j(".datatablesLeft").css({"float":"left"}); + $j(".datatablesCenter").css({"text-align":"center"}); + $j(".datatablesRight").css({"float":"right"}); + + }, 0); + this.loading = false; + } + }); + } + + goUrl(){ + location.href = 'index.php?admin=parameters&page=control_param_technic'; + } + + deleteParameter(paramId : string){ + var resp =confirm(this.lang.deleteConfirm+' '+paramId+'?'); + if(resp){ + this.http.delete(this.coreUrl + 'rest/parameters/'+paramId) + .map(res => res.json()) + .subscribe((data) => { + if(data.errors){ + this.resultInfo = data.errors; + $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + } else{ + for(var i = 0; i<this.parametersList.length;i++){ + if(this.parametersList[i].id==paramId){ + this.parametersList.splice(i,1); + } + } + this.table.row($j("#"+paramId)).remove().draw(); + this.resultInfo = "Paramètre supprimé avec succès"; + + $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); + $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ + $j("#resultInfo").slideUp(500); + }); + } + }); + } + } + +} diff --git a/apps/maarch_entreprise/js/angular/app/parameters.component.js b/apps/maarch_entreprise/js/angular/app/parameters.component.js deleted file mode 100644 index 2df75e3e996bea1a7346ced955186cb8941c26eb..0000000000000000000000000000000000000000 --- a/apps/maarch_entreprise/js/angular/app/parameters.component.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var core_1 = require("@angular/core"); -var http_1 = require("@angular/http"); -require("rxjs/add/operator/map"); -var router_1 = require("@angular/router"); -var parametersDataTable; -var ParametersComponent = (function () { - function ParametersComponent(http, route, router) { - this.http = http; - this.route = route; - this.router = router; - this.lang = ""; - this.resultInfo = ""; - } - ParametersComponent.prototype.ngOnInit = function () { - var _this = this; - this.coreUrl = angularGlobals.coreUrl; - this.prepareParameter(); - this.updateBreadcrumb(angularGlobals.applicationName); - this.http.get(this.coreUrl + 'rest/parameters') - .map(function (res) { return res.json(); }) - .subscribe(function (data) { - if (data.errors) { - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { - $j("#resultInfo").slideUp(500); - }); - } - else { - _this.parametersList = data.parametersList; - _this.lang = data.lang; - _this.nbParameters = Object.keys(_this.parametersList).length; - _this.pageTitle = _this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i>" + _this.lang.parameter + "s : " + _this.nbParameters + " " + _this.lang.parameter + "(s)"; - $j('#pageTitle').html(_this.pageTitle); - var tempLang = _this.lang; - setTimeout(function () { - parametersDataTable = $j('#paramsTable').DataTable({ - "language": { - "lengthMenu": tempLang.display + " _MENU_ " + tempLang.recordsPerPage, - "zeroRecords": tempLang.noRecords, - "info": tempLang.page + " _PAGE_ " + tempLang.outOf + " _PAGES_", - "infoEmpty": tempLang.noRecords + " " + tempLang.available, - "infoFiltered": "(" + tempLang.filteredFrom + " _MAX_ " + tempLang.records + ")", - "search": tempLang.search, - "paginate": { - "first": tempLang.first, - "last": tempLang.last, - "next": tempLang.next, - "previous": tempLang.previous - } - } - }); - }, 0); - } - }); - }; - ParametersComponent.prototype.goUrl = function () { - location.href = 'index.php?admin=parameters&page=control_param_technic'; - }; - ParametersComponent.prototype.prepareParameter = function () { - $j('#inner_content').remove(); - }; - ParametersComponent.prototype.updateBreadcrumb = function (applicationName) { - $j('#ariane').html("<a href='index.php?reinit=true'>" + applicationName + "</a> ><a href='index.php?page=admin&reinit=true'> Administration</a> > Paramètres"); - }; - ParametersComponent.prototype.deleteParameter = function (paramId) { - var _this = this; - var resp = confirm(this.lang.deleteConfirm + ' ' + paramId + '?'); - if (resp) { - this.http.delete(this.coreUrl + 'rest/parameters/' + paramId) - .map(function (res) { return res.json(); }) - .subscribe(function (data) { - if (data.errors) { - _this.resultInfo = data.errors; - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { - $j("#resultInfo").slideUp(500); - }); - } - else { - var list = _this.parametersList; - for (var i = 0; i < list.length; i++) { - if (list[i].id == paramId) { - list.splice(i, 1); - } - } - parametersDataTable.row($j("#" + paramId)).remove().draw(); - _this.resultInfo = "Paramètre supprimé avec succès"; - $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { - $j("#resultInfo").slideUp(500); - }); - _this.nbParameters = Object.keys(_this.parametersList).length; - _this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i>" + _this.lang.parameter + "s : " + _this.nbParameters + " " + _this.lang.parameter + "(s)"; - $j('#pageTitle').html(_this.pageTitle); - } - }); - } - }; - return ParametersComponent; -}()); -ParametersComponent = __decorate([ - core_1.Component({ - templateUrl: angularGlobals.parametersView, - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/parameter.component.css'] - }), - __metadata("design:paramtypes", [http_1.Http, router_1.ActivatedRoute, router_1.Router]) -], ParametersComponent); -exports.ParametersComponent = ParametersComponent; diff --git a/apps/maarch_entreprise/js/angular/app/parameters.component.ts b/apps/maarch_entreprise/js/angular/app/parameters.component.ts deleted file mode 100644 index 8a578b3b657a82c9de72e8afc3c22fb8c9ca5db4..0000000000000000000000000000000000000000 --- a/apps/maarch_entreprise/js/angular/app/parameters.component.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Http } from '@angular/http'; -import 'rxjs/add/operator/map'; -import { Router, ActivatedRoute } from '@angular/router'; - -declare function $j(selector: any) : any; - -declare var angularGlobals : any; -var parametersDataTable : any; - -@Component({ - templateUrl : angularGlobals.parametersView, - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css','css/parameter.component.css'] -}) - -export class ParametersComponent implements OnInit { - coreUrl : string; - nbParameters : number; - pageTitle : string ; - lang : any = ""; - parametersList : any; - - resultInfo :string = ""; - - - constructor(public http: Http, private route: ActivatedRoute, private router: Router) { - } - - ngOnInit(): void { - this.coreUrl = angularGlobals.coreUrl; - this.prepareParameter(); - this.updateBreadcrumb(angularGlobals.applicationName); - this.http.get(this.coreUrl + 'rest/parameters') - .map(res => res.json()) - .subscribe((data) => { - if(data.errors){ - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - } else { - this.parametersList=data.parametersList; - this.lang = data.lang; - this.nbParameters = Object.keys(this.parametersList).length; - this.pageTitle = this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i>" + this.lang.parameter + "s : "+this.nbParameters+" "+this.lang.parameter+"(s)"; - $j('#pageTitle').html(this.pageTitle); - var tempLang = this.lang; - setTimeout(function() { - parametersDataTable = $j('#paramsTable').DataTable({ - "language": { - "lengthMenu": tempLang.display + " _MENU_ " + tempLang.recordsPerPage, - "zeroRecords": tempLang.noRecords, - "info": tempLang.page + " _PAGE_ "+ tempLang.outOf +" _PAGES_", - "infoEmpty": tempLang.noRecords + " " + tempLang.available, - "infoFiltered": "(" + tempLang.filteredFrom + " _MAX_ " + tempLang.records + ")", - "search" : tempLang.search, - "paginate" : { - "first" : tempLang.first, - "last" : tempLang.last, - "next" : tempLang.next, - "previous" : tempLang.previous - } - } - } - ); - }, 0); - } - }); - } - - goUrl(){ - location.href = 'index.php?admin=parameters&page=control_param_technic'; - } - - prepareParameter() { - $j('#inner_content').remove(); - } - - updateBreadcrumb(applicationName: string){ - $j('#ariane').html("<a href='index.php?reinit=true'>" + applicationName + "</a> ><a href='index.php?page=admin&reinit=true'> Administration</a> > Paramètres"); - } - - deleteParameter(paramId : string){ - var resp =confirm(this.lang.deleteConfirm+' '+paramId+'?'); - if(resp){ - this.http.delete(this.coreUrl + 'rest/parameters/'+paramId) - .map(res => res.json()) - .subscribe((data) => { - if(data.errors){ - this.resultInfo = data.errors; - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - } else{ - var list = this.parametersList; - for(var i = 0; i<list.length;i++){ - if(list[i].id==paramId){ - list.splice(i,1); - } - } - parametersDataTable.row($j("#"+paramId)).remove().draw(); - this.resultInfo = "Paramètre supprimé avec succès"; - - $j('#resultInfo').removeClass().addClass('alert alert-success alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - this.nbParameters = Object.keys(this.parametersList).length; - this.pageTitle = "<i class=\"fa fa-wrench fa-2x\"></i>" + this.lang.parameter + "s : "+this.nbParameters+" "+this.lang.parameter+"(s)"; - $j('#pageTitle').html(this.pageTitle); - } - }); - } - } - - -} diff --git a/apps/maarch_entreprise/js/angular/app/priorities.component.js b/apps/maarch_entreprise/js/angular/app/priorities.component.js index 6cfcfb7da618589c3f3c69df7e029a9e81d01ae1..80f1238170cf00823cec9a9103552bbe553bffc2 100644 --- a/apps/maarch_entreprise/js/angular/app/priorities.component.js +++ b/apps/maarch_entreprise/js/angular/app/priorities.component.js @@ -77,7 +77,7 @@ var PrioritiesComponent = (function () { PrioritiesComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals.prioritiesView, - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/parameter.component.css'] + styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] }), __metadata("design:paramtypes", [http_1.Http, router_1.ActivatedRoute, router_1.Router]) ], PrioritiesComponent); diff --git a/apps/maarch_entreprise/js/angular/app/priorities.component.ts b/apps/maarch_entreprise/js/angular/app/priorities.component.ts index e99493106c9b89a86c99775659008084def413fa..3047245fb8da7b01900c90fb8ef244d6417cf7e4 100644 --- a/apps/maarch_entreprise/js/angular/app/priorities.component.ts +++ b/apps/maarch_entreprise/js/angular/app/priorities.component.ts @@ -10,7 +10,7 @@ var prioritiesDataTable : any; @Component({ templateUrl : angularGlobals.prioritiesView, - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css','css/parameter.component.css'] + styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] }) export class PrioritiesComponent implements OnInit { diff --git a/apps/maarch_entreprise/js/angular/app/priority.component.js b/apps/maarch_entreprise/js/angular/app/priority.component.js index e1be540ced2ee2248017f73e0964d9e29bcce6d6..9daed9f9e2f013ff09e7e53700a7e0f582b1d89d 100644 --- a/apps/maarch_entreprise/js/angular/app/priority.component.js +++ b/apps/maarch_entreprise/js/angular/app/priority.component.js @@ -118,7 +118,7 @@ var PriorityComponent = (function () { PriorityComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals.priorityView, - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/parameter.component.css'] + styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] }), __metadata("design:paramtypes", [http_1.Http, router_1.ActivatedRoute, router_1.Router]) ], PriorityComponent); diff --git a/apps/maarch_entreprise/js/angular/app/priority.component.ts b/apps/maarch_entreprise/js/angular/app/priority.component.ts index 5240ebd809e5fc1e94d23860393aa8cb56f8e12c..15b27bbee27cdb5ff0b6558eb94058dd5737700a 100644 --- a/apps/maarch_entreprise/js/angular/app/priority.component.ts +++ b/apps/maarch_entreprise/js/angular/app/priority.component.ts @@ -8,7 +8,7 @@ declare function $j(selector: any) : any; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals.priorityView, - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css','css/parameter.component.css'] + styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] }) export class PriorityComponent implements OnInit { diff --git a/apps/maarch_entreprise/js/angularFunctions.js b/apps/maarch_entreprise/js/angularFunctions.js index 3a805d20dd5c1a7b4a1160ed2816117bce79b882..eb56da4e5059e00600cf2e185ea66361e1f79f8c 100644 --- a/apps/maarch_entreprise/js/angularFunctions.js +++ b/apps/maarch_entreprise/js/angularFunctions.js @@ -11,7 +11,8 @@ function triggerAngular(prodmode, locationToGo) { 'action-administration', 'profile', 'signature-book', - 'parameters', + 'parameter-administration', + 'parameters-administration', 'priorities', 'priority', 'parameter' diff --git a/core/Controllers/ParametersController.php b/core/Controllers/ParametersController.php index 7560a4ef330dd8d45356707d2df87ff939ece0d4..ba8168fda00705ed979aad7a6d47a1b92d5fcb46 100644 --- a/core/Controllers/ParametersController.php +++ b/core/Controllers/ParametersController.php @@ -13,7 +13,7 @@ * @ingroup core */ - namespace Core\Controllers; +namespace Core\Controllers; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -26,7 +26,7 @@ require_once 'modules/notes/Models/NotesModel.php'; class ParametersController { - public function getList(RequestInterface $request, ResponseInterface $response) + public function getParametersForAdministration(RequestInterface $request, ResponseInterface $response) { $obj = [ 'parametersList' => ParametersModel::getList(), @@ -35,9 +35,30 @@ class ParametersController return $response->withJson($obj); } - public function getLang(RequestInterface $request, ResponseInterface $response) + public function getParameterForAdministration(RequestInterface $request, ResponseInterface $response, $aArgs) { - $obj = ParametersModel::getParametersLang(); + $obj['parameter'] = ParametersModel::getById(['id' => $aArgs['id']]); + + if (empty($obj)) { + return $response->withStatus(400)->withJson(['errors' => 'User not found']); + } + + if ($obj['parameter']['param_value_date']) { + $obj['type'] = 'date'; + } else if ($obj['parameter']['param_value_int']) { + $obj['type'] = 'int'; + } else { + $obj['type'] = 'string'; + } + + $obj['lang'] = ParametersModel::getParametersLang(); + + return $response->withJson($obj); + } + + public function getNewParameterForAdministration(RequestInterface $request, ResponseInterface $response) + { + $obj['lang'] = ParametersModel::getParametersLang(); return $response->withJson($obj); } diff --git a/core/Models/LangModelAbstract.php b/core/Models/LangModelAbstract.php index f1f0eb876f382e539dfefc266a0cd6b5ae104726..47eff2d1416c8ca0f1794ab02a483376d27e3c83 100644 --- a/core/Models/LangModelAbstract.php +++ b/core/Models/LangModelAbstract.php @@ -67,7 +67,9 @@ class LangModelAbstract public static function getParametersLang() { $aLang = [ + 'admin' => _ADMIN, 'parameter' => _PARAMETER, + 'parameters' => _PARAMETERS, 'identifier' => _PARAMETER_IDENTIFIER, 'description' => _DESCRIPTION, 'value' => _VALUE, @@ -77,17 +79,19 @@ class LangModelAbstract 'date' => _DATE, 'validate' => _VALIDATE, 'cancel' => _CANCEL, - 'modifyParameter' => _MODIFY_PARAMETER, - 'deleteParameter' => _DELETE_PARAMETER, + 'modify' => _MODIFY, + 'delete' => _DELETE, 'page' => _PAGE, 'outOf' => _OUT_OF, 'search' => _SEARCH, 'recordsPerPage' => _RECORDS_PER_PAGE, 'display' => _DISPLAY, - 'noRecords' => _NO_RECORDS, + 'noRecord' => _NO_RECORD, + 'noResult' => _NO_RESULTS, 'available' => _AVAILABLE, 'filteredFrom' => _FILTERED_FROM, 'records' => _RECORDS, + 'record' => _RECORD, 'first' => _FIRST, 'last' => _LAST, 'next' => _NEXT, diff --git a/core/Models/ParametersModelAbstract.php b/core/Models/ParametersModelAbstract.php index 39fc2cd90ffdcabd312ef65dfa53e69a7c555c4c..c8d57a2c53572520f2fe19c8505f0d723eb56f60 100644 --- a/core/Models/ParametersModelAbstract.php +++ b/core/Models/ParametersModelAbstract.php @@ -1,96 +1,107 @@ <?php - namespace Core\Models; +/** +* Copyright Maarch since 2008 under licence GPLv3. +* See LICENCE.txt file at the root folder for more details. +* This file is part of Maarch software. + +* @brief ParametersModelAbstract +* @author dev <dev@maarch.org> +* @ingroup core +*/ + +namespace Core\Models; + +require_once 'apps/maarch_entreprise/services/Table.php'; +require_once 'core/class/class_functions.php'; - require_once 'apps/maarch_entreprise/services/Table.php'; - require_once 'core/class/class_functions.php'; - - class ParametersModelAbstract extends \Apps_Table_Service +class ParametersModelAbstract extends \Apps_Table_Service +{ + public static function getList() { - public static function getList() - { - $func = new \functions(); + $func = new \functions(); - $aReturn = static::select([ - 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], - 'table' => ['parameters'], - ]); + $aReturn = static::select( + ['select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], + 'table' => ['parameters']] + ); - foreach($aReturn as $key => $parameter) - { - if($parameter['param_value_date'] != null){ - $aReturn[$key]['param_value_date'] = $func->format_date($aReturn[$key]['param_value_date']); - } - } + foreach ($aReturn as $key => $parameter) { - return $aReturn; - } - - public static function getParametersLang(){ - $aLang = LangModel::getParametersLang(); - return $aLang; + if ($parameter['param_value_date'] != null) { + $aReturn[$key]['param_value_date'] = $func->format_date($aReturn[$key]['param_value_date']); + } } - public static function getById(array $aArgs = []) - { - $func = new \functions(); - static::checkRequired($aArgs, ['id']); - static::checkString($aArgs,['id']); - - $aReturn = static::select([ - 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], - 'table' =>['parameters'], - 'where' => ['id = ?'], - 'data' => [$aArgs['id']] - ]); - if ($aReturn[0]['param_value_date']!=null) { - $aReturn[0]['param_value_date']=$func->format_date($aReturn[0]['param_value_date']); - } - - return $aReturn; + return $aReturn; + } + + public static function getParametersLang() + { + $aLang = LangModel::getParametersLang(); + return $aLang; + } + public static function getById(array $aArgs = []) + { + $func = new \functions(); + static::checkRequired($aArgs, ['id']); + static::checkString($aArgs, ['id']); + + $aReturn = static::select([ + 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], + 'table' =>['parameters'], + 'where' => ['id = ?'], + 'data' => [$aArgs['id']] + ]); + if ($aReturn[0]['param_value_date']!=null) { + $aReturn[0]['param_value_date']=$func->format_date($aReturn[0]['param_value_date']); } + + return $aReturn[0]; - public static function create(array $aArgs = []) - { - static::checkRequired($aArgs, ['id']); - static::checkString($aArgs, ['id']); + } - $aReturn = static::insertInto($aArgs, 'parameters'); + public static function create(array $aArgs = []) + { + static::checkRequired($aArgs, ['id']); + static::checkString($aArgs, ['id']); - return $aReturn; - } + $aReturn = static::insertInto($aArgs, 'parameters'); - public static function update(array $aArgs = []) - { - static::checkRequired($aArgs, ['id']); - static::checkString($aArgs, ['id']); + return $aReturn; + } - $where['id'] = $aArgs['id']; + public static function update(array $aArgs = []) + { + static::checkRequired($aArgs, ['id']); + static::checkString($aArgs, ['id']); - $aReturn = static::updateTable( - $aArgs, - 'parameters', - $where - ); + $where['id'] = $aArgs['id']; - return $aReturn; - } + $aReturn = static::updateTable( + $aArgs, + 'parameters', + $where + ); - public static function delete(array $aArgs = []) - { - static::checkRequired($aArgs, ['id']); - static::checkString($aArgs, ['id']); + return $aReturn; + } - $aReturn = static::deleteFrom([ - 'table' => 'parameters', - 'where' => ['id = ?'], - 'data' => [$aArgs['id']] - ]); + public static function delete(array $aArgs = []) + { + static::checkRequired($aArgs, ['id']); + static::checkString($aArgs, ['id']); - return $aReturn; - } + $aReturn = static::deleteFrom([ + 'table' => 'parameters', + 'where' => ['id = ?'], + 'data' => [$aArgs['id']] + ]); + return $aReturn; } + +} ?> \ No newline at end of file diff --git a/rest/index.php b/rest/index.php index cb664e836e7071309b9c087f540d187c6b88082b..dfa8692fe820ba9f8d6b29db81893fe1177abd65 100644 --- a/rest/index.php +++ b/rest/index.php @@ -121,16 +121,6 @@ $app->get('/docserver/{id}', \Core\Controllers\DocserverController::class . ':ge $app->get('/docserverType', \core\Controllers\DocserverTypeController::class . ':getList'); $app->get('/docserverType/{id}', \core\Controllers\DocserverTypeController::class . ':getById'); - -/** -* -* -* -* -* -* -* -**/ //admin_reports $app->get('/report/groups', \Core\Controllers\ReportController::class . ':getGroups'); $app->get('/report/groups/{id}', \Core\Controllers\ReportController::class . ':getReportsTypesByXML'); @@ -192,20 +182,18 @@ $app->put('/currentUser/emailSignature/{id}', \Core\Controllers\UserController:: $app->delete('/currentUser/emailSignature/{id}', \Core\Controllers\UserController::class . ':deleteCurrentUserEmailSignature'); //parameters -$app->get('/parameters/lang',\Core\Controllers\ParametersController::class . ':getLang'); -$app->get('/parameters', \Core\Controllers\ParametersController::class . ':getList'); -$app->get('/parameters/{id}', \Core\Controllers\ParametersController::class . ':getById'); +$app->get('/administration/parameters', \Core\Controllers\ParametersController::class . ':getParametersForAdministration'); +$app->get('/administration/parameters/new', \Core\Controllers\ParametersController::class . ':getNewParameterForAdministration'); +$app->get('/administration/parameters/{id}', \Core\Controllers\ParametersController::class . ':getParameterForAdministration'); $app->post('/parameters', \Core\Controllers\ParametersController::class . ':create'); $app->put('/parameters/{id}', \Core\Controllers\ParametersController::class . ':update'); $app->delete('/parameters/{id}', \Core\Controllers\ParametersController::class . ':delete'); - - //priorities $app->get('/priorities', \Core\Controllers\PrioritiesController::class . ':getList'); $app->get('/priorities/{id}', \Core\Controllers\PrioritiesController::class . ':getById'); $app->post('/priorities', \Core\Controllers\PrioritiesController::class . ':create'); -$app->put('/priorities/{id}',\Core\Controllers\PrioritiesController::class . ':update'); +$app->put('/priorities/{id}', \Core\Controllers\PrioritiesController::class . ':update'); $app->delete('/priorities/{id}', \Core\Controllers\PrioritiesController::class . ':delete'); //actions