fix for #254
[koha.git] / updater / updatedatabase
1 #!/usr/bin/perl
2
3 # $Id$
4
5 # Database Updater
6 # This script checks for required updates to the database.
7
8 # Part of the Koha Library Software www.koha.org
9 # Licensed under the GPL.
10
11 # Bugs/ToDo:
12 # - Would also be a good idea to offer to do a backup at this time...
13
14 # NOTE:  If you do something more than once in here, make it table driven.
15
16 use strict;
17
18 # CPAN modules
19 use DBI;
20
21 # Koha modules
22 use C4::Context("/etc/koha.conf.tmp");
23         # FIXME - /etc/koha.conf might not exist, so shouldn't use
24         # C4::Context.
25
26 # FIXME - The user might be installing a new database, so can't rely
27 # on /etc/koha.conf anyway.
28
29 my $debug=0;
30
31 my (
32         $sth, $sti,
33         $query,
34         %existingtables,        # tables already in database
35         %types,
36         $table,
37         $column,
38         $type, $null, $key, $default, $extra,
39         $prefitem,              # preference item in systempreferences table
40 );
41
42 my $dbh = C4::Context->dbh;
43
44 #-------------------
45 # Defines
46
47 # Tables to add if they don't exist
48 my %requiretables=(
49     shelfcontents=>"( shelfnumber int not null,
50                                                         itemnumber int not null,
51                                                         flags int)",
52     bookshelf=>"( shelfnumber int auto_increment primary key,
53                                                 shelfname char(255))",
54     z3950queue=>"( id int auto_increment primary key,
55                                                 term text,
56                                                 type char(10),
57                                                 startdate int,
58                                                 enddate int,
59                                                 done smallint,
60                                                 results longblob,
61                                                 numrecords int,
62                                                 servers text,
63                                                 identifier char(30))",
64         z3950results=>"( id int auto_increment primary key,
65                                                 queryid int,
66                                                 server char(255),
67                                                 startdate int,
68                                                 enddate int,
69                                                 results longblob,
70                                                 numrecords int,
71                                                 numdownloaded int,
72                                                 highestseen int,
73                                                 active smallint)",
74         branchrelations=>"( branchcode varchar(4),
75                                                         categorycode varchar(4))",
76         websites=>"( websitenumber int(11) NOT NULL auto_increment,
77                                                 biblionumber int(11) NOT NULL default '0',
78                                                 title text,
79                                                 description text,
80                                                 url varchar(255),
81                                                 PRIMARY KEY (websitenumber) )",
82         marcrecorddone=>"( isbn char(40),
83                                                                 issn char(40),
84                                                                 lccn char(40),
85                                                                 controlnumber char(40))",
86     uploadedmarc=>"( id int(11) NOT NULL auto_increment PRIMARY KEY,
87                                                         marc longblob,
88                                                         hidden smallint(6) default NULL,
89                                                         name varchar(255) default NULL)",
90         ethnicity=>"( code varchar(10) NOT NULL default '',
91                                         name varchar(255) default NULL,
92                                         PRIMARY KEY  (code)   )",
93         sessions=>"( sessionID varchar(255) NOT NULL default '',
94                                                 userid varchar(255) default NULL,
95                                                 ip varchar(16) default NULL,
96                                                 lasttime int,
97                                                 PRIMARY KEY (sessionID)   )",
98     sessionqueries=>"( sessionID varchar(255) NOT NULL default '',
99                                                                 userid char(100) NOT NULL default '',
100                                                                 ip char(18) NOT NULL default '',
101                                                                 url text NOT NULL default ''  )",
102         bibliothesaurus=> "( id bigint(20) NOT NULL auto_increment,
103                                                         freelib char(255) NOT NULL default '',
104                                                         stdlib char(255) NOT NULL default '',
105                                                         category char(10) NOT NULL default '',
106                                                         level tinyint(4) NOT NULL default '1',
107                                                         hierarchy char(80) NOT NULL default '',
108                                                         PRIMARY KEY  (id),
109                                                         KEY freelib (freelib),
110                                                         KEY stdlib (stdlib),
111                                                         KEY category (category),
112                                                         KEY hierarchy (hierarchy)
113                                                         )",
114         marc_biblio => "(
115                                                 bibid bigint(20) unsigned NOT NULL auto_increment,
116                                                 biblionumber int(11) NOT NULL default '0',
117                                                 datecreated date NOT NULL default '0000-00-00',
118                                                 datemodified date default NULL,
119                                                 origincode char(20) default NULL,
120                                                 PRIMARY KEY  (bibid),
121                                                 KEY origincode (origincode),
122                                                 KEY biblionumber (biblionumber)
123                                                 ) ",
124         marc_blob_subfield => "(
125                                         blobidlink bigint(20) NOT NULL auto_increment,
126                                         subfieldvalue longtext NOT NULL,
127                                         PRIMARY KEY  (blobidlink)
128                                         ) ",
129         marc_subfield_structure => "(
130                                                 tagfield char(3) NOT NULL default '',
131                                                 tagsubfield char(1) NOT NULL default '',
132                                                 liblibrarian char(255) NOT NULL default '',
133                                                 libopac char(255) NOT NULL default '',
134                                                 repeatable tinyint(4) NOT NULL default '0',
135                                                 mandatory tinyint(4) NOT NULL default '0',
136                                                 kohafield char(40)  default NULL,
137                                                 tab tinyint(1) default NULL,
138                                                 authorised_value char(10) default NULL,
139                                                 thesaurus_category char(10) default NULL,
140                                                 value_builder char(80) default NULL,
141                                                 PRIMARY KEY  (tagfield,tagsubfield),
142                                                 KEY kohafield (kohafield),
143                                                 KEY tab (tab)
144                                                 )",
145         marc_subfield_table => "(
146                                                 subfieldid bigint(20) unsigned NOT NULL auto_increment,
147                                                 bibid bigint(20) unsigned NOT NULL default '0',
148                                                 tag char(3) NOT NULL default '',
149                                                 tagorder tinyint(4) NOT NULL default '1',
150                                                 tag_indicator char(2) NOT NULL default '',
151                                                 subfieldcode char(1) NOT NULL default '',
152                                                 subfieldorder tinyint(4) NOT NULL default '1',
153                                                 subfieldvalue varchar(255) default NULL,
154                                                 valuebloblink bigint(20) default NULL,
155                                                 PRIMARY KEY  (subfieldid),
156                                                 KEY bibid (bibid),
157                                                 KEY tag (tag),
158                                                 KEY tag_indicator (tag_indicator),
159                                                 KEY subfieldorder (subfieldorder),
160                                                 KEY subfieldcode (subfieldcode),
161                                                 KEY subfieldvalue (subfieldvalue),
162                                                 KEY tagorder (tagorder)
163                                         )",
164         marc_tag_structure => "(
165                                         tagfield char(3) NOT NULL default '',
166                                         liblibrarian char(255) NOT NULL default '',
167                                         libopac char(255) NOT NULL default '',
168                                         repeatable tinyint(4) NOT NULL default '0',
169                                         mandatory tinyint(4) NOT NULL default '0',
170                                         authorised_value char(10) default NULL,
171                                         PRIMARY KEY  (tagfield)
172                                         )",
173         marc_word => "(
174                                 bibid bigint(20) NOT NULL default '0',
175                                 tag char(3) NOT NULL default '',
176                                 tagorder tinyint(4) NOT NULL default '1',
177                                 subfieldid char(1) NOT NULL default '',
178                                 subfieldorder tinyint(4) NOT NULL default '1',
179                                 word varchar(255) NOT NULL default '',
180                                 sndx_word varchar(255) NOT NULL default '',
181                                 KEY bibid (bibid),
182                                 KEY tag (tag),
183                                 KEY tagorder (tagorder),
184                                 KEY subfieldid (subfieldid),
185                                 KEY subfieldorder (subfieldorder),
186                                 KEY word (word),
187                                 KEY sndx_word (sndx_word)
188                         )",
189         marc_breeding =>"(  id bigint(20) NOT NULL auto_increment,
190                                 file varchar(80) NOT NULL default '',
191                                 isbn varchar(10) NOT NULL default '',
192                                 title varchar(128) default NULL,
193                                 author varchar(80) default NULL,
194                                 marc text NOT NULL,
195                                 PRIMARY KEY  (id),
196                                 KEY title (title),
197                                 KEY isbn (isbn)
198                         )",
199         authorised_values => "(id int(11) NOT NULL auto_increment,
200                                 category char(10) NOT NULL default '',
201                                 authorised_value char(80) NOT NULL default '',
202                                 lib char(80) NULL,
203                                 PRIMARY KEY  (id),
204                                 KEY name (category)
205                         )",
206         userflags =>            "( bit int(11) NOT NULL default '0',
207                                 flag char(30), flagdesc char(255),
208                                 defaulton int(11)
209                         )",
210 );
211
212
213
214 my %requirefields=(
215         biblio=>{ 'abstract' => 'text' },
216         deletedbiblio=>{ 'abstract' => 'text' },
217         biblioitems=>{ 'lccn' => 'char(25)',
218                         'url' => 'varchar(255)',
219                         'marc' => 'text' },
220         deletedbiblioitems=>{ 'lccn' => 'char(25)',
221                         'url' => 'varchar(255)',
222                         'marc' => 'text' },
223         branchtransfers=>{ 'datearrived' => 'datetime' },
224         statistics=>{'borrowernumber' =>'int(11)'},
225         aqbooksellers=>{'invoicedisc' =>'float(6,4)',
226                                                 'nocalc' => 'int(11)'},
227         borrowers=>{'userid' => 'char(30)',
228                                         'password' => 'char(30)',
229                                         'flags' => 'int(11)'},
230         aqorders=>{'budgetdate' => 'date'},
231         #added so that reference items are not available for reserves...
232         itemtypes=>{'notforloan' => 'smallint(6)'},
233         systempreferences =>{'explanation' => 'char(80)'},
234 );
235
236 my %dropable_table=(
237                     classification   =>'classification',
238                     multipart        =>'multipart',
239                     multivolume      =>'multivolume',
240                     newitems         =>'newitems',
241                     procedures       =>'procedures',
242                     publisher        =>'publisher',
243                     searchstats      =>'searchstats',
244                     serialissues     =>'serialissues',
245                     );
246
247
248 # The tabledata hash contains data that should be in the tables.
249 # The uniquefieldrequired hash entry is used to determine which (if any) fields
250 # must not exist in the table for this row to be inserted.  If the
251 # uniquefieldrequired entry is already in the table, the existing data is not
252 # modified.
253
254 my %tabledata=(
255     userflags => [
256         { uniquefieldrequired => 'bit', bit => 0, flag => 'superlibrarian', flagdesc => 'Access to all librarian functions', defaulton => 0 },
257         { uniquefieldrequired => 'bit', bit => 1, flag => 'circulate', flagdesc => 'Circulate books', defaulton => 0 },
258         { uniquefieldrequired => 'bit', bit => 2, flag => 'catalogue', flagdesc => 'View Catalogue (Librarian Interface)', defaulton => 0 },
259         { uniquefieldrequired => 'bit', bit => 3, flag => 'parameters', flagdesc => 'Set Koha system paramters', defaulton => 0 },
260         { uniquefieldrequired => 'bit', bit => 4, flag => 'borrowers', flagdesc => 'Add or modify borrowers', defaulton => 0 },
261         { uniquefieldrequired => 'bit', bit => 5, flag => 'permissions', flagdesc => 'Set user permissions', defaulton => 0 },
262         { uniquefieldrequired => 'bit', bit => 6, flag => 'reserveforothers', flagdesc => 'Reserve books for patrons', defaulton => 0 },
263         { uniquefieldrequired => 'bit', bit => 7, flag => 'borrow', flagdesc => 'Borrow books', defaulton => 1 },
264         { uniquefieldrequired => 'bit', bit => 8, flag => 'reserveforself', flagdesc => 'Reserve books for self', defaulton => 0 },
265         { uniquefieldrequired => 'bit', bit => 9, flag => 'editcatalogue', flagdesc => 'Edit Catalogue (Modify bibliographic/holdings data)', defaulton => 0 },
266         { uniquefieldrequired => 'bit', bit => 10, flag => 'updatecharges', flagdesc => 'Update borrower charges', defaulton => 0 },
267     ],
268     systempreferences => [
269         { uniquefieldrequired => 'variable', variable => 'autoMemberNum', value => '1', explanation => '1 or else. If 1, Barcode is auto-calculated' },
270         { uniquefieldrequired => 'variable', variable => 'acquisitions', value => 'simple', explanation => 'normal or simple : whether to use "acqui" or "acqui.simple" acquisition system' },
271         { uniquefieldrequired => 'variable', variable => 'dateformat', value => 'metric', explanation => 'metric, us, or iso' },
272         { uniquefieldrequired => 'variable', variable => 'template', value => 'default', explanation => 'template default name' },
273         { uniquefieldrequired => 'variable', variable => 'autoBarcode', value => '1', explanation => '1 or else. If 1, Barcode is auto-calculated' },
274         { uniquefieldrequired => 'variable', variable => 'insecure', value => 'NO', explanation => 'if YES, no auth at all is needed. Be careful if you set this to yes !' },
275         { uniquefieldrequired => 'variable', variable => 'authoritysep', value => '--', explanation => 'the separator used in authority/thesaurus. Usually --' },
276         { uniquefieldrequired => 'variable', variable => 'opaclanguages', value => 'en', explanation => 'languages' },
277         { uniquefieldrequired => 'variable', variable => 'opacthemes', value => 'default', explanation => 'theme' },
278         { uniquefieldrequired => 'variable', variable => 'timeout', value => '12000000', explanation => 'login timeout' },
279         { uniquefieldrequired => 'variable', variable => 'marc', value => 'ON', explanation => 'MARC support (ON or OFF)' },
280         { uniquefieldrequired => 'variable', variable => 'marcflavour', value => 'MARC21', explanation => 'your MARC flavor (MARC21 or UNIMARC) used for character encoding' },
281         { uniquefieldrequired => 'variable', variable => 'checkdigit', value => 'katipo', explanation => 'none= no check on member cardnumber. katipo= katipo check' },
282         { uniquefieldrequired => 'variable', variable => 'dateformat', value => 'ISO', explanation => 'date format (US mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd) ' },
283    ],
284
285 );
286
287
288 my %fielddefinitions=(
289 printers => [
290         { field => 'printername', type => 'char(40)', null => '', key => 'PRI', default => '' },
291         ],
292 aqbookfund => [
293         { field => 'bookfundid', type => 'char(5)', null => '', key => 'PRI', default => '' },
294         ],
295 z3950servers => [
296         { field => 'id', type => 'int', null => '', key => 'PRI', default => '', extra => 'auto_increment' },
297         ],
298 );
299
300
301
302 #-------------------
303 # Initialize
304
305 # Start checking
306
307 # Get version of MySQL database engine.
308 my $mysqlversion=`mysqld --version`;
309 $mysqlversion=~/Ver (\S*) /;
310 $mysqlversion=$1;
311 if ($mysqlversion ge '3.23') {
312         print "Could convert to MyISAM database tables...\n";
313 }
314
315 #---------------------------------
316 # Tables
317
318 # Collect all tables into a list
319 $sth=$dbh->prepare("show tables");
320 $sth->execute;
321 while (my ($table) = $sth->fetchrow) {
322     $existingtables{$table}=1;
323 }
324
325 # Now add any missing tables
326 foreach $table ( keys %requiretables ) {
327         print "Checking $table table...\n" if $debug;
328         unless ($existingtables{$table} ) {
329                 print "Adding $table table...\n";
330                 my $sth=$dbh->prepare(
331                         "create table $table $requiretables{$table}" );
332                 $sth->execute;
333                 if ($sth->err) {
334                                 print "Error : $sth->errstr \n";
335                                 $sth->finish;
336                 } # if error
337         } # unless exists
338 } # foreach
339
340 # now drop useless tables
341 foreach $table ( keys %dropable_table) {
342         print "Dropping unused tables...\n" if $debug;
343         if ($existingtables{$table} ) {
344                 $dbh->do("drop table $table");
345                 if ($dbh->err) {
346                 print "Error : $dbh->errstr \n";
347                 }
348         }
349 }
350 unless ($existingtables{'z3950servers'}) {
351         print "Adding z3950servers table...\n";
352         my $sti=$dbh->prepare("create table z3950servers (
353                                                                                 host char(255),
354                                                                                 port int,
355                                                                                 db char(255),
356                                                                                 userid char(255),
357                                                                                 password char(255),
358                                                                                 name text,
359                                                                                 id int,
360                                                                                 checked smallint,
361                                                                                 rank int)");
362         $sti->execute;
363         $sti=$dbh->prepare("insert into z3950servers
364                                                                 values ('z3950.loc.gov',
365                                                                 7090,
366                                                                 'voyager',
367                                                                 '', '',
368                                                                 'Library of Congress',
369                                                                 1, 1, 1)");
370         $sti->execute;
371 }
372
373 #---------------------------------
374 # Columns
375
376 foreach $table ( keys %requirefields ) {
377         print "Check table $table\n" if $debug;
378         $sth=$dbh->prepare("show columns from $table");
379         $sth->execute();
380         undef %types;
381         while ( ($column, $type, $null, $key, $default, $extra)
382                         = $sth->fetchrow) {
383                 $types{$column}=$type;
384         } # while
385         foreach $column ( keys %{ $requirefields{$table} } )  {
386                 print "  Check column $column\n" if $debug;
387                 if ( ! $types{$column} ) {
388                 # column doesn't exist
389                 print "Adding $column field to $table table...\n";
390                 $query="alter table $table
391                         add column $column " . $requirefields{$table}->{$column} ;
392                 print "Execute: $query\n" if $debug;
393                 my $sti=$dbh->prepare($query);
394                 $sti->execute;
395                         if ($sti->err) {
396                                         print "**Error : $sti->errstr \n";
397                                         $sti->finish;
398                         } # if error
399                 } # if column
400         } # foreach column
401 } # foreach table
402
403 foreach $table ( keys %fielddefinitions ) {
404     print "Check table $table\n" if $debug;
405     $sth=$dbh->prepare("show columns from $table");
406     $sth->execute();
407     my $definitions;
408     while ( ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
409         $definitions->{$column}->{type}=$type;
410         $definitions->{$column}->{null}=$null;
411         $definitions->{$column}->{key}=$key;
412         $definitions->{$column}->{default}=$default;
413         $definitions->{$column}->{extra}=$extra;
414     } # while 
415     my $fieldrow=$fielddefinitions{$table};
416     foreach my $row ( @$fieldrow )  {
417         my $field = $row->{field};
418         my $type = $row->{type};
419         my $null = $row->{null};
420         my $key = $row->{key};
421         my $default = $row->{default};
422         my $extra = $row->{extra};
423         my $def=$definitions->{$field};
424         unless ($type eq $def->{type} && $null eq $def->{null} && $key eq $def->{key} && $default eq $def->{default} && $extra eq $def->{extra}) {
425             if ($null eq '') {
426                 $null='NOT NULL';
427             }
428             if ($key eq 'PRI') {
429                 $key ='PRIMARY KEY';
430             }
431             unless ($extra eq 'auto_increment') {
432                 $extra='';
433             }
434             my $sth=$dbh->prepare("alter table $table change $field $field $type $null $key $extra default ?");
435             $sth->execute($default);
436             print "  Alter $field in $table\n";
437         }
438     }
439 }
440
441 # Get list of columns from items table
442 my %itemtypes;
443
444 $sth=$dbh->prepare("show columns from items");
445 $sth->execute;
446 while (my ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
447         $itemtypes{$column}=$type;
448 }
449
450 unless ($itemtypes{'barcode'} eq 'varchar(20)') {
451         $itemtypes{'barcode'}=~/varchar\((\d+)\)/;
452         my $oldlength=$1;
453         if ($oldlength<20) {
454                 print "Setting maximum barcode length to 20 (was $oldlength).\n";
455                 my $sti=$dbh->prepare("alter table items change barcode barcode varchar(20) not null");
456                 $sti->execute;
457         }
458 }
459
460 # extending the timestamp in branchtransfers...
461 my %branchtransfers;
462
463 $sth=$dbh->prepare("show columns from branchtransfers");
464 $sth->execute;
465 while (my ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
466     $branchtransfers{$column}=$type;
467 }
468
469 unless ($branchtransfers{'datesent'} eq 'datetime') {
470     print "Setting type of datesent in branchtransfers to datetime.\n";
471     my $sti=$dbh->prepare("alter table branchtransfers change datesent datesent datetime");
472     $sti->execute;
473 }
474
475 unless ($branchtransfers{'datearrived'} eq 'datetime') {
476     print "Setting type of datearrived in branchtransfers to datetime.\n";
477     my $sti=$dbh->prepare("alter table branchtransfers change datearrived datearrived datetime");
478     $sti->execute;
479 }
480
481 # changing the branchcategories table around...
482 my %branchcategories;
483
484 $sth=$dbh->prepare("show columns from branchcategories");
485 $sth->execute;
486 while (my ($column, $type, $null, $key, $default, $extra) = $sth->fetchrow) {
487         $branchcategories{$column}=$type;
488 }
489
490 unless ($branchcategories{'categorycode'} eq 'varchar(4)') {
491         print "Setting type of categorycode in branchcategories to varchar(4),\n and making the primary key.\n";
492         my $sti=$dbh->prepare("alter table branchcategories change categorycode categorycode varchar(4) not null");
493         $sti->execute;
494         $sti=$dbh->prepare("alter table branchcategories add primary key (categorycode)");
495         $sti->execute;
496 }
497
498 unless ($branchcategories{'categoryname'} eq 'text') {
499         print "Changing branchcode in branchcategories to categoryname text.\n";
500         my $sth=$dbh->prepare("alter table branchcategories change branchcode categoryname text");
501         $sth->execute;
502 }
503
504 unless ($branchcategories{'codedescription'} eq 'text') {
505         print "Replacing branchholding in branchcategories with codedescription text.\n";
506         my $sth=$dbh->prepare("alter table branchcategories change branchholding codedescription text");
507         $sth->execute;
508 }
509
510
511 # Populate tables with required data
512  
513 foreach my $table (keys %tabledata) {
514     print "Checking for data required in table $table...\n";
515     my $tablerows=$tabledata{$table};
516     foreach my $row (@$tablerows) {
517         my $uniquefieldrequired=$row->{uniquefieldrequired};
518         my $uniquevalue=$row->{$uniquefieldrequired};
519         my $sth=$dbh->prepare("select $uniquefieldrequired from $table where $uniquefieldrequired=?");
520         $sth->execute($uniquevalue);
521         unless ($sth->rows) {
522             print "Adding row to $table: ";
523             my @values;
524             my $fieldlist;
525             my $placeholders;
526             foreach my $field (keys %$row) {
527                 (next) if ($field eq 'uniquefieldrequired');
528                 my $value=$row->{$field};
529                 push @values, $value;
530                 print "  $field => $value";
531                 $fieldlist.="$field,";
532                 $placeholders.="?,";
533             }
534             print "\n";
535             $fieldlist=~s/,$//;
536             $placeholders=~s/,$//;
537             my $sth=$dbh->prepare("insert into $table ($fieldlist) values ($placeholders)");
538             $sth->execute(@values);
539         }
540     }
541 }
542
543 $sth->finish;
544
545 exit;
546
547 # $Log$
548 # Revision 1.39  2003/04/04 08:45:00  tipaul
549 # last commits before 1.9.1
550 #
551 # Revision 1.38  2003/03/18 10:58:19  tipaul
552 # adding checkdigit parameter that choose how to check the members cardnumber.
553 # At the moment :
554 # * none = no checking
555 # * katipo = checked as before
556 #
557 # Revision 1.37  2003/01/30 01:47:48  acli
558 # Corrected syntax error reported by Benedict
559 #
560 # Made the indentation somewhat easier to read; the messiness probably caused
561 # the original syntax error.
562 #
563 # Revision 1.36  2003/01/28 15:13:30  tipaul
564 # userflag table now created in upgrade script (bugfix #171)
565 #
566 # Revision 1.35  2003/01/27 03:12:49  acli
567 # Reworded the description for "acquisitions" to make it fit on the screen
568 #
569 # Added "iso" to dateformat, since dateformat is not yet being used anyway
570 #
571 # Revision 1.34  2003/01/23 12:30:02  tipaul
572 # introducint marcflavour in systempref file : used for character decoding
573 #
574 # Revision 1.33  2003/01/21 09:03:27  tipaul
575 # bugfix (NOTE : this bugs makes installation of the 1.3.3 a little fuzzy. Please fix your DB if you installed 1.3.3)
576 #
577 # Revision 1.32  2003/01/16 10:29:45  tipaul
578 # adding a MARC parameter in systempref ( which is ON or OFF)
579 # the search will be a marc search if MARC=ON
580 # and a standard (v1.2) search if MARC=OFF
581 #
582 # Revision 1.31  2003/01/06 13:32:43  tipaul
583 # *** empty log message ***
584 #
585 # Revision 1.29  2003/01/06 11:14:11  tipaul
586 # last bugfixes before 1.3.3 : systempref table correctly filled
587 #
588 # Revision 1.28  2002/12/10 13:27:47  tipaul
589 # bugfixes (davide mails in koha-dev)
590 #
591 # Revision 1.27  2002/11/26 15:04:54  tipaul
592 # road to 1.3.2. Updating db structure during installation
593 #
594 # Revision 1.26  2002/11/12 17:42:40  tonnesen
595 # Merged some features over from rel-1-2, including primary key checking.
596 #
597 # Revision 1.25  2002/11/12 16:44:38  tipaul
598 # road to 1.3.2 :
599 # * many bugfixes
600 # * adding value_builder : you can map a subfield in the marc_subfield_structure to a sub stored in "value_builder" directory. In this directory you can create screen used to build values with any method. In this commit is a 1st draft of the builder for 100$a unimarc french subfield, which is composed of 35 digits, with 12 differents values (only the 4th first are provided for instance)
601 #
602 # Revision 1.24  2002/10/30 14:00:23  arensb
603 # (bug fix): Fixed typo.
604 #
605 # Revision 1.23  2002/10/25 10:55:46  tipaul
606 # Road to 1.3.2
607 # * bugfixes and improvements
608 # * manage mandatory MARC subfields
609 # * new table : authorised_values. this table contains categories and authorised values for the category. On MARC management, you can map a subfield to a authorised_values category. If you do this, the subfield can only be filled with a authorised_value of the selected category.
610 # this submit contains everything needed :
611 # * updatedatabase
612 # * admin screens
613 # * "links" management
614 # * creation of a html-list if a subfield is mapped to an authorised value.
615 #
616 # Note this is different from authorities support, which will come soon.
617 # The authorised_values is supposed to contains a "small" number of authorised values for a category (less than 50-100). If you enter more authorised values than this, it should be hard to find what you want in a BIG list...
618 #
619 # Revision 1.22  2002/10/15 10:08:19  tipaul
620 # fixme corrected, re-indent and adding the marc_breeding table (see commit of marcimport.pl for more explanations about breeding)
621 #
622 # Revision 1.21  2002/10/14 11:48:59  tipaul
623 # bugfix
624 #
625 # Revision 1.20  2002/10/10 04:49:41  arensb
626 # Added some FIXME comments.
627 #
628 # Revision 1.19  2002/10/05 10:17:17  arensb
629 # Merged with arensb-context branch: use C4::Context->dbh instead of
630 # &C4Connect, and generally prefer C4::Context over C4::Database.
631 #
632 # Revision 1.18.2.2  2002/10/05 06:18:43  arensb
633 # Added a whole mess of FIXME comments.
634 #
635 # Revision 1.18.2.1  2002/10/04 02:46:00  arensb
636 # Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
637 # C4Connect.
638 #
639 # Revision 1.18  2002/09/24 13:50:55  tipaul
640 # long WAS the road to 1.3.0...
641 # coming VERY SOON NOW...
642 # modifying installer and buildrelease to update the DB
643 #
644 # Revision 1.17  2002/09/24 12:57:35  tipaul
645 # long WAS the road to 1.3.0...
646 # coming VERY SOON NOW...
647 # modifying installer and buildrelease to update the DB
648 #
649 # Revision 1.16  2002/07/31 02:34:27  finlayt
650 #
651 # added "notforloan" field to the itemtypes table.
652 #
653 # Revision 1.15  2002/07/20 22:30:06  rangi
654 # Making sure fix makes it into the main branch as well
655 # Fix for bug 69
656 #
657 # Revision 1.14  2002/07/08 16:20:26  tonnesen
658 # Added sessionqueries table and password/userid fields to borrowers table
659 #
660 # Revision 1.13  2002/07/04 18:05:36  tonnesen
661 # bug fix
662 #
663 # Revision 1.12  2002/07/04 16:41:06  tonnesen
664 # Merged changes from rel-1-2.  Abstracted table structure changes by alan.
665 #