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

(-)a/tools/batchMod.pl (-22 / +31 lines)
Lines 112-135 if ($op eq "action") { Link Here
112
    my $values_to_blank  = scalar(@disabled);
112
    my $values_to_blank  = scalar(@disabled);
113
    my $marcitem;
113
    my $marcitem;
114
114
115
    # Once the job is done
115
    if ( !$completedJobID || !$runinbackground ) {
116
    if ($completedJobID) {
117
	# If we have a reasonable amount of items, we display them
118
    if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) {
119
	    $items_display_hashref=BuildItemsData(@itemnumbers);
120
	} else {
121
	    # Else, we only display the barcode
122
	    my @simple_items_display = map {{ itemnumber => $_, barcode => (GetBarcodeFromItemnumber($_) or ""), biblionumber => (GetBiblionumberFromItemnumber($_) or "") }} @itemnumbers;
123
	    $template->param("simple_items_display" => \@simple_items_display);
124
	}
125
126
	# Setting the job as done
127
	my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID);
128
129
	# Calling the template
130
        add_saved_job_results_to_template($template, $completedJobID);
131
132
    } else {
133
    # While the job is getting done
116
    # While the job is getting done
134
117
135
	# Job size is the number of items we have to process
118
	# Job size is the number of items we have to process
Lines 200-208 if ($op eq "action") { Link Here
200
                        }
183
                        }
201
                    };
184
                    };
202
                }
185
                }
186
                $modified_items++ if $modified;
187
                $modified_fields += $modified;
203
                if ( $runinbackground ) {
188
                if ( $runinbackground ) {
204
                    $modified_items++ if $modified;
205
                    $modified_fields += $modified;
206
                    $job->set({
189
                    $job->set({
207
                        modified_items  => $modified_items,
190
                        modified_items  => $modified_items,
208
                        modified_fields => $modified_fields,
191
                        modified_fields => $modified_fields,
Lines 213-218 if ($op eq "action") { Link Here
213
		$i++;
196
		$i++;
214
	}
197
	}
215
    }
198
    }
199
    if ( $completedJobID || !$runinbackground ) {
200
        # Once the job is done
201
        # If we have a reasonable amount of items, we display them
202
        if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) {
203
            $items_display_hashref=BuildItemsData(@itemnumbers);
204
        } else {
205
            # Else, we only display the barcode
206
            my @simple_items_display = map{
207
                {
208
                    itemnumber   => $_,
209
                    barcode      => (GetBarcodeFromItemnumber($_) or ""),
210
                    biblionumber => (GetBiblionumberFromItemnumber($_) or "")
211
                }
212
            } @itemnumbers;
213
            $template->param("simple_items_display" => \@simple_items_display);
214
        }
215
216
        if ($runinbackground) {
217
            # Setting the job as done
218
            my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID);
219
220
            # Calling the template
221
            add_saved_job_results_to_template($template, $completedJobID);
222
        }
223
    }
216
}
224
}
217
#
225
#
218
#-------------------------------------------------------------------------------
226
#-------------------------------------------------------------------------------
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