card_edit.tpl.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?php
  2. /* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
  3. * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. // Protection to avoid direct call of template
  19. if (empty($conf) || !is_object($conf)) {
  20. print "Error, template page can't be called as URL";
  21. exit;
  22. }
  23. $contact = $GLOBALS['objcanvas']->control->object;
  24. ?>
  25. <!-- BEGIN PHP TEMPLATE CARD_EDIT.TPL.PHP COMPANY -->
  26. <?php echo $this->control->tpl['title']; ?>
  27. <?php echo $this->control->tpl['error']; ?>
  28. <?php echo $this->control->tpl['ajax_selectcountry']; ?>
  29. <?php if ($this->control->tpl['js_checkVatPopup']) {
  30. echo $this->control->tpl['js_checkVatPopup'];
  31. } ?>
  32. <form action="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id']; ?>" method="POST" name="formsoc">
  33. <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
  34. <input type="hidden" name="action" value="update">
  35. <input type="hidden" name="token" value="<?php echo newToken(); ?>">
  36. <input type="hidden" name="socid" value="<?php echo $this->control->tpl['id']; ?>">
  37. <?php if ($this->control->tpl['auto_customercode'] || $this->control->tpl['auto_suppliercode']) { ?>
  38. <input type="hidden" name="code_auto" value="1">
  39. <?php } ?>
  40. <table class="border allwidth">
  41. <tr>
  42. <td><span class="fieldrequired"><?php echo $langs->trans('ThirdPartyName'); ?></span></td>
  43. <td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="<?php echo $this->control->tpl['nom']; ?>"></td>
  44. </tr>
  45. <?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
  46. <tr>
  47. <td><?php echo $langs->trans("Prefix"); ?></td>
  48. <td colspan="3">
  49. <?php if (($this->control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?>
  50. <input type="hidden" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
  51. <?php echo $this->control->tpl['prefix_comm']; ?>
  52. <?php } else { ?>
  53. <input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
  54. <?php } ?>
  55. </td>
  56. </tr>
  57. <?php } ?>
  58. <tr>
  59. <td width="25%"><span class="fieldrequired"><?php echo $langs->trans('ProspectCustomer'); ?></span></td>
  60. <td width="25%"><?php echo $this->control->tpl['select_customertype']; ?></td>
  61. <td width="25%"><?php echo $langs->trans('CustomerCode'); ?></td>
  62. <td width="25%">
  63. <table class="nobordernopadding">
  64. <tr>
  65. <td>
  66. <?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
  67. <input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
  68. <?php } else { ?>
  69. <?php echo $this->control->tpl['customercode']; ?>
  70. <input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
  71. <?php } ?>
  72. </td>
  73. <td><?php echo $this->tpl['help_customercode']; ?></td>
  74. </tr>
  75. </table>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
  80. <td><?php echo $this->control->tpl['yn_supplier']; ?></td>
  81. <td><?php echo $langs->trans('SupplierCode'); ?></td>
  82. <td>
  83. <table class="nobordernopadding">
  84. <tr>
  85. <td>
  86. <?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
  87. <input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
  88. <?php } else { ?>
  89. <?php echo $this->control->tpl['suppliercode']; ?>
  90. <input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
  91. <?php } ?>
  92. </td>
  93. <td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
  94. </tr>
  95. </table>
  96. </td>
  97. </tr>
  98. <?php
  99. if ($this->control->tpl['fournisseur']) {
  100. if (count($this->control->tpl['suppliercategory']) > 0) { ?>
  101. <tr>
  102. <td><?php echo $langs->trans('SupplierCategory'); ?></td>
  103. <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
  104. </tr>
  105. <?php
  106. }
  107. }
  108. if (isModEnabled('barcode')) { ?>
  109. <tr>
  110. <td><?php echo $langs->trans('Gencod'); ?></td>
  111. <td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>
  112. </tr>
  113. <?php } ?>
  114. <tr>
  115. <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
  116. <td colspan="3"><textarea name="adress" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
  117. </tr>
  118. <tr>
  119. <td><?php echo $langs->trans('Zip'); ?></td>
  120. <td><?php echo $this->control->tpl['select_zip']; ?></td>
  121. <td><?php echo $langs->trans('Town'); ?></td>
  122. <td><?php echo $this->control->tpl['select_town']; ?></td>
  123. </tr>
  124. <tr>
  125. <td width="25%"><?php echo $langs->trans('Country'); ?></td>
  126. <td colspan="3"><?php echo $this->control->tpl['select_country']; echo $this->control->tpl['info_admin']; ?></td>
  127. </tr>
  128. <tr>
  129. <td><?php echo $langs->trans('State'); ?></td>
  130. <td colspan="3"><?php echo $this->control->tpl['select_state']; ?></td>
  131. </tr>
  132. <tr>
  133. <td><?php echo $langs->trans('Phone'); ?></td>
  134. <td><input type="text" name="phone" value="<?php echo $this->control->tpl['phone']; ?>"></td>
  135. <td><?php echo $langs->trans('Fax'); ?></td>
  136. <td><input type="text" name="fax" value="<?php echo $this->control->tpl['fax']; ?>"></td>
  137. </tr>
  138. <tr>
  139. <td><?php echo $langs->trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY ? '*' : ''); ?></td>
  140. <td><input type="text" name="email" size="32" value="<?php echo $this->control->tpl['email']; ?>"></td>
  141. <td><?php echo $langs->trans('Web'); ?></td>
  142. <td><input type="text" name="url" size="32" value="<?php echo $this->control->tpl['url']; ?>"></td>
  143. </tr>
  144. <?php
  145. for ($i = 1; $i <= 4; $i++) {
  146. if ($this->control->tpl['langprofid'.$i] != '-') {
  147. if ($i == 1 || $i == 3) {
  148. echo '<tr>';
  149. }
  150. echo '<td>'.$this->control->tpl['langprofid'.$i].'</td>';
  151. echo '<td>'.$this->control->tpl['showprofid'.$i].'</td>';
  152. if ($i == 2 || $i == 4) {
  153. echo '</tr>';
  154. }
  155. } else {
  156. if ($i == 1 || $i == 3) {
  157. echo '<tr>';
  158. }
  159. echo '<td>&nbsp;</td>';
  160. echo '<td>&nbsp;</td>';
  161. if ($i == 2 || $i == 4) {
  162. echo '</tr>';
  163. }
  164. }
  165. }
  166. ?>
  167. <tr>
  168. <td><?php echo $langs->trans('VATIsUsed'); ?></td>
  169. <td><?php echo $this->control->tpl['yn_assujtva']; ?></td>
  170. <td class="nowrap"><?php echo $langs->trans('VATIntra'); ?></td>
  171. <td class="nowrap"><?php echo $this->control->tpl['tva_intra']; ?></td>
  172. </tr>
  173. <tr>
  174. <td><?php echo $langs->trans('Capital'); ?></td>
  175. <td colspan="3"><input type="text" name="capital" size="10" value="<?php echo $this->control->tpl['capital']; ?>"> <?php echo $langs->trans("Currency".$conf->currency); ?></td>
  176. </tr>
  177. <tr>
  178. <td><?php echo $langs->trans('JuridicalStatus'); ?></td>
  179. <td colspan="3"><?php echo $this->control->tpl['select_juridicalstatus']; ?></td>
  180. </tr>
  181. <tr>
  182. <td><?php echo $langs->trans("ThirdPartyType"); ?></td>
  183. <td><?php echo $this->control->tpl['select_companytype']; echo $this->control->tpl['info_admin']; ?></td>
  184. <td><?php echo $langs->trans("Staff"); ?></td>
  185. <td><?php echo $this->control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?></td>
  186. </tr>
  187. <?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
  188. <tr>
  189. <td><?php echo $langs->trans("DefaultLang"); ?></td>
  190. <td colspan="3"><?php echo $this->control->tpl['select_lang']; ?></td>
  191. </tr>
  192. <?php }
  193. if (!empty($this->control->tpl['localtax'])) {
  194. echo $this->control->tpl['localtax'];
  195. } ?>
  196. </table>
  197. <br>
  198. <div class="center">
  199. <input type="submit" class="button button-save" name="save" value="<?php echo $langs->trans("Save"); ?>">
  200. &nbsp; &nbsp;
  201. <input type="submit" class="button button-cancel" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
  202. </div>
  203. </form>
  204. <!-- END PHP TEMPLATE -->