Bug 11415: Add syspref to toggle SCO receipt printing
authorJaTara Barnes <jendayi30@gmail.com>
Sun, 5 Jan 2014 06:33:31 +0000 (00:33 -0600)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 23 Jan 2014 17:03:58 +0000 (17:03 +0000)
This patch adds the SelfCheckReceiptPrompt to control
whether receipts are automatically printed when a patron
finishes a SCO session.  This is on by default during
new installations and upgrades.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt

index 6ebce00..1ef029b 100644 (file)
@@ -332,6 +332,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('SearchEngine','Zebra','Solr|Zebra','Search Engine','Choice'),
 ('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
 ('SelfCheckHelpMessage','','70|10','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','Textarea'),
+('SelfCheckReceiptPrompt','1','NULL','If ON, print receipt dialog pops up when self checkout is finished','YesNo'),
 ('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),
 ('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
 ('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
index 1311068..46e5406 100755 (executable)
@@ -7930,6 +7930,13 @@ if(CheckVersion($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.15.00.XXX";
+if (CheckVersion($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('SelfCheckReceiptPrompt', '1', 'NULL', 'If ON, print receipt dialog pops up when self checkout is finished.', 'YesNo');");
+    print "Upgrade to $DBversion done (Bug 11415: add system preference for self checkout receipt print)\n";
+    SetVersion($DBversion);
+}
+
 
 =head1 FUNCTIONS
 
index 2c5469b..33ae4c9 100644 (file)
@@ -592,6 +592,13 @@ Circulation:
             - and this password
             - pref: AutoSelfCheckPass
             - .
+        -
+            - pref: SelfCheckReceiptPrompt
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - "the print receipt popup dialog when self checkout is finished"
+
     Course Reserves:
         -
             - pref: UseCourseReserves
index b1c2f11..b98ba61 100644 (file)
@@ -1,3 +1,4 @@
+[% USE Koha %]
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
             $("#logout_form").submit(function(){
                 clearTimeout(mainTimeout);
+            [% IF Koha.Preference('SelfCheckReceiptPrompt') %]
                 if(confirm("Would you like to print a receipt?")){
                     window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
+     [% END %]
+
                 }
                 return true;
             });
index 6ab8b11..2fbdefb 100644 (file)
@@ -1,3 +1,4 @@
+[% USE Koha %]
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@@ -90,8 +91,10 @@ $(document).ready(function() {
     }));
     $("#logout_form").submit(function(){
         clearTimeout(mainTimeout);
+   [% IF Koha.Preference('SelfCheckReceiptPrompt') %]
         if(confirm("Would you like to print a receipt?")){
             window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
+   [%END %]
         }
         return true;
     });