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

(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 904-909 CREATE TABLE `deleteditems` ( Link Here
904
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
904
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
905
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
905
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
906
  `itemnotes` mediumtext, -- public notes on this item (MARC21 952$x)
906
  `itemnotes` mediumtext, -- public notes on this item (MARC21 952$x)
907
  `itemnotes_nonpublic` mediumtext default NULL,
907
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)
908
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)
908
  `paidfor` mediumtext,
909
  `paidfor` mediumtext,
909
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered
910
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered
Lines 1202-1207 CREATE TABLE `items` ( -- holdings/item information Link Here
1202
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
1203
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
1203
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
1204
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
1204
  `itemnotes` mediumtext, -- public notes on this item (MARC21 952$x)
1205
  `itemnotes` mediumtext, -- public notes on this item (MARC21 952$x)
1206
  `itemnotes_nonpublic` mediumtext default NULL,
1205
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)
1207
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)
1206
  `paidfor` mediumtext,
1208
  `paidfor` mediumtext,
1207
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered
1209
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered
(-)a/installer/data/mysql/updatedatabase.pl (-34 / +41 lines)
Lines 2741-2747 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
2741
$DBversion = '3.01.00.066';
2741
$DBversion = '3.01.00.066';
2742
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
2742
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
2743
    $dbh->do('ALTER TABLE issuingrules ADD COLUMN `reservesallowed` smallint(6) NOT NULL default "0" AFTER `renewalsallowed`;');
2743
    $dbh->do('ALTER TABLE issuingrules ADD COLUMN `reservesallowed` smallint(6) NOT NULL default "0" AFTER `renewalsallowed`;');
2744
    
2744
2745
    my $maxreserves = C4::Context->preference('maxreserves');
2745
    my $maxreserves = C4::Context->preference('maxreserves');
2746
    $sth = $dbh->prepare('UPDATE issuingrules SET reservesallowed = ?;');
2746
    $sth = $dbh->prepare('UPDATE issuingrules SET reservesallowed = ?;');
2747
    $sth->execute($maxreserves);
2747
    $sth->execute($maxreserves);
Lines 2948-2954 $$maxbudgetid[0] = 0 if !$$maxbudgetid[0]; Link Here
2948
    $dbh->do(<<BUDGETAUTOINCREMENT);
2948
    $dbh->do(<<BUDGETAUTOINCREMENT);
2949
ALTER TABLE aqbudget AUTO_INCREMENT=$$maxbudgetid[0]
2949
ALTER TABLE aqbudget AUTO_INCREMENT=$$maxbudgetid[0]
2950
BUDGETAUTOINCREMENT
2950
BUDGETAUTOINCREMENT
2951
    
2951
2952
    $dbh->do(<<BUDGETNAME);
2952
    $dbh->do(<<BUDGETNAME);
