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