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 (+22 lines)
Lines 71-76 Link Here
71
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
71
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
72
        </ol>
72
        </ol>
73
      </fieldset>
73
      </fieldset>
74
      <fieldset class="rows" id="shelves">
75
        <legend>Or select a list of records</legend>
76
        <ol>
77
          <li>
78
            <label for="shelf_number">Use records from the following list: </label>
79
            <select name="shelf_number" id="shelf_number">
80
              <option value="">Select a list</option>
81
                [% FOREACH list IN lists %]
82
                  <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
83
                [% END %]
84
              </option>
85
            </select>
86
          </li>
87
        </ol>
88
      </fieldset>
74
      <fieldset class="rows">
89
      <fieldset class="rows">
75
        <legend>Or enter a list of record numbers</legend>
90
        <legend>Or enter a list of record numbers</legend>
76
        <ol>
91
        <ol>
Lines 190-195 Link Here
190
    <script>
205
    <script>
191
        var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
206
        var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
192
        $(document).ready(function() {
207
        $(document).ready(function() {
208
          $("input[type='radio']").click(function(){
209
            if ($(this).attr('id') == 'authority_type') {
210
              $("#shelves").hide();
211
            } else if ($(this).attr('id') == 'biblio_type') {
212
              $("#shelves").show();
213
            }
214
          });
193
          $("#selectall").click(function(e){
215
          $("#selectall").click(function(e){
194
            e.preventDefault();
216
            e.preventDefault();
195
            $(".records").checkCheckboxes(":input[type='checkbox']:not(:disabled)");
217
            $(".records").checkCheckboxes(":input[type='checkbox']:not(:disabled)");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (+22 lines)
Lines 75-80 Link Here
75
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
75
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
76
        </ol>
76
        </ol>
77
      </fieldset>
77
      </fieldset>
78
      <fieldset class="rows" id="shelves">
79
        <legend>Or select a list of records</legend>
80
        <ol>
81
          <li>
82
            <label for="shelf_number">Use records from the following list: </label>
83
            <select name="shelf_number" id="shelf_number">
84
              <option value="">Select a list</option>
85
                [% FOREACH list IN lists %]
86
                  <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
87
                [% END %]
88
              </option>
89
            </select>
90
          </li>
91
        </ol>
92
      </fieldset>
78
      <fieldset class="rows">
93
      <fieldset class="rows">
79
        <legend>Or enter a list of record numbers</legend>
94
        <legend>Or enter a list of record numbers</legend>
80
        <ol>
95
        <ol>
Lines 247-252 Link Here
247
    [% Asset.js("js/background-job-progressbar.js") | $raw %]
262
    [% Asset.js("js/background-job-progressbar.js") | $raw %]
248
    <script>
263
    <script>
249
        $(document).ready(function() {
264
        $(document).ready(function() {
265
          $("input[type='radio']").click(function(){
266
            if ($(this).attr('id') == 'authority_type') {
267
              $("#shelves").hide();
268
            } else if ($(this).attr('id') == 'biblio_type') {
269
              $("#shelves").show();
270
            }
271
          });
250
          $("#selectall").click(function(e){
272
          $("#selectall").click(function(e){
251
            e.preventDefault();
273
            e.preventDefault();
252
            $(".records").checkCheckboxes();
274
            $(".records").checkCheckboxes();
(-)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
use Koha::Authorities;
32
use Koha::Authorities;
32
use Koha::Biblios;
33
use Koha::Biblios;
Lines 44-49 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
44
        flagsrequired => { tools => 'records_batchdel' },
45
        flagsrequired => { tools => 'records_batchdel' },
45
});
46
});
46
47
48
my @lists = Koha::Virtualshelves->search({});
49
$template->param( lists => \@lists );
50
47
my @records;
51
my @records;
48
my @messages;
52
my @messages;
49
if ( $op eq 'form' ) {
53
if ( $op eq 'form' ) {
Lines 64-69 if ( $op eq 'form' ) { Link Here
64
            $content =~ s/[\r\n]*$//;
68
            $content =~ s/[\r\n]*$//;
65
            push @record_ids, $content if $content;
69
            push @record_ids, $content if $content;
66
        }
70
        }
71
    } elsif ( my $shelf_number = $input->param('shelf_number') ) {
72
        my $shelf = Koha::Virtualshelves->find($shelf_number);
73
        my $contents = $shelf->get_contents;
74
        while ( my $content = $contents->next ) {
75
            my $biblionumber = $content->biblionumber;
76
            push @record_ids, $biblionumber;
77
        }
67
    } else {
78
    } else {
68
        # The user enters manually the list of id
79
        # The user enters manually the list of id
69
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
80
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
(-)a/tools/batch_record_modification.pl (-1 / +11 lines)
Lines 32-37 use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModifica Link Here
32
32
33
use Koha::Biblios;
33
use Koha::Biblios;
34
use Koha::MetadataRecord::Authority;
34
use Koha::MetadataRecord::Authority;
35
use Koha::Virtualshelves;
35
36
36
my $input = new CGI;
37
my $input = new CGI;
37
our $dbh = C4::Context->dbh;
38
our $dbh = C4::Context->dbh;
Lines 68-73 if ( $completedJobID ) { Link Here
68
    exit;
69
    exit;
69
}
70
}
70
71
72
my @lists = Koha::Virtualshelves->search({});
73
$template->param( lists => \@lists );
74
71
my @templates = GetModificationTemplates( $mmtid );
75
my @templates = GetModificationTemplates( $mmtid );
72
unless ( @templates ) {
76
unless ( @templates ) {
73
    $op = 'error';
77
    $op = 'error';
Lines 111-116 if ( $op eq 'form' ) { Link Here
111
            $content =~ s/[\r\n]*$//;
115
            $content =~ s/[\r\n]*$//;
112
            push @record_ids, $content if $content;
116
            push @record_ids, $content if $content;
113
        }
117
        }
118
    } elsif ( my $shelf_number = $input->param('shelf_number') ) {
119
        my $shelf = Koha::Virtualshelves->find($shelf_number);
120
        my $contents = $shelf->get_contents;
121
        while ( my $content = $contents->next ) {
122
            my $biblionumber = $content->biblionumber;
123
            push @record_ids, $biblionumber;
124
        }
114
    } else {
125
    } else {
115
        # The user enters manually the list of id
126
        # The user enters manually the list of id
116
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
127
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
117
- 

Return to bug 12759