card_edit.tpl.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. ?>
  24. <!-- BEGIN PHP TEMPLATE CARD_EDIT.TPL.PHP INDIVIDUAL -->
  25. <?php echo $this->control->tpl['title']; ?>
  26. <?php echo $this->control->tpl['error']; ?>
  27. <?php echo $this->control->tpl['ajax_selectcountry']; ?>
  28. <form action="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id']; ?>" method="POST" name="formsoc">
  29. <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
  30. <input type="hidden" name="action" value="update">
  31. <input type="hidden" name="token" value="<?php echo newToken(); ?>">
  32. <input type="hidden" name="socid" value="<?php echo $this->control->tpl['id']; ?>">
  33. <input type="hidden" name="typent_id" value="<?php echo $this->control->tpl['typent_id']; ?>">
  34. <?php if ($this->control->tpl['auto_customercode'] || $this->control->tpl['auto_suppliercode']) { ?>
  35. <input type="hidden" name="code_auto" value="1">
  36. <?php } ?>
  37. <table class="border allwidth">
  38. <tr>
  39. <td><span class="fieldrequired"><?php echo $langs->trans('Name'); ?></span></td>
  40. <td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="<?php echo $this->control->tpl['nom']; ?>"></td>
  41. </tr>
  42. <?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
  43. <tr>
  44. <td><?php echo $langs->trans("Prefix"); ?></td>
  45. <td colspan="3">
  46. <?php if (($this->control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?>
  47. <input type="hidden" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
  48. <?php echo $this->control->tpl['prefix_comm']; ?>
  49. <?php } else { ?>
  50. <input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
  51. <?php } ?>
  52. </td>
  53. </tr>
  54. <?php } ?>
  55. <tr>
  56. <td width="25%"><span class="fieldrequired"><?php echo $langs->trans('ProspectCustomer'); ?></span></td>
  57. <td width="25%"><?php echo $this->control->tpl['select_customertype']; ?></td>
  58. <td width="25%"><?php echo $langs->trans('CustomerCode'); ?></td>
  59. <td width="25%">
  60. <table class="nobordernopadding">
  61. <tr>
  62. <td>
  63. <?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
  64. <input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
  65. <?php } else { ?>
  66. <?php echo $this->control->tpl['customercode']; ?>
  67. <input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
  68. <?php } ?>
  69. </td>
  70. <td><?php echo $this->tpl['help_customercode']; ?></td>
  71. </tr>
  72. </table>
  73. </td>
  74. </tr>
  75. <tr>
  76. <td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
  77. <td><?php echo $this->control->tpl['yn_supplier']; ?></td>
  78. <td><?php echo $langs->trans('SupplierCode'); ?></td>
  79. <td>
  80. <table class="nobordernopadding">
  81. <tr>
  82. <td>
  83. <?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
  84. <input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
  85. <?php } else { ?>
  86. <?php echo $this->control->tpl['suppliercode']; ?>
  87. <input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
  88. <?php } ?>
  89. </td>
  90. <td><?php echo $this->tpl['help_suppliercode']; ?></td>
  91. </tr>
  92. </table>
  93. </td>
  94. </tr>
  95. <?php
  96. if ($this->control->tpl['fournisseur']) {
  97. if (count($this->control->tpl['suppliercategory']) > 0) { ?>
  98. <tr>
  99. <td><?php echo $langs->trans('SupplierCategory'); ?></td>
  100. <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
  101. </tr>
  102. <?php
  103. }
  104. }
  105. ?>
  106. <?php if (isModEnabled('barcode')) { ?>
  107. <tr>
  108. <td><?php echo $langs->trans('Gencod'); ?></td>
  109. <td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>
  110. </tr>
  111. <?php } ?>
  112. <tr>
  113. <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
  114. <td colspan="3"><textarea name="adresse" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
  115. </tr>
  116. <tr>
  117. <td><?php echo $langs->trans('Zip'); ?></td>
  118. <td><?php echo $this->control->tpl['select_zip']; ?></td>
  119. <td><?php echo $langs->trans('Town'); ?></td>
  120. <td><?php echo $this->control->tpl['select_town']; ?></td>
  121. </tr>
  122. <tr>
  123. <td width="25%"><?php echo $langs->trans('Country'); ?></td>
  124. <td colspan="3"><?php echo $this->control->tpl['select_country']; echo $this->control->tpl['info_admin']; ?></td>
  125. </tr>
  126. <tr>
  127. <td><?php echo $langs->trans('State'); ?></td>
  128. <td colspan="3"><?php echo $this->control->tpl['select_state']; ?></td>
  129. </tr>
  130. <tr>
  131. <td><?php echo $langs->trans('Phone'); ?></td>
  132. <td><input type="text" name="tel" value="<?php echo $this->control->tpl['tel']; ?>"></td>
  133. <td><?php echo $langs->trans('Fax'); ?></td>
  134. <td><input type="text" name="fax" value="<?php echo $this->control->tpl['fax']; ?>"></td>
  135. </tr>
  136. <tr>
  137. <td><?php echo $langs->trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY ? '*' : ''); ?></td>
  138. <td><input type="text" name="email" size="32" value="<?php echo $this->control->tpl['email']; ?>"></td>
  139. <td><?php echo $langs->trans('Web'); ?></td>
  140. <td><input type="text" name="url" size="32" value="<?php echo $this->control->tpl['url']; ?>"></td>
  141. </tr>
  142. <?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
  143. <tr>
  144. <td><?php echo $langs->trans("DefaultLang"); ?></td>
  145. <td colspan="3"><?php echo $this->control->tpl['select_lang']; ?></td>
  146. </tr>
  147. <?php } ?>
  148. <tr>
  149. <td><?php echo $langs->trans('VATIsUsed'); ?></td>
  150. <td colspan="3"><?php echo $this->control->tpl['yn_assujtva']; ?></td>
  151. </tr>
  152. <?php if (!empty($this->control->tpl['localtax'])) {
  153. echo $this->control->tpl['localtax'];
  154. } ?>
  155. </table>
  156. <br>
  157. <div class="center">
  158. <input type="submit" class="button button-save" name="save" value="<?php echo $langs->trans("Save"); ?>">
  159. &nbsp; &nbsp;
  160. <input type="submit" class="button button-cancel" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
  161. </div>
  162. </form>
  163. <!-- END PHP TEMPLATE -->