Bug 15630 - Make Edifact module pluggable
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / edi_accounts.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; EDI accounts
3 [% IF acct_form %]
4   [% IF account %]
5      &rsquo; Modify account
6   [% ELSE %]
7      &rsquo; Add new account
8   [% END %]
9 [% END %]
10 [% IF delete_confirm %]
11      &rsquo; Confirm deletion of account
12 [% END %]
13 </title>
14 [% INCLUDE 'doc-head-close.inc' %]
15 </head>
16 <body id="admin_edi_acct" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'cat-search.inc' %]
19
20 <div id="breadcrumbs">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22  &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
23  &rsaquo; <a href="/cgi-bin/koha/admin/edi_accounts.pl">EDI accounts</a>
24 [% IF acct_form %]
25   [% IF account %]
26      &rsaquo; Modify account
27   [% ELSE %]
28      &rsaquo; Add new account
29   [% END %]
30 [% ELSIF delete_confirm %]
31      &rsaquo; Confirm deletion of account
32 [% ELSE %]
33      &rsaquo; 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-small" id="newediacct" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form">
45          <i class="icon-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   <li>
80      <label for="plugin">Plugin: </label>
81      <select name="plugin" id="plugin">
82         <option value="">Do not use plugin</option>
83         [% FOREACH plugin IN plugins %]
84             [% IF account.plugin == plugin.class %]
85                 <option value="[% plugin.class %]" selected="selected">[% plugin.metadata.name %]</option>
86             [% ELSE %]
87                 <option value="[% plugin.class %]">[% plugin.metadata.name %]</option>
88             [% END %]
89         [% END %]
90      </select>
91   </li>
92   <li>
93      <label for="description">Description: </label>
94      <input type="text" name="description" id="description" size="20" maxlength="90" value="[% account.description %]" />
95   </li>
96   <li>
97      [% transport_types = [
98                  'FTP', 'SFTP', 'FILE'
99             ]
100      %]
101      <label for="transport">Transport: </label>
102      <select name="transport" title="valid types of transport are FTP and SFTP"
103       id="transport">
104       [% FOREACH transport_type IN transport_types %]
105            [% IF transport_type == account.transport %]
106               <option value="[% transport_type %]" selected="selected">[% transport_type %]</option>
107            [% ELSE %]
108               <option value="[% transport_type %]">[% transport_type %]</option>
109            [% END %]
110        [% END %]
111      </select>
112   </li>
113   <li>
114      <label for="host">Remote host: </label>
115      <input type="text" name="host" id="host" size="20" maxlength="90" value="[% account.host %]" />
116   </li>
117   <li>
118      <label for="username">Username: </label>
119      <input type="text" name="username" id="username" size="20" maxlength="90" value="[% account.username %]" />
120   </li>
121   <li>
122      <label for="password">Password: </label>
123      <input type="text" name="password" id="password" size="20" maxlength="90" value="[% account.password %]" />
124   </li>
125   <li>
126      <label for="download_directory">Download directory: </label>
127      <input type="text" name="download_directory" id="download_directory" size="20" maxlength="90"
128       title="The download directory specifies the directory on the ftpsite from which we download quotes and invoices"
129       value="[% account.download_directory %]" />
130   </li>
131   <li>
132      <label for="upload_directory">Upload directory: </label>
133      <input type="text" name="upload_directory" id="upload_directory" size="20" maxlength="90"
134       title="The upload directory specifies the directory on the ftp site to which we upload orders"
135       value="[% account.upload_directory %]" />
136   </li>
137   <li>
138      <label for="id_code_qualifier">Qualifier:</label>
139      <select name="id_code_qualifier" id="id_code_qualifier">
140      [% FOREACH qualifier IN code_qualifiers %]
141         [% IF qualifier.code == account.id_code_qualifier %]
142            <option value="[% qualifier.code %]" selected="selected">
143                [% qualifier.description %] ([% qualifier.code %])
144            </option>
145         [% ELSE %]
146            <option value="[% qualifier.code %]">
147               [% qualifier.description %] ([% qualifier.code %])
148            </option>
149         [% END %]
150      [% END %]
151    </select>
152   </li>
153   <li>
154      <label for="san">SAN: </label>
155      <input type="text" name="san" id="san" size="20" maxlength="90" value="[% account.san %]" />
156   </li>
157   <li>
158      <label for="quotes_enabled">Quotes enabled: </label>
159       [% IF account.quotes_enabled %]
160      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="[% account.quotes_enabled %]" checked />
161       [% ELSE %]
162      <input type="checkbox" name="quotes_enabled" id="quotes_enabled" value="[% account.quotes_enabled %]" />
163       [% END %]
164   </li>
165   <li>
166      <label for="orders_enabled">Orders enabled: </label>
167 [% IF account.orders_enabled %]
168      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="[% account.orders_enabled %]" checked />
169 [% ELSE %]
170      <input type="checkbox" name="orders_enabled" id="orders_enabled" value="[% account.orders_enabled %]" />
171 [% END %]
172   </li>
173   <li>
174      <label for="invoices_enabled">Invoices enabled: </label>
175 [% IF account.invoices_enabled %]
176      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="[% account.invoices_enabled %]" checked />
177 [% ELSE %]
178      <input type="checkbox" name="invoices_enabled" id="invoices_enabled" value="[% account.invoices_enabled %]" />
179 [% END %]
180   </li>
181   <li>
182      <label for="responses_enabled">Responses enabled: </label>
183 [% IF account.responses_enabled %]
184      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="[% account.responses_enabled %]" checked />
185 [% ELSE %]
186      <input type="checkbox" name="responses_enabled" id="responses_enabled" value="[% account.responses_enabled %]" />
187 [% END %]
188   </li>
189   <li>
190      <label for="auto_orders">Automatic ordering (Quotes generate orders without staff intervention): </label>
191 [% IF account.auto_orders %]
192      <input type="checkbox" name="auto_orders" id="auto_orders" value="[% account.auto_orders %]" checked />
193 [% ELSE %]
194      <input type="checkbox" name="auto_orders" id="auto_orders" value="[% account.auto_orders %]" />
195 [% END %]
196   </li>
197   </ol>
198   </fieldset>
199
200   <fieldset class="action">
201     <input type="submit" value="Submit" />
202     <a href="/cgi-bin/koha/admin/edi_accounts.pl" class="cancel">Cancel</a>
203   </fieldset>
204 </form>
205
206 [% END %]
207 [% IF delete_confirm %]
208 <div class="dialog alert">
209 <h3>Delete this account?</h3>
210 <table>
211     <tr>
212     <th>Vendor</th>
213     <td>[% account.vendor %]</td>
214     </tr>
215     <tr>
216     <th>Description</th>
217     <td>[% account.description %]</td>
218     </tr>
219     <tr>
220     <th>SAN</th>
221     <td>[% account.san %]</td>
222     </tr>
223 </table>
224 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="post">
225     <table>
226     </table>
227     <input type="hidden" name="op" value="delete_confirmed" />
228     <input type="hidden" name="id" value="[% account.id %]" />
229     <input type="submit" class="approve" value="Yes, Delete" />
230 </form>
231 <form action="/cgi-bin/koha/admin/edi_accounts.pl" method="get">
232     <input type="submit" class="deny" value="No, do not Delete" />
233 </form>
234 [% END %]
235 [% IF display %]
236 <h2>Vendor EDI accounts</h2>
237
238     <table>
239     <tr>
240        <th>ID</th>
241        <th>Vendor</th>
242        <th>Description</th>
243        <th>Transport</th>
244        <th>Remote host</th>
245        <th>Username</th>
246        <th>Password</th>
247        <th>Download Directory</th>
248        <th>Upload Directory</th>
249        <th>Qualifier</th>
250        <th>SAN</th>
251        <th>Quotes</th>
252        <th>Orders</th>
253        <th>Invoices</th>
254        <th>Responses</th>
255        <th>Auto ordering</th>
256        <th>Actions</th>
257     </tr>
258     [% FOREACH account IN ediaccounts %]
259     [% IF loop.even %]<tr>
260     [% ELSE %]<tr class="highlight">
261     [% END %]
262       <td>[% account.id %]</td>
263       <td><a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% account.vendor_id %]">[% account.vendor.name %]</a></td>
264       <td>[% account.description %]</td>
265       <td>[% account.transport %]</td>
266       <td>[% account.host %]</td>
267       <td>[% account.username %]</td>
268       <td>[% IF account.password %]*****[% END %]</td>
269       <td>[% account.download_directory %]</td>
270       <td>[% account.upload_directory %]</td>
271       <td>
272          [% FOREACH qualifier IN code_qualifiers %]
273             [% IF qualifier.code == account.id_code_qualifier %]
274                    [% qualifier.description %]
275             [% END %]
276          [% END %]
277          ([% account.id_code_qualifier %])
278      </td>
279       <td>[% account.san %]</td>
280       [% IF account.quotes_enabled %]
281          <td>Y</td>
282       [% ELSE %]
283          <td>N</td>
284       [% END %]
285       [% IF account.orders_enabled %]
286          <td>Y</td>
287       [% ELSE %]
288          <td>N</td>
289       [% END %]
290       [% IF account.invoices_enabled %]
291          <td>Y</td>
292       [% ELSE %]
293          <td>N</td>
294       [% END %]
295       [% IF account.responses_enabled %]
296          <td>Y</td>
297       [% ELSE %]
298          <td>N</td>
299       [% END %]
300       [% IF account.auto_orders %]
301          <td>Y</td>
302       [% ELSE %]
303          <td>N</td>
304       [% END %]
305       <td align="center">
306           <a href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form&id=[% account.id %]">Edit</a> | <a href="/cgi-bin/koha/admin/edi_accounts.pl?op=delete_confirm&id=[% account.id %]">Delete</a>
307       </td>
308     </tr>
309     [% END %]
310     </table>
311 [% END %]
312
313 </div>
314 </div>
315 <div class="yui-b">
316     [% INCLUDE 'admin-menu.inc' %]
317 </div>
318 </div>
319 [% INCLUDE 'intranet-bottom.inc' %]