Bugzilla – Attachment 28153 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 - Schema Updates
Bug-9303-1---relatives-checkouts-in-the-opac---Sch.patch (text/plain), 14.75 KB, created by
Kyle M Hall (khall)
on 2014-05-09 17:22:11 UTC
(
hide
)
Description:
Bug 9303 [1] - relative's checkouts in the opac - Schema Updates
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-05-09 17:22:11 UTC
Size:
14.75 KB
patch
obsolete
>From b0091747d9c95f5bf2fad69052e770ff1c8aca8b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 27 Jan 2014 12:50:23 -0500 >Subject: [PATCH] Bug 9303 [1] - relative's checkouts in the opac - Schema 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: Joel Sasse <jsasse@plumcreeklibrary.net> > >Signed-off-by: Heather Braum <hbraum@nekls.org> >--- > Koha/Schema/Result/Borrower.pm | 114 +++++++++++----------------------------- > Koha/Schema/Result/Issue.pm | 80 +++++++++++----------------- > Koha/Schema/Result/OldIssue.pm | 73 ++++++++----------------- > 3 files changed, 83 insertions(+), 184 deletions(-) > >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 3d9f9ae..3915ed7 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1,21 +1,17 @@ >-use utf8; > package Koha::Schema::Result::Borrower; > > # Created by DBIx::Class::Schema::Loader > # DO NOT MODIFY THE FIRST PART OF THIS FILE > >-=head1 NAME >- >-Koha::Schema::Result::Borrower >- >-=cut >- > use strict; > use warnings; > > use base 'DBIx::Class::Core'; > >-=head1 TABLE: C<borrowers> >+ >+=head1 NAME >+ >+Koha::Schema::Result::Borrower > > =cut > >@@ -191,7 +187,6 @@ __PACKAGE__->table("borrowers"); > =head2 dateofbirth > > data_type: 'date' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 branchcode >@@ -213,13 +208,11 @@ __PACKAGE__->table("borrowers"); > =head2 dateenrolled > > data_type: 'date' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 dateexpiry > > data_type: 'date' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 gonenoaddress >@@ -235,7 +228,6 @@ __PACKAGE__->table("borrowers"); > =head2 debarred > > data_type: 'date' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 debarredcomment >@@ -397,6 +389,12 @@ __PACKAGE__->table("borrowers"); > default_value: 1 > is_nullable: 0 > >+=head2 privacy_relative_checkouts >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ > =cut > > __PACKAGE__->add_columns( >@@ -463,7 +461,7 @@ __PACKAGE__->add_columns( > "b_phone", > { data_type => "mediumtext", is_nullable => 1 }, > "dateofbirth", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "date", is_nullable => 1 }, > "branchcode", > { > data_type => "varchar", >@@ -481,15 +479,15 @@ __PACKAGE__->add_columns( > size => 10, > }, > "dateenrolled", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "date", is_nullable => 1 }, > "dateexpiry", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "date", is_nullable => 1 }, > "gonenoaddress", > { data_type => "tinyint", is_nullable => 1 }, > "lost", > { data_type => "tinyint", is_nullable => 1 }, > "debarred", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "date", is_nullable => 1 }, > "debarredcomment", > { data_type => "varchar", is_nullable => 1, size => 255 }, > "contactname", >@@ -546,32 +544,10 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 1, size => 50 }, > "privacy", > { data_type => "integer", default_value => 1, is_nullable => 0 }, >+ "privacy_relative_checkouts", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > ); >- >-=head1 PRIMARY KEY >- >-=over 4 >- >-=item * L</borrowernumber> >- >-=back >- >-=cut >- > __PACKAGE__->set_primary_key("borrowernumber"); >- >-=head1 UNIQUE CONSTRAINTS >- >-=head2 C<cardnumber> >- >-=over 4 >- >-=item * L</cardnumber> >- >-=back >- >-=cut >- > __PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]); > > =head1 RELATIONS >@@ -696,34 +672,34 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 branchcode >+=head2 categorycode > > Type: belongs_to > >-Related object: L<Koha::Schema::Result::Branch> >+Related object: L<Koha::Schema::Result::Category> > > =cut > > __PACKAGE__->belongs_to( >- "branchcode", >- "Koha::Schema::Result::Branch", >- { branchcode => "branchcode" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+ "categorycode", >+ "Koha::Schema::Result::Category", >+ { categorycode => "categorycode" }, >+ { on_delete => "CASCADE", on_update => "CASCADE" }, > ); > >-=head2 categorycode >+=head2 branchcode > > Type: belongs_to > >-Related object: L<Koha::Schema::Result::Category> >+Related object: L<Koha::Schema::Result::Branch> > > =cut > > __PACKAGE__->belongs_to( >- "categorycode", >- "Koha::Schema::Result::Category", >- { categorycode => "categorycode" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+ "branchcode", >+ "Koha::Schema::Result::Branch", >+ { branchcode => "branchcode" }, >+ { on_delete => "CASCADE", on_update => "CASCADE" }, > ); > > =head2 course_instructors >@@ -1041,39 +1017,9 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 basketnoes >- >-Type: many_to_many >- >-Composing rels: L</aqbasketusers> -> basketno >- >-=cut >- >-__PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno"); >- >-=head2 budgets >- >-Type: many_to_many >- >-Composing rels: L</aqbudgetborrowers> -> budget >- >-=cut >- >-__PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget"); >- >-=head2 courses >- >-Type: many_to_many >- >-Composing rels: L</course_instructors> -> course >- >-=cut >- >-__PACKAGE__->many_to_many("courses", "course_instructors", "course"); >- > >-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 16:31:19 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z4kW3xYX1CyrwvGdZu32nA >+# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-07 08:15:21 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TQTGI0fDt+xCFs+8nOarfA > > > # You can replace this text with custom content, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm >index 282c802..5c834a8 100644 >--- a/Koha/Schema/Result/Issue.pm >+++ b/Koha/Schema/Result/Issue.pm >@@ -1,21 +1,17 @@ >-use utf8; > package Koha::Schema::Result::Issue; > > # Created by DBIx::Class::Schema::Loader > # DO NOT MODIFY THE FIRST PART OF THIS FILE > >-=head1 NAME >- >-Koha::Schema::Result::Issue >- >-=cut >- > use strict; > use warnings; > > use base 'DBIx::Class::Core'; > >-=head1 TABLE: C<issues> >+ >+=head1 NAME >+ >+Koha::Schema::Result::Issue > > =cut > >@@ -23,6 +19,12 @@ __PACKAGE__->table("issues"); > > =head1 ACCESSORS > >+=head2 issue_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ > =head2 borrowernumber > > data_type: 'integer' >@@ -38,7 +40,6 @@ __PACKAGE__->table("issues"); > =head2 date_due > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 branchcode >@@ -56,13 +57,11 @@ __PACKAGE__->table("issues"); > =head2 returndate > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 lastreneweddate > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 return >@@ -79,63 +78,47 @@ __PACKAGE__->table("issues"); > =head2 timestamp > > data_type: 'timestamp' >- datetime_undef_if_invalid: 1 > default_value: current_timestamp > is_nullable: 0 > > =head2 issuedate > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =cut > > __PACKAGE__->add_columns( >+ "issue_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, > "borrowernumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "itemnumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "date_due", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > "branchcode", > { data_type => "varchar", is_nullable => 1, size => 10 }, > "issuingbranch", > { data_type => "varchar", is_nullable => 1, size => 18 }, > "returndate", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > "lastreneweddate", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > "return", > { data_type => "varchar", is_nullable => 1, size => 4 }, > "renewals", > { data_type => "tinyint", is_nullable => 1 }, > "timestamp", > { >- data_type => "timestamp", >- datetime_undef_if_invalid => 1, >+ data_type => "timestamp", > default_value => \"current_timestamp", >- is_nullable => 0, >+ is_nullable => 0, > }, > "issuedate", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > ); >+__PACKAGE__->set_primary_key("issue_id"); > > =head1 RELATIONS > >@@ -151,12 +134,7 @@ __PACKAGE__->belongs_to( > "borrowernumber", > "Koha::Schema::Result::Borrower", > { borrowernumber => "borrowernumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >+ { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, > ); > > =head2 itemnumber >@@ -171,17 +149,12 @@ __PACKAGE__->belongs_to( > "itemnumber", > "Koha::Schema::Result::Item", > { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >+ { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZEh31EKBmURMKxDxI+H3EA >+# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-06 14:03:30 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x90AnyA32VcLbXMb7hfA9g > > __PACKAGE__->belongs_to( > "borrower", >@@ -190,4 +163,11 @@ __PACKAGE__->belongs_to( > { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, > ); > >+__PACKAGE__->belongs_to( >+ "item", >+ "Koha::Schema::Result::Item", >+ { itemnumber => "itemnumber" }, >+ { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ > 1; >diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm >index 4050f06..d63b867 100644 >--- a/Koha/Schema/Result/OldIssue.pm >+++ b/Koha/Schema/Result/OldIssue.pm >@@ -1,21 +1,17 @@ >-use utf8; > package Koha::Schema::Result::OldIssue; > > # Created by DBIx::Class::Schema::Loader > # DO NOT MODIFY THE FIRST PART OF THIS FILE > >-=head1 NAME >- >-Koha::Schema::Result::OldIssue >- >-=cut >- > use strict; > use warnings; > > use base 'DBIx::Class::Core'; > >-=head1 TABLE: C<old_issues> >+ >+=head1 NAME >+ >+Koha::Schema::Result::OldIssue > > =cut > >@@ -23,6 +19,12 @@ __PACKAGE__->table("old_issues"); > > =head1 ACCESSORS > >+=head2 issue_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ > =head2 borrowernumber > > data_type: 'integer' >@@ -38,7 +40,6 @@ __PACKAGE__->table("old_issues"); > =head2 date_due > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 branchcode >@@ -56,13 +57,11 @@ __PACKAGE__->table("old_issues"); > =head2 returndate > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 lastreneweddate > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =head2 return >@@ -79,63 +78,47 @@ __PACKAGE__->table("old_issues"); > =head2 timestamp > > data_type: 'timestamp' >- datetime_undef_if_invalid: 1 > default_value: current_timestamp > is_nullable: 0 > > =head2 issuedate > > data_type: 'datetime' >- datetime_undef_if_invalid: 1 > is_nullable: 1 > > =cut > > __PACKAGE__->add_columns( >+ "issue_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, > "borrowernumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "itemnumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "date_due", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > "branchcode", > { data_type => "varchar", is_nullable => 1, size => 10 }, > "issuingbranch", > { data_type => "varchar", is_nullable => 1, size => 18 }, > "returndate", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > "lastreneweddate", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > "return", > { data_type => "varchar", is_nullable => 1, size => 4 }, > "renewals", > { data_type => "tinyint", is_nullable => 1 }, > "timestamp", > { >- data_type => "timestamp", >- datetime_undef_if_invalid => 1, >+ data_type => "timestamp", > default_value => \"current_timestamp", >- is_nullable => 0, >+ is_nullable => 0, > }, > "issuedate", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "datetime", is_nullable => 1 }, > ); >+__PACKAGE__->set_primary_key("issue_id"); > > =head1 RELATIONS > >@@ -151,12 +134,7 @@ __PACKAGE__->belongs_to( > "borrowernumber", > "Koha::Schema::Result::Borrower", > { borrowernumber => "borrowernumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >+ { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, > ); > > =head2 itemnumber >@@ -171,17 +149,12 @@ __PACKAGE__->belongs_to( > "itemnumber", > "Koha::Schema::Result::Item", > { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >+ { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uPOxNROoMMRZ0qZsXsxEjA >+# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-07 08:15:21 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:np3nmo0XYIYp92QbCY6/cw > > > # You can replace this text with custom content, and it will be preserved on regeneration >-- >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