Bugzilla – Attachment 20017 Details for
Bug 9223
Multiple values of AdvancedSearchTypes in suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9223 [Follow-up] Multiple values of AdvancedSearchTypes in suggestions
Bug-9223-Follow-up-Multiple-values-of-AdvancedSear.patch (text/plain), 13.65 KB, created by
Owen Leonard
on 2013-07-31 16:53:15 UTC
(
hide
)
Description:
Bug 9223 [Follow-up] Multiple values of AdvancedSearchTypes in suggestions
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-07-31 16:53:15 UTC
Size:
13.65 KB
patch
obsolete
>From a3d3a65494dbcf9e9ee315ffbb65f0a7cc089075 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 31 Jul 2013 12:33:32 -0400 >Subject: [PATCH] Bug 9223 [Follow-up] Multiple values of AdvancedSearchTypes > in suggestions >Content-Type: text/plain; charset="utf-8" > >This follow-up implements some things I think will improve on the >previous patches: > >- 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. > >To test, apply this patch on top of the previous ones. Test submission >of purchase suggestions through the OPAC and staff client with the >SuggestionsUseValues preference set to all the various choices: item >type, collection code, shelving location, and 'none.' The suggestion >forms should look correct and work correctly. > >HOWEVER, neither the previous patches nor mine address the problem of >the suggestions management page's "organize by" option, which is >hard-coded to work with item types. Whether or not my patch is >acceptable this issue will need to be addressed. > >http://bugs.koha-community.org/show_bug.cgi?id=6473 >--- > 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(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 89da573..73f2585 100644 >--- a/C4/Koha.pm >+++ b/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 { > { >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d941aaf..71c022b 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index a01f6b7..c816000 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index de80ac1..96f3603 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/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 ' >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 90295ef..d2b8f86 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 >@@ -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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index ec737d3..eed0a9f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/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(); }); > <li><span class="label">Publisher:</span>[% publishercode %]</li> > <li><span class="label">Publication place:</span>[% place %]</li> > <li><span class="label">Collection title:</span>[% collectiontitle %]</li> >- <li><span class="label">Document type:</span> >- [% FOREACH supports_loo IN supports_loop %] >- [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %] >- [% END %] >- </li> >+ [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %] >+ <li> >+ [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %] >+ <span class="label">Item type:</span> >+ [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %] >+ <span class="label">Collection:</span> >+ [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%] >+ <span class="label">Shelving location:</span> >+ [% END %] >+ [% FOREACH supports_loo IN supports_loop %] >+ [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %] >+ [% END %] >+ </li> >+ [% END %] >+ > [% IF ( patron_reason_loop ) %] > <li><span class="label">Reason for suggestion: </span> > [% FOREACH patron_reason_loo IN patron_reason_loop %] >@@ -292,14 +303,24 @@ $(document).ready(function() { calcNewsuggTotal(); }); > <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li> > <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li> > <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li> >- <li><label for="itemtype">Document type:</label> >- <select id="itemtype" name="itemtype" > >- [% FOREACH supports_loo IN supports_loop %] >- [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %] >- [% supports_loo.lib %]</option> >- [% END %] >- </select> >- </li> >+ [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %] >+ <li> >+ [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %] >+ <label for="itemtype">Item type:</label> >+ [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %] >+ <label for="itemtype">Collection:</label> >+ [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%] >+ <label for="itemtype">Shelving location:</label> >+ [% END %] >+ <select id="itemtype" name="itemtype" > >+ <option value=""></option> >+ [% FOREACH supports_loo IN supports_loop %] >+ [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %] >+ [% supports_loo.lib %]</option> >+ [% END %] >+ </select> >+ </li> >+ [% END %] > [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %] > [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %] > [% END %]</select></li>[% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >index 2789573..999f343 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >@@ -112,12 +112,22 @@ $.tablesorter.addParser({ > <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li> > <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li> > <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li> >- <li><label for="itemtype">Document type:</label><select name="itemtype" id="itemtype"> >+ [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %] >+ <li> >+ [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %] >+ <label for="itemtype">Item type:</label> >+ [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %] >+ <label for="itemtype">Collection:</label> >+ [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%] >+ <label for="itemtype">Shelving location:</label> >+ [% END %] >+ <select name="itemtype" id="itemtype"> > <option value="">Default</option> > [% FOREACH supports_loo IN supports_loop %] > [% IF ( supports_loo.selected ) %]<option value="[% supports_loo.authorised_value %]" selected="selected">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %][% supports_loo.lib %]</option> > [% END %] > </select> </li> >+ [% END %] > [% IF ( branchloop ) %] > <li><label for="branch">Library:</label> > <select name="branch" id="branch"> >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9223
:
13903
|
14427
|
14428
|
20015
|
20016
|
20017
|
35492
|
35493
|
35494
|
36178
|
36179
|
36702
|
36703
|
36704
|
40011
|
40012
|
40013
|
40014
|
40015
|
40016
|
42287
|
42288
|
42289
|
42290
|
42291
|
42336
|
42337
|
42338
|
42339
|
42340
|
44111
|
44113
|
44114
|
44115
|
44116
|
44117
|
44118