diff --git a/apps/maarch_entreprise/Views/user-administration.component.html b/apps/maarch_entreprise/Views/user-administration.component.html index 0c10ffa04c8e6f9b8cd70b69b00e2518108d8c67..b3d1dba7b47da8495650ed7847857cc675250612 100755 --- a/apps/maarch_entreprise/Views/user-administration.component.html +++ b/apps/maarch_entreprise/Views/user-administration.component.html @@ -137,7 +137,8 @@ <div id="jstree"></div> </mat-tab> <mat-tab *ngIf="!creationMode" label="Signature(s)"> - <div dnd-droppable matTooltip="{{lang.uploadSignFileInfo}}" (click)="clickOnUploader('uploadSignFile')" [class.dndFileHighlighted]="highlightMe" (dragover)="highlightMe=true" (dragleave)="highlightMe=false" (onDropSuccess)="test($event);highlightMe=false;" + <div dnd-droppable matTooltip="{{lang.uploadSignFileInfo}}" (click)="clickOnUploader('uploadSignFile')" [class.dndFileHighlighted]="highlightMe" + (dragover)="highlightMe=true" (dragleave)="highlightMe=false" (onDropSuccess)="test($event);highlightMe=false;" class="dndFile"> {{lang.uploadSignFile}} </div> @@ -249,7 +250,12 @@ <h3 mat-subheader>{{lang.entities}}</h3> <mat-list-item *ngFor="let userEntity of user.entities"> <mat-icon color="primary" *ngIf="userEntity.primary_entity == 'Y'" mat-list-icon class="fa fa-sitemap"></mat-icon> - <mat-icon color="primary" *ngIf="userEntity.primary_entity != 'Y'" mat-list-icon class="fa fa-sitemap" style="position:relative;"><button mat-icon-button style="cursor:pointer;position: absolute;right: -20px;top: -20px;font-size:10px;" (click)="updatePrimaryEntity(userEntity)" matTooltip="{{lang.entityTooglePrimary}}"><mat-icon class="fa fa-arrow-up"></mat-icon></button></mat-icon> + <mat-icon color="primary" *ngIf="userEntity.primary_entity != 'Y'" mat-list-icon class="fa fa-sitemap" style="position:relative;"> + <button mat-icon-button style="cursor:pointer;position: absolute;right: -20px;top: -20px;font-size:10px;" (click)="updatePrimaryEntity(userEntity)" + matTooltip="{{lang.entityTooglePrimary}}"> + <mat-icon class="fa fa-arrow-up"></mat-icon> + </button> + </mat-icon> <h4 mat-line [ngStyle]="{'font-weight': userEntity.primary_entity == 'Y' ? 'bold' : 'normal'}" matTooltip="{{userEntity.entity_label}}">{{userEntity.entity_label}}</h4> <p mat-line> <mat-form-field style="font-size:10px;"> @@ -260,37 +266,97 @@ </mat-list-item> <mat-divider></mat-divider> <h3 mat-subheader>{{lang.baskets}}</h3> - <mat-list-item *ngFor="let basket of user.baskets;let i = index"> - - <mat-icon mat-list-icon color="primary" *ngIf="basket.enabled" style="margin-top:-70px;"><mat-slide-toggle matTooltip="activer / désactiver la bannette" color="primary" [(ngModel)]="basket.allowed" (change)="toggleBasket(basket)" [disabled]="basket.userToDisplay != ''"></mat-slide-toggle> - </mat-icon> - <h4 mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}" [attr.color]="basket.userToDisplay != '' ? 'primary': ''">{{basket.basket_name}} <span class="label label-primary" style="font-weight:normal">{{basket.group_id}}</span></h4> - <p mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}"> - <mat-form-field *ngIf="basket.userToDisplay == ''" floatLabel="never"> - <input matTooltip="Rediriger la banette à une personne lors de l'activation de l'absence" matTooltipPosition="above" type="text" - placeholder="Utilisateur de redirection" matInput [matAutocomplete]="auto" [formControl]="userCtrl"> - <mat-autocomplete #auto="matAutocomplete"> - <mat-option *ngFor="let user of filteredUsers | async" [value]="user.id" (click)="addBasketRedirection(user.id,basket)"> - <p mat-line matTooltip="{{ user.otherInfo }}"> - <span class="col-xm-1"> - <mat-icon color="primary" class="fa fa-user fa-2x" style="margin-right:0px;"></mat-icon> - </span> - <span class="col-xm-11"> - {{ user.idToDisplay }} - <small>{{ user.otherInfo }}</small> - </span> - </p> - </mat-option> - </mat-autocomplete> - </mat-form-field> - <mat-form-field> - <input type="text" color="warn" matInput disabled value="Redirigé à {{basket.userToDisplay}}"> - <button mat-button color="warn" matSuffix mat-icon-button aria-label="Clear" (click)="delBasketRedirection(basket)" matTooltip="Supprimer la redirection"> - <mat-icon color="warn" class="fa fa-times text-danger"></mat-icon> - </button> - </mat-form-field> - </p> - </mat-list-item> + <ng-container *ngFor="let basket of user.baskets;let i = index"> + <mat-list-item *ngIf="basket.group_id && basket.userToDisplay == ''"> + <mat-icon mat-list-icon color="primary" *ngIf="basket.enabled" style="margin-top:-70px;"> + <mat-slide-toggle matTooltip="activer / désactiver la bannette" color="primary" [(ngModel)]="basket.allowed" (change)="toggleBasket(basket)" + [disabled]="basket.userToDisplay != ''"></mat-slide-toggle> + </mat-icon> + <h4 mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}" [attr.color]="basket.userToDisplay != '' ? 'primary': ''">{{basket.basket_name}} + <span class="label label-primary" style="font-weight:normal">{{basket.group_id}}</span> + </h4> + <p mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}"> + <mat-form-field *ngIf="basket.userToDisplay == ''" floatLabel="never"> + <input matTooltip="Rediriger la banette à une personne lors de l'activation de l'absence" matTooltipPosition="above" type="text" + placeholder="Utilisateur de redirection" matInput [matAutocomplete]="auto" [formControl]="userCtrl"> + <mat-autocomplete #auto="matAutocomplete"> + <mat-option *ngFor="let user of filteredUsers | async" [value]="user.id" (click)="addBasketRedirection(user.id,basket)"> + <p mat-line matTooltip="{{ user.otherInfo }}"> + <span class="col-xm-1"> + <mat-icon color="primary" class="fa fa-user fa-2x" style="margin-right:0px;"></mat-icon> + </span> + <span class="col-xm-11"> + {{ user.idToDisplay }} + <small>{{ user.otherInfo }}</small> + </span> + </p> + </mat-option> + </mat-autocomplete> + </mat-form-field> + <mat-form-field> + <input type="text" color="warn" matInput disabled value="Redirigé à {{basket.userToDisplay}}"> + <button mat-button color="warn" matSuffix mat-icon-button aria-label="Clear" (click)="delBasketRedirection(basket)" matTooltip="Supprimer la redirection"> + <mat-icon color="warn" class="fa fa-times text-danger"></mat-icon> + </button> + </mat-form-field> + </p> + </mat-list-item> + </ng-container> + <mat-divider></mat-divider> + <h3 mat-subheader>{{lang.basketsRedirected}}</h3> + <ng-container *ngFor="let basket of user.baskets;let i = index"> + <mat-list-item *ngIf="basket.group_id && basket.userToDisplay != ''"> + <mat-icon mat-list-icon color="primary" *ngIf="basket.enabled" style="margin-top:-60px;" class="fa fa-paper-plane-o"> + </mat-icon> + <h4 mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}" [attr.color]="basket.userToDisplay != '' ? 'primary': ''">{{basket.basket_name}} + <span class="label label-primary" style="font-weight:normal">{{basket.group_id}}</span> + </h4> + <p mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}"> + <mat-form-field> + <input type="text" color="warn" matInput disabled value="Redirigé à {{basket.userToDisplay}}"> + <button mat-button color="warn" matSuffix mat-icon-button aria-label="Clear" (click)="delBasketRedirection(basket)" matTooltip="Supprimer la redirection"> + <mat-icon color="warn" class="fa fa-times text-danger"></mat-icon> + </button> + </mat-form-field> + </p> + </mat-list-item> + </ng-container> + <mat-divider></mat-divider> + <h3 mat-subheader>{{lang.basketsAssigned}}</h3> + <ng-container *ngFor="let basket of user.baskets;let i = index"> + <mat-list-item *ngIf="!basket.group_id"> + <mat-icon mat-list-icon color="primary" style="margin-top:-60px;" class="fa fa-reply"> + </mat-icon> + <h4 mat-line [attr.color]="basket.userToDisplay != '' ? 'primary': ''">{{basket.basket_name}} + <span class="label label-primary" style="font-weight:normal">{{basket.group_id}}</span> + </h4> + <p mat-line> + <mat-form-field *ngIf="basket.userToDisplay == ''" floatLabel="never"> + <input matTooltip="{{lang.redirectBasket}}" matTooltipPosition="above" type="text" + placeholder="{{lang.userToRedirect}}" matInput [matAutocomplete]="auto" [formControl]="userCtrl"> + <mat-autocomplete #auto="matAutocomplete"> + <mat-option *ngFor="let user of filteredUsers | async" [value]="user.id" (click)="reassignBasketRedirection(user.id,basket)"> + <p mat-line matTooltip="{{ user.otherInfo }}"> + <span class="col-xm-1"> + <mat-icon color="primary" class="fa fa-user fa-2x" style="margin-right:0px;"></mat-icon> + </span> + <span class="col-xm-11"> + {{ user.idToDisplay }} + <small>{{ user.otherInfo }}</small> + </span> + </p> + </mat-option> + </mat-autocomplete> + </mat-form-field> + <mat-form-field> + <input type="text" color="warn" matInput disabled value="{{lang.assignBy}} {{basket.userToDisplay}}"> + <button mat-button color="warn" matSuffix mat-icon-button aria-label="Clear" (click)="basket.userToDisplay =''" matTooltip="Réassigner"> + <mat-icon color="primary" class="fa fa-edit"></mat-icon> + </button> + </mat-form-field> + </p> + </mat-list-item> + </ng-container> </mat-list> </mat-sidenav> </mat-sidenav-container> 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 e1e2d657d59b4452dba89d5048c3207b373215be..51be6a665adc5992b3a3da81f88137e612b2b5c3 100644 --- a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts @@ -377,6 +377,22 @@ export class UserAdministrationComponent extends AutoCompletePlugin implements O } } + reassignBasketRedirection(newUser:any, basket: any) { + + let r = confirm(this.lang.confirmAction + ' ' + this.lang.redirectBasket); + + if (r) { + this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/redirectedBaskets", [{"newUser" : newUser, "basketId":basket.basket_id, "basketOwner":basket.basket_owner, "virtual": basket.is_virtual}]) + .subscribe((data: any) => { + this.userCtrl.setValue(''); + this.user.baskets = data["baskets"]; + this.notify.success(this.lang.basketUpdated); + }, (err) => { + this.notify.error(err.error.errors); + }); + } + } + delBasketRedirection(basket: any) { let r = confirm(this.lang.confirmAction + ' ' + this.lang.activateAbs); diff --git a/apps/maarch_entreprise/js/angular/lang/lang-en.ts b/apps/maarch_entreprise/js/angular/lang/lang-en.ts index 7f201042ded5a45ae4a48138706ef3acaa47609d..9fa045c17e7e944cafbe68609f49fd7cccd19f39 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-en.ts +++ b/apps/maarch_entreprise/js/angular/lang/lang-en.ts @@ -32,6 +32,7 @@ export const LANG_EN = { "april" : "April", "archivalAgency" : "Archival agency", "archivalAgreement" : "Archival agreement", + "assignBy" : "Assign by", "associatedStatus" : "Associated status", "attachment" : "Attachment", "attachments" : "Attachments", @@ -50,7 +51,9 @@ export const LANG_EN = { "basketModification" : "Basket modification", "basketNotification" : "Toggle notification for this basket", "baskets" : "Baskets", + "basketsAssigned" : "Assigned baskets", "basketsOrder" : "Manage baskets order", + "basketsRedirected" : "Redirected baskets", "basketUpdated" : "Basket updated", "browsing" : "Browsing", "calDays" : "calendar days", @@ -329,8 +332,15 @@ export const LANG_EN = { "usedInActionPage" : "Used in action page", "usedInBasketlist" : "Used in basket list", "user" : "user", + "userAdded" : "User added", + "userAuthorized" : "User authorized", "userCreation" : "User Creation", + "userDeleted" : "User deleted", "userModification" : "User Modification", + "users" : "User(s)", + "userSuspended" : "User suspended", + "userUpdated" : "User updated", + "userToRedirect" : "User to redirect", "validate" : "Validate", "validateAction" : "Validate action(s)", "value" : "value", diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts index 40285d85715e2796ca4245fba25256941c832c84..7ef27386298ba7f47360b8ae19dde3103d1e1e45 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts +++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts @@ -35,6 +35,7 @@ export const LANG_FR = { "april" : "Avril", "archivalAgency" : "Convention d'archivage", "archivalAgreement" : "Service d'archive", + "assignBy" : "Assigné par", "associatedStatus" : "Statut associé", "attachment" : "Pièce jointe", "attachments" : "Pièces jointes", @@ -53,7 +54,9 @@ export const LANG_FR = { "basketModification" : "Modification d'une bannette", "basketNotification" : "Activer / désactiver la notification de cette bannette", "baskets" : "Bannettes", + "basketsAssigned" : "Bannettes assignées", "basketsOrder" : "Gérer l'ordre des bannettes", + "basketsRedirected" : "Bannettes redirigées", "basketUpdated" : "Bannette modifiée", "browsing" : "Navigation", "calDays" : "jour(s) calendaire(s)", @@ -355,6 +358,7 @@ export const LANG_FR = { "users" : "Utilisateur(s)", "userSuspended" : "Utilisateur suspendu", "userUpdated" : "Utilisateur modifié", + "userToRedirect" : "Utilisateur de redirection", "validate" : "Valider", "validateAction" : "Action(s) de qualification", "value" : "valeur",