From 81367c84ebb02dfac5d95f39f214baf288fe1ec8 Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 25 Oct 2002 10:55:46 +0000 Subject: [PATCH] Road to 1.3.2 * bugfixes and improvements * manage mandatory MARC subfields * 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. this submit contains everything needed : * updatedatabase * admin screens * "links" management * creation of a html-list if a subfield is mapped to an authorised value. Note this is different from authorities support, which will come soon. 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... --- acqui.simple/addbiblio.pl | 50 +++- admin/authorised_values.pl | 181 ++++++++++++ admin/marc_subfields_structure.pl | 85 ++++-- .../default/en/acqui.simple/addbiblio.tmpl | 264 ++++++++++-------- .../default/en/parameters/admin-home.tmpl | 50 +++- .../en/parameters/authorised_values.tmpl | 84 ++++++ .../parameters/marc_subfields_structure.tmpl | 10 +- updater/updatedatabase | 21 ++ 8 files changed, 579 insertions(+), 166 deletions(-) create mode 100755 admin/authorised_values.pl create mode 100644 koha-tmpl/intranet-tmpl/default/en/parameters/authorised_values.tmpl diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index a34c10acd8..7f485d0893 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -82,7 +82,7 @@ my $template; my $tagslib = &MARCgettagslib($dbh,1); my $record = MARCgetbiblio($dbh,$bibid) if ($oldbiblionumber); -#my $record = MARCfindbreeding($dbh,$isbn) if ($isbn); +my $record = MARCfindbreeding($dbh,$isbn) if ($isbn); #------------------------------------------------------------------------------------------------------------------------------ if ($op eq "addbiblio") { @@ -104,15 +104,15 @@ if ($op eq "addbiblio") { next if ($subfield eq 'lib'); next if ($subfield eq 'tab'); next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10"); + $i++; my %subfield_data; $subfield_data{tag}=$tag; $subfield_data{subfield}=$subfield; $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib}; $subfield_data{marc_mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{marc_repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; push(@loop_data, \%subfield_data); - $i++ } } $template = gettemplate("acqui.simple/addbiblio2.tmpl"); @@ -184,7 +184,7 @@ if ($op eq "addbiblio") { $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib}; $subfield_data{marc_mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{marc_repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; push(@loop_data, \%subfield_data); $i++ } @@ -201,6 +201,8 @@ if ($op eq "addbiblio") { # fill arrays my @loop_data =(); my $tag; + my $i=0; + my $authorised_values_sth = $dbh->prepare("select authorised_value from authorised_values where category=?"); # loop through each tab 0 through 9 for (my $tabloop = 0; $tabloop<=9;$tabloop++) { # loop through each tag @@ -217,16 +219,46 @@ if ($op eq "addbiblio") { my %subfield_data; $subfield_data{tag}=$tag; $subfield_data{subfield}=$subfield; - $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib}; + $subfield_data{marc_lib}="
".$tagslib->{$tag}->{$subfield}->{lib}."
"; $subfield_data{mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; if ($record ne -1) { - my $value ="";# &find_value($tag,$subfield,$record); - $subfield_data{marc_value}=""; + my $value = find_value($tag,$subfield,$record); + if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { + $authorised_values_sth->execute($tagslib->{$tag}->{$subfield}->{authorised_value}); + my @authorised_values; + push @authorised_values, "" unless ($subfield_data{mandatory}); + while ((my $value) = $authorised_values_sth->fetchrow_array) { + push @authorised_values, $value; + } + $subfield_data{marc_value}= CGI::scrolling_list(-name=>'field_value', + -values=> \@authorised_values, + -default=>"$value", + -size=>1, + -multiple=>0, + ); + } else { + $subfield_data{marc_value}=""; + } } else { - $subfield_data{marc_value}=""; + if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { + $authorised_values_sth->execute($tagslib->{$tag}->{$subfield}->{authorised_value}); + my @authorised_values; + push @authorised_values, "" unless ($subfield_data{mandatory}); + while ((my $value) = $authorised_values_sth->fetchrow_array) { + push @authorised_values, $value; + } + $subfield_data{marc_value}= CGI::scrolling_list(-name=>'field_value', + -values=> \@authorised_values, + -size=>1, + -multiple=>0, + ); + } else { + $subfield_data{marc_value}=""; + } } push(@subfields_data, \%subfield_data); + $i++; } if ($#subfields_data>=0) { my %tag_data; @@ -251,7 +283,7 @@ if ($op eq "addbiblio") { $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib}; $subfield_data{marc_mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{marc_repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; push(@loop_data, \%subfield_data); $i++ } diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl new file mode 100755 index 0000000000..332c19e3ee --- /dev/null +++ b/admin/authorised_values.pl @@ -0,0 +1,181 @@ +#!/usr/bin/perl + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use CGI; +use C4::Context; +use C4::Output; +use C4::Search; +use HTML::Template; +use C4::Context; + + +sub StringSearch { + my ($env,$searchstring,$type)=@_; + my $dbh = C4::Context->dbh; + $searchstring=~ s/\'/\\\'/g; + my @data=split(' ',$searchstring); + my $count=@data; + my $query="Select id,category,authorised_value from authorised_values where (category like \"$data[0]%\") order by category,authorised_value"; + my $sth=$dbh->prepare($query); + $sth->execute; + my @results; + my $cnt=0; + while (my $data=$sth->fetchrow_hashref){ + push(@results,$data); + $cnt ++; + } + $sth->finish; + return ($cnt,\@results); +} + +my $input = new CGI; +my $searchfield=$input->param('searchfield'); +$searchfield=~ s/\,//g; +my $id = $input->param('id'); +my $reqsel="select category,authorised_value from authorised_values where id='$id'"; +my $reqdel="delete from authorised_values where id='$id'"; +my $offset=$input->param('offset'); +my $script_name="/cgi-bin/koha/admin/authorised_values.pl"; +my $dbh = C4::Context->dbh; + +my $template = gettemplate("parameters/authorised_values.tmpl",0); +my $pagesize=20; +my $op = $input->param('op'); + +if ($op) { +$template->param(script_name => $script_name, + $op => 1); # we show only the TMPL_VAR names $op +} else { +$template->param(script_name => $script_name, + else => 1); # we show only the TMPL_VAR names $op +} +################## ADD_FORM ################################## +# called by default. Used to create form to add or modify a record +if ($op eq 'add_form') { + my $data; + if ($id) { + my $dbh = C4::Context->dbh; + my $sth=$dbh->prepare("select id,category,authorised_value from authorised_values where id='$id'"); + $sth->execute; + $data=$sth->fetchrow_hashref; + $sth->finish; + } else { + $data->{'category'} = $input->param('category'); + } + if ($searchfield) { + $template->param(action => "Modify authorised value"); + } else { + $template->param(action => "Add authorised value"); + } + $template->param(category => $data->{'category'}, + authorised_value => $data->{'authorised_value'}, + id => $data->{'id'} + ); + if ($data->{'category'}) { + $template->param(category => "$data->{'category'}"); + } else { + $template->param(category => ""); + } +################## ADD_VALIDATE ################################## +# called by add_form, used to insert/modify data in DB +} elsif ($op eq 'add_validate') { + my $dbh = C4::Context->dbh; + my $sth=$dbh->prepare("replace authorised_values (id,category,authorised_value) values (?,?,?)"); + warn "TOTO : ".$input->param('id'), $input->param('category'), $input->param('authorised_value'); + $sth->execute($input->param('id'), $input->param('category'), $input->param('authorised_value')); + $sth->finish; + print "Content-Type: text/html\n\nparam('category')."\">"; + exit; +################## DELETE_CONFIRM ################################## +# called by default form, used to confirm deletion of data in DB +} elsif ($op eq 'delete_confirm') { + my $dbh = C4::Context->dbh; + my $sth=$dbh->prepare($reqsel); + $sth->execute; + my $data=$sth->fetchrow_hashref; + $sth->finish; + $template->param(searchfield => $searchfield, + Tvalue => $data->{'authorised_value'}, + id =>$id, + ); + + # END $OP eq DELETE_CONFIRM +################## DELETE_CONFIRMED ################################## +# called by delete_confirm, used to effectively confirm deletion of data in DB +} elsif ($op eq 'delete_confirmed') { + my $dbh = C4::Context->dbh; + my $sth=$dbh->prepare($reqdel); + $sth->execute; + $sth->finish; + print "Content-Type: text/html\n\n"; + exit; + + # END $OP eq DELETE_CONFIRMED +################## DEFAULT ################################## +} else { # DEFAULT + # build categories list + my $sth = $dbh->prepare("select distinct category from authorised_values"); + $sth->execute; + my @category_list; + while ( my ($category) = $sth->fetchrow_array) { + push(@category_list,$category); + } + my $tab_list = CGI::scrolling_list(-name=>'searchfield', + -values=> \@category_list, + -default=>"", + -size=>1, + -multiple=>0, + ); + if (!$searchfield) { + $searchfield=$category_list[0]; + } + my $env; + my ($count,$results)=StringSearch($env,$searchfield,'web'); + my $toggle="white"; + my @loop_data = (); + # builds value list + for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){ + if ($toggle eq 'white'){ + $toggle="#ffffcc"; + } else { + $toggle="white"; + } + my %row_data; # get a fresh hash for the row data + $row_data{category} = $results->[$i]{'category'}; + $row_data{authorised_value} = $results->[$i]{'authorised_value'}; + $row_data{edit} = "$script_name?op=add_form&id=".$results->[$i]{'id'}; + $row_data{delete} = "$script_name?op=delete_confirm&searchfield=$searchfield&id=".$results->[$i]{'id'}; + push(@loop_data, \%row_data); + } + + $template->param(loop => \@loop_data, + tab_list => $tab_list, + category => $searchfield); + if ($offset>0) { + my $prevpage = $offset-$pagesize; + $template->param("'); + } + if ($offset+$pagesize<$count) { + my $nextpage =$offset+$pagesize; + $template->param("a href=$script_name?offset=".$nextpage.'Next >>'); + } +} #---- END $OP eq DEFAULT + +print "Content-Type: text/html\n\n", $template->output; diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index e55dd173ae..184c5f91fb 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -31,7 +31,7 @@ sub StringSearch { $searchstring=~ s/\'/\\\'/g; my @data=split(' ',$searchstring); my $count=@data; - my $query="Select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab from marc_subfield_structure where (tagfield like \"$searchstring%\") order by tagfield"; + my $query="Select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab, authorised_value from marc_subfield_structure where (tagfield like \"$searchstring%\") order by tagfield"; my $sth=$dbh->prepare($query); $sth->execute; my @results; @@ -50,7 +50,7 @@ my $input = new CGI; my $tagfield=$input->param('tagfield'); my $tagsubfield=$input->param('tagsubfield'); my $pkfield="tagfield"; -my $reqsel="select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab from marc_subfield_structure where tagfield='$tagfield'"; +my $reqsel="select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value from marc_subfield_structure where tagfield='$tagfield'"; my $reqdel="delete from marc_subfield_structure where tagfield='$tagfield' and tagsubfield='$tagsubfield'"; my $offset=$input->param('offset'); my $script_name="/cgi-bin/koha/admin/marc_subfields_structure.pl"; @@ -75,7 +75,7 @@ $template->param(script_name => $script_name, if ($op eq 'add_form') { my $data; my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab from marc_subfield_structure where tagfield='$tagfield'"); # and tagsubfield='$tagsubfield'"); + my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value from marc_subfield_structure where tagfield='$tagfield'"); # and tagsubfield='$tagsubfield'"); $sth->execute; # builds kohafield tables my @kohafields; @@ -95,11 +95,21 @@ if ($op eq 'add_form') { while ((my $field) = $sth2->fetchrow_array) { push @kohafields, "items.".$field; } + # buiild authorised value list + $sth2->finish; + $sth2 = $dbh->prepare("select distinct category from authorised_values"); + $sth2->execute; + my @authorised_values; + push @authorised_values,""; + while ((my $category) = $sth2->fetchrow_array) { + push @authorised_values, $category; + } $template->param(action => "Edit subfields", tagfield => "$tagfield", ); my @loop_data = (); my $toggle="white"; + my $i=0; while ($data =$sth->fetchrow_hashref) { my %row_data; # get a fresh hash for the row data if ($toggle eq 'white'){ @@ -107,9 +117,9 @@ if ($op eq 'add_form') { } else { $toggle="white"; } - $row_data{tab} = CGI::scrolling_list(-name=>'tab[]', - -values=>['','0','1','2','3','4','5','6','7','8','9','10'], - -labels => {'' =>'','0'=>'0','1'=>'1', + $row_data{tab} = CGI::scrolling_list(-name=>'tab', + -values=>['-1','0','1','2','3','4','5','6','7','8','9','10'], + -labels => {'-1' =>'ignore','0'=>'0','1'=>'1', '2' =>'2','3'=>'3','4'=>'4', '5' =>'5','6'=>'6','7'=>'7', '8' =>'8','9'=>'9','10'=>'items (10)', @@ -118,40 +128,57 @@ if ($op eq 'add_form') { -size=>1, -multiple=>0, ); - $row_data{tagsubfield} =$data->{'tagsubfield'}.""; + $row_data{tagsubfield} =$data->{'tagsubfield'}.""; $row_data{liblibrarian} = $data->{'liblibrarian'}; $row_data{libopac} = $data->{'libopac'}; - $row_data{kohafield}= CGI::scrolling_list( -name=>'kohafield[]', + $row_data{kohafield}= CGI::scrolling_list( -name=>"kohafield", -values=> \@kohafields, -default=> "$data->{'kohafield'}", -size=>1, -multiple=>0, ); + $row_data{authorised_value} = CGI::scrolling_list(-name=>'authorised_value', + -values=> \@authorised_values, + -default=>$data->{'authorised_value'}, + -size=>1, + -multiple=>0, + ); # $row_data{kohafield} = $data->{'kohafield'}; - $row_data{repeatable} = CGI::checkbox('repeatable[]',$data->{'repeatable'}?'checked':'',1,''); - $row_data{mandatory} = CGI::checkbox('mandatory[]',$data->{'mandatory'}?'checked':'',1,''); + $row_data{repeatable} = CGI::checkbox("repeatable$i",$data->{'repeatable'}?'checked':'',1,''); + $row_data{mandatory} = CGI::checkbox("mandatory$i",$data->{'mandatory'}?'checked':'',1,''); $row_data{bgcolor} = $toggle; push(@loop_data, \%row_data); + $i++; } # add an empty line for add if needed my %row_data; # get a fresh hash for the row data - $row_data{tab} = CGI::scrolling_list(-name=>'tab[]', - -values=>['','0','1','2','3','4','5','6','7','8','9','items (10)'], + $row_data{tab} = CGI::scrolling_list(-name=>'tab', + -values=>['-1','0','1','2','3','4','5','6','7','8','9','10'], + -labels => {'-1' =>'ignore','0'=>'0','1'=>'1', + '2' =>'2','3'=>'3','4'=>'4', + '5' =>'5','6'=>'6','7'=>'7', + '8' =>'8','9'=>'9','10'=>'items (10)', + }, -default=>"", -size=>1, -multiple=>0, ); - $row_data{tagsubfield} = ""; + $row_data{tagsubfield} = ""; $row_data{liblibrarian} = ""; $row_data{libopac} = ""; - $row_data{repeatable} = CGI::checkbox('repeatable[]','',1,''); - $row_data{mandatory} = CGI::checkbox('mandatory[]','',1,''); - $row_data{kohafield}= CGI::scrolling_list( -name=>'kohafield[]', + $row_data{repeatable} = CGI::checkbox('repeatable','',1,''); + $row_data{mandatory} = CGI::checkbox('mandatory','',1,''); + $row_data{kohafield}= CGI::scrolling_list( -name=>'kohafield', -values=> \@kohafields, -default=> "", -size=>1, -multiple=>0, ); + $row_data{authorised_value} = CGI::scrolling_list(-name=>'authorised_value', + -values=> \@authorised_values, + -size=>1, + -multiple=>0, + ); $row_data{bgcolor} = $toggle; push(@loop_data, \%row_data); @@ -163,24 +190,24 @@ if ($op eq 'add_form') { } elsif ($op eq 'add_validate') { my $dbh = C4::Context->dbh; $template->param(tagfield => "$input->param('tagfield')"); - my $sth=$dbh->prepare("replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab) - values (?,?,?,?,?,?,?,?)"); - my @tagsubfield = $input->param('tagsubfield[]'); - my @liblibrarian = $input->param('liblibrarian[]'); - my @libopac = $input->param('libopac[]'); - my @repeatable = $input->param('repeatable[]'); - my @mandatory = $input->param('mandatory[]'); - my @kohafield = $input->param('kohafield[]'); - my @tab = $input->param('tab[]'); + my $sth=$dbh->prepare("replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value) + values (?,?,?,?,?,?,?,?,?)"); + my @tagsubfield = $input->param('tagsubfield'); + my @liblibrarian = $input->param('liblibrarian'); + my @libopac = $input->param('libopac'); + my @kohafield = $input->param('kohafield'); + my @tab = $input->param('tab'); + my @authorised_values = $input->param('authorised_value'); for (my $i=0; $i<= $#tagsubfield ; $i++) { my $tagfield =$input->param('tagfield'); my $tagsubfield =$tagsubfield[$i]; my $liblibrarian =$liblibrarian[$i]; my $libopac =$libopac[$i]; - my $repeatable =$repeatable[$i]?1:0; - my $mandatory =$mandatory[$i]?1:0; + my $repeatable =$input->param("repeatable$i")?1:0; + my $mandatory =$input->param("mandatory$i")?1:0; my $kohafield =$kohafield[$i]; my $tab =$tab[$i]; + my $authorised_value =$authorised_values[$i]; if ($tagsubfield) { $sth->execute ($tagfield, $tagsubfield, @@ -189,7 +216,8 @@ if ($op eq 'add_form') { $repeatable, $mandatory, $kohafield, - $tab); + $tab, + $authorised_value); } } $sth->finish; @@ -243,6 +271,7 @@ if ($op eq 'add_form') { $row_data{repeatable} = $results->[$i]{'repeatable'}; $row_data{mandatory} = $results->[$i]{'mandatory'}; $row_data{tab} = $results->[$i]{'tab'}; + $row_data{authorised_value} = $results->[$i]{'authorised_value'}; $row_data{delete} = "$script_name?op=delete_confirm&tagfield=$tagfield&tagsubfield=".$results->[$i]{'tagsubfield'}; $row_data{bgcolor} = $toggle; push(@loop_data, \%row_data); diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl index 672a7d9d08..ea2cf5f72d 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl @@ -1,6 +1,6 @@ -
+ @@ -9,239 +9,249 @@
MARC biblio : - - - - - - - - - - - + + + + + + + + + + +
0xx
1xx
2xx
3xx
4xx
5xx
6xx
7xx
8xx
9xx
0
1
2
3
4
5
6
7
8
9
-
- - + + -
   - "> - "> + "> + "> + ">
