From cbbd1f7fc2fed9dc28cba4254b5ae1e7bbcd2e38 Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Mon, 25 Sep 2017 14:03:04 -0400 Subject: [PATCH] Bug 11976 - Show publication date instead of received date Allows choosing between publication date or receival date for serials information in the OPAC. Test plan : 0) If you have no serials : a) Create a subscription b) Receive the item, making sure to have a different publication and receival date 1) Visit the OPAC details page for the item you've created 2) Without the patch the receival date will be displayed 3) Apply patch 4) Run installer/data/mysql/updatedatabase.pl 5) With the patch the publication date will be displayed. This can be changed back with the 'OPACSerialDisplayPublishedDate' system preference. Signed-off-by: Sarah Kirby --- .../data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/serials.pref | 7 +++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 +++++- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql diff --git a/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql b/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql new file mode 100644 index 0000000..ae36c37 --- /dev/null +++ b/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql @@ -0,0 +1 @@ +INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('OPACSerialDisplayPublishedDate', 1, NULL, 'Wether to display the publication date (yes) or the received date (no)', 'YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 5155fe7..407a2f0 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -375,6 +375,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'), ('OpacSeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings (OPAC)','Choice'), ('opacSerialDefaultTab','subscriptions','holdings|serialcollection|subscriptions','Define the default tab for serials in OPAC.','Choice'), +('OPACSerialDisplayPublishedDate', 1, NULL, 'Wether to display the publication date (yes) or the received date (no)', 'YesNo'), ('OPACSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the OPAC','Integer'), ('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo'), ('OPACShowBarcode','0','','Show items barcode in holding tab','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref index 76c89a8..f94a513 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref @@ -8,6 +8,13 @@ Serials: serialcollection: Serial Collection tab - as default tab for serials in OPAC. Please note that the Serial Collection tab is currently available only for UNIMARC. - + - Display the + - pref: OPACSerialDisplayPublishedDate + choices: + yes: "publication date" + no: "receival date" + - in the OPAC details tab for serials. + - - pref: RenewSerialAddsSuggestion choices: yes: Add diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 9d1f2b9..2e0ecbb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -853,7 +853,11 @@ [% FOREACH latestserial IN subscription.latestserials %] [% latestserial.serialseq %] - [% latestserial.planneddate %] + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) %] + [% latestserial.publisheddate %] + [% ELSE %] + [% latestserial.planneddate %] + [% END %] [% IF (latestserial.status1 ) %]Expected[% END %] [% IF (latestserial.status2 ) %]Arrived[% END %] -- 2.1.4