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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt (-107 / +110 lines)
Lines 1-26 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
3
<title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
5
[% INCLUDE 'datatables.inc' %]
6
<script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/batchMod.js"></script>
7
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8
<script type="text/javascript">
9
//<![CDATA[
10
11
// Prepare array of all column headers, incrementing each index by
12
// two to accommodate control and title columns
13
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
14
for( x=0; x<allColumns.length; x++ ){
15
  allColumns[x] = Number(allColumns[x]) + 2;
16
}
17
$(document).ready(function(){
18
    $("#mainformsubmit").on("click",function(){
19
        return submitBackgroundJob(this.form);
20
    });
21
});
22
//]]>
23
</script>
24
<!--[if IE]>
6
<!--[if IE]>
25
<style type="text/css">#selections { display: none; }</style>
7
<style type="text/css">#selections { display: none; }</style>
26
<![endif]-->
8
<![endif]-->
Lines 30-71 $(document).ready(function(){ Link Here
30
[% INCLUDE 'cat-search.inc' %]
12
[% INCLUDE 'cat-search.inc' %]
31
13
32
<div id="breadcrumbs">
14
<div id="breadcrumbs">
33
	<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
15
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
34
	<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
16
    <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
35
	<a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
17
    <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
36
</div>
18
</div>
37
19
38
<div id="doc3" class="yui-t7">
20
<div id="doc3" class="yui-t7">
39
    <div id="bd">
21
    <div id="bd">
40
        <div id="yui-main">
22
        <div id="yui-main">
41
                [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
23
                [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
42
	    [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
24
        [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
43
	    [% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
25
        [% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
44
        [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
26
        [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
45
        [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
27
        [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
46
28
47
    [% UNLESS ( action ) %]
29
    [% UNLESS ( action ) %]
48
30
49
    [% IF ( notfoundbarcodes ) %]
31
    [% IF ( notfoundbarcodes ) %]
50
	    <div class="dialog alert">
32
        <div class="dialog alert">
51
	    [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
33
        [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
52
		</div>
34
        </div>
53
	    <table style="margin:auto;">
35
        <table style="margin:auto;">
54
		<thead>
36
        <thead>
55
		    <tr>
37
            <tr>
56
			<th>Barcode</th>
38
            <th>Barcode</th>
57
		    </tr>
39
            </tr>
58
		</thead>
40
        </thead>
59
		<tbody>
41
        <tbody>
60
		    [% FOREACH notfoundbarcode IN notfoundbarcodes %]
42
            [% FOREACH notfoundbarcode IN notfoundbarcodes %]
61
            <tr><td>[% notfoundbarcode.barcode |html %]</td></tr>
43
            <tr><td>[% notfoundbarcode.barcode |html %]</td></tr>
62
		    [% END %]
44
            [% END %]
63
		</tbody>
45
        </tbody>
64
	    </table>
46
        </table>
65
	    [% UNLESS ( too_many_items ) %]
47
        [% UNLESS ( too_many_items ) %]
66
	    [% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
48
        [% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
67
	    [% END %]
49
        [% END %]
68
	[% END %]
50
    [% END %]
69
51
70
52
71
<form name="f" action="batchMod.pl" method="post">
53
<form name="f" action="batchMod.pl" method="post">
Lines 80-112 $(document).ready(function(){ Link Here
80
62
81
[% IF ( item_loop ) %]
63
[% IF ( item_loop ) %]
82
    [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a></div>[% END %]
64
    [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a></div>[% END %]
83
	<div id="cataloguing_additem_itemlist">
65
    <div id="cataloguing_additem_itemlist">
84
66
85
	<p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
67
    <p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
86
		[% FOREACH item_header_loo IN item_header_loop %]
68
        [% FOREACH item_header_loo IN item_header_loop %]
87
		<span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
69
        <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
88
		[% END %]
70
        [% END %]
89
	</p>
71
    </p>
90
72
91
		<table id="itemst">
73
        <table id="itemst">
92
		    <thead>
74
            <thead>
93
			<tr>
75
            <tr>
94
			    [% IF ( show ) %]<th>&nbsp;</th>[% END %]
76
                [% IF ( show ) %]<th>&nbsp;</th>[% END %]
95
                <th class="anti-the">Title</th>
77
                <th class="anti-the">Title</th>
96
			    [% FOREACH item_header_loo IN item_header_loop %]
78
                [% FOREACH item_header_loo IN item_header_loop %]
97
			    <th> [% item_header_loo.header_value %] </th>
79
                <th> [% item_header_loo.header_value %] </th>
98
			    [% END %]
80
                [% END %]
99
			</tr>
81
            </tr>
100
		    </thead>
82
            </thead>
101
		    <tbody>
83
            <tbody>
102
            [% FOREACH item_loo IN item_loop %] <tr> [% IF ( show ) %][% IF ( item_loo.nomod ) %] <td class="error">Cannot edit</td>[% ELSE %]<td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" /></td>[% END %][% END %]
84
            [% FOREACH item_loo IN item_loop %] <tr> [% IF ( show ) %][% IF ( item_loo.nomod ) %] <td class="error">Cannot edit</td>[% ELSE %]<td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" /></td>[% END %][% END %]
103
		    <td><label for="row[% item_loo.itemnumber %]"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">[% item_loo.title %]</a>[% IF ( item_loo.author ) %], by [% item_loo.author %][% END %]</label></td>
85
            <td><label for="row[% item_loo.itemnumber %]"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">[% item_loo.title %]</a>[% IF ( item_loo.author ) %], by [% item_loo.author %][% END %]</label></td>
104
			[% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
86
            [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td>
105
					[% END %] </tr>
87
                    [% END %] </tr>
106
		    [% END %]
88
            [% END %]
107
		    </tbody>
89
            </tbody>
108
		</table>
90
        </table>
109
	</div>
91
    </div>
110
[% END %]
92
[% END %]
111
93
112
[% IF ( simple_items_display ) %]
94
[% IF ( simple_items_display ) %]
Lines 127-140 $(document).ready(function(){ Link Here
127
    [% FOREACH itemnumber IN itemnumbers_array %]
109
    [% FOREACH itemnumber IN itemnumbers_array %]
128
        <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
110
        <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
129
    [% END %]
111
    [% END %]
130
[% END %]   
112
[% END %]
131
113
132
[% IF ( itemresults ) %]
114
[% IF ( itemresults ) %]
133
		<div id="cataloguing_additem_newitem">
115
        <div id="cataloguing_additem_newitem">
134
	     <input type="hidden" name="op" value="[% op %]" />
116
         <input type="hidden" name="op" value="[% op %]" />
135
	     <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
117
         <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
136
	     <input type="hidden" name="del" value="1" />
118
         <input type="hidden" name="del" value="1" />
137
	     <fieldset class="action">    
119
         <fieldset class="action">
138
        <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
120
        <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
139
        [% IF too_many_items %]
121
        [% IF too_many_items %]
140
            <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
122
            <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
Lines 142-159 $(document).ready(function(){ Link Here
142
            <input type="submit" name="mainformsubmit" value="Delete selected items" />
124
            <input type="submit" name="mainformsubmit" value="Delete selected items" />
143
        [% END %]
125
        [% END %]
144
126
145
		<a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
127
        <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
146
	    </fieldset>
128
        </fieldset>
147
	</div>
129
    </div>
148
	[% ELSE %]
130
    [% ELSE %]
149
	<p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
131
    <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
150
	[% END %]
132
    [% END %]
151
	[% END %]
133
    [% END %]
152
	</form>
134
    </form>
153
    [% END %]
135
    [% END %]
154
136
155
[% IF ( action ) %]
137
[% IF ( action ) %]
156
	<div class="dialog message">
138
    <div class="dialog message">
157
            <p>[% deleted_items %] item(s) deleted.</p>
139
            <p>[% deleted_items %] item(s) deleted.</p>
158
            [% IF delete_records %] <p>[% deleted_records %] record(s) deleted.</p> [% END %]
140
            [% IF delete_records %] <p>[% deleted_records %] record(s) deleted.</p> [% END %]
159
            [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
141
            [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
Lines 164-194 $(document).ready(function(){ Link Here
164
                <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
146
                <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
165
            [% END %]
147
            [% END %]
166
        </div>
148
        </div>
167
	[% IF ( not_deleted_items ) %]
149
    [% IF ( not_deleted_items ) %]
168
	<div style="width:55%;margin:auto;">
150
    <div style="width:55%;margin:auto;">
169
	    <p>[% not_deleted_items %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% END %]</p>
151
        <p>[% not_deleted_items %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% END %]</p>
170
	[% IF ( not_deleted_loop ) %]
152
    [% IF ( not_deleted_loop ) %]
171
	<table id="itemst">
153
    <table id="itemst">
172
		<thead>
154
        <thead>
173
		    <tr>
155
            <tr>
174
			<th>Itemnumber</th>
156
            <th>Itemnumber</th>
175
			<th>Barcode</th>
157
            <th>Barcode</th>
176
			<th>Reason</th>
158
            <th>Reason</th>
177
		    </tr>
159
            </tr>
178
		</thead>
160
        </thead>
179
		<tbody>
161
        <tbody>
180
		    [% FOREACH not_deleted_loo IN not_deleted_loop %]
162
            [% FOREACH not_deleted_loo IN not_deleted_loop %]
181
			<tr>
163
            <tr>
182
			    <td>[% not_deleted_loo.itemnumber %]</td>
164
                <td>[% not_deleted_loo.itemnumber %]</td>
183
			    <td>[% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=[% not_deleted_loo.biblionumber %]&amp;itemnumber=[% not_deleted_loo.itemnumber %]">[% not_deleted_loo.barcode %]</a>[% ELSE %][% not_deleted_loo.barcode %][% END %]</td>
165
                <td>[% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=[% not_deleted_loo.biblionumber %]&amp;itemnumber=[% not_deleted_loo.itemnumber %]">[% not_deleted_loo.barcode %]</a>[% ELSE %][% not_deleted_loo.barcode %][% END %]</td>
184
			    <td>[% IF ( not_deleted_loo.book_on_loan ) %]Item is checked out[% ELSIF ( not_deleted_loo.book_reserved ) %]Item has a waiting hold[% END %]</td>
166
                <td>[% IF ( not_deleted_loo.book_on_loan ) %]Item is checked out[% ELSIF ( not_deleted_loo.book_reserved ) %]Item has a waiting hold[% END %]</td>
185
			</tr>
167
            </tr>
186
		    [% END %]
168
            [% END %]
187
		</tbody>
169
        </tbody>
188
	    </table>
170
        </table>
189
	[% END %]
171
    [% END %]
190
	</div>
172
    </div>
191
	[% END %]
173
    [% END %]
192
174
193
    <p>
175
    <p>
194
        [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
176
        [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
Lines 202-205 $(document).ready(function(){ Link Here
202
[% END %]
184
[% END %]
203
    </div>
185
    </div>
204
    </div>
186
    </div>
187
188
[% MACRO jsinclude BLOCK %]
189
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
190
    [% INCLUDE 'datatables.inc' %]
191
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/batchMod.js"></script>
192
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
193
    <script type="text/javascript">
194
        // Prepare array of all column headers, incrementing each index by
195
        // two to accommodate control and title columns
196
        var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
197
        for( x=0; x<allColumns.length; x++ ){
198
          allColumns[x] = Number(allColumns[x]) + 2;
199
        }
200
        $(document).ready(function(){
201
            $("#mainformsubmit").on("click",function(){
202
                return submitBackgroundJob(this.form);
203
            });
204
        });
205
    </script>
206
[% END %]
207
205
[% INCLUDE 'intranet-bottom.inc' %]
208
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt (-12 / +18 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; [% IF ( del ) %]Batch item deletion[% ELSE %]Batch item modification[% END %] </title>
3
<title>Koha &rsaquo; Tools &rsaquo; [% IF ( del ) %]Batch item deletion[% ELSE %]Batch item modification[% END %] </title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 7-19 Link Here
7
[% INCLUDE 'cat-search.inc' %]
8
[% INCLUDE 'cat-search.inc' %]
8
9
9
<div id="breadcrumbs">
10
<div id="breadcrumbs">
10
	<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
11
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
11
	<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
12
    <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
12
	[% IF ( del ) %]
13
    [% IF ( del ) %]
13
	<a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
14
    <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
14
	[% ELSE %]
15
    [% ELSE %]
15
	<a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
16
    <a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
16
	[% END %]
17
    [% END %]
17
</div>
18
</div>
18
19
19
<div id="doc3" class="yui-t2">
20
<div id="doc3" class="yui-t2">
Lines 24-35 Link Here
24
                        <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batchMod.pl">
25
                        <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batchMod.pl">
25
                            <fieldset class="rows">
26
                            <fieldset class="rows">
26
                                <legend>Use a file</legend>
27
                                <legend>Use a file</legend>
27
                	              <ol>
28
                                  <ol>
28
				      <li>
29
                      <li>
29
                    <label for="barcode_file">Barcode file: </label><input type="radio" name="filecontent" value="barcode_file" id="barcode_file" checked="checked" /></li>
30
                    <label for="barcode_file">Barcode file: </label><input type="radio" name="filecontent" value="barcode_file" id="barcode_file" checked="checked" /></li>
30
                    <li>
31
                    <li>
31
                    <label for="itemid_file">Item number file: </label><input type="radio" name="filecontent" value="itemid_file" id="itemid_file" />
32
                    <label for="itemid_file">Item number file: </label><input type="radio" name="filecontent" value="itemid_file" id="itemid_file" />
32
				      </li>
33
                      </li>
33
                                    <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
34
                                    <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
34
                                </ol>
35
                                </ol>
35
                            </fieldset>
36
                            </fieldset>
Lines 61-74 Link Here
61
                            [% IF ( del ) %]<input type="hidden" name="del" value="1" />[% END %]
62
                            [% IF ( del ) %]<input type="hidden" name="del" value="1" />[% END %]
62
                            <fieldset class="action">
63
                            <fieldset class="action">
63
                                <input type="submit" value="Continue" class="button" />
64
                                <input type="submit" value="Continue" class="button" />
64
				<a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
65
                <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
65
                            </fieldset>
66
                            </fieldset>
66
67
67
                        </form>
68
                        </form>
68
                    </div>
69
                    </div>
69
		    </div>
70
            </div>
70
       <div class="yui-b">
71
       <div class="yui-b">
71
            [% INCLUDE 'tools-menu.inc' %]
72
            [% INCLUDE 'tools-menu.inc' %]
72
        </div>
73
        </div>
73
    </div>
74
    </div>
75
76
[% MACRO jsinclude BLOCK %]
77
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
78
[% END %]
79
74
[% INCLUDE 'intranet-bottom.inc' %]
80
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt (-76 / +81 lines)
Lines 1-85 Link Here
1
[% SET footerjs = 1 %]
1
[% PROCESS 'authorities-search-results.inc' %]
2
[% PROCESS 'authorities-search-results.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Tools &rsaquo; Batch record deletion</title>
4
<title>Koha &rsaquo; Tools &rsaquo; Batch record deletion</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
[% INCLUDE 'datatables.inc' %]
7
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8
<script type="text/javascript">
9
//<![CDATA[
10
var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
11
$(document).ready(function() {
12
  $("#selectall").click(function(e){
13
    e.preventDefault();
14
    $(".records").checkCheckboxes();
15
  });
16
  $("#clearall").click(function(e){
17
    e.preventDefault();
18
    $(".records").unCheckCheckboxes();
19
  });
20
  $("#selectwithoutitems").click(function(e){
21
    e.preventDefault();
22
    $("#biblios").checkCheckboxes(":input[data-items='0']:not(:disabled)");
23
  });
24
  $("#selectnotreserved").click(function(e){
25
    e.preventDefault();
26
    $("#biblios").checkCheckboxes(":input[data-reserves='0']:not(:disabled)");
27
28
  });
29
  $("#clearlinkedtobiblio").click(function(e){
30
    e.preventDefault();
31
    $("#authorities").unCheckCheckboxes(":not(input[data-usage='0'])");
32
  });
33
  $("#selectall").click();
34
35
  [% IF recordtype == 'biblio' %]
36
    $(".records input:checkbox[data-issues!='0']").each(function(){
37
      $(this).attr('title', MSG_CANNOT_BE_DELETED)
38
      $(this).prop('disabled', true);
39
      $(this).prop('checked', false);
40
      $(this).parents('tr').find('td').css('background-color', '#ffff99');
41
    });
42
  [% END %]
43
44
  $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
45
    "aoColumnDefs": [
46
      { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
47
      { "aTargets": [ 3, 4 ], "sType": "num-html" }
48
    ],
49
    "sDom": 't',
50
    "aaSorting": [],
51
    "bPaginate": false
52
  }));
53
54
  $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
55
    "aoColumnDefs": [
56
      { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
57
      { "aTargets": [ 3 ], "sType": "num-html" }
58
    ],
59
    "sDom": 't',
60
    "aaSorting": [],
61
    "bPaginate": false
62
  }));
63
64
  $("#selectrecords").on("submit",function(){
65
    var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size();
66
    if (nb_checked == 0){
67
      alert(_("No records have been selected."));
68
      return false;
69
    }
70
  });
71
72
  $("#selectauths").on("submit",function(){
73
    var checked = $("#selectauths").find("input[type='checkbox'][name='record_id']:checked").size();
74
    if (checked == 0) {
75
      alert(_("No authorities have been selected."));
76
      return false;
77
    }
78
  });
79
});
80
//]]>
81
</script>
82
</head>
7
</head>
8
83
<body id="tools_batch_delete_records" class="tools">
9
<body id="tools_batch_delete_records" class="tools">
84
[% INCLUDE 'header.inc' %]
10
[% INCLUDE 'header.inc' %]
85
[% INCLUDE 'cat-search.inc' %]
11
[% INCLUDE 'cat-search.inc' %]
Lines 249-252 $(document).ready(function() { Link Here
249
  [% INCLUDE 'tools-menu.inc' %]
175
  [% INCLUDE 'tools-menu.inc' %]
250
</div>
176
</div>
251
</div>
177
</div>
178
179
[% MACRO jsinclude BLOCK %]
180
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
181
    [% INCLUDE 'datatables.inc' %]
182
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
183
    <script type="text/javascript">
184
        var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
185
        $(document).ready(function() {
186
          $("#selectall").click(function(e){
187
            e.preventDefault();
188
            $(".records").checkCheckboxes();
189
          });
190
          $("#clearall").click(function(e){
191
            e.preventDefault();
192
            $(".records").unCheckCheckboxes();
193
          });
194
          $("#selectwithoutitems").click(function(e){
195
            e.preventDefault();
196
            $("#biblios").checkCheckboxes(":input[data-items='0']:not(:disabled)");
197
          });
198
          $("#selectnotreserved").click(function(e){
199
            e.preventDefault();
200
            $("#biblios").checkCheckboxes(":input[data-reserves='0']:not(:disabled)");
201
202
          });
203
          $("#clearlinkedtobiblio").click(function(e){
204
            e.preventDefault();
205
            $("#authorities").unCheckCheckboxes(":not(input[data-usage='0'])");
206
          });
207
          $("#selectall").click();
208
209
          [% IF recordtype == 'biblio' %]
210
            $(".records input:checkbox[data-issues!='0']").each(function(){
211
              $(this).attr('title', MSG_CANNOT_BE_DELETED)
212
              $(this).prop('disabled', true);
213
              $(this).prop('checked', false);
214
              $(this).parents('tr').find('td').css('background-color', '#ffff99');
215
            });
216
          [% END %]
217
218
          $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
219
            "aoColumnDefs": [
220
              { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
221
              { "aTargets": [ 3, 4 ], "sType": "num-html" }
222
            ],
223
            "sDom": 't',
224
            "aaSorting": [],
225
            "bPaginate": false
226
          }));
227
228
          $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
229
            "aoColumnDefs": [
230
              { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
231
              { "aTargets": [ 3 ], "sType": "num-html" }
232
            ],
233
            "sDom": 't',
234
            "aaSorting": [],
235
            "bPaginate": false
236
          }));
237
238
          $("#selectrecords").on("submit",function(){
239
            var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size();
240
            if (nb_checked == 0){
241
              alert(_("No records have been selected."));
242
              return false;
243
            }
244
          });
245
246
          $("#selectauths").on("submit",function(){
247
            var checked = $("#selectauths").find("input[type='checkbox'][name='record_id']:checked").size();
248
            if (checked == 0) {
249
              alert(_("No authorities have been selected."));
250
              return false;
251
            }
252
          });
253
        });
254
    </script>
255
[% END %]
256
252
[% INCLUDE 'intranet-bottom.inc' %]
257
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (-73 / +77 lines)
Lines 1-81 Link Here
1
[% SET footerjs = 1 %]
1
[% PROCESS 'authorities-search-results.inc' %]
2
[% PROCESS 'authorities-search-results.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Tools &rsaquo; Batch record modification</title>
4
<title>Koha &rsaquo; Tools &rsaquo; Batch record modification</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
[% INCLUDE 'datatables.inc' %]
7
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
9
<script type="text/javascript">
10
//<![CDATA[
11
$(document).ready(function() {
12
  $("#selectall").click(function(e){
13
    e.preventDefault();
14
    $(".records").checkCheckboxes();
15
  });
16
  $("#clearall").click(function(e){
17
    e.preventDefault();
18
    $(".records").unCheckCheckboxes();
19
  });
20
  $("#selectall").click();
21
22
  $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
23
    "aoColumnDefs": [
24
      { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
25
      { "aTargets": [ 1 ], "sType": "num-html" }
26
    ],
27
    "sDom": 't',
28
    "aaSorting": [],
29
    "bPaginate": false
30
  }));
31
32
  $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
33
    "aoColumnDefs": [
34
      { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
35
      { "aTargets": [ 1 ], "sType": "num-html" }
36
    ],
37
    "sDom": 't',
38
    "aaSorting": [],
39
    "bPaginate": false
40
  }));
41
42
  $("#mainformsubmit").click(function(){
43
    if ($("input[type=checkbox][name='record_id']:checked").length == 0 ) {
44
      alert(_("Please select at least one record to process"));
45
      return false;
46
    }
47
    if ( $("#marc_modification_template_id").val() <= 0 ) {
48
      alert(_("Please select a modification template."));
49
      return false;
50
    }
51
    return submitBackgroundJob(document.getElementById("process"));
52
  });
53
54
  $("#marc_modification_template_id").change(function(){
55
    var url = "/cgi-bin/koha/svc/records/preview?"
56
    var mmtid = $(this).val();
57
    $("a.previewMARC").each(function(){
58
      $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
59
    });
60
  });
61
62
    $("body").on("click",".previewMARC", function(e){
63
        e.preventDefault();
64
        var ltitle = $(this).text();
65
        var page = $(this).attr("href");
66
        $("#marcPreviewLabel").text(ltitle);
67
        $("#marcPreview .modal-body").load(page + " div");
68
        $('#marcPreview').modal({show:true});
69
    });
70
    $("#marcPreview").on("hidden", function(){
71
        $("#marcPreviewLabel").html("");
72
        $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
73
    });
74
75
});
76
//]]>
77
</script>
78
</head>
7
</head>
8
79
<body id="tools_batch_record_modification" class="tools">
9
<body id="tools_batch_record_modification" class="tools">
80
[% INCLUDE 'header.inc' %]
10
[% INCLUDE 'header.inc' %]
81
[% INCLUDE 'cat-search.inc' %]
11
[% INCLUDE 'cat-search.inc' %]
Lines 303-306 $(document).ready(function() { Link Here
303
  [% INCLUDE 'tools-menu.inc' %]
233
  [% INCLUDE 'tools-menu.inc' %]
304
</div>
234
</div>
305
</div>
235
</div>
236
237
[% MACRO jsinclude BLOCK %]
238
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
239
    [% INCLUDE 'datatables.inc' %]
240
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
241
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
242
    <script type="text/javascript">
243
        $(document).ready(function() {
244
          $("#selectall").click(function(e){
245
            e.preventDefault();
246
            $(".records").checkCheckboxes();
247
          });
248
          $("#clearall").click(function(e){
249
            e.preventDefault();
250
            $(".records").unCheckCheckboxes();
251
          });
252
          $("#selectall").click();
253
254
          $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
255
            "aoColumnDefs": [
256
              { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
257
              { "aTargets": [ 1 ], "sType": "num-html" }
258
            ],
259
            "sDom": 't',
260
            "aaSorting": [],
261
            "bPaginate": false
262
          }));
263
264
          $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
265
            "aoColumnDefs": [
266
              { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
267
              { "aTargets": [ 1 ], "sType": "num-html" }
268
            ],
269
            "sDom": 't',
270
            "aaSorting": [],
271
            "bPaginate": false
272
          }));
273
274
          $("#mainformsubmit").click(function(){
275
            if ($("input[type=checkbox][name='record_id']:checked").length == 0 ) {
276
              alert(_("Please select at least one record to process"));
277
              return false;
278
            }
279
            if ( $("#marc_modification_template_id").val() <= 0 ) {
280
              alert(_("Please select a modification template."));
281
              return false;
282
            }
283
            return submitBackgroundJob(document.getElementById("process"));
284
          });
285
286
          $("#marc_modification_template_id").change(function(){
287
            var url = "/cgi-bin/koha/svc/records/preview?"
288
            var mmtid = $(this).val();
289
            $("a.previewMARC").each(function(){
290
              $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
291
            });
292
          });
293
294
            $("body").on("click",".previewMARC", function(e){
295
                e.preventDefault();
296
                var ltitle = $(this).text();
297
                var page = $(this).attr("href");
298
                $("#marcPreviewLabel").text(ltitle);
299
                $("#marcPreview .modal-body").load(page + " div");
300
                $('#marcPreview').modal({show:true});
301
            });
302
            $("#marcPreview").on("hidden", function(){
303
                $("#marcPreviewLabel").html("");
304
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
305
            });
306
307
        });
308
    </script>
309
[% END %]
310
306
[% INCLUDE 'intranet-bottom.inc' %]
311
[% INCLUDE 'intranet-bottom.inc' %]
307
- 

Return to bug 19654