@@ -, +, @@ --- cataloguing/addbiblio.pl | 1 + cataloguing/additem.pl | 2 ++ .../prog/en/modules/cataloguing/addbiblio.tt | 5 ++++- .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 8 ++++++-- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 9 +++++++++ 5 files changed, 22 insertions(+), 3 deletions(-) --- a/cataloguing/addbiblio.pl +++ a/cataloguing/addbiblio.pl @@ -227,6 +227,7 @@ sub build_authorized_values_list { name => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, default => $value, values => \@authorised_values, + not_in_av => ( ( grep { $_ eq $value } @authorised_values ) ? 0 : 1 ), labels => \%authorised_lib, ( ( grep { $_ eq $category } ( qw(branches itemtypes cn_source) ) ) ? () : ( category => $category ) ), }; --- a/cataloguing/additem.pl +++ a/cataloguing/additem.pl @@ -231,6 +231,7 @@ sub generate_subfield_form { id => $subfield_data{id}, maxlength => $subfield_data{maxlength}, value => $value, + not_in_av => ( ( grep { $_ eq $value } @authorised_values ) ? 0 : 1 ), ( ( grep { $_ eq $subfieldlib->{authorised_value}} ( qw(branches itemtypes cn_source) ) ) ? () : ( category => $subfieldlib->{authorised_value}) ), }; } @@ -241,6 +242,7 @@ sub generate_subfield_form { values => \@authorised_values, labels => \%authorised_lib, default => $value, + not_in_av => ( ( grep { $_ eq $value } @authorised_values ) ? 0 : 1 ), ( ( grep { $_ eq $subfieldlib->{authorised_value}} ( qw(branches itemtypes cn_source) ) ) ? () : ( category => $subfieldlib->{authorised_value}) ), }; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -843,7 +843,10 @@ [% ELSIF ( mv.type == 'textarea' ) %] [% ELSIF ( mv.type == 'select' ) %] - + [% IF mv.not_in_av %] + + [% END %] [% FOREACH aval IN mv.values %] [% IF aval == mv.default %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -151,9 +151,13 @@ [% ELSIF ( mv.type == 'select' ) %] [% IF ( mv.readonly ) %] - [% ELSE %] - + [% END %] + + [% IF mv.not_in_av %] + [% END %] [% FOREACH aval IN mv.values %] [% IF aval == mv.default %] --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -576,4 +576,13 @@ $(document).ready(function() { }); return false; }); + + var tooltip_msg = _("The selected value is not in the list of authorised values!"); + $("select[data-not_av='1']").each(function(){ + var li = $(this).parent(); + var tooltip = $(''); + $(tooltip).tooltip(); + $(li).append(tooltip); + }); + }); --