From cf7fd5397482b520833869d73dfb7432c763b517 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 25 Oct 2005 12:36:21 +0000 Subject: [PATCH] * adding a feature to enable reordering of subfields in MARC editor (can be considered as a bug ? at least one of my libraries think that yes !) * as the MARC editor begins to be really heavy, i've also added a marc_hide systempref. It hides all marc features not requested by libraries that want MARC but not too much. It hides MARC tag & subfield code, reordering buttons as well as indicators. by default, hide_marc is off --- acqui.simple/addbiblio.pl | 6 +- .../default/en/acqui.simple/addbiblio.tmpl | 259 +++++++++++++----- updater/updatedatabase | 13 + 3 files changed, 206 insertions(+), 72 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index c4e0ebf88b..1e4adbb8d3 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -172,6 +172,7 @@ sub create_input () { $subfield_data{mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; $subfield_data{kohafield}=$tagslib->{$tag}->{$subfield}->{kohafield}; + $subfield_data{index} = $i; # it's an authorised field if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { $subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth); @@ -276,7 +277,7 @@ sub build_tabs ($$$$) { push (@loop_data, \%tag_data); } # If there is more than 1 field, add an empty hidden field as separator. - if ($#fields >=1) { + if ($#fields >=1 && $#loop_data >=0 && $loop_data[$#loop_data]->{'tag'} eq $tag) { my @subfields_data; my %tag_data; push(@subfields_data, &create_input('','','',$i,$tabloop,$record,$authorised_values_sth)); @@ -523,6 +524,7 @@ if ($op eq "addbiblio") { } $template->param( frameworkcode => $frameworkcode, - itemtype => $frameworkcode # HINT: if the library has itemtype = framework, itemtype is auto filled ! + itemtype => $frameworkcode, # HINT: if the library has itemtype = framework, itemtype is auto filled ! + hide_marc => C4::Context->preference('hide_marc'), ); output_html_with_http_headers $input, $cookie, $template->output; \ No newline at end of file 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 20ad5667d8..2b09a656f1 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl @@ -63,9 +63,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -74,14 +79,19 @@

"> - " size=2 maxlength=1> + " size="2" maxlength="1"> "> "> "> @@ -94,9 +104,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -105,14 +120,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -125,9 +145,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -136,14 +161,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -156,9 +186,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -167,14 +202,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -187,9 +227,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -198,14 +243,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -218,9 +268,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -229,14 +284,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -249,9 +309,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -260,14 +325,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -280,9 +350,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -291,14 +366,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -311,9 +391,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -322,14 +407,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -342,9 +432,14 @@

- "> - "> - + + + "> - + + "> + + ')">+ @@ -353,14 +448,19 @@

"> - "> + " size="2" maxlength="1"> "> "> "> @@ -527,6 +627,25 @@ function AddField(field) { document.forms['f'].addfield_field.value=field; document.f.submit(); } + +function upSubfield(index) { +// alert("UP "+index); + temp = document.forms['f'].field_value[index-1].value; + document.forms['f'].field_value[index-1].value=document.forms['f'].field_value[index].value; + document.forms['f'].field_value[index].value= temp; + temp = document.forms['f'].subfield[index-1].value; + document.forms['f'].subfield[index-1].value=document.forms['f'].subfield[index].value; + document.forms['f'].subfield[index].value = temp; + temp = document.forms['f'].mandatory[index-1].value; + document.forms['f'].mandatory[index-1].value=document.forms['f'].mandatory[index].value; + document.forms['f'].mandatory[index].value = temp; + temp = document.forms['f'].kohafield[index-1].value; + document.forms['f'].kohafield[index-1].value=document.forms['f'].kohafield[index].value; + document.forms['f'].kohafield[index].value = temp; +// temp = document.getElementById('error'+index).value = "XXX"; +// document.forms['f'].kohafield[index-1].value=document.forms['f'].kohafield[index].value; +// document.forms['f'].kohafield[index].value = temp; +} diff --git a/updater/updatedatabase b/updater/updatedatabase index ad9a11fa16..fca9eec074 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -915,6 +915,15 @@ my %tabledata = ( explanation => 'Disables Dictionary buttons if set to yes', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'hide_marc', + value => '0', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'hide marc specific datas like subfield code & indicators to library', + type => 'YesNo', + }, ], ); @@ -1511,6 +1520,10 @@ $sth->finish; exit; # $Log$ +# Revision 1.100.2.12 2005/10/25 12:36:21 tipaul +# * adding a feature to enable reordering of subfields in MARC editor (can be considered as a bug ? at least one of my libraries think that yes !) +# * as the MARC editor begins to be really heavy, i've also added a marc_hide systempref. It hides all marc features not requested by libraries that want MARC but not too much. It hides MARC tag & subfield code, reordering buttons as well as indicators. by default, hide_marc is off +# # Revision 1.100.2.11 2005/10/06 12:16:46 tipaul # removing a useless systempreference # -- 2.39.5