From b7afb8e8a2124e0e8a7afd079a72e6245c7f43dc Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 17 Mar 2023 09:24:22 +0000 Subject: [PATCH] Bug 32752: Use an include to display the serial status in the staff interface This moves the identical code used to display the serial status from the different templates into one common include. To test: * Add a subscription * Receive several issues, make sure 2 are late * Claim one of the late issues * Verify the status displays nicely on these pages: * Subscription detail page > issues tab * Catalog detail page > subscription tab * Serial claims page * Serial collection page of your subscription Note: there was some code for the subscription detail page that should have displayed the claim date, but didn't work. To keep things simpler and identical to before, I have left that bit out for now. Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Michaela Sieber Signed-off-by: Lucas Gass Signed-off-by: Tomas Cohen Arazi --- .../prog/en/includes/serial-status.inc | 12 ++++++++++++ .../prog/en/modules/catalogue/detail.tt | 13 +------------ .../prog/en/modules/serials/claims.tt | 9 +-------- .../en/modules/serials/serials-collection.tt | 13 +------------ .../en/modules/serials/subscription-detail.tt | 18 +----------------- 5 files changed, 16 insertions(+), 49 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/serial-status.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serial-status.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serial-status.inc new file mode 100644 index 0000000000..456171ecf2 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serial-status.inc @@ -0,0 +1,12 @@ +[% IF ( serial.status1 ) %]Expected[% END %] +[% IF ( serial.status2 ) %]Arrived[% END %] +[% IF ( serial.status3 ) %]Late[% END %] +[% IF ( serial.status4 ) %]Missing[% END %] + [% IF ( serial.status41 ) %]Missing (never received)[% END %] + [% IF ( serial.status42 ) %]Missing (sold out)[% END %] + [% IF ( serial.status43 ) %]Missing (damaged)[% END %] + [% IF ( serial.status44 ) %]Missing (lost)[% END %] +[% IF ( serial.status5 ) %]Not available[% END %] +[% IF ( serial.status6 ) %]Delete[% END %] +[% IF ( serial.status7 ) %]Claimed[% END %] +[% IF ( serial.status8 ) %]Stopped[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 60a2944610..74ecc00d7f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -798,18 +798,7 @@ [% latestserial.publisheddate | $KohaDates %] [% latestserial.publisheddatetext | html %] - [% IF ( latestserial.status1 ) %]Expected[% END %] - [% IF ( latestserial.status2 ) %]Arrived[% END %] - [% IF ( latestserial.status3 ) %]Late[% END %] - [% IF ( latestserial.status4 ) %]Missing[% END %] - [% IF ( latestserial.status41 ) %]Missing (never received)[% END %] - [% IF ( latestserial.status42 ) %]Missing (sold out)[% END %] - [% IF ( latestserial.status43 ) %]Missing (damaged)[% END %] - [% IF ( latestserial.status44 ) %]Missing (lost)[% END %] - [% IF ( latestserial.status5 ) %]Not issued[% END %] - [% IF ( latestserial.status6 ) %]Delete[% END %] - [% IF ( latestserial.status7 ) %]Claimed[% END %] - [% IF ( latestserial.status8 ) %]Stopped[% END %] + [% INCLUDE 'serial-status.inc' serial = latestserial %] [% latestserial.notes | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt index d1cecc3d03..366b6563b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -153,14 +153,7 @@ [% missingissue.issn | html %] [% missingissue.serialseq | html %] - [% IF ( missingissue.status1 ) %]Expected[% END %] - [% IF ( missingissue.status3 ) %]Late[% END %] - [% IF ( missingissue.status4 ) %]Missing[% END %] - [% IF ( missingissue.status41 ) %]Missing (never received)[% END %] - [% IF ( missingissue.status42 ) %]Missing (sold out)[% END %] - [% IF ( missingissue.status43 ) %]Missing (damaged)[% END %] - [% IF ( missingissue.status44 ) %]Missing (lost)[% END %] - [% IF ( missingissue.status7 ) %]Claimed[% END %] + [% INCLUDE 'serial-status.inc' serial = missingissue %] [% missingissue.planneddate | $KohaDates %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt index dcf0890885..ff542c79ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -287,18 +287,7 @@ [% END %] - [% IF ( serial.status1 ) %]Expected[% END %] - [% IF ( serial.status2 ) %]Arrived[% END %] - [% IF ( serial.status3 ) %]Late[% END %] - [% IF ( serial.status4 ) %]Missing[% END %] - [% IF ( serial.status41 ) %]Missing (never received)[% END %] - [% IF ( serial.status42 ) %]Missing (sold out)[% END %] - [% IF ( serial.status43 ) %]Missing (damaged)[% END %] - [% IF ( serial.status44 ) %]Missing (lost)[% END %] - [% IF ( serial.status5 ) %]Not issued[% END %] - [% IF ( serial.status6 ) %]Delete[% END %] - [% IF ( serial.status7 ) %]Claimed[% END %] - [% IF ( serial.status8 ) %]Stopped[% END %] + [% INCLUDE 'serial-status.inc' serial = serial %] [% serial.notes | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index c5eaafdf56..73e97e992a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -277,23 +277,7 @@ [% serialslis.publisheddatetext | html %] - [% IF ( serialslis.status1 ) %]Expected[% END %] - [% IF ( serialslis.status2 ) %]Arrived[% END %] - [% IF ( serialslis.status3 ) %]Late[% END %] - [% IF ( serialslis.status4 ) %]Missing[% END %] - [% IF ( serialslis.status41 ) %]Missing (never received)[% END %] - [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %] - [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %] - [% IF ( serialslis.status44 ) %]Missing (lost)[% END %] - [% IF ( serialslis.status5 ) %]Not issued[% END %] - [% IF ( serialslis.status6 ) %]Delete[% END %] - [% IF ( serialslis.status7 ) %] - Claimed - [% IF ( serialslis.claimdate ) %] - [% serialslis.claimdate | html %] - [% END %] - [% END %] - [% IF ( serialslis.status8 ) %]Stopped[% END %] + [% INCLUDE 'serial-status.inc' serial = serialslis %] [% END # /FOREACH serialslist %] -- 2.39.5