|
Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
| 2 |
use Koha::Installer::Output qw(say_warning say_success say_info); |
| 3 |
|
| 4 |
return { |
| 5 |
bug_number => "26355", |
| 6 |
description => "Patron self-renewal", |
| 7 |
up => sub { |
| 8 |
my ($args) = @_; |
| 9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
| 10 |
|
| 11 |
unless ( column_exists( 'categories', 'self_renewal_enabled' ) ) { |
| 12 |
$dbh->do( |
| 13 |
q{ |
| 14 |
ALTER TABLE categories ADD COLUMN `self_renewal_enabled` tinyint(1) NOT NULL DEFAULT 0 |
| 15 |
COMMENT 'allow self renewal for this category' |
| 16 |
AFTER `enforce_expiry_notice` |
| 17 |
} |
| 18 |
); |
| 19 |
|
| 20 |
say_success( $out, "Added column 'self_renewal_enabled' to categories" ); |
| 21 |
} |
| 22 |
unless ( column_exists( 'categories', 'self_renewal_availability_start' ) ) { |
| 23 |
$dbh->do( |
| 24 |
q{ |
| 25 |
ALTER TABLE categories ADD COLUMN `self_renewal_availability_start` smallint(6) DEFAULT NULL |
| 26 |
COMMENT 'how long before the patron expiry date self-renewal should be made available (overrides system default of NotifyBorrowerDeparture)' |
| 27 |
AFTER `self_renewal_enabled` |
| 28 |
} |
| 29 |
); |
| 30 |
|
| 31 |
say_success( $out, "Added column 'self_renewal_availability_start' to categories" ); |
| 32 |
} |
| 33 |
unless ( column_exists( 'categories', 'self_renewal_fines_block' ) ) { |
| 34 |
$dbh->do( |
| 35 |
q{ |
| 36 |
ALTER TABLE categories ADD COLUMN `self_renewal_fines_block` int(11) DEFAULT NULL |
| 37 |
COMMENT 'the amount owed in fines before self renewal is blocked (overrides system default of noissuescharge)' |
| 38 |
AFTER `self_renewal_availability_start` |
| 39 |
} |
| 40 |
); |
| 41 |
|
| 42 |
say_success( $out, "Added column 'self_renewal_fines_block' to categories" ); |
| 43 |
} |
| 44 |
unless ( column_exists( 'categories', 'self_renewal_if_expired' ) ) { |
| 45 |
$dbh->do( |
| 46 |
q{ |
| 47 |
ALTER TABLE categories ADD COLUMN `self_renewal_if_expired` smallint(6) DEFAULT 0 |
| 48 |
COMMENT 'how long after expiry a patron can self renew their account' |
| 49 |
AFTER `self_renewal_fines_block` |
| 50 |
} |
| 51 |
); |
| 52 |
|
| 53 |
say_success( $out, "Added column 'self_renewal_if_expired' to categories" ); |
| 54 |
} |
| 55 |
unless ( column_exists( 'categories', 'self_renewal_failure_message' ) ) { |
| 56 |
$dbh->do( |
| 57 |
q{ |
| 58 |
ALTER TABLE categories ADD COLUMN `self_renewal_failure_message` mediumtext DEFAULT NULL |
| 59 |
COMMENT 'the message to display if self renewal is not successful' |
| 60 |
AFTER `self_renewal_fines_block` |
| 61 |
} |
| 62 |
); |
| 63 |
|
| 64 |
say_success( $out, "Added column 'self_renewal_failure_message' to categories" ); |
| 65 |
} |
| 66 |
unless ( column_exists( 'categories', 'self_renewal_information_message' ) ) { |
| 67 |
$dbh->do( |
| 68 |
q{ |
| 69 |
ALTER TABLE categories ADD COLUMN `self_renewal_information_message` mediumtext DEFAULT NULL |
| 70 |
COMMENT 'the message to display if self renewal is not successful' |
| 71 |
AFTER `self_renewal_failure_message` |
| 72 |
} |
| 73 |
); |
| 74 |
|
| 75 |
say_success( $out, "Added column 'self_renewal_information_message' to categories" ); |
| 76 |
} |
| 77 |
}, |
| 78 |
}; |