From fc6e645e177c6c6075671fdf1ed69ce4135db69e Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Sun, 21 Dec 2014 23:51:06 -0500
Subject: [PATCH] Bug 9303 [QA Followup 2] - Fix db update, move 'show' field to guarantor area

---
 installer/data/mysql/updatedatabase.pl             |    6 ++--
 .../prog/en/modules/members/memberentrygen.tt      |   30 ++++++++++----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index dfa7b42..6956512 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -9612,13 +9612,13 @@ if ( CheckVersion($DBversion) ) {
 $DBversion = "3.19.00.XXX";
 if(CheckVersion($DBversion)) {
     $dbh->do(q{
-        ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0'
+        ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' AFTER privacy
     });
     $dbh->do(q{
-        ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0'
+        ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' AFTER privacy
     });
     $dbh->do(q{
-        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
+        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL PRIMARY KEY FIRST
     });
     $dbh->do(q{
         ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
index 6a19f48..f57cead 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
@@ -442,6 +442,21 @@
             [% END %]
             <input id="guarantordelete" type="button" value="Delete" />
         </li>
+    [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
+        <li>
+            <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
+            <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
+                [% IF privacy_guarantor_checkouts %]
+                    <option value="0">No</option>
+                    <option value="1" selected>Yes</option>
+                [% ELSE %]
+                    <option value="0" selected>No</option>
+                    <option value="1">Yes</option>
+                [% END %]
+            </select>
+            <div class="hint">Allow guarantor of this patron to view this patron's checkouts from the OPAC</div>
+        </li>
+    [% END %]
         </ol>
     </fieldset>
 
@@ -1186,21 +1201,6 @@
 			[% END %]
 	  [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
 		</li>
-        [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
-            <li>
-                <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
-                <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
-                    [% IF privacy_guarantor_checkouts %]
-                        <option value="0">No</option>
-                        <option value="1" selected>Yes</option>
-                    [% ELSE %]
-                        <option value="0" selected>No</option>
-                        <option value="1">Yes</option>
-                    [% END %]
-                </select>
-                <div class="hint">Allow guarantor of this patron to view this patron's checkouts from the OPAC</div>
-            </li>
-        [% END %]
 		</ol>
 		</fieldset>
         [% END # hide fieldset %][% END %]
-- 
1.7.2.5