Bug 19036: Add ability to auto generate a number for account credits
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / desks.tt
blob022968b7c61b23ebe413a6760b42e294102c5ca8
1 [% USE raw %]
2 [% USE Branches %]
3 [% USE Asset %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Administration &rsaquo; [% IF op =='add_form' %]Desks &rsaquo; [% IF desk.desk_id %] Modify desk[% ELSE %] New desk[% END %][% ELSE %][% IF op == 'delete_confirm' %]Desks &rsaquo; Confirm deletion of desk[% ELSE %] Desks[% END %][% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
10 <body id="admin_desks" class="admin">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'desks-admin-search.inc' %]
14 <div id="breadcrumbs">
15     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
16     &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
17     &rsaquo; <a href="/cgi-bin/koha/admin/desks.pl">Desks</a>
18     [% IF op == 'add_form' %]
19     &rsaquo; [% IF desk.desk_id %]Modify[% ELSE %]New[% END %] Desk
20     [% ELSIF op == 'delete_confirm' %]
21     &rsaquo; Confirm deletion of desk
22     [% END %]
23 </div>
25 <div class="main container-fluid">
26     <div class="row">
27         <div class="col-sm-10 col-sm-push-2">
28             <main>
30 [% FOR m IN messages %]
31     <div class="dialog [% m.type | html %]">
32         [% SWITCH m.code %]
33         [% CASE 'error_on_update' %]
34             An error occurred when updating this desk. Perhaps it already exists.
35         [% CASE 'error_on_insert' %]
36             An error occurred when adding this desk. The desk ID might already exist.
37         [% CASE 'error_on_delete' %]
38             An error occurred when deleting this desk. Check the logs.
39         [% CASE 'success_on_update' %]
40             Desk updated successfully.
41         [% CASE 'success_on_insert' %]
42             Desk added successfully.
43         [% CASE 'success_on_delete' %]
44             Desk deleted successfully.
45         [% CASE 'already_exists' %]
46             This desk already exists.
47         [% CASE %]
48             [% m.code | html %]
49         [% END %]
50     </div>
51 [% END %]
53 [% IF op == 'add_form' %]
54     [% IF desk %]
55         <h1>Modify a desk</h1>
56     [% ELSE %]
57         <h1>New desk</h1>
58     [% END %]
60     <form action="/cgi-bin/koha/admin/desks.pl" name="Aform" method="post" class="validated">
61         <input type="hidden" name="op" value="add_validate" />
62         <input type="hidden" name="desk_id" value="[% desk.desk_id | html %]" />
64         <fieldset class="rows">
65             <ol>
66                 [% IF desk %]
67                     <li><span class="label">Desk ID: </span>[% desk.desk_id | html %]</li>
68                 [% END %]
69                 <li>
70                     <label for="desk_name" class="required">Desk: </label>
71                     <input type="text" name="desk_name" id="desk_name" size="80" maxlength="100" value="[% desk.desk_name | html %]" required="required" class="required" /> <span class="required">Required</span>
72                 </li>
73                 <li>
74                     <label for="branchcode" class="required">Library: </label>
75                     <select id="branchcode" name="branchcode" required="required">
76                       <option value=""></option>
77                       [% FOREACH branch IN branches %]
78                         [% IF (Branches.GetLoggedInBranchcode == branch.branchcode) %]
79                         <option value="[% branch.branchcode|html %]" selected="selected">[% branch.branchname|html %]</option>
80                         [% ELSE %]
81                         <option value="[% branch.branchcode|html %]">[% branch.branchname|html %]</option>
82                         [% END %]
83                       [% END %]
84                      </select>
85                 </li>
87             </ol>
88         </fieldset>
90         <fieldset class="action">
91             <input type="submit" value="Submit" />
92             <a class="cancel" href="/cgi-bin/koha/admin/desks.pl">Cancel</a>
93         </fieldset>
94     </form>
95 [% END %]
97 [% IF op == 'delete_confirm' %]
98     <div class="dialog alert">
99         <h3>Delete desk "[% desk.desk_name | html %]?"</h3>
100         <table>
101             <tr><th>Desk ID</th>
102                 <td>[% desk.desk_id | html %]</td>
103             </tr>
104             <tr><th>Desk</th>
105                 <td>[% desk.desk_name | html %]</td>
106             </tr>
107             <tr><th>Library</th>
108                 <td>[% Branches.GetName( desk.branchcode ) | html %]</td>
109             </tr>
110         </table>
111         <form action="/cgi-bin/koha/admin/desks.pl" method="post">
112             <input type="hidden" name="op" value="delete_confirmed" />
113             <input type="hidden" name="desk_id" value="[% desk.desk_id | html %]" />
114             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
115         </form>
116         <form action="/cgi-bin/koha/admin/desks.pl" method="get">
117             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
118         </form>
119     </div>
120 [% END %]
122 [% IF op == 'list' %]
124     <div id="toolbar" class="btn-toolbar">
125         <a class="btn btn-default" id="newdesk" href="/cgi-bin/koha/admin/desks.pl?op=add_form"><i class="fa fa-plus"></i> New desk</a>
126     </div>
128     <h2>Desks</h2>
129     [% IF searchfield %]
130         Searching: [% searchfield | html %]
131     [% END %]
133     [% IF desks.count %]
134         <table id="table_desks">
135             <thead>
136                 <tr>
137                     <th>Desk ID</th>
138                     <th>Desk</th>
139                     <th>Library</th>
140                     <th>Action</th>
141                 </tr>
142             </thead>
143             <tbody>
144                 [% FOREACH desk IN desks %]
145                 <tr>
146                     <td>[% desk.desk_id | html %]</td>
147                     <td>[% desk.desk_name | html %]</td>
148                     <td>[% Branches.GetName( desk.branchcode ) | html %]</td>
149                     <td class="actions">
150                         <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/desks.pl?op=add_form&amp;desk_id=[% desk.desk_id | html %]"><i class="fa fa-pencil"></i> Edit</a>
151                         <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/desks.pl?op=delete_confirm&amp;desk_id=[% desk.desk_id | html %]"><i class="fa fa-trash"></i> Delete</a>
152                     </td>
153                 </tr>
154                 [% END %]
155             </tbody>
156         </table>
157     [% ELSE %]
158         <div class="dialog message">
159             There are no desks defined. <a href="/cgi-bin/koha/admin/desks.pl?op=add_form">Create a new desk</a>.
160         </div>
161     [% END %]
162 [% END %]
164             </main>
165         </div> <!-- /.col-sm-10.col-sm-push-2 -->
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 -->
174 [% MACRO jsinclude BLOCK %]
175     [% Asset.js("js/admin-menu.js") | $raw %]
176     [% INCLUDE 'datatables.inc' %]
177     <script>
178         $(document).ready(function() {
179             $("#table_desks").dataTable($.extend(true, {}, dataTablesDefaults, {
180                 "aoColumnDefs": [
181                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
182                 ],
183                 "aaSorting": [[ 1, "asc" ]],
184                 "iDisplayLength": 10,
185                 "sPaginationType": "full_numbers"
186             }));
187         });
188     </script>
189 [% END %]
190 [% INCLUDE 'intranet-bottom.inc' %]