Lines 29-55
use C4::Auth qw( checkauth );
Link Here
|
29 |
|
29 |
|
30 |
use Koha::Items; |
30 |
use Koha::Items; |
31 |
use Koha::Patrons; |
31 |
use Koha::Patrons; |
|
|
32 |
use Koha::HoldGroup; |
32 |
|
33 |
|
33 |
my $input = CGI->new(); |
34 |
my $input = CGI->new(); |
34 |
|
35 |
|
35 |
checkauth( $input, 0, { reserveforothers => 'place_holds' }, 'intranet' ); |
36 |
checkauth( $input, 0, { reserveforothers => 'place_holds' }, 'intranet' ); |
36 |
|
37 |
|
37 |
my @reqbib = $input->multi_param('reqbib'); |
38 |
my @reqbib = $input->multi_param('reqbib'); |
38 |
my @biblionumbers = $input->multi_param('biblionumber'); |
39 |
my @biblionumbers = $input->multi_param('biblionumber'); |
39 |
my @holdable_bibs = $input->multi_param('holdable_bibs'); |
40 |
my @holdable_bibs = $input->multi_param('holdable_bibs'); |
40 |
my $borrowernumber = $input->param('borrowernumber'); |
41 |
my $borrowernumber = $input->param('borrowernumber'); |
41 |
my $notes = $input->param('notes'); |
42 |
my $notes = $input->param('notes'); |
42 |
my $branch = $input->param('pickup'); |
43 |
my $branch = $input->param('pickup'); |
43 |
my $startdate = $input->param('reserve_date') || ''; |
44 |
my $startdate = $input->param('reserve_date') || ''; |
44 |
my @rank = $input->multi_param('rank-request'); |
45 |
my @rank = $input->multi_param('rank-request'); |
45 |
my $title = $input->param('title'); |
46 |
my $title = $input->param('title'); |
46 |
my @checkitems = $input->multi_param('checkitem'); |
47 |
my @checkitems = $input->multi_param('checkitem'); |
47 |
my $item_group_id = $input->param('item_group_id'); |
48 |
my $item_group_id = $input->param('item_group_id'); |
48 |
my $expirationdate = $input->param('expiration_date'); |
49 |
my $expirationdate = $input->param('expiration_date'); |
49 |
my $itemtype = $input->param('itemtype') || undef; |
50 |
my $itemtype = $input->param('itemtype') || undef; |
50 |
my $non_priority = $input->param('non_priority'); |
51 |
my $non_priority = $input->param('non_priority'); |
51 |
my $op = $input->param('op') || q{}; |
52 |
my $op = $input->param('op') || q{}; |
52 |
my $multi_holds = $input->param('multi_holds'); |
53 |
my $multi_holds = $input->param('multi_holds'); |
|
|
54 |
my $hold_group_param = $input->param('hold_group') || undef; |
55 |
my $hold_group; |
53 |
|
56 |
|
54 |
my $patron = Koha::Patrons->find($borrowernumber); |
57 |
my $patron = Koha::Patrons->find($borrowernumber); |
55 |
|
58 |
|
Lines 66-71
foreach my $bibnum (@holdable_bibs) {
Link Here
|
66 |
|
69 |
|
67 |
if ( $op eq 'cud-placerequest' && $patron ) { |
70 |
if ( $op eq 'cud-placerequest' && $patron ) { |
68 |
my %failed_holds; |
71 |
my %failed_holds; |
|
|
72 |
if ($hold_group_param) { |
73 |
$hold_group = Koha::HoldGroup->new->store; |
74 |
} |
75 |
|
69 |
foreach my $biblionumber ( keys %bibinfos ) { |
76 |
foreach my $biblionumber ( keys %bibinfos ) { |
70 |
|
77 |
|
71 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); |
78 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); |
Lines 102-107
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
102 |
found => undef, |
109 |
found => undef, |
103 |
itemtype => $itemtype, |
110 |
itemtype => $itemtype, |
104 |
non_priority => $non_priority, |
111 |
non_priority => $non_priority, |
|
|
112 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
105 |
} |
113 |
} |
106 |
); |
114 |
); |
107 |
|
115 |
|
Lines 130-135
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
130 |
found => undef, |
138 |
found => undef, |
131 |
itemtype => $itemtype, |
139 |
itemtype => $itemtype, |
132 |
non_priority => $non_priority, |
140 |
non_priority => $non_priority, |
|
|
141 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
133 |
} |
142 |
} |
134 |
); |
143 |
); |
135 |
} |
144 |
} |
Lines 153-158
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
153 |
itemtype => $itemtype, |
162 |
itemtype => $itemtype, |
154 |
non_priority => $non_priority, |
163 |
non_priority => $non_priority, |
155 |
item_group_id => $item_group_id, |
164 |
item_group_id => $item_group_id, |
|
|
165 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
156 |
} |
166 |
} |
157 |
); |
167 |
); |
158 |
} |
168 |
} |