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

(-)a/admin/background_jobs.pl (-1 / +3 lines)
Lines 24-31 use C4::Context; Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
26
27
use Koha::BackgroundJob;
28
use Koha::BackgroundJobs;
27
use Koha::BackgroundJobs;
28
use Koha::Virtualshelves;
29
29
30
my $input             = new CGI;
30
my $input             = new CGI;
31
my $op                = $input->param('op') || 'list';
31
my $op                = $input->param('op') || 'list';
Lines 50-55 if ( $op eq 'view' ) { Link Here
50
        $template->param(
50
        $template->param(
51
            job       => $job,
51
            job       => $job,
52
        );
52
        );
53
        $template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) )
54
            if $job->type eq 'batch_biblio_record_modification';
53
    } else {
55
    } else {
54
        $op = 'list';
56
        $op = 'list';
55
    }
57
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt (-15 / +26 lines)
Lines 51-56 Link Here
51
                        [% IF report.total_records == report.total_success %]
51
                        [% IF report.total_records == report.total_success %]
52
                            <div class="dialog message">
52
                            <div class="dialog message">
53
                                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>
53
                                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>
54
                                [% IF lists.count %]
55
                                    <br />
56
                                    Add modified records to the following list:
57
                                    <select name="add_bibs_to_list" id="add_bibs_to_list">
58
                                        <option value="">Select a list</option>
59
                                        [% FOREACH list IN lists %]
60
                                            <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
61
                                        [% END %]
62
                                    </select>
63
                                [% END %]
54
                            </div>
64
                            </div>
55
                        [% ELSE %]
65
                        [% ELSE %]
56
                            <div class="dialog message">
66
                            <div class="dialog message">
Lines 95-115 Link Here
95
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error %])[% END %].
105
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error %])[% END %].
96
                            [% CASE 'biblio_modified' %]
106
                            [% CASE 'biblio_modified' %]
97
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
107
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
98
                                <h3>Next steps</h3>
99
                                <ul>
100
                                    <li><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
101
                                    [% IF lists.count %]
102
                                    <li>
103
                                        <label for="add_bibs_to_list">Add modified records to the following list: </label>
104
                                        <select name="add_bibs_to_list" id="add_bibs_to_list">
105
                                            <option value="">Select a list</option>
106
                                            [% FOREACH list IN lists %]
107
                                                <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
108
                                            [% END %]
109
                                        </select>
110
                                    </li>
111
                                    [% END %]
112
                                </ul>
113
                            [% END %]
108
                            [% END %]
114
                        </div>
109
                        </div>
115
                    [% END %]
110
                    [% END %]
Lines 224-229 Link Here
224
                "iDisplayLength": 10,
219
                "iDisplayLength": 10,
225
                "sPaginationType": "full_numbers"
220
                "sPaginationType": "full_numbers"
226
            }));
221
            }));
222
223
            $("#add_bibs_to_list").change(function(){
224
                var selected = $("#add_bibs_to_list").find("option:selected");
225
                if ( selected.attr("class") == "shelf" ){
226
                    var shelfnumber = selected.attr("value");
227
                    var bibs = new Array();
228
                    [% FOREACH message IN job.messages %]
229
                        [% IF message.code == 'biblio_modified' %]
230
                            bibs.push("biblionumber="+[% message.biblionumber | html %]);
231
                        [% END %]
232
                    [% END %]
233
                    var bibstring = bibs.join("&");
234
                    window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
235
                    return false;
236
                }
237
            });
227
        });
238
        });
228
    </script>
239
    </script>
229
[% END %]
240
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (-17 lines)
Lines 363-385 Link Here
363
                $("#marcPreviewLabel").html("");
363
                $("#marcPreviewLabel").html("");
364
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
364
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
365
            });
365
            });
366
367
            $("#add_bibs_to_list").change(function(){
368
                var selected = $("#add_bibs_to_list").find("option:selected");
369
                if ( selected.attr("class") == "shelf" ){
370
                    var shelfnumber = selected.attr("value");
371
                    var bibs = new Array();
372
                    [% FOREACH message IN messages %]
373
                        [% IF message.code == 'biblio_modified' %]
374
                            bibs.push("biblionumber="+[% message.biblionumber | html %]);
375
                        [% END %]
376
                    [% END %]
377
                    var bibstring = bibs.join("&");
378
                    window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
379
                    return false;
380
                }
381
            });
382
383
        });
366
        });
384
    </script>
367
    </script>
385
[% END %]
368
[% END %]
(-)a/tools/batch_record_modification.pl (-3 lines)
Lines 53-60 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
53
        flagsrequired => { tools => 'records_batchmod' },
53
        flagsrequired => { tools => 'records_batchmod' },
54
});
54
});
55
55
56
$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) );
57
58
my $sessionID = $input->cookie("CGISESSID");
56
my $sessionID = $input->cookie("CGISESSID");
59
57
60
my @templates = GetModificationTemplates( $mmtid );
58
my @templates = GetModificationTemplates( $mmtid );
61
- 

Return to bug 22417