From 25374613347d30b865e07ac562b394aa2259984a Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 20 Jun 2003 14:32:08 +0000 Subject: [PATCH] repetable field support. The 3 problem from yesterday are fixed : * cc the + to each tab (for instance, only in tab 0) * doing the french template * fixing an annoying bug : everything is stored in the same field : 200$a$b$c$a$b$c and not 200$a$b$c 200$a$b$c as expected. 100% FUNCTIONNAL (at least I expect !) IMPORTANT NOTE : ALL subfields from a field MUST be in the same tab. Otherwise, Koha can't magically find how to group subfields in case of repeted fields. I'll add a check in checkmarc immediatly. That's not a "bug" in Koha. That's mandatory because of MARC structure. --- acqui.simple/addbiblio.pl | 15 +- .../default/en/acqui.simple/addbiblio.tmpl | 430 ++++++++--------- .../default/fr/acqui.simple/addbiblio.tmpl | 435 +++++++++--------- 3 files changed, 469 insertions(+), 411 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index 2f72b2c6c3..665ff6dfd5 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -179,6 +179,8 @@ sub create_input () { 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}=" ... $javascript"; + } elsif ($tag eq '') { + $subfield_data{marc_value}=""; #" } else { $subfield_data{marc_value}=""; #" } @@ -200,7 +202,6 @@ sub build_tabs ($$$$) { for (my $tabloop = 0; $tabloop <= 9; $tabloop++) { my @loop_data = (); foreach my $tag (sort(keys (%{$tagslib}))) { - my $previous_tag = ''; my $indicator; # if MARC::Record is not empty => use it as master loop, then add missing subfields that should be in the tab. # if MARC::Record is empty => use tab as master loop. @@ -240,6 +241,18 @@ sub build_tabs ($$$$) { $tag_data{subfield_loop} = \@subfields_data; push (@loop_data, \%tag_data); } +# If there is more than 1 field, add an empty hidden field as separator. + if ($#fields >=1) { + my @subfields_data; + my %tag_data; + push(@subfields_data, &create_input('','','',$i,$tabloop,$record,$authorised_values_sth)); + $tag_data{tag} = ''; + $tag_data{tag_lib} = ''; + $tag_data{indicator} = ''; + $tag_data{subfield_loop} = \@subfields_data; + push (@loop_data, \%tag_data); + $i++; + } } # if breeding is empty } else { diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl index c628ec35ea..dc9d040f66 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl @@ -40,232 +40,252 @@
- /images/background-mem.gif"> - - - - - - - - + + /images/background-mem.gif"> + + + + + + + + +
">"> - )">+
  * - - "> - "> - "> - "> - "> -
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+ + + + + /images/background-mem.gif"> + + + + + + + + + + +
">"> - )">+
  * + + "> + "> + "> + "> + "> +
+