-
+ + - - + + - + + - + + - + + + + - + + - + + - + + - + +
@@ -249,19 +259,39 @@ diff --git a/koha-tmpl/intranet-tmpl/default/en/parameters/admin-home.tmpl b/koha-tmpl/intranet-tmpl/default/en/parameters/admin-home.tmpl index 597acd6eb2..1ced59c2ed 100644 --- a/koha-tmpl/intranet-tmpl/default/en/parameters/admin-home.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/parameters/admin-home.tmpl @@ -3,15 +3,47 @@ Koha admin page


- - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/default/en/parameters/authorised_values.tmpl b/koha-tmpl/intranet-tmpl/default/en/parameters/authorised_values.tmpl new file mode 100644 index 0000000000..e8d52608e2 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/parameters/authorised_values.tmpl @@ -0,0 +1,84 @@ + + + + +

+
+ +
TableMeaning
libraries branchesthe differents branches you manage with this koha server
budgetthe budgets allowed to differents book funds.
book fundsthe differents book funds.
categoriesthe differents types of borrowers.
Item typesthe supports of an item.
CurrenciesCurrencies of booksellers.
PrintersPrinters (UNIX paths).
stopwordsWords deleted during searches
systempreferencesSystem preferences
libraries branchesthe differents branches you manage with this koha server
budgetthe budgets allowed to differents book funds.
book fundsthe differents book funds.
categoriesthe differents types of borrowers.
Item typesthe supports of an item.
CurrenciesCurrencies of booksellers.
PrintersPrinters (UNIX paths).
stopwordsWords deleted during searches
systempreferencesSystem preferences
authorised valuesDefine here categories and authorised values for them. + Authorised values are used in MARC form to limit/help editing MARC biblios
TableMeaning
MARC tag structureMARC structure : tag then subfields
+ + + + + + + + + + + + +
Category
Authorised value
 "> +
