card_create.tpl.php 6.8 KB

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