[Koha-patches] [PATCH] Bug 3693 display options for buttons when holds are triggered

Jane Wagner jwagner at ptfs.com
Tue Oct 6 19:42:43 CEST 2009


Allows sites to turn off any of the buttons that normally show when a hold is triggered at item checkin (Confirm, Print Slip and Confirm, and Ignore).
---
 admin/systempreferences.pl                         |    3 ++
 circ/returns.pl                                    |    6 +++++
 installer/data/mysql/en/mandatory/sysprefs.sql     |    3 ++
 .../1-Obligatoire/unimarc_standard_systemprefs.sql |    4 +++
 .../ru-RU/mandatory/system_preferences_optimal.sql |    4 +++
 installer/data/mysql/updatedatabase.pl             |   24 ++++++++++++++++++++
 .../prog/en/modules/circ/returns.tmpl              |   23 ++++++++++++++++++-
 7 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl
index e96c109..f2a7d6e 100755
--- a/admin/systempreferences.pl
+++ b/admin/systempreferences.pl
@@ -172,6 +172,9 @@ $tabsysprefs{NewItemsDefaultLocation}        = "Circulation";
 $tabsysprefs{ReturnToShelvingCart}           = "Circulation";
 $tabsysprefs{DisplayClearScreenButton}       = "Circulation";
 $tabsysprefs{AllowAllMessageDeletion}        = "Circulation";
+$tabsysprefs{HoldButtonConfirm}              = "Circulation";
+$tabsysprefs{HoldButtonPrintConfirm}         = "Circulation";
+$tabsysprefs{HoldButtonIgnore}               = "Circulation";
 
 # Staff Client
 $tabsysprefs{TemplateEncoding}        = "StaffClient";
diff --git a/circ/returns.pl b/circ/returns.pl
index 40eeed1..41dbf2a 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -75,6 +75,9 @@ my $printers = GetPrinters();
 #my $branch  = C4::Context->userenv?C4::Context->userenv->{'branch'}:"";
 my $printer = C4::Context->userenv ? C4::Context->userenv->{'branchprinter'} : "";
 my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
+my $HoldButtonConfirm = (C4::Context->preference('HoldButtonConfirm'));
+my $HoldButtonIgnore = (C4::Context->preference('HoldButtonIgnore'));
+my $HoldButtonPrintConfirm = (C4::Context->preference('HoldButtonPrintConfirm'));
 
 my $userenv_branch = C4::Context->userenv->{'branch'} || '';
 #
