Merge branch 'bug_2832' into 3.12-master
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 23 Nov 2012 16:41:48 +0000 (11:41 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 23 Nov 2012 16:41:48 +0000 (11:41 -0500)
Conflicts:
installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql
installer/data/mysql/updatedatabase.pl

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
1  2 
installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql
installer/data/mysql/updatedatabase.pl

@@@ -25,5 -25,6 +25,6 @@@ UPDATE systempreferences SET value = 'n
  UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'opaclanguages';
  UPDATE systempreferences SET value = '<p>Velkommen til Koha...</p><hr />' WHERE variable = 'OpacMainUserBlock';
  UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' WHERE variable = 'OpacNav';
 -UPDATE systempreferences SET value = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å' WHERE variable = 'alphabet';
 -
  UPDATE systempreferences SET value = '<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a></li><li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a></li><li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a></li>' WHERE variable = 'OPACSearchForTitleIn';
 +UPDATE systempreferences SET value = 'Monday' WHERE variable = 'CalendarFirstDayOfWeek';
++UPDATE systempreferences SET value = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å' WHERE variable = 'alphabet';
@@@ -6020,61 -6021,13 +6021,68 @@@ if (C4::Context->preference("Version") 
     SetVersion ($DBversion);
  }
  
 +$DBversion = "3.09.00.063";
 +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 +    my $gst_booksellers = $dbh->selectcol_arrayref("SELECT DISTINCT(gstrate) FROM aqbooksellers");
 +    my $gist_syspref = C4::Context->preference("gist");
 +    # remove the undef values and construct and array with the syspref and the supplier values
 +    my @gstrates = map { defined $_ ? $_ : () } @$gst_booksellers;
 +    push @gstrates, split ('\|', $gist_syspref);
 +    # we want to compare integer (or float)
 +    $_ = $_ + 0 for @gstrates;
 +    use List::MoreUtils qw/uniq/;
 +    # remove duplicate values
 +    @gstrates = uniq sort @gstrates;
 +    my $new_syspref_value = join '|', @gstrates;
 +    # update the syspref with the new values
 +    my $sth = $dbh->prepare("UPDATE systempreferences set value=? WHERE variable='gist'");
 +    $sth->execute( $new_syspref_value );
 +
 +    print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n";
 +    SetVersion ($DBversion);
 +}
 +
 +$DBversion = "3.09.00.064";
 +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 +   $dbh->do('ALTER TABLE items ADD coded_location_qualifier varchar(10) default NULL AFTER itemcallnumber');
 +   print "Upgrade to $DBversion done (Bug 6428: Added coded_location_qualifier to the items table)\n";
 +   SetVersion ($DBversion);
 +}
 +
 +$DBversion = "3.09.00.065";
 +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 +   $dbh->do('ALTER TABLE deleteditems ADD coded_location_qualifier varchar(10) default NULL AFTER itemcallnumber');
 +   print "Upgrade to $DBversion done (Bug 6428: Added coded_location_qualifier to the deleteditems table)\n";
 +   SetVersion ($DBversion);
 +}
 +
 +$DBversion = "3.09.00.066";
 +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 +   $dbh->do("DELETE FROM systempreferences WHERE variable='DidYouMeanFromAuthorities'");
 +   print "Upgrade to $DBversion done (Bug 9107: remove DidYouMeanFromAuthorities syspref)\n";
 +   SetVersion ($DBversion);
 +}
 +
 +$DBversion = "3.09.00.067";
 +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 +   $dbh->do("ALTER TABLE statistics CHANGE COLUMN ccode ccode varchar(10) NULL");
 +   print "Upgrade to $DBversion done (Bug 9064: statistics.ccode potentially wrongly defined)\n";
 +   SetVersion ($DBversion);
 +}
 +
 +$DBversion = "3.10.00.00";
 +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 +   print "Upgrade to $DBversion done (release tag)\n";
 +   SetVersion ($DBversion);
 +}
 +
+ $DBversion = "3.11.00.001";
+ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+     $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet that can be expanded into browse links, e.g. on Home > Patrons',NULL,'free')");
+     print "Upgrade to $DBversion done (Bug 2832 - Add alphabet syspref)\n";
+     SetVersion($DBversion);
+ }
  =head1 FUNCTIONS
  
  =head2 TableExists($table)