|
Lines 6-12
package Koha::Schema::Result::Reserve;
Link Here
|
| 6 |
|
6 |
|
| 7 |
=head1 NAME |
7 |
=head1 NAME |
| 8 |
|
8 |
|
| 9 |
Koha::Schema::Result::Reserve |
9 |
Koha::Schema::Result::Reserve - VIEW |
| 10 |
|
10 |
|
| 11 |
=cut |
11 |
=cut |
| 12 |
|
12 |
|
|
Lines 14-39
use strict;
Link Here
|
| 14 |
use warnings; |
14 |
use warnings; |
| 15 |
|
15 |
|
| 16 |
use base 'DBIx::Class::Core'; |
16 |
use base 'DBIx::Class::Core'; |
|
|
17 |
__PACKAGE__->table_class("DBIx::Class::ResultSource::View"); |
| 17 |
|
18 |
|
| 18 |
=head1 TABLE: C<reserves> |
19 |
=head1 TABLE: C<reserves> |
| 19 |
|
20 |
|
| 20 |
=cut |
21 |
=cut |
| 21 |
|
22 |
|
| 22 |
__PACKAGE__->table("reserves"); |
23 |
__PACKAGE__->table("reserves"); |
|
|
24 |
__PACKAGE__->result_source_instance->view_definition("select `dbic`.`holds`.`id` AS `reserve_id`,`dbic`.`holds`.`patron_id` AS `borrowernumber`,`dbic`.`holds`.`placing_date` AS `reservedate`,`dbic`.`holds`.`biblio_id` AS `biblionumber`,`dbic`.`holds`.`pickup_library_id` AS `branchcode`,NULL AS `cancellationdate`,`dbic`.`holds`.`notes` AS `reservenotes`,`dbic`.`holds`.`priority` AS `priority`,(case when (`dbic`.`holds`.`status` = 'waiting') then 'W' when (`dbic`.`holds`.`status` = 'in_transit') then 'T' else NULL end) AS `found`,`dbic`.`holds`.`timestamp` AS `timestamp`,`dbic`.`holds`.`item_id` AS `itemnumber`,`dbic`.`holds`.`waiting_date` AS `waitingdate`,`dbic`.`holds`.`expiration_date` AS `expirationdate`,`dbic`.`holds`.`lowest_priority` AS `lowestPriority`,`dbic`.`holds`.`suspended` AS `suspend`,`dbic`.`holds`.`suspended_until_date` AS `suspend_until`,`dbic`.`holds`.`item_type` AS `itemtype`,`dbic`.`holds`.`item_level` AS `item_level_hold` from `dbic`.`holds` where (`dbic`.`holds`.`completed` = 0)"); |
| 23 |
|
25 |
|
| 24 |
=head1 ACCESSORS |
26 |
=head1 ACCESSORS |
| 25 |
|
27 |
|
| 26 |
=head2 reserve_id |
28 |
=head2 reserve_id |
| 27 |
|
29 |
|
| 28 |
data_type: 'integer' |
30 |
data_type: 'integer' |
| 29 |
is_auto_increment: 1 |
31 |
default_value: 0 |
| 30 |
is_nullable: 0 |
32 |
is_nullable: 0 |
| 31 |
|
33 |
|
| 32 |
=head2 borrowernumber |
34 |
=head2 borrowernumber |
| 33 |
|
35 |
|
| 34 |
data_type: 'integer' |
36 |
data_type: 'integer' |
| 35 |
default_value: 0 |
37 |
default_value: 0 |
| 36 |
is_foreign_key: 1 |
|
|
| 37 |
is_nullable: 0 |
38 |
is_nullable: 0 |
| 38 |
|
39 |
|
| 39 |
=head2 reservedate |
40 |
=head2 reservedate |
|
Lines 46-77
__PACKAGE__->table("reserves");
Link Here
|
| 46 |
|
47 |
|
| 47 |
data_type: 'integer' |
48 |
data_type: 'integer' |
| 48 |
default_value: 0 |
49 |
default_value: 0 |
| 49 |
is_foreign_key: 1 |
|
|
| 50 |
is_nullable: 0 |
50 |
is_nullable: 0 |
| 51 |
|
51 |
|
| 52 |
=head2 branchcode |
52 |
=head2 branchcode |
| 53 |
|
53 |
|
| 54 |
data_type: 'varchar' |
54 |
data_type: 'varchar' |
| 55 |
is_foreign_key: 1 |
|
|
| 56 |
is_nullable: 1 |
55 |
is_nullable: 1 |
| 57 |
size: 10 |
56 |
size: 10 |
| 58 |
|
57 |
|
| 59 |
=head2 notificationdate |
|
|
| 60 |
|
| 61 |
data_type: 'date' |
| 62 |
datetime_undef_if_invalid: 1 |
| 63 |
is_nullable: 1 |
| 64 |
|
| 65 |
=head2 reminderdate |
| 66 |
|
| 67 |
data_type: 'date' |
| 68 |
datetime_undef_if_invalid: 1 |
| 69 |
is_nullable: 1 |
| 70 |
|
| 71 |
=head2 cancellationdate |
58 |
=head2 cancellationdate |
| 72 |
|
59 |
|
| 73 |
data_type: 'date' |
60 |
data_type: 'binary' |
| 74 |
datetime_undef_if_invalid: 1 |
|
|
| 75 |
is_nullable: 1 |
61 |
is_nullable: 1 |
| 76 |
|
62 |
|
| 77 |
=head2 reservenotes |
63 |
=head2 reservenotes |
|
Lines 95-107
__PACKAGE__->table("reserves");
Link Here
|
| 95 |
|
81 |
|
| 96 |
data_type: 'timestamp' |
82 |
data_type: 'timestamp' |
| 97 |
datetime_undef_if_invalid: 1 |
83 |
datetime_undef_if_invalid: 1 |
| 98 |
default_value: current_timestamp |
84 |
default_value: '0000-00-00 00:00:00' |
| 99 |
is_nullable: 0 |
85 |
is_nullable: 0 |
| 100 |
|
86 |
|
| 101 |
=head2 itemnumber |
87 |
=head2 itemnumber |
| 102 |
|
88 |
|
| 103 |
data_type: 'integer' |
89 |
data_type: 'integer' |
| 104 |
is_foreign_key: 1 |
|
|
| 105 |
is_nullable: 1 |
90 |
is_nullable: 1 |
| 106 |
|
91 |
|
| 107 |
=head2 waitingdate |
92 |
=head2 waitingdate |
|
Lines 138-144
__PACKAGE__->table("reserves");
Link Here
|
| 138 |
=head2 itemtype |
123 |
=head2 itemtype |
| 139 |
|
124 |
|
| 140 |
data_type: 'varchar' |
125 |
data_type: 'varchar' |
| 141 |
is_foreign_key: 1 |
|
|
| 142 |
is_nullable: 1 |
126 |
is_nullable: 1 |
| 143 |
size: 10 |
127 |
size: 10 |
| 144 |
|
128 |
|
|
Lines 152-182
__PACKAGE__->table("reserves");
Link Here
|
| 152 |
|
136 |
|
| 153 |
__PACKAGE__->add_columns( |
137 |
__PACKAGE__->add_columns( |
| 154 |
"reserve_id", |
138 |
"reserve_id", |
| 155 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
139 |
{ data_type => "integer", default_value => 0, is_nullable => 0 }, |
| 156 |
"borrowernumber", |
140 |
"borrowernumber", |
| 157 |
{ |
141 |
{ data_type => "integer", default_value => 0, is_nullable => 0 }, |
| 158 |
data_type => "integer", |
|
|
| 159 |
default_value => 0, |
| 160 |
is_foreign_key => 1, |
| 161 |
is_nullable => 0, |
| 162 |
}, |
| 163 |
"reservedate", |
142 |
"reservedate", |
| 164 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
143 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 165 |
"biblionumber", |
144 |
"biblionumber", |
| 166 |
{ |
145 |
{ data_type => "integer", default_value => 0, is_nullable => 0 }, |
| 167 |
data_type => "integer", |
|
|
| 168 |
default_value => 0, |
| 169 |
is_foreign_key => 1, |
| 170 |
is_nullable => 0, |
| 171 |
}, |
| 172 |
"branchcode", |
146 |
"branchcode", |
| 173 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
147 |
{ data_type => "varchar", is_nullable => 1, size => 10 }, |
| 174 |
"notificationdate", |
|
|
| 175 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 176 |
"reminderdate", |
| 177 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 178 |
"cancellationdate", |
148 |
"cancellationdate", |
| 179 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
149 |
{ data_type => "binary", is_nullable => 1 }, |
| 180 |
"reservenotes", |
150 |
"reservenotes", |
| 181 |
{ data_type => "longtext", is_nullable => 1 }, |
151 |
{ data_type => "longtext", is_nullable => 1 }, |
| 182 |
"priority", |
152 |
"priority", |
|
Lines 187-197
__PACKAGE__->add_columns(
Link Here
|
| 187 |
{ |
157 |
{ |
| 188 |
data_type => "timestamp", |
158 |
data_type => "timestamp", |
| 189 |
datetime_undef_if_invalid => 1, |
159 |
datetime_undef_if_invalid => 1, |
| 190 |
default_value => \"current_timestamp", |
160 |
default_value => "0000-00-00 00:00:00", |
| 191 |
is_nullable => 0, |
161 |
is_nullable => 0, |
| 192 |
}, |
162 |
}, |
| 193 |
"itemnumber", |
163 |
"itemnumber", |
| 194 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, |
164 |
{ data_type => "integer", is_nullable => 1 }, |
| 195 |
"waitingdate", |
165 |
"waitingdate", |
| 196 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
166 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 197 |
"expirationdate", |
167 |
"expirationdate", |
|
Lines 212-368
__PACKAGE__->add_columns(
Link Here
|
| 212 |
is_nullable => 1, |
182 |
is_nullable => 1, |
| 213 |
}, |
183 |
}, |
| 214 |
"itemtype", |
184 |
"itemtype", |
| 215 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
185 |
{ data_type => "varchar", is_nullable => 1, size => 10 }, |
| 216 |
"item_level_hold", |
186 |
"item_level_hold", |
| 217 |
{ data_type => "tinyint", default_value => 0, is_nullable => 0 }, |
187 |
{ data_type => "tinyint", default_value => 0, is_nullable => 0 }, |
| 218 |
); |
188 |
); |
| 219 |
|
189 |
|
| 220 |
=head1 PRIMARY KEY |
|
|
| 221 |
|
| 222 |
=over 4 |
| 223 |
|
| 224 |
=item * L</reserve_id> |
| 225 |
|
| 226 |
=back |
| 227 |
|
| 228 |
=cut |
| 229 |
|
| 230 |
__PACKAGE__->set_primary_key("reserve_id"); |
| 231 |
|
| 232 |
=head1 RELATIONS |
| 233 |
|
| 234 |
=head2 biblionumber |
| 235 |
|
| 236 |
Type: belongs_to |
| 237 |
|
| 238 |
Related object: L<Koha::Schema::Result::Biblio> |
| 239 |
|
| 240 |
=cut |
| 241 |
|
| 242 |
__PACKAGE__->belongs_to( |
| 243 |
"biblionumber", |
| 244 |
"Koha::Schema::Result::Biblio", |
| 245 |
{ biblionumber => "biblionumber" }, |
| 246 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
| 247 |
); |
| 248 |
|
| 249 |
=head2 borrowernumber |
| 250 |
|
| 251 |
Type: belongs_to |
| 252 |
|
| 253 |
Related object: L<Koha::Schema::Result::Borrower> |
| 254 |
|
| 255 |
=cut |
| 256 |
|
| 257 |
__PACKAGE__->belongs_to( |
| 258 |
"borrowernumber", |
| 259 |
"Koha::Schema::Result::Borrower", |
| 260 |
{ borrowernumber => "borrowernumber" }, |
| 261 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
| 262 |
); |
| 263 |
|
| 264 |
=head2 branchcode |
| 265 |
|
| 266 |
Type: belongs_to |
| 267 |
|
| 268 |
Related object: L<Koha::Schema::Result::Branch> |
| 269 |
|
| 270 |
=cut |
| 271 |
|
| 272 |
__PACKAGE__->belongs_to( |
| 273 |
"branchcode", |
| 274 |
"Koha::Schema::Result::Branch", |
| 275 |
{ branchcode => "branchcode" }, |
| 276 |
{ |
| 277 |
is_deferrable => 1, |
| 278 |
join_type => "LEFT", |
| 279 |
on_delete => "CASCADE", |
| 280 |
on_update => "CASCADE", |
| 281 |
}, |
| 282 |
); |
| 283 |
|
| 284 |
=head2 club_holds_to_patron_holds |
| 285 |
|
| 286 |
Type: has_many |
| 287 |
|
| 288 |
Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold> |
| 289 |
|
| 290 |
=cut |
| 291 |
|
| 292 |
__PACKAGE__->has_many( |
| 293 |
"club_holds_to_patron_holds", |
| 294 |
"Koha::Schema::Result::ClubHoldsToPatronHold", |
| 295 |
{ "foreign.hold_id" => "self.reserve_id" }, |
| 296 |
{ cascade_copy => 0, cascade_delete => 0 }, |
| 297 |
); |
| 298 |
|
| 299 |
=head2 itemnumber |
| 300 |
|
| 301 |
Type: belongs_to |
| 302 |
|
| 303 |
Related object: L<Koha::Schema::Result::Item> |
| 304 |
|
| 305 |
=cut |
| 306 |
|
190 |
|
| 307 |
__PACKAGE__->belongs_to( |
191 |
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-22 19:21:04 |
| 308 |
"itemnumber", |
192 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5rN+zc7MxGkvUsCfihsq2Q |
| 309 |
"Koha::Schema::Result::Item", |
|
|
| 310 |
{ itemnumber => "itemnumber" }, |
| 311 |
{ |
| 312 |
is_deferrable => 1, |
| 313 |
join_type => "LEFT", |
| 314 |
on_delete => "CASCADE", |
| 315 |
on_update => "CASCADE", |
| 316 |
}, |
| 317 |
); |
| 318 |
|
| 319 |
=head2 itemtype |
| 320 |
|
| 321 |
Type: belongs_to |
| 322 |
|
| 323 |
Related object: L<Koha::Schema::Result::Itemtype> |
| 324 |
|
| 325 |
=cut |
| 326 |
|
| 327 |
__PACKAGE__->belongs_to( |
| 328 |
"itemtype", |
| 329 |
"Koha::Schema::Result::Itemtype", |
| 330 |
{ itemtype => "itemtype" }, |
| 331 |
{ |
| 332 |
is_deferrable => 1, |
| 333 |
join_type => "LEFT", |
| 334 |
on_delete => "CASCADE", |
| 335 |
on_update => "CASCADE", |
| 336 |
}, |
| 337 |
); |
| 338 |
|
| 339 |
|
| 340 |
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-18 12:43:15 |
| 341 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VH7h5kYo9WhlGobXb3N3Jg |
| 342 |
|
| 343 |
__PACKAGE__->belongs_to( |
| 344 |
"item", |
| 345 |
"Koha::Schema::Result::Item", |
| 346 |
{ itemnumber => "itemnumber" }, |
| 347 |
{ |
| 348 |
is_deferrable => 1, |
| 349 |
join_type => "LEFT", |
| 350 |
on_delete => "CASCADE", |
| 351 |
on_update => "CASCADE", |
| 352 |
}, |
| 353 |
); |
| 354 |
|
| 355 |
__PACKAGE__->belongs_to( |
| 356 |
"biblio", |
| 357 |
"Koha::Schema::Result::Biblio", |
| 358 |
{ biblionumber => "biblionumber" }, |
| 359 |
{ |
| 360 |
is_deferrable => 1, |
| 361 |
join_type => "LEFT", |
| 362 |
on_delete => "CASCADE", |
| 363 |
on_update => "CASCADE", |
| 364 |
}, |
| 365 |
); |
| 366 |
|
193 |
|
| 367 |
__PACKAGE__->add_columns( |
194 |
__PACKAGE__->add_columns( |
| 368 |
'+item_level_hold' => { is_boolean => 1 }, |
195 |
'+item_level_hold' => { is_boolean => 1 }, |
| 369 |
- |
|
|