From c48da8131d0aad7b1680b3313fd0b83011ee5050 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 8 Jul 2008 12:12:01 -0500 Subject: [PATCH] bug 1909: add delete field/subfield button to MARC editor A button to delete (non-mandatory) subfields and fields is added to the bib and authority MARC editors. This button, which displays as a hypen or minus sign after the plus sign to clone a field, acts as follows: [1] When deleting a whole MARC field, if at least one other repeat of that field exists, deletes the field from the editor page. If the field to be deleted is the last instance of that tag, the contents of the field are cleared, not removed. This allows one to delete all 650 tags, then add a new one without having to reload the record in the editor. [2] When deleting a subfield, if at least one other repeat of that subfield and its tag occurs *anywhere else in the record, not necessarily in the same tag*, deletes the subfield. Otherwise, if the subfield is the last occurrence of that tag/subfield combination, clears the input form instead. Documentation note: new screenshots for MARC editor, plus description of the '-' button. Credit to MJ Ray for introducing the '-' button and the UnCloneField JavaScript function. Signed-off-by: Andrew Moore Signed-off-by: Joshua Ferraro --- authorities/authorities.pl | 2 + cataloguing/addbiblio.pl | 2 + .../intranet-tmpl/prog/en/css/addbiblio.css | 7 +- .../en/modules/authorities/authorities.tmpl | 94 +++++++++++++++--- .../en/modules/cataloguing/addbiblio.tmpl | 95 ++++++++++++++++--- 5 files changed, 170 insertions(+), 30 deletions(-) diff --git a/authorities/authorities.pl b/authorities/authorities.pl index cd2a2809d0..26da895ac3 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -426,6 +426,7 @@ sub build_tabs ($$$$$) { index => $index_tag, tag_lib => $tagslib->{$tag}->{lib}, repeatable => $tagslib->{$tag}->{repeatable}, + mandatory => $tagslib->{$tag}->{mandatory}, subfield_loop => \@subfields_data, fixedfield => ($tag < 10)?(1):(0), random => CreateKey, @@ -462,6 +463,7 @@ sub build_tabs ($$$$$) { index => $index_tag, tag_lib => $tagslib->{$tag}->{lib}, repeatable => $tagslib->{$tag}->{repeatable}, + mandatory => $tagslib->{$tag}->{mandatory}, indicator1 => $indicator1, indicator2 => $indicator2, subfield_loop => \@subfields_data, diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index b27b6fa96b..7713113b4a 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -657,6 +657,7 @@ sub build_tabs ($$$$$) { index => $index_tag, tag_lib => $tagslib->{$tag}->{lib}, repeatable => $tagslib->{$tag}->{repeatable}, + mandatory => $tagslib->{$tag}->{mandatory}, subfield_loop => \@subfields_data, fixedfield => $tag < 10?1:0, random => CreateKey, @@ -702,6 +703,7 @@ sub build_tabs ($$$$$) { index => $index_tag, tag_lib => $tagslib->{$tag}->{lib}, repeatable => $tagslib->{$tag}->{repeatable}, + mandatory => $tagslib->{$tag}->{mandatory}, indicator1 => $indicator1, indicator2 => $indicator2, subfield_loop => \@subfields_data, diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css index 9d8f9461ca..a102467184 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css @@ -6,7 +6,12 @@ float : left; } -a.buttonPlus { +.buttonPlus { + font-weight : bold; + text-decoration : none; +} + +.buttonMinus { font-weight : bold; text-decoration : none; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl index d6b13a9531..c8cf89bd8d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl @@ -6,8 +6,25 @@