diff --git a/apps/maarch_entreprise/Views/actions-administration.component.html b/apps/maarch_entreprise/Views/actions-administration.component.html index 3e98ac3c79f1573285b1f285f32900596bb89bdd..9cd0c28fb3efb15fce5ff7e1c85f7cbad7f74c8c 100755 --- a/apps/maarch_entreprise/Views/actions-administration.component.html +++ b/apps/maarch_entreprise/Views/actions-administration.component.html @@ -41,7 +41,7 @@ <button routerLink="/administration/actions/{{action.id}}" type="button" class="btn btn-default" title="{{lang.update}}"> <a><i style="cursor:pointer" class="fa fa-edit"></i></a> </button> - <button [disabled]="action.is_system == 'Y'" type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteAction(action.id)"> + <button [disabled]="action.is_system == 'Y'" type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteAction(action)"> <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> </button> </div> diff --git a/apps/maarch_entreprise/Views/administration.component.html b/apps/maarch_entreprise/Views/administration.component.html index b3044014dcab774dd0d84ab095da021f7b7e9d9b..f07accb215832169886d6dfe19c99cd249f8dadd 100755 --- a/apps/maarch_entreprise/Views/administration.component.html +++ b/apps/maarch_entreprise/Views/administration.component.html @@ -1,34 +1,26 @@ +<div class="page-header"> + <h1 style="margin-top: 0">{{lang.administration}}</h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> -<div *ngIf="!loading" class="container-fluid"> - <h1 style="margin-top: 0"><i class="fa fa-cogs fa-2x"></i> {{lang.administration}}</h1> - <div class="row row-eq-height"> - <div *ngIf="applicationServices[0]" class="col-md-12 servicesDiv"> - <h2 class="administrationTitle">{{lang.application}}</h2> - <div class="content"> - <div *ngFor="let appService of applicationServices" class="admin_item" title="{{appService.comment}}" (click)="goToSpecifiedAdministration(appService)"> - <div> - <i class="{{appService.style}} fa-4x"></i> - </div> - <div> - <strong>{{appService.name}}</strong> - </div> - </div> - </div> - </div> - <div *ngIf="modulesServices[0]" class="col-md-12 servicesDiv"> - <h2 class="administrationTitle">{{lang.modules}}</h2> - <div class="content"> - <div *ngFor="let modService of modulesServices" class="admin_item" title="{{modService.comment}}" (click)="goToSpecifiedAdministration(modService)"> - <div> - <i class="{{modService.style}} fa-4x"></i> - </div> - <div> - <strong>{{modService.name}}</strong> - </div> - </div> - </div> - </div> +<div *ngIf="!loading" class="container-fluid" style="color:#666;"> + <div class="col-md-12"> + <md-tab-group> + <md-tab label="{{lang.application}}"> + <md-grid-list cols="6" rowHeight="2:1"> + <md-grid-tile *ngFor="let appService of applicationServices"> + <button md-button tooltip="{{appService.comment}}" tooltip-delay="1000" (click)="goToSpecifiedAdministration(appService)"><i class="{{appService.style}} fa-4x"></i><br/>{{appService.name}}</button> + </md-grid-tile> + </md-grid-list> + </md-tab> + <md-tab label="{{lang.modules}}"> + <md-grid-list cols="6" rowHeight="2:1"> + <md-grid-tile *ngFor="let modService of modulesServices"> + <button md-button tooltip="{{modService.comment}}" tooltip-delay="1000" (click)="goToSpecifiedAdministration(modService)"><i class="{{modService.style}} fa-4x"></i><br/>{{modService.name}}</button> + </md-grid-tile> + </md-grid-list> + </md-tab> + </md-tab-group> </div> </div> diff --git a/apps/maarch_entreprise/Views/status-administration.component.html b/apps/maarch_entreprise/Views/status-administration.component.html index d3b4862a0884fc159b0bbebf53e61f2d52331c57..74150cad34a00fb2c5b25ee5c1447eb57eefa0fc 100755 --- a/apps/maarch_entreprise/Views/status-administration.component.html +++ b/apps/maarch_entreprise/Views/status-administration.component.html @@ -1,104 +1,87 @@ +<div class="page-header"> + <h1 *ngIf="!creationMode">{{lang.statusModification}} <small>{{status.id}}</small></h1> + <h1 *ngIf="creationMode">{{lang.statusCreation}} <small>{{status.id}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> -<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/status" 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-circle 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)="submitStatus()" #statusFormUp="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="{{lang.identifier}}"></i><sup class="mandatory" title="champ requis"><i class="fa fa-asterisk" aria-hidden="true"></i></sup></span> - <input [(ngModel)]="status.id" class="form-control" [disabled]="mode == 'update'" maxlength="10" name="id" id="id" title="{{lang.identifier}}" type="text" required> +<div *ngIf="!loading" class="container-fluid"> + <div class="col-md-6 col-md-offset-3"> + <form class="form-horizontal" (ngSubmit)="submitStatus()" #statusFormUp="ngForm"> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput [(ngModel)]="status.id" [disabled]="mode == 'update'" maxlength="10" name="id" id="id" title="{{lang.id}}" placeholder="{{lang.id}}" type="text" required> + </md-input-container> </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="{{lang.description}}"></i><sup class="mandatory" title="champ requis"><i class="fa fa-asterisk" aria-hidden="true"></i></sup></span> - <input class="form-control" name="label_status" id="label_status" maxlength="50" [(ngModel)]="status.label_status" title="{{lang.description}}" type="text" required> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput name="label_status" id="label_status" maxlength="50" [(ngModel)]="status.label_status" title="{{lang.desc}}" placeholder="{{lang.desc}}" type="text" required> + </md-input-container> </div> </div> - </div> - <div class="form-group"> - <div class="col-sm-4"> - <div class="input-group"> - <span class="input-group-btn"> - <button data-tooltip-content="#infoSearchableTooltip" class="btn btn-default help" type="button"><i class="fa fa-question-circle"></i></button> - </span> - <label class="form-control" for="can_be_searched">{{lang.can_be_searched}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="status.can_be_searched" name="can_be_searched" id="can_be_searched" type="checkbox"> - </span> + <div class="form-group"> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="col-sm-4" style="white-space:nowrap;"> + <md-slide-toggle [(ngModel)]="status.can_be_searched" id="can_be_search" name="can_be_search" color="primary" [checked]="status.can_be_searched == true"> + {{lang.canBeSearched}} + </md-slide-toggle> + <sup> + <i class="fa fa-question-circle" tooltip="Si <b>coché</b>,<br/>le statut <b>{{status.id}}</b> vous <b>proposé</b> pour le critère de recherche STATUS de la recherche avancée de documents."></i> + </sup> + </div> + <div class="col-sm-4" style="white-space:nowrap;"> + <md-slide-toggle [(ngModel)]="status.can_be_modified" id="can_be_modified" name="can_be_modified" color="primary" [checked]="status.can_be_modified == true"> + {{lang.canBeModified}} + </md-slide-toggle> + <sup> + <i class="fa fa-question-circle" tooltip="Si <b>coché</b>,<br/>vous pourrez <b>modifier</b> les meta-données des documents ayant le statut <b>{{status.id}}</b>."></i> + </sup> + </div> + <div class="col-sm-4" style="white-space:nowrap;"> + <md-slide-toggle [(ngModel)]="status.is_folder_status" id="is_folder_status" name="is_folder_status" color="primary" [checked]="status.is_folder_status == true"> + {{lang.isFolderStatus}} + </md-slide-toggle> + <sup> + <i class="fa fa-question-circle" tooltip="Si <b>coché</b>,<br/>le statut <b>{{status.id}}</b> pourra être utilisé pour des <b>bannettes de dossiers</b>."></i> + </sup> + </div> + </div> </div> </div> - <div class="col-sm-4"> - <div class="input-group"> - <span class="input-group-btn"> - <button data-tooltip-content="#infoCanBeModifiedTooltip" class="btn btn-default help" type="button"><i class="fa fa-question-circle"></i></button> - </span> - <label class="form-control" for="can_be_modified">{{lang.can_be_modified}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="status.can_be_modified" type="checkbox" name="can_be_modified" id="can_be_modified"> - </span> + <div class="form-group"> + <div class="col-sm-1"> + <i class="fm {{status.img_filename}} fm-2x text-primary"></i> </div> - </div> - <div class="col-sm-4"> - <div class="input-group"> - <span class="input-group-btn"> - <button data-tooltip-content="#infoIsFolderStatusTooltip" class="btn btn-default help" type="button"><i class="fa fa-question-circle"></i></button> - </span> - <label class="form-control" for="is_folder_status">{{lang.is_folder_status}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="status.is_folder_status" type="checkbox" name="is_folder_status" id="is_folder_status"> - </span> + <div class="col-sm-11"> + <md2-select + id="status" + name="status" + placeholder="{{lang.imgRelated}}" + [(ngModel)]="status.img_filename" + required + #searchStatusIcon="ngModel"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" + type="text" + placeholder="Filtre" + [(ngModel)]="_search" + autocomplete="off" + (focusout)="clearSearch()"/> + </md-input-container> + </md2-select-header> + <md2-option *ngFor="let image of statusImages | dataPipe : 'image_name' : _search" [value]="image.image_name"><i [ngClass]="[image.image_name.indexOf('fm') == 0 ? 'fm' : 'fa']" class="{{image.image_name}} fa-2x"></i> {{image.image_name}}</md2-option> + </md2-select> </div> </div> - </div> - <div id="statusIconList" class="form-group panel panel-default"> - <div class="col-sm-12 panel-heading" style="font-size: 14px;text-align:center;"> - <i class="fa fa-picture-o" aria-hidden="true"></i> {{lang.img_related}} - </div> - <div class="col-sm-12 panel-body"> - <button *ngFor="let image of statusImages" type="button" [ngClass]="[status.img_filename==image.image_name ? 'btn-primary' : 'btn-default']" class="btn btn-group-lg" (click)="selectImage(image.image_name)"> - <i id="img_0" [ngClass]="[image.image_name.indexOf('fm') == 0 ? 'fm' : 'fa']" class="{{image.image_name}}"></i> - </button> + <div class="col-sm-12 panel-body" style="text-align:center;"> + <button class="btn btn-default" type="submit" [disabled]="!statusFormUp.form.valid">{{lang.validate}}</button> + <button class="btn btn-default" routerLink='/administration/status'>{{lang.cancel}}</button> </div> - </div> - <div class="col-sm-12 panel-body" style="text-align:center;"> - <button class="btn btn-default" type="submit" [disabled]="!statusFormUp.form.valid">{{lang.validate}}</button> - <button class="btn btn-default" routerLink='/administration/status'>{{lang.cancel}}</button> - </div> - </form> -</div> -</div> - -<div class="tooltip_templates" style="display: none"> - <span id="infoSearchableTooltip"> - Si <b>coché</b>,<br/> - le statut <b>{{status.id}}</b> vous <b>proposé</b> pour le critère de recherche STATUS de la recherche avancée de documents. - </span> - <span id="infoCanBeModifiedTooltip"> - Si <b>coché</b>,<br/> - vous pourrez <b>modifier</b> les meta-données des documents ayant le statut <b>{{status.id}}</b>. - </span> - <span id="infoIsFolderStatusTooltip"> - Si <b>coché</b>,<br/> - le statut <b>{{status.id}}</b> pourra être utilisé pour des <b>bannettes de dossiers</b>. - </span> + </form> + </div> </div> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/statuses-administration.component.html b/apps/maarch_entreprise/Views/statuses-administration.component.html index 5282ffbf6e8736d616b346ce3ad61809c9bfa2b0..f7ebf58cb076f65906f57f879e7563cd37ea752e 100755 --- a/apps/maarch_entreprise/Views/statuses-administration.component.html +++ b/apps/maarch_entreprise/Views/statuses-administration.component.html @@ -1,49 +1,47 @@ + +<div class="page-header"> + <h1>{{lang.administration}} {{lang.statuses}} <small>{{data.length}} {{lang.statuses}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </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" 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/status/new"> - <a title="{{lang.newStatus}}"><i class="fa fa-check-circle"></i><sup><i class="fa fa-plus"></i></sup></a> - </li> - </ul> - </div> - </div> - </nav> - <h1 style="margin-top: 0"><i class="fa fa-check-circle fa-2x"></i> {{lang.statusListTitle}} : {{nbStatus}} {{lang.status}}(s)</h1> - - <div class="col-md-12" style="margin-top: 15px"> - <table id="statusTable" class="display"> + <div class="col-md-12"> + <table id="statusTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'label_status' : search" #md2="md2DataTable" [sortBy]='label_status' [rowsPerPage]="10"> <thead> <tr> - <th style="width:50px;"><span>{{lang.img_related}}</span></th> - <th><span>{{lang.identifier}}</span></th> - <th><span>{{lang.description}}</span></th> - <th><span> </span></th> + <td colspan="3"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md-input-container> + <input mdInput placeholder="{{lang.filterBy}} : {{lang.desc}}" class="searchTable" [(ngModel)]="search" /> + </md-input-container> + + <a class="text-primary" style="cursor: pointer" routerLink="/administration/status/new" title="{{lang.addStatus}}"><i class="fa fa-check-circle fa-2x"></i><sup><i class="fa fa-plus"></i></sup></a> + </td> + </tr> + <tr> + <th md2SortBy="id" style="width:50px;"><span>{{lang.imgRelated}}</span></th> + <th md2SortBy="img_filename"><span>{{lang.id}}</span></th> + <th md2SortBy="label_status"><span>{{lang.desc}}</span></th> + <th> </th> </tr> </thead> <tbody> - <tr *ngFor="let status of statusList" id="{{status.id}}"> - <td style="text-align:center;"> - <i class="fm {{status.img_filename}} fm-2x" *ngIf="status.img_filename.indexOf('fm') == 0"></i> - <i class="fa {{status.img_filename}} fa-2x" *ngIf="status.img_filename.indexOf('fa') == 0"></i> + <tr *ngFor="let status of md2.data"> + <td style="text-align:center;vertical-align:middle;"> + <i class="fm {{status.img_filename}} fm-2x text-primary" *ngIf="status.img_filename.indexOf('fm') == 0"></i> + <i class="fa {{status.img_filename}} fa-2x text-primary" *ngIf="status.img_filename.indexOf('fa') == 0"></i> </td> - <td>{{status.id}}</td> - <td>{{status.label_status}}</td> - <td style="text-align:right;"> + <td style="vertical-align:middle;">{{status.id}}</td> + <td style="vertical-align:middle;">{{status.label_status}}</td> + <td style="text-align:right;vertical-align:middle;"> <div class="btn-group" role="group" aria-label="..."> <button routerLink="/administration/status/{{status.identifier}}" type="button" class="btn btn-default" title="{{lang.edit}}"> <a><i style="cursor:pointer" class="fa fa-edit"></i></a> </button> - <button type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteStatus(status.id, status.identifier)"> + <button type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteStatus(status)"> <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> </button> </div> diff --git a/apps/maarch_entreprise/Views/user-administration.component.html b/apps/maarch_entreprise/Views/user-administration.component.html index e3818485d437e64bf1ba580b27c43d60e42965e3..562f40c2e960bbf5d33d463071ed419198dc3401 100755 --- a/apps/maarch_entreprise/Views/user-administration.component.html +++ b/apps/maarch_entreprise/Views/user-administration.component.html @@ -1,6 +1,6 @@ <div class="page-header"> - <h1 *ngIf="!userCreation">{{lang.userModification}} <small>{{user.lastname}} {{user.firstname}}</small></h1> - <h1 *ngIf="userCreation">{{lang.userCreation}} <small>{{user.lastname}} {{user.firstname}}</small></h1> + <h1 *ngIf="!creationMode">{{lang.userModification}} <small>{{user.lastname}} {{user.firstname}}</small></h1> + <h1 *ngIf="creationMode">{{lang.userCreation}} <small>{{user.lastname}} {{user.firstname}}</small></h1> </div> <div *ngIf="loading"> <md-spinner style="margin:auto;"></md-spinner> @@ -21,10 +21,10 @@ <div class="input-group"> <!--<span class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></span>--> <md-input-container> - <input mdInput *ngIf="userCreation" type="text" title="{{lang.id}}" name="user_id" [(ngModel)]="user.userId" placeholder="{{lang.id}}" + <input mdInput *ngIf="creationMode" type="text" title="{{lang.id}}" name="user_id" [(ngModel)]="user.userId" placeholder="{{lang.id}}" pattern="^[\w.@-]*$" required> - <input mdInput *ngIf="!userCreation" type="text" title="{{lang.id}}" value="{{user.user_id}}" placeholder="{{lang.id}}" disabled> + <input mdInput *ngIf="!creationMode" type="text" title="{{lang.id}}" value="{{user.user_id}}" placeholder="{{lang.id}}" disabled> </md-input-container> </div> </div> @@ -74,18 +74,18 @@ </div> <div class="form-group"> <div style="text-align:center;"> - <button *ngIf="userCreation" type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid"><i class="fa fa-plus"></i> {{lang.save}}</button> - <button *ngIf="!userCreation" type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid"><i class="fa fa-save"></i> {{lang.update}}</button> - <button *ngIf="user.status != 'ABS' && !userCreation" type="button" (click)="activateAbsence()" class="btn btn-warning"><i class="fa fa-plane"></i> {{lang.activateAbsence}}</button> - <button *ngIf="user.status == 'ABS' && !userCreation" type="button" (click)="desactivateAbsence()" class="btn btn-success"><i class="fa fa-check"></i> {{lang.desactivateAbsence}}</button> - <button type="button" *ngIf="!userCreation" (click)="resetPassword()" class="btn btn-default"><i class="fa fa-key"></i> {{lang.reinitPassword}}</button> + <button *ngIf="creationMode" type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid"><i class="fa fa-plus"></i> {{lang.save}}</button> + <button *ngIf="!creationMode" type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid"><i class="fa fa-save"></i> {{lang.update}}</button> + <button *ngIf="user.status != 'ABS' && !creationMode" type="button" (click)="activateAbsence()" class="btn btn-warning"><i class="fa fa-plane"></i> {{lang.activateAbsence}}</button> + <button *ngIf="user.status == 'ABS' && !creationMode" type="button" (click)="desactivateAbsence()" class="btn btn-success"><i class="fa fa-check"></i> {{lang.desactivateAbsence}}</button> + <button type="button" *ngIf="!creationMode" (click)="resetPassword(user)" class="btn btn-default"><i class="fa fa-key"></i> {{lang.reinitPassword}}</button> </div> </div> </form> </div> </div> </md-tab> - <md-tab *ngIf="!userCreation" label="Groupe(s)"> + <md-tab *ngIf="!creationMode" label="Groupe(s)"> <div class="col-md-6"> <div class="groupList"> <ul class="list-group col-md-12"> @@ -138,7 +138,7 @@ </div> </div> </md-tab> - <md-tab *ngIf="!userCreation" label="Entité(s)"> + <md-tab *ngIf="!creationMode" label="Entité(s)"> <div class="col-md-6"> <md-input-container> <input mdInput id="jstree_search" type="text" placeholder="Rechercher une entité"> @@ -160,7 +160,7 @@ </div> </div> </md-tab> - <md-tab *ngIf="!userCreation" label="Signature(s)"> + <md-tab *ngIf="!creationMode" label="Signature(s)"> <div class="col-md-6 col-md-offset-3"> <div class="form-group"> <button (click)="clickOnUploader('uploadSignFile')" mdTooltip="taille de 2 mo maximum" class="form-control btn btn-sm btn-success" @@ -205,7 +205,7 @@ (focusout)="updateSignature(i)"> </md-input-container> </md-card-title> - <i class="fa fa-times text-danger" style="cursor:pointer;" (click)="deleteSignature(signature.id)"></i> + <i class="fa fa-times text-danger" style="cursor:pointer;" (click)="deleteSignature(signature)"></i> </md-card-header> diff --git a/apps/maarch_entreprise/css/engine.css b/apps/maarch_entreprise/css/engine.css index 9f95a38578b578b9346b86036b82cc3d6ba17d5f..674fc29466508e57fced51e2780de7e710d4007b 100755 --- a/apps/maarch_entreprise/css/engine.css +++ b/apps/maarch_entreprise/css/engine.css @@ -1,3 +1,38 @@ +/******* CORECTION BUG CSS WITH V1 (A SUPPRIMER A LA FIN) *********/ +.page-header h1{ + margin-top: 10px !important; +} + +#menu{ + margin-top: 35px !important; +} +#menunav{ + font-size: 90% !important; +} +#menu span{ + background-size: 45% !important; +} + +#gauchemenu{ + top: 28px !important; + height: 38px !important; +} +#logo{ + height: 66px !important; +} +#menunav{ + width: 264px !important; +} +#ariane{ + top: -5px !important; + font-size: 0.8em !important; +} +.footer_menu{ + font-size: 0.7em !important; + height: 18px !important; +} +/************************************************************/ + .page-header{ margin-top: 0px; } @@ -11,7 +46,7 @@ } .md2-toast { display: table; - /*background-color: #3f51b5 !important;*/ + background-color: #337ab7 !important; vertical-align: middle; /*background-color: rgba(63, 81, 181, 0.6) !important;*/ /*background-color: rgba(0, 0, 0, 0.6) !important;*/ diff --git a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js index 5a01b47d96d29582a341e39249947e85a9af797c..7a9751a5881f5ed156202d640249fcde1251783d 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js @@ -30,9 +30,14 @@ var ActionAdministrationComponent = (function () { this.loading = false; } ActionAdministrationComponent.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/actions\"' style='cursor: pointer'>Actions</a> > Modification"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > <a onclick='location.hash = \"/administration/actions\"' style='cursor: pointer'>" + this.lang.actions + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.actionCreation; } + else { + breadCrumb += this.lang.actionModification; + } + $j('#ariane')[0].innerHTML = breadCrumb; }; ActionAdministrationComponent.prototype.prepareActions = function () { $j('#inner_content').remove(); @@ -45,7 +50,7 @@ var ActionAdministrationComponent = (function () { this.updateBreadcrumb(angularGlobals.applicationName); this.route.params.subscribe(function (params) { if (typeof params['id'] == "undefined") { - _this.actionCreation = true; + _this.creationMode = true; _this.http.get(_this.coreUrl + 'rest/initAction') .subscribe(function (data) { _this.action = data.action; @@ -57,11 +62,10 @@ var ActionAdministrationComponent = (function () { }); } else { - _this.actionCreation = false; + _this.creationMode = false; _this.http.get(_this.coreUrl + 'rest/administration/actions/' + params['id']) .subscribe(function (data) { _this.action = data.action; - _this.lang.pageTitle = _this.lang.modify_action + ' : ' + _this.action.id; _this.categoriesList = data.categoriesList; _this.statusList = data.statusList; _this.actionPagesList = data.action_pagesList; @@ -76,11 +80,11 @@ var ActionAdministrationComponent = (function () { }; ActionAdministrationComponent.prototype.onSubmit = function () { var _this = this; - if (this.actionCreation) { + if (this.creationMode) { this.http.post(this.coreUrl + 'rest/actions', this.action) .subscribe(function (data) { _this.router.navigate(['/administration/actions']); - _this.notify.success(data.success); + _this.notify.success(_this.lang.actionAdded + ' « ' + _this.action.label_action + ' »'); }, function (err) { _this.notify.error(JSON.parse(err._body).errors); }); @@ -89,7 +93,7 @@ var ActionAdministrationComponent = (function () { this.http.put(this.coreUrl + 'rest/actions/' + this.action.id, this.action) .subscribe(function (data) { _this.router.navigate(['/administration/actions']); - _this.notify.success(data.success); + _this.notify.success(_this.lang.actionUpdated + ' « ' + _this.action.label_action + ' »'); }, function (err) { _this.notify.error(JSON.parse(err._body).errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts index c9ea7d8981a73190c8c34db216e9087da9d40ab9..c257309cda734783d34c6f2911e275fee6654fd9 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts @@ -18,7 +18,7 @@ export class ActionAdministrationComponent implements OnInit { lang : any = LANG; _search : string = ''; coreUrl : string; - actionCreation : boolean; + creationMode : boolean; action : any = {}; statusList : any[] = []; actionPagesList : any[] = []; @@ -31,9 +31,14 @@ export class ActionAdministrationComponent implements OnInit { } updateBreadcrumb(applicationName: string) { - 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/actions\"' style='cursor: pointer'>Actions</a> > Modification"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > <a onclick='location.hash = \"/administration/actions\"' style='cursor: pointer'>"+this.lang.actions+"</a> > "; + + if(this.creationMode == true){ + breadCrumb += this.lang.actionCreation; + } else { + breadCrumb += this.lang.actionModification; } + $j('#ariane')[0].innerHTML = breadCrumb; } prepareActions() { @@ -50,7 +55,7 @@ export class ActionAdministrationComponent implements OnInit { this.route.params.subscribe(params => { if(typeof params['id']== "undefined"){ - this.actionCreation = true; + this.creationMode = true; this.http.get(this.coreUrl + 'rest/initAction') .subscribe((data : any) => { @@ -64,12 +69,11 @@ export class ActionAdministrationComponent implements OnInit { }); } else { - this.actionCreation = false; + this.creationMode = false; this.http.get(this.coreUrl + 'rest/administration/actions/' + params['id']) .subscribe((data : any) => { this.action = data.action; - this.lang.pageTitle = this.lang.modify_action+' : '+this.action.id; this.categoriesList = data.categoriesList; this.statusList = data.statusList; @@ -86,11 +90,11 @@ export class ActionAdministrationComponent implements OnInit { } onSubmit() { - if (this.actionCreation) { + if (this.creationMode) { this.http.post(this.coreUrl + 'rest/actions', this.action) .subscribe((data : any) => { this.router.navigate(['/administration/actions']); - this.notify.success(data.success); + this.notify.success(this.lang.actionAdded+' « '+this.action.label_action+' »'); },(err) => { this.notify.error(JSON.parse(err._body).errors); @@ -99,7 +103,7 @@ export class ActionAdministrationComponent implements OnInit { this.http.put(this.coreUrl + 'rest/actions/' + this.action.id, this.action) .subscribe((data : any) => { this.router.navigate(['/administration/actions']); - this.notify.success(data.success); + this.notify.success(this.lang.actionUpdated+' « '+this.action.label_action+' »'); },(err) => { this.notify.error(JSON.parse(err._body).errors); diff --git a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js index 9c09e389375206bb035011d479dfd079e261f37b..3b5b6c263c916619dc3c5f25e98cd49c5b4eddd1 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js @@ -26,7 +26,7 @@ var ActionsAdministrationComponent = (function () { } ActionsAdministrationComponent.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> > Actions"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.actions; } }; ActionsAdministrationComponent.prototype.ngOnInit = function () { @@ -39,7 +39,6 @@ var ActionsAdministrationComponent = (function () { .subscribe(function (data) { _this.actions = data['actions']; _this.data = _this.actions; - _this.titles = data['titles']; _this.loading = false; setTimeout(function () { $j("[md2sortby='id']").click(); @@ -49,14 +48,14 @@ var ActionsAdministrationComponent = (function () { location.href = "index.php"; }); }; - ActionsAdministrationComponent.prototype.deleteAction = function (id) { + ActionsAdministrationComponent.prototype.deleteAction = function (action) { var _this = this; - var r = confirm(this.lang.deleteMsg + ' ?'); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + action.label_action + ' »'); if (r) { - this.http.delete(this.coreUrl + 'rest/actions/' + id) + this.http.delete(this.coreUrl + 'rest/actions/' + action.id) .subscribe(function (data) { _this.data = data.action; - _this.notify.success(data.success); + _this.notify.success(_this.lang.actionDeleted + ' « ' + action.label_action + ' »'); }, function (err) { _this.notify.error(JSON.parse(err._body).errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts index 4149bf407364429d6968a74c8db18c410b6e0ab1..9409c66a2cb3b58304f7c68479dfbc7e08ed0e10 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts @@ -30,7 +30,7 @@ export class ActionsAdministrationComponent implements OnInit { updateBreadcrumb(applicationName: string) { 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> > Actions"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.actions; } } @@ -46,7 +46,6 @@ export class ActionsAdministrationComponent implements OnInit { .subscribe((data) => { this.actions = data['actions']; this.data = this.actions; - this.titles = data['titles']; this.loading = false; setTimeout(() => { $j("[md2sortby='id']").click(); @@ -57,14 +56,14 @@ export class ActionsAdministrationComponent implements OnInit { }); } - deleteAction(id: number) { - let r = confirm(this.lang.deleteMsg+' ?'); + deleteAction(action: any) { + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+action.label_action+' »'); if (r) { - this.http.delete(this.coreUrl + 'rest/actions/' + id) + this.http.delete(this.coreUrl + 'rest/actions/' + action.id) .subscribe((data : any) => { this.data = data.action; - this.notify.success(data.success); + this.notify.success(this.lang.actionDeleted+' « '+action.label_action+' »'); }, (err) => { this.notify.error(JSON.parse(err._body).errors); diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js index 243dcd100937ab247707127ec293a171fceb1420..8e2f907c4ee81778aeeaf094f337520498b9b983 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js @@ -29,9 +29,14 @@ var ParameterAdministrationComponent = (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"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>" + this.lang.parameters + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.parameterCreation; + } + else { + breadCrumb += this.lang.parameterModification; } + $j('#ariane')[0].innerHTML = breadCrumb; }; ParameterAdministrationComponent.prototype.ngOnInit = function () { var _this = this; @@ -43,6 +48,7 @@ var ParameterAdministrationComponent = (function () { _this.http.get(_this.coreUrl + 'rest/administration/parameters/new') .subscribe(function (data) { _this.type = 'string'; + _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function () { location.href = "index.php"; @@ -54,6 +60,7 @@ var ParameterAdministrationComponent = (function () { .subscribe(function (data) { _this.parameter = data.parameter; _this.type = data.type; + _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function () { location.href = "index.php"; @@ -79,7 +86,7 @@ var ParameterAdministrationComponent = (function () { this.http.post(this.coreUrl + 'rest/parameters', this.parameter) .subscribe(function (data) { _this.router.navigate(['administration/parameters']); - _this.notify.success(data.success); + _this.notify.success(_this.lang.parameterAdded + ' « ' + _this.parameter.id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -88,7 +95,7 @@ var ParameterAdministrationComponent = (function () { this.http.put(this.coreUrl + 'rest/parameters/' + this.parameter.id, this.parameter) .subscribe(function (data) { _this.router.navigate(['administration/parameters']); - _this.notify.success(data.success); + _this.notify.success(_this.lang.parameterUpdated + ' « ' + _this.parameter.id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts index a2ef9393ad1b5efaa329c8b66d68460b456761f8..43c763d1eb7946805094ece8460693cb1e8177be 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts @@ -33,12 +33,16 @@ export class ParameterAdministrationComponent implements OnInit { $j('#inner_content').remove(); } - updateBreadcrumb(applicationName: string){ - 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"; + updateBreadcrumb(applicationName: string) { + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>"+this.lang.parameters+"</a> > "; + + if(this.creationMode == true){ + breadCrumb += this.lang.parameterCreation; + } else { + breadCrumb += this.lang.parameterModification; } + $j('#ariane')[0].innerHTML = breadCrumb; } - ngOnInit(): void { this.loading = true; this.coreUrl = angularGlobals.coreUrl; @@ -50,7 +54,7 @@ export class ParameterAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/parameters/new') .subscribe((data : any) => { this.type = 'string'; - + this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; }, () => { @@ -62,7 +66,7 @@ export class ParameterAdministrationComponent implements OnInit { .subscribe((data : any) => { this.parameter = data.parameter; this.type = data.type; - + this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; }, () => { @@ -91,7 +95,7 @@ export class ParameterAdministrationComponent implements OnInit { this.http.post(this.coreUrl + 'rest/parameters', this.parameter) .subscribe((data : any) => { this.router.navigate(['administration/parameters']); - this.notify.success(data.success); + this.notify.success(this.lang.parameterAdded+' « '+this.parameter.id+' »'); },(err) => { this.notify.error(err.error.errors); @@ -100,7 +104,7 @@ export class ParameterAdministrationComponent implements OnInit { this.http.put(this.coreUrl+'rest/parameters/'+this.parameter.id,this.parameter) .subscribe((data : any) => { this.router.navigate(['administration/parameters']); - this.notify.success(data.success); + this.notify.success(this.lang.parameterUpdated+' « '+this.parameter.id+' »'); },(err) => { this.notify.error(err.error.errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js index 630e9e5d32dd547db17d1793244d0d84cb2c578c..ea0b3ee45759ba1306a32fedbafcb5046cb41e89 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js @@ -24,10 +24,13 @@ var ParametersAdministrationComponent = (function () { this.data = []; } 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"; + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.parameters; + } }; ParametersAdministrationComponent.prototype.ngOnInit = function () { var _this = this; + this.updateBreadcrumb(angularGlobals.applicationName); this.coreUrl = angularGlobals.coreUrl; this.http.get(this.coreUrl + 'rest/administration/parameters') .subscribe(function (data) { @@ -44,12 +47,12 @@ var ParametersAdministrationComponent = (function () { }; ParametersAdministrationComponent.prototype.deleteParameter = function (paramId) { var _this = this; - var resp = confirm(this.lang.deleteConfirm + ' ' + paramId + '?'); + var resp = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + paramId + ' »'); if (resp) { this.http.delete(this.coreUrl + 'rest/parameters/' + paramId) .subscribe(function (data) { - _this.data = data.parameter; - _this.notify.success(data.success); + _this.data = data.parameters; + _this.notify.success(_this.lang.parameterDeleted + ' « ' + paramId + ' »'); }, function (err) { _this.notify.error(JSON.parse(err._body).errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts index 0ada9e3fcadbcfb494dff56d27032b3838de1efe..2cd18ed0456c77bfaed83964de707e4884336ce6 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts @@ -29,11 +29,14 @@ export class ParametersAdministrationComponent implements OnInit { constructor(public http: HttpClient, private notify: NotificationService) { } - 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"; + updateBreadcrumb(applicationName: string) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.parameters; + } } ngOnInit(): void { + this.updateBreadcrumb(angularGlobals.applicationName); this.coreUrl = angularGlobals.coreUrl; this.http.get(this.coreUrl + 'rest/administration/parameters') @@ -53,12 +56,12 @@ export class ParametersAdministrationComponent implements OnInit { } deleteParameter(paramId : string){ - var resp = confirm(this.lang.deleteConfirm+' '+paramId+'?'); + let resp = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+paramId+' »'); if (resp) { this.http.delete(this.coreUrl + 'rest/parameters/'+paramId) .subscribe((data : any) => { - this.data = data.parameter; - this.notify.success(data.success); + this.data = data.parameters; + this.notify.success(this.lang.parameterDeleted+' « '+paramId+' »'); },(err) => { this.notify.error(JSON.parse(err._body).errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js index e54c896e846af75920f51031ec411e4f8df528e7..79a3e6830d9bbc1c74e02a747795945d47f92b13 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js @@ -12,13 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); var router_1 = require("@angular/router"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var StatusAdministrationComponent = (function () { - function StatusAdministrationComponent(http, route, router) { + function StatusAdministrationComponent(http, route, router, notify) { this.http = http; this.route = route; this.router = router; - this.pageTitle = ""; - this.mode = null; + this.notify = notify; + this.lang = translate_component_1.LANG; this.status = { id: null, label_status: null, @@ -27,7 +29,6 @@ var StatusAdministrationComponent = (function () { is_folder_status: null, img_filename: null }; - this.lang = ""; this.statusImages = ""; this.loading = false; } @@ -40,39 +41,35 @@ var StatusAdministrationComponent = (function () { if (typeof params['identifier'] == "undefined") { _this.http.get(_this.coreUrl + 'rest/administration/status/new') .subscribe(function (data) { - _this.lang = data['lang']; + _this.status.img_filename = "fm-letter"; + _this.status.can_be_searched = true; + _this.status.can_be_modified = true; _this.statusImages = data['statusImages']; - _this.mode = 'create'; - _this.pageTitle = _this.lang.newStatus; + _this.creationMode = true; _this.updateBreadcrumb(angularGlobals.applicationName); + _this.loading = false; }); } else { - _this.mode = 'update'; + _this.creationMode = false; _this.statusIdentifier = params['identifier']; _this.getStatusInfos(_this.statusIdentifier); + _this.loading = false; } - setTimeout(function () { - $j(".help").tooltipster({ - theme: 'tooltipster-maarch', - interactive: true - }); - }, 0); }); - this.loading = false; }; StatusAdministrationComponent.prototype.prepareStatus = function () { $j('#inner_content').remove(); }; StatusAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > " + - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.admin + "</a> > " + - "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>" + this.lang.admin_status + "</a> > "; - if (this.mode == 'create') { - breadCrumb += this.lang.newItem; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + + "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>" + this.lang.statuses + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.statusCreation; } else { - breadCrumb += this.lang.modification; + breadCrumb += this.lang.statusModification; } $j('#ariane')[0].innerHTML = breadCrumb; }; @@ -99,35 +96,30 @@ var StatusAdministrationComponent = (function () { else { _this.status.is_folder_status = false; } - _this.lang = data['lang']; _this.statusImages = data['statusImages']; - _this.pageTitle = _this.lang.modify_status + ' : ' + _this.status.id; _this.updateBreadcrumb(angularGlobals.applicationName); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); }; - StatusAdministrationComponent.prototype.selectImage = function (image_name) { - this.status.img_filename = image_name; - }; StatusAdministrationComponent.prototype.submitStatus = function () { var _this = this; - if (this.mode == 'create') { + if (this.creationMode == true) { this.http.post(this.coreUrl + 'rest/status', this.status) - .subscribe(function () { - successNotification(_this.lang.newStatusAdded + ' : ' + _this.status.id); + .subscribe(function (data) { + _this.notify.success(_this.lang.statusAdded + ' « ' + data.status.id + ' »'); _this.router.navigate(['administration/status']); }, function (err) { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + _this.notify.error(JSON.parse(err._body).errors); }); } - else if (this.mode == "update") { + else if (this.creationMode == false) { this.http.put(this.coreUrl + 'rest/status/' + this.statusIdentifier, this.status) - .subscribe(function () { - successNotification(_this.lang.statusUpdated + ' : ' + _this.status.id); + .subscribe(function (data) { + _this.notify.success(_this.lang.statusUpdated + ' « ' + data.status.id + ' »'); _this.router.navigate(['administration/status']); }, function (err) { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -136,8 +128,9 @@ var StatusAdministrationComponent = (function () { StatusAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals['status-administrationView'], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/status-administration.component.css'] + styleUrls: ['css/status-administration.component.css'], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router]) + __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router, notification_service_1.NotificationService]) ], StatusAdministrationComponent); exports.StatusAdministrationComponent = StatusAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts index 5cd7b9549ce764565d8facff6cc393395ceac5f6..caad7f78d19f0e551c27d82e4986eb2a7e105458 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts @@ -1,66 +1,66 @@ import { Component, OnInit} from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Router, ActivatedRoute } from '@angular/router'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; + @Component({ templateUrl : angularGlobals['status-administrationView'], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/status-administration.component.css'] + styleUrls : ['css/status-administration.component.css'], + providers : [NotificationService] }) export class StatusAdministrationComponent implements OnInit { coreUrl : string; - pageTitle : string = "" ; - mode : string = null; + lang : any = LANG; + + creationMode : boolean; + statusIdentifier : string; status : any = { id : null, - label_status : null, + label_status : null, can_be_searched : null, can_be_modified : null, - is_folder_status : null, - img_filename : null + is_folder_status: null, + img_filename : null }; - lang : any = ""; statusImages : any = ""; loading : boolean = false; - constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router) { + constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService) { } ngOnInit(): void { this.loading = true; this.coreUrl = angularGlobals.coreUrl; + this.prepareStatus(); this.route.params.subscribe((params) => { if (typeof params['identifier'] == "undefined"){ this.http.get(this.coreUrl + 'rest/administration/status/new') .subscribe((data) => { - this.lang = data['lang']; + this.status.img_filename = "fm-letter"; + this.status.can_be_searched = true + this.status.can_be_modified = true this.statusImages = data['statusImages']; - this.mode = 'create'; - this.pageTitle = this.lang.newStatus; + this.creationMode = true; this.updateBreadcrumb(angularGlobals.applicationName); + this.loading = false; }); } else { - this.mode = 'update'; + this.creationMode = false; this.statusIdentifier = params['identifier']; this.getStatusInfos(this.statusIdentifier); + this.loading = false; } - setTimeout(() => { - $j(".help").tooltipster({ - theme: 'tooltipster-maarch', - interactive: true - }); - }, 0); }); - this.loading = false; } prepareStatus() { @@ -69,12 +69,12 @@ export class StatusAdministrationComponent implements OnInit { updateBreadcrumb(applicationName: string){ var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > "+ - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.admin+"</a> > "+ - "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>"+this.lang.admin_status+"</a> > "; - if(this.mode == 'create'){ - breadCrumb += this.lang.newItem; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+ + "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>"+this.lang.statuses+"</a> > "; + if(this.creationMode == true){ + breadCrumb += this.lang.statusCreation; } else { - breadCrumb += this.lang.modification; + breadCrumb += this.lang.statusModification; } $j('#ariane')[0].innerHTML = breadCrumb; } @@ -98,36 +98,30 @@ export class StatusAdministrationComponent implements OnInit { }else{ this.status.is_folder_status = false; } - this.lang = data['lang']; this.statusImages = data['statusImages']; - this.pageTitle = this.lang.modify_status + ' : ' + this.status.id; this.updateBreadcrumb(angularGlobals.applicationName); }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } - - selectImage(image_name : string){ - this.status.img_filename = image_name; - } submitStatus() { - if(this.mode == 'create'){ + if(this.creationMode == true){ this.http.post(this.coreUrl + 'rest/status', this.status) - .subscribe(() => { - successNotification(this.lang.newStatusAdded + ' : ' + this.status.id); + .subscribe((data : any) => { + this.notify.success(this.lang.statusAdded+' « '+data.status.id+' »'); this.router.navigate(['administration/status']); }, (err) => { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + this.notify.error(JSON.parse(err._body).errors); }); - } else if(this.mode == "update"){ + } else if(this.creationMode == false){ this.http.put(this.coreUrl+'rest/status/'+this.statusIdentifier, this.status) - .subscribe(() => { - successNotification(this.lang.statusUpdated + ' : ' + this.status.id); + .subscribe((data : any) => { + this.notify.success(this.lang.statusUpdated+' « '+data.status.id+' »'); this.router.navigate(['administration/status']); }, (err) => { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js index d200a51aa207c09c7125853b0976b70d390c6671..0dc14ca5b9c0e89bac73c4db93d92e89c621a6a9 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js @@ -11,11 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) { Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var StatusesAdministrationComponent = (function () { - function StatusesAdministrationComponent(http) { + function StatusesAdministrationComponent(http, notify) { this.http = http; - this.lang = ""; - this.resultInfo = ""; + this.notify = notify; + this.lang = translate_component_1.LANG; + this.data = []; this.loading = false; } StatusesAdministrationComponent.prototype.ngOnInit = function () { @@ -26,42 +29,14 @@ var StatusesAdministrationComponent = (function () { this.http.get(this.coreUrl + 'rest/administration/status') .subscribe(function (data) { _this.statusList = data.statusList; - _this.lang = data.lang; - _this.nbStatus = Object.keys(_this.statusList).length; + _this.data = _this.statusList; setTimeout(function () { - _this.table = $j('#statusTable').DataTable({ - "dom": '<"datatablesLeft"p><"datatablesRight"f><"datatablesCenter"l>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": [[2, "asc"]], - "columnDefs": [ - { "orderable": false, "targets": [0, 3] } - ], - "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" }); + $j("[md2sortby='label_status']").click(); }, 0); _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); }; StatusesAdministrationComponent.prototype.prepareStatus = function () { @@ -69,25 +44,18 @@ var StatusesAdministrationComponent = (function () { }; StatusesAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > " + - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.admin + "</a> > " + this.lang.admin_status; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.statuses; }; - StatusesAdministrationComponent.prototype.deleteStatus = function (statusId, statusIdentifier) { + StatusesAdministrationComponent.prototype.deleteStatus = function (status) { var _this = this; - var resp = confirm(this.lang.deleteConfirm + ' ' + statusId + '?'); + var resp = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + status.id + ' »'); if (resp) { - this.http.delete(this.coreUrl + 'rest/status/' + statusIdentifier) - .subscribe(function () { - var list = _this.statusList; - for (var i = 0; i < list.length; i++) { - if (list[i].id == statusId) { - list.splice(i, 1); - } - } - _this.table.row($j("#" + statusId)).remove().draw(); - successNotification(_this.lang.delStatus + " : " + statusId); - _this.nbStatus = Object.keys(_this.statusList).length; + this.http.delete(this.coreUrl + 'rest/status/' + status.identifier) + .subscribe(function (data) { + _this.data = data.statuses; + _this.notify.success(_this.lang.statusDeleted + ' « ' + status.id + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -96,8 +64,9 @@ var StatusesAdministrationComponent = (function () { StatusesAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals['statuses-administrationView'], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls: [], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient]) + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) ], StatusesAdministrationComponent); exports.StatusesAdministrationComponent = StatusesAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts index 18f0618ff55aba2396da017b877f0c8aa2578a5d..719fef1e1b0f3949bbff6d982e11c1255afcce41 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts @@ -1,29 +1,30 @@ import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Router, ActivatedRoute } from '@angular/router'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals['statuses-administrationView'], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls : [], + providers : [NotificationService] }) export class StatusesAdministrationComponent implements OnInit { coreUrl : string; + lang : any = LANG; + nbStatus : number; - lang : any = ""; - table : any; statusList : any; + data : any = []; - resultInfo : string = ""; - loading : boolean = false; + loading : boolean = false; - constructor(public http: HttpClient) { + constructor(public http: HttpClient, private notify: NotificationService) { } ngOnInit(): void { @@ -36,43 +37,14 @@ export class StatusesAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/status') .subscribe((data : any) => { this.statusList = data.statusList; - this.lang = data.lang; - this.nbStatus = Object.keys(this.statusList).length; + this.data = this.statusList; setTimeout(() => { - this.table = $j('#statusTable').DataTable({ - "dom": '<"datatablesLeft"p><"datatablesRight"f><"datatablesCenter"l>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": [[ 2, "asc" ]], - "columnDefs": [ - { "orderable": false, "targets": [0,3] } - ], - "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"}); - + $j("[md2sortby='label_status']").click(); }, 0); this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } @@ -82,26 +54,19 @@ export class StatusesAdministrationComponent implements OnInit { updateBreadcrumb(applicationName: string){ $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > "+ - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.admin + "</a> > " + this.lang.admin_status; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.statuses; } - deleteStatus(statusId : string, statusIdentifier : string){ - var resp = confirm(this.lang.deleteConfirm+' '+statusId+'?'); + deleteStatus(status : any){ + var resp = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+status.id+' »'); if(resp){ - this.http.delete(this.coreUrl + 'rest/status/'+statusIdentifier) - .subscribe(() => { - var list = this.statusList; - for(var i = 0; i<list.length;i++){ - if(list[i].id==statusId){ - list.splice(i, 1); - } - } - this.table.row($j("#"+statusId)).remove().draw(); - - successNotification(this.lang.delStatus + " : " + statusId); - this.nbStatus = Object.keys(this.statusList).length; + this.http.delete(this.coreUrl + 'rest/status/'+status.identifier) + .subscribe((data : any) => { + this.data = data.statuses; + this.notify.success(this.lang.statusDeleted+' « '+status.id+' »'); + }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js index 7e3af25c31a5daa641137c9cf2a4f1ed79d9c574..2250d2b9ce19ff2f1adfbde49cff2081e2a0edd5 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js @@ -23,6 +23,7 @@ var UserAdministrationComponent = (function () { this.zone = zone; this.notify = notify; this.lang = translate_component_1.LANG; + this._search = ''; this.user = {}; this.signatureModel = { base64: "", @@ -42,28 +43,34 @@ var UserAdministrationComponent = (function () { }; } UserAdministrationComponent.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/users\"' style='cursor: pointer'>Utilisateurs</a>"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > <a onclick='location.hash = \"/administration/users\"' style='cursor: pointer'>" + this.lang.users + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.userCreation; } + else { + breadCrumb += this.lang.userModification; + } + $j('#ariane')[0].innerHTML = breadCrumb; }; UserAdministrationComponent.prototype.ngOnInit = function () { var _this = this; //$j('#header').remove(); - this.updateBreadcrumb(angularGlobals.applicationName); this.coreUrl = angularGlobals.coreUrl; this.loading = true; this.route.params.subscribe(function (params) { if (typeof params['id'] == "undefined") { - _this.userCreation = true; + _this.creationMode = true; _this.loading = false; + _this.updateBreadcrumb(angularGlobals.applicationName); } else { - _this.userCreation = false; + _this.creationMode = false; _this.serialId = params['id']; _this.http.get(_this.coreUrl + "rest/users/" + _this.serialId + "/details") .subscribe(function (data) { _this.user = data; _this.userId = data.user_id; + _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function () { location.href = "index.php"; @@ -159,13 +166,13 @@ var UserAdministrationComponent = (function () { this.selectedSignature = index; this.selectedSignatureLabel = this.user.signatures[index].signature_label; }; - UserAdministrationComponent.prototype.resetPassword = function () { + UserAdministrationComponent.prototype.resetPassword = function (user) { var _this = this; - var r = confirm('Voulez-vous vraiment réinitialiser le mot de passe de l\'utilisateur ?'); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.resetPsw); if (r) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/password", {}) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.pswReseted + ' ' + _this.lang.for + ' « ' + user.user_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -183,7 +190,7 @@ var UserAdministrationComponent = (function () { _this.user.groups = data.groups; _this.user.allGroups = data.allGroups; _this.user.baskets = data.baskets; - _this.notify.success(data.success); + _this.notify.success(_this.lang.groupAdded + ' « ' + group.group_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -193,7 +200,7 @@ var UserAdministrationComponent = (function () { .subscribe(function (data) { _this.user.groups = data.groups; _this.user.allGroups = data.allGroups; - _this.notify.success(data.success); + _this.notify.success(_this.lang.groupDeleted + ' « ' + group.group_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -203,25 +210,11 @@ var UserAdministrationComponent = (function () { var _this = this; this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id, group) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.groupUpdated + ' « ' + group.group_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); }; - UserAdministrationComponent.prototype.deleteGroup = function (group) { - var _this = this; - var r = confirm('Voulez-vous vraiment retirer l\'utilisateur de ce groupe ?'); - if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id) - .subscribe(function (data) { - _this.user.groups = data.groups; - _this.user.allGroups = data.allGroups; - _this.notify.success(data.success); - }, function (err) { - _this.notify.error(err.error.errors); - }); - } - }; UserAdministrationComponent.prototype.addEntity = function (entiyId) { var _this = this; var entity = { @@ -232,7 +225,7 @@ var UserAdministrationComponent = (function () { .subscribe(function (data) { _this.user.entities = data.entities; _this.user.allEntities = data.allEntities; - _this.notify.success(data.success); + _this.notify.success(_this.lang.entityAdded + ' « ' + entiyId + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -241,7 +234,7 @@ var UserAdministrationComponent = (function () { var _this = this; this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id, entity) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.entityUpdated + ' « ' + entity.entity_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -251,7 +244,7 @@ var UserAdministrationComponent = (function () { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id + "/primaryEntity", {}) .subscribe(function (data) { _this.user['entities'] = data.entities; - _this.notify.success(data.success); + _this.notify.success(_this.lang.entityTooglePrimary + ' « ' + entity.entity_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -262,7 +255,7 @@ var UserAdministrationComponent = (function () { .subscribe(function (data) { _this.user.entities = data.entities; _this.user.allEntities = data.allEntities; - _this.notify.success(data.success); + _this.notify.success(_this.lang.entityDeleted + ' « ' + entityId + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -272,6 +265,7 @@ var UserAdministrationComponent = (function () { this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/signatures", this.signatureModel) .subscribe(function (data) { _this.user.signatures = data.signatures; + _this.notify.success(_this.lang.signAdded + ' « ' + _this.signatureModel.name + ' »'); _this.signatureModel = { base64: "", base64ForJs: "", @@ -280,7 +274,6 @@ var UserAdministrationComponent = (function () { size: 0, label: "", }; - _this.notify.success(data.success); }, function (err) { _this.notify.error(err.error.errors); }); @@ -292,19 +285,19 @@ var UserAdministrationComponent = (function () { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id, { "label": label }) .subscribe(function (data) { _this.user.signatures[selectedSignature].signature_label = data.signature.signature_label; - _this.notify.success(data.success); + _this.notify.success(_this.lang.signUpdated + ' « ' + data.signature.signature_label + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); }; - UserAdministrationComponent.prototype.deleteSignature = function (id) { + UserAdministrationComponent.prototype.deleteSignature = function (signature) { var _this = this; - var r = confirm('Voulez-vous vraiment supprimer la signature ?'); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + signature.signature_label + ' »'); if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id) + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + signature.id) .subscribe(function (data) { _this.user.signatures = data.signatures; - _this.notify.success(data.success); + _this.notify.success(_this.lang.signDeleted + ' « ' + signature.signature_label + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -313,7 +306,7 @@ var UserAdministrationComponent = (function () { UserAdministrationComponent.prototype.addBasketRedirection = function (i, basket) { var r = false; if (this.user.status != 'ABS') { - r = confirm('Cela activera automatiquement le mode absent, continuer ?'); + var r_1 = confirm(this.lang.confirmAction + ' ' + this.lang.activateAbs); } if (r || this.user.status == 'ABS') { this.userAbsenceModel.push({ @@ -335,7 +328,7 @@ var UserAdministrationComponent = (function () { .subscribe(function (data) { _this.user.status = data.user.status; _this.userAbsenceModel = []; - _this.notify.success(data.success); + _this.notify.success(_this.lang.absOn + ' ' + _this.lang.for + ' « ' + _this.user.user_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); @@ -348,17 +341,17 @@ var UserAdministrationComponent = (function () { for (var i in _this.user.baskets) { _this.user.baskets[i].userToDisplay = ''; } - _this.notify.success(data.success); + _this.notify.success(_this.lang.absOff + ' ' + _this.lang.for + ' « ' + _this.user.user_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); }; UserAdministrationComponent.prototype.onSubmit = function () { var _this = this; - if (this.userCreation) { + if (this.creationMode) { this.http.post(this.coreUrl + "rest/users", this.user) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.userAdded + ' « ' + data.user.user_id + ' »'); _this.router.navigate(["/administration/users/" + data.user.id]); }, function (err) { _this.notify.error(err.error.errors); @@ -367,7 +360,7 @@ var UserAdministrationComponent = (function () { else { this.http.put(this.coreUrl + "rest/users/" + this.serialId, this.user) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.userUpdated + ' « ' + _this.user.user_id + ' »'); }, function (err) { _this.notify.error(err.error.errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts index cfdc3a34803ae1b0b79bca900172403176b2a7db..7366cc55b25d840bdf329cdd0dcc60e6f7a40b66 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts @@ -18,9 +18,11 @@ export class UserAdministrationComponent implements OnInit { coreUrl : string; lang : any = LANG; + _search : string = ''; + userId : string; serialId : number; - userCreation : boolean; + creationMode : boolean; user : any = {}; signatureModel : any = { @@ -46,29 +48,35 @@ export class UserAdministrationComponent implements OnInit { } updateBreadcrumb(applicationName: string) { - 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/users\"' style='cursor: pointer'>Utilisateurs</a>"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > <a onclick='location.hash = \"/administration/users\"' style='cursor: pointer'>"+this.lang.users+"</a> > "; + + if(this.creationMode == true){ + breadCrumb += this.lang.userCreation; + } else { + breadCrumb += this.lang.userModification; } + $j('#ariane')[0].innerHTML = breadCrumb; } ngOnInit(): void { //$j('#header').remove(); - this.updateBreadcrumb(angularGlobals.applicationName); this.coreUrl = angularGlobals.coreUrl; this.loading = true; this.route.params.subscribe(params => { if (typeof params['id'] == "undefined") { - this.userCreation = true; + this.creationMode = true; this.loading = false; + this.updateBreadcrumb(angularGlobals.applicationName); } else { - this.userCreation = false; + this.creationMode = false; this.serialId = params['id']; this.http.get(this.coreUrl + "rest/users/" + this.serialId + "/details") .subscribe((data : any) => { this.user = data; this.userId = data.user_id; + this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; @@ -176,13 +184,13 @@ export class UserAdministrationComponent implements OnInit { this.selectedSignatureLabel = this.user.signatures[index].signature_label; } - resetPassword() { - let r = confirm('Voulez-vous vraiment réinitialiser le mot de passe de l\'utilisateur ?'); + resetPassword(user:any) { + let r = confirm(this.lang.confirmAction+' '+this.lang.resetPsw); if (r) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/password", {}) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.pswReseted+' '+this.lang.for+' « '+user.user_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -200,7 +208,7 @@ export class UserAdministrationComponent implements OnInit { this.user.groups = data.groups; this.user.allGroups = data.allGroups; this.user.baskets = data.baskets; - this.notify.success(data.success); + this.notify.success(this.lang.groupAdded+' « '+group.group_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -209,7 +217,7 @@ export class UserAdministrationComponent implements OnInit { .subscribe((data : any) => { this.user.groups = data.groups; this.user.allGroups = data.allGroups; - this.notify.success(data.success); + this.notify.success(this.lang.groupDeleted+' « '+group.group_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -218,27 +226,12 @@ export class UserAdministrationComponent implements OnInit { updateGroup(group: any) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id, group) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.groupUpdated+' « '+group.group_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); } - deleteGroup(group: any) { - let r = confirm('Voulez-vous vraiment retirer l\'utilisateur de ce groupe ?'); - - if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id) - .subscribe((data : any) => { - this.user.groups = data.groups; - this.user.allGroups = data.allGroups; - this.notify.success(data.success); - }, (err) => { - this.notify.error(err.error.errors); - }); - } - } - addEntity(entiyId:any) { var entity = { @@ -250,7 +243,7 @@ export class UserAdministrationComponent implements OnInit { .subscribe((data : any) => { this.user.entities = data.entities; this.user.allEntities = data.allEntities; - this.notify.success(data.success); + this.notify.success(this.lang.entityAdded+' « '+entiyId+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -260,7 +253,7 @@ export class UserAdministrationComponent implements OnInit { updateEntity(entity: any) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id, entity) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.entityUpdated+' « '+entity.entity_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -270,7 +263,7 @@ export class UserAdministrationComponent implements OnInit { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id + "/primaryEntity", {}) .subscribe((data : any) => { this.user['entities'] = data.entities; - this.notify.success(data.success); + this.notify.success(this.lang.entityTooglePrimary+' « '+entity.entity_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -282,7 +275,7 @@ export class UserAdministrationComponent implements OnInit { .subscribe((data : any) => { this.user.entities = data.entities; this.user.allEntities = data.allEntities; - this.notify.success(data.success); + this.notify.success(this.lang.entityDeleted+' « '+entityId+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -293,6 +286,7 @@ export class UserAdministrationComponent implements OnInit { this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/signatures", this.signatureModel) .subscribe((data : any) => { this.user.signatures = data.signatures; + this.notify.success(this.lang.signAdded+' « '+this.signatureModel.name+' »'); this.signatureModel = { base64 : "", base64ForJs : "", @@ -301,7 +295,6 @@ export class UserAdministrationComponent implements OnInit { size : 0, label : "", }; - this.notify.success(data.success); }, (err) => { this.notify.error(err.error.errors); }); @@ -314,20 +307,20 @@ export class UserAdministrationComponent implements OnInit { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id, {"label" : label}) .subscribe((data : any) => { this.user.signatures[selectedSignature].signature_label = data.signature.signature_label; - this.notify.success(data.success); + this.notify.success(this.lang.signUpdated+' « '+data.signature.signature_label+' »'); }, (err) => { this.notify.error(err.error.errors); }); } - deleteSignature(id: number) { - let r = confirm('Voulez-vous vraiment supprimer la signature ?'); + deleteSignature(signature: any) { + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+signature.signature_label+' »'); if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id) + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + signature.id) .subscribe((data : any) => { this.user.signatures = data.signatures; - this.notify.success(data.success); + this.notify.success(this.lang.signDeleted+' « '+signature.signature_label+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -337,7 +330,7 @@ export class UserAdministrationComponent implements OnInit { addBasketRedirection(i:number,basket:any) { let r = false; if(this.user.status != 'ABS'){ - r = confirm('Cela activera automatiquement le mode absent, continuer ?'); + let r = confirm(this.lang.confirmAction+' '+this.lang.activateAbs); } if (r || this.user.status == 'ABS') { @@ -361,7 +354,7 @@ export class UserAdministrationComponent implements OnInit { .subscribe((data : any) => { this.user.status = data.user.status; this.userAbsenceModel = []; - this.notify.success(data.success); + this.notify.success(this.lang.absOn+' '+this.lang.for+' « '+this.user.user_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); @@ -374,17 +367,17 @@ export class UserAdministrationComponent implements OnInit { for (let i in this.user.baskets) { this.user.baskets[i].userToDisplay = ''; } - this.notify.success(data.success); + this.notify.success(this.lang.absOff+' '+this.lang.for+' « '+this.user.user_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); } onSubmit() { - if (this.userCreation) { + if (this.creationMode) { this.http.post(this.coreUrl + "rest/users", this.user) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.userAdded+' « '+data.user.user_id+' »'); this.router.navigate(["/administration/users/" + data.user.id]); }, (err) => { this.notify.error(err.error.errors); @@ -392,7 +385,7 @@ export class UserAdministrationComponent implements OnInit { } else { this.http.put(this.coreUrl + "rest/users/" + this.serialId, this.user) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.userUpdated+' « '+this.user.user_id+' »'); }, (err) => { this.notify.error(err.error.errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js index 7f903791eedfb75b827ff39dabf0e8823e7d63ee..edd969aa51e17481a746faf7f11a56848307c8e1 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js @@ -45,7 +45,7 @@ var UsersAdministrationComponent = (function () { } UsersAdministrationComponent.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> > Utilisateurs"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.users; } }; UsersAdministrationComponent.prototype.ngOnInit = function () { @@ -79,12 +79,12 @@ var UsersAdministrationComponent = (function () { }); } else { - var r = confirm(this.lang.suspendMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.suspend + ' « ' + user.user_id + ' »'); if (r) { user.enabled = 'N'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.userSuspended + ' « ' + user.user_id + ' »'); }, function (err) { user.enabled = 'Y'; _this.notify.error(JSON.parse(err._body).errors); @@ -94,7 +94,7 @@ var UsersAdministrationComponent = (function () { }; UsersAdministrationComponent.prototype.suspendUserModal = function (user) { var _this = this; - var r = confirm(this.lang.suspendMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.suspend + ' « ' + user.user_id + ' »'); if (r) { user.enabled = 'N'; user.redirectListModels = this.userDestRedirectModels; @@ -111,7 +111,7 @@ var UsersAdministrationComponent = (function () { .subscribe(function (data) { user.inDiffListDest = 'N'; $j('#changeDiffListDest').modal('hide'); - _this.notify.success(data.success); + _this.notify.success(_this.lang.userSuspended + ' « ' + user.user_id + ' »'); }, function (err) { user.enabled = 'Y'; _this.notify.error(JSON.parse(err._body).errors); @@ -124,12 +124,12 @@ var UsersAdministrationComponent = (function () { }; UsersAdministrationComponent.prototype.activateUser = function (user) { var _this = this; - var r = confirm(this.lang.authorizeMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.authorize + ' « ' + user.user_id + ' »'); if (r) { user.enabled = 'Y'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { - _this.notify.success(data.success); + _this.notify.success(_this.lang.userAuthorized + ' « ' + user.user_id + ' »'); }, function (err) { user.enabled = 'N'; _this.notify.error(JSON.parse(err._body).errors); @@ -149,12 +149,12 @@ var UsersAdministrationComponent = (function () { }); } else { - var r = confirm(this.lang.deleteMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + user.user_id + ' »'); if (r) { this.http.delete(this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { _this.data = data.users; - _this.notify.success(data.success); + _this.notify.success(_this.lang.userDeleted + ' « ' + user.user_id + ' »'); }, function (err) { _this.notify.error(JSON.parse(err._body).errors); }); @@ -163,7 +163,7 @@ var UsersAdministrationComponent = (function () { }; UsersAdministrationComponent.prototype.deleteUserModal = function (user) { var _this = this; - var r = confirm(this.lang.deleteMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + user.user_id + ' »'); if (r) { user.redirectListModels = this.userDestRedirectModels; //first, update listModels @@ -179,7 +179,7 @@ var UsersAdministrationComponent = (function () { user.inDiffListDest = 'N'; _this.data = data.users; $j('#changeDiffListDest').modal('hide'); - _this.notify.success(data.success); + _this.notify.success(_this.lang.userDeleted + ' « ' + user.user_id + ' »'); }, function (err) { _this.notify.error(JSON.parse(err._body).errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts index bf1fe7e1b423e8dc7e7e11501908cd22fc74db4b..305e14049c21e6b92bc8d96c3c10bc3a390f735d 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts @@ -44,7 +44,7 @@ export class UsersAdministrationComponent implements OnInit { updateBreadcrumb(applicationName: string) { 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> > Utilisateurs"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.users; } } @@ -79,13 +79,13 @@ export class UsersAdministrationComponent implements OnInit { location.href = "index.php"; }); } else { - let r = confirm(this.lang.suspendMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.suspend+' « '+user.user_id+' »'); if (r) { user.enabled = 'N'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.userSuspended+' « '+user.user_id+' »'); }, (err) => { user.enabled = 'Y'; @@ -96,7 +96,7 @@ export class UsersAdministrationComponent implements OnInit { } suspendUserModal(user: any) { - let r = confirm(this.lang.suspendMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.suspend+' « '+user.user_id+' »'); if (r) { user.enabled = 'N'; @@ -113,7 +113,7 @@ export class UsersAdministrationComponent implements OnInit { .subscribe((data : any) => { user.inDiffListDest = 'N'; $j('#changeDiffListDest').modal('hide'); - this.notify.success(data.success); + this.notify.success(this.lang.userSuspended+' « '+user.user_id+' »'); }, (err) => { user.enabled = 'Y'; @@ -128,13 +128,13 @@ export class UsersAdministrationComponent implements OnInit { } activateUser(user: any) { - let r = confirm(this.lang.authorizeMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.authorize+' « '+user.user_id+' »'); if (r) { user.enabled = 'Y'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { - this.notify.success(data.success); + this.notify.success(this.lang.userAuthorized+' « '+user.user_id+' »'); }, (err) => { user.enabled = 'N'; @@ -156,13 +156,13 @@ export class UsersAdministrationComponent implements OnInit { this.notify.error(JSON.parse(err._body).errors); }); } else { - let r = confirm(this.lang.deleteMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+user.user_id+' »'); if (r) { this.http.delete(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { this.data = data.users; - this.notify.success(data.success); + this.notify.success(this.lang.userDeleted+' « '+user.user_id+' »'); }, (err) => { this.notify.error(JSON.parse(err._body).errors); @@ -172,7 +172,7 @@ export class UsersAdministrationComponent implements OnInit { } deleteUserModal(user: any) { - let r = confirm(this.lang.deleteMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+user.user_id+' »'); if (r) { user.redirectListModels = this.userDestRedirectModels; @@ -188,8 +188,8 @@ export class UsersAdministrationComponent implements OnInit { user.inDiffListDest = 'N'; this.data = data.users; $j('#changeDiffListDest').modal('hide'); - this.notify.success(data.success); - + this.notify.success(this.lang.userDeleted+' « '+user.user_id+' »'); + }, (err) => { this.notify.error(JSON.parse(err._body).errors); }); diff --git a/apps/maarch_entreprise/js/angular/app/app-material.module.js b/apps/maarch_entreprise/js/angular/app/app-material.module.js index a9d1cc9a9661f91e169090a10b30618ed8464ec0..a8dab892802ed36558af1236247f70bccf4f93ca 100644 --- a/apps/maarch_entreprise/js/angular/app/app-material.module.js +++ b/apps/maarch_entreprise/js/angular/app/app-material.module.js @@ -28,7 +28,8 @@ AppMaterialModule = __decorate([ material_1.MdButtonToggleModule, material_1.MdProgressSpinnerModule, material_1.MdToolbarModule, - material_1.MdMenuModule + material_1.MdMenuModule, + material_1.MdGridListModule ], exports: [ material_1.MdCheckboxModule, @@ -43,7 +44,8 @@ AppMaterialModule = __decorate([ material_1.MdButtonToggleModule, material_1.MdProgressSpinnerModule, material_1.MdToolbarModule, - material_1.MdMenuModule + material_1.MdMenuModule, + material_1.MdGridListModule ] }) ], AppMaterialModule); diff --git a/apps/maarch_entreprise/js/angular/app/app-material.module.ts b/apps/maarch_entreprise/js/angular/app/app-material.module.ts index 6d6b01cc03d25995eeda02d95f94b21969ac075e..142acaf37fe12f01305303df96fec532f59c5c6d 100644 --- a/apps/maarch_entreprise/js/angular/app/app-material.module.ts +++ b/apps/maarch_entreprise/js/angular/app/app-material.module.ts @@ -12,7 +12,8 @@ import { MdButtonToggleModule, MdProgressSpinnerModule, MdToolbarModule, - MdMenuModule + MdMenuModule, + MdGridListModule } from '@angular/material'; @@ -30,7 +31,8 @@ import { MdButtonToggleModule, MdProgressSpinnerModule, MdToolbarModule, - MdMenuModule + MdMenuModule, + MdGridListModule ], exports: [ MdCheckboxModule, @@ -45,7 +47,8 @@ import { MdButtonToggleModule, MdProgressSpinnerModule, MdToolbarModule, - MdMenuModule + MdMenuModule, + MdGridListModule ] }) export class AppMaterialModule { } diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.js b/apps/maarch_entreprise/js/angular/lang/lang-fr.js index 4b7b2ec864d6b0bba1c47474c2b39d1515436f03..e9523bdd115cc145ebbcccb4309efeed58aa2159 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-fr.js +++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.js @@ -29,6 +29,10 @@ exports.LANG_FR = { "clickOn": "Cliquez sur", "to": "vers", "value": "valeur", + confirmAction: "Voulez-vous vraiment effectuer cette action ?", + suspend: "Suspendre", + authorize: "Autoriser", + for: "pour", //Administration "userCreation": "Création d'un utilisateur", "userModification": "Modification de l'utilisateur", @@ -64,33 +68,57 @@ exports.LANG_FR = { search: "Chercher", filterBy: "Filtrer par", //Users - "user": "utilisateur", - "users": "utilisateur(s)", - "status": "Statut", - "informations": "Informations", - "firstname": "Prénom", - "lastname": "Nom", - "email": "Email", - "phoneNumber": "Numéro de téléphone", - "role": "Rôle", - "emailSignatures": "Signatures de mail", - "sbSignatures": "Signatures de parapheur", - "initials": "Initiales", - "fingerprint": "Empreinte numérique", - "color": "Couleur", - "label": "Label", - "processDelay": "Délai de traitement", - "workingDays": "Jours travaillés", - "folders": "Dossiers", - "groups": "Groupes", - "entities": "Entités", - "primaryEntity": "Entité Primaire", - "secondaryEntity": "Entité Secondaire", + user: "Utilisateur", + users: "Utilisateur(s)", + userAdded: "Utilisateur ajouté", + userUpdated: "Utilisateur modifié", + userSuspended: "Utilisateur suspendu", + userAuthorized: "Utilisateur autorisé", + userDeleted: "Utilisateur supprimé", + pswReseted: "Mot de passe réinitialisé", + status: "Statut", + informations: "Informations", + firstname: "Prénom", + lastname: "Nom", + email: "Email", + phoneNumber: "Numéro de téléphone", + role: "Rôle", + emailSignatures: "Signatures de mail", + sbSignatures: "Signatures de parapheur", + initials: "Initiales", + fingerprint: "Empreinte numérique", + color: "Couleur", + label: "Label", + processDelay: "Délai de traitement", + workingDays: "Jours travaillés", + folders: "Dossiers", + groups: "Groupes", + entities: "Entités", + primaryEntity: "Entité Primaire", + secondaryEntity: "Entité Secondaire", + resetPsw: "Réinitialiser le mot de passe", + signAdded: "Signature ajoutée", + signUpdated: "Signature modifiée", + signDeleted: "Signature supprimée", + activateAbs: "Activer l'absence", + absOn: "Absence activé", + absOff: "Absence désactivé", + //Group + groupAdded: "Groupe ajouté", + groupUpdated: "Groupe modifié", + groupDeleted: "Groupe supprimé", + //Entity + entityAdded: "Entité ajouté", + entityUpdated: "Entité modifié", + entityDeleted: "Entité supprimé", + entityTooglePrimary: "Passage en entité primaire", //Actions + actionAdded: "Action ajoutée", + actionUpdated: "Action modifiée", + actionDeleted: "Action supprimée", actionCreation: "Création d'une action", actionModification: "Modification de l'action", action: "Action", - actionAdded: "Ajout d'une nouvelle action", actionHistory: "Tracer l'action", actionHistoryDesc: "Permet tracer cette action dans l'historique du document. Il est fortement recommandé de cocher cette option.", actionModified: "Modification de l'action", @@ -107,11 +135,25 @@ exports.LANG_FR = { keyword: "Mot clé", newAction: "Nouvelle action", //Parametre + parameterAdded: "Paramètre ajouté", + parameterUpdated: "Paramètre modifié", + parameterDeleted: "Paramètre supprimé", parameterCreation: "Création d'un paramètre", parameterModification: "Modification du paramètre", parameters: "Paramètre(s)", type: "Type", string: "Chaine de caratère", integer: "Entier", - date: "Date" + date: "Date", + //Status + statusCreation: "Création d'un statut", + statusModification: "Modification du statut", + statuses: "Statut(s)", + imgRelated: "Image associée", + canBeSearched: "Recherche", + canBeModified: "Modification des index", + isFolderStatus: "Statut de dossier", + statusAdded: "Statut ajouté", + statusUpdated: "Statut mis à jour", + statusDeleted: "Statut supprimé" }; diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts index b65441671bad93228064d7c4ca0e40cdb7c6210d..15bc2770b6214d75a97bec52d0f3a7f0b26db917 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts +++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts @@ -27,6 +27,10 @@ export const LANG_FR = { "clickOn" : "Cliquez sur", "to" : "vers", "value" : "valeur", + confirmAction: "Voulez-vous vraiment effectuer cette action ?", + suspend: "Suspendre", + authorize: "Autoriser", + for: "pour", //Administration @@ -67,35 +71,61 @@ export const LANG_FR = { filterBy: "Filtrer par", //Users - "user" : "utilisateur", - "users" : "utilisateur(s)", - "status" : "Statut", - "informations" : "Informations", - "firstname" : "Prénom", - "lastname" : "Nom", - "email" : "Email", - "phoneNumber" : "Numéro de téléphone", - "role" : "Rôle", - "emailSignatures" : "Signatures de mail", - "sbSignatures" : "Signatures de parapheur", - "initials" : "Initiales", - "fingerprint" : "Empreinte numérique", - "color" : "Couleur", - "label" : "Label", - "processDelay" : "Délai de traitement", - "workingDays" : "Jours travaillés", - "folders" : "Dossiers", - "groups" : "Groupes", - "entities" : "Entités", - "primaryEntity" : "Entité Primaire", - "secondaryEntity" : "Entité Secondaire", - + user: "Utilisateur", + users: "Utilisateur(s)", + userAdded: "Utilisateur ajouté", + userUpdated: "Utilisateur modifié", + userSuspended: "Utilisateur suspendu", + userAuthorized: "Utilisateur autorisé", + userDeleted: "Utilisateur supprimé", + pswReseted: "Mot de passe réinitialisé", + status: "Statut", + informations: "Informations", + firstname: "Prénom", + lastname: "Nom", + email: "Email", + phoneNumber: "Numéro de téléphone", + role: "Rôle", + emailSignatures: "Signatures de mail", + sbSignatures: "Signatures de parapheur", + initials: "Initiales", + fingerprint: "Empreinte numérique", + color: "Couleur", + label: "Label", + processDelay: "Délai de traitement", + workingDays: "Jours travaillés", + folders: "Dossiers", + groups: "Groupes", + entities: "Entités", + primaryEntity: "Entité Primaire", + secondaryEntity: "Entité Secondaire", + resetPsw: "Réinitialiser le mot de passe", + signAdded: "Signature ajoutée", + signUpdated: "Signature modifiée", + signDeleted: "Signature supprimée", + activateAbs: "Activer l'absence", + absOn: "Absence activé", + absOff: "Absence désactivé", + + + //Group + groupAdded: "Groupe ajouté", + groupUpdated: "Groupe modifié", + groupDeleted: "Groupe supprimé", + //Entity + entityAdded: "Entité ajouté", + entityUpdated: "Entité modifié", + entityDeleted: "Entité supprimé", + entityTooglePrimary: "Passage en entité primaire", + //Actions + actionAdded: "Action ajoutée", + actionUpdated: "Action modifiée", + actionDeleted: "Action supprimée", actionCreation: "Création d'une action", actionModification: "Modification de l'action", action: "Action", - actionAdded: "Ajout d'une nouvelle action", actionHistory: "Tracer l'action", actionHistoryDesc: "Permet tracer cette action dans l'historique du document. Il est fortement recommandé de cocher cette option.", actionModified: "Modification de l'action", @@ -113,11 +143,26 @@ export const LANG_FR = { newAction: "Nouvelle action", //Parametre + parameterAdded: "Paramètre ajouté", + parameterUpdated: "Paramètre modifié", + parameterDeleted: "Paramètre supprimé", parameterCreation: "Création d'un paramètre", parameterModification: "Modification du paramètre", parameters: "Paramètre(s)", type:"Type", string:"Chaine de caratère", integer:"Entier", - date:"Date" + date:"Date", + + //Status + statusCreation: "Création d'un statut", + statusModification: "Modification du statut", + statuses: "Statut(s)", + imgRelated: "Image associée", + canBeSearched: "Recherche", + canBeModified: "Modification des index", + isFolderStatus: "Statut de dossier", + statusAdded: "Statut ajouté", + statusUpdated: "Statut mis à jour", + statusDeleted: "Statut supprimé" }; \ No newline at end of file diff --git a/core/Controllers/ParametersController.php b/core/Controllers/ParametersController.php index fd7a879899674a860c18779a26b187f7bd0c2067..322567bbb5cbe451eed6919e7d3f019a0b20779d 100755 --- a/core/Controllers/ParametersController.php +++ b/core/Controllers/ParametersController.php @@ -84,7 +84,7 @@ class ParametersController return $response->withJson( [ - 'success' => _PARAMETER. ' <b>' . $obj['id'] .'</b> ' ._ADDED, + 'success' => _PARAMETER. ' <b>' . $obj['id'] .'</b> ' ._ADDED ] ); } @@ -123,6 +123,7 @@ class ParametersController return $response->withJson( [ 'success' => _PARAMETER. ' <b>' . $aArgs['id'] .'</b> ' ._DELETED, + 'parameters' => ParametersModel::getList() ] ); } diff --git a/core/Controllers/StatusController.php b/core/Controllers/StatusController.php index 861c91f2bbcbc31127d7e7c2b3a916f8a7cb198c..89e189b76e75eb78e2b83b6f55f7b5b2ae2870f6 100755 --- a/core/Controllers/StatusController.php +++ b/core/Controllers/StatusController.php @@ -31,8 +31,7 @@ class StatusController } return $response->withJson([ - 'statusList' => StatusModel::getList(), - 'lang' => StatusModel::getStatusLang() + 'statusList' => StatusModel::getList() ]); } @@ -43,8 +42,7 @@ class StatusController } return $response->withJson([ - 'statusImages' => StatusImagesModel::getStatusImages(), - 'lang' => StatusModel::getStatusLang() + 'statusImages' => StatusImagesModel::getStatusImages() ]); } @@ -147,9 +145,8 @@ class StatusController $statusDeleted = StatusModel::getByIdentifier(['identifier' => $aArgs['identifier']]); if (Validator::notEmpty()->validate($aArgs['identifier']) && Validator::numeric()->validate($aArgs['identifier']) && !empty($statusDeleted)) { - $return = [ - StatusModel::delete(['identifier' => $aArgs['identifier']]) - ]; + + StatusModel::delete(['identifier' => $aArgs['identifier']]); HistoryController::add([ 'table_name' => 'status', @@ -164,7 +161,11 @@ class StatusController ->withJson(['errors' => 'identifier not valid']); } - return $response->withJson($return); + return $response->withJson( + [ + 'statuses' => StatusModel::getList() + ] + ); } protected function manageValue($request) diff --git a/core/Controllers/UserController.php b/core/Controllers/UserController.php index 990cc2a61acc33a3850159dbf65f0936a5b503ae..275f07192748e8a9bb7af286c9702e90dd1a151d 100755 --- a/core/Controllers/UserController.php +++ b/core/Controllers/UserController.php @@ -69,7 +69,7 @@ class UserController UserModel::create(['user' => $data]); - $newUser = UserModel::getByUserId(['userId' => $data['userId'], 'select' => ['id']]); + $newUser = UserModel::getByUserId(['userId' => $data['userId']]); if (!Validator::intType()->notEmpty()->validate($newUser['id'])) { return $response->withStatus(500)->withJson(['errors' => 'User Creation Error']); }