Bugzilla – Attachment 18926 Details for
Bug 7825
Change OPACItemHolds syspref to be of type Choice, choices being "no", "yes", "force"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug_7825: Sign off Changed OPACItemHolds syspref to be no|tes|force choice
bug7825-Sign-off-Changed-OPACItemHolds-syspref-to-.patch (text/plain), 9.80 KB, created by
Kyle M Hall (khall)
on 2013-06-13 11:21:44 UTC
(
hide
)
Description:
bug_7825: Sign off Changed OPACItemHolds syspref to be no|tes|force choice
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-06-13 11:21:44 UTC
Size:
9.80 KB
patch
obsolete
>From 4018aee333b5769963fdaabb1030a72cd6285fff Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Mon, 26 Mar 2012 21:34:34 +1300 >Subject: [PATCH] bug_7825: Sign off Changed OPACItemHolds syspref to be no|tes|force choice > >Amended opac-reserve.tt accordingly > >Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 8 ++++ > .../prog/en/modules/admin/preferences/opac.pref | 5 +- > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 44 +++++++------------ > 4 files changed, 28 insertions(+), 31 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index fbd0387..fe93fa3 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -183,7 +183,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','OAI-PMH archive identification',NULL,'Free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:MaxCount','50','OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries',NULL,'Integer'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File'); >-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','yes','Allow OPAC users to place hold on specific items. If No, users can only request next available copy. If Yes, users can choose between next available and specific copy. If Force, users *must* choose a specific copy.','no|yes|force','Choice'); > > INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 648e161..2b7103c 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6991,6 +6991,14 @@ if ( CheckVersion($DBversion) ) { > } > > >+ >+$DBversion = "3.13.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("UPDATE systempreferences SET type = 'Choice', options = 'no|yes|force', value = CASE value WHEN '1' THEN 'yes' ELSE 'no' END, explanation = 'Allow OPAC users to place hold on specific items. If No, users can only request next available copy. If Yes, users can choose between next available and specific copy. If Force, users *must* choose a specific copy.' WHERE variable = 'OPACItemHolds'"); >+ print "Upgrade to $DBversion done (Changed OPACItemHolds syspref to Choice)\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 90295ef..58a2d56 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 >@@ -454,9 +454,10 @@ OPAC: > - > - pref: OPACItemHolds > choices: >- yes: Allow > no: "Don't allow" >- - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item. >+ yes: Allow >+ force: Force >+ - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item. If this is forced, users must put a hold on a specific item. > - > - pref: OpacRenewalAllowed > choices: >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >index 42d85d4..7ecb8a4 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >@@ -273,8 +273,8 @@ > [% END %] > <th>Hold not needed after</th> > [% IF ( OpacHoldNotes ) %]<th>Notes</th>[% END %] >- [% IF ( OPACItemHolds ) %] >- <th id="place_on_hdr" style="display:none">Place on</th> >+ [% IF OPACItemHolds == 'yes' %] >+ <th id="place_on_hdr" style="display:none">Place On</th> > [% END %] > [% UNLESS ( singleBranchMode ) %] > [% IF ( choose_branch ) %] >@@ -362,50 +362,38 @@ > [% IF ( OpacHoldNotes ) %][% IF ( bibitemloo.holdable ) %]<td><input type="button" id="shownotes_[% bibitemloo.biblionumber %]" class="shownotes" value="Edit notes"/></td>[% END %][% END %] > > [% IF ( bibitemloo.holdable ) %] >- <!-- HOLD ABLE --> >- [% IF ( OPACItemHolds ) %] >- <!-- ITEM HOLDS --> >+ <!-- HOLDABLE --> >+ [% IF OPACItemHolds == 'yes' %] >+ <!-- ITEM HOLDS --> > <td class="place_on_type" style="display:none"> > <ul> > <li> >- [% UNLESS ( bibitemloo.holdable ) %] >- <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" >- id="reqany_[% bibitemloo.biblionumber %]" >- class="selectany" >- value="Any" >- disabled="disabled" >- /> >- [% ELSE %] > <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" > id="reqany_[% bibitemloo.biblionumber %]" > class="selectany" > value="Any" > checked="checked" > /> >- [% END %] >- <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label> >+ <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label> > </li> > <li> >- [% UNLESS ( bibitemloo.holdable ) %] > <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" > id="reqspecific_[% bibitemloo.biblionumber %]" > class="selectspecific" >- disabled="disabled" > value="Specific" > /> >- [% ELSE %] >- <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" >- id="reqspecific_[% bibitemloo.biblionumber %]" >- class="selectspecific" >- value="Specific" >- /> >- [% END %] >- <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label> >+ <label for="reqspecific_[% bibitemloo.biblionumber %]">A specific copy</label> > </li> > </ul> > </td> >- [% END %][% END %] >- >+ [% ELSIF OPACItemHolds == 'force' %] >+<script type="text/javascript"> >+ $(document).ready(function() { >+ $("#copiesrow_[% bibitemloo.biblionumber %]").show(); >+ }); >+</script> >+ [% END %] >+ [% END # holdable%] > [% UNLESS ( singleBranchMode ) %] > [% IF ( bibitemloo.holdable ) %] > [% IF ( choose_branch ) %] >@@ -451,7 +439,7 @@ > [% END %] > [% END %] > >- [% IF ( OPACItemHolds ) %] >+ [% IF OPACItemHolds == 'yes' || OPACItemHolds == 'force' %] > [% IF ( bibitemloo.holdable ) %] > <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]"> > <td> </td> >-- >1.7.2.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 7825
:
8641
|
8645
|
8646
|
12881
|
12883
|
12884
|
12885
|
12915
|
12920
|
12921
|
12922
|
12923
|
13305
|
13306
|
13307
|
13340
|
13341
|
13350
|
15032
|
15033
|
15034
|
15035
|
15606
|
15607
|
18435
|
18436
|
18878
|
18879
|
18903
|
18904
|
18920
|
18924
|
18925
|
18926
|
18927
|
18928
|
22635
|
22877
|
23631
|
24218
|
24270
|
24271
|
24538
|
24539
|
24540
|
24541
|
24542
|
24578
|
24579
|
24591
|
24592
|
27961
|
27962
|
27963
|
27964
|
27965
|
27966