From 1ab000909287e46fb2e0571b6916c0ff8fef5200 Mon Sep 17 00:00:00 2001 From: kados Date: Tue, 11 Jul 2006 13:00:30 +0000 Subject: [PATCH] syncing with rel_2_2 before rel_2_2 was broken (meaning that dev-week MARC editor works now) --- acqui.simple/addbiblio.pl | 12 ++- acqui.simple/additem.pl | 6 +- .../npl/en/acqui.simple/addbiblio.tmpl | 102 +++++++----------- 3 files changed, 46 insertions(+), 74 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index 32e093c0df..5302901553 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -25,7 +25,8 @@ use C4::Auth; use C4::Output; use C4::Interface::CGI::Output; use C4::Biblio; -use C4::Search; # also includes Biblio.pm, SearchMarc is used to FindDuplicate +use C4::SearchMarc; # also includes Biblio.pm, SearchMarc is used to FindDuplicate +use C4::Search; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p #use Smart::Comments; @@ -487,9 +488,10 @@ if ($op eq "addbiblio") { my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag); - #warn $xml; - my $record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour')); - #warn $record->as_formatted; + $xml =~ s/collection/record/g; + warn "BEFORE".$xml; + my $record=MARC::Record->new_from_xml($xml, 'UTF-8'); #,'UNIMARC'); #C4::Context->preference('TemplateEncoding'), C4::Context->preference('marcflavour')); + warn $record->as_formatted; #warn "IN ADDBIB"; # check for a duplicate my ($duplicatebiblionumber,$duplicatebibid,$duplicatetitle) = FindDuplicate($record) if ($op eq "addbiblio") && (!$is_a_modif); @@ -537,7 +539,7 @@ if ($op eq "addbiblio") { my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag); - my $record=MARC::Record->new_from_xml($xml, C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour')); + my $record=MARC::Record->new_from_xml($xml, 'UTF-8'); #C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour')); # adding an empty field my $field = MARC::Field->new("$addedfield",'','','$tagaddfield_subfield' => ""); $record->append_fields($field); diff --git a/acqui.simple/additem.pl b/acqui.simple/additem.pl index ef778bb0bd..df4caae9e3 100755 --- a/acqui.simple/additem.pl +++ b/acqui.simple/additem.pl @@ -261,16 +261,12 @@ foreach my $tag (sort keys %{$tagslib}) { (C4::Context->userenv->{flags} != 1) && ($value) && ($value ne C4::Context->userenv->{branch}) ; # print $input->redirect(".pl?bibid=$bibid") if ($test); # search for itemcallnumber if applicable -##Lc callnumbers expect 2 subfields like 050ab or 090ab . Modified to accept 2 subfields if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) { my $CNtag = substr(C4::Context->preference('itemcallnumber'),0,3); my $CNsubfield = substr(C4::Context->preference('itemcallnumber'),3,1); - my $CNsubfield2 = substr(C4::Context->preference('itemcallnumber'),4,1); my $temp = $record->field($CNtag); if ($temp) { - $value = ($temp->subfield($CNsubfield)).' '.($temp->subfield($CNsubfield2)); -#remove any trailing space incase one subfield is used - $value=~s/^\s+|\s+$//g; + $value = $temp->subfield($CNsubfield); } } if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { diff --git a/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl index dcce1df389..ad7e25d7eb 100644 --- a/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl @@ -98,57 +98,27 @@
- -

- "> - - "> - " class="flat"> - - - "> - - - ')">+ -

- -
- - - " onclick="unHideSubfield('subfield','label')"> - - - -
- - - - - - ')">+ - - "/> - " size="2" maxlength="1"/> - "/> - "/> - "/> -
-
+ +

+ "> + "> + " class="flat"> - + +"> + + ')">+ +

+ +
" onclick="unHideSubfield('subfield','label')">
+')">+ +"/> +" size="2" maxlength="1"/> +"/> +"/> +"/> +
@@ -408,7 +378,10 @@ function active(numlayer) } active(0); function Check(f) { - document.body.style.cursor ="wait"; +document.forms['f'].submit(); +} +function Check2(f) { + document.body.style.cursor ='wait'; // Scan for nonempty fields var field_is_nonempty_p = new Array(); for (i=0 ; i - var orginput = original.getElementsByTagName('input')[0]; - - var orginput = original.getElementsByTagName('input')[1]; - image = clone.getElementsByTagName('img')[0]; - image.setAttribute("onclick","upSubfield('" + index + index + "')"); - + image = clone.getElementsByTagName('img')[0]; + image.setAttribute("onclick","upSubfield('" + index + index + "')"); trigger = original.getElementsByTagName('a')[0]; if (trigger) { trigger.parentNode.removeChild(trigger); } + clonespan = clone.getElementsByTagName('span')[0]; + clonespan.setAttribute("id", "error"+index); clonetrigger = clone.getElementsByTagName('a')[0]; clonetrigger.setAttribute("onclick","cloneSubfield('" + index + index + "')"); clone.setAttribute("tabindex","1"); - orginput.value = ''; + var orginput = original.getElementsByTagName('input')[0]; +// orginput.value = ''; original.parentNode.insertBefore( clone, original.nextSibling); } -- 2.39.5