2953
ALTER TABLE aqbudget RENAME `aqbudgets`
2953
ALTER TABLE aqbudget RENAME `aqbudgets`
2954
BUDGETNAME
2954
BUDGETNAME
Lines 3326-3335 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3326
$DBversion = "3.01.00.101";
3326
$DBversion = "3.01.00.101";
3327
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3327
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3328
	$dbh->do(
3328
	$dbh->do(
3329
        "INSERT INTO systempreferences 
3329
        "INSERT INTO systempreferences
3330
           (variable, value, options, explanation, type)
3330
           (variable, value, options, explanation, type)
3331
         VALUES (
3331
         VALUES (
3332
            'OverdueNoticeBcc', '', '', 
3332
            'OverdueNoticeBcc', '', '',
3333
            'Email address to Bcc outgoing notices sent by email',
3333
            'Email address to Bcc outgoing notices sent by email',
3334
            'free')
3334
            'free')
3335
         ");
3335
         ");
Lines 3364-3370 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3364
    if ($borrnotes_count == 0) {
3364
    if ($borrnotes_count == 0) {
3365
        $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('BOR_NOTES','ADDR','Address Notes')");
3365
        $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('BOR_NOTES','ADDR','Address Notes')");
3366
    }
3366
    }
3367
    
3367
3368
    $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('LOC','CART','Book Cart')");
3368
    $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('LOC','CART','Book Cart')");
3369
    $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('LOC','PROC','Processing Center')");
3369
    $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('LOC','PROC','Processing Center')");
3370
3370
Lines 3384-3390 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3384
        PRIMARY KEY  (`colId`)
3384
        PRIMARY KEY  (`colId`)
3385
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3385
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3386
    ");
3386
    ");
3387
       
3387
3388
    $dbh->do("
3388
    $dbh->do("
3389
      CREATE TABLE `collections_tracking` (
3389
      CREATE TABLE `collections_tracking` (
3390
        `ctId` int(11) NOT NULL auto_increment,
3390
        `ctId` int(11) NOT NULL auto_increment,
Lines 3394-3400 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3394
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3394
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3395
    ");
3395
    ");
3396
    $dbh->do("
3396
    $dbh->do("
3397
        INSERT INTO permissions (module_bit, code, description) 
3397
        INSERT INTO permissions (module_bit, code, description)
3398
        VALUES ( 13, 'rotating_collections', 'Manage Rotating collections')" );
3398
        VALUES ( 13, 'rotating_collections', 'Manage Rotating collections')" );
3399
	print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotating collections functionality)\n";
3399
	print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotating collections functionality)\n";
3400
    SetVersion ($DBversion);
3400
    SetVersion ($DBversion);
Lines 3419-3425 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3419
	$dbh->do(qq{
3419
	$dbh->do(qq{
3420
	ALTER TABLE `export_format` ADD `csv_separator` VARCHAR( 2 ) NOT NULL AFTER `marcfields` ,
3420
	ALTER TABLE `export_format` ADD `csv_separator` VARCHAR( 2 ) NOT NULL AFTER `marcfields` ,
3421
	ADD `field_separator` VARCHAR( 2 ) NOT NULL AFTER `csv_separator` ,
3421
	ADD `field_separator` VARCHAR( 2 ) NOT NULL AFTER `csv_separator` ,
3422
	ADD `subfield_separator` VARCHAR( 2 ) NOT NULL AFTER `field_separator` 
3422
    ADD `subfield_separator` VARCHAR( 2 ) NOT NULL AFTER `field_separator`
3423
	});
3423
	});
3424
	print "Upgrade to $DBversion done (added separators for csv export)\n";
3424
	print "Upgrade to $DBversion done (added separators for csv export)\n";
3425
    SetVersion ($DBversion);
3425
    SetVersion ($DBversion);
Lines 3592-3598 $DBversion = "3.01.00.126"; Link Here
3592
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3592
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3593
	$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ILS-DI','0','Enable ILS-DI services. See http://your.opac.name/cgi-bin/koha/ilsdi.pl for online documentation.','','YesNo')");
3593
	$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ILS-DI','0','Enable ILS-DI services. See http://your.opac.name/cgi-bin/koha/ilsdi.pl for online documentation.','','YesNo')");
3594
	$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ILS-DI:AuthorizedIPs','127.0.0.1','A comma separated list of IP addresses authorized to access the web services.','','free')");
3594
	$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ILS-DI:AuthorizedIPs','127.0.0.1','A comma separated list of IP addresses authorized to access the web services.','','free')");
3595
	
3595
3596
    print "Upgrade to $DBversion done (Adding ILS-DI updates and ILS-DI:AuthorizedIPs)\n";
3596
    print "Upgrade to $DBversion done (Adding ILS-DI updates and ILS-DI:AuthorizedIPs)\n";
3597
    SetVersion ($DBversion);
3597
    SetVersion ($DBversion);
3598
}
3598
}
Lines 3819-3839 if (C4::Context->preference("Version") < TransformToNum($DBversion) && $original Link Here
3819
    $dbh->do("ALTER TABLE subscriptionroutinglist MODIFY COLUMN `borrowernumber` int(11) NOT NULL;");
3819
    $dbh->do("ALTER TABLE subscriptionroutinglist MODIFY COLUMN `borrowernumber` int(11) NOT NULL;");
3820
    $dbh->do("DELETE FROM subscriptionroutinglist WHERE subscriptionid IS NULL;");
3820
    $dbh->do("DELETE FROM subscriptionroutinglist WHERE subscriptionid IS NULL;");
3821
    $dbh->do("ALTER TABLE subscriptionroutinglist MODIFY COLUMN `subscriptionid` int(11) NOT NULL;");
3821
    $dbh->do("ALTER TABLE subscriptionroutinglist MODIFY COLUMN `subscriptionid` int(11) NOT NULL;");
3822
    $dbh->do("CREATE TEMPORARY TABLE del_subscriptionroutinglist 
3822
    $dbh->do("CREATE TEMPORARY TABLE del_subscriptionroutinglist
3823
              SELECT s1.routingid FROM subscriptionroutinglist s1
3823
              SELECT s1.routingid FROM subscriptionroutinglist s1
3824
              WHERE EXISTS (SELECT * FROM subscriptionroutinglist s2
3824
              WHERE EXISTS (SELECT * FROM subscriptionroutinglist s2
3825
                            WHERE s2.borrowernumber = s1.borrowernumber
3825
                            WHERE s2.borrowernumber = s1.borrowernumber
3826
                            AND   s2.subscriptionid = s1.subscriptionid 
3826
                            AND   s2.subscriptionid = s1.subscriptionid
3827
                            AND   s2.routingid < s1.routingid);");
3827
                            AND   s2.routingid < s1.routingid);");
3828
    $dbh->do("DELETE FROM subscriptionroutinglist
3828
    $dbh->do("DELETE FROM subscriptionroutinglist
3829
              WHERE routingid IN (SELECT routingid FROM del_subscriptionroutinglist);");
3829
              WHERE routingid IN (SELECT routingid FROM del_subscriptionroutinglist);");
3830
    $dbh->do("ALTER TABLE subscriptionroutinglist ADD UNIQUE (subscriptionid, borrowernumber);");
3830
    $dbh->do("ALTER TABLE subscriptionroutinglist ADD UNIQUE (subscriptionid, borrowernumber);");
3831
    $dbh->do("ALTER TABLE subscriptionroutinglist 
3831
    $dbh->do("ALTER TABLE subscriptionroutinglist
3832
                ADD CONSTRAINT `subscriptionroutinglist_ibfk_1` FOREIGN KEY (`borrowernumber`) 
3832
                ADD CONSTRAINT `subscriptionroutinglist_ibfk_1` FOREIGN KEY (`borrowernumber`)
3833
                REFERENCES `borrowers` (`borrowernumber`)
3833
                REFERENCES `borrowers` (`borrowernumber`)
3834
                ON DELETE CASCADE ON UPDATE CASCADE");
3834
                ON DELETE CASCADE ON UPDATE CASCADE");
3835
    $dbh->do("ALTER TABLE subscriptionroutinglist 
3835
    $dbh->do("ALTER TABLE subscriptionroutinglist
3836
                ADD CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`) 
3836
                ADD CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`)
3837
                REFERENCES `subscription` (`subscriptionid`)
3837
                REFERENCES `subscription` (`subscriptionid`)
3838
                ON DELETE CASCADE ON UPDATE CASCADE");
3838
                ON DELETE CASCADE ON UPDATE CASCADE");
3839
    print "Upgrade to $DBversion done (Make subscriptionroutinglist more strict)\n";
3839
    print "Upgrade to $DBversion done (Make subscriptionroutinglist more strict)\n";
Lines 4102-4108 if (C4::Context->preference("Version") < TransformToNum($DBversion) && $original Link Here
4102
    SetVersion ($DBversion);
4102
    SetVersion ($DBversion);
4103
}
4103
}
4104
4104
4105
$DBversion = '3.03.00.027'; 
4105
$DBversion = '3.03.00.027';
4106
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4106
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4107
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo')");
4107
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo')");
4108
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer')");
4108
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer')");
Lines 4136-4142 $DBversion = "3.03.00.031"; Link Here
4136
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4136
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4137
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FineNotifyAtCheckin',0,'If ON notify librarians of overdue fines on the items they are checking in.',NULL,'YesNo');");
4137
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FineNotifyAtCheckin',0,'If ON notify librarians of overdue fines on the items they are checking in.',NULL,'YesNo');");
4138
    print "Upgrade to $DBversion done (Add syspref FineNotifyAtCheckin)\n";
4138
    print "Upgrade to $DBversion done (Add syspref FineNotifyAtCheckin)\n";
4139
    SetVersion ($DBversion);    
4139
    SetVersion ($DBversion);
4140
}
4140
}
4141
4141
4142
$DBversion = '3.03.00.032';
4142
$DBversion = '3.03.00.032';
Lines 4205-4211 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4205
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC',NULL,'YesNo');");
4205
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC',NULL,'YesNo');");
4206
    print "Upgrade to $DBversion done (Add syspref ShowReviewer)\n";
4206
    print "Upgrade to $DBversion done (Add syspref ShowReviewer)\n";
4207
}
4207
}
4208
    
4208
4209
$DBversion = "3.03.00.040";
4209
$DBversion = "3.03.00.040";
4210
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4210
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4211
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('UseControlNumber',0,'If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','','YesNo');");
4211
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('UseControlNumber',0,'If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','','YesNo');");
Lines 4325-4331 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4325
    $dbh->do("UPDATE message_attributes SET message_name = 'Advance_Notice' WHERE message_name='Advance Notice'");
4325
    $dbh->do("UPDATE message_attributes SET message_name = 'Advance_Notice' WHERE message_name='Advance Notice'");
4326
    $dbh->do("UPDATE message_attributes SET message_name = 'Hold_Filled' WHERE message_name='Hold Filled'");
4326
    $dbh->do("UPDATE message_attributes SET message_name = 'Hold_Filled' WHERE message_name='Hold Filled'");
4327
    $dbh->do("UPDATE message_attributes SET message_name = 'Item_Check_in' WHERE message_name='Item Check-in'");
4327
    $dbh->do("UPDATE message_attributes SET message_name = 'Item_Check_in' WHERE message_name='Item Check-in'");
4328
    $dbh->do("UPDATE message_attributes SET message_name = 'Item_Checkout' WHERE message_name='Item Checkout'");    
4328
    $dbh->do("UPDATE message_attributes SET message_name = 'Item_Checkout' WHERE message_name='Item Checkout'");
4329
    SetVersion ($DBversion);
4329
    SetVersion ($DBversion);
4330
}
4330
}
4331
4331
Lines 4372-4380 $DBversion = "3.05.00.004"; Link Here
4372
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4372
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4373
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC',NULL,'YesNo');");
4373
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC',NULL,'YesNo');");
4374
    print "Upgrade to $DBversion done (Add syspref ShowReviewerPhoto)\n";
4374
    print "Upgrade to $DBversion done (Add syspref ShowReviewerPhoto)\n";
4375
    SetVersion($DBversion);    
4375
    SetVersion($DBversion);
4376
}
4376
}
4377
    
4377
4378
$DBversion = "3.05.00.005";
4378
$DBversion = "3.05.00.005";
4379
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4379
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4380
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice');");
4380
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice');");
Lines 4382-4388 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4382
    SetVersion($DBversion);
4382
    SetVersion($DBversion);
4383
}
4383
}
4384
4384
4385
$DBversion = "3.05.00.006"; 
4385
$DBversion = "3.05.00.006";
4386
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4386
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4387
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn           | a|a     d', NULL, NULL, 'Textarea')");
4387
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn           | a|a     d', NULL, NULL, 'Textarea')");
4388
    print "Upgrade to $DBversion done (Add syspref MARCAuthorityControlField008)\n";
4388
    print "Upgrade to $DBversion done (Add syspref MARCAuthorityControlField008)\n";
Lines 4451-4457 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4451
    print "Upgrade to $DBversion done (add OPACResultsSidebar syspref (enh 6165))\n";
4451
    print "Upgrade to $DBversion done (add OPACResultsSidebar syspref (enh 6165))\n";
4452
    SetVersion($DBversion);
4452
    SetVersion($DBversion);
4453
}
4453
}
4454
    
