PageRenderTime 51ms CodeModel.GetById 6ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/societe/canvas/company/tpl/card_view.tpl.php

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