dolibarr 24.0.0-beta
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2014-2021 Charlene Benke <charlene.r@benke.fr>
6 * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
7 * Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
8 * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
9 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
31// Load Dolibarr environment
32require '../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
41require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
42require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
43
44// Load translation files required by the page
45$langs->load("companies");
46
47
48// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
49$hookmanager->initHooks(array('thirdpartiesindex'));
50
51
52$socid = GETPOSTINT('socid');
53if ($user->socid) {
54 $socid = $user->socid;
55}
56
57// Security check
58$result = restrictedArea($user, 'societe|contact', 0, '', '', '', '');
59
60$thirdparty_static = new Societe($db);
61$contact_static = new Contact($db);
62
63if (!isset($form) || !is_object($form)) {
64 $form = new Form($db);
65}
66
67// Load $resultboxes
68$resultboxes = FormOther::getBoxesArea($user, "3");
69
70if (GETPOST('addbox')) {
71 // Add box (when submit is done from a form when ajax disabled)
72 require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
73 $zone = GETPOSTINT('areacode');
74 $userid = GETPOSTINT('userid');
75 $boxorder = GETPOST('boxorder', 'aZ09');
76 $boxorder .= GETPOST('boxcombo', 'aZ09');
77 $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
78 if ($result > 0) {
79 setEventMessages($langs->trans("BoxAdded"), null);
80 }
81}
82
83$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
84
85
86/*
87 * View
88 */
89
90$transAreaType = $langs->trans("ThirdPartiesArea");
91$helpurl = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Terceros';
92
93llxHeader("", $langs->trans("ThirdParties"), $helpurl);
94
95print load_fiche_titre($transAreaType, $resultboxes['selectboxlist'], 'companies');
96
97
98// Statistics area
99
100$third = array(
101 'customer' => 0,
102 'prospect' => 0,
103 'supplier' => 0,
104 'other' =>0
105);
106$total = 0;
107
108$sql = "SELECT s.rowid, s.client, s.fournisseur";
109$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
110if (!$user->hasRight('societe', 'client', 'voir')) {
111 $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
112}
113$sql .= ' WHERE s.entity IN ('.getEntity('societe').')';
114if (!$user->hasRight('societe', 'client', 'voir')) {
115 $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
116}
117if (!$user->hasRight('fournisseur', 'lire')) {
118 $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
119}
120// Add where from hooks
121$parameters = array('socid' => $socid);
122$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
123if (empty($reshook)) {
124 if ($socid > 0) {
125 $sql .= " AND s.rowid = ".((int) $socid);
126 }
127}
128$sql .= $hookmanager->resPrint;
129//print $sql;
130$result = $db->query($sql);
131if ($result) {
132 while ($objp = $db->fetch_object($result)) {
133 $found = 0;
134 if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS') && ($objp->client == 2 || $objp->client == 3)) {
135 $found = 1;
136 $third['prospect']++;
137 }
138 if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS') && ($objp->client == 1 || $objp->client == 3)) {
139 $found = 1;
140 $third['customer']++;
141 }
142 if (((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_STATS') && $objp->fournisseur) {
143 $found = 1;
144 $third['supplier']++;
145 }
146 if (isModEnabled('societe') && $objp->client == 0 && $objp->fournisseur == 0) {
147 $found = 1;
148 $third['other']++;
149 }
150 if ($found) {
151 $total++;
152 }
153 }
154} else {
156}
157
158$thirdpartygraph = '<div class="div-table-responsive-no-min">';
159$thirdpartygraph .= '<table class="noborder nohover centpercent">'."\n";
160$thirdpartygraph .= '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("NatureOfThirdParty").'</th></tr>';
161if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) {
162 $thirdpartygraph .= '<tr><td class="center" colspan="2">';
163 $dataseries = array();
164 if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS')) {
165 $dataseries[] = array($langs->transnoentitiesnoconv("Prospects"), round($third['prospect']));
166 }
167 if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS')) {
168 $dataseries[] = array($langs->transnoentitiesnoconv("Customers"), round($third['customer']));
169 }
170 if (((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_STATS')) {
171 $dataseries[] = array($langs->transnoentitiesnoconv("Suppliers"), round($third['supplier']));
172 }
173 if (isModEnabled('societe')) {
174 $dataseries[] = array($langs->transnoentitiesnoconv("Others"), round($third['other']));
175 }
176 include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
177 $dolgraph = new DolGraph();
178 $dolgraph->SetData($dataseries);
179 $dolgraph->setShowLegend(2);
180 $dolgraph->setShowPercent(1);
181 $dolgraph->SetType(array('pie'));
182 $dolgraph->setHeight('200');
183 $dolgraph->draw('idgraphthirdparties');
184 $thirdpartygraph .= $dolgraph->show();
185 $thirdpartygraph .= '</td></tr>'."\n";
186} else {
187 $statstring = '';
188 if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS')) {
189 $statstring .= "<tr>";
190 $statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=p">'.$langs->trans("Prospects").'</a></td><td class="right">'.round($third['prospect']).'</td>';
191 $statstring .= "</tr>";
192 }
193 if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS')) {
194 $statstring .= "<tr>";
195 $statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=c">'.$langs->trans("Customers").'</a></td><td class="right">'.round($third['customer']).'</td>';
196 $statstring .= "</tr>";
197 }
198 $statstring2 = '';
199 if (((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_STATS')) {
200 $statstring2 .= "<tr>";
201 $statstring2 .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td class="right">'.round($third['supplier']).'</td>';
202 $statstring2 .= "</tr>";
203 }
204 $thirdpartygraph .= $statstring;
205 $thirdpartygraph .= $statstring2;
206}
207$thirdpartygraph .= '<tr class="liste_total"><td>'.$langs->trans("UniqueThirdParties").'</td><td class="right">';
208$thirdpartygraph .= $total;
209$thirdpartygraph .= '</td></tr>';
210$thirdpartygraph .= '</table>';
211$thirdpartygraph .= '</div>';
212
213$thirdpartycateggraph = '';
214if (isModEnabled('category') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES')) {
215 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
216
217 $thirdpartycateggraph = '<div class="div-table-responsive-no-min">';
218 $thirdpartycateggraph .= '<table class="noborder nohover centpercent">';
219 $thirdpartycateggraph .= '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
220 $thirdpartycateggraph .= '<tr><td class="center" colspan="2">';
221 $sql = "SELECT c.label, count(*) as nb";
222 $sql .= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs";
223 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
224 $sql .= " WHERE c.type = 2";
225 if (!is_numeric(getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES'))) {
226 $sql .= " AND c.label like '".$db->escape(getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES'))."'";
227 }
228 $sql .= " AND c.entity IN (".getEntity('category').")";
229 $sql .= " GROUP BY c.label";
230 $total = 0;
231 $result = $db->query($sql);
232 if ($result) {
233 $num = $db->num_rows($result);
234 $i = 0;
235 if (!empty($conf->use_javascript_ajax)) {
236 $dataseries = array();
237 $rest = 0;
238 $nbmax = 10;
239
240 while ($i < $num) {
241 $obj = $db->fetch_object($result);
242 if ($i < $nbmax) {
243 $dataseries[] = array($obj->label, round($obj->nb));
244 } else {
245 $rest += $obj->nb;
246 }
247 $total += $obj->nb;
248 $i++;
249 }
250 if ($i > $nbmax) {
251 $dataseries[] = array($langs->trans("Other"), round($rest));
252 }
253 include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
254 $dolgraph = new DolGraph();
255 $dolgraph->SetData($dataseries);
256 $dolgraph->setShowLegend(2);
257 $dolgraph->setShowPercent(1);
258 $dolgraph->SetType(array('pie'));
259 $dolgraph->setHeight('200');
260 $dolgraph->draw('idgraphcateg');
261 $thirdpartycateggraph .= $dolgraph->show();
262 } else {
263 while ($i < $num) {
264 $obj = $db->fetch_object($result);
265
266 $thirdpartycateggraph .= '<tr class="oddeven"><td>'.dolPrintHTML($obj->label).'</td><td>'.$obj->nb.'</td></tr>';
267 $total += $obj->nb;
268 $i++;
269 }
270 }
271 }
272 $thirdpartycateggraph .= '</td></tr>';
273 $thirdpartycateggraph .= '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
274 $thirdpartycateggraph .= $total;
275 $thirdpartycateggraph .= '</td></tr>';
276 $thirdpartycateggraph .= '</table>';
277 $thirdpartycateggraph .= '</div>';
278} else {
279 $thirdpartycateggraph = '';
280}
281
282
283/*
284 * Latest modified third parties
285 */
286
287$sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur";
288$sql .= ", s.code_client";
289$sql .= ", s.code_fournisseur";
290if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
291 $sql .= ", spe.accountancy_code_supplier as code_compta_fournisseur";
292 $sql .= ", spe.accountancy_code_customer as code_compta";
293} else {
294 $sql .= ", s.code_compta_fournisseur";
295 $sql .= ", s.code_compta";
296}
297$sql .= ", s.logo";
298$sql .= ", s.entity";
299$sql .= ", s.canvas, GREATEST(s.tms, sef.tms) as date_modification, s.status as status";
300$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
301$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as sef ON sef.fk_object=s.rowid";
302if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
303 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
304}
305// TODO Replace this
306if (!$user->hasRight('societe', 'client', 'voir')) {
307 $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
308}
309$sql .= ' WHERE s.entity IN ('.getEntity('societe').')';
310if (!$user->hasRight('societe', 'client', 'voir')) {
311 $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
312}
313if (!$user->hasRight('fournisseur', 'lire')) {
314 $sql .= " AND (s.fournisseur != 1 OR s.client != 0)";
315}
316// Add where from hooks
317$parameters = array('socid' => $socid);
318$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
319if (empty($reshook)) {
320 if ($socid > 0) {
321 $sql .= " AND s.rowid = ".((int) $socid);
322 }
323}
324$sql .= $hookmanager->resPrint;
325$sql .= $db->order("date_modification", "DESC");
326$sql .= $db->plimit($max, 0);
327
328//print $sql;
329$lastmodified="";
330$result = $db->query($sql);
331if ($result) {
332 $num = $db->num_rows($result);
333
334 $i = 0;
335
336 if ($num > 0) {
337 $transRecordedType = $langs->trans("LastModifiedThirdParties", $max);
338
339 $lastmodified = "\n<!-- last thirdparties modified -->\n";
340 $lastmodified .= '<div class="div-table-responsive-no-min">';
341 $lastmodified .= '<table class="noborder centpercent">';
342
343 $lastmodified .= '<tr class="liste_titre"><th colspan="2">';
344 //$lastmodified .= img_picto('', 'company', 'class="pictofixedwidth"');
345 $lastmodified .= '<span class="valignmiddle">'.$transRecordedType.'</span>';
346 $lastmodified .= '<a class="marginleftonlyshort" href="'.DOL_URL_ROOT.'/societe/list.php?sortfield=s.tms&sortorder=DESC" title="'.$langs->trans("FullList").'">';
347 $lastmodified .= '<span class="badge marginleftonlyshort">...</span>';
348 $lastmodified .= '</a>';
349 $lastmodified .= '</th>';
350 $lastmodified .= '<th>&nbsp;</th>';
351 $lastmodified .= '<th class="right">';
352 $lastmodified .= '</th>';
353 $lastmodified .= '</tr>'."\n";
354
355 while ($i < $num) {
356 $objp = $db->fetch_object($result);
357
358 $thirdparty_static->id = $objp->rowid;
359 $thirdparty_static->name = $objp->name;
360 $thirdparty_static->client = $objp->client;
361 $thirdparty_static->fournisseur = $objp->fournisseur;
362 $thirdparty_static->logo = $objp->logo;
363 $thirdparty_static->date_modification = $db->jdate($objp->date_modification);
364 $thirdparty_static->status = $objp->status;
365 $thirdparty_static->code_client = $objp->code_client;
366 $thirdparty_static->code_fournisseur = $objp->code_fournisseur;
367 $thirdparty_static->canvas = $objp->canvas;
368 $thirdparty_static->email = $objp->email;
369 $thirdparty_static->entity = $objp->entity;
370 $thirdparty_static->code_compta_fournisseur = $objp->code_compta_fournisseur;
371 $thirdparty_static->code_compta_client = $objp->code_compta;
372
373 $lastmodified .= '<tr class="oddeven">';
374 // Name
375 $lastmodified .= '<td class="nowrap tdoverflowmax200">';
376 $lastmodified .= $thirdparty_static->getNomUrl(1);
377 $lastmodified .= "</td>\n";
378 // Type
379 $lastmodified .= '<td class="center">';
380 $lastmodified .= $thirdparty_static->getTypeUrl();
381 $lastmodified .= '</td>';
382 // Last modified date
383 $lastmodified .= '<td class="right tddate" title="'.dol_escape_htmltag($langs->trans("DateModification").' '.dol_print_date($thirdparty_static->date_modification, 'dayhour', 'tzuserrel')).'">';
384 $lastmodified .= dol_print_date($thirdparty_static->date_modification, 'day', 'tzuserrel');
385 $lastmodified .= "</td>";
386 $lastmodified .= '<td class="right nowrap">';
387 $lastmodified .= $thirdparty_static->getLibStatut(3);
388 $lastmodified .= "</td>";
389 $lastmodified .= "</tr>\n";
390 $i++;
391 }
392
393 $db->free($result);
394
395 $lastmodified .= "</table>\n";
396 $lastmodified .= '</div>';
397 $lastmodified .= "<!-- End last thirdparties modified -->\n";
398 }
399} else {
401}
402
403
404
405/*
406 * Latest modified contacts
407 */
408$sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur";
409$sql .= ", s.code_client";
410$sql .= ", s.code_fournisseur";
411if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
412 $sql .= ", spe.accountancy_code_supplier as code_compta_fournisseur";
413 $sql .= ", spe.accountancy_code_customer as code_compta";
414} else {
415 $sql .= ", s.code_compta_fournisseur";
416 $sql .= ", s.code_compta";
417}
418$sql .= ", s.logo";
419$sql .= ", s.entity";
420$sql .= ", s.canvas";
421$sql .= ", s.status as status";
422$sql .= ", GREATEST(sp.tms, spef.tms) as date_modification, sp.statut as cstatus";
423$sql .= ", sp.rowid as cid, sp.canvas as ccanvas, sp.email as cemail, sp.firstname, sp.lastname";
424$sql .= ", sp.address as caddress, sp.phone as cphone";
425$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
426$sql .= " INNER JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0)";
427$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople_extrafields as spef ON spef.fk_object = sp.rowid";
428if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
429 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
430}
431// TODO Replace this
432if (!$user->hasRight('societe', 'client', 'voir')) {
433 $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
434}
435$sql .= " WHERE s.entity IN (".getEntity('societe').") ";
436if (!$user->hasRight('societe', 'client', 'voir')) {
437 $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
438}
439if (!$user->hasRight('fournisseur', 'lire')) {
440 $sql .= " AND (s.fournisseur != 1 OR s.client != 0)";
441}
442// Add where from hooks
443$parameters = array('socid' => $socid);
444$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
445if (empty($reshook)) {
446 if ($socid > 0) {
447 $sql .= " AND s.rowid = ".((int) $socid);
448 }
449}
450$sql .= $hookmanager->resPrint;
451$sql .= $db->order("date_modification", "DESC");
452$sql .= $db->plimit($max, 0);
453
454//print $sql;
455$lastmodifiedcontact = '';
456$result = $db->query($sql);
457if ($result) {
458 $num = $db->num_rows($result);
459
460 $i = 0;
461
462 if ($num > 0) {
463 $transRecordedType = $langs->trans("LastModifiedContacts", $max);
464
465 $lastmodifiedcontact = "\n<!-- last contacts modified -->\n";
466 $lastmodifiedcontact .= '<div class="div-table-responsive-no-min">';
467 $lastmodifiedcontact .= '<table class="noborder centpercent">';
468
469 $lastmodifiedcontact .= '<tr class="liste_titre"><th colspan="2">';
470 //$lastmodifiedcontact .= img_picto('', 'contact', 'class="pictofixedwidth"');
471 $lastmodifiedcontact .= '<span class="valignmiddle">'.$transRecordedType.'</div>';
472 $lastmodifiedcontact .= '<a class="marginleftonlyshort" href="'.DOL_URL_ROOT.'/contact/list.php?sortfield=p.tms&sortorder=DESC" title="'.$langs->trans("FullList").'">';
473 //$lastmodifiedcontact .= img_picto($langs->trans("FullList"), 'contact');
474 $lastmodifiedcontact .= '<span class="badge marginleftonlyshort">...</span>';
475 $lastmodifiedcontact .= '</th>';
476 $lastmodifiedcontact .= '<th>&nbsp;</th>';
477 $lastmodifiedcontact .= '<th class="right">';
478 //$lastmodifiedcontact .= '<a href="'.DOL_URL_ROOT.'/contact/list.php?sortfield=s.tms&sortorder=DESC">'.img_picto($langs->trans("FullList"), 'contact');
479 $lastmodifiedcontact .= '</th>';
480 $lastmodifiedcontact .= '</tr>'."\n";
481
482 while ($i < $num) {
483 $objp = $db->fetch_object($result);
484
485 $thirdparty_static->id = $objp->rowid;
486 $thirdparty_static->name = $objp->name;
487 $thirdparty_static->client = $objp->client;
488 $thirdparty_static->fournisseur = $objp->fournisseur;
489 $thirdparty_static->logo = $objp->logo;
490 $thirdparty_static->date_modification = $db->jdate($objp->date_modification);
491 $thirdparty_static->status = $objp->status;
492 $thirdparty_static->code_client = $objp->code_client;
493 $thirdparty_static->code_fournisseur = $objp->code_fournisseur;
494 $thirdparty_static->canvas = $objp->canvas;
495 $thirdparty_static->email = $objp->email;
496 $thirdparty_static->entity = $objp->entity;
497 $thirdparty_static->code_compta_fournisseur = $objp->code_compta_fournisseur;
498 $thirdparty_static->code_compta_client = $objp->code_compta;
499
500 $contact_static->id = $objp->cid;
501 $contact_static->status = $objp->cstatus;
502 $contact_static->firstname = $objp->firstname;
503 $contact_static->lastname = $objp->lastname;
504 $contact_static->email = $objp->cemail;
505 $contact_static->socid = $objp->rowid;
506 $contact_static->canvas = $objp->ccanvas;
507 $contact_static->phone_pro = $objp->cphone;
508 $contact_static->address = $objp->caddress;
509
510 $lastmodifiedcontact .= '<tr class="oddeven">';
511 // Contact
512 $lastmodifiedcontact .= '<td class="tdoverflowmax150">';
513 $lastmodifiedcontact .= $contact_static->getNomUrl(1);
514 $lastmodifiedcontact .= '</td>';
515 // Third party
516 $lastmodifiedcontact .= '<td class="nowrap tdoverflowmax125">';
517 $lastmodifiedcontact .= $thirdparty_static->getNomUrl(1);
518 $lastmodifiedcontact .= "</td>\n";
519 // Last modified date
520 $lastmodifiedcontact .= '<td class="right tddate" title="'.dol_escape_htmltag($langs->trans("DateModification").' '.dol_print_date($thirdparty_static->date_modification, 'dayhour', 'tzuserrel')).'">';
521 $lastmodifiedcontact .= dol_print_date($thirdparty_static->date_modification, 'day', 'tzuserrel');
522 $lastmodifiedcontact .= "</td>";
523 $lastmodifiedcontact .= '<td class="right nowrap">';
524 $lastmodifiedcontact .= $thirdparty_static->getLibStatut(3);
525 $lastmodifiedcontact .= "</td>";
526 $lastmodifiedcontact .= "</tr>\n";
527 $i++;
528 }
529
530 $db->free($result);
531
532 $lastmodifiedcontact .= "</table>\n";
533 $lastmodifiedcontact .= '</div>';
534 $lastmodifiedcontact .= "<!-- End last contacts modified -->\n";
535 }
536} else {
538}
539
540
541// boxes
542print '<div class="clearboth"></div>';
543print '<div class="fichecenter fichecenterbis">';
544
545$boxlist = '<div class="twocolumns">';
546
547$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
548$boxlist .= $thirdpartygraph;
549$boxlist .= '<br>';
550$boxlist .= $thirdpartycateggraph;
551$boxlist .= '<br>';
552$boxlist .= $resultboxes['boxlista'];
553$boxlist .= '</div>'."\n";
554
555$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
556$boxlist .= $lastmodified;
557$boxlist .= '<br>';
558$boxlist .= $lastmodifiedcontact;
559$boxlist .= '<br>';
560$boxlist .= $resultboxes['boxlistb'];
561$boxlist .= '</div>'."\n";
562
563$boxlist .= '</div>';
564
565print $boxlist;
566
567print '</div>';
568
569$parameters = array('user' => $user);
570$reshook = $hookmanager->executeHooks('dashboardThirdparties', $parameters, $thirdparty_static); // Note that $action and $object may have been modified by hook
571
572// End of page
573llxFooter();
574$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage contact/addresses.
Class to build graphs.
Class to manage generation of HTML components Only common components must be here.
static getBoxesArea($user, $areacode)
Get array with HTML tabs with widgets/boxes of a particular area including personalized choices of us...
static saveboxorder($dbs, $zone, $boxorder, $userid=0)
Save order of boxes for area and user.
Class to manage third parties objects (customers, suppliers, prospects...)
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.