From c7a2ef33177f176b8c5a5c12da9586de77569af1 Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Fri, 7 Oct 2011 13:38:15 +0200 Subject: [PATCH] Bug 6982 - Don't show MARC tag documentation links for NORMARC Links to UNIMARC documentation were being shown when marcflavour = NORMARC. This patch hides the doc link functionality for NORMARC by hiding: 1. The checkbox for turning doc links on/off 2. The hyperlinked questionmarks This patch does not hide e.g. the JavaScript functions related to the doc link functionality, in order to make it easy to add doc links for NORMARC in the future (hopefully). The doc link functionality was passing a variable called MARC21 (based on the contents of the marcflavour syspref) to the template and testing the value of this to decide if MARC21 or UNIMARC doc links were to be shown. I have replaced this variable with he standard/full marcflavour syspref, in order to make it possible to test for more then two MARC dialects. To test: - Set the marcflavour syspref to MARC21, NORMARC and UNIMARC, one after the other. - Check that correct doc links are shown for MARC21 and UNIMARC on the cataloguing screen, and that no checkbox and no doc links are displayed for NORMARC. Signed-off-by: Katrin Fischer Works as described - thx for the great test plan! Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- cataloguing/addbiblio.pl | 8 ++------ .../prog/en/modules/cataloguing/addbiblio.tt | 13 +++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index ee0662a7c4..1a829897d2 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -1075,16 +1075,12 @@ elsif ( $op eq "delete" ) { } $template->param( title => $record->title() ) if ( $record ne "-1" ); -if (C4::Context->preference("marcflavour") eq "MARC21"){ - $template->param(MARC21 => 1); -} - - $template->param( popup => $mode, frameworkcode => $frameworkcode, itemtype => $frameworkcode, - borrowernumber => $loggedinuser + borrowernumber => $loggedinuser, + marcflavour => C4::Context->preference("marcflavour"), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 8155be15b5..65feefbec7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -78,9 +78,9 @@ function PopupZ3950() { } function PopupMARCFieldDoc(field, blocknumber) { - [% IF ( MARC21 ) %] + [% IF ( marcflavour == 'MARC21' ) %] _MARC21FieldDoc(field); - [% ELSE %] + [% ELSIF ( marcflavour == 'UNIMARC' ) %] _UNIMARCFieldDoc(field, blocknumber); [% END %] } @@ -664,10 +664,10 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
- -

[% IF ( biblionumber ) %]Editing [% title |html %] (Record Number [% biblionumber %])

[% ELSE %]Add MARC Record[% END %] +[% IF marcflavour != 'NORMARC' %]
Show MARC tag documentation links
+[% END %] [% UNLESS ( number ) %] @@ -825,8 +825,9 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? [% IF advancedMARCEditor %] [% innerloo.tag %] [% ELSE %] - [% innerloo.tag %] ? + [% innerloo.tag %] + [% IF marcflavour != 'NORMARC' %] ?[% END %] + [% END %] [% IF ( innerloo.fixedfield ) %] -- 2.39.5