From 2103143da98a27ae04c5be1fee980762c56b4f3d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 2 Mar 2015 03:07:52 -0800 Subject: [PATCH] Bug 9303 [1] - relative's checkouts in the opac - Database Updates This patch gives patrons the option of allowing other linked relatives to view his or her checkouts from opac-user.pl in a manner similiar to the patron's own checkouts tab. By default the setting is not enabled. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Create three borrowers, link them as relatives 4) In the OPAC, go to "my privacy" and choose to allow relatives to view current checkouts for borrowers A and B 5) Check out some items to each borrower 6) Log into the OPAC as borrower A, you should see a "Relatives' checkouts" tab. In this tab you should see the checkouts for borrower B 7) Log into the OPAC as borrower C, you should be able to view the current checkouts for both borrower A and borrower B Signed-off-by: Martin Renvoize --- installer/data/mysql/kohastructure.sql | 2 ++ installer/data/mysql/sysprefs.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 32 +++++++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index dd6bac9..2deb6b9 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -265,6 +265,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on) `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history + `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts UNIQUE KEY `cardnumber` (`cardnumber`), PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), @@ -894,6 +895,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on) `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history KEY `borrowernumber` (`borrowernumber`), + `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts KEY borrowernumber (borrowernumber), KEY `cardnumber` (`cardnumber`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index f371193..87cf88c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -25,12 +25,14 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'), ('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'), ('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'), +('AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo'), ('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'), ('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'), ('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'), ('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'), ('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'), ('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'), +('AllowStaffToSetCheckoutsVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo'), ('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'), ('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'), ('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 394e4ba..e01bdf6 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9759,7 +9759,7 @@ if ( CheckVersion($DBversion) ) { } else { print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n"; } - SetVersion($DBversion); + SetVersion ($DBversion); } $DBversion = "3.19.00.008"; @@ -10392,6 +10392,36 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "XXX"; +if(CheckVersion($DBversion)) { + $dbh->do(q{ + 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' AFTER privacy + }); + + $dbh->do(q{ + 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' + ) + }); + + $dbh->do(q{ + 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' + ) + }); + + print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 1.7.2.5