4454
4455
$DBversion = "3.05.00.012";
4455
$DBversion = "3.05.00.012";
4456
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4456
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4457
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RecordLocalUseOnReturn',0,'If ON, statistically record returns of unissued items as local use, instead of return',NULL,'YesNo')");
4457
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RecordLocalUseOnReturn',0,'If ON, statistically record returns of unissued items as local use, instead of return',NULL,'YesNo')");
Lines 4532-4542 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4532
$DBversion = "3.05.00.021";
4532
$DBversion = "3.05.00.021";
4533
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4533
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4534
    $dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN display_checkout TINYINT(1) NOT NULL DEFAULT '0';");
4534
    $dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN display_checkout TINYINT(1) NOT NULL DEFAULT '0';");
4535
    print "Upgrade to $DBversion done (Added a display_checkout field in borrower_attribute_types table)\n"; 
4535
    print "Upgrade to $DBversion done (Added a display_checkout field in borrower_attribute_types table)\n";
4536
    SetVersion($DBversion);
4536
    SetVersion($DBversion);
4537
}
4537
}
4538
4538
4539
$DBversion = "3.05.00.022"; 
4539
$DBversion = "3.05.00.022";
4540
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4540
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4541
    $dbh->do("CREATE TABLE need_merge_authorities (id int NOT NULL auto_increment PRIMARY KEY, authid bigint NOT NULL, done tinyint DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=utf8");
