dolibarr 20.0.2
contact.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2006-2024 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27require "../../main.inc.php";
28require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
29require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
30require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
33
34// Load translation files required by the page
35$langs->loadLangs(array('projects', 'companies'));
36
37$id = GETPOSTINT('id');
38$ref = GETPOST('ref', 'alpha');
39$action = GETPOST('action', 'aZ09');
40$confirm = GETPOST('confirm', 'alpha');
41$withproject = GETPOSTINT('withproject');
42$project_ref = GETPOST('project_ref', 'alpha');
43
44$object = new Task($db);
45$projectstatic = new Project($db);
46
47if ($id > 0 || $ref) {
48 $object->fetch($id, $ref);
49}
50
51// Security check
52$socid = 0;
53
54restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
55
56
57/*
58 * Actions
59 */
60
61// Add new contact
62if ($action == 'addcontact' && $user->hasRight('projet', 'creer')) {
63 $source = 'internal';
64 if (GETPOST("addsourceexternal")) {
65 $source = 'external';
66 }
67
68 $result = $object->fetch($id, $ref);
69
70 if ($result > 0 && $id > 0) {
71 if ($source == 'internal') {
72 $idfortaskuser = ((GETPOST("userid") != 0 && GETPOST('userid') != -1) ? GETPOST("userid") : 0); // GETPOST('contactid') may val -1 to mean empty or -2 to means "everybody"
73 $typeid = GETPOST('type');
74 } else {
75 $idfortaskuser = ((GETPOST("contactid") > 0) ? GETPOSTINT("contactid") : 0); // GETPOST('contactid') may val -1 to mean empty or -2 to means "everybody"
76 $typeid = GETPOST('typecontact');
77 }
78 if ($idfortaskuser == -2) {
79 $result = $projectstatic->fetch($object->fk_project);
80 if ($result <= 0) {
81 dol_print_error($db, $projectstatic->error, $projectstatic->errors);
82 } else {
83 $contactsofproject = $projectstatic->getListContactId('internal');
84 foreach ($contactsofproject as $key => $val) {
85 $result = $object->add_contact($val, $typeid, $source);
86 }
87 }
88 } else {
89 $result = $object->add_contact($idfortaskuser, $typeid, $source);
90 }
91 }
92
93 if ($result >= 0) {
94 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
95 exit;
96 } else {
97 if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
98 $langs->load("errors");
99 setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
100 } else {
101 setEventMessages($object->error, $object->errors, 'errors');
102 }
103 }
104}
105
106// bascule du statut d'un contact
107if ($action == 'swapstatut' && $user->hasRight('projet', 'creer')) {
108 if ($object->fetch($id, $ref)) {
109 $result = $object->swapContactStatus(GETPOSTINT('ligne'));
110 } else {
111 dol_print_error($db);
112 }
113}
114
115// Efface un contact
116if ($action == 'deleteline' && $user->hasRight('projet', 'creer')) {
117 $object->fetch($id, $ref);
118 $result = $object->delete_contact(GETPOSTINT("lineid"));
119
120 if ($result >= 0) {
121 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
122 exit;
123 } else {
124 dol_print_error($db);
125 }
126}
127
128// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
129if (!empty($project_ref) && !empty($withproject)) {
130 if ($projectstatic->fetch(0, $project_ref) > 0) {
131 $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
132 if (count($tasksarray) > 0) {
133 $id = $tasksarray[0]->id;
134 } else {
135 header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
136 exit;
137 }
138 }
139}
140
141/*
142 * View
143 */
144$form = new Form($db);
145$formcompany = new FormCompany($db);
146$contactstatic = new Contact($db);
147$userstatic = new User($db);
148$result = $projectstatic->fetch($object->fk_project);
149
150$title = $object->ref . ' - ' . $langs->trans("Contacts");
151if (!empty($withproject)) {
152 $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ;
153}
154$help_url = '';
155
156llxHeader('', $title, $help_url);
157
158
159/* *************************************************************************** */
160/* */
161/* Card view and edit mode */
162/* */
163/* *************************************************************************** */
164
165if ($id > 0 || !empty($ref)) {
166 if ($object->fetch($id, $ref) > 0) {
167 if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_TASK') && method_exists($object, 'fetchComments') && empty($object->comments)) {
168 $object->fetchComments();
169 }
170 $id = $object->id; // So when doing a search from ref, id is also set correctly.
171
172 if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
173 $projectstatic->fetchComments();
174 }
175 if (!empty($projectstatic->socid)) {
176 $projectstatic->fetch_thirdparty();
177 }
178
179 $object->project = clone $projectstatic;
180
181 $userWrite = $projectstatic->restrictedProjectArea($user, 'write');
182
183 if ($withproject) {
184 // Tabs for project
185 $tab = 'tasks';
186 $head = project_prepare_head($projectstatic);
187 print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'));
188
189 $param = (!empty($mode) && $mode == 'mine' ? '&mode=mine' : '');
190
191 // Project card
192
193 $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
194
195 $morehtmlref = '<div class="refidno">';
196 // Title
197 $morehtmlref .= $projectstatic->title;
198 // Thirdparty
199 if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
200 $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
201 }
202 $morehtmlref .= '</div>';
203
204 // Define a complementary filter for search of next/prev ref.
205 if (!$user->hasRight('projet', 'all', 'lire')) {
206 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
207 $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
208 }
209
210 dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
211
212 print '<div class="fichecenter">';
213 print '<div class="fichehalfleft">';
214 print '<div class="underbanner clearboth"></div>';
215
216 print '<table class="border tableforfield centpercent">';
217
218 // Usage
219 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
220 print '<tr><td class="tdtop">';
221 print $langs->trans("Usage");
222 print '</td>';
223 print '<td>';
224 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
225 print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
226 $htmltext = $langs->trans("ProjectFollowOpportunity");
227 print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
228 print '<br>';
229 }
230 if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
231 print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
232 $htmltext = $langs->trans("ProjectFollowTasks");
233 print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
234 print '<br>';
235 }
236 if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
237 print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
238 $htmltext = $langs->trans("ProjectBillTimeDescription");
239 print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
240 print '<br>';
241 }
242 if (isModEnabled('eventorganization')) {
243 print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
244 $htmltext = $langs->trans("EventOrganizationDescriptionLong");
245 print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
246 }
247 print '</td></tr>';
248 }
249
250 // Visibility
251 print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
252 if ($projectstatic->public) {
253 print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
254 print $langs->trans('SharedProject');
255 } else {
256 print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
257 print $langs->trans('PrivateProject');
258 }
259 print '</td></tr>';
260
261 // Budget
262 print '<tr><td>'.$langs->trans("Budget").'</td><td>';
263 if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
264 print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
265 }
266 print '</td></tr>';
267
268 // Date start - end project
269 print '<tr><td>'.$langs->trans("Dates").'</td><td>';
270 $start = dol_print_date($projectstatic->date_start, 'day');
271 print($start ? $start : '?');
272 $end = dol_print_date($projectstatic->date_end, 'day');
273 print ' - ';
274 print($end ? $end : '?');
275 if ($projectstatic->hasDelay()) {
276 print img_warning("Late");
277 }
278 print '</td></tr>';
279
280 // Other attributes
281 $cols = 2;
282 //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
283
284 print '</table>';
285
286 print '</div>';
287 print '<div class="fichehalfright">';
288 print '<div class="underbanner clearboth"></div>';
289
290 print '<table class="border tableforfield centpercent">';
291
292 // Description
293 print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
294 print nl2br($projectstatic->description);
295 print '</td></tr>';
296
297 // Categories
298 if (isModEnabled('category')) {
299 print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
300 print $form->showCategories($projectstatic->id, 'project', 1);
301 print "</td></tr>";
302 }
303
304 print '</table>';
305
306 print '</div>';
307 print '</div>';
308
309 print '<div class="clearboth"></div>';
310
311 print dol_get_fiche_end();
312
313 print '<br>';
314 }
315
316
317 // To verify role of users
318 //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
319 //$arrayofuseridoftask=$object->getListContactId('internal');
320
321 $head = task_prepare_head($object);
322 print dol_get_fiche_head($head, 'task_contact', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
323
324
325 $param = (GETPOST('withproject') ? '&withproject=1' : '');
326 $linkback = GETPOST('withproject') ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
327
328 if (!GETPOST('withproject') || empty($projectstatic->id)) {
329 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
330 $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")";
331 } else {
332 $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id);
333 }
334
335 $morehtmlref = '';
336
337 // Project
338 if (empty($withproject)) {
339 $result = $projectstatic->fetch($object->fk_project);
340 $morehtmlref .= '<div class="refidno">';
341 $morehtmlref .= $langs->trans("Project").': ';
342 $morehtmlref .= $projectstatic->getNomUrl(1);
343 $morehtmlref .= '<br>';
344
345 // Third party
346 $morehtmlref .= $langs->trans("ThirdParty").': ';
347 if ($projectstatic->socid > 0) {
348 $projectstatic->fetch_thirdparty();
349 $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
350 }
351
352 $morehtmlref .= '</div>';
353 }
354
355 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1);
356
357 print dol_get_fiche_end();
358
359 /*
360 * Lines of contacts
361 */
362 /*
363 // Contacts lines (modules that overwrite templates must declare this into descriptor)
364 $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
365 foreach($dirtpls as $reldir)
366 {
367 $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
368 if ($res) break;
369 }
370 */
371
372 /*
373 * Add a new contact line
374 */
375 print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
376 print '<input type="hidden" name="token" value="'.newToken().'">';
377 print '<input type="hidden" name="action" value="addcontact">';
378 print '<input type="hidden" name="id" value="'.$id.'">';
379 if ($withproject) {
380 print '<input type="hidden" name="withproject" value="'.$withproject.'">';
381 }
382
383 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
384 print '<table class="noborder centpercent">';
385
386 if ($action != 'editline' && $user->hasRight('projet', 'creer')) {
387 print '<tr class="liste_titre">';
388 print '<td>'.$langs->trans("NatureOfContact").'</td>';
389 print '<td>'.$langs->trans("ThirdParty").'</td>';
390 print '<td>'.$langs->trans("Users").'</td>';
391 print '<td>'.$langs->trans("ContactType").'</td>';
392 print '<td colspan="3">&nbsp;</td>';
393 print "</tr>\n";
394
395 // Ligne ajout pour contact interne
396 print '<tr class="oddeven nohover">';
397
398 print '<td class="nowrap">';
399 print img_object('', 'user').' '.$langs->trans("Users");
400 print '</td>';
401
402 print '<td>';
403 print $conf->global->MAIN_INFO_SOCIETE_NOM;
404 print '</td>';
405
406 print '<td>';
407 // On recupere les id des users deja selectionnes
408 if ($object->project->public) {
409 $contactsofproject = ''; // Everybody
410 } else {
411 $contactsofproject = $projectstatic->getListContactId('internal');
412 }
413 print $form->select_dolusers((GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject"));
414 print '</td>';
415 print '<td>';
416 $formcompany->selectTypeContact($object, '', 'type', 'internal', 'position');
417 print '</td>';
418 print '<td class="right" colspan="3" ><input type="submit" class="button button-add small" value="'.$langs->trans("Add").'" name="addsourceinternal"></td>';
419 print '</tr>';
420
421 // Line to add an external contact. Only if project linked to a third party.
422 if ($projectstatic->socid) {
423 print '<tr class="oddeven">';
424
425 print '<td class="nowrap">';
426 print img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts");
427 print '</td>';
428
429 print '<td>';
430 $thirdpartyofproject = $projectstatic->getListContactId('thirdparty');
431 $selectedCompany = GETPOSTISSET("newcompany") ? GETPOST("newcompany") : $projectstatic->socid;
432 $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', $thirdpartyofproject, 0, '&withproject='.$withproject);
433 print '</td>';
434
435 print '<td>';
436 $contactofproject = $projectstatic->getListContactId('external');
437 //print $form->selectcontacts($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, '', false, 0, 0);
438 print $form->select_contact($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, 'maxwidth300 widthcentpercentminusx', true);
439 $nbofcontacts = $form->num;
440 print '</td>';
441 print '<td>';
442 $formcompany->selectTypeContact($object, '', 'typecontact', 'external', 'position');
443 print '</td>';
444 print '<td class="right" colspan="3" ><input type="submit" class="button button-add small" id="add-customer-contact" name="addsourceexternal" value="'.$langs->trans("Add").'"';
445 if (!$nbofcontacts) {
446 print ' disabled';
447 }
448 print '></td>';
449 print '</tr>';
450 }
451 }
452
453 // List of contact line
454 print '<tr class="liste_titre">';
455 print '<td>'.$langs->trans("Source").'</td>';
456 print '<td>'.$langs->trans("ThirdParty").'</td>';
457 print '<td>'.$langs->trans("TaskContact").'</td>';
458 print '<td>'.$langs->trans("ContactType").'</td>';
459 print '<td class="center">'.$langs->trans("Status").'</td>';
460 print '<td colspan="2">&nbsp;</td>';
461 print "</tr>\n";
462
463 $companystatic = new Societe($db);
464
465 foreach (array('internal', 'external') as $source) {
466 $tab = $object->liste_contact(-1, $source);
467
468 $num = count($tab);
469
470 $i = 0;
471 while ($i < $num) {
472 print '<tr class="oddeven" valign="top">';
473
474 // Source
475 print '<td class="left">';
476 if ($tab[$i]['source'] == 'internal') {
477 print $langs->trans("User");
478 }
479 if ($tab[$i]['source'] == 'external') {
480 print $langs->trans("ThirdPartyContact");
481 }
482 print '</td>';
483
484 // Societe
485 print '<td class="left">';
486 if ($tab[$i]['socid'] > 0) {
487 $companystatic->fetch($tab[$i]['socid']);
488 print $companystatic->getNomUrl(1);
489 }
490 if ($tab[$i]['socid'] < 0) {
491 print $conf->global->MAIN_INFO_SOCIETE_NOM;
492 }
493 if (!$tab[$i]['socid']) {
494 print '&nbsp;';
495 }
496 print '</td>';
497
498 // Contact
499 print '<td>';
500 if ($tab[$i]['source'] == 'internal') {
501 $userstatic->id = $tab[$i]['id'];
502 $userstatic->lastname = $tab[$i]['lastname'];
503 $userstatic->firstname = $tab[$i]['firstname'];
504 $userstatic->photo = $tab[$i]['photo'];
505 $userstatic->login = $tab[$i]['login'];
506 $userstatic->email = $tab[$i]['email'];
507 $userstatic->gender = $tab[$i]['gender'];
508 $userstatic->status = $tab[$i]['statuscontact'];
509
510 print $userstatic->getNomUrl(-1);
511 }
512 if ($tab[$i]['source'] == 'external') {
513 $contactstatic->id = $tab[$i]['id'];
514 $contactstatic->lastname = $tab[$i]['lastname'];
515 $contactstatic->firstname = $tab[$i]['firstname'];
516 $contactstatic->email = $tab[$i]['email'];
517 $contactstatic->statut = $tab[$i]['statuscontact'];
518 print $contactstatic->getNomUrl(1);
519 }
520 print '</td>';
521
522 // Type de contact
523 print '<td>'.$tab[$i]['libelle'].'</td>';
524
525 // Statut
526 print '<td class="center">';
527 // Activation desativation du contact
528 if ($object->status >= 0) {
529 print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].($withproject ? '&withproject=1' : '').'">';
530 }
531 print $contactstatic->LibStatut($tab[$i]['status'], 3);
532 if ($object->status >= 0) {
533 print '</a>';
534 }
535 print '</td>';
536
537 // Icon update et delete
538 print '<td class="center nowrap">';
539 if ($user->hasRight('projet', 'creer')) {
540 print '&nbsp;';
541 print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteline&token='.newToken().'&lineid='.$tab[$i]['rowid'].($withproject ? '&withproject=1' : '').'">';
542 print img_picto($langs->trans('Unlink'), 'unlink');
543 print '</a>';
544 }
545 print '</td>';
546
547 print "</tr>\n";
548
549 $i++;
550 }
551 }
552 print "</table>";
553 print '</div>';
554
555 print "</form>";
556 } else {
557 print "ErrorRecordNotFound";
558 }
559}
560
561if (is_object($hookmanager)) {
562 $hookmanager->initHooks(array('contacttpl'));
563 $parameters = array();
564 $reshook = $hookmanager->executeHooks('formContactTpl', $parameters, $object, $action);
565}
566
567// End of page
568llxFooter();
569$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage contact/addresses.
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage tasks.
Class to manage Dolibarr users.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
task_prepare_head($object)
Prepare array with list of tabs.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
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.