8000 fix(circ): error when no item note by PascalRepond · Pull Request #1189 · rero/rero-ils-ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(circ): error when no item note #1189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ export class CheckinComponent implements OnInit {
this.getPatronInfo(item.action_applied.checkin.patron.barcode);
}
if (item.status === ItemStatus.IN_TRANSIT) {
const destination = item.loan.item_destination.library_name;
this.toastService.warning(
this.translate.instant('The item is ' + ItemStatus.IN_TRANSIT),
this.translate.instant('The item is in transit to {{ destination }}', {destination}),
this.translate.instant('Checkin')
);
}
Expand Down
17 changes: 10 additions & 7 deletions projects/admin/src/app/circulation/item/item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,17 @@ export class ItemComponent implements OnInit {
*/
getCirculationNoteForAction(): ItemNote[] {
if (this.item.actionDone) {
if (
(this.item.actionDone === this.itemAction.checkin)
|| (((this.item.actionDone === this.itemAction.receive) && this.item.library.pid === this.userService.user.currentLibrary))
) {
return [this.item.getNote(ItemNoteType.CHECKIN)];
const checkinNote = this.item.getNote(ItemNoteType.CHECKIN)
if (checkinNote && (
(this.item.actionDone === this.itemAction.checkin) || (
(((this.item.actionDone === this.itemAction.receive) && this.item.library.pid === this.userService.user.currentLibrary))
)
)) {
return [checkinNote];
}
if (this.item.actionDone === this.itemAction.checkout) {
return [this.item.getNote(ItemNoteType.CHECKOUT)];
const checkoutNote = this.item.getNote(ItemNoteType.CHECKOUT)
if (checkoutNote && this.item.actionDone === this.itemAction.checkout) {
return [checkoutNote];
}
} else if (this.item.notes) {
// Notes for item without loan.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ export class LoanComponent implements OnInit, OnDestroy {
);
}
if (item.status === ItemStatus.IN_TRANSIT) {
const destination = item.loan.item_destination.library_name;
this.toastService.warning(
this.translateService.instant('The item is in transit'),
this.translateService.instant('The item is in transit to {{ destination }}', {destination}),
this.translateService.instant('Checkin')
);
}
Expand Down Expand Up @@ -292,7 +293,7 @@ export class LoanComponent implements OnInit, OnDestroy {
if (newItem.status === ItemStatus.IN_TRANSIT) {
const destination = newItem.loan.item_destination.library_name;
this.toastService.warning(
this.translateService.instant('The item is in transit to [{{ destination }}]', {destination}),
this.translateService.instant('The item is in transit to {{ destination }}', {destination}),
this.translateService.instant('Checkin')
);
}
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "The item is {{ status }}",
"The item is already checked out or requested by this patron.": "تم بالفعل اعارة أو طلب النسخة من قبل المستفيد.",
"The item is already in the list.": "النسخة موجودة في القائمة",
"The item is in transit": "The item is in transit",
"The item is in transit to [{{ destination }}]": "The item is in transit to [{{ destination }}]",
"The item is in transit to {{ destination }}": "The item is in transit to {{ destination }}",
"The item status does not allow requests.": "حالة النسخة لا تسمح بطلبات جديدة",
"The maximum number of files is reached. No additional upload is allowed.": "The maximum number of files is reached. No additional upload is allowed.",
"The notifications for patrons without e-mail are sent to this address.": "The notifications for patrons without e-mail are sent to this address.",
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "The item is {{ status }}",
"The item is already checked out or requested by this patron.": "Das Exemplar ist von diesem Kunde bereits bestellt oder ausgeliehen.",
"The item is already in the list.": "Das Exemplar ist bereits in der Liste.",
"The item is in transit": "Das Exemplar ist in Transit",
"The item is in transit to [{{ destination }}]": "Das Exemplar ist in Transit nach [{{ destination }}]",
"The item is in transit to {{ destination }}": "Das Exemplar ist in Transit nach {{ destination }}",
"The item status does not allow requests.": "Der Exemplarstatus erlaubt keine Bestellungen.",
"The maximum number of files is reached. No additional upload is allowed.": "Die maximale Anzahl von Dateien ist erreicht. Ein weiterer Upload ist nicht möglich.",
"The notifications for patrons without e-mail are sent to this address.": "Die Benachrichtigungen für Kunden ohne E-Mail werden an diese Adresse gesendet.",
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "The item is {{ status }}",
"The item is already checked out or requested by this patron.": "The item is already checked out or requested by this patron.",
"The item is already in the list.": "The item is already in the list.",
"The item is in transit": "The item is in transit",
"The item is in transit to [{{ destination }}]": "The item is in transit to [{{ destination }}]",
"The item is in transit to {{ destination }}": "The item is in transit to {{ destination }}",
"The item status does not allow requests.": "The item status does not allow requests.",
"The maximum number of files is reached. No additional upload is allowed.": "The maximum number of files is reached. No additional upload is allowed.",
"The notifications for patrons without e-mail are sent to this address.": "The notifications for patrons without e-mail are sent to this address.",
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "The item is {{ status }}",
"The item is already checked out or requested by this patron.": "The item is already checked out or requested by this patron.",
"The item is already in the list.": "The item is already in the list.",
"The item is in transit": "The item is in transit",
"The item is in transit to [{{ destination }}]": "The item is in transit to [{{ destination }}]",
"The item is in transit to {{ destination }}": "The item is in transit to {{ destination }}",
"The item status does not allow requests.": "The item status does not allow requests.",
"The maximum number of files is reached. No additional upload is allowed.": "The maximum number of files is reached. No additional upload is allowed.",
"The notifications for patrons without e-mail are sent to this address.": "The notifications for patrons without e-mail are sent to this address.",
Expand Down
2 changes: 1 addition & 1 deletion projects/admin/src/assets/rero-ils-ui/admin/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@
"The item is already checked out or requested by this patron.": "El ejemplar ya está eb préstamo o reservado por el usuario.",
"The item is already in the list.": "El ejemplar ya está en la lista.",
"The item is in transit": "El ejemplar está en tránsito",
"The item is in transit to [{{ destination }}]": "El ejemplar está en tránsito a [{{ destination }}]",
"The item is in transit to {{ destination }}": "El ejemplar está en tránsito a {{ destination }}",
"The item status does not allow requests.": "El estado del ejemplar no permite reservaciones.",
"The maximum number of files is reached. No additional upload is allowed.": "The maximum number of files is reached. No additional upload is allowed.",
"The notifications for patrons without e-mail are sent to this address.": "Las notificaciones para los usuarios sin correo electrónico se envían a esta dirección.",
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "L'exemplaire est {{ status }}",
"The item is already checked out or requested by this patron.": "L'exemplaire est déjà en prêt ou demandé par ce lecteur.",
"The item is already in the list.": "L'exemplaire est déjà dans la liste.",
"The item is in transit": "L'exemplaire est en transit",
"The item is in transit to [{{ destination }}]": "L'exemplaire est en transit vers [{{ destination }}]",
"The item is in transit to {{ destination }}": "L'exemplaire est en transit vers {{ destination }}",
"The item status does not allow requests.": "Le statut de l'exemplaire n'autorise pas les demandes.",
"The maximum number of files is reached. No additional upload is allowed.": "Nombre maximum de fichiers atteint. Aucun chargement supplémentaire autorisé.",
"The notifications for patrons without e-mail are sent to this address.": "Les notifications aux lecteurs sans e-mail sont envoyées à cette adresse.",
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "The item is {{ status }}",
"The item is already checked out or requested by this patron.": "L'esemplare è già in prestito o richiesto da questo lettore.",
"The item is already in the list.": "L'esemplare è già nella lista.",
"The item is in transit": "L'esemplare è in transito",
"The item is in transit to [{{ destination }}]": "L'esemplare è in transito verso [{{ destinazione }}]",
"The item is in transit to {{ destination }}": "L'esemplare è in transito verso {{ destination }}",
"The item status does not allow requests.": "Lo stato dell'esemplare non consente le richieste.",
"The maximum number of files is reached. No additional upload is allowed.": "È stato raggiunto il numero massimo di file. Non è consentito un ulteriore caricamento.",
"The notifications for patrons without e-mail are sent to this address.": "Le notifiche per i lettori senza e-mail vengono inviate a questo indirizzo.",
Expand Down
3 changes: 1 addition & 2 deletions projects/admin/src/assets/rero-ils-ui/admin/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,7 @@
"The item is {{ status }}": "The item is {{ status }}",
"The item is already checked out or requested by this patron.": "Item is al uitleend of aangevraagd door de lezer.",
"The item is already in the list.": "Het exemplaar staat al in de lijst",
"The item is in transit": "The item is in transit",
"The item is in transit to [{{ destination }}]": "The item is in transit to [{{ destination }}]",
"The item is in transit to {{ destination }}": "The item is in transit to {{ destination }}",
"The item status does not allow requests.": "The item status does not allow requests.",
"The maximum number of files is reached. No additional upload is allowed.": "The maximum number of files is reached. No additional upload is allowed.",
"The notifications for patrons without e-mail are sent to this address.": "The notifications for patrons without e-mail are sent to this address.",
Expand Down
2 changes: 1 addition & 1 deletion projects/admin/src/manual_translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ _('Circulation policy disallows the operation.');
_('No circulation action performed');
_('Item returned at owning library');
_('The item is {{ status }}');
_('The item is in transit to [{{ destination }}]');
_('The item is in transit to {{ destination }}');
_('Checkout is not allowed by circulation policy');

// item note
Expand Down
Loading
0