Bug 13881: (RM follow-up) Make 'Desks' feature optional
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 18 May 2020 10:40:14 +0000 (11:40 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 18 May 2020 10:41:28 +0000 (11:41 +0100)
This patch adds a new 'UseIssueDesks' preference which defaults to
"Don't use" to enabled/disable the 'Desks' functionality added with this
bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_13881.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref

diff --git a/installer/data/mysql/atomicupdate/bug_13881.perl b/installer/data/mysql/atomicupdate/bug_13881.perl
new file mode 100644 (file)
index 0000000..ac11e53
--- /dev/null
@@ -0,0 +1,11 @@
+$DBversion = 'XXX';    # will be replaced by the RM
+  if ( CheckVersion($DBversion) ) {
+   
+      $dbh->do(qq{
+          INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES
+          ('UseIssueDesks','0','','Use issue desks with circulation.','YesNo')
+      });
+   
+      SetVersion($DBversion);
+      print "Upgrade to $DBversion done (Bug 13881 - Add cash register system preference)\n";
+  }
index 58bd459..00fba52 100644 (file)
@@ -686,6 +686,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('useDischarge','','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
 ('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
 ('UseICU','0','1','Tell Koha if ICU indexing is in use for Zebra or not.','YesNo'),
+('UseIssueDesks','0','','Use issue desks with circulation.','YesNo'),
 ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
 ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
 ('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'),
index 82d766f..f037889 100644 (file)
@@ -63,8 +63,6 @@
                         <dd>Define libraries.</dd>
                         <dt><a href="/cgi-bin/koha/admin/library_groups.pl">Library groups</a></dt>
                         <dd>Define hierarchical library groups.</dd>
-                        <dt><a href="/cgi-bin/koha/admin/desks.pl">Desks</a></dt>
-                        <dd>Define desks</dd>
                     [% END %]
                     [% IF ( CAN_user_parameters_manage_itemtypes ) %]
                         <dt><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></dt>
                     <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
                     <dd>Define rules for check-in and checkout notifications for combinations of libraries, patron categories, and item types</dd>
                 [% END %]
+                [% IF ( Koha.Preference('UseIssueDesks') && CAN_user_parameters_manage_libraries ) %]
+                        <dt><a href="/cgi-bin/koha/admin/desks.pl">Issue desks</a></dt>
+                        <dd>Define issue desks</dd>
+                [% END %]
                 [% IF ( CAN_user_parameters_manage_cities ) %]
                     <dt><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></dt>
                     <dd>Define cities and towns that your patrons live in.</dd>
index 9ea394b..11f1ba5 100644 (file)
@@ -156,6 +156,12 @@ Circulation:
                   yes: Allow
                   no: "Don't allow"
             - patrons to submit notes about checked out items.
+        -
+            - pref: UseIssueDesks
+              choices:
+                  yes: "Use"
+                  no: "Don't use"
+            - issue desks with circulation.
 
     Checkout policy:
         -