From a71c325357e49940ddb75010b7c43762b41a9dbd Mon Sep 17 00:00:00 2001 From: Jacek Ablewicz Date: Sun, 8 Jun 2014 12:52:08 +0200 Subject: [PATCH] Bug 10848 - Allow configuration of mandatory/required fields on the suggestion form in OPAC #2/2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (part #2: new syspref 'OPACSuggestionMandatoryFields' + DB updates) Signed-off-by: Nick Clemens Signed-off-by: Valérie Bertrand --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index c3e308f..15b95f1 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -305,6 +305,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACShowUnusedAuthorities','1','','Show authorities that are not being used in the OPAC.','YesNo'), ('OpacStarRatings','all','disable|all|details',NULL,'Choice'), ('OpacSuggestionManagedBy',1,'','Show the name of the staff member who managed a suggestion in OPAC','YesNo'), +('OPACSuggestionMandatoryFields','',NULL,'Define the mandatory fields for a patron purchase suggestions made via OPAC.','free'), ('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'), ('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'), ('OpacSuppressionMessage','','Display this message on the redirect page for suppressed biblios','70|10','Textarea'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index cf17e0b..211e6d3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9585,6 +9585,13 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.19.00.XXX"; +if (CheckVersion($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACSuggestionMandatoryFields', '', 'NULL', 'Define the mandatory fields for a patron purchase suggestions made via OPAC.', 'Free');"); + print "Upgrade to $DBversion done (Bug 10848 - Allow configuration of mandatory/required fields on the suggestion form in OPAC)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 45df9f8..458b3d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -530,6 +530,13 @@ OPAC: yes: Allow - patrons to select library when making a purchase suggestion - + - "Fields (separated with |) that should be mandatory for patron purchase suggestions:" + - pref: OPACSuggestionMandatoryFields + class: multi + - "
Field names you can set here as mandatory for OPAC suggestions include: author, copyrightdate," + - "isbn, publishercode, place, itemtype and patronreason." + - "Note: title field would be allways implicitly required, no need to enter it here." + - - pref: OpacHiddenItems type: textarea class: code -- 1.7.2.5