Lines 41-46
my $error = $input->param('error');
Link Here
|
41 |
my @itemnumbers = $input->param('itemnumber'); |
41 |
my @itemnumbers = $input->param('itemnumber'); |
42 |
my $op = $input->param('op'); |
42 |
my $op = $input->param('op'); |
43 |
my $del = $input->param('del'); |
43 |
my $del = $input->param('del'); |
|
|
44 |
my $del_records = $input->param('del_records'); |
44 |
my $completedJobID = $input->param('completedJobID'); |
45 |
my $completedJobID = $input->param('completedJobID'); |
45 |
my $runinbackground = $input->param('runinbackground'); |
46 |
my $runinbackground = $input->param('runinbackground'); |
46 |
|
47 |
|
Lines 76-83
my $items_display_hashref;
Link Here
|
76 |
my $frameworkcode=""; |
77 |
my $frameworkcode=""; |
77 |
my $tagslib = &GetMarcStructure(1,$frameworkcode); |
78 |
my $tagslib = &GetMarcStructure(1,$frameworkcode); |
78 |
|
79 |
|
79 |
my $deleted_items = 0; # Numbers of deleted items |
80 |
my $deleted_items = 0; # Number of deleted items |
80 |
my $not_deleted_items = 0; # Numbers of items that could not be deleted |
81 |
my $deleted_records = 0; # Number of deleted records ( with no items attached ) |
|
|
82 |
my $not_deleted_items = 0; # Number of items that could not be deleted |
81 |
my @not_deleted; # List of the itemnumbers that could not be deleted |
83 |
my @not_deleted; # List of the itemnumbers that could not be deleted |
82 |
|
84 |
|
83 |
my %cookies = parse CGI::Cookie($cookie); |
85 |
my %cookies = parse CGI::Cookie($cookie); |
Lines 156-162
if ($op eq "action") {
Link Here
|
156 |
foreach my $itemnumber(@itemnumbers){ |
158 |
foreach my $itemnumber(@itemnumbers){ |
157 |
|
159 |
|
158 |
$job->progress($i) if $runinbackground; |
160 |
$job->progress($i) if $runinbackground; |
159 |
my $itemdata=GetItem($itemnumber); |
161 |
my $itemdata = GetItem($itemnumber); |
160 |
if ($input->param("del")){ |
162 |
if ($input->param("del")){ |
161 |
my $return = DelItemCheck(C4::Context->dbh, $itemdata->{'biblionumber'}, $itemdata->{'itemnumber'}); |
163 |
my $return = DelItemCheck(C4::Context->dbh, $itemdata->{'biblionumber'}, $itemdata->{'itemnumber'}); |
162 |
if ($return == 1) { |
164 |
if ($return == 1) { |
Lines 171-185
if ($op eq "action") {
Link Here
|
171 |
$return => 1 |
173 |
$return => 1 |
172 |
}; |
174 |
}; |
173 |
} |
175 |
} |
|
|
176 |
|
177 |
# If there are no items left, delete the biblio |
178 |
if ( $del_records ) { |
179 |
my $itemscount = GetItemsCount($itemdata->{'biblionumber'}); |
180 |
if ( $itemscount == 0 ) { |
181 |
my $error = DelBiblio($itemdata->{'biblionumber'}); |
182 |
$deleted_records++ unless ( $error ); |
183 |
} |
184 |
} |
174 |
} else { |
185 |
} else { |
175 |
if ($values_to_modify || $values_to_blank) { |
186 |
if ($values_to_modify || $values_to_blank) { |
176 |
my $localmarcitem = Item2Marc($itemdata); |
187 |
my $localmarcitem = Item2Marc($itemdata); |
177 |
UpdateMarcWith( $marcitem, $localmarcitem ); |
188 |
UpdateMarcWith( $marcitem, $localmarcitem ); |
178 |
eval{ |
189 |
eval{ |
179 |
if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) { |
190 |
if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) { |
180 |
LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $item->{itemlost}; |
191 |
LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $item->{itemlost}; |
181 |
} |
192 |
} |
182 |
}; |
193 |
}; |
183 |
} |
194 |
} |
184 |
} |
195 |
} |
185 |
$i++; |
196 |
$i++; |
Lines 433-438
if ($op eq "action") {
Link Here
|
433 |
$template->param( |
444 |
$template->param( |
434 |
not_deleted_items => $not_deleted_items, |
445 |
not_deleted_items => $not_deleted_items, |
435 |
deleted_items => $deleted_items, |
446 |
deleted_items => $deleted_items, |
|
|
447 |
delete_records => $del_records, |
448 |
deleted_records => $deleted_records, |
436 |
not_deleted_loop => \@not_deleted |
449 |
not_deleted_loop => \@not_deleted |
437 |
); |
450 |
); |
438 |
} |
451 |
} |
439 |
- |
|
|