Lines 35-41
use C4::Members::Messaging;
Link Here
|
35 |
use C4::Members qw(); |
35 |
use C4::Members qw(); |
36 |
use C4::Letters; |
36 |
use C4::Letters; |
37 |
use C4::Branch qw( GetBranchDetail ); |
37 |
use C4::Branch qw( GetBranchDetail ); |
38 |
use C4::Dates qw( format_date_in_iso ); |
|
|
39 |
|
38 |
|
40 |
use Koha::DateUtils; |
39 |
use Koha::DateUtils; |
41 |
use Koha::Calendar; |
40 |
use Koha::Calendar; |
Lines 166-176
sub AddReserve {
Link Here
|
166 |
|
165 |
|
167 |
my $dbh = C4::Context->dbh; |
166 |
my $dbh = C4::Context->dbh; |
168 |
|
167 |
|
169 |
$resdate = format_date_in_iso( $resdate ) if ( $resdate ); |
168 |
$resdate = eval { output_pref( { dt => dt_from_string( $resdate ), dateonly => 1 }); } |
170 |
$resdate = C4::Dates->today( 'iso' ) unless ( $resdate ); |
169 |
if ( $resdate ); |
|
|
170 |
$resdate = eval { output_pref( { dt => dt_from_string, dateonly => 1 }); } |
171 |
unless ( $resdate ); |
171 |
|
172 |
|
172 |
if ($expdate) { |
173 |
if ($expdate) { |
173 |
$expdate = format_date_in_iso( $expdate ); |
174 |
$expdate = eval { output_pref( { dt => dt_from_string( $expdate), dateonly => 1, dateformat => 'iso' } ); }; |
174 |
} else { |
175 |
} else { |
175 |
undef $expdate; # make reserves.expirationdate default to null rather than '0000-00-00' |
176 |
undef $expdate; # make reserves.expirationdate default to null rather than '0000-00-00' |
176 |
} |
177 |
} |
Lines 1162-1168
sub ModReserve {
Link Here
|
1162 |
|
1163 |
|
1163 |
if ( defined( $suspend_until ) ) { |
1164 |
if ( defined( $suspend_until ) ) { |
1164 |
if ( $suspend_until ) { |
1165 |
if ( $suspend_until ) { |
1165 |
$suspend_until = C4::Dates->new( $suspend_until )->output("iso"); |
1166 |
$suspend_until = eval { output_pref( { dt => dt_from_string( $suspend_until ), dateonly => 1 }); }; |
1166 |
$dbh->do("UPDATE reserves SET suspend = 1, suspend_until = ? WHERE reserve_id = ?", undef, ( $suspend_until, $reserve_id ) ); |
1167 |
$dbh->do("UPDATE reserves SET suspend = 1, suspend_until = ? WHERE reserve_id = ?", undef, ( $suspend_until, $reserve_id ) ); |
1167 |
} else { |
1168 |
} else { |
1168 |
$dbh->do("UPDATE reserves SET suspend_until = NULL WHERE reserve_id = ?", undef, ( $reserve_id ) ); |
1169 |
$dbh->do("UPDATE reserves SET suspend_until = NULL WHERE reserve_id = ?", undef, ( $reserve_id ) ); |
Lines 1655-1661
sub SuspendAll {
Link Here
|
1655 |
my $suspend_until = $params{'suspend_until'} || undef; |
1656 |
my $suspend_until = $params{'suspend_until'} || undef; |
1656 |
my $suspend = defined( $params{'suspend'} ) ? $params{'suspend'} : 1; |
1657 |
my $suspend = defined( $params{'suspend'} ) ? $params{'suspend'} : 1; |
1657 |
|
1658 |
|
1658 |
$suspend_until = C4::Dates->new( $suspend_until )->output("iso") if ( defined( $suspend_until ) ); |
1659 |
$suspend_until = eval { output_pref( { dt => dt_from_string( $suspend_until), dateonly => 1, dateformat => 'iso' } ); } |
|
|
1660 |
if ( defined( $suspend_until ) ); |
1659 |
|
1661 |
|
1660 |
return unless ( $borrowernumber || $biblionumber ); |
1662 |
return unless ( $borrowernumber || $biblionumber ); |
1661 |
|
1663 |
|
Lines 1976-1982
sub _koha_notify_reserve {
Link Here
|
1976 |
'reserves' => $reserve, |
1978 |
'reserves' => $reserve, |
1977 |
'items', $reserve->{'itemnumber'}, |
1979 |
'items', $reserve->{'itemnumber'}, |
1978 |
}, |
1980 |
}, |
1979 |
substitute => { today => C4::Dates->new()->output() }, |
1981 |
substitute => { today => eval { output_pref( { dt => dt_from_string, dateonly => 1 } ); } }, |
1980 |
); |
1982 |
); |
1981 |
|
1983 |
|
1982 |
my $notification_sent = 0; #Keeping track if a Hold_filled message is sent. If no message can be sent, then default to a print message. |
1984 |
my $notification_sent = 0; #Keeping track if a Hold_filled message is sent. If no message can be sent, then default to a print message. |