diff --git a/apps/maarch_entreprise/Views/basket-home.component.html b/apps/maarch_entreprise/Views/basket-home.component.html index 46c5e4d5bcc8a3b372796645f4e4d4fe4279f116..343982504821cb15513daf6e658989a307442f06 100644 --- a/apps/maarch_entreprise/Views/basket-home.component.html +++ b/apps/maarch_entreprise/Views/basket-home.component.html @@ -14,18 +14,22 @@ <mat-divider *ngIf="regroupedBasket.baskets[0]"></mat-divider> <mat-nav-list> <ng-container *ngFor="let basket of regroupedBasket.baskets | filterList:listFilter.value"> - <a mat-list-item [disableRipple]="basket.redirected" [ngStyle]="{'cursor': basket.redirected ? 'not-allowed' : 'pointer'}"> - <mat-icon [ngStyle]="{'color': basket.color}" *ngIf="!basket.redirected && !mobileMode" mat-list-icon class="fa fa-inbox"></mat-icon> - <mat-icon [ngStyle]="{'color': basket.color}" *ngIf="basket.redirected && !mobileMode" mat-list-icon class="fa fa-share"></mat-icon> - <span *ngIf="basket.resourceNumber==0" class="badge">{{basket.resourceNumber}}</span> - <span *ngIf="basket.resourceNumber!=0" bgcolor="warn" class="badge">{{basket.resourceNumber}}</span> - <p mat-line (click)="goTo(basket.basket_id,regroupedBasket.groupId)" *ngIf="!basket.redirected" title="{{basket.basket_name}}" [ngStyle]="{'color': basket.color}"> - {{basket.basket_name}} - </p> - <p mat-line *ngIf="basket.redirected" title="{{basket.basket_name}}" [ngStyle]="{'color': basket.color}"> + <a mat-list-item *ngIf="basket.redirected" disableRipple="true" style="cursor:not-allowed;"> + <mat-icon [ngStyle]="{'color': basket.color}" *ngIf="basket.redirected && !mobileMode" mat-list-icon class="fa fa-share"></mat-icon> + <span *ngIf="basket.resourceNumber==0" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> + <span *ngIf="basket.resourceNumber!=0" bgcolor="warn" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> + <p mat-line title="{{basket.basket_name}}" [ngStyle]="{'color': basket.color}"> {{basket.basket_name}}<br/><small color="primary">({{lang.redirectedTo}} {{basket.redirectedUser}})</small> </p> </a> + <a mat-list-item *ngIf="!basket.redirected" routerLink="/basketList/{{regroupedBasket.groupSerialId}}/baskets/{{basket.basket_id}}" style="cursor:pointer;" [ngStyle]="{'opacity': basket.resourceNumber==0 ? '0.5' : '1'}"> + <mat-icon [ngStyle]="{'color': basket.color}" *ngIf="!mobileMode" mat-list-icon class="fa fa-inbox"></mat-icon> + <span *ngIf="basket.resourceNumber==0" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> + <span *ngIf="basket.resourceNumber!=0" bgcolor="warn" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> + <p mat-line title="{{basket.basket_name}}" [ngStyle]="{'color': basket.color}"> + {{basket.basket_name}} + </p> + </a> </ng-container> </mat-nav-list> </ng-container> @@ -35,7 +39,7 @@ <mat-nav-list> <a mat-list-item *ngFor="let basket of homeData.assignedBaskets | filterList:listFilter.value"> <mat-icon *ngIf="!mobileMode" style="color:#666" mat-list-icon class="fa fa-inbox"></mat-icon> - <span *ngIf="basket.resourceNumber==0" class="badge">{{basket.resourceNumber}}</span> + <span *ngIf="basket.resourceNumber==0" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> <span *ngIf="basket.resourceNumber!=0" bgcolor="warn" class="badge">{{basket.resourceNumber}}</span> <p mat-line (click)="goToRedirect(basket.basket_id,basket.basket_owner)" title="{{basket.basket_name}}" style="color:#666"> {{basket.basket_name}}<br/><small color="primary">({{basket.userToDisplay}})</small> @@ -44,47 +48,4 @@ </mat-nav-list> </ng-container> </mat-expansion-panel> - <mat-divider></mat-divider> -<!--<mat-nav-list class="homeBasketList"> - Nouveau courrier - <mat-list> - <ng-container *ngFor="let regroupedBasket of homeData.regroupedBaskets"> - <h4 *ngIf="regroupedBasket.baskets[0]" class="mat-toolbar mat-primary" style="padding-left:5px"> - <mat-icon mat-list-icon class="fa fa-users"></mat-icon> {{regroupedBasket.groupDesc}}</h4> - - <mat-list-item *ngFor="let basket of regroupedBasket.baskets" [ngStyle]="{'color': basket.color}"> - <mat-icon mat-list-icon *ngIf="!basket.redirected" class="fa fa-inbox" matBadge="{{basket.resourceNumber}}" matBadgePosition="before" - matBadgeColor="warn" [matBadgeHidden]="basket.resourceNumber==0" matTooltip="{{basket.resourceNumber}}"> - <span class="badge">{{basket.resourceNumber}}</span> - </mat-icon> - <mat-icon mat-list-icon *ngIf="basket.redirected" class="fa fa-share" matBadge="{{basket.resourceNumber}}" matBadgePosition="before" - matBadgeColor="warn" [matBadgeHidden]="basket.resourceNumber==0" matTooltip="{{basket.resourceNumber}}"> - <span class="badge">{{basket.resourceNumber}}</span> - </mat-icon> - <a *ngIf="!basket.redirected" href="index.php?page=view_baskets&module=basket&baskets={{basket.basket_id}}&groupId={{regroupedBasket.groupId}}"> - <span mat-line matTooltip="{{basket.basket_desc}}"> {{basket.basket_name}}</span> - </a> - <span *ngIf="basket.redirected" style="cursor:not-allowed"> - <span mat-line matTooltip="{{basket.basket_desc}}"> {{basket.basket_name}} ({{lang.redirectedTo}} {{basket.redirectedUser}})</span> - </span> - </mat-list-item> - <mat-divider></mat-divider> - </ng-container> - - <ng-container *ngIf="homeData.assignedBaskets.length>0"> - <h4 class="mat-toolbar mat-primary" style="padding-left:5px">{{lang.othersBaskets}}</h4> - <mat-list-item *ngFor="let basket of homeData.assignedBaskets" style="color:#666"> - <mat-icon mat-list-icon class="fa fa-inbox" matBadge="{{basket.resourceNumber}}" matBadgePosition="before" matBadgeColor="warn" - [matBadgeHidden]="basket.resourceNumber==0" matTooltip="{{basket.resourceNumber}}"></mat-icon> - <a href="index.php?page=view_baskets&module=basket&baskets={{basket.basket_id}}_{{basket.basket_owner}}&groupId="> - <span mat-line matTooltip="{{basket.basket_desc}} ({{basket.userToDisplay}})"> {{basket.basket_name}} ({{basket.userToDisplay}})</span> - </a> - </mat-list-item> - </ng-container> - - </mat-list> - - <h4 *ngIf="homeData.regroupedBaskets.length==0 && homeData.assignedBaskets.length==0">{{lang.noAvailableBasket}}</h4> - -</mat-nav-list>--> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/basket-list.component.html b/apps/maarch_entreprise/Views/basket-list.component.html new file mode 100644 index 0000000000000000000000000000000000000000..d0b417e715c6eacdac32e06c480506d134b19511 --- /dev/null +++ b/apps/maarch_entreprise/Views/basket-list.component.html @@ -0,0 +1,103 @@ +<div class="admin-container" [class.admin-is-mobile]="mobileQuery.matches"> + <mat-sidenav-container class="admin-sidenav-container"> + <mat-sidenav #snav [mode]="mobileMode ? 'over' : 'side'" [fixedInViewport]="mobileMode" fixedTopGap="56" [opened]="mobileMode ? false : true" + autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': mobileMode ? '80%' : '400px'}"> + <menu-shortcut></menu-shortcut> + <menu-nav></menu-nav> + <basket-home *ngIf="homeData" [homeData]="homeData"></basket-home> + <mat-divider></mat-divider> + </mat-sidenav> + <mat-sidenav-content> + <div *ngIf="loading" style="display:flex;height:100%;"> + <mat-spinner style="margin:auto;"></mat-spinner> + </div> + <mat-card class="card-app-content"> + <div class="example-loading-shade" *ngIf="isLoadingResults"> + <mat-spinner *ngIf="isLoadingResults"></mat-spinner> + </div> + <mat-paginator [length]="resultsLength" [pageSize]="10"></mat-paginator> + <table #tableBasketListSort="matSort" mat-table [dataSource]="data" matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc" + style="width:100%;table-layout: fixed;"> + <!-- Number Column --> + <ng-container matColumnDef="res_id"> + <td mat-cell *matCellDef="let row" style="text-align:center;width:10%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> + <div style="overflow: hidden;text-overflow: ellipsis;"> + <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}}"></mat-icon> + </div> + <div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" title="{{row.res_id}}"> + {{row.alt_identifier}} + </div> + + </td> + </ng-container> + <ng-container matColumnDef="subject"> + <td mat-cell *matCellDef="let row" style="width:50%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> + <div style="overflow: hidden;text-overflow: ellipsis;" title="{{row.subject}}"> + <span class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span> + <span>{{row.subject}}</span> + </div> + <!--<div> + <button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button> + <button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button> + <button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button> + </div> + <div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> + <span><i class="fa fa-check" color="accent"></i> Barbara BAIN </span> <i class="fa fa-arrow-right"></i> <span><i class="fa fa-user"></i> Patricia PETIT</span> + </div>--> + </td> + </ng-container> + <ng-container matColumnDef="contact_society"> + <td mat-cell *matCellDef="let row" style="width:25%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> + <div style="overflow: hidden;text-overflow: ellipsis;"> + <i class="fa fa-address-card" color="primary"></i> + <span *ngIf="row.contact_lastname==''">{{row.contact_society}}</span> + <span *ngIf="row.contact_society==''">{{row.contact_lastname}}</span> + <i class="fa fa-arrow-right"></i> + <i class="fa fa-sitemap" color="primary"></i> + <span title="{{row.entity_label}}">{{row.entity_destination}}</span> + </div> + <div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> + {{row.dest_user}} + </div> + </td> + </ng-container> + + <ng-container matColumnDef="creation_date"> + <td mat-cell *matCellDef="let row" style="text-align: right;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> + <div *ngIf="row.closing_date == null" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" + title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'> + <i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}} + </div> + <div *ngIf="row.closing_date == null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> + <i class="fa fa-stopwatch" title="date limite de traitement"></i> + <span [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span> + </div> + <div *ngIf="row.closing_date != null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> + <i class="fa fa-lock" title="date de clôture"></i> + <span title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'>{{row.closing_date | timeAgo}}</span> + </div> + <div> + <button mat-icon-button> + <mat-icon color="primary" class="fa fa-sticky-note"></mat-icon> + </button> + <button mat-icon-button (click)="goTo(row);"> + <mat-icon color="primary" class="fa fa-eye"></mat-icon> + </button> + <button mat-icon-button> + <mat-icon color="primary" class="fa fa-share-alt"></mat-icon> + </button> + </div> + </td> + </ng-container> + + <tr mat-row *matRowDef="let row; columns: displayedColumnsBasket;"></tr> + </table> + <div class="mat-paginator" style="min-height:48px;min-height: 48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;">{{resultsLength}} {{lang.entries}}</div> + </mat-card> + </mat-sidenav-content> + <mat-sidenav #snav2 [mode]="mobileQuery.matches ? 'over' : 'side'" [fixedInViewport]="mobileQuery.matches" fixedTopGap="56" + position='end' [opened]="mobileQuery.matches ? false : false" style="overflow-x:hidden;" [ngStyle]="{'width': mobileMode ? '80%' : '40%'}"> + <div *ngIf="innerHtml" [innerHTML]="innerHtml" style="height: 100%;overflow: hidden;"></div> + </mat-sidenav> + </mat-sidenav-container> +</div> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/home.component.html b/apps/maarch_entreprise/Views/home.component.html index 5b3ce7de82e4205cc87ef1fb66016231181839d8..be394ccf77f2f962d745ec0dbe2c94615594d58f 100755 --- a/apps/maarch_entreprise/Views/home.component.html +++ b/apps/maarch_entreprise/Views/home.component.html @@ -11,24 +11,23 @@ <div *ngIf="loading" style="display:flex;height:100%;"> <mat-spinner style="margin:auto;"></mat-spinner> </div> - <mat-card *ngIf="!loading" class="card-app-content"> + <mat-card class="card-app-content"> <mat-card style="display: flex"> - <div *ngIf="!mobileMode"style="text-align:center;flex: 1;background: url(static.php?filename=logo_only.svg);background-size: auto auto;height: 70px;background-size: 100%;background-repeat: no-repeat;background-position: center;"> + <div *ngIf="!mobileMode" style="text-align:center;flex: 1;background: url(static.php?filename=logo_only.svg);background-size: auto auto;height: 70px;background-size: 100%;background-repeat: no-repeat;background-position: center;"> </div> <div style="flex:10;padding-left: 10px;"> - <span [innerHTML]="lang.welcomeInGEC"></span> <b>{{currentDate}}</b>. + <span [innerHTML]="lang.welcomeInGEC"></span> + <b>{{currentDate}}</b>. </div> </mat-card> <mat-tab-group> <mat-tab label="Mes derniers courriers"> <table mat-table [dataSource]="dataSource" matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc" style="width:100%;table-layout: fixed;"> - <!-- Number Column --> <ng-container matColumnDef="res_id"> <td mat-cell *matCellDef="let row" style="text-align:center;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <div style="overflow: hidden;text-overflow: ellipsis;"> - <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="fm {{row.status_icon}} fm-2x" - title="{{row.status_label}}"></mat-icon> + <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}}"></mat-icon> </div> <div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> {{row.alt_identifier}} @@ -66,14 +65,13 @@ title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'> <i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}} </div> - <div *ngIf="row.closing_date == null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" - > + <div *ngIf="row.closing_date == null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> <i class="fa fa-stopwatch" title="date limite de traitement"></i> <span [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span> </div> - <div *ngIf="row.closing_date != null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" - > - <i class="fa fa-lock" title="date de clôture"></i> <span title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'>{{row.closing_date | timeAgo}}</span> + <div *ngIf="row.closing_date != null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> + <i class="fa fa-lock" title="date de clôture"></i> + <span title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'>{{row.closing_date | timeAgo}}</span> </div> <div> <button mat-icon-button (click)="$event.stopPropagation();goTo(row);"> @@ -85,7 +83,7 @@ <tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="goToDetail(row);" style="cursor: pointer;"></tr> </table> </mat-tab> - </mat-tab-group> + </mat-tab-group> </mat-card> </mat-sidenav-content> <mat-sidenav #snav2 [mode]="mobileQuery.matches ? 'over' : 'side'" [fixedInViewport]="mobileQuery.matches" fixedTopGap="56" diff --git a/apps/maarch_entreprise/Views/menuNav.component.html b/apps/maarch_entreprise/Views/menuNav.component.html index 145a11aa92ebf0398e896d07d943383fb8e77776..6417e57094cf82aef2ab326d2b94945e35848b90 100644 --- a/apps/maarch_entreprise/Views/menuNav.component.html +++ b/apps/maarch_entreprise/Views/menuNav.component.html @@ -1,4 +1,4 @@ -<mat-nav-list *ngIf="router.url != '/home'"> +<mat-nav-list *ngIf="router.url != '/home' && router.url != '/administration' && router.url.indexOf('/basketList') == -1"> <a mat-list-item (click)="backClicked()"> <mat-icon color="primary" mat-list-icon class="fa fa-chevron-left"></mat-icon> <p mat-line> @@ -6,4 +6,4 @@ </p> </a> </mat-nav-list> -<mat-divider *ngIf="router.url != '/home'"></mat-divider> \ No newline at end of file +<mat-divider *ngIf="router.url != '/home' && router.url != '/administration' && router.url.indexOf('/basketList') == -1"></mat-divider> \ No newline at end of file diff --git a/apps/maarch_entreprise/Views/menuShortcut.component.html b/apps/maarch_entreprise/Views/menuShortcut.component.html index b21a526263c02a6698ebcb29b9bf9de2a1e91932..e5631cdfb07e7df6072bc2caf1870585d7002016 100644 --- a/apps/maarch_entreprise/Views/menuShortcut.component.html +++ b/apps/maarch_entreprise/Views/menuShortcut.component.html @@ -31,13 +31,13 @@ <h3 mat-subheader>{{lang.shortcut}}</h3> <div class="button-row" style="padding-left: 10px;padding-right: 10px;display: flex;width: 250px;"> <span style="flex:1;text-align: center;padding: 5px;"> - <button color="primary" mat-mini-fab (click)="gotToMenu('/home','true');" matTooltip="{{lang.home}}"> + <button color="primary" mat-icon-button (click)="gotToMenu('/home','true');" matTooltip="{{lang.home}}"> <mat-icon class="fa fa-home" style="height:auto;"></mat-icon> </button> </span> <ng-container *ngFor="let shortcut of user.menu"> <span style="flex:1;text-align: center;padding: 5px;" *ngIf="shortcut.shortcut == 'true'"> - <button color="primary" mat-mini-fab (click)="gotToMenu(shortcut.servicepage,shortcut.angular);" matTooltip="{{shortcut.name}}"> + <button color="primary" mat-icon-button (click)="gotToMenu(shortcut.servicepage,shortcut.angular);" matTooltip="{{shortcut.name}}"> <mat-icon class="fa {{shortcut.style}}" style="height:auto;"></mat-icon> </button> </span> diff --git a/apps/maarch_entreprise/css/engine.css b/apps/maarch_entreprise/css/engine.css index 703685a5b5ca1bf9188e837de8b0f6f46d8188b3..1e57ad9162dd7cf508921765ecd762ad073c4c34 100755 --- a/apps/maarch_entreprise/css/engine.css +++ b/apps/maarch_entreprise/css/engine.css @@ -352,3 +352,16 @@ h1.admin-app-name { height: 39px !important; font-size: 14px !important; } + +.example-loading-shade { + position: absolute; + top: 0; + left: 0; + bottom: 56px; + right: 0; + background: rgba(0, 0, 0, 0.15); + z-index: 1; + display: flex; + align-items: center; + justify-content: center; +} \ No newline at end of file diff --git a/apps/maarch_entreprise/index.php b/apps/maarch_entreprise/index.php index e80305e0ffbf50892daa2c0c2f9f7939b2cea399..82d3d9d8b86159a7a1b112e6c744ea68f57c9879 100755 --- a/apps/maarch_entreprise/index.php +++ b/apps/maarch_entreprise/index.php @@ -391,6 +391,8 @@ if (file_exists($path)) { ?><script>triggerAngular('#/activate-user')</script><?php } elseif ($_SESSION['user']['UserId'] == 'superadmin' && !empty($_REQUEST['administration'])) { ?><script>triggerAngular('#/administration')</script><?php + } elseif (!$_REQUEST['page']) { + ?><script>triggerAngular('#/home')</script><?php } ?> </html> diff --git a/apps/maarch_entreprise/js/angular/app/app-routing.module.ts b/apps/maarch_entreprise/js/angular/app/app-routing.module.ts index 5da64dbd616411ca5ee021a3373f0634ec547b17..86c8383eded4d5460da10d2e02254135bcad85eb 100755 --- a/apps/maarch_entreprise/js/angular/app/app-routing.module.ts +++ b/apps/maarch_entreprise/js/angular/app/app-routing.module.ts @@ -5,7 +5,8 @@ import { ActivateUserComponent } from './activate-user.component'; import { PasswordModificationComponent } from './password-modification.component'; import { ProfileComponent } from './profile.component'; import { AboutUsComponent } from './about-us.component'; -import { HomeComponent } from './home.component'; +import { HomeComponent } from './home.component'; +import { BasketListComponent } from './basket/basket-list.component'; import { SignatureBookComponent } from './signature-book.component'; import { SaveNumericPackageComponent } from './save-numeric-package.component'; @@ -17,6 +18,7 @@ import { SaveNumericPackageComponent } from './save-numeric-package.compone { path: 'profile', component: ProfileComponent }, { path: 'about-us', component: AboutUsComponent }, { path: 'home', component: HomeComponent }, + { path: 'basketList/:groupSerialId/baskets/:basketId', component: BasketListComponent }, { path: 'saveNumericPackage', component: SaveNumericPackageComponent }, { path: 'groups/:groupId/baskets/:basketId/signatureBook/:resId', component: SignatureBookComponent }, { path: '**', redirectTo: '', pathMatch: 'full' }, diff --git a/apps/maarch_entreprise/js/angular/app/app.module.ts b/apps/maarch_entreprise/js/angular/app/app.module.ts index 2dc4884ab2a743c4f7a4f49cb4b8731d8a3e40a7..4f730d68b530dd6f481aa28ec2e2bc93169ef8fb 100755 --- a/apps/maarch_entreprise/js/angular/app/app.module.ts +++ b/apps/maarch_entreprise/js/angular/app/app.module.ts @@ -11,7 +11,8 @@ import { AdministrationModule } from './administration/administr import { ProfileComponent } from './profile.component'; import { AboutUsComponent } from './about-us.component'; -import { HomeComponent } from './home.component'; +import { HomeComponent } from './home.component'; +import { BasketListComponent } from './basket/basket-list.component'; import { PasswordModificationComponent, InfoChangePasswordModalComponent, } from './password-modification.component'; import { SignatureBookComponent, SafeUrlPipe } from './signature-book.component'; import { SaveNumericPackageComponent } from './save-numeric-package.component'; @@ -28,6 +29,7 @@ import { ActivateUserComponent } from './activate-user.component' ProfileComponent, AboutUsComponent, HomeComponent, + BasketListComponent, PasswordModificationComponent, SignatureBookComponent, SafeUrlPipe, diff --git a/apps/maarch_entreprise/js/angular/app/basket/basket-list.component.ts b/apps/maarch_entreprise/js/angular/app/basket/basket-list.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f6122bb0720d4fbcf212d2bb36d309f19b955db --- /dev/null +++ b/apps/maarch_entreprise/js/angular/app/basket/basket-list.component.ts @@ -0,0 +1,143 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild, QueryList, ViewChildren } from '@angular/core'; +import { MediaMatcher } from '@angular/cdk/layout'; +import { HttpClient } from '@angular/common/http'; +import { LANG } from '../translate.component'; +import { merge, Observable, of as observableOf} from 'rxjs'; +import { NotificationService } from '../notification.service'; +import { MatDialog, MatSidenav, MatExpansionPanel, MatTableDataSource, MatPaginator, MatSort } from '@angular/material'; + +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; +import { startWith, switchMap, map, catchError } from 'rxjs/operators'; +import { ActivatedRoute } from '@angular/router'; + +declare function $j(selector: any): any; + +declare var angularGlobals: any; + +@Component({ + templateUrl: "../../../../Views/basket-list.component.html", + providers: [NotificationService] +}) +export class BasketListComponent implements OnInit { + + private _mobileQueryListener: () => void; + mobileQuery: MediaQueryList; + mobileMode: boolean = false; + coreUrl: string; + lang: any = LANG; + + loading: boolean = false; + docUrl : string = ''; + public innerHtml: SafeHtml; + basketUrl: string; + homeData: any; + + + @ViewChild('snav') sidenavLeft: MatSidenav; + @ViewChild('snav2') sidenavRight: MatSidenav; + + + displayedColumnsBasket: string[] = ['res_id', 'subject', 'contact_society', 'creation_date']; + + exampleDatabase: ExampleHttpDao | null; + data: any[] = []; + resultsLength = 0; + isLoadingResults = true; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild('tableBasketListSort') sort: MatSort; + constructor(changeDetectorRef: ChangeDetectorRef, private route: ActivatedRoute, media: MediaMatcher, public http: HttpClient, public dialog: MatDialog, private sanitizer: DomSanitizer) { + this.mobileMode = angularGlobals.mobileMode; + $j("link[href='merged_css.php']").remove(); + this.mobileQuery = media.matchMedia('(max-width: 768px)'); + this._mobileQueryListener = () => changeDetectorRef.detectChanges(); + this.mobileQuery.addListener(this._mobileQueryListener); + } + + ngOnInit(): void { + this.coreUrl = angularGlobals.coreUrl; + + this.loading = false; + + this.http.get(this.coreUrl + "rest/home") + .subscribe((data: any) => { + this.homeData = data; + }); + + + this.route.params.subscribe(params => { + this.basketUrl = this.coreUrl + 'rest/resources/groups/'+params['groupSerialId']+'/baskets/'+params['basketId']; + this.http.get(this.coreUrl + "rest/baskets/" + params['basketId']) + .subscribe((data: any) => { + window['MainHeaderComponent'].refreshTitle(data.basket.basket_name); + window['MainHeaderComponent'].setSnav(this.sidenavLeft); + window['MainHeaderComponent'].setSnavRight(null); + this.exampleDatabase = new ExampleHttpDao(this.http); + + // If the user changes the sort order, reset back to the first page. + this.paginator.pageIndex = 0; + this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); + + merge(this.sort.sortChange, this.paginator.page) + .pipe( + startWith({}), + switchMap(() => { + this.isLoadingResults = true; + return this.exampleDatabase!.getRepoIssues( + this.sort.active, this.sort.direction, this.paginator.pageIndex, this.basketUrl); + }), + map(data => { + // Flip flag to show that loading has finished. + this.isLoadingResults = false; + this.resultsLength = data.number; + + return data.resources; + }), + catchError(() => { + this.isLoadingResults = false; + return observableOf([]); + }) + ).subscribe(data => this.data = data); + + }, () => { + location.href = "index.php"; + }); + }); + + + } + + goTo(row:any){ + if (this.docUrl == this.coreUrl+'rest/res/'+row.res_id+'/content' && this.sidenavRight.opened) { + this.sidenavRight.close(); + } else { + this.docUrl = this.coreUrl+'rest/res/'+row.res_id+'/content'; + this.innerHtml = this.sanitizer.bypassSecurityTrustHtml( + "<object style='height:100%;width:100%;' data='" + this.docUrl + "' type='application/pdf' class='embed-responsive-item'>" + + "<div>Le document "+row.res_id+" ne peut pas être chargé</div>" + + "</object>"); + this.sidenavRight.open(); + } + } + + goToDetail(row:any){ + location.href = "index.php?page=details&dir=indexing_searching&id="+row.res_id; + } + +} +export interface BasketList { + resources: any[]; + number: number; +} + + +export class ExampleHttpDao { + + constructor(private http: HttpClient) { } + + getRepoIssues(sort: string, order: string, page: number, href :string): Observable<BasketList> { + let offset = page * 10; + const requestUrl = `${href}?limit=10&offset=${offset}`; + + return this.http.get<BasketList>(requestUrl); + } +} \ No newline at end of file diff --git a/apps/maarch_entreprise/js/angular/app/home.component.ts b/apps/maarch_entreprise/js/angular/app/home.component.ts index 2cc4299916384a252013f084f2db079b0af010c2..86cb5f11f43558bfbed6abfcfca755c9e710f84c 100755 --- a/apps/maarch_entreprise/js/angular/app/home.component.ts +++ b/apps/maarch_entreprise/js/angular/app/home.component.ts @@ -2,11 +2,13 @@ import { ChangeDetectorRef, Component, OnInit, ViewChild, QueryList, ViewChildre import { MediaMatcher } from '@angular/cdk/layout'; import { HttpClient } from '@angular/common/http'; import { LANG } from './translate.component'; +import { merge, Observable, of as observableOf} from 'rxjs'; import { NotificationService } from './notification.service'; -import { MatDialog, MatSidenav, MatExpansionPanel, MatTableDataSource } from '@angular/material'; +import { MatDialog, MatSidenav, MatExpansionPanel, MatTableDataSource, MatPaginator, MatSort } from '@angular/material'; import { AutoCompletePlugin } from '../plugins/autocomplete.plugin'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; +import { startWith, switchMap, map, catchError } from 'rxjs/operators'; declare function $j(selector: any): any; @@ -91,4 +93,4 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit { location.href = "index.php?page=details&dir=indexing_searching&id="+row.res_id; } -} +} \ No newline at end of file diff --git a/src/app/resource/models/ResModelAbstract.php b/src/app/resource/models/ResModelAbstract.php index bb0caf2bf70b4b900dc59e12529ee0df9e381500..52c11ea0bc7bd90e7247d00d5c4dacb6a03bf480 100644 --- a/src/app/resource/models/ResModelAbstract.php +++ b/src/app/resource/models/ResModelAbstract.php @@ -50,8 +50,8 @@ abstract class ResModelAbstract $aResources = DatabaseModel::select([ 'select' => [ - 'res_id', 'alt_identifier', 'subject', 'type_label', 'process_limit_date', 'entity_label', 'category_id', - 'creation_date', 'dest_user', 'priorities.label', 'priorities.color', 'status.img_filename' + 'res_id', 'alt_identifier', 'subject', 'type_label as doctype_label', 'process_limit_date', 'closing_date', 'entity_label as entity_destination', 'category_id', 'contact_lastname', 'contact_society', + 'creation_date', 'dest_user', 'priorities.label as priority_label', 'priorities.color as priority_color', 'status.label_status as status_label', 'status.img_filename as status_icon' ], 'table' => ['res_view_letterbox, priorities, status'], 'where' => $where,