View | Details | Raw Unified | Return to bug 17240
Collapse All | Expand All

(-)a/tools/batchMod.pl (-16 / +25 lines)
Lines 113-132 if ($op eq "action") { Link Here
113
    my $marcitem;
113
    my $marcitem;
114
114
115
    # Once the job is done
115
    # Once the job is done
116
    if ($completedJobID) {
116
    if ($completedJobID || !$runinbackground) {
117
	# If we have a reasonable amount of items, we display them
117
        # If we have a reasonable amount of items, we display them
118
    if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) {
118
        if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) {
119
	    $items_display_hashref=BuildItemsData(@itemnumbers);
119
            $items_display_hashref=BuildItemsData(@itemnumbers);
120
	} else {
120
        } else {
121
	    # Else, we only display the barcode
121
            # Else, we only display the barcode
122
	    my @simple_items_display = map {{ itemnumber => $_, barcode => (GetBarcodeFromItemnumber($_) or ""), biblionumber => (GetBiblionumberFromItemnumber($_) or "") }} @itemnumbers;
122
            my @simple_items_display = map{
123
	    $template->param("simple_items_display" => \@simple_items_display);
123
                {
124
	}
124
                    itemnumber   => $_,
125
                    barcode      => (GetBarcodeFromItemnumber($_) or ""),
126
                    biblionumber => (GetBiblionumberFromItemnumber($_) or "")
127
                }
128
            } @itemnumbers;
129
            $template->param("simple_items_display" => \@simple_items_display);
130
        }
131
    }
125
132
126
	# Setting the job as done
133
    if ($completedJobID) {
127
	my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID);
134
        # Setting the job as done
135
        my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID);
128
136
129
	# Calling the template
137
        # Calling the template
130
        add_saved_job_results_to_template($template, $completedJobID);
138
        add_saved_job_results_to_template($template, $completedJobID);
131
139
132
    } else {
140
    } else {
Lines 200-208 if ($op eq "action") { Link Here
200
                        }
208
                        }
201
                    };
209
                    };
202
                }
210
                }
211
                $modified_items++ if $modified;
212
                $modified_fields += $modified;
203
                if ( $runinbackground ) {
213
                if ( $runinbackground ) {
204
                    $modified_items++ if $modified;
205
                    $modified_fields += $modified;
206
                    $job->set({
214
                    $job->set({
207
                        modified_items  => $modified_items,
215
                        modified_items  => $modified_items,
208
                        modified_fields => $modified_fields,
216
                        modified_fields => $modified_fields,
Lines 507-513 if ($op eq "action") { Link Here
507
	deleted_items => $deleted_items,
515
	deleted_items => $deleted_items,
508
	delete_records => $del_records,
516
	delete_records => $del_records,
509
	deleted_records => $deleted_records,
517
	deleted_records => $deleted_records,
510
	not_deleted_loop => \@not_deleted 
518
	not_deleted_loop => \@not_deleted,
519
        modified_items => $modified_items,
520
        modified_fields => $modified_fields,
511
    );
521
    );
512
}
522
}
513
523
514
- 

Return to bug 17240