card_view.tpl.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <?php
  2. /* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. // Protection to avoid direct call of template
  18. if (empty($conf) || !is_object($conf)) {
  19. print "Error, template page can't be called as URL";
  20. exit;
  21. }
  22. $object = $GLOBALS['objcanvas']->control->object;
  23. print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP INDIVIDUAL -->\n";
  24. $head = societe_prepare_head($object);
  25. print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
  26. if ($this->control->tpl['error']) {
  27. echo $this->control->tpl['error'];
  28. }
  29. if ($this->control->tpl['action_delete']) {
  30. echo $this->control->tpl['action_delete'];
  31. } ?>
  32. <table class="border allwidth">
  33. <tr>
  34. <td width="20%"><?php echo $langs->trans('Name'); ?></td>
  35. <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
  36. </tr>
  37. <?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
  38. <tr>
  39. <td><?php echo $langs->trans('Prefix'); ?></td>
  40. <td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
  41. </tr>
  42. <?php } ?>
  43. <?php if ($this->control->tpl['client']) { ?>
  44. <tr>
  45. <td><?php echo $langs->trans('CustomerCode'); ?></td>
  46. <td colspan="3"><?php echo $this->control->tpl['code_client']; ?>
  47. <?php if ($this->control->tpl['checkcustomercode'] <> 0) { ?>
  48. <span class="error">(<?php echo $langs->trans("WrongCustomerCode"); ?>)</span>
  49. <?php } ?>
  50. </td>
  51. </tr>
  52. <?php } ?>
  53. <?php if ($this->control->tpl['fournisseur']) { ?>
  54. <tr>
  55. <td><?php echo $langs->trans('SupplierCode'); ?></td>
  56. <td colspan="3"><?php echo $this->control->tpl['code_fournisseur']; ?>
  57. <?php if ($this->control->tpl['checksuppliercode'] <> 0) { ?>
  58. <span class="error">(<?php echo $langs->trans("WrongSupplierCode"); ?>)</span>
  59. <?php } ?>
  60. </td>
  61. </tr>
  62. <?php } ?>
  63. <?php if (isModEnabled('barcode')) { ?>
  64. <tr>
  65. <td><?php echo $langs->trans('Gencod'); ?></td>
  66. <td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>
  67. </tr>
  68. <?php } ?>
  69. <tr>
  70. <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
  71. <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
  72. </tr>
  73. <tr>
  74. <td width="25%"><?php echo $langs->trans('Zip'); ?></td>
  75. <td width="25%"><?php echo $this->control->tpl['zip']; ?></td>
  76. <td width="25%"><?php echo $langs->trans('Town'); ?></td>
  77. <td width="25%"><?php echo $this->control->tpl['town']; ?></td>
  78. </tr>
  79. <tr>
  80. <td><?php echo $langs->trans("Country"); ?></td>
  81. <td colspan="3" class="nowrap"><?php echo $this->control->tpl['country']; ?></td>
  82. </tr>
  83. <tr>
  84. <td><?php echo $langs->trans('State'); ?></td>
  85. <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
  86. </tr>
  87. <tr>
  88. <td><?php echo $langs->trans('Phone'); ?></td>
  89. <td><?php echo $this->control->tpl['phone']; ?></td>
  90. <td><?php echo $langs->trans('Fax'); ?></td>
  91. <td><?php echo $this->control->tpl['fax']; ?></td>
  92. </tr>
  93. <tr>
  94. <td><?php echo $langs->trans('EMail'); ?></td>
  95. <td><?php echo $this->control->tpl['email']; ?></td>
  96. <td><?php echo $langs->trans('Web'); ?></td>
  97. <td><?php echo $this->control->tpl['url']; ?></td>
  98. </tr>
  99. <tr>
  100. <td><?php echo $langs->trans('VATIsUsed'); ?></td>
  101. <td colspan="3"><?php echo $this->control->tpl['tva_assuj']; ?></td>
  102. </tr>
  103. <?php if (!empty($this->control->tpl['localtax'])) {
  104. echo $this->control->tpl['localtax'];
  105. } ?>
  106. <tr>
  107. <td><?php echo $langs->trans("Type"); ?></td>
  108. <td colspan="3"><?php echo $this->control->tpl['typent']; ?></td>
  109. </tr>
  110. <?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
  111. <tr>
  112. <td><?php echo $langs->trans("DefaultLang"); ?></td>
  113. <td colspan="3"><?php echo $this->control->tpl['default_lang']; ?></td>
  114. </tr>
  115. <?php } ?>
  116. <tr>
  117. <td>
  118. <table class="nobordernopadding allwidth">
  119. <tr>
  120. <td><?php echo $langs->trans('RIB'); ?></td>
  121. <td class="right">
  122. <?php if ($user->hasRight('societe', 'creer')) { ?>
  123. <a href="<?php echo DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
  124. <?php } else { ?>
  125. &nbsp;
  126. <?php } ?>
  127. </td>
  128. </tr>
  129. </table>
  130. </td>
  131. <td colspan="3"><?php echo $this->control->tpl['display_rib']; ?></td>
  132. </tr>
  133. <tr>
  134. <td>
  135. <table class="nobordernopadding allwidth">
  136. <tr>
  137. <td><?php echo $langs->trans('SalesRepresentatives'); ?></td>
  138. <td class="right">
  139. <?php if ($user->hasRight('societe', 'creer')) { ?>
  140. <a href="<?php echo DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
  141. <?php } else { ?>
  142. &nbsp;
  143. <?php } ?>
  144. </td>
  145. </tr>
  146. </table>
  147. </td>
  148. <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
  149. </tr>
  150. <?php if (isModEnabled('adherent')) { ?>
  151. <tr>
  152. <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
  153. <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>
  154. </tr>
  155. <?php } ?>
  156. </table>
  157. <?php print dol_get_fiche_end(); ?>
  158. <div class="tabsAction">
  159. <?php if ($user->hasRight('societe', 'creer')) { ?>
  160. <a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.urlencode($canvas); ?>"><?php echo $langs->trans("Modify"); ?></a>
  161. <?php } ?>
  162. <?php if ($user->hasRight('societe', 'supprimer')) { ?>
  163. <?php if ($conf->use_javascript_ajax) { ?>
  164. <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
  165. <?php } else { ?>
  166. <a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.urlencode($canvas); ?>"><?php echo $langs->trans('Delete'); ?></a>
  167. <?php } ?>
  168. <?php } ?>
  169. </div>
  170. <br>
  171. <table class="allwidth"><tr><td valign="top" width="50%">
  172. <div id="builddoc"></div>
  173. <?php
  174. /*
  175. * Generated documents
  176. */
  177. $filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
  178. $urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid;
  179. $genallowed = $user->hasRight('societe', 'lire');
  180. $delallowed = $user->hasRight('societe', 'creer');
  181. print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang);
  182. ?>
  183. </td>
  184. <td></td>
  185. </tr>
  186. </table>
  187. <br>
  188. <?php
  189. // Subsidiaries list
  190. $result = show_subsidiaries($conf, $langs, $db, $object);
  191. // Contacts list
  192. $result = show_contacts($conf, $langs, $db, $object);
  193. // Projects list
  194. $result = show_projects($conf, $langs, $db, $object);
  195. print "<!-- END PHP TEMPLATE -->\n";