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