Bug 31742

Summary: Highlight logged-in library holdings on add/edit items screen (additem.pl)
Product: Koha Reporter: Jason Robb <jrobb>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, lauren_denny, lucas, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34940
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Jason Robb 2022-10-12 14:51:39 UTC
It would be helpful in a consortia setting where many different libraries are sharing a single record to make items owned by the logged-in library stand out in the table at additem.pl. Highlighting an item's home library if it matches logged-in library is an easy visual indicator.

I wrote some JS for this using the currentlibrary class added with bug 10902:

  var loggedBranch = $("#logged-in-info-full .logged-in-branch-name").text();
  var colIndex = $('#cat_additem th:contains("Home library")').index() + 1;
  
  $('#cat_additem tr td:nth-child(' + colIndex + ')').each(function () {
    if (this.textContent == loggedBranch) {
      $(this).wrapInner('<span class="currentlibrary"></span>');
    }
  });
Comment 1 Katrin Fischer 2022-11-14 22:14:06 UTC
I like the idea, this would be similar to how we highlight users of the logged-in library in patron search now.
Comment 2 Fridolin Somers 2023-09-27 21:24:45 UTC
> th:contains("Home library")
One must adapt this for translated templates right ?

One may use data-colname="homebranch"