Bug 24279: (QA follow-up) Show values disabled with tooltips
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 23 Apr 2020 13:04:25 +0000 (09:04 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 27 Jul 2020 15:05:06 +0000 (17:05 +0200)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

cataloguing/additem.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt

index 9f37537..d4cee2e 100755 (executable)
@@ -171,11 +171,10 @@ sub generate_subfield_form {
             my %authorised_lib;
             # builds list, depending on authorised value...
             if ( $subfieldlib->{authorised_value} eq "LOST" ) {
-                  my $ClaimReturnedLostValue = C4::Context->preference('ClaimReturnedLostValue');
+                  $subfield_data{IS_LOST_AV} = 1;
                   push @authorised_values, qq{};
                   my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
                   for my $r ( @$av ) {
-                      next if $ClaimReturnedLostValue && $r->{authorised_value} eq $ClaimReturnedLostValue;
                       push @authorised_values, $r->{authorised_value};
                       $authorised_lib{$r->{authorised_value}} = $r->{lib};
                   }
index 5e639f7..62d0860 100644 (file)
@@ -79,7 +79,7 @@
                 [% IF ( ITEM_DAT.withdrawn ) %]Withdrawn[% END %]
             )[% END %]</h4>
 
-            <div class="rows">
+            <span class="rows">
             <ol class="bibliodetails">
             <li><span class="label">Current location:</span> [% Branches.GetName( ITEM_DAT.holdingbranch ) | html %]&nbsp;</li>
             <li><span class="label">Checkout status:</span>
                             <input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
                             <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" />
                             <input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
-                            <select name="itemlost" >
+                            <select name="itemlost">
                                 <option value="">Choose</option>
                                 [% FOREACH itemlostloo IN itemlostloop %]
-                                    [% NEXT IF ClaimReturnedLostValue && !ITEM_DAT.itemlost && itemlostloo.authorised_value == ClaimReturnedLostValue #Filter claims returned status from pulldown %]
-                                    [% IF itemlostloo.authorised_value == ITEM_DAT.itemlost %]
+                                    [% IF ClaimReturnedLostValue && !ITEM_DAT.itemlost && itemlostloo.authorised_value == ClaimReturnedLostValue #Filter claims returned status from pulldown %]
+                                        [% SET add_claims_returned_tip = itemlostloo.lib %]
+                                        <option value="[% itemlostloo.authorised_value | html %]" disabled="disabled">[% itemlostloo.lib | html %]</option>
+                                    [% ELSIF itemlostloo.authorised_value == ITEM_DAT.itemlost %]
                                         <option value="[% itemlostloo.authorised_value | html %]" selected="selected">[% itemlostloo.lib | html %]</option>
                                     [% ELSE %]
                                         <option value="[% itemlostloo.authorised_value | html %]">[% itemlostloo.lib | html %]</option>
                             <input type="hidden" name="withdrawn" value="[% ITEM_DAT.withdrawn | html %]" />
                             <input type="hidden" name="damaged" value="[% ITEM_DAT.damaged | html %]" />
 
+                            [% IF add_claims_returned_tip %]
+                                <i class="fa fa-question-circle" data-toggle="tooltip"
+                                   title="The value '[% add_claims_returned_tip | html %]' cannot be selected. Return claims must be processed from the patron details page."
+                                   data-placement="right"></i>
+                            [% END %]
+
                             [% IF ClaimReturnedLostValue && ITEM_DAT.itemlost == ClaimReturnedLostValue %]
                                 <input type="submit" name="submit" class="submit" value="Set status" disabled="disabled"/>
                                 <p class="help-block">Item has been claimed as returned.</p>
                             [% ELSE %]
                                 <input type="hidden" name="op" value="set_lost" />
-                                <input type="submit" name="submit" class="submit" value="Set status" /></form>
+                                <input type="submit" name="submit" class="submit" value="Set status" />
                             [% END %]
                         </form>
                     [% ELSE %]
     <script>
         var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
         browser.show();
+        $( document ).ready(function() {
+            $('[data-toggle="tooltip"]').tooltip();
+        });
     </script>
 [% END %]
 [% INCLUDE 'intranet-bottom.inc' %]
index 1674d43..38b22ae 100644 (file)
                         [% IF aval == mv.default %]
                         <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
                         [% ELSE %]
-                        <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
+                            [% IF ite.IS_LOST_AV && aval == Koha.Preference("ClaimReturnedLostValue") %]
+                                [% SET add_claims_returned_tip = mv.labels.$aval %]
+                                <option disabled="disabled" value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
+                            [%  ELSE %]
+                                <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
+                            [% END %]
                         [% END %]
                     [% END %]
                     </select>
+
+                    [% IF ite.IS_LOST_AV && add_claims_returned_tip %]
+                        &nbsp;
+                        <i class="fa fa-question-circle" data-toggle="tooltip"
+                           title="The value '[% add_claims_returned_tip | html %]' cannot be selected. Return claims must be processed from the patron details page."
+                           data-placement="right"></i>
+                    [% END %]
                 [% ELSIF ( mv.type == 'text_auth' ) %]
                     [% IF mv.readonly %]
                         <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />