dolibarr 21.0.0-beta
card_view.tpl.php
1<?php
2/* Copyright (C) 2010-2011 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
30// Protection to avoid direct call of template
31if (empty($conf) || !is_object($conf)) {
32 print "Error, template page can't be called as URL";
33 exit(1);
34}
35
36
37$object = $GLOBALS['objcanvas']->control->object;
38
39
40print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP INDIVIDUAL -->\n";
41
42$head = societe_prepare_head($object);
43
44print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
45
46if ($this->control->tpl['error']) {
47 echo $this->control->tpl['error'];
48}
49if ($this->control->tpl['action_delete']) {
50 echo $this->control->tpl['action_delete'];
51} ?>
52
53<table class="border allwidth">
54
55<tr>
56 <td width="20%"><?php echo $langs->trans('Name'); ?></td>
57 <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
58</tr>
59
60<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
61<tr>
62 <td><?php echo $langs->trans('Prefix'); ?></td>
63 <td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
64</tr>
65<?php } ?>
66
67<?php if ($this->control->tpl['client']) { ?>
68<tr>
69 <td><?php echo $langs->trans('CustomerCode'); ?></td>
70 <td colspan="3"><?php echo $this->control->tpl['code_client']; ?>
71 <?php if ($this->control->tpl['checkcustomercode'] != 0) { ?>
72 <span class="error">(<?php echo $langs->trans("WrongCustomerCode"); ?>)</span>
73 <?php } ?>
74 </td>
75</tr>
76<?php } ?>
77
78<?php if ($this->control->tpl['fournisseur']) { ?>
79<tr>
80 <td><?php echo $langs->trans('SupplierCode'); ?></td>
81 <td colspan="3"><?php echo $this->control->tpl['code_fournisseur']; ?>
82 <?php if ($this->control->tpl['checksuppliercode'] != 0) { ?>
83 <span class="error">(<?php echo $langs->trans("WrongSupplierCode"); ?>)</span>
84 <?php } ?>
85 </td>
86</tr>
87<?php } ?>
88
89<?php if (isModEnabled('barcode')) { ?>
90<tr>
91 <td><?php echo $langs->trans('Gencod'); ?></td>
92 <td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>
93</tr>
94<?php } ?>
95
96<tr>
97 <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
98 <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
99</tr>
100
101<tr>
102 <td width="25%"><?php echo $langs->trans('Zip'); ?></td>
103 <td width="25%"><?php echo $this->control->tpl['zip']; ?></td>
104 <td width="25%"><?php echo $langs->trans('Town'); ?></td>
105 <td width="25%"><?php echo $this->control->tpl['town']; ?></td>
106</tr>
107
108<tr>
109 <td><?php echo $langs->trans("Country"); ?></td>
110 <td colspan="3" class="nowrap"><?php echo $this->control->tpl['country']; ?></td>
111</tr>
112
113<tr>
114 <td><?php echo $langs->trans('State'); ?></td>
115 <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
116</tr>
117
118<tr>
119 <td><?php echo $langs->trans('Phone'); ?></td>
120 <td><?php echo $this->control->tpl['phone']; ?></td>
121 <td><?php echo $langs->trans('PhoneMobile'); ?></td>
122 <td><?php echo $this->control->tpl['phone_mobile']; ?></td>
123 <td><?php echo $langs->trans('Fax'); ?></td>
124 <td><?php echo $this->control->tpl['fax']; ?></td>
125</tr>
126
127<tr>
128 <td><?php echo $langs->trans('EMail'); ?></td>
129 <td><?php echo $this->control->tpl['email']; ?></td>
130 <td><?php echo $langs->trans('Web'); ?></td>
131 <td><?php echo $this->control->tpl['url']; ?></td>
132</tr>
133
134<tr>
135 <td><?php echo $langs->trans('VATIsUsed'); ?></td>
136 <td colspan="3"><?php echo $this->control->tpl['tva_assuj']; ?></td>
137</tr>
138
139<?php if (!empty($this->control->tpl['localtax'])) {
140 echo $this->control->tpl['localtax'];
141} ?>
142
143<tr>
144 <td><?php echo $langs->trans("Type"); ?></td>
145 <td colspan="3"><?php echo $this->control->tpl['typent']; ?></td>
146</tr>
147
148<?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
149<tr>
150 <td><?php echo $langs->trans("DefaultLang"); ?></td>
151 <td colspan="3"><?php echo $this->control->tpl['default_lang']; ?></td>
152</tr>
153<?php } ?>
154
155<tr>
156 <td>
157 <table class="nobordernopadding allwidth">
158 <tr>
159 <td><?php echo $langs->trans('RIB'); ?></td>
160 <td class="right">
161 <?php if ($user->hasRight('societe', 'creer')) { ?>
162 <a href="<?php echo DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
163 <?php } else { ?>
164 &nbsp;
165 <?php } ?>
166 </td>
167 </tr>
168 </table>
169 </td>
170 <td colspan="3"><?php echo $this->control->tpl['display_rib']; ?></td>
171</tr>
172
173<tr>
174 <td>
175 <table class="nobordernopadding allwidth">
176 <tr>
177 <td><?php echo $langs->trans('SalesRepresentatives'); ?></td>
178 <td class="right">
179 <?php if ($user->hasRight('societe', 'creer')) { ?>
180 <a href="<?php echo DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
181 <?php } else { ?>
182 &nbsp;
183 <?php } ?>
184 </td>
185 </tr>
186 </table>
187 </td>
188 <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
189</tr>
190
191<?php if (isModEnabled('member')) { ?>
192<tr>
193 <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
194 <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>
195</tr>
196<?php } ?>
197
198</table>
199
200<?php print dol_get_fiche_end(); ?>
201
202<div class="tabsAction">
203<?php if ($user->hasRight('societe', 'creer')) { ?>
204<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.urlencode($canvas); ?>"><?php echo $langs->trans("Modify"); ?></a>
205<?php } ?>
206
207<?php if ($user->hasRight('societe', 'supprimer')) { ?>
208 <?php if ($conf->use_javascript_ajax) { ?>
209 <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
210 <?php } else { ?>
211 <a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.urlencode($canvas); ?>"><?php echo $langs->trans('Delete'); ?></a>
212 <?php } ?>
213<?php } ?>
214</div>
215
216<br>
217
218<table class="allwidth"><tr><td valign="top" width="50%">
219<div id="builddoc"></div>
220<?php
221/*
222 * Generated documents
223 */
224$filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
225$urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid;
226$genallowed = $user->hasRight('societe', 'lire');
227$delallowed = $user->hasRight('societe', 'creer');
228
229print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang);
230?>
231
232</td>
233<td></td>
234</tr>
235</table>
236
237<br>
238
239<?php
240// Subsidiaries list
241$result = show_subsidiaries($conf, $langs, $db, $object);
242
243// Contacts list
244$result = show_contacts($conf, $langs, $db, $object);
245
246// Projects list
247$result = show_projects($conf, $langs, $db, $object);
248
249print "<!-- END PHP TEMPLATE -->\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='')
Show html area for list of projects.
show_contacts($conf, $langs, $db, $object, $backtopage='', $showuserlogin=0)
Show html area for list of contacts.
show_subsidiaries($conf, $langs, $db, $object)
Show html area for list of subsidiaries.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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