Bugzilla – Attachment 35679 Details for
Bug 9303
relative's checkouts in the opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9303 [1] - relative's checkouts in the opac - Database Updates
Bug-9303-1---relatives-checkouts-in-the-opac---Dat.patch (text/plain), 9.43 KB, created by
Kyle M Hall (khall)
on 2015-02-05 18:21:17 UTC
(
hide
)
Description:
Bug 9303 [1] - relative's checkouts in the opac - Database Updates
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-02-05 18:21:17 UTC
Size:
9.43 KB
patch
obsolete
>From 5becc32afed49d4ab35ef04257a106244f94e4c4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 21 Jul 2014 11:48:28 -0400 >Subject: [PATCH] Bug 9303 [1] - relative's checkouts in the opac - Database Updates > >Signed-off-by: Nick Clemens <nick@quecheelibrary.org> >--- > installer/data/mysql/kohastructure.sql | 6 +++ > installer/data/mysql/sysprefs.sql | 2 + > installer/data/mysql/updatedatabase.pl | 63 ++++++++++++++++++++++++++++++++ > 3 files changed, 71 insertions(+), 0 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 82868e7..50d6b8e 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; >@@ -1140,6 +1142,7 @@ CREATE TABLE `import_items` ( > > DROP TABLE IF EXISTS `issues`; > CREATE TABLE `issues` ( -- information related to check outs or issues >+ `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table > `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to > `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out > `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) >@@ -1153,6 +1156,7 @@ CREATE TABLE `issues` ( -- information related to check outs or issues > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched > `issuedate` datetime default NULL, -- date the item was checked out or issued > `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag >+ PRIMARY KEY (`issue_id`), > KEY `issuesborridx` (`borrowernumber`), > KEY `itemnumber_idx` (`itemnumber`), > KEY `branchcode_idx` (`branchcode`), >@@ -1614,6 +1618,7 @@ CREATE TABLE `oai_sets_biblios` ( > > DROP TABLE IF EXISTS `old_issues`; > CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned >+ `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table > `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to > `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out > `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) >@@ -1627,6 +1632,7 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched > `issuedate` datetime default NULL, -- date the item was checked out or issued > `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag >+ PRIMARY KEY (`issue_id`), > KEY `old_issuesborridx` (`borrowernumber`), > KEY `old_issuesitemidx` (`itemnumber`), > KEY `branchcode_idx` (`branchcode`), >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 89707ef..2112998 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -26,12 +26,14 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), > ('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','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 891ee25..eeb0210 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -37,6 +37,7 @@ use Getopt::Long; > use C4::Context; > use C4::Installer; > use C4::Dates; >+use Koha::Database; > > use MARC::Record; > use MARC::File::XML ( BinaryEncoding => 'utf8' ); >@@ -9688,6 +9689,68 @@ if ( CheckVersion($DBversion) ) { > } else { > print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n"; > } >+ SetVersion ($DBversion); >+} >+ >+$DBversion = "3.19.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' >+ }); >+ $dbh->do(q{ >+ ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' >+ }); >+ $dbh->do(q{ >+ ALTER TABLE old_issues DROP PRIMARY KEY >+ }); >+ $dbh->do(q{ >+ ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST >+ }); >+ $dbh->do(q{ >+ ALTER TABLE old_issues DROP INDEX itemnumber_idx >+ }); >+ $dbh->do(q{ >+ ALTER TABLE issues DROP PRIMARY KEY >+ }); >+ $dbh->do(q{ >+ ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST >+ }); >+ $dbh->do(q{ >+ ALTER TABLE issues DROP INDEX itemnumber_idx >+ }); >+ $dbh->do(q{ >+ ALTER TABLE issues ADD UNIQUE itemnumber_idx (itemnumber) >+ }); >+ $dbh->do(qq{ >+ UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC >+ }); >+ >+ my $schema = Koha::Database->new()->schema(); >+ my $max_issue_id = $schema->resultset('Issue')->get_column('issue_id')->max(); >+ $max_issue_id ||= $schema->resultset('OldIssue')->get_column('issue_id')->max(); >+ $max_issue_id ||= 0; >+ $max_issue_id++; >+ $dbh->do(qq{ >+ ALTER TABLE issues AUTO_INCREMENT = $max_issue_id >+ }); >+ >+ $dbh->do(q{ >+ INSERT 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 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); > } > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9303
:
22757
|
22770
|
22771
|
22772
|
22783
|
22789
|
22790
|
22809
|
22966
|
22967
|
22968
|
22974
|
22975
|
23086
|
23087
|
23088
|
23089
|
23090
|
23525
|
23526
|
23527
|
24009
|
24010
|
24011
|
24773
|
24774
|
24775
|
24776
|
25008
|
25584
|
25585
|
25586
|
27537
|
27538
|
27539
|
27540
|
27541
|
27542
|
27543
|
27698
|
27699
|
28153
|
28154
|
28155
|
28156
|
28157
|
28158
|
28159
|
28160
|
28161
|
28912
|
29171
|
29172
|
29215
|
29286
|
29287
|
29288
|
29289
|
29290
|
29299
|
29302
|
29303
|
29304
|
29932
|
29933
|
29934
|
29935
|
29936
|
29937
|
30287
|
30288
|
30289
|
30297
|
30298
|
30299
|
30300
|
32053
|
32054
|
32055
|
33049
|
34629
|
34630
|
34631
|
34632
|
34633
|
35519
|
35520
|
35521
|
35522
|
35523
|
35524
|
35525
|
35526
|
35527
|
35528
|
35529
|
35530
|
35531
|
35532
|
35678
|
35679
|
35680
|
35681
|
35682
|
35683
|
35684
|
35686
|
35687
|
35688
|
35689
|
35690
|
35691
|
35832
|
36287
|
36288
|
36289
|
37110
|
37111
|
37112
|
38264
|
38265
|
38266
|
38267
|
38328
|
38329
|
38330
|
38331
|
38446
|
38447
|
38448
|
38449
|
38450
|
38820
|
38821
|
38822
|
38823
|
38824
|
39042
|
39043
|
39044
|
39045
|
39046
|
39047
|
39048
|
39811
|
39817
|
39818
|
39819
|
39820
|
39821
|
39822
|
39823
|
44430
|
44431
|
44432
|
44433
|
44434
|
44435
|
44436
|
44511
|
44512
|
44513
|
44514
|
44515
|
44516
|
44517
|
46136
|
46137
|
46138
|
46139
|
46140
|
46141
|
46142