|
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 10762-10775
if ( CheckVersion($DBversion) ) {
Link Here
|
| 10762 |
SetVersion ($DBversion); |
10761 |
SetVersion ($DBversion); |
| 10763 |
} |
10762 |
} |
| 10764 |
|
10763 |
|
| 10765 |
$DBversion = "3.19.00.XXX"; |
10764 |
$DBversion = "3.21.00.XXX"; |
| 10766 |
if ( CheckVersion($DBversion) ) { |
10765 |
if ( CheckVersion($DBversion) ) { |
| 10767 |
foreach my $format (@{ GetSupportList() }) { |
10766 |
my $query = q{ SELECT * FROM itemtypes ORDER BY description }; |
| 10768 |
$dbh->do(q| |
10767 |
my $sth = C4::Context->dbh->prepare($query); |
|
|
10768 |
$sth->execute; |
| 10769 |
$suggestion_formats = $sth->fetchall_arrayref( {} ); |
| 10770 |
|
| 10771 |
foreach my $format (@$suggestion_formats) { |
| 10772 |
$dbh->do( |
| 10773 |
q| |
| 10769 |
INSERT IGNORE INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) |
10774 |
INSERT IGNORE INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) |
| 10770 |
VALUES (?, ?, ?, ?, ?) |
10775 |
VALUES (?, ?, ?, ?, ?) |
| 10771 |
|, {}, |
10776 |
|, {}, |
| 10772 |
'SUGGEST_FORMAT', $format->{itemtype}, $format->{description}, $format->{description}, $format->{imageurl} |
10777 |
'SUGGEST_FORMAT', $format->{itemtype}, $format->{description}, $format->{description}, |
|
|
10778 |
$format->{imageurl} |
| 10773 |
); |
10779 |
); |
| 10774 |
} |
10780 |
} |
| 10775 |
print "Upgrade to $DBversion done (Bug 9468: create new SUGGEST_FORMAT authorised_value list)\n"; |
10781 |
print "Upgrade to $DBversion done (Bug 9468: create new SUGGEST_FORMAT authorised_value list)\n"; |
| 10776 |
- |
|
|