Browse Source

Bug 10902: (follow-up) Account for singleBranchMode

This patch checks singleBranchMode before highlighting the current
branch in search results.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11.x
Owen Leonard 3 years ago
committed by Jonathan Druart
parent
commit
dd8e23d85c
  1. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc
  2. 12
      koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc
  3. 3
      koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt

2
koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc

@ -29,7 +29,7 @@
<td data-order="[% borrower.dateofbirth | html %]">[% INCLUDE 'patron-age.inc' patron = borrower %]</td>
<td>[% Categories.GetName( borrower.categorycode ) | html %]</td>
<td>
[% IF ( Branches.GetLoggedInBranchcode == borrower.branchcode ) %]
[% IF ( Branches.GetLoggedInBranchcode == borrower.branchcode && !singleBranchMode ) %]
<span class="currentlibrary">[% Branches.GetName( borrower.branchcode ) | html %]</span>
[% ELSE %]
[% Branches.GetName( borrower.branchcode ) | html %]

12
koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc

@ -105,7 +105,9 @@
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
+ ( item.country ? item.country.escapeHtml() : "" )
+ "</small></a>";
itemString += " <span class=\"ac-library\">" + item.branchname + "</span> " + "</a>";
[% UNLESS ( singleBranchMode ) %]
itemString += " <span class=\"ac-library\">" + item.branchname + "</span> " + "</a>";
[% END %]
return $( "<li></li>" )
.addClass( loggedInClass )
.data( "ui-autocomplete-item", item )
@ -156,9 +158,11 @@
+ ( item.city ? item.city.escapeHtml() : "" ) + " "
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
+ ( item.country ? item.country.escapeHtml() : "" ) + " "
+ "<span class=\"ac-library\">"
+ ( item.branchname ? item.branchname.escapeHtml() : "" )
+ "</span>"
[% UNLESS ( singleBranchMode ) %]
+ "<span class=\"ac-library\">"
+ ( item.branchname ? item.branchname.escapeHtml() : "" )
+ "</span>"
[% END %]
+ "</small>"
+ "</a>" )
.appendTo( ul );

3
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt

@ -217,6 +217,7 @@
[% Asset.js("lib/hc-sticky.js") | $raw %]
[% Asset.js("js/members-menu.js") | $raw %]
<script>
var singleBranchMode = '[% singleBranchMode | html %]';
$(document).ready(function() {
$('#merge-patrons').prop('disabled', true);
$('#memberresultst').on('change', 'input.selection', function() {
@ -467,7 +468,7 @@
{ 'mDataProp': 'dt_category' },
{
'mDataProp': function ( oObj ) {
if( oObj.dt_branch == "[% Branches.GetLoggedInBranchname | html %]" ){
if( !singleBranchMode && oObj.dt_branch == "[% Branches.GetLoggedInBranchname | html %]" ){
return "<span class=\"currentlibrary\">" + oObj.dt_branch + "</span>";
} else {
return oObj.dt_branch;

Loading…
Cancel
Save