@@ -, +, @@ in suggestions - Change the system preference name to "SuggestionsUseValues" - Change the description of the preference to "Suggestions can be submitted using the following authorized values:" - Move the new preference to the OPAC tab so that it is grouped with other suggestions-related preferences. - Add the option offer no itemtype/collection code chooser on the submission form. - Display the correct label on the submission form depending on the value of the SuggestionsUseValues preference. --- C4/Koha.pm | 4 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 4 +- .../en/modules/admin/preferences/cataloguing.pref | 9 ---- .../prog/en/modules/admin/preferences/opac.pref | 9 ++++ .../prog/en/modules/suggestion/suggestion.tt | 47 ++++++++++++++------ .../opac-tmpl/prog/en/modules/opac-suggestions.tt | 12 ++++- 7 files changed, 59 insertions(+), 28 deletions(-) --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -136,7 +136,7 @@ Returns the name of the support corresponding to specified authorised value. sub GetSupportName { my $authorised_value = shift; return '' unless $authorised_value; - my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes'; + my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes'; if ( $supports_av eq 'itemtypes' ) { my $itemtype = getitemtypeinfo($authorised_value); return $itemtype->{'description'} if $itemtype; @@ -177,7 +177,7 @@ build a HTML select with the following code : =cut sub GetSupportList { - my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes'; + my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes'; if ( $supports_av eq 'itemtypes' ) { my @supports = map { { --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -430,4 +430,4 @@ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SuggestionsUseValues', 'itemtypes', 'Suggestions can be submitted using the following authorized values:','itemtypes|ccode|loc|none','Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -7069,8 +7069,8 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.13.00.XXX"; if ( CheckVersion($DBversion) ) { - $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice')"); - print "Upgrade to $DBversion done (Bug 9223: Add SupportsAuthorizedValues syspref)\n"; + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SuggestionsUseValues', 'itemtypes', 'Suggestions can be submitted using the following authorized values:','itemtypes|ccode|loc|none','Choice')"); + print "Upgrade to $DBversion done (Bug 9223: Add SuggestionsUseValues syspref)\n"; SetVersion ($DBversion); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -109,15 +109,6 @@ Cataloging: - pref: UNIMARCField100Language class: short - as default language in the UNIMARC field 100 when creating a new record or in the field plugin. - - - - pref: SupportsAuthorizedValues - default: itemtypes - choices: - itemtypes: "Item type" - loc: "Shelving Location" - ccode: "Collection code" - - represents document physical support. - - Display: - - 'Separate multiple displayed authors, series or subjects with ' --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -492,6 +492,15 @@ OPAC: yes: Allow - patrons to select library when making a purchase suggestion - + - 'Suggestions can be submitted using the following authorized values:' + - pref: SuggestionsUseValues + default: itemtypes + choices: + itemtypes: "Item type" + loc: "Shelving location" + ccode: "Collection code" + none: "None. Hide this option" + - - pref: OpacHiddenItems type: textarea class: code --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% USE KohaAuthorisedValues %] [% USE KohaBranchName %] [% INCLUDE 'doc-head-open.inc' %] @@ -177,11 +178,21 @@ $(document).ready(function() { calcNewsuggTotal(); });
  • Publisher:[% publishercode %]
  • Publication place:[% place %]
  • Collection title:[% collectiontitle %]
  • -
  • Document type: - [% FOREACH supports_loo IN supports_loop %] - [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %] - [% END %] -
  • + [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %] +
  • + [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %] + Item type: + [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %] + Collection: + [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%] + Shelving location: + [% END %] + [% FOREACH supports_loo IN supports_loop %] + [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %] + [% END %] +
  • + [% END %] + [% IF ( patron_reason_loop ) %]
  • Reason for suggestion: [% FOREACH patron_reason_loo IN patron_reason_loop %] @@ -292,14 +303,24 @@ $(document).ready(function() { calcNewsuggTotal(); });
  • -
  • - -
  • + [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %] +
  • + [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %] + + [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %] + + [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%] + + [% END %] + +
  • + [% END %] [% IF ( patron_reason_loop ) %]
  • [% END %] --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt @@ -112,12 +112,22 @@ $.tablesorter.addParser({
  • -
  • [% FOREACH supports_loo IN supports_loop %] [% IF ( supports_loo.selected ) %] [% END %]
  • + [% END %] [% IF ( branchloop ) %]