From 1c60222a30b9e4b12f96bcd0fbb9ed7bbc2f1c4f Mon Sep 17 00:00:00 2001 From: Kyle M Hall 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 | 19 +++++++----- .../prog/en/modules/members/memberentrygen.tt | 30 ++++++++++---------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 886146f..2bcdaa0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9695,22 +9695,25 @@ 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 }); + $dbh->do(q{ - ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST + ALTER TABLE old_issues CHANGE issue_id issue_id INT( 11 ) NOT NULL }); + $dbh->do(q{ - ALTER TABLE issues - DROP INDEX itemnumber_idx, - ADD UNIQUE itemnumber_idx ( itemnumber ) + ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST }); + $dbh->do(qq{ UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC }); @@ -9725,7 +9728,7 @@ if(CheckVersion($DBversion)) { }); $dbh->do(q{ - INSERT INTO systempreferences (variable, value, options, explanation, type ) + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type ) VALUES ( 'AllowStaffToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo' @@ -9733,7 +9736,7 @@ if(CheckVersion($DBversion)) { }); $dbh->do(q{ - INSERT INTO systempreferences (variable, value, options, explanation, type ) + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type ) VALUES ( 'AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo' 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 %] + [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %] +
  • + + +
    Allow guarantor of this patron to view this patron's checkouts from the OPAC
    +
  • + [% END %] @@ -1186,21 +1201,6 @@ [% END %] [% IF ( mandatorypassword ) %]Required[% END %][% IF ( ERROR_password_mismatch ) %]Passwords do not match[% END %] - [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %] -
  • - - -
    Allow guarantor of this patron to view this patron's checkouts from the OPAC
    -
  • - [% END %] [% END # hide fieldset %][% END %] -- 1.7.2.5