View | Details | Raw Unified | Return to bug 4222
Collapse All | Expand All

(-)a/installer/data/mysql/updatedatabase.pl (-2 / +8 lines)
Lines 5340-5346 $DBversion = '3.09.00.XXX'; Link Here
5340
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5340
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5341
    $dbh->do("ALTER TABLE items ADD COLUMN nonpublicnote MEDIUMTEXT AFTER itemnotes");
5341
    $dbh->do("ALTER TABLE items ADD COLUMN nonpublicnote MEDIUMTEXT AFTER itemnotes");
5342
    $dbh->do("ALTER TABLE deleteditems ADD COLUMN nonpublicnote MEDIUMTEXT AFTER itemnotes");
5342
    $dbh->do("ALTER TABLE deleteditems ADD COLUMN nonpublicnote MEDIUMTEXT AFTER itemnotes");
5343
    $dbh->do("UPDATE marc_subfield_structure SET kohafield='items.nonpublicnote' WHERE (kohafield IS NULL OR kohafield = '') AND tagfield='952' AND tagsubfield='x'");
5343
    unless ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) {
5344
        $sth = $dbh->prepare("SELECT COUNT(*) FROM marc_subfield_structure WHERE kohafield='items.nonpublicnote'");
5345
        $sth->execute;
5346
        my ($count) = $sth->fetchrow;
5347
        unless ( $count ) {
5348
            $dbh->do("UPDATE marc_subfield_structure SET kohafield='items.nonpublicnote' WHERE (kohafield IS NULL OR kohafield = '') AND tagfield='952' AND tagsubfield='x'");
5349
        }
5350
    }
5344
    print "Upgrade to $DBversion done (Make nonpublicnote easier to use. <b>If you have mapped your items to a MARC field other than 952 (system default), please check your Koha to MARC mapping for items.nonpublicnote</b>)\n";
5351
    print "Upgrade to $DBversion done (Make nonpublicnote easier to use. <b>If you have mapped your items to a MARC field other than 952 (system default), please check your Koha to MARC mapping for items.nonpublicnote</b>)\n";
5345
}
5352
}
5346
5353
5347
- 

Return to bug 4222