Bugzilla – Attachment 135321 Details for
Bug 22456
Allow patrons to cancel their waiting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22456: DBIC update
Bug-22456-DBIC-update.patch (text/plain), 6.86 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-05-24 17:17:49 UTC
(
hide
)
Description:
Bug 22456: DBIC update
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-05-24 17:17:49 UTC
Size:
6.86 KB
patch
obsolete
>From 2eba78f702fe09bfeeeba92099406d8bed6a4205 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 18 Apr 2022 13:08:19 -0300 >Subject: [PATCH] Bug 22456: DBIC update > >--- > Koha/Schema/Result/Borrower.pm | 34 ++- > Koha/Schema/Result/HoldCancellationRequest.pm | 219 ++++++++++++++++++ > Koha/Schema/Result/Reserve.pm | 4 +- > 3 files changed, 253 insertions(+), 4 deletions(-) > create mode 100644 Koha/Schema/Result/HoldCancellationRequest.pm > >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 5d0cac62c4..87a392323b 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1249,6 +1249,36 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 hold_cancellation_requests_requesters >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::HoldCancellationRequest> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "hold_cancellation_requests_requesters", >+ "Koha::Schema::Result::HoldCancellationRequest", >+ { "foreign.requester_id" => "self.borrowernumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+=head2 hold_cancellation_requests_resolvers >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::HoldCancellationRequest> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "hold_cancellation_requests_resolvers", >+ "Koha::Schema::Result::HoldCancellationRequest", >+ { "foreign.resolver_id" => "self.borrowernumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 hold_fill_targets > > Type: has_many >@@ -1965,8 +1995,8 @@ Composing rels: L</user_permissions> -> permission > __PACKAGE__->many_to_many("permissions", "user_permissions", "permission"); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-06 19:32:13 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lGlRQ4XvRdsrqTye6sDpYg >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-16 18:18:02 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WK9kGNgMgN3hH/ZRf7SH1g > > __PACKAGE__->has_many( > "extended_attributes", >diff --git a/Koha/Schema/Result/HoldCancellationRequest.pm b/Koha/Schema/Result/HoldCancellationRequest.pm >new file mode 100644 >index 0000000000..a66cc1b185 >--- /dev/null >+++ b/Koha/Schema/Result/HoldCancellationRequest.pm >@@ -0,0 +1,219 @@ >+use utf8; >+package Koha::Schema::Result::HoldCancellationRequest; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::HoldCancellationRequest >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<hold_cancellation_requests> >+ >+=cut >+ >+__PACKAGE__->table("hold_cancellation_requests"); >+ >+=head1 ACCESSORS >+ >+=head2 hold_cancellation_request_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+Unique ID of the cancellation request >+ >+=head2 hold_id >+ >+ data_type: 'integer' >+ is_nullable: 0 >+ >+ID of the hold >+ >+=head2 requester_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+ID of the user that made the cancellation request >+ >+=head2 creation_date >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ is_nullable: 1 >+ >+Time and date the cancellation request was created >+ >+=head2 source >+ >+ data_type: 'enum' >+ default_value: 'owner' >+ extra: {list => ["owner"]} >+ is_nullable: 0 >+ >+The source for the cancellation request >+ >+=head2 status >+ >+ data_type: 'enum' >+ default_value: 'requested' >+ extra: {list => ["requested","accepted","rejected"]} >+ is_nullable: 1 >+ >+request status >+ >+=head2 resolution_date >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ is_nullable: 1 >+ >+Time and date cancellation request was resolved >+ >+=head2 resolver_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+ID of the staff member that resolved the request >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "hold_cancellation_request_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "hold_id", >+ { data_type => "integer", is_nullable => 0 }, >+ "requester_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ "creation_date", >+ { >+ data_type => "timestamp", >+ datetime_undef_if_invalid => 1, >+ is_nullable => 1, >+ }, >+ "source", >+ { >+ data_type => "enum", >+ default_value => "owner", >+ extra => { list => ["owner"] }, >+ is_nullable => 0, >+ }, >+ "status", >+ { >+ data_type => "enum", >+ default_value => "requested", >+ extra => { list => ["requested", "accepted", "rejected"] }, >+ is_nullable => 1, >+ }, >+ "resolution_date", >+ { >+ data_type => "timestamp", >+ datetime_undef_if_invalid => 1, >+ is_nullable => 1, >+ }, >+ "resolver_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</hold_cancellation_request_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("hold_cancellation_request_id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<hold_requester_uniq> >+ >+=over 4 >+ >+=item * L</hold_id> >+ >+=item * L</requester_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("hold_requester_uniq", ["hold_id", "requester_id"]); >+ >+=head1 RELATIONS >+ >+=head2 requester >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Borrower> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "requester", >+ "Koha::Schema::Result::Borrower", >+ { borrowernumber => "requester_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "CASCADE", >+ on_update => "CASCADE", >+ }, >+); >+ >+=head2 resolver >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Borrower> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "resolver", >+ "Koha::Schema::Result::Borrower", >+ { borrowernumber => "resolver_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-18 17:36:48 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LQw6vNCU3DspZ7UOdgHvjg >+ >+# FIXME: Revisit after bug 25260 >+__PACKAGE__->might_have( >+ "hold", >+ "Koha::Schema::Result::Reserve", >+ { "foreign.reserve_id" => "self.hold_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+sub koha_object_class { >+ 'Koha::Hold::CancellationRequest'; >+} >+sub koha_objects_class { >+ 'Koha::Hold::CancellationRequests'; >+} >+ >+1; >diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm >index 04b81a1960..08818830ca 100644 >--- a/Koha/Schema/Result/Reserve.pm >+++ b/Koha/Schema/Result/Reserve.pm >@@ -431,8 +431,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:08:09 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7Q8/GFCOkXdn+jg69HZ0GQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-19 15:00:15 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nlwpni0zHBZZ5sODq9eF8w > > __PACKAGE__->belongs_to( > "item", >-- >2.34.1
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 22456
:
135165
|
135166
|
135167
|
135168
|
135169
|
135170
|
135171
|
135319
|
135320
|
135321
|
135322
|
135323
|
135324
|
135325
|
135326
|
135349
|
135350
|
135351
|
135352
|
135396
|
135397
|
135398
|
135399
|
135400
|
135401
|
135402
|
135403
|
135404
|
135405
|
135406
|
135407
|
135408
|
135409
|
135410
|
135411
|
135430
|
135830
|
135831
|
135832
|
135838
|
135839
|
135840
|
135841
|
135842
|
135843
|
135844
|
135845
|
135846
|
137580
|
137581
|
137582
|
137583
|
137584
|
137585
|
137586
|
137587
|
137588
|
137589
|
137591
|
138209
|
138210
|
138211
|
138212
|
138213
|
138214
|
138215
|
138216
|
138217
|
138218