@if (!item.actions || item.loan || totalAmountOfFee || item.pending_loans || notifications$) {
}
-
+
@if (item.actionDone) {
@if ((item.actionDone === itemAction.checkin && item.getNote('checkin_note')) ||
(item.actionDone === itemAction.checkout && item.getNote('checkout_note'))) {
-
+
}
} @else {
@if (!item.actions) {
-
+
}
}
-
+
-
-
- @if (item.loan) {
-
- @switch (item.status) {
- @case ('on_loan') {
-
- {{ item.status | translate }}
-
-
- {{ item.loan.dueDate | dateTranslate :'shortDate' }}
-
-
- }
- @case ('in_transit') {
-
- {{ item.status | translate }}
- @if (getTransitLocationPid() | getRecord: 'locations' | async; as location) {
- ({{ 'to' | translate }}
- @if (item.loan && item.loan.state === 'ITEM_IN_TRANSIT_FOR_PICKUP') {
- {{ $any(location).metadata.pickup_name }}
- } @else {
- {{ $any(location).metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
- })
- }
-
- }
- @case ('on_shelf') {
- {{ item.status | translate }}
- }
- @case ('at_desk') {
-
- {{ item.status | translate }}
- @if (item.loan && item.loan.pickup_location) {
- ({{ item.loan.pickup_location.pickup_name }})
- }
- @if (!item.loan && item.pending_loans && item.pending_loans.length > 0 && item.pending_loans[0].pickup_location) {
- ({{ item.pending_loans[0].pickup_location.pickup_name }})
- }
-
- }
- @default {
- {{ item.status | translate }}
- }
- }
-
-
- @if (isCollapsed && item.loan && item.loan.extension_count && (!item.actionDone || item.actionDone !== itemAction.checkin)) {
-
- {{ item.loan.extension_count }}
-
- }
- @if (isCollapsed && totalAmountOfFee > 0) {
-
- {{ totalAmountOfFee | currency: organisation.default_currency }}
-
- }
- @if (isCollapsed && item.pending_loans && item.pending_loans.length) {
-
-
-
- {{ item.pending_loans[0].patron.name }}
-
-
- }
-
-
- } @else {
- {{ item.status | translate }}
- }
-
-
-
- @if (item.actionDone) {
- @switch (item.actionDone) {
- @case (itemAction.checkin) {
-
- checked in
- }
- @case (itemAction.checkout) {
-
- checked out
- }
- @case (itemAction.extend_loan) {
-
- renewed
- }
- @default {
- {{ item.actionDone | translate }}
- }
- }
- }
-
-
+
@if (!isCollapsed) {
-
-
- Call number
-
-
+
+
+ Call number
+
+
@if (item.enumerationAndChronology) {
- Unit
-
+ Unit
+
{{ item.enumerationAndChronology }}
}
@if (item.location.pid | getRecord: 'locations' | async; as location) {
- Location
-
+ Location
+
{{ $any(location).metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}:
{{ $any(location).metadata.name }}
}
@if (item.temporary_location) {
- Temporary location
-
+ Temporary location
+
{{ item.temporary_location.name }}
}
@if (item.collections && item.collections.length > 0) {
- Exhibition/course
-
+ Exhibition/course
+
{{ item.collections.join(', ') }}
}
@if (item.loan && item.loan.extension_count) {
- Renewals
-
+ Renewals
+
{{ item.loan.extension_count }}
@@ -213,14 +104,14 @@
}
@if (item.loan && item.actionDone === 'checkin' && item?.loan?.last_end_date) {
- Due date
-
+ Due date
+
{{ item.loan.last_end_date | dateTranslate :'shortDate' }}
}
@if (item.loan && totalAmountOfFee > 0) {
- Fees
-
+ Fees
+
{{ totalAmountOfFee | currency: organisation.default_currency }}
@@ -228,12 +119,12 @@
}
@if (item.loan && notifications$ | async; as notifications) {
@if (notifications.length > 0) {
- Notifications
-
-
+ Notifications
+
+
@for (notification of notifications; track notification) {
-
+
{{ notification.metadata.process_date
? (notification.metadata.process_date | dateTranslate :'short')
: (notification.metadata.creation_date | dateTranslate : 'shortDate')
@@ -249,8 +140,8 @@
}
}
@if (item.pending_loans) {
- Requests
-
+ Requests
+
@if (item.pending_loans.length > 1) {
{{ item.pending_loans.length }}
@@ -259,7 +150,7 @@
}
@for (request of item.pending_loans; track request) {
-
+
{{ request.patron.name }}
}
@@ -267,47 +158,174 @@
}
@for (note of getCirculationNoteForAction(); track note) {
-
-
- @if (note.type !== NOTEAPI) {
- {{ note.type | translate }}
- } @else {
- {{ 'Note' | translate }}
- }
+
+ @if (note.type !== NOTEAPI) {
+ {{ note.type | translate }}
+ } @else {
+ {{ 'Note' | translate }}
+ }
- {{ note.content }}
+ {{ note.content }}
}
- @if (debugMode) {
-
- Debug
- @if (loan) {
-
- {{ loan | json }}loan
-
- @if (loan | getLoanCipo | async; as cipo) {
-
- {{ cipo | json }}
-
- cipo
-
-
-
- }
- } @else {
-
- {{ item | json }}item
-
+
+
+ }
+
+
+
+ @if (item.loan) {
+
+ @switch (item.status) {
+ @case ('on_loan') {
+
+ {{ item.status | translate }}
+
+
+ {{ item.loan.dueDate | dateTranslate :'shortDate' }}
+
+
+ }
+ @case ('in_transit') {
+
+ {{ item.status | translate }}
+ @if (getTransitLocationPid() | getRecord: 'locations' | async; as location) {
+ ({{ 'to' | translate }}
+ @if (item.loan && item.loan.state === 'ITEM_IN_TRANSIT_FOR_PICKUP') {
+ {{ $any(location).metadata.pickup_name }}
+ } @else {
+ {{ $any(location).metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
+ })
+ }
+
+ }
+ @case ('on_shelf') {
+ {{ item.status | translate }}
+ }
+ @case ('at_desk') {
+
+ {{ item.status | translate }}
+ @if (item.loan && item.loan.pickup_location) {
+ ({{ item.loan.pickup_location.pickup_name }})
+ }
+ @if (!item.loan && item.pending_loans && item.pending_loans.length > 0 && item.pending_loans[0].pickup_location) {
+ ({{ item.pending_loans[0].pickup_location.pickup_name }})
+
+ }
+
+ }
+ @default {
+ {{ item.status | translate }}
}
}
-
- @if (canUseDebugMode) {
-
-
-
-
+
+
+ @if (isCollapsed && item.loan && item.loan.extension_count && (!item.actionDone || item.actionDone !== itemAction.checkin)) {
+
+ {{ item.loan.extension_count }}
+
+ }
+ @if (isCollapsed && totalAmountOfFee > 0) {
+
+ {{ totalAmountOfFee | currency: organisation.default_currency }}
+
+ }
+ @if (isCollapsed && item.pending_loans && item.pending_loans.length) {
+
+
+
+ {{ item.pending_loans[0].patron.name }}
+
+
+ }
+
+
+ } @else {
+ {{ item.status | translate }}
+ }
+
+
+
+
+ @if (item.actionDone) {
+
+ @switch (item.actionDone) {
+ @case (itemAction.checkin) {
+
+ checked in
+ }
+ @case (itemAction.checkout) {
+
+ checked out
+ }
+ @case (itemAction.extend_loan) {
+
+ renewed
+ }
+ @default {
+ {{ item.actionDone | translate }}
+ }
+ }
+
}
+ @if (patron && !item.actionDone) {
+
+ }
+
+ @if (canUseDebugMode && !isCollapsed) {
+
+ }
+
+ @if (debugMode && !isCollapsed) {
+
+
{{ 'Debug' | translate }}
+
+ @if (loan) {
+
+
+
Loan
+
+ {{ loan | json }}
+
+
+
+
+ @if (loan | getLoanCipo | async; as cipo) {
+
+
+ {{ 'Circulation policy' | translate }}
+
+
+
+
+
+ {{ cipo | json }}
+
+
+ }
+
+ } @else {
+
+
+
Item
+
+ {{ item | json }}
+
+
+
+ }
+
}
diff --git a/projects/admin/src/app/circulation/item/item.component.ts b/projects/admin/src/app/circulation/item/item.component.ts
index f2bc990cb..1998972ba 100644
--- a/projects/admin/src/app/circulation/item/item.component.ts
+++ b/projects/admin/src/app/circulation/item/item.component.ts
@@ -30,8 +30,7 @@ import { map } from 'rxjs/operators';
@Component({
selector: 'admin-item',
- templateUrl: './item.component.html',
- styleUrls: ['../circulation.scss']
+ templateUrl: './item.component.html'
})
export class ItemComponent implements OnInit {
diff --git a/projects/admin/src/app/circulation/items-list/items-list.component.html b/projects/admin/src/app/circulation/items-list/items-list.component.html
index 6e58e63a3..8164e4fd7 100644
--- a/projects/admin/src/app/circulation/items-list/items-list.component.html
+++ b/projects/admin/src/app/circulation/items-list/items-list.component.html
@@ -21,44 +21,53 @@
}
@if ((checkedOutItems && checkedOutItems.length > 0) || (checkedInItems && checkedInItems.length > 0)) {
-
-
-
- {{ 'Items' | translate }}
-
-
Document
-
Circulation info
-
- @if (patron) {
-
+
+
+
+
Document
+
Circulation info
+
+
+
+
+
+
+ @for (item of checkedOutItems; track item) {
+
}
-
-
-
- @for (item of checkedOutItems; track item) {
-
-
- }
-
-
-
- @for (item of checkedInItems; track item) {
-
-
- }
+
+
+ @for (item of checkedInItems; track item) {
+
+ }
+
+
}
diff --git a/projects/admin/src/app/circulation/items-list/items-list.component.ts b/projects/admin/src/app/circulation/items-list/items-list.component.ts
index 6b90bcd1b..a755f7e98 100644
--- a/projects/admin/src/app/circulation/items-list/items-list.component.ts
+++ b/projects/admin/src/app/circulation/items-list/items-list.component.ts
@@ -21,7 +21,6 @@ import { ItemAction } from '../../classes/items';
@Component({
selector: 'admin-circulation-items-list',
- styleUrls: ['./items-list.component.scss'],
templateUrl: './items-list.component.html'
})
export class ItemsListComponent implements OnInit{
diff --git a/projects/admin/src/app/circulation/main-request/main-request.component.html b/projects/admin/src/app/circulation/main-request/main-request.component.html
index dd265ff9c..0c73d4620 100644
--- a/projects/admin/src/app/circulation/main-request/main-request.component.html
+++ b/projects/admin/src/app/circulation/main-request/main-request.component.html
@@ -25,30 +25,49 @@
/>
-
-
+
-
-
0" (onChange)="enableAutoRefresh($event.checked)" />
- Auto refresh
+
+
+
0" (onChange)="enableAutoRefresh($event.checked)" />
+ Auto refresh
+
+
+ @if (refreshInterval > 0) {
+
+
+
+
+
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+
+
+
- @if (refreshInterval > 0) {
-
- }
-
-
@@ -56,7 +75,6 @@
diff --git a/projects/admin/src/app/circulation/main-request/main-request.component.ts b/projects/admin/src/app/circulation/main-request/main-request.component.ts
index 433da8321..31d466297 100644
--- a/projects/admin/src/app/circulation/main-request/main-request.component.ts
+++ b/projects/admin/src/app/circulation/main-request/main-request.component.ts
@@ -38,24 +38,24 @@ export class MainRequestComponent implements OnInit, OnDestroy {
// COMPONENT ATTRIBUTES ==================================================================
/** options used for auto-refresh select box */
public refreshOptions = [
- {value: '15000', label: '15 s', icon: 'fa-clock-o'},
- {value: '30000', label: '30 s', icon: 'fa-clock-o'},
- {value: '60000', label: '1 m', icon: 'fa-clock-o'},
- {value: '300000', label: '5 m', icon: 'fa-clock-o'},
- {value: '600000', label: '10 m', icon: 'fa-clock-o'},
- {value: '3000000', label: '30 m', icon: 'fa-clock-o'}
+ {value: '15000', label: '15 s', icon: 'fa fa-clock-o'},
+ {value: '30000', label: '30 s', icon: 'fa fa-clock-o'},
+ {value: '60000', label: '1 m', icon: 'fa fa-clock-o'},
+ {value: '300000', label: '5 m', icon: 'fa fa-clock-o'},
+ {value: '600000', label: '10 m', icon: 'fa fa-clock-o'},
+ {value: '3000000', label: '30 m', icon: 'fa fa-clock-o'}
];
/** options used to sort requested items list */
public sortingCriteria = [
- {value: 'requestdate', label: this.translateService.instant('Request date'), icon: 'fa-sort-numeric-asc'},
- {value: '-requestdate', label: this.translateService.instant('Request date (desc)'), icon: 'fa-sort-numeric-desc'},
- {value: 'callnumber', label: this.translateService.instant('Call number'), icon: 'fa-sort-alpha-asc'},
- {value: '-callnumber', label: this.translateService.instant('Call number (desc)'), icon: 'fa-sort-alpha-desc'},
- {value: 'location', label: this.translateService.instant('Location'), icon: 'fa-sort-alpha-asc'},
- {value: '-location', label: this.translateService.instant('Location (desc)'), icon: 'fa-sort-alpha-desc'},
- {value: 'pickuplocation', label: this.translateService.instant('Pick-up location'), icon: 'fa-sort-alpha-asc'},
- {value: '-pickuplocation', label: this.translateService.instant('Pick-up location (desc)'), icon: 'fa-sort-alpha-desc'},
+ {value: 'requestdate', label: this.translateService.instant('Request date'), icon: 'fa fa-sort-numeric-asc'},
+ {value: '-requestdate', label: this.translateService.instant('Request date (desc)'), icon: 'fa fa-sort-numeric-desc'},
+ {value: 'callnumber', label: this.translateService.instant('Call number'), icon: 'fa fa-sort-alpha-asc'},
+ {value: '-callnumber', label: this.translateService.instant('Call number (desc)'), icon: 'fa fa-sort-alpha-desc'},
+ {value: 'location', label: this.translateService.instant('Location'), icon: 'fa fa-sort-alpha-asc'},
+ {value: '-location', label: this.translateService.instant('Location (desc)'), icon: 'fa fa-sort-alpha-desc'},
+ {value: 'pickuplocation', label: this.translateService.instant('Pick-up location'), icon: 'fa fa-sort-alpha-asc'},
+ {value: '-pickuplocation', label: this.translateService.instant('Pick-up location (desc)'), icon: 'fa fa-sort-alpha-desc'},
];
/** the placeholder string used on the */
@@ -66,8 +66,6 @@ export class MainRequestComponent implements OnInit, OnDestroy {
public items = null;
/** the interval (in millis) between 2 calls of requested items (0 = no refresh) */
public refreshInterval = 0;
- /** is the requested items detail should be collapsed or not */
- public isDetailCollapsed = true;
/** Focus attribute of the search input */
public searchInputFocus = true;
/** Disabled attribute of the search input */
diff --git a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html
index 1ee714091..9a0912b43 100644
--- a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html
+++ b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html
@@ -1,6 +1,6 @@
@if (document) {
-
-
+
+
+
+
+
+
+
{{ item.loan.creation_date | dateTranslate :'medium' }}
+
@if (item.loan.state === LoanState.PENDING) {
}
-
-
-
- @if (document.title | mainTitle; as title) {
-
- {{ title }}
-
+ @if (!isCollapsed) {
+
+
+ @if (item.enumerationAndChronology) {
+ Unit
+ {{ item.enumerationAndChronology }}
}
-
-
-
-
-
-
{{ item.loan.creation_date | dateTranslate :'medium' }}
-
- @if (!isCollapsed) {
-
-
-
- @if (item.enumerationAndChronology) {
- Unit
- {{ item.enumerationAndChronology }}
- }
-
- Requested by
-
-
- {{ item.loan.patron.name }}
-
-
-
- Location
-
- {{ item.library.name }} -
- @if (item.temporary_location?.name) {
- {{ item.temporary_location.name }}
- } @else {
- {{ item.location.name }}
- }
+
+ Requested by
+
+
+ {{ item.loan.patron.name }}
+
+
+
+ Location
+
+ {{ item.library.name }} -
+ @if (item.temporary_location?.name) {
+ {{ item.temporary_location.name }}
+ } @else {
+ {{ item.location.name }}
+ }
-
- Pick-up location
-
-
-
- @if (item.loan.pickup_location.pickup_name) {
- {{ item.loan.pickup_location.pickup_name }}
- } @else {
- {{ item.loan.pickup_location.library_name }}: {{ item.loan.pickup_location.name }}
- }
-
-
-
- }
+
+
Pick-up location
+
+
+
+ @if (item.loan.pickup_location.pickup_name) {
+ {{ item.loan.pickup_location.pickup_name }}
+ } @else {
+ {{ item.loan.pickup_location.library_name }}: {{ item.loan.pickup_location.name }}
+ }
+
+
+ }
}
diff --git a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts
index 1cac3d87b..f71920aee 100644
--- a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts
+++ b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts
@@ -21,8 +21,7 @@ import { RecordService } from '@rero/ng-core';
@Component({
selector: 'admin-requested-item',
- templateUrl: './requested-item.component.html',
- styleUrls: ['./requested-item.component.scss']
+ templateUrl: './requested-item.component.html'
})
export class RequestedItemComponent implements OnInit {
@@ -67,7 +66,6 @@ export class RequestedItemComponent implements OnInit {
getCallout() {
return (this.callout !== null)
? `callout ${this.callout}`
- : 'border rounded';
+ : null;
}
-
}
diff --git a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html
index 5eaee360f..41b91b6e3 100644
--- a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html
+++ b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html
@@ -1,6 +1,6 @@
-
-
-
Item
-
Document
-
Call number
-
Request date
-
-
-@if (items) {
- @if (items.length > 0) {
- @for (item of items; track item) {
-
+@defer (when items) {
+
+
+
+
+
+
Document
+
Call number
+
Request date
+
+
+
+ @if (items.length > 0) {
+
+ @for (item of items; track item) {
+
+ }
+
+ } @else {
+
+ {{ 'no request to validate' | translate }}
+
}
- } @else {
- {{ 'no request to validate' | translate }}
- }
+
+} @placeholder {
+
Loading in progress
}
diff --git a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts
index c0bc2cb0e..e31dd851c 100644
--- a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts
+++ b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts
@@ -28,11 +28,12 @@ export class RequestedItemsListComponent implements OnChanges {
// COMPONENT ATTRIBUTES ====================================================
/** Item list */
@Input() items: any[];
- /** Is the item detail should be collapsed */
- @Input() isCollapsed: boolean;
+
/** event emit when a request is validated */
@Output() requestValidated = new EventEmitter();
+ /** Is the item detail should be collapsed */
+ isCollapsed: boolean = true;
/** the know item barcode list */
private knownItemBarcodes: Array
= null;
@@ -68,5 +69,4 @@ export class RequestedItemsListComponent implements OnChanges {
validateRequest(itemBarcode: string) {
this.requestValidated.emit(itemBarcode);
}
-
}
diff --git a/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts b/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts
index 35061e00c..ada05bbd7 100644
--- a/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts
+++ b/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts
@@ -24,22 +24,17 @@ import { MessageService } from 'primeng/api';
@Component({
selector: 'admin-cancel-request-button',
template: `
- @if (canCancelRequest()) {
- } @else {
-
- }
`
})
export class CancelRequestButtonComponent {
diff --git a/projects/admin/src/app/circulation/patron/card/card.component.html b/projects/admin/src/app/circulation/patron/card/card.component.html
index 5f66fdb1b..3a954e7e6 100644
--- a/projects/admin/src/app/circulation/patron/card/card.component.html
+++ b/projects/admin/src/app/circulation/patron/card/card.component.html
@@ -15,11 +15,11 @@
along with this program. If not, see .
-->
@if (patron?.patron) {
-
+
-
+
-
+ @if (clearPatronButton) {
+
+ }
@if (patron.notes) {
-
+
@for (note of patron.notes; track note) {
- {{ note.type | translate | ucfirst }}
+ {{ note.type | translate | ucfirst }}
}
@@ -75,7 +77,7 @@
}
-
+
@if (displayCirculationMessages) {
@if (patron.circulation_information) {
@@ -88,14 +90,12 @@
/>
}
}
- @for (message of circulationMessages; track message) {
-
- }
+
}
diff --git a/projects/admin/src/app/circulation/patron/card/card.component.scss b/projects/admin/src/app/circulation/patron/card/card.component.scss
index a3ed182c0..220c186e6 100644
--- a/projects/admin/src/app/circulation/patron/card/card.component.scss
+++ b/projects/admin/src/app/circulation/patron/card/card.component.scss
@@ -29,3 +29,7 @@
visibility: hidden;
}
}
+
+.p-message {
+ @extend .mt-0;
+}
diff --git a/projects/admin/src/app/circulation/patron/card/card.component.ts b/projects/admin/src/app/circulation/patron/card/card.component.ts
index a0ee6920d..d9de70be1 100644
--- a/projects/admin/src/app/circulation/patron/card/card.component.ts
+++ b/projects/admin/src/app/circulation/patron/card/card.component.ts
@@ -14,17 +14,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see
.
*/
-import { Component, EventEmitter, inject, Input, Output } from '@angular/core';
+import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core';
import { DateTime } from 'luxon';
import { getSeverity } from '../../../utils/utils';
import { CirculationService } from '../../services/circulation.service';
@Component({
selector: 'admin-circulation-patron-detailed',
- templateUrl: './card.component.html',
- styleUrls: ['./card.component.scss']
+ templateUrl: './card.component.html'
})
-export class CardComponent {
+export class CardComponent implements OnInit {
private circulationService: CirculationService = inject(CirculationService);
@@ -42,40 +41,38 @@ export class CardComponent {
/** event emitter when the close button are fired */
@Output() clearPatron = new EventEmitter
();
- // GETTER & SETTER ==========================================================
- /** Build the link used on the patron name */
- get patronLink(): string {
+ /** Link used on the patron name */
+ patronLink: string;
+ /** it's the birthday of the patron */
+ isBirthday: boolean = false;
+ /** Patron age */
+ patronAge: number;
+ /** circulation messages about the loaded patron if exists */
+ circulationMessages: {severity: string, detail: string}[] = [];
+
+ ngOnInit(): void {
if (this.patron) {
- return (this.linkMode === 'detail')
+ this.patronLink = (this.linkMode === 'detail')
? '/records/patrons/detail/' + this.patron.pid
: '/circulation/patron/' + this.barcode + '/loan';
}
- }
- /** Get the patron age */
- get patronAge(): number {
if (this.patron && this.patron.birth_date) {
- const birthDate = DateTime.fromISO(this.patron.birth_date);
- return Math.floor(DateTime.now().diff(birthDate, 'years').years);
+ const today = DateTime.now().toFormat('M-dd');
+ const birthDate = DateTime.fromISO(this.patron.birth_date).toFormat('M-dd');
+ if (today === birthDate) {
+ this.isBirthday = true;
+ }
}
- }
- /** Defined if it's the birthday of the patron */
- get isBirthday(): boolean {
if (this.patron && this.patron.birth_date) {
- const today = DateTime.fromISO(DateTime.now().toFormat('yyyy-M-d'));
const birthDate = DateTime.fromISO(this.patron.birth_date);
- return today.diff(birthDate, 'years').years % 1 === 0;
+ this.patronAge = Math.floor(DateTime.now().diff(birthDate, 'years').years);
}
- return false;
- }
- /** Get the circulation messages about the loaded patron if exists */
- get circulationMessages(): Array<{type: string, content: string}> {
- return this.circulationService.messages();
+ this.circulationMessages = this.circulationService.messages();
}
- // COMPONENT FUNCTIONS ======================================================
/** Clear current patron */
clear(): void {
if (this.patron) {
@@ -91,5 +88,4 @@ export class CardComponent {
getMessageSeverity(level: string): string {
return getSeverity(level);
}
-
}
diff --git a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html
index 335b2291f..5222a705e 100644
--- a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html
+++ b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html
@@ -15,15 +15,15 @@
along with this program. If not, see .
-->
@if (form) {
-
+
}
diff --git a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts
index 26fcabf94..15083811a 100644
--- a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts
+++ b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts
@@ -95,12 +95,12 @@ export class ChangePasswordFormComponent implements OnInit {
{
key: 'password',
type: 'passwordGenerator',
- focus: true,
props: {
+ class: 'surface-100',
api: "/api/user/password/generate",
- label: this.translateService.instant('New password'),
+ label: 'New password',
required: true,
- keydown: (field, event) => {
+ keydown: (_, event) => {
if (event.key === 'Enter') {
event.preventDefault();
}
diff --git a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.html b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.html
index f2851b3f0..8bd20e7a3 100644
--- a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.html
+++ b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.html
@@ -14,10 +14,10 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
-->
-
+
-
-
+
+
-
+
@if (document?.metadata?.contribution && document.metadata.contribution.length > 0) {
- } @else {
-
}
-
+
{{ log.metadata.date | dateTranslate: 'short' }}
@if (!isCollapsed) {
-
+
@if (log.metadata.loan.item.pid | getRecord:'items' | async; as item) {
-
+
Item
}
Transaction history
-
-
-
-
- {{ log.metadata.date | dateTranslate: 'short' }}
-
-
-
-
-
- {{ 'Checkin' | translate }}
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ event.type | translate }}
+
-
-
-
- @if (checkout) {
-
-
- {{ checkout.metadata.date | dateTranslate: 'short' }}
-
-
-
-
-
- {{ 'Checkout' | translate }}
-
-
-
-
-
+
+
- }
-
+
+
+
+ {{ event.date | dateTranslate: 'shortDate' }}
+ {{ event.date | dateTranslate: 'HH:mm:ss' }}
+
+
+
}
diff --git a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts
index 9987dcc62..16685b006 100644
--- a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts
+++ b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2021-2024 RERO
+ * Copyright (C) 2021-2025 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -37,15 +37,23 @@ export class HistoryLogComponent {
provisionActivityType = ProvisionActivityType;
/** Checkout record operation logs */
- checkout: any = null;
+ checkoutLoaded: boolean = false;
+
+ events: any[] = [];
/** Load checkout */
loadCheckout() {
- if (this.checkout === null) {
+ if (!this.checkoutLoaded) {
this.operationLogsApiService
.getHistoryByLoanPid(this.log.metadata.loan.pid, 'checkout')
.subscribe((log: any) => {
- this.checkout = log;
+ this.checkoutLoaded = true;
+ this.log.metadata['type'] = 'Checkin';
+ this.events = [this.log.metadata];
+ if (log) {
+ log.metadata['type'] = 'Checkout';
+ this.events.push(log.metadata);
+ }
});
}
}
diff --git a/projects/admin/src/app/circulation/patron/history/history.component.html b/projects/admin/src/app/circulation/patron/history/history.component.html
index 5b3188c9c..24d79ff07 100644
--- a/projects/admin/src/app/circulation/patron/history/history.component.html
+++ b/projects/admin/src/app/circulation/patron/history/history.component.html
@@ -1,6 +1,6 @@
-
-
Title
-
Authors
-
Return date
+
+
Title
+
Authors
+
Return date
+
+
+ @for (log of logs; track log) {
+
+ }
-
- @for (log of logs; track log) {
-
- }
} @else {
- {{ 'No history.' | translate }}
+
No history.
}
}
-
-
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html
index 128f8a1aa..a100d8cbf 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html
@@ -15,9 +15,9 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
-->
-
+
-
+
{{ record.metadata.document.title }}
@@ -39,35 +39,35 @@
@if (!isCollapsed) {
-
-
+
+
@if (record.metadata.document.publisher) {
- Publisher
- {{ record.metadata.document.publisher }}
+ Publisher
+ {{ record.metadata.document.publisher }}
}
@if (record.metadata.document.year) {
- Year
- {{ record.metadata.document.year }}
+ Year
+ {{ record.metadata.document.year }}
}
@if (record.metadata.document.identifier) {
- Identifier
- {{ record.metadata.document.identifier }}
+ Identifier
+ {{ record.metadata.document.identifier }}
}
@if (record.metadata.document.source) {
- Source
-
+ Source
+
@if (record.metadata.document.source.volume || record.metadata.document.source.number) {
{{ record.metadata.document.source | journalVolume }}
}
}
- Scope
-
+ Scope
+
@if (record.metadata.copy) {
{{ 'Copy' | translate }}
} @else {
@@ -76,33 +76,31 @@
@if (record.metadata.copy && record.metadata.pages) {
- Pages
- {{ record.metadata.pages }}
+ Pages
+ {{ record.metadata.pages }}
}
@if (record.metadata.found_in) {
- Found in
-
+ Found in
+
{{ record.metadata.found_in.url }}
}
- Request status
-
+ Request status
+
@if (record.metadata.notes && record.metadata.notes.length > 0) {
- Note
-
-
-
- @for (note of record.metadata.notes; track note) {
-
- }
-
-
+ Note
+
+
+ @for (note of record.metadata.notes; track note) {
+
+ }
+
}
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts
index effe50a4f..42d9d33a2 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts
@@ -20,8 +20,7 @@ import { getTagSeverityFromStatus } from '@app/admin/utils/utils';
@Component({
selector: 'admin-ill-request-item',
- templateUrl: './ill-request-item.component.html',
- styleUrls: ['../../../circulation.scss']
+ templateUrl: './ill-request-item.component.html'
})
export class IllRequestItemComponent {
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html
index 1b0c09676..d8a7a67d8 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html
@@ -1,6 +1,6 @@
-@if (illRequests$ | async; as illRequests) {
-
- @if (illRequests.length > 0) {
-
-
-
Document
+@if(illRequests$ | async; as illRequests) {
+
+
+
+
Document
Pickup location
Request date
Loan status
-
+
+
+
+ @if (illRequests.length > 0) {
+
+ @for (record of illRequests; track record) {
+
+ }
- @for (record of illRequests; track record) {
-
- }
} @else {
- {{ 'No ill request.' | translate }}
+
+ No ill request.
+
}
-
+
+} @else {
+
Loading in progress
}
diff --git a/projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.ts b/projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.ts
index a267a1731..28b057a9f 100644
--- a/projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.ts
+++ b/projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.ts
@@ -63,8 +63,8 @@ export class CirculationSettingsComponent implements OnInit {
private openFixedEndDateDialog(): void {
this.dialogRef = this.dialogService.open(FixedDateFormComponent, {
header: this.translateService.instant('Choose a due date'),
+ focusOnShow: false,
width: '30vw',
- height: '600px'
});
this.dialogRef.onClose.subscribe((result?: any) => {
if (result && 'action' in result && result.action === 'submit') {
diff --git a/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html b/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html
index 833e66cfe..acbfbd274 100644
--- a/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html
+++ b/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html
@@ -1,6 +1,6 @@