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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt (-1 / +15 lines)
Lines 140-145 Link Here
140
          | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
140
          | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
141
          | <a id="selectwithoutitems" href="#">Select without items</a>
141
          | <a id="selectwithoutitems" href="#">Select without items</a>
142
          | <a id="selectnotreserved" href="#">Select without holds</a>
142
          | <a id="selectnotreserved" href="#">Select without holds</a>
143
          | <a id="selectwithoutsubscriptions" href="#">Select without subscriptions</a>
143
        </div>
144
        </div>
144
        <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectrecords">
145
        <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectrecords">
145
          <table id="biblios" class="records">
146
          <table id="biblios" class="records">
Lines 151-167 Link Here
151
                <th>Items</th>
152
                <th>Items</th>
152
                <th>Holds</th>
153
                <th>Holds</th>
153
                <th>Checkouts</th>
154
                <th>Checkouts</th>
155
                <th>Subscriptions</th>
154
              </tr>
156
              </tr>
155
            </thead>
157
            </thead>
156
            <tbody>
158
            <tbody>
157
              [% FOR biblio IN records %]
159
              [% FOR biblio IN records %]
158
                <tr>
160
                <tr>
159
                  <td><input type="checkbox" name="record_id" id="record_id_[% biblio.biblionumber | html %]" value="[% biblio.biblionumber | html %]" data-items="[% biblio.itemnumbers.size | html %]" data-issues="[% biblio.issues_count | html %]" data-reserves="[% biblio.holds_count | html %]" /></td>
161
                  <td><input type="checkbox" name="record_id" id="record_id_[% biblio.biblionumber | html %]" value="[% biblio.biblionumber | html %]" data-items="[% biblio.itemnumbers.size | html %]" data-issues="[% biblio.issues_count | html %]" data-reserves="[% biblio.holds_count | html %]" data-subscriptions="[% biblio.subscriptions_count | html %]" /></td>
160
                  <td><label for="record_id_[% biblio.biblionumber | html %]">[% biblio.biblionumber | html %]</label></td>
162
                  <td><label for="record_id_[% biblio.biblionumber | html %]">[% biblio.biblionumber | html %]</label></td>
161
                  <td>[% INCLUDE 'biblio-title.inc' link = 1 %]</td>
163
                  <td>[% INCLUDE 'biblio-title.inc' link = 1 %]</td>
162
                  <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.itemnumbers.size | html %]</a></td>
164
                  <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.itemnumbers.size | html %]</a></td>
163
                  <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.holds_count | html %]</a></td>
165
                  <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.holds_count | html %]</a></td>
164
                  <td><a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.issues_count | html %]</a></td>
166
                  <td><a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.issues_count | html %]</a></td>
167
                  <td><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblio.biblionumber | uri %]">[% biblio.subscriptions_count | html %]</a></td>
165
                </tr>
168
                </tr>
166
              [% END %]
169
              [% END %]
167
            </tbody>
170
            </tbody>
Lines 281-286 Link Here
281
                });
284
                });
282
            });
285
            });
283
286
287
            $("#selectwithoutsubscriptions").click(function(e){
288
                e.preventDefault();
289
                $(".records input[type='checkbox']:not(:disabled)").each(function(){
290
                    if( $(this).data("subscriptions") == 0 ){
291
                        $(this).prop("checked", true );
292
                    } else {
293
                        $(this).prop("checked", false );
294
                    }
295
                });
296
            });
297
284
            $("#clearlinkedtobiblio").click(function(e){
298
            $("#clearlinkedtobiblio").click(function(e){
285
                e.preventDefault();
299
                e.preventDefault();
286
                $(".records input[type='checkbox']:not(:disabled)").each(function(){
300
                $(".records input[type='checkbox']:not(:disabled)").each(function(){
(-)a/tools/batch_delete_records.pl (-4 / +5 lines)
Lines 23-32 use Modern::Perl; Link Here
23
use CGI;
23
use CGI;
24
use List::MoreUtils qw( uniq );
24
use List::MoreUtils qw( uniq );
25
25
26
use C4::Auth;
26
use C4::Auth qw( get_template_and_user );
27
use C4::Output;
27
use C4::Output qw( output_html_with_http_headers );
28
use C4::Biblio qw( GetMarcBiblio );
29
use C4::Serials qw( CountSubscriptionFromBiblionumber);
28
use C4::AuthoritiesMarc;
30
use C4::AuthoritiesMarc;
29
use C4::Biblio;
30
use Koha::Virtualshelves;
31
use Koha::Virtualshelves;
31
32
32
use Koha::Authorities;
33
use Koha::Authorities;
Lines 102-107 if ( $op eq 'form' ) { Link Here
102
            $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')];
103
            $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')];
103
            $biblio->{holds_count} = $holds_count;
104
            $biblio->{holds_count} = $holds_count;
104
            $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id );
105
            $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id );
106
            $biblio->{subscriptions_count} = CountSubscriptionFromBiblionumber( $record_id );
105
            push @records, $biblio;
107
            push @records, $biblio;
106
        } else {
108
        } else {
107
            # Retrieve authority information
109
            # Retrieve authority information
108
- 

Return to bug 9565