Skip to content

Commit

Permalink
fix: hide 'item was not checked in' warning
Browse files Browse the repository at this point in the history
  • Loading branch information
phette23 committed Oct 3, 2024
1 parent 0dbcda8 commit 43486fc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions admin-js/circ-returns.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ if (path.match('/cgi-bin/koha/circ/returns.pl')) {
$(function(){
// loop over each row in the checkin table
$('#checkedintable tr').each(function(){
var row = $(this)
var home = row.find('td.ci-homelibrary')
var holding = row.find('td.ci-holdinglibrary')
// compare home branch to branch where the item's being checked in
if (home.text() !== holding.text()) {
let row = $(this)

// 1 misleading warning when item that wasn't checked out is checked in
let duedate = row.find('td.ci-duedate')
if (duedate.find('.problem').text().toLowerCase().trim() === 'item was not checked in' &&
duedate.find('span').eq(1).text().toLowerCase().trim() === 'not checked out') {
duedate.find('.problem').hide()
}

// 2 extra warning for books that need to be returned to their home library
let home = row.find('td.ci-homelibrary')
let holding = row.find('td.ci-holdinglibrary')
if (home.text().trim() !== holding.text().trim()) {
// if they differ, show an alert with on-hover helper text
holding.addClass('error alert-error')
.css({'cursor': 'help', 'font-weight': 'bold'})
Expand Down

0 comments on commit 43486fc

Please sign in to comment.