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...
This commit is contained in:
parent
08d26bcc75
commit
81367c84eb
|
|
@ -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}="<input type=\"text\" name=\"value[]\">";
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_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}="<input type=\"text\" name=\"value[]\">";
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_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}="<DIV id=\"error$i\">".$tagslib->{$tag}->{$subfield}->{lib}."</div>";
|
||||
$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}="<input type=\"text\" name=\"value[]\" value=\"$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}="<input type=\"text\" name=\"field_value\" value=\"$value\">";
|
||||
}
|
||||
} else {
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"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}="<input type=\"text\" name=\"field_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}="<input type=\"hidden\" name=\"value[]\">";
|
||||
$subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value\">";
|
||||
push(@loop_data, \%subfield_data);
|
||||
$i++
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 => "<input type=\"hidden\" name=\"category\" value='$data->{'category'}'>$data->{'category'}");
|
||||
} else {
|
||||
$template->param(category => "<input type=text name=\"category\" size=8 maxlength=8>");
|
||||
}
|
||||
################## 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\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=".$input->param('category')."\"></html>";
|
||||
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<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=$searchfield\"></html>";
|
||||
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("<a href=$script_name?offset=".$prevpage.'<< Prev</a>');
|
||||
}
|
||||
if ($offset+$pagesize<$count) {
|
||||
my $nextpage =$offset+$pagesize;
|
||||
$template->param("a href=$script_name?offset=".$nextpage.'Next >></a>');
|
||||
}
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
|
|
@ -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 => "<input type=hidden name=tagfield value='$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'}."<input type='hidden' name='tagsubfield[]' value='".$data->{'tagsubfield'}."'>";
|
||||
$row_data{tagsubfield} =$data->{'tagsubfield'}."<input type='hidden' name='tagsubfield' value='".$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} = "<input type='text' name='tagsubfield[]' value='".$data->{'tagsubfield'}."' size=3 maxlength=1>";
|
||||
$row_data{tagsubfield} = "<input type='text' name='tagsubfield' value='".$data->{'tagsubfield'}."' size=3 maxlength=1>";
|
||||
$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);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<TMPL_INCLUDE NAME="acquisitions-top.inc">
|
||||
|
||||
<form method="post">
|
||||
<form method="post" name="f">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=1>
|
||||
<tr background="/images/background-mem.gif">
|
||||
<th>MARC biblio : <TMPL_VAR name="bibid"></th>
|
||||
|
|
@ -9,239 +9,249 @@
|
|||
<td>
|
||||
<table width=100% border=0 colspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td width=9% align="center"><a href="javascript:active(0)"><div id="link0">0xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(1)" ><div id="link1">1xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(2)"><div id="link2">2xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(3)"><div id="link3">3xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(4)"><div id="link4">4xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(5)"><div id="link5">5xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(6)"><div id="link6">6xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(7)"><div id="link7">7xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(8)"><div id="link8">8xx</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(9)"><div id="link9">9xx</div></a></td>
|
||||
<td width=10% align="center"><input type="hidden" name="op" value="addbiblio"><input type="submit" value=">>> items"></td>
|
||||
<td width=9% align="center"><a href="javascript:active(0)"><div id="link0">0</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(1)"><div id="link1">1</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(2)"><div id="link2">2</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(3)"><div id="link3">3</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(4)"><div id="link4">4</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(5)"><div id="link5">5</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(6)"><div id="link6">6</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(7)"><div id="link7">7</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(8)"><div id="link8">8</div></a></td>
|
||||
<td width=9% align="center"><a href="javascript:active(9)"><div id="link9">9</div></a></td>
|
||||
<td width=10% align="center"><input type="hidden" name="op" value="addbiblio"><input type="button" value=">>> items" onClick='Check(this.form)'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<DIV name="0XX" id="0XX" style="position:absolute;left:40px;top:150px;visibility:visible;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="0XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><TMPL_VAR name="subfield"></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tmpl_loop>
|
||||
</tmpl_loop>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="1XX" id="1XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="1XX" id="1XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="1XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="2XX" id="2XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="2XX" id="2XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="2XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="3XX" id="3XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="3XX" id="3XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="3XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><<TMPL_IF name="mandatory"></b></TMPL_IF>/td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="4XX" id="4XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="4XX" id="4XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="4XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="5XX" id="5XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="5XX" id="5XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="5XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="6XX" id="6XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=90% cellspacing=0 cellpadding=5 border=0>
|
||||
<table width=90% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="6XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="7XX" id="7XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="7XX" id="7XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="7XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="8XX" id="8XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="8XX" id="8XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=100% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="8XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="9XX" id="9XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=90% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="9XX" id="9XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=90% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="9XX">
|
||||
<tr background="/images/background-mem.gif"><td colspan=4><b><tmpl_var name="tag"></td></tr>
|
||||
<TMPL_LOOP name="subfield">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV name="hidden" id="hidden" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=90% cellspacing=0 cellpadding=5 border=0>
|
||||
<DIV name="hidden" id="hidden" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
|
||||
<table width=90% cellspacing=0 cellpadding=5 border=0>
|
||||
<TMPL_LOOP name="hidden_loop">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="marc_tag"></b></td>
|
||||
<td width="3%"> </td>
|
||||
<td width="2%"><b><TMPL_VAR name="subfield"></b></td>
|
||||
<td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
|
||||
<td width="40%">
|
||||
<TMPL_VAR name="marc_value">
|
||||
<input type="hidden" name="tag[]" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield[]" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
|
||||
<input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
|
||||
<input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
</form>
|
||||
|
||||
|
|
@ -249,19 +259,39 @@
|
|||
<script LANGUAGE="JavaScript">
|
||||
function active(numlayer)
|
||||
{
|
||||
for (i=0; i <= 10 ; i++ ) {
|
||||
ong = i+"XX";
|
||||
link = "link"+i;
|
||||
if (numlayer==i) {
|
||||
document.getElementById(ong).style.visibility="visible";
|
||||
document.getElementById(link).style.backgroundColor="#11AA11";
|
||||
document.getElementById(link).style.backgroundImage="url(/images/background-mem.gif)";
|
||||
} else {
|
||||
document.getElementById(ong).style.visibility="hidden";
|
||||
document.getElementById(link).style.backgroundColor="#FFFFFF";
|
||||
document.getElementById(link).style.backgroundImage="";
|
||||
}
|
||||
for (i=0; i < 10 ; i++ ) {
|
||||
ong = i+"XX";
|
||||
link = "link"+i;
|
||||
if (numlayer==i) {
|
||||
document.getElementById(ong).style.visibility="visible";
|
||||
document.getElementById(link).style.backgroundColor="#11AA11";
|
||||
document.getElementById(link).style.backgroundImage="url(/images/background-mem.gif)";
|
||||
} else {
|
||||
document.getElementById(ong).style.visibility="hidden";
|
||||
document.getElementById(link).style.backgroundColor="#FFFFFF";
|
||||
document.getElementById(link).style.backgroundImage="";
|
||||
}
|
||||
}
|
||||
}
|
||||
function Check(f) {
|
||||
var total_errors=0;
|
||||
// alert(f.field_value.length);
|
||||
for (i=0 ; i<f.field_value.length ; i++) {
|
||||
// alert (f.field_value[i].value);
|
||||
if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
|
||||
document.getElementById("error"+i).style.backgroundColor="#FF0000";
|
||||
total_errors++;
|
||||
}
|
||||
}
|
||||
var alertString2;
|
||||
if (total_errors==0) {
|
||||
document.f.submit();
|
||||
} else {
|
||||
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||
alertString2 += "- "+ total_errors+" mandatory fields empty (see bold subfields)";
|
||||
alert(alertString2);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -3,15 +3,47 @@
|
|||
<FONT SIZE=6><em>Koha admin page</em></FONT><br><br><br>
|
||||
<table cellspacing=0 cellpadding=3 width=60%>
|
||||
<th width="30%" background="/images/background-mem.gif">Table</th><th width="70%" background="/images/background-mem.gif">Meaning</th>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/branches.pl>libraries branches</a></td><td>the differents branches you manage with this koha server</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/aqbudget.pl>budget</a></td><td>the budgets allowed to differents book funds.</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/aqbookfund.pl>book funds</a></td><td>the differents book funds.</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/categorie.pl>categories</a></td><td>the differents types of borrowers.</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/itemtypes.pl>Item types</a></td><td>the supports of an item.</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/currency.pl>Currencies</a></td><td>Currencies of booksellers.</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/printers.pl>Printers</a></td><td>Printers (UNIX paths).</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/stopwords.pl>stopwords</a></td><td>Words deleted during searches</td></tr>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/systempreferences.pl>systempreferences</a></td><td>System preferences</td></tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/branches.pl>libraries branches</a></td>
|
||||
<td>the differents branches you manage with this koha server</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/aqbudget.pl>budget</a></td>
|
||||
<td>the budgets allowed to differents book funds.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/aqbookfund.pl>book funds</a></td>
|
||||
<td>the differents book funds.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/categorie.pl>categories</a></td>
|
||||
<td>the differents types of borrowers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/itemtypes.pl>Item types</a></td>
|
||||
<td>the supports of an item.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/currency.pl>Currencies</a></td>
|
||||
<td>Currencies of booksellers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/printers.pl>Printers</a></td>
|
||||
<td>Printers (UNIX paths).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/stopwords.pl>stopwords</a></td>
|
||||
<td>Words deleted during searches</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/systempreferences.pl>systempreferences</a></td>
|
||||
<td>System preferences</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a href=/cgi-bin/koha/admin/authorised_values.pl>authorised values</a></td>
|
||||
<td>Define here categories and authorised values for them.
|
||||
Authorised values are used in MARC form to limit/help editing MARC biblios</td>
|
||||
</tr>
|
||||
|
||||
<th background="/images/background-mem.gif">Table</th><th background="/images/background-mem.gif">Meaning</th>
|
||||
<tr><td valign="top"><a href=/cgi-bin/koha/admin/marctagstructure.pl>MARC tag structure</a></td><td>MARC structure : tag then subfields</td></tr>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
<TMPL_INCLUDE NAME="cat-top.inc">
|
||||
|
||||
<TMPL_IF name="add_form">
|
||||
<!-------------------------------------------------------------------------------------------------->
|
||||
<H1><TMPL_VAR name="action"></H1>
|
||||
<form action='<TMPL_VAR name="script_name">' name=Aform method=post>
|
||||
<input type=hidden name=op value='add_validate'>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Category</td>
|
||||
<td><TMPL_VAR name="category"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Authorised value</td>
|
||||
<td><input type=text name="authorised_value" value='<TMPL_VAR name="authorised_value">'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="hidden" name="id" value="<TMPL_VAR name="id">">
|
||||
<INPUT type="submit" value='OK'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
|
||||
|
||||
<TMPL_IF name="delete_confirm">
|
||||
<!-------------------------------------------------------------------------------------------------->
|
||||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
<tr valign=top bgcolor=#99cc33>
|
||||
<td background="/images/background-mem.gif"><b>Variable</b></td>
|
||||
<td background="/images/background-mem.gif"><b><TMPL_VAR name="searchfield"></b></td>
|
||||
</tr>
|
||||
<tr><td>Value</td><td><TMPL_VAR name="Tvalue"></td></tr>
|
||||
<form action='<TMPL_VAR name="script_name">' method=post>
|
||||
<input type=hidden name=op value=delete_confirmed>
|
||||
<input type=hidden name=id value='<TMPL_VAR name="id">'>
|
||||
<input type="hidden" name="searchfield" value="<TMPL_VAR name="searchfield">">
|
||||
<tr><td colspan=2 align=center>CONFIRM DELETION</td></tr>
|
||||
<tr><td><INPUT type=submit value='YES'></form></td>
|
||||
<td><form action='<TMPL_VAR name="script_name">' method=post><input type=submit value=NO></form></td></tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<!-------------------------------------------------------------------------------------------------->
|
||||
<TMPL_IF name="else">
|
||||
<font SIZE=6><em>Authorised values admin</em></font>
|
||||
<p>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.</p>
|
||||
<p>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</p>
|
||||
<form action=/cgi-bin/koha/admin/authorised_values.pl method=post>
|
||||
<TMPL_VAR name="tab_list"><input type="submit" value="OK"> <a href="authorised_values.pl?op=add_form">New category...</a>
|
||||
</form>
|
||||
<TMPL_VAR name="searchfield">
|
||||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
<tr valign=top bgcolor=#99cc33>
|
||||
<td background="/images/background-mem.gif"><b>category</b></td>
|
||||
<td background="/images/background-mem.gif"><b>Authorised value</b></td>
|
||||
<td background="/images/background-mem.gif"> </td>
|
||||
<td background="/images/background-mem.gif"> </td>
|
||||
<TMPL_LOOP name="loop">
|
||||
</tr valign=top bgcolor='<TMPL_VAR name="bgcolor">'>
|
||||
<td><TMPL_VAR name="category"></td>
|
||||
<td><TMPL_VAR name="authorised_value"></td>
|
||||
<td><a href="<TMPL_VAR name="edit">">Edit</a></td>
|
||||
<td><a href="<TMPL_VAR name="delete">">Delete</a></td>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
<form action='<TMPL_VAR name="script_name">' method=post>
|
||||
<input type=hidden name=op value=add_form>
|
||||
</table>
|
||||
<table width=40%>
|
||||
<tr>
|
||||
<td width=50%><TMPL_VAR name="previous"></td>
|
||||
<td width=50%><TMPL_VAR name="next"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<form action='<TMPL_VAR name="script_name">' method=post>
|
||||
<input type="hidden" name="op" value="add_form">
|
||||
<input type="hidden" name="category" value="<TMPL_VAR name="category">">
|
||||
<br><input type=image src="/images/button-add-new.gif" WIDTH=188 HEIGHT=44 ALT="Add budget" BORDER=0 ></a><br>
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_INCLUDE NAME="cat-bottom.inc">
|
||||
|
|
@ -12,16 +12,18 @@
|
|||
<th>Mandatory</th>
|
||||
<th>Koha field</th>
|
||||
<th>Tab</th>
|
||||
<th>Authorised value</th>
|
||||
</tr>
|
||||
<TMPL_LOOP name="loop">
|
||||
<tr valign=top bgcolor='<TMPL_VAR name="bgcolor">'>
|
||||
<td><TMPL_VAR name="tagfield"> - <TMPL_VAR name="tagsubfield"></td>
|
||||
<td><input type=text name="liblibrarian[]" value='<TMPL_VAR name="liblibrarian">' size=40 maxlength=80><br/>
|
||||
<input type=text name="libopac[]" value='<TMPL_VAR name="libopac">' size=40 maxlength=80></td>
|
||||
<td><input type=text name="liblibrarian" value='<TMPL_VAR name="liblibrarian">' size=40 maxlength=80><br/>
|
||||
<input type=text name="libopac" value='<TMPL_VAR name="libopac">' size=40 maxlength=80></td>
|
||||
<td><TMPL_VAR name="repeatable"></td>
|
||||
<td><TMPL_VAR name="mandatory"></td>
|
||||
<td><TMPL_VAR name="kohafield"></td>
|
||||
<td><TMPL_VAR name="tab"></td>
|
||||
<td><TMPL_VAR name="authorised_value"></td>
|
||||
</TMPL_LOOP>
|
||||
</table>
|
||||
<INPUT type=submit value='OK'>
|
||||
|
|
@ -60,11 +62,12 @@ ensure that both DB are synchronized, thus you can change from MARC to KOHA inte
|
|||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
<tr valign=top bgcolor=#99cc33>
|
||||
<td background="/images/background-mem.gif" width=5%><b>Subfield</b></td>
|
||||
<td background="/images/background-mem.gif" width=42%><b>Lib</b></td>
|
||||
<td background="/images/background-mem.gif" width=30%><b>Lib</b></td>
|
||||
<td background="/images/background-mem.gif" width=10%><b>koha field</b> <span style="font-size:8;color:red" title="the koha-DB field linked to this subfield">?</span></td>
|
||||
<td background="/images/background-mem.gif" width=8%><b>Rep</b> <span style="font-size:8;color:red" title="subfield may be repeated (1=yes, 0=no)">?</span></td>
|
||||
<td background="/images/background-mem.gif" width=8%><b>Mand</b> <span style="font-size:8;color:red" title="subfield is mandatory (1=yes, 0=no)">?</span></td>
|
||||
<td background="/images/background-mem.gif" width=8%><b>Tab</b> <span style="font-size:8;color:red" title="subfield is shown in which tab (0-9 or item)">?</span></td>
|
||||
<td background="/images/background-mem.gif" width=8%><b>Auth value</b> <span style="font-size:8;color:red" title="values authorised for this subfield">?</span></td>
|
||||
<td background="/images/background-mem.gif" width=8%>
|
||||
<TMPL_LOOP name="loop">
|
||||
<tr valign=top bgcolor='<TMPL_VAR name="bgcolor">'>
|
||||
|
|
@ -74,6 +77,7 @@ ensure that both DB are synchronized, thus you can change from MARC to KOHA inte
|
|||
<td><TMPL_IF name="repeatable">Yes<TMPL_ELSE>No</TMPL_IF></td>
|
||||
<td><TMPL_IF name="mandatory">Yes<TMPL_ELSE>No</TMPL_IF></td>
|
||||
<td><TMPL_VAR name="tab"></td>
|
||||
<td><TMPL_VAR name="authorised_value"></td>
|
||||
<td><a href="<TMPL_VAR name="delete">">delete</a></td>
|
||||
</tr>
|
||||
</TMPL_LOOP>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue