5 [% USE AuthorisedValues %]
6 [% PROCESS 'i18n.inc' %]
7 [% BLOCK edit_contact %]
9 <input type="hidden" name="contact_id" value="[% contact.id | html %]" />
10 <li><label for="contact_name[% contact.id | html %]">Contact name: </label>
11 <input type="text" size="40" id="contact_name[% contact.id | html %]" name="contact_name" value="[% contact.name | html %]" /></li>
12 <li><label for="contact_position[% contact.id | html %]">Position: </label>
13 <input type="text" size="40" id="contact_position[% contact.id | html %]" name="contact_position" value="[% contact.position | html %]" /></li>
14 <li><label for="contact_phone[% contact.id | html %]">Phone: </label>
15 <input type="text" size="20" id="contact_phone[% contact.id | html %]" name="contact_phone" value="[% contact.phone | html %]" /> </li>
16 <li><label for="contact_altphone[% contact.id | html %]">Alternative phone: </label>
17 <input type="text" size="20" id="contact_altphone[% contact.id | html %]" name="contact_altphone" value="[% contact.altphone | html %]" /></li>
18 <li><label for="contact_fax[% contact.id | html %]">Fax: </label>
19 <input type="text" size="20" id="contact_fax[% contact.id | html %]" name="contact_fax" value="[% contact.fax | html %]" /></li>
20 <li><label for="contact_email[% contact.id | html %]">Email: </label>
21 <input type="text" size="40" id="contact_email[% contact.id | html %]" name="contact_email" value="[% contact.email | html %]" class="email" /></li>
22 <li><label for="contact_notes[% contact.id | html %]">Notes: </label>
23 <textarea id="contact_notes[% contact.id | html %]" name="contact_notes" cols="40" rows="4">[% contact.notes | html %]</textarea></li>
25 <div style="display:flex">
27 <fieldset class="rows">
28 <legend>Acquisitions options</legend>
32 [% IF contact.acqprimary %]
33 <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" checked="checked" />
35 <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" />
37 <input type="hidden" class="contact_acqprimary_hidden" name="contact_acqprimary" value="[% contact.acqprimary | html %]" />
38 Primary acquisitions contact
43 [% IF contact.orderacquisition %]
44 <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" checked="checked" />
46 <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" />
48 <input type="hidden" class="contact_orderacquisition_hidden" name="contact_orderacquisition" value="[% contact.orderacquisition | html %]" />
54 [% IF contact.claimacquisition %]
55 <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" checked="checked" />
57 <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" />
59 <input type="hidden" class="contact_claimacquisition_hidden" name="contact_claimacquisition" value="[% contact.claimacquisition | html %]" />
60 Contact about late orders
67 <fieldset class="rows">
68 <legend>Serials options</legend>
72 [% IF contact.serialsprimary %]
73 <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" checked="checked" />
75 <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" />
77 <input type="hidden" class="contact_serialsprimary_hidden" name="contact_serialsprimary" value="[% contact.serialsprimary | html %]" />
78 Primary serials contact
83 [% IF contact.claimissues %]
84 <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" checked="checked" />
86 <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" />
88 <input type="hidden" class="contact_claimissues_hidden" name="contact_claimissues" value="[% contact.claimissues | html %]" />
89 Contact about late issues
97 [% IF contact.id %]<li><button class="btn btn-default delete-contact"><i class="fa fa-trash-can"></i> Delete contact</li>[% END %]
101 [% BLOCK show_contact %]
102 <h3>[% contact.name | html %]</h3>
104 <li><span class="label">Position: </span>[% contact.position | html %]</li>
105 <li><span class="label">Phone: </span>[% contact.phone | html %]</li>
106 <li><span class="label">Alternative phone: </span>[% contact.altphone | html %]</li>
107 <li><span class="label">Fax: </span>[% contact.fax | html %]</li>
108 [% IF ( contact.email ) %]
109 <li><span class="label">Email: </span><a href="mailto:[% contact.email | uri %]">[% contact.email | html %]</a></li>
111 [% IF ( contact.notes ) %]
112 <li><span class="label">Notes: </span>[% contact.notes | html %]</li>
114 [% IF ( contact.acqprimary || contact.orderacquisition || contact.claimacquisition ) %]
116 <span class="label">Acquisitions options:</span>
118 [% IF ( contact.acqprimary ) %]
119 <li><span class="label"></span> <i class="fa fa-check"></i> Primary acquisitions contact</li>
121 [% IF ( contact.orderacquisition ) %]
122 <li><span class="label"></span> <i class="fa fa-check"></i> Receives orders</li>
124 [% IF ( contact.claimacquisition ) %]
125 <li><span class="label"></span> <i class="fa fa-check"></i> Receives claims for late orders</li>
130 [% IF ( contact.serialsprimary || contact.claimissues ) %]
132 <span class="label">Serials options:</span>
134 [% IF ( contact.serialsprimary ) %]
135 <li><span class="label"></span> <i class="fa fa-check"></i> Primary serials contact</li>
137 [% IF ( contact.claimissues ) %]
138 <li><span class="label"></span> <i class="fa fa-check"></i> Receives claims for late issues</li>
146 [% SET footerjs = 1 %]
147 [% INCLUDE 'doc-head-open.inc' %]
148 <title>[% FILTER collapse %]
149 [% tx("Vendor {vendor}", { vendor = name }) | html %] ›
150 [% t("Koha") | html %]
152 [% INCLUDE 'doc-head-close.inc' %]
154 div.rows p{ margin-left: 1rem; }
155 div.rows { padding: 1rem; }
159 <body id="acq_supplier" class="acq">
160 [% WRAPPER 'header.inc' %]
161 [% INCLUDE 'acquisitions-search.inc' %]
164 [% WRAPPER 'sub-header.inc' %]
165 [% WRAPPER breadcrumbs %]
166 [% WRAPPER breadcrumb_item %]
167 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
170 [% IF ( booksellerid ) %]
171 [% WRAPPER breadcrumb_item %]
172 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a>
174 [% WRAPPER breadcrumb_item bc_active= 1 %]
175 <span>Modify [% name | html %]</span>
178 [% WRAPPER breadcrumb_item bc_active= 1 %]
179 <span>Add vendor</span>
183 [% WRAPPER breadcrumb_item bc_active= 1 %]
186 [% END # /IF (enter) %]
187 [% END #/ WRAPPER breadcrumbs %]
188 [% END #/ WRAPPER sub-header.inc %]
190 <div class="main container-fluid">
192 <div class="col-sm-10 col-sm-push-2">
196 [% IF ( booksellerid ) %]
197 <h1>Update: [% name | html %]</h1>
202 [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
204 <form action="updatesupplier.pl" name="updatesupplier" style="display:block" class="validated" method="post">
205 <div id="toolbar" class="btn-toolbar">
206 <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> Save</button>
207 [% IF ( booksellerid ) %]
208 <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">
210 <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
211 [% END %] <i class="fa fa-times"></i> Cancel</a>
214 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
215 <fieldset class="rows">
216 <legend>Company details</legend>
217 <ol><li><label for="company" class="required">Name:</label>
218 <input type="text" size="40" id="company" name="company" value="[% name | html %]" required="required" class="required focus" /><span class="required">Required</span></li>
219 <li><label for="company_postal">Postal address: </label>
220 <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal | html %]</textarea></li>
221 <li><label for="physical">Physical address: </label>
222 <textarea id="physical" name="physical" cols="40" rows="3">[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</textarea></li>
223 <li><label for="company_phone">Phone: </label>
224 <input type="text" size="20" id="company_phone" name="company_phone" value="[% phone | html %]" /></li>
225 <li><label for="company_fax">Fax: </label>
226 <input type="text" size="20" id="company_fax" name="company_fax" value="[% fax | html %]" /></li>
227 <li><label for="website">Website: </label>
228 <input type="text" size="40" id="website" name="website" value="[% url | html %]" class="url" /></li>
229 <li><label for="accountnumber">Account number: </label>
230 <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber | html %]" /></li>
232 <label for="vendor_type">Vendor type: </label>
233 [% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=type, empty=1, size = 20 %]
236 <label for="aliases">Aliases: </label>
237 <div id="aliases" style="padding-left: 11rem;"></div>
241 <fieldset class="rows">
242 <legend>Contacts</legend>
243 <fieldset id="contact-template" class="supplier-contact">
244 <legend>Contact details</legend>
245 [% INCLUDE edit_contact %]
247 [% FOREACH contact IN contacts %]
248 <fieldset class="supplier-contact">
249 <legend>Contact details</legend>
250 [% INCLUDE edit_contact %]
253 <button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button>
256 <fieldset class="rows">
257 <legend>Interfaces</legend>
258 <div id="interfaces"></div>
261 <fieldset class="rows">
262 <legend>Ordering information</legend>
263 <ol><li><label for="activestatus">Vendor is:</label>
265 <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
266 <label class="radio" for="activestatus">Active</label>
267 <input type="radio" id="inactivestatus" name="status" value="0" />
268 <label class="radio" for="inactivestatus">Inactive</label>
270 <input type="radio" id="activestatus" name="status" value="1" />
271 <label class="radio" for="activestatus">Active</label>
272 <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
273 <label class="radio" for="inactivestatus">Inactive</label>
275 <li><label for="list_currency">List prices are: </label>
276 <select name="list_currency" id="list_currency">
277 [% FOREACH c IN currencies %]
278 [% IF booksellerid and c.currency == listprice or not booksellerid and c.active %]
279 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
280 [% ELSIF not c.archived %]
281 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
286 <li><label for="invoice_currency">Invoice prices are: </label>
287 <select name="invoice_currency" id="invoice_currency">
288 [% FOREACH c IN currencies %]
289 [% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %]
290 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
291 [% ELSIF not c.archived %]
292 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
297 <li><label for="gstyes">Tax number registered:</label>
299 <label class="radio" for="gstyes">Yes</label>
300 <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
301 <label class="radio" for="gstno">No</label>
302 <input type="radio" name="gst" id="gstno" value="0" />
304 <label class="radio" for="gstyes">Yes</label>
305 <input type="radio" name="gst" id="gstyes" value="1" />
306 <label class="radio" for="gstno">No</label>
307 <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
310 <li><label for="list_gstyes">List prices:</label>
311 [% IF ( listincgst ) %]
312 <label class="radio" for="list_gstyes">Include tax</label>
313 <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
314 <label class="radio" for="list_gstno">Don't include tax</label>
315 <input type="radio" id="list_gstno" name="list_gst" value="0" />
317 <label class="radio" for="list_gstyes">Include tax</label>
318 <input type="radio" id="list_gstyes" name="list_gst" value="1" />
319 <label class="radio" for="list_gstno">Don't include tax</label>
320 <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
323 <li><label for="invoice_gstyes">Invoice prices:</label>
324 [% IF ( invoiceincgst ) %]
325 <label class="radio" for="invoice_gstyes">Include tax</label>
326 <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
327 <label class="radio" for="invoice_gstno">Don't include tax</label>
328 <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
330 <label class="radio" for="invoice_gstyes">Include tax</label>
331 <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
332 <label class="radio" for="invoice_gstno">Don't include tax</label>
333 <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
338 <label for="tax_rate">Tax rate: </label>
339 <select name="tax_rate" id="tax_rate">
340 [% FOREACH gst IN gst_values %]
341 [% IF ( tax_rate == gst.option ) %]
342 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %] %</option>
344 <option value="[% gst.option | html %]">[% gst.option * 100 | html %] %</option>
350 <input type="hidden" name="tax_rate" value="0" />
352 <li><label for="discount">Discount: </label>
353 <input type="text" size="6" id="discount" name="discount" value="[% discount | format ('%.1f') %]" />%</li>
355 <label for="deliverytime">Delivery time: </label>
356 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> days
358 <li><label for="notes">Notes: </label>
359 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes | html %]</textarea></li>
365 <h1>[% name | html %]</h1>
367 <div class="col-sm-6">
368 <div id="supplier-company-details" class="page-section rows">
369 <h2>Vendor details</h2>
371 <span class="label">Type: </span>
372 [% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %]
374 <li><span class="label">Company name: </span>[% name | html %]</li>
375 <li><span class="label">Postal address: </span>[% postal | html %]</li>
376 <li><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</li>
377 <li><span class="label">Phone: </span>[% phone | html %]</li>
378 <li><span class="label">Fax: </span>[% fax | html %]</li>
380 <li><span class="label">Website: </span><a href="[% url | url %]">[% url | html %]</a></li>
382 [% IF ( accountnumber ) %]
383 <li><span class="label">Account number: </span>[% accountnumber | html %]</li>
385 [% IF vendor.aliases.count %]
387 <span class="label">Aliases: </span>
389 [% FOR alias IN vendor.aliases %]
390 <li>[% alias.alias | html %]</li>
395 </div> <!-- /#supplier-company-details -->
397 <div id="supplier-ordering-information" class="page-section rows">
398 <h2>Ordering information</h2>
399 <li><span class="label">Vendor is: </span>[% IF ( active ) %]Active[% ELSE %]Inactive[% END %]</li>
400 <li><span class="label">List prices are: </span>[% listprice | html %]</li>
401 <li><span class="label">Invoice prices are: </span>[% invoiceprice | html %]</li>
402 [% IF ( tax_rate ) %]
403 <li><span class="label">Tax number registered: </span>[% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</li>
404 <li><span class="label">List item price includes tax: </span>[% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</li>
405 <li><span class="label">Invoice item price includes tax: </span>[% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</li>
407 <li><span class="label">Discount: </span>[% ( discount || 0 ) | format("%.1f" ) %] %</li>
408 <li><span class="label">Tax rate: </span>[% ( tax_rate || 0 ) * 100 | html %] %</li>
409 [% IF deliverytime.defined %]
410 <li><span class="label">Delivery time: </span>[% deliverytime | html %] days</li>
413 <li><span class="label">Notes: </span>[% notes | html %]</li>
415 </div> <!-- #supplier-ordering-information -->
417 [% IF vendor.interfaces.count %]
418 <div id="supplier-interfaces" class="page-section rows">
421 [% FOR i IN vendor.interfaces %]
422 <h3>[% i.name | html %]</h3>
424 <li><span class="label">Type: </span>[% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]</li>
427 <li><span class="label">URI: </span>[% i.uri | html %]</li>
430 <li><span class="label">Login: </span>[% i.login | html %]</li>
433 <li><span class="label">Password: </span><span class="password"><a href="#" class="show_password" data-plain-text-password="[% i.plain_text_password | html %]">Show</a></span></span></li>
435 [% IF i.account_email %]
436 <li><span class="label">Account email: </span>[% i.account_email | html %]</li>
439 <li><span class="label">Notes: </span>[% i.notes | html %]</li>
445 </div> <!-- /.col-sm-6 -->
447 <div class="col-sm-6">
448 <div id="supplier-contact-details" class="page-section rows">
450 [% FOREACH contact IN contacts %]
451 [% INCLUDE show_contact %]
453 </div> <!-- /#supplier-contact-details -->
455 <div id="subscription-details" class="page-section rows">
456 <h2>Subscription details</h2>
457 <p><strong>Number of subscriptions: </strong>
458 [% IF ( CAN_user_serials ) %]
459 <a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% name | uri %]&searched=1">[% subscriptioncount | html %]</a>
461 [% subscriptioncount | html %]
464 </div> <!-- /#subscription-details -->
465 </div> <!-- /.col-sm-6 -->
469 [% IF ( contracts ) %]
470 <div id="supplier-contracts" class="page-section rows">
472 <table id="contractst">
475 <th scope="col">Name</th>
476 <th scope="col">Description</th>
477 <th scope="col">Start date</th>
478 <th scope="col">End date</th>
479 [% IF CAN_user_acquisition_contracts_manage %]
480 <th scope="col" class="NoSort noExport">Actions</th>
485 [% FOREACH contract IN contracts %]
488 <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | uri %]&booksellerid=[% contract.booksellerid | uri %]">[% contract.contractname | html %]</a>
490 <td>[% contract.contractdescription | html %]</td>
491 <td data-order="[% contract.contractstartdate | html %]">[% contract.contractstartdate | $KohaDates %]</td>
492 <td data-order="[% contract.contractenddate | html %]">[% contract.contractenddate | $KohaDates %]</td>
493 [% IF CAN_user_acquisition_contracts_manage %]
495 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | html %]&booksellerid=[% contract.booksellerid | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
496 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&contractnumber=[% contract.contractnumber | html %]&booksellerid=[% contract.booksellerid | html %]"><i class="fa fa-trash-can"></i> Delete</a>
503 </div> <!-- /#supplier-contracts -->
509 </div> <!-- /.col-sm-10.col-sm-push-2 -->
511 <div class="col-sm-2 col-sm-pull-10">
513 [% INCLUDE 'vendor-menu.inc' %]
515 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
516 </div> <!-- /.row -->
517 [% MACRO jsinclude BLOCK %]
518 [% Asset.js("js/acquisitions-menu.js") | $raw %]
519 [% Asset.js("lib/hc-sticky.js") | $raw %]
520 [% Asset.js("js/acq.js") | $raw %]
521 [% INCLUDE 'datatables.inc' %]
523 function confirm_deletion() {
524 if (confirm(_("Confirm deletion of this vendor ?"))) {
525 window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
529 function add_contact() {
530 var new_contact = $('#contact-template').clone();
531 var timestamp = new Date().getTime();
532 $(new_contact).removeAttr('id');
533 $('input, textarea', new_contact).each(function () {
534 $(this).attr('id', $(this).attr('id') + '_' + timestamp);
536 $(new_contact).insertBefore(this);
537 if ($('.supplier-contact').length === 2) { // First contact
538 $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) {
539 $(checkbox, new_contact).click();
542 $('input[name="contact_name"]', new_contact).focus();
546 function delete_contact(ev) {
547 $(this).parents('.supplier-contact').remove();
552 let aliases = [% To.json(vendor.aliases.unblessed) | $raw %];
556 function remove_alias(i){
557 aliases.splice(i, 1);
561 function encodeHTMLEntities(str){
562 return str.replace(/[&<>'"]/g,
572 function add_alias(){
573 let alias = $("#new_alias").val();
574 if ( !alias.length > 0 ) { return }
575 aliases.push({alias});
578 function refresh_aliases(){
579 let nodes = $("<div></div>");
580 aliases.forEach((a, i) => {
581 let alias_str = encodeHTMLEntities(a.alias);
582 let n = $("<div></div>").append(alias_str);
583 let input = $('<input type="hidden" name="alias" />');
586 n.append(` <a style="cursor: pointer;" onclick="remove_alias(${i});"><i class="fa fa-trash" aria-hidden="true"></i> ` + _("Remove") + '</a>');
589 nodes.append("<input id='new_alias' type='text' class='noEnterSubmit' />");
590 nodes.append(' <a style="cursor: pointer;" onclick="add_alias();"><i class="fa fa-plus" aria-hidden="true"></i> ' + _("Add") + '</a>');
591 $("#aliases").html(nodes.html());
596 [% FOR i_object IN vendor.interfaces %]
597 [% SET i = i_object.unblessed %]
598 [% SET i.password = i_object.plain_text_password %]
599 interfaces.push([% To.json(i) | $raw %]);
604 function serialize_interface_form(){
606 $("#interfaces > fieldset.supplier-interface > ol.interface-form").each( (index, interface_form )=> {
608 $(interface_form).find('input,textarea,select').serializeArray().map(attr => {
609 let name = attr.name.replace(/interface_([\w_]+)_\d+/, "$1");
610 interface[name] = attr.value
612 interfaces.push(interface);
616 function remove_interface(i){
617 interfaces = serialize_interface_form();
618 interfaces.splice(i, 1);
619 refresh_interfaces();
621 function add_interface(){
622 interfaces = serialize_interface_form();
632 refresh_interfaces();
635 VENDOR_INTERFACE_TYPE: $("[% PROCESS 'av-build-dropbox.inc', category="VENDOR_INTERFACE_TYPE" empty=1 | replace('\n', '') | replace('"', '\"') %]"),
637 function refresh_interfaces(){
638 let nodes = $("<div id='interfaces'></div>");
639 interfaces.forEach((interface, i) => {
640 let n = $("<fieldset class='supplier-interface'></fieldset>");
641 n.append("<legend>" + _("Interface details") + "</legend>");
642 n.append(`<input type="hidden" name="interface_counter" value="${i}" />`);
643 let ol = $('<ol class="interface-form"></ol>');
645 { label: _("Name:"), name: 'name', node: 'input' },
646 { label: _("Type:"), name: 'type', node: 'av_select', av_cat: 'VENDOR_INTERFACE_TYPE' },
647 { label: _("URI:"), name: 'uri', node: 'input' },
648 { label: _("Login:"), name: 'login', node: 'input' },
649 { label: _("Password:"), name: 'password', node: 'input' },
650 { label: _("Account email:"), name: 'account_email', node: 'input' },
651 { label: _("Notes:"), name: 'notes', node: 'textarea' }
653 attributes.forEach((attribute, ii) => {
654 let li = $('<li></li>');
655 li.append(`<label for="interface_${attribute.name}_${i}">${attribute.label}</label>`);
656 if( attribute.node == 'input' ) {
657 li.append(`<input type="text" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`);
658 } else if ( attribute.node == 'textarea' ) {
659 li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`);
660 } else if ( attribute.node == 'av_select' ) {
661 let select = av_select[attribute.av_cat].clone();
662 select.attr('name', `interface_${attribute.name}_${i}`);
663 select.find(`option[value='${interface[attribute.name]}']`).prop("selected", true);
668 ol.append(`<li><button class="btn btn-default" onclick="remove_interface(${i});"><i class="fa fa-trash"></i> ` + _("Delete interface") + '</li>');
672 nodes.append(`<button onclick="add_interface();" class="btn btn-default"><i class="fa fa-plus"></i> ` + _("Add another interface") + '</button>')
673 $("#interfaces").replaceWith(nodes);
675 interfaces.forEach((interface, i) => {
676 $("#interface_account_email_" + i).rules("add", {
684 $(document).ready(function() {
685 var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
687 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
691 $('body').on('click', '.delete-contact', null, delete_contact);
692 $('#add-contact').click(add_contact);
693 $('body').on('click', '.contact_acqprimary', null, function () {
694 if ($(this).is(':checked')) {
695 $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
696 $('.contact_acqprimary_hidden').each(function () {
700 $(this).next('.contact_acqprimary_hidden').val('1');
702 $('body').on('click', '.contact_serialsprimary', null, function () {
703 if ($(this).is(':checked')) {
704 $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
705 $('.contact_serialsprimary_hidden').each(function () {
709 $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
711 $('body').on('click', '.contact_orderacquisition', null, function () {
712 $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
714 $('body').on('click', '.contact_claimacquisition', null, function () {
715 $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
717 $('body').on('click', '.contact_claimissues', null, function () {
718 $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
721 $('body').on('click', '.show_password', null, function(e){
723 $(this).parent().replaceWith($(this).data('plain-text-password'));
726 refresh_interfaces();
728 Sticky = $("#toolbar");
731 stickyClass: "floating"
737 [% INCLUDE 'intranet-bottom.inc' %]