Bug 30629: fix <span> in title of some pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-manage.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% PROCESS 'i18n.inc' %]
4 [% SET footerjs = 1 %]
5 [% BLOCK translate_label_element %]
6 [%-  SWITCH element -%]
7 [%-  CASE 'layout'    -%][% t('layout') | html %]
8 [%-  CASE 'Layouts'   -%][% t('Layouts') | html %]
9 [%-  CASE 'template'  -%][% t('template') | html %]
10 [%-  CASE 'Templates' -%][% t('Templates') | html %]
11 [%-  CASE 'profile'   -%][% t('profile') | html %]
12 [%-  CASE 'Profiles'  -%][% t('Profiles') | html %]
13 [%-  CASE 'batch'     -%][% t('batch') | html %]
14 [%-  CASE 'Batches'   -%][% t('Batches') | html %]
15 [%-  END -%]
16 [% END %]
17     [% INCLUDE 'doc-head-open.inc' %]
18     <title>[% PROCESS translate_label_element element=label_element_title %] &rsaquo; Label creator &rsaquo; Tools &rsaquo; Koha</title>
19     [% INCLUDE 'doc-head-close.inc' %]
20 </head>
21
22 <body id="labels_label-manage" class="tools labels">
23     [% INCLUDE 'header.inc' %]
24     [% INCLUDE 'cat-search.inc' %]
25
26     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
27         <ol>
28             <li>
29                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
30             </li>
31             <li>
32                 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
33             </li>
34             <li>
35                 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
36             </li>
37             <li>
38                 <a href="#" aria-current="page">
39                     [% PROCESS translate_label_element element=label_element_title %]
40                 </a>
41             </li>
42         </ol>
43     </nav>
44
45     <div class="main container-fluid">
46         <div class="row">
47             <div class="col-sm-10 col-sm-push-2">
48                 <main>
49
50                     [% INCLUDE 'labels-toolbar.inc' %]
51                     <h1>Manage labels</h1>
52
53                         [% IF ( error ) %]
54                             <div class="dialog alert">
55                                 <strong>WARNING:</strong> An error was encountered and the [% op | html %] operation for [% label_element | html %] [% element_id | html %] was not completed. Please have your system administrator check the error log for details.
56                             </div>
57                         [% END %]
58
59                         <div id="manage-label-layouts">
60                             [% IF ( table_loop ) %]
61                             <form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element | html %]">
62                             [% IF    ( label_element == 'layout' ) %]
63                             <h2>Currently available layouts</h2>
64                             [% ELSIF ( label_element == 'template' ) %]
65                             <h2>Currently available templates</h2>
66                             [% ELSIF ( label_element == 'profile' ) %]
67                             <h2>Currently available profiles</h2>
68                             [% ELSIF ( label_element == 'batch' ) %]
69                             <h2>Currently available batches</h2>
70                             [% END %]
71                             <table id="labels-table">
72                                 [% FOREACH table_loo IN table_loop %]
73                                     [% IF ( table_loo.header_fields ) %]
74                                         <thead>
75                                         <tr>
76                                             [% FOREACH header_field IN table_loo.header_fields %]
77                                                 [% SWITCH header_field.field_label %]
78                                                     [% CASE 'Layout ID'       %]<th>Layout ID</th>
79                                                     [% CASE 'Layout'          %]<th>Layout</th>
80                                                     [% CASE 'Barcode Type'    %]<th>Barcode type</th>
81                                                     [% CASE 'Print Type'      %]<th>Print type</th>
82                                                     [% CASE 'Template ID'     %]<th>Template ID</th>
83                                                     [% CASE 'Template Name'   %]<th>Template name</th>
84                                                     [% CASE 'Description'     %]<th>Description</th>
85                                                     [% CASE 'Actions'         %]<th class="noExport">Actions</th>
86                                                     [% CASE 'Profile ID'      %]<th>Profile ID</th>
87                                                     [% CASE 'Printer Name'    %]<th>Printer name</th>
88                                                     [% CASE 'Paper Bin'       %]<th>Paper bin</th>
89                                                     [% CASE 'Batch ID'        %]<th>Batch ID</th>
90                                                     [% CASE 'Item Count'      %]<th>Item count</th>
91                                                     [% CASE 'Fields to Print' %]<th>Fields to print</th>
92                                                     [% CASE                   %]<th>[% header_field.field_label | html %]</th>
93                                                 [% END %]
94                                             [% END %]
95                                         </tr>
96                                         </thead>
97                                     [% ELSE %]
98                                         <tr>
99                                         [% FOREACH text_field IN table_loo.text_fields %]
100                                             [% IF ( text_field.select_field ) %]
101                                                 <td class="actions">
102                                                     <a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-edit"></i> Edit</a>
103                                                     <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&amp;label_element=[% label_element | html %]&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a>
104                                                 </td>
105                                                 [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
106                                             [% ELSIF ( text_field.field_value ) %]
107                                                 <td>[% text_field.field_value | html %]</td>
108                                             [% ELSE %]
109                                                 <td>&nbsp;</td>
110                                             [% END %]
111                                         [% END %]
112                                         </tr>
113                                     [% END %]
114                                 [% END %]
115                             </table>
116                             [% IF ( print ) %]<button type="button" class="btn btn-default" id="print">Export selected</button>[% END %]
117                             </fieldset>
118                             </form>
119                             [% ELSE %]
120                                                         <div class="dialog message">
121                             <h4>There are no
122                             [% PROCESS translate_label_element element=label_element_title %]
123                             currently available.</h4>
124                             <p>Use the toolbar above to create a new
125                             [% PROCESS translate_label_element element=label_element %].</p></div>
126                             [% END %]
127                         </div>
128             </main>
129         </div> <!-- /.col-sm-10.col-sm-push-2 -->
130
131         <div class="col-sm-2 col-sm-pull-10">
132             <aside>
133                 [% INCLUDE 'tools-menu.inc' %]
134             </aside>
135         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
136      </div> <!-- /.row -->
137
138 [% MACRO jsinclude BLOCK %]
139     [% Asset.js("js/tools-menu.js") | $raw %]
140     [% INCLUDE 'greybox.inc' %]
141     [% INCLUDE 'datatables.inc' %]
142     <script>
143         function Xport() {
144             batches= new Array;
145             if(document.layouts.action.length > 0) {
146                 for (var i=0; i < document.layouts.action.length; i++) {
147                     if (document.layouts.action[i].checked) {
148                         batches.push("batch_id=" +  document.layouts.action[i].value);
149                     }
150                 }
151                 if (batches.length < 1) {
152                     alert(_("Please select at least one batch to export."));
153                     return;     // no batch selected
154                 }
155                 getstr = batches.join("&");
156             }
157             else if (document.layouts.action.checked) {
158                 getstr = "batch_id="+document.layouts.action.value;
159             }
160             else {
161                 alert(_("Please select at least one batch to export."));
162                 return;     // no batch selected
163             }
164             return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800);
165         }
166         function selected_layout(op) {
167             var selected = new Array;
168             if (document.layouts.action.length) {
169                 for (i=0;i<document.layouts.action.length;i++){
170                     if (document.layouts.action[i].checked){
171                         selected.push(i);
172                     }
173                 };
174                 if (selected.length == 1) {
175                     return(document.layouts.action[selected[0]].value);
176                 }
177                 else {
178                     alert(_("Please select only one %s to %s.").format("[% label_element | html %]", op));
179                     return (-1);
180                 }
181             }
182             else {
183                 if (document.layouts.action.checked){
184                     return(document.layouts.action.value);
185                 }
186             };
187             alert(_("Please select a %s.").format("[% label_element | html %]"));
188             return (-1);
189         }
190         $(document).ready(function(){
191             $("#print").click(function(e){
192                 e.preventDefault();
193                 Xport();
194             });
195             $(".delete").on("click", function(){
196                 return confirmDelete( _("Are you sure you want to delete this?") );
197             });
198             $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
199                 "sPaginationType": "full",
200                 "aaSorting": [[ 1, "asc" ]],
201                 "aoColumnDefs": [
202                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
203                 ]
204             }));
205         });
206     </script>
207 [% END %]
208
209 [% INCLUDE 'intranet-bottom.inc' %]