Lines 16480-16513
if( CheckVersion( $DBversion ) ) {
Link Here
|
16480 |
print "Upgrade to $DBversion done (Bug 21403 - Add Indian Amazon Affiliate option to AmazonLocale setting)\n"; |
16480 |
print "Upgrade to $DBversion done (Bug 21403 - Add Indian Amazon Affiliate option to AmazonLocale setting)\n"; |
16481 |
} |
16481 |
} |
16482 |
|
16482 |
|
16483 |
$DBversion = "18.06.00.XXX"; |
|
|
16484 |
if ( CheckVersion($DBversion) ) { |
16485 |
my $maxpickupdelay = C4::Context->preference('ReservesMaxPickUpDelay') || 0; #MaxPickupDelay |
16486 |
$dbh->do(q{ DELETE FROM systempreferences WHERE variable='ReservesMaxPickUpDelay'; }); |
16487 |
$dbh->do(q{ DELETE FROM systempreferences WHERE variable='ExpireReservesOnHolidays'; }); |
16488 |
# //DELETE FROM systempreferences WHERE variable='ExpireReservesMaxPickUpDelay'; #This syspref is not needed and would be better suited to be calculated from the holdspickupwait |
16489 |
# //ExpireReservesMaxPickUpDelayCharge #This could be added as a column to the issuing rules. |
16490 |
$dbh->do(q{ ALTER TABLE issuingrules ADD COLUMN holdspickupwait INT(11) NULL default NULL AFTER reservesallowed; }); |
16491 |
$dbh->do(q{ ALTER TABLE reserves ADD COLUMN lastpickupdate DATE NULL default NULL AFTER suspend_until; }); |
16492 |
$dbh->do(q{ ALTER TABLE old_reserves ADD COLUMN lastpickupdate DATE NULL default NULL AFTER suspend_until; }); |
16493 |
my $sth = $dbh->prepare(q{ |
16494 |
UPDATE issuingrules SET holdspickupwait = ? |
16495 |
}); |
16496 |
$sth->execute( $maxpickupdelay ) if $maxpickupdelay; #Don't want to accidentally nullify all! |
16497 |
|
16498 |
##Populate the lastpickupdate-column from existing 'ReservesMaxPickUpDelay' |
16499 |
print "Populating the new lastpickupdate-column for all waiting holds. This might take a while.\n"; |
16500 |
$sth = $dbh->prepare(q{ SELECT * FROM reserves WHERE found = 'W'; }); |
16501 |
$sth->execute( ); |
16502 |
my $dtdur = DateTime::Duration->new( days => 0 ); |
16503 |
|
16504 |
while ( my $res = $sth->fetchrow_hashref ) { |
16505 |
C4::Reserves::MoveWaitingdate( $res, $dtdur ); #We call MoveWaitingdate with a 0 duration to simply recalculate the lastpickupdate and store the new values to DB. |
16506 |
} |
16507 |
print "Upgrade to $DBversion done (8367: Add colum issuingrules.holdspickupwait and reserves.lastpickupdate. Populates introduced columns from the expiring ReservesMaxPickUpDelay. Deletes the ReservesMaxPickUpDelay and ExpireReservesOnHolidays -sysprefs)\n"; |
16508 |
SetVersion($DBversion); |
16509 |
} |
16510 |
|
16511 |
# SEE bug 13068 |
16483 |
# SEE bug 13068 |
16512 |
# if there is anything in the atomicupdate, read and execute it. |
16484 |
# if there is anything in the atomicupdate, read and execute it. |
16513 |
|
16485 |
|
16514 |
- |
|
|