|
Lines 39-45
use C4::Installer;
Link Here
|
| 39 |
use C4::Dates; |
39 |
use C4::Dates; |
| 40 |
use Koha::Database; |
40 |
use Koha::Database; |
| 41 |
use Koha; |
41 |
use Koha; |
| 42 |
use C4::Koha qw/GetSupportList/; |
|
|
| 43 |
|
42 |
|
| 44 |
use MARC::Record; |
43 |
use MARC::Record; |
| 45 |
use MARC::File::XML ( BinaryEncoding => 'utf8' ); |
44 |
use MARC::File::XML ( BinaryEncoding => 'utf8' ); |
|
Lines 11311-11324
if ( CheckVersion($DBversion) ) {
Link Here
|
| 11311 |
SetVersion($DBversion); |
11310 |
SetVersion($DBversion); |
| 11312 |
} |
11311 |
} |
| 11313 |
|
11312 |
|
| 11314 |
$DBversion = "3.19.00.XXX"; |
11313 |
$DBversion = "3.21.00.XXX"; |
| 11315 |
if ( CheckVersion($DBversion) ) { |
11314 |
if ( CheckVersion($DBversion) ) { |
| 11316 |
foreach my $format (@{ GetSupportList() }) { |
11315 |
my $query = q{ SELECT * FROM itemtypes ORDER BY description }; |
| 11317 |
$dbh->do(q| |
11316 |
my $sth = C4::Context->dbh->prepare($query); |
|
|
11317 |
$sth->execute; |
| 11318 |
my $suggestion_formats = $sth->fetchall_arrayref( {} ); |
| 11319 |
|
| 11320 |
foreach my $format (@$suggestion_formats) { |
| 11321 |
$dbh->do( |
| 11322 |
q| |
| 11318 |
INSERT IGNORE INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) |
11323 |
INSERT IGNORE INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) |
| 11319 |
VALUES (?, ?, ?, ?, ?) |
11324 |
VALUES (?, ?, ?, ?, ?) |
| 11320 |
|, {}, |
11325 |
|, {}, |
| 11321 |
'SUGGEST_FORMAT', $format->{itemtype}, $format->{description}, $format->{description}, $format->{imageurl} |
11326 |
'SUGGEST_FORMAT', $format->{itemtype}, $format->{description}, $format->{description}, |
|
|
11327 |
$format->{imageurl} |
| 11322 |
); |
11328 |
); |
| 11323 |
} |
11329 |
} |
| 11324 |
print "Upgrade to $DBversion done (Bug 9468: create new SUGGEST_FORMAT authorised_value list)\n"; |
11330 |
print "Upgrade to $DBversion done (Bug 9468: create new SUGGEST_FORMAT authorised_value list)\n"; |
| 11325 |
- |
|
|