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 (-6 / +41 lines)
Lines 8-13 Link Here
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
9
<script type="text/javascript">
9
<script type="text/javascript">
10
//<![CDATA[
10
//<![CDATA[
11
function Dopop(link) {
12
    newin=window.open(link,'popup','width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
13
}
14
11
$(document).ready(function() {
15
$(document).ready(function() {
12
  $("input[type='radio']").click(function(){
16
  $("input[type='radio']").click(function(){
13
    if ($(this).attr('id') == 'authority_type') {
17
    if ($(this).attr('id') == 'authority_type') {
Lines 16-21 $(document).ready(function() { Link Here
16
      $("#shelves").show();
20
      $("#shelves").show();
17
    }
21
    }
18
  });
22
  });
23
  $("#add_bibs_to_list").change(function(){
24
    if($("#add_bibs_to_list").find("option:selected").attr("class") == "shelf"){
25
      var shelfnumber = $("#add_bibs_to_list").find("option:selected").attr("value");
26
      var bibs = new Array();
27
      [% FOREACH message IN messages %]
28
        [% IF message.code == 'biblio_modified' %]
29
          bibs.push("biblionumber="+[% message.biblionumber %]);
30
        [% END %]
31
      [% END %]
32
      var bibstring = bibs.join("&");
33
      Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring);
34
      return false;
35
    }
36
  });
37
  [% IF ( recordtype == 'biblio' ) %]
38
    $("#auth_next_steps").hide();
39
    $("#bib_next_steps").show();
40
  [% ELSE %]
41
    $("#auth_next_steps").show();
42
    $("#bib_next_steps").hide();
43
  [% END %]
19
  $("#selectall").click(function(e){
44
  $("#selectall").click(function(e){
20
    e.preventDefault();
45
    e.preventDefault();
21
    $(".records").checkCheckboxes();
46
    $(".records").checkCheckboxes();
Lines 298-311 $(document).ready(function() { Link Here
298
    [% END %]
323
    [% END %]
299
  [% ELSIF view == 'report' %]
324
  [% ELSIF view == 'report' %]
300
    [% IF report.total_records == report.total_success %]
325
    [% IF report.total_records == report.total_success %]
301
        <div class="dialog message">
326
        <div class="dialog message">All records have successfully been modified! <span id="auth_next_steps"><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a></span></div>
302
            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>
303
        </div>
304
    [% ELSE %]
327
    [% ELSE %]
305
        <div class="dialog message">
328
        <div class="dialog message">[% report.total_success %] / [% report.total_records %] records have successfully been modified. Some errors occurred. <span id="auth_next_steps"><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a></span></div>
306
            [% report.total_success %] / [% report.total_records %] 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>
307
        </div>
308
    [% END %]
329
    [% END %]
330
    <fieldset class="rows" id="bib_next_steps"><legend>Next</legend>
331
        <ol>
332
            <li><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification" class="btn btn-default btn-sm">New batch record modification</a>&nbsp;-- OR --</li>
333
            <li>
334
                <label for="add_bibs_to_list">Add modified records to the following list: </label>
335
                <select name="add_bibs_to_list" id="add_bibs_to_list">
336
                    <option value="">Select a list</option>
337
                    [% FOREACH list IN lists %]
338
                        <option class="shelf" value="[% list.shelfnumber %]">[% list.shelfname %]</option>
339
                    [% END %]
340
                </select>
341
            </li>
342
        </ol>
343
    </fieldset>
309
  [% ELSIF view == 'errors' %]
344
  [% ELSIF view == 'errors' %]
310
    [% FOR error IN errors %]
345
    [% FOR error IN errors %]
311
      [% IF error == 'no_template_defined' %]
346
      [% IF error == 'no_template_defined' %]
(-)a/tools/batch_record_modification.pl (-4 / +5 lines)
Lines 51-56 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
51
51
52
my $sessionID = $input->cookie("CGISESSID");
52
my $sessionID = $input->cookie("CGISESSID");
53
53
54
my @lists = Koha::Virtualshelves->search({});
55
54
my $runinbackground = $input->param('runinbackground');
56
my $runinbackground = $input->param('runinbackground');
55
my $completedJobID = $input->param('completedJobID');
57
my $completedJobID = $input->param('completedJobID');
56
if ( $completedJobID ) {
58
if ( $completedJobID ) {
Lines 58-75 if ( $completedJobID ) { Link Here
58
    my $report = $job->get('report');
60
    my $report = $job->get('report');
59
    my $messages = $job->get('messages');
61
    my $messages = $job->get('messages');
60
    $template->param(
62
    $template->param(
63
        recordtype => $recordtype,
61
        report => $report,
64
        report => $report,
62
        messages => $messages,
65
        messages => $messages,
63
        view => 'report',
66
        view => 'report',
67
        lists => \@lists,
64
    );
68
    );
65
    output_html_with_http_headers $input, $cookie, $template->output;
69
    output_html_with_http_headers $input, $cookie, $template->output;
66
    $job->clear();
70
    $job->clear();
67
    exit;
71
    exit;
68
}
72
}
69
73
70
my @lists = Koha::Virtualshelves->search({});
71
$template->param( lists => \@lists );
72
73
my @templates = GetModificationTemplates( $mmtid );
74
my @templates = GetModificationTemplates( $mmtid );
74
unless ( @templates ) {
75
unless ( @templates ) {
75
    $op = 'error';
76
    $op = 'error';
Lines 266-271 if ( $op eq 'form' ) { Link Here
266
}
267
}
267
268
268
$template->param(
269
$template->param(
270
    lists => \@lists,
269
    messages => \@messages,
271
    messages => \@messages,
270
    recordtype => $recordtype,
272
    recordtype => $recordtype,
271
    MarcModificationTemplatesLoop => \@templates,
273
    MarcModificationTemplatesLoop => \@templates,
272
- 

Return to bug 18127