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

(-)a/installer/data/mysql/atomicupdate/bug_14783-add_OpacAllowPickupLocationChange_syspref.perl (-10 lines)
Lines 1-10 Link Here
1
2
3
$DBversion = 'XXX'; # will be replaced by the RM
4
if( CheckVersion( $DBversion ) ) {
5
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACAllowUserToChangeBranch','','Pending, In-Transit, Suspended','Allow users to change the library to pick up a hold for these statuses:','multiple');" );
6
    $dbh->do( "UPDATE systempreferences set value = (SELECT CASE WHEN value = 1 THEN 'intransit' ELSE '' END FROM systempreferences WHERE variable = 'OPACInTransitHoldPickupLocationChange')");
7
    $dbh->do( "DELETE FROM systempreferences WHERE variable = 'OPACInTransitHoldPickupLocationChange' ");
8
    # Always end with this (adjust the bug info)
9
    NewVersion( $DBversion, 14783, "Allow patrons to change pickup location for non-waiting holds");
10
}
(-)a/installer/data/mysql/atomicupdate/bug_14783.pl (-1 / +30 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "14783",
5
    description => "Allow patrons to change pickup location for non-waiting holds",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
12
            VALUES ('OPACAllowUserToChangeBranch','','Pending, In-Transit, Suspended','Allow users to change the library to pick up a hold for these statuses:','multiple');
13
        });
14
15
        $dbh->do(q{
16
            UPDATE systempreferences SET value = (SELECT CASE WHEN value = 1 THEN 'intransit' ELSE '' END
17
            FROM systempreferences
18
            WHERE variable = 'OPACInTransitHoldPickupLocationChange')
19
        });
20
21
        say $out "Added new system preference 'OPACAllowUserToChangeBranch'";
22
23
        $dbh->do(q{
24
            DELETE FROM systempreferences
25
            WHERE variable = 'OPACInTransitHoldPickupLocationChange'
26
        });
27
28
        say $out "Removed system preference 'OPACInTransitHoldPickupLocationChange'";
29
    },
30
};

Return to bug 14783