dolibarr 20.0.0
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(1);
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('PhoneMobile'); ?></td>
115 <td><?php echo $this->control->tpl['phone_mobile']; ?></td>
116 <td><?php echo $langs->trans('Fax'); ?></td>
117 <td><?php echo $this->control->tpl['fax']; ?></td>
118</tr>
119
120<tr>
121 <td><?php echo $langs->trans('EMail'); ?></td>
122 <td><?php echo $this->control->tpl['email']; ?></td>
123 <td><?php echo $langs->trans('Web'); ?></td>
124 <td><?php echo $this->control->tpl['url']; ?></td>
125</tr>
126
127<?php
128for ($i = 1; $i <= 4; $i++) {
129 if ($this->control->tpl['langprofid'.$i] != '-') {
130 if ($i == 1 || $i == 3) {
131 echo '<tr>';
132 }
133 echo '<td>'.$this->control->tpl['langprofid'.$i].'</td>';
134 echo '<td>'.$this->control->tpl['profid'.$i];
135 if ($this->control->tpl['profid'.$i]) {
136 if ($this->control->tpl['checkprofid'.$i] > 0) {
137 echo ' &nbsp; '.$this->control->tpl['urlprofid'.$i];
138 } else {
139 echo ' <span class="error">('.$langs->trans("ErrorWrongValue").')</span>';
140 }
141 }
142 echo '</td>';
143 if ($i == 2 || $i == 4) {
144 echo '</tr>';
145 }
146 } else {
147 if ($i == 1 || $i == 3) {
148 echo '<tr>';
149 }
150 echo '<td>&nbsp;</td>';
151 echo '<td>&nbsp;</td>';
152 if ($i == 2 || $i == 4) {
153 echo '</tr>';
154 }
155 }
156}
157?>
158
159<tr>
160 <td><?php echo $langs->trans('VATIsUsed'); ?></td>
161 <td><?php echo $this->control->tpl['tva_assuj']; ?></td>
162 <td class="nowrap"><?php echo $langs->trans('VATIntra'); ?></td>
163 <td><?php echo $this->control->tpl['tva_intra']; ?></td>
164</tr>
165
166<?php if (!empty($this->control->tpl['localtax'])) {
167 echo $this->control->tpl['localtax'];
168} ?>
169
170<tr>
171 <td><?php echo $langs->trans('Capital'); ?></td>
172 <td colspan="3">
173 <?php
174 if ($this->control->tpl['capital']) {
175 echo $this->control->tpl['capital'].' '.$langs->trans("Currency".$conf->currency);
176 } else {
177 echo '&nbsp;';
178 }
179 ?>
180 </td>
181</tr>
182
183<tr>
184 <td><?php echo $langs->trans('JuridicalStatus'); ?></td>
185 <td colspan="3"><?php echo $this->control->tpl['forme_juridique']; ?></td>
186</tr>
187
188<tr>
189 <td><?php echo $langs->trans("ThirdPartyType"); ?></td>
190 <td><?php echo $this->control->tpl['typent']; ?></td>
191 <td><?php echo $langs->trans("Staff"); ?></td>
192 <td><?php echo $this->control->tpl['effectif']; ?></td>
193</tr>
194
195<?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
196<tr>
197 <td><?php echo $langs->trans("DefaultLang"); ?></td>
198 <td colspan="3"><?php echo $this->control->tpl['default_lang']; ?></td>
199</tr>
200<?php } ?>
201
202<tr>
203 <td>
204 <table class="nobordernopadding allwidth">
205 <tr>
206 <td><?php echo $langs->trans('RIB'); ?></td>
207 <td class="right">
208 <?php if ($user->hasRight('societe', 'creer')) { ?>
209 <a href="<?php echo DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
210 <?php } else { ?>
211 &nbsp;
212 <?php } ?>
213 </td>
214 </tr>
215 </table>
216 </td>
217 <td colspan="3"><?php echo $this->control->tpl['display_rib']; ?></td>
218</tr>
219
220<tr>
221 <td>
222 <table class="nobordernopadding allwidth">
223 <tr>
224 <td><?php echo $langs->trans('ParentCompany'); ?></td>
225 <td class="right">
226 &nbsp;
227 </td>
228 </tr>
229 </table>
230 </td>
231 <td colspan="3"><?php echo $this->control->tpl['parent_company']; ?></td>
232</tr>
233
234<tr>
235 <td>
236 <table class="nobordernopadding allwidth">
237 <tr>
238 <td><?php echo $langs->trans('SalesRepresentatives'); ?></td>
239 <td class="right">
240 <?php if ($user->hasRight('societe', 'creer')) { ?>
241 <a href="<?php echo DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
242 <?php } else { ?>
243 &nbsp;
244 <?php } ?>
245 </td>
246 </tr>
247 </table>
248 </td>
249 <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
250</tr>
251
252<?php if (isModEnabled('member')) { ?>
253<tr>
254 <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
255 <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>
256</tr>
257<?php } ?>
258
259</table>
260
261<?php print dol_get_fiche_end(); ?>
262
263<div class="tabsAction">
264<?php if ($user->hasRight('societe', 'creer')) { ?>
265<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>
266<?php } ?>
267
268<?php if ($user->hasRight('societe', 'supprimer')) { ?>
269 <?php if ($conf->use_javascript_ajax) { ?>
270 <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
271 <?php } else { ?>
272 <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>
273 <?php } ?>
274<?php } ?>
275</div>
276
277<br>
278
279<table class="allwidth"><tr><td valign="top" width="50%">
280<div id="builddoc"></div>
281
282<?php
283/*
284 * Generated documents
285 */
286$filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
287$urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid;
288$genallowed = $user->hasRight('societe', 'lire');
289$delallowed = $user->hasRight('societe', 'creer');
290
291print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang);
292?>
293
294</td>
295<td></td>
296</tr>
297</table>
298
299<br>
300
301<?php
302// Subsidiaries list
303$result = show_subsidiaries($conf, $langs, $db, $soc);
304
305// Contacts list
306$result = show_contacts($conf, $langs, $db, $soc);
307
308// Projects list
309$result = show_projects($conf, $langs, $db, $soc);
310?>
311
312<!-- 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.
treeview li table
No Email.