my @list = ();
my $item_error = 0;
- my $ccodes = GetKohaAuthorisedValues("items.ccode");
- my $locations = GetKohaAuthorisedValues("items.location");
+ my $ccodes = { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' } ) };
+ my $locations = { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
+ my $notforloans = { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.notforloan' } ) };
# location list
my @locations;
foreach (sort keys %$locations) {
foreach (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) {
push @ccodes, { code => $_, description => $ccodes->{$_} };
}
-
+ my @notforloans;
+ foreach (sort {$notforloans->{$a} cmp $notforloans->{$b}} keys %$notforloans) {
+ push @notforloans, { code => $_, description => $notforloans->{$_} };
+ }
my $biblio_count = 0;
foreach my $biblio (@$biblios) {
locationloop => \@locations,
itypeloop => \@itypes,
ccodeloop => \@ccodes,
+ notforloanloop => \@notforloans,
);
batch_info($template, $batch);
}
</select>
</li>
- <li><label for="notforloan_item_[% item.item_id %]">notforloan</label><input type="text" id="notforloan_item_[% item.item_id %]" name="notforloan_[% item.biblio_count %]" value="[% item.notforloan %]"></li>
+ <li>
+ <label for="notforloan_item_[% item.item_id %]">notforloan</label><select id="notforloan_item_[% item.item_id %]" name="notforloan_[% item.biblio_count %]">
+ [% FOREACH n IN notforloanloop %]
+ [% IF n.code == item.notforloan %]
+ <option value="[% n.code %]" selected="selected">[% n.description %]</option>
+ [% ELSE %]
+ <option value="[% n.code %]">[% n.description %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
<li><label for="uri_item_[% item.item_id %]">uri</label><input type="text" id="uri_item_[% item.item_id %]" name="uri_[% item.biblio_count %]" value="[% item.uri %]"></li>
<li><label for="copyno_item_[% item.item_id %]">copyno</label><input type="text" id="copyno_item_[% item.item_id %]" name="copyno_[% item.biblio_count %]" value="[% item.copyno %]"></li>
<li><label for="budget_code_item_[% item.item_id %]">budget_code</label><select id="budget_code_item_[% item.item_id %]" name="budget_code_[% item.biblio_count %]">