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