contactcard_view.tpl.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. /* Copyright (C) 2010-2012 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. $contact = $GLOBALS['objcanvas']->control->object;
  23. print "<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->\n";
  24. echo $this->control->tpl['showhead'];
  25. dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
  26. if (!empty($this->control->tpl['action_create_user'])) {
  27. echo $this->control->tpl['action_create_user'];
  28. }
  29. if (!empty($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("Ref"); ?></td>
  35. <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
  36. </tr>
  37. <tr>
  38. <td width="20%"><?php echo $langs->trans("Lastname"); ?></td>
  39. <td width="30%"><?php echo $this->control->tpl['name']; ?></td>
  40. <td width="25%"><?php echo $langs->trans("Firstname"); ?></td>
  41. <td width="25%"><?php echo $this->control->tpl['firstname']; ?></td>
  42. </tr>
  43. <tr>
  44. <td><?php echo $langs->trans("ThirdParty"); ?></td>
  45. <td colspan="3"><?php echo $this->control->tpl['company']; ?></td>
  46. </tr>
  47. <tr>
  48. <td width="15%"><?php echo $langs->trans("UserTitle"); ?></td>
  49. <td colspan="3"><?php echo $this->control->tpl['civility']; ?></td>
  50. </tr>
  51. <tr>
  52. <td><?php echo $langs->trans("PostOrFunction"); ?></td>
  53. <td colspan="3"><?php echo $this->control->tpl['poste']; ?></td>
  54. </tr>
  55. <tr>
  56. <td><?php echo $langs->trans("Address"); ?></td>
  57. <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
  58. </tr>
  59. <tr>
  60. <td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
  61. <td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['town']; ?></td>
  62. </tr>
  63. <tr>
  64. <td><?php echo $langs->trans("Country"); ?></td>
  65. <td colspan="3"><?php echo $this->control->tpl['country']; ?></td>
  66. </tr>
  67. <tr>
  68. <td><?php echo $langs->trans('State'); ?></td>
  69. <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
  70. </tr>
  71. <tr>
  72. <td><?php echo $langs->trans("PhonePro"); ?></td>
  73. <td><?php echo $this->control->tpl['phone_pro']; ?></td>
  74. <td><?php echo $langs->trans("PhonePerso"); ?></td>
  75. <td><?php echo $this->control->tpl['phone_perso']; ?></td>
  76. </tr>
  77. <tr>
  78. <td><?php echo $langs->trans("PhoneMobile"); ?></td>
  79. <td><?php echo $this->control->tpl['phone_mobile']; ?></td>
  80. <td><?php echo $langs->trans("Fax"); ?></td>
  81. <td><?php echo $this->control->tpl['fax']; ?></td>
  82. </tr>
  83. <tr>
  84. <td><?php echo $langs->trans("EMail"); ?></td>
  85. <td><?php echo $this->control->tpl['email']; ?></td>
  86. <?php if ($this->control->tpl['nb_emailing']) { ?>
  87. <td class="nowrap"><?php echo $langs->trans("NbOfEMailingsReceived"); ?></td>
  88. <td><?php echo $this->control->tpl['nb_emailing']; ?></td>
  89. <?php } else { ?>
  90. <td colspan="2">&nbsp;</td>
  91. <?php } ?>
  92. </tr>
  93. <tr>
  94. <td><?php echo $langs->trans("ContactVisibility"); ?></td>
  95. <td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
  96. </tr>
  97. <tr>
  98. <td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
  99. <td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
  100. </tr>
  101. <?php foreach ($this->control->tpl['contact_element'] as $element) { ?>
  102. <tr>
  103. <td><?php echo $element['linked_element_label']; ?></td>
  104. <td colspan="3"><?php echo $element['linked_element_value']; ?></td>
  105. </tr>
  106. <?php } ?>
  107. <tr>
  108. <td><?php echo $langs->trans("DolibarrLogin"); ?></td>
  109. <td colspan="3"><?php echo $this->control->tpl['dolibarr_user']; ?></td>
  110. </tr>
  111. </table>
  112. <?php echo $this->control->tpl['showend'];
  113. if (empty($user->socid)) {
  114. print '<div class="tabsAction">';
  115. if ($user->rights->societe->contact->creer) {
  116. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
  117. }
  118. if (!$this->control->tpl['user_id'] && $user->rights->user->user->creer) {
  119. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=create_user&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
  120. }
  121. if ($user->rights->societe->contact->supprimer) {
  122. print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
  123. }
  124. print '</div><br>';
  125. }
  126. echo $this->control->tpl['actionstodo'];
  127. echo $this->control->tpl['actionsdone'];
  128. print "<!-- END PHP TEMPLATE -->\n";