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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt (+15 lines)
Lines 135-140 $(document).ready(function() { Link Here
135
        </ol>
135
        </ol>
136
      </fieldset>
136
      </fieldset>
137
      <fieldset class="rows">
137
      <fieldset class="rows">
138
        <legend>Or select a list of records</legend>
139
        <ol>
140
          <li>
141
            <label for="shelf_number">Use records from the following list: </label>
142
            <select name="shelf_number" id="shelf_number">
143
              <option value="">Select a list</option>
144
                [% FOREACH list IN lists %]
145
                  <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
146
                [% END %]
147
              </option>
148
            </select>
149
          </li>
150
        </ol>
151
      </fieldset>
152
      <fieldset class="rows">
138
        <legend>Or enter a list of record numbers</legend>
153
        <legend>Or enter a list of record numbers</legend>
139
        <ol>
154
        <ol>
140
          <li>
155
          <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (+22 lines)
Lines 9-14 Link Here
9
<script type="text/javascript">
9
<script type="text/javascript">
10
//<![CDATA[
10
//<![CDATA[
11
$(document).ready(function() {
11
$(document).ready(function() {
12
  $("input[type='radio']").click(function(){
13
    if ($(this).attr('id') == 'authority_type') {
14
      $("#shelves").hide();
15
    } else if ($(this).attr('id') == 'biblio_type') {
16
      $("#shelves").show();
17
    }
18
  });
12
  $("#selectall").click(function(e){
19
  $("#selectall").click(function(e){
13
    e.preventDefault();
20
    e.preventDefault();
14
    $(".records").checkCheckboxes();
21
    $(".records").checkCheckboxes();
Lines 142-147 $(document).ready(function() { Link Here
142
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
149
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
143
        </ol>
150
        </ol>
144
      </fieldset>
151
      </fieldset>
152
      <fieldset class="rows" id="shelves">
153
        <legend>Or select a list of records</legend>
154
        <ol>
155
          <li>
156
            <label for="shelf_number">Use records from the following list: </label>
157
            <select name="shelf_number" id="shelf_number">
158
              <option value="">Select a list</option>
159
                [% FOREACH list IN lists %]
160
                  <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
161
                [% END %]
162
              </option>
163
            </select>
164
          </li>
165
        </ol>
166
      </fieldset>
145
      <fieldset class="rows">
167
      <fieldset class="rows">
146
        <legend>Or enter a list of record numbers</legend>
168
        <legend>Or enter a list of record numbers</legend>
147
        <ol>
169
        <ol>
(-)a/tools/batch_delete_records.pl (+11 lines)
Lines 27-32 use C4::Auth; Link Here
27
use C4::Output;
27
use C4::Output;
28
use C4::AuthoritiesMarc;
28
use C4::AuthoritiesMarc;
29
use C4::Biblio;
29
use C4::Biblio;
30
use Koha::Virtualshelves;
30
31
31
my $input = new CGI;
32
my $input = new CGI;
32
my $dbh = C4::Context->dbh;
33
my $dbh = C4::Context->dbh;
Lines 41-46 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
41
        flagsrequired => { tools => 'records_batchdel' },
42
        flagsrequired => { tools => 'records_batchdel' },
42
});
43
});
43
44
45
my @lists = Koha::Virtualshelves->search({});
46
$template->param( lists => \@lists );
47
44
my @records;
48
my @records;
45
my @messages;
49
my @messages;
46
if ( $op eq 'form' ) {
50
if ( $op eq 'form' ) {
Lines 60-65 if ( $op eq 'form' ) { Link Here
60
            $content =~ s/[\r\n]*$//;
64
            $content =~ s/[\r\n]*$//;
61
            push @record_ids, $content if $content;
65
            push @record_ids, $content if $content;
62
        }
66
        }
67
    } elsif ( my $shelf_number = $input->param('shelf_number') ) {
68
        my $shelf = Koha::Virtualshelves->find($shelf_number);
69
        my $contents = $shelf->get_contents;
70
        while ( my $content = $contents->next ) {
71
            my $biblionumber = $content->biblionumber;
72
            push @record_ids, $biblionumber;
73
        }
63
    } else {
74
    } else {
64
        # The user enters manually the list of id
75
        # The user enters manually the list of id
65
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
76
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
(-)a/tools/batch_record_modification.pl (-1 / +11 lines)
Lines 30-35 use C4::BackgroundJob; Link Here
30
use C4::Biblio qw( GetMarcBiblio ModBiblio );
30
use C4::Biblio qw( GetMarcBiblio ModBiblio );
31
use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ModifyRecordWithTemplate );
31
use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ModifyRecordWithTemplate );
32
use Koha::MetadataRecord::Authority;
32
use Koha::MetadataRecord::Authority;
33
use Koha::Virtualshelves;
33
34
34
my $input = new CGI;
35
my $input = new CGI;
35
our $dbh = C4::Context->dbh;
36
our $dbh = C4::Context->dbh;
Lines 66-71 if ( $completedJobID ) { Link Here
66
    exit;
67
    exit;
67
}
68
}
68
69
70
my @lists = Koha::Virtualshelves->search({});
71
$template->param( lists => \@lists );
72
69
my @templates = GetModificationTemplates( $mmtid );
73
my @templates = GetModificationTemplates( $mmtid );
70
unless ( @templates ) {
74
unless ( @templates ) {
71
    $op = 'error';
75
    $op = 'error';
Lines 108-113 if ( $op eq 'form' ) { Link Here
108
            $content =~ s/[\r\n]*$//;
112
            $content =~ s/[\r\n]*$//;
109
            push @record_ids, $content if $content;
113
            push @record_ids, $content if $content;
110
        }
114
        }
115
    } elsif ( my $shelf_number = $input->param('shelf_number') ) {
116
        my $shelf = Koha::Virtualshelves->find($shelf_number);
117
        my $contents = $shelf->get_contents;
118
        while ( my $content = $contents->next ) {
119
            my $biblionumber = $content->biblionumber;
120
            push @record_ids, $biblionumber;
121
        }
111
    } else {
122
    } else {
112
        # The user enters manually the list of id
123
        # The user enters manually the list of id
113
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
124
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
114
- 

Return to bug 12759