From 73f362d75bf80d011817fe12792edb2ece5f12f6 Mon Sep 17 00:00:00 2001 From: kados Date: Tue, 11 Jul 2006 12:53:14 +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 | 32 +- .../npl/en/acqui.simple/addbiblio.tmpl | 480 ++++++++++++------ 2 files changed, 347 insertions(+), 165 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index 4759aa7afa..5302901553 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -26,6 +26,7 @@ use C4::Output; use C4::Interface::CGI::Output; use C4::Biblio; 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; @@ -225,7 +226,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}=" {$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">..."; + $subfield_data{marc_value}=" {$tag}->{$subfield}->{authtypecode}','subfield$tag$i')\">..."; # 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 @@ -264,10 +265,6 @@ sub build_tabs ($$$$) { my $authorised_values_sth = $dbh->prepare("select authorised_value,lib from authorised_values where category=? order by lib"); - - # in this array, we will push all the 10 tabs - # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP - my @BIG_LOOP; # loop through each tab 0 through 9 for (my $tabloop = 0; $tabloop <= 9; $tabloop++) { @@ -373,17 +370,8 @@ sub build_tabs ($$$$) { } } } - if ($#loop_data >=0) { - my %big_loop_line; - $big_loop_line{number}=$tabloop; - $big_loop_line{innerloop}=\@loop_data; - push @BIG_LOOP,\%big_loop_line; - } -# $template->param($tabloop."XX" =>\@loop_data); + $template->param($tabloop."XX" =>\@loop_data); } -# use Data::Dumper; -# warn "DUMP : ".Dumper(@BIG_LOOP); - $template->param(BIG_LOOP => \@BIG_LOOP); } @@ -499,13 +487,11 @@ if ($op eq "addbiblio") { # build indicator hash. my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); - if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1") { - $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,\@indicator,\@ind_tag); - } else { - my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag); - $record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour')); - } - #warn $record->as_formatted; + my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag); + $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); @@ -553,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/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl index b78609bbda..ad7e25d7eb 100644 --- a/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/npl/en/acqui.simple/addbiblio.tmpl @@ -24,117 +24,324 @@ - +
- - - ); return false;" id="link"> - - ); return false;" id="link"> - - + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 +
- - - - -
XX" id="XX" class="tab" style="visibility:hidden"> - -
XX" id="XX" class="tab" style="visibility:visible"> + +
+ +
+

Is this a duplicate of " onclick="openWindow('../MARCdetail.pl?bib=&popup=1', 'Duplicate biblio'; return false;)">?

+

You must either :

+ +
- - - -
-

Is this a duplicate of " onclick="openWindow('../MARCdetail.pl?bib=&popup=1', 'Duplicate biblio'; return false;)">?

-

You must either :

- -
- - - -
"> - -

- " /> - - "> - style="display:none;" name="indicator" size="2" maxlength="2" value="" class="flat" /> - - - style="display:none;" name="indicator" value="" /> - - - - - ')">+ -

- - - - " onclick="unHideSubfield('subfield','label')"> - - - -
-

- - - - - - ')">+ - - " /> - " size="2" maxlength="1" /> - " /> - " /> - " /> -

-
- -
- -
+ + +

+ "> + "> + style="display:none;" name="indicator" size="2" maxlength="2" value="" class="flat"> - + + style="display:none;" name="indicator" value=""> + + ')">+ +

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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