|
Lines 22-27
package C4::Reserves;
Link Here
|
| 22 |
|
22 |
|
| 23 |
use Modern::Perl; |
23 |
use Modern::Perl; |
| 24 |
|
24 |
|
|
|
25 |
use JSON qw( to_json ); |
| 26 |
|
| 25 |
use C4::Accounts; |
27 |
use C4::Accounts; |
| 26 |
use C4::Biblio qw( GetMarcFromKohaField ); |
28 |
use C4::Biblio qw( GetMarcFromKohaField ); |
| 27 |
use C4::Circulation qw( CheckIfIssuedToPatron GetAgeRestriction GetBranchItemRule ); |
29 |
use C4::Circulation qw( CheckIfIssuedToPatron GetAgeRestriction GetBranchItemRule ); |
|
Lines 193-198
sub AddReserve {
Link Here
|
| 193 |
my $non_priority = $params->{non_priority}; |
195 |
my $non_priority = $params->{non_priority}; |
| 194 |
my $item_group_id = $params->{item_group_id}; |
196 |
my $item_group_id = $params->{item_group_id}; |
| 195 |
my $hold_group_id = $params->{hold_group_id}; |
197 |
my $hold_group_id = $params->{hold_group_id}; |
|
|
198 |
my $confirmations = $params->{confirmations}; |
| 199 |
my $forced = $params->{forced}; |
| 196 |
|
200 |
|
| 197 |
$resdate ||= dt_from_string; |
201 |
$resdate ||= dt_from_string; |
| 198 |
|
202 |
|
|
Lines 263-270
sub AddReserve {
Link Here
|
| 263 |
# record patron activity |
267 |
# record patron activity |
| 264 |
$hold->patron->update_lastseen('hold'); |
268 |
$hold->patron->update_lastseen('hold'); |
| 265 |
|
269 |
|
| 266 |
logaction( 'HOLDS', 'CREATE', $hold->id, $hold ) |
270 |
# Log the hold creation |
| 267 |
if C4::Context->preference('HoldsLog'); |
271 |
if ( C4::Context->preference('HoldsLog') ) { |
|
|
272 |
my $info = $hold->id; |
| 273 |
if ( defined($confirmations) || defined($forced) ) { |
| 274 |
$info = to_json( |
| 275 |
{ |
| 276 |
hold => $hold->id, |
| 277 |
branchcode => $hold->branchcode, |
| 278 |
biblionumber => $hold->biblionumber, |
| 279 |
itemnumber => $hold->itemnumber, |
| 280 |
confirmations => $confirmations, |
| 281 |
forced => $forced |
| 282 |
}, |
| 283 |
{ pretty => 1, canonical => 1 } |
| 284 |
); |
| 285 |
} |
| 286 |
logaction( 'HOLDS', 'CREATE', $hold->id, $info ); |
| 287 |
} |
| 268 |
|
288 |
|
| 269 |
my $reserve_id = $hold->id(); |
289 |
my $reserve_id = $hold->id(); |
| 270 |
|
290 |
|