Bug 33076: (QA follow-up) Update context hint to "EDIFACT message QUOTE"
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / edi_accounts.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Asset %]
4 [% PROCESS 'i18n.inc' %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>
8 [% IF acct_form %]
9     [% IF account %]
10         Modify account
11     [% ELSE %]
12         Add new account
13     [% END %] &rsaquo; [% END %]
14 [% IF delete_confirm %]
15     Confirm deletion of account &rsaquo; [% END %]
16 EDI accounts &rsaquo; Administration &rsaquo; Koha
17 </title>
18 [% INCLUDE 'doc-head-close.inc' %]
19 </head>
20 <body id="admin_edi_acct" class="admin">
21 [% WRAPPER 'header.inc' %]
22     [% INCLUDE 'prefs-admin-search.inc' %]
23 [% END %]
24
25 [% WRAPPER 'sub-header.inc' %]
26     [% WRAPPER breadcrumbs %]
27         [% WRAPPER breadcrumb_item %]
28             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
29         [% END %]
30
31         [% IF acct_form || delete_confirm %]
32             [% WRAPPER breadcrumb_item %]
33                 <a href="/cgi-bin/koha/admin/edi_accounts.pl">EDI accounts</a>
34             [% END %]
35         [% ELSE %]
36             [% WRAPPER breadcrumb_item bc_active= 1 %]
37                 <span>EDI accounts</span>
38             [% END %]
39         [% END %]
40
41         [% IF acct_form %]
42             [% IF account %]
43                 [% WRAPPER breadcrumb_item bc_active= 1 %]
44                     <span>Modify account</span>
45                 [% END %]
46             [% ELSE %]
47                 [% WRAPPER breadcrumb_item bc_active= 1 %]
48                     <span>Add new account</span>
49                 [% END %]
50             [% END %]
51
52         [% ELSIF delete_confirm %]
53             [% WRAPPER breadcrumb_item bc_active= 1 %]
54                 <span>Confirm deletion of account</span>
55             [% END %]
56         [% END %]
57     [% END #/ WRAPPER breadcrumbs %]
58 [% END #/ WRAPPER sub-header.inc %]
59
60 <div class="main container-fluid">
61     <div class="row">
62         <div class="col-sm-10 col-sm-push-2">
63             <main>
64
65
66 [% UNLESS Koha.Preference('EDIFACT') %]
67     <div class="dialog message">
68         EDIFACT is currently disabled
69     </div>
70 [% END %]
71
72 [% IF display %]
73     <div id="toolbar" class="btn-toolbar">
74     <a class="btn btn-default" id="newediacct" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form">
75          <i class="fa fa-plus"></i>
76          New account
77     </a>
78     </div>
79 [% END %]
80
81 [% IF acct_form %]
82 <form action="/cgi-bin/koha/admin/edi_accounts.pl" name="Actform" method="post">
83   <input type="hidden" name="op" value="save" />
84   [% IF account %]
85   <input type="hidden" name="id" value="[% account.id | html %]" />
86   [% END %]
87   <fieldset class="rows">
88   <legend>
89         <h1>
90             [% IF account %]
91                 Modify account
92             [% ELSE %]
93                 New account
94             [% END %]
95         </h1>
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="standard">Standard:</label>
190      <select name="standard" id="standard">
191      [% FOREACH standard IN standards %]
192         [% IF standard == 'BIC' %]
193         [% SET description = 'BiC' %]
194         [% ELSE %]
195         [% SET description = 'EDItEUR' %]
196         [% END %]
197         [% IF standard == account.standard %]
198            <option value="[% standard | html %]" selected="selected">
199                [% description | html %]
200            </option>
201         [% ELSE %]
202            <option value="[% standard | html %]">
203               [% description | html %]
204            </option>
205         [% END %]
206      [% END %]
207    </select>
208   </li>
209   <li>
210      <label for="quotes_enabled">Quotes enabled: </label>
211       [% IF account.quotes_enabled %]
212      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="1" checked="checked" />
213       [% ELSE %]
214      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="1" />
215       [% END %]
216   </li>
217   <li>
218      <label for="orders_enabled">Orders enabled: </label>
219 [% IF account.orders_enabled %]
220      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="1" checked="checked" />
221 [% ELSE %]
222      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="1" />
223 [% END %]
224   </li>
225   <li>
226      <label for="invoices_enabled">Invoices enabled: </label>
227 [% IF account.invoices_enabled %]
228      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="1" checked="checked" />
229 [% ELSE %]
230      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="1" />
231 [% END %]
232   </li>
233   <li>
234      <label for="responses_enabled">Responses enabled: </label>
235 [% IF account.responses_enabled %]
236      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="1" checked="checked" />
237 [% ELSE %]
238      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="1" />
239 [% END %]
240   </li>
241   <li>
242      <label for="auto_orders">Automatic ordering: </label>
243 [% IF account.auto_orders %]
244      <input type="checkbox" name="auto_orders" id="auto_orders" value="1" checked="checked" />
245 [% ELSE %]
246      <input type="checkbox" name="auto_orders" id="auto_orders" value="1" />
247 [% END %]
248     <div class="hint">
249         With automatic ordering quotes generate orders without staff intervention.
250     </div>
251   </li>
252   </ol>
253   </fieldset>
254
255   <fieldset class="action">
256     <input type="submit" class="btn btn-primary" value="Submit" />
257     <a href="/cgi-bin/koha/admin/edi_accounts.pl" class="cancel">Cancel</a>
258   </fieldset>
259 </form>
260
261 [% END %]
262 [% IF delete_confirm %]
263 <div class="dialog alert">
264 <h1>Delete this account?</h1>
265 <table>
266     <tr>
267     <th>Vendor</th>
268     <td>[% account.vendor.name | html %]</td>
269     </tr>
270     <tr>
271     <th>Description</th>
272     <td>[% account.description | html %]</td>
273     </tr>
274     <tr>
275     <th>SAN</th>
276     <td>[% account.san | html %]</td>
277     </tr>
278 </table>
279 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="post">
280     <table>
281     </table>
282     <input type="hidden" name="op" value="delete_confirmed" />
283     <input type="hidden" name="id" value="[% account.id | html %]" />
284     <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
285 </form>
286 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="get">
287     <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
288 </form>
289 </div>
290 [% END %]
291 [% IF display %]
292 [% IF ( ediaccounts ) %]
293 <h1>Vendor EDI accounts</h1>
294 <div class="page-section">
295     <table>
296     <tr>
297        <th>ID</th>
298        <th>Vendor</th>
299        <th>Description</th>
300        <th>Transport</th>
301        <th>Remote host</th>
302        <th>Username</th>
303        <th>Password</th>
304        <th>Download directory</th>
305        <th>Upload directory</th>
306        <th>Qualifier</th>
307        <th>SAN</th>
308        <th>Standard</th>
309        <th>[% tp('EDIFACT message QUOTE', 'Quotes') | html %]</th>
310        <th>Orders</th>
311        <th>Invoices</th>
312        <th>Responses</th>
313        <th>Auto ordering</th>
314        <th class="noExport">Actions</th>
315     </tr>
316     [% FOREACH account IN ediaccounts %]
317     <tr>
318       <td>[% account.id | html %]</td>
319       <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% account.vendor_id | uri %]">[% account.vendor.name | html %]</a></td>
320       <td>[% account.description | html %]</td>
321       <td>[% account.transport | html %]</td>
322       <td>[% account.host | html %]</td>
323       <td>[% account.username | html %]</td>
324       <td>[% IF account.password %]*****[% END %]</td>
325       <td>[% account.download_directory | html %]</td>
326       <td>[% account.upload_directory | html %]</td>
327       <td>
328          [% FOREACH qualifier IN code_qualifiers %]
329             [% IF qualifier.code == account.id_code_qualifier %]
330                    [% qualifier.description | html %]
331             [% END %]
332          [% END %]
333          ([% account.id_code_qualifier | html %])
334      </td>
335       <td>[% account.san | html %]</td>
336       <td>[% IF account.standard == 'BIC' %]BiC[% ELSE %]EDItEUR[% END %]</td>
337       [% IF account.quotes_enabled %]
338          <td>Yes</td>
339       [% ELSE %]
340          <td>No</td>
341       [% END %]
342       [% IF account.orders_enabled %]
343          <td>Yes</td>
344       [% ELSE %]
345          <td>No</td>
346       [% END %]
347       [% IF account.invoices_enabled %]
348          <td>Yes</td>
349       [% ELSE %]
350          <td>No</td>
351       [% END %]
352       [% IF account.responses_enabled %]
353          <td>Yes</td>
354       [% ELSE %]
355          <td>No</td>
356       [% END %]
357       [% IF account.auto_orders %]
358          <td>Yes</td>
359       [% ELSE %]
360          <td>No</td>
361       [% END %]
362       <td class="actions">
363           <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>
364       </td>
365     </tr>
366     [% END %]
367     </table>
368 </div> <!-- /.page-section -->
369     [% ELSE %]
370         <div class="dialog message">
371             There are no EDI accounts.
372         </div>
373     [% END %]
374 [% END %]
375
376             </main>
377         </div> <!-- /.col-sm-10.col-sm-push-2 -->
378
379         <div class="col-sm-2 col-sm-pull-10">
380             <aside>
381                 [% INCLUDE 'admin-menu.inc' %]
382             </aside>
383         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
384      </div> <!-- /.row -->
385
386 [% MACRO jsinclude BLOCK %]
387     [% Asset.js("js/admin-menu.js") | $raw %]
388 [% END %]
389 [% INCLUDE 'intranet-bottom.inc' %]