+ + + + + + + + + + + + + + + + "> + + + + + + + +Authorised values admin +

This table is used in MARC definition. You can define as many categories as you want, and as many authorised values as you want in each category.

+

When you define the MARC subfield structure, you can link a subfield to a authorised-value category. When the user ask for adding of modifying a biblio, +the subfield is not entered through a free field, but though a list of authorised values

+
+ New category... + + +
Variable
Value
CONFIRM DELETION
+ + + + + + + + + + + + + + + +
categoryAuthorised value  
">Edit">Delete
+ + + + + +
+ + +"> +

+ +
+ + diff --git a/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl index 2c1055ea48..d49966a113 100644 --- a/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl @@ -12,16 +12,18 @@ Mandatory Koha field Tab + Authorised value - -
- +
+ +
@@ -60,11 +62,12 @@ ensure that both DB are synchronized, thus you can change from MARC to KOHA inte - + + @@ -74,6 +77,7 @@ ensure that both DB are synchronized, thus you can change from MARC to KOHA inte + diff --git a/updater/updatedatabase b/updater/updatedatabase index 5912fa87e8..cf636aad2f 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -129,6 +129,7 @@ my %requiretables=( mandatory tinyint(4) NOT NULL default '0', kohafield char(40) NOT NULL default '', tab tinyint(1), + authorised_value char(10) default NULL, PRIMARY KEY (tagfield,tagsubfield), KEY kohafield (kohafield), KEY tab (tab) @@ -181,6 +182,12 @@ my %requiretables=( marc text NOT NULL, PRIMARY KEY (isbn) )", + authorised_values => "(id int(11) NOT NULL auto_increment, + category char(10) NOT NULL default '', + authorised_value char(80) NOT NULL default '', + PRIMARY KEY (id), + KEY name (category) + )"; ); @@ -414,6 +421,20 @@ $sth->finish; exit; # $Log$ +# Revision 1.23 2002/10/25 10:55:46 tipaul +# Road to 1.3.2 +# * bugfixes and improvements +# * manage mandatory MARC subfields +# * 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. +# this submit contains everything needed : +# * updatedatabase +# * admin screens +# * "links" management +# * creation of a html-list if a subfield is mapped to an authorised value. +# +# Note this is different from authorities support, which will come soon. +# 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... +# # Revision 1.22 2002/10/15 10:08:19 tipaul # fixme corrected, re-indent and adding the marc_breeding table (see commit of marcimport.pl for more explanations about breeding) # -- 2.39.5
SubfieldLibLib koha field ? Rep ? Mand ? Tab ?Auth value ?
YesNo YesNo ">delete