From 38685bdf906dd14cb5eaa3bb1db65b004e01d556 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Fri, 19 Oct 2007 21:00:35 +0200 Subject: [PATCH] Bug Fixing : Adding item had a javascript Error. So. There are no more errors on saving an item. There are still little problems when you duplicate a subfield : Display table is not adapted When you reedit, all the duplicate field values are concatenated. But apart from that, it works. Donot have time enough to work on it these days. Signed-off-by: Joshua Ferraro --- cataloguing/additem.pl | 19 +++++++++++-------- .../prog/en/modules/cataloguing/additem.tmpl | 18 +++++++++++------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index e99d0ce317..3d32130e09 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -60,7 +60,7 @@ my $dbh = C4::Context->dbh; my $error = $input->param('error'); my $biblionumber = $input->param('biblionumber'); my $itemnumber = $input->param('itemnumber'); - +warn Data::Dumper::Dumper($input->param()); my $op = $input->param('op'); # find itemtype @@ -142,6 +142,9 @@ if ($op eq "additem") { # build indicator hash. my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); + warn "tags :@tags" ; + warn "subfields :@subfields" ; + warn "values :@values" ; # my $itemnumber = $input->param('itemnumber'); my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag,'ITEM'); my $itemrecord=MARC::Record::new_from_xml($xml, 'UTF-8'); @@ -346,7 +349,7 @@ foreach my $tag (sort keys %{$tagslib}) { } } $subfield_data{marc_value} =CGI::scrolling_list( - -name => "tag_".$tag."_subfield_".$subfield."_".$index_subfield, + -name => "field_value", -values => \@authorised_values, -default => $value, -labels => \%authorised_lib, @@ -363,7 +366,7 @@ foreach my $tag (sort keys %{$tagslib}) { $subfield_data{marc_value} = " @@ -419,7 +422,7 @@ foreach my $tag (sort keys %{$tagslib}) { $subfield_data{marc_value} = " var clone = original.cloneNode(true); var new_key = CreateKey(); - var new_id = original.getAttribute('id')+new_key; + var old_id = original.getAttribute('id'); + old_id=old_id.substr(12); + var new_id = old_id+new_key; // set the attribute for the new 'div' subfields var inputs = clone.getElementsByTagName('input'); @@ -68,21 +70,21 @@ function CloneSubfield(index){ for(var i=0,len=inputs.length; i @@ -138,9 +140,6 @@ function CreateKey(){

Items for by (Record #)

-
- " /> - " />

Existing items

@@ -165,6 +164,9 @@ function CreateKey(){
+ + " /> + " />

Add Item

@@ -184,6 +186,8 @@ function CreateKey(){
+ + " /> ERROR : Barcode already exists ! -- 2.39.5