Lines 21-27
use Modern::Perl;
Link Here
|
21 |
|
21 |
|
22 |
use constant PULL_INTERVAL => 2; |
22 |
use constant PULL_INTERVAL => 2; |
23 |
use List::MoreUtils qw( uniq ); |
23 |
use List::MoreUtils qw( uniq ); |
24 |
use YAML::XS; |
|
|
25 |
use Encode; |
24 |
use Encode; |
26 |
|
25 |
|
27 |
use C4::Context; |
26 |
use C4::Context; |
Lines 106-127
if ( $op eq 'cancel_reserve' and $reserve_id ) {
Link Here
|
106 |
C4::Items::ModItemTransfer( $item->itemnumber, $item->holdingbranch, $item->homebranch, 'LostReserve' ); |
105 |
C4::Items::ModItemTransfer( $item->itemnumber, $item->holdingbranch, $item->homebranch, 'LostReserve' ); |
107 |
} |
106 |
} |
108 |
|
107 |
|
109 |
if ( my $yaml = C4::Context->preference('UpdateItemWhenLostFromHoldList') ) { |
108 |
my $assignments = C4::Context->yaml_preference('UpdateItemWhenLostFromHoldList'); |
110 |
$yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
109 |
if ( $assignments ) { |
111 |
my $assignments; |
110 |
eval { |
112 |
eval { $assignments = YAML::XS::Load(Encode::encode_utf8($yaml)); }; |
111 |
while ( my ( $f, $v ) = each( %$assignments ) ) { |
113 |
if ($@) { |
112 |
$item->$f($v); |
114 |
warn "Unable to parse UpdateItemWhenLostFromHoldList syspref : $@" if $@; |
113 |
} |
115 |
} |
114 |
$item->store; |
116 |
else { |
115 |
}; |
117 |
eval { |
116 |
warn "Unable to modify item itemnumber=" . $item->itemnumber . ": $@" if $@; |
118 |
while ( my ( $f, $v ) = each( %$assignments ) ) { |
|
|
119 |
$item->$f($v); |
120 |
} |
121 |
$item->store; |
122 |
}; |
123 |
warn "Unable to modify item itemnumber=" . $item->itemnumber . ": $@" if $@; |
124 |
} |
125 |
} |
117 |
} |
126 |
|
118 |
|
127 |
} elsif ( not $item ) { |
119 |
} elsif ( not $item ) { |
128 |
- |
|
|