From be269a6bcda05669628e0737db8f7026042b03d1 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 9 Feb 2018 12:18:10 +0100 Subject: [PATCH] Bug 14769: (Follow-up) Let blinddetail look at indicator values Content-Type: text/plain; charset=utf-8 If the indicators are not controlled, blinddetail should not overwrite what the user already entered. Very strictly seen, we could say that it is outside the scope. But it is strongly related. Signed-off-by: Marcel de Rooy Tested with 100 and 600 in the cataloging editor. For 100 the second indicator should not be overwritten. For 600 it should. Also tested "ind2:" which should blank ind2. --- authorities/blinddetail-biblio-search.pl | 10 ++++------ .../prog/en/modules/authorities/blinddetail-biblio-search.tt | 8 ++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl index 0146a66..13f5dc6 100755 --- a/authorities/blinddetail-biblio-search.pl +++ b/authorities/blinddetail-biblio-search.pl @@ -105,8 +105,8 @@ if ($authid) { push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship ); my $controlled_ind = $auth->controlled_indicators({ record => $record, biblio_tag => $tag_number }); - $indicator1 = $controlled_ind->{ind1} // q{}; - $indicator2 = $controlled_ind->{ind2} // q{}; + $indicator1 = $controlled_ind->{ind1}; + $indicator2 = $controlled_ind->{ind2}; if( defined $controlled_ind->{sub2} ) { my $v = $controlled_ind->{sub2}; push @subfield_loop, { marc_subfield => '2', marc_values => [ $v ] }; @@ -116,15 +116,13 @@ if ($authid) { $template->param( "clear" => 1 ); } -# Remove spaces in indicators -$indicator1 =~ s/\s//g; -$indicator2 =~ s/\s//g; - $template->param( authid => $authid ? $authid : "", index => $index, tagid => $tagid, + update_ind1 => defined($indicator1), indicator1 => $indicator1, + update_ind2 => defined($indicator2), indicator2 => $indicator2, SUBFIELD_LOOP => \@subfield_loop, tag_number => $tag_number, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt index f6ab158..abb0c66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt @@ -82,8 +82,12 @@ ); [% END %] var indicators = field_start.getElementsByClassName('indicator flat'); - indicators[0].value="[% indicator1 %]"; - indicators[1].value="[% indicator2 %]"; + [% IF update_ind1 %] + indicators[0].value="[% indicator1 %]"; + [% END %] + [% IF update_ind2 %] + indicators[1].value="[% indicator2 %]"; + [% END %] [% END %] // browse all its subfields (clear and $9) -- 2.1.4