dolibarr  13.0.2
contactcard_view.tpl.php
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 
18 // Protection to avoid direct call of template
19 if (empty($conf) || !is_object($conf))
20 {
21  print "Error, template page can't be called as URL";
22  exit;
23 }
24 
25 
26 $contact = $GLOBALS['objcanvas']->control->object;
27 
28 print "<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->\n";
29 echo $this->control->tpl['showhead'];
30 
31 dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
32 
33 if (!empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user'];
34 if (!empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
35 
36 <table class="border allwidth">
37 
38 <tr>
39  <td width="20%"><?php echo $langs->trans("Ref"); ?></td>
40  <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
41 </tr>
42 
43 <tr>
44  <td width="20%"><?php echo $langs->trans("Lastname"); ?></td>
45  <td width="30%"><?php echo $this->control->tpl['name']; ?></td>
46  <td width="25%"><?php echo $langs->trans("Firstname"); ?></td>
47  <td width="25%"><?php echo $this->control->tpl['firstname']; ?></td>
48 </tr>
49 
50 <tr>
51  <td><?php echo $langs->trans("ThirdParty"); ?></td>
52  <td colspan="3"><?php echo $this->control->tpl['company']; ?></td>
53 </tr>
54 
55 <tr>
56  <td width="15%"><?php echo $langs->trans("UserTitle"); ?></td>
57  <td colspan="3"><?php echo $this->control->tpl['civility']; ?></td>
58 </tr>
59 
60 <tr>
61  <td><?php echo $langs->trans("PostOrFunction"); ?></td>
62  <td colspan="3"><?php echo $this->control->tpl['poste']; ?></td>
63 </tr>
64 
65 <tr>
66  <td><?php echo $langs->trans("Address"); ?></td>
67  <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
68 </tr>
69 
70 <tr>
71  <td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
72  <td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['town']; ?></td>
73 </tr>
74 
75 <tr>
76  <td><?php echo $langs->trans("Country"); ?></td>
77  <td colspan="3"><?php echo $this->control->tpl['country']; ?></td>
78 </tr>
79 
80 <tr>
81  <td><?php echo $langs->trans('State'); ?></td>
82  <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
83 </tr>
84 
85 <tr>
86  <td><?php echo $langs->trans("PhonePro"); ?></td>
87  <td><?php echo $this->control->tpl['phone_pro']; ?></td>
88  <td><?php echo $langs->trans("PhonePerso"); ?></td>
89  <td><?php echo $this->control->tpl['phone_perso']; ?></td>
90 </tr>
91 
92 <tr>
93  <td><?php echo $langs->trans("PhoneMobile"); ?></td>
94  <td><?php echo $this->control->tpl['phone_mobile']; ?></td>
95  <td><?php echo $langs->trans("Fax"); ?></td>
96  <td><?php echo $this->control->tpl['fax']; ?></td>
97 </tr>
98 
99 <tr>
100  <td><?php echo $langs->trans("EMail"); ?></td>
101  <td><?php echo $this->control->tpl['email']; ?></td>
102  <?php if ($this->control->tpl['nb_emailing']) { ?>
103  <td class="nowrap"><?php echo $langs->trans("NbOfEMailingsReceived"); ?></td>
104  <td><?php echo $this->control->tpl['nb_emailing']; ?></td>
105  <?php } else { ?>
106  <td colspan="2">&nbsp;</td>
107  <?php } ?>
108 </tr>
109 
110 <tr>
111  <td><?php echo $langs->trans("ContactVisibility"); ?></td>
112  <td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
113 </tr>
114 
115 <tr>
116  <td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
117  <td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
118 </tr>
119 
120 <?php foreach ($this->control->tpl['contact_element'] as $element) { ?>
121 <tr>
122  <td><?php echo $element['linked_element_label']; ?></td>
123  <td colspan="3"><?php echo $element['linked_element_value']; ?></td>
124 </tr>
125 <?php } ?>
126 
127 <tr>
128  <td><?php echo $langs->trans("DolibarrLogin"); ?></td>
129  <td colspan="3"><?php echo $this->control->tpl['dolibarr_user']; ?></td>
130 </tr>
131 
132 </table>
133 
134 <?php echo $this->control->tpl['showend'];
135 
136 if (empty($user->socid)) {
137  print '<div class="tabsAction">';
138  if ($user->rights->societe->contact->creer) {
139  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
140  }
141 
142  if (!$this->control->tpl['user_id'] && $user->rights->user->user->creer) {
143  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
144  }
145 
146  if ($user->rights->societe->contact->supprimer) {
147  print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;token='.newToken().'&amp;canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
148  }
149 
150  print '</div><br>';
151 }
152 
153 echo $this->control->tpl['actionstodo'];
154 
155 echo $this->control->tpl['actionsdone'];
156 
157 print "<!-- END PHP TEMPLATE -->\n";
print
Draft customers invoices.
Definition: index.php:89
newToken()
Return the value of token currently saved into session with name &#39;newtoken&#39;.
dol_htmloutput_errors($mesgstring= '', $mesgarray=array(), $keepembedded=0)
Print formated error messages to output (Used to show messages on html output).