Lines 32-37
use C4::Reports;
Link Here
|
32 |
use C4::Members; |
32 |
use C4::Members; |
33 |
use Koha::AuthorisedValues; |
33 |
use Koha::AuthorisedValues; |
34 |
use Koha::DateUtils; |
34 |
use Koha::DateUtils; |
|
|
35 |
use Koha::ItemTypes; |
35 |
use Koha::Libraries; |
36 |
use Koha::Libraries; |
36 |
use Koha::Patron::Categories; |
37 |
use Koha::Patron::Categories; |
37 |
use List::MoreUtils qw/any/; |
38 |
use List::MoreUtils qw/any/; |
Lines 81-87
$sep = "\t" if ($sep eq 'tabulation');
Link Here
|
81 |
$template->param(do_it => $do_it, |
82 |
$template->param(do_it => $do_it, |
82 |
); |
83 |
); |
83 |
|
84 |
|
84 |
my $itemtypes = GetItemTypes(); |
|
|
85 |
my @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']}); |
85 |
my @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']}); |
86 |
|
86 |
|
87 |
my $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) }; |
87 |
my $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) }; |
Lines 137-147
my @values;
Link Here
|
137 |
my %labels; |
137 |
my %labels; |
138 |
my %select; |
138 |
my %select; |
139 |
|
139 |
|
140 |
# create itemtype arrayref for <select>. |
140 |
my $itemtypes = Koha::ItemTypes->search_with_localization; |
141 |
my @itemtypeloop; |
|
|
142 |
for my $itype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description}} keys(%$itemtypes)) { |
143 |
push @itemtypeloop, { code => $itype , description => $itemtypes->{$itype}->{translated_description} } ; |
144 |
} |
145 |
|
141 |
|
146 |
# location list |
142 |
# location list |
147 |
my @locations; |
143 |
my @locations; |
Lines 160-166
my $CGIsepChoice=GetDelimiterChoices;
Link Here
|
160 |
|
156 |
|
161 |
$template->param( |
157 |
$template->param( |
162 |
categoryloop => \@patron_categories, |
158 |
categoryloop => \@patron_categories, |
163 |
itemtypeloop => \@itemtypeloop, |
159 |
itemtypes => $itemtypes, |
164 |
locationloop => \@locations, |
160 |
locationloop => \@locations, |
165 |
ccodeloop => \@ccodes, |
161 |
ccodeloop => \@ccodes, |
166 |
hassort1=> $hassort1, |
162 |
hassort1=> $hassort1, |
Lines 332-344
sub display_value {
Link Here
|
332 |
my ( $crit, $value ) = @_; |
328 |
my ( $crit, $value ) = @_; |
333 |
my $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) }; |
329 |
my $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) }; |
334 |
my $ccodes = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ) }; |
330 |
my $ccodes = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ) }; |
335 |
my $itemtypes = GetItemTypes(); |
|
|
336 |
my $Bsort1 = GetAuthorisedValues("Bsort1"); |
331 |
my $Bsort1 = GetAuthorisedValues("Bsort1"); |
337 |
my $Bsort2 = GetAuthorisedValues("Bsort2"); |
332 |
my $Bsort2 = GetAuthorisedValues("Bsort2"); |
338 |
my $display_value = |
333 |
my $display_value = |
339 |
( $crit =~ /ccode/ ) ? $ccodes->{$value} |
334 |
( $crit =~ /ccode/ ) ? $ccodes->{$value} |
340 |
: ( $crit =~ /location/ ) ? $locations->{$value} |
335 |
: ( $crit =~ /location/ ) ? $locations->{$value} |
341 |
: ( $crit =~ /itemtype/ ) ? $itemtypes->{$value}->{description} |
336 |
: ( $crit =~ /itemtype/ ) ? Koha::ItemTypes->find( $value )->translated_description |
342 |
: ( $crit =~ /branch/ ) ? Koha::Libraries->find($value)->branchname |
337 |
: ( $crit =~ /branch/ ) ? Koha::Libraries->find($value)->branchname |
343 |
: ( $crit =~ /reservestatus/ ) ? reservestatushuman($value) |
338 |
: ( $crit =~ /reservestatus/ ) ? reservestatushuman($value) |
344 |
: $value; # default fallback |
339 |
: $value; # default fallback |