Bug 20312: (QA follow-up) Make display syspref driven
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 31 Oct 2018 13:53:16 +0000 (13:53 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 8 Nov 2018 15:38:20 +0000 (15:38 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/bug_20312.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref

diff --git a/installer/data/mysql/atomicupdate/bug_20312.perl b/installer/data/mysql/atomicupdate/bug_20312.perl
new file mode 100644 (file)
index 0000000..579a839
--- /dev/null
@@ -0,0 +1,12 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    # System preferences
+    $dbh->do(q{
+        INSERT IGNORE INTO `systempreferences` (`variable`,`value`,`explanation`,`options`,`type`)
+        VALUES ('showLastPatron','0','','If ON, enables the last patron feature in the intranet','YesNo');
+    });
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 20312 - Add showLastPatron systempreference)\n";
+}
index ad62255..2a7aaa9 100644 (file)
@@ -516,6 +516,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'),
 ('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'),
 ('ShowAllCheckins', '0', '', 'Show all checkins', 'YesNo'),
+('showLastPatron','0','','If ON, enables the last patron feature in the intranet','YesNo'),
 ('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
 ('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
 ('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
index 997fe50..a693da9 100644 (file)
             [% END %]
         </ul>
     </div>
-    [% INCLUDE 'last-borrower.inc' %]
+    [% IF Koha.Preference('showLastPatron') %][% INCLUDE 'last-borrower.inc' %][% END %]
     [% IF ( intranetbookbag ) %]<div id="cartDetails">Your cart is empty.</div>[% END %]
 </div>
index 1822c7a..5127853 100644 (file)
@@ -138,6 +138,12 @@ Staff Client:
                   yes: "Don't show"
             - the names of patrons that have items checked out or on hold on detail pages or the "Place Hold" screen.
         -
+            - pref: showLastPatron
+              choices:
+                  no: "Don't show"
+                  yes: Show
+            - a link to the last searched patron in the staff client.
+        -
             - pref: intranetbookbag
               choices:
                   yes: Show