dolibarr 21.0.0-beta
contactcard_view.tpl.php
1<?php
2/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
26// Protection to avoid direct call of template
27if (empty($conf) || !is_object($conf)) {
28 print "Error, template page can't be called as URL";
29 exit(1);
30}
31
32
33$contact = $GLOBALS['objcanvas']->control->object;
34
35print "<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->\n";
36echo $this->control->tpl['showhead'];
37
38dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
39
40if (!empty($this->control->tpl['action_create_user'])) {
41 echo $this->control->tpl['action_create_user'];
42}
43if (!empty($this->control->tpl['action_delete'])) {
44 echo $this->control->tpl['action_delete'];
45} ?>
46
47<table class="border allwidth">
48
49<tr>
50 <td width="20%"><?php echo $langs->trans("Ref"); ?></td>
51 <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
52</tr>
53
54<tr>
55 <td width="20%"><?php echo $langs->trans("Lastname"); ?></td>
56 <td width="30%"><?php echo $this->control->tpl['name']; ?></td>
57 <td width="25%"><?php echo $langs->trans("Firstname"); ?></td>
58 <td width="25%"><?php echo $this->control->tpl['firstname']; ?></td>
59</tr>
60
61<tr>
62 <td><?php echo $langs->trans("ThirdParty"); ?></td>
63 <td colspan="3"><?php echo $this->control->tpl['company']; ?></td>
64</tr>
65
66<tr>
67 <td width="15%"><?php echo $langs->trans("UserTitle"); ?></td>
68 <td colspan="3"><?php echo $this->control->tpl['civility']; ?></td>
69</tr>
70
71<tr>
72 <td><?php echo $langs->trans("PostOrFunction"); ?></td>
73 <td colspan="3"><?php echo $this->control->tpl['poste']; ?></td>
74</tr>
75
76<tr>
77 <td><?php echo $langs->trans("Address"); ?></td>
78 <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
79</tr>
80
81<tr>
82 <td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
83 <td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['town']; ?></td>
84</tr>
85
86<tr>
87 <td><?php echo $langs->trans("Country"); ?></td>
88 <td colspan="3"><?php echo $this->control->tpl['country']; ?></td>
89</tr>
90
91<tr>
92 <td><?php echo $langs->trans('State'); ?></td>
93 <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
94</tr>
95
96<tr>
97 <td><?php echo $langs->trans("PhonePro"); ?></td>
98 <td><?php echo $this->control->tpl['phone_pro']; ?></td>
99 <td><?php echo $langs->trans("PhonePerso"); ?></td>
100 <td><?php echo $this->control->tpl['phone_perso']; ?></td>
101</tr>
102
103<tr>
104 <td><?php echo $langs->trans("PhoneMobile"); ?></td>
105 <td><?php echo $this->control->tpl['phone_mobile']; ?></td>
106 <td><?php echo $langs->trans("Fax"); ?></td>
107 <td><?php echo $this->control->tpl['fax']; ?></td>
108</tr>
109
110<tr>
111 <td><?php echo $langs->trans("EMail"); ?></td>
112 <td><?php echo $this->control->tpl['email']; ?></td>
113 <?php if ($this->control->tpl['nb_emailing']) { ?>
114 <td class="nowrap"><?php echo $langs->trans("NbOfEMailingsReceived"); ?></td>
115 <td><?php echo $this->control->tpl['nb_emailing']; ?></td>
116 <?php } else { ?>
117 <td colspan="2">&nbsp;</td>
118 <?php } ?>
119</tr>
120
121<tr>
122 <td><?php echo $langs->trans("ContactVisibility"); ?></td>
123 <td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
124</tr>
125
126<tr>
127 <td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
128 <td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
129</tr>
130
131<?php foreach ($this->control->tpl['contact_element'] as $element) { ?>
132<tr>
133 <td><?php echo $element['linked_element_label']; ?></td>
134 <td colspan="3"><?php echo $element['linked_element_value']; ?></td>
135</tr>
136<?php } ?>
137
138<tr>
139 <td><?php echo $langs->trans("DolibarrLogin"); ?></td>
140 <td colspan="3"><?php echo $this->control->tpl['dolibarr_user']; ?></td>
141</tr>
142
143</table>
144
145<?php echo $this->control->tpl['showend'];
146
147if (empty($user->socid)) {
148 print '<div class="tabsAction">';
149 if ($user->hasRight('societe', 'contact', 'creer')) {
150 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
151 }
152
153 if (!$this->control->tpl['user_id'] && $user->hasRight('user', 'user', 'creer')) {
154 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=create_user&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
155 }
156
157 if ($user->hasRight('societe', 'contact', 'supprimer')) {
158 print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
159 }
160
161 print '</div><br>';
162}
163
164echo $this->control->tpl['actionstodo'];
165
166echo $this->control->tpl['actionsdone'];
167
168print "<!-- END PHP TEMPLATE -->\n";
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
treeview li table
No Email.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79