];
}
+sub GetDescriptionsByKohaField {
+ my ( $self, $params ) = @_;
+ return Koha::AuthorisedValues->get_descriptions_by_koha_field(
+ { kohafield => $params->{kohafield} } );
+}
+
+sub GetDescriptionByKohaField {
+ my ( $self, $params ) = @_;
+ my $av = Koha::AuthorisedValues->get_description_by_koha_field(
+ {
+ kohafield => $params->{kohafield},
+ authorised_value => $params->{authorised_value},
+ }
+ );
+ return %$av
+ ? $params->{opac}
+ ? $av->{opac_description}
+ : $av->{lib}
+ : ''; # Maybe we should return $params->{authorised_value}?
+
+}
+
1;
=head1 NAME
The parameters are identical to those used by the subroutine C4::Koha::GetAuthValueDropbox
+=head2 GetDescriptionsByKohaField
+
+The parameters are identical to those used by the subroutine Koha::AuthorisedValues->get_descriptions_by_koha_field
+
+=head2 GetDescriptionByKohaField
+
+The parameters are identical to those used by the subroutine Koha::AuthorisedValues->get_description_by_koha_field
+
=head1 AUTHOR
Kyle M Hall <kyle@bywatersolutions.com>
<th>Item type</th>
<th>Current location</th>
<th>Location</th>
+ <th>Not for loan status</th>
<th>Notes</th>
</tr>
</thead>
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
</td>
<td>[% item.biblio.author %]</td>
- <td>[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) %]</td>
+ <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
<td>
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
</td>
<td>[% item.effective_itemtype %]</td>
<td>[% Branches.GetName(item.holdingbranch) %]</td>
<td>[% item.location %]</td>
+ <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
<td>[% item.itemnotes %]</td>
</tr>
[% END %]
[% END %]
</select></li>
- <li><label for="loststatusfilter">Lost status: </label><select name="loststatusfilter" id="loststatusfilter">
- <option value="">All</option>
- [% FOREACH loststatusloo IN loststatusloop %]
- [% IF ( loststatusloo.selected ) %]<option value="[% loststatusloo.authorised_value %]" selected="selected">[% loststatusloo.lib %]</option>
- [% ELSE %]
- <option value="[% loststatusloo.authorised_value %]">[% loststatusloo.lib %]</option>
- [% END %]
+ <li>
+ <label for="loststatusfilter">Lost status: </label>
+ <select name="loststatusfilter" id="loststatusfilter">
+ <option value="">All</option>
+ [% FOREACH l IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.itemlost') %]
+ [% IF l.authorised_value == lostfilter %]
+ <option value="[% l.authorised_value %]" selected="selected">[% l.lib %]</option>
+ [% ELSE %]
+ <option value="[% l.authorised_value %]">[% l.lib %]</option>
[% END %]
- </select></li>
+ [% END %]
+ </select>
+ </li>
+
+ <li>
+ <label for="notforloanfilter">Not for loan: </label>
+ <select name="notforloanfilter" id="notforloanfilter">
+ <option value="">All</option>
+ [% FOREACH n IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.notforloan') %]
+ [% IF n.authorised_value == notforloanfilter %]
+ <option value="[% n.authorised_value %]" selected="selected">[% n.lib %]</option>
+ [% ELSE %]
+ <option value="[% n.authorised_value %]">[% n.lib %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+
</ol></fieldset>
<fieldset class="action"> <input type="submit" value="Submit" />
<input type="hidden" name="get_items" value="1" /></fieldset>
use C4::Output;
use C4::Biblio;
use C4::Items;
+
+use Koha::AuthorisedValues;
use Koha::DateUtils;
my $query = new CGI;
my $barcodefilter = $params->{'barcodefilter'} || undef;
my $itemtypesfilter = $params->{'itemtypesfilter'} || undef;
my $loststatusfilter = $params->{'loststatusfilter'} || undef;
+ my $notforloanfilter = $params->{'notforloanfilter'} || undef;
my $params = {
( $branchfilter ? ( homebranch => $branchfilter ) : () ),
? ( itemlost => $loststatusfilter )
: ( itemlost => { '!=' => 0 } )
),
+ (
+ $notforloanfilter
+ ? ( notforloan => $notforloanfilter )
+ : ()
+ ),
( $barcodefilter ? ( barcode => { like => "%$barcodefilter%" } ) : () ),
};
# getting all itemtypes
my $itemtypes = Koha::ItemTypes->search_with_localization;
-# get lost statuses
-my $lost_status_loop = C4::Koha::GetAuthorisedValues( 'LOST' );
-
$template->param(
- itemtypes => $itemtypes,
- loststatusloop => $lost_status_loop,
+ itemtypes => $itemtypes,
);
# writing the template