diff --git a/src/frontend/app/administration/administration-routing.module.ts b/src/frontend/app/administration/administration-routing.module.ts index 4fa90d373bfeccf7268090dd0848824d600b45e4..2543d4bcce06c75d1d541ce52983f2f6ff255394 100755 --- a/src/frontend/app/administration/administration-routing.module.ts +++ b/src/frontend/app/administration/administration-routing.module.ts @@ -1,51 +1,53 @@ -import { NgModule } from '@angular/core'; +import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { AdministrationComponent } from './home/administration.component'; -import { UsersAdministrationComponent } from './user/users-administration.component'; -import { UserAdministrationComponent } from './user/user-administration.component'; -import { GroupsAdministrationComponent } from './group/groups-administration.component'; -import { GroupAdministrationComponent } from './group/group-administration.component'; -import { BasketsAdministrationComponent } from './basket/baskets-administration.component'; -import { BasketAdministrationComponent } from './basket/basket-administration.component'; -import { DoctypesAdministrationComponent } from './doctype/doctypes-administration.component'; -import { DiffusionModelsAdministrationComponent } from './diffusionModel/diffusionModels-administration.component'; -import { DiffusionModelAdministrationComponent } from './diffusionModel/diffusionModel-administration.component'; -import { EntitiesAdministrationComponent } from './entity/entities-administration.component'; -import { StatusesAdministrationComponent } from './status/statuses-administration.component'; -import { StatusAdministrationComponent } from './status/status-administration.component'; -import { ActionsAdministrationComponent } from './action/actions-administration.component'; -import { ActionAdministrationComponent } from './action/action-administration.component'; -import { ParameterAdministrationComponent } from './parameter/parameter-administration.component'; -import { ParametersAdministrationComponent } from './parameter/parameters-administration.component'; -import { PrioritiesAdministrationComponent } from './priority/priorities-administration.component'; -import { PriorityAdministrationComponent } from './priority/priority-administration.component'; -import { NotificationsAdministrationComponent } from './notification/notifications-administration.component'; -import { NotificationAdministrationComponent } from './notification/notification-administration.component'; -import { HistoryAdministrationComponent } from './history/history-administration.component'; -import { HistoryBatchAdministrationComponent } from './history/batch/history-batch-administration.component'; -import { UpdateStatusAdministrationComponent } from './updateStatus/update-status-administration.component'; -import { ContactsGroupsAdministrationComponent } from './contact/group/contacts-groups-administration.component'; -import { ContactsGroupAdministrationComponent } from './contact/group/contacts-group-administration.component'; -import { ContactsParametersAdministrationComponent } from './contact/parameter/contacts-parameters-administration.component'; -import { VersionsUpdateAdministrationComponent } from './versionUpdate/versions-update-administration.component'; -import { DocserversAdministrationComponent } from './docserver/docservers-administration.component'; -import { DocserverAdministrationComponent } from './docserver/docserver-administration.component'; -import { TemplatesAdministrationComponent } from './template/templates-administration.component'; -import { TemplateAdministrationComponent } from './template/template-administration.component'; -import { SecuritiesAdministrationComponent } from './security/securities-administration.component'; -import { SendmailAdministrationComponent } from './sendmail/sendmail-administration.component'; -import { ShippingsAdministrationComponent } from './shipping/shippings-administration.component'; -import { ShippingAdministrationComponent } from './shipping/shipping-administration.component'; -import { CustomFieldsAdministrationComponent } from './customField/custom-fields-administration.component'; -import { AppGuard } from '../../service/app.guard'; -import { IndexingModelAdministrationComponent } from './indexingModel/indexing-model-administration.component'; -import { IndexingModelsAdministrationComponent } from './indexingModel/indexing-models-administration.component'; -import { ContactsListAdministrationComponent } from './contact/list/contacts-list-administration.component'; +import { AdministrationComponent } from './home/administration.component'; +import { UsersAdministrationComponent } from './user/users-administration.component'; +import { UserAdministrationComponent } from './user/user-administration.component'; +import { GroupsAdministrationComponent } from './group/groups-administration.component'; +import { GroupAdministrationComponent } from './group/group-administration.component'; +import { BasketsAdministrationComponent } from './basket/baskets-administration.component'; +import { BasketAdministrationComponent } from './basket/basket-administration.component'; +import { DoctypesAdministrationComponent } from './doctype/doctypes-administration.component'; +import { DiffusionModelsAdministrationComponent } from './diffusionModel/diffusionModels-administration.component'; +import { DiffusionModelAdministrationComponent } from './diffusionModel/diffusionModel-administration.component'; +import { EntitiesAdministrationComponent } from './entity/entities-administration.component'; +import { StatusesAdministrationComponent } from './status/statuses-administration.component'; +import { StatusAdministrationComponent } from './status/status-administration.component'; +import { ActionsAdministrationComponent } from './action/actions-administration.component'; +import { ActionAdministrationComponent } from './action/action-administration.component'; +import { ParameterAdministrationComponent } from './parameter/parameter-administration.component'; +import { ParametersAdministrationComponent } from './parameter/parameters-administration.component'; +import { PrioritiesAdministrationComponent } from './priority/priorities-administration.component'; +import { PriorityAdministrationComponent } from './priority/priority-administration.component'; +import { NotificationsAdministrationComponent } from './notification/notifications-administration.component'; +import { NotificationAdministrationComponent } from './notification/notification-administration.component'; +import { HistoryAdministrationComponent } from './history/history-administration.component'; +import { HistoryBatchAdministrationComponent } from './history/batch/history-batch-administration.component'; +import { UpdateStatusAdministrationComponent } from './updateStatus/update-status-administration.component'; +import { ContactsGroupsAdministrationComponent } from './contact/group/contacts-groups-administration.component'; +import { ContactsGroupAdministrationComponent } from './contact/group/contacts-group-administration.component'; +import { ContactsParametersAdministrationComponent } from './contact/parameter/contacts-parameters-administration.component'; +import { VersionsUpdateAdministrationComponent } from './versionUpdate/versions-update-administration.component'; +import { DocserversAdministrationComponent } from './docserver/docservers-administration.component'; +import { DocserverAdministrationComponent } from './docserver/docserver-administration.component'; +import { TemplatesAdministrationComponent } from './template/templates-administration.component'; +import { TemplateAdministrationComponent } from './template/template-administration.component'; +import { SecuritiesAdministrationComponent } from './security/securities-administration.component'; +import { SendmailAdministrationComponent } from './sendmail/sendmail-administration.component'; +import { ShippingsAdministrationComponent } from './shipping/shippings-administration.component'; +import { ShippingAdministrationComponent } from './shipping/shipping-administration.component'; +import { CustomFieldsAdministrationComponent } from './customField/custom-fields-administration.component'; +import { AppGuard } from '../../service/app.guard'; +import { IndexingModelAdministrationComponent } from './indexingModel/indexing-model-administration.component'; +import { IndexingModelsAdministrationComponent } from './indexingModel/indexing-models-administration.component'; +import { ContactsListAdministrationComponent } from './contact/list/contacts-list-administration.component'; import { ContactsCustomFieldsAdministrationComponent } from './contact/customField/contacts-custom-fields-administration.component'; import { ContactsPageAdministrationComponent } from './contact/page/contacts-page-administration.component'; import { TagsAdministrationComponent } from './tag/tags-administration.component'; import { TagAdministrationComponent } from './tag/tag-administration.component'; +import { AlfrescoAdministrationComponent } from './alfresco/alfresco-administration.component'; +import { AlfrescoListAdministrationComponent } from './alfresco/alfresco-list-administration.component'; @NgModule({ imports: [ @@ -71,9 +73,9 @@ import { TagAdministrationComponent } from './tag/tag-administration.component'; { path: 'administration/parameters', canActivate: [AppGuard], component: ParametersAdministrationComponent }, { path: 'administration/parameters/new', canActivate: [AppGuard], component: ParameterAdministrationComponent }, { path: 'administration/parameters/:id', canActivate: [AppGuard], component: ParameterAdministrationComponent }, - { path: 'administration/priorities', canActivate: [AppGuard], component : PrioritiesAdministrationComponent }, - { path: 'administration/priorities/new', canActivate: [AppGuard], component : PriorityAdministrationComponent }, - { path: 'administration/priorities/:id', canActivate: [AppGuard], component : PriorityAdministrationComponent }, + { path: 'administration/priorities', canActivate: [AppGuard], component: PrioritiesAdministrationComponent }, + { path: 'administration/priorities/new', canActivate: [AppGuard], component: PriorityAdministrationComponent }, + { path: 'administration/priorities/:id', canActivate: [AppGuard], component: PriorityAdministrationComponent }, { path: 'administration/actions', canActivate: [AppGuard], component: ActionsAdministrationComponent }, { path: 'administration/actions/new', canActivate: [AppGuard], component: ActionAdministrationComponent }, { path: 'administration/actions/:id', canActivate: [AppGuard], component: ActionAdministrationComponent }, @@ -110,10 +112,13 @@ import { TagAdministrationComponent } from './tag/tag-administration.component'; { path: 'administration/tags', canActivate: [AppGuard], component: TagsAdministrationComponent }, { path: 'administration/tags/new', canActivate: [AppGuard], component: TagAdministrationComponent }, { path: 'administration/tags/:id', canActivate: [AppGuard], component: TagAdministrationComponent }, + { path: 'administration/alfresco', canActivate: [AppGuard], component: AlfrescoListAdministrationComponent }, + { path: 'administration/alfresco/new', canActivate: [AppGuard], component: AlfrescoAdministrationComponent }, + { path: 'administration/alfresco/:id', canActivate: [AppGuard], component: AlfrescoAdministrationComponent }, ]), ], exports: [ RouterModule ] }) -export class AdministrationRoutingModule {} +export class AdministrationRoutingModule { } diff --git a/src/frontend/app/administration/administration.module.ts b/src/frontend/app/administration/administration.module.ts index 5821c37ed7c30cf97f784a581ae62ac25de1f2af..a487f663c3a0df8fcb1f359ecb271890c684b4dc 100755 --- a/src/frontend/app/administration/administration.module.ts +++ b/src/frontend/app/administration/administration.module.ts @@ -53,6 +53,8 @@ import { ContactsPageAdministrationComponent } from './contact/page/contacts-pag import { TagsAdministrationComponent } from './tag/tags-administration.component'; import { TagAdministrationComponent } from './tag/tag-administration.component'; import { TemplateFileEditorModalComponent } from './template/templateFileEditorModal/template-file-editor-modal.component'; +import { AlfrescoListAdministrationComponent } from './alfresco/alfresco-list-administration.component'; +import { AlfrescoAdministrationComponent } from './alfresco/alfresco-administration.component'; @@ -119,7 +121,9 @@ import { TemplateFileEditorModalComponent } from './template/templateFileEditorM ContactsPageAdministrationComponent, TagsAdministrationComponent, TagAdministrationComponent, - TemplateFileEditorModalComponent + TemplateFileEditorModalComponent, + AlfrescoAdministrationComponent, + AlfrescoListAdministrationComponent ], entryComponents: [ UsersAdministrationRedirectModalComponent, diff --git a/src/frontend/app/administration/alfresco/alfresco-administration.component.html b/src/frontend/app/administration/alfresco/alfresco-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..f9b420f29043f971215f4921478ab24246242a25 --- /dev/null +++ b/src/frontend/app/administration/alfresco/alfresco-administration.component.html @@ -0,0 +1,98 @@ +<mat-sidenav-container autosize class="maarch-container"> + <mat-sidenav-content> + <div class="bg-head"> + <div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()"> + <div class="bg-head-title-label"> + <header-left></header-left> + </div> + <div class="bg-head-title-tool"> + <header-right></header-right> + </div> + </div> + <div class="bg-head-content" [class.fullContainer]="appService.getViewMode()"> + </div> + </div> + <div class="container" [class.fullContainer]="appService.getViewMode()"> + <div class="container-content"> + <div *ngIf="loading" style="display:flex;height:100%;"> + <mat-spinner style="margin:auto;"></mat-spinner> + </div> + <mat-card *ngIf="!loading" class="card-app-content"> + <form (ngSubmit)="onSubmit()" #alfrescoForm="ngForm"> + <mat-form-field> + <input matInput [(ngModel)]="alfresco.label" required name="label" id="label" + title="{{lang.label}}" type="text" placeholder="{{lang.label}}" maxlength="64"> + </mat-form-field> + <div class="form-group" style="flex-direction: row; flex-wrap: wrap;"> + <div class="formType ratio-2 col-sm-12"> + <div class="formType-title"> + {{lang.alfrescoAccount}} + </div> + <div style="width: 100%;"> + <mat-form-field> + <input matInput [(ngModel)]="alfresco.account.id" required name="accountId" + id="accountId" title="{{lang.id}}" type="text" placeholder="{{lang.id}}"> + </mat-form-field> + <mat-form-field> + <input matInput [(ngModel)]="alfresco.account.password" [required]="creationMode" name="password" + id="password" [title]="creationMode ? lang.password : lang.changePassword" type="password" + [placeholder]="creationMode ? lang.password : lang.changePassword"> + </mat-form-field> + </div> + </div> + <div class="formType ratio-1 col-sm-12"> + <div class="formType-title"> + {{lang.rootFolder}} + </div> + <div *ngIf="alfresco.account.id !== '' && alfresco.account.password !== '' && functionsService.empty(alfresco.rootFolder) && !alfrescoTreeLoaded" + (click)="getAlfrescoFolders()" + style="text-align: center;font-weight: bold;opacity: 0.5;width: 100%;"> + <div>{{lang.showTreeMsg}}</div> + <button mat-icon-button> + <mat-icon class="fas fa-sync-alt" style="font-size: 25px;"></mat-icon> + </button> + </div> + <div *ngIf="(alfresco.account.id === '' || alfresco.account.password === '') && functionsService.empty(alfresco.rootFolder)" + style="text-align: center;font-weight: bold;opacity: 0.5;"> + <div>{{lang.mustFillAccountMsg}}</div> + </div> + <div *ngIf="alfrescoTreeLoaded && functionsService.empty(alfresco.rootFolder)"> + <div id="jstreeAlfresco"></div> + </div> + <div *ngIf="!functionsService.empty(alfresco.rootFolder)" style="width: 100%;"> + <mat-form-field> + <input matInput [(ngModel)]="alfresco.rootFolder" required name="rootFolder" + id="rootFolder" title="Dépôt racine" type="text" placeholder="Dépôt racine" + disabled> + <button mat-icon-button matSuffix color="warn" + (click)="alfresco.rootFolder=null"> + <mat-icon class="fa fa-trash"></mat-icon> + </button> + </mat-form-field> + </div> + </div> + </div> + <div class="col-sm-12 text-center" style="padding:10px;"> + <button mat-raised-button type="submit" color="primary" + [disabled]="!alfrescoForm.valid">{{lang.validate}}</button> + </div> + </form> + </mat-card> + </div> + </div> + </mat-sidenav-content> + + <mat-sidenav #snav2 [mode]="appService.getViewMode() ? 'over' : 'side'" [fixedInViewport]="appService.getViewMode()" + fixedTopGap="56" position='end' [opened]="!appService.getViewMode()" style="overflow-x:hidden;width:400px;"> + <mat-list> + <h3 mat-subheader>{{lang.chooseEntityAssociationAccount}}</h3> + <div style="padding:10px;"> + <mat-form-field> + <input matInput id="jstree_search" name="jstree_search" type="text" + placeholder="{{lang.searchEntities}}"> + </mat-form-field> + <div id="jstree"></div> + </div> + </mat-list> + </mat-sidenav> +</mat-sidenav-container> \ No newline at end of file diff --git a/src/frontend/app/administration/alfresco/alfresco-administration.component.scss b/src/frontend/app/administration/alfresco/alfresco-administration.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..07f7b34451c65cb648fc69afe580a1d8b88f683a --- /dev/null +++ b/src/frontend/app/administration/alfresco/alfresco-administration.component.scss @@ -0,0 +1,71 @@ +@import '../../../css/vars.scss'; + +.form-group { + display: flex; +} + +.formType { + align-items: center; + display: flex; + margin: 10px; + border-radius: 4px; + border: solid 1px #ccc; + position: relative; + padding: 10px; + + &-title { + white-space: pre; + overflow: hidden; + max-width: 85%; + text-overflow: ellipsis; + z-index: 1; + font-size: 10px; + font-weight: bold; + background: white; + position: absolute; + top: -7px; + left: 10px; + padding: 0px; + margin: 0px; + color: #135f7f; + } + + + ::ng-deep.mat-slide-toggle-label { + color: #666; + font-weight: bold; + } + + ::ng-deep.mat-radio-button,::ng-deep.mat-slide-toggle { + opacity: 0.5; + color: #666; + user-select: none; + } + + ::ng-deep.mat-radio-checked,::ng-deep.mat-checked { + opacity: 1; + color: $primary; + } + + + ::ng-deep.mat-checked { + .mat-slide-toggle-label { + color: $primary; + } + } + + ::ng-deep.mat-form-field-suffix { + color: $secondary; + font-size: 15px; + top: 0; + } +} + +.ratio-1 { + flex: 1; +} + +.ratio-2 { + flex: 1; + align-items: baseline; +} \ No newline at end of file diff --git a/src/frontend/app/administration/alfresco/alfresco-administration.component.ts b/src/frontend/app/administration/alfresco/alfresco-administration.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..7390831d3d8dc4c180db406453c020c085074f4d --- /dev/null +++ b/src/frontend/app/administration/alfresco/alfresco-administration.component.ts @@ -0,0 +1,268 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { LANG } from '../../translate.component'; +import { AppService } from '../../../service/app.service'; +import { HeaderService } from '../../../service/header.service'; +import { NotificationService } from '../../notification.service'; +import { MatSidenav } from '@angular/material/sidenav'; +import { FunctionsService } from '../../../service/functions.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { tap } from 'rxjs/internal/operators/tap'; +import { catchError } from 'rxjs/internal/operators/catchError'; +import { of } from 'rxjs/internal/observable/of'; + +@Component({ + selector: 'app-alfresco', + templateUrl: './alfresco-administration.component.html', + styleUrls: ['./alfresco-administration.component.scss'] +}) +export class AlfrescoAdministrationComponent implements OnInit { + + @ViewChild('snav2', { static: true }) public sidenavRight: MatSidenav; + + lang: any = LANG; + loading: boolean = false; + creationMode: boolean = true; + + entities: any[] = []; + + alfresco: any = { + id: 0, + label: '', + account: { + id: '', + password: '', + }, + rootFolder: null, + linkedEntities: [] + }; + + alfrescoTreeLoaded: boolean = false; + + constructor( + public http: HttpClient, + private route: ActivatedRoute, + private router: Router, + private notify: NotificationService, + private headerService: HeaderService, + public appService: AppService, + public functionsService: FunctionsService + ) { } + + ngOnInit() { + this.loading = false; + this.route.params.subscribe(async params => { + if (typeof params['id'] === 'undefined') { + this.headerService.setHeader(this.lang.alfrescoCreation); + this.creationMode = true; + } else { + this.headerService.setHeader(this.lang.alfrescoModification); + + this.alfresco.id = params['id']; + this.creationMode = false; + } + await this.getEntities(); + await this.initAccount(); + this.loading = false; + }); + } + + onSubmit() { + if (this.creationMode) { + this.createAccount(); + } else { + this.updateAccount(); + } + } + + createAccount() { + this.http.post('../rest/alfresco/accounts', this.formatData()).pipe( + tap(() => { + this.notify.success(this.lang.accountAdded); + this.router.navigate(['/administration/alfresco']); + }), + catchError((err: any) => { + this.notify.handleSoftErrors(err); + return of(false); + }) + ).subscribe(); + } + + updateAccount() { + this.http.put(`../rest/alfresco/accounts/${this.alfresco.id}`, this.formatData()).pipe( + tap(() => { + this.notify.success(this.lang.accountUpdated); + this.router.navigate(['/administration/alfresco']); + }), + catchError((err: any) => { + this.notify.handleSoftErrors(err); + return of(false); + }) + ).subscribe(); + } + + formatData() { + const alfresco: any = { + label: this.alfresco.label, + login: this.alfresco.account.id, + nodeId: this.alfresco.rootFolder, + entities: $('#jstree').jstree('get_checked', null, true) + }; + + if (!this.functionsService.empty(this.alfresco.account.password)) { + alfresco.password = this.alfresco.account.password; + } + + return alfresco; + } + + getEntities() { + return new Promise((resolve, reject) => { + this.http.get(`../rest/administration/shippings/new`).pipe( + tap((data: any) => { + this.entities = data['entities']; + resolve(true); + }), + catchError((err: any) => { + this.notify.handleSoftErrors(err); + return of(false); + }) + ).subscribe(); + }); + } + + initAccount() { + return new Promise((resolve, reject) => { + if (this.creationMode) { + this.http.get('../rest/administration/shippings/new').pipe( + tap((data: any) => { + this.entities = data['entities']; + + // TO DO : WAIT BACK + const allowedEntities = ['12', '19', '16']; + + this.entities.forEach(element => { + if (allowedEntities.indexOf(element.id) === -1) { + element.state.disabled = true; + } + }); + + setTimeout(() => { + this.initEntitiesTree(this.entities); + }, 0); + resolve(true); + }), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + + } else { + this.http.get(`../rest/alfresco/accounts/${this.alfresco.id}`).pipe( + tap((data: any) => { + this.alfresco = { + id: data.id, + label: data.label, + account: { + id: data.login + }, + rootFolder: data.nodeId, + linkedEntities: data.entities + }; + + // TO DO : WAIT BACK + const allowedEntities = ['12', '19', '16']; + + this.entities.forEach(element => { + element.state.disabled = false; + /*if (allowedEntities.indexOf(element.id) === -1) { + element.state.disabled = true; + }*/ + console.log(this.alfresco.linkedEntities[0]); + console.log(element.id); + + if (this.alfresco.linkedEntities.indexOf(+element.id) > -1) { + element.state.selected = true; + } + }); + setTimeout(() => { + this.initEntitiesTree(this.entities); + }, 0); + resolve(true); + }), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + } + + }); + } + + initEntitiesTree(entities: any) { + $('#jstree') + .jstree({ + 'checkbox': { + 'three_state': false // no cascade selection + }, + 'core': { + force_text: true, + 'themes': { + 'name': 'proton', + 'responsive': true + }, + 'data': entities + }, + 'plugins': ['checkbox', 'search', 'sort'] + }); + let to: any = false; + $('#jstree_search').keyup(function () { + if (to) { clearTimeout(to); } + to = setTimeout(function () { + const v: any = $('#jstree_search').val(); + $('#jstree').jstree(true).search(v); + }, 250); + }); + } + + getAlfrescoFolders() { + + // TODO : ROUTE GET FOLDERS ARBO + const folders: any = [{ 'id': '1', 'entity_id': 'VILLE', 'entity_label': 'Ville de Maarch-les-bains', 'parent_id': null, 'parent': '#', 'icon': 'fa fa-building', 'allowed': true, 'state': { 'opened': true }, 'text': 'Ville de Maarch-les-bains' }, { 'id': '2', 'entity_id': 'CAB', 'entity_label': 'Cabinet du Maire', 'parent_id': 1, 'parent': '1', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Cabinet du Maire' }, { 'id': '3', 'entity_id': 'DGS', 'entity_label': 'Direction Générale des Services', 'parent_id': 1, 'parent': '1', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Direction Générale des Services' }, { 'id': '4', 'entity_id': 'DGA', 'entity_label': 'Direction Générale Adjointe', 'parent_id': 3, 'parent': '3', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Direction Générale Adjointe' }, { 'id': '5', 'entity_id': 'PCU', 'entity_label': 'Pôle Culturel', 'parent_id': 4, 'parent': '4', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Pôle Culturel' }, { 'id': '6', 'entity_id': 'PJS', 'entity_label': 'Pôle Jeunesse et Sport', 'parent_id': 4, 'parent': '4', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Pôle Jeunesse et Sport' }, { 'id': '7', 'entity_id': 'PE', 'entity_label': 'Petite enfance', 'parent_id': 6, 'parent': '6', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Petite enfance' }, { 'id': '8', 'entity_id': 'SP', 'entity_label': 'Sport', 'parent_id': 6, 'parent': '6', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Sport' }, { 'id': '9', 'entity_id': 'PSO', 'entity_label': 'Pôle Social', 'parent_id': 4, 'parent': '4', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Pôle Social' }, { 'id': '10', 'entity_id': 'PTE', 'entity_label': 'Pôle Technique', 'parent_id': 4, 'parent': '4', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Pôle Technique' }, { 'id': '11', 'entity_id': 'DRH', 'entity_label': 'Direction des Ressources Humaines', 'parent_id': 3, 'parent': '3', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Direction des Ressources Humaines' }, { 'id': '12', 'entity_id': 'DSG', 'entity_label': 'Secrétariat Général', 'parent_id': 3, 'parent': '3', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Secrétariat Général' }, { 'id': '14', 'entity_id': 'COR', 'entity_label': 'Correspondants Archive', 'parent_id': 13, 'parent': '13', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Correspondants Archive' }, { 'id': '13', 'entity_id': 'COU', 'entity_label': 'Service Courrier', 'parent_id': 12, 'parent': '12', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Service Courrier' }, { 'id': '15', 'entity_id': 'PSF', 'entity_label': 'Pôle des Services Fonctionnels', 'parent_id': 12, 'parent': '12', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Pôle des Services Fonctionnels' }, { 'id': '16', 'entity_id': 'DSI', 'entity_label': 'Direction des Systèmes d\'Information', 'parent_id': 3, 'parent': '3', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Direction des Systèmes d\'Information' }, { 'id': '17', 'entity_id': 'FIN', 'entity_label': 'Direction des Finances', 'parent_id': 3, 'parent': '3', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Direction des Finances' }, { 'id': '18', 'entity_id': 'PJU', 'entity_label': 'Pôle Juridique', 'parent_id': 17, 'parent': '17', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Pôle Juridique' }, { 'id': '19', 'entity_id': 'ELUS', 'entity_label': 'Ensemble des élus', 'parent_id': 1, 'parent': '1', 'icon': 'fa fa-sitemap', 'allowed': true, 'state': { 'opened': true }, 'text': 'Ensemble des élus' }, { 'id': '20', 'entity_id': 'CCAS', 'entity_label': 'Centre Communal d\'Action Sociale', 'parent_id': null, 'parent': '#', 'icon': 'fa fa-building', 'allowed': true, 'state': { 'opened': true }, 'text': 'Centre Communal d\'Action Sociale' }]; + + this.alfrescoTreeLoaded = true; + setTimeout(() => { + this.initAlfrescoTree(folders); + }, 0); + + } + + initAlfrescoTree(folders: any) { + $('#jstreeAlfresco') + .on('select_node.jstree', (e: any, data: any) => { + this.alfresco.rootFolder = data.node.id; + this.alfrescoTreeLoaded = false; + }).on('deselect_node.jstree', (e: any, data: any) => { + // this.shipping.entities = data.selected; + }) + .jstree({ + 'checkbox': { + 'deselect_all': true, + 'three_state': false // no cascade selection + }, + 'core': { + force_text: true, + 'themes': { + 'name': 'proton', + 'responsive': true + }, + 'multiple': false, + 'data': folders + }, + 'plugins': ['checkbox', 'search', 'sort'] + }); + } + +} diff --git a/src/frontend/app/administration/alfresco/alfresco-list-administration.component.html b/src/frontend/app/administration/alfresco/alfresco-list-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..535e69a3097c33ebb3b51a7348be9e916bd7e20f --- /dev/null +++ b/src/frontend/app/administration/alfresco/alfresco-list-administration.component.html @@ -0,0 +1,77 @@ +<mat-sidenav-container autosize class="maarch-container"> + <ng-template #adminMenuTemplate> + <mat-nav-list> + <h3 mat-subheader>{{lang.actions}}</h3> + <a mat-list-item routerLink="/administration/alfresco/new"> + <mat-icon color="primary" mat-list-icon class="fa fa-plus"></mat-icon> + <p mat-line> + {{lang.add}} + </p> + </a> + </mat-nav-list> + </ng-template> + <mat-sidenav-content> + <div class="bg-head"> + <div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()"> + <div class="bg-head-title-label"> + <header-left></header-left> + </div> + <div class="bg-head-title-tool"> + <header-right></header-right> + </div> + </div> + <div class="bg-head-content" [class.fullContainer]="appService.getViewMode()"> + </div> + </div> + <div class="container" [class.fullContainer]="appService.getViewMode()"> + <div class="container-content"> + <div *ngIf="loading" style="display:flex;height:100%;"> + <mat-spinner style="margin:auto;"></mat-spinner> + </div> + <mat-card *ngIf="!loading" class="card-app-content"> + <div class="row"> + <div class="col-md-6 col-xs-6"> + <mat-form-field> + <input matInput (keyup)="applyFilter($event.target.value)" + placeholder="{{lang.filterBy}}"> + </mat-form-field> + </div> + <div class="col-md-6 col-xs-6"> + <mat-paginator #paginator [length]="100" [hidePageSize]="true" [pageSize]="10"> + </mat-paginator> + </div> + </div> + <mat-table #table [dataSource]="dataSource" matSort matSortActive="id" matSortDirection="asc"> + <ng-container matColumnDef="label"> + <mat-header-cell *matHeaderCellDef mat-sort-header + [class.hide-for-mobile]="appService.getViewMode()">{{lang.label}}</mat-header-cell> + <mat-cell *matCellDef="let element" [class.hide-for-mobile]="appService.getViewMode()"> + {{element.label}} </mat-cell> + </ng-container> + <ng-container matColumnDef="entitiesLabel"> + <mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.linkedEntities}}</mat-header-cell> + <mat-cell *matCellDef="let element"> + {{element.entitiesLabel}} </mat-cell> + </ng-container> + <ng-container matColumnDef="actions"> + <mat-header-cell *matHeaderCellDef></mat-header-cell> + <mat-cell *matCellDef="let element" style="justify-content: flex-end;"> + <button mat-icon-button color="warn" matTooltip="{{lang.delete}}" + (click)="$event.stopPropagation();deleteAccount(element.id)"> + <mat-icon class="fa fa-trash-alt fa-2x" aria-hidden="true"></mat-icon> + </button> + </mat-cell> + </ng-container> + <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> + <mat-row *matRowDef="let row; columns: displayedColumns;" + routerLink="/administration/alfresco/{{row.id}}" style="cursor:pointer;" + matTooltip="{{lang.view}}"></mat-row> + </mat-table> + <div class="mat-paginator" + style="min-height:48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;"> + {{accounts.length}} {{lang.accounts}}</div> + </mat-card> + </div> + </div> + </mat-sidenav-content> +</mat-sidenav-container> \ No newline at end of file diff --git a/src/frontend/app/administration/alfresco/alfresco-list-administration.component.ts b/src/frontend/app/administration/alfresco/alfresco-list-administration.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..60681840308ab25407bd79d6976465daaa650a57 --- /dev/null +++ b/src/frontend/app/administration/alfresco/alfresco-list-administration.component.ts @@ -0,0 +1,101 @@ +import { Component, OnInit, ViewChild, TemplateRef, ViewContainerRef } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { LANG } from '../../translate.component'; +import { NotificationService } from '../../notification.service'; +import { HeaderService } from '../../../service/header.service'; +import { MatPaginator } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; +import { MatTableDataSource } from '@angular/material/table'; +import { AppService } from '../../../service/app.service'; +import { FunctionsService } from '../../../service/functions.service'; +import { tap } from 'rxjs/internal/operators/tap'; +import { catchError } from 'rxjs/internal/operators/catchError'; +import { of } from 'rxjs/internal/observable/of'; +import { ConfirmComponent } from '../../../plugins/modal/confirm.component'; +import { MatDialogRef } from '@angular/material/dialog/dialog-ref'; +import { filter } from 'rxjs/internal/operators/filter'; +import { exhaustMap } from 'rxjs/internal/operators/exhaustMap'; +import { MatDialog } from '@angular/material/dialog'; + +@Component({ + templateUrl: 'alfresco-list-administration.component.html', + providers: [AppService] +}) +export class AlfrescoListAdministrationComponent implements OnInit { + + @ViewChild('adminMenuTemplate', { static: true }) adminMenuTemplate: TemplateRef<any>; + + lang: any = LANG; + + accounts: any[] = []; + + loading: boolean = false; + + displayedColumns = ['label', 'entitiesLabel', 'actions']; + dataSource: any; + dialogRef: MatDialogRef<any>; + + @ViewChild(MatPaginator, { static: false }) paginator: MatPaginator; + @ViewChild(MatSort, { static: false }) sort: MatSort; + + + constructor( + public http: HttpClient, + private notify: NotificationService, + private headerService: HeaderService, + public appService: AppService, + private dialog: MatDialog, + public functions: FunctionsService, + private viewContainerRef: ViewContainerRef + ) { } + + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches + this.dataSource.filter = filterValue; + this.dataSource.filterPredicate = (template: any, filter: string) => { + return this.functions.filterUnSensitive(template, filter, ['label', 'entitiesLabel']); + }; + } + + ngOnInit(): void { + this.headerService.setHeader(this.lang.administration + ' ' + this.lang.alfresco); + + this.headerService.injectInSideBarLeft(this.adminMenuTemplate, this.viewContainerRef, 'adminMenu'); + + this.loading = true; + + this.http.get('../rest/alfresco/accounts') + .subscribe((data: any) => { + this.accounts = data.accounts; + + setTimeout(() => { + this.dataSource = new MatTableDataSource(this.accounts); + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + }, 0); + this.loading = false; + }); + } + + deleteAccount(id: number) { + + this.dialogRef = this.dialog.open(ConfirmComponent, { panelClass: 'maarch-modal', autoFocus: false, disableClose: true, data: { title: this.lang.delete, msg: this.lang.confirmAction } }); + + this.dialogRef.afterClosed().pipe( + filter((data: string) => data === 'ok'), + exhaustMap(() => this.http.delete('../rest/alfresco/accounts/' + id)), + tap(() => { + this.accounts = this.accounts.filter((account: any) => account.id !== id); + this.dataSource = new MatTableDataSource(this.accounts); + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + this.notify.success(this.lang.accountDeleted); + }), + catchError((err: any) => { + this.notify.handleSoftErrors(err); + return of(false); + }) + ).subscribe(); + } +} diff --git a/src/frontend/app/app-routing.module.ts b/src/frontend/app/app-routing.module.ts index badf89186ad667e052507d15e045f68509214e18..7c3c7c6a34db338bd9240c5b4c0c0041c23e82bb 100755 --- a/src/frontend/app/app-routing.module.ts +++ b/src/frontend/app/app-routing.module.ts @@ -41,7 +41,7 @@ import { DocumentViewerPageComponent } from './viewer/page/document-viewer-page. { path: 'followed', canActivate: [AppGuard], component: FollowedDocumentListComponent }, { path: 'resources/:detailResId', canActivate: [AppGuard], canDeactivate: [AfterProcessGuard], component: ProcessComponent }, { path: 'resources/:resId/content', canActivate: [AppGuard], component: DocumentViewerPageComponent }, - { path: '**', redirectTo: 'login', pathMatch: 'full' }, + { path: '**', redirectTo: 'home', pathMatch: 'full' }, ], { useHash: true }), ], exports: [ diff --git a/src/frontend/app/app.component.ts b/src/frontend/app/app.component.ts index 047c75dc8f63c4a91bd3604c38460a43eb4cd2e4..013573253a0214fd0d1873045e1ba9f6fe430949 100755 --- a/src/frontend/app/app.component.ts +++ b/src/frontend/app/app.component.ts @@ -45,6 +45,7 @@ export class AppComponent implements OnInit { iconReg.addSvgIcon('maarchLogoWhite', sanitizer.bypassSecurityTrustResourceUrl('assets/logo_only_white.svg')); iconReg.addSvgIcon('maarchLogoWhiteFull', sanitizer.bypassSecurityTrustResourceUrl('assets/logo_white.svg')); iconReg.addSvgIcon('maarchBox', sanitizer.bypassSecurityTrustResourceUrl('assets/maarch_box.svg')); + iconReg.addSvgIcon('alfresco', sanitizer.bypassSecurityTrustResourceUrl('assets/alfresco.svg')); } diff --git a/src/frontend/assets/alfresco.svg b/src/frontend/assets/alfresco.svg new file mode 100644 index 0000000000000000000000000000000000000000..70ba03aa396d91a8f6704258d093a9a98ce63737 --- /dev/null +++ b/src/frontend/assets/alfresco.svg @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="2719" + height="2690" + viewBox="0 0 278.4256 275.48192" + preserveAspectRatio="xMidYMid" + version="1.1" + id="svg24" + sodipodi:docname="alfresco.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)"> + <metadata + id="metadata30"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs28" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1031" + id="namedview26" + showgrid="false" + inkscape:pagecheckerboard="true" + inkscape:snap-text-baseline="false" + inkscape:zoom="0.26807582" + inkscape:cx="1097.0823" + inkscape:cy="1189.085" + inkscape:window-x="0" + inkscape:window-y="25" + inkscape:window-maximized="1" + inkscape:current-layer="svg24" /> + <path + d="m 99.8388,177.12458 32.3,-32.302 -48.504,0.002 h -0.116 c -26.878,0 -48.667,21.79 -48.667,48.665 0,26.88 21.787,48.667 48.665,48.667 2.041,0 4.05,-0.14 6.025,-0.385 -10.622,-20.925 -7.198,-47.154 10.297,-64.647" + id="path2" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 139.2178,193.42958 v -45.678 l -34.295,34.3 -0.083,0.08 c -19.006,19.006 -19.006,49.82 0,68.826 19.006,19.006 49.82,19.006 68.825,0 1.443,-1.443 2.738,-2.975 3.963,-4.541 -22.297,-7.294 -38.408,-28.252 -38.41,-52.987" + id="path4" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 178.5958,177.11458 -32.3,-32.3 v 48.62 c 0,26.88 21.79,48.666 48.667,48.666 26.878,0 48.667,-21.787 48.667,-48.665 0,-2.041 -0.14,-4.05 -0.385,-6.025 -20.925,10.625 -47.154,7.199 -64.65,-10.296" + id="path6" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 252.4278,103.28958 c -1.442,-1.442 -2.972,-2.738 -4.539,-3.962989 -7.293,22.295989 -28.253,38.407989 -52.986,38.407989 h -45.676 l 34.376,34.378 c 19.006,19.006 49.822,19.006 68.825,0 19.006,-19.005 19.006,-49.819 0,-68.823" + id="path8" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 194.9088,33.324589 c -2.041,0 -4.05,0.139 -6.025,0.384 10.622,20.927 7.198,47.154 -10.297,64.648002 l -32.297,32.299989 h 48.62 c 26.875,0 48.664,-21.79 48.664,-48.666991 0.002,-26.878 -21.787,-48.665 -48.665,-48.665" + id="path10" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 173.5858,24.522589 c -19.006,-19.004 -49.82,-19.004 -68.825,0.002 -1.44,1.442 -2.736,2.972 -3.96,4.54 22.294,7.294 38.407,28.253 38.407,52.985 v 45.677991 l 34.295,-34.296989 0.083,-0.081 c 19.006,-19.006002 19.006,-49.820002 0,-68.827002" + id="path12" + style="fill:#ffffff;fill-opacity:0.99227798" + inkscape:connector-curvature="0" /> + <path + d="m 99.8778,98.390591 1.384,1.444 30.835,30.833989 h 0.033 V 82.046589 c 0,-26.878 -21.79,-48.667 -48.667,-48.667 -26.878,0 -48.667,21.787 -48.665,48.665 0,2.037 0.139,4.04 0.381,6.01 20.94,-10.615 47.202,-7.16 64.699,10.337002" + id="path14" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 30.6798,175.73158 a 56.105,56.105 0 0 1 1.241,-3.345 c 0.056,-0.139 0.106,-0.28 0.164,-0.415 a 54.866,54.866 0 0 1 1.606,-3.467 c 0.124,-0.25 0.253,-0.497 0.384,-0.748 a 55.713,55.713 0 0 1 1.863,-3.316 c 0.07,-0.116 0.147,-0.226 0.217,-0.338 a 54.642,54.642 0 0 1 1.976,-2.954 c 0.14,-0.199 0.28,-0.4 0.425,-0.597 a 56.745,56.745 0 0 1 2.313,-2.939 c 0.163,-0.194 0.33,-0.383 0.497,-0.572 a 55.447,55.447 0 0 1 2.431,-2.646 c 0.075,-0.075 0.143,-0.154 0.218,-0.228 a 55.476,55.476 0 0 1 2.775,-2.589 57.482,57.482 0 0 1 3.571,-2.895 c 0.133,-0.098 0.272,-0.19 0.404,-0.284 a 56.412,56.412 0 0 1 2.896,-1.97 c 0.195,-0.124 0.387,-0.252 0.584,-0.375 a 56.323,56.323 0 0 1 3.267,-1.867 c 0.234,-0.122 0.47,-0.24 0.706,-0.36 a 55.306,55.306 0 0 1 3.38,-1.599 c 0.057,-0.022 0.11,-0.05 0.167,-0.074 a 55.697,55.697 0 0 1 3.63,-1.376 57.986,57.986 0 0 1 4.498,-1.347 c 0.191,-0.046 0.388,-0.088 0.579,-0.131 1.16,-0.28 2.333,-0.52 3.519,-0.726 0.222,-0.037 0.441,-0.083 0.663,-0.116 a 55.019,55.019 0 0 1 3.905,-0.478 c 0.284,-0.025 0.57,-0.044 0.854,-0.067 a 57.37,57.37 0 0 1 4.11,-0.166 l 45.678,-0.002 -34.378,-34.378 c -19.006,-19.003991 -49.822,-19.005991 -68.825,0 -19.006,19.006 -19.006,49.82 0,68.825 a 49.392,49.392 0 0 0 4.514,3.994 c 0.052,-0.153 0.116,-0.3 0.168,-0.454" + id="path16" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 94.9368,103.36658 27.22,27.22 h -36.587 l -2.075,0.043 c -22.28,0 -41.063,-14.972 -46.837,-35.403989 18.535,-10.394002 42.429,-7.706002 58.197,8.059989 l 0.08,0.08 m 37.177,-21.329991 v 38.493991 l -25.871,-25.869989 -1.497,-1.436 c -15.756,-15.754002 -18.45,-39.625002 -8.085,-58.154002 20.457,5.758 35.452,24.554 35.452,46.85 v 0.116 m 41.624,11.277002 -27.22,27.220989 V 83.948589 l -0.043,-2.075 c 0,-22.28 14.973,-41.065 35.405,-46.837 10.394,18.535 7.706,42.428 -8.06,58.195002 l -0.082,0.08" + id="path18" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 194.8778,130.55458 h -38.494 l 25.87,-25.87 1.436,-1.496 c 15.754,-15.755991 39.624,-18.449991 58.154,-8.085989 -5.758,20.456989 -24.555,35.451989 -46.85,35.451989 h -0.116" + id="path20" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="m 183.5098,171.92058 -27.22,-27.22 h 36.586 l 2.075,-0.043 c 22.28,0.002 41.062,14.974 46.837,35.406 -18.538,10.392 -42.429,7.706 -58.197,-8.063 l -0.081,-0.08 m -37.102,21.29 v -38.495 l 25.87,25.87 1.499,1.437 c 15.754,15.756 18.448,39.622 8.083,58.153 -20.457,-5.758 -35.452,-24.552 -35.452,-46.851 v -0.114 m -41.367,-11.047 27.22,-27.222 v 36.586 l 0.043,2.074 c 0,22.28 -14.973,41.065 -35.404,46.84 -10.395,-18.54 -7.706,-42.431 8.06,-58.198 l 0.08,-0.08 m -21.353,-37.262 h 38.494 l -25.87,25.87 -1.436,1.497 c -15.756,15.756 -39.625,18.45 -58.156,8.085 5.76,-20.459 24.554,-35.452 46.852,-35.452 h 0.116" + id="path22" + style="fill:#ffffff;fill-opacity:1" + inkscape:connector-curvature="0" /> +</svg> diff --git a/src/frontend/css/engine.scss b/src/frontend/css/engine.scss index eb249d185ea754c749ffcb64b7d54d03b3b9b7e0..29b6caf90e84aeb61ace4d096713d5f0ccf64679 100755 --- a/src/frontend/css/engine.scss +++ b/src/frontend/css/engine.scss @@ -1,6 +1,7 @@ @import 'maarch-material-modal.scss'; @import 'maarch-material-alert.scss'; @import 'maarch-material-table.scss'; +@import 'others-logo.scss'; .mat-form-field { width: 100% !important; diff --git a/src/frontend/css/others-logo.scss b/src/frontend/css/others-logo.scss new file mode 100644 index 0000000000000000000000000000000000000000..68139eb38425475d8b6f17ecbf4178e65a56cdb3 --- /dev/null +++ b/src/frontend/css/others-logo.scss @@ -0,0 +1,6 @@ +.alfresco { + background-image: url('../assets/alfresco.svg') !important; + background-size: 80% !important; + background-repeat: no-repeat !important; + background-position: center !important; +} \ No newline at end of file diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index dd6c758a977a12d16d793481cd22f46e213c7a4b..b4bf583289dde6e225e8383515efb33cc844ba84 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1677,4 +1677,14 @@ export const LANG_EN = { "linkedResources": "Attachments (linked mails)", "accessNotFound": "Access not found", "moreOneCustom": "This url is not an available instance of this application, please verify your address.", + "linkedEntities": "Linked entities", + "accounts": "Accounts", + "alfrescoCreation": "Alfresco account creation", + "alfrescoModification": "Alfresco account modification", + "showTreeMsg": "Click here to show the Alfresco tree.", + "mustFillAccountMsg": "Please fill the Alfresco account information in order to choose a root folder.", + "accountUpdated": "Account updated", + "alfrescoAccount": "Alfresco account", + "rootFolder": "Dossier racine", + "chooseEntityAssociationAccount": "Choose entities who will be able to use this account", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 1f173107d76204f716c27de225f6af00ecc38a2a..ba93f583b7899189779527ae7ee67e9b66e9ceba 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1677,4 +1677,16 @@ export const LANG_FR = { "linkedResources": "Pièces jointes (courriers liés)", "accessNotFound": "Accès introuvable", "moreOneCustom": "Cette url ne correspond à aucune instance configurée, veuillez vérifier l'adresse.", + "alfresco": "Alfresco", + "adminAlfrescoDesc": "Administrer les comptes alfresco liés aux entités", + "linkedEntities": "Entités associés", + "accounts": "Comptes", + "alfrescoCreation": "Création d'un compte Alfresco", + "alfrescoModification": "Modification du compte Alfresco", + "showTreeMsg": "Cliquer ici pour afficher l'arborescence du dépôt.", + "mustFillAccountMsg": "Veuillez renseigner le compte alfresco pour choisir un dépôt racine.", + "accountUpdated": "Compte modifié", + "alfrescoAccount": "Compte Alfresco", + "rootFolder": "Dépôt racine", + "chooseEntityAssociationAccount": "Attribuer le compte au(x) service(s)", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index 506aa45d111b11b40765429fbbeaeb4300359dd5..cda2ae48a0892ce7eacae177ee00fd28d81c3e81 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1661,4 +1661,14 @@ export const LANG_NL = { "linkedResources": "Attachments (linked mails)", //_TO_TRANSLATE "accessNotFound": "Access not found", //_TO_TRANSLATE "moreOneCustom": "This url is not an available instance of this application, please verify your address.", //_TO_TRANSLATE + "linkedEntities": "Linked entities", //_TO_TRANSLATE + "accounts": "Accounts", //_TO_TRANSLATE + "alfrescoCreation": "Alfresco account creation", //_TO_TRANSLATE + "alfrescoModification": "Alfresco account modification", //_TO_TRANSLATE + "showTreeMsg": "Click here to show the Alfresco tree", //_TO_TRANSLATE + "mustFillAccountMsg": "Please fill the Alfresco account information in order to choose a root folder.", //_TO_TRANSLATE + "accountUpdated": "Account updated", //_TO_TRANSLATE + "alfrescoAccount": "Alfresco account", //_TO_TRANSLATE + "rootFolder": "Dossier racine", //_TO_TRANSLATE + "chooseEntityAssociationAccount": "Choose entities who will be able to use this account", //_TO_TRANSLATE }; diff --git a/src/frontend/service/privileges.service.ts b/src/frontend/service/privileges.service.ts index 26282ac09ab18f562a4edc4a5f677c83f62a1a9c..daf608d17e21a539d4043dbe7c1284c390ed6879 100755 --- a/src/frontend/service/privileges.service.ts +++ b/src/frontend/service/privileges.service.ts @@ -3,32 +3,32 @@ import { LANG } from '../app/translate.component'; import { HeaderService } from './header.service'; interface menu { - 'id': string, // identifier - 'label': string, // title - 'comment': string, // description - 'route': string, // navigate to interface - 'style': string, // icon used interface - 'unit': string, //category of administration - 'angular': boolean, // to navigate in V1 <=>V2 - 'shortcut': boolean // show in panel + 'id': string; // identifier + 'label': string; // title + 'comment': string; // description + 'route': string; // navigate to interface + 'style': string; // icon used interface + 'unit': string; // category of administration + 'angular': boolean; // to navigate in V1 <=>V2 + 'shortcut': boolean; // show in panel } interface administration { - 'id': string, // identifier - 'label': string, // title - 'comment': string, // description - 'route': string, // navigate to interface - 'style': string, //icone used interface - 'unit': 'organisation' | 'classement' | 'production' | 'supervision' //category of administration - 'angular': boolean //to navigate in V1 <=>V2 - 'hasParams' : boolean + 'id': string; // identifier + 'label': string; // title + 'comment': string; // description + 'route': string; // navigate to interface + 'style': string; // icone used interface + 'unit': 'organisation' | 'classement' | 'production' | 'supervision'; // category of administration + 'angular': boolean; // to navigate in V1 <=>V2 + 'hasParams': boolean; } interface privilege { - 'id': string, // identifier - 'label': string, // title - 'unit': string //category of administration - 'comment': string, // description + 'id': string; // identifier + 'label': string; // title + 'unit': string; // category of administration + 'comment': string; // description } @Injectable() @@ -38,477 +38,487 @@ export class PrivilegeService { private administrations: administration[] = [ { - "id": "admin_users", - "label": this.lang.users, - "comment": this.lang.adminUsersDesc, - "route": "/administration/users", - "unit": "organisation", - "style": "fa fa-user", - "angular" : true, - "hasParams" : true - }, - { - "id": "admin_groups", - "label": this.lang.groups, - "comment": this.lang.adminGroupsDesc, - "route": "/administration/groups", - "unit": "organisation", - "style": "fa fa-users", - "angular" : true, - "hasParams" : false - }, - { - "id": "manage_entities", - "label": this.lang.entities, - "comment": this.lang.adminEntitiesDesc, - "route": "/administration/entities", - "unit": "organisation", - "style": "fa fa-sitemap", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_listmodels", - "label": this.lang.workflowModels, - "comment": this.lang.adminWorkflowModelsDesc, - "route": "/administration/diffusionModels", - "unit": "organisation", - "style": "fa fa-th-list", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_architecture", - "label": this.lang.documentTypes, - "comment": this.lang.adminDocumentTypesDesc, - "route": "/administration/doctypes", - "unit": "classement", - "style": "fa fa-suitcase", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_tag", - "label": this.lang.tags, - "comment": this.lang.adminTagsDesc, - "route": "/administration/tags", - "unit": "classement", - "style": "fa fa-tags", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_baskets", - "label": this.lang.baskets, - "comment": this.lang.adminBasketsDesc, - "route": "/administration/baskets", - "unit": "production", - "style": "fa fa-inbox", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_status", - "label": this.lang.statuses, - "comment": this.lang.statusesAdmin, - "route": "/administration/statuses", - "unit": "production", - "style": "fa fa-check-circle", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_actions", - "label": this.lang.actions, - "comment": this.lang.actionsAdmin, - "route": "/administration/actions", - "unit": "production", - "style": "fa fa-exchange-alt", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_contacts", - "label": this.lang.contacts, - "comment": this.lang.contactsAdmin, - "route": "/administration/contacts", - "unit": "production", - "style": "fa fa-address-book", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_priorities", - "label": this.lang.prioritiesAlt, - "comment": this.lang.prioritiesAlt, - "route": "/administration/priorities", - "unit": "production", - "style": "fa fa-clock", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_templates", - "label": this.lang.templates, - "comment": this.lang.templatesAdmin, - "route": "/administration/templates", - "unit": "production", - "style": "fa fa-file-alt", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_indexing_models", - "label": this.lang.indexingModels, - "comment": this.lang.indexingModels, - "route": "/administration/indexingModels", - "unit": "production", - "style": "fab fa-wpforms", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_custom_fields", - "label": this.lang.customFieldsAdmin, - "comment": this.lang.customFieldsAdmin, - "route": "/administration/customFields", - "unit": "production", - "style": "fa fa-code", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_notif", - "label": this.lang.notifications, - "comment": this.lang.notificationsAdmin, - "route": "/administration/notifications", - "unit": "production", - "style": "fa fa-bell", - "angular" : true, - "hasParams" : false - }, - { - "id": "update_status_mail", - "label": this.lang.updateStatus, - "comment": this.lang.updateStatus, - "route": "/administration/update-status", - "unit": "supervision", - "style": "fa fa-envelope-square", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_docservers", - "label": this.lang.docservers, - "comment": this.lang.docserversAdmin, - "route": "/administration/docservers", - "unit": "supervision", - "style": "fa fa-hdd", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_parameters", - "label": this.lang.parameters, - "comment": this.lang.parameters, - "route": "/administration/parameters", - "unit": "supervision", - "style": "fa fa-wrench", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_password_rules", - "label": this.lang.securities, - "comment": this.lang.securities, - "route": "/administration/securities", - "unit": "supervision", - "style": "fa fa-lock", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_email_server", - "label": this.lang.emailServerParam, - "comment": this.lang.emailServerParamDesc, - "route": "/administration/sendmail", - "unit": "supervision", - "style": "fa fa-mail-bulk", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_shippings", - "label": this.lang.mailevaAdmin, - "comment": this.lang.mailevaAdminDesc, - "route": "/administration/shippings", - "unit": "supervision", - "style": "fa fa-shipping-fast", - "angular" : true, - "hasParams" : false - }, - { - "id": "view_history", - "label": this.lang.history, - "comment": this.lang.viewHistoryDesc, - "route": "/administration/history", - "unit": "supervision", - "style": "fa fa-history", - "angular" : true, - "hasParams" : false - }, - { - "id": "view_history_batch", - "label": this.lang.historyBatch, - "comment": this.lang.historyBatchAdmin, - "route": "/administration/history-batch", - "unit": "supervision", - "style": "fa fa-history", - "angular" : true, - "hasParams" : false - }, - { - "id": "admin_update_control", - "label": this.lang.updateControl, - "comment": this.lang.updateControlDesc, - "route": "/administration/versions-update", - "unit": "supervision", - "style": "fa fa-sync", - "angular" : true, - "hasParams" : false + 'id': 'admin_users', + 'label': this.lang.users, + 'comment': this.lang.adminUsersDesc, + 'route': '/administration/users', + 'unit': 'organisation', + 'style': 'fa fa-user', + 'angular': true, + 'hasParams': true + }, + { + 'id': 'admin_groups', + 'label': this.lang.groups, + 'comment': this.lang.adminGroupsDesc, + 'route': '/administration/groups', + 'unit': 'organisation', + 'style': 'fa fa-users', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'manage_entities', + 'label': this.lang.entities, + 'comment': this.lang.adminEntitiesDesc, + 'route': '/administration/entities', + 'unit': 'organisation', + 'style': 'fa fa-sitemap', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_listmodels', + 'label': this.lang.workflowModels, + 'comment': this.lang.adminWorkflowModelsDesc, + 'route': '/administration/diffusionModels', + 'unit': 'organisation', + 'style': 'fa fa-th-list', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_architecture', + 'label': this.lang.documentTypes, + 'comment': this.lang.adminDocumentTypesDesc, + 'route': '/administration/doctypes', + 'unit': 'classement', + 'style': 'fa fa-suitcase', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_tag', + 'label': this.lang.tags, + 'comment': this.lang.adminTagsDesc, + 'route': '/administration/tags', + 'unit': 'classement', + 'style': 'fa fa-tags', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_baskets', + 'label': this.lang.baskets, + 'comment': this.lang.adminBasketsDesc, + 'route': '/administration/baskets', + 'unit': 'production', + 'style': 'fa fa-inbox', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_status', + 'label': this.lang.statuses, + 'comment': this.lang.statusesAdmin, + 'route': '/administration/statuses', + 'unit': 'production', + 'style': 'fa fa-check-circle', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_actions', + 'label': this.lang.actions, + 'comment': this.lang.actionsAdmin, + 'route': '/administration/actions', + 'unit': 'production', + 'style': 'fa fa-exchange-alt', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_contacts', + 'label': this.lang.contacts, + 'comment': this.lang.contactsAdmin, + 'route': '/administration/contacts', + 'unit': 'production', + 'style': 'fa fa-address-book', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_priorities', + 'label': this.lang.prioritiesAlt, + 'comment': this.lang.prioritiesAlt, + 'route': '/administration/priorities', + 'unit': 'production', + 'style': 'fa fa-clock', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_templates', + 'label': this.lang.templates, + 'comment': this.lang.templatesAdmin, + 'route': '/administration/templates', + 'unit': 'production', + 'style': 'fa fa-file-alt', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_indexing_models', + 'label': this.lang.indexingModels, + 'comment': this.lang.indexingModels, + 'route': '/administration/indexingModels', + 'unit': 'production', + 'style': 'fab fa-wpforms', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_custom_fields', + 'label': this.lang.customFieldsAdmin, + 'comment': this.lang.customFieldsAdmin, + 'route': '/administration/customFields', + 'unit': 'production', + 'style': 'fa fa-code', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_notif', + 'label': this.lang.notifications, + 'comment': this.lang.notificationsAdmin, + 'route': '/administration/notifications', + 'unit': 'production', + 'style': 'fa fa-bell', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'update_status_mail', + 'label': this.lang.updateStatus, + 'comment': this.lang.updateStatus, + 'route': '/administration/update-status', + 'unit': 'supervision', + 'style': 'fa fa-envelope-square', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_docservers', + 'label': this.lang.docservers, + 'comment': this.lang.docserversAdmin, + 'route': '/administration/docservers', + 'unit': 'supervision', + 'style': 'fa fa-hdd', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_parameters', + 'label': this.lang.parameters, + 'comment': this.lang.parameters, + 'route': '/administration/parameters', + 'unit': 'supervision', + 'style': 'fa fa-wrench', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_password_rules', + 'label': this.lang.securities, + 'comment': this.lang.securities, + 'route': '/administration/securities', + 'unit': 'supervision', + 'style': 'fa fa-lock', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_email_server', + 'label': this.lang.emailServerParam, + 'comment': this.lang.emailServerParamDesc, + 'route': '/administration/sendmail', + 'unit': 'supervision', + 'style': 'fa fa-mail-bulk', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_shippings', + 'label': this.lang.mailevaAdmin, + 'comment': this.lang.mailevaAdminDesc, + 'route': '/administration/shippings', + 'unit': 'supervision', + 'style': 'fa fa-shipping-fast', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'view_history', + 'label': this.lang.history, + 'comment': this.lang.viewHistoryDesc, + 'route': '/administration/history', + 'unit': 'supervision', + 'style': 'fa fa-history', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'view_history_batch', + 'label': this.lang.historyBatch, + 'comment': this.lang.historyBatchAdmin, + 'route': '/administration/history-batch', + 'unit': 'supervision', + 'style': 'fa fa-history', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_update_control', + 'label': this.lang.updateControl, + 'comment': this.lang.updateControlDesc, + 'route': '/administration/versions-update', + 'unit': 'supervision', + 'style': 'fa fa-sync', + 'angular': true, + 'hasParams': false + }, + { + 'id': 'admin_alfresco', + 'label': this.lang.alfresco, + 'comment': this.lang.adminAlfrescoDesc, + 'route': '/administration/alfresco', + 'unit': 'supervision', + 'style': 'alfresco', + 'angular': true, + 'hasParams': false } ]; private privileges: privilege[] = [ { - "id": "view_doc_history", - "label": this.lang.viewDocHistory, - "comment": this.lang.viewHistoryDesc, - "unit": 'history' + 'id': 'view_doc_history', + 'label': this.lang.viewDocHistory, + 'comment': this.lang.viewHistoryDesc, + 'unit': 'history' }, { - "id": "view_full_history", - "label": this.lang.viewFullHistory, - "comment": this.lang.viewFullHistoryDesc, - "unit": 'history' + 'id': 'view_full_history', + 'label': this.lang.viewFullHistory, + 'comment': this.lang.viewFullHistoryDesc, + 'unit': 'history' }, { - "id": "edit_resource", - "label": this.lang.editResource, - "comment": this.lang.editResourceDesc, - "unit": 'application' + 'id': 'edit_resource', + 'label': this.lang.editResource, + 'comment': this.lang.editResourceDesc, + 'unit': 'application' }, { - "id": "add_links", - "label": this.lang.addLinks, - "comment": this.lang.addLinks, - "unit": 'application' + 'id': 'add_links', + 'label': this.lang.addLinks, + 'comment': this.lang.addLinks, + 'unit': 'application' }, { - "id": "manage_tags_application", - "label": this.lang.manageTagsInApplication, - "comment": this.lang.manageTagsInApplicationDesc, - "unit": 'application' + 'id': 'manage_tags_application', + 'label': this.lang.manageTagsInApplication, + 'comment': this.lang.manageTagsInApplicationDesc, + 'unit': 'application' }, { - "id": "create_contacts", - "label": this.lang.manageCreateContacts, - "comment": this.lang.manageCreateContactsDesc, - "unit": 'application' + 'id': 'create_contacts', + 'label': this.lang.manageCreateContacts, + 'comment': this.lang.manageCreateContactsDesc, + 'unit': 'application' }, { - "id": "update_contacts", - "label": this.lang.manageUpdateContacts, - "comment": this.lang.manageUpdateContactsDesc, - "unit": 'application' + 'id': 'update_contacts', + 'label': this.lang.manageUpdateContacts, + 'comment': this.lang.manageUpdateContactsDesc, + 'unit': 'application' }, { - "id": "update_diffusion_indexing", - "label": this.lang.allRoles, - "comment": this.lang.updateDiffusionWhileIndexing, - "unit": 'diffusionList' + 'id': 'update_diffusion_indexing', + 'label': this.lang.allRoles, + 'comment': this.lang.updateDiffusionWhileIndexing, + 'unit': 'diffusionList' }, { - "id": "update_diffusion_except_recipient_indexing", - "label": this.lang.rolesExceptAssignee, - "comment": this.lang.updateDiffusionExceptRecipientWhileIndexing, - "unit": 'diffusionList' + 'id': 'update_diffusion_except_recipient_indexing', + 'label': this.lang.rolesExceptAssignee, + 'comment': this.lang.updateDiffusionExceptRecipientWhileIndexing, + 'unit': 'diffusionList' }, { - "id": "update_diffusion_process", - "label": this.lang.allRoles, - "comment": this.lang.updateDiffusionWhileProcess, - "unit": 'diffusionList' + 'id': 'update_diffusion_process', + 'label': this.lang.allRoles, + 'comment': this.lang.updateDiffusionWhileProcess, + 'unit': 'diffusionList' }, { - "id": "update_diffusion_except_recipient_process", - "label": this.lang.rolesExceptAssignee, - "comment": this.lang.updateDiffusionExceptRecipientWhileProcess, - "unit": 'diffusionList' + 'id': 'update_diffusion_except_recipient_process', + 'label': this.lang.rolesExceptAssignee, + 'comment': this.lang.updateDiffusionExceptRecipientWhileProcess, + 'unit': 'diffusionList' }, { - "id": "update_diffusion_details", - "label": this.lang.allRoles, - "comment": this.lang.updateDiffusionWhileDetails, - "unit": 'diffusionList' + 'id': 'update_diffusion_details', + 'label': this.lang.allRoles, + 'comment': this.lang.updateDiffusionWhileDetails, + 'unit': 'diffusionList' }, { - "id": "update_diffusion_except_recipient_details", - "label": this.lang.rolesExceptAssignee, - "comment": this.lang.updateDiffusionExceptRecipientWhileDetails, - "unit": 'diffusionList' + 'id': 'update_diffusion_except_recipient_details', + 'label': this.lang.rolesExceptAssignee, + 'comment': this.lang.updateDiffusionExceptRecipientWhileDetails, + 'unit': 'diffusionList' }, { - "id": "sendmail", - "label": this.lang.sendmail, - "comment": this.lang.sendmail, - "unit": 'sendmail' + 'id': 'sendmail', + 'label': this.lang.sendmail, + 'comment': this.lang.sendmail, + 'unit': 'sendmail' }, { - "id": "use_mail_services", - "label": this.lang.useMailServices, - "comment": this.lang.useMailServices, - "unit": 'sendmail' + 'id': 'use_mail_services', + 'label': this.lang.useMailServices, + 'comment': this.lang.useMailServices, + 'unit': 'sendmail' }, { - "id": "view_documents_with_notes", - "label": this.lang.viewDocumentsWithNotes, - "comment": this.lang.viewDocumentsWithNotesDesc, - "unit": 'application' + 'id': 'view_documents_with_notes', + 'label': this.lang.viewDocumentsWithNotes, + 'comment': this.lang.viewDocumentsWithNotesDesc, + 'unit': 'application' }, { - "id": "view_technical_infos", - "label": this.lang.viewTechnicalInformation, - "comment": this.lang.viewTechnicalInformation, - "unit": 'application' + 'id': 'view_technical_infos', + 'label': this.lang.viewTechnicalInformation, + 'comment': this.lang.viewTechnicalInformation, + 'unit': 'application' }, { - "id": "config_avis_workflow", - "label": this.lang.configAvisWorkflow, - "comment": this.lang.configAvisWorkflowDesc, - "unit": 'avis' + 'id': 'config_avis_workflow', + 'label': this.lang.configAvisWorkflow, + 'comment': this.lang.configAvisWorkflowDesc, + 'unit': 'avis' }, { - "id": "config_avis_workflow_in_detail", - "label": this.lang.configAvisWorkflowInDetail, - "comment": this.lang.configAvisWorkflowInDetailDesc, - "unit": 'avis' + 'id': 'config_avis_workflow_in_detail', + 'label': this.lang.configAvisWorkflowInDetail, + 'comment': this.lang.configAvisWorkflowInDetailDesc, + 'unit': 'avis' }, { - "id": "avis_documents", - "label": this.lang.avisAnswer, - "comment": this.lang.avisAnswerDesc, - "unit": 'avis' + 'id': 'avis_documents', + 'label': this.lang.avisAnswer, + 'comment': this.lang.avisAnswerDesc, + 'unit': 'avis' }, { - "id": "config_visa_workflow", - "label": this.lang.configVisaWorkflow, - "comment": this.lang.configVisaWorkflowDesc, - "unit": 'visaWorkflow' + 'id': 'config_visa_workflow', + 'label': this.lang.configVisaWorkflow, + 'comment': this.lang.configVisaWorkflowDesc, + 'unit': 'visaWorkflow' }, { - "id": "config_visa_workflow_in_detail", - "label": this.lang.configVisaWorkflowInDetail, - "comment": this.lang.configVisaWorkflowInDetailDesc, - "unit": 'visaWorkflow' + 'id': 'config_visa_workflow_in_detail', + 'label': this.lang.configVisaWorkflowInDetail, + 'comment': this.lang.configVisaWorkflowInDetailDesc, + 'unit': 'visaWorkflow' }, { - "id": "visa_documents", - "label": this.lang.visaAnswers, - "comment": this.lang.visaAnswersDesc, - "unit": 'visaWorkflow' + 'id': 'visa_documents', + 'label': this.lang.visaAnswers, + 'comment': this.lang.visaAnswersDesc, + 'unit': 'visaWorkflow' }, { - "id": "sign_document", - "label": this.lang.signDocs, - "comment": this.lang.signDocs, - "unit": 'visaWorkflow' + 'id': 'sign_document', + 'label': this.lang.signDocs, + 'comment': this.lang.signDocs, + 'unit': 'visaWorkflow' }, { - "id": "modify_visa_in_signatureBook", - "label": this.lang.modifyVisaInSignatureBook, - "comment": this.lang.modifyVisaInSignatureBookDesc, - "unit": 'visaWorkflow' + 'id': 'modify_visa_in_signatureBook', + 'label': this.lang.modifyVisaInSignatureBook, + 'comment': this.lang.modifyVisaInSignatureBookDesc, + 'unit': 'visaWorkflow' }, { - "id": "print_folder_doc", - "label": this.lang.printFolderDoc, - "comment": this.lang.printFolderDoc, - "unit": 'application' + 'id': 'print_folder_doc', + 'label': this.lang.printFolderDoc, + 'comment': this.lang.printFolderDoc, + 'unit': 'application' }, { - "id": "manage_attachments", - "label": this.lang.manageAttachments, - "comment": this.lang.manageAttachments, - "unit": 'application' + 'id': 'manage_attachments', + 'label': this.lang.manageAttachments, + 'comment': this.lang.manageAttachments, + 'unit': 'application' }, { - "id": "view_personal_data", - "label": this.lang.viewPersonalData, - "comment": this.lang.viewPersonalData, - "unit": 'confidentialityAndSecurity' + 'id': 'view_personal_data', + 'label': this.lang.viewPersonalData, + 'comment': this.lang.viewPersonalData, + 'unit': 'confidentialityAndSecurity' }, { - "id": "manage_personal_data", - "label": this.lang.managePersonalData, - "comment": this.lang.managePersonalData, - "unit": 'confidentialityAndSecurity' - } + 'id': 'manage_personal_data', + 'label': this.lang.managePersonalData, + 'comment': this.lang.managePersonalData, + 'unit': 'confidentialityAndSecurity' + }, ]; private menus: menu[] = [ { - "id": "admin", - "label": this.lang.administration, - "comment": this.lang.administration, - "route": "/administration", - "style": "fa fa-cogs", - "unit": "application", - "angular": true, - 'shortcut' : true - }, - { - "id": "adv_search_mlb", - "label": this.lang.search, - "comment": this.lang.search, - "route": "index.php?page=search_adv&dir=indexing_searching", - "style": "fa fa-search", - "unit": "application", - "angular": false, - 'shortcut' : true - }, - { - "id": "entities_print_sep_mlb", - "label": this.lang.entitiesSeparator, - "comment": this.lang.entitiesSeparator, - "route": "/separators/print", - "style": "fa fa-print", - "unit": "entities", - "angular": true, - 'shortcut' : false - }, - { - "id": "manage_numeric_package", - "label": this.lang.manageNumericPackage, - "comment": this.lang.manageNumericPackage, - "route": "/saveNumericPackage", - "style": "fa fa-file-archive", - "unit": "sendmail", - "angular": true, - 'shortcut' : false + 'id': 'admin', + 'label': this.lang.administration, + 'comment': this.lang.administration, + 'route': '/administration', + 'style': 'fa fa-cogs', + 'unit': 'application', + 'angular': true, + 'shortcut': true + }, + { + 'id': 'adv_search_mlb', + 'label': this.lang.search, + 'comment': this.lang.search, + 'route': 'index.php?page=search_adv&dir=indexing_searching', + 'style': 'fa fa-search', + 'unit': 'application', + 'angular': false, + 'shortcut': true + }, + { + 'id': 'entities_print_sep_mlb', + 'label': this.lang.entitiesSeparator, + 'comment': this.lang.entitiesSeparator, + 'route': '/separators/print', + 'style': 'fa fa-print', + 'unit': 'entities', + 'angular': true, + 'shortcut': false + }, + { + 'id': 'manage_numeric_package', + 'label': this.lang.manageNumericPackage, + 'comment': this.lang.manageNumericPackage, + 'route': '/saveNumericPackage', + 'style': 'fa fa-file-archive', + 'unit': 'sendmail', + 'angular': true, + 'shortcut': false } ]; shortcuts: any[] = [ { - "id": "followed", - "label": this.lang.followedMail, - "comment": this.lang.followedMail, - "route": "/followed", - "style": "fas fa-star", - "unit": "application", - "angular": true, - "shortcut" : true + 'id': 'followed', + 'label': this.lang.followedMail, + 'comment': this.lang.followedMail, + 'route': '/followed', + 'style': 'fas fa-star', + 'unit': 'application', + 'angular': true, + 'shortcut': true } ]; @@ -517,26 +527,26 @@ export class PrivilegeService { getAllPrivileges() { let priv: any[] = []; - priv = priv.concat(this.privileges.map(elem => elem.id)); - priv = priv.concat(this.administrations.map(elem => elem.id)); - priv = priv.concat(this.menus.map(elem => elem.id)); + priv = priv.concat(this.privileges.map(elem => elem.id)); + priv = priv.concat(this.administrations.map(elem => elem.id)); + priv = priv.concat(this.menus.map(elem => elem.id)); return priv; } - getPrivileges(ids: string[]=null) { + getPrivileges(ids: string[] = null) { if (ids !== null) { return this.privileges.filter(elem => ids.indexOf(elem.id) > -1); } else { return this.privileges; } - + } getUnitsPrivileges(): Array<string> { return this.privileges.map(elem => elem.unit).filter((elem, pos, arr) => arr.indexOf(elem) === pos); } - + getPrivilegesByUnit(unit: string): Array<privilege> { return this.privileges.filter(elem => elem.unit === unit); @@ -560,20 +570,20 @@ export class PrivilegeService { }); const indexingmenu: any = { - "id": "indexing", - "label": this.lang.recordMail, - "comment": this.lang.recordMail, - "route": "/indexing/"+indexingGroups[0].id, - "style": "fa fa-file-medical", - "unit": "application", - "angular": true, - 'shortcut' : true, - "groups": indexingGroups + 'id': 'indexing', + 'label': this.lang.recordMail, + 'comment': this.lang.recordMail, + 'route': '/indexing/' + indexingGroups[0].id, + 'style': 'fa fa-file-medical', + 'unit': 'application', + 'angular': true, + 'shortcut': true, + 'groups': indexingGroups }; menus.push(indexingmenu); } - return menus; + return menus; } getMenusByUnit(unit: string): Array<menu> { @@ -587,17 +597,17 @@ export class PrivilegeService { resfreshUserShortcuts() { this.shortcuts = [ { - "id": "followed", - "label": this.lang.followedMail, - "comment": this.lang.followedMail, - "route": "/followed", - "style": "fas fa-star", - "unit": "application", - "angular": true, - "shortcut" : true + 'id': 'followed', + 'label': this.lang.followedMail, + 'comment': this.lang.followedMail, + 'route': '/followed', + 'style': 'fas fa-star', + 'unit': 'application', + 'angular': true, + 'shortcut': true } ]; - + this.shortcuts = this.shortcuts.concat(this.menus.filter(elem => elem.shortcut === true).filter(elem => this.headerService.user.privileges.indexOf(elem.id) > -1)); if (this.headerService.user.groups.filter((group: any) => group.can_index === true).length > 0) { @@ -611,15 +621,15 @@ export class PrivilegeService { }); const indexingShortcut: any = { - "id": "indexing", - "label": this.lang.recordMail, - "comment": this.lang.recordMail, - "route": "/indexing", - "style": "fa fa-file-medical", - "unit": "application", - "angular": true, - 'shortcut' : true, - "groups": indexingGroups + 'id': 'indexing', + 'label': this.lang.recordMail, + 'comment': this.lang.recordMail, + 'route': '/indexing', + 'style': 'fa fa-file-medical', + 'unit': 'application', + 'angular': true, + 'shortcut': true, + 'groups': indexingGroups }; this.shortcuts.push(indexingShortcut); } @@ -635,7 +645,7 @@ export class PrivilegeService { } else { return this.administrations.filter(elem => elem.unit === unit).filter(elem => this.headerService.user.privileges.indexOf(elem.id) > -1); } - + } hasCurrentUserPrivilege(privilegeId: string) {