X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=installer%2Fdata%2Fmysql%2Fupdatedatabase.pl;h=28962fb00a49b0f1a338ebf3664016d01b1787fd;hb=e7ef292577cc626a6b5066008b841e815ea66c1e;hp=d2db8d110e4f14d9868fd608bc0ef98dae263c3b;hpb=09e9641928b6885995d5faf0d0671541c5f4a43f;p=koha_fer diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d2db8d110e..28962fb00a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7165,7 +7165,6 @@ $DBversion = "3.13.00.024"; if ( CheckVersion($DBversion) ) { $dbh->do(q{ALTER TABLE z3950servers ADD COLUMN recordtype VARCHAR(45) NOT NULL DEFAULT 'biblio' AFTER description;}); print "Upgrade to $DBversion done (Bug 10096 - Add a Z39.50 interface for authority searching)\n"; - SetVersion ($DBversion); } $DBversion = "3.13.00.025"; @@ -7738,7 +7737,7 @@ if(CheckVersion($DBversion)) { $dbh->do(q{ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AcqItemSetSubfieldsWhenReceived','','Set subfields for item when items are created when receiving (e.g. o=5|a="foo bar")','','Free'); }); - print "Upgrade to $DBversion done (Added AcqItemSetSubfieldsWhenReceived syspref)\n"; + print "Upgrade to $DBversion done (Bug 10986: Added AcqItemSetSubfieldsWhenReceived syspref)\n"; SetVersion($DBversion); } @@ -8137,6 +8136,232 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.15.00.032"; +if ( CheckVersion($DBversion) ) { + $dbh->do("ALTER TABLE aqorders CHANGE notes order_internalnote MEDIUMTEXT;"); + $dbh->do("ALTER TABLE aqorders ADD COLUMN order_vendornote MEDIUMTEXT AFTER order_internalnote;"); + print "Upgrade to $DBversion done (Bug 9416 - In each order, add a new note made for the vendor)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.15.00.033"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NoLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea')"); + print "Upgrade to $DBversion done (Bug 10951: Add NoLoginInstructions pref)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.034"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an advanced search option. Example: eng|fra|ita','Textarea')"); + print "Upgrade to $DBversion done (Bug 10986: system preferences to limit languages in advanced search )\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.15.00.035"; +if ( CheckVersion($DBversion) ) { + #insert a notice for sharing a list and accepting a share + $dbh->do(" +INSERT INTO letter (module, code, branchcode, name, is_html, title, content) +VALUES ( 'members', 'SHARE_INVITE', '', 'Invitation for sharing a list', '0', 'Share list <>', 'Dear patron, + +One of our patrons, <> <>, invites you to share a list <> in our library catalog. + +To access this shared list, please click on the following URL or copy-and-paste it into your browser address bar. + +<> + +In case you are not a patron in our library or do not want to accept this invitation, please ignore this mail. Note also that this invitation expires within two weeks. + +Thank you. + +Your library.' + )"); + $dbh->do(" +INSERT INTO letter (module, code, branchcode, name, is_html, title, content) +VALUES ( 'members', 'SHARE_ACCEPT', '', 'Notification about an accepted share', '0', 'Share on list <> accepted', 'Dear patron, + +We want to inform you that <> <> accepted your invitation to share your list <> in our library catalog. + +Thank you. + +Your library.' + )"); + print "Upgrade to $DBversion done (Bug 9032: Share a list)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.036"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) + VALUES('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo') + }); + + print "Upgrade to $DBversion done (Bug 10859 - Add system preference AllowMultipleIssuesOnABiblio)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.037"; +if(CheckVersion($DBversion)) { + $dbh->do(q{ + ALTER TABLE itemtypes ADD sip_media_type VARCHAR( 3 ) DEFAULT NULL AFTER checkinmsgtype + }); + $dbh->do(q{ + INSERT INTO authorised_values (category, authorised_value, lib) VALUES + ('SIP_MEDIA_TYPE', '000', 'Other'), + ('SIP_MEDIA_TYPE', '001', 'Book'), + ('SIP_MEDIA_TYPE', '002', 'Magazine'), + ('SIP_MEDIA_TYPE', '003', 'Bound journal'), + ('SIP_MEDIA_TYPE', '004', 'Audio tape'), + ('SIP_MEDIA_TYPE', '005', 'Video tape'), + ('SIP_MEDIA_TYPE', '006', 'CD/CDROM'), + ('SIP_MEDIA_TYPE', '007', 'Diskette'), + ('SIP_MEDIA_TYPE', '008', 'Book with diskette'), + ('SIP_MEDIA_TYPE', '009', 'Book with CD'), + ('SIP_MEDIA_TYPE', '010', 'Book with audio tape') + }); + print "Upgrade to $DBversion done (Bug 11351 - Add support for SIP2 media type)\n"; + SetVersion($DBversion); +} + +$DBversion = '3.15.00.038'; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT INTO systempreferences ( + variable, + value, + options, + explanation, + type + ) + VALUES ( + 'DisplayLibraryFacets', 'holding', 'home|holding|both', 'Defines which library facets to display.', 'Choice' + ); + }); + print "Upgrade to $DBversion done (Bug 11334 - Add facet for home library)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.15.00.039"; +if ( CheckVersion($DBversion) ) { + + $dbh->do( q{ + ALTER TABLE letter ADD COLUMN message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email' AFTER content + } ); + + $dbh->do( q{ + ALTER TABLE letter ADD CONSTRAINT message_transport_type_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types(message_transport_type); + } ); + + $dbh->do( q{ + ALTER TABLE letter DROP PRIMARY KEY, ADD PRIMARY KEY (`module`,`code`,`branchcode`, message_transport_type); + } ); + + $dbh->do( q{ + CREATE TABLE overduerules_transport_types( + id INT(11) NOT NULL AUTO_INCREMENT, + branchcode varchar(10) NOT NULL DEFAULT '', + categorycode VARCHAR(10) NOT NULL DEFAULT '', + letternumber INT(1) NOT NULL DEFAULT 1, + message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email', + PRIMARY KEY (id), + CONSTRAINT overduerules_fk FOREIGN KEY (branchcode, categorycode) REFERENCES overduerules (branchcode, categorycode) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT mtt_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types (message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + } ); + + my $sth = $dbh->prepare( q{ + SELECT * FROM overduerules; + } ); + + $sth->execute; + my $sth_insert_mtt = $dbh->prepare( q{ + INSERT INTO overduerules_transport_types (branchcode, categorycode, letternumber, message_transport_type) VALUES ( ?, ?, ?, ? ) + } ); + while ( my $row = $sth->fetchrow_hashref ) { + my $branchcode = $row->{branchcode}; + my $categorycode = $row->{categorycode}; + for my $letternumber ( 1 .. 3 ) { + next unless $row->{"letter$letternumber"}; + $sth_insert_mtt->execute( + $branchcode, $categorycode, $letternumber, 'email' + ); + } + } + + print "Upgrade done (Bug 9016: Adds multi transport types management for notices)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.040"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q| + UPDATE message_transports SET letter_code='HOLD' WHERE letter_code='HOLD_PHONE' OR letter_code='HOLD_PRINT' + |); + $dbh->do(q| + UPDATE letter SET code='HOLD', message_transport_type='print' WHERE code='HOLD_PRINT' + |); + $dbh->do(q| + UPDATE letter SET code='HOLD', message_transport_type='phone' WHERE code='HOLD_PHONE' + |); + print "Upgrade to $DBversion done (Bug 10845: Multi transport types for holds)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.041"; +if ( CheckVersion($DBversion) ) { + my $name = $dbh->selectcol_arrayref(q| + SELECT name FROM letter WHERE code="HOLD" + |); + $name = $name->[0]; + $dbh->do(q| + UPDATE letter + SET code="HOLD", + message_transport_type="phone", + name= ? + WHERE code="HOLD_PHONE" + |, {}, $name); + + $dbh->do(q| + UPDATE letter + SET code="PREDUE", + message_transport_type="phone", + name= ? + WHERE code="PREDUE_PHONE" + |, {}, $name); + + $dbh->do(q| + UPDATE letter + SET code="OVERDUE", + message_transport_type="phone", + name= ? + WHERE code="OVERDUE_PHONE" + |, {}, $name); + + print "Upgrade to $DBversion done (Bug 11867: Update letters *_PHONE)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.042"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT INTO systempreferences + (variable,value,explanation,options,type) + VALUES + ('SpecifyReturnDate',0,'Define whether to display \"Specify Return Date\" form in Circulation','','YesNo') + }); + print "Upgrade to $DBversion done (Bug 10694 - Allow arbitrary backdating of returns)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.15.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MarcFieldsToOrder','','Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.', NULL, 'textarea')"); + print "Upgrade to $DBversion done (Bug 7180: Added MarcFieldsToOrder syspref)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table)