card_view.tpl.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. $soc = $GLOBALS['objcanvas']->control->object;
  23. print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP COMPANY -->\n";
  24. $head = societe_prepare_head($soc);
  25. print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
  26. ?>
  27. <?php if ($this->control->tpl['error']) {
  28. echo $this->control->tpl['error'];
  29. } ?>
  30. <?php if ($this->control->tpl['action_delete']) {
  31. echo $this->control->tpl['action_delete'];
  32. } ?>
  33. <?php if ($this->control->tpl['js_checkVatPopup']) {
  34. echo $this->control->tpl['js_checkVatPopup'];
  35. } ?>
  36. <table class="border allwidth">
  37. <tr>
  38. <td width="20%"><?php echo $langs->trans('ThirdPartyName'); ?></td>
  39. <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
  40. </tr>
  41. <?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
  42. <tr>
  43. <td><?php echo $langs->trans('Prefix'); ?></td>
  44. <td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
  45. </tr>
  46. <?php } ?>
  47. <?php if ($this->control->tpl['client']) { ?>
  48. <tr>
  49. <td><?php echo $langs->trans('CustomerCode'); ?></td>
  50. <td colspan="3"><?php echo $this->control->tpl['code_client']; ?>
  51. <?php if ($this->control->tpl['checkcustomercode'] <> 0) { ?>
  52. <span class="error">(<?php echo $langs->trans("WrongCustomerCode"); ?>)</span>
  53. <?php } ?>
  54. </td>
  55. </tr>
  56. <?php } ?>
  57. <?php if ($this->control->tpl['fournisseur']) { ?>
  58. <tr>
  59. <td><?php echo $langs->trans('SupplierCode'); ?></td>
  60. <td colspan="3"><?php echo $this->control->tpl['code_fournisseur']; ?>
  61. <?php if ($this->control->tpl['checksuppliercode'] <> 0) { ?>
  62. <span class="error">(<?php echo $langs->trans("WrongSupplierCode"); ?>)</span>
  63. <?php } ?>
  64. </td>
  65. </tr>
  66. <?php } ?>
  67. <?php if (isModEnabled('barcode')) { ?>
  68. <tr>
  69. <td><?php echo $langs->trans('Gencod'); ?></td>
  70. <td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>
  71. </tr>
  72. <?php } ?>
  73. <tr>
  74. <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
  75. <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
  76. </tr>
  77. <tr>
  78. <td width="25%"><?php echo $langs->trans('Zip'); ?></td>
  79. <td width="25%"><?php echo $this->control->tpl['zip']; ?></td>
  80. <td width="25%"><?php echo $langs->trans('Town'); ?></td>
  81. <td width="25%"><?php echo $this->control->tpl['town']; ?></td>
  82. </tr>
  83. <tr>
  84. <td><?php echo $langs->trans("Country"); ?></td>
  85. <td colspan="3" class="nowrap"><?php echo $this->control->tpl['country']; ?></td>
  86. </tr>
  87. <tr>
  88. <td><?php echo $langs->trans('State'); ?></td>
  89. <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
  90. </tr>
  91. <tr>
  92. <td><?php echo $langs->trans('Phone'); ?></td>
  93. <td><?php echo $this->control->tpl['phone']; ?></td>
  94. <td><?php echo $langs->trans('Fax'); ?></td>
  95. <td><?php echo $this->control->tpl['fax']; ?></td>
  96. </tr>
  97. <tr>
  98. <td><?php echo $langs->trans('EMail'); ?></td>
  99. <td><?php echo $this->control->tpl['email']; ?></td>
  100. <td><?php echo $langs->trans('Web'); ?></td>
  101. <td><?php echo $this->control->tpl['url']; ?></td>
  102. </tr>
  103. <?php
  104. for ($i = 1; $i <= 4; $i++) {
  105. if ($this->control->tpl['langprofid'.$i] != '-') {
  106. if ($i == 1 || $i == 3) {
  107. echo '<tr>';
  108. }
  109. echo '<td>'.$this->control->tpl['langprofid'.$i].'</td>';
  110. echo '<td>'.$this->control->tpl['profid'.$i];
  111. if ($this->control->tpl['profid'.$i]) {
  112. if ($this->control->tpl['checkprofid'.$i] > 0) {
  113. echo ' &nbsp; '.$this->control->tpl['urlprofid'.$i];
  114. } else {
  115. echo ' <span class="error">('.$langs->trans("ErrorWrongValue").')</span>';
  116. }
  117. }
  118. echo '</td>';
  119. if ($i == 2 || $i == 4) {
  120. echo '</tr>';
  121. }
  122. } else {
  123. if ($i == 1 || $i == 3) {
  124. echo '<tr>';
  125. }
  126. echo '<td>&nbsp;</td>';
  127. echo '<td>&nbsp;</td>';
  128. if ($i == 2 || $i == 4) {
  129. echo '</tr>';
  130. }
  131. }
  132. }
  133. ?>
  134. <tr>
  135. <td><?php echo $langs->trans('VATIsUsed'); ?></td>
  136. <td><?php echo $this->control->tpl['tva_assuj']; ?></td>
  137. <td class="nowrap"><?php echo $langs->trans('VATIntra'); ?></td>
  138. <td><?php echo $this->control->tpl['tva_intra']; ?></td>
  139. </tr>
  140. <?php if (!empty($this->control->tpl['localtax'])) {
  141. echo $this->control->tpl['localtax'];
  142. } ?>
  143. <tr>
  144. <td><?php echo $langs->trans('Capital'); ?></td>
  145. <td colspan="3">
  146. <?php
  147. if ($this->control->tpl['capital']) {
  148. echo $this->control->tpl['capital'].' '.$langs->trans("Currency".$conf->currency);
  149. } else {
  150. echo '&nbsp;';
  151. }
  152. ?>
  153. </td>
  154. </tr>
  155. <tr>
  156. <td><?php echo $langs->trans('JuridicalStatus'); ?></td>
  157. <td colspan="3"><?php echo $this->control->tpl['forme_juridique']; ?></td>
  158. </tr>
  159. <tr>
  160. <td><?php echo $langs->trans("ThirdPartyType"); ?></td>
  161. <td><?php echo $this->control->tpl['typent']; ?></td>
  162. <td><?php echo $langs->trans("Staff"); ?></td>
  163. <td><?php echo $this->control->tpl['effectif']; ?></td>
  164. </tr>
  165. <?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
  166. <tr>
  167. <td><?php echo $langs->trans("DefaultLang"); ?></td>
  168. <td colspan="3"><?php echo $this->control->tpl['default_lang']; ?></td>
  169. </tr>
  170. <?php } ?>
  171. <tr>
  172. <td>
  173. <table class="nobordernopadding allwidth">
  174. <tr>
  175. <td><?php echo $langs->trans('RIB'); ?></td>
  176. <td class="right">
  177. <?php if ($user->hasRight('societe', 'creer')) { ?>
  178. <a href="<?php echo DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
  179. <?php } else { ?>
  180. &nbsp;
  181. <?php } ?>
  182. </td>
  183. </tr>
  184. </table>
  185. </td>
  186. <td colspan="3"><?php echo $this->control->tpl['display_rib']; ?></td>
  187. </tr>
  188. <tr>
  189. <td>
  190. <table class="nobordernopadding allwidth">
  191. <tr>
  192. <td><?php echo $langs->trans('ParentCompany'); ?></td>
  193. <td class="right">
  194. &nbsp;
  195. </td>
  196. </tr>
  197. </table>
  198. </td>
  199. <td colspan="3"><?php echo $this->control->tpl['parent_company']; ?></td>
  200. </tr>
  201. <tr>
  202. <td>
  203. <table class="nobordernopadding allwidth">
  204. <tr>
  205. <td><?php echo $langs->trans('SalesRepresentatives'); ?></td>
  206. <td class="right">
  207. <?php if ($user->hasRight('societe', 'creer')) { ?>
  208. <a href="<?php echo DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
  209. <?php } else { ?>
  210. &nbsp;
  211. <?php } ?>
  212. </td>
  213. </tr>
  214. </table>
  215. </td>
  216. <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
  217. </tr>
  218. <?php if (isModEnabled('adherent')) { ?>
  219. <tr>
  220. <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
  221. <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>
  222. </tr>
  223. <?php } ?>
  224. </table>
  225. <?php print dol_get_fiche_end(); ?>
  226. <div class="tabsAction">
  227. <?php if ($user->hasRight('societe', 'creer')) { ?>
  228. <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>
  229. <?php } ?>
  230. <?php if ($user->hasRight('societe', 'supprimer')) { ?>
  231. <?php if ($conf->use_javascript_ajax) { ?>
  232. <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
  233. <?php } else { ?>
  234. <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>
  235. <?php } ?>
  236. <?php } ?>
  237. </div>
  238. <br>
  239. <table class="allwidth"><tr><td valign="top" width="50%">
  240. <div id="builddoc"></div>
  241. <?php
  242. /*
  243. * Generated documents
  244. */
  245. $filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
  246. $urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid;
  247. $genallowed = $user->hasRight('societe', 'lire');
  248. $delallowed = $user->hasRight('societe', 'creer');
  249. print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang);
  250. ?>
  251. </td>
  252. <td></td>
  253. </tr>
  254. </table>
  255. <br>
  256. <?php
  257. // Subsidiaries list
  258. $result = show_subsidiaries($conf, $langs, $db, $soc);
  259. // Contacts list
  260. $result = show_contacts($conf, $langs, $db, $soc);
  261. // Projects list
  262. $result = show_projects($conf, $langs, $db, $soc);
  263. ?>
  264. <!-- END PHP TEMPLATE -->