@@ -, +, @@ --- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -3987,6 +3987,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.03.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + + my ($opac_sug_count); + eval { $opac_sug_count = $dbh->do("SELECT 1 FROM authorised_values WHERE category='OPAC_SUG'"); }; + if ($opac_sug_count == 0) { + $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','The copy on the shelf is damaged','The copy on the shelf is damaged')"); + $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Upcoming title by popular author','Upcoming title by popular author')"); + } + + print "Upgrade to $DBversion done: Adding some default authorized values in the OPAC_SUG category for patrons to select when submitting a suggestion (Bug 1883)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --