[Koha-cvs] CVS: koha/updater updatedatabase,1.49,1.50

Steve Tonnesen tonnesen at users.sourceforge.net
Wed Jun 11 23:28:25 CEST 2003


Update of /cvsroot/koha/koha/updater
In directory sc8-pr-cvs1:/tmp/cvs-serv26437

Modified Files:
	updatedatabase 
Log Message:
Added modifications required to the systempreferences table by the new
systempreferences.pl script.  The systempreferences.pl script will not work
properly until this table is updated.


Index: updatedatabase
===================================================================
RCS file: /cvsroot/koha/koha/updater/updatedatabase,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** updatedatabase	26 May 2003 10:41:53 -0000	1.49
--- updatedatabase	11 Jun 2003 21:28:22 -0000	1.50
***************
*** 25,29 ****
  # on /etc/koha.conf anyway.
  
! my $debug = 0;
  
  my (
--- 25,29 ----
  # on /etc/koha.conf anyway.
  
! my $debug = 1;
  
  my (
***************
*** 241,245 ****
      #added so that reference items are not available for reserves...
      itemtypes         => { 'notforloan'  => 'smallint(6)' },
!     systempreferences => { 'explanation' => 'char(80)' },
      z3950servers      => { 'syntax'      => 'char(80)' },
  );
--- 241,247 ----
      #added so that reference items are not available for reserves...
      itemtypes         => { 'notforloan'  => 'smallint(6)' },
!     systempreferences => { 'explanation' => 'char(80)',
!     		 	   'type' => 'char(20)',
! 			   'options' => 'text' },
      z3950servers      => { 'syntax'      => 'char(80)' },
  );
***************
*** 260,264 ****
  # must not exist in the table for this row to be inserted.  If the
  # uniquefieldrequired entry is already in the table, the existing data is not
! # modified.
  
  my %tabledata = (
--- 262,268 ----
  # must not exist in the table for this row to be inserted.  If the
  # uniquefieldrequired entry is already in the table, the existing data is not
! # modified, unless the forceupdate hash entry is also set.  Fields in the
! # anonymous "forceupdate" hash will be forced to be updated to the default
! # values given in the %tabledata hash.
  
  my %tabledata = (
***************
*** 345,462 ****
          {
              uniquefieldrequired => 'variable',
              variable            => 'autoMemberNum',
              value               => '1',
!             explanation         => '1 or 0. If 1, Member number is auto-calculated'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'acquisitions',
              value               => 'simple',
              explanation         =>
! 'normal or simple : whether to use "acqui" or "acqui.simple" acquisition system'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'dateformat',
              value               => 'metric',
!             explanation         => 'metric, us, or iso'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'template',
              value               => 'default',
!             explanation         => 'template default name'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'autoBarcode',
!             value               => '1',
!             explanation         => '1 or 0. If 1, Barcode is auto-calculated'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'insecure',
!             value               => 'NO',
              explanation         =>
! 'if YES, no auth at all is needed. Be careful if you set this to yes !'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'authoritysep',
              value               => '--',
              explanation         =>
!             'the separator used in authority/thesaurus. Usually --'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'opaclanguages',
              value               => 'en',
!             explanation         => 'languages'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'opacthemes',
              value               => 'default',
!             explanation         => 'theme'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'timeout',
!             value               => '12000000',
!             explanation         => 'login timeout'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'marc',
!             value               => 'ON',
!             explanation         => 'MARC support (ON or OFF)'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'marcflavour',
              value               => 'MARC21',
              explanation         =>
!             'your MARC flavor (MARC21 or UNIMARC) used for character encoding'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'checkdigit',
!             value               => 'katipo',
!             explanation         =>
!             'none= no check on member cardnumber. katipo= katipo check'
!         },
!         {
!             uniquefieldrequired => 'variable',
!             variable            => 'dateformat',
!             value               => 'ISO',
!             explanation         =>
!             'date format (US mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd) '
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'maxoutstanding',
              value               => '5',
              explanation         =>
!             'maximum amount withstanding to be able make reserves '
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'maxreserves',
              value               => '5',
              explanation         =>
!             'maximum number of reserves a member can make '
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'noissuescharge',
              value               => '5',
              explanation         =>
!             'maximum amount withstanding to be able to check out an item '
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'KohaAdminEmailAddress',
              value               => 'your.mail at here',
!             explanation => 'the email adress where borrowers modifs are sent'
          },
      ],
--- 349,523 ----
          {
              uniquefieldrequired => 'variable',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              variable            => 'autoMemberNum',
              value               => '1',
!             explanation         => 'Member number is auto-calculated',
! 	    type		=> 'YesNo'
! 
          },
          {
              uniquefieldrequired => 'variable',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1,
+ 				     'options' => 1 },
              variable            => 'acquisitions',
              value               => 'simple',
              explanation         =>
! 'Normal, budget-based acquisitions, or Simple bibliographic-data acquisitions',
! 	    type		=> 'Choice',
! 	    options 		=> 'simple|normal'
          },
          {
              uniquefieldrequired => 'variable',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1,
+ 				     'options' => 1 },
              variable            => 'dateformat',
              value               => 'metric',
!             explanation         =>
!             'date format (US mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd)',
! 	    type		=> 'Choice',
! 	    options 		=> 'metric|us|iso'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'template',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => 'default',
!             explanation         => 'Preference order for intranet interface templates',
! 	    type		=> 'Themes'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'autoBarcode',
! 	    forceupdate		=> { 'explanation' => 1,
! 	    			     'type' => 1 },
!             value               => 'yes',
!             explanation         => 'Barcode is auto-calculated',
! 	    type		=> 'YesNo'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'insecure',
! 	    forceupdate		=> { 'explanation' => 1,
! 	    			     'type' => 1 },
!             value               => 'no',
              explanation         =>
! 'If YES, no auth at all is needed. Be careful if you set this to yes!',
! 	    type		=> 'YesNo'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'authoritysep',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1,
+ 				     'options' => 1 },
              value               => '--',
              explanation         =>
!             'the separator used in authority/thesaurus. Usually --',
! 	    type		=> 'free',
! 	    options		=> '10'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'opaclanguages',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => 'en',
!             explanation         => 'Set the preferred order for translations.  The top language will be tried first.',
! 	    type		=> 'Languages'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'opacthemes',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => 'default',
!             explanation         => 'Set the preferred order for themes.  The top theme will be tried first.',
! 	    type		=> 'Themes'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'timeout',
! 	    forceupdate		=> { 'explanation' => 1,
! 	    			     'type' => 1 },
!             value               => '1200',
!             explanation         => 'Inactivity timeout for cookies authentication (in seconds)',
! 	    type		=> 'Integer'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'marc',
! 	    forceupdate		=> { 'explanation' => 1,
! 	    			     'type' => 1 },
!             value               => 'yes',
!             explanation         => 'Turn on MARC support',
! 	    type		=> 'YesNo'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'marcflavour',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1,
+ 				     'options' => 1},
              value               => 'MARC21',
              explanation         =>
!             'your MARC flavor (MARC21 or UNIMARC) used for character encoding',
! 	    type		=> 'Choice',
! 	    options		=> 'MARC21|UNIMARC'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'checkdigit',
!             value               => 'none',
! 	    forceupdate		=> { 'explanation' => 1,
! 	    			     'type' => 1,
! 				     'options' => 1},
!             explanation         => 'Validity checks on membership number: none or "Katipo" style checks',
! 	    type		=> 'Choice',
! 	    options		=> 'none|katipo'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'maxoutstanding',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => '5',
              explanation         =>
!             'maximum amount withstanding to be able make reserves ',
! 	    type		=> 'Integer'
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'maxreserves',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => '5',
              explanation         =>
!             'maximum number of reserves a member can make',
! 	    type		=> 'Integer'
! 
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'noissuescharge',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => '5',
              explanation         =>
!             'maximum amount withstanding to be able to check out an item',
! 	    type		=> 'Integer'
! 
          },
          {
              uniquefieldrequired => 'variable',
              variable            => 'KohaAdminEmailAddress',
+ 	    forceupdate		=> { 'explanation' => 1,
+ 	    			     'type' => 1 },
              value               => 'your.mail at here',
!             explanation => 'the email adress where borrowers modifs are sent',
! 	    type		=> 'free'
          },
      ],
***************
*** 580,584 ****
      }    # while
      foreach $column ( keys %{ $requirefields{$table} } ) {
!         print "  Check column $column\n" if $debug;
          if ( !$types{$column} ) {
  
--- 641,645 ----
      }    # while
      foreach $column ( keys %{ $requirefields{$table} } ) {
!         print "  Check column $column  [$types{$column}]\n" if $debug;
          if ( !$types{$column} ) {
  
***************
*** 744,747 ****
--- 805,809 ----
          my $uniquefieldrequired = $row->{uniquefieldrequired};
          my $uniquevalue         = $row->{$uniquefieldrequired};
+         my $forceupdate         = $row->{forceupdate};
          my $sth                 =
            $dbh->prepare(
***************
*** 749,753 ****
          );
          $sth->execute($uniquevalue);
!         unless ( $sth->rows ) {
              print "Adding row to $table: ";
              my @values;
--- 811,822 ----
          );
          $sth->execute($uniquevalue);
! 	if ($sth->rows) {
! 	    foreach my $field (keys %$forceupdate) {
! 		if ($forceupdate->{$field}) {
! 		    my $sth=$dbh->prepare("update systempreferences set $field=? where $uniquefieldrequired=?");
! 		    $sth->execute($row->{$field}, $uniquevalue);
! 		}
! 	    }
! 	} else {
              print "Adding row to $table: ";
              my @values;
***************
*** 755,759 ****
              my $placeholders;
              foreach my $field ( keys %$row ) {
!                 (next) if ( $field eq 'uniquefieldrequired' );
                  my $value = $row->{$field};
                  push @values, $value;
--- 824,829 ----
              my $placeholders;
              foreach my $field ( keys %$row ) {
!                 next if $field eq 'uniquefieldrequired';
! 		next if $field eq 'forceupdate';
                  my $value = $row->{$field};
                  push @values, $value;
***************
*** 778,781 ****
--- 848,856 ----
  
  # $Log$
+ # Revision 1.50  2003/06/11 21:28:22  tonnesen
+ # Added modifications required to the systempreferences table by the new
+ # systempreferences.pl script.  The systempreferences.pl script will not work
+ # properly until this table is updated.
+ #
  # Revision 1.49  2003/05/26 10:41:53  tipaul
  # bugfix : borrowers modifs overwritten by stupid hash entry existing twice.





More information about the Koha-cvs mailing list