Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / printers.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Administration &rsaquo;
5 [% IF ( add_form ) %][% IF ( searchfield ) %] Printers &rsaquo; Modify printer '[% searchfield | html %]'[% ELSE %] Printers &rsaquo; New printer[% END %][% END %]
6 [% IF ( add_validate ) %] Printers &rsaquo; Printer added[% END %]
7 [% IF ( delete_confirm ) %] Printers &rsaquo; Confirm deletion of printer '[% searchfield | html %]'[% END %]
8 [% IF ( delete_confirmed ) %] Printers &rsaquo; Printer deleted[% END %]
9 [% IF ( else ) %]Printers[% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% IF ( loop ) %]
12 [% Asset.css("css/datatables.css") | $raw %]
13 [% INCLUDE 'datatables.inc' %]
14 <script>
15 //<![CDATA[
16     $(document).ready(function() {
17         $("#printerst").dataTable($.extend(true, {}, dataTablesDefaults, {
18             "aoColumnDefs": [
19                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
20             ],
21             "aaSorting": [[ 0, "asc" ]],
22             "sPaginationType": "four_button"
23         }));
24     });
25 //]]>
26 </script>
27 [% END %]
28 </head>
29 <body id="admin_printers" class="admin">
30 [% INCLUDE 'header.inc' %]
31 [% INCLUDE 'cat-search.inc' %]
32
33 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( add_form ) %][% IF ( searchfield ) %] <a href="/cgi-bin/koha/admin/printers.pl">Printers</a> &rsaquo; Modify printer '[% searchfield | html %]'[% ELSE %] <a href="/cgi-bin/koha/admin/printers.pl">Printers</a> &rsaquo; New printer[% END %][% END %]
34 [% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/printers.pl">Printers</a> &rsaquo; Printer added[% END %]
35 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/printers.pl">Printers</a> &rsaquo; Confirm deletion of printer '[% searchfield | html %]'[% END %]
36 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/printers.pl">Printers</a> &rsaquo; Printer deleted[% END %]
37 [% IF ( else ) %]Printers[% END %]</div>
38
39 <div class="main container-fluid">
40     <div class="row">
41         <div class="col-sm-10 col-sm-push-2">
42             <main>
43
44 [% IF ( add_form ) %]
45
46 [% IF ( searchfield ) %]
47                 <h1>Modify printer</h1>
48         [% ELSE %]
49                 <h1>New printer</h1>
50         [% END %]
51         <form action="[% script_name | html %]" name="Aform" method="post" class="validated">
52         <input type="hidden" name="op" value="add_validate" />
53         [% IF ( searchfield ) %]
54                 <input type="hidden" name="add" value="0" />
55         [% ELSE %]
56                 <input type="hidden" name="add" value="1" />
57         [% END %]
58         <fieldset class="rows">
59 <ol>    [% IF ( searchfield ) %]
60                 <li>
61             <span class="label">Printer name: </span>
62                                 <input type="hidden" name="printername" id="" value="[% searchfield | html %]" />[% searchfield | html %]
63                 </li>
64         [% ELSE %]
65                 <li>
66             <label for="printername" class="required">Printer name: </label>
67                 <input type="text" name="printername" id="printername" size="40" maxlength="40" class="required" required="required" />
68                 <span class="required">Required</span>
69                 </li>
70         [% END %]
71                 <li>
72             <label for="printqueue" class="required">Queue: </label>
73             <input type="text" name="printqueue" id="printqueue" size="20" maxlength="20" value="[% printqueue | html %]"  class="required" required="required" />
74             <span class="required">Required</span>
75                 </li>
76                 <li>
77                         <label for="printtype">Type: </label>
78             <input type="text" name="printtype" id="printtype" size="20" maxlength="20" value="[% printtype | html %]" />
79                 </li></ol>
80         </fieldset>
81         <fieldset class="action"><input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/printers.pl">Cancel</a></fieldset>
82         </form>
83
84 [% END %]
85
86 [% IF ( add_validate ) %]
87 <h3>Printer added</h3>
88 <form action="[% script_name | html %]" method="post">
89        <fieldset class="action"> <input type="submit" value="OK" /></fieldset>
90 </form>
91 [% END %]
92
93 [% IF ( delete_confirm ) %]
94     <div class="dialog alert">
95         <h3>Confirm deletion of printer <em>[% searchfield | html %]</em></h3>
96
97         <table>
98             <tr>
99                 <th scope="row">Printer: </th><td>[% searchfield | html %]</td>
100             </tr>
101             <tr>
102                 <th scope="row">Queue: </th><td>[% printqueue | html %]</td>
103             </tr>
104             <tr>
105                 <th scope="row">Type: </th><td>[% printtype | html %]</td>
106             </tr>
107         </table>
108
109         <form action="[% script_name | html %]" method="post">
110             <input type="hidden" name="op" value="delete_confirmed" />
111             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
112             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
113         </form>
114         <form action="/cgi-bin/koha/admin/printers.pl" method="get">
115             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
116         </form>
117     </div>
118 [% END %]
119
120 [% IF ( delete_confirmed ) %]
121     <div class="dialog message">
122         <h3>Printer deleted</h3>
123         <form action="[% script_name | html %]" method="post">
124             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
125         </form>
126     </div>
127
128 [% END %]
129
130 [% IF ( else ) %]
131
132 <div id="toolbar" class="btn-toolbar">
133     <a class="btn btn-default btn-sm" id="newprinter" href="/cgi-bin/koha/admin/printers.pl?op=add_form"><i class="fa fa-plus"></i> New printer</a>
134 </div>
135
136 <h2>Printers</h2>
137         [% IF ( searchfield ) %]
138                 You searched for [% searchfield | html %]</span>
139         [% END %]
140
141 [% IF ( loop ) %]
142     <table id="printerst">
143         <thead>
144             <tr>
145                 <th>Name</th>
146                 <th>Queue</th>
147                 <th>Type</th>
148                 <th>&nbsp;</th>
149             </tr>
150         </thead>
151         <tbody>
152                 [% FOREACH loo IN loop %]
153         <tr>
154                         <td>[% loo.printername | html %]</td>
155                         <td>[% loo.printqueue | html %]</td>
156                         <td>[% loo.printtype | html %]</td>
157             <td class="actions"><a class="btn btn-default btn-xs" href="[% loo.script_name | url %]?op=add_form&amp;searchfield=[% loo.printername |uri %]"><i class="fa fa-pencil"></i> Edit</a> <a class="btn btn-default btn-xs" href="[% loo.script_name | url %]?op=delete_confirm&amp;searchfield=[% loo.printername |uri %]"><i class="fa fa-trash"></i> Delete</a></td>
158                 </tr>
159                 [% END %]
160         </tbody>
161     </table>[% ELSE %]<div class="dialog message">No printers defined.</div>[% END %]
162 [% END %]
163
164             </main>
165         </div> <!-- /.col-sm-10.col-sm-push-2 -->
166
167         <div class="col-sm-2 col-sm-pull-10">
168             <aside>
169                 [% INCLUDE 'admin-menu.inc' %]
170             </aside>
171         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
172      </div> <!-- /.row -->
173
174 [% INCLUDE 'intranet-bottom.inc' %]