diff --git a/apps/maarch_entreprise/Views/doctypes-administration.component.html b/apps/maarch_entreprise/Views/doctypes-administration.component.html index 8b0878a400ed0cd063074b0a20353d8e82422818..0df3324c7d61da7f20cd15e4e6259b35f03fca3c 100644 --- a/apps/maarch_entreprise/Views/doctypes-administration.component.html +++ b/apps/maarch_entreprise/Views/doctypes-administration.component.html @@ -18,10 +18,31 @@ <mat-divider></mat-divider> <mat-nav-list> <h3 mat-subheader>{{lang.actions}}</h3> - <a mat-list-item (click)="prepareDoctypeAdd()"> - <mat-icon color="primary" mat-list-icon class="fa fa-plus"></mat-icon> + <a mat-list-item (click)="prepareDoctypeAdd('firstLevel')"> + <mat-icon color="primary" mat-list-icon class="fa-stack fa-fw" style="margin-left:-3px; font-size:18px"> + <i class="fa fa-folder-o"></i> + <i class="fa fa-plus" style="position:absolute"></i> + </mat-icon> <p mat-line> - {{lang.add}} + {{lang.addFirstLevel}} + </p> + </a> + <a mat-list-item (click)="prepareDoctypeAdd('secondLevel')"> + <mat-icon color="primary" mat-list-icon class="fa-stack fa-fw" style="margin-left:-3px; font-size:18px"> + <i class="fa fa-folder-o"></i> + <i class="fa fa-plus" style="position:absolute"></i> + </mat-icon> + <p mat-line> + {{lang.addSecondLevel}} + </p> + </a> + <a mat-list-item (click)="prepareDoctypeAdd('doctype')"> + <mat-icon color="primary" mat-list-icon class="fa-stack fa-fw" style="margin-left:-3px; font-size:18px"> + <i class="fa fa-file-o"></i> + <i class="fa fa-plus" style="position:absolute"></i> + </mat-icon> + <p mat-line> + {{lang.addDoctype}} </p> </a> </mat-nav-list> @@ -47,7 +68,7 @@ <mat-nav-list> <mat-tab-group> - <mat-tab label="{{lang.firstLevelDoctype}}" *ngIf="currentFirstLevel || creationMode"> + <mat-tab label="{{lang.firstLevelDoctype}}" *ngIf="currentFirstLevel || creationMode=='firstLevel'"> <form class="form-horizontal" #firstLevelForm="ngForm" style="overflow:hidden;"> <div class="form-group" *ngIf="!creationMode"> <div class="col-sm-12"> @@ -93,7 +114,7 @@ </form> </mat-tab> - <mat-tab label="{{lang.secondLevelDoctype}}" *ngIf="currentSecondLevel || creationMode"> + <mat-tab label="{{lang.secondLevelDoctype}}" *ngIf="currentSecondLevel || creationMode=='secondeLevel'"> <form class="form-horizontal" #secondLevelForm="ngForm" style="overflow:hidden;"> <div class="form-group" *ngIf="!creationMode"> <div class="col-sm-12"> @@ -139,7 +160,7 @@ </form> </mat-tab> - <mat-tab label="{{lang.doctype}}" *ngIf="currentType || creationMode"> + <mat-tab label="{{lang.doctype}}" *ngIf="currentType || creationMode=='doctype'"> <form class="form-horizontal" #typeForm="ngForm" style="overflow:hidden;"> <div class="form-group" *ngIf="!creationMode"> <div class="col-sm-12"> diff --git a/apps/maarch_entreprise/js/angular/app/administration/doctypes-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/doctypes-administration.component.ts index 1e8d7bc878b790b9b54ce8ad01baf837e85eb446..3d49c973e9f2f96fad2573b34f80f103784f9892 100644 --- a/apps/maarch_entreprise/js/angular/app/administration/doctypes-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/doctypes-administration.component.ts @@ -34,7 +34,7 @@ export class DoctypesAdministrationComponent implements OnInit { models: any = false; loading: boolean = false; - creationMode: boolean = false; + creationMode: any = false; newSecondLevel: any = false; displayedColumns = ['label','use', 'mandatory', 'column']; @@ -335,10 +335,19 @@ export class DoctypesAdministrationComponent implements OnInit { } } - prepareDoctypeAdd() { - this.currentFirstLevel = {}; - this.currentSecondLevel = {}; - this.currentType = {}; + prepareDoctypeAdd(mode: any) { + this.currentFirstLevel = false; + this.currentSecondLevel = false; + this.currentType = false; + if(mode == 'firstLevel'){ + this.currentFirstLevel = {}; + } + if(mode == 'secondLevel'){ + this.currentSecondLevel = {}; + } + if(mode == 'doctype'){ + this.currentType = {}; + } $j('#jstree').jstree('deselect_all'); this.http.get(this.coreUrl + "rest/administration/doctypes/new") .subscribe((data: any) => { @@ -347,12 +356,14 @@ export class DoctypesAdministrationComponent implements OnInit { this.secondLevels = data['secondLevel']; this.processModes = data['processModes']; this.models = data['models']; - this.currentType.indexes = data['indexes']; - this.loadIndexesTable(); + if(mode == 'doctype'){ + this.currentType.indexes = data['indexes']; + this.loadIndexesTable(); + } }, (err) => { this.notify.error(err.error.errors); }); - this.creationMode = true; + this.creationMode = mode; } selectIndexesUse(e: any, index: any) { diff --git a/apps/maarch_entreprise/js/angular/lang/lang-en.ts b/apps/maarch_entreprise/js/angular/lang/lang-en.ts index 94400b5b4151be9db2235ca1440fdba60a9da4a0..bbddff6402acce76a8da11d7145d7233631404a1 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-en.ts +++ b/apps/maarch_entreprise/js/angular/lang/lang-en.ts @@ -379,6 +379,9 @@ export const LANG_EN = { 'quota' : 'Quota', 'actives' : 'Active(s)', 'inactives' : 'Inactive(s)', - 'quotaExceeded' : 'Quota exceeded' + 'quotaExceeded' : 'Quota exceeded', + "addFirstLevel" : "Add first level", + "addSecondLevel" : "Add second level", + "addDoctype" : "Add document type", }; diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts index c06abf6ebb6be7257705c0bbddce3784aaf49d06..44d96f9547b52bff26da5ab23f6ee6c1860a6349 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts +++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts @@ -404,5 +404,8 @@ export const LANG_FR = { 'quota' : 'Quota', 'actives' : 'Actif(s)', 'inactives' : 'Inactif(s)', - 'quotaExceeded' : 'Quota dépassé' + 'quotaExceeded' : 'Quota dépassé', + "addFirstLevel" : "Ajouter une chemise", + "addSecondLevel" : "Ajouter une sous-chemise", + "addDoctype" : "Ajouter un type de document", };