From 9995be1068aecfe30ce56e352da523c2c0ac0e82 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 5 Feb 2021 16:01:54 +1300 Subject: [PATCH] Bug 17748: [WIP] Not ready for testing --- 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(-) diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index f5f66fe349..de9988a116 100755 --- a/catalogue/itemsearch.pl +++ b/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 = { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc index 739c145cb5..4a343c6f2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc +++ b/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 %]" diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc index 1933950c07..06aa97d529 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc +++ b/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 ~%]
[%~ END %]" diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 919fad3188..e5c00b1cf9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -30,6 +30,7 @@ [%- CASE 'itemlost' %]Lost [%- CASE 'withdrawn' %]Withdrawn [%- CASE 'new_status' %]Is new + [%- CASE 'onloan' %]Checked out [%- END -%] [%- END -%] @@ -138,6 +139,17 @@ [% loc.label = loc.lib %] [% END %] +[% onloan = [ + { + value = '0', + label = 'Available', + }, + { + value = '1', + label = 'Checked out', + } +] %] + [%# Page starts here %] [% SET footerjs = 1 %] @@ -160,6 +172,7 @@

Item search

+

Go to advanced search

@@ -190,6 +203,7 @@ [% IF withdrawns.size %] [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %] [% END %] + [% INCLUDE form_field_select name="onloan" options = onloan empty_option = "All statuses" %]
[% INCLUDE form_field_select_text %] @@ -313,6 +327,8 @@ + ' ' + _("Lost status") + '' + ' ' + _("Withdrawn status") + '' + ' ' + _("Checkouts") + '' + + ' ' + _("Availability") + '' + + ' ' + _("Due date") + '' + ' ' + ' ' var table = '' @@ -469,6 +485,8 @@ { 'sName': 'itemlost' }, { 'sName': 'withdrawn' }, { 'sName': 'issues' }, + { 'sName': 'availability' }, + { 'sName': 'duedate' }, { 'sName': 'actions', 'bSortable': false } ], "sPaginationType": "full_numbers" @@ -515,6 +533,8 @@ null, [% END %] { 'type': 'text' }, + { 'type': 'text' }, + { 'type': 'text' }, null ] }); -- 2.11.0