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 */
27// Protection to avoid direct call of template
28if (empty($conf) || !is_object($conf)) {
29 print "Error, template page can't be called as URL";
30 exit(1);
31}
32
33
34$soc = $GLOBALS['objcanvas']->control->object;
35
36
37print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP COMPANY -->\n";
38
39$head = societe_prepare_head($soc);
40
41print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
42
43if ($this->control->tpl['error']) {
44 echo $this->control->tpl['error'];
45}
46if ($this->control->tpl['action_delete']) {
47 echo $this->control->tpl['action_delete'];
48}
49if ($this->control->tpl['js_checkVatPopup']) {
50 echo $this->control->tpl['js_checkVatPopup'];
51}
52?>
53
54<table class="border allwidth">
55
56<tr>
57 <td width="20%"><?php echo $langs->trans('ThirdPartyName'); ?></td>
58 <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
59</tr>
60
61<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
62<tr>
63 <td><?php echo $langs->trans('Prefix'); ?></td>
64 <td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
65</tr>
66<?php } ?>
67
68<?php if ($this->control->tpl['client']) { ?>
69<tr>
70 <td><?php echo $langs->trans('CustomerCode'); ?></td>
71 <td colspan="3"><?php echo $this->control->tpl['code_client']; ?>
72 <?php if ($this->control->tpl['checkcustomercode'] != 0) { ?>
73 <span class="error">(<?php echo $langs->trans("WrongCustomerCode"); ?>)</span>
74 <?php } ?>
75 </td>
76</tr>
77<?php } ?>
78
79<?php if ($this->control->tpl['fournisseur']) { ?>
80<tr>
81 <td><?php echo $langs->trans('SupplierCode'); ?></td>
82 <td colspan="3"><?php echo $this->control->tpl['code_fournisseur']; ?>
83 <?php if ($this->control->tpl['checksuppliercode'] != 0) { ?>
84 <span class="error">(<?php echo $langs->trans("WrongSupplierCode"); ?>)</span>
85 <?php } ?>
86 </td>
87</tr>
88<?php } ?>
89
90<?php if (isModEnabled('barcode')) { ?>
91<tr>
92 <td><?php echo $langs->trans('Gencod'); ?></td>
93 <td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>
94</tr>
95<?php } ?>
96
97<tr>
98 <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
99 <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
100</tr>
101
102<tr>
103 <td width="25%"><?php echo $langs->trans('Zip'); ?></td>
104 <td width="25%"><?php echo $this->control->tpl['zip']; ?></td>
105 <td width="25%"><?php echo $langs->trans('Town'); ?></td>
106 <td width="25%"><?php echo $this->control->tpl['town']; ?></td>
107</tr>
108
109<tr>
110 <td><?php echo $langs->trans("Country"); ?></td>
111 <td colspan="3" class="nowrap"><?php echo $this->control->tpl['country']; ?></td>
112</tr>
113
114<tr>
115 <td><?php echo $langs->trans('State'); ?></td>
116 <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
117</tr>
118
119<tr>
120 <td><?php echo $langs->trans('Phone'); ?></td>
121 <td><?php echo $this->control->tpl['phone']; ?></td>
122 <td><?php echo $langs->trans('PhoneMobile'); ?></td>
123 <td><?php echo $this->control->tpl['phone_mobile']; ?></td>
124 <td><?php echo $langs->trans('Fax'); ?></td>
125 <td><?php echo $this->control->tpl['fax']; ?></td>
126</tr>
127
128<tr>
129 <td><?php echo $langs->trans('EMail'); ?></td>
130 <td><?php echo $this->control->tpl['email']; ?></td>
131 <td><?php echo $langs->trans('Web'); ?></td>
132 <td><?php echo $this->control->tpl['url']; ?></td>
133</tr>
134
135<?php
136for ($i = 1; $i <= 4; $i++) {
137 if ($this->control->tpl['langprofid'.$i] != '-') {
138 if ($i == 1 || $i == 3) {
139 echo '<tr>';
140 }
141 echo '<td>'.$this->control->tpl['langprofid'.$i].'</td>';
142 echo '<td>'.$this->control->tpl['profid'.$i];
143 if ($this->control->tpl['profid'.$i]) {
144 if ($this->control->tpl['checkprofid'.$i] > 0) {
145 echo ' &nbsp; '.$this->control->tpl['urlprofid'.$i];
146 } else {
147 echo ' <span class="error">('.$langs->trans("ErrorWrongValue").')</span>';
148 }
149 }
150 echo '</td>';
151 if ($i == 2 || $i == 4) {
152 echo '</tr>';
153 }
154 } else {
155 if ($i == 1 || $i == 3) {
156 echo '<tr>';
157 }
158 echo '<td>&nbsp;</td>';
159 echo '<td>&nbsp;</td>';
160 if ($i == 2 || $i == 4) {
161 echo '</tr>';
162 }
163 }
164}
165?>
166
167<tr>
168 <td><?php echo $langs->trans('VATIsUsed'); ?></td>
169 <td><?php echo $this->control->tpl['tva_assuj']; ?></td>
170 <td class="nowrap"><?php echo $langs->trans('VATIntra'); ?></td>
171 <td><?php echo $this->control->tpl['tva_intra']; ?></td>
172</tr>
173
174<?php if (!empty($this->control->tpl['localtax'])) {
175 echo $this->control->tpl['localtax'];
176} ?>
177
178<tr>
179 <td><?php echo $langs->trans('Capital'); ?></td>
180 <td colspan="3">
181 <?php
182 if ($this->control->tpl['capital']) {
183 echo $this->control->tpl['capital'].' '.$langs->trans("Currency".$conf->currency);
184 } else {
185 echo '&nbsp;';
186 }
187 ?>
188 </td>
189</tr>
190
191<tr>
192 <td><?php echo $langs->trans('JuridicalStatus'); ?></td>
193 <td colspan="3"><?php echo $this->control->tpl['forme_juridique']; ?></td>
194</tr>
195
196<tr>
197 <td><?php echo $langs->trans("ThirdPartyType"); ?></td>
198 <td><?php echo $this->control->tpl['typent']; ?></td>
199 <td><?php echo $langs->trans("Staff"); ?></td>
200 <td><?php echo $this->control->tpl['effectif']; ?></td>
201</tr>
202
203<?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
204<tr>
205 <td><?php echo $langs->trans("DefaultLang"); ?></td>
206 <td colspan="3"><?php echo $this->control->tpl['default_lang']; ?></td>
207</tr>
208<?php } ?>
209
210<tr>
211 <td>
212 <table class="nobordernopadding allwidth">
213 <tr>
214 <td><?php echo $langs->trans('RIB'); ?></td>
215 <td class="right">
216 <?php if ($user->hasRight('societe', 'creer')) { ?>
217 <a href="<?php echo DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
218 <?php } else { ?>
219 &nbsp;
220 <?php } ?>
221 </td>
222 </tr>
223 </table>
224 </td>
225 <td colspan="3"><?php echo $this->control->tpl['display_rib']; ?></td>
226</tr>
227
228<tr>
229 <td>
230 <table class="nobordernopadding allwidth">
231 <tr>
232 <td><?php echo $langs->trans('ParentCompany'); ?></td>
233 <td class="right">
234 &nbsp;
235 </td>
236 </tr>
237 </table>
238 </td>
239 <td colspan="3"><?php echo $this->control->tpl['parent_company']; ?></td>
240</tr>
241
242<tr>
243 <td>
244 <table class="nobordernopadding allwidth">
245 <tr>
246 <td><?php echo $langs->trans('SalesRepresentatives'); ?></td>
247 <td class="right">
248 <?php if ($user->hasRight('societe', 'creer')) { ?>
249 <a href="<?php echo DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
250 <?php } else { ?>
251 &nbsp;
252 <?php } ?>
253 </td>
254 </tr>
255 </table>
256 </td>
257 <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
258</tr>
259
260<?php if (isModEnabled('member')) { ?>
261<tr>
262 <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
263 <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>
264</tr>
265<?php } ?>
266
267</table>
268
269<?php print dol_get_fiche_end(); ?>
270
271<div class="tabsAction">
272<?php if ($user->hasRight('societe', 'creer')) { ?>
273<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>
274<?php } ?>
275
276<?php if ($user->hasRight('societe', 'supprimer')) { ?>
277 <?php if ($conf->use_javascript_ajax) { ?>
278 <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
279 <?php } else { ?>
280 <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>
281 <?php } ?>
282<?php } ?>
283</div>
284
285<br>
286
287<table class="allwidth"><tr><td valign="top" width="50%">
288<div id="builddoc"></div>
289
290<?php
291/*
292 * Generated documents
293 */
294$filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
295$urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid;
296$genallowed = $user->hasRight('societe', 'lire');
297$delallowed = $user->hasRight('societe', 'creer');
298
299print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang);
300?>
301
302</td>
303<td></td>
304</tr>
305</table>
306
307<br>
308
309<?php
310// Subsidiaries list
311$result = show_subsidiaries($conf, $langs, $db, $soc);
312
313// Contacts list
314$result = show_contacts($conf, $langs, $db, $soc);
315
316// Projects list
317$result = show_projects($conf, $langs, $db, $soc);
318?>
319
320<!-- END PHP TEMPLATE -->
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