moving cataloguing scripts to a cataloguing directory (more logic than acqui.simple !!!) & updating prog templates
This commit is contained in:
parent
247e04d204
commit
ef71641736
6 changed files with 758 additions and 18 deletions
|
@ -179,7 +179,7 @@ sub create_input () {
|
|||
$subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth);
|
||||
# it's a thesaurus / authority field
|
||||
} elsif ($tagslib->{$tag}->{$subfield}->{authtypecode}) {
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"67\" maxlength=\"255\" DISABLE READONLY> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"67\" maxlength=\"255\" DISABLE READONLY /> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
|
||||
# it's a plugin field
|
||||
} elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) {
|
||||
# opening plugin. Just check wether we are on a developper computer on a production one
|
||||
|
@ -192,18 +192,18 @@ sub create_input () {
|
|||
require $plugin;
|
||||
my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
|
||||
my ($function_name,$javascript) = plugin_javascript($dbh,$rec,$tagslib,$i,$tabloop);
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"67\" maxlength=\"255\" OnFocus=\"javascript:Focus$function_name($i)\" OnBlur=\"javascript:Blur$function_name($i)\"> <a href=\"javascript:Clic$function_name($i)\">...</a> $javascript";
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"67\" maxlength=\"255\" OnFocus=\"javascript:Focus$function_name($i)\" OnBlur=\"javascript:Blur$function_name($i)\" /> <a href=\"javascript:Clic$function_name($i)\">...</a> $javascript";
|
||||
# it's an hidden field
|
||||
} elsif ($tag eq '') {
|
||||
$subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value\" value=\"$value\">";
|
||||
$subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value\" value=\"$value\" />";
|
||||
} elsif ($tagslib->{$tag}->{$subfield}->{'hidden'}) {
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"70\" maxlength=\"255\" DISABLE READONLY>";
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"70\" maxlength=\"255\" DISABLE READONLY />";
|
||||
# it's a standard field
|
||||
} else {
|
||||
if (length($value) >100) {
|
||||
$subfield_data{marc_value}="<textarea name=\"field_value\" cols=\"70\" rows=\"5\" >$value</textarea>";
|
||||
} else {
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"70\">"; #"
|
||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"70\" />"; #"
|
||||
}
|
||||
}
|
||||
return \%subfield_data;
|
||||
|
@ -360,7 +360,7 @@ my $bibid;
|
|||
$frameworkcode = &MARCfind_frameworkcode($dbh,$biblionumber) if ($biblionumber and not ($frameworkcode));
|
||||
$frameworkcode='' if ($frameworkcode eq 'Default');
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "acqui.simple/addbiblio.tmpl",
|
||||
= get_template_and_user({template_name => "cataloguing/addbiblio.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
|
|
|
@ -48,7 +48,7 @@ my $error = $query->param('error');
|
|||
my $success = $query->param('biblioitem');
|
||||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
||||
{
|
||||
template_name => "acqui.simple/addbooks.tmpl",
|
||||
template_name => "cataloguing/addbooks.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
|
|
|
@ -58,7 +58,7 @@ my $op = $input->param('op');
|
|||
my $itemtype = &MARCfind_frameworkcode($dbh,$biblionumber);
|
||||
|
||||
my $tagslib = &MARCgettagslib($dbh,1,$itemtype);
|
||||
my $record = MARCgetbiblio($dbh,$bibid);
|
||||
my $record = MARCgetbiblio($dbh,$biblionumber);
|
||||
# warn "==>".$record->as_formatted;
|
||||
my $oldrecord = MARCmarc2koha($dbh,$record);
|
||||
my $itemrecord;
|
||||
|
@ -95,11 +95,11 @@ if ($op eq "additem") {
|
|||
}
|
||||
}
|
||||
# check for item barcode # being unique
|
||||
my $addedolditem = MARCmarc2koha($dbh,$addeditem);
|
||||
my $addedolditem = MARCmarc2koha($dbh,$record);
|
||||
my $exists = get_item_from_barcode($addedolditem->{'barcode'});
|
||||
push @errors,"barcode_not_unique" if($exists);
|
||||
# if barcode exists, don't create, but report The problem.
|
||||
$itemnumber = NEWnewitem($dbh,$addeditem,$biblionumber,$biblioitemnumber) unless ($exists);
|
||||
$itemnumber = NEWnewitem($dbh,$addedolditem,$biblionumber,$biblioitemnumber) unless ($exists);
|
||||
$nextop = "additem";
|
||||
#------------------------------------------------------------------------------------------------------------------------------
|
||||
} elsif ($op eq "edititem") {
|
||||
|
@ -123,7 +123,7 @@ if ($op eq "additem") {
|
|||
# build indicator hash.
|
||||
my @ind_tag = $input->param('ind_tag');
|
||||
my @indicator = $input->param('indicator');
|
||||
# my $itemnum = $input->param('itemnum');
|
||||
# my $itemnumber = $input->param('itemnumber');
|
||||
my %indicators;
|
||||
for (my $i=0;$i<=$#ind_tag;$i++) {
|
||||
$indicators{$ind_tag[$i]} = $indicator[$i];
|
||||
|
@ -131,8 +131,8 @@ if ($op eq "additem") {
|
|||
my $itemrecord = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
|
||||
# MARC::Record builded => now, record in DB
|
||||
# warn "R: ".$record->as_formatted;
|
||||
my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWmoditem($dbh,$record,$bibid,$itemnum,0);
|
||||
$itemnum="";
|
||||
my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWmoditem($dbh,$record,$biblionumber,$itemnumber,0);
|
||||
$itemnumber="";
|
||||
$nextop="additem";
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ if ($op eq "additem") {
|
|||
# build screen with existing items. and "new" one
|
||||
#------------------------------------------------------------------------------------------------------------------------------
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "acqui.simple/additem.tmpl",
|
||||
= get_template_and_user({template_name => "cataloguing/additem.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
|
@ -152,7 +152,7 @@ my ($template, $loggedinuser, $cookie)
|
|||
my %indicators;
|
||||
$indicators{995}=' ';
|
||||
# now, build existiing item list
|
||||
my $temp = MARCgetbiblio($dbh,$bibid);
|
||||
my $temp = MARCgetbiblio($dbh,$biblionumber);
|
||||
my @fields = $temp->fields();
|
||||
#my @fields = $record->fields();
|
||||
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
|
||||
|
@ -237,7 +237,7 @@ foreach my $tag (sort keys %{$tagslib}) {
|
|||
my $test = (C4::Context->preference("IndependantBranches")) &&
|
||||
($tag eq $branchtagfield) && ($subfield eq $branchtagsubfield) &&
|
||||
(C4::Context->userenv->{flags} != 1) && ($value) && ($value ne C4::Context->userenv->{branch}) ;
|
||||
# print $input->redirect(".pl?bibid=$bibid") if ($test);
|
||||
# print $input->redirect(".pl?biblionumber=$biblionumber") if ($test);
|
||||
# search for itemcallnumber if applicable
|
||||
if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) {
|
||||
my $CNtag = substr(C4::Context->preference('itemcallnumber'),0,3);
|
||||
|
@ -316,8 +316,7 @@ foreach my $tag (sort keys %{$tagslib}) {
|
|||
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
|
||||
$template->param(item_loop => \@item_value_loop,
|
||||
item_header_loop => \@header_value_loop,
|
||||
bibid => $bibid,
|
||||
biblionumber =>$oldbiblionumber,
|
||||
biblionumber => $biblionumber,
|
||||
title => $oldrecord->{title},
|
||||
author => $oldrecord->{author},
|
||||
item => \@loop_data,
|
||||
|
|
546
koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl
Normal file
546
koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl
Normal file
|
@ -0,0 +1,546 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Cataloging: <!-- TMPL_IF NAME="oldbiblionumtagfield" -->Edit MARC Record Number <!-- TMPL_VAR name="bibid" --><!-- TMPL_ELSE -->Add MARC Record<!-- /TMPL_IF --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="menus.inc" -->
|
||||
<!-- TMPL_INCLUDE NAME="menu-catalogue.inc" -->
|
||||
|
||||
<form method="post" name="f" id="f" action="addbiblio.pl">
|
||||
<h1><!-- TMPL_IF NAME="oldbiblionumtagfield" -->Edit MARC Record Number <!-- TMPL_VAR name="oldbiblionumber" --><!-- TMPL_ELSE -->Add MARC Record<!-- /TMPL_IF --> With Framework : <!--TMPL_VAR Name="framework" --></h1>
|
||||
|
||||
<input type="hidden" name="op" value="addbiblio" />
|
||||
<input type="hidden" name="addfield_field" />
|
||||
<input type="hidden" name="frameworkcode" value="<!-- TMPL_VAR NAME="frameworkcode" -->" />
|
||||
<input type="hidden" name="oldbiblionumber" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
|
||||
<!-- TMPL_IF name="0XX" -->
|
||||
<a href="#0XX">0</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="1XX" -->
|
||||
<a href="#1XX">1</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="2XX" -->
|
||||
<a href="#2XX">2</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="3XX" -->
|
||||
<a href="#3XX">3</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="4XX" -->
|
||||
<a href="#4XX">4</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="5XX" -->
|
||||
<a href="#5XX">5</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="6XX" -->
|
||||
<a href="#6XX">6</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="7XX" -->
|
||||
<a href="#7XX">7</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="8XX" -->
|
||||
<a href="#8XX">8</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="9XX" -->
|
||||
<a href="#9XX">9</a>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<div id="0XX">
|
||||
<!-- TMPL_IF name="duplicatebiblionumber" -->
|
||||
|
||||
<p>Is this a duplicate of <a href="../MARCdetail.pl?bib=<!-- TMPL_VAR name="duplicatebiblionumber" -->" onclick="openWindow('../MARCdetail.pl?bib=<!-- TMPL_VAR name="duplicatebiblionumber" -->&popup=1', 'Duplicate biblio'; return false;)"><!-- TMPL_VAR name="duplicatetitle" --></a>?</p>
|
||||
<p>You must either :</p>
|
||||
<ul>
|
||||
<li>If it is a duplicate, <a href="additem.pl?bibid=<!-- TMPL_VAR name="duplicatebibid" -->">Edit Items</a> of the existing record.</li>
|
||||
<li>If not, click to <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" /> <a href="#" onclick="confirmnotdup(); return false;">Confirm it's not a duplicate</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="0XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="1XX">
|
||||
<!-- TMPL_LOOP NAME="1XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="2XX">
|
||||
<!-- TMPL_LOOP NAME="2XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="3XX">
|
||||
<!-- TMPL_LOOP NAME="3XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="4XX">
|
||||
<!-- TMPL_LOOP NAME="4XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="5XX">
|
||||
<!-- TMPL_LOOP NAME="5XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="6XX">
|
||||
<!-- TMPL_LOOP NAME="6XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="7XX">
|
||||
<!-- TMPL_LOOP NAME="7XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="8XX">
|
||||
<!-- TMPL_LOOP NAME="8XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div id="9XX">
|
||||
<!-- TMPL_LOOP NAME="9XX" -->
|
||||
<!-- TMPL_IF name="tag" -->
|
||||
<p>
|
||||
<!-- TMPL_VAR NAME="tag" -->
|
||||
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
|
||||
<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
|
||||
<!-- TMPL_IF name="repeatable" -->
|
||||
<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="subfield_loop" -->
|
||||
<p>
|
||||
<label>
|
||||
<!-- TMPL_VAR NAME="subfield" -->
|
||||
<!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR NAME="marc_lib" -->
|
||||
<!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF -->
|
||||
</label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<!-- /tmpl_loop -->
|
||||
</div>
|
||||
|
||||
<div name="hidden" id="hidden">
|
||||
<!-- TMPL_LOOP NAME="hidden_loop" -->
|
||||
<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" -->" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
<!-- /TMPL_LOOP --> <br clear="both" />
|
||||
</div> <br clear="both" />
|
||||
<!-- TMPL_IF name="oldbiblionumtagfield" -->
|
||||
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldbiblionumtagfield" -->" />
|
||||
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldbiblionumtagsubfield" -->" />
|
||||
<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
|
||||
<input type="hidden" name="mandatory" value="0" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldbiblioitemnumtagfield" -->" />
|
||||
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldbiblioitemnumtagsubfield" -->" />
|
||||
<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="oldbiblioitemnumber" -->" />
|
||||
<input type="hidden" name="mandatory" value="0" />
|
||||
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
|
||||
<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<div id="action">
|
||||
<!-- TMPL_IF name="bibid" -->
|
||||
<input type="button" value="Save Bibliographic Record and go to Items" onclick="Check(this.form)" accesskey="w" />
|
||||
<!-- TMPL_ELSE -->
|
||||
<input type="button" value="Add Bibliographic Record and go to Items" onclick="Check(this.form)" accesskey="w" />
|
||||
<!-- /TMPL_IF -->
|
||||
<input type="button" value="z39.50 Search" onclick="PopupZ3950(); return false;" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function _(s) { return s } // dummy function for gettext
|
||||
function confirmnotdup(){
|
||||
document.getElementById("confirm_not_duplicate").value = 1;
|
||||
var checkform = document.getElementById("f");
|
||||
Check(checkform);
|
||||
}
|
||||
|
||||
function Check(f) {
|
||||
// Scan for nonempty fields
|
||||
var field_is_nonempty_p = new Array();
|
||||
for (i=0 ; i<f.field_value.length ; i++) {
|
||||
field_is_nonempty_p[f.tag[i].value] = 0;
|
||||
}
|
||||
for (i=0 ; i<f.field_value.length ; i++) {
|
||||
if (f.field_value[i].value.length != 0) {
|
||||
field_is_nonempty_p[f.tag[i].value] += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Scan for missing mandatory subfields
|
||||
var total_missing_mandatory_subfields = 0;
|
||||
var missing_mandatory_subfields = new Array();
|
||||
for (i=0 ; i<f.field_value.length-2 ; i++) {
|
||||
if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
|
||||
// We should not flag an error unless the tag is also
|
||||
// mandatory, or if something else in the tag is entered
|
||||
|
||||
if (f.tag_mandatory[i].value == 1 || field_is_nonempty_p[f.tag[i].value]) {
|
||||
document.getElementById("error"+i).style.backgroundColor="#FF0000";
|
||||
total_missing_mandatory_subfields++;
|
||||
if (document.getElementById("error"+i).parentNode.tagName == "B")
|
||||
{
|
||||
missing_mandatory_subfields.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
|
||||
}
|
||||
else
|
||||
{
|
||||
missing_mandatory_subfields.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.id.substr(0,1) + ")");
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// alert("I = "+i);
|
||||
document.getElementById("error"+i).style.backgroundColor="#FFFFCC";
|
||||
}
|
||||
}
|
||||
|
||||
// Scan for missing mandatory tags
|
||||
var total_missing_mandatory_tags = 0;
|
||||
var seen_mandatory_tag_p = new Array();
|
||||
var missing_mandatory_tags = new Array();
|
||||
for (i=0 ; i<f.field_value.length ; i++) {
|
||||
var j = f.tag[i].value;
|
||||
if (!field_is_nonempty_p[j] && f.tag_mandatory[i].value == 1) {
|
||||
if (seen_mandatory_tag_p[j] != 1) {
|
||||
seen_mandatory_tag_p[j] = 1;
|
||||
total_missing_mandatory_tags++;
|
||||
if (document.getElementById("error"+i).parentNode.tagName == "B")
|
||||
{
|
||||
missing_mandatory_tags.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
|
||||
}
|
||||
else
|
||||
{
|
||||
missing_mandatory_tags.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.id.substr(0,1) + ")");
|
||||
}
|
||||
}
|
||||
document.getElementById("error"+i).style.backgroundColor="#ffff00";
|
||||
}
|
||||
}
|
||||
|
||||
var total_errors = total_missing_mandatory_tags + total_missing_mandatory_subfields;
|
||||
var alertString2;
|
||||
if (total_errors!=0) {
|
||||
alertString2 = _("Form not submitted because of the following problem(s)");
|
||||
alertString2 += "\n------------------------------------------------------------------------------------\n";
|
||||
alertString2 += "\n- "+ total_missing_mandatory_tags +_(" mandatory tags empty");
|
||||
for (i=0; i<missing_mandatory_tags.length; i++)
|
||||
{
|
||||
alertString2 += "\n--->"+ missing_mandatory_tags[i];
|
||||
}
|
||||
alertString2 += "\n- "+ total_missing_mandatory_subfields +_(" mandatory fields empty (see bold subfields)");
|
||||
for (i=0; i<missing_mandatory_subfields.length; i++)
|
||||
{
|
||||
alertString2 += "\n--->"+ missing_mandatory_subfields[i];
|
||||
}
|
||||
alert(alertString2);
|
||||
} else {
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
function Dopop(link,i) {
|
||||
defaultvalue=document.forms[0].field_value[i].value;
|
||||
newin=window.open(link+"&result="+defaultvalue,"value builder",'width=550,height=550,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
|
||||
function PopupZ3950() {
|
||||
var strQuery="";
|
||||
var error = 0;
|
||||
for (i=0 ; i<document.forms[0].field_value.length ; i++) {
|
||||
if (document.forms[0].kohafield[i].value == "biblioitems.isbn"){
|
||||
if(document.forms[0].field_value[i].value.length>0) {
|
||||
strQuery += "&isbn="+document.forms[0].field_value[i].value;
|
||||
} else {
|
||||
error++;
|
||||
}
|
||||
}
|
||||
if (document.forms[0].kohafield[i].value == "biblio.title"){
|
||||
if(document.forms[0].field_value[i].value.length>0) {
|
||||
strQuery += "&title="+document.forms[0].field_value[i].value;
|
||||
} else {
|
||||
error++;
|
||||
}
|
||||
}
|
||||
if (document.forms[0].kohafield[i].value == "biblio.author"){
|
||||
if(document.forms[0].field_value[i].value.length>0) {
|
||||
strQuery += "&author="+document.forms[0].field_value[i].value;
|
||||
} else {
|
||||
error++;
|
||||
}
|
||||
}
|
||||
if (document.forms[0].kohafield[i].value == "biblioitems.issn"){
|
||||
if(document.forms[0].field_value[i].value.length>0) {
|
||||
strQuery += "&issn="+document.forms[0].field_value[i].value;
|
||||
} else {
|
||||
error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(error < 4){
|
||||
newin=window.open("../z3950/search.pl?bibid=<!-- TMPL_VAR NAME="bibid" -->"+strQuery,"z3950search",'width=640,height=400,location=yes,toolbar=no,scrollbars=yes');
|
||||
} else {
|
||||
alert("To perform a z39.50 search, you must enter at least one of the following: \n\n ISBN\n ISSN\n Title\n Author\n");
|
||||
}
|
||||
}
|
||||
|
||||
function Changefwk(FwkList) {
|
||||
var fwk = FwkList.options[FwkList.selectedIndex].value;
|
||||
window.location = "addbiblio.pl?oldbiblionumber=<!--TMPL_VAR Name="oldbiblionumber"-->&frameworkcode="+fwk;
|
||||
}
|
||||
|
||||
function AddField(field) {
|
||||
document.forms[0].op.value = "addfield";
|
||||
document.forms[0].addfield_field.value=field;
|
||||
document.f.submit();
|
||||
}
|
||||
</script></body>
|
||||
</html>
|
61
koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbooks.tmpl
Normal file
61
koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbooks.tmpl
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Cataloging Home<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="menus.inc" -->
|
||||
<!-- TMPL_INCLUDE NAME="menu-catalogue.inc" -->
|
||||
|
||||
<h1>Catalog Maintenance</h1>
|
||||
<!-- TMPL_IF name="noitemsfound" -->
|
||||
No items found
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<h2>Search Existing Records</h2>
|
||||
<div id="addbooks_search">
|
||||
<form action="isbnsearch.pl">
|
||||
<p>
|
||||
<label for="title">Title</label>
|
||||
<input type="hidden" name="marclist" value="biblio.title" />
|
||||
<input type="hidden" name="and_or" value="and" />
|
||||
<input type="hidden" name="excluding" value="" />
|
||||
<input type="hidden" name="operator" value="contains" />
|
||||
<input type="text" name="value" id="title"size="35" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="isbn">ISBN</label>
|
||||
<input type="hidden" name="marclist" value="biblioitems.isbn" />
|
||||
<input type="hidden" name="and_or" value="and" />
|
||||
<input type="hidden" name="excluding" value="" />
|
||||
<input type="hidden" name="operator" value="start" />
|
||||
<input type="text" name="value" id="isbn"size="35" />
|
||||
</p>
|
||||
<p><input type="submit" value="Search" /></p>
|
||||
<ul>
|
||||
<li>If the ISBN is found into the database, that record will be retrieved and can be modified.</li>
|
||||
<li>If the ISBN is found in the reservoir, it will be retrieved and a full record added.</li>
|
||||
<li>Otherwise, a record can be added from scratch.</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div id="addbooks_add_without_search">
|
||||
<!-- TMPL_IF NAME="NOTMARC" -->
|
||||
<form action="addbiblio.pl">
|
||||
<input type="submit" value="Add Record Without Search" />
|
||||
</form>
|
||||
<!-- TMPL_ELSE -->
|
||||
<form action="addbiblio.pl" method="post">
|
||||
<h3>Create a Blank Bibliographic Record</h3>
|
||||
<p>
|
||||
<label for="frameworkcode">Choose a Framework:</label>
|
||||
<select name="frameworkcode" id="frameworkcode">
|
||||
<option value="">Default</option>
|
||||
<!-- TMPL_LOOP NAME="frameworkcodeloop" -->
|
||||
<option value="<!-- TMPL_VAR NAME="value" -->">
|
||||
<!-- TMPL_VAR NAME="frameworktext" -->
|
||||
</option>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</select>
|
||||
<input type="submit" value="Add Record Without Search" />
|
||||
</p>
|
||||
</form>
|
||||
<!-- /TMPL_IF -->
|
||||
</div>
|
||||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|
134
koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl
Normal file
134
koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl
Normal file
|
@ -0,0 +1,134 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Cataloging: Items for Bibliographic Record <!-- TMPL_VAR name="biblionumber" --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="menus.inc" -->
|
||||
<!-- TMPL_INCLUDE NAME="menu-catalogue.inc" -->
|
||||
|
||||
|
||||
<h1>Items for <!-- TMPL_VAR name="title" --> <!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR name="author" --><!-- /TMPL_IF --> (Record #<!-- TMPL_VAR NAME="biblionumber" -->)</h1>
|
||||
|
||||
<div id="cataloguing_additem_itemlist">
|
||||
<form method="post" action="additem.pl" name="f">
|
||||
<input type="hidden" name="op" value="<!-- TMPL_VAR NAME="op" -->" />
|
||||
<input type="hidden" name="bibid" value="<!-- TMPL_VAR NAME="bibid" -->" />
|
||||
<!-- TMPL_IF name="item_loop" -->
|
||||
<h2>Existing items</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<!-- TMPL_LOOP NAME="item_header_loop" -->
|
||||
<th>
|
||||
<!-- TMPL_VAR NAME="header_value" -->
|
||||
</th>
|
||||
<!-- /TMPL_LOOP -->
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="item_loop" -->
|
||||
<tr>
|
||||
<!-- TMPL_VAR NAME="item_value" -->
|
||||
<td><a href="additem.pl?op=edititem&bibid=<!-- TMPL_VAR NAME="bibid" -->&itemnum=<!-- TMPL_VAR NAME="itemnum" -->">Edit</a></td>
|
||||
<td><a href="javascript:confirm_deletion(<!-- TMPL_VAR NAME="bibid" -->,<!-- TMPL_VAR NAME="itemnum" -->)">Delete</a></td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
<!-- /TMPL_IF -->
|
||||
</div>
|
||||
|
||||
<div id="cataloguing_additem_newitem">
|
||||
<!-- TMPL_IF name="opisadd" -->
|
||||
<h2>Add Item</h2>
|
||||
<!-- TMPL_ELSE -->
|
||||
<h2>Edit Item</h2>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="item" -->
|
||||
<p>
|
||||
<label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *<!-- /TMPL_IF --></label>
|
||||
<!-- 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="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
|
||||
</p>
|
||||
<!-- /tmpl_loop -->
|
||||
<input type="hidden" name="itemnum" value="<!-- TMPL_VAR NAME="itemnum" -->" />
|
||||
<!-- TMPL_IF name="barcode_not_unique" -->
|
||||
ERROR : Barcode already exists !
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="opisadd" -->
|
||||
<input type="button" value="Add item" onClick="Check(this.form)" accesskey="w" />
|
||||
<!-- TMPL_ELSE -->
|
||||
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
|
||||
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
|
||||
<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnum" -->" />
|
||||
<input type="button" value="Save Changes" onClick="Check(this.form)" accesskey="w" />
|
||||
<!-- /TMPL_IF -->
|
||||
</form>
|
||||
|
||||
<div id="action">
|
||||
<form action="/cgi-bin/koha/cataloguing/addbiblio.pl" method="get">
|
||||
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" />
|
||||
<input type="submit" value="Edit Bibliographic Record" />
|
||||
</form>
|
||||
<form action="/cgi-bin/koha/catalogue/detail.pl" method="get">
|
||||
<input type="hidden" name="bib" value="<!-- TMPL_VAR name="biblionumber" -->" />
|
||||
<input type="submit" value="Normal view" />
|
||||
</form>
|
||||
<form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="get">
|
||||
<input type="hidden" name="bib" value="<!-- TMPL_VAR name="biblionumber" -->" />
|
||||
<input type="submit" value="View MARC in Catalog" />
|
||||
</form>
|
||||
<form action="/cgi-bin/koha/cataloguie/ISBDdetail.pl" method="get">
|
||||
<input type="hidden" name="bib" value="<!-- TMPL_VAR name="biblionumber" -->" />
|
||||
<input type="submit" value="View ISBD in Catalog" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function _(s) { return s } // dummy function for gettext
|
||||
function active(numlayer)
|
||||
{
|
||||
for (i=10; i < 11 ; 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(<!-- TMPL_VAR NAME="themelang" -->/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++;
|
||||
} else {
|
||||
// document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
|
||||
}
|
||||
}
|
||||
var alertString2;
|
||||
if (total_errors==0) {
|
||||
document.f.submit();
|
||||
} else {
|
||||
alertString2 = _("Form not submitted because of the following problem(s)");
|
||||
alertString2 += "\n------------------------------------------------------------------------------------\n";
|
||||
alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
|
||||
alert(alertString2);
|
||||
}
|
||||
}
|
||||
function Dopop(link,i) {
|
||||
defaultvalue=document.forms[0].field_value[i].value;
|
||||
newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
function confirm_deletion(bibid,itemnum) {
|
||||
var is_confirmed = confirm(_('Are you sure you want to delete this item?'));
|
||||
if (is_confirmed) {
|
||||
window.location = "additem.pl?op=delitem&bibid="+bibid+"&itemnum="+itemnum;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|
Loading…
Reference in a new issue