Bug 31986: Add page-section to various administration pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / edi_accounts.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Asset %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>
7 [% IF acct_form %]
8     [% IF account %]
9         Modify account
10     [% ELSE %]
11         Add new account
12     [% END %] &rsaquo; [% END %]
13 [% IF delete_confirm %]
14     Confirm deletion of account &rsaquo; [% END %]
15 EDI accounts &rsaquo; Administration &rsaquo; Koha
16 </title>
17 [% INCLUDE 'doc-head-close.inc' %]
18 </head>
19 <body id="admin_edi_acct" class="admin">
20 [% WRAPPER 'header.inc' %]
21     [% INCLUDE 'prefs-admin-search.inc' %]
22 [% END %]
23
24 [% WRAPPER 'sub-header.inc' %]
25 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
26     <ol>
27         <li>
28             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
29         </li>
30         <li>
31             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
32         </li>
33
34         [% IF acct_form %]
35             <li>
36                 <a href="/cgi-bin/koha/admin/edi_accounts.pl">EDI accounts</a>
37             </li>
38             [% IF account %]
39                 <li>
40                     <a href="#" aria-current="page">
41                         Modify account
42                     </a>
43                 </li>
44             [% ELSE %]
45                 <li>
46                     <a href="#" aria-current="page">
47                         Add new account
48                     </a>
49                 </li>
50             [% END %]
51
52         [% ELSIF delete_confirm %]
53             <li>
54                 <a href="/cgi-bin/koha/admin/edi_accounts.pl">EDI accounts</a>
55             </li>
56             <li>
57                 <a href="#" aria-current="page">
58                     Confirm deletion of account
59                 </a>
60             </li>
61
62         [% ELSE %]
63             <li>
64                 <a href="#" aria-current="page">
65                     EDI accounts
66                 </a>
67             </li>
68         [% END %]
69     </ol>
70 </nav>
71 [% END %]
72
73 <div class="main container-fluid">
74     <div class="row">
75         <div class="col-sm-10 col-sm-push-2">
76             <main>
77
78
79 [% UNLESS Koha.Preference('EDIFACT') %]
80     <div class="dialog message">
81         EDIFACT is currently disabled
82     </div>
83 [% END %]
84
85 [% IF display %]
86     <div id="toolbar" class="btn-toolbar">
87     <a class="btn btn-default" id="newediacct" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form">
88          <i class="fa fa-plus"></i>
89          New account
90     </a>
91     </div>
92 [% END %]
93
94 [% IF acct_form %]
95 <form action="/cgi-bin/koha/admin/edi_accounts.pl" name="Actform" method="post">
96   <input type="hidden" name="op" value="save" />
97   [% IF account %]
98   <input type="hidden" name="id" value="[% account.id | html %]" />
99   [% END %]
100   <fieldset class="rows">
101   <legend>
102         <h1>
103             [% IF account %]
104                 Modify account
105             [% ELSE %]
106                 New account
107             [% END %]
108         </h1>
109   </legend>
110
111   <ol>
112   <li>
113      <label for="vendor_id">Vendor: </label>
114      <select name="vendor_id" id="vendor_id">
115      [% FOREACH vendor IN vendors %]
116        [% IF account.vendor_id == vendor.id %]
117           <option value="[% vendor.id | html %]" selected="selected">[% vendor.name | html %]</option>
118        [% ELSE %]
119           <option value="[% vendor.id | html %]">[% vendor.name | html %]</option>
120        [% END %]
121      [% END %]
122      </select>
123   </li>
124   [% IF plugins %]
125   <li>
126      <label for="plugin">Plugin: </label>
127      <select name="plugin" id="plugin">
128         <option value="">Do not use plugin</option>
129         [% FOREACH plugin IN plugins %]
130             [% IF account.plugin == plugin.class %]
131                 <option value="[% plugin.class | html %]" selected="selected">[% plugin.metadata.name | html %]</option>
132             [% ELSE %]
133                 <option value="[% plugin.class | html %]">[% plugin.metadata.name | html %]</option>
134             [% END %]
135         [% END %]
136      </select>
137   </li>
138   [% ELSE %]
139   <input type="hidden" name="plugin" value="" />
140   [% END %]
141   <li>
142      <label for="description">Description: </label>
143      <input type="text" name="description" id="description" size="20" value="[% account.description | html %]" />
144   </li>
145   <li>
146      [% transport_types = [ 'FTP', 'SFTP', 'FILE' ] %]
147      <label for="transport">Transport: </label>
148      <select name="transport" title="valid types of transport are FTP and SFTP"
149       id="transport">
150       [% FOREACH transport_type IN transport_types %]
151            [% IF transport_type == account.transport %]
152               <option value="[% transport_type | html %]" selected="selected">[% transport_type | html %]</option>
153            [% ELSE %]
154               <option value="[% transport_type | html %]">[% transport_type | html %]</option>
155            [% END %]
156        [% END %]
157      </select>
158   </li>
159   <li>
160      <label for="host">Remote host: </label>
161      <input type="text" name="host" id="host" size="20" maxlength="40" value="[% account.host | html %]" />
162   </li>
163   <li>
164      <label for="username">Username: </label>
165      <input type="text" name="username" id="username" size="20" maxlength="40" value="[% account.username | html %]" />
166   </li>
167   <li>
168      <label for="password">Password: </label>
169      <input type="text" name="password" id="password" size="20" maxlength="40" value="[% account.password | html %]" />
170   </li>
171   <li>
172      <label for="download_directory">Download directory: </label>
173      <input type="text" name="download_directory" id="download_directory" size="20" value="[% account.download_directory | html %]" />
174         <div class="hint">The download directory specifies the directory on the ftp site from which quotes and invoices are downloaded.</div>
175   </li>
176   <li>
177      <label for="upload_directory">Upload directory: </label>
178      <input type="text" name="upload_directory" id="upload_directory" size="20" value="[% account.upload_directory | html %]" />
179         <div class="hint">The upload directory specifies the directory on the ftp site to which orders are uploaded.</div>
180   </li>
181   <li>
182      <label for="id_code_qualifier">Qualifier:</label>
183      <select name="id_code_qualifier" id="id_code_qualifier">
184      [% FOREACH qualifier IN code_qualifiers %]
185         [% IF qualifier.code == account.id_code_qualifier %]
186            <option value="[% qualifier.code | html %]" selected="selected">
187                [% qualifier.description | html %] ([% qualifier.code | html %])
188            </option>
189         [% ELSE %]
190            <option value="[% qualifier.code | html %]">
191               [% qualifier.description | html %] ([% qualifier.code | html %])
192            </option>
193         [% END %]
194      [% END %]
195    </select>
196   </li>
197   <li>
198      <label for="san">SAN: </label>
199      <input type="text" name="san" id="san" size="20" maxlength="20" value="[% account.san | html %]" />
200   </li>
201   <li>
202      <label for="standard">Standard:</label>
203      <select name="standard" id="standard">
204      [% FOREACH standard IN standards %]
205         [% IF standard == 'BIC' %]
206         [% SET description = 'BiC' %]
207         [% ELSE %]
208         [% SET description = 'EDItEUR' %]
209         [% END %]
210         [% IF standard == account.standard %]
211            <option value="[% standard | html %]" selected="selected">
212                [% description | html %]
213            </option>
214         [% ELSE %]
215            <option value="[% standard | html %]">
216               [% description | html %]
217            </option>
218         [% END %]
219      [% END %]
220    </select>
221   </li>
222   <li>
223      <label for="quotes_enabled">Quotes enabled: </label>
224       [% IF account.quotes_enabled %]
225      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="1" checked="checked" />
226       [% ELSE %]
227      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="1" />
228       [% END %]
229   </li>
230   <li>
231      <label for="orders_enabled">Orders enabled: </label>
232 [% IF account.orders_enabled %]
233      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="1" checked="checked" />
234 [% ELSE %]
235      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="1" />
236 [% END %]
237   </li>
238   <li>
239      <label for="invoices_enabled">Invoices enabled: </label>
240 [% IF account.invoices_enabled %]
241      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="1" checked="checked" />
242 [% ELSE %]
243      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="1" />
244 [% END %]
245   </li>
246   <li>
247      <label for="responses_enabled">Responses enabled: </label>
248 [% IF account.responses_enabled %]
249      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="1" checked="checked" />
250 [% ELSE %]
251      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="1" />
252 [% END %]
253   </li>
254   <li>
255      <label for="auto_orders">Automatic ordering: </label>
256 [% IF account.auto_orders %]
257      <input type="checkbox" name="auto_orders" id="auto_orders" value="1" checked="checked" />
258 [% ELSE %]
259      <input type="checkbox" name="auto_orders" id="auto_orders" value="1" />
260 [% END %]
261     <div class="hint">
262         With automatic ordering quotes generate orders without staff intervention.
263     </div>
264   </li>
265   </ol>
266   </fieldset>
267
268   <fieldset class="action">
269     <input type="submit" value="Submit" />
270     <a href="/cgi-bin/koha/admin/edi_accounts.pl" class="cancel">Cancel</a>
271   </fieldset>
272 </form>
273
274 [% END %]
275 [% IF delete_confirm %]
276 <div class="dialog alert">
277 <h1>Delete this account?</h1>
278 <table>
279     <tr>
280     <th>Vendor</th>
281     <td>[% account.vendor.name | html %]</td>
282     </tr>
283     <tr>
284     <th>Description</th>
285     <td>[% account.description | html %]</td>
286     </tr>
287     <tr>
288     <th>SAN</th>
289     <td>[% account.san | html %]</td>
290     </tr>
291 </table>
292 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="post">
293     <table>
294     </table>
295     <input type="hidden" name="op" value="delete_confirmed" />
296     <input type="hidden" name="id" value="[% account.id | html %]" />
297     <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
298 </form>
299 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="get">
300     <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
301 </form>
302 </div>
303 [% END %]
304 [% IF display %]
305 [% IF ( ediaccounts ) %]
306 <h1>Vendor EDI accounts</h1>
307 <div class="page-section">
308     <table>
309     <tr>
310        <th>ID</th>
311        <th>Vendor</th>
312        <th>Description</th>
313        <th>Transport</th>
314        <th>Remote host</th>
315        <th>Username</th>
316        <th>Password</th>
317        <th>Download directory</th>
318        <th>Upload directory</th>
319        <th>Qualifier</th>
320        <th>SAN</th>
321        <th>Standard</th>
322        <th>Quotes</th>
323        <th>Orders</th>
324        <th>Invoices</th>
325        <th>Responses</th>
326        <th>Auto ordering</th>
327        <th class="noExport">Actions</th>
328     </tr>
329     [% FOREACH account IN ediaccounts %]
330     <tr>
331       <td>[% account.id | html %]</td>
332       <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% account.vendor_id | uri %]">[% account.vendor.name | html %]</a></td>
333       <td>[% account.description | html %]</td>
334       <td>[% account.transport | html %]</td>
335       <td>[% account.host | html %]</td>
336       <td>[% account.username | html %]</td>
337       <td>[% IF account.password %]*****[% END %]</td>
338       <td>[% account.download_directory | html %]</td>
339       <td>[% account.upload_directory | html %]</td>
340       <td>
341          [% FOREACH qualifier IN code_qualifiers %]
342             [% IF qualifier.code == account.id_code_qualifier %]
343                    [% qualifier.description | html %]
344             [% END %]
345          [% END %]
346          ([% account.id_code_qualifier | html %])
347      </td>
348       <td>[% account.san | html %]</td>
349       <td>[% IF account.standard == 'BIC' %]BiC[% ELSE %]EDItEUR[% END %]</td>
350       [% IF account.quotes_enabled %]
351          <td>Yes</td>
352       [% ELSE %]
353          <td>No</td>
354       [% END %]
355       [% IF account.orders_enabled %]
356          <td>Yes</td>
357       [% ELSE %]
358          <td>No</td>
359       [% END %]
360       [% IF account.invoices_enabled %]
361          <td>Yes</td>
362       [% ELSE %]
363          <td>No</td>
364       [% END %]
365       [% IF account.responses_enabled %]
366          <td>Yes</td>
367       [% ELSE %]
368          <td>No</td>
369       [% END %]
370       [% IF account.auto_orders %]
371          <td>Yes</td>
372       [% ELSE %]
373          <td>No</td>
374       [% END %]
375       <td class="actions">
376           <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form&id=[% account.id | html %]"><i class="fa fa-pencil"></i> Edit</a> <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/edi_accounts.pl?op=delete_confirm&id=[% account.id | html %]"><i class="fa fa-trash"></i> Delete</a>
377       </td>
378     </tr>
379     [% END %]
380     </table>
381 </div> <!-- /.page-section -->
382     [% ELSE %]
383         <div class="dialog message">
384             There are no EDI accounts.
385         </div>
386     [% END %]
387 [% END %]
388
389             </main>
390         </div> <!-- /.col-sm-10.col-sm-push-2 -->
391
392         <div class="col-sm-2 col-sm-pull-10">
393             <aside>
394                 [% INCLUDE 'admin-menu.inc' %]
395             </aside>
396         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
397      </div> <!-- /.row -->
398
399 [% MACRO jsinclude BLOCK %]
400     [% Asset.js("js/admin-menu.js") | $raw %]
401 [% END %]
402 [% INCLUDE 'intranet-bottom.inc' %]