@@ -541,6 +544,9 @@ $template->param(
     dropboxmode    => $dropboxmode,
     dropboxdate	   => $dropboxdate->output(),
     overduecharges => $overduecharges,
+    HoldButtonConfirm => $HoldButtonConfirm,
+    HoldButtonIgnore => $HoldButtonIgnore,
+    HoldButtonPrintConfirm => $HoldButtonPrintConfirm,
 );
 
 # actually print the page!
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
index 6f60fa7..8e6e84f 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -262,3 +262,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'If ON, displays patron image when a patron uses web-based self-checkout', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonConfirm', '1', 'Display Confirm button when hold triggered. Leave either this setting or HoldButtonPrintConfirm on.', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonPrintConfirm', '1', 'Display Confirm and Print Slip button when hold triggered. Leave either this setting or HoldButtonConfirm on.', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonIgnore', '1', 'Display Ignore button when hold triggered.', '', 'YesNo');
diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
index bee360a..fe9f1b0 100644
--- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
@@ -261,3 +261,7 @@ INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('H
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'Si activé, affiche le format, le type de public et les icônes de type en XSLT (MARC21)).', 'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'Si activé, affiche la photo de l''adhérent lors de l''utilisation de la console de prêt auto-contrôlé', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonConfirm', '1', 'Affiche un bouton de confirmation quand une rérvation passe disponible.  Cette option est exclusive avec HoldButtonPrintConfirm : Utilisez l''une ou l''autre.', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonPrintConfirm', '1', 'Affiche un bouton qui permet de confirmer et imprimer un ticket quand une rérvation passe disponible.  Cette option est exclusive avec HoldButtonPrintConfirm : Utilisez l''une ou l''autre .', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonIgnore', '1', 'Affiche un bouton Ignorer lorsqu''une reservation passe disponible.', '', 'YesNo');
+
diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql
index 61318c0..2fea5bb 100644
--- a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql
+++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql
@@ -238,3 +238,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonConfirm', '1', 'Display Confirm button when hold triggered. Leave either this setting or HoldButtonPrintConfirm on.', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonPrintConfirm', '1', 'Display Confirm and Print Slip button when hold triggered. Leave either this setting or HoldButtonConfirm on.', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonIgnore', '1', 'Display Ignore button when hold triggered.', '', 'YesNo');
+
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 10c3451..b58ac44 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2675,6 +2675,30 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = '3.01.00.062';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonConfirm', '1', 'Display Confirm button when hold triggered. Leave either this setting or HoldButtonPrintConfirm on.', '', 'YesNo')");
+");
+	print "Upgrade to $DBversion done ( Added HoldButtonConfirm system preference )\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.01.00.063';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonPrintConfirm', '1', 'Display Confirm and Print Slip button when hold triggered. Leave either this setting or HoldButtonConfirm on.', '', 'YesNo')");
+");
+	print "Upgrade to $DBversion done ( Added HoldButtonPrintConfirm system preference )\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.01.00.064';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('HoldButtonIgnore', '1', 'Display Ignore button when hold triggered.', '', 'YesNo');");
+");
+	print "Upgrade to $DBversion done ( Added HoldButtonIgnore system preference )\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
index 12b372c..b759966 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
@@ -76,8 +76,12 @@ function Dopop(link) {
             <input type="hidden" name="WT-itemNumber" value="<!-- TMPL_VAR Name="WrongTransferItem" -->" />
             <input type="hidden" name="WT-waitingAt" value="<!-- TMPL_VAR Name="TransferWaitingAt" -->" />
             <input type="hidden" name="WT-From" value="<!-- TMPL_VAR Name="wtransfertFrom" -->" />
+		<!-- TMPL_IF name="HoldButtonConfirm" -->
         <input type="submit" class="approve" value="Confirm" />
+        	<!-- /TMPL_IF -->
+		<!-- TMPL_IF name="HoldButtonPrintConfirm" -->
 			<input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip'); this.form.submit();" />
+        	<!-- /TMPL_IF -->
     </form>
     <!-- /TMPL_IF --></div>
 <!-- /TMPL_IF -->
@@ -106,8 +110,10 @@ function Dopop(link) {
 		<h4><strong>Hold at</strong> <!-- TMPL_VAR Name="destbranchname" --></h4>
         <!-- /TMPL_IF -->
         <form method="post" action="returns.pl" class="confirm">
+		<!-- TMPL_IF name="HoldButtonConfirm" -->
             <input type="submit" class="approve" value="Confirm" />
-
+        	<!-- /TMPL_IF -->
+		<!-- TMPL_IF name="HoldButtonPrintConfirm" -->
 			<input type="submit" value="Print and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip'); this.form.submit();" />
             <!-- TMPL_LOOP Name="inputloop" -->
                 <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
@@ -120,6 +126,7 @@ function Dopop(link) {
                 <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR Name="destbranch" -->" />
                 <input type="hidden" name="exemptfine" value="<!-- TMPL_VAR Name="exemptfine" -->" />
                 <input type="hidden" name="dropboxmode" value="<!-- TMPL_VAR Name="dropboxmode" -->" />
+        	<!-- /TMPL_IF -->
                 </form>
 	</div>
     <!-- /TMPL_IF -->
@@ -146,7 +153,10 @@ function Dopop(link) {
         <!-- /TMPL_IF -->
 
         <form method="post" action="returns.pl" class="confirm">
+		<!-- TMPL_IF name="HoldButtonConfirm" -->
             <input type="submit" class="approve" value="Confirm" />
+        	<!-- /TMPL_IF -->
+		<!-- TMPL_IF name="HoldButtonPrintConfirm" -->
 			<input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip'); this.form.submit();" />
             <!-- TMPL_LOOP Name="inputloop" -->
                 <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
@@ -157,6 +167,7 @@ function Dopop(link) {
             <input type="hidden" name="exemptfine" value="<!-- TMPL_VAR Name="exemptfine" -->" />
             <input type="hidden" name="dropboxmode" value="<!-- TMPL_VAR Name="dropboxmode" -->" />
             <input type="hidden" name="barcode" value="0" />
+        	<!-- /TMPL_IF -->
         </form>
 		</div>
     <!-- /TMPL_IF -->
@@ -235,13 +246,23 @@ function Dopop(link) {
         <!-- /TMPL_IF -->
         <form method="post" action="returns.pl" class="confirm">
             <!-- TMPL_IF name="transfertodo" -->
+		<!-- TMPL_IF name="HoldButtonConfirm" -->
                 <input type="submit" class="approve" value="Confirm hold and Transfer" />
+        	<!-- /TMPL_IF -->
+		<!-- TMPL_IF name="HoldButtonPrintConfirm" -->
                 <input type="submit" value="Print slip, Transfer, and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip'); this.form.submit();" />
+        	<!-- /TMPL_IF -->
             <!-- TMPL_ELSE -->
+		<!-- TMPL_IF name="HoldButtonConfirm" -->
                 <input type="submit" class="approve" value="Confirm hold" />
+        	<!-- /TMPL_IF -->
+		<!-- TMPL_IF name="HoldButtonPrintConfirm" -->
                 <input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip'); this.form.submit();" />
+        	<!-- /TMPL_IF -->
             <!-- /TMPL_IF -->
+		<!-- TMPL_IF name="HoldButtonIgnore" -->
                 <input type="submit" class="deny" value="Ignore" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;" />
+            	<!-- /TMPL_IF -->
             <!-- TMPL_LOOP Name="inputloop" -->
 	<input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
 	<input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
-- 
1.5.6.5




More information about the Koha-patches mailing list