$::request->layout->focus() größtenteils durch class="initial_focus" ersetzen
[kivitendo-erp.git] / templates / webpages / ct / form_header.html
index 91d8636..294cf47 100644 (file)
@@ -1,29 +1,28 @@
 [%- USE T8 %]
 [% USE HTML %][% USE LxERP %]
 [% USE L %]
-[% L.javascript_tag('jquery') %]
-<body>
 
- <div class="listtop">[% title %]</div>
+ <h1>[% title %]</h1>
+
+ [% PROCESS 'common/flash.html' %]
 
  <form method="post" name="ct" action="ct.pl" >
 
-  <ul id="maintab" class="shadetabs">
-   <li class="selected"><a href="#" rel="billing">[% 'Billing Address' | $T8 %]</a></li>
-   <li><a href="#" rel="shipto">[% 'Shipping Address' | $T8 %]</a></li>
-   <li><a href="#" rel="contacts">[% 'Contacts' | $T8 %]</a></li>
+  <div class="tabwidget">
+   <ul>
+    <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
+    <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
+    <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
 [%- IF id %]
-   <li><a href="#" rel="deliveries">[% 'Supplies' | $T8 %]</a></li>
+    <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
 [%- END %]
-   <li><a href="#" rel="vcnotes">[% 'Notes' | $T8 %]</a></li>
-   [%- IF CUSTOM_VARIABLES.size %]
-   <li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
-   [%- END %]
-  </ul>
-
-  <div class="tabcontentstyle">
+    <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
+[%- IF CUSTOM_VARIABLES.CT.size %]
+    <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
+[%- END %]
+   </ul>
 
-   <div id="billing" class="tabcontent">
+   <div id="billing">
 
     <table width="100%">
      <tr height="5"></tr>
@@ -81,7 +80,7 @@
      <tr>
       <th align="right" nowrap>[% 'Greeting' | $T8 %]</th>
       <td>
