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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (-2 / +36 lines)
Lines 245-263 Link Here
245
                            </form> <!-- /#process -->
245
                            </form> <!-- /#process -->
246
                        [% ELSE %]
246
                        [% ELSE %]
247
                            <div class="dialog message">
247
                            <div class="dialog message">
248
                                No records were modified. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
248
                                No records were modified. [% IF recordtype != 'biblio' %]<a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>[% END %]
249
                            </div>
249
                            </div>
250
                        [% END %]
250
                        [% END %]
251
                    [% ELSIF view == 'report' %]
251
                    [% ELSIF view == 'report' %]
252
                        [% IF report.total_records == report.total_success %]
252
                        [% IF report.total_records == report.total_success %]
253
                            <div class="dialog message">
253
                            <div class="dialog message">
254
                                All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
254
                                All records have successfully been modified! [% IF recordtype != 'biblio' %]<a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>[% END %]
255
                            </div>
255
                            </div>
256
                        [% ELSE %]
256
                        [% ELSE %]
257
                            <div class="dialog message">
257
                            <div class="dialog message">
258
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
258
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
259
                            </div>
259
                            </div>
260
                        [% END %]
260
                        [% END %]
261
262
                        [% IF recordtype == 'biblio' %]
263
                            <h3>Next steps</h3>
264
                            <ul>
265
                                <li><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
266
                                [% IF lists.count %]
267
                                <li>
268
                                    <label for="add_bibs_to_list">Add modified records to the following list: </label>
269
                                    <select name="add_bibs_to_list" id="add_bibs_to_list">
270
                                        <option value="">Select a list</option>
271
                                        [% FOREACH list IN lists %]
272
                                            <option class="shelf" value="[% list.shelfnumber %]">[% list.shelfname %]</option>
273
                                        [% END %]
274
                                    </select>
275
                                </li>
276
                                [% END %]
277
                            </ul>
278
                        [% END %]
261
                    [% ELSIF view == 'errors' %]
279
                    [% ELSIF view == 'errors' %]
262
                        [% FOR error IN errors %]
280
                        [% FOR error IN errors %]
263
                            [% IF error == 'no_template_defined' %]
281
                            [% IF error == 'no_template_defined' %]
Lines 376-381 Link Here
376
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
394
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
377
            });
395
            });
378
396
397
            $("#add_bibs_to_list").change(function(){
398
                var selected = $("#add_bibs_to_list").find("option:selected");
399
                if ( selected.attr("class") == "shelf" ){
400
                    var shelfnumber = selected.attr("value");
401
                    var bibs = new Array();
402
                    [% FOREACH message IN messages %]
403
                        [% IF message.code == 'biblio_modified' %]
404
                            bibs.push("biblionumber="+[% message.biblionumber %]);
405
                        [% END %]
406
                    [% END %]
407
                    var bibstring = bibs.join("&");
408
                    window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
409
                    return false;
410
                }
411
            });
412
379
        });
413
        });
380
    </script>
414
    </script>
381
[% END %]
415
[% END %]
(-)a/tools/batch_record_modification.pl (-3 / +2 lines)
Lines 50-55 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
50
        flagsrequired => { tools => 'records_batchmod' },
50
        flagsrequired => { tools => 'records_batchmod' },
51
});
51
});
52
52
53
$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) );
53
54
54
my $sessionID = $input->cookie("CGISESSID");
55
my $sessionID = $input->cookie("CGISESSID");
55
56
Lines 63-76 if ( $completedJobID ) { Link Here
63
        report => $report,
64
        report => $report,
64
        messages => $messages,
65
        messages => $messages,
65
        view => 'report',
66
        view => 'report',
67
        recordtype => $recordtype,
66
    );
68
    );
67
    output_html_with_http_headers $input, $cookie, $template->output;
69
    output_html_with_http_headers $input, $cookie, $template->output;
68
    $job->clear();
70
    $job->clear();
69
    exit;
71
    exit;
70
}
72
}
71
73
72
$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) );
73
74
my @templates = GetModificationTemplates( $mmtid );
74
my @templates = GetModificationTemplates( $mmtid );
75
unless ( @templates ) {
75
unless ( @templates ) {
76
    $op = 'error';
76
    $op = 'error';
77
- 

Return to bug 18127