Bug 35650: (follow-up) Other cases found
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / ill_batch_statuses.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% USE Price %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>
8     [% IF op =='add_form' %]
9        [% IF status.id %]
10            Modify batch status
11        [% ELSE %]
12            New batch status
13        [% END %] &rsaquo; [% END %]
14     Interlibrary loan batch statuses &rsaquo; Administration &rsaquo; Koha
15 </title>
16 [% INCLUDE 'doc-head-close.inc' %]
17 </head>
18
19 <body id="admin_ill_batch_statuses" class="admin">
20 [% INCLUDE 'header.inc' %]
21 [% INCLUDE 'prefs-admin-search.inc' %]
22
23 [% WRAPPER 'sub-header.inc' %]
24     [% WRAPPER breadcrumbs %]
25         [% WRAPPER breadcrumb_item %]
26             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
27         [% END %]
28         [% IF op == 'add_form' %]
29             [% WRAPPER breadcrumb_item %]
30                 <a href="/cgi-bin/koha/admin/ill_batch_statuses.pl">Interlibrary loan batch statuses</a>
31             [% END %]
32             [% WRAPPER breadcrumb_item bc_active= 1 %]
33                 [% IF status.id %]
34                     <span>Modify batch status</span>
35                 [% ELSE %]
36                     <span>New batch status</span>
37                 [% END %]
38             [% END %]
39         [% ELSE %]
40             [% WRAPPER breadcrumb_item bc_active= 1 %]
41                 Interlibrary loan batch statuses
42             [% END %]
43         [% END %]
44     [% END #/ WRAPPER breadcrumbs %]
45 [% END #/ WRAPPER sub-header.inc %]
46
47 <div class="main container-fluid">
48     <div class="row">
49         <div class="col-sm-10 col-sm-push-2">
50             <main>
51
52                 [% FOREACH m IN messages %]
53                 <div class="dialog [% m.type | html %]">
54                     [% SWITCH m.code %]
55                     [% CASE 'success_on_saving' %]
56                         <span>Batch status saved successfully.</span>
57                     [% CASE 'success_on_delete' %]
58                         <span>Batch status deleted successfully.</span>
59                     [% CASE 'error_on_saving' %]
60                         <span>An error occurred when saving this batch status. Check the logs for details.</span>
61                     [% CASE 'error_on_delete' %]
62                         <span>An error occurred when deleting this batch status.</span>
63                     [% CASE %]
64                         <span>[% m.code | html %]</span>
65                     [% END %]
66                 </div>
67                 [% END %]
68
69                 [% IF op == 'add_form' %]
70                     [% IF status %]
71                         <h1>Modify a batch status</h1>
72                     [% ELSE %]
73                         <h1>New batch status</h1>
74                     [% END %]
75
76                     <form action="/cgi-bin/koha/admin/ill_batch_statuses.pl" name="Aform" method="post" class="validated">
77                         <input type="hidden" name="op" value="add_validate" />
78                         <fieldset class="rows">
79                             <ol>
80                                 <li>
81                                     <label for="name" class="required">Name: </label>
82                                     <input type="text" name="name" id="name" size="80" maxlength="100" class="required focus" required="required" value="[% status.name | html %]"><span class="required">Required. Maximum length is 100 letters</span>
83                                 </li>
84                                 <li>
85                                     <label for="code">Code: </label>
86                                     [% IF status %]
87                                         <strong>[% status.code | html %]</strong>
88                                         <input type="hidden" name="code" value="[% status.code | html %]" />
89                                     [% ELSE %]
90                                     <input type="text" name="code" id="code" size="80" maxlength="20" class="required" required="required" value="[% status.code | html %]"><span class="required">Required, specify UPPERCASE LETTERS. Maximum length is 20 letters</span>
91                                     [% END %]
92                                 </li>
93                                 <li>
94                                     <label for="is_system">Is a system status: </label>
95                                     [% IF status.is_system %]
96                                         <strong>Yes</strong>
97                                     [% ELSE %]
98                                         <strong>No</strong>
99                                     [% END %]
100                                     <input type="hidden" name="is_system" value="[% status.is_system | html %]" />
101                                 </li>
102                             </ol>
103                         </fieldset>
104
105                         <fieldset class="action">
106                             <button id="save_batch_status" class="btn btn-primary">Save</button>
107                             <a class="cancel" href="/cgi-bin/koha/admin/ill_batch_statuses.pl">Cancel</a>
108                         </fieldset>
109                     </form>
110                 [% END %]
111
112                 [% IF op == 'list' %]
113                     <div id="toolbar" class="btn-toolbar">
114                         <a class="btn btn-default" id="newillbatchstatus" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form"><i class="fa fa-plus"></i> New batch status</a>
115                     </div>
116
117                     <h1>Interlibrary loan batch statuses</h1>
118                     [% IF statuses.count %]
119                         <div class="page-section">
120                             <table id="table_batch_statuses">
121                                 <thead>
122                                     <th>Name</th>
123                                     <th>Code</th>
124                                     <th>Is system</th>
125                                     <th class="noExport">Actions</th>
126                                 </thead>
127                                 <tbody>
128                                     [% FOREACH status IN statuses %]
129                                     <tr>
130                                         <td>[% status.name | html %]</td>
131                                         <td>[% status.code | html %]</td>
132                                         <td>[% status.is_system ? "Yes" : "No" | html %]</td>
133                                         <td class="actions">
134                                             <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form&amp;code=[% status.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
135                                             [% IF !status.is_system %]
136                                             <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=delete&amp;code=[% status.code | uri %]"><i class="fa fa-delete"></i> Delete</a>
137                                             [% END %]
138                                         </td>
139                                     </tr>
140                                     [% END %]
141                                 </tbody>
142                             </table>
143                         </page-section>
144                     [% ELSE %]
145                         <div class="dialog message">
146                             There are no batch statuses defined. <a href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form">Create new batch status</a>
147                         </div>
148                     [% END %]
149                 [% END %]
150             </main>
151         </div> <!-- /.col-sm-10.col-sm-push-2 -->
152
153         <div class="col-sm-2 col-sm-pull-10">
154             <aside>
155                 [% INCLUDE 'admin-menu.inc' %]
156             </aside>
157         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
158     </div> <!-- /.row -->
159
160 [% MACRO jsinclude BLOCK %]
161     [% Asset.js("js/admin-menu.js") | $raw %]
162     [% INCLUDE 'datatables.inc' %]
163 [% END %]
164
165 [% INCLUDE 'intranet-bottom.inc' %]