-       <input id="greeting" name="greeting" size="30" value="[% HTML.escape(greeting) %]">&nbsp;
+       <input id="greeting" name="greeting" size="30" value="[% HTML.escape(greeting) %]" class="initial_focus">&nbsp;
        [%- INCLUDE generic/multibox.html
              name       = 'selected_company_greeting',
              DATA       = MB_COMPANY_GREETINGS,
 
      <tr>
       <th align="right" nowrap>[% 'Street' | $T8 %]</th>
-      <td><input name="street" size="35" maxlength="75" value="[% HTML.escape(street) %]"></td>
+      <td>
+        <input name="street" size="35" maxlength="75" value="[% HTML.escape(street) %]">
+        <a
+          href="#"
+          onclick="window.open('https://maps.google.com/maps?q='+ encodeURIComponent($('#billing input[name=street]').val() +', '+ $('#billing input[name=zipcode]').val() +' '+ $('#billing input[name=city]').val() +', '+ $('#billing input[name=country]').val()), '_blank'); window.focus();"
+          title="[% 'Map' | $T8 %]"
+          >
+            <img src="image/map.png" alt="[% 'Map' | $T8 %]" />
+          </a>
+      </td>
      </tr>
 
      <tr>
 
      <tr>
       <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
-      <td><input name="phone" size="30" maxlength="30" value="[% HTML.escape(phone) %]"></td>
+      <td><input name="phone" size="30" value="[% HTML.escape(phone) %]"></td>
      </tr>
 
      <tr>
       <td><input name="email" size="45" value="[% HTML.escape(email) %]"></td>
      </tr>
 
+     <tr>
+      <th align="right" nowrap>[% 'Cc E-mail' | $T8 %]</th>
+      <td><input name="cc" size="45" value="[% HTML.escape(cc) %]"></td>
+     </tr>
+
+     <tr>
+      <th align="right" nowrap>[% 'Bcc E-mail' | $T8 %]</th>
+      <td><input name="bcc" size="45" value="[% HTML.escape(bcc) %]"></td>
+     </tr>
+
+
      <tr>
       <th align="right" nowrap>
       [% IF homepage %]<a href="[% HTML.escape(homepage) %]" title="[% 'Open this Website' | $T8 %]" target="_blank">[% 'Homepage' | $T8 %]</a>
       [% ELSE %][% 'Homepage' | $T8 %]
       [% END %]
       </th>
-      <td><input name="homepage" size="45" title="[% 'Example: http://lx-office.org' | $T8 %]" value="[% HTML.escape(homepage) %]"></td>
+      <td><input name="homepage" size="45" title="[% 'Example: http://kivitendo.de' | $T8 %]" value="[% HTML.escape(homepage) %]"></td>
      </tr>
 
      <tr>
       <td><input name="taxnumber" size="20" value="[% HTML.escape(taxnumber) %]"></td>
       <!-- Anm.: R&B 15.11.2008     VAT Reg No ist Ust-ID in GB, aber generell sollte es laut Richardson die sales tax id sein -->
       <th align="right">[% 'sales tax identification number' | $T8 %]</th>
-      <td><input name="ustid" id="ustid" maxlength="14" size="20" value="[% HTML.escape(ustid) %]"></td>
+      <td>[% L.input_tag('ustid', ustid, maxlength=14, size=30) %]</td>
       [%- IF is_customer %]
       <th align="right">[% 'our vendor number at customer' | $T8 %]</th>
-      <td><input name="c_vendor_id" size="10" value="[% HTML.escape(c_vendor_id) %]"></td>
+      <td>[% L.input_tag('c_vendor_id', c_vendor_id, size=30) %]</td>
       [%- ELSE %]
       <th align="right">[% 'Customer Number' | $T8 %]</th>
-      <td><input name="v_customer_id" size="10" value="[% HTML.escape(v_customer_id) %]"></td>
+      <td>[% L.input_tag('v_customer_id', v_customer_id, size=30) %]</td>
       [%- END %]
      </tr>
 
      <tr>
       <th align="right">[% 'Account Number' | $T8 %]</th>
-      <td><input name="account_number" size="10" maxlength="100" value="[% HTML.escape(account_number) %]"></td>
+      <td>[% L.input_tag('account_number', account_number, size=30) %]</td>
       <th align="right">[% 'Bank Code Number' | $T8 %]</th>
-      <td><input name="bank_code" size="10" maxlength="100" value="[% HTML.escape(bank_code) %]"></td>
+      <td>[% L.input_tag('bank_code', bank_code, size=30) %]</td>
       <th align="right">[% 'Bank' | $T8 %]</th>
-      <td><input name="bank" size="20" value="[% HTML.escape(bank) %]"></td>
+      <td>[% L.input_tag('bank', bank, size=30) %]</td>
      </tr>
 
      <tr>
       <th align="right">[% 'IBAN' | $T8 %]</th>
-      <td><input name="iban" size="10" maxlength="100" value="[% HTML.escape(iban) %]"></td>
+      <td>[% L.input_tag('iban', iban, maxlength=100, size=30) %]</td>
       <th align="right">[% 'BIC' | $T8 %]</th>
-      <td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
+      <td>[% L.input_tag('bic', bic, maxlength=100, size=30) %]</td>
+      [%- IF ALL_CURRENCIES.size %]
+        <th align="right">[% 'Currency' | $T8 %]</th>
+        <td>[% L.select_tag('currency', ALL_CURRENCIES, default = currency) %]</td>
+      [%- END %]
      </tr>
 
      <tr>
       <td>
        [%- INCLUDE generic/multibox.html
              name       = 'language_id',
+             default    = default_language_id,
              DATA       = languages,
              show_empty = 1,
              id_key     = 'id',
      </tr>
 
      <tr>
-      <td align="right">[% 'Obsolete' | $T8 %]</td>
-      <td><input name="obsolete" class="checkbox" type="checkbox" value="1" [% IF obsolete %]checked[% END %]></td>
-      <td align="right">[% 'direct debit' | $T8 %]</td>
-      <td><input name="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
+      <td align="right"><label for="obsolete">[% 'Obsolete' | $T8 %]</label></td>
+      <td><input name="obsolete" id="obsolete" class="checkbox" type="checkbox" value="1" [% IF obsolete %]checked[% END %]></td>
+      <td align="right"><label for="direct_debit">[% 'direct debit' | $T8 %]</label></td>
+      <td><input name="direct_debit" id="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
      </tr>
 
      <tr>
       </td>
       [%- IF is_customer && !conf_vertreter %]
       <th align="right">[% 'Salesman' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'salesman_id',
-             DATA       = ALL_SALESMEN,
-             show_empty = 1,
-             id_key     = 'id',
-             label_sub  = 'salesman_label',
-       -%]
-      </td>
+      <td>[% L.select_tag('salesman_id', ALL_SALESMEN, default = salesman_id, with_empty = 1, title_key = 'safe_name') %]</td>
       [%- END %]
+
+      <td>[% 'taxincluded checked' | $T8 %]</td>
+      <td>[% L.select_tag('taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = taxincluded_checked) %]</td>
      </tr>
     </table>
 
       <td><textarea name="notes" rows="3" cols="60" wrap="soft">[% HTML.escape(notes) %]</textarea></td>
      </tr>
     </table>
-
-    <br style="clear: left" />
    </div>
 
-   <div id="shipto" class="tabcontent">
+   <div id="shipto">
     [% INCLUDE 'ct/_shipto.html' %]
-
-    <input type="submit" id="delete_shipto" name="action" value="[% 'Delete Shipto' | $T8 %]" disabled>
-    <br style="clear: left" />
    </div>
 
-   <div id="contacts" class="tabcontent">
+   <div id="contacts">
     [% INCLUDE 'ct/_contact.html' %]
-
-    <input type="submit" id="delete_contact" name="action" value="[% 'Delete Contact' | $T8 %]" disabled>
-    <br style="clear: left" />
    </div>
 
-   <div id="deliveries" class="tabcontent">
+   <div id="deliveries">
     <table>
      <tr>
       <th align="right">[% 'Shipping Address' | $T8 %]</th>
       <td colspan="3">
-       [% L.select_tag('delivery_id', L.options_for_select(SHIPTO_ALL, title_sub => \shipto_label, with_empty => 1),
-                       onchange => "\$('#delivery').load('ct.pl?action=get_delivery&id=' + \$('#cvid').attr('value') + '&db=' + \$('#db').attr('value') + '&shipto_id=' + this.value)") %]
+       [% L.select_tag('delivery_id', SHIPTO_ALL, value_key = 'shipto_id', title_sub = \shipto_label, with_empty = 1,
+                       onchange = "\$('#delivery').load('ct.pl?action=get_delivery&id=' + \$('#cvid').val() + '&db=' + \$('#db').val() + '&shipto_id=' + this.value)") %]
       </td>
      </tr>
 
      <tr>
       <th align="right" nowrap>[% 'From' | $T8 %]</th>
       <td>
-       <input id="from" name="from" size="10" maxlength="10" onChange="get_delivery(['shipto_id__' + delivery_id.value, 'from__' + this.value, 'to__' + to.value, 'id__' + cvid.value, 'db__' + db.value], ['delivery'])" value="[% HTML.escape(from) %]">
-       <input type="button" name="fromB" id="trigger_from" value="?">
+        [% L.date_tag('from',
+                      from,
+                      onchange => "\$('#delivery').load('ct.pl?action=get_delivery&shipto_id='+ \$('#delivery_id').val() +'&from='+ \$('#from').val() +'&to='+ \$('#to').val() +'&id='+ \$('#cvid').val() +'&db='+ \$('#db').val())")
+        %]
       </td>
       <th align="right" nowrap>[% 'To (time)' | $T8 %]</th>
       <td>
-       <input id="to" name="to" size="10" maxlength="10" onChange="get_delivery(['shipto_id__' + delivery_id.value, 'from__' + from.value, 'to__' + this.value, 'id__' + cvid.value, 'db__' + db.value], ['delivery'])" value="[% HTML.escape(to) %]">
-       <input type="button" name="toB" id="trigger_to" value="?">
+       [% L.date_tag('to',
+                      to,
+                      onchange => "\$('#delivery').load('ct.pl?action=get_delivery&shipto_id='+ \$('#delivery_id').val() +'&from='+ \$('#from').val() +'&to='+ \$('#to').val() +'&id='+ \$('#cvid').val() +'&db='+ \$('#db').val())")
+       %]
       </td>
      </tr>
 
       </td>
      </tr>
     </table>
-
-    <br style="clear: left" />
    </div>
 
-   <div id="vcnotes" class="tabcontent">
+   <div id="vcnotes">
 
     [%- IF NOTES && NOTES.size %]
     <p>
       <tr>
        <td valign="right">[% 'Follow-Up On' | $T8 %]</td>
        <td>
-        <input name="FU_date" id="FU_date" value="[% HTML.escape(FU_date) %]" size="12">
-        <input type="button" name="FU_date_button" id="FU_date_trigger" value="?">
+        [% L.date_tag('FU_date', FU_date) %]
         [% 'for' | $T8 %]
-        <select name="FU_created_for_user">
-         [%- FOREACH row = ALL_EMPLOYEES %]
-         <option value="[% HTML.escape(row.id) %]"[% IF (NOTE_id && (row.id == FU_created_for_user)) || (row.login == login) %] selected[% END %]>
-          [%- IF row.name %][%- HTML.escape(row.name) %] ([% HTML.escape(row.login) %])[% ELSE %][% HTML.escape(row.login) %][% END %]
-         </option>
-         [%- END %]
-        </select>
+        [% L.select_tag('FU_created_for_user', ALL_EMPLOYEES, default = (FU_created_for_user ? FU_created_for_user : USER.id), title_key='safe_name') %]
        </td>
       </tr>
 
       </tr>
      </table>
     </p>
-
-    <br style="clear: left" />
    </div>
 
-   [%- IF CUSTOM_VARIABLES.size %]
-   <div id="custom_variables" class="tabcontent">
+   [%- IF CUSTOM_VARIABLES.CT.size %]
+   <div id="custom_variables">
 
     <p>
      <table>
-      [%- FOREACH var = CUSTOM_VARIABLES %]
+      [%- FOREACH var = CUSTOM_VARIABLES.CT %]
       <tr>
        <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
        <td valign="top">[% var.HTML_CODE %]</td>
       [%- END %]
      </table>
     </p>
-
-    <br style="clear: left" />
    </div>
    [%- END %]