From 7b535484edd7d2fa39c9fcfa40a0103c26b53460 Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Mon, 25 Sep 2017 14:03:04 -0400 Subject: [PATCH] Bug 11976 - Choose date to display Allows choosing between publication date or receival date (or both) 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 only the receival date will be displayed 3) Apply patch 4) Run installer/data/mysql/updatedatabase.pl 5) With the patch the publication date and the receival date will be displayed. This can be changed to either (or both) with the 'OPACSerialDisplayPublishedDate' system preference. Signed-off-by: Mark Tompsett --- .../mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/serials.pref | 8 ++++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 14 ++++++++++++-- 4 files changed, 22 insertions(+), 2 deletions(-) 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..fff212e --- /dev/null +++ b/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql @@ -0,0 +1 @@ +INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('OPACSerialDisplayPublishedDate', 'both', 'publication|receival|both', 'Which date should be displayed in the OPAC page of a serial', 'Choice'); \ No newline at end of file diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 4647789..e009608 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -376,6 +376,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', 'both', 'publication|receival|both', 'Which date should be displayed in the OPAC page of a serial', 'Choice'), ('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'), ('OPACShowCheckoutName','0','','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','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..c9c23a4 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,14 @@ 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: + publication: "publication date" + receival: "receival date" + both: "publication and receival dates" + - 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 eb857ec..4756f6b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -847,14 +847,24 @@ - + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'publication' || Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'both' %] + + [% END %] + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'receival' || Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'both' %] + + [% END %] [% FOREACH latestserial IN subscription.latestserials %] - + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'publication' || Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'both' %] + + [% END %] + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'receival' || Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'both' %] + + [% END %]
Issue #DatePublication dateReceival dateStatus Note
[% latestserial.serialseq %][% latestserial.planneddate %][% latestserial.publisheddate %][% latestserial.planneddate %] [% IF (latestserial.status1 ) %]Expected[% END %] [% IF (latestserial.status2 ) %]Arrived[% END %] -- 2.1.4