Skip to content
Snippets Groups Projects
Verified Commit 3d05f3b9 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #159 add redirect baskets components

parent 4b4e98c5
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,8 @@ ...@@ -137,7 +137,8 @@
<div id="jstree"></div> <div id="jstree"></div>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!creationMode" label="Signature(s)"> <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"> class="dndFile">
{{lang.uploadSignFile}} {{lang.uploadSignFile}}
</div> </div>
...@@ -249,7 +250,12 @@ ...@@ -249,7 +250,12 @@
<h3 mat-subheader>{{lang.entities}}</h3> <h3 mat-subheader>{{lang.entities}}</h3>
<mat-list-item *ngFor="let userEntity of user.entities"> <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"></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> <h4 mat-line [ngStyle]="{'font-weight': userEntity.primary_entity == 'Y' ? 'bold' : 'normal'}" matTooltip="{{userEntity.entity_label}}">{{userEntity.entity_label}}</h4>
<p mat-line> <p mat-line>
<mat-form-field style="font-size:10px;"> <mat-form-field style="font-size:10px;">
...@@ -260,37 +266,97 @@ ...@@ -260,37 +266,97 @@
</mat-list-item> </mat-list-item>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<h3 mat-subheader>{{lang.baskets}}</h3> <h3 mat-subheader>{{lang.baskets}}</h3>
<mat-list-item *ngFor="let basket of user.baskets;let i = index"> <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 mat-list-icon color="primary" *ngIf="basket.enabled" style="margin-top:-70px;">
</mat-icon> <mat-slide-toggle matTooltip="activer / désactiver la bannette" color="primary" [(ngModel)]="basket.allowed" (change)="toggleBasket(basket)"
<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> [disabled]="basket.userToDisplay != ''"></mat-slide-toggle>
<p mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}"> </mat-icon>
<mat-form-field *ngIf="basket.userToDisplay == ''" floatLabel="never"> <h4 mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}" [attr.color]="basket.userToDisplay != '' ? 'primary': ''">{{basket.basket_name}}
<input matTooltip="Rediriger la banette à une personne lors de l'activation de l'absence" matTooltipPosition="above" type="text" <span class="label label-primary" style="font-weight:normal">{{basket.group_id}}</span>
placeholder="Utilisateur de redirection" matInput [matAutocomplete]="auto" [formControl]="userCtrl"> </h4>
<mat-autocomplete #auto="matAutocomplete"> <p mat-line [ngStyle]="{'opacity': basket.allowed ? '1' : '0.5'}">
<mat-option *ngFor="let user of filteredUsers | async" [value]="user.id" (click)="addBasketRedirection(user.id,basket)"> <mat-form-field *ngIf="basket.userToDisplay == ''" floatLabel="never">
<p mat-line matTooltip="{{ user.otherInfo }}"> <input matTooltip="Rediriger la banette à une personne lors de l'activation de l'absence" matTooltipPosition="above" type="text"
<span class="col-xm-1"> placeholder="Utilisateur de redirection" matInput [matAutocomplete]="auto" [formControl]="userCtrl">
<mat-icon color="primary" class="fa fa-user fa-2x" style="margin-right:0px;"></mat-icon> <mat-autocomplete #auto="matAutocomplete">
</span> <mat-option *ngFor="let user of filteredUsers | async" [value]="user.id" (click)="addBasketRedirection(user.id,basket)">
<span class="col-xm-11"> <p mat-line matTooltip="{{ user.otherInfo }}">
{{ user.idToDisplay }} <span class="col-xm-1">
<small>{{ user.otherInfo }}</small> <mat-icon color="primary" class="fa fa-user fa-2x" style="margin-right:0px;"></mat-icon>
</span> </span>
</p> <span class="col-xm-11">
</mat-option> {{ user.idToDisplay }}
</mat-autocomplete> <small>{{ user.otherInfo }}</small>
</mat-form-field> </span>
<mat-form-field> </p>
<input type="text" color="warn" matInput disabled value="Redirigé à {{basket.userToDisplay}}"> </mat-option>
<button mat-button color="warn" matSuffix mat-icon-button aria-label="Clear" (click)="delBasketRedirection(basket)" matTooltip="Supprimer la redirection"> </mat-autocomplete>
<mat-icon color="warn" class="fa fa-times text-danger"></mat-icon> </mat-form-field>
</button> <mat-form-field>
</mat-form-field> <input type="text" color="warn" matInput disabled value="Redirigé à {{basket.userToDisplay}}">
</p> <button mat-button color="warn" matSuffix mat-icon-button aria-label="Clear" (click)="delBasketRedirection(basket)" matTooltip="Supprimer la redirection">
</mat-list-item> <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-list>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
......
...@@ -377,6 +377,22 @@ export class UserAdministrationComponent extends AutoCompletePlugin implements O ...@@ -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) { delBasketRedirection(basket: any) {
let r = confirm(this.lang.confirmAction + ' ' + this.lang.activateAbs); let r = confirm(this.lang.confirmAction + ' ' + this.lang.activateAbs);
......
...@@ -32,6 +32,7 @@ export const LANG_EN = { ...@@ -32,6 +32,7 @@ export const LANG_EN = {
"april" : "April", "april" : "April",
"archivalAgency" : "Archival agency", "archivalAgency" : "Archival agency",
"archivalAgreement" : "Archival agreement", "archivalAgreement" : "Archival agreement",
"assignBy" : "Assign by",
"associatedStatus" : "Associated status", "associatedStatus" : "Associated status",
"attachment" : "Attachment", "attachment" : "Attachment",
"attachments" : "Attachments", "attachments" : "Attachments",
...@@ -50,7 +51,9 @@ export const LANG_EN = { ...@@ -50,7 +51,9 @@ export const LANG_EN = {
"basketModification" : "Basket modification", "basketModification" : "Basket modification",
"basketNotification" : "Toggle notification for this basket", "basketNotification" : "Toggle notification for this basket",
"baskets" : "Baskets", "baskets" : "Baskets",
"basketsAssigned" : "Assigned baskets",
"basketsOrder" : "Manage baskets order", "basketsOrder" : "Manage baskets order",
"basketsRedirected" : "Redirected baskets",
"basketUpdated" : "Basket updated", "basketUpdated" : "Basket updated",
"browsing" : "Browsing", "browsing" : "Browsing",
"calDays" : "calendar days", "calDays" : "calendar days",
...@@ -329,8 +332,15 @@ export const LANG_EN = { ...@@ -329,8 +332,15 @@ export const LANG_EN = {
"usedInActionPage" : "Used in action page", "usedInActionPage" : "Used in action page",
"usedInBasketlist" : "Used in basket list", "usedInBasketlist" : "Used in basket list",
"user" : "user", "user" : "user",
"userAdded" : "User added",
"userAuthorized" : "User authorized",
"userCreation" : "User Creation", "userCreation" : "User Creation",
"userDeleted" : "User deleted",
"userModification" : "User Modification", "userModification" : "User Modification",
"users" : "User(s)",
"userSuspended" : "User suspended",
"userUpdated" : "User updated",
"userToRedirect" : "User to redirect",
"validate" : "Validate", "validate" : "Validate",
"validateAction" : "Validate action(s)", "validateAction" : "Validate action(s)",
"value" : "value", "value" : "value",
......
...@@ -35,6 +35,7 @@ export const LANG_FR = { ...@@ -35,6 +35,7 @@ export const LANG_FR = {
"april" : "Avril", "april" : "Avril",
"archivalAgency" : "Convention d'archivage", "archivalAgency" : "Convention d'archivage",
"archivalAgreement" : "Service d'archive", "archivalAgreement" : "Service d'archive",
"assignBy" : "Assigné par",
"associatedStatus" : "Statut associé", "associatedStatus" : "Statut associé",
"attachment" : "Pièce jointe", "attachment" : "Pièce jointe",
"attachments" : "Pièces jointes", "attachments" : "Pièces jointes",
...@@ -53,7 +54,9 @@ export const LANG_FR = { ...@@ -53,7 +54,9 @@ export const LANG_FR = {
"basketModification" : "Modification d'une bannette", "basketModification" : "Modification d'une bannette",
"basketNotification" : "Activer / désactiver la notification de cette bannette", "basketNotification" : "Activer / désactiver la notification de cette bannette",
"baskets" : "Bannettes", "baskets" : "Bannettes",
"basketsAssigned" : "Bannettes assignées",
"basketsOrder" : "Gérer l'ordre des bannettes", "basketsOrder" : "Gérer l'ordre des bannettes",
"basketsRedirected" : "Bannettes redirigées",
"basketUpdated" : "Bannette modifiée", "basketUpdated" : "Bannette modifiée",
"browsing" : "Navigation", "browsing" : "Navigation",
"calDays" : "jour(s) calendaire(s)", "calDays" : "jour(s) calendaire(s)",
...@@ -355,6 +358,7 @@ export const LANG_FR = { ...@@ -355,6 +358,7 @@ export const LANG_FR = {
"users" : "Utilisateur(s)", "users" : "Utilisateur(s)",
"userSuspended" : "Utilisateur suspendu", "userSuspended" : "Utilisateur suspendu",
"userUpdated" : "Utilisateur modifié", "userUpdated" : "Utilisateur modifié",
"userToRedirect" : "Utilisateur de redirection",
"validate" : "Valider", "validate" : "Valider",
"validateAction" : "Action(s) de qualification", "validateAction" : "Action(s) de qualification",
"value" : "valeur", "value" : "valeur",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment