diff --git a/src/app/entity/controllers/ListInstanceController.php b/src/app/entity/controllers/ListInstanceController.php index 0cf47963e67bed6e5298cb4cbcd402ff437d89de..323b6130ec1b5c5261e183976f1756e6e0d8b3a4 100755 --- a/src/app/entity/controllers/ListInstanceController.php +++ b/src/app/entity/controllers/ListInstanceController.php @@ -62,9 +62,12 @@ class ListInstanceController if (!Validator::intVal()->validate($aArgs['resId']) || !ResController::hasRightByResId(['resId' => [$aArgs['resId']], 'userId' => $GLOBALS['userId']])) { return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']); } - $listinstances = ListInstanceModel::getVisaCircuitByResId(['select' => ['listinstance_id', 'sequence', 'item_id', 'item_type', 'firstname as item_firstname', 'lastname as item_lastname', 'entity_label as item_entity', 'viewed', 'process_date', 'process_comment', 'signatory', 'requested_signature'], 'id' => $aArgs['resId']]); - - return $response->withJson($listinstances); + $listInstances = ListInstanceModel::getVisaCircuitByResId(['select' => ['listinstance_id', 'sequence', 'item_id', 'item_type', 'firstname as item_firstname', 'lastname as item_lastname', 'entity_label as item_entity', 'viewed', 'process_date', 'process_comment', 'signatory', 'requested_signature'], 'id' => $aArgs['resId']]); + foreach ($listInstances as $key => $value) { + $listInstances[$key]['labelToDisplay'] = $listInstances[$key]['item_firstname'].' '.$listInstances[$key]['item_lastname']; + } + + return $response->withJson($listInstances); } public function getAvisCircuitByResId(Request $request, Response $response, array $aArgs) @@ -72,9 +75,12 @@ class ListInstanceController if (!Validator::intVal()->validate($aArgs['resId']) || !ResController::hasRightByResId(['resId' => [$aArgs['resId']], 'userId' => $GLOBALS['userId']])) { return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']); } - $listinstances = ListInstanceModel::getAvisCircuitByResId(['select' => ['listinstance_id', 'sequence', 'item_id', 'item_type', 'firstname as item_firstname', 'lastname as item_lastname', 'entity_label as item_entity', 'viewed', 'process_date', 'process_comment'], 'id' => $aArgs['resId']]); - - return $response->withJson($listinstances); + $listInstances = ListInstanceModel::getAvisCircuitByResId(['select' => ['listinstance_id', 'sequence', 'item_id', 'item_type', 'firstname as item_firstname', 'lastname as item_lastname', 'entity_label as item_entity', 'viewed', 'process_date', 'process_comment'], 'id' => $aArgs['resId']]); + foreach ($listInstances as $key => $value) { + $listInstances[$key]['labelToDisplay'] = $listInstances[$key]['item_firstname'].' '.$listInstances[$key]['item_lastname']; + } + + return $response->withJson($listInstances); } public function update(Request $request, Response $response) diff --git a/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.html b/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.html index b6e21b2219e0ebd1d47aacd3a71208df16a9062b..2ead7c3c052056f62114bac3faa0fe268f225e4b 100644 --- a/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.html +++ b/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.html @@ -1,8 +1,13 @@ -<div class="col-md-12" *ngIf="additionalsInfos.users.length == 0"> - {{lang.noUserDefinedInMaarchParapheur}} -</div> <div class="col-md-12"> - <div class="alert-message alert-message-info" role="alert">{{lang.visaWorkflowWillBeSend}}</div> + <div class="fieldsetdContainer" style="flex:2"> + <h2>{{lang.visaWorkflow}} :</h2> + <div class="fieldsetdContent"> + <app-visa-workflow #appVisaWorkflow [injectDatas]="injectDatasParam"></app-visa-workflow> + <div *ngIf="appVisaWorkflow.checkExternalSignatoryBook().length > 0" class="alert-message alert-message-danger" role="alert"> + <b>{{appVisaWorkflow.checkExternalSignatoryBook().join(', ')}}</b> {{lang.usersMissingInSignatureBook}} ! + </div> + </div> + </div> </div> <div class="col-md-12" *ngIf="additionalsInfos.visaWorkflowError"> <div> diff --git a/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.scss b/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.scss index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..07d81da0a9dbd4a75bf976c04dfb268ecfc7df78 100644 --- a/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.scss +++ b/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.scss @@ -0,0 +1,35 @@ +.fieldsetdContainer { + position: relative; + + h2 { + white-space: pre; + overflow: hidden; + max-width: 85%; + text-overflow: ellipsis; + z-index: 1; + font-size: 10px; + font-weight: bold; + background: white; + position: absolute; + top: -5px; + left: 30px; + padding: 0px; + margin: 0px; + padding-left: 5px; + padding-right: 5px; + color: #135f7f; + } + + .fieldsetdContent { + background: white; + border-radius: 4px; + border: solid 1px #ccc; + margin-top: 10px; + padding: 10px; + overflow: auto; + } +} + +.alert-message { + margin: 0 ; +} \ No newline at end of file diff --git a/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.ts b/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.ts index c3dce09c9d6d8c1f841b13127ef2d261303149f6..ba1eea0a88a86341429919d3f79245d26043f1b8 100644 --- a/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.ts +++ b/src/frontend/app/actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component.ts @@ -1,7 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, ViewChild } from '@angular/core'; import { LANG } from '../../../translate.component'; import { NotificationService } from '../../../notification.service'; import { HttpClient } from '@angular/common/http'; +import { VisaWorkflowComponent } from '../../../visa/visa-workflow.component'; declare function $j(selector: any): any; @@ -18,16 +19,27 @@ export class MaarchParaphComponent implements OnInit { currentAccount: any = null; usersWorkflowList: any[] = []; + + injectDatasParam = { + resId: 0, + editable: true + }; + @ViewChild('appVisaWorkflow') appVisaWorkflow: VisaWorkflowComponent; + @Input('additionalsInfos') additionalsInfos: any; @Input('externalSignatoryBookDatas') externalSignatoryBookDatas: any; constructor(public http: HttpClient, private notify: NotificationService) { } - ngOnInit(): void { } + ngOnInit(): void { + if (this.additionalsInfos.destinationId !== '') { + this.appVisaWorkflow.loadListModel(this.additionalsInfos.destinationId); + } + } checkValidParaph() { - if (this.additionalsInfos.attachments.length == 0) { + if (this.additionalsInfos.attachments.length == 0 || this.appVisaWorkflow.getWorkflow().length === 0 || this.appVisaWorkflow.checkExternalSignatoryBook().length > 0) { return true; } else { return false; @@ -39,6 +51,17 @@ export class MaarchParaphComponent implements OnInit { } getDatas() { + const workflow = this.appVisaWorkflow.getWorkflow(); + + workflow.forEach((element:any) => { + this.externalSignatoryBookDatas.steps.push( + { + 'externalId' : element.externalId.maarchParapheur, + 'action' : element.requested_signature ? 'sign' : 'visa', + } + ); + }); + return this.externalSignatoryBookDatas; } } diff --git a/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts b/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts index 6bf55a63a27147a1c8b6a3996b9df0ddae5af96a..86ae0c6e02de877df986f960ec034f5ef1338d7e 100644 --- a/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts +++ b/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts @@ -17,13 +17,15 @@ export class SendExternalSignatoryBookActionComponent implements OnInit { lang: any = LANG; loading: boolean = false; additionalsInfos: any = { + destinationId: '', users: [], attachments: [], noAttachment: [] }; - signatoryBookEnabled: string = 'maarchParapheur'; + signatoryBookEnabled: string = ''; externalSignatoryBookDatas: any = { + steps: [], objectSent: 'attachment' }; errors: any; @@ -44,6 +46,7 @@ export class SendExternalSignatoryBookActionComponent implements OnInit { this.signatoryBookEnabled = data.signatureBookEnabled; this.errors = data.errors; this.loading = false; + console.log(data); }, (err: any) => { this.notify.handleErrors(err); this.loading = false; diff --git a/src/frontend/app/visa/visa-workflow.component.html b/src/frontend/app/visa/visa-workflow.component.html index 0dc3d9360526958e556ef0ec7a4378b39cff0506..cb2d80f1fd7df44f22c0a89ea2936fdf0ddc9372 100644 --- a/src/frontend/app/visa/visa-workflow.component.html +++ b/src/frontend/app/visa/visa-workflow.component.html @@ -1,31 +1,55 @@ <mat-list *ngIf="!loading"> <mat-form-field *ngIf="injectDatas.editable" appearance="outline" floatLabel="never" [style.fontSize.px]="10"> - <input class="metaSearch" type="text" matInput placeholder="{{lang.addPerson}}"> + <input id="availableUsers" type="text" matInput placeholder="{{lang.addPerson}}" + [matAutocomplete]="auto" [formControl]="userCtrl"> + <mat-autocomplete #auto="matAutocomplete" (optionSelected)="addItem($event)" isOpen="true"> + <mat-option *ngFor="let user of filteredUsers | async" [value]="user"> + {{user.displayName}} + </mat-option> + </mat-autocomplete> </mat-form-field> <div cdkDropList #dataAvailableList="cdkDropList" [cdkDropListData]="visaWorkflow.items" class="cdk-list" (cdkDropListDropped)="drop($event)" [cdkDropListDisabled]="!injectDatas.editable"> - <div *ngIf="visaWorkflow.items.length === 0" style="opacity: 0.5;text-align: center;font-size: 10px;padding: 10px;"> + <div class="emptyContent" *ngIf="visaWorkflow.items.length === 0"> {{lang.noPerson}} </div> <mat-list-item *ngFor="let diffusion of visaWorkflow.items;let i=index" cdkDrag class="columns" - [cdkDragDisabled]="!injectDatas.editable" [class.notDraggable]="injectDatas.editable" [class.notEditable]="!injectDatas.editable" [ngStyle]="{'background': diffusion.process_date != null ? 'rgba(0, 128, 0, 0.11)' : ''}"> + [cdkDragDisabled]="!injectDatas.editable" [class.notDraggable]="!injectDatas.editable" + [class.notEditable]="!injectDatas.editable" [class.processed]="diffusion.process_date != null"> <mat-icon mat-list-icon class="fa fa-user fa-2x" color="primary"></mat-icon> - <mat-icon mat-list-icon class="fa fa-hourglass fa-2x" *ngIf="diffusion.process_date == null" style="opacity:0.5;"></mat-icon> - <mat-icon mat-list-icon class="fa fa-check fa-2x" *ngIf="diffusion.process_date != null" style="opacity:0.5;" - color="accent"></mat-icon> - <h4 mat-line style="display: flex;"> - <span style="flex: 1;">{{diffusion.item_firstname}} {{diffusion.item_lastname}}</span> - <span *ngIf="!diffusion.requested_signature" style="flex: 1;text-align: right;font-size: 90%;" color="primary">{{lang.visaUser}}</span> - <span *ngIf="diffusion.requested_signature" style="flex: 1;text-align: right;font-size: 90%;" color="warn">{{lang.signUser}}</span> - </h4> - <p mat-line style="display: flex;"> - <span style="opacity:0.5;flex: 1;">{{diffusion.item_entity}}</span> - <span *ngIf="diffusion.process_date != null" title='{{diffusion.process_date | date : lang.onRange + " dd/MM/y " + lang.atRange +" HH:mm"}}' - style="flex: 1;text-align: right;font-size: 90%;" color="accent">{{diffusion.process_date - | timeAgo}}</span> - </p> + <ng-container *ngIf="!injectDatas.editable"> + <mat-icon mat-list-icon class="fa fa-hourglass fa-2x" + [ngClass]="{'fa-hourglass': diffusion.process_date == null,'fa-check': diffusion.process_date != null}" + style="opacity:0.5;"></mat-icon> + </ng-container> + <div mat-line style="display: flex;align-items: center;"> + <div style="flex:1;overflow: hidden;text-overflow: ellipsis;"> + <div style="text-overflow: ellipsis;overflow: hidden;"> + {{diffusion.labelToDisplay}} + </div> + <div style="opacity:0.5;flex: 1;text-overflow: ellipsis;overflow: hidden;">{{diffusion.item_entity}}</div> + <div *ngIf="diffusion.process_date != null" + title='{{diffusion.process_date | date : lang.onRange + " dd/MM/y " + lang.atRange +" HH:mm"}}' + style="flex: 1;text-align: right;font-size: 90%;" color="accent">{{diffusion.process_date + | timeAgo}}</div> + </div> + <div> + <button class="currentRoleButton" [disabled]="!injectDatas.editable" mat-button [matMenuTriggerFor]="menu" + title="{{lang[diffusion.currentRole+'User']}}">{{diffusion.requested_signature ? lang.signUser : lang.visaUser}}</button> + <mat-menu [class]="'listMenu'" #menu="matMenu"> + <div + style="text-align: center;font-size: 10px;color: white;background: #135F7F;padding: 5px;font-weight: bold;"> + {{lang.roles}} + </div> + <button *ngFor="let role of visaWorkflow.roles" mat-menu-item + (click)="changeRole(i)">{{lang[role+'User']}}</button> + </mat-menu> + </div> + + </div> <button mat-icon-button *ngIf="injectDatas.editable" (click)="deleteItem(i)"> <mat-icon class="fa fa-times" color="warn"></mat-icon> </button> </mat-list-item> - </div> \ No newline at end of file + </div> +</mat-list> \ No newline at end of file diff --git a/src/frontend/app/visa/visa-workflow.component.scss b/src/frontend/app/visa/visa-workflow.component.scss index e228e789956723c2e78bfe70bf2a11b7f57c46be..036c226d2daff9d5c5370478151e356337d3845e 100644 --- a/src/frontend/app/visa/visa-workflow.component.scss +++ b/src/frontend/app/visa/visa-workflow.component.scss @@ -37,4 +37,38 @@ .notEditable { cursor: initial; +} + +.currentContextButton{ + overflow: hidden; + text-overflow: ellipsis; + font-size: 13px; + width: 150px; + text-align: left; +} + +.currentRoleButton{ + overflow: hidden; + text-overflow: ellipsis; + font-size: 13px; + width: 120px; + text-align: center; +} + +::ng-deep.listMenu { + .mat-menu-content { + padding-top: 0; + padding-bottom: 0; + } +} + +.emptyContent { + opacity: 0.5; + text-align: center; + font-size: 10px; + padding: 10px; +} + +.processed { + background: rgba(0, 128, 0, 0.11); } \ No newline at end of file diff --git a/src/frontend/app/visa/visa-workflow.component.ts b/src/frontend/app/visa/visa-workflow.component.ts index 33648e0d9cc73076978d7af6a302a10ab6bfa7bf..e6a62a3879d3433efd7d3ef144b48a0bc0ac39ec 100644 --- a/src/frontend/app/visa/visa-workflow.component.ts +++ b/src/frontend/app/visa/visa-workflow.component.ts @@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http'; import { LANG } from '../translate.component'; import { NotificationService } from '../notification.service'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +import { AutoCompletePlugin } from '../../plugins/autocomplete.plugin'; @Component({ selector: 'app-visa-workflow', @@ -10,18 +11,21 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; styleUrls: ['visa-workflow.component.scss'], providers: [NotificationService] }) -export class VisaWorkflowComponent implements OnInit { +export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit { lang: any = LANG; visaWorkflow: any = { + roles: ['sign','visa'], items : [] }; - loading: boolean = true; + loading: boolean = false; data: any; @Input('injectDatas') injectDatas: any; - constructor(public http: HttpClient, private notify: NotificationService) { } + constructor(public http: HttpClient, private notify: NotificationService) { + super(http, ['signatureBookUsers']); + } ngOnInit(): void { } @@ -31,52 +35,21 @@ export class VisaWorkflowComponent implements OnInit { } } - loadListModel(entityId: string) { + loadListModel(entityId: number) { this.loading = true; this.visaWorkflow.items = []; - - // TO DO : ADD ROUTE - /*this.http.get("../../rest/???") + this.http.get("../../rest/listTemplates/entities/" + entityId) .subscribe((data: any) => { + data.listTemplate.forEach((element:any) => { + if (element.object_type === 'VISA_CIRCUIT') { + element.requested_signature = (element.item_mode === 'visa' ? false : true); + this.visaWorkflow.items.push(element); + } + }); this.loading = false; - });*/ - - this.visaWorkflow.items.push( - { - "listinstance_id": 20, - "sequence": 0, - "item_mode": "visa", - "item_id": "bbain", - "item_type": "user_id", - "item_firstname": "Barbara", - "item_lastname": "BAIN", - "item_entity": "P\u00f4le Jeunesse et Sport", - "viewed": 0, - "process_date": null, - "process_comment": "", - "signatory": false, - "requested_signature": false }); - - this.visaWorkflow.items.push( - { - "listinstance_id": 21, - "sequence": 0, - "item_mode": "sign", - "item_id": "DSG", - "item_type": "entity_id", - "item_entity": "Secr\u00e9tariat G\u00e9n\u00e9ral", - "viewed": 0, - "process_date": null, - "process_comment": null, - "signatory": true, - "requested_signature": false - } - ); - - this.loading = false; } loadWorkflow(resId: number) { @@ -100,4 +73,23 @@ export class VisaWorkflowComponent implements OnInit { getVisaCount() { return this.visaWorkflow.items.length; } + + changeRole(i: number) { + this.visaWorkflow.items[i].requested_signature = !this.visaWorkflow.items[i].requested_signature; + } + + getWorkflow() { + return this.visaWorkflow.items; + } + + checkExternalSignatoryBook() { + let usersMissing: string[] = []; + this.visaWorkflow.items.forEach((element: any) => { + if (Object.keys(element.externalId).indexOf('maarchParapheur') === -1) { + usersMissing.push(element.labelToDisplay); + } + }); + + return usersMissing; + } } \ No newline at end of file diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index ee5d5abd30a1590178c303ca134e5ae7bafb9d32..72ab32868d2746aff002d0c3b6de1a3bea209240 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1005,7 +1005,8 @@ export const LANG_EN = { "userOK" : "Active", "userSPD" : "Inactive", "userABS" : "Absent", - "noVisaWorkflow" : "No visa workflow set up.", - "visaWorkflowWillBeSend" : "Visa workflow will be send to Maarch Parapheur", - "usersNotExistedInMaarchParapheur" : "Some users does not exist in Maarch Parapheur" + "noVisaWorkflow" : "No visa workflow set up.", + "visaWorkflowWillBeSend" : "Visa workflow will be send to Maarch Parapheur", + "usersNotExistedInMaarchParapheur" : "Some users does not exist in Maarch Parapheur", + "usersMissingInSignatureBook" : "missing in Maarch Parapheur", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 86e41eaf125d047da4bf5bace316ad894f1a1bba..3eb3822cce5914484ef77313095e7f9177c15f10 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1038,7 +1038,8 @@ export const LANG_FR = { "userOK" : "Actif", "userSPD" : "Inactif", "userABS" : "Absent", - "noVisaWorkflow" : "Aucun circuit de visa paramétré.", - "visaWorkflowWillBeSend" : "Le circuit visa des courriers sera envoyé à Maarch Parapheur", - "usersNotExistedInMaarchParapheur" : "Certains utilisateurs n'existent pas dans Maarch Parapheur" + "noVisaWorkflow" : "Aucun circuit de visa paramétré.", + "visaWorkflowWillBeSend" : "Le circuit visa des courriers sera envoyé à Maarch Parapheur", + "usersNotExistedInMaarchParapheur" : "Certains utilisateurs n'existent pas dans Maarch Parapheur", + "usersMissingInSignatureBook" : "non présent dans Maarch Parapheur", }; \ No newline at end of file diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index dfd65a07d5bd6fa4884eb9282fb5b07840e39bec..9fca72d95813ac6c185ba70218757e031ab8424e 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1032,7 +1032,8 @@ export const LANG_NL = { "userOK" : "Active", //_TO_TRANSLATE "userSPD" : "Inactive", //_TO_TRANSLATE "userABS" : "Absent", //_TO_TRANSLATE - "noVisaWorkflow" : "No visa workflow set up.", //_TO_TRANSLATE - "visaWorkflowWillBeSend" : "Visa workflow will be send to Maarch Parapheur", //_TO_TRANSLATE - "usersNotExistedInMaarchParapheur" : "Some users does not exist in Maarch Parapheur", //_TO_TRANSLATE + "noVisaWorkflow" : "No visa workflow set up.", //_TO_TRANSLATE + "visaWorkflowWillBeSend" : "Visa workflow will be send to Maarch Parapheur", //_TO_TRANSLATE + "usersNotExistedInMaarchParapheur" : "Some users does not exist in Maarch Parapheur", //_TO_TRANSLATE + "usersMissingInSignatureBook" : "missing in Maarch Parapheur", //_TO_TRANSLATE }; diff --git a/src/frontend/plugins/autocomplete.plugin.ts b/src/frontend/plugins/autocomplete.plugin.ts index 1b8e7d16e5acd93e9ff0cfc0463ac4f51818476c..2be17c1db33b5288bb46791cc2fc7c6810cb22f8 100755 --- a/src/frontend/plugins/autocomplete.plugin.ts +++ b/src/frontend/plugins/autocomplete.plugin.ts @@ -56,6 +56,22 @@ export class AutoCompletePlugin { }); } + if (target.indexOf('signatureBookUsers') != -1) { + this.userCtrl = new FormControl(); + this.userCtrl.valueChanges.pipe( + debounceTime(300), + filter(value => value ? value.length > 2 : false), + distinctUntilChanged(), + switchMap(data => this.http.get(this.coreUrl + 'rest/autocomplete/maarchParapheurUsers', { params: { "search": data } })) + ).subscribe((response: any) => { + this.filteredUsers = this.userCtrl.valueChanges + .pipe( + startWith(''), + map(user => user ? this.autocompleteFilterUser(user) : response.slice()) + ); + }); + } + if (target.indexOf('statuses') != -1) { this.statusCtrl = new FormControl(); this.http.get(this.coreUrl + 'rest/autocomplete/statuses') diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 4626994fd4d8ac4c5489670d85b09af1b6d8aab0..dc02dfb114fb6af2eacf89407a529c37ab8e7eb8 100755 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -374,10 +374,14 @@ class ClassLoader $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath.'\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { return $file; } } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index 1a28124886db89f1ca3e4fa674cb69a9a17585b3..f0157a6ed025c0168a2f595d09a98b800c5ba431 100755 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,21 +1,56 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Composer +Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be> +Source: https://github.com/composer/composer -Copyright (c) 2016 Nils Adermann, Jordi Boggiano +Files: * +Copyright: 2016, Nils Adermann <naderman@naderman.de> + 2016, Jordi Boggiano <j.boggiano@seld.be> +License: Expat -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: +Files: src/Composer/Util/TlsHelper.php +Copyright: 2016, Nils Adermann <naderman@naderman.de> + 2016, Jordi Boggiano <j.boggiano@seld.be> + 2013, Evan Coury <me@evancoury.com> +License: Expat and BSD-2-Clause -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +License: BSD-2-Clause + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is furnished + to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE.