Bug 5795 Update the database as follow-up If sys pref

ReservesControlBranch has null then update the table to
insert a PatronLibrary as value

To Test:
1) Go to mysql use koha database
2) select * from systempreferences where variable = 'ReservesControlBranch'; Check if value set to ItemHomeLibrary.
+-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+
| variable              | value           | options                       | explanation                                     | type   |
+-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+
| ReservesControlBranch | PatronLibrary   | ItemHomeLibrary|PatronLibrary | Branch checked for members reservations rights. | Choice |
+-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Conflicts:

	installer/data/mysql/updatedatabase.pl

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Fixed for 3.8.x

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Amit Gupta 2012-05-22 16:02:31 +05:30 committed by Jared Camins-Esakov
parent f15d6c9c9f
commit 5722f72e8f
1 changed files with 9 additions and 0 deletions

View File

@ -4682,6 +4682,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
$DBversion = "3.06.05.001";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
unless(C4::Context->preference('ReservesControlBranch')){
$dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights.','Choice')");
}
print "Upgrade to $DBversion done (Insert ReservesControlBranch systempreference into systempreferences table )\n";
SetVersion($DBversion);
}
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)