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 69-74 Link Here
69
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
69
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
70
        </ol>
70
        </ol>
71
      </fieldset>
71
      </fieldset>
72
      <fieldset class="rows" id="shelves">
73
        <legend>Or select a list of records</legend>
74
        <ol>
75
          <li>
76
            <label for="shelf_number">Use records from the following list: </label>
77
            <select name="shelf_number" id="shelf_number">
78
              <option value="">Select a list</option>
79
                [% FOREACH list IN lists %]
80
                  <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
81
                [% END %]
82
              </option>
83
            </select>
84
          </li>
85
        </ol>
86
      </fieldset>
72
      <fieldset class="rows">
87
      <fieldset class="rows">
73
        <legend>Or enter a list of record numbers</legend>
88
        <legend>Or enter a list of record numbers</legend>
74
        <ol>
89
        <ol>
Lines 184-189 Link Here
184
    <script type="text/javascript">
199
    <script type="text/javascript">
185
        var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
200
        var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
186
        $(document).ready(function() {
201
        $(document).ready(function() {
202
          $("input[type='radio']").click(function(){
203
            if ($(this).attr('id') == 'authority_type') {
204
              $("#shelves").hide();
205
            } else if ($(this).attr('id') == 'biblio_type') {
206
              $("#shelves").show();
207
            }
208
          });
187
          $("#selectall").click(function(e){
209
          $("#selectall").click(function(e){
188
            e.preventDefault();
210
            e.preventDefault();
189
            $(".records").checkCheckboxes(":input[type='checkbox']:not(:disabled)");
211
            $(".records").checkCheckboxes(":input[type='checkbox']:not(:disabled)");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (+22 lines)
Lines 73-78 Link Here
73
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
73
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
74
        </ol>
74
        </ol>
75
      </fieldset>
75
      </fieldset>
76
      <fieldset class="rows" id="shelves">
77
        <legend>Or select a list of records</legend>
78
        <ol>
79
          <li>
80
            <label for="shelf_number">Use records from the following list: </label>
81
            <select name="shelf_number" id="shelf_number">
82
              <option value="">Select a list</option>
83
                [% FOREACH list IN lists %]
84
                  <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
85
                [% END %]
86
              </option>
87
            </select>
88
          </li>
89
        </ol>
90
      </fieldset>
76
      <fieldset class="rows">
91
      <fieldset class="rows">
77
        <legend>Or enter a list of record numbers</legend>
92
        <legend>Or enter a list of record numbers</legend>
78
        <ol>
93
        <ol>
Lines 242-247 Link Here
242
    [% Asset.js("js/background-job-progressbar.js") %]
257
    [% Asset.js("js/background-job-progressbar.js") %]
243
    <script type="text/javascript">
258
    <script type="text/javascript">
244
        $(document).ready(function() {
259
        $(document).ready(function() {
260
          $("input[type='radio']").click(function(){
261
            if ($(this).attr('id') == 'authority_type') {
262
              $("#shelves").hide();
263
            } else if ($(this).attr('id') == 'biblio_type') {
264
              $("#shelves").show();
265
            }
266
          });
245
          $("#selectall").click(function(e){
267
          $("#selectall").click(function(e){
246
            e.preventDefault();
268
            e.preventDefault();
247
            $(".records").checkCheckboxes();
269
            $(".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 43-48 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
43
        flagsrequired => { tools => 'records_batchdel' },
44
        flagsrequired => { tools => 'records_batchdel' },
44
});
45
});
45
46
47
my @lists = Koha::Virtualshelves->search({});
48
$template->param( lists => \@lists );
49
46
my @records;
50
my @records;
47
my @messages;
51
my @messages;
48
if ( $op eq 'form' ) {
52
if ( $op eq 'form' ) {
Lines 62-67 if ( $op eq 'form' ) { Link Here
62
            $content =~ s/[\r\n]*$//;
66
            $content =~ s/[\r\n]*$//;
63
            push @record_ids, $content if $content;
67
            push @record_ids, $content if $content;
64
        }
68
        }
69
    } elsif ( my $shelf_number = $input->param('shelf_number') ) {
70
        my $shelf = Koha::Virtualshelves->find($shelf_number);
71
        my $contents = $shelf->get_contents;
72
        while ( my $content = $contents->next ) {
73
            my $biblionumber = $content->biblionumber;
74
            push @record_ids, $biblionumber;
75
        }
65
    } else {
76
    } else {
66
        # The user enters manually the list of id
77
        # The user enters manually the list of id
67
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
78
        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 110-115 if ( $op eq 'form' ) { Link Here
110
            $content =~ s/[\r\n]*$//;
114
            $content =~ s/[\r\n]*$//;
111
            push @record_ids, $content if $content;
115
            push @record_ids, $content if $content;
112
        }
116
        }
117
    } elsif ( my $shelf_number = $input->param('shelf_number') ) {
118
        my $shelf = Koha::Virtualshelves->find($shelf_number);
119
        my $contents = $shelf->get_contents;
120
        while ( my $content = $contents->next ) {
121
            my $biblionumber = $content->biblionumber;
122
            push @record_ids, $biblionumber;
123
        }
113
    } else {
124
    } else {
114
        # The user enters manually the list of id
125
        # The user enters manually the list of id
115
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
126
        push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
116
- 

Return to bug 12759