4541
    $dbh->do("CREATE TABLE need_merge_authorities (id int NOT NULL auto_increment PRIMARY KEY, authid bigint NOT NULL, done tinyint DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=utf8");
4542
    print "Upgrade to $DBversion done (6094: Fixing ModAuthority problems, add a need_merge_authorities table)\n";
4542
    print "Upgrade to $DBversion done (6094: Fixing ModAuthority problems, add a need_merge_authorities table)\n";
Lines 5349-5372 $DBversion ="3.09.00.014"; Link Here
5349
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5349
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5350
    # add phone message transport type
5350
    # add phone message transport type
5351
    $dbh->do("INSERT INTO message_transport_types (message_transport_type) VALUES ('phone')");
5351
    $dbh->do("INSERT INTO message_transport_types (message_transport_type) VALUES ('phone')");
5352
    
5352
5353
    # adds HOLD_PHONE and PREDUE_PHONE letters (as placeholders)
5353
    # adds HOLD_PHONE and PREDUE_PHONE letters (as placeholders)
5354
    $dbh->do("INSERT INTO letter (module, code, name, title, content) VALUES
5354
    $dbh->do("INSERT INTO letter (module, code, name, title, content) VALUES
5355
              ('reserves', 'HOLD_PHONE', 'Item Available for Pick-up (phone notice)', 'Item Available for Pick-up (phone notice)', 'Your item is available for pickup'),
5355
              ('reserves', 'HOLD_PHONE', 'Item Available for Pick-up (phone notice)', 'Item Available for Pick-up (phone notice)', 'Your item is available for pickup'),
5356
              ('circulation', 'PREDUE_PHONE', 'Advance Notice of Item Due (phone notice)', 'Advance Notice of Item Due (phone notice)', 'Your item is due soon'),
5356
              ('circulation', 'PREDUE_PHONE', 'Advance Notice of Item Due (phone notice)', 'Advance Notice of Item Due (phone notice)', 'Your item is due soon'),
5357
              ('circulation', 'OVERDUE_PHONE', 'Overdue Notice (phone notice)', 'Overdue Notice (phone notice)', 'Your item is overdue')
5357
              ('circulation', 'OVERDUE_PHONE', 'Overdue Notice (phone notice)', 'Overdue Notice (phone notice)', 'Your item is overdue')
5358
              ");
5358
              ");
5359
    
5359
5360
    # add phone notifications to patron message preferences options
5360
    # add phone notifications to patron message preferences options
5361
    $dbh->do("INSERT INTO message_transports
5361
    $dbh->do("INSERT INTO message_transports
5362
             (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES
5362
             (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES
5363
             (4, 'phone', 0, 'reserves', 'HOLD_PHONE'),
5363
             (4, 'phone', 0, 'reserves', 'HOLD_PHONE'),
5364
             (2, 'phone', 0, 'circulation', 'PREDUE_PHONE')
5364
             (2, 'phone', 0, 'circulation', 'PREDUE_PHONE')
5365
             ");
5365
             ");
5366
    
5366
5367
    # add TalkingTechItivaPhoneNotification syspref
5367
    # add TalkingTechItivaPhoneNotification syspref
5368
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('TalkingTechItivaPhoneNotification',0,'If ON, enables Talking Tech I-tiva phone notifications',NULL,'YesNo');");
5368
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('TalkingTechItivaPhoneNotification',0,'If ON, enables Talking Tech I-tiva phone notifications',NULL,'YesNo');");
5369
    
5369
5370
    print "Upgrade done (Support for Talking Tech i-tiva phone notification system)\n";
5370
    print "Upgrade done (Support for Talking Tech i-tiva phone notification system)\n";
5371
    SetVersion($DBversion);
5371
    SetVersion($DBversion);
5372
}
5372
}
Lines 5948-5954 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5948
                ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
5948
                ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
5949
    $dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
5949
    $dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
5950
                (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
5950
                (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
5951
    
5951
5952
    print "Upgrade to $DBversion done (Added support for staging authorities)\n";
5952
    print "Upgrade to $DBversion done (Added support for staging authorities)\n";
5953
    SetVersion ($DBversion);
5953
    SetVersion ($DBversion);
5954
}
5954
}
Lines 7204-7212 if ( CheckVersion($DBversion) ) { Link Here
7204
$DBversion = "3.13.00.029";
7204
$DBversion = "3.13.00.029";
7205
if ( CheckVersion($DBversion) ) {
7205
if ( CheckVersion($DBversion) ) {
7206
    $dbh->do(q{
7206
    $dbh->do(q{
7207
        INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type ) 
7207
        INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type )
7208
        VALUES ( "issues to claim", "efault CSV export for serial issue claims",
7208
        VALUES ( "issues to claim", "efault CSV export for serial issue claims",
7209
                "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate", 
7209
                "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate",
7210
                ",", "sql" )
7210
                ",", "sql" )
7211
    });
7211
    });
7212
    print "Upgrade to $DBversion done (Bug 10854: Add the default CSV profile for claiming issues)\n";
7212
    print "Upgrade to $DBversion done (Bug 10854: Add the default CSV profile for claiming issues)\n";
Lines 7317-7323 if ( CheckVersion($DBversion) ) { Link Here
7317
                SELECT DISTINCT(parent_ordernumber)
7317
                SELECT DISTINCT(parent_ordernumber)
7318
                FROM aqorders
7318
                FROM aqorders
7319
                WHERE ordernumber != parent_ordernumber
7319
                WHERE ordernumber != parent_ordernumber
7320
            ) AS aq 
7320
            ) AS aq
7321
        )
7321
        )
7322
        AND basketno IN (SELECT basketno FROM aqbasket WHERE closedate IS NOT NULL)
7322
        AND basketno IN (SELECT basketno FROM aqbasket WHERE closedate IS NOT NULL)
7323
    });
7323
    });
Lines 8838-8843 if ( CheckVersion($DBversion) ) { Link Here
8838
    SetVersion($DBversion);
8838
    SetVersion($DBversion);
8839
}
8839
}
8840
8840
8841
$DBversion = '3.17.00.XXX';
8842
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
8843
    $dbh->do("ALTER TABLE items ADD COLUMN itemnotes_nonpublic MEDIUMTEXT AFTER itemnotes");
8844
    $dbh->do("ALTER TABLE deleteditems ADD COLUMN itemnotes_nonpublic MEDIUMTEXT AFTER itemnotes");
8845
    print "Upgrade to $DBversion done (Bug 4222 - Nonpublic note not appearing in the staff client) <b>Please check each of your frameworks to ensure your non-public item notes are mapped to items.itemnotes_nonpublic. After doing so please have your administrator run misc/batchRebuildItemsTables.pl </b>)\n";
8846
    SetVersion($DBversion);
8847
}
8848
8841
=head1 FUNCTIONS
8849
=head1 FUNCTIONS
8842
8850
8843
=head2 TableExists($table)
8851
=head2 TableExists($table)
8844
- 

Return to bug 13023