diff --git a/.gitignore b/.gitignore index 6a5e7b48dfcd1ffac25b9c132aa7409bc1abf7ac..44d9c2322c1a350c8aa23e94c52a739fe755691a 100755 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ apps/maarch_entreprise/xml/log4php.xml xdelete.sh core/Test/build/ apps/maarch_entreprise/tmp/* -/nbproject/private/ \ No newline at end of file +/nbproject/private/apps/maarch_entreprise/define_custom.php diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 428d4cee848cd0e6c761d4a94550311c22a6ed50..b47432f6a2b959fbd23bc3b9e5fc1f02c59829a9 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,11 +34,15 @@ job_php-7.0: - cd /var/www/html/MaarchCourrier - mkdir -p /var/www/html/MaarchCourrier - composer -n install - - npm install --production + - curl -sL https://deb.nodesource.com/setup_7.x | bash - + - apt-get install -yqq nodejs + - npm install npm@latest -g + - npm set registry https://registry.npmjs.org/ + - npm install - sed 's/<databaseserver>.*<\/databaseserver>/<databaseserver>postgres<\/databaseserver>/;s/<databasepassword>.*<\/databasepassword>/<databasepassword><\/databasepassword>/;s/<databasename>.*<\/databasename>/<databasename>MaarchCourrier<\/databasename>/;s/<databaseuser>.*<\/databaseuser>/<databaseuser>maarch<\/databaseuser>/' apps/maarch_entreprise/xml/config.xml.default > apps/maarch_entreprise/xml/config.xml - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar - chmod +x /usr/local/bin/phpunit #- cd App/MaarchRM - phpunit --coverage-text --colors=never -c phpunit.xml only: - - develop + - develop \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/action-administration.component.html b/apps/maarch_entreprise/Views/action-administration.component.html index b66fb0e1a812a0402be5a09a35ccbd79b7834cb6..412a7f0c21ee5a205e3f2cf6e08de2f3854731b9 100755 --- a/apps/maarch_entreprise/Views/action-administration.component.html +++ b/apps/maarch_entreprise/Views/action-administration.component.html @@ -1,90 +1,123 @@ +<div class="page-header"> + <h1 *ngIf="!actionCreation">{{lang.actionModification}} <small>{{action.label_action}}</small></h1> + <h1 *ngIf="actionCreation">{{lang.actionCreation}} <small>{{action.label_action}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration/actions" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - - </ul> - </div> - </div> - </nav> - <h1 style="margin-top: 0"><i class="fa fa-exchange fa-2x"></i> {{lang.pageTitle}}</h1> - <div class="container-fluid" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> + <div class="container-fluid"> <div class="col-md-6 col-md-offset-3"> - <div *ngIf="action.is_system == true" class="alert alert-danger" role="alert"><b>{{lang.action}} {{lang.is_system}} !</b> {{lang.do_not_modify_unless_expert}}</div> + <div *ngIf="action.is_system == true" class="alert alert-danger" role="alert"><b>{{lang.isSytemAction}} !</b> {{lang.doNotModifyUnlessExpert}}</div> <form class="form-horizontal" (ngSubmit)="onSubmit()" #actionsFormUp="ngForm"> <div class="form-group"> <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-tag" title="{{lang.desc}}"></i><sup class="mandatory" title="champ requis">*</sup></span> - <input [(ngModel)]="action.label_action" required class="form-control" name="action_name" id="action_name" title="{{lang.desc}}" type="text" placeholder="{{lang.desc}}" required> - </div> + <md-input-container> + <input mdInput [(ngModel)]="action.label_action" required name="action_name" id="action_name" title="{{lang.desc}}" type="text" placeholder="{{lang.desc}}" required> + </md-input-container> </div> </div> <div class="form-group"> <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-check-circle" title="{{lang.associated_status}}"></i></span> - <select [(ngModel)]="action.id_status" class="forms-select form-control" name="status" id="status"> - <option *ngFor="let statut of statusList" [value]="statut.id">{{statut.label_status}}</option> - </select> - </div> + <md2-select + id="status" + name="status" + placeholder="{{lang.associatedStatus}}" + [(ngModel)]="action.id_status" + required + #searchStatus="ngModel"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" + type="text" + placeholder="Filtre" + [(ngModel)]="_search" + autocomplete="off" + (focusout)="clearSearch()"/> + </md-input-container> + </md2-select-header> + <md2-option *ngFor="let statut of statusList | dataPipe : 'label_status' : _search" [value]="statut.id">{{statut.label_status}}</md2-option> + </md2-select> </div> </div> <div class="form-group"> <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-retweet" title="{{lang.action_page}}"></i></span> - <select [(ngModel)]="action.action_page" class="forms-select form-control" name="action_page" id="action_page"> - <option title="{{action.desc}}" *ngFor="let action of actionPagesList.actionsPageList" value="{{action.name}}">{{action.label}}</option> - </select> - </div> + <md2-select + id="action_page" + name="action_page" + placeholder="{{lang.actionPage}}" + [(ngModel)]="action.action_page" + #searchAction="ngModel"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" + type="text" + placeholder="Filtre" + [(ngModel)]="_search" + autocomplete="off" + (focusout)="clearSearch()"/> + </md-input-container> + </md2-select-header> + <md2-option *ngFor="let action of actionPagesList.actionsPageList | dataPipe : 'label' : _search" [value]="action.name">{{action.label}}</md2-option> + </md2-select> </div> </div> <div class="form-group"> <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-code" title="{{lang.keyword}}"></i></span> - <select [(ngModel)]="action.keyword" class="forms-select form-control" name="keyword" id="keyword"> - <option title="{{keyword.desc}}" *ngFor="let keyword of keywordsList" value="{{keyword.value}}">{{keyword.label}}</option> - </select> - </div> + <md2-select + id="keyword" + name="keyword" + placeholder="{{lang.keyword}}" + [(ngModel)]="action.keyword" + #searchAction="ngModel"> + <!--<md2-select-header> + <md-input-container> + <input mdInput name="search" + type="text" + placeholder="Filtre" + [(ngModel)]="_search" + autocomplete="off" + (focusout)="clearSearch()"/> + </md-input-container> + </md2-select-header>--> + <md2-option *ngFor="let keyword of keywordsList | dataPipe : 'label' : _search" [value]="keyword.value">{{keyword.label}}</md2-option> + </md2-select> </div> </div> <div class="form-group"> - <div class="col-sm-6"> - <div class="input-group"> - <label class="form-control" for="history" title="{{lang.action_history_desc}}">{{lang.action_history}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="action.history" name="history" id="history" type="checkbox"> - </span> - </div> - </div> - <div class="col-sm-6"> - <div class="input-group"> - <label class="form-control" for="is_folder_action" title="{{lang.is_folder_action_desc}}">{{lang.is_folder_action}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="action.is_folder_action" name="is_folder_action" id="is_folder_action" type="checkbox"> - </span> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="col-sm-6"> + <md-slide-toggle name="history" title="{{lang.actionHistoryDesc}}" id="history" color="primary" [(ngModel)]="action.history" [checked]="action.history == 'Y'">{{lang.actionHistory}}</md-slide-toggle> + </div> + <div class="col-sm-6"> + <md-slide-toggle name="is_folder_action" title="{{lang.isFolderActionDesc}}" id="is_folder_action" color="primary" [(ngModel)]="action.is_folder_action" [checked]="action.is_folder_action == 'Y'">{{lang.isFolderAction}}</md-slide-toggle> + </div> </div> </div> </div> - <div id="categoryAssociationList" class="form-group panel panel-default"> - <div class="col-sm-12 panel-heading" style="font-size: 14px;text-align:center;"> - <i title="{{lang.selectAll}}" class="fa fa-check-square-o selectAll" data-target="categorieslist" (click)="selectAll($event)"></i> <i title="{{lang.unselectAll}}" class="fa fa-square-o unselectAll" data-target="categorieslist" (click)="unselectAll($event)"></i> {{lang.choose_category_association }} - </div> - <div class="col-sm-12 panel-body"> - <select class="forms-select form-control" name="categorieslist[]" id="categorieslist" size="7" multiple="multiple" required> - <option *ngFor="let category of categoriesList" [selected]="category.selected" value="{{category.id}}">{{category.label}}</option> - </select> + <div class="form-group"> + <div class="col-sm-12"> + <md2-select + id="categorieslist" + name="categorieslist" + placeholder="{{lang.chooseCategoryAssociation}}" + [(ngModel)]="this.action.actionCategories" + required + multiple + #searchCat="ngModel"> + <!--<md2-select-header> + <md-input-container> + <input mdInput name="search" + type="text" + placeholder="Filtre" + [(ngModel)]="_search" + autocomplete="off" + (focusout)="clearSearch()"/> + </md-input-container> + </md2-select-header>--> + <md2-option *ngFor="let category of categoriesList | dataPipe : 'label' : _search" [value]="category.id">{{category.label}}</md2-option> + </md2-select> </div> </div> <div class="col-sm-12 panel-body" style="text-align:center;"> diff --git a/apps/maarch_entreprise/Views/actions-administration.component.html b/apps/maarch_entreprise/Views/actions-administration.component.html index 9a7f564f5f6d929782217aa816c2dc483ffc3192..9cd0c28fb3efb15fce5ff7e1c85f7cbad7f74c8c 100755 --- a/apps/maarch_entreprise/Views/actions-administration.component.html +++ b/apps/maarch_entreprise/Views/actions-administration.component.html @@ -1,49 +1,47 @@ +<div class="page-header"> + <h1>{{lang.administration}} {{lang.actions}} <small>{{data.length}} {{lang.actions}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <h1 style="margin-top: 0"><i class="fa fa-exchange fa-2x"></i> {{lang.admin}} {{lang.actions}} : {{actions.length}} {{lang.actions}}</h1> - <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - <li style="cursor: pointer" routerLink="/administration/actions/new"> - <a data-toggle="modal" data-target="#manageSign" title="{{lang.new_action}}"><i class="fa fa-exchange"></i><sup><i class="fa fa-plus"></i></sup></a> - </li> - </ul> - </div> - </div> - </nav> <div class="col-md-12"> - <table id ="actionsTable" class="display" style="display:none;"> + <table id ="actionsTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'label_action' : search" #md2="md2DataTable" [sortBy]='id' [rowsPerPage]="10"> <thead> <tr> - <th style="width:5%;"><span>{{lang.id}}</span></th> - <th style="width:45%;"><span>{{lang.desc}}</span></th> - <th style="width:15%;"><span>{{lang.action_history}}</span></th> - <th style="width:15%;"><span>{{lang.isFolderAction}}</span></th> + <td colspan="4"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md-input-container> + <input mdInput placeholder="{{lang.filterBy}} : {{lang.desc}}" class="md2-input" [(ngModel)]="search" /> + </md-input-container> + + <a class="text-primary" style="cursor: pointer" routerLink="/administration/actions/new" title="{{lang.new_action}}"><i class="fa fa-exchange fa-2x"></i><sup><i class="fa fa-plus"></i></sup></a> + </td> + </tr> + <tr> + <th style="width:5%;" md2SortBy="id"><span>{{lang.id}}</span></th> + <th style="width:45%;" md2SortBy="label_action"><span>{{lang.desc}}</span></th> + <th style="width:15%;" md2SortBy="history"><span>{{lang.actionHistory}}</span></th> + <th style="width:15%;" md2SortBy="is_folder_action"><span>{{lang.isFolderAction}}</span></th> <th style="width:30%;"><span> </span></th> </tr> </thead> <tbody> - <tr *ngFor="let action of actions" id="{{action.id}}"> - <td style="width:5%;"> {{action.id}} </td> - <td style="width:45%;"> {{action.label_action}} </td> - <td style="width:15%;" *ngIf="action.history == 'N'"> {{lang.no}} </td> - <td style="width:15%;" *ngIf="action.history == 'Y'"> {{lang.yes}} </td> - <td style="width:15%;" *ngIf="action.is_folder_action == 'Y'"> {{lang.yes}} </td> - <td style="width:15%;" *ngIf="action.is_folder_action == 'N'"> {{lang.no}} </td> - <td style="width:30%;" style="text-align:right;"> + <tr *ngFor="let action of md2.data"> + <td style="width:5%;vertical-align:middle;"> {{action.id}} </td> + <td style="width:45%;vertical-align:middle;"> {{action.label_action}} </td> + <td style="width:15%;vertical-align:middle;" *ngIf="action.history == 'N'"> {{lang.no}} </td> + <td style="width:15%;vertical-align:middle;" *ngIf="action.history == 'Y'"> {{lang.yes}} </td> + <td style="width:15%;vertical-align:middle;" *ngIf="action.is_folder_action == 'Y'"> {{lang.yes}} </td> + <td style="width:15%;vertical-align:middle;" *ngIf="action.is_folder_action == 'N'"> {{lang.no}} </td> + <td style="width:30%;vertical-align:middle;" style="text-align:right;"> <div class="btn-group" role="group" aria-label="..."> <button routerLink="/administration/actions/{{action.id}}" type="button" class="btn btn-default" title="{{lang.update}}"> <a><i style="cursor:pointer" class="fa fa-edit"></i></a> </button> - <button [disabled]="action.is_system == 'Y'" type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteAction(action.id)"> + <button [disabled]="action.is_system == 'Y'" type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteAction(action)"> <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> </button> </div> diff --git a/apps/maarch_entreprise/Views/administration.component.html b/apps/maarch_entreprise/Views/administration.component.html index b3044014dcab774dd0d84ab095da021f7b7e9d9b..f07accb215832169886d6dfe19c99cd249f8dadd 100755 --- a/apps/maarch_entreprise/Views/administration.component.html +++ b/apps/maarch_entreprise/Views/administration.component.html @@ -1,34 +1,26 @@ +<div class="page-header"> + <h1 style="margin-top: 0">{{lang.administration}}</h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> -<div *ngIf="!loading" class="container-fluid"> - <h1 style="margin-top: 0"><i class="fa fa-cogs fa-2x"></i> {{lang.administration}}</h1> - <div class="row row-eq-height"> - <div *ngIf="applicationServices[0]" class="col-md-12 servicesDiv"> - <h2 class="administrationTitle">{{lang.application}}</h2> - <div class="content"> - <div *ngFor="let appService of applicationServices" class="admin_item" title="{{appService.comment}}" (click)="goToSpecifiedAdministration(appService)"> - <div> - <i class="{{appService.style}} fa-4x"></i> - </div> - <div> - <strong>{{appService.name}}</strong> - </div> - </div> - </div> - </div> - <div *ngIf="modulesServices[0]" class="col-md-12 servicesDiv"> - <h2 class="administrationTitle">{{lang.modules}}</h2> - <div class="content"> - <div *ngFor="let modService of modulesServices" class="admin_item" title="{{modService.comment}}" (click)="goToSpecifiedAdministration(modService)"> - <div> - <i class="{{modService.style}} fa-4x"></i> - </div> - <div> - <strong>{{modService.name}}</strong> - </div> - </div> - </div> - </div> +<div *ngIf="!loading" class="container-fluid" style="color:#666;"> + <div class="col-md-12"> + <md-tab-group> + <md-tab label="{{lang.application}}"> + <md-grid-list cols="6" rowHeight="2:1"> + <md-grid-tile *ngFor="let appService of applicationServices"> + <button md-button tooltip="{{appService.comment}}" tooltip-delay="1000" (click)="goToSpecifiedAdministration(appService)"><i class="{{appService.style}} fa-4x"></i><br/>{{appService.name}}</button> + </md-grid-tile> + </md-grid-list> + </md-tab> + <md-tab label="{{lang.modules}}"> + <md-grid-list cols="6" rowHeight="2:1"> + <md-grid-tile *ngFor="let modService of modulesServices"> + <button md-button tooltip="{{modService.comment}}" tooltip-delay="1000" (click)="goToSpecifiedAdministration(modService)"><i class="{{modService.style}} fa-4x"></i><br/>{{modService.name}}</button> + </md-grid-tile> + </md-grid-list> + </md-tab> + </md-tab-group> </div> </div> diff --git a/apps/maarch_entreprise/Views/header.component.html b/apps/maarch_entreprise/Views/header.component.html index bbbd7325debea3d95ffecef337f5985089aff7d4..33828d8a85268982dd4dd369629c6a61c4a05b30 100755 --- a/apps/maarch_entreprise/Views/header.component.html +++ b/apps/maarch_entreprise/Views/header.component.html @@ -1,72 +1,53 @@ -<nav id="headerV2" class="navbar navbar-default"> - <div class="container-fluid"> - <!-- Brand and toggle get grouped for better mobile display --> - <div class="navbar-header"> - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a id="headerLogo" class="navbar-brand" href="index.php"></a> - </div> - - <!-- Collect the nav links, forms, and other content for toggling --> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <form class="navbar-form navbar-left"> - <div class="form-group"> - <div class="input-group"> - <div class="input-group-btn"> - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fa fa-bars"></span> Courriers</button> - <ul class="dropdown-menu"> - <li><a href="#">Courriers</a></li> - <li><a href="#">Contacts</a></li> - <li><a href="#">Pièces jointes</a></li> - <li role="separator" class="divider"></li> - <li><a href="#">Globale</a></li> - </ul> - </div><!-- /btn-group --> - <input style="width:400px;" type="text" class="form-control" placeholder="Search for..."> - <span class="input-group-btn"> - <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button> - </span> - </div><!-- /input-group --> - </div> - </form> - <ul class="nav navbar-nav navbar-right"> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-gears fa-2x"></i> <span class="caret"></span></a> - <ul class="dropdown-menu"> - <li><a href="#">Gestion utlisateurs</a></li> - <li><a href="#">Gestion groupes</a></li> - <li><a href="#">Gestion statuts</a></li> - <li><a href="#">...</a></li> - <li role="separator" class="divider"></li> - <li><a href="#">Panneau d'administration</a></li> - </ul> - </li> - <li class="dropdown" id="headerNotification"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-bell fa-2x"></i><sup class="notification"><span color="red" class="badge">5</span></sup> <span class="caret"></span></a> - <ul class="dropdown-menu"> - <li class="alert-info"><a><b>3</b> nouveau(x) courrier(s) dans <i class="link">courrier à traiter</i></a></li> - <li class="alert-info"><a><b class="link">2017/A/123</b> nouvelle note ajoutée</a></li> - <li class="alert-warning"><a><b class="link">2017/A/123</b> arrive bientôt à échéance ! <i class="badge">1 jour(s)</i></a></li> - <li class="alert-warning"><a><b class="link">2017/A/21</b> arrive bientôt à échéance ! <i class="badge">2 jour(s)</i></a></li> - <li class="alert-danger"><a><b class="link">2017/A/21</b> est arrivé à échéance ! <i class="badge">- 4 jour(s)</i></a></li> - <li role="separator" class="divider"></li> - <li><a href="#">Voir la liste des notifications</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user fa-2x"></i> <span class="caret"></span></a> - <ul class="dropdown-menu"> - <li><a href="#">Mon profile</a></li> - <li role="separator" class="divider"></li> - <li><a href="#">Déconnexion</a></li> - </ul> - </li> - </ul> - </div><!-- /.navbar-collapse --> - </div><!-- /.container-fluid --> -</nav> -<router-outlet></router-outlet> \ No newline at end of file +<md-toolbar color="primary"> + <button tooltip="Menu" tooltip-delay="1000" md-button mdInput [mdMenuTriggerFor]="mySetting">{{applicationName}}</button> + <span id="globalSearch"> + <form class="example-form"> + <md-input-container> + <button md-button mdPrefix [mdMenuTriggerFor]="searchTarget"><i class="fa fa-bars fa-2x"></i></button> + <input type="tel" mdInput placeholder="Rechercher dans : global"> + </md-input-container> + </form> + </span> + <span style="flex: 1 1 auto;"></span> + <button tooltip="Administration" tooltip-delay="1000" md-icon-button [mdMenuTriggerFor]="myAdmin"> + <i class="fa fa-cogs fa-2x"></i> + </button> + <button tooltip="Mes notifications" tooltip-delay="1000" md-icon-button [mdMenuTriggerFor]="myNotif"> + <i class="fa fa-bell fa-2x"></i> + <sub class="badge text-warning">0</sub> + </button> + <button tooltip="Mes paramètres" tooltip-delay="1000" md-icon-button [mdMenuTriggerFor]="myProfil"> + <i class="fa fa-user fa-2x"></i> + </button> + <md-menu #mySetting="mdMenu"> + <button *ngFor="let menu of menuList" routerLink="{{menu.link}}" md-menu-item> + <span><i class="fa {{menu.icon}}"></i> {{menu.label}}</span> + </button> + </md-menu> + <md-menu #myNotif="mdMenu"> + <button md-menu-item disabled> + <span style="opacity:0.5;"><i class="fa fa-times"></i> Aucune notification</span> + </button> + </md-menu> + <md-menu #myProfil="mdMenu"> + <button *ngFor="let profil of profilList" routerLink="{{profil.link}}" md-menu-item> + <span><i class="fa {{profil.style}}"></i> {{profil.label}}</span> + </button> + </md-menu> + <md-menu #myAdmin="mdMenu"> + <button *ngFor="let admin of adminList" routerLink="{{admin.servicepage}}" tooltip="{{admin.comment}}" tooltip-position="before" tooltip-delay="1000" md-menu-item [disabled]="admin.angular == 'false'"> + <span><i class="fa {{admin.style}}"></i> {{admin.name}}</span> + </button> + <button *ngFor="let adminMod of adminListModule" routerLink="{{adminMod.servicepage}}" tooltip="{{adminMod.comment}}" tooltip-position="before" tooltip-delay="1000" md-menu-item [disabled]="adminMod.angular == 'false'"> + <span><i class="fa {{adminMod.style}}"></i> {{adminMod.name}}</span> + </button> + </md-menu> + <md-menu #searchTarget="mdMenu"> + <button md-menu-item> + <span>Courriers</span> + </button> + <button md-menu-item> + <span>Contacts</span> + </button> + </md-menu> +</md-toolbar> diff --git a/apps/maarch_entreprise/Views/history-administration.component.html b/apps/maarch_entreprise/Views/history-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..dd807a1db4cc1559bdb5912c8a111fdd1a81a0b9 --- /dev/null +++ b/apps/maarch_entreprise/Views/history-administration.component.html @@ -0,0 +1,84 @@ +<div class="page-header"> + <h1>{{lang.administration}} {{lang.history}} <small>{{data.length}} {{lang.entries}}</small></h1> +</div> +<div *ngIf="loading"> + <md-spinner style="margin:auto;"></md-spinner> +</div> +<div *ngIf="!loading" class="container-fluid"> + <div class="col-md-12"> + <table id="usersTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'info' : search | dataPipe : 'user_id' : filterUser | dataPipe : 'event_type' : filterEventType" + #md2="md2DataTable" [sortBy]='event_date' [rowsPerPage]="10"> + <thead> + <tr> + <td colspan="5"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md2-datepicker name="mindate" placeholder="{{lang.dataOfMonth}} :" type="month" [(ngModel)]="minDate" #minDateControl="ngModel" + (change)="refreshHistory()"> + </md2-datepicker> + + </td> + </tr> + <tr class="filters"> + <td colspan="6"> + <md2-accordion> + <md2-accordion-tab> + <md2-accordion-header class="text-primary">{{lang.filterBy}} : </md2-accordion-header> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="col-sm-4"> + <md-input-container> + <input mdInput placeholder="{{lang.desc}}" [(ngModel)]="search" /> + </md-input-container> + </div> + <div class="col-sm-4"> + <md2-select placeholder="Utilisateur cible" [(ngModel)]="filterUser" #filterUsersSelect="ngModel" style="padding:0px;padding-top: 15px;"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" type="text" placeholder="Filtre" [(ngModel)]="_search" autocomplete="off" /> + </md-input-container> + </md2-select-header> + <md2-option style="font-style:italic;color:grey;">{{lang.noSelection}}</md2-option> + <md2-option *ngFor="let filter of filterUsers | dataPipe : 'user_id' : _search" [value]="filter.user_id">{{filter.user_id}}</md2-option> + </md2-select> + </div> + <div class="col-sm-4"> + <md2-select placeholder="Evenement cible" [(ngModel)]="filterEventType" #filterUsersSelect="ngModel" style="padding:0px;padding-top: 15px;"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" type="text" placeholder="Filtre" [(ngModel)]="_search" autocomplete="off" /> + </md-input-container> + </md2-select-header> + <md2-option style="font-style:italic;color:grey;">{{lang.noSelection}}</md2-option> + <md2-option *ngFor="let filter of filterEventTypes | dataPipe : 'event_type' : _search" [value]="filter.event_type">{{filter.event_type}}</md2-option> + </md2-select> + </div> + </div> + </div> + </md2-accordion-tab> + </md2-accordion> + </td> + </tr> + <tr> + <th md2SortBy="event_date" style="width:10%;">{{lang.date}}</th> + <th md2SortBy="event_type" style="width:10%;">{{lang.event}}</th> + <th md2SortBy="user_id" style="width:15%;">{{lang.user}}</th> + <th md2SortBy="table_name" style="width:15%;">{{lang.table}}</th> + <th md2SortBy="info" style="width:40%;">{{lang.desc}}</th> + <th md2SortBy="info" style="width:10%;">{{lang.ip}}</th> + </tr> + </thead> + <tbody> + <tr *ngFor="let history of md2.data"> + <td style="vertical-align:middle;">{{history.event_date | date : "dd/MM/y HH:mm"}}</td> + <td style="vertical-align:middle;">{{history.event_type}}</td> + <td style="vertical-align:middle;">{{history.user_id}}</td> + <td style="vertical-align:middle;">{{history.table_name}}</td> + <td style="vertical-align:middle;">{{history.info}}</td> + <td style="vertical-align:middle;">{{history.remote_ip}}</td> + </tr> + </tbody> + </table> + </div> +</div> diff --git a/apps/maarch_entreprise/Views/historyBatch-administration.component.html b/apps/maarch_entreprise/Views/historyBatch-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..9b471ea567e2785ddfd361272399a19163a767d6 --- /dev/null +++ b/apps/maarch_entreprise/Views/historyBatch-administration.component.html @@ -0,0 +1,76 @@ +<div class="page-header"> + <h1>{{lang.administration}} {{lang.historyBatch}} <small>{{data.length}} {{lang.entries}}</small></h1> +</div> +<div *ngIf="loading"> + <md-spinner style="margin:auto;"></md-spinner> +</div> +<div *ngIf="!loading" class="container-fluid"> + <div class="col-md-12"> + <table id="usersTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'info' : search | dataPipe : 'user_id' : filterUser | dataPipe : 'event_type' : filterEventType" + #md2="md2DataTable" [sortBy]='event_date' [rowsPerPage]="10"> + <thead> + <tr> + <td colspan="5"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md2-datepicker name="mindate" placeholder="{{lang.dataOfMonth}} :" type="month" [(ngModel)]="minDate" #minDateControl="ngModel" + (change)="refreshHistory()"> + </md2-datepicker> + + </td> + </tr> + <tr class="filters"> + <td colspan="6"> + <md2-accordion> + <md2-accordion-tab> + <md2-accordion-header class="text-primary">{{lang.filterBy}} : </md2-accordion-header> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="col-sm-4"> + <md-input-container> + <input mdInput placeholder="{{lang.desc}}" [(ngModel)]="search" /> + </md-input-container> + </div> + <div class="col-sm-4"> + <md2-select placeholder="Module cible" [(ngModel)]="filterModule" #filterUsersSelect="ngModel" style="padding:0px;padding-top: 15px;"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" type="text" placeholder="Filtre" [(ngModel)]="_search" autocomplete="off" /> + </md-input-container> + </md2-select-header> + <md2-option style="font-style:italic;color:grey;">{{lang.noSelection}}</md2-option> + <md2-option *ngFor="let filter of filterModules | dataPipe : 'module_name' : _search" [value]="filter.module_name">{{filter.module_name}}</md2-option> + </md2-select> + </div> + <div class="col-sm-4"> + + </div> + </div> + </div> + </md2-accordion-tab> + </md2-accordion> + </td> + </tr> + <tr> + <th md2SortBy="batch_id" style="width:5%;">{{lang.id}}</th> + <th md2SortBy="event_date" style="width:15%;">{{lang.date}}</th> + <th md2SortBy="total_processed" style="width:15%;">{{lang.totalProcessed}}</th> + <th md2SortBy="total_errors" style="width:15%;">{{lang.totalErrors}}</th> + <th md2SortBy="info" style="width:40%;">{{lang.desc}}</th> + <th md2SortBy="module_name" style="width:10%;">{{lang.module}}</th> + </tr> + </thead> + <tbody> + <tr *ngFor="let history of md2.data"> + <td style="vertical-align:middle;">{{history.batch_id}}</td> + <td style="vertical-align:middle;">{{history.event_date | date : "dd/MM/y HH:mm"}}</td> + <td style="vertical-align:middle;">{{history.total_processed}}</td> + <td style="vertical-align:middle;">{{history.total_errors}}</td> + <td style="vertical-align:middle;">{{history.info}}</td> + <td style="vertical-align:middle;">{{history.module_name}}</td> + </tr> + </tbody> + </table> + </div> +</div> diff --git a/apps/maarch_entreprise/Views/parameter-administration.component.html b/apps/maarch_entreprise/Views/parameter-administration.component.html index f22e8b2562a991b28df3389e30c3169edba0b801..ce9f5704a3fe8b59042f3cf753a8889a6008c0e6 100755 --- a/apps/maarch_entreprise/Views/parameter-administration.component.html +++ b/apps/maarch_entreprise/Views/parameter-administration.component.html @@ -1,64 +1,61 @@ -<div id="resultInfo" class="fade" style="display:none;"> - {{resultInfo}} +<div class="page-header"> + <h1 *ngIf="!creationMode">{{lang.parameterModification}} <small>{{parameter.id}}</small></h1> + <h1 *ngIf="creationMode">{{lang.parameterCreation}} <small>{{parameter.id}}</small></h1> </div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration/parameters" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - - </ul> - </div> - </div> - </nav> - <h1 style="margin-top: 0"><i class="fa fa-check-wrench fa-2x"></i> {{pageTitle}}</h1> - <div class="container-fluid" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> + <div class="container-fluid"> <div class="col-md-6 col-md-offset-3"> <form class="form-horizontal" (ngSubmit)="onSubmit()" #parameterFormUp="ngForm"> <div class="form-group"> <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-hashtag" title="{{this.lang.identifier}}"></i><sup class="mandatory" title="champ requis">*</sup></span> - <input [(ngModel)]="parameter.id" [disabled]="!creationMode" required class="form-control" name="id" id="id" title="{{lang.desc}}" type="text" placeholder="{{this.lang.identifier}}" required> - </div> + <md-input-container> + <input mdInput [(ngModel)]="parameter.id" [disabled]="!creationMode" required name="id" id="id" title="{{lang.id}}" type="text" placeholder="{{lang.id}}" required> + </md-input-container> </div> </div> <div class="form-group"> <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-tag" title="{{this.lang.description}}"></i><sup class="mandatory" title="champ requis"></sup></span> - <input [(ngModel)]="parameter.description" class="form-control" name="description" id="description" title="{{lang.description}}" type="text" placeholder="{{this.lang.description}}"> - </div> + <md-input-container> + <input mdInput [(ngModel)]="parameter.description" name="description" id="description" title="{{lang.desc}}" type="text" placeholder="{{lang.desc}}"> + </md-input-container> </div> </div> <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-bullseye" title="{{this.lang.type}}"></i><sup class="mandatory" title="champ requis"></sup></span> - <select name="type" id="type" [disabled]="!creationMode" [(ngModel)]="type" class="forms-select form-control" #selectType> - <option value="string" [(ngValue)]="string">{{this.lang.string}}</option> - <option value="int" [(ngValue)]="int">{{this.lang.integer}}</option> - <option value="date" [(ngValue)]="date">{{this.lang.date}}</option> - </select> - </div> + <div class="col-sm-6"> + <md2-select + style="margin-top:10px;" + id="type" + name="type" + placeholder="{{lang.type}}" + [(ngModel)]="type" + required + [disabled]="!creationMode" + #selectType> + <md2-option value="string" >{{lang.string}}</md2-option> + <md2-option value="int">{{lang.integer}}</md2-option> + <md2-option value="date">{{lang.date}}</md2-option> + </md2-select> </div> - </div> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-code" title="{{this.lang.value}}"></i><sup class="mandatory" title="champ requis">*</sup></span> - <input *ngIf = "type == 'string'" [(ngModel)]="parameter.param_value_string" class="form-control" name="paramValue" id="paramValue" title="{{this.lang.value}}" type="text" placeholder="{{this.lang.value}}" required> - <input *ngIf = "type == 'int'" [(ngModel)]="parameter.param_value_int" class="form-control" name="paramValue" id="paramValue" title="{{this.lang.value}}" type="number" placeholder="{{this.lang.value}}" required> - <input *ngIf = "type == 'date'" [(ngModel)]="parameter.param_value_date" class="form-control" name="paramValue" id="paramValue" title="{{this.lang.value}}" type="date" placeholder="{{this.lang.value}}" required> - </div> + <div class="col-sm-6"> + + <md-input-container *ngIf = "type == 'string'"> + <input mdInput [(ngModel)]="parameter.param_value_string" name="paramValue" id="paramValue" title="{{lang.value}}" type="text" placeholder="{{lang.value}}"> + </md-input-container> + <md-input-container *ngIf = "type == 'int'"> + <input mdInput [(ngModel)]="parameter.param_value_int" name="paramValue" id="paramValue" title="{{lang.value}}" type="text" placeholder="{{lang.value}}"> + </md-input-container> + <md2-datepicker *ngIf = "type == 'date'" + name="paramValue" + placeholder="{{this.lang.value}}" + [(ngModel)]="parameter.param_value_date" + mode="auto" + format="dd-MM-y" + #minDateControl="ngModel" + isOpenOnFocus> + </md2-datepicker> </div> </div> <div class="col-sm-12" style="text-align:center;"> diff --git a/apps/maarch_entreprise/Views/parameters-administration.component.html b/apps/maarch_entreprise/Views/parameters-administration.component.html index 39989cb7db27feeacae2405149cd687242fabf82..e8fbed04d3b7e386757fb53f8642cf7ae4a882f7 100755 --- a/apps/maarch_entreprise/Views/parameters-administration.component.html +++ b/apps/maarch_entreprise/Views/parameters-administration.component.html @@ -1,42 +1,41 @@ -<div id="resultInfo" class="fade" style="display:none;"> - {{resultInfo}} +<div class="page-header"> + <h1>{{lang.administration}} {{lang.parameters}} <small>{{data.length}} {{lang.parameters}}</small></h1> </div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <h1 style="margin-top: 0"><i class="fa fa-wrench fa-2x"></i> {{lang.admin}} {{lang.parameters}} : {{parametersList.length}} {{lang.parameter}}(s)</h1> - <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - <li style="cursor: pointer" routerLink="/administration/parameters/new"> - <a title="{{lang.new_parameter}}"><i class="fa fa-wrench"></i><sup><i class="fa fa-plus"></i></sup></a> - </li> - </ul> - </div> - </div> - </nav> <div class="col-md-12"> - <table id ="paramsTable" class="display" style="display:none;"> + <table id ="paramsTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'id' : search" #md2="md2DataTable" [sortBy]='id' [rowsPerPage]="10"> <thead> <tr> - <th style="width:10%;"><span>{{lang.identifier}}</span></th> - <th style="width:30%;"><span>{{lang.description}}</span></th> - <th style="width:30%;"><span>{{lang.value}}</span></th> + <td colspan="5"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md-input-container> + <input mdInput placeholder="{{lang.filterBy}} : {{lang.id}}" class="searchTable" [(ngModel)]="search" /> + </md-input-container> + + <a class="text-primary" style="cursor: pointer" routerLink="/administration/parameters/new" title="{{lang.addUser}}"><i class="fa fa-wrench fa-2x"></i><sup><i class="fa fa-plus"></i></sup></a> + </td> + </tr> + <tr> + <th md2SortBy="id"style="width:10%;"><span>{{lang.id}}</span></th> + <th md2SortBy="description"style="width:30%;"><span>{{lang.desc}}</span></th> + <th md2SortBy="param_value_string"style="width:10%;"><span>{{lang.value}}</span></th> + <th md2SortBy="param_value_int"style="width:10%;"><span>{{lang.value}}</span></th> + <th md2SortBy="param_value_date"style="width:10%;"><span>{{lang.value}}</span></th> <th style="width:30%;"><span> </span></th> </tr> </thead> <tbody> - <tr *ngFor="let parameter of parametersList" id="{{parameter.id}}"> - <td style="width:10%;"> {{parameter.id}} </td> - <td style="width:30%;"> {{parameter.description}} </td> - <td style="width:30%;"> {{parameter.param_value_string || parameter.param_value_int || parameter.param_value_date}} </td> + <tr *ngFor="let parameter of md2.data"> + <td style="width:10%;vertical-align:middle;">{{parameter.id}}</td> + <td style="width:30%;vertical-align:middle;">{{parameter.description}}</td> + <td style="width:10%;vertical-align:middle;">{{parameter.param_value_string}}</td> + <td style="width:10%;vertical-align:middle;">{{parameter.param_value_int}}</td> + <td style="width:10%;vertical-align:middle;">{{parameter.param_value_date}}</td> <td style="text-align:right;width:30%;"> <div class="btn-group" role="group"> <button routerLink="/administration/parameters/{{parameter.id}}" type="button" class="btn btn-default" title="{{lang.modify}}"> diff --git a/apps/maarch_entreprise/Views/status-administration.component.html b/apps/maarch_entreprise/Views/status-administration.component.html index d3b4862a0884fc159b0bbebf53e61f2d52331c57..74150cad34a00fb2c5b25ee5c1447eb57eefa0fc 100755 --- a/apps/maarch_entreprise/Views/status-administration.component.html +++ b/apps/maarch_entreprise/Views/status-administration.component.html @@ -1,104 +1,87 @@ +<div class="page-header"> + <h1 *ngIf="!creationMode">{{lang.statusModification}} <small>{{status.id}}</small></h1> + <h1 *ngIf="creationMode">{{lang.statusCreation}} <small>{{status.id}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> -<nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration/status" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - - </ul> - </div> - </div> -</nav> -<h1 style="margin-top: 0"><i class="fa fa-check-circle fa-2x"></i> {{pageTitle}}</h1> -<div class="container-fluid" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> -<div class="col-md-6 col-md-offset-3"> - <form class="form-horizontal" (ngSubmit)="submitStatus()" #statusFormUp="ngForm"> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-hashtag" title="{{lang.identifier}}"></i><sup class="mandatory" title="champ requis"><i class="fa fa-asterisk" aria-hidden="true"></i></sup></span> - <input [(ngModel)]="status.id" class="form-control" [disabled]="mode == 'update'" maxlength="10" name="id" id="id" title="{{lang.identifier}}" type="text" required> +<div *ngIf="!loading" class="container-fluid"> + <div class="col-md-6 col-md-offset-3"> + <form class="form-horizontal" (ngSubmit)="submitStatus()" #statusFormUp="ngForm"> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput [(ngModel)]="status.id" [disabled]="mode == 'update'" maxlength="10" name="id" id="id" title="{{lang.id}}" placeholder="{{lang.id}}" type="text" required> + </md-input-container> </div> </div> - </div> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i aria-hidden="true" class="fa fa-tag" title="{{lang.description}}"></i><sup class="mandatory" title="champ requis"><i class="fa fa-asterisk" aria-hidden="true"></i></sup></span> - <input class="form-control" name="label_status" id="label_status" maxlength="50" [(ngModel)]="status.label_status" title="{{lang.description}}" type="text" required> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput name="label_status" id="label_status" maxlength="50" [(ngModel)]="status.label_status" title="{{lang.desc}}" placeholder="{{lang.desc}}" type="text" required> + </md-input-container> </div> </div> - </div> - <div class="form-group"> - <div class="col-sm-4"> - <div class="input-group"> - <span class="input-group-btn"> - <button data-tooltip-content="#infoSearchableTooltip" class="btn btn-default help" type="button"><i class="fa fa-question-circle"></i></button> - </span> - <label class="form-control" for="can_be_searched">{{lang.can_be_searched}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="status.can_be_searched" name="can_be_searched" id="can_be_searched" type="checkbox"> - </span> + <div class="form-group"> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="col-sm-4" style="white-space:nowrap;"> + <md-slide-toggle [(ngModel)]="status.can_be_searched" id="can_be_search" name="can_be_search" color="primary" [checked]="status.can_be_searched == true"> + {{lang.canBeSearched}} + </md-slide-toggle> + <sup> + <i class="fa fa-question-circle" tooltip="Si <b>coché</b>,<br/>le statut <b>{{status.id}}</b> vous <b>proposé</b> pour le critère de recherche STATUS de la recherche avancée de documents."></i> + </sup> + </div> + <div class="col-sm-4" style="white-space:nowrap;"> + <md-slide-toggle [(ngModel)]="status.can_be_modified" id="can_be_modified" name="can_be_modified" color="primary" [checked]="status.can_be_modified == true"> + {{lang.canBeModified}} + </md-slide-toggle> + <sup> + <i class="fa fa-question-circle" tooltip="Si <b>coché</b>,<br/>vous pourrez <b>modifier</b> les meta-données des documents ayant le statut <b>{{status.id}}</b>."></i> + </sup> + </div> + <div class="col-sm-4" style="white-space:nowrap;"> + <md-slide-toggle [(ngModel)]="status.is_folder_status" id="is_folder_status" name="is_folder_status" color="primary" [checked]="status.is_folder_status == true"> + {{lang.isFolderStatus}} + </md-slide-toggle> + <sup> + <i class="fa fa-question-circle" tooltip="Si <b>coché</b>,<br/>le statut <b>{{status.id}}</b> pourra être utilisé pour des <b>bannettes de dossiers</b>."></i> + </sup> + </div> + </div> </div> </div> - <div class="col-sm-4"> - <div class="input-group"> - <span class="input-group-btn"> - <button data-tooltip-content="#infoCanBeModifiedTooltip" class="btn btn-default help" type="button"><i class="fa fa-question-circle"></i></button> - </span> - <label class="form-control" for="can_be_modified">{{lang.can_be_modified}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="status.can_be_modified" type="checkbox" name="can_be_modified" id="can_be_modified"> - </span> + <div class="form-group"> + <div class="col-sm-1"> + <i class="fm {{status.img_filename}} fm-2x text-primary"></i> </div> - </div> - <div class="col-sm-4"> - <div class="input-group"> - <span class="input-group-btn"> - <button data-tooltip-content="#infoIsFolderStatusTooltip" class="btn btn-default help" type="button"><i class="fa fa-question-circle"></i></button> - </span> - <label class="form-control" for="is_folder_status">{{lang.is_folder_status}}</label> - <span class="input-group-addon"> - <input [(ngModel)]="status.is_folder_status" type="checkbox" name="is_folder_status" id="is_folder_status"> - </span> + <div class="col-sm-11"> + <md2-select + id="status" + name="status" + placeholder="{{lang.imgRelated}}" + [(ngModel)]="status.img_filename" + required + #searchStatusIcon="ngModel"> + <md2-select-header> + <md-input-container> + <input mdInput name="search" + type="text" + placeholder="Filtre" + [(ngModel)]="_search" + autocomplete="off" + (focusout)="clearSearch()"/> + </md-input-container> + </md2-select-header> + <md2-option *ngFor="let image of statusImages | dataPipe : 'image_name' : _search" [value]="image.image_name"><i [ngClass]="[image.image_name.indexOf('fm') == 0 ? 'fm' : 'fa']" class="{{image.image_name}} fa-2x"></i> {{image.image_name}}</md2-option> + </md2-select> </div> </div> - </div> - <div id="statusIconList" class="form-group panel panel-default"> - <div class="col-sm-12 panel-heading" style="font-size: 14px;text-align:center;"> - <i class="fa fa-picture-o" aria-hidden="true"></i> {{lang.img_related}} - </div> - <div class="col-sm-12 panel-body"> - <button *ngFor="let image of statusImages" type="button" [ngClass]="[status.img_filename==image.image_name ? 'btn-primary' : 'btn-default']" class="btn btn-group-lg" (click)="selectImage(image.image_name)"> - <i id="img_0" [ngClass]="[image.image_name.indexOf('fm') == 0 ? 'fm' : 'fa']" class="{{image.image_name}}"></i> - </button> + <div class="col-sm-12 panel-body" style="text-align:center;"> + <button class="btn btn-default" type="submit" [disabled]="!statusFormUp.form.valid">{{lang.validate}}</button> + <button class="btn btn-default" routerLink='/administration/status'>{{lang.cancel}}</button> </div> - </div> - <div class="col-sm-12 panel-body" style="text-align:center;"> - <button class="btn btn-default" type="submit" [disabled]="!statusFormUp.form.valid">{{lang.validate}}</button> - <button class="btn btn-default" routerLink='/administration/status'>{{lang.cancel}}</button> - </div> - </form> -</div> -</div> - -<div class="tooltip_templates" style="display: none"> - <span id="infoSearchableTooltip"> - Si <b>coché</b>,<br/> - le statut <b>{{status.id}}</b> vous <b>proposé</b> pour le critère de recherche STATUS de la recherche avancée de documents. - </span> - <span id="infoCanBeModifiedTooltip"> - Si <b>coché</b>,<br/> - vous pourrez <b>modifier</b> les meta-données des documents ayant le statut <b>{{status.id}}</b>. - </span> - <span id="infoIsFolderStatusTooltip"> - Si <b>coché</b>,<br/> - le statut <b>{{status.id}}</b> pourra être utilisé pour des <b>bannettes de dossiers</b>. - </span> + </form> + </div> </div> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/statuses-administration.component.html b/apps/maarch_entreprise/Views/statuses-administration.component.html index 5282ffbf6e8736d616b346ce3ad61809c9bfa2b0..f7ebf58cb076f65906f57f879e7563cd37ea752e 100755 --- a/apps/maarch_entreprise/Views/statuses-administration.component.html +++ b/apps/maarch_entreprise/Views/statuses-administration.component.html @@ -1,49 +1,47 @@ + +<div class="page-header"> + <h1>{{lang.administration}} {{lang.statuses}} <small>{{data.length}} {{lang.statuses}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - <li style="cursor: pointer" routerLink="/administration/status/new"> - <a title="{{lang.newStatus}}"><i class="fa fa-check-circle"></i><sup><i class="fa fa-plus"></i></sup></a> - </li> - </ul> - </div> - </div> - </nav> - <h1 style="margin-top: 0"><i class="fa fa-check-circle fa-2x"></i> {{lang.statusListTitle}} : {{nbStatus}} {{lang.status}}(s)</h1> - - <div class="col-md-12" style="margin-top: 15px"> - <table id="statusTable" class="display"> + <div class="col-md-12"> + <table id="statusTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'label_status' : search" #md2="md2DataTable" [sortBy]='label_status' [rowsPerPage]="10"> <thead> <tr> - <th style="width:50px;"><span>{{lang.img_related}}</span></th> - <th><span>{{lang.identifier}}</span></th> - <th><span>{{lang.description}}</span></th> - <th><span> </span></th> + <td colspan="3"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md-input-container> + <input mdInput placeholder="{{lang.filterBy}} : {{lang.desc}}" class="searchTable" [(ngModel)]="search" /> + </md-input-container> + + <a class="text-primary" style="cursor: pointer" routerLink="/administration/status/new" title="{{lang.addStatus}}"><i class="fa fa-check-circle fa-2x"></i><sup><i class="fa fa-plus"></i></sup></a> + </td> + </tr> + <tr> + <th md2SortBy="id" style="width:50px;"><span>{{lang.imgRelated}}</span></th> + <th md2SortBy="img_filename"><span>{{lang.id}}</span></th> + <th md2SortBy="label_status"><span>{{lang.desc}}</span></th> + <th> </th> </tr> </thead> <tbody> - <tr *ngFor="let status of statusList" id="{{status.id}}"> - <td style="text-align:center;"> - <i class="fm {{status.img_filename}} fm-2x" *ngIf="status.img_filename.indexOf('fm') == 0"></i> - <i class="fa {{status.img_filename}} fa-2x" *ngIf="status.img_filename.indexOf('fa') == 0"></i> + <tr *ngFor="let status of md2.data"> + <td style="text-align:center;vertical-align:middle;"> + <i class="fm {{status.img_filename}} fm-2x text-primary" *ngIf="status.img_filename.indexOf('fm') == 0"></i> + <i class="fa {{status.img_filename}} fa-2x text-primary" *ngIf="status.img_filename.indexOf('fa') == 0"></i> </td> - <td>{{status.id}}</td> - <td>{{status.label_status}}</td> - <td style="text-align:right;"> + <td style="vertical-align:middle;">{{status.id}}</td> + <td style="vertical-align:middle;">{{status.label_status}}</td> + <td style="text-align:right;vertical-align:middle;"> <div class="btn-group" role="group" aria-label="..."> <button routerLink="/administration/status/{{status.identifier}}" type="button" class="btn btn-default" title="{{lang.edit}}"> <a><i style="cursor:pointer" class="fa fa-edit"></i></a> </button> - <button type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteStatus(status.id, status.identifier)"> + <button type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteStatus(status)"> <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> </button> </div> diff --git a/apps/maarch_entreprise/Views/user-administration.component.html b/apps/maarch_entreprise/Views/user-administration.component.html index c0cc2ee8386d2e1aaeb50b6ddfa46d1832ea68bd..5fe0c8c7ba1751d81fc84c20b015a47e51785369 100755 --- a/apps/maarch_entreprise/Views/user-administration.component.html +++ b/apps/maarch_entreprise/Views/user-administration.component.html @@ -1,269 +1,179 @@ +<div class="page-header"> + <h1 *ngIf="!creationMode">{{lang.userModification}} <small>{{user.lastname}} {{user.firstname}}</small></h1> + <h1 *ngIf="creationMode">{{lang.userCreation}} <small>{{user.lastname}} {{user.firstname}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <h1 *ngIf="userCreation" style="margin-top: 0"> - <i class="fa fa-user fa-2x"></i> {{lang.userCreation}} {{user.userId}} - </h1> - <h1 *ngIf="!userCreation" style="margin-top: 0"> - <i class="fa fa-user fa-2x"></i> {{lang.userModification}} : {{userId}} - <sup> - <span *ngIf="user.status == 'OK' && user.enabled == 'Y'" class="label label-primary">{{lang.active}}</span> - <span *ngIf="user.enabled == 'N'" class="label label-danger">{{lang.inactive}}</span> - <span *ngIf="user.status == 'ABS'" class="label label-warning">{{lang.abs}}</span> - </sup> - </h1> - <nav class="navbar navbar-default" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a routerLink="/administration/users" class="navbar-brand" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div *ngIf="!userCreation" class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right userAdministrationClickable"> - <li> - <a (click)="resetPassword()"><i class="fa fa-key"></i> {{lang.reinitPassword}}</a> - </li> - <li *ngIf="user.status == 'ABS'"> - <a (click)="deactivateAbsence()"><i class="fa fa-user"></i> {{lang.deactivateAbs}}</a> - </li> - <li *ngIf="user.status == 'OK'"> - <a data-toggle="modal" data-target="#manageAbs"><i class="fa fa-user-times"></i> {{lang.manageAbsences}}</a> - </li> - <li> - <a data-toggle="modal" data-target="#manageSign"><i class="fa fa-vcard-o"></i> {{lang.manageSignatures}}</a> - </li> - </ul> - </div> - </div> - </nav> - <div class="row row-eq-height"> - <div class="col-md-4" [ngClass]="{'col-md-offset-4': userCreation}" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> - <h2>{{lang.informations}}</h2> - <form class="form-horizontal" (ngSubmit)="onSubmit()" #profileForm="ngForm"> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></span> - <input *ngIf="userCreation" type="text" class="form-control" name="user_id" [(ngModel)]="user.userId" placeholder="{{lang.id}}" pattern="^[\w.@-]*$" required> - <input *ngIf="!userCreation" type="text" class="form-control" title="{{lang.id}}" value="{{user.user_id}}" disabled> - </div> + <div class="container-fluid"> + <md-tab-group (selectChange)="initService()"> + <md-tab label="Informations"> + <div *ngIf="user.status == 'ABS'" class="text-warning" style="position: absolute;opacity: 0.1;font-size: 120px;transform: rotate(324deg);-webkit-transform: rotate(324deg);margin-left: 35%;margin-top: 90px;">{{user.status}}</div> + <div class="col-md-6 col-md-offset-3"> + <div class="example-sidenav-content"> + <form class="form-horizontal" (ngSubmit)="onSubmit()" #profileForm="ngForm"> + <div class="form-group"> + <div class="col-sm-12"> + <div class="pull-left image"> + <img src="img/maarch_box.png" class="img-circle avatar" alt="user profile image"> + </div> + <div class="input-group"> + <!--<span class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></span>--> + <md-input-container> + <input mdInput *ngIf="creationMode" type="text" title="{{lang.id}}" name="user_id" [(ngModel)]="user.userId" placeholder="{{lang.id}}" + pattern="^[\w.@-]*$" required> + + <input mdInput *ngIf="!creationMode" type="text" title="{{lang.id}}" value="{{user.user_id}}" placeholder="{{lang.id}}" disabled> + </md-input-container> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-5" style="font-weight:bold;"> + <md-input-container> + <input mdInput type="text" id="lastname" name="lastname" title="{{lang.lastname}}" placeholder="{{lang.lastname}}" [(ngModel)]="user.lastname" + required> + </md-input-container> + </div> + <div class="col-sm-5" style="font-weight:bold;"> + <md-input-container> + <input mdInput type="text" id="firstname" name="firstname" title="{{lang.firstname}}" placeholder="{{lang.firstname}}" [(ngModel)]="user.firstname" + required> + </md-input-container> + </div> + <div class="col-sm-2" style="font-style:italic;"> + <md-input-container> + <input mdInput type="text" id="initials" name="initials" title="{{lang.initials}}" placeholder="{{lang.initials}}" [(ngModel)]="user.initials"> + </md-input-container> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput type="tel" id="phone" name="phone" title="{{lang.phoneNumber}}" placeholder="{{lang.phoneNumber}}" [(ngModel)]="user.phone" + pattern="^(?:0|\+\d\d?\d?\s?)[1-9]([\.\-\s]?\d\d){4}([\.\-\s]?\d?\d?)$"> + </md-input-container> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput type="email" id="mail" name="mail" title="{{lang.email}}" placeholder="{{lang.email}}" [(ngModel)]="user.mail" + pattern="[^@\s]+@[^@\s]+"> + </md-input-container> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <md-input-container> + <input mdInput type="text" id="fingerprint" name="fingerprint" title="{{lang.fingerprint}}" placeholder="{{lang.fingerprint}}" + [(ngModel)]="user.thumbprint"> + </md-input-container> + </div> + </div> + <div class="form-group"> + <div style="text-align:center;"> + <button *ngIf="creationMode" type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid"><i class="fa fa-plus"></i> {{lang.save}}</button> + <button *ngIf="!creationMode" type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid"><i class="fa fa-save"></i> {{lang.update}}</button> + <button *ngIf="user.status != 'ABS' && !creationMode" type="button" (click)="activateAbsence()" class="btn btn-warning"><i class="fa fa-plane"></i> {{lang.activateAbsence}}</button> + <button *ngIf="user.status == 'ABS' && !creationMode" type="button" (click)="desactivateAbsence()" class="btn btn-success"><i class="fa fa-check"></i> {{lang.desactivateAbsence}}</button> + <button type="button" *ngIf="!creationMode" (click)="resetPassword(user)" class="btn btn-default"><i class="fa fa-key"></i> {{lang.reinitPassword}}</button> + </div> + </div> + </form> </div> </div> - <div class="form-group"> - <div class="col-sm-5" style="font-weight:bold;"> - <input type="text" class="form-control" id="lastname" name="lastname" title="{{lang.lastname}}" placeholder="{{lang.lastname}}" [(ngModel)]="user.lastname" required> - </div> - <div class="col-sm-5" style="font-weight:bold;"> - <input type="text" class="form-control" id="firstname" name="firstname" title="{{lang.firstname}}" placeholder="{{lang.firstname}}" [(ngModel)]="user.firstname" required> - </div> - <div class="col-sm-2" style="font-style:italic;"> - <input type="text" class="form-control" id="initials" name="initials" title="{{lang.initials}}" placeholder="{{lang.initials}}" [(ngModel)]="user.initials"> + </md-tab> + <md-tab *ngIf="!creationMode" label="Groupe(s)"> + <div class="col-md-6"> + <div class="groupList"> + <ul class="list-group col-md-12"> + <li class="list-group-item" *ngFor="let group of user.allGroups"> + <md-slide-toggle id="{{group.group_id}}" color="primary" [checked]="group.disabled == true" (change)="toggleGroup(group)">{{group.group_desc}}</md-slide-toggle> + </li> + </ul> </div> </div> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i class="fa fa-phone" aria-hidden="true"></i></span> - <input type="tel" class="form-control" id="phone" name="phone" title="{{lang.phoneNumber}}" placeholder="{{lang.phoneNumber}}" [(ngModel)]="user.phone" pattern="^(?:0|\+\d\d?\d?\s?)[1-9]([\.\-\s]?\d\d){4}([\.\-\s]?\d?\d?)$"> + <div class="col-md-4 col-md-offset-1"> + <div class="panel" *ngFor="let userGroup of user.groups" [ngClass]="[userGroup.primary_group == 'Y' ? 'panel-primary' : 'panel-default']"> + <div class="panel-heading"> + {{userGroup.group_desc}} <i *ngIf="userGroup.primary_group != 'Y'" class="fa fa-asterisk" aria-hidden="true"></i> </div> - </div> - </div> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i class="fa fa-envelope-o" aria-hidden="true"></i></span> - <input type="email" class="form-control" id="mail" name="mail" title="{{lang.email}}" placeholder="{{lang.email}}" [(ngModel)]="user.mail" pattern="[^@\s]+@[^@\s]+"> + <div class="panel-body"> + <md-input-container> + <input mdInput type="text" id="role" name="role" title="{{lang.role}}" placeholder="{{lang.role}}" [(ngModel)]="userGroup.role" + (focusout)="updateGroup(userGroup)"> + </md-input-container> + <div class="col-md-12"> + <ul class="list-unstyled"> + <li *ngFor="let basket of user.baskets; let i = index"> + <span *ngIf="basket.group_id == userGroup.group_id"> + <md-slide-toggle [(ngModel)]="basket.enabled" color="primary">{{basket.basket_name}} <small class="text-danger" style="font-style:italic;" *ngIf="basket.userToDisplay != '' && basket.enabled">(Redirigé à {{basket.userToDisplay}})</small></md-slide-toggle> + <i (click)="toogleRedirect(basket)" *ngIf="basket.userToDisplay == '' && basket.enabled" mdTooltip="Rediriger la banette à une personne lors de l'activation de l'absence" mdTooltipPosition="above" + class="fa fa-share-square text-primary" style="cursor:pointer;"></i> + <sup><i style="cursor:pointer;" *ngIf="basket.userToDisplay != '' && basket.enabled" mdTooltip="Supprimer la redirection" class="fa fa-times text-danger" aria-hidden="true" (click)="delBasketRedirection(i)"></i></sup> + <div *ngIf="basket.userToDisplay == '' && basket.enabled" id="redirectUser_{{basket.group_id}}_{{basket.basket_id}}" style="display:none;"> + <md2-autocomplete + [items]="userList" + item-text="user_id" + item-value="user_id" + placeholder="utilisateur de redirection" + [(ngModel)]="basket.userToDisplay" + required + (change)="addBasketRedirection(i,basket)"> + </md2-autocomplete> + </div> + </span> + </li> + </ul> + </div> </div> - - </div> - </div> - <div class="form-group"> - <div class="col-sm-12"> - <div class="input-group"> - <span class="input-group-addon"><i class="fa fa-paw" aria-hidden="true"></i></span> - <input type="text" class="form-control" id="fingerprint" name="fingerprint" title="{{lang.fingerprint}}" placeholder="{{lang.fingerprint}}" [(ngModel)]="user.thumbprint"> + <div class="panel-footer"> + <md-input-container> + <input value="{{userGroup.maarch_comment}}" mdInput type="text" title="{{lang.perimeter}}" placeholder="Ressource documentaire" + disabled> + </md-input-container> </div> </div> </div> - <div class="form-group"> - <div style="text-align:center;"> - <button type="submit" class="btn btn-success" [disabled]="!profileForm.form.valid">{{lang.save}}</button> - </div> - </div> - </form> - </div> - <div *ngIf="!userCreation" class="col-md-3 col-md-offset-1" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> - <h2>{{lang.groups}} <i class="fa fa-plus pull-right" data-toggle="modal" data-target="#addGroupModal" style="cursor:pointer;" aria-hidden="true" title="Ajouter un groupe"></i></h2> - <div *ngFor="let group of user.groups" class="col-sm-12 form-group"> - <div class="input-group"> - <div class="input-group-btn"> - <button type="button" style="color:white;" class="btn btn-default dropdown-toggle label-primary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{group.group_desc}} <span class="caret"></span></button> - <ul class="dropdown-menu userAdministrationClickable"> - <li><a (click)="updateGroup(group)">{{lang.save}}</a></li> - <li role="separator" class="divider"></li> - <li><a (click)="deleteGroup(group)">{{lang.delete}}</a></li> - </ul> - </div> - <input type="text" class="form-control" aria-describedby="group_desc" placeholder="{{lang.role}}" [(ngModel)]="group.role"> - </div> - </div> - <div *ngIf="user.groups.length == 0" class="col-sm-12 form-group"> - L'utilisateur n'appartient à aucun groupe. - </div> - </div> - <div *ngIf="!userCreation" class="col-md-3 col-md-offset-1" style="border-left:solid 1px white;border-right:solid 1px white;background-color: #CEE9F1;border-top: solid 2px #FDD16C;border-bottom: solid 2px #FDD16C;padding:10px;"> - <h2>{{lang.entities}} <i class="fa fa-plus pull-right" data-toggle="modal" data-target="#addEntityModal" style="cursor:pointer;" aria-hidden="true" title="Ajouter une entité"></i></h2> - <div *ngFor="let entity of user.entities" class="col-sm-12 form-group"> - <div class="input-group"> - <div class="input-group-btn"> - <button *ngIf="entity.primary_entity == 'Y'" type="button" style="color:white;" class="btn btn-default dropdown-toggle label-primary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" [title]="entity.entity_label">{{entity.entity_id}} <span class="caret"></span></button> - <button *ngIf="entity.primary_entity == 'N'" type="button" style="background-color:#eee;" class="btn btn-default dropdown-toggle label-default" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" [title]="entity.entity_label">{{entity.entity_id}} <span class="caret"></span></button> - <ul class="dropdown-menu userAdministrationClickable"> - <li *ngIf="entity.primary_entity == 'N'"><a (click)="updatePrimaryEntity(entity)">Passer en entité primaire</a></li> - <li><a (click)="updateEntity(entity)">{{lang.save}}</a></li> - <li role="separator" class="divider"></li> - <li><a (click)="deleteEntity(entity)">{{lang.delete}}</a></li> - </ul> - </div> - <input type="text" class="form-control" aria-describedby="group_desc" placeholder="{{lang.role}}" [(ngModel)]="entity.user_role"> + </md-tab> + <md-tab *ngIf="!creationMode" label="Entité(s)"> + <div class="col-md-6"> + <md-input-container> + <input mdInput id="jstree_search" type="text" placeholder="Rechercher une entité"> + </md-input-container> + <div id="jstree"></div> </div> - </div> - <div *ngIf="user.entities.length == 0" class="col-sm-12 form-group"> - L'utilisateur n'appartient à aucune entité. - </div> - </div> - </div> -</div> - -<!-- ADD GROUP --> -<div class="modal fade" id="addGroupModal" tabindex="-1" role="dialog" aria-labelledby="addGroupModalLabel"> - <div class="modal-dialog" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="addGroupModalLabel">Ajouter un groupe</h4> - </div> - <div class="modal-body"> - <form class="form-horizontal"> - <div class="form-group"> - <div class="col-sm-6"> - <select id="groupsSelect" class="form-control"> - <option>{{lang.chooseGroup}}</option> - <option *ngFor="let group of user.allGroups" [disabled]="group.disabled">{{group.group_desc}}</option> - </select> + <div class="col-md-4 col-md-offset-1"> + <div class="panel" *ngFor="let userEntity of user.entities" [ngClass]="[userEntity.primary_entity == 'Y' ? 'panel-primary' : 'panel-default']"> + <div class="panel-heading"> + {{userEntity.entity_label}} <i mdTooltip="Passer en entité primaire" *ngIf="userEntity.primary_entity != 'Y'" + (click)="updatePrimaryEntity(userEntity)" class="fa fa-asterisk text-primary pull-right" style="cursor:pointer;"></i> </div> - <div class="col-sm-6"> - <input id="groupRole" class="form-control" placeholder="{{lang.role}}" type="text"> + <div class="panel-body"> + <md-input-container> + <input mdInput type="text" id="role" name="role" title="{{lang.role}}" placeholder="{{lang.role}}" [(ngModel)]="userEntity.user_role" + (focusout)="updateEntity(userEntity)"> + </md-input-container> </div> </div> - </form> - </div> - <div class="modal-footer"> - <button (click)="addGroup()" type="button" class="btn btn-success">{{lang.validate}}</button> - </div> - </div> - </div> -</div> - -<!-- ADD ENTITY --> -<div class="modal fade" id="addEntityModal" tabindex="-1" role="dialog" aria-labelledby="addEntityModalLabel"> - <div class="modal-dialog" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="addEntityModalLabel">Ajouter une entité</h4> - </div> - <div class="modal-body"> - <form class="form-horizontal"> + </div> + </md-tab> + <md-tab *ngIf="!creationMode" label="Signature(s)"> + <div class="col-md-6 col-md-offset-3"> <div class="form-group"> - <div class="col-sm-6"> - <select id="entitiesSelect" class="form-control"> - <option>Choisissez une entité</option> - <option *ngFor="let entity of user.allEntities" [disabled]="entity.disabled">{{entity.entity_label}}</option> - </select> - </div> - <div class="col-sm-6"> - <input class="form-control" id="entityRole" placeholder="Rôle" type="text"> - </div> + <button (click)="clickOnUploader('uploadSignFile')" mdTooltip="taille de 2 mo maximum" class="form-control btn btn-sm btn-success" + style="width:auto;"> + <i class="fa fa-plus"></i> Ajouter une signature + </button> </div> - </form> - </div> - <div class="modal-footer"> - <button (click)="addEntity()" type="button" class="btn btn-success" >{{lang.validate}}</button> - </div> - </div> - </div> -</div> - -<div id="manageAbs" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"> - <div class="modal-dialog modal-lg" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="myModalLabel">{{lang.manageAbsences}}</h4> - </div> - <div class="modal-body"> - <nav class="navbar navbar-default"> - <div class="container-fluid"> - <form class="navbar-form navbar-left"> - <div class="form-group"> - <select id="selectBasketAbsenceUser" class="form-control"> - <option>{{lang.chooseBasket}}</option> - <option *ngFor="let basket of user.baskets" [disabled]="basket.disabled"> - {{basket.basket_name}} - <span *ngIf="basket.group_id">({{basket.group_id}})</span> - <span *ngIf="basket.userToDisplay">({{basket.userToDisplay}})</span> - </option> - </select> - <span> {{lang.to}} </span> - </div> - <div class="form-group typeahead__container"> - <div class="typeahead__field"> - <input id="absenceUser" type="text" class="form-control" placeholder="{{lang.user}}" autocomplete="off"> - </div> - </div> - </form> - <ul class="nav navbar-nav navbar-right" (click)="addBasketRedirection()" style="cursor: pointer"> - <li><a title="{{lang.save}}"><i class="fa fa-plus"></i></a></li> - </ul> - </div> - </nav> - <ul class="list-group"> - <li class="list-group-item" *ngFor="let uam of userAbsenceModel; let i = index"> - <i class="fa fa-tasks" title="{{uam.basketId}}"></i> {{uam.basketName}} - <span class="pull-right"> - <span class="label label-primary">{{uam.newUser}}</span> - <a (click)="delBasketRedirection(i)" style="cursor: pointer" title="{{lang.delete}}"><i class="fa fa-trash" style="color:red;"></i></a> - </span> - </li> - </ul> - </div> - <div class="modal-footer"> - <button type="button" (click)="activateAbsence()" class="btn btn-default">{{lang.activateAbsence}}</button> - </div> - </div> - </div> -</div> - -<div id="manageSign" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"> - <div class="modal-dialog modal-lg" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title">{{lang.manageSignatures}}</h4> - </div> - <div class="modal-body"> - <ul class="nav nav-tabs" role="tablist"> - <li role="presentation" class="active"><a href="#signatureBookSign" aria-controls="signatureBookSign" role="tab" data-toggle="tab">{{lang.sbSignatures}}</a></li> - </ul> - <div class="tab-content"> - <div role="tabpanel" class="tab-pane active" id="signatureBookSign"> - <div class="row" style="margin-top:5px;"> + <div class="form-group"> + <div class="row" style="margin-top:5px;display:none;"> <form (ngSubmit)="submitSignature()" #signatureForm="ngForm"> <div class="col-md-11"> - <input type="text" [(ngModel)]="signatureModel.label" id="signLabel" name="label" placeholder="{{lang.label}}" class="form-control" required> + <input type="text" [(ngModel)]="signatureModel.label" id="signLabel" name="label" placeholder="{{lang.label}}" class="form-control" + required> <div class="form-inline hide"> <div class="form-group"> <input type="file" name="files[]" id="uploadSignFile" (change)="uploadSignatureTrigger($event)" accept="image/*"> @@ -272,50 +182,71 @@ </div> <div class="col-md-1" style="margin-bottom:5px;"> <button class="form-control btn btn-sm btn-success" type="submit" [disabled]="!signatureForm.form.valid || !signatureModel.size"> - <i class="fa fa-plus"></i> - </button> + <i class="fa fa-plus"></i> + </button> </div> <div [ngClass]="[signatureModel.size != '' ? 'col-md-10' : 'col-md-12']"> <div class="upload-drop-zone" (click)="clickOnUploader('uploadSignFile')" style="cursor:pointer"> - {{lang.clickOn}} <i class="fa fa-upload fa-2x"></i> - (< 2MB) + {{lang.clickOn}} <i class="fa fa-upload fa-2x"></i> ( + < 2MB) </div> </div> - </div> - <div class="col-md-2" *ngIf="signatureModel.size"> - <img id="signaturePreview" src="{{signatureModel.base64ForJs}}" alt="Invalid image" style="width: 100%;"> - </div> - </form> - </div> - <div class="row" id="signList"> - <div *ngFor="let signature of user.signatures; let i = index" class="col-md-3"> - <div class="thumbnail"> - <img src="{{signature.pathToSignatureOnTmp}}" alt="Signature" style="width:auto;height:60px;"> - <div class="caption" style="margin-bottom:0px;"> - <div *ngIf="selectedSignature != i"> - <p title="{{signature.signature_label}}" style="text-overflow: ellipsis;">{{signature.signature_label}}</p> - <a (click)="displaySignatureEditionForm(i)" class="btn btn-success" role="button" title="{{lang.update}}"> - <i class="fa fa-edit"></i> - </a> - <a (click)="deleteSignature(signature.id)" class="btn btn-danger" role="button" title="{{lang.delete}}"> - <i class="fa fa-trash"></i> - </a> - </div> - <div *ngIf="selectedSignature == i"> - <input type="text" [(ngModel)]="selectedSignatureLabel" name="selectedSignatureLabel" placeholder="{{lang.label}}" class="form-control" style="margin-bottom: 10px; font-size: 12px;height:28px"> - <button (click)="updateSignature()" type="button" class="btn btn-success" [disabled]="!selectedSignatureLabel" title="{{lang.update}}"> - <i class="fa fa-check"></i> - </button> - <button (click)="selectedSignature = -1" type="button" class="btn btn-warning" title="{{lang.cancel}}"> - <i class="fa fa-times"></i> - </button> - </div> + <div class="col-md-2" *ngIf="signatureModel.size"> + <img id="signaturePreview" src="{{signatureModel.base64ForJs}}" alt="Invalid image" style="width: 100%;"> </div> + </form> + </div> + <div id="signList"> + <div *ngFor="let signature of user.signatures; let i = index" class="col-md-4" style="margin-bottom:10px;"> + <md-card> + <md-card-header> + <md-card-title> + <md-input-container> + <input mdInput type="text" [(ngModel)]="signature.signature_label" name="selectedSignatureLabel" placeholder="{{lang.label}}" + (focusout)="updateSignature(i)"> + </md-input-container> + </md-card-title> + <i class="fa fa-times text-danger" style="cursor:pointer;" (click)="deleteSignature(signature)"></i> + </md-card-header> + + + <md-card-content> + <img src="{{signature.pathToSignatureOnTmp}}" alt="Signature" style="width:100%;height:60px;"> + </md-card-content> + </md-card> </div> + <div class="clearfix"></div> </div> </div> </div> - </div> - </div> + </md-tab> + <md-tab label="Historique"> + <div class="col-md-12"> + <table id="hisotryTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'info' : search" #md2="md2DataTable" [sortBy]='event_date' [rowsPerPage]="10"> + <thead> + <tr> + <td> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md-input-container> + <input mdInput placeholder="{{lang.filterBy}} : {{lang.desc}}" class="searchTable" [(ngModel)]="search" /> + </md-input-container> + </td> + </tr> + <tr> + <th md2SortBy="event_date">{{lang.date}}</th> + <th md2SortBy="info">{{lang.desc}}</th> + </tr> + </thead> + <tbody> + <tr *ngFor="let history of md2.data"> + <td style="vertical-align:middle;">{{history.event_date | date : "dd/MM/y HH:mm"}}</td> + <td style="vertical-align:middle;">{{history.info}}</td> + </tr> + </tbody> + </table> + </div> + </md-tab> + </md-tab-group> </div> - </div> -</div> + </div> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/users-administration.component.html b/apps/maarch_entreprise/Views/users-administration.component.html index 3fe20b3a770fdc79b92ec8f96465df4c280cb11d..6c77df645fc015dbd16dd505a36c703aeb576df7 100755 --- a/apps/maarch_entreprise/Views/users-administration.component.html +++ b/apps/maarch_entreprise/Views/users-administration.component.html @@ -1,72 +1,71 @@ + +<div class="page-header"> + <h1>{{lang.administration}} {{lang.users}} <small>{{data.length}} {{lang.users}}</small></h1> +</div> <div *ngIf="loading"> - <i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i> + <md-spinner style="margin:auto;"></md-spinner> </div> <div *ngIf="!loading" class="container-fluid"> - <h1 style="margin-top: 0"><i class="fa fa-user fa-2x"></i> {{lang.admin}} {{lang.users}} : {{users.length}} {{lang.users}}</h1> - <nav class="navbar navbar-default" style="font-size:17px !important;" id="toolBox"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" routerLink="/administration" style="cursor: pointer"> - <i class="fa fa-arrow-circle-left" title="{{lang.back}}"></i> - </a> - </div> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav navbar-right"> - <li style="cursor: pointer" routerLink="/administration/users/new"> - <a title="{{lang.addUser}}"><i class="fa fa-user-plus"></i></a> - </li> - </ul> - </div> - </div> - </nav> - <div class="col-md-12" style="margin-top: 1%"> - <table id="usersTable" class="display" style="width: 100%" cellspacing="0" border="0"> - <thead> - <tr> - <th style="width:15%;" valign="bottom" align="left"><span>{{lang.identifier}}</span></th> - <th style="width:20%;" valign="bottom" align="left"><span>{{lang.lastname}}</span></th> - <th style="width:20%;" valign="bottom" align="left"><span>{{lang.firstname}}</span></th> - <th style="width:5%;" valign="bottom" align="left"><span>{{lang.status}}</span></th> - <th style="width:20%;" valign="bottom" align="left"><span>{{lang.mail}}</span></th> - <th style="width:20%;"><span> </span></th> - </tr> - </thead> - <tbody> - <tr *ngFor="let user of users" id="{{user.user_id}}"> - <td>{{user.user_id}}</td> - <td>{{user.lastname}}</td> - <td>{{user.firstname}}</td> - <td> - <span *ngIf="user.status == 'OK' && user.enabled == 'Y'" class="label label-primary">{{lang.active}}</span> - <span *ngIf="user.enabled == 'N'" class="label label-danger">{{lang.inactive}}</span> - <span *ngIf="user.status == 'ABS'" class="label label-warning">{{lang.abs}}</span> - </td> - <td>{{user.mail}}</td> - <td style="text-align:right;"> - <div class="btn-group" role="group" aria-label="..."> - <button routerLink="/administration/users/{{user.id}}" type="button" class="btn btn-default" title="{{lang.edit}}"> - <a><i style="cursor:pointer" class="fa fa-edit"></i></a> - </button> - <button *ngIf="user.enabled == 'Y' && user.inDiffListDest == 'Y'" data-toggle="modal" data-target="#changeDiffListDest" type="button" class="btn btn-default" title="{{lang.suspend}}" (click)="suspendUser(user)"> - <a><i style="cursor:pointer;color:#f0ad4e;" class="fa fa-pause"></i></a> - </button> - <button *ngIf="user.enabled == 'Y' && user.inDiffListDest == 'N'" type="button" class="btn btn-default" title="{{lang.suspend}}" (click)="suspendUser(user)"> - <a><i style="cursor:pointer;color:#f0ad4e;" class="fa fa-pause"></i></a> - </button> + <div class="col-md-12"> + <table id="usersTable" class="table table-hover table-condensed" [md2Data]="data | dataPipe : 'user_id' : search" #md2="md2DataTable" [sortBy]='user_id' [rowsPerPage]="10"> + <thead> + <tr> + <td colspan="5"> + <md2-pagination></md2-pagination> + </td> + <td style="text-align:right;"> + <md-input-container> + <input mdInput placeholder="{{lang.filterBy}} : {{lang.id}}" class="searchTable" [(ngModel)]="search" /> + </md-input-container> + + <a class="text-primary" style="cursor: pointer" routerLink="/administration/users/new" title="{{lang.addUser}}"><i class="fa fa-user-plus fa-2x"></i></a> + </td> + </tr> + <tr> + <th md2SortBy="user_id">{{lang.id}}</th> + <th md2SortBy="lastname">{{lang.lastname}}</th> + <th md2SortBy="firstname">{{lang.firstname}}</th> + <th md2SortBy="status">{{lang.status}}</th> + <th md2SortBy="mail">{{lang.email}}</th> + <th> </th> + </tr> + </thead> + <tbody> + <tr *ngFor="let user of md2.data"> + <td style="vertical-align:middle;">{{user.user_id}}</td> + <td style="vertical-align:middle;">{{user.lastname}}</td> + <td style="vertical-align:middle;">{{user.firstname}}</td> + <td style="vertical-align:middle;"> + <span *ngIf="user.status == 'OK' && user.enabled == 'Y'" class="label label-primary">{{lang.active}}</span> + <span *ngIf="user.enabled == 'N'" class="label label-danger">{{lang.inactive}}</span> + <span *ngIf="user.status == 'ABS'" class="label label-warning">{{lang.abs}}</span> + </td> + <td style="vertical-align:middle;">{{user.mail}}</td> + <td style="text-align:right;"> + <div class="btn-group" role="group" aria-label="..."> + <button routerLink="/administration/users/{{user.id}}" type="button" class="btn btn-default" title="{{lang.edit}}"> + <a><i style="cursor:pointer" class="fa fa-edit"></i></a> + </button> + <button *ngIf="user.enabled == 'Y' && user.inDiffListDest == 'Y'" data-toggle="modal" data-target="#changeDiffListDest" type="button" class="btn btn-default" title="{{lang.suspend}}" (click)="suspendUser(user)"> + <a><i style="cursor:pointer;color:#f0ad4e;" class="fa fa-pause"></i></a> + </button> + <button *ngIf="user.enabled == 'Y' && user.inDiffListDest == 'N'" type="button" class="btn btn-default" title="{{lang.suspend}}" (click)="suspendUser(user)"> + <a><i style="cursor:pointer;color:#f0ad4e;" class="fa fa-pause"></i></a> + </button> - <button *ngIf="user.enabled == 'N'" type="button" class="btn btn-default" title="{{lang.authorize}}" (click)="activateUser(user)"> - <a><i style="cursor:pointer;color:#5cb85c;" class="fa fa-check"></i></a> - </button> - <button *ngIf="user.inDiffListDest == 'Y'" type="button" class="btn btn-default" title="{{lang.delete}}" data-toggle="modal" data-target="#changeDiffListDest" (click)="deleteUser(user)"> - <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> - </button> - <button *ngIf="user.inDiffListDest == 'N'" type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteUser(user)"> - <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> - </button> - </div> - </td> - </tr> - </tbody> + <button *ngIf="user.enabled == 'N'" type="button" class="btn btn-default" title="{{lang.authorize}}" (click)="activateUser(user)"> + <a><i style="cursor:pointer;color:#5cb85c;" class="fa fa-check"></i></a> + </button> + <button *ngIf="user.inDiffListDest == 'Y'" type="button" class="btn btn-default" title="{{lang.delete}}" data-toggle="modal" data-target="#changeDiffListDest" (click)="deleteUser(user)"> + <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> + </button> + <button *ngIf="user.inDiffListDest == 'N'" type="button" class="btn btn-default" title="{{lang.delete}}" (click)="deleteUser(user)"> + <a><i style="cursor:pointer;color: #D9534F" class="fa fa-trash"></i></a> + </button> + </div> + </td> + </tr> + </tbody> </table> </div> </div> @@ -84,16 +83,15 @@ <b>{{this.userDestRedirect.firstname}} {{this.userDestRedirect.lastname}}</b> est en <b>destinataire</b> des modèles liste de difffusion suivante, veuillez choisir un utilisateur de <b>remplacement</b> : </div> <div *ngFor="let userDestRedirectModel of userDestRedirectModels" id="{{userDestRedirectModel.object_id}}" class="form-group"> - <div class="input-group input-group-sm"> - <span class="input-group-addon" id="sizing-addon1"><i class="fa fa-share-alt-square"></i> {{userDestRedirectModel.object_id}} - {{userDestRedirectModel.description}}</span> - <div class="form-group typeahead__container" style="margin-bottom:0px;"> - <div class="typeahead__field"> - <input name="redirectDest_{{userDestRedirectModel.object_id}}" [(ngModel)]="userDestRedirectModel.redirectUserId" type="text" class="form-control redirectDest" placeholder="Utilisateur" autocomplete="off" aria-describedby="sizing-addon1" required> - </div> - </div> - </div> - </div> - + <md2-autocomplete name="userList" + [items]="data" + item-text="user_id" + item-value="user_id" + placeholder="nouveau destinataire pour : {{userDestRedirectModel.title}}" + [(ngModel)]="userDestRedirectModel.redirectUserId" + required> + </md2-autocomplete> + </div> </div> <div class="modal-footer"> <button *ngIf="userDestRedirect.mode == 'del'" type="button" class="btn btn-danger" (click)="deleteUserModal(userDestRedirect)" [disabled]="!changeDiffListDestForm.form.valid">{{lang.delete}} {{lang.user}}</button> diff --git a/apps/maarch_entreprise/admin/history/history.php b/apps/maarch_entreprise/admin/history/history.php index d623789e7fa590eef226a97e8986b7e87d51fc60..9f116380226ec02ef8cb29c02621d19971619f48 100755 --- a/apps/maarch_entreprise/admin/history/history.php +++ b/apps/maarch_entreprise/admin/history/history.php @@ -51,12 +51,12 @@ $core_tools2->manage_location_bar($page_path, $page_label, $page_id, $init, $lev /***********************************************************/ $db = new Database(); -$where = ''; +$where = ''; $arrayPDO = array(); -$label = ''; -$tab = array(); -$modules = array(); -$stmt = $db->query("SELECT DISTINCT id_module FROM ".$_SESSION['tablename']['history']); +$label = ''; +$tab = array(); +$modules = array(); +$stmt = $db->query("SELECT DISTINCT ON(lower(id_module)) id_module FROM history WHERE id_module NOT IN ('null') ORDER BY lower(id_module)"); while ($res = $stmt->fetchObject()) { if ($res->id_module == 'admin') { array_push($modules, array('id' => 'admin', 'label' => _ADMIN)); @@ -124,7 +124,7 @@ if (isset($_REQUEST['search']) || $history_module=$_SESSION['m_admin']['history']['module']; } if (!empty($history_module)) { - $where .= " ".$_SESSION['tablename']['history'].".id_module = ? and"; + $where .= " lower(".$_SESSION['tablename']['history'].".id_module) = lower(?) and"; $arrayPDO = array_merge($arrayPDO, array($history_module)); } } diff --git a/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php b/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php index 0e389c1a67096b3133645bc8108000f40c232406..4620522b8e16ff1958c68269a06a7d1577756e29 100755 --- a/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php +++ b/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php @@ -501,9 +501,13 @@ abstract class contacts_v2_Abstract extends Database <table id="frmcontact_table"> <tr> <td> </td> - <td class="indexing_field"> - <input type="radio" class="check" name="is_corporate" value="Y" <?php if($_SESSION['m_admin']['contact']['IS_CORPORATE_PERSON'] == 'Y'){?> checked="checked"<?php } ?>/ onclick="javascript:show_admin_contacts( true, '<?php functions::xecho($display_value);?>');setContactType('corporate', '<?php echo ($can_add_contact);?>')" id="corpo_yes"><span onclick="$j('#corpo_yes').click();" onmouseover="this.style.cursor='pointer';"><?php echo _IS_CORPORATE_PERSON;?></span> - <input type="radio" class="check" name="is_corporate" value="N" <?php if($_SESSION['m_admin']['contact']['IS_CORPORATE_PERSON'] == 'N'){?> checked="checked"<?php } ?> onclick="javascript:show_admin_contacts( false, '<?php functions::xecho($display_value);?>');setContactType('no_corporate', '<?php echo ($can_add_contact);?>')" id="corpo_no"><span onclick="$j('#corpo_no').click();" onmouseover="this.style.cursor='pointer';"><?php echo _INDIVIDUAL;?></span> + <td class="indexing_field" style="text-align:center"> + <span id="span_corporate"> + <input type="radio" class="check" name="is_corporate" value="Y" <?php if($_SESSION['m_admin']['contact']['IS_CORPORATE_PERSON'] == 'Y'){?> checked="checked"<?php } ?>/ onclick="javascript:show_admin_contacts( true, '<?php functions::xecho($display_value);?>');setContactType('corporate', '<?php echo ($can_add_contact);?>')" id="corpo_yes"><span onclick="$j('#corpo_yes').click();" onmouseover="this.style.cursor='pointer';"><?php echo _IS_CORPORATE_PERSON;?></span> + </span> + <span id="span_no_corporate"> + <input type="radio" class="check" name="is_corporate" value="N" <?php if($_SESSION['m_admin']['contact']['IS_CORPORATE_PERSON'] == 'N'){?> checked="checked"<?php } ?> onclick="javascript:show_admin_contacts( false, '<?php functions::xecho($display_value);?>');setContactType('no_corporate', '<?php echo ($can_add_contact);?>')" id="corpo_no"><span onclick="$j('#corpo_no').click();" onmouseover="this.style.cursor='pointer';"><?php echo _INDIVIDUAL;?></span> + </span> </td> <td> </td> <td> </td> @@ -521,11 +525,13 @@ abstract class contacts_v2_Abstract extends Database </tr> <?php }?> + <script type="text/javascript"> </script> <tr id="contact_types_tr" > <td><?php echo _CONTACT_TYPE;?> :</td> <td class="indexing_field"> <select name="contact_type" id="contact_type" - <?php if($mode == "add"){ + + <?php if($mode == "add"){ ?> onchange="getContacts('<?php echo $_SESSION['config']['businessappurl'];?>index.php?display=true&dir=my_contacts&page=getContacts', this.options[this.selectedIndex].value, 'view');" <?php } ?> > @@ -649,7 +655,25 @@ abstract class contacts_v2_Abstract extends Database </p> </form> - <script type="text/javascript">setContactType("<?php if(isset($_SESSION['m_admin']['contact']['IS_CORPORATE_PERSON']) && $_SESSION['m_admin']['contact']['IS_CORPORATE_PERSON'] == 'N' ){ echo 'no_corporate'; } else { echo 'corporate'; }?>", '<?php echo ($can_add_contact);?>');</script> + <script type="text/javascript"> + if(!checkContactType('no_corporate','<?php echo ($can_add_contact);?>')) + { + $j('#span_no_corporate').css('display','none'); + } else { + setContactType('no_corporate',''); + $j('#corpo_no').prop('checked',true); + } + if(!checkContactType('corporate','<?php echo ($can_add_contact);?>')) + { + $j('#span_corporate').css('display','none'); + } else { + setContactType('corporate',''); + $j('#corpo_yes').prop('checked',true); + } + + + </script> + <?php if($mode=="up" && $admin) diff --git a/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php b/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php index a12047dfc2d2ae66d2250de8ddfe5a2ea5da5304..f2b981de7a3ce5804a1cc6bc9599eb6403b38176 100755 --- a/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php +++ b/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php @@ -293,20 +293,30 @@ abstract class indexing_searching_app_Abstract extends Database $_SESSION['error'] .= $_ENV['categories'][$cat_id]['other_cases']['process_limit_date']['label']." "._WRONG_FORMAT; } if (!empty($post['process_limit_date'])) { - - $processLimitDate = new datetime($post['process_limit_date']); - $processLimitDate = date_add($processLimitDate,date_interval_create_from_date_string('23 hours + 59 minutes + 59 seconds')); - $processLimitDate = (array) $processLimitDate; - - array_push( - $data_ext, - array( - 'column' => 'process_limit_date', - 'value' => $func->format_date_db($processLimitDate['date'],'true','','true'), - 'type' => "date" - ) - ); - } + $processLimitDate = new datetime($post['process_limit_date']); + $processLimitDate = date_add($processLimitDate,date_interval_create_from_date_string('23 hours + 59 minutes + 59 seconds')); + $processLimitDate = (array) $processLimitDate; + + array_push( + $data_ext, + array( + 'column' => 'process_limit_date', + 'value' => $func->format_date_db($processLimitDate['date'],'true','','true'), + 'type' => "date" + ) + ); + } + else + { + array_push( + $data_ext, + array( + 'column' => 'process_limit_date', + 'value' => null, + 'type' => "date" + ) + ); + } if ($core->is_module_loaded('folder')) { diff --git a/apps/maarch_entreprise/class/class_lists_Abstract.php b/apps/maarch_entreprise/class/class_lists_Abstract.php index e01e4a7284c1bb7fb82462765b2f6fa68224c8b7..48b5c7d37aa0ac7342c99b2c53a9167719972088 100755 --- a/apps/maarch_entreprise/class/class_lists_Abstract.php +++ b/apps/maarch_entreprise/class/class_lists_Abstract.php @@ -1262,10 +1262,10 @@ abstract class lists_Abstract extends Database $href = $this->_buildMyLink($this->params['viewDocumentLink'], $resultTheLine, $listKey); if ($core->is_module_loaded('thumbnails') === true && !$isAttachment){ $return .= '<div align="center" class="iconDoc" onmouseover="showThumb(\'thumb_\',\'' . $res_id . '\', \'letterbox_coll\')"><a href="'.$href.'" target="_blank" title="' - ._VIEW_DOC.'"><i class="fa fa-download fa-2x" title="' . _VIEW_DOC . '"></i><span id="thumb_' . $res_id . '" name="thumb_' . $res_id . '"></span></a></div>'; + ._VIEW_DOC.'"><i class="tooltip fa fa-download fa-2x" title="' . _DOWNLOAD_LOCAL_DOC_COPY . '"></i><span id="thumb_' . $res_id . '" name="thumb_' . $res_id . '"></span></a></div>'; } - else $return .= '<div align="center" class="iconDoc"><a href="'.$href.'" target="_blank" title="' - ._VIEW_DOC.'"><i class="fa fa-download fa-2x" title="' . _VIEW_DOC . '"></i></a></div>'; + else $return .= '<div align="right" class="iconDoc" style="" ><a href="'.$href.'" target="_blank" title="' + ._VIEW_DOC.'"><i class="tooltip fa fa-download fa-2x" title="' . _DOWNLOAD_LOCAL_DOC_COPY . '"></i></a></div>'; return $return; } @@ -1606,10 +1606,11 @@ abstract class lists_Abstract extends Database $return = '<a href="' . $_SESSION['config']['businessappurl'] . 'index.php?display=true' . '&module=attachments&page=del_attachment&relation=' . $resultTheLine[1]['value'] . '&id=' . $resultTheLine[0]['value'].'&fromDetail='.$fromDetail.'" class="delete"' . 'onclick="return(confirm(\'' . _REALLY_DELETE . ' ?\n\r\n\r' - . _DEFINITIVE_ACTION . '\'));"><i class="fa fa-trash-o fa-lg" title="'._DELETE.'"></i></a>'; + . _DEFINITIVE_ACTION . '\'));"><i class="tooltip fa fa-trash-o fa-2x" title="'._DELETE.'"></i></a>'; }else{ - $return = '<a href="" class="delete" style="visibility:hidden;"><i class="fa fa-trash-o fa-lg" title="'._DELETE.'"></i></a>'; + $return = '<a href="" class="delete" style="visibility:hidden;"><i class="tooltip fa fa-trash-o fa-2x" title="'._DELETE.'"></i></a>'; } + $return .= '<script>titleWithTooltipsterClass("tooltip");</script>'; return $return; } @@ -1634,12 +1635,12 @@ abstract class lists_Abstract extends Database $core_tools = new core_tools(); if (($core_tools->test_service('modify_attachments', 'attachments', false) || $typist == $_SESSION['user']['UserId']) && $status <> "TRA") { - $return = '<a href="javascript://" class="change" onclick="modifyAttachmentsForm(\'' . $_SESSION['config']['businessappurl'] + $return = '<a style="padding-left:10px;" href="javascript://" class="change" onclick="modifyAttachmentsForm(\'' . $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=attachments&page=attachments_content&id=' . $resultTheLine[0]['value'] . '&relation='.$relation.'&fromDetail='.$fromDetail.'\',\'98%\',\'auto\');"> - <i class="fa fa-pencil fa-lg" title="'._MODIFY.'"></i></a>'; + <i class="tooltip fa fa-pencil fa-2x fa-lg" title="'._MODIFY.'"></i></a>'; }else{ $return = '<a href="javascript://" disabled="disabled" class="change" style="visibility:hidden;"> - <i class="fa fa-pencil fa-lg" title="'._MODIFY.'"></i></a>'; + <i class="tooltip fa fa-pencil fa-2x" title="'._MODIFY.'"></i></a>'; } return $return; @@ -1668,7 +1669,8 @@ abstract class lists_Abstract extends Database $fromDetail = $resultTheLine[$iresults]['fromDetail']; } } - $return = '<input type="checkbox" name="final" id="final" '; + $return = '<input type="checkbox" name="final" id="final" align="left"'; + if ($resultTheLine[2]['value_bis'] == "TRA") { $return .= 'checked '; diff --git a/apps/maarch_entreprise/css/action-administration.component.css b/apps/maarch_entreprise/css/action-administration.component.css index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8b137891791fe96927ad78e64b0aad7bded08bdc 100755 --- a/apps/maarch_entreprise/css/action-administration.component.css +++ b/apps/maarch_entreprise/css/action-administration.component.css @@ -0,0 +1 @@ + diff --git a/apps/maarch_entreprise/css/engine.css b/apps/maarch_entreprise/css/engine.css index b89c98bfd04e3661ca3a69a068a5492f7bfdd445..73c46878603020f861277daec2fc5fcf89b7215f 100755 --- a/apps/maarch_entreprise/css/engine.css +++ b/apps/maarch_entreprise/css/engine.css @@ -1,180 +1,108 @@ -/*HeaderV2*/ -#headerV2 .nav .open > a, .nav .open > a:focus, .nav .open > a:hover{ - background-color: inherit !important; -} - -/* Alert info*/ -#resultInfo{ - top :10px; - text-align: center; - position: fixed; - width: 30%; - right: 10px; - z-index: 1051; - -moz-box-shadow: 0px 0px 5px 0px #656565; - -webkit-box-shadow: 0px 0px 5px 0px #656565; - -o-box-shadow: 0px 0px 5px 0px #656565; - box-shadow: 0px 0px 5px 0px #656565; - filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=NaN, Strength=5); -} -form .form-group{ - margin-bottom: 15px; +/******* CORECTION BUG CSS WITH V1 (A SUPPRIMER A LA FIN) *********/ +.page-header h1{ + margin-top: 10px !important; } -/* toolbox in admin */ -#toolBox{ - margin-top:10px !important; - margin-bottom: 10px !important; -} - -/* modal part */ -.modal-content{ - background-color: #009DC5 !important; -} -.modal-header h4{ - color: white !important; -} -.modal-body{ - background-color: white; - padding:10px; - min-height: 200px; - max-height: 70vh; - overflow: hidden; - overflow-y: auto; +#menu{ + margin-top: 35px !important; } -.modal-body .list-group li{ - /*border-color: #009DC5 !important;*/ - font-weight: bold; +#menunav{ + font-size: 90% !important; } -.modal-footer{ - background:white; +#menu span{ + background-size: 45% !important; } -/* datatables part */ -table.dataTable thead .sorting { - background-image: url("../../node_modules/datatables/media/images/sort_both.png")!important; -} -table.dataTable thead .sorting_asc { - background-image: url("../../node_modules/datatables/media/images/sort_asc.png")!important; -} -table.dataTable thead .sorting_desc { - background-image: url("../../node_modules/datatables/media/images/sort_desc.png")!important; -} -table.dataTable thead .sorting_asc_disabled { - background-image: url("../../node_modules/datatables/media/images/sort_asc_disabled.png")!important; -} -table.dataTable thead .sorting_desc_disabled { - background-image: url("../../node_modules/datatables/media/images/sort_desc_disabled.png")!important; -} -.datatablesCenter .dataTables_paginate{ - float:none !important; - text-align: center !important; -} -.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{ - background:#FDD16C !important; - border:none !important; - color:white !important; -} -.dataTables_wrapper .dataTables_paginate .paginate_button:hover :not(.disabled) :not(.current){ - background: white !important; - border:solid 1px white !important; - border-radius: 2px !important; - color:#333 !important; -} -.dataTables_wrapper .dataTables_paginate .paginate_button:active{ - background: none !important; - box-shadow: none !important; +#gauchemenu{ + top: 28px !important; + height: 38px !important; } -.dataTables_wrapper .dataTables_paginate .paginate_button:hover :not(.disabled) :not(.current) i{ - color: #009DC5 !important; +#logo{ + height: 66px !important; } -.dataTables_wrapper .dataTables_paginate .paginate_button:active :not(.disabled) :not(.current) i{ - color: #FDD16C !important; +#menunav{ + width: 264px !important; } -.dataTables_wrapper .dataTables_paginate .paginate_button .disabled:hover{ - background: none !important; - border:solid 1px white !important; - border-radius: 2px !important; +#ariane{ + top: -5px !important; + font-size: 0.8em !important; } -table.dataTable.display tbody tr.odd { - background-color: #DEEDF3 !important; +.footer_menu{ + font-size: 0.7em !important; + height: 18px !important; } -table.dataTable.hover tbody tr.even:hover, table.dataTable.display tbody tr.even:hover{ - background-color: #fff !important; -} -table.dataTable.hover tbody tr.odd:hover, table.dataTable.display tbody tr.odd:hover{ - background-color: #DEEDF3 !important; -} -table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 { - background-color: #DEEDF3 !important; -} -table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 { - background-color: #DEEDF3 !important; +/************************************************************/ + +.page-header{ + margin-top: 0px; } -table.dataTable thead th, table.dataTable thead td { - border-bottom: 1px solid #009DC5 !important; + +.page-header h1{ + font-size: 30px; } -table.dataTable.no-footer { - border-bottom: 1px solid #009DC5 !important; + +#container{ + padding: 0px !important; } -table.dataTable thead th, table.dataTable tfoot th { - color: #009DC5 !important; +.md2-toast { + display: table; + background-color: #337ab7 !important; + vertical-align: middle; + /*background-color: rgba(63, 81, 181, 0.6) !important;*/ + /*background-color: rgba(0, 0, 0, 0.6) !important;*/ } -a.next{ - background-image: none !important; + +.md2-toast i{ + display: table-cell; + padding:5px; + vertical-align: middle; } -.dataTables_info{ - float: none !important; - color:#666 !important; + +.md2-toast span{ + display: table-cell; + padding:5px; + vertical-align: middle; } -.dataTables_filter input{ - font-size: inherit; +.mat-input-container,.md2-select,md2-datepicker{ + width:100% !important; } -.dataTables_length{ - float:none !important; + +.md2-select{ + padding-bottom: 1.29688em; } -.dataTables_length select{ - width:auto !important; + +.mat-tab-body-wrapper{ + padding: 10px; } -.tooltipster-sidetip.tooltipster-maarch .tooltipster-box { - background: white; - border: solid 2px #009DC5; - border-radius: 3px; - box-shadow: 5px 5px 2px 0 rgba(0,0,0,0.4); - width: 300px; +table tr:not(.filters) .mat-input-container{ + width:200px !important; } -.tooltipster-sidetip.tooltipster-maarch .tooltipster-content { - color: #666; - padding: 8px; +/*HeaderV2*/ +#headerV2 .nav .open > a, .nav .open > a:focus, .nav .open > a:hover{ + background-color: inherit !important; } -.help{ - background: none !important; - border: none !important; +/* modal part */ +.modal-content{ + background-color: #009DC5 !important; } -.help:active,.help:hover{ - background: none !important; - border: none !important; +.modal-header h4{ + color: white !important; } - -.help i{ - font-size: 10px; - position: relative; - top: -6px; - right: -6px; +.modal-body{ + background-color: white; + padding:10px; + min-height: 200px; + max-height: 70vh; + overflow: hidden; + overflow-y: auto; } - -.selectAll, .unselectAll{ - cursor: pointer; - float:left; +.modal-body .list-group li{ + /*border-color: #009DC5 !important;*/ + font-weight: bold; } - -.selectAll:active, .unselectAll:active{ - color: #009DC5 !important; +.modal-footer{ + background:white; } - -.mandatory{ - color:red; -} \ No newline at end of file diff --git a/apps/maarch_entreprise/css/header.component.css b/apps/maarch_entreprise/css/header.component.css index e4f9566d8a4765e308b71b048a4d5c72b9315ac1..172279e09776f577f79be7dbf7cd284ed1253c27 100755 --- a/apps/maarch_entreprise/css/header.component.css +++ b/apps/maarch_entreprise/css/header.component.css @@ -1,140 +1,14 @@ -#headerV2{ - border-radius:0px; - margin-left: -10px; - margin-top: 0px; - margin-right: -10px; - border: solid 2px #009DC5; - background: #009DC5; - color:white; +/deep/ .mat-toolbar-row .mat-icon-button { + margin-left: 5px; + margin-right: 5px; } -#headerV2 .navbar-right .dropdown-toggle{ - color:white !important; +/deep/ .mat-toolbar-row #globalSearch { + margin-left: 20px; } -#headerV2 .breadcrumb{ - padding:0px; - margin-bottom:0px; - background:none; - position:initial; +/deep/ .mat-toolbar-row .badge{ + margin-left: -15px; + margin-top: 10px; + background-color: #a94442 } -#ariane{ - position:initial; -} -#headerV2 .divider{ - background-color: #009DC5 !important; -} -#headerPos{ - margin-top: 3px; -} -#menuList{ - font-size:20px; - height: 40px; -} -#menuList .dropdown-toggle{ - padding-bottom: 8px; - color:white; - font-weight:bold; -} -#menuListContent{ - background-color: #CEE9F1; - border: solid 2px #009DC5; - box-shadow: none; - width: 247px; - padding-bottom: 0px; -} - -#menuListContent a{ - color: #0094D0; - font-size: 12px; - font-weight: normal; - letter-spacing: 0.02em; -} - -#headerPos .navbar-text{ - position: absolute; - margin: 0px; - padding: 15px; - padding-top: 5px; - background: #f2f2f2; - width: 80%; - height: 44px; - top: 26px; - border-top-left-radius: 3px; - left: 262px; - color: #009dc5; - font-weight: bold; - font-size: 1.3em; -} -#headerLogoPos{ - background-color:#f2f2f2; - margin-right:-30px; - margin-top:-34px; -} -#headerLogo{ - margin: 0px; - padding-right: 0px; - padding-top: 0px; - height: 56px; - width: 176px; - background: url(static.php?filename=default_nav_logo_maarch.gif) #f2f2f2; - background-size: 90%; - background-position: center; - background-repeat: no-repeat; -} - -#headerNotification .link{ - text-decoration: underline; - cursor: pointer; -} -#headerNotification .dropdown-menu .badge{ - font-size: 70%; -} -#headerNotification .alert-info a{ - color: #31708f !important; -} -#headerNotification .alert-warning a{ - color: #8a6d3b !important; -} -#headerNotification .alert-danger a{ - color: #a94442 !important; -} - -#menuListContentInfoUser{ - background-color: #1B91BA; - height: 15px; - width: 100%; - font-weight: bold; - font-size: 0.8em; - padding-right: 5px; - padding-left: 5px; - padding-top: 0px; - border-top: 2px solid #FFFFFF; - position: relative; - bottom: 0; -} - -#menuListContentInfoUser span{ - float:left; - font-weight: bold; - font-size: 0.8em; -} -#menuListContentInfoUser a{ - float:right; - font-weight: bold; - font-size: 0.8em; - clear: none; - color: white; - padding: 0px; -} -#menuListContentInfoUser a:hover,#menuListContentInfoUser a:focus{ - background-color: initial; -} - -.notification .badge { - background-color: #a94442; - font-size: 9px; - position: relative; - left: -10px; - top: 5px; -} \ No newline at end of file diff --git a/apps/maarch_entreprise/css/jstree-custom.min.css b/apps/maarch_entreprise/css/jstree-custom.min.css new file mode 100644 index 0000000000000000000000000000000000000000..89b68099e7cdf9daa024d9cc198ab7114227ea37 --- /dev/null +++ b/apps/maarch_entreprise/css/jstree-custom.min.css @@ -0,0 +1 @@ +.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#333;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;-moz-box-shadow:5px 5px 4px -4px #666;-webkit-box-shadow:2px 2px 2px #999;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;-moz-text-shadow:1px 1px 0 #fff;-webkit-text-shadow:1px 1px 0 #fff;text-shadow:1px 1px 0 #fff;-moz-border-radius:1px;-webkit-border-radius:1px;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;-moz-box-shadow:0 0 2px #0a6aa1;-webkit-box-shadow:0 0 2px #0a6aa1;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;-moz-box-shadow:0 0 2px #0a6aa1;-webkit-box-shadow:0 0 2px #0a6aa1;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;-moz-text-shadow:0 0 0 transparent;-webkit-text-shadow:0 0 0 transparent;text-shadow:0 0 0 transparent;-moz-box-shadow:0 0 0 transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-proton .jstree-node,.jstree-proton .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-proton .jstree-anchor,.jstree-proton .jstree-wholerow{transition:background-color .15s,box-shadow .15s,color .15s}.jstree-proton .jstree-hovered{background:#76b6ec;color:#fff;border-radius:3px;box-shadow:inset 0 0 1px #76b6ec}.jstree-proton .jstree-clicked{background:#3392e3;color:#fff;border-radius:3px;box-shadow:inset 0 0 1px #3392e3}.jstree-proton .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-proton .jstree-disabled{background:0 0;color:#666}.jstree-proton .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-proton .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale");-webkit-filter:grayscale(100%)}.jstree-proton .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-proton .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-proton.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;color:inherit;box-shadow:none}.jstree-proton.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#76b6ec;color:#fff}.jstree-proton.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0;color:inherit}.jstree-proton.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#76b6ec;color:#fff}.jstree-proton>.jstree-striped{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-proton>.jstree-wholerow-ul .jstree-hovered,.jstree-proton>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-proton .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-proton .jstree-wholerow-hovered{background:#76b6ec}.jstree-proton .jstree-wholerow-clicked{background:#3392e3;background:-moz-linear-gradient(top,#3392e3 0,#3392e3 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3392e3),color-stop(100%,#3392e3));background:-webkit-linear-gradient(top,#3392e3 0,#3392e3 100%);background:-o-linear-gradient(top,#3392e3 0,#3392e3 100%);background:-ms-linear-gradient(top,#3392e3 0,#3392e3 100%);background:linear-gradient(to bottom,#3392e3 0,#3392e3 100%)}.jstree-proton .jstree-node{min-height:22px;line-height:22px;margin-left:22px;min-width:22px}.jstree-proton .jstree-anchor{line-height:22px;margin:1px 0 2px;height:22px}.jstree-proton .jstree-icon{width:22px;height:22px;line-height:22px}.jstree-proton .jstree-icon:empty{width:22px;height:22px;line-height:22px}.jstree-proton.jstree-rtl .jstree-node{margin-right:22px}.jstree-proton .jstree-wholerow{height:22px}.jstree-proton .jstree-node,.jstree-proton .jstree-icon{background-size:320px 96px;background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png)}.jstree-proton .jstree-node{background-position:-293px -5px;background-repeat:repeat-y}.jstree-proton .jstree-last{background:0 0}.jstree-proton .jstree-open>.jstree-ocl{background-position:-133px -5px}.jstree-proton .jstree-closed>.jstree-ocl{background-position:-101px -5px}.jstree-proton .jstree-leaf>.jstree-ocl{background-position:-69px -5px}.jstree-proton .jstree-themeicon{background-position:-261px -7px}.jstree-proton>.jstree-no-dots .jstree-node,.jstree-proton>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-37px -5px}.jstree-proton>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-5px -5px}.jstree-proton .jstree-disabled{background:0 0}.jstree-proton .jstree-disabled.jstree-hovered{background:0 0}.jstree-proton .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton .jstree-checkbox{background-position:-165px -5px}.jstree-proton .jstree-checkbox:hover{background-position:-165px -37px}.jstree-proton.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton .jstree-checked>.jstree-checkbox{background-position:-229px -5px}.jstree-proton.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton .jstree-checked>.jstree-checkbox:hover{background-position:-229px -37px}.jstree-proton .jstree-anchor>.jstree-undetermined{background-position:-197px -5px}.jstree-proton .jstree-anchor>.jstree-undetermined:hover{background-position:-197px -37px}.jstree-proton>.jstree-striped{background-size:auto 44px}.jstree-proton.jstree-rtl .jstree-node{background-size:320px 96px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-proton.jstree-rtl .jstree-last{background:0 0}.jstree-proton.jstree-rtl .jstree-open>.jstree-ocl{background-position:-133px -37px}.jstree-proton.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-101px -37px}.jstree-proton.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-69px -37px}.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-37px -37px}.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-5px -37px}.jstree-proton .jstree-themeicon-custom{background-color:transparent;background-size:320px 96px;background-image:none;background-position:0 0}.jstree-proton>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/throbber.gif) center center no-repeat}.jstree-proton .jstree-file{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png) -101px -69px no-repeat}.jstree-proton .jstree-folder{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png) -261px -5px no-repeat}.jstree-proton>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-proton{line-height:22px;padding:0 4px}#jstree-dnd.jstree-proton .jstree-ok,#jstree-dnd.jstree-proton .jstree-er{background-size:320px 96px;background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-proton i{background:0 0;width:22px;height:22px;line-height:22px}#jstree-dnd.jstree-proton .jstree-ok{background-position:-5px -69px}#jstree-dnd.jstree-proton .jstree-er{background-position:-37px -69px}.jstree-proton.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-proton.jstree-rtl .jstree-last{background:0 0}.jstree-proton-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-proton-small .jstree-anchor{line-height:18px;margin:1px 0 2px;height:18px}.jstree-proton-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-proton-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-proton-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-proton-small .jstree-wholerow{height:18px}.jstree-proton-small .jstree-node,.jstree-proton-small .jstree-icon{background-size:320px 96px;background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png)}.jstree-proton-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-proton-small .jstree-last{background:0 0}.jstree-proton-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-proton-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-proton-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-proton-small .jstree-themeicon{background-position:-263px -9px}.jstree-proton-small>.jstree-no-dots .jstree-node,.jstree-proton-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-proton-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-proton-small .jstree-disabled{background:0 0}.jstree-proton-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-proton-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton-small .jstree-checkbox{background-position:-167px -7px}.jstree-proton-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-proton-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-proton-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-proton-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-proton-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-proton-small>.jstree-striped{background-size:auto 36px}.jstree-proton-small.jstree-rtl .jstree-node{background-size:320px 96px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-proton-small.jstree-rtl .jstree-last{background:0 0}.jstree-proton-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-proton-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-proton-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-proton-small .jstree-themeicon-custom{background-color:transparent;background-size:320px 96px;background-image:none;background-position:0 0}.jstree-proton-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/throbber.gif) center center no-repeat}.jstree-proton-small .jstree-file{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png) -103px -71px no-repeat}.jstree-proton-small .jstree-folder{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png) -263px -7px no-repeat}.jstree-proton-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-proton-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-proton-small .jstree-ok,#jstree-dnd.jstree-proton-small .jstree-er{background-size:320px 96px;background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-proton-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-proton-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-proton-small .jstree-er{background-position:-39px -71px}.jstree-proton-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-proton-small.jstree-rtl .jstree-last{background:0 0}.jstree-proton-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-proton-large .jstree-anchor{line-height:32px;margin:1px 0 2px;height:32px}.jstree-proton-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-proton-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-proton-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-proton-large .jstree-wholerow{height:32px}.jstree-proton-large .jstree-node,.jstree-proton-large .jstree-icon{background-size:320px 96px;background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png)}.jstree-proton-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-proton-large .jstree-last{background:0 0}.jstree-proton-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-proton-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-proton-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-proton-large .jstree-themeicon{background-position:-256px -2px}.jstree-proton-large>.jstree-no-dots .jstree-node,.jstree-proton-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-proton-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-proton-large .jstree-disabled{background:0 0}.jstree-proton-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-proton-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton-large .jstree-checkbox{background-position:-160px 0}.jstree-proton-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-proton-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-proton-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-proton-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-proton-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-proton-large>.jstree-striped{background-size:auto 64px}.jstree-proton-large.jstree-rtl .jstree-node{background-size:320px 96px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-proton-large.jstree-rtl .jstree-last{background:0 0}.jstree-proton-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-proton-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-proton-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-proton-large .jstree-themeicon-custom{background-color:transparent;background-size:320px 96px;background-image:none;background-position:0 0}.jstree-proton-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/throbber.gif) center center no-repeat}.jstree-proton-large .jstree-file{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png) -96px -64px no-repeat}.jstree-proton-large .jstree-folder{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png) -256px 0 no-repeat}.jstree-proton-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-proton-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-proton-large .jstree-ok,#jstree-dnd.jstree-proton-large .jstree-er{background-size:320px 96px;background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-proton-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-proton-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-proton-large .jstree-er{background-position:-32px -64px}.jstree-proton-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-proton-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:30px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:30px;height:30px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/30px.png);background-position:0 -150px;background-size:90px 180px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/30px.png);background-position:-30px -150px;background-size:90px 180px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-proton-responsive .jstree-container-ul{overflow:hidden}.jstree-proton-responsive .jstree-icon{background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/30px.png);background-size:90px 180px}.jstree-proton-responsive .jstree-node,.jstree-proton-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-responsive .jstree-node{min-height:30px;line-height:30px;margin-left:30px;min-width:30px;white-space:nowrap}.jstree-proton-responsive .jstree-anchor{line-height:38px;height:38px;margin:0}.jstree-proton-responsive .jstree-icon,.jstree-proton-responsive .jstree-icon:empty{margin-top:4px;width:30px;height:30px;line-height:30px}.jstree-proton-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-proton-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:30px}.jstree-proton-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-proton-responsive .jstree-ocl,.jstree-proton-responsive .jstree-themeicon,.jstree-proton-responsive .jstree-checkbox{background-size:90px 180px}.jstree-proton-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-proton-responsive .jstree-closed>.jstree-ocl{background-position:0 -30px!important}.jstree-proton-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-30px 0!important}.jstree-proton-responsive .jstree-themeicon{background-position:-30px -30px}.jstree-proton-responsive .jstree-checkbox,.jstree-proton-responsive .jstree-checkbox:hover{background-position:-30px -60px}.jstree-proton-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton-responsive .jstree-checked>.jstree-checkbox,.jstree-proton-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -60px}.jstree-proton-responsive .jstree-anchor>.jstree-undetermined,.jstree-proton-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -90px}.jstree-proton-responsive>.jstree-striped{background:0 0}.jstree-proton-responsive .jstree-wholerow-ul li{position:relative}.jstree-proton-responsive .jstree-wholerow-ul .jstree-wholerow{position:absolute;top:0;left:-1000px;right:-1000px;width:auto;height:100%}.jstree-proton-responsive .jstree-wholerow{border-top:1px solid rgba(0,0,0,.05);background:rgba(0,0,0,.02);height:30px}.jstree-proton-responsive .jstree-wholerow-hovered{background:#76b6ec}.jstree-proton-responsive .jstree-wholerow-clicked{background:#3392e3}.jstree-proton-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-proton-responsive .jstree-node,.jstree-proton-responsive .jstree-icon,.jstree-proton-responsive .jstree-node>.jstree-ocl,.jstree-proton-responsive .jstree-themeicon,.jstree-proton-responsive .jstree-checkbox{background-image:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/30px.png);background-size:90px 180px}.jstree-proton-responsive .jstree-node{background-position:-60px 0;background-repeat:repeat-y}.jstree-proton-responsive .jstree-last{background:0 0}.jstree-proton-responsive .jstree-leaf>.jstree-ocl{background-position:-30px -90px}.jstree-proton-responsive .jstree-last>.jstree-ocl{background-position:-30px -120px}.jstree-proton-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-proton-responsive .jstree-file{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/30px.png) 0 -120px no-repeat;background-size:90px 180px}.jstree-proton-responsive .jstree-folder{background:url(../../node_modules/jstree-bootstrap-theme/dist/themes/proton/30px.png) -30px -30px no-repeat;background-size:90px 180px}.jstree-proton-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-extralight-webfont.eot);src:url(fonts/titillium/titilliumweb-extralight-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/titillium/titilliumweb-extralight-webfont.woff) format('woff'),url(fonts/titillium/titilliumweb-extralight-webfont.ttf) format('truetype'),url(fonts/titillium/titilliumweb-extralight-webfont.svg#titillium_webthin) format('svg');font-weight:300;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-regular-webfont.eot);src:url(fonts/titillium/titilliumweb-regular-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/titillium/titilliumweb-regular-webfont.woff) format('woff'),url(fonts/titillium/titilliumweb-regular-webfont.ttf) format('truetype'),url(fonts/titillium/titilliumweb-regular-webfont.svg#titillium_webregular) format('svg');font-weight:400;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-bold-webfont.eot);src:url(fonts/titillium/titilliumweb-bold-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/titillium/titilliumweb-bold-webfont.woff) format('woff'),url(fonts/titillium/titilliumweb-bold-webfont.ttf) format('truetype'),url(fonts/titillium/titilliumweb-bold-webfont.svg#titillium_webbold) format('svg');font-weight:700;font-style:normal}@media screen and (-webkit-min-device-pixel-ratio:0){@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-extralight-webfont.svg#titillium_webthin) format('svg');font-weight:300;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-regular-webfont.svg#titillium_webregular) format('svg');font-weight:400;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-bold-webfont.svg#titillium_webbold) format('svg');font-weight:700;font-style:normal}}.jstree-proton{font-family:'Titillium Web',sans-serif,Arial,sans-serif} \ No newline at end of file diff --git a/apps/maarch_entreprise/css/status-administration.component.css b/apps/maarch_entreprise/css/status-administration.component.css index facab33b3c05298b78b7ce983d755dc210423792..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100755 --- a/apps/maarch_entreprise/css/status-administration.component.css +++ b/apps/maarch_entreprise/css/status-administration.component.css @@ -1,25 +0,0 @@ - -#statusIconList i{ - color : #666; - font-size: 18px; -} -#statusIconList button{ - width: 60px; - margin-bottom: 5px; -} -#statusIconList .btn-primary i{ - color:white; -} -.mandatory{ - font-size:7px; - color:red; - top: -1.5em; -} - -label{ - font-weight: normal; -} - -.ng-invalid:not(form) { - border-left: 5px solid #a94442; -} diff --git a/apps/maarch_entreprise/css/user-administration.component.css b/apps/maarch_entreprise/css/user-administration.component.css index d9e1defd75b1e6704e04e2db18445aa22415715e..3d31b32e00f37767ab723b6266095df81e318258 100755 --- a/apps/maarch_entreprise/css/user-administration.component.css +++ b/apps/maarch_entreprise/css/user-administration.component.css @@ -1,100 +1,27 @@ -h2{ - background-color: #009DC5 !important; - color: white !important; - margin-top: -10px !important; - margin-left: -10px !important; - margin-right: -10px !important; - padding: 10px !important; - font-size: 16px !important; +.groupOtherInfo input{ + opacity: 0.5; } -.btn-default:focus.label-primary ,.btn-default:hover.label-primary ,.btn-default.active.label-primary, .btn-default:active.label-primary, .open > .dropdown-toggle.btn-default.label-primary{ - background: #337ab7 !important; +#basketList li{ + font-size: 10px; } -.userAdministrationClickable li { - cursor: pointer; -} - -.ng-invalid:not(form) { - border-left: 5px solid #a94442; -} - -.modal-content{ - background-color: #009DC5 !important; -} -.modal-header h4{ - color: white !important; +#basketList li:before { + /*Using a Bootstrap glyphicon as the bullet point*/ + content: "\f01c"; + font-family: 'FontAwesome'; + font-size: 9px; + margin-right: 5px; } -.modal-body{ - background-color: white; - padding:10px; -} -.modal-body .list-group li{ - /*border-color: #009DC5 !important;*/ - font-weight: bold; -} - -.modal-footer{ - background:white; -} -/* layout.css Style */ -.upload-drop-zone { - font-size: 16px; - height: 100px; - border-width: 2px; - margin-bottom: 20px; +.avatar { + width: 60px; + height: 60px; + display: block; + margin-right: 15px; } -/* skin.css Style*/ -.upload-drop-zone { - color: #ccc; - border-style: dashed; - border-color: #ccc; - line-height: 100px; - text-align: center -} -.upload-drop-zone.drop { - color: #222; - border-color: #222; -} -/* Alert info*/ -#resultInfo{ - top :10px; - text-align: center; - position: absolute; - width: 30%; - right: 10px; - z-index: 1051; - height: 40px; - -moz-box-shadow: 0px 0px 5px 0px #656565; - -webkit-box-shadow: 0px 0px 5px 0px #656565; - -o-box-shadow: 0px 0px 5px 0px #656565; - box-shadow: 0px 0px 5px 0px #656565; - filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=NaN, Strength=5); -} -#signList { - overflow-x:scroll; - overflow-y:hidden; - white-space:nowrap; - margin-right: 0px !important; - margin-left: 0px !important; -} -#signList [class*="col-lg"], #signList [class*="col-md"], #signList [class*="col-sm"] { - float:none; - display:inline-block; - white-space:normal; - vertical-align:top; -} -.caption p{ - white-space: nowrap; - overflow: hidden; -} -.form-control.btn-success[disabled]{ - background-color: #5cb85c; -} -.form-control.btn-primary[disabled]{ - background-color: #286090; -} +.panel-footer /deep/ .mat-input-wrapper{ + margin-bottom:-20px !important; +} \ No newline at end of file diff --git a/apps/maarch_entreprise/css/users-administration.component.css b/apps/maarch_entreprise/css/users-administration.component.css index 48e517f541c284015e1469bb0d3a68a43f3412ae..d430e1d2ccdb891c75682a1e29271dfdc0903766 100755 --- a/apps/maarch_entreprise/css/users-administration.component.css +++ b/apps/maarch_entreprise/css/users-administration.component.css @@ -1,3 +1,4 @@ + button:disabled{ opacity:0.3 !important; } \ No newline at end of file diff --git a/apps/maarch_entreprise/documents_list_with_attachments.php b/apps/maarch_entreprise/documents_list_with_attachments.php index 3bcf78c47146a117d511bc3aab5e0a6e8cd92ec9..caa1d47fd195fdaf2cec8b2fc4ea041222fbe102 100755 --- a/apps/maarch_entreprise/documents_list_with_attachments.php +++ b/apps/maarch_entreprise/documents_list_with_attachments.php @@ -89,7 +89,7 @@ array_push( "contact_firstname", "contact_lastname", "contact_society", "user_lastname", "user_firstname", "priority", "creation_date", "admission_date", "subject", "process_limit_date", "entity_label", "dest_user", "category_id", "type_label", - "exp_user_id", "count_attachment", "alt_identifier", "is_multicontacts", "locker_user_id", "locker_time", "address_id" + "exp_user_id", "count_attachment", "alt_identifier", "is_multicontacts", "locker_user_id", "locker_time", "address_id", "filename" ); if ($core_tools->is_module_loaded("cases") == true) { diff --git a/apps/maarch_entreprise/indexing_searching/change_category_actions.php b/apps/maarch_entreprise/indexing_searching/change_category_actions.php index 4ba0179fa4ea7a81deee67ddcf8ac627d4841b43..3976db13a9388f666d92f50b9dcfbc471073c16f 100755 --- a/apps/maarch_entreprise/indexing_searching/change_category_actions.php +++ b/apps/maarch_entreprise/indexing_searching/change_category_actions.php @@ -7,7 +7,7 @@ $b = new basket(); $_SESSION['category_id'] = $_REQUEST['category_id']; $actions = $b->get_actions_from_current_basket( - $_REQUEST['resId'], $_REQUEST['collId'], 'PAGE_USE', false + $_REQUEST['resId'], $_REQUEST['collId'], 'PAGE_USE', true ); if (count($actions) > 0) { //$frmStr .= '<b>' . _ACTIONS . ' : </b>'; diff --git a/apps/maarch_entreprise/indexing_searching/details.php b/apps/maarch_entreprise/indexing_searching/details.php index 43c7ae4fae2d4979007de4097592721d347f6f17..5db8b2b91ed52aeb2df593da42819433da728484 100755 --- a/apps/maarch_entreprise/indexing_searching/details.php +++ b/apps/maarch_entreprise/indexing_searching/details.php @@ -557,7 +557,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) ?> <?php $detailsExport .= "<h1><center>"._DETAILS_PRINT." : ".$s_id."</center></h1><hr>";?> - <div class="fa fa-tachometer detailsTab DetailsTabFunc TabSelected " id="DetailstachometerTab" style="font-size:2em;padding-left: 15px;<?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')){echo 'padding-right: 0px;';}else{echo 'padding-right: 15px;';}?>" title="<?php echo _PROPERTIES;?>" onclick="tabClicked('DetailstachometerTab',false);"> + <div class="fa fa-info-circle detailsTab DetailsTabFunc TabSelected " id="DetailstachometerTab" style="font-size:2em;padding-left: 15px;<?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')){echo 'padding-right: 0px;';}else{echo 'padding-right: 15px;';}?>" title="<?php echo _PROPERTIES;?>" onclick="tabClicked('DetailstachometerTab',false);"> <sup><span style="font-size: 10px;<?php echo $style; ?>" class="nbResZero">0</span></sup></div> @@ -568,7 +568,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) $pathScriptTab = 'index.php?display=true&page=show_technicalInfo_tab'; $uniqueString .= '<div class="fa fa-cogs DetailsTabFunc" id="DetailsCogdTab" style="font-size:2em;padding-left: 15px;padding-right: 15px;" title="'._TECHNICAL_INFORMATIONS.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');tabClicked(\'DetailsCogdTab\',true);"><sup><span style="font-size: 10px;display: none;" class="nbResZero"></span></sup></div>'; } - $uniqueString .= '<div class="fa fa-gear DetailsTabFunc" id="DetailsGearTab" " style="font-size:2em;padding-left: 15px;'; + $uniqueString .= '<div class="fa fa-share-alt DetailsTabFunc" id="DetailsGearTab" " style="font-size:2em;padding-left: 15px;'; if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) { $uniqueString .= 'padding-right: 0px;'; }else { @@ -616,7 +616,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) if ($core->is_module_loaded('visa')) { $pathScriptTab = 'index.php?display=true&page=show_visa_tab&module=visa&resId='.$s_id.'&collId='.$coll_id.'&destination='.$destination.'&fromDetail=true'; - $uniqueString .= '<div id="visa_tab" class="fa fa-certificate DetailsTabFunc " style="font-size:2em;padding-left: 15px;'; + $uniqueString .= '<div id="visa_tab" class="fa fa-retweet DetailsTabFunc " style="font-size:2em;padding-left: 15px;'; $uniqueString .='padding-right: 15px;" title="'._VISA_WORKFLOW.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');tabClicked(\'visa_tab\',true);"> <sup id="visa_tab_badge"></sup></div>'; //LOAD TOOLBAR BADGE $toolbarBagde_script = 'index.php?display=true&module=visa&page=load_toolbar_visa&resId='.$s_id.'&collId='.$coll_id; @@ -625,7 +625,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) if ($core->is_module_loaded('avis')) { $pathScriptTab = 'index.php?display=true&page=show_avis_tab&module=avis&resId='.$s_id.'&collId='.$coll_id.'&fromDetail=true'; - $uniqueString .= '<div id="avis_tab" class="fa fa-check-square DetailsTabFunc " style="font-size:2em;padding-left: 15px;'; + $uniqueString .= '<div id="avis_tab" class="fa fa-commenting-o DetailsTabFunc " style="font-size:2em;padding-left: 15px;'; $uniqueString .= 'padding-right: 15px;" title="'._AVIS_WORKFLOW.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');tabClicked(\'avis_tab\',true);"> <sup id="avis_tab_badge"></sup></div><div id="page_circuit_avis" style="overflow-x: hidden;">'; $uniqueString .= '</div>'; @@ -658,7 +658,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) $pathScriptTab = 'index.php?display=true&page=show_history_tab&resId=' . $s_id . '&collId=' . $coll_id; - $uniqueString .= '<div class="fa fa-line-chart DetailsTabFunc" id="DetailsLineChartTab" style="font-size:2em;padding-left: 15px;'; + $uniqueString .= '<div class="fa fa-history DetailsTabFunc" id="DetailsLineChartTab" style="font-size:2em;padding-left: 15px;'; if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) { $uniqueString .= 'padding-right: 0px;'; } else { @@ -677,7 +677,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) // $note = ''; $pathScriptTab = 'index.php?display=true&module=notes&page=notes&identifier=' . $s_id . '&origin=document&coll_id=' . $coll_id . '&load&size=full'; - $uniqueString .= '<div id="notes_tab" class="fa fa-pencil DetailsTabFunc" style="font-size:2em;padding-left: 15px;padding-right: 15px;" title="'. _NOTES.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');;tabClicked(\'notes_tab\',true);"> <sup id="notes_tab_badge"></sup></div>'; + $uniqueString .= '<div id="notes_tab" class="fa fa-sticky-note DetailsTabFunc" style="font-size:2em;padding-left: 15px;padding-right: 15px;" title="'. _NOTES.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');;tabClicked(\'notes_tab\',true);"> <sup id="notes_tab_badge"></sup></div>'; //LOAD TOOLBAR BADGE $toolbarBagde_script = 'index.php?display=true&module=notes&page=load_toolbar_notes&resId='.$s_id.'&collId='.$coll_id; $uniqueString .='<script>loadToolbarBadge(\'notes_tab\',\''.$toolbarBagde_script.'\');</script>'; @@ -1168,7 +1168,7 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) ) if ($indexes[$key]['type_field'] == 'input') { ?> - <input type="text" name="<?php functions::xecho($key);?>" id="<?php functions::xecho($key);?>" value="<?php functions::xecho($indexes[$key]['show_value']);?>" <?php if (!isset($indexes[$key]['readonly']) || $indexes[$key]['readonly'] == true){ echo 'readonly="readonly" class="readonly"';}else if ($indexes[$key]['type'] == 'date'){echo 'onclick="showCalender(this);"';}?> size="40" title="<?php functions::xecho($indexes[$key]['show_value']);?>" alt="<?php functions::xecho($indexes[$key]['show_value']);?>" /> + <textarea name="<?php functions::xecho($key);?>" id="<?php functions::xecho($key);?>" value="<?php functions::xecho($indexes[$key]['show_value']);?>" <?php if (!isset($indexes[$key]['readonly']) || $indexes[$key]['readonly'] == true){ echo 'readonly="readonly" class="readonly"';}else if ($indexes[$key]['type'] == 'date'){echo 'onclick="showCalender(this);"';}?> style="width: 200px; " title="<?php functions::xecho($indexes[$key]['show_value']);?>" alt="<?php functions::xecho($indexes[$key]['show_value']);?>" ></textarea> <?php } else diff --git a/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php b/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php index 92d232fddd33b3d09bc97c8c2635c2d6bc07da0f..6f799347e5880f0a9082a9288674b9242c3595f6 100755 --- a/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php +++ b/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php @@ -229,12 +229,11 @@ if($mode == 'normal') { array_push($select[$view], "res_id", "res_id as is_labeled", "alt_identifier", "priority", "status", "subject", "category_id as category_img", "contact_firstname", "contact_lastname", "contact_society", "user_lastname", "user_firstname", "category_id", "dest_user", "type_label", - "creation_date", "entity_label", "address_id", "exp_user_id", "count_attachment", "is_multicontacts"); + "creation_date", "entity_label", "address_id", "exp_user_id", "count_attachment", "is_multicontacts","filename"); //Cases if($core_tools->is_module_loaded("cases") == true) { array_push($select[$view], "case_id", "case_label", "case_description"); } - //Folder if ($core_tools->is_module_loaded("folder")) { array_push($select[$view], "folders_system_id", "folder_name"); @@ -769,7 +768,7 @@ if($mode == 'normal') { $tab[$i][$j]["value_export"] = $tab[$i][$j]['value']; $tab[$i][$j]["value"] = $contact->get_contact_information_from_view($_SESSION['mlb_search_current_category_id'], $contact_lastname, $contact_firstname, $contact_society, $user_lastname, $user_firstname); $tab[$i][$j]["order"]=false; - } + } } } diff --git a/apps/maarch_entreprise/indexing_searching/search_adv.php b/apps/maarch_entreprise/indexing_searching/search_adv.php index ea16b4dd98d87b48cb801f2372fb8a6bdd9d885e..f586bfb30a62c600818c690f5c3ba8218f6d31c7 100755 --- a/apps/maarch_entreprise/indexing_searching/search_adv.php +++ b/apps/maarch_entreprise/indexing_searching/search_adv.php @@ -336,7 +336,19 @@ if($core_tools->is_module_loaded('entities')) } $param['destination_mu'] = array('label' => _DESTINATION_SEARCH, 'type' => 'select_multiple', 'param' => array('field_label' => _DESTINATION_SEARCH, 'label_title' => _CHOOSE_ENTITES_SEARCH_TITLE, -'id' => 'services','options' => $arr_tmp)); + 'id' => 'services','options' => $arr_tmp)); + + $stmt = $conn->query("SELECT DISTINCT ".$table.".initiator, e.short_label FROM ".$table." join ".$_SESSION['tablename']['ent_entities']." e on e.entity_id = ".$table.".initiator + ".$where." group by e.short_label, ".$table.".initiator order by e.short_label"); + //Initiator + $arr_tmp = array(); + while($res = $stmt->fetchObject()) + { + array_push($arr_tmp, array('VALUE' => $res->initiator, 'LABEL' => $res->short_label)); + } + + $param['initiator_mu'] = array('label' => _INITIATORS, 'type' => 'select_multiple', 'param' => array('field_label' => _INITIATORS, 'label_title' => _CHOOSE_ENTITES_SEARCH_TITLE, + 'id' => 'initiatorServices','options' => $arr_tmp)); } diff --git a/apps/maarch_entreprise/indexing_searching/search_adv_result.php b/apps/maarch_entreprise/indexing_searching/search_adv_result.php index 839887123f9a9bd65f11f1962ec56eb550624add..53a75168424fbc8035280cd63955121fe7891cd4 100755 --- a/apps/maarch_entreprise/indexing_searching/search_adv_result.php +++ b/apps/maarch_entreprise/indexing_searching/search_adv_result.php @@ -111,6 +111,7 @@ if (count($_REQUEST['meta']) > 0) { //$func->show_array($tab_id_fields); for ($j=0; $j<count($tab_id_fields);$j++) { // ENTITIES + if ($tab_id_fields[$j] == 'services_chosen' && isset($_REQUEST['services_chosen'])) { $json_txt .= " 'services_chosen' : ["; @@ -119,12 +120,24 @@ if (count($_REQUEST['meta']) > 0) { $json_txt .= "'".$_REQUEST['services_chosen'][$get_i]."',"; } $json_txt = substr($json_txt, 0, -1); - $where_request .= " destination IN (:serviceChosen) "; $where_request .=" and "; $arrayPDO = array_merge($arrayPDO, array(":serviceChosen" => $_REQUEST['services_chosen'])); $json_txt .= '],'; - } elseif ($tab_id_fields[$j] == 'multifield' && !empty($_REQUEST['multifield'])) { + } + elseif ($tab_id_fields[$j] == 'initiatorServices_chosen' && isset($_REQUEST['initiatorServices_chosen'])) { + $json_txt .= " 'initiatorServices_chosen' : ["; + + for ($get_i = 0; $get_i <count($_REQUEST['initiatorServices_chosen']); $get_i++) { + $json_txt .= "'".$_REQUEST['initiatorServices_chosen'][$get_i]."',"; + } + $json_txt = substr($json_txt, 0, -1); + $where_request .= " initiator IN (:initiatorServiceChosen) "; + $where_request .=" and "; + $arrayPDO = array_merge($arrayPDO, array(":initiatorServiceChosen" => $_REQUEST['initiatorServices_chosen'])); + $json_txt .= '],'; + } + elseif ($tab_id_fields[$j] == 'multifield' && !empty($_REQUEST['multifield'])) { // MULTIFIELD : subject, title, doc_custom_t1, process notes $json_txt .= "'multifield' : ['".addslashes(trim($_REQUEST['multifield']))."'],"; $where_request .= "(lower(translate(subject,'ÀÃÂÃÄÅÆÇÈÉÊËÌÃÃŽÃÃÑÒÓÔÕÖØÙÚÛÜÃÞßà áâãäåæçèéêëìÃîïðñòóôõöøùúûýýþÿŔŕ','aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr')) like lower(:multifield) " diff --git a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js index f3e025c30ff6beeac49c10d37ee0ab5c06bc82d6..7a9751a5881f5ed156202d640249fcde1251783d 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.js @@ -12,24 +12,32 @@ Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); var router_1 = require("@angular/router"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var ActionAdministrationComponent = (function () { - function ActionAdministrationComponent(http, route, router) { + function ActionAdministrationComponent(http, route, router, notify) { this.http = http; this.route = route; this.router = router; - this.mode = null; + this.notify = notify; + this.lang = translate_component_1.LANG; + this._search = ''; this.action = {}; this.statusList = []; this.actionPagesList = []; - this.lang = {}; this.categoriesList = []; this.keywordsList = []; this.loading = false; } ActionAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { - if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/actions\"' style='cursor: pointer'>Actions</a> > Modification"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > <a onclick='location.hash = \"/administration/actions\"' style='cursor: pointer'>" + this.lang.actions + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.actionCreation; } + else { + breadCrumb += this.lang.actionModification; + } + $j('#ariane')[0].innerHTML = breadCrumb; }; ActionAdministrationComponent.prototype.prepareActions = function () { $j('#inner_content').remove(); @@ -42,84 +50,63 @@ var ActionAdministrationComponent = (function () { this.updateBreadcrumb(angularGlobals.applicationName); this.route.params.subscribe(function (params) { if (typeof params['id'] == "undefined") { - _this.mode = 'create'; + _this.creationMode = true; _this.http.get(_this.coreUrl + 'rest/initAction') .subscribe(function (data) { _this.action = data.action; - _this.lang = data.lang; - _this.lang.pageTitle = _this.lang.add + ' ' + _this.lang.action; _this.categoriesList = data.categoriesList; _this.statusList = data.statusList; _this.actionPagesList = data.action_pagesList; _this.keywordsList = data.keywordsList; _this.loading = false; - setTimeout(function () { - $j("select").chosen({ width: "100%", disable_search_threshold: 10, search_contains: true }); - }, 0); }); } else { - _this.mode = 'update'; + _this.creationMode = false; _this.http.get(_this.coreUrl + 'rest/administration/actions/' + params['id']) .subscribe(function (data) { - _this.lang = data.lang; _this.action = data.action; - _this.lang.pageTitle = _this.lang.modify_action + ' : ' + _this.action.id; _this.categoriesList = data.categoriesList; _this.statusList = data.statusList; _this.actionPagesList = data.action_pagesList; _this.keywordsList = data.keywordsList; _this.loading = false; - setTimeout(function () { - $j("select").chosen({ width: "100%", disable_search_threshold: 10, search_contains: true }); - }, 0); }); } }); }; + ActionAdministrationComponent.prototype.clearSearch = function () { + this._search = ''; + }; ActionAdministrationComponent.prototype.onSubmit = function () { var _this = this; - //affect value of select - this.action.actionCategories = $j("#categorieslist").chosen().val(); - this.action.id_status = $j("#status").chosen().val(); - this.action.keyword = $j("#keyword").chosen().val(); - this.action.action_page = $j("#action_page").chosen().val(); - if (this.mode == 'create') { + if (this.creationMode) { this.http.post(this.coreUrl + 'rest/actions', this.action) .subscribe(function (data) { _this.router.navigate(['/administration/actions']); - successNotification(data.success); + _this.notify.success(_this.lang.actionAdded + ' « ' + _this.action.label_action + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } - else if (this.mode == 'update') { + else { this.http.put(this.coreUrl + 'rest/actions/' + this.action.id, this.action) .subscribe(function (data) { _this.router.navigate(['/administration/actions']); - successNotification(data.success); + _this.notify.success(_this.lang.actionUpdated + ' « ' + _this.action.label_action + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; - ActionAdministrationComponent.prototype.selectAll = function (event) { - var target = event.target.getAttribute("data-target"); - $j('#' + target + ' option').prop('selected', true); - $j('#' + target).trigger('chosen:updated'); - }; - ActionAdministrationComponent.prototype.unselectAll = function (event) { - var target = event.target.getAttribute("data-target"); - $j('#' + target + ' option').prop('selected', false); - $j('#' + target).trigger('chosen:updated'); - }; return ActionAdministrationComponent; }()); ActionAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals["action-administrationView"], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/action-administration.component.css'] + styleUrls: ['css/action-administration.component.css'], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router]) + __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router, notification_service_1.NotificationService]) ], ActionAdministrationComponent); exports.ActionAdministrationComponent = ActionAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts index cdb8d853987cef9b8815d74f5e1f941924a70bfe..c257309cda734783d34c6f2911e275fee6654fd9 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/action-administration.component.ts @@ -1,39 +1,44 @@ import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Router, ActivatedRoute } from '@angular/router'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals["action-administrationView"], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/action-administration.component.css'] + styleUrls : ['css/action-administration.component.css'], + providers : [NotificationService] }) export class ActionAdministrationComponent implements OnInit { - + lang : any = LANG; + _search : string = ''; coreUrl : string; - mode : string = null; + creationMode : boolean; action : any = {}; statusList : any[] = []; actionPagesList : any[] = []; - lang : any = {}; categoriesList : any[] = []; keywordsList : any[] = []; - resultInfo : string; loading : boolean = false; - constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router){ + constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService){ } updateBreadcrumb(applicationName: string) { - if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/actions\"' style='cursor: pointer'>Actions</a> > Modification"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > <a onclick='location.hash = \"/administration/actions\"' style='cursor: pointer'>"+this.lang.actions+"</a> > "; + + if(this.creationMode == true){ + breadCrumb += this.lang.actionCreation; + } else { + breadCrumb += this.lang.actionModification; } + $j('#ariane')[0].innerHTML = breadCrumb; } prepareActions() { @@ -50,85 +55,59 @@ export class ActionAdministrationComponent implements OnInit { this.route.params.subscribe(params => { if(typeof params['id']== "undefined"){ - this.mode = 'create'; + this.creationMode = true; this.http.get(this.coreUrl + 'rest/initAction') .subscribe((data : any) => { this.action = data.action; - this.lang = data.lang; - this.lang.pageTitle = this.lang.add+' '+this.lang.action; this.categoriesList = data.categoriesList; this.statusList = data.statusList; this.actionPagesList = data.action_pagesList; this.keywordsList = data.keywordsList; this.loading = false; - setTimeout(() => { - $j("select").chosen({width:"100%",disable_search_threshold: 10, search_contains: true}); - }, 0); }); } else { - this.mode = 'update'; + this.creationMode = false; this.http.get(this.coreUrl + 'rest/administration/actions/' + params['id']) .subscribe((data : any) => { - this.lang= data.lang; this.action = data.action; - this.lang.pageTitle = this.lang.modify_action+' : '+this.action.id; this.categoriesList = data.categoriesList; this.statusList = data.statusList; this.actionPagesList = data.action_pagesList; this.keywordsList = data.keywordsList; this.loading = false; - setTimeout(() => { - $j("select").chosen({width:"100%",disable_search_threshold: 10, search_contains: true}); - }, 0); }); } }); } - onSubmit() { - //affect value of select - this.action.actionCategories = $j("#categorieslist").chosen().val(); - this.action.id_status = $j("#status").chosen().val(); - this.action.keyword = $j("#keyword").chosen().val(); - this.action.action_page = $j("#action_page").chosen().val(); + clearSearch(){ + this._search = ''; + } - if (this.mode == 'create') { + onSubmit() { + if (this.creationMode) { this.http.post(this.coreUrl + 'rest/actions', this.action) .subscribe((data : any) => { this.router.navigate(['/administration/actions']); - successNotification(data.success); + this.notify.success(this.lang.actionAdded+' « '+this.action.label_action+' »'); },(err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); - }else if (this.mode == 'update') { + }else{ this.http.put(this.coreUrl + 'rest/actions/' + this.action.id, this.action) .subscribe((data : any) => { this.router.navigate(['/administration/actions']); - successNotification(data.success); + this.notify.success(this.lang.actionUpdated+' « '+this.action.label_action+' »'); },(err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } - - } - - selectAll(event:any){ - var target = event.target.getAttribute("data-target"); - $j('#' + target + ' option').prop('selected', true); - $j('#' + target).trigger('chosen:updated'); - - } - - unselectAll(event:any){ - var target = event.target.getAttribute("data-target"); - $j('#' + target + ' option').prop('selected', false); - $j('#' + target).trigger('chosen:updated'); } } \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js index ec65e4378b33ddddbdd560c40ebd1156341c5a90..3b5b6c263c916619dc3c5f25e98cd49c5b4eddd1 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.js @@ -12,18 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var ActionsAdministrationComponent = (function () { - function ActionsAdministrationComponent(http) { + function ActionsAdministrationComponent(http, notify) { this.http = http; + this.notify = notify; this.lang = translate_component_1.LANG; + this.search = null; this.actions = []; this.titles = []; - this.resultInfo = ""; this.loading = false; + this.data = []; } ActionsAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Actions"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.actions; } }; ActionsAdministrationComponent.prototype.ngOnInit = function () { @@ -35,62 +38,26 @@ var ActionsAdministrationComponent = (function () { this.http.get(this.coreUrl + 'rest/administration/actions') .subscribe(function (data) { _this.actions = data['actions']; - _this.titles = data['titles']; + _this.data = _this.actions; + _this.loading = false; setTimeout(function () { - _this.table = $j('#actionsTable').DataTable({ - "dom": '<"datatablesLeft"l><"datatablesRight"f><"datatablesCenter"p>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [10, 25, 50, 75, 100], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": _this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ " + _this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": _this.lang.next + " <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> " + _this.lang.previous - }, - "sInfoEmpty": _this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ " + _this.lang.record + ")" - }, - "order": [[1, "asc"]], - "columnDefs": [ - { "orderable": false, "targets": 4 } - ], - "fnInitComplete": function () { - $j('#actionsTable').show(); - }, - stateSave: true - }); - $j('.dataTables_filter input').attr("placeholder", _this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({ "float": "left" }); - $j(".datatablesCenter").css({ "text-align": "center" }); - $j(".datatablesRight").css({ "float": "right" }); + $j("[md2sortby='id']").click(); }, 0); - _this.loading = false; }, function (err) { console.log(err); location.href = "index.php"; }); }; - ActionsAdministrationComponent.prototype.deleteAction = function (id) { + ActionsAdministrationComponent.prototype.deleteAction = function (action) { var _this = this; - var r = confirm(this.lang.deleteMsg + ' ?'); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + action.label_action + ' »'); if (r) { - this.http.delete(this.coreUrl + 'rest/actions/' + id) + this.http.delete(this.coreUrl + 'rest/actions/' + action.id) .subscribe(function (data) { - var list = _this.actions; - for (var i = 0; i < list.length; i++) { - if (list[i].id == id) { - list.splice(i, 1); - } - } - _this.table.row($j("#" + id)).remove().draw(); - successNotification(data.success); + _this.data = data.action; + _this.notify.success(_this.lang.actionDeleted + ' « ' + action.label_action + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -99,8 +66,9 @@ var ActionsAdministrationComponent = (function () { ActionsAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals["actions-administrationView"], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls: [], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient]) + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) ], ActionsAdministrationComponent); exports.ActionsAdministrationComponent = ActionsAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts index 81a6ca7c290221fc57e287c7654c84d8dd353c8d..9409c66a2cb3b58304f7c68479dfbc7e08ed0e10 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/actions-administration.component.ts @@ -1,36 +1,36 @@ import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals["actions-administrationView"], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls : [], + providers : [NotificationService] }) export class ActionsAdministrationComponent implements OnInit { coreUrl : string; lang : any = LANG; + search : string = null; actions : any[] = []; titles : any[] = []; - table : any; - resultInfo : string = ""; loading : boolean = false; + data : any = []; - constructor(public http: HttpClient) { + constructor(public http: HttpClient, private notify: NotificationService) { } updateBreadcrumb(applicationName: string) { if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Actions"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.actions; } } @@ -45,65 +45,28 @@ export class ActionsAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/actions') .subscribe((data) => { this.actions = data['actions']; - this.titles = data['titles']; + this.data = this.actions; + this.loading = false; setTimeout(() => { - this.table = $j('#actionsTable').DataTable({ - "dom": '<"datatablesLeft"l><"datatablesRight"f><"datatablesCenter"p>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [ 10, 25, 50, 75, 100 ], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ "+this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": this.lang.next+" <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> "+this.lang.previous - }, - "sInfoEmpty": this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ "+this.lang.record+")" - }, - "order": [[ 1, "asc" ]], - "columnDefs": [ - { "orderable": false, "targets": 4 } - ], - "fnInitComplete": function () { - $j('#actionsTable').show(); - }, - stateSave: true - }); - $j('.dataTables_filter input').attr("placeholder", this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({"float":"left"}); - $j(".datatablesCenter").css({"text-align":"center"}); - $j(".datatablesRight").css({"float":"right"}); - + $j("[md2sortby='id']").click(); }, 0); - this.loading = false; }, (err) => { console.log(err); location.href = "index.php"; }); } - deleteAction(id: number) { - let r = confirm(this.lang.deleteMsg+' ?'); + deleteAction(action: any) { + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+action.label_action+' »'); if (r) { - this.http.delete(this.coreUrl + 'rest/actions/' + id) + this.http.delete(this.coreUrl + 'rest/actions/' + action.id) .subscribe((data : any) => { - var list = this.actions; - for(var i = 0; i<list.length;i++){ - if(list[i].id==id){ - list.splice(i,1); - } - } - this.table.row($j("#"+id)).remove().draw(); - successNotification(data.success); + this.data = data.action; + this.notify.success(this.lang.actionDeleted+' « '+action.label_action+' »'); }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.js b/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.js index 6db0c926959f9c969112aab280e8138112f5e4e2..d951ab9d25ae42800aec7c2466048a6b33369e5f 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.js +++ b/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.js @@ -20,8 +20,8 @@ var parameters_administration_component_1 = require("./parameters-administration var priorities_administration_component_1 = require("./priorities-administration.component"); var priority_administration_component_1 = require("./priority-administration.component"); var reports_administration_component_1 = require("./reports-administration.component"); -var notifications_administration_component_1 = require("./notifications-administration.component"); -var notification_administration_component_1 = require("./notification-administration.component"); +var history_administration_component_1 = require("./history-administration.component"); +var historyBatch_administration_component_1 = require("./historyBatch-administration.component"); var AdministrationRoutingModule = (function () { function AdministrationRoutingModule() { } @@ -48,9 +48,8 @@ AdministrationRoutingModule = __decorate([ { path: 'administration/actions', component: actions_administration_component_1.ActionsAdministrationComponent }, { path: 'administration/actions/new', component: action_administration_component_1.ActionAdministrationComponent }, { path: 'administration/actions/:id', component: action_administration_component_1.ActionAdministrationComponent }, - { path: 'administration/notifications', component: notifications_administration_component_1.NotificationsAdministrationComponent }, - { path: 'administration/notifications/new', component: notification_administration_component_1.NotificationAdministrationComponent }, - { path: 'administration/notifications/:identifier', component: notification_administration_component_1.NotificationAdministrationComponent }, + { path: 'administration/history', component: history_administration_component_1.HistoryAdministrationComponent }, + { path: 'administration/historyBatch', component: historyBatch_administration_component_1.HistoryBatchAdministrationComponent }, ]), ], exports: [ diff --git a/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.ts b/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.ts index 429fbafa11a301bd83340d68dd089caaf04ae80d..6ce534e40cde0aaf0cf4ec804a20bc6c2c94fba1 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/administration-routing.module.ts @@ -13,8 +13,11 @@ import { ParametersAdministrationComponent } from './parameters-administratio import { PrioritiesAdministrationComponent } from './priorities-administration.component'; import { PriorityAdministrationComponent } from './priority-administration.component'; import { ReportsAdministrationComponent } from './reports-administration.component'; -import { NotificationsAdministrationComponent } from './notifications-administration.component'; -import { NotificationAdministrationComponent } from './notification-administration.component'; +import { NotificationsAdministrationComponent } from './notifications-administration.component'; +import { NotificationAdministrationComponent } from './notification-administration.component'; +import { HistoryAdministrationComponent } from './history-administration.component'; +import { HistoryBatchAdministrationComponent } from './historyBatch-administration.component'; + @NgModule({ imports: [ @@ -39,6 +42,8 @@ import { NotificationAdministrationComponent } from './notification-admini { path: 'administration/notifications', component: NotificationsAdministrationComponent }, { path: 'administration/notifications/new', component: NotificationAdministrationComponent }, { path: 'administration/notifications/:identifier', component: NotificationAdministrationComponent }, + { path: 'administration/history', component: HistoryAdministrationComponent }, + { path: 'administration/historyBatch', component: HistoryBatchAdministrationComponent }, ]), ], exports: [ diff --git a/apps/maarch_entreprise/js/angular/app/administration/administration.module.js b/apps/maarch_entreprise/js/angular/app/administration/administration.module.js index b87cc06c72bf37d96f376c65f8a8976647e05db5..725ffb3bcdc51de6e531926d60848a5e23e326bb 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/administration.module.js +++ b/apps/maarch_entreprise/js/angular/app/administration/administration.module.js @@ -10,6 +10,7 @@ var core_1 = require("@angular/core"); var common_1 = require("@angular/common"); var forms_1 = require("@angular/forms"); var http_1 = require("@angular/common/http"); +var md2_1 = require("md2"); var app_material_module_1 = require("../app-material.module"); var administration_routing_module_1 = require("./administration-routing.module"); var administration_component_1 = require("./administration.component"); @@ -26,6 +27,8 @@ var parameter_administration_component_1 = require("./parameter-administration.c var priorities_administration_component_1 = require("./priorities-administration.component"); var priority_administration_component_1 = require("./priority-administration.component"); var reports_administration_component_1 = require("./reports-administration.component"); +var history_administration_component_1 = require("./history-administration.component"); +var historyBatch_administration_component_1 = require("./historyBatch-administration.component"); var AdministrationModule = (function () { function AdministrationModule() { } @@ -38,7 +41,8 @@ AdministrationModule = __decorate([ forms_1.FormsModule, http_1.HttpClientModule, app_material_module_1.AppMaterialModule, - administration_routing_module_1.AdministrationRoutingModule + administration_routing_module_1.AdministrationRoutingModule, + md2_1.Md2Module ], declarations: [ administration_component_1.AdministrationComponent, @@ -54,7 +58,10 @@ AdministrationModule = __decorate([ parameter_administration_component_1.ParameterAdministrationComponent, priorities_administration_component_1.PrioritiesAdministrationComponent, priority_administration_component_1.PriorityAdministrationComponent, - reports_administration_component_1.ReportsAdministrationComponent + reports_administration_component_1.ReportsAdministrationComponent, + history_administration_component_1.HistoryAdministrationComponent, + historyBatch_administration_component_1.HistoryBatchAdministrationComponent, + users_administration_component_1.DataTablePipe ] }) ], AdministrationModule); diff --git a/apps/maarch_entreprise/js/angular/app/administration/administration.module.ts b/apps/maarch_entreprise/js/angular/app/administration/administration.module.ts index 9351b3c2a95201206c44d41ae607029496cfd7c8..4299b86a1d491a8d538431d3914ffc779f1538f6 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/administration.module.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/administration.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; +import { Md2Module } from 'md2'; import { AppMaterialModule } from '../app-material.module'; import { AdministrationRoutingModule } from './administration-routing.module'; @@ -9,7 +10,7 @@ import { AdministrationRoutingModule } from './administration-routing.m import { AdministrationComponent } from './administration.component'; import { NotificationsAdministrationComponent } from './notifications-administration.component'; import { NotificationAdministrationComponent } from './notification-administration.component'; -import { UsersAdministrationComponent } from './users-administration.component'; +import { UsersAdministrationComponent, DataTablePipe } from './users-administration.component'; import { UserAdministrationComponent } from './user-administration.component'; import { StatusesAdministrationComponent } from './statuses-administration.component'; import { StatusAdministrationComponent } from './status-administration.component'; @@ -20,6 +21,9 @@ import { ParameterAdministrationComponent } from './parameter-administration import { PrioritiesAdministrationComponent } from './priorities-administration.component'; import { PriorityAdministrationComponent } from './priority-administration.component'; import { ReportsAdministrationComponent } from './reports-administration.component'; +import { HistoryAdministrationComponent } from './history-administration.component'; +import { HistoryBatchAdministrationComponent } from './historyBatch-administration.component'; + @NgModule({ imports: [ @@ -27,7 +31,8 @@ import { ReportsAdministrationComponent } from './reports-administration.c FormsModule, HttpClientModule, AppMaterialModule, - AdministrationRoutingModule + AdministrationRoutingModule, + Md2Module ], declarations: [ AdministrationComponent, @@ -43,7 +48,10 @@ import { ReportsAdministrationComponent } from './reports-administration.c ParameterAdministrationComponent, PrioritiesAdministrationComponent, PriorityAdministrationComponent, - ReportsAdministrationComponent + ReportsAdministrationComponent, + HistoryAdministrationComponent, + HistoryBatchAdministrationComponent, + DataTablePipe ] }) export class AdministrationModule { } \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/administration/history-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/history-administration.component.js new file mode 100644 index 0000000000000000000000000000000000000000..fd6adb4d6eba071d027c59da41210b4b21c42d51 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/administration/history-administration.component.js @@ -0,0 +1,83 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = require("@angular/core"); +var http_1 = require("@angular/common/http"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); +var HistoryAdministrationComponent = (function () { + function HistoryAdministrationComponent(http, notify) { + this.http = http; + this.notify = notify; + this.lang = translate_component_1.LANG; + this.search = null; + this._search = ''; + this.filterEventTypes = []; + this.filterEventType = ''; + this.filterUsers = []; + this.filterUser = ''; + this.filterByDate = ''; + this.loading = false; + this.data = []; + this.CurrentYear = new Date().getFullYear(); + this.currentMonth = new Date().getMonth() + 1; + this.minDate = new Date(); + } + HistoryAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.history; + } + }; + HistoryAdministrationComponent.prototype.ngOnInit = function () { + var _this = this; + this.coreUrl = angularGlobals.coreUrl; + this.loading = true; + this.updateBreadcrumb(angularGlobals.applicationName); + $j('#inner_content').remove(); + this.minDate = new Date(this.CurrentYear + '-' + this.currentMonth + '-01'); + console.log(this.minDate.toJSON()); + this.http.get(this.coreUrl + 'rest/administration/history/eventDate/' + this.minDate.toJSON()) + .subscribe(function (data) { + _this.data = data.historyList; + _this.filterEventTypes = data.filters.eventType; + _this.filterUsers = data.filters.users; + _this.loading = false; + setTimeout(function () { + $j("[md2sortby='event_date']").click().click(); + }, 0); + }, function (err) { + console.log(err); + location.href = "index.php"; + }); + }; + HistoryAdministrationComponent.prototype.refreshHistory = function () { + var _this = this; + this.http.get(this.coreUrl + 'rest/administration/history/eventDate/' + this.minDate.toJSON()) + .subscribe(function (data) { + _this.data = data.historyList; + _this.filterEventTypes = data.filters.eventType; + _this.filterUsers = data.filters.users; + }, function (err) { + console.log(err); + location.href = "index.php"; + }); + }; + return HistoryAdministrationComponent; +}()); +HistoryAdministrationComponent = __decorate([ + core_1.Component({ + templateUrl: angularGlobals["history-administrationView"], + styleUrls: [], + providers: [notification_service_1.NotificationService] + }), + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) +], HistoryAdministrationComponent); +exports.HistoryAdministrationComponent = HistoryAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/history-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/history-administration.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e0a1489db80961958d69b53763f0abe4533458a --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/administration/history-administration.component.ts @@ -0,0 +1,85 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; + +declare function $j(selector: any) : any; + +declare var angularGlobals : any; + + +@Component({ + templateUrl : angularGlobals["history-administrationView"], + styleUrls : [], + providers : [NotificationService] +}) + +export class HistoryAdministrationComponent implements OnInit { + coreUrl : string; + lang : any = LANG; + search : string = null; + _search : string = ''; + + filterEventTypes : any = []; + filterEventType : string = ''; + filterUsers : any = []; + filterUser : string = ''; + filterByDate : string = ''; + + loading : boolean = false; + data : any = []; + CurrentYear : number = new Date().getFullYear(); + currentMonth : number = new Date().getMonth()+1; + minDate : Date = new Date(); + + + constructor(public http: HttpClient, private notify: NotificationService) { + } + + updateBreadcrumb(applicationName: string) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.history; + } + } + + ngOnInit(): void { + this.coreUrl = angularGlobals.coreUrl; + + this.loading = true; + + this.updateBreadcrumb(angularGlobals.applicationName); + $j('#inner_content').remove(); + + this.minDate = new Date(this.CurrentYear+'-'+this.currentMonth+'-01'); + console.log(this.minDate.toJSON()); + this.http.get(this.coreUrl + 'rest/administration/history/eventDate/'+this.minDate.toJSON()) + .subscribe((data:any) => { + this.data = data.historyList; + + this.filterEventTypes = data.filters.eventType; + this.filterUsers = data.filters.users; + this.loading = false; + setTimeout(() => { + + $j("[md2sortby='event_date']").click().click(); + }, 0); + }, (err) => { + console.log(err); + location.href = "index.php"; + }); + } + + refreshHistory() { + this.http.get(this.coreUrl + 'rest/administration/history/eventDate/'+this.minDate.toJSON()) + .subscribe((data:any) => { + this.data = data.historyList; + this.filterEventTypes = data.filters.eventType; + this.filterUsers = data.filters.users; + + }, (err) => { + console.log(err); + location.href = "index.php"; + }); + } + +} \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/administration/historyBatch-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/historyBatch-administration.component.js new file mode 100644 index 0000000000000000000000000000000000000000..5c675399b0f18f6b9970c128ca76052fc5298d7f --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/administration/historyBatch-administration.component.js @@ -0,0 +1,78 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = require("@angular/core"); +var http_1 = require("@angular/common/http"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); +var HistoryBatchAdministrationComponent = (function () { + function HistoryBatchAdministrationComponent(http, notify) { + this.http = http; + this.notify = notify; + this.lang = translate_component_1.LANG; + this.search = null; + this._search = ''; + this.filterModules = []; + this.filterModule = ''; + this.filterByDate = ''; + this.loading = false; + this.data = []; + this.CurrentYear = new Date().getFullYear(); + this.currentMonth = new Date().getMonth() + 1; + this.minDate = new Date(); + } + HistoryBatchAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.historyBatch; + } + }; + HistoryBatchAdministrationComponent.prototype.ngOnInit = function () { + var _this = this; + this.coreUrl = angularGlobals.coreUrl; + this.loading = true; + this.updateBreadcrumb(angularGlobals.applicationName); + $j('#inner_content').remove(); + this.minDate = new Date(this.CurrentYear + '-' + this.currentMonth + '-01'); + this.http.get(this.coreUrl + 'rest/administration/historyBatch/eventDate/' + this.minDate.toJSON()) + .subscribe(function (data) { + _this.data = data.historyList; + _this.filterModules = data.filters.modules; + _this.loading = false; + setTimeout(function () { + $j("[md2sortby='event_date']").click().click(); + }, 0); + }, function (err) { + console.log(err); + location.href = "index.php"; + }); + }; + HistoryBatchAdministrationComponent.prototype.refreshHistory = function () { + var _this = this; + this.http.get(this.coreUrl + 'rest/administration/historyBatch/eventDate/' + this.minDate.toJSON()) + .subscribe(function (data) { + _this.data = data.historyList; + _this.filterModules = data.filters.modules; + }, function (err) { + console.log(err); + location.href = "index.php"; + }); + }; + return HistoryBatchAdministrationComponent; +}()); +HistoryBatchAdministrationComponent = __decorate([ + core_1.Component({ + templateUrl: angularGlobals["historyBatch-administrationView"], + styleUrls: [], + providers: [notification_service_1.NotificationService] + }), + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) +], HistoryBatchAdministrationComponent); +exports.HistoryBatchAdministrationComponent = HistoryBatchAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/historyBatch-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/historyBatch-administration.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b518197c0b1a448afd01e8b952f9047dbea062d --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/administration/historyBatch-administration.component.ts @@ -0,0 +1,80 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; + +declare function $j(selector: any) : any; + +declare var angularGlobals : any; + + +@Component({ + templateUrl : angularGlobals["historyBatch-administrationView"], + styleUrls : [], + providers : [NotificationService] +}) + +export class HistoryBatchAdministrationComponent implements OnInit { + coreUrl : string; + lang : any = LANG; + search : string = null; + _search : string = ''; + + filterModules : any = []; + filterModule : string = ''; + filterByDate : string = ''; + + loading : boolean = false; + data : any = []; + CurrentYear : number = new Date().getFullYear(); + currentMonth : number = new Date().getMonth()+1; + minDate : Date = new Date(); + + + constructor(public http: HttpClient, private notify: NotificationService) { + } + + updateBreadcrumb(applicationName: string) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.historyBatch; + } + } + + ngOnInit(): void { + this.coreUrl = angularGlobals.coreUrl; + + this.loading = true; + + this.updateBreadcrumb(angularGlobals.applicationName); + $j('#inner_content').remove(); + + this.minDate = new Date(this.CurrentYear+'-'+this.currentMonth+'-01'); + + this.http.get(this.coreUrl + 'rest/administration/historyBatch/eventDate/'+this.minDate.toJSON()) + .subscribe((data:any) => { + this.data = data.historyList; + + this.filterModules = data.filters.modules; + this.loading = false; + setTimeout(() => { + $j("[md2sortby='event_date']").click().click(); + }, 0); + }, (err) => { + console.log(err); + location.href = "index.php"; + }); + } + + refreshHistory() { + this.http.get(this.coreUrl + 'rest/administration/historyBatch/eventDate/'+this.minDate.toJSON()) + .subscribe((data:any) => { + this.data = data.historyList; + this.filterModules = data.filters.modules; + + }, (err) => { + console.log(err); + location.href = "index.php"; + }); + } + +} \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js index 822d5fa1b43d4f0abf90e0d45955cbcd7a959993..8e2f907c4ee81778aeeaf094f337520498b9b983 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.js @@ -12,31 +12,43 @@ Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); var router_1 = require("@angular/router"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var ParameterAdministrationComponent = (function () { - function ParameterAdministrationComponent(http, route, router) { + function ParameterAdministrationComponent(http, route, router, notify) { this.http = http; this.route = route; this.router = router; - this.creationMode = true; + this.notify = notify; + this.lang = translate_component_1.LANG; + this._search = ''; this.parameter = {}; - this.lang = ""; - this.resultInfo = ""; this.loading = false; } + ParameterAdministrationComponent.prototype.prepareParameter = function () { + $j('#inner_content').remove(); + }; + ParameterAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>" + this.lang.parameters + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.parameterCreation; + } + else { + breadCrumb += this.lang.parameterModification; + } + $j('#ariane')[0].innerHTML = breadCrumb; + }; ParameterAdministrationComponent.prototype.ngOnInit = function () { var _this = this; this.loading = true; this.coreUrl = angularGlobals.coreUrl; - this.prepareParameter(); - this.updateBreadcrumb(angularGlobals.applicationName); this.route.params.subscribe(function (params) { if (typeof params['id'] == "undefined") { _this.creationMode = true; _this.http.get(_this.coreUrl + 'rest/administration/parameters/new') .subscribe(function (data) { - _this.lang = data.lang; _this.type = 'string'; - _this.pageTitle = _this.lang.newParameter; + _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function () { location.href = "index.php"; @@ -47,8 +59,8 @@ var ParameterAdministrationComponent = (function () { _this.http.get(_this.coreUrl + 'rest/administration/parameters/' + params['id']) .subscribe(function (data) { _this.parameter = data.parameter; - _this.lang = data.lang; _this.type = data.type; + _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function () { location.href = "index.php"; @@ -56,18 +68,9 @@ var ParameterAdministrationComponent = (function () { } }); }; - ParameterAdministrationComponent.prototype.prepareParameter = function () { - $j('#inner_content').remove(); - }; - ParameterAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { - if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>Paramètres</a> > Modification"; - } - }; ParameterAdministrationComponent.prototype.onSubmit = function () { var _this = this; if (this.type == 'date') { - this.parameter.param_value_date = $j("#paramValue").val(); this.parameter.param_value_int = null; this.parameter.param_value_string = null; } @@ -83,18 +86,18 @@ var ParameterAdministrationComponent = (function () { this.http.post(this.coreUrl + 'rest/parameters', this.parameter) .subscribe(function (data) { _this.router.navigate(['administration/parameters']); - successNotification(data.success); + _this.notify.success(_this.lang.parameterAdded + ' « ' + _this.parameter.id + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(err.error.errors); }); } else if (this.creationMode == false) { this.http.put(this.coreUrl + 'rest/parameters/' + this.parameter.id, this.parameter) .subscribe(function (data) { _this.router.navigate(['administration/parameters']); - successNotification(data.success); + _this.notify.success(_this.lang.parameterUpdated + ' « ' + _this.parameter.id + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(err.error.errors); }); } }; @@ -103,8 +106,9 @@ var ParameterAdministrationComponent = (function () { ParameterAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals['parameter-administrationView'], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls: [], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router]) + __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router, notification_service_1.NotificationService]) ], ParameterAdministrationComponent); exports.ParameterAdministrationComponent = ParameterAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts index e71eb48a6f61517405cd9aeb261d74847d0cb67a..43c763d1eb7946805094ece8460693cb1e8177be 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/parameter-administration.component.ts @@ -1,37 +1,51 @@ import { Component, OnInit} from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Router, ActivatedRoute } from '@angular/router'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals['parameter-administrationView'], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls : [], + providers : [NotificationService] }) export class ParameterAdministrationComponent implements OnInit { coreUrl : string; - pageTitle : string; - creationMode : boolean = true; + + lang : any = LANG; + _search : string = ''; + creationMode : boolean; + type : string; parameter : any = {}; paramDateTemp : string; - lang : any = ""; - resultInfo : string = ""; loading : boolean = false; - constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router) { + constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService) { + } + + prepareParameter() { + $j('#inner_content').remove(); } + updateBreadcrumb(applicationName: string) { + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>"+this.lang.parameters+"</a> > "; + + if(this.creationMode == true){ + breadCrumb += this.lang.parameterCreation; + } else { + breadCrumb += this.lang.parameterModification; + } + $j('#ariane')[0].innerHTML = breadCrumb; + } ngOnInit(): void { this.loading = true; this.coreUrl = angularGlobals.coreUrl; - this.prepareParameter(); - this.updateBreadcrumb(angularGlobals.applicationName); this.route.params.subscribe((params) => { if (typeof params['id'] == "undefined"){ @@ -39,10 +53,8 @@ export class ParameterAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/parameters/new') .subscribe((data : any) => { - this.lang = data.lang; this.type = 'string'; - this.pageTitle = this.lang.newParameter; - + this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; }, () => { @@ -53,9 +65,8 @@ export class ParameterAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/parameters/'+params['id']) .subscribe((data : any) => { this.parameter = data.parameter; - this.lang = data.lang; this.type = data.type; - + this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; }, () => { @@ -66,19 +77,8 @@ export class ParameterAdministrationComponent implements OnInit { } - prepareParameter() { - $j('#inner_content').remove(); - } - - updateBreadcrumb(applicationName: string){ - if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/parameters\"' style='cursor: pointer'>Paramètres</a> > Modification"; - } - } - onSubmit() { if(this.type=='date'){ - this.parameter.param_value_date = $j("#paramValue").val(); this.parameter.param_value_int=null; this.parameter.param_value_string=null; } @@ -95,19 +95,18 @@ export class ParameterAdministrationComponent implements OnInit { this.http.post(this.coreUrl + 'rest/parameters', this.parameter) .subscribe((data : any) => { this.router.navigate(['administration/parameters']); - successNotification(data.success); + this.notify.success(this.lang.parameterAdded+' « '+this.parameter.id+' »'); },(err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(err.error.errors); }); } else if(this.creationMode == false){ - this.http.put(this.coreUrl+'rest/parameters/'+this.parameter.id,this.parameter) .subscribe((data : any) => { this.router.navigate(['administration/parameters']); - successNotification(data.success); + this.notify.success(this.lang.parameterUpdated+' « '+this.parameter.id+' »'); },(err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(err.error.errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js index 995e9819bf9f4ac41f4763d383c9a8fb31955446..ea0b3ee45759ba1306a32fedbafcb5046cb41e89 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.js @@ -11,70 +11,35 @@ var __metadata = (this && this.__metadata) || function (k, v) { Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var ParametersAdministrationComponent = (function () { - function ParametersAdministrationComponent(http) { + function ParametersAdministrationComponent(http, notify) { this.http = http; - this.lang = ""; + this.notify = notify; + this.lang = translate_component_1.LANG; + this.search = null; this.resultInfo = ""; this.loading = false; + this.data = []; } - ParametersAdministrationComponent.prototype.prepareParameter = function () { - $j('#inner_content').remove(); - }; ParametersAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Paramètres"; + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.parameters; + } }; ParametersAdministrationComponent.prototype.ngOnInit = function () { var _this = this; - this.coreUrl = angularGlobals.coreUrl; - this.prepareParameter(); this.updateBreadcrumb(angularGlobals.applicationName); + this.coreUrl = angularGlobals.coreUrl; this.http.get(this.coreUrl + 'rest/administration/parameters') .subscribe(function (data) { - if (data.errors) { - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function () { - $j("#resultInfo").slideUp(500); - }); - } - else { - _this.parametersList = data.parametersList; - _this.lang = data.lang; - setTimeout(function () { - _this.table = $j('#paramsTable').DataTable({ - "dom": '<"datatablesLeft"l><"datatablesRight"f><"datatablesCenter"p>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [10, 25, 50, 75, 100], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": _this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ " + _this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": _this.lang.next + " <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> " + _this.lang.previous - }, - "sInfoEmpty": _this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ " + _this.lang.record + ")" - }, - "order": [[0, "asc"]], - "columnDefs": [ - { "orderable": false, "targets": 3 } - ], - "fnInitComplete": function () { - $j('#paramsTable').show(); - }, - stateSave: true - }); - $j('.dataTables_filter input').attr("placeholder", _this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({ "float": "left" }); - $j(".datatablesCenter").css({ "text-align": "center" }); - $j(".datatablesRight").css({ "float": "right" }); - }, 0); - _this.loading = false; - } + _this.parametersList = data.parametersList; + _this.data = _this.parametersList; + setTimeout(function () { + $j("[md2sortby='id']").click(); + }, 0); + _this.loading = false; }); }; ParametersAdministrationComponent.prototype.goUrl = function () { @@ -82,19 +47,14 @@ var ParametersAdministrationComponent = (function () { }; ParametersAdministrationComponent.prototype.deleteParameter = function (paramId) { var _this = this; - var resp = confirm(this.lang.deleteConfirm + ' ' + paramId + '?'); + var resp = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + paramId + ' »'); if (resp) { this.http.delete(this.coreUrl + 'rest/parameters/' + paramId) .subscribe(function (data) { - for (var i = 0; i < _this.parametersList.length; i++) { - if (_this.parametersList[i].id == paramId) { - _this.parametersList.splice(i, 1); - } - } - _this.table.row($j("#" + paramId)).remove().draw(); - successNotification(data.success); + _this.data = data.parameters; + _this.notify.success(_this.lang.parameterDeleted + ' « ' + paramId + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -103,8 +63,9 @@ var ParametersAdministrationComponent = (function () { ParametersAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals["parameters-administrationView"], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/parameters-administration.component.css'] + styleUrls: ['css/parameters-administration.component.css'], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient]) + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) ], ParametersAdministrationComponent); exports.ParametersAdministrationComponent = ParametersAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts index 240d8201dc0ba05391ea8d29a2e54537bf668339..2cd18ed0456c77bfaed83964de707e4884336ce6 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/parameters-administration.component.ts @@ -1,93 +1,53 @@ import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals["parameters-administrationView"], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css','css/parameters-administration.component.css'] + styleUrls : ['css/parameters-administration.component.css'], + providers : [NotificationService] }) export class ParametersAdministrationComponent implements OnInit { coreUrl : string; - parametersList : any; - pageTitle : string; - lang : any = ""; - table : any; - + lang : any = LANG; + search : string = null; + + parametersList : any; resultInfo : string = ""; loading : boolean = false; + data : any = []; - constructor(public http: HttpClient) { - } - - prepareParameter() { - $j('#inner_content').remove(); + constructor(public http: HttpClient, private notify: NotificationService) { } - updateBreadcrumb(applicationName: string){ - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Paramètres"; + updateBreadcrumb(applicationName: string) { + if ($j('#ariane')[0]) { + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.parameters; + } } ngOnInit(): void { + this.updateBreadcrumb(angularGlobals.applicationName); this.coreUrl = angularGlobals.coreUrl; - this.prepareParameter(); - this.updateBreadcrumb(angularGlobals.applicationName); - this.http.get(this.coreUrl + 'rest/administration/parameters') .subscribe((data : any) => { - if(data.errors){ - $j('#resultInfo').removeClass().addClass('alert alert-danger alert-dismissible'); - $j("#resultInfo").fadeTo(3000, 500).slideUp(500, function(){ - $j("#resultInfo").slideUp(500); - }); - } else { - this.parametersList = data.parametersList; - this.lang = data.lang; - setTimeout(() => { - this.table = $j('#paramsTable').DataTable({ - "dom": '<"datatablesLeft"l><"datatablesRight"f><"datatablesCenter"p>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [ 10, 25, 50, 75, 100 ], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ "+this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": this.lang.next+" <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> "+this.lang.previous - }, - "sInfoEmpty": this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ "+this.lang.record+")" - }, - "order": [[ 0, "asc" ]], - "columnDefs": [ - { "orderable": false, "targets": 3 } - ], - "fnInitComplete": function () { - $j('#paramsTable').show(); - }, - stateSave: true - }); - $j('.dataTables_filter input').attr("placeholder", this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({"float":"left"}); - $j(".datatablesCenter").css({"text-align":"center"}); - $j(".datatablesRight").css({"float":"right"}); - + this.parametersList = data.parametersList; + this.data = this.parametersList; + setTimeout(() => { + $j("[md2sortby='id']").click(); }, 0); this.loading = false; - } + }); } @@ -96,19 +56,14 @@ export class ParametersAdministrationComponent implements OnInit { } deleteParameter(paramId : string){ - var resp =confirm(this.lang.deleteConfirm+' '+paramId+'?'); + let resp = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+paramId+' »'); if (resp) { this.http.delete(this.coreUrl + 'rest/parameters/'+paramId) .subscribe((data : any) => { - for(var i = 0; i<this.parametersList.length;i++){ - if(this.parametersList[i].id==paramId){ - this.parametersList.splice(i,1); - } - } - this.table.row($j("#"+paramId)).remove().draw(); - successNotification(data.success); + this.data = data.parameters; + this.notify.success(this.lang.parameterDeleted+' « '+paramId+' »'); },(err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js index e54c896e846af75920f51031ec411e4f8df528e7..79a3e6830d9bbc1c74e02a747795945d47f92b13 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.js @@ -12,13 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); var router_1 = require("@angular/router"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var StatusAdministrationComponent = (function () { - function StatusAdministrationComponent(http, route, router) { + function StatusAdministrationComponent(http, route, router, notify) { this.http = http; this.route = route; this.router = router; - this.pageTitle = ""; - this.mode = null; + this.notify = notify; + this.lang = translate_component_1.LANG; this.status = { id: null, label_status: null, @@ -27,7 +29,6 @@ var StatusAdministrationComponent = (function () { is_folder_status: null, img_filename: null }; - this.lang = ""; this.statusImages = ""; this.loading = false; } @@ -40,39 +41,35 @@ var StatusAdministrationComponent = (function () { if (typeof params['identifier'] == "undefined") { _this.http.get(_this.coreUrl + 'rest/administration/status/new') .subscribe(function (data) { - _this.lang = data['lang']; + _this.status.img_filename = "fm-letter"; + _this.status.can_be_searched = true; + _this.status.can_be_modified = true; _this.statusImages = data['statusImages']; - _this.mode = 'create'; - _this.pageTitle = _this.lang.newStatus; + _this.creationMode = true; _this.updateBreadcrumb(angularGlobals.applicationName); + _this.loading = false; }); } else { - _this.mode = 'update'; + _this.creationMode = false; _this.statusIdentifier = params['identifier']; _this.getStatusInfos(_this.statusIdentifier); + _this.loading = false; } - setTimeout(function () { - $j(".help").tooltipster({ - theme: 'tooltipster-maarch', - interactive: true - }); - }, 0); }); - this.loading = false; }; StatusAdministrationComponent.prototype.prepareStatus = function () { $j('#inner_content').remove(); }; StatusAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > " + - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.admin + "</a> > " + - "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>" + this.lang.admin_status + "</a> > "; - if (this.mode == 'create') { - breadCrumb += this.lang.newItem; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + + "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>" + this.lang.statuses + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.statusCreation; } else { - breadCrumb += this.lang.modification; + breadCrumb += this.lang.statusModification; } $j('#ariane')[0].innerHTML = breadCrumb; }; @@ -99,35 +96,30 @@ var StatusAdministrationComponent = (function () { else { _this.status.is_folder_status = false; } - _this.lang = data['lang']; _this.statusImages = data['statusImages']; - _this.pageTitle = _this.lang.modify_status + ' : ' + _this.status.id; _this.updateBreadcrumb(angularGlobals.applicationName); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); }; - StatusAdministrationComponent.prototype.selectImage = function (image_name) { - this.status.img_filename = image_name; - }; StatusAdministrationComponent.prototype.submitStatus = function () { var _this = this; - if (this.mode == 'create') { + if (this.creationMode == true) { this.http.post(this.coreUrl + 'rest/status', this.status) - .subscribe(function () { - successNotification(_this.lang.newStatusAdded + ' : ' + _this.status.id); + .subscribe(function (data) { + _this.notify.success(_this.lang.statusAdded + ' « ' + data.status.id + ' »'); _this.router.navigate(['administration/status']); }, function (err) { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + _this.notify.error(JSON.parse(err._body).errors); }); } - else if (this.mode == "update") { + else if (this.creationMode == false) { this.http.put(this.coreUrl + 'rest/status/' + this.statusIdentifier, this.status) - .subscribe(function () { - successNotification(_this.lang.statusUpdated + ' : ' + _this.status.id); + .subscribe(function (data) { + _this.notify.success(_this.lang.statusUpdated + ' « ' + data.status.id + ' »'); _this.router.navigate(['administration/status']); }, function (err) { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -136,8 +128,9 @@ var StatusAdministrationComponent = (function () { StatusAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals['status-administrationView'], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/status-administration.component.css'] + styleUrls: ['css/status-administration.component.css'], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router]) + __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router, notification_service_1.NotificationService]) ], StatusAdministrationComponent); exports.StatusAdministrationComponent = StatusAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts index 5cd7b9549ce764565d8facff6cc393395ceac5f6..caad7f78d19f0e551c27d82e4986eb2a7e105458 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts @@ -1,66 +1,66 @@ import { Component, OnInit} from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Router, ActivatedRoute } from '@angular/router'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; + @Component({ templateUrl : angularGlobals['status-administrationView'], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/status-administration.component.css'] + styleUrls : ['css/status-administration.component.css'], + providers : [NotificationService] }) export class StatusAdministrationComponent implements OnInit { coreUrl : string; - pageTitle : string = "" ; - mode : string = null; + lang : any = LANG; + + creationMode : boolean; + statusIdentifier : string; status : any = { id : null, - label_status : null, + label_status : null, can_be_searched : null, can_be_modified : null, - is_folder_status : null, - img_filename : null + is_folder_status: null, + img_filename : null }; - lang : any = ""; statusImages : any = ""; loading : boolean = false; - constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router) { + constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService) { } ngOnInit(): void { this.loading = true; this.coreUrl = angularGlobals.coreUrl; + this.prepareStatus(); this.route.params.subscribe((params) => { if (typeof params['identifier'] == "undefined"){ this.http.get(this.coreUrl + 'rest/administration/status/new') .subscribe((data) => { - this.lang = data['lang']; + this.status.img_filename = "fm-letter"; + this.status.can_be_searched = true + this.status.can_be_modified = true this.statusImages = data['statusImages']; - this.mode = 'create'; - this.pageTitle = this.lang.newStatus; + this.creationMode = true; this.updateBreadcrumb(angularGlobals.applicationName); + this.loading = false; }); } else { - this.mode = 'update'; + this.creationMode = false; this.statusIdentifier = params['identifier']; this.getStatusInfos(this.statusIdentifier); + this.loading = false; } - setTimeout(() => { - $j(".help").tooltipster({ - theme: 'tooltipster-maarch', - interactive: true - }); - }, 0); }); - this.loading = false; } prepareStatus() { @@ -69,12 +69,12 @@ export class StatusAdministrationComponent implements OnInit { updateBreadcrumb(applicationName: string){ var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > "+ - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.admin+"</a> > "+ - "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>"+this.lang.admin_status+"</a> > "; - if(this.mode == 'create'){ - breadCrumb += this.lang.newItem; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+ + "<a onclick='location.hash = \"/administration/status\"' style='cursor: pointer'>"+this.lang.statuses+"</a> > "; + if(this.creationMode == true){ + breadCrumb += this.lang.statusCreation; } else { - breadCrumb += this.lang.modification; + breadCrumb += this.lang.statusModification; } $j('#ariane')[0].innerHTML = breadCrumb; } @@ -98,36 +98,30 @@ export class StatusAdministrationComponent implements OnInit { }else{ this.status.is_folder_status = false; } - this.lang = data['lang']; this.statusImages = data['statusImages']; - this.pageTitle = this.lang.modify_status + ' : ' + this.status.id; this.updateBreadcrumb(angularGlobals.applicationName); }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } - - selectImage(image_name : string){ - this.status.img_filename = image_name; - } submitStatus() { - if(this.mode == 'create'){ + if(this.creationMode == true){ this.http.post(this.coreUrl + 'rest/status', this.status) - .subscribe(() => { - successNotification(this.lang.newStatusAdded + ' : ' + this.status.id); + .subscribe((data : any) => { + this.notify.success(this.lang.statusAdded+' « '+data.status.id+' »'); this.router.navigate(['administration/status']); }, (err) => { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + this.notify.error(JSON.parse(err._body).errors); }); - } else if(this.mode == "update"){ + } else if(this.creationMode == false){ this.http.put(this.coreUrl+'rest/status/'+this.statusIdentifier, this.status) - .subscribe(() => { - successNotification(this.lang.statusUpdated + ' : ' + this.status.id); + .subscribe((data : any) => { + this.notify.success(this.lang.statusUpdated+' « '+data.status.id+' »'); this.router.navigate(['administration/status']); }, (err) => { - errorNotification((JSON.parse(err._body).errors).join("<br>")); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js index d200a51aa207c09c7125853b0976b70d390c6671..0dc14ca5b9c0e89bac73c4db93d92e89c621a6a9 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.js @@ -11,11 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) { Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var StatusesAdministrationComponent = (function () { - function StatusesAdministrationComponent(http) { + function StatusesAdministrationComponent(http, notify) { this.http = http; - this.lang = ""; - this.resultInfo = ""; + this.notify = notify; + this.lang = translate_component_1.LANG; + this.data = []; this.loading = false; } StatusesAdministrationComponent.prototype.ngOnInit = function () { @@ -26,42 +29,14 @@ var StatusesAdministrationComponent = (function () { this.http.get(this.coreUrl + 'rest/administration/status') .subscribe(function (data) { _this.statusList = data.statusList; - _this.lang = data.lang; - _this.nbStatus = Object.keys(_this.statusList).length; + _this.data = _this.statusList; setTimeout(function () { - _this.table = $j('#statusTable').DataTable({ - "dom": '<"datatablesLeft"p><"datatablesRight"f><"datatablesCenter"l>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [10, 25, 50, 75, 100], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": _this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ " + _this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": _this.lang.next + " <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> " + _this.lang.previous - }, - "sInfoEmpty": _this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ " + _this.lang.record + ")" - }, - "order": [[2, "asc"]], - "columnDefs": [ - { "orderable": false, "targets": [0, 3] } - ], - "stateSave": true - }); - $j('.dataTables_filter input').attr("placeholder", _this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({ "float": "left" }); - $j(".datatablesCenter").css({ "text-align": "center" }); - $j(".datatablesRight").css({ "float": "right" }); + $j("[md2sortby='label_status']").click(); }, 0); _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); }; StatusesAdministrationComponent.prototype.prepareStatus = function () { @@ -69,25 +44,18 @@ var StatusesAdministrationComponent = (function () { }; StatusesAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > " + - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.admin + "</a> > " + this.lang.admin_status; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.statuses; }; - StatusesAdministrationComponent.prototype.deleteStatus = function (statusId, statusIdentifier) { + StatusesAdministrationComponent.prototype.deleteStatus = function (status) { var _this = this; - var resp = confirm(this.lang.deleteConfirm + ' ' + statusId + '?'); + var resp = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + status.id + ' »'); if (resp) { - this.http.delete(this.coreUrl + 'rest/status/' + statusIdentifier) - .subscribe(function () { - var list = _this.statusList; - for (var i = 0; i < list.length; i++) { - if (list[i].id == statusId) { - list.splice(i, 1); - } - } - _this.table.row($j("#" + statusId)).remove().draw(); - successNotification(_this.lang.delStatus + " : " + statusId); - _this.nbStatus = Object.keys(_this.statusList).length; + this.http.delete(this.coreUrl + 'rest/status/' + status.identifier) + .subscribe(function (data) { + _this.data = data.statuses; + _this.notify.success(_this.lang.statusDeleted + ' « ' + status.id + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -96,8 +64,9 @@ var StatusesAdministrationComponent = (function () { StatusesAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals['statuses-administrationView'], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls: [], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient]) + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) ], StatusesAdministrationComponent); exports.StatusesAdministrationComponent = StatusesAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts index 18f0618ff55aba2396da017b877f0c8aa2578a5d..719fef1e1b0f3949bbff6d982e11c1255afcce41 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/statuses-administration.component.ts @@ -1,29 +1,30 @@ import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Router, ActivatedRoute } from '@angular/router'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; @Component({ templateUrl : angularGlobals['statuses-administrationView'], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls : [], + providers : [NotificationService] }) export class StatusesAdministrationComponent implements OnInit { coreUrl : string; + lang : any = LANG; + nbStatus : number; - lang : any = ""; - table : any; statusList : any; + data : any = []; - resultInfo : string = ""; - loading : boolean = false; + loading : boolean = false; - constructor(public http: HttpClient) { + constructor(public http: HttpClient, private notify: NotificationService) { } ngOnInit(): void { @@ -36,43 +37,14 @@ export class StatusesAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/status') .subscribe((data : any) => { this.statusList = data.statusList; - this.lang = data.lang; - this.nbStatus = Object.keys(this.statusList).length; + this.data = this.statusList; setTimeout(() => { - this.table = $j('#statusTable').DataTable({ - "dom": '<"datatablesLeft"p><"datatablesRight"f><"datatablesCenter"l>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [ 10, 25, 50, 75, 100 ], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ "+this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": this.lang.next+" <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> "+this.lang.previous - }, - "sInfoEmpty": this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ "+this.lang.record+")" - }, - "order": [[ 2, "asc" ]], - "columnDefs": [ - { "orderable": false, "targets": [0,3] } - ], - "stateSave": true - }); - $j('.dataTables_filter input').attr("placeholder", this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({"float":"left"}); - $j(".datatablesCenter").css({"text-align":"center"}); - $j(".datatablesRight").css({"float":"right"}); - + $j("[md2sortby='label_status']").click(); }, 0); this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } @@ -82,26 +54,19 @@ export class StatusesAdministrationComponent implements OnInit { updateBreadcrumb(applicationName: string){ $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > "+ - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.admin + "</a> > " + this.lang.admin_status; + "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.statuses; } - deleteStatus(statusId : string, statusIdentifier : string){ - var resp = confirm(this.lang.deleteConfirm+' '+statusId+'?'); + deleteStatus(status : any){ + var resp = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+status.id+' »'); if(resp){ - this.http.delete(this.coreUrl + 'rest/status/'+statusIdentifier) - .subscribe(() => { - var list = this.statusList; - for(var i = 0; i<list.length;i++){ - if(list[i].id==statusId){ - list.splice(i, 1); - } - } - this.table.row($j("#"+statusId)).remove().draw(); - - successNotification(this.lang.delStatus + " : " + statusId); - this.nbStatus = Object.keys(this.statusList).length; + this.http.delete(this.coreUrl + 'rest/status/'+status.identifier) + .subscribe((data : any) => { + this.data = data.statuses; + this.notify.success(this.lang.statusDeleted+' « '+status.id+' »'); + }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js index b149172318c3cf84febee1e7037531718e48f6b0..85fae090b052141017784cdf55f7cd22f199e550 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.js @@ -13,14 +13,17 @@ var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); var router_1 = require("@angular/router"); var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); var UserAdministrationComponent = (function () { - function UserAdministrationComponent(http, route, router, zone) { + function UserAdministrationComponent(http, route, router, zone, notify) { var _this = this; this.http = http; this.route = route; this.router = router; this.zone = zone; + this.notify = notify; this.lang = translate_component_1.LANG; + this._search = ''; this.user = {}; this.signatureModel = { base64: "", @@ -31,56 +34,101 @@ var UserAdministrationComponent = (function () { label: "", }; this.userAbsenceModel = []; + this.userList = []; this.selectedSignature = -1; this.selectedSignatureLabel = ""; + this.data = []; this.loading = false; window['angularUserAdministrationComponent'] = { componentAfterUpload: function (base64Content) { return _this.processAfterUpload(base64Content); }, }; } UserAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { - if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/users\"' style='cursor: pointer'>Utilisateurs</a>"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > <a onclick='location.hash = \"/administration/users\"' style='cursor: pointer'>" + this.lang.users + "</a> > "; + if (this.creationMode == true) { + breadCrumb += this.lang.userCreation; } + else { + breadCrumb += this.lang.userModification; + } + $j('#ariane')[0].innerHTML = breadCrumb; }; UserAdministrationComponent.prototype.ngOnInit = function () { var _this = this; - this.updateBreadcrumb(angularGlobals.applicationName); + //$j('#header').remove(); this.coreUrl = angularGlobals.coreUrl; this.loading = true; this.route.params.subscribe(function (params) { if (typeof params['id'] == "undefined") { - _this.userCreation = true; + _this.creationMode = true; _this.loading = false; + _this.updateBreadcrumb(angularGlobals.applicationName); } else { - _this.userCreation = false; + _this.creationMode = false; _this.serialId = params['id']; _this.http.get(_this.coreUrl + "rest/users/" + _this.serialId + "/details") .subscribe(function (data) { _this.user = data; + _this.data = data.history; _this.userId = data.user_id; + _this.updateBreadcrumb(angularGlobals.applicationName); _this.loading = false; - setTimeout(function () { - $j("#absenceUser").typeahead({ - order: "asc", - display: "formattedUser", - templateValue: "{{user_id}}", - source: { - ajax: { - type: "GET", - dataType: "json", - url: _this.coreUrl + "rest/users/autocompleter", - } - } - }); - }, 0); }, function () { location.href = "index.php"; }); } }); }; + UserAdministrationComponent.prototype.toogleRedirect = function (basket) { + var _this = this; + $j('#redirectUser_' + basket.group_id + '_' + basket.basket_id).toggle(); + this.http.get(this.coreUrl + 'rest/administration/users') + .subscribe(function (data) { + _this.userList = data['users']; + }, function () { + location.href = "index.php"; + }); + }; + UserAdministrationComponent.prototype.initService = function () { + var _this = this; + if ($j('.jstree-container-ul').length == 0) { + $j('#jstree').jstree({ + "checkbox": { + "three_state": false //no cascade selection + }, + 'core': { + 'themes': { + 'name': 'proton', + 'responsive': true + }, + 'data': this.user.allEntities + }, + "plugins": ["checkbox", "search"] + }); + $j('#jstree') + .on('select_node.jstree', function (e, data) { + _this.addEntity(data.node.id); + }).on('deselect_node.jstree', function (e, data) { + console.log(data.node.id); + _this.deleteEntity(data.node.id); + }) + .jstree(); + var to = false; + $j('#jstree_search').keyup(function () { + if (to) { + clearTimeout(to); + } + to = setTimeout(function () { + var v = $j('#jstree_search').val(); + $j('#jstree').jstree(true).search(v); + }, 250); + }); + } + if ($j("[md2sortby='event_date']").length != 0) { + $j("[md2sortby='event_date']").click(); + } + }; UserAdministrationComponent.prototype.processAfterUpload = function (b64Content) { var _this = this; this.zone.run(function () { return _this.resfreshUpload(b64Content); }); @@ -96,13 +144,14 @@ var UserAdministrationComponent = (function () { this.signatureModel.type = ""; this.signatureModel.base64 = ""; this.signatureModel.base64ForJs = ""; - errorNotification("Taille maximum de fichier dépassée (2 MB)"); + this.notify.error("Taille maximum de fichier dépassée (2 MB)"); } }; UserAdministrationComponent.prototype.clickOnUploader = function (id) { $j('#' + id).click(); }; UserAdministrationComponent.prototype.uploadSignatureTrigger = function (fileInput) { + var _this = this; if (fileInput.target.files && fileInput.target.files[0]) { var reader = new FileReader(); this.signatureModel.name = fileInput.target.files[0].name; @@ -114,6 +163,7 @@ var UserAdministrationComponent = (function () { reader.readAsDataURL(fileInput.target.files[0]); reader.onload = function (value) { window['angularUserAdministrationComponent'].componentAfterUpload(value.target.result); + _this.submitSignature(); }; } }; @@ -121,85 +171,77 @@ var UserAdministrationComponent = (function () { this.selectedSignature = index; this.selectedSignatureLabel = this.user.signatures[index].signature_label; }; - UserAdministrationComponent.prototype.resetPassword = function () { - var r = confirm('Voulez-vous vraiment réinitialiser le mot de passe de l\'utilisateur ?'); + UserAdministrationComponent.prototype.resetPassword = function (user) { + var _this = this; + var r = confirm(this.lang.confirmAction + ' ' + this.lang.resetPsw); if (r) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/password", {}) .subscribe(function (data) { - successNotification(data.success); + _this.notify.success(_this.lang.pswReseted + ' ' + _this.lang.for + ' « ' + user.user_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); } }; - UserAdministrationComponent.prototype.addGroup = function () { + UserAdministrationComponent.prototype.toggleGroup = function (group) { var _this = this; - var index = $j("#groupsSelect option:selected").index(); - if (index > 0) { - var group = { - "groupId": this.user.allGroups[index - 1].group_id, - "role": $j("#groupRole")[0].value + if ($j('#' + group.group_id + '-input').is(':checked') == true) { + var groupReq = { + "groupId": group.group_id, + "role": group.role }; - this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/groups", group) + this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/groups", groupReq) .subscribe(function (data) { _this.user.groups = data.groups; _this.user.allGroups = data.allGroups; - $j("#groupRole")[0].value = ""; - $j('#addGroupModal').modal('hide'); - successNotification(data.success); + _this.user.baskets = data.baskets; + _this.notify.success(_this.lang.groupAdded + ' « ' + group.group_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); } - }; - UserAdministrationComponent.prototype.updateGroup = function (group) { - this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id, group) - .subscribe(function (data) { - successNotification(data.success); - }, function (err) { - errorNotification(err.error.errors); - }); - }; - UserAdministrationComponent.prototype.deleteGroup = function (group) { - var _this = this; - var r = confirm('Voulez-vous vraiment retirer l\'utilisateur de ce groupe ?'); - if (r) { + else { this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id) .subscribe(function (data) { _this.user.groups = data.groups; _this.user.allGroups = data.allGroups; - successNotification(data.success); + _this.notify.success(_this.lang.groupDeleted + ' « ' + group.group_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); } }; - UserAdministrationComponent.prototype.addEntity = function () { + UserAdministrationComponent.prototype.updateGroup = function (group) { var _this = this; - var index = $j("#entitiesSelect option:selected").index(); - if (index > 0) { - var entity = { - "entityId": this.user.allEntities[index - 1].entity_id, - "role": $j("#entityRole")[0].value - }; - this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/entities", entity) - .subscribe(function (data) { - _this.user.entities = data.entities; - _this.user.allEntities = data.allEntities; - $j("#entityRole")[0].value = ""; - $j('#addEntityModal').modal('hide'); - successNotification(data.success); - }, function (err) { - errorNotification(err.error.errors); - }); - } + this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id, group) + .subscribe(function (data) { + _this.notify.success(_this.lang.groupUpdated + ' « ' + group.group_id + ' »'); + }, function (err) { + _this.notify.error(err.error.errors); + }); + }; + UserAdministrationComponent.prototype.addEntity = function (entiyId) { + var _this = this; + var entity = { + "entityId": entiyId, + "role": '' + }; + this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/entities", entity) + .subscribe(function (data) { + _this.user.entities = data.entities; + _this.user.allEntities = data.allEntities; + _this.notify.success(_this.lang.entityAdded + ' « ' + entiyId + ' »'); + }, function (err) { + _this.notify.error(err.error.errors); + }); }; UserAdministrationComponent.prototype.updateEntity = function (entity) { + var _this = this; this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id, entity) .subscribe(function (data) { - successNotification(data.success); + _this.notify.success(_this.lang.entityUpdated + ' « ' + entity.entity_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); }; UserAdministrationComponent.prototype.updatePrimaryEntity = function (entity) { @@ -207,30 +249,28 @@ var UserAdministrationComponent = (function () { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id + "/primaryEntity", {}) .subscribe(function (data) { _this.user['entities'] = data.entities; - successNotification(data.success); + _this.notify.success(_this.lang.entityTooglePrimary + ' « ' + entity.entity_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); }; - UserAdministrationComponent.prototype.deleteEntity = function (entity) { + UserAdministrationComponent.prototype.deleteEntity = function (entityId) { var _this = this; - var r = confirm('Voulez-vous vraiment retirer l\'utilisateur de cette entité ?'); - if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id) - .subscribe(function (data) { - _this.user.entities = data.entities; - _this.user.allEntities = data.allEntities; - successNotification(data.success); - }, function (err) { - errorNotification(err.error.errors); - }); - } + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entityId) + .subscribe(function (data) { + _this.user.entities = data.entities; + _this.user.allEntities = data.allEntities; + _this.notify.success(_this.lang.entityDeleted + ' « ' + entityId + ' »'); + }, function (err) { + _this.notify.error(err.error.errors); + }); }; UserAdministrationComponent.prototype.submitSignature = function () { var _this = this; this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/signatures", this.signatureModel) .subscribe(function (data) { _this.user.signatures = data.signatures; + _this.notify.success(_this.lang.signAdded + ' « ' + _this.signatureModel.name + ' »'); _this.signatureModel = { base64: "", base64ForJs: "", @@ -239,56 +279,53 @@ var UserAdministrationComponent = (function () { size: 0, label: "", }; - successNotification(data.success); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); }; - UserAdministrationComponent.prototype.updateSignature = function () { + UserAdministrationComponent.prototype.updateSignature = function (selectedSignature) { var _this = this; - var id = this.user.signatures[this.selectedSignature].id; - this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id, { "label": this.selectedSignatureLabel }) + var id = this.user.signatures[selectedSignature].id; + var label = this.user.signatures[selectedSignature].signature_label; + this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id, { "label": label }) .subscribe(function (data) { - _this.user.signatures[_this.selectedSignature].signature_label = data.signature.signature_label; - _this.selectedSignature = -1; - _this.selectedSignatureLabel = ""; - successNotification(data.success); + _this.user.signatures[selectedSignature].signature_label = data.signature.signature_label; + _this.notify.success(_this.lang.signUpdated + ' « ' + data.signature.signature_label + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); }; - UserAdministrationComponent.prototype.deleteSignature = function (id) { + UserAdministrationComponent.prototype.deleteSignature = function (signature) { var _this = this; - var r = confirm('Voulez-vous vraiment supprimer la signature ?'); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + signature.signature_label + ' »'); if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id) + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + signature.id) .subscribe(function (data) { _this.user.signatures = data.signatures; - successNotification(data.success); + _this.notify.success(_this.lang.signDeleted + ' « ' + signature.signature_label + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); } }; - UserAdministrationComponent.prototype.addBasketRedirection = function () { - var index = $j("#selectBasketAbsenceUser option:selected").index(); - if (index > 0 && $j("#absenceUser")[0].value != "") { + UserAdministrationComponent.prototype.addBasketRedirection = function (i, basket) { + var r = false; + if (this.user.status != 'ABS') { + var r_1 = confirm(this.lang.confirmAction + ' ' + this.lang.activateAbs); + } + if (r || this.user.status == 'ABS') { this.userAbsenceModel.push({ - "basketId": this.user.baskets[index - 1].basket_id, - "basketName": this.user.baskets[index - 1].basket_name, - "virtual": this.user.baskets[index - 1].is_virtual, - "basketOwner": this.user.baskets[index - 1].basket_owner, - "newUser": $j("#absenceUser")[0].value, - "index": index - 1 + "basketId": this.user.baskets[i].basket_id, + "basketName": this.user.baskets[i].basket_name, + "virtual": this.user.baskets[i].is_virtual, + "basketOwner": this.user.baskets[i].basket_owner, + "newUser": this.user.baskets[i].userToDisplay }); - this.user.baskets[index - 1].disabled = true; - $j('#selectBasketAbsenceUser option:eq(0)').prop("selected", true); - $j("#absenceUser")[0].value = ""; + this.activateAbsence(); } }; - UserAdministrationComponent.prototype.delBasketRedirection = function (index) { - this.user.baskets[this.userAbsenceModel[index].index].disabled = false; - this.userAbsenceModel.splice(index, 1); + UserAdministrationComponent.prototype.delBasketRedirection = function (i) { + this.user.baskets[i].userToDisplay = ''; }; UserAdministrationComponent.prototype.activateAbsence = function () { var _this = this; @@ -296,39 +333,41 @@ var UserAdministrationComponent = (function () { .subscribe(function (data) { _this.user.status = data.user.status; _this.userAbsenceModel = []; - $j('#manageAbs').modal('hide'); - successNotification(data.success); + _this.notify.success(_this.lang.absOn + ' ' + _this.lang.for + ' « ' + _this.user.user_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); }; - UserAdministrationComponent.prototype.deactivateAbsence = function () { + UserAdministrationComponent.prototype.desactivateAbsence = function () { var _this = this; this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/status", { "status": "OK" }) .subscribe(function (data) { _this.user.status = data.user.status; - successNotification(data.success); + for (var i in _this.user.baskets) { + _this.user.baskets[i].userToDisplay = ''; + } + _this.notify.success(_this.lang.absOff + ' ' + _this.lang.for + ' « ' + _this.user.user_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); }; UserAdministrationComponent.prototype.onSubmit = function () { var _this = this; - if (this.userCreation) { + if (this.creationMode) { this.http.post(this.coreUrl + "rest/users", this.user) .subscribe(function (data) { - successNotification(data.success); + _this.notify.success(_this.lang.userAdded + ' « ' + data.user.user_id + ' »'); _this.router.navigate(["/administration/users/" + data.user.id]); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); } else { this.http.put(this.coreUrl + "rest/users/" + this.serialId, this.user) .subscribe(function (data) { - successNotification(data.success); + _this.notify.success(_this.lang.userUpdated + ' « ' + _this.user.user_id + ' »'); }, function (err) { - errorNotification(err.error.errors); + _this.notify.error(err.error.errors); }); } }; @@ -337,8 +376,9 @@ var UserAdministrationComponent = (function () { UserAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals["user-administrationView"], - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/user-administration.component.css'] + styleUrls: ['css/user-administration.component.css'], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router, core_1.NgZone]) + __metadata("design:paramtypes", [http_1.HttpClient, router_1.ActivatedRoute, router_1.Router, core_1.NgZone, notification_service_1.NotificationService]) ], UserAdministrationComponent); exports.UserAdministrationComponent = UserAdministrationComponent; 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 3f503996a9dd1f6cbc51d4146c5034c0ba61bd7c..922e9adc0fbcbe04399bbf90ce2da654a55638e8 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/user-administration.component.ts @@ -2,25 +2,27 @@ import { Component, OnInit, NgZone } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { ActivatedRoute, Router } from '@angular/router'; import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare const angularGlobals : any; @Component({ templateUrl : angularGlobals["user-administrationView"], - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css', 'css/user-administration.component.css'] + styleUrls : ['css/user-administration.component.css'], + providers : [NotificationService] }) export class UserAdministrationComponent implements OnInit { coreUrl : string; lang : any = LANG; + _search : string = ''; + userId : string; serialId : number; - userCreation : boolean; + creationMode : boolean; user : any = {}; signatureModel : any = { @@ -32,57 +34,54 @@ export class UserAdministrationComponent implements OnInit { label : "", }; userAbsenceModel : any[] = []; - + userList : any[] = []; + selectedSignature : number = -1; selectedSignatureLabel : string = ""; + data : any = []; loading : boolean = false; - - constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router, private zone: NgZone) { + constructor(public http: HttpClient, private route: ActivatedRoute, private router: Router, private zone: NgZone, private notify: NotificationService) { window['angularUserAdministrationComponent'] = { componentAfterUpload: (base64Content: any) => this.processAfterUpload(base64Content), }; + } updateBreadcrumb(applicationName: string) { - if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > <a onclick='location.hash = \"/administration/users\"' style='cursor: pointer'>Utilisateurs</a>"; + var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > <a onclick='location.hash = \"/administration/users\"' style='cursor: pointer'>"+this.lang.users+"</a> > "; + + if(this.creationMode == true){ + breadCrumb += this.lang.userCreation; + } else { + breadCrumb += this.lang.userModification; } + $j('#ariane')[0].innerHTML = breadCrumb; } ngOnInit(): void { - this.updateBreadcrumb(angularGlobals.applicationName); + //$j('#header').remove(); this.coreUrl = angularGlobals.coreUrl; this.loading = true; this.route.params.subscribe(params => { if (typeof params['id'] == "undefined") { - this.userCreation = true; + this.creationMode = true; this.loading = false; + this.updateBreadcrumb(angularGlobals.applicationName); } else { - this.userCreation = false; + this.creationMode = false; this.serialId = params['id']; this.http.get(this.coreUrl + "rest/users/" + this.serialId + "/details") .subscribe((data : any) => { this.user = data; + this.data = data.history; this.userId = data.user_id; - + this.updateBreadcrumb(angularGlobals.applicationName); this.loading = false; - setTimeout(() => { - $j("#absenceUser").typeahead({ - order: "asc", - display: "formattedUser", - templateValue: "{{user_id}}", - source: { - ajax: { - type: "GET", - dataType: "json", - url: this.coreUrl + "rest/users/autocompleter", - } - } - }); - }, 0); + + }, () => { location.href = "index.php"; }); @@ -90,6 +89,58 @@ export class UserAdministrationComponent implements OnInit { }); } + toogleRedirect(basket:any) { + $j('#redirectUser_'+basket.group_id+'_'+basket.basket_id).toggle(); + + this.http.get(this.coreUrl + 'rest/administration/users') + .subscribe((data : any) => { + this.userList = data['users']; + + }, () => { + location.href = "index.php"; + }); + } + + initService(){ + if($j('.jstree-container-ul').length == 0){ + $j('#jstree').jstree({ + "checkbox" : { + "three_state" : false //no cascade selection + }, + 'core' : { + 'themes': { + 'name': 'proton', + 'responsive': true + }, + 'data' : this.user.allEntities + }, + "plugins" : [ "checkbox", "search" ] + }); + $j('#jstree') + // listen for event + .on('select_node.jstree', (e:any, data:any) => { + this.addEntity(data.node.id); + }).on('deselect_node.jstree', (e:any, data:any) => { + console.log(data.node.id); + this.deleteEntity(data.node.id); + }) + // create the instance + .jstree(); + + var to : any = false; + $j('#jstree_search').keyup(function () { + if(to) { clearTimeout(to); } + to = setTimeout(function () { + var v = $j('#jstree_search').val(); + $j('#jstree').jstree(true).search(v); + }, 250); + }); + } + if($j("[md2sortby='event_date']").length != 0){ + $j("[md2sortby='event_date']").click(); + } + } + processAfterUpload(b64Content: any) { this.zone.run(() => this.resfreshUpload(b64Content)); } @@ -105,7 +156,7 @@ export class UserAdministrationComponent implements OnInit { this.signatureModel.base64 = ""; this.signatureModel.base64ForJs = ""; - errorNotification("Taille maximum de fichier dépassée (2 MB)"); + this.notify.error("Taille maximum de fichier dépassée (2 MB)"); } } @@ -126,10 +177,10 @@ export class UserAdministrationComponent implements OnInit { reader.readAsDataURL(fileInput.target.files[0]); - reader.onload = function (value: any) { + reader.onload = (value: any) => { window['angularUserAdministrationComponent'].componentAfterUpload(value.target.result); + this.submitSignature(); }; - } } @@ -138,93 +189,78 @@ export class UserAdministrationComponent implements OnInit { this.selectedSignatureLabel = this.user.signatures[index].signature_label; } - resetPassword() { - let r = confirm('Voulez-vous vraiment réinitialiser le mot de passe de l\'utilisateur ?'); + resetPassword(user:any) { + let r = confirm(this.lang.confirmAction+' '+this.lang.resetPsw); if (r) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/password", {}) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.pswReseted+' '+this.lang.for+' « '+user.user_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } } - addGroup() { - var index = $j("#groupsSelect option:selected").index(); - - if (index > 0) { - var group = { - "groupId" : this.user.allGroups[index - 1].group_id, - "role" : $j("#groupRole")[0].value + toggleGroup(group: any){ + if($j('#'+group.group_id+'-input').is(':checked') == true){ + var groupReq = { + "groupId" : group.group_id, + "role" : group.role }; - - this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/groups", group) - .subscribe((data : any) => { - this.user.groups = data.groups; - this.user.allGroups = data.allGroups; - $j("#groupRole")[0].value = ""; - $j('#addGroupModal').modal('hide'); - successNotification(data.success); - }, (err) => { - errorNotification(err.error.errors); - }); + this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/groups", groupReq) + .subscribe((data : any) => { + this.user.groups = data.groups; + this.user.allGroups = data.allGroups; + this.user.baskets = data.baskets; + this.notify.success(this.lang.groupAdded+' « '+group.group_id+' »'); + }, (err) => { + this.notify.error(err.error.errors); + }); + }else{ + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id) + .subscribe((data : any) => { + this.user.groups = data.groups; + this.user.allGroups = data.allGroups; + this.notify.success(this.lang.groupDeleted+' « '+group.group_id+' »'); + }, (err) => { + this.notify.error(err.error.errors); + }); } } - updateGroup(group: any) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id, group) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.groupUpdated+' « '+group.group_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } - deleteGroup(group: any) { - let r = confirm('Voulez-vous vraiment retirer l\'utilisateur de ce groupe ?'); + addEntity(entiyId:any) { - if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/groups/" + group.group_id) - .subscribe((data : any) => { - this.user.groups = data.groups; - this.user.allGroups = data.allGroups; - successNotification(data.success); - }, (err) => { - errorNotification(err.error.errors); - }); - } - } - - addEntity() { - var index = $j("#entitiesSelect option:selected").index(); - - if (index > 0) { - var entity = { - "entityId" : this.user.allEntities[index - 1].entity_id, - "role" : $j("#entityRole")[0].value - }; + var entity = { + "entityId" : entiyId, + "role" : '' + }; - this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/entities", entity) - .subscribe((data : any) => { - this.user.entities = data.entities; - this.user.allEntities = data.allEntities; - $j("#entityRole")[0].value = ""; - $j('#addEntityModal').modal('hide'); - successNotification(data.success); - }, (err) => { - errorNotification(err.error.errors); - }); - } + this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/entities", entity) + .subscribe((data : any) => { + this.user.entities = data.entities; + this.user.allEntities = data.allEntities; + this.notify.success(this.lang.entityAdded+' « '+entiyId+' »'); + }, (err) => { + this.notify.error(err.error.errors); + }); + } updateEntity(entity: any) { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id, entity) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.entityUpdated+' « '+entity.entity_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } @@ -232,31 +268,30 @@ export class UserAdministrationComponent implements OnInit { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id + "/primaryEntity", {}) .subscribe((data : any) => { this.user['entities'] = data.entities; - successNotification(data.success); + this.notify.success(this.lang.entityTooglePrimary+' « '+entity.entity_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } - deleteEntity(entity: any) { - let r = confirm('Voulez-vous vraiment retirer l\'utilisateur de cette entité ?'); + deleteEntity(entityId: any) { - if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entity.entity_id) - .subscribe((data : any) => { - this.user.entities = data.entities; - this.user.allEntities = data.allEntities; - successNotification(data.success); - }, (err) => { - errorNotification(err.error.errors); - }); - } + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/entities/" + entityId) + .subscribe((data : any) => { + this.user.entities = data.entities; + this.user.allEntities = data.allEntities; + this.notify.success(this.lang.entityDeleted+' « '+entityId+' »'); + }, (err) => { + this.notify.error(err.error.errors); + }); + } submitSignature() { this.http.post(this.coreUrl + "rest/users/" + this.serialId + "/signatures", this.signatureModel) .subscribe((data : any) => { this.user.signatures = data.signatures; + this.notify.success(this.lang.signAdded+' « '+this.signatureModel.name+' »'); this.signatureModel = { base64 : "", base64ForJs : "", @@ -265,61 +300,58 @@ export class UserAdministrationComponent implements OnInit { size : 0, label : "", }; - successNotification(data.success); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } - updateSignature() { - var id = this.user.signatures[this.selectedSignature].id; - - this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id, {"label" : this.selectedSignatureLabel}) + updateSignature(selectedSignature:any) { + var id = this.user.signatures[selectedSignature].id; + var label = this.user.signatures[selectedSignature].signature_label; + + this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id, {"label" : label}) .subscribe((data : any) => { - this.user.signatures[this.selectedSignature].signature_label = data.signature.signature_label; - this.selectedSignature = -1; - this.selectedSignatureLabel = ""; - successNotification(data.success); + this.user.signatures[selectedSignature].signature_label = data.signature.signature_label; + this.notify.success(this.lang.signUpdated+' « '+data.signature.signature_label+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } - deleteSignature(id: number) { - let r = confirm('Voulez-vous vraiment supprimer la signature ?'); + deleteSignature(signature: any) { + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+signature.signature_label+' »'); if (r) { - this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + id) + this.http.delete(this.coreUrl + "rest/users/" + this.serialId + "/signatures/" + signature.id) .subscribe((data : any) => { this.user.signatures = data.signatures; - successNotification(data.success); + this.notify.success(this.lang.signDeleted+' « '+signature.signature_label+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } } - addBasketRedirection() { - var index = $j("#selectBasketAbsenceUser option:selected").index(); - - if (index > 0 && $j("#absenceUser")[0].value != "") { + addBasketRedirection(i:number,basket:any) { + let r = false; + if(this.user.status != 'ABS'){ + let r = confirm(this.lang.confirmAction+' '+this.lang.activateAbs); + } + + if (r || this.user.status == 'ABS') { this.userAbsenceModel.push({ - "basketId" : this.user.baskets[index - 1].basket_id, - "basketName" : this.user.baskets[index - 1].basket_name, - "virtual" : this.user.baskets[index - 1].is_virtual, - "basketOwner" : this.user.baskets[index - 1].basket_owner, - "newUser" : $j("#absenceUser")[0].value, - "index" : index - 1 + "basketId" : this.user.baskets[i].basket_id, + "basketName" : this.user.baskets[i].basket_name, + "virtual" : this.user.baskets[i].is_virtual, + "basketOwner" : this.user.baskets[i].basket_owner, + "newUser" : this.user.baskets[i].userToDisplay }); - this.user.baskets[index - 1].disabled = true; - $j('#selectBasketAbsenceUser option:eq(0)').prop("selected", true); - $j("#absenceUser")[0].value = ""; + this.activateAbsence(); } } - delBasketRedirection(index: number) { - this.user.baskets[this.userAbsenceModel[index].index].disabled = false; - this.userAbsenceModel.splice(index, 1); + delBasketRedirection(i:number) { + this.user.baskets[i].userToDisplay = ''; } activateAbsence() { @@ -327,38 +359,40 @@ export class UserAdministrationComponent implements OnInit { .subscribe((data : any) => { this.user.status = data.user.status; this.userAbsenceModel = []; - $j('#manageAbs').modal('hide'); - successNotification(data.success); + this.notify.success(this.lang.absOn+' '+this.lang.for+' « '+this.user.user_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } - deactivateAbsence() { + desactivateAbsence() { this.http.put(this.coreUrl + "rest/users/" + this.serialId + "/status", {"status" : "OK"}) .subscribe((data : any) => { this.user.status = data.user.status; - successNotification(data.success); + for (let i in this.user.baskets) { + this.user.baskets[i].userToDisplay = ''; + } + this.notify.success(this.lang.absOff+' '+this.lang.for+' « '+this.user.user_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } onSubmit() { - if (this.userCreation) { + if (this.creationMode) { this.http.post(this.coreUrl + "rest/users", this.user) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.userAdded+' « '+data.user.user_id+' »'); this.router.navigate(["/administration/users/" + data.user.id]); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } else { this.http.put(this.coreUrl + "rest/users/" + this.serialId, this.user) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.userUpdated+' « '+this.user.user_id+' »'); }, (err) => { - errorNotification(err.error.errors); + this.notify.error(err.error.errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js index a3987ee0309c48feb0d8c2895a9deb72db9e9132..03c7bca00331c85884fe080133ec39370c0ff71b 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.js @@ -11,19 +11,42 @@ var __metadata = (this && this.__metadata) || function (k, v) { Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var http_1 = require("@angular/common/http"); +var translate_component_1 = require("../translate.component"); +var notification_service_1 = require("../notification.service"); +var DataTablePipe = (function () { + function DataTablePipe() { + } + DataTablePipe.prototype.transform = function (array, field, query) { + if (query) { + query = query.toLowerCase(); + console.log(array); + return array.filter(function (value) { + return value[field].toLowerCase().indexOf(query) > -1; + }); + } + return array; + }; + return DataTablePipe; +}()); +DataTablePipe = __decorate([ + core_1.Pipe({ name: 'dataPipe' }) +], DataTablePipe); +exports.DataTablePipe = DataTablePipe; var UsersAdministrationComponent = (function () { - function UsersAdministrationComponent(http) { + function UsersAdministrationComponent(http, notify) { this.http = http; + this.notify = notify; + this.search = null; this.users = []; this.userDestRedirect = {}; this.userDestRedirectModels = []; - this.lang = {}; - this.resultInfo = ""; + this.lang = translate_component_1.LANG; this.loading = false; + this.data = []; } UsersAdministrationComponent.prototype.updateBreadcrumb = function (applicationName) { if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Utilisateurs"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + this.lang.users; } }; UsersAdministrationComponent.prototype.ngOnInit = function () { @@ -34,37 +57,11 @@ var UsersAdministrationComponent = (function () { this.http.get(this.coreUrl + 'rest/administration/users') .subscribe(function (data) { _this.users = data['users']; - _this.lang = data.lang; + _this.data = _this.users; + _this.loading = false; setTimeout(function () { - _this.table = $j('#usersTable').DataTable({ - "dom": '<"datatablesLeft"p><"datatablesRight"f><"datatablesCenter"l>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [10, 25, 50, 75, 100], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": _this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ " + _this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": _this.lang.next + " <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> " + _this.lang.previous - }, - "sInfoEmpty": _this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ " + _this.lang.record + ")" - }, - "order": [[1, "asc"]], - "columnDefs": [ - { "orderable": false, "targets": [3, 5] } - ] - }); - $j('.dataTables_filter input').attr("placeholder", _this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({ "float": "left" }); - $j(".datatablesCenter").css({ "text-align": "center" }); - $j(".datatablesRight").css({ "float": "right" }); + $j("[md2sortby='user_id']").click(); }, 0); - _this.loading = false; }, function () { location.href = "index.php"; }); @@ -77,42 +74,28 @@ var UsersAdministrationComponent = (function () { this.http.get(this.coreUrl + 'rest/listModels/itemId/' + user.user_id + '/itemMode/dest/objectType/entity_id') .subscribe(function (data) { _this.userDestRedirectModels = data.listModels; - setTimeout(function () { - $j(".redirectDest").typeahead({ - order: "asc", - display: "formattedUser", - templateValue: "{{user_id}}", - source: { - ajax: { - type: "GET", - dataType: "json", - url: _this.coreUrl + "rest/users/autocompleter/exclude/" + user.user_id, - } - } - }); - }, 0); }, function (err) { console.log(err); location.href = "index.php"; }); } else { - var r = confirm(this.lang.suspendMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.suspend + ' « ' + user.user_id + ' »'); if (r) { user.enabled = 'N'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { - successNotification(data.success); + _this.notify.success(_this.lang.userSuspended + ' « ' + user.user_id + ' »'); }, function (err) { user.enabled = 'Y'; - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } } }; UsersAdministrationComponent.prototype.suspendUserModal = function (user) { var _this = this; - var r = confirm(this.lang.suspendMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.suspend + ' « ' + user.user_id + ' »'); if (r) { user.enabled = 'N'; user.redirectListModels = this.userDestRedirectModels; @@ -121,35 +104,36 @@ var UsersAdministrationComponent = (function () { .subscribe(function (data) { if (data.errors) { user.enabled = 'Y'; - errorNotification(data.errors); + _this.notify.error(data.errors); } else { //then suspend user - _this.http.put(_this.coreUrl + 'rest/users/' + user.user_id, user) + _this.http.put(_this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { user.inDiffListDest = 'N'; $j('#changeDiffListDest').modal('hide'); - successNotification(data.success); + _this.notify.success(_this.lang.userSuspended + ' « ' + user.user_id + ' »'); }, function (err) { user.enabled = 'Y'; - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; UsersAdministrationComponent.prototype.activateUser = function (user) { - var r = confirm(this.lang.authorizeMsg + " ?"); + var _this = this; + var r = confirm(this.lang.confirmAction + ' ' + this.lang.authorize + ' « ' + user.user_id + ' »'); if (r) { user.enabled = 'Y'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { - successNotification(data.success); + _this.notify.success(_this.lang.userAuthorized + ' « ' + user.user_id + ' »'); }, function (err) { user.enabled = 'N'; - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -161,70 +145,48 @@ var UsersAdministrationComponent = (function () { this.http.get(this.coreUrl + 'rest/listModels/itemId/' + user.user_id + '/itemMode/dest/objectType/entity_id') .subscribe(function (data) { _this.userDestRedirectModels = data.listModels; - setTimeout(function () { - $j(".redirectDest").typeahead({ - order: "asc", - source: { - ajax: { - type: "GET", - dataType: "json", - url: _this.coreUrl + "rest/users/autocompleter/exclude/" + user.user_id, - } - } - }); - }); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } else { - var r = confirm(this.lang.deleteMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + user.user_id + ' »'); if (r) { - this.http.delete(this.coreUrl + 'rest/users/' + user.user_id, user) + this.http.delete(this.coreUrl + 'rest/users/' + user.id, user) .subscribe(function (data) { - for (var i = 0; i < _this.users.length; i++) { - if (_this.users[i].user_id == user.user_id) { - _this.users.splice(i, 1); - } - } - _this.table.row($j("#" + user.user_id)).remove().draw(); - successNotification(data.success); + _this.data = data.users; + _this.notify.success(_this.lang.userDeleted + ' « ' + user.user_id + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } } }; UsersAdministrationComponent.prototype.deleteUserModal = function (user) { var _this = this; - var r = confirm(this.lang.deleteMsg + " ?"); + var r = confirm(this.lang.confirmAction + ' ' + this.lang.delete + ' « ' + user.user_id + ' »'); if (r) { user.redirectListModels = this.userDestRedirectModels; //first, update listModels this.http.put(this.coreUrl + 'rest/listModels/itemId/' + user.user_id + '/itemMode/dest/objectType/entity_id', user) .subscribe(function (data) { if (data.errors) { - errorNotification(data.errors); + _this.notify.error(data.errors); } else { //then delete user - _this.http.delete(_this.coreUrl + 'rest/users/' + user.user_id) + _this.http.delete(_this.coreUrl + 'rest/users/' + user.id) .subscribe(function (data) { user.inDiffListDest = 'N'; + _this.data = data.users; $j('#changeDiffListDest').modal('hide'); - for (var i = 0; i < _this.users.length; i++) { - if (_this.users[i].user_id == user.user_id) { - _this.users.splice(i, 1); - } - } - _this.table.row($j("#" + user.user_id)).remove().draw(); - successNotification(data.success); + _this.notify.success(_this.lang.userDeleted + ' « ' + user.user_id + ' »'); }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }, function (err) { - errorNotification(JSON.parse(err._body).errors); + _this.notify.error(JSON.parse(err._body).errors); }); } }; @@ -233,8 +195,9 @@ var UsersAdministrationComponent = (function () { UsersAdministrationComponent = __decorate([ core_1.Component({ templateUrl: angularGlobals["users-administrationView"], - styleUrls: ['css/users-administration.component.css', '../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls: ['css/users-administration.component.css'], + providers: [notification_service_1.NotificationService] }), - __metadata("design:paramtypes", [http_1.HttpClient]) + __metadata("design:paramtypes", [http_1.HttpClient, notification_service_1.NotificationService]) ], UsersAdministrationComponent); exports.UsersAdministrationComponent = UsersAdministrationComponent; diff --git a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts index 13273514a6d8c580f8986e5da8e6d13bbfa24bb0..cc4aa276fbd690202622a9b74739c4afcf431271 100755 --- a/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/users-administration.component.ts @@ -1,38 +1,51 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Pipe, PipeTransform} from '@angular/core'; import { HttpClient } from '@angular/common/http'; +import { LANG } from '../translate.component'; +import { NotificationService } from '../notification.service'; declare function $j(selector: any) : any; -declare function successNotification(message: string) : void; -declare function errorNotification(message: string) : void; declare var angularGlobals : any; +@Pipe({ name: 'dataPipe' }) +export class DataTablePipe implements PipeTransform { + transform(array: any[], field: string, query: string): any { + if (query) { + query = query.toLowerCase(); + console.log(array); + return array.filter((value: any) => + value[field].toLowerCase().indexOf(query) > -1); + } + return array; + } +} @Component({ templateUrl : angularGlobals["users-administrationView"], - styleUrls : ['css/users-administration.component.css','../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + styleUrls : ['css/users-administration.component.css'], + providers : [NotificationService] }) -export class UsersAdministrationComponent implements OnInit { +export class UsersAdministrationComponent implements OnInit { + search : string = null; + coreUrl : string; users : any[] = []; userDestRedirect : any = {}; userDestRedirectModels : any[] = []; - lang : any = {}; - table : any; + lang : any = LANG; - resultInfo : string = ""; loading : boolean = false; - - constructor(public http: HttpClient) { + data : any = []; + constructor(public http: HttpClient, private notify: NotificationService) { } updateBreadcrumb(applicationName: string) { if ($j('#ariane')[0]) { - $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>Administration</a> > Utilisateurs"; + $j('#ariane')[0].innerHTML = "<a href='index.php?reinit=true'>" + applicationName + "</a> > <a onclick='location.hash = \"/administration\"' style='cursor: pointer'>"+this.lang.administration+"</a> > "+this.lang.users; } } @@ -45,40 +58,11 @@ export class UsersAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/administration/users') .subscribe((data : any) => { this.users = data['users']; - this.lang = data.lang; - + this.data = this.users; + this.loading = false; setTimeout(() => { - this.table = $j('#usersTable').DataTable({ - "dom": '<"datatablesLeft"p><"datatablesRight"f><"datatablesCenter"l>rt<"datatablesCenter"i><"clear">', - "lengthMenu": [ 10, 25, 50, 75, 100 ], - "oLanguage": { - "sLengthMenu": "<i class='fa fa-bars'></i> _MENU_", - "sZeroRecords": this.lang.noResult, - "sInfo": "_START_ - _END_ / _TOTAL_ "+this.lang.record, - "sSearch": "", - "oPaginate": { - "sFirst": "<<", - "sLast": ">>", - "sNext": this.lang.next+" <i class='fa fa-caret-right'></i>", - "sPrevious": "<i class='fa fa-caret-left'></i> "+this.lang.previous - }, - "sInfoEmpty": this.lang.noRecord, - "sInfoFiltered": "(filtré de _MAX_ "+this.lang.record+")" - }, - "order": [[ 1, "asc" ]], - "columnDefs": [ - { "orderable": false, "targets": [3,5] } - ] - }); - $j('.dataTables_filter input').attr("placeholder", this.lang.search); - $j('dataTables_filter input').addClass('form-control'); - $j(".datatablesLeft").css({"float":"left"}); - $j(".datatablesCenter").css({"text-align":"center"}); - $j(".datatablesRight").css({"float":"right"}); - + $j("[md2sortby='user_id']").click(); }, 0); - - this.loading = false; }, () => { location.href = "index.php"; }); @@ -91,42 +75,29 @@ export class UsersAdministrationComponent implements OnInit { this.http.get(this.coreUrl + 'rest/listModels/itemId/'+user.user_id+'/itemMode/dest/objectType/entity_id') .subscribe((data : any) => { this.userDestRedirectModels = data.listModels; - setTimeout(() => { - $j(".redirectDest").typeahead({ - order: "asc", - display: "formattedUser", - templateValue: "{{user_id}}", - source: { - ajax: { - type: "GET", - dataType: "json", - url: this.coreUrl + "rest/users/autocompleter/exclude/"+user.user_id, - } - } - }); - }, 0); }, (err) => { console.log(err); location.href = "index.php"; }); } else { - let r = confirm(this.lang.suspendMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.suspend+' « '+user.user_id+' »'); if (r) { user.enabled = 'N'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.userSuspended+' « '+user.user_id+' »'); + }, (err) => { user.enabled = 'Y'; - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } } suspendUserModal(user: any) { - let r = confirm(this.lang.suspendMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.suspend+' « '+user.user_id+' »'); if (r) { user.enabled = 'N'; @@ -136,42 +107,45 @@ export class UsersAdministrationComponent implements OnInit { .subscribe((data : any) => { if (data.errors) { user.enabled = 'Y'; - errorNotification(data.errors); + this.notify.error(data.errors); } else { //then suspend user - this.http.put(this.coreUrl + 'rest/users/' + user.user_id, user) + this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { user.inDiffListDest = 'N'; $j('#changeDiffListDest').modal('hide'); - successNotification(data.success); + this.notify.success(this.lang.userSuspended+' « '+user.user_id+' »'); + }, (err) => { user.enabled = 'Y'; - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } activateUser(user: any) { - let r = confirm(this.lang.authorizeMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.authorize+' « '+user.user_id+' »'); if (r) { user.enabled = 'Y'; this.http.put(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { - successNotification(data.success); + this.notify.success(this.lang.userAuthorized+' « '+user.user_id+' »'); + }, (err) => { user.enabled = 'N'; - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } deleteUser(user: any) { + if(user.inDiffListDest == 'Y') { user.mode = 'del'; this.userDestRedirect = user; @@ -179,44 +153,27 @@ export class UsersAdministrationComponent implements OnInit { .subscribe((data : any) => { this.userDestRedirectModels = data.listModels; - setTimeout(() => { - $j(".redirectDest").typeahead({ - order: "asc", - source: { - ajax: { - type: "GET", - dataType: "json", - url: this.coreUrl + "rest/users/autocompleter/exclude/"+user.user_id, - } - } - }); - }); - }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); - } else { - let r = confirm(this.lang.deleteMsg + " ?"); + } else { + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+user.user_id+' »'); if (r) { - this.http.delete(this.coreUrl + 'rest/users/' + user.user_id, user) + this.http.delete(this.coreUrl + 'rest/users/' + user.id, user) .subscribe((data : any) => { - for (var i = 0;i<this.users.length;i++) { - if(this.users[i].user_id == user.user_id){ - this.users.splice(i,1); - } - } - this.table.row($j("#"+user.user_id)).remove().draw(); - successNotification(data.success); + this.data = data.users; + this.notify.success(this.lang.userDeleted+' « '+user.user_id+' »'); + }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } } deleteUserModal(user: any) { - let r = confirm(this.lang.deleteMsg + " ?"); + let r = confirm(this.lang.confirmAction+' '+this.lang.delete+' « '+user.user_id+' »'); if (r) { user.redirectListModels = this.userDestRedirectModels; @@ -224,26 +181,22 @@ export class UsersAdministrationComponent implements OnInit { this.http.put(this.coreUrl + 'rest/listModels/itemId/'+user.user_id+'/itemMode/dest/objectType/entity_id', user) .subscribe((data : any) => { if (data.errors) { - errorNotification(data.errors); + this.notify.error(data.errors); } else { //then delete user - this.http.delete(this.coreUrl + 'rest/users/' + user.user_id) + this.http.delete(this.coreUrl + 'rest/users/' + user.id) .subscribe((data : any) => { user.inDiffListDest = 'N'; + this.data = data.users; $j('#changeDiffListDest').modal('hide'); - for (var i = 0;i<this.users.length;i++) { - if(this.users[i].user_id == user.user_id){ - this.users.splice(i,1); - } - } - this.table.row($j("#"+user.user_id)).remove().draw(); - successNotification(data.success); + this.notify.success(this.lang.userDeleted+' « '+user.user_id+' »'); + }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } }, (err) => { - errorNotification(JSON.parse(err._body).errors); + this.notify.error(JSON.parse(err._body).errors); }); } } diff --git a/apps/maarch_entreprise/js/angular/app/app-material.module.js b/apps/maarch_entreprise/js/angular/app/app-material.module.js index e572d379a363743ce45d71ef4d443f85bd357bf7..a8dab892802ed36558af1236247f70bccf4f93ca 100644 --- a/apps/maarch_entreprise/js/angular/app/app-material.module.js +++ b/apps/maarch_entreprise/js/angular/app/app-material.module.js @@ -18,12 +18,34 @@ AppMaterialModule = __decorate([ imports: [ material_1.MdCheckboxModule, material_1.MdSelectModule, - material_1.MdRadioModule + material_1.MdSlideToggleModule, + material_1.MdInputModule, + material_1.MdTooltipModule, + material_1.MdTabsModule, + material_1.MdSidenavModule, + material_1.MdButtonModule, + material_1.MdCardModule, + material_1.MdButtonToggleModule, + material_1.MdProgressSpinnerModule, + material_1.MdToolbarModule, + material_1.MdMenuModule, + material_1.MdGridListModule ], exports: [ material_1.MdCheckboxModule, material_1.MdSelectModule, - material_1.MdRadioModule + material_1.MdSlideToggleModule, + material_1.MdInputModule, + material_1.MdTooltipModule, + material_1.MdTabsModule, + material_1.MdSidenavModule, + material_1.MdButtonModule, + material_1.MdCardModule, + material_1.MdButtonToggleModule, + material_1.MdProgressSpinnerModule, + material_1.MdToolbarModule, + material_1.MdMenuModule, + material_1.MdGridListModule ] }) ], AppMaterialModule); diff --git a/apps/maarch_entreprise/js/angular/app/app-material.module.ts b/apps/maarch_entreprise/js/angular/app/app-material.module.ts index c266a44e9c9d25d4b46488a3781c53ba9d9fcd8d..142acaf37fe12f01305303df96fec532f59c5c6d 100644 --- a/apps/maarch_entreprise/js/angular/app/app-material.module.ts +++ b/apps/maarch_entreprise/js/angular/app/app-material.module.ts @@ -2,7 +2,18 @@ import { NgModule } from '@angular/core'; import { MdSelectModule, MdCheckboxModule, - MdRadioModule + MdSlideToggleModule, + MdInputModule, + MdTooltipModule, + MdTabsModule, + MdSidenavModule, + MdButtonModule, + MdCardModule, + MdButtonToggleModule, + MdProgressSpinnerModule, + MdToolbarModule, + MdMenuModule, + MdGridListModule } from '@angular/material'; @@ -10,12 +21,34 @@ import { imports: [ MdCheckboxModule, MdSelectModule, - MdRadioModule + MdSlideToggleModule, + MdInputModule, + MdTooltipModule, + MdTabsModule, + MdSidenavModule, + MdButtonModule, + MdCardModule, + MdButtonToggleModule, + MdProgressSpinnerModule, + MdToolbarModule, + MdMenuModule, + MdGridListModule ], exports: [ MdCheckboxModule, MdSelectModule, - MdRadioModule + MdSlideToggleModule, + MdInputModule, + MdTooltipModule, + MdTabsModule, + MdSidenavModule, + MdButtonModule, + MdCardModule, + MdButtonToggleModule, + MdProgressSpinnerModule, + MdToolbarModule, + MdMenuModule, + MdGridListModule ] }) export class AppMaterialModule { } diff --git a/apps/maarch_entreprise/js/angular/app/app.component.js b/apps/maarch_entreprise/js/angular/app/app.component.js index 33439b8c6e5cd8835b2de00882d6e67927448050..7040e6a6ddf632855b57dbfc6c924203d981e108 100755 --- a/apps/maarch_entreprise/js/angular/app/app.component.js +++ b/apps/maarch_entreprise/js/angular/app/app.component.js @@ -15,8 +15,15 @@ var AppComponent = (function () { AppComponent = __decorate([ core_1.Component({ selector: 'my-app', - template: "<div id=\"resultInfo\" class=\"fade\" style=\"display:none;\"></div><router-outlet></router-outlet>", - styleUrls: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + //template: `<menu-app></menu-app><router-outlet></router-outlet>`, + template: "<router-outlet></router-outlet>", + encapsulation: core_1.ViewEncapsulation.None, + styleUrls: [ + '../../node_modules/bootstrap/dist/css/bootstrap.min.css', + '../../node_modules/@angular/material/prebuilt-themes/indigo-pink.css', + 'css/engine.css', + 'css/jstree-custom.min.css' //treejs module + ] }) ], AppComponent); exports.AppComponent = AppComponent; diff --git a/apps/maarch_entreprise/js/angular/app/app.component.ts b/apps/maarch_entreprise/js/angular/app/app.component.ts index ee44d3143842c56385dcc443211f9cafb1e284dd..841d450dd0b3b0dedd13f672bca781d2bc9fb804 100755 --- a/apps/maarch_entreprise/js/angular/app/app.component.ts +++ b/apps/maarch_entreprise/js/angular/app/app.component.ts @@ -1,8 +1,15 @@ -import { Component } from '@angular/core'; +import { Component, ViewEncapsulation } from '@angular/core'; @Component({ - selector: 'my-app', - template: `<div id="resultInfo" class="fade" style="display:none;"></div><router-outlet></router-outlet>`, - styleUrls : ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'] + selector: 'my-app', + //template: `<menu-app></menu-app><router-outlet></router-outlet>`, + template: `<router-outlet></router-outlet>`, + encapsulation: ViewEncapsulation.None, + styleUrls : [ + '../../node_modules/bootstrap/dist/css/bootstrap.min.css', + '../../node_modules/@angular/material/prebuilt-themes/indigo-pink.css', + 'css/engine.css', + 'css/jstree-custom.min.css' //treejs module + ] }) export class AppComponent {} diff --git a/apps/maarch_entreprise/js/angular/app/app.module.js b/apps/maarch_entreprise/js/angular/app/app.module.js index 748f117ab91b2cdbed94516c2d3616ff726d54bb..8bcaa65780b5345b8c9bf97c2a280bdd07890476 100755 --- a/apps/maarch_entreprise/js/angular/app/app.module.js +++ b/apps/maarch_entreprise/js/angular/app/app.module.js @@ -11,6 +11,9 @@ var platform_browser_1 = require("@angular/platform-browser"); var animations_1 = require("@angular/platform-browser/animations"); var forms_1 = require("@angular/forms"); var http_1 = require("@angular/common/http"); +var app_material_module_1 = require("./app-material.module"); +var md2_1 = require("md2"); +var header_component_1 = require("./header.component"); var app_component_1 = require("./app.component"); var app_routing_module_1 = require("./app-routing.module"); var administration_module_1 = require("./administration/administration.module"); @@ -29,9 +32,12 @@ AppModule = __decorate([ forms_1.FormsModule, http_1.HttpClientModule, administration_module_1.AdministrationModule, - app_routing_module_1.AppRoutingModule + app_routing_module_1.AppRoutingModule, + app_material_module_1.AppMaterialModule, + md2_1.Md2Module ], declarations: [ + header_component_1.HeaderComponent, app_component_1.AppComponent, profile_component_1.ProfileComponent, signature_book_component_1.SignatureBookComponent, diff --git a/apps/maarch_entreprise/js/angular/app/app.module.ts b/apps/maarch_entreprise/js/angular/app/app.module.ts index c3afb563acfe5819d4eff1228230cfdc7a5e269d..a21c8654434e4747cfe6051e35f6b9924146ffa7 100755 --- a/apps/maarch_entreprise/js/angular/app/app.module.ts +++ b/apps/maarch_entreprise/js/angular/app/app.module.ts @@ -3,7 +3,10 @@ import { BrowserModule } from '@angular/platform-browser' import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { FormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; +import { AppMaterialModule } from './app-material.module'; +import { Md2Module } from 'md2'; +import { HeaderComponent } from './header.component'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import { AdministrationModule } from './administration/administration.module'; @@ -12,20 +15,23 @@ import { ProfileComponent } from './profile.component'; import { SignatureBookComponent, SafeUrlPipe } from './signature-book.component'; @NgModule({ - imports: [ - BrowserModule, - BrowserAnimationsModule, - FormsModule, - HttpClientModule, - AdministrationModule, - AppRoutingModule - ], - declarations: [ - AppComponent, - ProfileComponent, - SignatureBookComponent, - SafeUrlPipe - ], - bootstrap: [ AppComponent] + imports: [ + BrowserModule, + BrowserAnimationsModule, + FormsModule, + HttpClientModule, + AdministrationModule, + AppRoutingModule, + AppMaterialModule, + Md2Module + ], + declarations: [ + HeaderComponent, + AppComponent, + ProfileComponent, + SignatureBookComponent, + SafeUrlPipe + ], + bootstrap: [AppComponent] }) export class AppModule { } diff --git a/apps/maarch_entreprise/js/angular/app/header.component.js b/apps/maarch_entreprise/js/angular/app/header.component.js index 37e2700ffd6f26d906ffe49704ae5bc00d111a30..de807b59a8a2d1849538bde555b20f180d73478b 100755 --- a/apps/maarch_entreprise/js/angular/app/header.component.js +++ b/apps/maarch_entreprise/js/angular/app/header.component.js @@ -14,17 +14,38 @@ var http_1 = require("@angular/common/http"); var HeaderComponent = (function () { function HeaderComponent(http) { this.http = http; - this.lang = {}; - this.resultInfo = ""; - this.loading = false; + this.applicationName = ""; + this.adminList = []; + this.adminListModule = []; + this.menuList = []; + this.profilList = []; + this.notifList = []; } HeaderComponent.prototype.prepareHeader = function () { - $j('#header').remove(); + $j('#maarch_content').remove(); }; HeaderComponent.prototype.ngOnInit = function () { + var _this = this; this.prepareHeader(); this.coreUrl = angularGlobals.coreUrl; - this.loading = true; + this.http.get(this.coreUrl + 'rest/administration') + .subscribe(function (data) { + _this.menuList = data.menu.menuList; + _this.applicationName = data.menu.applicationName[0]; + _this.adminList = data.application; + _this.adminListModule = data.modules; + }); + this.profilList = [ + { + label: 'Mon profil', + link: '/profile', + style: 'fa-user' + }, + { label: 'Déconnexion', + link: '/logout', + style: 'fa-sign-out' + } + ]; }; return HeaderComponent; }()); @@ -34,7 +55,6 @@ HeaderComponent = __decorate([ templateUrl: angularGlobals["headerView"], styleUrls: [ 'css/header.component.css', - '../../node_modules/bootstrap/dist/css/bootstrap.min.css' //load bootstrap css ] }), __metadata("design:paramtypes", [http_1.HttpClient]) diff --git a/apps/maarch_entreprise/js/angular/app/header.component.ts b/apps/maarch_entreprise/js/angular/app/header.component.ts index 711c272d854133253415d1e753d385e5e53383b8..e3015adc8876461f6373608d437f51597f701538 100755 --- a/apps/maarch_entreprise/js/angular/app/header.component.ts +++ b/apps/maarch_entreprise/js/angular/app/header.component.ts @@ -10,26 +10,26 @@ declare var angularGlobals : any; selector: 'menu-app', templateUrl : angularGlobals["headerView"], styleUrls : [ - 'css/header.component.css', //load specific custom css - '../../node_modules/bootstrap/dist/css/bootstrap.min.css' //load bootstrap css - ] + 'css/header.component.css', //load specific custom css + ] }) export class HeaderComponent implements OnInit { coreUrl : string; - lang : any = {}; - table : any; - - resultInfo : string = ""; - loading : boolean = false; + applicationName : string = ""; + adminList : any[] = []; + adminListModule : any[] = []; + menuList : any[] = []; + profilList : any[] = []; + notifList : any[] = []; constructor(public http: HttpClient) { } prepareHeader() { - $j('#header').remove(); + $j('#maarch_content').remove(); } ngOnInit(): void { @@ -37,7 +37,24 @@ export class HeaderComponent implements OnInit { this.coreUrl = angularGlobals.coreUrl; - this.loading = true; - + this.http.get(this.coreUrl + 'rest/administration') + .subscribe((data : any) => { + this.menuList = data.menu.menuList; + this.applicationName = data.menu.applicationName[0]; + this.adminList = data.application; + this.adminListModule = data.modules; + }); + + this.profilList = [ + { + label : 'Mon profil', + link : '/profile', + style : 'fa-user' + }, + { label : 'Déconnexion', + link : '/logout', + style : 'fa-sign-out' + } + ] } } diff --git a/apps/maarch_entreprise/js/angular/app/notification.service.js b/apps/maarch_entreprise/js/angular/app/notification.service.js new file mode 100644 index 0000000000000000000000000000000000000000..60748d8cf7fbab977286ecd2c6353751ffdd032b --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/notification.service.js @@ -0,0 +1,30 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var md2_1 = require("md2"); +var core_1 = require("@angular/core"); +var NotificationService = (function () { + function NotificationService(toast) { + this.toast = toast; + } + NotificationService.prototype.success = function (message) { + this.toast.show('<i class="fa fa-info-circle fa-2x"></i><span>' + message + '</span>', 2000); + }; + NotificationService.prototype.error = function (message) { + this.toast.show('<i class="fa fa-exclamation-triangle fa-2x"></i><span>' + message + '</span>', 2000); + }; + return NotificationService; +}()); +NotificationService = __decorate([ + core_1.Injectable(), + __metadata("design:paramtypes", [md2_1.Md2Toast]) +], NotificationService); +exports.NotificationService = NotificationService; diff --git a/apps/maarch_entreprise/js/angular/app/notification.service.ts b/apps/maarch_entreprise/js/angular/app/notification.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..7eb2de712d4c3fef1e514ee530170aa355dddcb6 --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/notification.service.ts @@ -0,0 +1,15 @@ +import {Md2Toast} from 'md2'; +import {Injectable} from '@angular/core'; + +@Injectable() +export class NotificationService { + constructor(private toast: Md2Toast) { + } + success(message:string) { + this.toast.show('<i class="fa fa-info-circle fa-2x"></i><span>'+message+'</span>', 2000); + } + + error(message:string) { + this.toast.show('<i class="fa fa-exclamation-triangle fa-2x"></i><span>'+message+'</span>', 2000); + } +} \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.js b/apps/maarch_entreprise/js/angular/lang/lang-fr.js index 5beb77ca4c33793e19eeb70b46cc87a8a26930d7..4c173e0e2bcd1793f4542026d3100437f3057613 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-fr.js +++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.js @@ -28,26 +28,13 @@ exports.LANG_FR = { "deleteMsg": "Voulez-vous vraiment supprimer cet élément", "clickOn": "Cliquez sur", "to": "vers", - "user": "utilisateur", - "informations": "Informations", - "firstname": "Prénom", - "lastname": "Nom", - "email": "Email", - "phoneNumber": "Numéro de téléphone", - "role": "Rôle", - "emailSignatures": "Signatures de mail", - "sbSignatures": "Signatures de parapheur", - "initials": "Initiales", - "fingerprint": "Empreinte numérique", - "color": "Couleur", - "label": "Label", - "processDelay": "Délai de traitement", - "workingDays": "Jours travaillés", - "folders": "Dossiers", - "groups": "Groupes", - "entities": "Entités", - "primaryEntity": "Entité Primaire", - "secondaryEntity": "Entité Secondaire", + "value": "valeur", + confirmAction: "Voulez-vous vraiment effectuer cette action ?", + suspend: "Suspendre", + authorize: "Autoriser", + for: "pour", + noSelection: "aucune sélection", + table: "Table", //Administration "userCreation": "Création d'un utilisateur", "userModification": "Modification de l'utilisateur", @@ -62,11 +49,10 @@ exports.LANG_FR = { "newSignature": "Nouvelle signature", "manageAbsences": "Gérer les absences", "activateAbsence": "Activer l'absence", - "deactivateAbsence": "Désactiver l'absence", + "desactivateAbsence": "Désactiver l'absence", "autoLogoutAbsence": "Vous allez être automatiquement déconnecté après avoir défini vos redirections de bannettes", "reports": "Etats et éditions", "myProfile": "Mon profil", - "event": "Evènement", "template": "Modèle", "diffusion_type": "Type de diffusion", //Notifications @@ -89,14 +75,64 @@ exports.LANG_FR = { records: "résultats", recordsPerPage: "résultats par page", search: "Chercher", + filterBy: "Filtrer par", + //Users + absOff: "Absence désactivé", + absOn: "Absence activé", + activateAbs: "Activer l'absence", + color: "Couleur", + email: "Email", + emailSignatures: "Signatures de mail", + entities: "Entités", + fingerprint: "Empreinte numérique", + firstname: "Prénom", + folders: "Dossiers", + groups: "Groupes", + informations: "Informations", + initials: "Initiales", + label: "Label", + lastname: "Nom", + phoneNumber: "Numéro de téléphone", + primaryEntity: "Entité Primaire", + processDelay: "Délai de traitement", + pswReseted: "Mot de passe réinitialisé", + resetPsw: "Réinitialiser le mot de passe", + role: "Rôle", + sbSignatures: "Signatures de parapheur", + secondaryEntity: "Entité Secondaire", + signAdded: "Signature ajoutée", + signDeleted: "Signature supprimée", + signUpdated: "Signature modifiée", + status: "Statut", + user: "Utilisateur", + userAdded: "Utilisateur ajouté", + userAuthorized: "Utilisateur autorisé", + userDeleted: "Utilisateur supprimé", + users: "Utilisateur(s)", + userSuspended: "Utilisateur suspendu", + userUpdated: "Utilisateur modifié", + workingDays: "Jours travaillés", + //Group + groupAdded: "Groupe ajouté", + groupDeleted: "Groupe supprimé", + groupUpdated: "Groupe modifié", + //Entity + entityAdded: "Entité ajouté", + entityDeleted: "Entité supprimé", + entityTooglePrimary: "Passage en entité primaire", + entityUpdated: "Entité modifié", //Actions action: "Action", - actionAdded: "Ajout d'une nouvelle action", + actionAdded: "Action ajoutée", + actionCreation: "Création d'une action", + actionDeleted: "Action supprimée", actionHistory: "Tracer l'action", actionHistoryDesc: "Permet tracer cette action dans l'historique du document. Il est fortement recommandé de cocher cette option.", + actionModification: "Modification de l'action", actionModified: "Modification de l'action", actionPage: "Page de résultat de l'action", actions: "Action(s)", + actionUpdated: "Action modifiée", associatedStatus: "Statut associé", chooseCategoryAssociation: "Choisissez une ou plusieurs catégories associée", chooseCategoryAssociationHelp: "Si aucune catégorie sélectionnée alors l'action est valable pour toute les catégories", @@ -104,18 +140,40 @@ exports.LANG_FR = { infosActions: "Vous devez choisir au moins un statut et / ou un script.", isFolderAction: "Action de dossier", isFolderActionDesc: "Permet d'utiliser cette action dans une bannette de dossier", + isSytemAction: "Action système", keyword: "Mot clé", newAction: "Nouvelle action", - sendToDestFromGroups: "Envoi aux utilisateurs du(des) groupe(s) spécifié(s):", - sendToDestFromentities: "Envoi aux utilisateurs des entité(s) spécifié(s):", - sendToMainDestUserWithStatus: "Envoi au destinataire principal du document avec le(s) statut(s):", - sendToUsers: "Envoi aux utilisateurs spécifiés:", - sendToCopyUsers: "Envoi aux utilisateurs en copie du document", - sendToMainDestUser: "Envoi au destinataire principal du document", - sendToContact: "Envoi à l'expéditeur du courrier", - sendToVisaUserWithStatus: "Envoi à l'utilisateur devant viser avec le(s) statut(s):", - sendToSignUserWithStatus: "Envoi à l'utilisateur devant signer avec le(s) statut(s):", - authorization: "Autorisé :", - joinDoc: "Joindre le document à la notification :", - newNotificationAdded: "Nouvelle notification créée ", + //Parameter + date: "Date", + integer: "Entier", + parameterAdded: "Paramètre ajouté", + parameterCreation: "Création d'un paramètre", + parameterDeleted: "Paramètre supprimé", + parameterModification: "Modification du paramètre", + parameters: "Paramètre(s)", + parameterUpdated: "Paramètre modifié", + string: "Chaine de caratère", + type: "Type", + //Status + canBeModified: "Modification des index", + canBeSearched: "Recherche", + imgRelated: "Image associée", + isFolderStatus: "Statut de dossier", + statusAdded: "Statut ajouté", + statusCreation: "Création d'un statut", + statusDeleted: "Statut supprimé", + statuses: "Statut(s)", + statusModification: "Modification du statut", + statusUpdated: "Statut mis à jour", + //History + dataOfMonth: "Données du mois", + entries: "entrée(s)", + event: "Événement", + history: "Historique", + ip: "Adresse IP", + //HistoryBatch + historyBatch: "Historique des batchs", + totalProcessed: "Élément(s) analysé(s)", + totalErrors: "Élément(s) en erreur", + module: "Module" }; diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts index dc0c1817a817d9a93a97e18df59e530b04d5573b..1890df43d916579b867a7efb3445a0772cc7eee3 100755 --- a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts +++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts @@ -26,27 +26,14 @@ export const LANG_FR = { "deleteMsg" : "Voulez-vous vraiment supprimer cet élément", "clickOn" : "Cliquez sur", "to" : "vers", - "user" : "utilisateur", - "informations" : "Informations", - "firstname" : "Prénom", - "lastname" : "Nom", - "email" : "Email", - "phoneNumber" : "Numéro de téléphone", - "role" : "Rôle", - "emailSignatures" : "Signatures de mail", - "sbSignatures" : "Signatures de parapheur", - "initials" : "Initiales", - "fingerprint" : "Empreinte numérique", - "color" : "Couleur", - "label" : "Label", - "processDelay" : "Délai de traitement", - "workingDays" : "Jours travaillés", - "folders" : "Dossiers", - "groups" : "Groupes", - "entities" : "Entités", - "primaryEntity" : "Entité Primaire", - "secondaryEntity" : "Entité Secondaire", - + "value" : "valeur", + confirmAction: "Voulez-vous vraiment effectuer cette action ?", + suspend: "Suspendre", + authorize: "Autoriser", + for: "pour", + noSelection: "aucune sélection", + table: "Table", + //Administration "userCreation" : "Création d'un utilisateur", @@ -62,7 +49,7 @@ export const LANG_FR = { "newSignature" : "Nouvelle signature", "manageAbsences" : "Gérer les absences", "activateAbsence" : "Activer l'absence", - "deactivateAbsence" : "Désactiver l'absence", + "desactivateAbsence" : "Désactiver l'absence", "autoLogoutAbsence" : "Vous allez être automatiquement déconnecté après avoir défini vos redirections de bannettes", "reports" : "Etats et éditions", "myProfile" : "Mon profil", @@ -93,16 +80,69 @@ export const LANG_FR = { records: "résultats", recordsPerPage: "résultats par page", search: "Chercher", + filterBy: "Filtrer par", + //Users + absOff: "Absence désactivé", + absOn: "Absence activé", + activateAbs: "Activer l'absence", + color: "Couleur", + email: "Email", + emailSignatures: "Signatures de mail", + entities: "Entités", + fingerprint: "Empreinte numérique", + firstname: "Prénom", + folders: "Dossiers", + groups: "Groupes", + informations: "Informations", + initials: "Initiales", + label: "Label", + lastname: "Nom", + phoneNumber: "Numéro de téléphone", + primaryEntity: "Entité Primaire", + processDelay: "Délai de traitement", + pswReseted: "Mot de passe réinitialisé", + resetPsw: "Réinitialiser le mot de passe", + role: "Rôle", + sbSignatures: "Signatures de parapheur", + secondaryEntity: "Entité Secondaire", + signAdded: "Signature ajoutée", + signDeleted: "Signature supprimée", + signUpdated: "Signature modifiée", + status: "Statut", + user: "Utilisateur", + userAdded: "Utilisateur ajouté", + userAuthorized: "Utilisateur autorisé", + userDeleted: "Utilisateur supprimé", + users: "Utilisateur(s)", + userSuspended: "Utilisateur suspendu", + userUpdated: "Utilisateur modifié", + workingDays: "Jours travaillés", + + + //Group + groupAdded: "Groupe ajouté", + groupDeleted: "Groupe supprimé", + groupUpdated: "Groupe modifié", + //Entity + entityAdded: "Entité ajouté", + entityDeleted: "Entité supprimé", + entityTooglePrimary: "Passage en entité primaire", + entityUpdated: "Entité modifié", + //Actions action: "Action", - actionAdded: "Ajout d'une nouvelle action", + actionAdded: "Action ajoutée", + actionCreation: "Création d'une action", + actionDeleted: "Action supprimée", actionHistory: "Tracer l'action", actionHistoryDesc: "Permet tracer cette action dans l'historique du document. Il est fortement recommandé de cocher cette option.", + actionModification: "Modification de l'action", actionModified: "Modification de l'action", actionPage: "Page de résultat de l'action", actions: "Action(s)", + actionUpdated: "Action modifiée", associatedStatus: "Statut associé", chooseCategoryAssociation: "Choisissez une ou plusieurs catégories associée", chooseCategoryAssociationHelp: "Si aucune catégorie sélectionnée alors l'action est valable pour toute les catégories", @@ -110,19 +150,46 @@ export const LANG_FR = { infosActions: "Vous devez choisir au moins un statut et / ou un script.", isFolderAction: "Action de dossier", isFolderActionDesc: "Permet d'utiliser cette action dans une bannette de dossier", + isSytemAction: "Action système", keyword: "Mot clé", newAction: "Nouvelle action", - sendToDestFromGroups : "Envoi aux utilisateurs du(des) groupe(s) spécifié(s):", - sendToDestFromentities : "Envoi aux utilisateurs des entité(s) spécifié(s):", - sendToMainDestUserWithStatus : "Envoi au destinataire principal du document avec le(s) statut(s):", - sendToUsers : "Envoi aux utilisateurs spécifiés:", - sendToCopyUsers : "Envoi aux utilisateurs en copie du document", - sendToMainDestUser : "Envoi au destinataire principal du document", - sendToContact : "Envoi à l'expéditeur du courrier", - sendToVisaUserWithStatus : "Envoi à l'utilisateur devant viser avec le(s) statut(s):", - sendToSignUserWithStatus : "Envoi à l'utilisateur devant signer avec le(s) statut(s):", - authorization : "Autorisé :", - joinDoc : "Joindre le document à la notification :", - newNotificationAdded : "Nouvelle notification créée ", + //Parameter + date:"Date", + integer:"Entier", + parameterAdded: "Paramètre ajouté", + parameterCreation: "Création d'un paramètre", + parameterDeleted: "Paramètre supprimé", + parameterModification: "Modification du paramètre", + parameters: "Paramètre(s)", + parameterUpdated: "Paramètre modifié", + string:"Chaine de caratère", + type:"Type", + + //Status + canBeModified: "Modification des index", + canBeSearched: "Recherche", + imgRelated: "Image associée", + isFolderStatus: "Statut de dossier", + statusAdded: "Statut ajouté", + statusCreation: "Création d'un statut", + statusDeleted: "Statut supprimé", + statuses: "Statut(s)", + statusModification: "Modification du statut", + statusUpdated: "Statut mis à jour", + + //History + dataOfMonth: "Données du mois", + entries: "entrée(s)", + event: "Événement", + history: "Historique", + ip: "Adresse IP", + + //HistoryBatch + historyBatch: "Historique des batchs", + totalProcessed: "Élément(s) analysé(s)", + totalErrors: "Élément(s) en erreur", + module: "Module" + + }; \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/systemjs.config.js b/apps/maarch_entreprise/js/angular/systemjs.config.js index 8b8ef0c6a13af1561b0a188ebf4ce74eb3bfcaab..dbb88f58f2c36fa1a9b0523e6e4be93b2b2b82c3 100755 --- a/apps/maarch_entreprise/js/angular/systemjs.config.js +++ b/apps/maarch_entreprise/js/angular/systemjs.config.js @@ -28,6 +28,7 @@ '@angular/http': 'npm:@angular/http/bundles/http.umd.min.js', '@angular/material': 'npm:@angular/material/bundles/material.umd.min.js', '@angular/cdk': 'npm:@angular/cdk/bundles/cdk.umd.min.js', + 'md2': 'npm:md2/bundles/md2.umd.js', // other libraries 'rxjs': 'npm:rxjs', diff --git a/apps/maarch_entreprise/js/angularFunctions.js b/apps/maarch_entreprise/js/angularFunctions.js index b3b126341c95dcc2ee960bebbdd7106c9fd35375..f24d6587ed75ef9f05152d914feb433ec9b5b555 100755 --- a/apps/maarch_entreprise/js/angularFunctions.js +++ b/apps/maarch_entreprise/js/angularFunctions.js @@ -9,6 +9,8 @@ function triggerAngular(prodmode, locationToGo) { 'statuses-administration', 'actions-administration', 'action-administration', + 'history-administration', + 'historyBatch-administration', 'profile', 'signature-book', 'parameter-administration', diff --git a/apps/maarch_entreprise/js/functions.js b/apps/maarch_entreprise/js/functions.js index ce9d63084ec876cc73306b6b82db60036d54c701..d78f1ce1f683b7156b1667ef63463b3cc3cb3316 100755 --- a/apps/maarch_entreprise/js/functions.js +++ b/apps/maarch_entreprise/js/functions.js @@ -1793,6 +1793,27 @@ function setContactType(mode, creation){ }); } +function checkContactType(mode,creation){ + var bool = false; + $j.ajax({ + url: 'index.php?dir=my_contacts&page=setContactType&display=false', + type: 'POST', + async: false, + data: { + contact_target: mode, + can_add_contact: creation + }, + success: function(answer){ + if(answer.substring(0,5)=='false'){ + bool =false; + } else{ + bool =true; + } + } + }); + return bool; +} + /** * Show or hide the data related to a person in the contacts admin * @@ -3243,6 +3264,11 @@ function titleWithTooltipster(id){ }); } +function titleWithTooltipsterClass(className){ + $j(document).ready(function() { + $j('.'+className).tooltipster({delay :0}); + }); +} /** Advanced Search **/ /** diff --git a/apps/maarch_entreprise/lang/en.php b/apps/maarch_entreprise/lang/en.php index a89d96073cb0fc2823fb4dbda55e033aa975187c..5c4cf3a99bba0b055c7b7363931673ca2c3a017b 100755 --- a/apps/maarch_entreprise/lang/en.php +++ b/apps/maarch_entreprise/lang/en.php @@ -2043,3 +2043,6 @@ if (!defined("_NEW_ITEM")) define("_NEW_ITEM", "New"); if(!defined('_SAVED_CHANGE')) define('_SAVED_CHANGE', 'Saved change'); /** Generic messages **/ + +if (!defined('_DOC_CREATED_WITH_STATUS')) + define('_DOC_CREATED_WITH_STATUS', 'Document created with status'); \ No newline at end of file diff --git a/apps/maarch_entreprise/lang/fr.php b/apps/maarch_entreprise/lang/fr.php index 7cce282324c84e15bc351f834b637867cc17b599..6af191709f8d0db97076b08fbc77cbbf3577d44b 100755 --- a/apps/maarch_entreprise/lang/fr.php +++ b/apps/maarch_entreprise/lang/fr.php @@ -1136,6 +1136,7 @@ if (!defined("_TO")) define("_TO", "vers"); if (!defined("_FILE_PROPERTIES")) define("_FILE_PROPERTIES", "Propriétés du fichier"); if (!defined("_FILE_DATA")) define("_FILE_DATA", "Informations sur le document"); if (!defined("_VIEW_DOC")) define("_VIEW_DOC", "Voir le document"); +if (!defined("_DOWNLOAD_LOCAL_DOC_COPY")) define("_DOWNLOAD_LOCAL_DOC_COPY", "Télécharger une copie locale"); if (!defined("_VIEW_DOC_DESC")) define("_VIEW_DOC_DESC", "Ouvre une modal avec le document en visualisation. Incrémente également la donnée 'viewed' de la table listinstance (utile si utilisée dans les clauses de bannettes) "); if (!defined("_TYPIST")) define("_TYPIST", "Opérateur"); if (!defined("_LOT")) define("_LOT", "Lot"); @@ -1631,6 +1632,7 @@ if (!defined("_EMAIL_ACCOUNT")) define("_EMAIL_ACCOUNT", "Email compte"); if (!defined("_HELP_KEYWORD_EMAIL")) define("_HELP_KEYWORD_EMAIL", "Email de l'utilisateur connecté"); if (!defined("_INITIATOR")) define("_INITIATOR", "Service initiateur"); +if (!defined("_INITIATORS")) define("_INITIATORS", "Service(s) initiateur(s)"); if (!defined("_QUALIF_BUSINESS")) define("_QUALIF_BUSINESS", "Qualification des documents de la collection business"); if (!defined("_PROCESS_BUSINESS")) define("_PROCESS_BUSINESS", "Traitement des documents de la collection business"); @@ -2090,3 +2092,6 @@ if (!defined('_STATUS_UPDATED')) if(!defined('_SAVED_CHANGE')) define('_SAVED_CHANGE', 'Modification enregistrée'); /** Generic messages **/ + +if (!defined('_DOC_CREATED_WITH_STATUS')) + define('_DOC_CREATED_WITH_STATUS', 'Document créé avec le statut'); diff --git a/apps/maarch_entreprise/merged_css.php b/apps/maarch_entreprise/merged_css.php index cf297a0045b1fda224e357baeb255023bc598ada..571a20760c9c313502c21f27e7bc469b6db9b1c8 100755 --- a/apps/maarch_entreprise/merged_css.php +++ b/apps/maarch_entreprise/merged_css.php @@ -1,5 +1,16 @@ <?php -include_once('../../core/init.php'); +/** +* Copyright Maarch since 2008 under licence GPLv3. +* See LICENCE.txt file at the root folder for more details. +* This file is part of Maarch software. + +* @brief merged_css +* @author dev <dev@maarch.org> +* @ingroup apps +*/ + +require_once '../../core/init.php'; + function compress($buffer) { /* remove comments */ @@ -12,7 +23,7 @@ function compress($buffer) return $buffer; } -$date = mktime(0, 0, 0, date("m") + 2 , date("d"), date("Y")); +$date = mktime(0, 0, 0, date("m") + 2, date("d"), date("Y")); $date = date("D, d M Y H:i:s", $date); $time = 30 * 12 * 60 * 60; header("Pragma: public"); @@ -24,7 +35,8 @@ header('Content-type: text/css; charset=utf-8'); ob_start("compress"); -include 'apps/' . $_SESSION['config']['app_id'] . '/css/styles.css'; +require 'apps/' . $_SESSION['config']['app_id'] . '/css/styles.css'; + foreach (array_keys($_SESSION['modules_loaded']) as $value) { if (file_exists( $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR @@ -42,24 +54,17 @@ foreach (array_keys($_SESSION['modules_loaded']) as $value) { } } -include_once 'apps/' . $_SESSION['config']['app_id'] . '/css/doctype_levels.css'; -include_once 'apps/' . $_SESSION['config']['app_id'] . '/css/bootstrapTree.css'; +require_once 'apps/' . $_SESSION['config']['app_id'] . '/css/doctype_levels.css'; +require_once 'apps/' . $_SESSION['config']['app_id'] . '/css/bootstrapTree.css'; //Views readfile('apps/maarch_entreprise/css/administration.component.css'); //Dependencies readfile('node_modules/tooltipster/dist/css/tooltipster.bundle.min.css'); -readfile('node_modules/datatables/media/css/jquery.dataTables.min.css'); -readfile('node_modules/jquery-typeahead/dist/jquery.typeahead.min.css'); -readfile('node_modules/@angular/material/prebuilt-themes/indigo-pink.css'); readfile('apps/maarch_entreprise/css/chosen.min.css'); readfile('node_modules/photoswipe/dist/photoswipe.css'); readfile('node_modules/photoswipe/dist/default-skin/default-skin.css'); readfile('apps/maarch_entreprise/css/photoswipe_custom.css'); -//Custom CSS for V2 -readfile('apps/maarch_entreprise/css/engine.css'); -readfile('apps/maarch_entreprise/css/bootstrap-chosen.css'); - ob_end_flush(); diff --git a/apps/maarch_entreprise/merged_js.php b/apps/maarch_entreprise/merged_js.php index 5851615b1a2321045ecb7ba090b664f17c08a66a..5faf5140027a72102560494914a51b2e26c9f9b8 100755 --- a/apps/maarch_entreprise/merged_js.php +++ b/apps/maarch_entreprise/merged_js.php @@ -1,28 +1,19 @@ <?php +/** +* Copyright Maarch since 2008 under licence GPLv3. +* See LICENCE.txt file at the root folder for more details. +* This file is part of Maarch software. -/* -* Copyright 2017 Maarch -* -* This file is part of Maarch Framework. -* -* Maarch Framework is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Maarch Framework is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>. +* @brief merged_js +* @author dev <dev@maarch.org> +* @ingroup apps */ -include_once('../../core/init.php'); -include_once($_SESSION['config']['corepath'].DIRECTORY_SEPARATOR.'apps/maarch_entreprise'.DIRECTORY_SEPARATOR.'merged_jsAbstract.php'); +require_once '../../core/init.php'; +require_once $_SESSION['config']['corepath'].DIRECTORY_SEPARATOR.'apps/maarch_entreprise'.DIRECTORY_SEPARATOR.'merged_jsAbstract.php'; -class MergedJs extends MergedJsAbstract{ +class MergedJs extends MergedJsAbstract +{ // Your stuff her } diff --git a/apps/maarch_entreprise/merged_jsAbstract.php b/apps/maarch_entreprise/merged_jsAbstract.php index 59d80219e99afdbe1b0624af280fd7b48a0fccdb..80bdc8e12795b3dd6b8b3afdd08c23c10f78d2e8 100755 --- a/apps/maarch_entreprise/merged_jsAbstract.php +++ b/apps/maarch_entreprise/merged_jsAbstract.php @@ -1,109 +1,106 @@ -<?php - -/* -* Copyright 2017 Maarch -* -* This file is part of Maarch Framework. -* -* Maarch Framework is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Maarch Framework is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>. -*/ - -class MergedJsAbstract { - public function header() { - if ( empty($_GET['debug']) ) { - $date = mktime(0,0,0,date("m" ) + 2 ,date("d" ) ,date("Y" ) ); - $date = date("D, d M Y H:i:s", $date); - $time = 30*12*60*60; - header("Pragma: public"); - header("Expires: ".$date." GMT"); - header("Cache-Control: max-age=".$time.", must-revalidate"); - header('Content-type: text/javascript'); - } - } - public function start() { - ob_start(); - } - public function end() { - ob_end_flush(); - } - - public function merge_lib() { - readfile('apps/maarch_entreprise/js/prototype.js'); - - //scriptaculous (prototype) - readfile('apps/maarch_entreprise/js/scriptaculous.js'); - readfile('apps/maarch_entreprise/js/effects.js'); - readfile('apps/maarch_entreprise/js/controls.js'); - - //Dependencies - readfile('node_modules/jquery/dist/jquery.min.js'); - readfile('node_modules/core-js/client/shim.js'); //Angular - readfile('node_modules/zone.js/dist/zone.min.js'); //Angular - readfile('node_modules/bootstrap/dist/js/bootstrap.min.js'); - readfile('node_modules/chart.js/Chart.min.js'); - readfile('node_modules/tinymce/tinymce.min.js'); - readfile('node_modules/datatables/media/js/jquery.dataTables.min.js'); - readfile('node_modules/jquery.nicescroll/jquery.nicescroll.min.js'); - readfile('node_modules/tooltipster/dist/js/tooltipster.bundle.min.js'); - readfile('node_modules/jquery-typeahead/dist/jquery.typeahead.min.js'); - readfile('node_modules/hammerjs/hammer.min.js'); //Angular Material - readfile('apps/maarch_entreprise/js/chosen.jquery.min.js'); - readfile('apps/maarch_entreprise/js/bootstrap-tree.js'); - - //Mobile - readfile('node_modules/photoswipe/dist/photoswipe.min.js'); - readfile('node_modules/photoswipe/dist/photoswipe-ui-default.min.js'); - - //Maarch - include('apps/maarch_entreprise/js/functions.js'); - include('apps/maarch_entreprise/js/indexing.js'); - readfile('apps/maarch_entreprise/js/angularFunctions.js'); - - -// include('apps/maarch_entreprise/js/RSVP.js'); -// include('apps/maarch_entreprise/js/render.js'); -// include('apps/maarch_entreprise/js/jio.js'); - - - echo "\n"; - } - - public function merge_module() { - if ( !empty($_SESSION['modules_loaded'])) { - foreach(array_keys($_SESSION['modules_loaded']) as $value) - { - if(file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules_loaded'][$value]['name'].DIRECTORY_SEPARATOR."js".DIRECTORY_SEPARATOR."functions.js") - || file_exists($_SESSION['config']['corepath'].'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules_loaded'][$value]['name'].DIRECTORY_SEPARATOR."js".DIRECTORY_SEPARATOR."functions.js")) - { - include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/functions.js'); - } - } - } - } - - public function merge() { - if ( empty($_GET['html'] ) ) { - $this->header(); - $this->start(); - $this->merge_lib(); - $this->merge_module(); - $this->end(); - } else { - echo '<html><body><script>'; - $this->merge_lib(); - $this->merge_module(); - echo '</script></body></html>';exit; - } - } -} +<?php +/** +* Copyright Maarch since 2008 under licence GPLv3. +* See LICENCE.txt file at the root folder for more details. +* This file is part of Maarch software. + +* @brief merged_jsAbstract +* @author dev <dev@maarch.org> +* @ingroup apps +*/ + +class MergedJsAbstract +{ + public function header() + { + if (empty($_GET['debug'])) { + $date = mktime(0, 0, 0, date("m") + 2, date("d"), date("Y")); + $date = date("D, d M Y H:i:s", $date); + $time = 30*12*60*60; + header("Pragma: public"); + header("Expires: ".$date." GMT"); + header("Cache-Control: max-age=".$time.", must-revalidate"); + header('Content-type: text/javascript'); + } + } + public function start() + { + ob_start(); + } + public function end() + { + ob_end_flush(); + } + + public function merge_lib() + { + readfile('apps/maarch_entreprise/js/prototype.js'); + + //scriptaculous (prototype) + readfile('apps/maarch_entreprise/js/scriptaculous.js'); + readfile('apps/maarch_entreprise/js/effects.js'); + readfile('apps/maarch_entreprise/js/controls.js'); + + //Dependencies + readfile('node_modules/jquery/dist/jquery.min.js'); + readfile('node_modules/core-js/client/shim.js'); //V2 - Angular + readfile('node_modules/zone.js/dist/zone.min.js'); //V2 - Angular + readfile('node_modules/bootstrap/dist/js/bootstrap.min.js'); //V2 + readfile('node_modules/chart.js/Chart.min.js'); + readfile('node_modules/tinymce/tinymce.min.js'); + readfile('node_modules/jquery.nicescroll/jquery.nicescroll.min.js'); //V2 + readfile('node_modules/tooltipster/dist/js/tooltipster.bundle.min.js'); //V2 + readfile('node_modules/jquery-typeahead/dist/jquery.typeahead.min.js'); //V2 + readfile('node_modules/hammerjs/hammer.min.js'); //V2- Angular Material + readfile('apps/maarch_entreprise/js/chosen.jquery.min.js'); + readfile('node_modules/jstree-bootstrap-theme/dist/jstree.js'); //V2 + readfile('apps/maarch_entreprise/js/bootstrap-tree.js'); //DEPRECATED use jstree instead + + //Mobile + readfile('node_modules/photoswipe/dist/photoswipe.min.js'); + readfile('node_modules/photoswipe/dist/photoswipe-ui-default.min.js'); + + //Maarch + include 'apps/maarch_entreprise/js/functions.js'; + include 'apps/maarch_entreprise/js/indexing.js'; + readfile('apps/maarch_entreprise/js/angularFunctions.js'); + + + // include('apps/maarch_entreprise/js/RSVP.js'); + // include('apps/maarch_entreprise/js/render.js'); + // include('apps/maarch_entreprise/js/jio.js'); + + + echo "\n"; + } + + public function merge_module() + { + if (!empty($_SESSION['modules_loaded'])) { + foreach (array_keys($_SESSION['modules_loaded']) as $value) { + + if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules_loaded'][$value]['name'].DIRECTORY_SEPARATOR."js".DIRECTORY_SEPARATOR."functions.js") + || file_exists($_SESSION['config']['corepath'].'modules'.DIRECTORY_SEPARATOR.$_SESSION['modules_loaded'][$value]['name'].DIRECTORY_SEPARATOR."js".DIRECTORY_SEPARATOR."functions.js") + ) { + include 'modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/functions.js'; + } + } + } + } + + public function merge() + { + if (empty($_GET['html'])) { + $this->header(); + $this->start(); + $this->merge_lib(); + $this->merge_module(); + $this->end(); + } else { + echo '<html><body><script>'; + $this->merge_lib(); + $this->merge_module(); + echo '</script></body></html>';exit; + } + } +} diff --git a/apps/maarch_entreprise/my_contacts/setContactType.php b/apps/maarch_entreprise/my_contacts/setContactType.php index 48fe5a820627b61a8acfad7a65c639742e8f5b2e..f797166cbc6e94cfcfb354d217eddd93677fdf7a 100755 --- a/apps/maarch_entreprise/my_contacts/setContactType.php +++ b/apps/maarch_entreprise/my_contacts/setContactType.php @@ -24,7 +24,6 @@ $core->test_user(); require_once 'core/class/class_db_pdo.php'; $db = new Database(); - if ($_POST['contact_target'] == "") { $_POST['contact_target'] = "corporate"; } @@ -57,6 +56,8 @@ while($res = $stmt->fetchObject()){ $iCount++; } - +if($stmt->rowCount()==0){ + echo "false"; +} echo $frmStr; exit; diff --git a/apps/maarch_entreprise/reports/get_report_by_period_val.php b/apps/maarch_entreprise/reports/get_report_by_period_val.php index 373cfd328545bc45772a8c49ace05091f8bb59bb..0ec2eb33d5b4a609d5dd3fc39a0c79e5a2456e02 100755 --- a/apps/maarch_entreprise/reports/get_report_by_period_val.php +++ b/apps/maarch_entreprise/reports/get_report_by_period_val.php @@ -27,11 +27,11 @@ $core_tools = new core_tools(); $core_tools->test_user(); $core_tools->load_lang(); $core_tools->test_service('reports', 'reports'); -$db = new Database(); -$req = new request(); -$list = new list_show(); +$db = new Database(); +$req = new request(); +$list = new list_show(); $graph = new graphics(); -$sec = new security(); +$sec = new security(); $_ENV['date_pattern'] = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/"; @@ -43,10 +43,23 @@ $where_status = ''; if (!empty($_POST['entities_chosen'])) { $entities_chosen = explode("#", $_POST['entities_chosen']); + if($_REQUEST['sub_entities'] == 'true'){ + $sub_entities = []; + foreach($entities_chosen as $value){ + $sub_entities[] = users_entities_Abstract::getEntityChildren($value); + } + $sub_entities1 = "'"; + $countSubEntities = count($sub_entities); + for( $i=0; $i< $countSubEntities; $i++){ + $sub_entities1 .= implode("','",$sub_entities[$i]); + $sub_entities1 .= "','"; + } + $sub_entities1 = substr($sub_entities1, 0, -2); + } $entities_chosen = "'" . join("','", $entities_chosen) . "'"; $where_entities = ' AND destination in (' . $entities_chosen . ') '; if($_REQUEST['sub_entities'] == 'true'){ - $where_entities = 'AND (destination in (' . $entities_chosen . ') or destination in (select entity_id from entities where parent_entity_id IN ('.$entities_chosen.')))'; + $where_entities = 'AND (destination in (' . $entities_chosen . ') or destination in ('.$sub_entities1.'))'; } } @@ -706,7 +719,6 @@ else $totalCourrier=array(); $totalEntities = count($entities); - foreach(array_keys($_SESSION['coll_categories']['letterbox_coll']) as $key) { if($key!='default_category'){ diff --git a/apps/maarch_entreprise/template/documents_list_attachments.html b/apps/maarch_entreprise/template/documents_list_attachments.html index 1dadf6a94451815c83947d7073f6c70c32ae951f..3e8e8dfc72fecbeb733d4658a98ada81c47277ec 100755 --- a/apps/maarch_entreprise/template/documents_list_attachments.html +++ b/apps/maarch_entreprise/template/documents_list_attachments.html @@ -64,12 +64,12 @@ Mods <br/> ##sortColumn|identifier## </div> - <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 10px;float:left;"> + <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 30px;float:left;"> ##defineLang|_TYPES## <br/> ##sortColumn|attachment_type## </div> - <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 10px;float:left;"> + <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 25px;float:left;"> ##defineLang|_OBJECT## <br/> ##sortColumn|title## @@ -84,17 +84,17 @@ Mods <br/> ##sortColumn|creation_date## </div> - <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 10px;float:left;"> + <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 55px;float:left;"> ##defineLang|_UPDATED_DATE## <br/> ##sortColumn|doc_date## </div> - <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 10px;float:left;"> + <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 55px;float:left;"> ##defineLang|_MODIFY_BY## <br/> ##sortColumn|updated_by## </div> - <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 10px;float:left;"> + <div style="white-space: nowrap;display: table-cell;text-align: center;padding-left: 87px;float:left;"> ##defineLang|_BACK_DATE## <br/> ##sortColumn|validation_date## @@ -157,8 +157,8 @@ Mods <tr class="##cssLine|col|white ##" > <td width="15%" style="text-align:center"> - <table width="100%" border="0" cellspacing="0" cellpadding="0" > - <tr> + <table width="85%" border="0" cellspacing="0" cellpadding="0" > + <tr style="left: 5%;position: relative;"> <!--<td style="text-align:center;width:25px"><b title="##defineLang|_VERSION##">##loadValue|relation##</b></td>--> <td style="text-align:center;width:100px"> <b title="##defineLang|_CHRONO_NUMBER##">##loadValue|identifier##</b><br/> @@ -186,15 +186,17 @@ Mods </td> </tr> <tr class="##cssLineReload##"> - <td width="15%" style="text-align:center"> - <table width="100%" border="0" cellspacing="0" cellpadding="0" > - <tr> - <td width="40%">##showIconDocument##</td> - <td width="15%"> + <td width="15%" > + <table width="85%" border="0" cellspacing="0" cellpadding="0" > + <tr > + <td width="40%" style="text-align:right"> <i style="font-size:10px;color:#16ADEB;" title="##defineLang|_VERSION##">##loadValue|relation##</i> <i style="color:#16ADEB;">##func_previous_version##</i> </td> - <td width="45%" style="text-align:center;font-size:13px;width:100px" title="##defineLang|_STATUS##"><i>##loadValue|status##</i></td> + <td width="65%" style="text-align:left;" title="##defineLang|_STATUS##"> + <i>##loadValue|status##</i> + </td> + <!--<td width="45%" style="text-align:center;font-size:13px;width:100px" title="##defineLang|_STATUS##"></td>--> </tr> </table> </td> @@ -209,16 +211,22 @@ Mods <td width="11%" style="text-align:right">##func_previous_version##</td> </table> </td>--> - <td style="text-align:left;width:20%;" title="##defineLang|_CREATION_DATE##"><i class="fa fa-calendar"></i> + <td style="text-align:left;width:17%;" title="##defineLang|_CREATION_DATE##"><i class="fa fa-calendar"></i> ##loadValue|creation_date##</td> <td style="text-align:left;width:20%;" title="##defineLang|_UPDATED_DATE##"><i class="fa fa-calendar-check-o"></i> - ##loadValue|doc_date##<i title="##defineLang|_MODIFY_BY##" style="font-size:10px;cursor: pointer;"> ##defineLang|_MODIFY_BY## : ##loadValue|updated_by##</i></td> + ##loadValue|doc_date##<i title="##defineLang|_MODIFY_BY##" style="font-size:10px;cursor: pointer;padding-left:35px"> ##defineLang|_MODIFY_BY## : ##loadValue|updated_by##</i></td> <!--<td style="text-align:left" width="17%" title="##defineLang|_TYPIST##">##loadValue|typist##</td>--> <!--<td style="text-align:center" width="10%">##loadValue|doc_date##</td>--> - <td style="text-align:left;width:20%;" title="##defineLang|_BACK_DATE##"><i class="fa fa-calendar-times-o"></i> + <td style="text-align:center;width:10%;" title="##defineLang|_BACK_DATE##"><i class="fa fa-calendar-times-o"></i> ##loadValue|validation_date##</td> - <td style="text-align:right;width:200px;">##func_final_version## - ##func_modify## ##func_delete##</td> + <td style="text-align:right;width:200px;"><table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tbody> + <tr> + <td style="width:30%;text-align:right;">##func_final_version##</td> + <td style="width:10%;text-align:right;padding-bottom:5px;">##func_modify## ##func_delete##</td> + <td style="width:1%;text-align:right;">##showIconDocument##</td> + </tr> + </tbody></table> </td> <!--<td style="text-align:left" width="17%">##loadValue|updated_by##</td>--> </tr> </table> diff --git a/apps/maarch_entreprise/template/documents_list_search_adv.html b/apps/maarch_entreprise/template/documents_list_search_adv.html index 35aec327338ea392e2664c5bf2150b5332d73b33..97cf5799706f76306dc162e7d4f08410544fb690 100755 --- a/apps/maarch_entreprise/template/documents_list_search_adv.html +++ b/apps/maarch_entreprise/template/documents_list_search_adv.html @@ -153,7 +153,7 @@ Mods <td style="font-size:10px;" width ="30px">##func_bool_see_notes##</td> <td style="font-size:10px;" width ="30px">##showActionAdvResultFA|#defineLang|_ATTACHMENTS#|paperclip|loadRepList('#loadValue|res_id#', 'FT')|#loadValue|count_attachment# == 0##</td> <td style="font-size:10px;" width ="30px">##showActionFA|#defineLang|_WF#|gear|loadDiffList('#loadValue|res_id#')##</td> - <td style="font-size:10px;" width ="30px" >##showIconDocument##</td> + <td style="font-size:10px;" width ="30px" >##ifStatement|'#loadValue|filename#'!=null|#showIconDocument#|## </td> <td style="font-size:10px;" width ="30px" >##showIconDetails##</td> </tr> </table> diff --git a/apps/maarch_entreprise/template/documents_list_with_attachments.html b/apps/maarch_entreprise/template/documents_list_with_attachments.html index 5c4229dd3aa84e0dd07c2d91f5a1eefabe4fda17..4085a5765adc8f34f6e1ed3515d505513740c151 100755 --- a/apps/maarch_entreprise/template/documents_list_with_attachments.html +++ b/apps/maarch_entreprise/template/documents_list_with_attachments.html @@ -156,7 +156,7 @@ Mods <td style="font-size:10px;" width ="30px">##func_bool_see_notes##</td> <td style="font-size:10px;" width ="30px">##showActionBasketsFA|#defineLang|_ATTACHMENTS#|paperclip|loadRepList('#loadValue|res_id#', 'baskets')|#loadValue|count_attachment# == 0##</td> <td style="font-size:10px;" width ="30px">##showActionFA|#defineLang|_WF#|gear|loadDiffList('#loadValue|res_id#')##</td> - <td style="font-size:10px;" width ="30px" >##showIconDocument##</td> + <td style="font-size:10px;" width ="30px" >##ifStatement|'#loadValue|filename#'!=null|#showIconDocument#|##</td> <td style="font-size:10px;" width ="30px" >##showIconDetails##</td> </tr> </table> diff --git a/apps/maarch_entreprise/template/header.html b/apps/maarch_entreprise/template/header.html index dfe9bd3797ed44e04021c21582891c4c37db7292..c97bb7886cb6dec288f4646eb3fa812517650dad 100755 --- a/apps/maarch_entreprise/template/header.html +++ b/apps/maarch_entreprise/template/header.html @@ -1,5 +1,28 @@ +<?php +require_once 'core/Models/UserModel.php'; +?> <div id="header"> <div id="nav"> + <div id="header_username" style="position:absolute;text-align:center;left:45%;font-size: 1.3em;top: 6px;color: white; font-size:14px; line-height: 1; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"> + <?php + $strUserInfos = $_SESSION['user']['FirstName']." ".$_SESSION['user']['LastName']; + $userGroups=\Core\Models\UserModel::getGroupsByUserId(['userId'=> $_SESSION['user']['UserId']]); + + if(!empty($userGroups)){ + $strUserInfos.=" ("; + for($i=0;$i<count($userGroups);$i++){ + if($i==count($userGroups)-1){ + $strUserInfos.=$userGroups[$i]['group_desc']; + } else { + $strUserInfos.=$userGroups[$i]['group_desc'].", "; + } + } + $strUserInfos.=")"; + } + + echo $strUserInfos; + ?> + </div> <div id="menu" onmouseover="ShowHideMenu('menunav','on');" onmouseout="ShowHideMenu('menunav','off');" class="off"> <p> <span style="background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfsAAAGECAYAAAAx/4nGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAACZVSURBVHja7J19jBxnfcd/szO7e3d7e76L7fhIJCKRFAxxpBZBghWpITSRihQlwKl5gTSx1Cq5VBGlNeBYon8ViVIlBakRBylSgSbgEBzLEFEqosqJiExK1EgNIYhSBIimdhzL73bu9uXpH/Gc5/Zm73Z35pl5Xj4fyUrsOLe7szPzeb6/55nfEyilBACcRudFvkdE7uAQA5hNgOwBEL2OewuHHsAcIg4BAKIv4LX3rPF3qQwAkOwBwDLRZ2UPAwIAkj0AuCt6EZHbh/z7DAQASPYAiN4D9jAgACDZg58CY5GYP9ye8f9nMAAkewDLE2rAMYMhqwPIH5A9gIXCCjhuwDkDvkIZH3wRlXL4Bo7oyzmurBMAkj2AwYIKOI7AuQYkewC3BeVKykf0dn1He0j+QLIHBE/yQvbAIkFA9oCQkD6i93wAIFQHYBQo4wMyuvB+A44tGMigPQQQP5DsAQk5lPK5aMGl8xlI9oDkSflFHeuuUlIJ8IJH1ycbDpHsAUiWBiYjraIXEZn7u68v/9neB+5O/bsMCLyCJwiQPSB5hO/Kse8qtUL0gxAPBpA/gwAGA8gekDzCtyDVDyv6teTfDwYF3g8EGAwge0DwSN9m0WcZDDAIYDDAgADZA3L3XfpOiJ7BAAw5GED4yB4QvTfCN26evvQBwa67Vx11BgPeVwMYGCB7QPDWCh/RZ6wIMBjgGgRkj+Qtp5s4bw26mQc2fE8uiX7UwQADAK+qACR/ZI/kbRV87/Pgjgkf0Zc4GGAgQPJH9oDcDRF8vxu2I9JXOo8lss9WFWBAgPCRPSD4ksXkgPRJ9RYOBpA/wkf2gOSHTPBZ06ehN+CgzO8R0ZtREaAygPCRPXiZ4LOk+EFuuBYJX9l2fCG/wQDyR/jIHpyU/KBz8XndVA2XPqL3Xf677l5TPwwGkD2yR/CkePulT/kehqoEMABA9sgewXub4i0Vvtbjjuj9HAwwEED2yB7ReyV4X6WP6GGtwUAgIoHfAwJkDwg+L9GbLhsDF/B5dfzBHPl7WBFA9oDkfRKMiymfVA8MBpA9skfyuQvehRTpivQRPTAYQPbIHrkj+AFvYDZKn/I9mD4gcHTTKmQP7qV4H0RiY8pH9MBgANkjewSfKcH7KBFbU3435XpmAAAMAJA9skfwpETHUj6DAHDxOsz5GkT24LfgkYC7wl9vAMD3Dp6IHtmDX5JH8EifCgAge2QPDiZ4JI/wqQSA56JH9kCKB6RPFQBI9e4RcTq5n+ZZcIfkdZB2DPbt3kEFAIBkj+DLSFzcbJE85yOQ6v1N9SR7RyXPzRTRm1wB2Ld7R9/BAOcuAMkewa+TmrhRWpEsgEoAkOpJ9kieFE+SpxLQWwno9gklnP8AyJ4UD0MLHsnbMQBIDgS4NgDWx/UyPikeSPIekloJUCJzn+casuF6pIRPsvdG8EgeyUPOlYBg9UYrXFtAskfypScSbkRIHsqpBHDtkepJ9sgdwSN5cLwSkLYWgGkAINkjeSSP5MHDCgADAeNTPcnewmTPXDx4Lfm9B19a9Wdz26/iiy6xApDUSXI9ANe2OYGWQ2CH7BE8jCx5F9P8PQ8/PtDf+/A126RS4T5X1kAgngZQSq26iXEPgFJGPQaX8a0XPWV6knzeyX5Q2YuIPHL/bVQADL8vMAi4cO2yMC8X7wW2yB7Bg5Oif3D/AfnkLe8vVPbrDQBWyYYBAfcOZG+944JLglC9qrq9fx758OGLukiRO5JPk7xJDDNYQP7FkjyHe/sBuFwF8ED0hTpOvao6aZ8/8uUAIHkkXySvnTgt3zjwgnzu20+LiMjuW28w/pgOOhBgEFCs+NPuO2mDAe5D/ol9nfex4iQqo4xvteQRfPmCN1nyrx49Id/80YsiIsuij3n9sc9miht5lPHzJJ4SQP5m3ZtsGwRoSPZF3hxM91lQpOzpTw/OJ/l2pytffOrZVMnHHHn0bzO9f9Nk30/+1269TEREZmemOHENHQSYch+zpIRvs8OWj4WuMj6ta8ELyYtcmJfvJ3lfSBuIpC0IpBJQLGnXTr81AZ7f55zeFS7vZE+KByTfh6zJXkRk48c+48x3HA8EPnTNlRJWKpz0BlYAdN4HDUj1yoOvNdcyPikecpe8yaIfNckj+8HkH3PpzJRcPNOUt225iAvDwEFA1ntlwbJXnn59ucje+oOX7G6F4EnyuiQf8+MH/1J+7y2bkX3GQcDNV79LqmHIRWPoQGCQe2lBffAV39Doc/akePBO9N/9ycvyi1ePZJ6T3/8fL2durOMjq9YCpKwDuPH33y6T9Rotggtm0PUABd5nEXwfIp8OHpJH8sPeNR7af8D7hXfGy79PBUCExYCmDAD27d6Ruk8AmCN72teCt0lehBX2tg8C7nn48VWDgGu3XsZjgSUQBAFb0Bkqe2tFj+CR/Cj87LeH5fsvvmK04B+5/zajn7W3qRLQWw245ZorJeKpAPBM9laKnkfmkPwodLpKvvC9Z0jyng8E7nl49SDgD952KU8DgLOyt0r0pHgkn+Xc+YfvPoPgYeBqQO+UwAffvVUm6lUOGFgne2tEj+SRfBbK6nq32GpLvRpxkjgyCGAaAGxO9ggeMokeyafzuW8/LffeuB3ZOyv/2/r+PZ4KAGQ/hOQRPGneRsmDn6k/7b/FlYB3XLJJJsbq8tbN01QDPEeJSKfb1XEeBFbInhRvj+BtkDyiBxMHBGlrAKrRmzd9ugS6R6fbTZ0r1y16kdXtckufsyfFk+RdTvK//qe/keZEPdPP8LFlrm/QIMh+2t3uit//yee/kfr3nth1VyGyNybZI3kk77roRUTOtVrSlDonEgxdAdh78KUVf/aR7VfRpMZSwSdFr4HU06JU2VOqt0/ypoo+bm1rquRjvnHgBfrjQ2b5x3/WWwEg/Zsp9bUoas1G4bJH8KR5n5I8QJGDgN6FgDHvuGSTbLvsLRywksXem+qLKN8XKnsEj+RzvwA7XfniU88ieYABKwExVAMGk3qeYjeBQmRfCYLUfY/BXMkzJ28u9MeHvKsB8QDg0pkpuXimKSLidJvgbvdNH8Vr412SeqmyT6bDvQ/cTbo3OMWbmuSRPECxlYC0JwJsqwSkpXUT5K6phG+G7JMiicWC9M0SPZIHgLUGADbIPyl4HxJ7gsAo2cdS6SpFykfyA0ke0QPYMQgoSvz9ErsNgi96YV6psu8VPikfySN5AHvl/8j9t2kTvesL5wqL/Wr1wrnCV9LRUAfJ94reZckffeyz2b7Hgy+xQA+MoQjRuyL3uIlOzsl+oBt61Od/LFT4pPxiJG9DmvchyT+4/wCNdcAZ0V+79TKtr+Faii9r46NojZFC4cKPUz5z+fmKniQPADpELyIyOzOlLdUj+nxSvYhIJY8fokP6yTQKo0neZNE/uP8Aoh8RmqCAKaLXWb53TfSa+uBnTvalJfxY+CT80SUfiEhAuR4ALBx0dtdYaQ/6ZF+q8JMJH+mvL/nkcUPyAKAz1euiK+Jkqi+zhD+o7JM/lJRvoOCRPAAUKXrK924me6NSPsK3I8n/7LeH5fsvvoLkARwD0RuR6rXLvjThx2LzvaxvuuRt2VfehYTFs/ZQ9DmH6I1haAFEGV6oNOH7WNY3XfJsOQuA6MHMVJ9F9qULPylAl6VPkgeAskWvNSiQ6rWn+qyyT74oKd8zyYuw+A7AFyjfj5bqw6BizPvJayMcI1K+C8JH8n6gpKSuVQBDpvoiN7hxLoLnf5GP/BPTNsLJ4z5WCjZvqGOD5F89ekK++aMXkXwOvPKlB+TiDZOjny9shgMOiN71VG+S7HVsccviPcdEz5azAIg+b1yfpzdJ9LpkX7rwY4GaLnxbFt8hePOY234VyR6shAV55RBp/NmlL94zdbU+SR4ATE71H75mmzbRu44JrXGLlr0RKd+ksr7pkmdOvji+ceAF9rQHI0V//bbLpVLJ/x7l+jy9z8neiJRvQlnfdMn/6tBRefL5l0jyAJ6LXkTkouaEttdwXfQmNdEpS/ZGpPyiy/qmb1TT6XblC997FsEDwJv3Rp6nN5Fc5FGx9Y2PKvyk9HVKPt5XPn5N03hw/wFE70gSA8jjXOJ5+uyp3qQmOmUn+9ITvs6Ub3qSf2OpJQ//63MiQrkeAC6I/tKZKa2i9yXVm/a4nQmyT34IJxbv7X3gbrreAYB1ohcRed/Wy7S9hg+if2LXXcZ3xIwMeA/WbqhjepJnkxoAWE/0zNPnQ2jg43amyd7KlG/Ls/JIHgD6gej9wbTVBKUu3utN6/0kH5fsTRT92cUWorcAvhsoO9XrEr3y7Fia2kTH1GTf+yGNa7VrepI/fuacfPXp5xEJAKwr+pve805tP79DqjeSyND3ZUyr3d6BgImQ5P2+cdMjH4alXtVz6/etfP/Errt0+s8L2RuR8uMtc00U/Z5n/1N+d+wkkveYue1Xyd6DL3EgYKjBIc/T5yzRSsWO92nBeyy91S5JHnTQ6SoJKwEHApwRPake2Vud8pE86OAL33uGzXCgMNFfv+1yra/h4zy9DQvzbJS9t8Jny1kAyIquDW58fMzO5A1vXJG9V8InyQNAHqmeeXpr3Oac7BXfK0keAPSL/uar36VV9D6W703e8Car7JFzASz84Dk5s9hC8ACQi+hFRKphqO01fBT9E7vuMnrDm35UUqSe9gsKSPOIHobllmuu5CBAX9HTDhfSkj1SL0nyMYgeAPIC0etJ9TatwE9L9oi+YFSP6ME/GNyBrlSvS/RdFuRZnewRfQkEIiuesV5qd5AAAGQWvU66Il6nettlDwZQi8Jl+X/ylvevSv0MAABgENFTvtcoTEtL+MjeYPp1VkP6oPnmAxaD6AHZOyL/e2/cLl/54UHE7wiqyKE9OJ3qaZyjD5sX5iF7S2lO1JfFv/OW98u5xZZ86QfPIX9LeWj/AfrjQ2bRf0ST6GNI9SR7KJFARCbq1VRZIH4Av+4FulK976K3sQ8+snecpPR33nydPPTdZ5A/gOOpnnl6xmfI3uczKQhWyP8TN/2hfPGpZxG/ozf8ex5+nAOB6HMVPbiT6pG9R0RhZVn+f/ZHV8sj//bj5f/290/+OwcIwDLRf0hTq+S48Qqp3p1Uj+w9ZWZyQnbNfUBE3mzmc+8fb5ev/OAg0gewRPQiIqGmxNmhfL+c6kOHHm31RvaLS+2h/n695sehqUWh1KJx2TX3Adk19wF55qe/lJ/8z+9EhHI/gKkwT29tBC/tSVujjbbYGkDQAzb7vf2hR4d67T0771zx9dSrfsj/um1XyHXbrhCR1Z38kD9A+aleX997Oqc7PXBRSpXyDa+XtIeVs26S8vcl9fcOvP7x+z9C/Bo4+thnM/3/ew++xAI9T0T/wXdvlYl6lVSvGRea6BiT7HuFmZS/aaLvfU8+ir9ejVas7if1AxQrehFB9GCf7PvJv9NVsmfnnaJEyR0PPWbkQesnft9SP/37AYoTPfP0Vqd6ZN9LWAkkPC/MWPpKRD5qgfh9Tf1riR/562du+1WU8T34jnWJHgqh9C0wSpuzH5bFVnt5MZ6JZf40fF3kl+T4mXPy1aefR/prkHXOXkRk48c+w4F0NNXf9J53art3kOoLS/Wly94a+8Qn++JSe1Xp3FT5p72v+L37kvqnG+OU+9fh7GJL21ws2C365L0P0ZPqvUj2/VAisnR+cZ8tid9X8ffCAr832X3rDZl3viPZuyl75ulJ9d4l+7WOYj0xx29D4k97fz7O9a8nOJI/IHo9oge/Un0s+0AGbk1jNr2STArURvFHUShhJfDiiugVfzdRcEL6g8mBRXqIfj3iy4pU7x9RYvThXPuk3sf5SPz2UOnZtQ/xgy+i10lHUb5Pw8UmOv1k76zwRVY+zrfYurDAz4Y5fsTPY33gF8zTg27Z945EnBR/cmWrTWk/7T0m33+tGkoQuF/yT4r/7GIL8YNTqZ55elJ9UbL3S/w1e8VP6n+zdSipHxD9YKIn1ftNMOKTd05vj7S41D7ft0+Mbdm7FknxV6uhVILAuxPbtq16sz5+x2Y4dov+0pkped/Wy7TJHtH3T/UVCaSS70JoI2+4UcYP43TiV+pCn36bxN+v3O/TPH9yq94/v+Ga5S5+JH4wEURfHhVPnnjKevd3utQfBMFK8X/yTlFKWZf2fX+sL9nFr6uUvP2SzfKLV48gfjAi1TNPX16q92GuPi/Ze5P2gyBYXtz3nV13S7vdOf9h7ZJ/v9QfhoFEYej+KD4I5Ob3Xrn8+6T4bZY/m+HYKXpdME8POmXfb2TjnPyTj/IlhZkmUxtTv4g/q/uT4u+F1A+6Ra8r1SN6WCXmglvjK9cP6OL5Pv22yj8t9YvQv1/3AID++Ig+z1SP6NfG9T74RSX7QQ6Es9JPSjG5Q5+N0k9L/b6t7k8K+Jmf/lJ233oDqR8yg+jdDM8mv7lKiQfFeWPUa9Hyrz0771y1UY9t4r/9oUel1erI4lJ7+ZdPXLftimX57771hmXxAwyT6q/fdjkHws1Ub/ZIxKAdbpUvBz0pSZvL/MnEHw9ufCSPrXrzKOPzrL35oifVOyt748OrSXdn5xf2pUnR5sV9ve+5t3JRq0biQ8W/n6Qp9UMviL580fuKyVHM+Xa9SfHbtjPfeuL3NfUnxX/dlW+TZ17+FfIH7c/TI/ohpOdhqjdd9l6l/hU781m+sG+t1O9TM5/3XvFWee8VbyX1I3rt+9PDYKneV9HbJHuvUr9LZf61xC/iz/P8ydT/2onTiN8j0d989bu0/Xz2pwfXZZ8mfud35nty9w5ZOr+4z0nx1yLxQfsXb5hcUe6/98bt8pUfHuRu5ChVTZ0pKd8Pl+qRvTs4P8cfJOQfS9K2dr1rib9X/r4809+cqGdeiQ9mpnr63hskO49L+CJmPXqnCy9mtRYdSPxp8GjfcCf6JrroGSP6m97zzuX9NHSInlQ/XLJH9n6t8PCqXa9L4u99rM+nhX7DQMtcM0Qvoucxu063KwrRmyB662TvW1Tyql3vvt07nEn8aeX+NmkfDEXb6ntEb5pLSPakfhJ/GYlfAtFSOrUFuuiVn+p5np5Uj+yRvhkfUClZanWcE3+a/H1M/kpEnjz40vLvkX9xor9262UyOzOlRfRCqjdF9lbOHyJ7z8WfTP2uiR/5XxDF/udfRvyaRS9CO1xEj+yRv0XSjyH1O/gdt9ry1AuvkPo1yB7RI3tkj/ito9NV0m67WepPk7+vC/3i1I/0ET2iR/bgoez7JX4fxO+r/Pcyz2+U6JE9qR7ZI/vyPrTDi/sQf7r8EX9/0YswT4/skT2yJ/EjfxI/qR7RI3pkj+xdE7/tvfqHkb/vid9n+RfR9x7ZI3tkj+zNFn+rvXyESPxu89//d0T+69eHpN1uy198eS+iR/Quih7ZA8IfNPGLuC3+XvmT+t1M/SzII9Uje2Sfia5Szm/nurjU9qrMH98mfG3f2+0q2ff8T50SP/P0ZotehK1skb3hsj907NSK32+ZnpTAYfkvttorjh6p3/0LxfYWvpTvSfXIHtln5sjJ09LpKLnv/LznwvyciIhMjtdkcqzufOL3Ufq1aiSBp7v0/vjnv5H/PXbSGvEjelI9sodc0/19fRY5xfLf0BiT8VoV8ZP4nSE5z2+i/B+5/za5ftvlclFzQpvsET2pHtkj+1Tpi7hf6k/K3zfxR1EoYcXP2G9S6qdxDrJH9qBF9iKyrvDTxD/dGJcxh5Ohz4mf1F9e4mdBHqJH9lBaul9P/LMzTS/Svi/i75U/4i9G/szTI3tkD8bJvp/4NzYnpBqFiB/5O8WhYyfluZ//Rpv0dZbvlYh0SPWZBR+D6JG9lbIXEfnw576W65uL5e9y4k9K3zfxJ+Xv+259ecifeXo9Us7bvKGeTnnIHuxK9+sl/k1TDYnCirNfhq+JPyn+SiVwuqoziPxHET/z9PmJPKpYd49xdlUssvdI9mnynxyvyUStJhWHV377LP6k/H1c4d+b+tcbALg2T581Wa91toQVJ8MCsofihF+U7HsT/+YNDVcvYMSfkH5QEalFfi7yW2y15akXXkmVvm197wcReUUCpwfyyB7ZWy17pZQcPn66UOH3il/E7Tn+Vqcj3Y7yXvwirO5PUnT5PmvyjhwfnCN6ZO+07MtI92uJf6wWyXRjnMTvgfzDMJAo9G+e//WTp2XT1KQ20acRBhVv2yUje2SP7A2Sfb/E73q5H/HT0AcQPbIHb4WfJn7XG/goJbLU8qdl71riR/qA7JE9eCR7X8VP4ifxA6JH9qBF9iJivPB7xe96n36llCy1Oogf6QOyR/YI3590v17iv3h6UiqOrkTqdJW02x1vpY/8AdEje2TvsezTxF+NQtmoaU9wEr+Z4kf+gOyRPbL3SPhpiX/LTNPpKy2e4/c58ffKv1oNna3yAKJH9ggf2a8jfhb3+Sl/Uj8gemSP7B2XfZr4XZc+iT9d+ogfED2y9174i622HDt9znnh94qfnfn8lb+Pm/YAokf2pHsv0n0/6fuQ+BH/2vIn9QOCR/bI3jPxk/j9lT7yR9aA7JE9id852p2OdDzena9X+JT3kTUge4SP+J3+rL4u7ItFT5pH6oDskT14szNfcnMel+UfS75WDSXg2fxc7h9p5DhI5ktC9gg/z4sV4Q8nftdTv2uJnySffgM53EfWg9DvnrFv9w6SPbIH0r2b8vdB/Lalfh9W3h/SIOusIHtkD8ge8dt+0iV69ZsqfRtT/JGTp1f8PrmAsgxhj8qX7v2IvOWiKUTvCdTJwDuSN91Y/GO1SKYb426N5INgWaKPf+pOUV1z0r7NpfpORzHgBpI96E32pHvSvs2J/8Kiu0hsXXPnyvW3MD/H4jySPeQ9qMpb+KA/7bsq/mTiT86V6xQ/3fAASPak+yHpdJUcOXGadE/izxUdnftcXFnvSrJ/9K8/Ko16jWRPsgdToYNY8Yl/YX5uxWpqF8WfFPKenXeKEiV3PPRYJsnT8c7cQSyiR/agB0r5Dki/N/Ff1JyQWhQ6K/59u3fIYqstcQVwPfnTCAcA2UOOXNSc4CAYkviXR3OByJZpBxN/9cJt4ju77pZ2u5Na5t+z804k72eIARu+KObsC4dn7h0mlr+r4k+SnOMPKiK1yOzsEE/DZJ2CceG6e+LTd+W1cySyJ9kD+Jv4fUj9tiy6S7aZ7m2j7OuAlHUUyB4ANIi/V/6ur+wvG6WUHD5+etX3wAxDfBw4EMgetF9nklMpf3amKQvzc5TyLU79SF9vkgcAZA9QuvhJ+3ZJ/sziEoMIQPYAkD3tb5pq5LV4CsnnzKmzixzwCzAXgOxhgIskl1L+lulJSvkOiz/+jpljXUlXKXktZU5+PTY2Gxw8QPZg4agBCXglfkr9oyf5hfk5KiacQ8geuHjBHvFv3tCQsOKPuEZN8rB6wAPIHgoO5ZJjgx1K+f6JP/7eXW3ZKyJybqklJ868geQBkD2A3/J3dX6fR+gAkD2Q7iEl7SfFPzlek8mxulWfJd6+2VTJ23595Tjlx2IhZA9lXcTJLVgB8Sflv3FqQqqhuaX+fh3vIN8wAMgeyoFtb6GU1L+xOSFVA+b5TU/yAMgejEz3AMOIvzlRl0a9huQBkD3YBPP2kCXxb5lpap2MbXU6cvTkWSQPgOy9g1I+GCP+WP7TjXEZy3ELWxfm5G1eE7MwPycbmxOc7MgeED7ABfkvzM+JnHnz92O1SKYb4yP9LJrhmEPV0V4MgOy9hG1vQVfaT55j67HYasux0+eQvCFsmsp1TwAeu0P2AOC6/Ad9hMs0yW+ZnvTyu2NPAED2ZpFbKZ+9caDI1G/NBebhhcGz9RDDcM9Btkw3ucgBQERyfySXKIHsAQDApFTv69QFIHvTYdQMAPndUJjTA2TvNvGqfADwb+6aax+QPQCAJwP+nKFMgOzBREZthALgGs2JujefdWF+TjZvYK4ekL03jNUiynkAHhJWcg/hpHpkD1xUAG6jlLKiv8DC/By7XwKyBwAAAgiyB+dgVT74zsL8nNSjyIvPSaoHZM9IGsBb6A0PyB6cZ0NjjIMAkIGu4RtQa0z1BA9kD7ak+/FalVI+QAaOnDjNQQBkDwAApHpA9sDFBgAaRM+9B5A9LMOqfAB3r20AZA8AQKon1SN7MJzcLrxNUw2OJgCpHpA9uEwUVijlA5DqSfXIHgAAknSVmQ/Zk+oB2UNfNm9okO4BhsSkTXAW5ue82rIXkD2MQFjhKwe/cFGMjXpNx4+lhI/soWS4CAFGTMGaxFja56GBDiB7GIiJsRoHAWBQFIcAkD1YmO6nxuvM2wMMyGuG9MUn1QOyBwBwGB61A2RPuh+JDY0x0j2ARfCoHSB7GJrxWpWDAEB4AGQPAABlo3GuHpA9MBoHcOBisfxqYa4ekD1khm1vAdZGGdAql1QPyB4AQCOHj58urVXuwvycTI7TKQ+Qvc/kdrGSGgDMZXKMHviA7CHHBAHgIps3TFp7TVajkFQPyB4AYD1hVixeobexOcGXCMgeAMDVQYomSPXIHiwk13l7SvkA5sBaGkD2AACkegBkD9xoAEj1K6CEj+wBKBsCmDDY3jTVQPSA7IGLGMBlopBbMiB7KED4lPIBykn1lO8B2UMhUMoHuECnqzgIgOwBAFymq7qF9MUn1QOyh8LZwjP3AADIHowkMO4HAQCpHpA9AIDvogdA9lDaSL4ahdyIwP4LIuMV0S1ggR6pHpA9lAa7bQGIHDt9jlQPyB4AAEj1gOyheHK70LdMT5I+AEj1gOzB6VFDQEAAu4W6ZdrcJlGkekD2YAxxuieJAADYTcQhgLXS/exMU1qdzrLwi+goBuAqPFcPyB7yvOhzfWaoGoYyO9MUpRTSB8gg+uZEHdEDsgc7kn5844pB/OAap99Y1PJzG/UaBxeQPdhDLH1K/OCk7M8t5Xo+L8zPycSYFtGT6mEgWKDnaAgv6oXiEn9v2geAlUyN1zkIQLIHN5L+E5++S14/eYakD0acjybAojxA9qA73avCT6iwsirpI30AAGQPjqcrpA++QqoHZA9IHwAAkD24Kf1//vht8sZSG/GDtjTteKoHGBpW47uNkaW+6ca4zM40ZdNUgxX8AI5c10Cyh/JvDMrIk+/8Yj4a9IBrMFcPyB4Qfg/JmyLz+gAAyB4cFX6v+En7QKon1QOyB4eFT9qHMjl8/NTI55rGNSiIHpA9jHTTULa84dmZpnS6XaQP1pyvAMgekP4IhBU684HZsNkNIHtA+hqSE9KHNDZNNUp7bTa7AWQPSF+z9BE/5IEa4QpYmJ+TahRy8ADZg3XS/9b5f95ui/SPnzlH2ofS2Nic0Hk9AmSCDnrQjzvO/7LmZhN35ouTFt35oAgW5ufk4ulJDgSQ7MGZtC9i0bP6SimSPhSTmoJA93UHgOyhFPEbL/0gCGR2pintDo/t+ZSyo7BS6OttaIwhekD2gPRLP8nDCov5QBvjtSoHAYyHOXvIQ/rWpJDZmSbz+pBbqqctLpDsgaRvuPRFhM58MLLoNV9HACR7IOnnRW9nPpK+3yilBh700RYXkD2AZQmF8j4AuAxlfChK+Oy2B4V+f7pgrh6QPcD6NzLa8YK1UPEBZA/geNo/dOwUad9x2p1uWdUDUj1ohTl7KFv8PLYHxnD01Nk1U72eRnmIHpA9IH2kD8awZZoV+IDsAbyU/lgtQvgGoPM7WJifk80bJnWd8wDaYc4eTJW+iCVz+tONcZGGyL7dO+TQsVMiwpy+i4QVvAzIHkB36rFqMd+X75sTpZA+kOoB2QMMe2O05rG9eG73ax+/Tc4ttUn7FqPxuXqAwmDOHmwTvlXz+hsa4yzms1z0W6aZqweSPUCZ4hexrLx//Mw5ntU3mLTvJAjwMiB7AKQ/BPFiPqUU0rcg1dNAB5A9gJnSt0L8QRDI7ExTWu0O0gcAZA/gctqvRuFyevz6J+6Qs28sIf0RyTOFk+oB2QMgfS1MjddlarxO0i+JQfriI3pA9gDmS98K8ceJ8l/+6g45fW4J8RfE6yfP6E71AMgegLS/ksmxukyO1aXbZTGfYwNOgOJPQKUURwF8R9nyJg/TjjeVPNJ43OqYuXog2QOQ9kt9k7GIvrnzY3LizBuIn1QPgOwBXJS+iMh4rSrjtaos8eherjBXD8geAOkbR+38o3tKBOlnZENjjFQPzkJvfAAHbtRxib8ahfTgHwGllIzXqhwIINkDIHzzk/7G5sTyv3/1/lul1e6Q9AeRvZ6RHakekD2AxeK3YvV+LP5kykf86VTY7AaQPQDYnPbjRWf04S/tHAFA9gAO3NStSPpxH/43ltrOSd+wYI7oAdkDOCr8b53/99tNf7NjtUhma005s7hE0gfw5SZFBz0ALVh1YR2yvDPfl++bky3TxjwjT7IHkj2AR2nfGunPzjSl0+2ymA/RA8keAHxJ+612R46eOmuF9A3bpQ7Zg5HQVAegWBFYIYN4MV8sU5r0IHqwG8r4AOVIwZryfjJB25D0AQDZA5iWAq0p7SeTPtIn1QOyBwCPpI/4AZA9AAyfDK0q8R86dsr3tE+qB2QPAG6n/Vj6J88tUuIHMBRW4wOYLf09trzZqfG6zM405aLmRKEr+JsTdVI9wHonKs/ZA1iDlV35dCf9b3/qT6UahcgeYA0o4wPYlfStEb8Hj+0hekD2AKBdNFat4FdKuSR9RA/IHgBI+qvebBDw2B5AWdcfc/YATmHVBZ21B//C/JxsmmpIFBa+1phkDyR7ACg97Vsh/bgHf3LHvWGlj+gB1odH7wDclb41UgorFVs23kH0QLIHACPlZF0r3lj6MczrAyB7ABg8jVonfoPa8ZLqwVoo4wP4J36rpDU707SlxA9g7oXPanwAr7HuBpDszJesAJDqAZA9ADgm/kPHTsnM5LjUq4XMRiJ7QPYAgPRdvk9yCMB2WKAHAGvJDfEDOAAL9ACAVAtAsgcAhO9t0mewAyR7APBS/AgQANkDANIn1QMgewBA+ogeoDCYsweAvOWoHPosAMgeAMAx8SN6cBLK+ACgW56BRe8VgGQPAJBBpMrQ9wWA7AEANIiVznwABUIZHwDKEj+pGoBkDwCkfQAg2QMAaR8AkD0AIP01XgcA2QMAOCp9RA/IHgDAMOkjeoAM/P8A6WAIZSGjEIoAAAAASUVORK5CYII=');background-position: 10px 0px;background-size:25%; diff --git a/apps/maarch_entreprise/xml/IVS/validation_rules.xml b/apps/maarch_entreprise/xml/IVS/validation_rules.xml index 08ef49ce0a21a0f0e67653f8dedd968a2cc85a83..a65534200f29e7581d412770b61102bdfd2ccd7d 100755 --- a/apps/maarch_entreprise/xml/IVS/validation_rules.xml +++ b/apps/maarch_entreprise/xml/IVS/validation_rules.xml @@ -471,6 +471,8 @@ <parameter name="identifier" type="string" /> <parameter name="services_chosen" type="identifier" /> <parameter name="services_available" type="identifier" /> + <parameter name="initiatorServices_chosen" type="identifier" /> + <parameter name="initiatorServices_available" type="identifier" /> <parameter name="market" type="string" /> <parameter name="status_chosen" type="identifier" /> <parameter name="status_available" type="identifier" /> diff --git a/apps/maarch_entreprise/xml/services.xml b/apps/maarch_entreprise/xml/services.xml index a384e9659a08aba4bd27fd08ecbbe3fe4278c2d0..4f9c63bb158c1e8317f8bbfc70f48dc9d01fafd2 100755 --- a/apps/maarch_entreprise/xml/services.xml +++ b/apps/maarch_entreprise/xml/services.xml @@ -67,21 +67,23 @@ <id>view_history</id> <name>_VIEW_HISTORY</name> <comment>_VIEW_HISTORY_DESC</comment> - <servicepage>index.php?page=history&admin=history</servicepage> + <servicepage>/administration/history</servicepage> <servicetype>admin</servicetype> <system_service>false</system_service> <style>fa fa-history</style> <enabled>true</enabled> + <angular>true</angular> </SERVICE> <SERVICE> <id>view_history_batch</id> <name>_VIEW_HISTORY_BATCH</name> <comment>_VIEW_HISTORY_BATCH_DESC</comment> - <servicepage>index.php?page=history_batch&admin=history_batch</servicepage> + <servicepage>/administration/historyBatch</servicepage> <servicetype>admin</servicetype> <system_service>false</system_service> <style>fa fa-history</style> <enabled>true</enabled> + <angular>true</angular> </SERVICE> <!--<SERVICE> <id>xml_param_services</id> diff --git a/core/Controllers/ActionsController.php b/core/Controllers/ActionsController.php index fa321e9062364a036f4c9a9601b6d9fb23eb08d9..65a23db241469bfe619c5f5032c6fe45b423c308 100755 --- a/core/Controllers/ActionsController.php +++ b/core/Controllers/ActionsController.php @@ -63,6 +63,11 @@ class ActionsController $obj['action']['create_id'] = false; } + //array of id categoriesList + foreach ($obj['action']['actionCategories'] as $key => $category) { + $arrActionCategories[] = $category['category_id']; + } + $obj['action']['actionCategories'] = $arrActionCategories; $obj['categoriesList'] = ActionsModel:: getLettersBoxCategories(); @@ -70,23 +75,10 @@ class ActionsController foreach ($obj['categoriesList'] as $key => $category) { $arrCategoriesList[] = $category['id']; } + //array of id actionCategories - if (!empty($obj['action']['actionCategories'])) { - foreach ($obj['action']['actionCategories'] as $actionCategories) { - $arrActionCategories[] = $actionCategories['category_id']; - } - //check - foreach ($arrActionCategories as $key => $category_id) { - if (in_array($category_id, $arrCategoriesList)) { - $obj['categoriesList'][$key]['selected'] = true; - } else { - $obj['categoriesList'][$key]['selected'] = false; - } - } - } else { - foreach ($obj['categoriesList'] as $key => $category) { - $obj['categoriesList'][$key]['selected'] = false; - } + if (empty($obj['action']['actionCategories'])) { + $obj['action']['actionCategories'] = $arrCategoriesList; } $obj['statusList'] = StatusModel::getList(); @@ -94,7 +86,6 @@ class ActionsController $obj['action_pagesList']=ActionsModel::getAction_pages(); array_unshift($obj['action_pagesList']['actionsPageList'], ['id'=>'','label'=> _NO_PAGE, 'name'=>'', 'origin'=>'']); $obj['keywordsList']=ActionsModel::getKeywords(); - $obj['lang'] = LangModel::getActionsForAdministrationLang(); return $response->withJson($obj); } @@ -184,11 +175,10 @@ class ActionsController ->withJson(['errors' => _NOT_DELETE]); } - return $response->withJson( [ 'success' => _ACTION. ' <b>' . $id .'</b> ' ._DELETED, - 'action' => $obj + 'action' => ActionsModel::getList() ] ); } diff --git a/core/Controllers/CoreController.php b/core/Controllers/CoreController.php index b7c8bac5614ec99829e107b12092bd216c6c896f..a66b75f64e27d9afa821e5facdeb51600f9d5f5a 100755 --- a/core/Controllers/CoreController.php +++ b/core/Controllers/CoreController.php @@ -37,7 +37,7 @@ class CoreController if (!empty($data['views'])) { foreach ($data['views'] as $view) { $aInit[$view . 'View'] = 'Views/' . $view . '.component.html'; - if(file_exists("custom/{$customId}/apps/maarch_entreprise/Views/{$view}.component.html")) { + if (file_exists("custom/{$customId}/apps/maarch_entreprise/Views/{$view}.component.html")) { $aInit[$view . 'View'] = "../../custom/{$customId}/apps/maarch_entreprise/Views/{$view}.component.html"; } } @@ -50,6 +50,7 @@ class CoreController { if ($_SESSION['user']['UserId'] == 'superadmin') { //TODO session $administration = []; + $administration['menu'] = ServiceModel::getApplicationAdministrationMenuByXML(); $administration['application'] = ServiceModel::getApplicationAdministrationServicesByXML(); $administration['modules'] = ServiceModel::getModulesAdministrationServicesByXML(); } else { diff --git a/core/Controllers/HistoryController.php b/core/Controllers/HistoryController.php index 27c1815743145900ec20e48703b30e0a08704c85..eec4dd47aac0d5b77e7b955217ea23e091db2dbb 100755 --- a/core/Controllers/HistoryController.php +++ b/core/Controllers/HistoryController.php @@ -21,6 +21,7 @@ use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Respect\Validation\Validator; use Core\Models\HistoryModel; +use Core\Models\ServiceModel; use Core\Models\ValidatorModel; use Notifications\Controllers\NotificationsEventsController; @@ -245,4 +246,35 @@ class HistoryController return $pathToXml; } + + public function getForAdministration(RequestInterface $request, ResponseInterface $response, $aArgs) + { + if (!ServiceModel::hasService(['id' => 'history', 'userId' => $_SESSION['user']['UserId'], 'location' => 'apps', 'type' => 'admin'])) { + return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); + } + $return = []; + $historyList = HistoryModel::getHistoryList(['event_date' => $aArgs['date']]); + $historyListFilters['users'] = HistoryModel::getFilter(['select' => 'user_id','event_date' => $aArgs['date']]); + $historyListFilters['eventType'] = HistoryModel::getFilter(['select' => 'event_type','event_date' => $aArgs['date']]); + + $return['filters'] = $historyListFilters; + $return['historyList'] = $historyList; + + return $response->withJson($return); + } + + public function getBatchForAdministration(RequestInterface $request, ResponseInterface $response, $aArgs) + { + if (!ServiceModel::hasService(['id' => 'view_history_batch', 'userId' => $_SESSION['user']['UserId'], 'location' => 'apps', 'type' => 'admin'])) { + return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); + } + $return = []; + $historyList = HistoryModel::getHistoryBatchList(['event_date' => $aArgs['date']]); + $historyListFilters['modules'] = HistoryModel::getBatchFilter(['select' => 'module_name','event_date' => $aArgs['date']]); + + $return['filters'] = $historyListFilters; + $return['historyList'] = $historyList; + + return $response->withJson($return); + } } diff --git a/core/Controllers/ParametersController.php b/core/Controllers/ParametersController.php index fd7a879899674a860c18779a26b187f7bd0c2067..322567bbb5cbe451eed6919e7d3f019a0b20779d 100755 --- a/core/Controllers/ParametersController.php +++ b/core/Controllers/ParametersController.php @@ -84,7 +84,7 @@ class ParametersController return $response->withJson( [ - 'success' => _PARAMETER. ' <b>' . $obj['id'] .'</b> ' ._ADDED, + 'success' => _PARAMETER. ' <b>' . $obj['id'] .'</b> ' ._ADDED ] ); } @@ -123,6 +123,7 @@ class ParametersController return $response->withJson( [ 'success' => _PARAMETER. ' <b>' . $aArgs['id'] .'</b> ' ._DELETED, + 'parameters' => ParametersModel::getList() ] ); } diff --git a/core/Controllers/ResController.php b/core/Controllers/ResController.php index 3b437330d4bae99ebfe13301e7011ea8556c026c..c40325dee5200b2799a15db79d1717e7bf786c88 100755 --- a/core/Controllers/ResController.php +++ b/core/Controllers/ResController.php @@ -34,12 +34,37 @@ class ResController { public function create(RequestInterface $request, ResponseInterface $response, $aArgs) { - if(empty($aArgs)){ + if(empty($aArgs)) { + $aArgs = $request->getQueryParams(); + $aArgs['data'] = json_decode($aArgs['data']); + $aArgs['data'] = $this->object2array($aArgs['data']); + + //FIX pb if data has parent + if (isset($aArgs['data']['data'])) { + $aArgs['data'] = $aArgs['data']['data']; + } } + //***************************************************************************************** + //LOG ONLY LOG FOR DEBUG + // $file = fopen('storeResourceLogs.log', a); + // fwrite($file, '[' . date('Y-m-d H:i:s') . '] new request' . PHP_EOL); + // foreach ($aArgs as $key => $value) { + // if ($key <> 'encodedFile') { + // fwrite($file, '[' . date('Y-m-d H:i:s') . '] ' . $key . ' : ' . $value . PHP_EOL); + // } + // } + // fclose($file); + // ob_flush(); + // ob_start(); + // print_r($aArgs['data']); + // file_put_contents("storeResourceLogs.log", ob_get_flush()); + //END LOG FOR DEBUG ONLY + //***************************************************************************************** + $return = $this->storeResource($aArgs); if ($return['errors']) { @@ -49,8 +74,11 @@ class ResController ['errors' => _NOT_CREATE . ' ' . $return['errors']] ); } + + //standardize ws response for MaarchCapture + $wsReturn['resId'] = $return[0]; - return $response->withJson($return); + return $response->withJson($wsReturn); } public function delete(RequestInterface $request, ResponseInterface $response, $aArgs) @@ -158,7 +186,8 @@ class ResController $returnCode = 0; //copy sended file on tmp - $fileContent = base64_decode($encodedFile); + //$fileContent = base64_decode($encodedFile); + $fileContent = base64_decode(str_replace(array('-', '_'), array('+', '/'), $encodedFile)); $random = rand(); $fileName = 'tmp_file_' . $random . '.' . $fileFormat; $Fnm = CoreConfigModel::getTmpPath() . $fileName; @@ -419,7 +448,7 @@ class ResController } $resInsert = ResModel::create([ - 'table' => 'res_letterbox', + 'table' => $table, 'data' => $prepareData ]); diff --git a/core/Controllers/ResExtController.php b/core/Controllers/ResExtController.php index b1ef7784535b8304c2ed34368e3ab80be7835fd8..8bee0e0f90e9f05e8ab8ed50ed3a34e6378418cd 100755 --- a/core/Controllers/ResExtController.php +++ b/core/Controllers/ResExtController.php @@ -27,12 +27,37 @@ class ResExtController { public function create(RequestInterface $request, ResponseInterface $response, $aArgs) { - if(empty($aArgs)){ + if(empty($aArgs)) { + $aArgs = $request->getQueryParams(); + $aArgs['data'] = json_decode($aArgs['data']); + $aArgs['data'] = $this->object2array($aArgs['data']); + + //FIX pb if data has parent + if (isset($aArgs['data']['data'])) { + $aArgs['data'] = $aArgs['data']['data']; + } } + //***************************************************************************************** + //LOG ONLY LOG FOR DEBUG + // $file = fopen('storeResourceLogs.log', a); + // fwrite($file, '[' . date('Y-m-d H:i:s') . '] new request' . PHP_EOL); + // foreach ($aArgs as $key => $value) { + // if ($key <> 'encodedFile') { + // fwrite($file, '[' . date('Y-m-d H:i:s') . '] ' . $key . ' : ' . $value . PHP_EOL); + // } + // } + // fclose($file); + // ob_flush(); + // ob_start(); + // print_r($aArgs['data']); + // file_put_contents("storeResourceLogs.log", ob_get_flush()); + //END LOG FOR DEBUG ONLY + //***************************************************************************************** + $return = $this->storeExtResource($aArgs); if ($return['errors']) { @@ -43,7 +68,10 @@ class ResExtController ); } - return $response->withJson([$return]); + //standardize ws response for MaarchCapture + $wsReturn['status'] = $return; + + return $response->withJson($wsReturn); } public function delete(RequestInterface $request, ResponseInterface $response, $aArgs) diff --git a/core/Controllers/StatusController.php b/core/Controllers/StatusController.php index 861c91f2bbcbc31127d7e7c2b3a916f8a7cb198c..89e189b76e75eb78e2b83b6f55f7b5b2ae2870f6 100755 --- a/core/Controllers/StatusController.php +++ b/core/Controllers/StatusController.php @@ -31,8 +31,7 @@ class StatusController } return $response->withJson([ - 'statusList' => StatusModel::getList(), - 'lang' => StatusModel::getStatusLang() + 'statusList' => StatusModel::getList() ]); } @@ -43,8 +42,7 @@ class StatusController } return $response->withJson([ - 'statusImages' => StatusImagesModel::getStatusImages(), - 'lang' => StatusModel::getStatusLang() + 'statusImages' => StatusImagesModel::getStatusImages() ]); } @@ -147,9 +145,8 @@ class StatusController $statusDeleted = StatusModel::getByIdentifier(['identifier' => $aArgs['identifier']]); if (Validator::notEmpty()->validate($aArgs['identifier']) && Validator::numeric()->validate($aArgs['identifier']) && !empty($statusDeleted)) { - $return = [ - StatusModel::delete(['identifier' => $aArgs['identifier']]) - ]; + + StatusModel::delete(['identifier' => $aArgs['identifier']]); HistoryController::add([ 'table_name' => 'status', @@ -164,7 +161,11 @@ class StatusController ->withJson(['errors' => 'identifier not valid']); } - return $response->withJson($return); + return $response->withJson( + [ + 'statuses' => StatusModel::getList() + ] + ); } protected function manageValue($request) diff --git a/core/Controllers/UserController.php b/core/Controllers/UserController.php index d42ba1c60dcca2ce7b4e659ecf76b2853e0297ed..36c75cc9a3d55f04fe3b74256da7b9e8a0e0dd42 100755 --- a/core/Controllers/UserController.php +++ b/core/Controllers/UserController.php @@ -15,18 +15,19 @@ namespace Core\Controllers; -use Core\Models\CoreConfigModel; -use Core\Models\SecurityModel; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; -use Respect\Validation\Validator; use Baskets\Models\BasketsModel; +use Core\Models\CoreConfigModel; use Core\Models\GroupModel; +use Core\Models\HistoryModel; use Core\Models\LangModel; +use Core\Models\SecurityModel; use Core\Models\ServiceModel; -use Entities\Models\EntityModel; use Core\Models\UserModel; +use Entities\Models\EntityModel; use Entities\Models\ListModelsModel; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; +use Respect\Validation\Validator; include_once 'core/class/docservers_controler.php'; @@ -41,7 +42,7 @@ class UserController $user['groups'] = UserModel::getGroupsByUserId(['userId' => $_SESSION['user']['UserId']]); $user['entities'] = UserModel::getEntitiesById(['userId' => $_SESSION['user']['UserId']]); $user['baskets'] = BasketsModel::getBasketsByUserId(['userId' => $_SESSION['user']['UserId']]); - + return $response->withJson($user); } @@ -69,7 +70,7 @@ class UserController UserModel::create(['user' => $data]); - $newUser = UserModel::getByUserId(['userId' => $data['userId'], 'select' => ['id']]); + $newUser = UserModel::getByUserId(['userId' => $data['userId']]); if (!Validator::intType()->notEmpty()->validate($newUser['id'])) { return $response->withStatus(500)->withJson(['errors' => 'User Creation Error']); } @@ -112,7 +113,53 @@ class UserController UserModel::delete(['id' => $aArgs['id']]); - return $response->withJson(['success' => _DELETED_USER]); + //get New User List + if ($_SESSION['user']['UserId'] == 'superadmin') { + $users = UserModel::get( + [ + 'select' => ['id', 'user_id', 'firstname', 'lastname', 'status', 'enabled', 'mail'], + 'where' => ['user_id != ?', 'status != ?'], + 'data' => ['superadmin', 'DEL'] + ] + ); + } else { + $entities = EntityModel::getAllEntitiesByUserId(['userId' => $_SESSION['user']['UserId']]); + $users = UserModel::getByEntities( + [ + 'select' => ['DISTINCT users.id', 'users.user_id', 'firstname', 'lastname', 'status', 'enabled', 'mail'], + 'entities' => $entities + ] + ); + } + + $usersId = []; + foreach ($users as $value) { + $usersId[] = $value['user_id']; + } + + $listModels = ListModelsModel::getDiffListByUsersId(['select' => ['item_id'], 'users_id' => $usersId, 'object_type' => 'entity_id', 'item_mode' => 'dest']); + + $usersListModels = []; + foreach ($listModels as $value) { + $usersListModels[] = $value['item_id']; + } + + foreach ($users as $key => $value) { + if (in_array($value['user_id'], $usersListModels)) { + $users[$key]['inDiffListDest'] = 'Y'; + } else { + $users[$key]['inDiffListDest'] = 'N'; + } + } + $users; + + + return $response->withJson( + [ + 'success' => _DELETED_USER, + 'users' => $users + ] + ); } public function updateProfile(RequestInterface $request, ResponseInterface $response) @@ -218,7 +265,7 @@ class UserController if (!empty($data['status']) && $data['status'] == 'OK') { $user = UserModel::getById(['id' => $aArgs['id'], 'select' => ['user_id', 'firstname', 'lastname']]); - UserModel::deactivateAbsenceById(['id' => $aArgs['id']]); + UserModel::desactivateAbsenceById(['id' => $aArgs['id']]); HistoryController::add([ 'table_name' => 'users', 'record_id' => $user['user_id'], @@ -476,8 +523,7 @@ class UserController $users[$key]['inDiffListDest'] = 'N'; } } - - $return['lang'] = LangModel::getUsersAdministrationLang(); + $return['users'] = $users; return $response->withJson($return); @@ -498,6 +544,7 @@ class UserController $user['entities'] = UserModel::getEntitiesById(['userId' => $user['user_id']]); $user['allEntities'] = EntityModel::getAvailableEntitiesForAdministratorByUserId(['userId' => $user['user_id'], 'administratorUserId' => $_SESSION['user']['UserId']]); $user['baskets'] = BasketsModel::getBasketsByUserId(['userId' => $user['user_id']]); + $user['history'] = HistoryModel::getHistoryByUserId(['userId' => $user['user_id']]); return $response->withJson($user); } @@ -528,7 +575,8 @@ class UserController return $response->withJson([ 'success' => _ADDED_GROUP, 'groups' => UserModel::getGroupsByUserId(['userId' => $user['user_id']]), - 'allGroups' => GroupModel::getAvailableGroupsByUserId(['userId' => $user['user_id']]) + 'allGroups' => GroupModel::getAvailableGroupsByUserId(['userId' => $user['user_id']]), + 'baskets' => BasketsModel::getBasketsByUserId(['userId' => $user['user_id']]) ]); } diff --git a/core/Models/GroupModelAbstract.php b/core/Models/GroupModelAbstract.php index 5c6f4148f166a02cf8e19c303ecae9ef3fb73d71..c3c2abb59a032d8e87d13baf23287c8da22962dc 100755 --- a/core/Models/GroupModelAbstract.php +++ b/core/Models/GroupModelAbstract.php @@ -23,7 +23,8 @@ class GroupModelAbstract 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'table' => ['usergroups'], 'where' => ['enabled = ?'], - 'data' => ['Y'] + 'data' => ['Y'], + 'order_by' => ['group_desc'] ]); return $aGroups; diff --git a/core/Models/HistoryModelAbstract.php b/core/Models/HistoryModelAbstract.php index da8f17756d0a79852e6d10c20939c02c0113339e..a973d6f203f8034ebc669126058c7152130cd301 100755 --- a/core/Models/HistoryModelAbstract.php +++ b/core/Models/HistoryModelAbstract.php @@ -115,4 +115,88 @@ class HistoryModelAbstract return $aReturn; } + + public static function getHistoryList(array $aArgs = []) + { + ValidatorModel::notEmpty($aArgs, ['event_date']); + + $aReturn = DatabaseModel::select( + [ + 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], + 'table' => ['history'], + 'where' => ["event_date >= date '".$aArgs['event_date']."'","event_date < date '".$aArgs['event_date']."' + interval '1 month'"], + 'order_by' => ['event_date DESC'] + ] + ); + + return $aReturn; + } + + public static function getHistoryBatchList(array $aArgs = []) + { + ValidatorModel::notEmpty($aArgs, ['event_date']); + + $aReturn = DatabaseModel::select( + [ + 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], + 'table' => ['history_batch'], + 'where' => ["event_date >= date '".$aArgs['event_date']."'","event_date < date '".$aArgs['event_date']."' + interval '1 month'"], + 'order_by' => ['event_date DESC'] + ] + ); + + return $aReturn; + } + + public static function getHistoryByUserId(array $aArgs = []) + { + ValidatorModel::notEmpty($aArgs, ['userId']); + ValidatorModel::stringType($aArgs, ['userId']); + + $aReturn = DatabaseModel::select( + [ + 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], + 'table' => ['history'], + 'where' => ['user_id = ?'], + 'data' => [$aArgs['userId']], + 'order_by' => ['event_date DESC'] + ] + ); + + return $aReturn; + } + + public static function getFilter(array $aArgs = []) + { + ValidatorModel::notEmpty($aArgs, ['select','event_date']); + ValidatorModel::stringType($aArgs, ['select']); + + $aReturn = DatabaseModel::select( + [ + 'select' => ['DISTINCT('.$aArgs['select'].')'], + 'table' => ['history'], + 'where' => ["event_date >= date '".$aArgs['event_date']."'","event_date < date '".$aArgs['event_date']."' + interval '1 month'"], + 'order_by' => [$aArgs['select'].' ASC'] + ] + ); + + return $aReturn; + } + + public static function getBatchFilter(array $aArgs = []) + { + ValidatorModel::notEmpty($aArgs, ['select','event_date']); + ValidatorModel::stringType($aArgs, ['select']); + + $aReturn = DatabaseModel::select( + [ + 'select' => ['DISTINCT('.$aArgs['select'].')'], + 'table' => ['history_batch'], + 'where' => ["event_date >= date '".$aArgs['event_date']."'","event_date < date '".$aArgs['event_date']."' + interval '1 month'"], + 'order_by' => [$aArgs['select'].' ASC'] + ] + ); + + return $aReturn; + } } diff --git a/core/Models/ServiceModelAbstract.php b/core/Models/ServiceModelAbstract.php index 59354d3cfde7149b51182b3db9f421ef988a7250..4808ce27811c5303b74ce22a0f870fd846c9ccbe 100755 --- a/core/Models/ServiceModelAbstract.php +++ b/core/Models/ServiceModelAbstract.php @@ -41,6 +41,7 @@ class ServiceModelAbstract return $applicationServices; } + public static function getApplicationAdministrationServicesByUserServices(array $aArgs = []) { ValidatorModel::notEmpty($aArgs, ['userServices']); @@ -145,6 +146,138 @@ class ServiceModelAbstract return $modulesServices; } + public static function getApplicationAdministrationMenuByXML() + { + $customId = CoreConfigModel::getCustomId(); + + if (file_exists("custom/{$customId}/apps/maarch_entreprise/xml/menu.xml")) { + $path = "custom/{$customId}/apps/maarch_entreprise/xml/menu.xml"; + } else { + $path = 'apps/maarch_entreprise/xml/menu.xml'; + } + + $modulesServices = []; + + $xmlfile = simplexml_load_file($path); + foreach ($xmlfile->MENU as $value) { + + $label = defined((string)$value->libconst) ? constant((string)$value->libconst) : (string)$value->libconst; + + $modulesServices['menuList'][] = [ + 'id' => (string) $value->id, + 'label' => $label, + 'link' => (string) $value->url, + 'icon' => (string)$value->style, + 'angular' => empty((string)$value->angular) ? 'false' : (string)$value->angular + ]; + + } + if (file_exists("custom/{$customId}/apps/maarch_entreprise/xml/config.xml")) { + $path = "custom/{$customId}/apps/maarch_entreprise/xml/config.xml"; + } else { + $path = 'apps/maarch_entreprise/xml/config.xml'; + } + $xmlfile = simplexml_load_file($path); + $modulesServices['applicationName'] = $xmlfile->CONFIG->applicationname; + foreach ($xmlfile->MODULES as $mod) { + $path = false; + $module = (string)$mod->moduleid; + + if (file_exists("custom/{$customId}/modules/{$module}/xml/menu.xml")) { + $path = "custom/{$customId}/modules/{$module}/xml/menu.xml"; + } else if (file_exists("modules/{$module}/xml/menu.xml")) { + $path = "modules/{$module}/xml/menu.xml"; + } + if ($path) { + $xmlfile = simplexml_load_file($path); + foreach ($xmlfile->MENU as $value) { + $id = (string) $value->id; + + $label = defined((string)$value->libconst) ? constant((string)$value->libconst) : (string)$value->libconst; + + $modulesServices['menuList'][] = [ + 'id' => (string) $value->id, + 'label' => $label, + 'link' => (string) $value->url, + 'icon' => (string)$value->style, + 'angular' => empty((string)$value->angular) ? 'false' : (string)$value->angular + ]; + + } + } + } + return $modulesServices; + } + + public static function getApplicationAdministrationMenuByUserServices(array $aArgs = []) + { + ValidatorModel::notEmpty($aArgs, ['userServices']); + ValidatorModel::arrayType($aArgs, ['userServices']); + + $customId = CoreConfigModel::getCustomId(); + + if (file_exists("custom/{$customId}/apps/maarch_entreprise/xml/menu.xml")) { + $path = "custom/{$customId}/apps/maarch_entreprise/xml/menu.xml"; + } else { + $path = 'apps/maarch_entreprise/xml/menu.xml'; + } + + $modulesServices = []; + + $xmlfile = simplexml_load_file($path); + foreach ($xmlfile->MENU as $value) { + if (in_array((string) $value->id, $aArgs['userServices'])) { + + $label = defined((string)$value->libconst) ? constant((string)$value->libconst) : (string)$value->libconst; + + $modulesServices['menuList'][] = [ + 'id' => (string) $value->id, + 'label' => $label, + 'link' => (string) $value->url, + 'icon' => (string)$value->style, + 'angular' => empty((string)$value->angular) ? 'false' : (string)$value->angular + ]; + } + } + if (file_exists("custom/{$customId}/apps/maarch_entreprise/xml/config.xml")) { + $path = "custom/{$customId}/apps/maarch_entreprise/xml/config.xml"; + } else { + $path = 'apps/maarch_entreprise/xml/config.xml'; + } + $xmlfile = simplexml_load_file($path); + $modulesServices['applicationName'] = $xmlfile->CONFIG->applicationname; + foreach ($xmlfile->MODULES as $mod) { + $path = false; + $module = (string)$mod->moduleid; + + if (file_exists("custom/{$customId}/modules/{$module}/xml/menu.xml")) { + $path = "custom/{$customId}/modules/{$module}/xml/menu.xml"; + } else if (file_exists("modules/{$module}/xml/menu.xml")) { + $path = "modules/{$module}/xml/menu.xml"; + } + if ($path) { + $xmlfile = simplexml_load_file($path); + foreach ($xmlfile->MENU as $value) { + $id = (string) $value->id; + + if (in_array((string) $value->id, $aArgs['userServices'])) { + + $label = defined((string)$value->libconst) ? constant((string)$value->libconst) : (string)$value->libconst; + + $modulesServices['menuList'][] = [ + 'id' => (string) $value->id, + 'label' => $label, + 'link' => (string) $value->url, + 'icon' => (string)$value->style, + 'angular' => empty((string)$value->angular) ? 'false' : (string)$value->angular + ]; + } + } + } + } + return $modulesServices; + } + public static function getAdministrationServicesByUserId(array $aArgs = []) { ValidatorModel::notEmpty($aArgs, ['userId']); @@ -157,6 +290,7 @@ class ServiceModelAbstract } $administration = []; + $administration['menu'] = ServiceModel::getApplicationAdministrationMenuByUserServices(['userServices' => $servicesStoredInDB]); $administration['application'] = ServiceModel::getApplicationAdministrationServicesByUserServices(['userServices' => $servicesStoredInDB]); $administration['modules'] = ServiceModel::getModulesAdministrationServicesByUserServices(['userServices' => $servicesStoredInDB]); diff --git a/core/Models/UserModelAbstract.php b/core/Models/UserModelAbstract.php index 65be101c1c8ea335cdbb268662e7fffb5fb4c4f9..2c7c25d5eccd482a76f3ecdedb2441c43fd444a0 100755 --- a/core/Models/UserModelAbstract.php +++ b/core/Models/UserModelAbstract.php @@ -484,9 +484,9 @@ class UserModelAbstract ValidatorModel::stringType($aArgs, ['userId']); $aGroups = DatabaseModel::select([ - 'select' => ['usergroup_content.group_id', 'usergroups.group_desc', 'usergroup_content.primary_group', 'usergroup_content.role'], - 'table' => ['usergroup_content, usergroups'], - 'where' => ['usergroup_content.group_id = usergroups.group_id', 'usergroup_content.user_id = ?'], + 'select' => ['usergroup_content.group_id', 'usergroups.group_desc', 'usergroup_content.primary_group', 'usergroup_content.role', 'security.maarch_comment'], + 'table' => ['usergroup_content, usergroups, security'], + 'where' => ['usergroup_content.group_id = usergroups.group_id', 'usergroup_content.user_id = ?','usergroups.group_id = security.group_id'], 'data' => [$aArgs['userId']] ]); @@ -541,7 +541,7 @@ class UserModelAbstract return true; } - public static function deactivateAbsenceById(array $aArgs = []) + public static function desactivateAbsenceById(array $aArgs = []) { ValidatorModel::notEmpty($aArgs, ['id']); ValidatorModel::intVal($aArgs, ['id']); diff --git a/core/Test/ResControllerTest.php b/core/Test/ResControllerTest.php index f9cc616d6b69972577cea81a4b1ae8a4f9b9de2b..6ed1101d217785d738725e2085b8ac0d5a2a85d0 100755 --- a/core/Test/ResControllerTest.php +++ b/core/Test/ResControllerTest.php @@ -227,7 +227,7 @@ class ResControllerTest extends TestCase $response = new \Slim\Http\Response(); $response = $action->create($request, $response, $aArgs); //print_r($response);exit; - $this->assertGreaterThan(1, json_decode($response->getBody())[0]); + $this->assertGreaterThan(1, json_decode($response->getBody())->resId); } public function testDeleteRes() diff --git a/core/Test/ResExtControllerTest.php b/core/Test/ResExtControllerTest.php index 51a8866bf9b5a87f7a2e63df1679831938e38256..36b3c4b8d4a9af4c8991a5b436bb64144101d66d 100755 --- a/core/Test/ResExtControllerTest.php +++ b/core/Test/ResExtControllerTest.php @@ -110,7 +110,7 @@ class ResExtControllerTest extends TestCase $response = new \Slim\Http\Response(); $response = $action->create($request, $response, $aArgs); - $this->assertTrue(json_decode($response->getBody())[0]); + $this->assertTrue(json_decode($response->getBody())->status); $this->deleteResArtefact($resId); } diff --git a/core/Test/StatusControllerTest.php b/core/Test/StatusControllerTest.php index 236b9fab859feb3de26bdeeed3376a9a824f596a..3171f4df1573c38df0e8248e664c8afc27f4e8e2 100755 --- a/core/Test/StatusControllerTest.php +++ b/core/Test/StatusControllerTest.php @@ -96,7 +96,7 @@ class StatusControllerTest extends TestCase $this->assertInternalType("int", $value->identifier); } - $this->assertNotNull($responseBody->lang); + //$this->assertNotNull($responseBody->lang); $elem = $responseBody->statusList; end($elem); @@ -185,7 +185,8 @@ class StatusControllerTest extends TestCase $response = $status->delete($request, new \Slim\Http\Response(), ['identifier'=> $lastIdentifier]); - $this->assertSame((string)$response->getBody(), '[true]'); + //$this->assertSame((string)$response->getBody(), '[true]'); + $this->assertRegexp('/statuses/', (string)$response->getBody()); } public function testGetNewInformations() @@ -199,6 +200,6 @@ class StatusControllerTest extends TestCase $responseBody = json_decode((string)$response->getBody()); $this->assertNotNull($responseBody->statusImages); - $this->assertNotNull($responseBody->lang); + //$this->assertNotNull($responseBody->lang); } } diff --git a/core/class/class_db_pdo.php b/core/class/class_db_pdo.php index cd56d9441cc38d706f41be8a68289e336b360e1a..5208171c977f0a0f6f0e081e06ddacadd8d4f85d 100755 --- a/core/class/class_db_pdo.php +++ b/core/class/class_db_pdo.php @@ -431,14 +431,23 @@ class Database extends functions ' ' . $limit_clause; if ($_SESSION['config']['databasetype'] == 'ORACLE') { - $query = 'SELECT' . + /*$query = 'SELECT' . ' ' . $select_opts . ' ' . $select_expr . ' FROM ' . $table_refs . ' WHERE ' . $where_def . ' ' . $other_clauses . ' ' . $limit_clause . - ' ' . $order_by; + ' ' . $order_by;*/ + $query = 'SELECT * FROM (SELECT' . + ' ' . $select_opts . + ' ' . $select_expr . + ' FROM ' . $table_refs . + ' WHERE ' . $where_def . + ' ' . $other_clauses . + // ' ' . $limit_clause . + ' ' . $order_by . + ') WHERE ' . $limit_clause; } else { $query = 'SELECT' . ' ' . $select_opts . diff --git a/core/class/docservers_controler.php b/core/class/docservers_controler.php index 489d19a23327b5a222be1f64d5951f77708e8dbc..7cb9b491ff3f0a84f72dd04e01d49e0c7b85ee3a 100755 --- a/core/class/docservers_controler.php +++ b/core/class/docservers_controler.php @@ -1539,7 +1539,8 @@ class docservers_controler $docserverTypeObject = $docserverTypeControler->get( $docserverObject->docserver_type_id ); - if (!file_exists($file)) { + if (!file_exists($file) || empty($adr[0][$cptDocserver]['path']) || empty($adr[0][$cptDocserver]['filename'])) { + $concatError .= _FILE_NOT_EXISTS_ON_THE_SERVER . ' : ' . $file . '||'; $history->add( diff --git a/core/manage_action.php b/core/manage_action.php index af48fa8dc9b9dfc5ad34040edf61490cc379f3ad..f636022f0a563f5f36dc032a2faf8603b5e5872b 100755 --- a/core/manage_action.php +++ b/core/manage_action.php @@ -141,7 +141,7 @@ if($_POST['req'] == 'valid_form' && !empty($_POST['action_id']) && isset($_POST[ } } elseif(trim($_POST['req']) == 'change_status' && !empty($_POST['values']) && !empty($_POST['new_status']) && !empty($_POST['table'])){ - $stmt = $db->query("select id from status where id = ?", array($_POST['new_status'])); + $stmt = $db->query("select id, label_status from status where id = ?", array($_POST['new_status'])); $lineStatus = $stmt->fetchObject(); if ($lineStatus->id <> '') { $arr_id = explode(',', $_POST['values']); @@ -163,6 +163,12 @@ elseif(trim($_POST['req']) == 'change_status' && !empty($_POST['values']) && !em echo "{status : 1, error_txt : '".addslashes(_ERROR_WITH_STATUS." ".functions::xssafe($query_str))."'}"; exit(); } + require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_history.php"); + $hist = new history(); + $hist->add( + $_POST['table'], + $arr_id[$i], 'ACTION#', 'resadd', + _DOC_CREATED_WITH_STATUS . ' : '. $lineStatus->label_status, $_SESSION['config']['databasetype'], 'apps'); } } echo json_encode(['status' => 0, 'error_txt' => _STATUS_UPDATED.' : '.functions::xssafe($_POST['new_status']) ]); @@ -435,6 +441,9 @@ else if(empty($_POST['values']) || !isset($_POST['action_id']) || empty($_POST[' } $_SESSION['info'] = $what . ' '; $_SESSION['cpt_info_basket'] = 0; + if($_POST['module'] == 'null'){ + $_POST['module'] = ''; + } $hist->add( $_POST['table'], $arr_res[$i],'ACTION#'.$id_action, $id_action, diff --git a/install/class/Class_Install.php b/install/class/Class_Install.php index 15705c123e27b1e9e4609f6e8e7e513893405add..73240400528ec17035c52f02ac4b4ca605318444 100755 --- a/install/class/Class_Install.php +++ b/install/class/Class_Install.php @@ -2147,7 +2147,8 @@ class Install extends functions $db = new Database(); $query = "UPDATE users SET password=? WHERE user_id='superadmin'"; - $db->query($query, [\Core\Models\SecurityModel::getPasswordHash($newPass)]); + $sec = new security(); + $db->query($query, [$sec->getPasswordHash($newPass)]); } function copy_dir($dir2copy, $dir_paste, $excludeExt=false) diff --git a/install/scripts/password.php b/install/scripts/password.php index 8fd6e535c6c37fe39ac8692d020d9d11175269f2..22e55f606bae3b025407f9cce0d838f735156b4d 100755 --- a/install/scripts/password.php +++ b/install/scripts/password.php @@ -32,14 +32,14 @@ include_once '../../core/init.php'; require_once('install/class/Class_Install.php'); $Class_Install = new Install; - //CONTROLLER - if (!isset($_REQUEST['newSuperadminPass']) || empty($_REQUEST['newSuperadminPass'])) { + $trimmedPassword=rtrim($_REQUEST['newSuperadminPass']); + if (!isset($_REQUEST['newSuperadminPass']) || empty($trimmedPassword)) { header("Location: ../error.php?error=badForm"); exit; } - - $Class_Install->setSuperadminPass( + $resp=$Class_Install->setSuperadminPass( $_REQUEST['newSuperadminPass'] ); + - header("Location: ../index.php?step=resume"); + header("Location: ../index.php?step=config"); \ No newline at end of file diff --git a/install/view/password_view.php b/install/view/password_view.php index 86b6c7aa43235674b415256c408141c571dd8b1b..04be8f89a1a2bc8d4793ebc37d89b51651fd4818 100755 --- a/install/view/password_view.php +++ b/install/view/password_view.php @@ -74,7 +74,7 @@ <h6> <?php echo _PASSWORD_EXP;?> </h6> - <form action="scripts/password.php" method="post"> + <form action="scripts/password.php" method="post" id="newAdminPassForm" name="newAdminPassForm"> <table> <tr> <td> @@ -120,7 +120,7 @@ </a> </div> <div style="float: right;" class="nextButton" id="next"> - <a href="#" onClick="goTo('index.php?step=config');" id="okAdminPass" style="display: none;"> + <a href="#" onClick="document.getElementById('newAdminPassForm').submit();" id="okAdminPass" style="display: none;"> <?php echo _NEXT_INSTALL;?> </a> </div> diff --git a/modules/attachments/view_attachment.php b/modules/attachments/view_attachment.php index 937f9fab28cb887d1e67c9888ec17c31aa3ed0d8..bd5d3bb799fc49b3b1b2fb1d518ccc550ec7fafc 100755 --- a/modules/attachments/view_attachment.php +++ b/modules/attachments/view_attachment.php @@ -92,7 +92,7 @@ if (! empty($_SESSION['error'])) { $_SESSION['collection_id_choice'], $resIdMaster ); - $table = $sec->retrieve_table_from_coll($collId); + $table = $sec->retrieve_view_from_coll_id($collId); $stmt = $db->query( "SELECT res_id FROM " . $table . " WHERE res_id = ? ".$where2,array($resIdMaster)); diff --git a/modules/avis/send_docs_to_recommendation.php b/modules/avis/send_docs_to_recommendation.php index 86f07e35a7508b3418c3af8a33e39015850dc0c0..98b82f03c6113a2a41f16b480f95233d4299cb49 100755 --- a/modules/avis/send_docs_to_recommendation.php +++ b/modules/avis/send_docs_to_recommendation.php @@ -132,12 +132,12 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module } } - $frm_str .='<b>'._RECOMMENDATION_LIMIT_DATE.':</b><br/>'; + $frm_str .='<b>'._RECOMMENDATION_LIMIT_DATE.' <span class="red_asterisk"><i class="fa fa-star"></i></span> :</b> <br/>'; $frm_str .= '<input name="recommendation_limit_date_tr" type="text" ' . 'id="recommendation_limit_date_tr" value="" placeholder="JJ-MM-AAAA" onfocus="checkRealDateAvis();" onChange="checkRealDateAvis();" onclick="clear_error(\'frm_error_' . $actionId . '\');showCalender(this);" onblur="document.getElementById(\'recommendation_limit_date\').value=document.getElementById(\'recommendation_limit_date_tr\').value;"/>'; $frm_str .='<br/>'; - $frm_str .='<br/><b>'._RECOMMENDATION_NOTE.':</b><br/>'; + $frm_str .='<br/><b>'._RECOMMENDATION_NOTE.' :</b><br/>'; $frm_str .= '<select name="templateNotes" id="templateNotes" style="width:98%;margin-bottom: 10px;background-color: White;border: 1px solid #999;color: #666;text-align: left;" ' . 'onchange="addTemplateToNote($(\'templateNotes\').value, \'' . $_SESSION['config']['businessappurl'] . 'index.php?display=true' @@ -195,6 +195,15 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module $_SESSION['action_error'] = _NOTE. " " . _MANDATORY; return false; } + + $d = DateTime::createFromFormat('d-m-Y', $recommendation_limit_date); + + if ($d && $d->format('d-m-Y') === $recommendation_limit_date) { + } else { + $_SESSION['action_error'] = _RECOMMENDATION_LIMIT_DATE. " " . _WRONG_FORMAT; + return false; + } + return true; } diff --git a/modules/basket/Models/BasketsModelAbstract.php b/modules/basket/Models/BasketsModelAbstract.php index 1c05a64bca7f322ee48da73d2ef6a26b88e857a9..7d1f2edc4d189505c1d15a9b2eb01455dfea817e 100755 --- a/modules/basket/Models/BasketsModelAbstract.php +++ b/modules/basket/Models/BasketsModelAbstract.php @@ -103,6 +103,7 @@ class BasketsModelAbstract $aBaskets = DatabaseModel::select([ 'select' => ['groupbasket.basket_id', 'group_id', 'basket_name', 'basket_desc'], 'table' => ['groupbasket, baskets'], + 'debug' => ['true'], 'where' => ['group_id in (?)', 'groupbasket.basket_id = baskets.basket_id'], 'data' => [$groupIds], 'order_by' => ['group_id, basket_order, basket_name'] @@ -111,6 +112,14 @@ class BasketsModelAbstract foreach ($aBaskets as $key => $value) { $aBaskets[$key]['is_virtual'] = 'N'; $aBaskets[$key]['basket_owner'] = $aArgs['userId']; + $aBaskets2 = DatabaseModel::select([ + 'select' => ['new_user'], + 'table' => ['user_abs'], + 'where' => ['user_abs = ?', 'basket_id = ?'], + 'data' => [$aArgs['userId'],$value['basket_id']], + ]); + $aBaskets[$key]['userToDisplay'] = UserModel::getLabelledUserById(['userId' => $aBaskets2[0]['new_user']]); + $aBaskets[$key]['enabled'] = true; } $aBaskets = array_merge($aBaskets, BasketsModel::getAbsBasketsByUserId(['userId' => $aArgs['userId']])); } diff --git a/modules/basket/class/class_modules_tools_Abstract.php b/modules/basket/class/class_modules_tools_Abstract.php index e4d871ee32b3e7d1e5cd91c91f80e927c8b2e28c..078743e28ca85022866acf2bd33eb90447e3db25 100755 --- a/modules/basket/class/class_modules_tools_Abstract.php +++ b/modules/basket/class/class_modules_tools_Abstract.php @@ -679,7 +679,6 @@ abstract class basket_Abstract extends Database strtoupper($mode) == 'PAGE_USE' && $_SESSION['current_basket']['actions'][$i]['PAGE_USE'] == 'Y' && $testWhere && strtoupper($resId) != 'NONE' - && ($_SESSION['current_basket']['actions'][$i]['id'] <> 'IndexingBasket') ) { $where = ' where res_id = ' . $resId; if (!empty($_SESSION['current_basket']['actions'][$i]['WHERE'])) { @@ -689,7 +688,7 @@ abstract class basket_Abstract extends Database if ($stmt->rowCount() > 0) { $arr[] = ['VALUE' => $_SESSION['current_basket']['actions'][$i]['ID'], 'LABEL' => $_SESSION['current_basket']['actions'][$i]['LABEL']]; } - } else if (strtoupper($mode) == 'PAGE_USE' && $_SESSION['current_basket']['actions'][$i]['PAGE_USE'] == 'Y' && !$testWhere) { + } else if (strtoupper($mode) == 'PAGE_USE' && $_SESSION['current_basket']['actions'][$i]['PAGE_USE'] == 'Y') { $arr[] = ['VALUE' => $_SESSION['current_basket']['actions'][$i]['ID'], 'LABEL' => $_SESSION['current_basket']['actions'][$i]['LABEL']]; } else if (strtoupper($mode) == 'MASS_USE' && $_SESSION['current_basket']['actions'][$i]['MASS_USE'] == 'Y') { // If "MASS_USE" adding the actions in the array diff --git a/modules/content_management/dist/DisCM.jar b/modules/content_management/dist/DisCM.jar deleted file mode 100755 index c00f00b7160be83dc8ccbe2c060041a0cbfe1170..0000000000000000000000000000000000000000 Binary files a/modules/content_management/dist/DisCM.jar and /dev/null differ diff --git a/modules/content_management/dist/lib/commons-logging-1.2.jar b/modules/content_management/dist/lib/commons-logging-1.2.jar index 1fa460f3a6bd63b919a1f6d5cc831714fdf175c4..f0776f6f44b920c8511fe1922d36cdb02e517b27 100755 Binary files a/modules/content_management/dist/lib/commons-logging-1.2.jar and b/modules/content_management/dist/lib/commons-logging-1.2.jar differ diff --git a/modules/content_management/dist/lib/httpclient-4.5.2.jar b/modules/content_management/dist/lib/httpclient-4.5.2.jar index d08f4dbc92f1bf45dd04e876228d31a3118e464c..8cc0a013a46e3962bc21b4ea8d70b32dcfb6a4cd 100755 Binary files a/modules/content_management/dist/lib/httpclient-4.5.2.jar and b/modules/content_management/dist/lib/httpclient-4.5.2.jar differ diff --git a/modules/content_management/dist/lib/httpclient-cache-4.5.2.jar b/modules/content_management/dist/lib/httpclient-cache-4.5.2.jar index d3c0d2d92da69bd20aef7fb0eadf386189da7c1e..a570b724ee456345e707063c915994d0c3ab7625 100755 Binary files a/modules/content_management/dist/lib/httpclient-cache-4.5.2.jar and b/modules/content_management/dist/lib/httpclient-cache-4.5.2.jar differ diff --git a/modules/content_management/dist/lib/httpclient-win-4.5.2.jar b/modules/content_management/dist/lib/httpclient-win-4.5.2.jar index 065f01e509a1b861813d1300141e80c7be765a99..e0459fad426482ecdd3436cd99c87eac039e84b2 100755 Binary files a/modules/content_management/dist/lib/httpclient-win-4.5.2.jar and b/modules/content_management/dist/lib/httpclient-win-4.5.2.jar differ diff --git a/modules/content_management/dist/lib/httpcore-4.4.4.jar b/modules/content_management/dist/lib/httpcore-4.4.4.jar index 022dab7456cd0ac9fc48a8ece47aa5d149068a85..cfb54f35dcd915585eb2942bbe7487bafb2cd0ac 100755 Binary files a/modules/content_management/dist/lib/httpcore-4.4.4.jar and b/modules/content_management/dist/lib/httpcore-4.4.4.jar differ diff --git a/modules/content_management/dist/lib/plugin.jar b/modules/content_management/dist/lib/plugin.jar index 504eb7e799ef2d9e743a7e00449f3467b8a78c4c..047d55b4821c8bca44d964317f7a1382ed598c35 100755 Binary files a/modules/content_management/dist/lib/plugin.jar and b/modules/content_management/dist/lib/plugin.jar differ diff --git a/modules/content_management/dist/maarchCM.jar b/modules/content_management/dist/maarchCM.jar index 506116032c1743315a17f4104bd590226c9c763e..953b1c4713b6b8f9a2de1186619da413523e1d3f 100755 Binary files a/modules/content_management/dist/maarchCM.jar and b/modules/content_management/dist/maarchCM.jar differ diff --git a/modules/content_management/dist/maarchCM_sans_signature.jar b/modules/content_management/dist/maarchCM_sans_signature.jar deleted file mode 100755 index 7b0a215f47657450035179a077ccf9dfc6870110..0000000000000000000000000000000000000000 Binary files a/modules/content_management/dist/maarchCM_sans_signature.jar and /dev/null differ diff --git a/modules/content_management/dist/not_signed/lib/commons-logging-1.2.jar b/modules/content_management/dist/not_signed/lib/commons-logging-1.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..1fa460f3a6bd63b919a1f6d5cc831714fdf175c4 Binary files /dev/null and b/modules/content_management/dist/not_signed/lib/commons-logging-1.2.jar differ diff --git a/modules/content_management/dist/not_signed/lib/httpclient-4.5.2.jar b/modules/content_management/dist/not_signed/lib/httpclient-4.5.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..d08f4dbc92f1bf45dd04e876228d31a3118e464c Binary files /dev/null and b/modules/content_management/dist/not_signed/lib/httpclient-4.5.2.jar differ diff --git a/modules/content_management/dist/not_signed/lib/httpclient-cache-4.5.2.jar b/modules/content_management/dist/not_signed/lib/httpclient-cache-4.5.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..d3c0d2d92da69bd20aef7fb0eadf386189da7c1e Binary files /dev/null and b/modules/content_management/dist/not_signed/lib/httpclient-cache-4.5.2.jar differ diff --git a/modules/content_management/dist/not_signed/lib/httpclient-win-4.5.2.jar b/modules/content_management/dist/not_signed/lib/httpclient-win-4.5.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..065f01e509a1b861813d1300141e80c7be765a99 Binary files /dev/null and b/modules/content_management/dist/not_signed/lib/httpclient-win-4.5.2.jar differ diff --git a/modules/content_management/dist/not_signed/lib/httpcore-4.4.4.jar b/modules/content_management/dist/not_signed/lib/httpcore-4.4.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..022dab7456cd0ac9fc48a8ece47aa5d149068a85 Binary files /dev/null and b/modules/content_management/dist/not_signed/lib/httpcore-4.4.4.jar differ diff --git a/modules/content_management/dist/not_signed/lib/plugin.jar b/modules/content_management/dist/not_signed/lib/plugin.jar new file mode 100644 index 0000000000000000000000000000000000000000..280df7212897d44db75d844f52e2e5019771ce61 Binary files /dev/null and b/modules/content_management/dist/not_signed/lib/plugin.jar differ diff --git a/modules/content_management/dist/DisCM_sans_signature.jar b/modules/content_management/dist/not_signed/maarchCM.jar old mode 100755 new mode 100644 similarity index 88% rename from modules/content_management/dist/DisCM_sans_signature.jar rename to modules/content_management/dist/not_signed/maarchCM.jar index 420bfb620f0b69d0b7aad211d0a6e7cc1909597d..8f864e0297724367de89501e6e16561eb33cbb41 Binary files a/modules/content_management/dist/DisCM_sans_signature.jar and b/modules/content_management/dist/not_signed/maarchCM.jar differ diff --git a/modules/content_management/dist/src/FileManager.java b/modules/content_management/dist/src/FileManager.java index 3b7eebddca7fd3280da9ca3594cd6748e01f03cb..aa2d592950e75b96023cc0acb55fa66cc95b7b1e 100755 --- a/modules/content_management/dist/src/FileManager.java +++ b/modules/content_management/dist/src/FileManager.java @@ -129,7 +129,7 @@ public class FileManager { AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws IOException { if ("win".equals(os)) { - if (fileToLaunch.contains(".odt") || fileToLaunch.contains(".ods")) { + if ((fileToLaunch.contains(".odt") || fileToLaunch.contains(".ods")) || ("".equals(pathToFileToLaunch))) { //out.write("start /WAIT SOFFICE.exe -env:UserInstallation=file:///" // + pathToFileToLaunch.replace("\\", "/") + " \"" + pathToFileToLaunch + fileToLaunch + "\""); out.write("start /WAIT SOFFICE.exe \"-env:UserInstallation=file:///" + pathToFileToLaunch.replace("\\", "/") + idApplet +"/\" \"" + pathToFileToLaunch + fileToLaunch + "\""); @@ -139,7 +139,8 @@ public class FileManager { } else if ("mac".equals(os)) { out.write("open -W " + pathToFileToLaunch + fileToLaunch); } else if ("linux".equals(os)) { - out.write("libreoffice -env:UserInstallation=file://" + pathToFileToLaunch + idApplet +"/ " + pathToFileToLaunch + fileToLaunch + " || ooffice " + pathToFileToLaunch + fileToLaunch +"& wait"); + //out.write("libreoffice -env:UserInstallation=file://" + pathToFileToLaunch + idApplet +"/ " + pathToFileToLaunch + fileToLaunch + " || ooffice " + pathToFileToLaunch + fileToLaunch +"&wait"); + out.write("libreoffice -env:UserInstallation=file://" + pathToFileToLaunch + idApplet +"/ " + pathToFileToLaunch + fileToLaunch + "&wait"); } out.close(); File file = new File(pathToBatFile); @@ -275,6 +276,28 @@ public class FileManager { WinRegistry.HKEY_LOCAL_MACHINE, //HKEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" + program, //Key ""); + + if (path != null && !"soffice.exe".equals(program.toLowerCase())) { + int index; + String olderVersion = null; + boolean isOlderOffice = false; + + for (index = 7; index <= 12; ++index) + { + olderVersion = WinRegistry.readString ( + WinRegistry.HKEY_LOCAL_MACHINE, //HKEY + "Software\\Microsoft\\Office\\"+index+".0\\Word", //Key + ""); + System.out.println("Older version of Office ? : " + olderVersion); + if(olderVersion != null){ + isOlderOffice = true; + } + } + if(isOlderOffice == true){ + path = null; + } + } + return "\"" + path + "\""; } diff --git a/modules/content_management/dist/src/MaarchCM.java b/modules/content_management/dist/src/MaarchCM.java index f92c1c0fef3c4bab137563352f221ebef8733fa7..24ef49333a1e68717f9d562396b63f3c9f2919e2 100755 --- a/modules/content_management/dist/src/MaarchCM.java +++ b/modules/content_management/dist/src/MaarchCM.java @@ -96,6 +96,8 @@ public class MaarchCM { public MyLogger logger; public FileManager fM; public String fileToEdit; + public String editMode; + public List<String> fileToDelete = new ArrayList<String>(); @@ -323,6 +325,7 @@ public class MaarchCM { public void createPDF(String docxFile, String directory, boolean isUnix) { try { + System.out.println("mode ! : "+editMode); boolean conversion = true; String cmd = ""; if (docxFile.contains(".odt") || docxFile.contains(".ods") || docxFile.contains(".ODT") || docxFile.contains(".ODS")) { @@ -339,8 +342,12 @@ public class MaarchCM { if (useExeConvert.equals("false")) { if (isUnix) { cmd = "libreoffice -env:UserInstallation=file://"+userLocalDirTmp+idApplet+"_conv\\ --headless --convert-to pdf --outdir \"" + userLocalDirTmp.substring(0, userLocalDirTmp.length() - 1) + "\" \"" + docxFile + "\""; - } else { - cmd = "cmd /C c:\\Windows\\System32\\cscript \"" + vbsPath + "\" \"" + docxFile + "\" /nologo \r\n"; + } else if(editMode.equals("libreoffice")){ + String convertProgram; + convertProgram = fM.findPathProgramInRegistry("soffice.exe"); + cmd = convertProgram + " \"-env:UserInstallation=file:///"+userLocalDirTmp.replace("\\", "/")+idApplet+"_conv/\" --headless --convert-to pdf --outdir \"" + userLocalDirTmp.substring(0, userLocalDirTmp.length() - 1) + "\" \"" + docxFile + "\" \r\n"; + }else{ + cmd = "cmd /C c:\\Windows\\System32\\cscript \"" + vbsPath + "\" \"" + docxFile + "\" /nologo \r\n"; } } else { @@ -481,7 +488,7 @@ public class MaarchCM { System.out.println("----------BEGIN EDIT OBJECT---------- LGI by Maarch and DIS 22/01/2017"); System.out.println("----------BEGIN LOCAL DIR TMP IF NOT EXISTS----------"); - String os = System.getProperty("os.name").toLowerCase(); + os = System.getProperty("os.name").toLowerCase(); boolean isUnix = os.contains("nix") || os.contains("nux"); boolean isWindows = os.contains("win"); boolean isMac = os.contains("mac"); @@ -728,24 +735,51 @@ public class MaarchCM { Process proc; logger.log("LAUNCH THE EDITOR !", Level.INFO); + if ("linux".equals(os) || "mac".equals(os)) { + editMode = "libreoffice"; proc = fM.launchApp(appPath); } else { logger.log("FILE TO EDIT : " + userLocalDirTmp + fileToEdit, Level.INFO); String programName; programName = fM.findGoodProgramWithExt(fileExtension); - logger.log("PROGRAM NAME TO EDIT : " + programName, Level.INFO); String pathProgram; pathProgram = fM.findPathProgramInRegistry(programName); - logger.log("PROGRAM PATH TO EDIT : " + pathProgram, Level.INFO); String options; - options = fM.findGoodOptionsToEdit(fileExtension); + System.out.println("check prog name : "+programName); + System.out.println("check path : "+pathProgram); + if("soffice.exe".equals(programName)){ + if("\"null\"".equals(pathProgram)){ + System.out.println(programName+" not found! switch to microsoft office..."); + programName = "office.exe"; + pathProgram = fM.findPathProgramInRegistry(programName); + options = fM.findGoodOptionsToEdit(fileExtension); + }else{ + options = "\"-env:UserInstallation=file:///" + userLocalDirTmp.replace("\\", "/") + idApplet +"/\" "; + } + }else{ + if("\"null\"".equals(pathProgram)){ + System.out.println(programName+" not found! switch to libreoffice..."); + programName = "soffice.exe"; + pathProgram = fM.findPathProgramInRegistry(programName); + options = "\"-env:UserInstallation=file:///" + userLocalDirTmp.replace("\\", "/") + idApplet +"/\" "; + }else{ + options = fM.findGoodOptionsToEdit(fileExtension); + } + } + + if("soffice.exe".equals(programName)){ + editMode = "libreoffice"; + }else{ + editMode = "office"; + } + logger.log("PROGRAM NAME TO EDIT : " + programName, Level.INFO); logger.log("OPTION PROGRAM TO EDIT " + options, Level.INFO); + logger.log("PROGRAM PATH TO EDIT : " + pathProgram, Level.INFO); + + String pathCommand; - if("".equals(options)){ - options = "\"-env:UserInstallation=file:///" + userLocalDirTmp.replace("\\", "/") + idApplet +"/\" "; - } pathCommand = pathProgram + " " + options + "\"" + userLocalDirTmp + fileToEdit + "\""; logger.log("PATH COMMAND TO EDIT " + pathCommand, Level.INFO); proc = fM.launchApp(pathCommand); diff --git a/modules/content_management/dist/srcDIS/DisCM.java b/modules/content_management/dist/srcDIS/DisCM.java deleted file mode 100755 index 337bccc2759768704e2d3761fa574708bef25b36..0000000000000000000000000000000000000000 --- a/modules/content_management/dist/srcDIS/DisCM.java +++ /dev/null @@ -1,899 +0,0 @@ -/** - * Jdk platform : 1.8 - */ - -/** - * SVN version 141 - */ - -package com.dis; - -//import java.applet.Applet; -import java.io.*; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; -import java.security.PrivilegedActionException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -//import javax.swing.JApplet; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import netscape.javascript.JSException; -import org.apache.http.client.config.CookieSpecs; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.protocol.HttpClientContext; -import org.apache.http.entity.AbstractHttpEntity; -import org.apache.http.impl.client.*; -import org.apache.http.impl.cookie.BasicClientCookie; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; -import netscape.javascript.JSObject; - -import javax.swing.JOptionPane; -import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.message.BasicNameValuePair; - -/** - * DisCM class manages webservices between end user desktop and Maarch - * @author DIS - */ -//public class DisCM extends JApplet { -public class DisCM { - - //INIT PARAMETERS - protected String url; - protected String idApplet; - protected String objectType; - protected String objectTable; - protected String objectId; - protected String cookie; - protected String clientSideCookies; - protected String uniqueId; - protected String convertPdf; - protected String domain; - protected String userLocalDirTmp; - protected String userMaarch; - protected String messageStatus; - static Hashtable messageResult = new Hashtable(); - - //XML PARAMETERS - protected String status; - protected String appPath; - protected String appPath_convert; - protected String fileContent; - protected String fileContentVbs; - protected String vbsPath; - protected String fileContentExe; - protected String useExeConvert; - protected String fileExtension; - protected String error; - protected String endMessage; - protected String os; - protected String fileContentTosend; - protected String pdfContentTosend; - - private final HttpClientContext httpContext = HttpClientContext.create(); - private CloseableHttpClient httpClient; // Apache HttpClient yet to be instantiated - - public MyLogger logger; - public FileManager fM; - public String fileToEdit; - - public List<String> fileToDelete = new ArrayList<String>(); - - - public static void main(String[] args) throws JSException { - DisCM DisCM = new DisCM(); - DisCM.start(args); - } - - /** - * Launch of the JNLP - */ - public void start(String[] args) throws JSException { - - System.out.println("----------BEGIN----------"); - System.out.println("----------ARGUMENTS----------"); - - int index; - - for (index = 0; index < args.length; ++index) - { - System.out.println("args[" + index + "]: " + args[index]); - } - url = args[0]; - objectType = args[1]; - objectTable = args[2]; - objectId = args[3]; - uniqueId = args[4]; - cookie = args[5]; - clientSideCookies = args[6]; - idApplet = args[7]; - userMaarch = args[8]; - convertPdf = args[9]; - - System.out.println("URL : " + url); - System.out.println("OBJECT TYPE : " + objectType); - System.out.println("ID APPLET : " + idApplet); - System.out.println("OBJECT TABLE : " + objectTable); - System.out.println("OBJECT ID : " + objectId); - System.out.println("UNIQUE ID : " + uniqueId); - System.out.println("COOKIE : " + cookie); - System.out.println("CLIENTSIDECOOKIES : " + clientSideCookies); - System.out.println("USERMAARCH : " + userMaarch); - System.out.println("CONVERPDF : " + convertPdf); - System.out.println("----------CONTROL PARAMETERS----------"); - - if ( - isURLInvalid() || - isObjectTypeInvalid() || - isObjectTableInvalid() || - isObjectIdInvalid() || - isCookieInvalid() - ) { - System.out.println("PARAMETERS NOT OK ! END OF APPLICATION"); - //System.exit(0); - try { - //DisCM.getAppletContext().showDocument(new URL("error.html")); - //Go to an appropriate error page - } catch (Exception e) { - //Nothing - } - } - - System.out.println("----------END PARAMETERS----------"); - - if ("empty".equals(uniqueId)) { - uniqueId = null; - } - - if ("empty".equals(clientSideCookies)) { - clientSideCookies = null; - } - - // The following code is to ensure a high level of management for HTTP cookies - BasicCookieStore cookieStore = new BasicCookieStore(); - // Loading the cookie store with the Maarch cookie provided by the server - cookieStore.addCookie(getCookieFromString(cookie)); - if ( - clientSideCookies != null && - clientSideCookies.length() > 0 - ) { - System.out.println("clientSideCookies : " + clientSideCookies); - // Within the whole cookie string returned from JavaScript, cookies are separated by a semicolon followed by a space - // Let's get an array where cookies are stored with a "name=value" pattern - String[] cookies = clientSideCookies.split(";\\s"); - System.out.println("cookies : " + cookies); - // Iterate through the cookie array to retrieve each cookie name ans value and load the cookie store - for (String nameValue : cookies) { - cookieStore.addCookie(getCookieFromString(nameValue)); // Loading the cookie store - } - } - httpContext.setCookieStore(cookieStore); // Assign all the cookies retrieved from JavaScript - // Apply a Cookie policy: https://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html - RequestConfig globalConfig = RequestConfig.custom().setCookieSpec(CookieSpecs.DEFAULT).build(); - - // Pick up the best Apache HttpClient to do the job - // which will allows for the automatic retrieval of the user session Kerberos ticket, - // so this app will be able to properly talk with a proxy - if ("win".equals(os) && WinHttpClients.isWinAuthAvailable()) { - // Instantiation of the Apache HttpClient for Windows 7 - httpClient = WinHttpClients.custom().setDefaultRequestConfig(globalConfig).setDefaultCookieStore(cookieStore).build(); - System.out.println("The Apache HttpClient for Windows 7 was picked up"); - } else { - // Instantiation of the generic Apache HttpClient - HttpClientBuilder httpClientBuilder = HttpClients.custom(); - httpClientBuilder.useSystemProperties(); - httpClientBuilder.setDefaultRequestConfig(globalConfig); - httpClientBuilder.setDefaultCookieStore(cookieStore); - httpClient = httpClientBuilder.build(); - System.out.println("The generic Apache HttpClient was picked up"); - } - - if (httpClient == null) { - System.out.println("NO HTTP CLIENT WAS INSTANTIATED, THE APPLICATION WILL FAIL!"); - } - - try { - editObject(); - //TODO exit of JNLP - //DisCM.destroy(); - //DisCM.stop(); - System.exit(0); - } catch (Exception ex) { - Logger.getLogger(DisCM.class.getName()).log(Level.SEVERE, null, ex); - } - } - - /** - * Controls the url parameter - * @return boolean - */ - private boolean isURLInvalid() { - try { - URL address = new URL(url); // Trying to build a valid URL - address.openConnection().connect(); // Trying to open a valid connection - domain = address.getHost(); // Retrieve the domain used - System.out.println("DOMAIN USED IS: " + domain); - return false; //success - } catch (MalformedURLException e) { - System.out.println("the URL is not a valid form " + url); - } catch (IOException e) { - System.out.println("the connection couldn't be etablished " + url); - } - return true; //default is failure - } - - /** - * Controls the objectType parameter - * @return boolean - */ - private boolean isObjectTypeInvalid() { - Set<String> whiteList = new HashSet<>(); - whiteList.add("template"); - whiteList.add("templateStyle"); - whiteList.add("attachmentVersion"); - whiteList.add("attachmentUpVersion"); - whiteList.add("resource"); - whiteList.add("attachmentFromTemplate"); - whiteList.add("attachment"); - whiteList.add("outgoingMail"); - if (whiteList.contains(objectType)) return false; //success - System.out.println("ObjectType not in the authorized list " + objectType); - return true; //default is failure - } - - /** - * Controls the objectTable parameter - * @return boolean - */ - private boolean isObjectTableInvalid() { - Set<String> whiteList = new HashSet<>(); - whiteList.add("res_letterbox"); - whiteList.add("res_business"); - whiteList.add("res_x"); - whiteList.add("res_attachments"); - whiteList.add("mlb_coll_ext"); - whiteList.add("business_coll_ext"); - whiteList.add("res_version_letterbox"); - whiteList.add("res_version_business"); - whiteList.add("res_version_x"); - whiteList.add("res_view_attachments"); - whiteList.add("res_view"); - whiteList.add("res_view_letterbox"); - whiteList.add("res_view_business"); - whiteList.add("templates"); - if (whiteList.contains(objectTable)) return false; //success - System.out.println("objectTable not in the authorized list " + objectTable); - return true; //default is failure - } - - /** - * Controls the objectId parameter - * @return boolean - */ - private boolean isObjectIdInvalid() { - if (objectId != null && objectId.length() > 0) return false; //success - System.out.println("objectId is null or empty " + objectId); - return true; //default is failure - } - - /** - * Controls the cookie parameter - * @return boolean - */ - private boolean isCookieInvalid() { - if (cookie != null && cookie.length() > 0) return false; //success - System.out.println("cookie is null or empty " + cookie); - return true; //default is failure - } - - /** - * Build a cookie from a String - * @param nameValue - * @return BasicClientCookie - */ - private BasicClientCookie getCookieFromString(String nameValue) { - int separator = nameValue.indexOf('='); // Locating the equal character - String name = nameValue.substring(0, separator); // Getting everything before the equal character - String value = nameValue.substring(separator + 1); // Getting everything after the equal character - BasicClientCookie cookie = new BasicClientCookie(name, value); - cookie.setPath("/"); - cookie.setDomain(domain); - return cookie; - } - - public void createPDF(String docxFile, String directory, boolean isUnix) { - try { - boolean conversion = true; - String cmd = ""; - if (docxFile.contains(".odt") || docxFile.contains(".ods") || docxFile.contains(".ODT") || docxFile.contains(".ODS")) { - logger.log("This is opendocument ! ", Level.INFO); - if (isUnix) { - cmd = "libreoffice -env:UserInstallation=file://"+userLocalDirTmp+idApplet+"_conv/ --headless --convert-to pdf --outdir \"" + userLocalDirTmp.substring(0, userLocalDirTmp.length() - 1) + "\" \"" + docxFile + "\""; - } else { - String convertProgram; - convertProgram = fM.findPathProgramInRegistry("soffice.exe"); - cmd = convertProgram + " \"-env:UserInstallation=file:///"+userLocalDirTmp.replace("\\", "/")+idApplet+"_conv/\" --headless --convert-to pdf --outdir \"" + userLocalDirTmp.substring(0, userLocalDirTmp.length() - 1) + "\" \"" + docxFile + "\" \r\n"; - } - - } else if (docxFile.contains(".doc") || docxFile.contains(".docx") || docxFile.contains(".DOC") || docxFile.contains(".DOCX")) { - if (useExeConvert.equals("false")) { - if (isUnix) { - cmd = "libreoffice -env:UserInstallation=file://"+userLocalDirTmp+idApplet+"_conv\\ --headless --convert-to pdf --outdir \"" + userLocalDirTmp.substring(0, userLocalDirTmp.length() - 1) + "\" \"" + docxFile + "\""; - } else { - cmd = "cmd /C c:\\Windows\\System32\\cscript \"" + vbsPath + "\" \"" + docxFile + "\" /nologo \r\n"; - } - } else { - - StringBuffer buffer = new StringBuffer(docxFile); - buffer.replace(buffer.lastIndexOf("."), buffer.length(), ".pdf"); - String pdfOut = buffer.toString(); - - cmd = "cmd /C \"" + userLocalDirTmp + "Word2Pdf.exe\" \"" + docxFile + "\" \"" + pdfOut + "\" \r\n"; - } - } else { - conversion = false; - } - - if (conversion) { - logger.log("EXEC PATH : " + cmd, Level.INFO); - FileManager fM = new FileManager(); - - Process proc_vbs; - if (isUnix) { - //cmd = "cscript \""+vbsPath+"\" \""+docxFile+"\" /nologo \r\n"; - final Writer outBat; - outBat = new OutputStreamWriter(new FileOutputStream(appPath_convert), "CP850"); - logger.log("--- cmd sh --- " + cmd, Level.INFO); - outBat.write(cmd); - //outBat.write("exit \r\n"); - outBat.close(); - - File myFileBat = new File(appPath_convert); - myFileBat.setReadable(true, false); - myFileBat.setWritable(true, false); - myFileBat.setExecutable(true, false); - - /*String cmd2 = "start /WAIT /MIN "+appPath_convert+" \r\n"; - final Writer outBat2 = new OutputStreamWriter(new FileOutputStream(appPath), "CP850"); - outBat2.write(cmd2); - outBat2.write("exit \r\n"); - outBat2.close();*/ - - /*File myFileBat2 = new File(appPath); - myFileBat2.setReadable(true, false); - myFileBat2.setWritable(true, false); - myFileBat2.setExecutable(true, false);*/ - - final String exec_vbs = "\"" + appPath + "\""; - proc_vbs = fM.launchApp(appPath_convert); - } else { - proc_vbs = fM.launchApp(cmd); - } - proc_vbs.waitFor(); - } - - } catch (Throwable e) { - logger.log("Erreur ! : " + e, Level.SEVERE); - e.printStackTrace(); - } - } - - /** - * Retrieve the xml message from Maarch and parse it - * @param flux_xml xml content message - */ - public void parse_xml(InputStream flux_xml) throws SAXException, IOException, ParserConfigurationException { - logger.log("----------BEGIN PARSE XML----------", Level.INFO); - DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - - try { - Document doc = builder.parse(flux_xml); - messageResult.clear(); - NodeList level_one_list = doc.getChildNodes(); - for (Integer i = 0; i < level_one_list.getLength(); i++) { - NodeList level_two_list = level_one_list.item(i).getChildNodes(); - if ("SUCCESS".equals(level_one_list.item(i).getNodeName())) { - for (Integer j = 0; j < level_one_list.item(i).getChildNodes().getLength(); j++) { - messageResult.put(level_two_list.item(j).getNodeName(), level_two_list.item(j).getTextContent()); - } - messageStatus = "SUCCESS"; - } else if ("ERROR".equals(level_one_list.item(i).getNodeName())) { - for (Integer j = 0; j < level_one_list.item(i).getChildNodes().getLength(); j++) { - messageResult.put(level_two_list.item(j).getNodeName(), level_two_list.item(j).getTextContent()); - } - messageStatus = "ERROR"; - } - } - } catch (SAXException | IOException e) { - - logger.log("ERREUR : Le document n'a pas pu être transféré du coté client. Assurez-vous que le modèle n'est pas corrompu et que la zone de stockage des templates soit correct.", Level.SEVERE); - messageStatus = "ERROR"; - messageResult.put("ERROR", "ERREUR : Le document n'a pas pu être transféré du coté client. Assurez-vous que le modèle n'est pas corrompu et que la zone de stockage des templates soit correct."); - JOptionPane.showMessageDialog(null, "ERREUR ! L'édition de votre document a échoué. Assurez-vous que le modèle n'est pas corrompu et que la zone de stockage des modèles soit correct."); - } - logger.log("----------END PARSE XML----------", Level.INFO); - } - - /** - * Manage the return of program execution - * @param result result of the program execution - */ - public void processReturn(Hashtable result) { - Iterator itValue = result.values().iterator(); - Iterator itKey = result.keySet().iterator(); - while (itValue.hasNext()) { - String value = (String) itValue.next(); - String key = (String) itKey.next(); - logger.log(key + " : " + value, Level.INFO); - if ("STATUS".equals(key)) status = value; - if ("OBJECT_TYPE".equals(key)) objectType = value; - if ("OBJECT_TABLE".equals(key)) objectTable = value; - if ("OBJECT_ID".equals(key)) objectId = value; - if ("UNIQUE_ID".equals(key)) uniqueId = value; - if ("COOKIE".equals(key)) cookie = value; - if ("CLIENTSIDECOOKIES".equals(key)) clientSideCookies = value; - if ("APP_PATH".equals(key)) ; //appPath = value; - if ("FILE_CONTENT".equals(key)) fileContent = value; - if ("FILE_CONTENT_VBS".equals(key)) fileContentVbs = value; - if ("VBS_PATH".equals(key)) vbsPath = value; - if ("FILE_CONTENT_EXE".equals(key)) fileContentExe = value; - if ("USE_EXE_CONVERT".equals(key)) useExeConvert = value; - if ("FILE_EXTENSION".equals(key)) fileExtension = value; - if ("ERROR".equals(key)) error = value; - if ("END_MESSAGE".equals(key)) endMessage = value; - } - //send message error to Maarch if necessary - if (!error.isEmpty()) { - //TODO exit of the JNLP - //destroy(); - //stop(); - System.exit(0); - } - } - - /** - * Main function of the class - * enables you to edit document with the user favorit editor - * @return nothing - * @throws java.lang.Exception - */ - public String editObject() throws Exception, InterruptedException, JSException { - - System.out.println("----------BEGIN EDIT OBJECT---------- LGI by DIS 22/01/2017"); - System.out.println("----------BEGIN LOCAL DIR TMP IF NOT EXISTS----------"); - String os = System.getProperty("os.name").toLowerCase(); - boolean isUnix = os.contains("nix") || os.contains("nux"); - boolean isWindows = os.contains("win"); - boolean isMac = os.contains("mac"); - userLocalDirTmp = System.getProperty("user.home"); - - fM = new FileManager(); - - if (isWindows) { - System.out.println("This is Windows"); - userLocalDirTmp = userLocalDirTmp + "\\maarchTmp\\"; - appPath = userLocalDirTmp + "start.bat"; - appPath_convert = userLocalDirTmp + "conversion_"+idApplet+".bat"; - os = "win"; - } else if (isMac) { - System.out.println("This is Mac"); - userLocalDirTmp = userLocalDirTmp + "/maarchTmp/"; - appPath = userLocalDirTmp + "start.sh"; - appPath_convert = userLocalDirTmp + "conversion_"+idApplet+".sh"; - os = "mac"; - } else if (isUnix) { - System.out.println("This is Unix or Linux"); - userLocalDirTmp = userLocalDirTmp + "/maarchTmp/"; - appPath = userLocalDirTmp + "start.sh"; - appPath_convert = userLocalDirTmp + "conversion_"+idApplet+".sh"; - os = "linux"; - } else { - System.out.println("Your OS is not supported!!"); - } - fileToDelete.add(appPath_convert); - - System.out.println("Create the logger"); - logger = new MyLogger(userLocalDirTmp); - - System.out.println("APP PATH: " + appPath); - System.out.println("----------BEGIN LOCAL DIR TMP IF NOT EXISTS----------"); - - String info = fM.createUserLocalDirTmp(userLocalDirTmp, os); - - if (info == "ERROR") { - logger.log("ERREUR : Permissions insuffisante sur votre répertoire temporaire maarch", Level.SEVERE); - messageStatus = "ERROR"; - messageResult.clear(); - messageResult.put("ERROR", "ERREUR : Permissions insuffisante sur votre répertoire temporaire maarch"); - JOptionPane.showMessageDialog(null, "ERREUR ! Permissions insuffisante sur votre répertoire temporaire maarch."); - processReturn(messageResult); - } - - System.out.println("Create the logger"); - logger = new MyLogger(userLocalDirTmp); - - /*logger.log("Delete thefile if exists", Level.INFO); - FileManager.deleteFilesOnDir(userLocalDirTmp, "thefile");*/ - - logger.log("----------PARAM ----------", Level.INFO); - logger.log("URL : " + url, Level.INFO); - logger.log("OBJECT TYPE : " + objectType, Level.INFO); - logger.log("ID APPLET : " + idApplet, Level.INFO); - logger.log("OBJECT TABLE : " + objectTable, Level.INFO); - logger.log("OBJECT ID : " + objectId, Level.INFO); - logger.log("UNIQUE ID : " + uniqueId, Level.INFO); - logger.log("COOKIE : " + cookie, Level.INFO); - logger.log("CLIENTSIDECOOKIES : " + clientSideCookies, Level.INFO); - logger.log("USERMAARCH : " + userMaarch, Level.INFO); - - logger.log("----------BEGIN OPEN REQUEST----------", Level.INFO); - String urlToSend = url + "?action=editObject&objectType=" + objectType - + "&objectTable=" + objectTable + "&objectId=" + objectId - + "&uniqueId=" + uniqueId; - sendHttpRequest(urlToSend, "none", false); - logger.log("MESSAGE STATUS : " + messageStatus, Level.INFO); - logger.log("MESSAGE RESULT : ", Level.INFO); - processReturn(messageResult); - logger.log("----------END OPEN REQUEST----------", Level.INFO); - - fileToEdit = "thefile_" + idApplet + "." + fileExtension; - - logger.log("----------BEGIN CREATE THE BAT TO LAUNCH IF NECESSARY----------", Level.INFO); - logger.log("create the file : " + appPath, Level.INFO); - fM.createBatFile( - appPath, - userLocalDirTmp, - fileToEdit, - os, - idApplet - ); - logger.log("----------END CREATE THE BAT TO LAUNCH IF NECESSARY----------", Level.INFO); - - if ("ok".equals(status)) { - logger.log("RESPONSE OK", Level.INFO); - - if ("true".equals(convertPdf)) { - logger.log("CREATE FILE IN LOCAL PATH", Level.INFO); - if (useExeConvert.equals("false")) { - logger.log("---------- VBS FILE ----------", Level.INFO); - logger.log(" Path = " + vbsPath, Level.INFO); - if (vbsPath.equals("")) vbsPath = userLocalDirTmp + "DOC2PDF_VBS.vbs"; - boolean isVbsExists = fM.isPsExecFileExists(vbsPath); - if (!isVbsExists) fM.createFile(fileContentVbs, vbsPath); - } else { - boolean isConvExecExists = fM.isPsExecFileExists(userLocalDirTmp + "Word2Pdf.exe"); - if (!isConvExecExists) fM.createFile(fileContentExe, userLocalDirTmp + "Word2Pdf.exe"); - } - } - - logger.log("----------BEGIN EXECUTION OF THE EDITOR----------", Level.INFO); - logger.log("CREATE FILE IN LOCAL PATH", Level.INFO); - fM.createFile(fileContent, userLocalDirTmp + fileToEdit); - fileToDelete.add(userLocalDirTmp + fileToEdit); - - Thread theThread; - theThread = new Thread(new ProcessLoop(this)); - - theThread.start(); - - String actualContent; - fileContentTosend = ""; - do { - theThread.sleep(3000); - File fileTotest = new File(userLocalDirTmp + fileToEdit); - if (fileTotest.canRead()) { - actualContent = FileManager.encodeFile(userLocalDirTmp + fileToEdit); - if (!fileContentTosend.equals(actualContent)) { - fileContentTosend = actualContent; - logger.log("----------[SECURITY BACKUP] BEGIN SEND OF THE OBJECT----------", Level.INFO); - String urlToSave = url + "?action=saveObject&objectType=" + objectType - + "&objectTable=" + objectTable + "&objectId=" + objectId - + "&uniqueId=" + uniqueId + "&step=backup&userMaarch=" + userMaarch; - logger.log("[SECURITY BACKUP] URL TO SAVE : " + urlToSave, Level.INFO); - sendHttpRequest(urlToSave, fileContentTosend, false); - logger.log("[SECURITY BACKUP] MESSAGE STATUS : " + messageStatus, Level.INFO); - } - } else { - logger.log(userLocalDirTmp + fileToEdit + " FILE NOT READABLE !!!!!!", Level.INFO); - } - } - while (theThread.isAlive()); - - theThread.interrupt(); - - logger.log("----------END EXECUTION OF THE EDITOR----------", Level.INFO); - - logger.log("----------BEGIN RETRIEVE CONTENT OF THE OBJECT----------", Level.INFO); - - fileContentTosend = FileManager.encodeFile(userLocalDirTmp + fileToEdit); - - logger.log("----------END RETRIEVE CONTENT OF THE OBJECT----------", Level.INFO); - - if ("true".equals(convertPdf)) { - if ((fileExtension.equalsIgnoreCase("docx") || fileExtension.equalsIgnoreCase("doc") || fileExtension.equalsIgnoreCase("docm") || fileExtension.equalsIgnoreCase("odt") || fileExtension.equalsIgnoreCase("ott"))) { - logger.log("----------CONVERSION PDF----------", Level.INFO); - createPDF(userLocalDirTmp + fileToEdit, userLocalDirTmp, isUnix); - - String pdfFile = userLocalDirTmp + "thefile_" + idApplet + ".pdf"; - - logger.log("----------BEGIN RETRIEVE CONTENT OF THE OBJECT----------", Level.INFO); - if (fM.isPsExecFileExists(pdfFile)) { - pdfContentTosend = FileManager.encodeFile(pdfFile); - fileToDelete.add(pdfFile); - } else { - pdfContentTosend = "null"; - logger.log("ERREUR DE CONVERSION PDF !", Level.WARNING); - JOptionPane.showMessageDialog(null, "Attention ! La conversion PDF a échoué mais le document a bien été transféré."); - } - logger.log("----------END RETRIEVE CONTENT OF THE OBJECT----------", Level.INFO); - - logger.log("---------- FIN CONVERSION PDF----------", Level.INFO); - }else{ - pdfContentTosend = "not allowed"; - logger.log("Conversion not allowed for this extension : " + fileExtension, Level.INFO); - } - } - - - String urlToSave = url + "?action=saveObject&objectType=" + objectType - + "&objectTable=" + objectTable + "&objectId=" + objectId - + "&uniqueId=" + uniqueId + "&idApplet=" + idApplet + "&step=end&userMaarch=" + userMaarch; - logger.log("----------BEGIN SEND OF THE OBJECT----------", Level.INFO); - logger.log("URL TO SAVE : " + urlToSave, Level.INFO); - sendHttpRequest(urlToSave, fileContentTosend, true); - logger.log("MESSAGE STATUS : " + messageStatus, Level.INFO); - logger.log("LAST MESSAGE RESULT : ", Level.INFO); - processReturn(messageResult); - - if ("true".equals(convertPdf)) { - if (pdfContentTosend == "null") { - endMessage = endMessage + " mais la conversion pdf n'a pas fonctionné (le document ne pourra pas être signé)"; - } - } - - logger.log("----------END SEND OF THE OBJECT----------", Level.INFO); - } else { - logger.log("RESPONSE KO", Level.WARNING); - } - logger.log("----------END EDIT OBJECT----------", Level.INFO); - - //delete tmp files - FileManager.deleteSpecificFilesOnDir(fileToDelete); - - //delete env libreoffice instance - File dir_app = new File(userLocalDirTmp+idApplet); - if (dir_app.exists()) { - Path directory = Paths.get(userLocalDirTmp+idApplet); - Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - Files.delete(file); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - Files.delete(dir); - return FileVisitResult.CONTINUE; - } - }); - } - //delete env libreoffice convert instance - File dir_app_conv = new File(userLocalDirTmp+idApplet+"_conv"); - if (dir_app_conv.exists()) { - Path directory = Paths.get(userLocalDirTmp+idApplet+"_conv"); - Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - Files.delete(file); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - Files.delete(dir); - return FileVisitResult.CONTINUE; - } - }); - } - - return "ok"; - } - - /** - * Launch the external program and wait his execution end - * @return boolean - */ - public Boolean launchProcess() throws PrivilegedActionException, InterruptedException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { - Process proc; - - logger.log("LAUNCH THE EDITOR !", Level.INFO); - if ("linux".equals(os) || "mac".equals(os)) { - proc = fM.launchApp(appPath); - } else { - logger.log("FILE TO EDIT : " + userLocalDirTmp + fileToEdit, Level.INFO); - - String programName; - programName = fM.findGoodProgramWithExt(fileExtension); - logger.log("PROGRAM NAME TO EDIT : " + programName, Level.INFO); - String pathProgram; - pathProgram = fM.findPathProgramInRegistry(programName); - logger.log("PROGRAM PATH TO EDIT : " + pathProgram, Level.INFO); - String options; - options = fM.findGoodOptionsToEdit(fileExtension); - logger.log("OPTION PROGRAM TO EDIT " + options, Level.INFO); - String pathCommand; - if("".equals(options)){ - options = "\"-env:UserInstallation=file:///" + userLocalDirTmp.replace("\\", "/") + idApplet +"/\" "; - } - pathCommand = pathProgram + " " + options + "\"" + userLocalDirTmp + fileToEdit + "\""; - logger.log("PATH COMMAND TO EDIT " + pathCommand, Level.INFO); - proc = fM.launchApp(pathCommand); - } - proc.waitFor(); - logger.log("END OF THE PROCESS", Level.INFO); - - return true; - } - - /** - * Send an http request to Maarch - * @param theUrl url to contact Maarch - * @param postRequest the request - * @param endProcess end request - */ - public void sendHttpRequest(String theUrl, final String postRequest, final boolean endProcess) throws UnsupportedEncodingException { - System.out.println("URL request : " + theUrl); - - // Inner class representing the payload to be posted via HTTP - AbstractHttpEntity entity = new AbstractHttpEntity() { - public boolean isRepeatable() { - return false; // must be implemented - } - - public long getContentLength() { - return -1; // must be implemented - } - - public boolean isStreaming() { - return false; // must be implemented - } - - public InputStream getContent() throws IOException { - return new ByteArrayInputStream(postRequest.getBytes()); - } - - public void writeTo(OutputStream out) throws IOException { - System.out.println("METHOD 'WriteTo' WAS CALLED!"); - if (!"none".equals(postRequest)) { - Writer writer = new OutputStreamWriter(out, "UTF-8"); - // Using a StringBuffer rather than multiple "+" operators results in much better performance! - StringBuffer sb = new StringBuffer(); - if ("true".equals(convertPdf)) { - if (endProcess) { - // Prepending "null" saves from testing "if(pdfContentTosend != null)" - if ("null".equalsIgnoreCase(pdfContentTosend)) { - sb.append("fileContent="); - sb.append(fileContentTosend); - sb.append("&fileExtension="); - sb.append(fileExtension); - } else { - sb.append("fileContent="); - sb.append(fileContentTosend); - sb.append("&fileExtension="); - sb.append(fileExtension); - sb.append("&pdfContent="); - sb.append(pdfContentTosend); - } - } else { - sb.append("fileContent="); - sb.append(fileContentTosend); - sb.append("&fileExtension="); - sb.append(fileExtension); - } - } else { - sb.append("fileContent="); - sb.append(fileContentTosend); - sb.append("&fileExtension="); - sb.append(fileExtension); - } - - writer.write(sb.toString()); - writer.flush(); - } - } - }; - HttpPost request = new HttpPost(theUrl); // Construct a HTTP post request - System.out.println("BUILT REQUEST: " + request); - - - // Request parameters and other properties. - List<NameValuePair> params = new ArrayList<NameValuePair>(2); - - if ("true".equals(convertPdf)) { - if (endProcess) { - // Prepending "null" saves from testing "if(pdfContentTosend != null)" - if ("null".equalsIgnoreCase(pdfContentTosend)) { - params.add(new BasicNameValuePair("fileContent", fileContentTosend)); - params.add(new BasicNameValuePair("fileExtension", fileExtension)); - } else { - params.add(new BasicNameValuePair("fileContent", fileContentTosend)); - params.add(new BasicNameValuePair("fileExtension", fileExtension)); - params.add(new BasicNameValuePair("pdfContent", pdfContentTosend)); - } - } else { - params.add(new BasicNameValuePair("fileContent", fileContentTosend)); - params.add(new BasicNameValuePair("fileExtension", fileExtension)); - } - } else { - params.add(new BasicNameValuePair("fileContent", fileContentTosend)); - params.add(new BasicNameValuePair("fileExtension", fileExtension)); - } - - request.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); - System.out.println("FULL REQUEST" + request); - try { - System.out.println("COOKIES TO BE SENT: " + httpContext.getCookieStore().getCookies()); // Show the cookies to be sent - CloseableHttpResponse response = httpClient.execute(request, httpContext); // Carry out the HTTP post request - System.out.println(response); - if (response == null) { - System.out.println("NO RESPONSE, THE APPLICATION WILL FAIL!"); - } else { - parse_xml(response.getEntity().getContent()); // Process the response from the server - response.close(); - } - } catch (Exception ex) { - logger.log("erreur: " + ex, Level.SEVERE); - JOptionPane.showMessageDialog(null, "ERREUR ! La connexion au serveur a été interrompue, le document édité n'a pas été sauvegardé !"); - } - } - - /** - * Class to manage the execution of an external program - */ - public class ProcessLoop extends Thread { - public DisCM disCM; - - public ProcessLoop(DisCM disCM){ - this.disCM = disCM; - } - - public void run() { - try { - disCM.launchProcess(); - } catch (PrivilegedActionException ex) { - Logger.getLogger(DisCM.class.getName()).log(Level.SEVERE, null, ex); - } catch (InterruptedException ex) { - Logger.getLogger(DisCM.class.getName()).log(Level.SEVERE, null, ex); - } catch (IllegalArgumentException ex) { - Logger.getLogger(DisCM.class.getName()).log(Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - Logger.getLogger(DisCM.class.getName()).log(Level.SEVERE, null, ex); - } catch (InvocationTargetException ex) { - Logger.getLogger(DisCM.class.getName()).log(Level.SEVERE, null, ex); - } - } - } -} - diff --git a/modules/content_management/dist/srcDIS/FileManager.java b/modules/content_management/dist/srcDIS/FileManager.java deleted file mode 100755 index ff48982491f41325d4f41fcb96a58217b6d886b2..0000000000000000000000000000000000000000 --- a/modules/content_management/dist/srcDIS/FileManager.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * Jdk platform : 1.8 - */ - -/** - * SVN version 120 - */ - - -package com.dis; - -import java.io.*; -import java.lang.reflect.InvocationTargetException; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import org.apache.commons.codec.binary.Base64; - -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; - -/** - * FileManager class manages the exchange of files between the applet and the workstation - * @author Laurent Giovannoni - */ -public class FileManager { - - /** - * Creates the tmp dir - * @param path path to the tmp dir - */ - public String createUserLocalDirTmp(String path, String os) throws IOException { - File file=new File(path); - String msg = ""; - if (!file.exists()) { - System.out.println("directory " + path + " not exists so the applet will create it"); - if (file.mkdir()) { - System.out.println("Directory: " + path + " created"); - } else { - System.out.println("Directory: " + path + " not created"); - msg = "ERROR"; - } - } else { - System.out.println("directory " + path + " already exists"); - } - if (!file.setReadable(true, false)) { - System.out.println("set permission readable failed on : " + path); - msg = "ERROR"; - } - if (!file.setWritable(true, false) && !"win".equals(os)) { - System.out.println("set permission writable failed on : " + path); - msg = "ERROR"; - } - if (!file.setExecutable(true, false)) { - System.out.println("set permission executable failed on : " + path); - msg = "ERROR"; - } - return msg; - } - - /** - * Controls the existance of psExec file in tmp dir - * @param path path to the tmp dir - * @return boolean - */ - public boolean isPsExecFileExists(String path) throws IOException { - File file=new File(path); - if (!file.exists()) { - System.out.println("psExec on path " + path + " not exists so the applet will create it"); - return false; - } else { - System.out.println("psExec on path " + path + " already exists"); - return true; - } - } - - /** - * Creates the template sended by Maarch file in tmp dir - * @param encodedContent the file to create - * @param pathTofile directory of the file to create - * @return boolean - */ - public boolean createFile(String encodedContent, final String pathTofile) throws IOException, PrivilegedActionException{ - final byte[] decodedBytes = Base64.decodeBase64(encodedContent); - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws IOException { - FileOutputStream fos = new FileOutputStream(pathTofile); - fos.write(decodedBytes); - fos.close(); - File file = new File(pathTofile); - if (!file.setReadable(true, false)) { - System.out.println("set permission readable failed on : " + pathTofile); - } - if (!file.setWritable(true, false)) { - System.out.println("set permission writable failed on : " + pathTofile); - } - if (!file.setExecutable(true, false)) { - System.out.println("set permission executable failed on : " + pathTofile); - } - return fos; - } - } - ); - return true; - } - - /** - * Creates the bat file to launch te editor of te template - * @param pathToBatFile path to the bat file - * @param pathToFileToLaunch path to the file to launch - * @param fileToLaunch name of the file to launch - * @param os os of the workstation - * @return boolean - */ - public boolean createBatFile( - final String pathToBatFile, - final String pathToFileToLaunch, - final String fileToLaunch, - final String os, - final String idApplet - ) throws IOException, PrivilegedActionException { - final Writer out; - if ("win".equals(os)) { - out = new OutputStreamWriter(new FileOutputStream(pathToBatFile), "CP850"); - } else { - out = new OutputStreamWriter(new FileOutputStream(pathToBatFile), "utf-8"); - } - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws IOException { - if ("win".equals(os)) { - if (fileToLaunch.contains(".odt") || fileToLaunch.contains(".ods")) { - //out.write("start /WAIT SOFFICE.exe -env:UserInstallation=file:///" - // + pathToFileToLaunch.replace("\\", "/") + " \"" + pathToFileToLaunch + fileToLaunch + "\""); - out.write("start /WAIT SOFFICE.exe \"-env:UserInstallation=file:///" + pathToFileToLaunch.replace("\\", "/") + idApplet +"/\" \"" + pathToFileToLaunch + fileToLaunch + "\""); - } else { - out.write("start /WAIT \"\" \"" + pathToFileToLaunch + fileToLaunch + "\""); - } - } else if ("mac".equals(os)) { - out.write("open -W " + pathToFileToLaunch + fileToLaunch); - } else if ("linux".equals(os)) { - out.write("libreoffice -env:UserInstallation=file://" + pathToFileToLaunch + idApplet +"/ " + pathToFileToLaunch + fileToLaunch + " || ooffice " + pathToFileToLaunch + fileToLaunch +"& wait"); - } - out.close(); - File file = new File(pathToBatFile); - if (!file.setReadable(true, false)) { - System.out.println("set permission readable failed on : " + pathToBatFile); - } - if (!file.setWritable(true, false)) { - System.out.println("set permission writable failed on : " + pathToBatFile); - } - if (!file.setExecutable(true, false)) { - System.out.println("set permission executable failed on : " + pathToBatFile); - } - - return out; - } - } - ); - return true; - } - - /** - * Encodes a file in base64 - * @param fichier path to the file to encode - * @return string - * @throws java.lang.Exception - */ - public static String encodeFile(String fichier) throws Exception { - byte[] buffer = readFile(fichier); - byte[] encodedBytes = Base64.encodeBase64(buffer); - return new String(encodedBytes); - } - - /** - * Reads a file - * @param filename path to the file to read - * @return byte - */ - private static byte[] readFile(String filename) throws IOException { - byte[] fileToEncode = Files.readAllBytes(Paths.get(filename)); - return fileToEncode; - } - - /** - * Launchs a command to execute - * @param launchCommand the command to launch - * @return process - */ - public Process launchApp(final String launchCommand) throws PrivilegedActionException { - return (Process) AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public Object run() throws IOException { - return Runtime.getRuntime().exec(launchCommand); - } - } - ); - } - - /** - * Launchs a command to execute - * @param launchCommand the command to launch - * @return process - */ - /*public Process launchApp(final String launchCommand) throws PrivilegedActionException { - System.out.println("COMMAND : " + launchCommand); - Object proc = new Object(); - try{ - proc = AccessController.doPrivileged( - new PrivilegedExceptionAction() { - - public Object run() throws IOException { - - Runtime rt = Runtime.getRuntime(); - Process proc = rt.exec(launchCommand); - String line; - BufferedReader in = new BufferedReader( - new InputStreamReader(proc.getInputStream()) ); - System.out.println("INFO: LAUNCH OF THE COMMAND -->"); - while ((line = in.readLine()) != null) { - System.out.println(line); - } - System.out.println("<--"); - in.close(); - - in = new BufferedReader( - new InputStreamReader(proc.getErrorStream()) ); - System.out.println("INFO: ERROR ON THE COMMAND -->"); - while ((line = in.readLine()) != null) { - System.out.println(line); - } - System.out.println("<--"); - in.close(); - - return proc; - - } - } - ); - } catch (Throwable t) - { - t.printStackTrace(); - } - return (Process) proc; - }*/ - - /** - * Retrieves the right program to edit the template with his extension - * @param ext extension of the template - * @return string - */ - public String findGoodProgramWithExt(String ext) { - String program = ""; - if ((ext.equalsIgnoreCase("docx") || ext.equalsIgnoreCase("doc") || ext.equalsIgnoreCase("docm"))) { - program = "winword.exe"; - } else if (ext.equalsIgnoreCase("xlsx") || ext.equalsIgnoreCase("xls") || ext.equalsIgnoreCase("xlsm")) { - program = "excel.exe"; - } else if (ext.equalsIgnoreCase("pptx") || ext.equalsIgnoreCase("ppt") || ext.equalsIgnoreCase("pptm") || ext.equalsIgnoreCase("ppsm")) { - program = "powerpnt.exe"; - } else { - program = "soffice.exe"; - } - - return program; - } - - /** - * Retrieves the path of a program in the registry - * @param program name of the program - * @return string - */ - public String findPathProgramInRegistry(String program) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - String path; - path = WinRegistry.readString ( - WinRegistry.HKEY_LOCAL_MACHINE, //HKEY - "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" + program, //Key - ""); - return "\"" + path + "\""; - } - - /** - * Retrieves the right options to edit the template - * @param ext extension of the template - * @return string - */ - public String findGoodOptionsToEdit(String ext) { - String options = ""; - if ( - "docx".equals(ext.toLowerCase()) || - "doc".equals(ext.toLowerCase()) || - "docm".equals(ext.toLowerCase()) - ) { - options = " /n /dde "; - } else if ( - "xlsx".equals(ext.toLowerCase()) || - "xls".equals(ext.toLowerCase()) || - "xlsm".equals(ext.toLowerCase()) - ) { - options = " /x "; - } else if ( - "pptx".equals(ext.toLowerCase()) || - "ppt".equals(ext.toLowerCase()) || - "pptm".equals(ext.toLowerCase()) || - "ppsm".equals(ext.toLowerCase()) - ) { - options = " "; - } else { - //options = " -env:UserInstallation=$SYSUSERCONFIG "; - } - - return options; - } - - /** - * Deletes file in the tmp dir - * @param directory path of the tmp dir - * @param pattern pattern of files to delete - */ - public static void deleteFilesOnDir (String directory, String pattern) throws IOException { - File dir = new File(directory); - File[] directoryListing = dir.listFiles(); - if (directoryListing != null) { - for (File child : directoryListing) { - System.out.println("a file : " + child); - if (child.toString().contains(pattern)) { - System.out.println("a file with pattern : " + child); - child.delete(); - } - } - } - } - - /** - * Deletes specific files in the tmp dir - * @param files contains alls file to delete - * @throws java.io.IOException - */ - public static void deleteSpecificFilesOnDir (List<String> files) throws IOException { - for (String file : files) { - System.out.println("file to delete : " + file); - File theFile = new File(file); - if (theFile.exists()) { - theFile.delete(); - } - } - } - -} \ No newline at end of file diff --git a/modules/content_management/dist/srcDIS/MyLogger.java b/modules/content_management/dist/srcDIS/MyLogger.java deleted file mode 100755 index 643b89387c518455fc985bde6c76c53e0236ec29..0000000000000000000000000000000000000000 --- a/modules/content_management/dist/srcDIS/MyLogger.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Jdk platform : 1.8 - */ - -/** - * SVN version 10 - */ - -package com.dis; - -import java.io.IOException; -import java.util.logging.FileHandler; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.logging.SimpleFormatter; - -/** - * MyLogger class manages the log of the applet - * @author Laurent Giovannoni - */ -public class MyLogger { - - private String loggerFile; - private FileHandler fh; - private Logger logger; - - /** - * Prepares the log - * @param pathTologs path to the log file in the tmp dir - */ - MyLogger(String pathTologs) { - this.loggerFile = pathTologs + "DisCM.log"; - this.logger = Logger.getLogger("DisCM"); - try { - // This block configure the logger with handler and formatter - this.fh = new FileHandler(this.loggerFile, true); - this.logger.addHandler(this.fh); - this.logger.setLevel(Level.ALL); - SimpleFormatter formatter = new SimpleFormatter(); - this.fh.setFormatter(formatter); - // the following statement is used to log any messages - this.logger.log(Level.INFO,"init the logger"); - } catch (SecurityException e) { - System.out.println(e); - } catch (IOException e) { - System.out.println(e); - } - } - - /** - * Writes the log - * @param message message to write in the log file - * @param level level of the message - */ - public void log(String message, Level level) { - this.logger.log(level, message); - } -} \ No newline at end of file diff --git a/modules/content_management/dist/srcDIS/WinRegistry.java b/modules/content_management/dist/srcDIS/WinRegistry.java deleted file mode 100755 index cbcfd76f0e0661c40662e0db08779498835d89df..0000000000000000000000000000000000000000 --- a/modules/content_management/dist/srcDIS/WinRegistry.java +++ /dev/null @@ -1,396 +0,0 @@ -/** - * Jdk platform : 1.8 - */ - -/** - * SVN version 120 - */ - -package com.dis; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; -import java.util.ArrayList; -import java.util.List; -import java.util.prefs.Preferences; - -/** - * WinRegistry class manages the access to the registry - */ -public class WinRegistry { - public static final int HKEY_CURRENT_USER = 0x80000001; - public static final int HKEY_LOCAL_MACHINE = 0x80000002; - public static final int REG_SUCCESS = 0; - public static final int REG_NOTFOUND = 2; - public static final int REG_ACCESSDENIED = 5; - - private static final int KEY_ALL_ACCESS = 0xf003f; - private static final int KEY_READ = 0x20019; - private static Preferences userRoot = Preferences.userRoot(); - private static Preferences systemRoot = Preferences.systemRoot(); - private static Class<? extends Preferences> userClass = userRoot.getClass(); - private static Method regOpenKey = null; - private static Method regCloseKey = null; - private static Method regQueryValueEx = null; - private static Method regEnumValue = null; - private static Method regQueryInfoKey = null; - private static Method regEnumKeyEx = null; - private static Method regCreateKeyEx = null; - private static Method regSetValueEx = null; - private static Method regDeleteKey = null; - private static Method regDeleteValue = null; - - static { - try { - regOpenKey = userClass.getDeclaredMethod("WindowsRegOpenKey", - new Class[] { int.class, byte[].class, int.class }); - regOpenKey.setAccessible(true); - regCloseKey = userClass.getDeclaredMethod("WindowsRegCloseKey", - new Class[] { int.class }); - regCloseKey.setAccessible(true); - regQueryValueEx = userClass.getDeclaredMethod("WindowsRegQueryValueEx", - new Class[] { int.class, byte[].class }); - regQueryValueEx.setAccessible(true); - regEnumValue = userClass.getDeclaredMethod("WindowsRegEnumValue", - new Class[] { int.class, int.class, int.class }); - regEnumValue.setAccessible(true); - regQueryInfoKey = userClass.getDeclaredMethod("WindowsRegQueryInfoKey1", - new Class[] { int.class }); - regQueryInfoKey.setAccessible(true); - regEnumKeyEx = userClass.getDeclaredMethod( - "WindowsRegEnumKeyEx", new Class[] { int.class, int.class, - int.class }); - regEnumKeyEx.setAccessible(true); - regCreateKeyEx = userClass.getDeclaredMethod( - "WindowsRegCreateKeyEx", new Class[] { int.class, - byte[].class }); - regCreateKeyEx.setAccessible(true); - regSetValueEx = userClass.getDeclaredMethod( - "WindowsRegSetValueEx", new Class[] { int.class, - byte[].class, byte[].class }); - regSetValueEx.setAccessible(true); - regDeleteValue = userClass.getDeclaredMethod( - "WindowsRegDeleteValue", new Class[] { int.class, - byte[].class }); - regDeleteValue.setAccessible(true); - regDeleteKey = userClass.getDeclaredMethod( - "WindowsRegDeleteKey", new Class[] { int.class, - byte[].class }); - regDeleteKey.setAccessible(true); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - private WinRegistry() { } - - /** - * Read a value from key and value name - * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE - * @param key - * @param valueName - * @return the value - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static String readString(int hkey, String key, String valueName) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - if (hkey == HKEY_LOCAL_MACHINE) { - return readString(systemRoot, hkey, key, valueName); - } - else if (hkey == HKEY_CURRENT_USER) { - return readString(userRoot, hkey, key, valueName); - } - else { - throw new IllegalArgumentException("hkey=" + hkey); - } - } - - /** - * Read value(s) and value name(s) form given key - * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE - * @param key - * @return the value name(s) plus the value(s) - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static Map<String, String> readStringValues(int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - if (hkey == HKEY_LOCAL_MACHINE) { - return readStringValues(systemRoot, hkey, key); - } - else if (hkey == HKEY_CURRENT_USER) { - return readStringValues(userRoot, hkey, key); - } - else { - throw new IllegalArgumentException("hkey=" + hkey); - } - } - - /** - * Read the value name(s) from a given key - * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE - * @param key - * @return the value name(s) - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static List<String> readStringSubKeys(int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - if (hkey == HKEY_LOCAL_MACHINE) { - return readStringSubKeys(systemRoot, hkey, key); - } - else if (hkey == HKEY_CURRENT_USER) { - return readStringSubKeys(userRoot, hkey, key); - } - else { - throw new IllegalArgumentException("hkey=" + hkey); - } - } - - /** - * Create a key - * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE - * @param key - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static void createKey(int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int [] ret; - if (hkey == HKEY_LOCAL_MACHINE) { - ret = createKey(systemRoot, hkey, key); - regCloseKey.invoke(systemRoot, new Object[] { ret[0]}); - } - else if (hkey == HKEY_CURRENT_USER) { - ret = createKey(userRoot, hkey, key); - regCloseKey.invoke(userRoot, new Object[] { ret[0]}); - } - else { - throw new IllegalArgumentException("hkey=" + hkey); - } - if (ret[1] != REG_SUCCESS) { - throw new IllegalArgumentException("rc=" + ret[1] + " key=" + key); - } - } - - /** - * Write a value in a given key/value name - * @param hkey - * @param key - * @param valueName - * @param value - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static void writeStringValue - (int hkey, String key, String valueName, String value) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - if (hkey == HKEY_LOCAL_MACHINE) { - writeStringValue(systemRoot, hkey, key, valueName, value); - } - else if (hkey == HKEY_CURRENT_USER) { - writeStringValue(userRoot, hkey, key, valueName, value); - } - else { - throw new IllegalArgumentException("hkey=" + hkey); - } - } - - /** - * Delete a given key - * @param hkey - * @param key - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static void deleteKey(int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int rc = -1; - if (hkey == HKEY_LOCAL_MACHINE) { - rc = deleteKey(systemRoot, hkey, key); - } - else if (hkey == HKEY_CURRENT_USER) { - rc = deleteKey(userRoot, hkey, key); - } - if (rc != REG_SUCCESS) { - throw new IllegalArgumentException("rc=" + rc + " key=" + key); - } - } - - /** - * delete a value from a given key/value name - * @param hkey - * @param key - * @param value - * @throws IllegalArgumentException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - public static void deleteValue(int hkey, String key, String value) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int rc = -1; - if (hkey == HKEY_LOCAL_MACHINE) { - rc = deleteValue(systemRoot, hkey, key, value); - } - else if (hkey == HKEY_CURRENT_USER) { - rc = deleteValue(userRoot, hkey, key, value); - } - if (rc != REG_SUCCESS) { - throw new IllegalArgumentException("rc=" + rc + " key=" + key + " value=" + value); - } - } - - // ===================== - - private static int deleteValue - (Preferences root, int hkey, String key, String value) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { - hkey, toCstr(key), KEY_ALL_ACCESS}); - if (handles[1] != REG_SUCCESS) { - return handles[1]; // can be REG_NOTFOUND, REG_ACCESSDENIED - } - int rc =((Integer) regDeleteValue.invoke(root, - new Object[] { - handles[0], toCstr(value) - })).intValue(); - regCloseKey.invoke(root, new Object[] { handles[0]}); - return rc; - } - - private static int deleteKey(Preferences root, int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int rc =((Integer) regDeleteKey.invoke(root, - new Object[] { hkey, toCstr(key) })).intValue(); - return rc; // can REG_NOTFOUND, REG_ACCESSDENIED, REG_SUCCESS - } - - private static String readString(Preferences root, int hkey, String key, String value) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { - hkey, toCstr(key), KEY_READ}); - if (handles[1] != REG_SUCCESS) { - return null; - } - byte[] valb = (byte[]) regQueryValueEx.invoke(root, new Object[] { - handles[0], toCstr(value) }); - regCloseKey.invoke(root, new Object[] { handles[0]}); - return (valb != null ? new String(valb).trim() : null); - } - - private static Map<String,String> readStringValues - (Preferences root, int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - HashMap<String, String> results = new HashMap<String,String>(); - int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { - hkey, toCstr(key), KEY_READ}); - if (handles[1] != REG_SUCCESS) { - return null; - } - int[] info = (int[]) regQueryInfoKey.invoke(root, - new Object[] { handles[0]}); - - int count = info[0]; // count - int maxlen = info[3]; // value length max - for(int index=0; index<count; index++) { - byte[] name = (byte[]) regEnumValue.invoke(root, new Object[] { - handles[0], index, maxlen + 1}); - String value = readString(hkey, key, new String(name)); - results.put(new String(name).trim(), value); - } - regCloseKey.invoke(root, new Object[] { handles[0]}); - return results; - } - - private static List<String> readStringSubKeys - (Preferences root, int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - List<String> results = new ArrayList<String>(); - int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { - hkey, toCstr(key), KEY_READ}); - if (handles[1] != REG_SUCCESS) { - return null; - } - int[] info = (int[]) regQueryInfoKey.invoke(root, - new Object[] { handles[0]}); - - int count = info[0]; // Fix: info[2] was being used here with wrong results. Suggested by davenpcj, confirmed by Petrucio - int maxlen = info[3]; // value length max - for(int index=0; index<count; index++) { - byte[] name = (byte[]) regEnumKeyEx.invoke(root, new Object[] { - handles[0], index, maxlen + 1}); - results.add(new String(name).trim()); - } - regCloseKey.invoke(root, new Object[] { handles[0]}); - return results; - } - - private static int [] createKey(Preferences root, int hkey, String key) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - return (int[]) regCreateKeyEx.invoke(root, - new Object[] { hkey, toCstr(key) }); - } - - private static void writeStringValue - (Preferences root, int hkey, String key, String valueName, String value) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException - { - int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { - hkey, toCstr(key), KEY_ALL_ACCESS}); - - regSetValueEx.invoke(root, - new Object[] { - handles[0], toCstr(valueName), toCstr(value) - }); - regCloseKey.invoke(root, new Object[] { handles[0]}); - } - - // utility - private static byte[] toCstr(String str) { - byte[] result = new byte[str.length() + 1]; - - for (int i = 0; i < str.length(); i++) { - result[i] = (byte) str.charAt(i); - } - result[str.length()] = 0; - return result; - } -} - diff --git a/modules/entities/Controllers/ListModelsController.php b/modules/entities/Controllers/ListModelsController.php index 87720a055f7db8b3e8fdc1d2e69c9c134cdcdb39..cafef8873b39c9e14fba08a7caa38d4d2f054e28 100755 --- a/modules/entities/Controllers/ListModelsController.php +++ b/modules/entities/Controllers/ListModelsController.php @@ -27,7 +27,7 @@ class ListModelsController public function getListModelsDiffListDestByUserId(RequestInterface $request, ResponseInterface $response, $aArgs) { - $return['listModels'] = ListModelsModel::getDiffListByUserId(['select' => ['object_id','description'], 'itemId' => $aArgs['itemId'],'objectType' => $aArgs['objectType'],'itemMode' => $aArgs['itemMode']]); + $return['listModels'] = ListModelsModel::getDiffListByUserId(['select' => ['object_id','title'], 'itemId' => $aArgs['itemId'],'objectType' => $aArgs['objectType'],'itemMode' => $aArgs['itemMode']]); return $response->withJson($return); } diff --git a/modules/entities/Models/EntityModelAbstract.php b/modules/entities/Models/EntityModelAbstract.php index 6715d62923a98ec89cdbb7812075afffab4bb0fd..da49cf51fe1a3791f5fe95840b773a7c820bc6e7 100755 --- a/modules/entities/Models/EntityModelAbstract.php +++ b/modules/entities/Models/EntityModelAbstract.php @@ -27,7 +27,8 @@ class EntityModelAbstract 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'table' => ['entities'], 'where' => ['enabled = ?'], - 'data' => ['Y'] + 'data' => ['Y'], + 'order_by' => ['entity_label'] ]); return $aEntities; @@ -148,13 +149,21 @@ class EntityModelAbstract $userEntities[] = $value['entity_id']; } - $allEntities = EntityModel::get(['select' => ['entity_id', 'entity_label']]); + $allEntities = EntityModel::get(['select' => ['entity_id', 'entity_label', 'parent_entity_id']]); foreach ($allEntities as $key => $value) { - if (in_array($value['entity_id'], $userEntities) || !in_array($value['entity_id'], $entitiesAllowedForAdministrator)) { - $allEntities[$key]['disabled'] = true; + $allEntities[$key]['id'] = $value['entity_id']; + if (empty($value['parent_entity_id'])) { + $allEntities[$key]['parent'] = '#'; + $allEntities[$key]['icon'] = "fa fa-building"; } else { - $allEntities[$key]['disabled'] = false; + $allEntities[$key]['parent'] = $value['parent_entity_id']; + $allEntities[$key]['icon'] = "fa fa-sitemap"; + } + $allEntities[$key]['text'] = $value['entity_label']; + if (in_array($value['entity_id'], $userEntities) || !in_array($value['entity_id'], $entitiesAllowedForAdministrator)) { + $allEntities[$key]['state']['opened'] = true; + $allEntities[$key]['state']['selected'] = true; } } diff --git a/modules/reports/xml/IVS/validation_rules.xml b/modules/reports/xml/IVS/validation_rules.xml index 8655087f3f29cfe9cdad7fb5552e30c54a962043..01dd8b5ce1fd363fcf6234b7d750eda1b10c762a 100755 --- a/modules/reports/xml/IVS/validation_rules.xml +++ b/modules/reports/xml/IVS/validation_rules.xml @@ -24,6 +24,8 @@ <parameter name="the_month" type="mois" /> <parameter name="the_year" type="annee" /> <parameter name="dir" type="string"/> + <parameter name="date_start" type="string"/> + <parameter name="date_fin" type="string"/> </validationRule> <validationRule name="users_logs" extends="standardForm" mode="error"> diff --git a/modules/visa/css/module.css b/modules/visa/css/module.css index 67ff8091b28cf773864f9e1a164fc1dd2cde1cda..1432db1310ad83f7cd33c89d92093af138cd37cb 100755 --- a/modules/visa/css/module.css +++ b/modules/visa/css/module.css @@ -19,6 +19,13 @@ float: left; } +#tabricatorLeft{ + height:99.5%; + min-width:0; + width:99.5%; + margin-bottom:0px; +} + #visa_right{ /*border:1px solid green;*/ height:95%; @@ -27,6 +34,12 @@ float: left; } +#tabricatorRight{ + height:90%; + min-width:0; + width:99.5%; +} + #visa_listDoc .toolbar{ height: 4%; width: 100%; @@ -135,6 +148,7 @@ opacity: 0.5 !important; color : #666 !important; border: solid 2px white !important; + text-decoration: line-through !important; } .droptarget input{ diff --git a/package.json b/package.json index 5c5deddb8155ddde5532d838a48d8f15867277f4..717a652a1d9b1906411004223ac3f4f67c03dfc7 100755 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "datatables": "^1.10.13", "jquery": "^3.2.1", "jquery-typeahead": "^2.8.0", - "jquery.nicescroll": "^3.6.8", + "jquery.nicescroll": "~3.6.8", + "jstree-bootstrap-theme": "^1.0.1", + "md2": "0.0.28", "photoswipe": "^4.1.2", "tinymce": "^4.6.2", "tooltipster": "^4.2.5", @@ -25,14 +27,14 @@ }, "devDependencies": { "@angular/animations": "^4.3.0", - "@angular/cdk": "^2.0.0-beta.8", + "@angular/cdk": "2.0.0-beta.8", "@angular/common": "^4.3.0", "@angular/compiler": "^4.3.0", "@angular/compiler-cli": "^4.3.0", "@angular/core": "^4.3.0", "@angular/forms": "^4.3.0", "@angular/http": "^4.3.1", - "@angular/material": "^2.0.0-beta.8", + "@angular/material": "2.0.0-beta.8", "@angular/platform-browser": "^4.3.0", "@angular/platform-browser-dynamic": "^4.3.0", "@angular/platform-server": "^4.3.0", diff --git a/rest/index.php b/rest/index.php index 97cb005d188b9ee8deb274ef75db350d3d2c3cb0..a76efeff405f44bb6d967c31ceabd5f9c090bbac 100755 --- a/rest/index.php +++ b/rest/index.php @@ -206,6 +206,13 @@ $app->get('/priorities/{id}', \Core\Controllers\PriorityController::class . ':ge $app->put('/priorities/{id}', \Core\Controllers\PriorityController::class . ':update'); $app->delete('/priorities/{id}', \Core\Controllers\PriorityController::class . ':delete'); +//History +$app->get('/administration/history/eventDate/{date}', \Core\Controllers\HistoryController::class . ':getForAdministration'); + +//HistoryBatch +$app->get('/administration/historyBatch/eventDate/{date}', \Core\Controllers\HistoryController::class . ':getBatchForAdministration'); + + //actions $app->get('/administration/actions', \Core\Controllers\ActionsController::class . ':getForAdministration'); $app->get('/initAction', \Core\Controllers\ActionsController::class . ':initAction');