From 00b9fca0b12dd464bad0932c25b36e21b2e21a78 Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Wed, 11 Oct 2017 09:30:39 -0400 Subject: [PATCH] Bug 11976 - Display either or both publication date and receival date This changes the behavior of the patch. The systempreference now allows choosing to display either date, or both (in two separate columns). --- .../mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql | 3 ++- installer/data/mysql/kohastructure.sql | 3 +++ installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/serials.pref | 5 +++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 12 +++++++++--- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql b/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql index ae36c37..f4aaf2c 100644 --- a/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql +++ b/installer/data/mysql/atomicupdate/Bug11976-DisplayPublishedDate.sql @@ -1 +1,2 @@ -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 +DELETE FROM systempreferences WHERE variable='OPACSerialDisplayPublishedDate'; +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/kohastructure.sql b/installer/data/mysql/kohastructure.sql index eb02c95..7b1c920 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3922,6 +3922,7 @@ CREATE TABLE IF NOT EXISTS `housebound_role` ( -- Table structure for table 'article_requests' -- +DROP TABLE IF EXISTS `article_requests`; CREATE TABLE `article_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `borrowernumber` int(11) NOT NULL, @@ -3955,6 +3956,7 @@ CREATE TABLE `article_requests` ( -- Table structure for table `biblio_metadata` -- +DROP TABLE IF EXISTS `biblio_metadata`; CREATE TABLE biblio_metadata ( `id` INT(11) NOT NULL AUTO_INCREMENT, `biblionumber` INT(11) NOT NULL, @@ -3970,6 +3972,7 @@ CREATE TABLE biblio_metadata ( -- Table structure for table `deletedbiblio_metadata` -- +DROP TABLE IF EXISTS `deletedbiblio_metadata`; CREATE TABLE deletedbiblio_metadata ( `id` INT(11) NOT NULL AUTO_INCREMENT, `biblionumber` INT(11) NOT NULL, diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index c341646..bcf0122 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -376,7 +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', 1, NULL, 'Wether to display the publication date (yes) or the received date (no)', 'YesNo'), +('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'), ('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 f94a513..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 @@ -11,8 +11,9 @@ Serials: - Display the - pref: OPACSerialDisplayPublishedDate choices: - yes: "publication date" - no: "receival date" + publication: "publication date" + receival: "receival date" + both: "publication and receival dates" - in the OPAC details tab for serials. - - pref: RenewSerialAddsSuggestion 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 2e0ecbb..8ed2214 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -846,16 +846,22 @@ - + [% 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' ) %] + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'publication' || Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'both' %] - [% ELSE %] + [% END %] + [% IF Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'receival' || Koha.Preference( 'OPACSerialDisplayPublishedDate' ) == 'both' %] [% END %]
Issue #DatePublication dateReceival dateStatus Note
[% latestserial.serialseq %][% latestserial.publisheddate %][% latestserial.planneddate %] -- 2.7.4