@@ -, +, @@ --- catalogue/itemsearch.pl | 4 ++-- .../en/includes/catalogue/itemsearch_item.csv.inc | 5 +++++ .../en/includes/catalogue/itemsearch_item.json.inc | 3 +++ .../prog/en/modules/catalogue/itemsearch.tt | 20 ++++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) --- a/catalogue/itemsearch.pl +++ a/catalogue/itemsearch.pl @@ -63,7 +63,7 @@ if (defined $format and $format eq 'json') { push @f, $columns[$i]; push @c, 'and'; - if ( grep { $_ eq $columns[$i] } qw( ccode homebranch holdingbranch location itype notforloan itemlost ) ) { + if ( grep { $_ eq $columns[$i] } qw( ccode homebranch holdingbranch location itype notforloan itemlost onloan ) ) { push @q, "$word"; push @op, '='; } else { @@ -114,7 +114,7 @@ if (scalar keys %params > 0) { filters => [], }; - foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) { + foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn onloan)) { if (my @q = $cgi->multi_param($p)) { if ($q[0] ne '') { my $f = { --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc @@ -1,6 +1,7 @@ [%- USE raw -%] [%- USE Branches -%] [%- USE Koha -%] +[%- USE KohaDates -%] [%- USE ItemTypes -%] [%- USE AuthorisedValues -%] [%- SET biblio = item.biblio -%] @@ -35,3 +36,7 @@ "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | replace('"', '""') | $raw %]" [%- delimiter | $raw -%] "[% (item.issues || 0) | $raw %]" +[%- delimiter | $raw -%] +"[% IF item.onloan %]Checked out[% ELSIF item.withdrawn || item.damaged || item.notforloan || item.itemlost %]Not available[% ELSE %]Available[% END %]" +[%- delimiter | $raw -%] +"[% IF item.checkout %][% item.checkout.date_due | $KohaDates | $raw %][% ELSE %][% END %]" --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc @@ -1,5 +1,6 @@ [%- USE Branches -%] [%- USE Koha -%] +[%- USE KohaDates -%] [%- USE To -%] [%- USE ItemTypes -%] [%- USE AuthorisedValues -%] @@ -28,6 +29,8 @@ "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]", "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | html %]", "[% (item.issues || 0) | html %]", + "[% IF item.onloan %]Checked out[% ELSIF item.withdrawn || item.damaged || item.notforloan || item.itemlost %]Not available[% ELSE %]Available[% END %]", + "[% IF item.checkout %][% item.checkout.date_due | $KohaDates | html %][% ELSE %]Not checked out[% END %]", "[% FILTER escape_quotes ~%]