Skip to content

Commit

Permalink
circulation: allow request for organisation items
Browse files Browse the repository at this point in the history
The request document button was only available for the current library
items. This commit updates this behavior; now all items of the current
logged user application can be requested.

Closes rero/rero-ils#927

Co-authored-by: Renaud Michotte <[email protected]>
  • Loading branch information
zannkukai committed Aug 25, 2020
1 parent 94ea8e6 commit 19447f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,21 @@
{{ callNumber }}
</div>
<div class="col-sm-4 text-right">
<ng-container *ngIf="isHoldingMatchUserLibraryPID">
<button *ngIf="permissions.canRequest && permissions.canRequest.can; else notRequest"
type="button" class="btn btn-sm btn-outline-primary " (click)="addRequest(item.metadata.pid)"
<button *ngIf="permissions.canRequest && permissions.canRequest.can; else notRequest"
type="button" class="btn btn-sm btn-outline-primary " (click)="addRequest(item.metadata.pid)"
title="{{ 'Item request' | translate}}"
name="request">
<i class="fa fa-shopping-basket" aria-hidden="true"></i>
</button>
<ng-template #notRequest>
<button type="buttton" class="btn btn-sm btn-outline-primary disabled"
title="{{ 'Item request' | translate}}"
[popover]="tolTemplate" triggers="mouseenter:mouseleave"
name="request">
<i class="fa fa-shopping-basket" aria-hidden="true"></i>
</button>
<ng-template #notRequest>
<button type="buttton" class="btn btn-sm btn-outline-primary disabled"
title="{{ 'Item request' | translate}}"
[popover]="tolTemplate" triggers="mouseenter:mouseleave"
name="request">
<i class="fa fa-shopping-basket" aria-hidden="true"></i>
</button>
<ng-template #tolTemplate><div [innerHtml]="cannotRequestInfoMessage | nl2br"></div></ng-template>
</ng-template>
</ng-container>
<ng-template #tolTemplate><div [innerHtml]="cannotRequestInfoMessage | nl2br"></div></ng-template>
</ng-template>
<button *ngIf="permissions.update && permissions.update.can"
type="button" class="btn btn-sm btn-outline-primary ml-1"
title="{{ 'Edit' | translate}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ export class DefaultHoldingItemComponent implements OnInit {
});
}

/** Check if the holding owning library correspond to the current user library affiliation.
*
* Used to display the request button. A more advanced test is performed when the patron barcode is known.
* @returns - true if match
*/
get isHoldingMatchUserLibraryPID(): boolean {
return this._userService.getCurrentUser().currentLibrary === this.holding.metadata.library.pid;
}

/**
* Get formatted call number
*
Expand Down

0 comments on commit 19447f4

Please sign in to comment.