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$object = $GLOBALS['objcanvas']->control->object;
26
27
28print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP INDIVIDUAL -->\n";
29
30$head = societe_prepare_head($object);
31
32print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
33
34if ($this->control->tpl['error']) {
35 echo $this->control->tpl['error'];
36}
37if ($this->control->tpl['action_delete']) {
38 echo $this->control->tpl['action_delete'];
39} ?>
40
41<table class="border allwidth">
42
43<tr>
44 <td width="20%"><?php echo $langs->trans('Name'); ?></td>
45 <td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
46</tr>
47
48<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
49<tr>
50 <td><?php echo $langs->trans('Prefix'); ?></td>
51 <td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
52</tr>
53<?php } ?>
54
55<?php if ($this->control->tpl['client']) { ?>
56<tr>
57 <td><?php echo $langs->trans('CustomerCode'); ?></td>
58 <td colspan="3"><?php echo $this->control->tpl['code_client']; ?>
59 <?php if ($this->control->tpl['checkcustomercode'] != 0) { ?>
60 <span class="error">(<?php echo $langs->trans("WrongCustomerCode"); ?>)</span>
61 <?php } ?>
62 </td>
63</tr>
64<?php } ?>
65
66<?php if ($this->control->tpl['fournisseur']) { ?>
67<tr>
68 <td><?php echo $langs->trans('SupplierCode'); ?></td>
69 <td colspan="3"><?php echo $this->control->tpl['code_fournisseur']; ?>
70 <?php if ($this->control->tpl['checksuppliercode'] != 0) { ?>
71 <span class="error">(<?php echo $langs->trans("WrongSupplierCode"); ?>)</span>
72 <?php } ?>
73 </td>
74</tr>
75<?php } ?>
76
77<?php if (isModEnabled('barcode')) { ?>
78<tr>
79 <td><?php echo $langs->trans('Gencod'); ?></td>
80 <td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>
81</tr>
82<?php } ?>
83
84<tr>
85 <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
86 <td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
87</tr>
88
89<tr>
90 <td width="25%"><?php echo $langs->trans('Zip'); ?></td>
91 <td width="25%"><?php echo $this->control->tpl['zip']; ?></td>
92 <td width="25%"><?php echo $langs->trans('Town'); ?></td>
93 <td width="25%"><?php echo $this->control->tpl['town']; ?></td>
94</tr>
95
96<tr>
97 <td><?php echo $langs->trans("Country"); ?></td>
98 <td colspan="3" class="nowrap"><?php echo $this->control->tpl['country']; ?></td>
99</tr>
100
101<tr>
102 <td><?php echo $langs->trans('State'); ?></td>
103 <td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
104</tr>
105
106<tr>
107 <td><?php echo $langs->trans('Phone'); ?></td>
108 <td><?php echo $this->control->tpl['phone']; ?></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 <td><?php echo $langs->trans('Web'); ?></td>
117 <td><?php echo $this->control->tpl['url']; ?></td>
118</tr>
119
120<tr>
121 <td><?php echo $langs->trans('VATIsUsed'); ?></td>
122 <td colspan="3"><?php echo $this->control->tpl['tva_assuj']; ?></td>
123</tr>
124
125<?php if (!empty($this->control->tpl['localtax'])) {
126 echo $this->control->tpl['localtax'];
127} ?>
128
129<tr>
130 <td><?php echo $langs->trans("Type"); ?></td>
131 <td colspan="3"><?php echo $this->control->tpl['typent']; ?></td>
132</tr>
133
134<?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
135<tr>
136 <td><?php echo $langs->trans("DefaultLang"); ?></td>
137 <td colspan="3"><?php echo $this->control->tpl['default_lang']; ?></td>
138</tr>
139<?php } ?>
140
141<tr>
142 <td>
143 <table class="nobordernopadding allwidth">
144 <tr>
145 <td><?php echo $langs->trans('RIB'); ?></td>
146 <td class="right">
147 <?php if ($user->hasRight('societe', 'creer')) { ?>
148 <a href="<?php echo DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
149 <?php } else { ?>
150 &nbsp;
151 <?php } ?>
152 </td>
153 </tr>
154 </table>
155 </td>
156 <td colspan="3"><?php echo $this->control->tpl['display_rib']; ?></td>
157</tr>
158
159<tr>
160 <td>
161 <table class="nobordernopadding allwidth">
162 <tr>
163 <td><?php echo $langs->trans('SalesRepresentatives'); ?></td>
164 <td class="right">
165 <?php if ($user->hasRight('societe', 'creer')) { ?>
166 <a href="<?php echo DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->control->tpl['id']; ?>"><?php echo $this->control->tpl['image_edit']; ?></a>
167 <?php } else { ?>
168 &nbsp;
169 <?php } ?>
170 </td>
171 </tr>
172 </table>
173 </td>
174 <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
175</tr>
176
177<?php if (isModEnabled('adherent')) { ?>
178<tr>
179 <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
180 <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>
181</tr>
182<?php } ?>
183
184</table>
185
186<?php print dol_get_fiche_end(); ?>
187
188<div class="tabsAction">
189<?php if ($user->hasRight('societe', 'creer')) { ?>
190<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>
191<?php } ?>
192
193<?php if ($user->hasRight('societe', 'supprimer')) { ?>
194 <?php if ($conf->use_javascript_ajax) { ?>
195 <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
196 <?php } else { ?>
197 <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>
198 <?php } ?>
199<?php } ?>
200</div>
201
202<br>
203
204<table class="allwidth"><tr><td valign="top" width="50%">
205<div id="builddoc"></div>
206<?php
207/*
208 * Generated documents
209 */
210$filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
211$urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid;
212$genallowed = $user->hasRight('societe', 'lire');
213$delallowed = $user->hasRight('societe', 'creer');
214
215print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang);
216?>
217
218</td>
219<td></td>
220</tr>
221</table>
222
223<br>
224
225<?php
226// Subsidiaries list
227$result = show_subsidiaries($conf, $langs, $db, $object);
228
229// Contacts list
230$result = show_contacts($conf, $langs, $db, $object);
231
232// Projects list
233$result = show_projects($conf, $langs, $db, $object);
234
235print "<!-- END PHP TEMPLATE -->\n";
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.