View | Details | Raw Unified | Return to bug 20773
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_20724.perl (-3 / +5 lines)
Lines 1-7 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    my $sql = q|UPDATE reserves SET expirationdate = DATE_ADD( NOW(), INTERVAL ? DAY) WHERE expirationdate IS NULL AND waitingdate IS NOT NULL|;
3
    my $dtf   = Koha::Database->new->schema->storage->datetime_parser;
4
    $dbh->do( $sql, undef, C4::Context->preference('MaxPickupDelay') || 7 );
4
    my $days = C4::Context->preference('MaxPickupDelay') || 7;
5
    my $date = DateTime->now()->add( days => $days );
6
    my $sql = q|UPDATE reserves SET expirationdate = ? WHERE expirationdate IS NULL AND waitingdate IS NOT NULL|;
7
    $dbh->do( $sql, undef, $dtf->format_datetime($date) );
5
8
6
    SetVersion( $DBversion );
9
    SetVersion( $DBversion );
7
    print "Upgrade to $DBversion done (Bug 20724 - expirationdate filled for waiting holds)\n";
10
    print "Upgrade to $DBversion done (Bug 20724 - expirationdate filled for waiting holds)\n";
8
- 

Return to bug 20773