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