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