[Koha] Can we combine OPAC Item Status and Due Date into one column

Indranil Das Gupta indradg at gmail.com
Thu May 14 00:12:11 NZST 2015


Hello,

On Wed, May 13, 2015 at 7:17 AM, Iming Chan <imingchan at yahoo.com.au> wrote:
<snipped>
> The Due Date which appears when the item status is at "Checked out" will be
> displayed like:
>
> Checked out (Due: 13/5/2015)

You could try putting in the following jquery into opacuserjs (i did
it on a koha 'master' instance)

$(document).ready(function(){
  $('tr .status:contains("Checked out")').each(function()
    {
      $(this).css('white-space', 'nowrap');
      var status = $(this);
      var datedue = status.next();
      status.html(status.html() + '(Due: ' + datedue.html() + ')');
      $('span', this).css('display', 'inline-block');
    });
  $('#item_datedue').hide();
  $('tr .date_due').hide();
});

Basically, this concats the contents of the two <td>s into one, while
adding a bit of formatting i.e. white-space: nowrap to the td and
having the two <span> elements displayed as inline-blocks. then hides
the item_datedue <th> and date_due <td>

hope this helps

-- 
Indranil Das Gupta

Phone : +91-98300-20971
Blog    : http://indradg.randomink.org/blog
IRC      : indradg on irc://irc.freenode.net
Twitter : indradg

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-
Please exchange editable Office documents only in ODF Format. No other
format is acceptable. Support Open Standards.

For a free editor supporting ODF, please visit LibreOffice -
http://www.documentfoundation.org


More information about the Koha mailing list