Bug 24279: Display the tip in the title of the option

This patch tells select2 to retrieve the title attribute from the
original option node.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2020-05-07 12:33:17 +02:00
parent 2a57e3d3db
commit f8e73978a2
3 changed files with 5 additions and 20 deletions

View file

@ -42,6 +42,9 @@
var n = input.length - max;
return _("Please delete %d character(s)").format(n);
},
formatResult: function(item) {
return $('<div>', {title: item.element[0].title}).text(item.text);
},
formatSelectionTooBig: function (limit) {
return _("You can only select %s item(s)").format(limit);
},

View file

@ -108,8 +108,7 @@
<option value="">Choose</option>
[% FOREACH itemlostloo IN itemlostloop %]
[% 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>
<option value="[% itemlostloo.authorised_value | html %]" disabled="disabled" title="At least one item is available at this library">[% itemlostloo.lib | html %]</option>
[% ELSIF itemlostloo.authorised_value == ITEM_DAT.itemlost %]
<option value="[% itemlostloo.authorised_value | html %]" selected="selected">[% itemlostloo.lib | html %]</option>
[% ELSE %]
@ -120,12 +119,6 @@
<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>
@ -312,9 +305,6 @@
<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' %]

View file

@ -167,21 +167,13 @@
<option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
[% ELSE %]
[% 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>
<option disabled="disabled" value="[%- aval | html -%]" title="Return claims must be processed from the patron details page">[%- 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" />