Bug 15503 - Fix adding multiple items in multiple biblios.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Benjamin Daeuber <bdaeuber@cityoffargo.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
9ada51e6b4
commit
78e539460f
|
|
@ -143,7 +143,9 @@ if ($op eq ""){
|
|||
my @sort2 = $input->multi_param('sort2');
|
||||
my $matcher_id = $input->param('matcher_id');
|
||||
my $active_currency = Koha::Acquisition::Currencies->get_active;
|
||||
my $biblio_count = 0;
|
||||
for my $biblio (@$biblios){
|
||||
$biblio_count++;
|
||||
# Check if this import_record_id was selected
|
||||
next if not grep { $_ eq $$biblio{import_record_id} } @import_record_id_selected;
|
||||
my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
|
||||
|
|
@ -197,19 +199,19 @@ if ($op eq ""){
|
|||
}
|
||||
|
||||
# Add items from MarcItemFieldsToOrder
|
||||
my @homebranches = $input->multi_param('homebranch');
|
||||
my @homebranches = $input->multi_param('homebranch_' . $biblio_count);
|
||||
my $count = scalar @homebranches;
|
||||
my @holdingbranches = $input->multi_param('holdingbranch');
|
||||
my @itypes = $input->multi_param('itype');
|
||||
my @nonpublic_notes = $input->multi_param('nonpublic_note');
|
||||
my @public_notes = $input->multi_param('public_note');
|
||||
my @locs = $input->multi_param('loc');
|
||||
my @ccodes = $input->multi_param('ccodes');
|
||||
my @notforloans = $input->multi_param('notforloans');
|
||||
my @uris = $input->multi_param('uri');
|
||||
my @copynos = $input->multi_param('copyno');
|
||||
my @budget_codes = $input->multi_param('budget_code');
|
||||
my @itemprices = $input->multi_param('itemprice');
|
||||
my @holdingbranches = $input->multi_param('holdingbranch_' . $biblio_count);
|
||||
my @itypes = $input->multi_param('itype_' . $biblio_count);
|
||||
my @nonpublic_notes = $input->multi_param('nonpublic_note_' . $biblio_count);
|
||||
my @public_notes = $input->multi_param('public_note_' . $biblio_count);
|
||||
my @locs = $input->multi_param('loc_' . $biblio_count);
|
||||
my @ccodes = $input->multi_param('ccodes_' . $biblio_count);
|
||||
my @notforloans = $input->multi_param('notforloans_' . $biblio_count);
|
||||
my @uris = $input->multi_param('uri_' . $biblio_count);
|
||||
my @copynos = $input->multi_param('copyno_' . $biblio_count);
|
||||
my @budget_codes = $input->multi_param('budget_code_' . $biblio_count);
|
||||
my @itemprices = $input->multi_param('itemprice_' . $biblio_count);
|
||||
my $itemcreation = 0;
|
||||
for (my $i = 0; $i < $count; $i++) {
|
||||
$itemcreation = 1;
|
||||
|
|
@ -457,7 +459,6 @@ sub import_biblios_list {
|
|||
return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/;
|
||||
my $biblios = GetImportRecordsRange($import_batch_id,'','',$batch->{import_status});
|
||||
my @list = ();
|
||||
my $item_id = 1;
|
||||
my $item_error = 0;
|
||||
|
||||
my $ccodes = GetKohaAuthorisedValues("items.ccode");
|
||||
|
|
@ -473,8 +474,10 @@ sub import_biblios_list {
|
|||
}
|
||||
|
||||
|
||||
|
||||
my $biblio_count = 0;
|
||||
foreach my $biblio (@$biblios) {
|
||||
my $item_id = 1;
|
||||
$biblio_count++;
|
||||
my $citation = $biblio->{'title'};
|
||||
$citation .= " $biblio->{'author'}" if $biblio->{'author'};
|
||||
$citation .= " (" if $biblio->{'issn'} or $biblio->{'isbn'};
|
||||
|
|
@ -536,6 +539,7 @@ sub import_biblios_list {
|
|||
|
||||
my %itemrecord = (
|
||||
'item_id' => $item_id++,
|
||||
'biblio_count' => $biblio_count,
|
||||
'homebranch' => $item_homebranch,
|
||||
'holdingbranch' => $item_holdingbranch,
|
||||
'itype' => $item_itype,
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@
|
|||
<legend>Item Record [% item.item_id %]</legend>
|
||||
<ol>
|
||||
<li>
|
||||
<label for="homebranch_item_[% item.item_id %]">homebranch</label><select id="homebranch_item_[% item.item_id %]" name="homebranch">
|
||||
<label for="homebranch_item_[% item.item_id %]">homebranch</label><select id="homebranch_item_[% item.item_id %]" name="homebranch_[% item.biblio_count %]">
|
||||
[% FOREACH branchloo IN branchloop %]
|
||||
[% IF ( branchloo.value ) == ( item.homebranch ) %]
|
||||
<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
|
||||
|
|
@ -331,7 +331,7 @@
|
|||
</select>
|
||||
</li>
|
||||
|
||||
<li><label for="holdingbranch_item_[% item.item_id %]">holdingbranch</label><select id="holdingbranch_item_[% item.item_id %]" name="holdingbranch">
|
||||
<li><label for="holdingbranch_item_[% item.item_id %]">holdingbranch</label><select id="holdingbranch_item_[% item.item_id %]" name="holdingbranch_[% item.biblio_count %]">
|
||||
[% FOREACH branchloo IN branchloop %]
|
||||
[% IF ( branchloo.value ) == ( item.holdingbranch ) %]
|
||||
<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
|
||||
|
|
@ -341,7 +341,7 @@
|
|||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
<li><label for="itype_item_[% item.item_id %]">itype</label><select id="itype_item_[% item.item_id %]" name="itype">
|
||||
<li><label for="itype_item_[% item.item_id %]">itype</label><select id="itype_item_[% item.item_id %]" name="itype_[% item.biblio_count %]">
|
||||
[% FOREACH itypeloo IN itypeloop %]
|
||||
[% IF ( itypeloo.value ) == ( item.itype ) %]
|
||||
<option value="[% itypeloo.itemtype %]" selected="selected">[% itypeloo.description |html %]</option>
|
||||
|
|
@ -352,9 +352,9 @@
|
|||
</select>
|
||||
</li>
|
||||
|
||||
<li><label for="nonpublic_note_item_[% item.item_id %]">nonpublic_note</label><input type="text" id="nonpublic_note_item_[% item.item_id %]" name="nonpublic_note" value="[% item.nonpublic_note %]"></li>
|
||||
<li><label for="public_note_item_[% item.item_id %]">public_note</label><input type="text" id="public_note_item_[% item.item_id %]" name="public_note" value="[% item.public_note %]"></li>
|
||||
<li><label for="loc_item_[% item.item_id %]">loc</label><select id="loc_item_[% item.item_id %]" name="loc">
|
||||
<li><label for="nonpublic_note_item_[% item.item_id %]">nonpublic_note</label><input type="text" id="nonpublic_note_item_[% item.item_id %]" name="nonpublic_note_[% item.biblio_count %]" value="[% item.nonpublic_note %]"></li>
|
||||
<li><label for="public_note_item_[% item.item_id %]">public_note</label><input type="text" id="public_note_item_[% item.item_id %]" name="public_note_[% item.biblio_count %]" value="[% item.public_note %]"></li>
|
||||
<li><label for="loc_item_[% item.item_id %]">loc</label><select id="loc_item_[% item.item_id %]" name="loc_[% item.biblio_count %]">
|
||||
<option value=""> </option>
|
||||
[% FOREACH locationloo IN locationloop %]
|
||||
[% IF ( locationloo.code ) == (item.loc) %]<option value="[% locationloo.code %]" selected="selected">[% locationloo.description %]</option>[% ELSE %]<option value="[% locationloo.code %]">[% locationloo.description %]</option>[% END %]
|
||||
|
|
@ -362,17 +362,17 @@
|
|||
</select>
|
||||
</li>
|
||||
|
||||
<li><label for="ccode_item_[% item.item_id %]">ccode</label><select id="ccode_item_[% item.item_id %]" name="ccode">
|
||||
<li><label for="ccode_item_[% item.item_id %]">ccode</label><select id="ccode_item_[% item.item_id %]" name="ccode_[% item.biblio_count %]">
|
||||
[% FOREACH ccodeloo IN ccodeloop %]
|
||||
[% IF ( ccodeloo.code ) == (item.ccode) %]<option value="[% ccodeloo.code %]" selected="selected">[% ccodeloo.description %]</option>[% ELSE %]<option value="[% ccodeloo.code %]">[% ccodeloo.description %]</option>[% END %]
|
||||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li><label for="notforloan_item_[% item.item_id %]">notforloan</label><input type="text" id="notforloan_item_[% item.item_id %]" name="notforloan" value="[% item.notforloan %]"></li>
|
||||
<li><label for="uri_item_[% item.item_id %]">uri</label><input type="text" id="uri_item_[% item.item_id %]" name="uri" 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" 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">
|
||||
<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="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 %]">
|
||||
<option value="">Select a fund</option>
|
||||
[% FOREACH budget_loo IN budget_loop %]
|
||||
[% IF ( budget_loo.b_code ) == ( item.budget_code ) %]<option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
|
||||
|
|
@ -381,7 +381,7 @@
|
|||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
<li><label for="price_item_[% item.item_id %]">price</label><input type="text" id="price_item_[% item.item_id %]" name="itemprice" value="[% item.itemprice %]"></li>
|
||||
<li><label for="price_item_[% item.item_id %]">price</label><input type="text" id="price_item_[% item.item_id %]" name="itemprice_[% item.biblio_count %]" value="[% item.itemprice %]"></li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
[% END %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue