dolibarr 23.0.3
contact.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2012-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
5 * Copyright (C) 2024-2025 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
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
30require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
31require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34if (isModEnabled('category')) {
35 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
36}
37
46// Load translation files required by the page
47$langsLoad = array('projects', 'companies');
48if (isModEnabled('eventorganization')) {
49 $langsLoad[] = 'eventorganization';
50}
51
52$langs->loadLangs($langsLoad);
53
54$id = GETPOSTINT('id');
55$ref = GETPOST('ref', 'alpha');
56$lineid = GETPOSTINT('lineid');
57$socid = GETPOSTINT('socid');
58$action = GETPOST('action', 'aZ09');
59
60$mine = GETPOST('mode') == 'mine' ? 1 : 0;
61
62$object = new Project($db);
63
64include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
65if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && empty($object->comments)) {
66 $object->fetchComments();
67}
68
69// Security check
70$socid = 0;
71
72$hookmanager->initHooks(array('projectcontactcard', 'globalcard'));
73
74//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
75$result = restrictedArea($user, 'projet', $id, 'projet&project');
76
77$permissiontoadd = $user->hasRight('projet', 'creer');
78
79
80/*
81 * Actions
82 */
83$error = 0;
84$parameters = array('id' => $id);
85$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
86if ($reshook < 0) {
87 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
88}
89
90$formconfirmtoaddtasks = '';
91if (empty($reshook)) {
92 // Test if we can add contact to the tasks at the same times, if not or not required, make a redirect
93 if ($action == 'addcontact' && $permissiontoadd) {
94 $form = new Form($db);
95
96 $source = GETPOST("source", 'aZ09');
97
98 $taskstatic = new Task($db);
99 $task_array = $taskstatic->getTasksArray(null, null, $object->id, 0, 0);
100 $nbTasks = count($task_array);
101
102 //If no task available, redirec to to add confirm
103 $type_to = (GETPOST('typecontact') ? 'typecontact='.GETPOST('typecontact') : 'type='.GETPOST('type'));
104 $personToAffect = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid'));
105 $affect_to = (GETPOST('userid') ? 'userid='.$personToAffect : 'contactid='.$personToAffect);
106 $url_redirect = '?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source;
107
108 if ($personToAffect > 0 && (!getDolGlobalString('PROJECT_HIDE_TASKS') || $nbTasks > 0)) {
109 $text = $langs->trans('AddPersonToTask');
110 $textbody = $text.' (<a href="#" class="selectall">'.$langs->trans("SelectAll").'</a>)';
111 $formquestion = array('text' => $textbody);
112
113 $task_to_affect = array();
114 foreach ($task_array as $task) {
115 $task_already_affected = false;
116 $personsLinked = $task->liste_contact(-1, $source);
117 if (!is_array($personsLinked)) {
118 // When liste_contact() does not return an array, it's an error.
119 setEventMessage($object->error, 'errors');
120 } else {
121 foreach ($personsLinked as $person) {
122 if ($person['id'] == $personToAffect) {
123 $task_already_affected = true;
124 break;
125 }
126 }
127 if (!$task_already_affected) {
128 $task_to_affect[$task->id] = $task->id;
129 }
130 }
131 }
132
133 if (empty($task_to_affect)) {
134 $action = 'addcontact_confirm';
135 } else {
136 $formcompany = new FormCompany($db);
137 foreach ($task_array as $task) {
138 $key = $task->id;
139 $val = $task->ref . ' '.dol_trunc($task->label);
140 $formquestion[] = array(
141 'type' => 'other',
142 'name' => 'person_'.$key.',person_role_'.$key,
143 'label' => '<input type="checkbox" class="flat'.(in_array($key, $task_to_affect) ? ' taskcheckboxes"' : '" checked disabled').' id="person_'.$key.'" name="person_'.$key.'" value="1"> <label for="person_'.$key.'">'.$val.'<label>',
144 'value' => $formcompany->selectTypeContact($taskstatic, '', 'person_role_'.$key, $source, 'position', 0, 'minwidth100imp', 0, 1)
145 );
146 }
147 $formquestion[] = array('type' => 'other', 'name' => 'tasksavailable', 'label' => '', 'value' => '<input type="hidden" id="tasksavailable" name="tasksavailable" value="'.implode(',', array_keys($task_to_affect)).'">');
148 }
149
150 $formconfirmtoaddtasks = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590);
151 $formconfirmtoaddtasks .= '
152 <script>
153 $(document).ready(function() {
154 var saveprop = false;
155 $(".selectall").click(function(){
156 console.log("We click on select all with "+saveprop);
157 if (!saveprop) {
158 $(".taskcheckboxes").prop("checked", true);
159 saveprop = true;
160 } else {
161 $(".taskcheckboxes").prop("checked", false);
162 saveprop = false;
163 }
164 });
165 });
166 </script>';
167 } else {
168 $action = 'addcontact_confirm';
169 }
170 }
171
172 // Add new contact
173 if ($action == 'addcontact_confirm' && $permissiontoadd) {
174 if (GETPOST('confirm', 'alpha') == 'no') {
175 header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
176 exit;
177 }
178
179 $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid'));
180 $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
181 $groupid = GETPOSTINT('groupid');
182 $contactarray = array();
183 $errorgroup = 0;
184 $errorgrouparray = array();
185
186 if ($groupid > 0) {
187 require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
188 $usergroup = new UserGroup($db);
189 $result = $usergroup->fetch($groupid);
190 if ($result > 0) {
191 $excludefilter = 'statut = 1';
192 $tmpcontactarray = $usergroup->listUsersForGroup($excludefilter, 0);
193 if (!is_array($tmpcontactarray)) {
194 $error++;
195 } else {
196 foreach ($tmpcontactarray as $tmpuser) {
197 $contactarray[] = $tmpuser->id;
198 }
199 }
200 } else {
201 $error++;
202 }
203 } elseif (! ($contactid > 0)) {
204 $error++;
205 $langs->load("errors");
206 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors');
207 } else {
208 $contactarray[] = $contactid;
209 }
210
211 $result = 0;
212 $result = $object->fetch($id);
213 if (!$error && $result > 0 && $id > 0) {
214 foreach ($contactarray as $key => $contactid) {
215 $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
216
217 if ($result == 0) {
218 if ($groupid > 0) {
219 $errorgroup++;
220 $errorgrouparray[] = $contactid;
221 } else {
222 $langs->load("errors");
223 setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
224 }
225 } elseif ($result < 0) {
226 if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
227 if ($groupid > 0) {
228 $errorgroup++;
229 $errorgrouparray[] = $contactid;
230 } else {
231 $langs->load("errors");
232 setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
233 }
234 } else {
235 setEventMessages($object->error, $object->errors, 'errors');
236 }
237 }
238
239 $affecttotask = GETPOST('tasksavailable', 'intcomma');
240 if (!empty($affecttotask)) {
241 require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
242 $task_to_affect = explode(',', $affecttotask);
243 if (!empty($task_to_affect)) {
244 foreach ($task_to_affect as $task_id) {
245 if (GETPOSTISSET('person_'.$task_id) && GETPOST('person_'.$task_id, 'aZ09comma')) {
246 $tasksToAffect = new Task($db);
247 $result = $tasksToAffect->fetch((int) $task_id);
248 if ($result < 0) {
249 setEventMessages($tasksToAffect->error, null, 'errors');
250 } else {
251 $result = $tasksToAffect->add_contact($contactid, GETPOST('person_role_'.$task_id), GETPOST("source", 'aZ09'));
252 if ($result < 0) {
253 if ($tasksToAffect->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
254 $langs->load("errors");
255 setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
256 } else {
257 setEventMessages($tasksToAffect->error, $tasksToAffect->errors, 'errors');
258 }
259 }
260 }
261 }
262 }
263 }
264 }
265 }
266 }
267 if ($errorgroup > 0) {
268 $langs->load("errors");
269 if ($errorgroup == count($contactarray)) {
270 setEventMessages($langs->trans("ErrorThisGroupIsAlreadyDefinedAsThisType"), null, 'errors');
271 } else {
272 $tmpuser = new User($db);
273 foreach ($errorgrouparray as $key => $value) {
274 $tmpuser->fetch($value);
275 setEventMessages($langs->trans("ErrorThisContactXIsAlreadyDefinedAsThisType", dolGetFirstLastname($tmpuser->firstname, $tmpuser->lastname)), null, 'errors');
276 }
277 }
278 }
279
280 if ($result >= 0) {
281 header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
282 exit;
283 }
284 }
285
286 // Change contact's status
287 if ($action == 'swapstatut' && $permissiontoadd) {
288 if ($object->fetch($id)) {
289 $result = $object->swapContactStatus(GETPOSTINT('ligne'));
290 } else {
291 dol_print_error($db);
292 }
293 }
294
295 // Delete a contact
296 if (($action == 'deleteline' || $action == 'deletecontact') && $permissiontoadd) {
297 $object->fetch($id);
298 $result = $object->delete_contact(GETPOSTINT("lineid"));
299
300 if ($result >= 0) {
301 header("Location: contact.php?id=".$object->id);
302 exit;
303 } else {
304 dol_print_error($db);
305 }
306 }
307}
308
309
310/*
311 * View
312 */
313
314$form = new Form($db);
315$contactstatic = new Contact($db);
316$userstatic = new User($db);
317
318$title = $langs->trans('ProjectContact').' - '.$object->ref.' '.$object->name;
319if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
320 $title = $object->ref.' '.$object->name.' - '.$langs->trans('ProjectContact');
321}
322
323$help_url = 'EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos|DE:Modul_Projekte';
324
325llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-project page-card_contact');
326
327
328
329if ($id > 0 || !empty($ref)) {
330 /*
331 * View
332 */
333 if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && empty($object->comments)) {
334 $object->fetchComments();
335 }
336 // To verify role of users
337 //$userAccess = $object->restrictedProjectArea($user,'read');
338 $userWrite = $object->restrictedProjectArea($user, 'write');
339 //$userDelete = $object->restrictedProjectArea($user,'delete');
340 //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
341
342 $head = project_prepare_head($object);
343 print dol_get_fiche_head($head, 'contact', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'));
344
345 $formconfirm = $formconfirmtoaddtasks;
346
347 // Call Hook formConfirm
348 $parameters = array('formConfirm' => $formconfirm);
349 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
350 if (empty($reshook)) {
351 $formconfirm .= $hookmanager->resPrint;
352 } elseif ($reshook > 0) {
353 $formconfirm = $hookmanager->resPrint;
354 }
355
356 // Print form confirm
357 print $formconfirm;
358
359 // Project card
360
361 if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
362 $tmpurl = $_SESSION['pageforbacktolist']['project'];
363 $tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
364 $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
365 } else {
366 $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
367 }
368
369 $morehtmlref = '<div class="refidno">';
370 // Title
371 $morehtmlref .= dol_escape_htmltag($object->title);
372 $morehtmlref .= '<br>';
373 // Thirdparty
374 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
375 $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project');
376 }
377 $morehtmlref .= '</div>';
378
379 // Define a complementary filter for search of next/prev ref.
380 if (!$user->hasRight('projet', 'all', 'lire')) {
381 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
382 $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
383 }
384
385 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
386
387
388 print '<div class="fichecenter">';
389 print '<div class="fichehalfleft">';
390 print '<div class="underbanner clearboth"></div>';
391
392 print '<table class="border tableforfield centpercent">';
393
394 // Usage
395 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
396 print '<tr><td class="tdtop">';
397 print $langs->trans("Usage");
398 print '</td>';
399 print '<td>';
400 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
401 print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_opportunity ? ' checked="checked"' : '')).'"> ';
402 $htmltext = $langs->trans("ProjectFollowOpportunity");
403 print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
404 print '<br>';
405 }
406 if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
407 print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'"> ';
408 $htmltext = $langs->trans("ProjectFollowTasks");
409 print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
410 print '<br>';
411 }
412 if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
413 print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'"> ';
414 $htmltext = $langs->trans("ProjectBillTimeDescription");
415 print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
416 print '<br>';
417 }
418 if (isModEnabled('eventorganization')) {
419 print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
420 $htmltext = $langs->trans("EventOrganizationDescriptionLong");
421 print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
422 }
423 print '</td></tr>';
424 }
425
426 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
427 // Opportunity status
428 print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
429 $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
430 if ($code) {
431 print $langs->trans("OppStatus".$code);
432 }
433
434 // Opportunity percent
435 print ' <span title="'.$langs->trans("OpportunityProbability").'"> / ';
436 if (strcmp($object->opp_percent, '')) {
437 print price($object->opp_percent, 0, $langs, 1, 0).' %';
438 }
439 print '</span></td></tr>';
440
441 // Opportunity Amount
442 print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
443 if (strcmp($object->opp_amount, '')) {
444 print '<span class="amount">'.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).'</span>';
445 if (strcmp($object->opp_percent, '')) {
446 print ' &nbsp; &nbsp; &nbsp; <span title="'.dol_escape_htmltag($langs->trans('OpportunityWeightedAmount')).'"><span class="opacitymedium">'.$langs->trans("OpportunityWeightedAmountShort").'</span>: <span class="amount">'.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).'</span></span>';
447 }
448 }
449 print '</td></tr>';
450 }
451
452 // Budget
453 print '<tr><td>'.$langs->trans("Budget").'</td><td>';
454 if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
455 print '<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
456 }
457 print '</td></tr>';
458
459 // Date start - end project
460 print '<tr><td>'.$langs->trans("Dates").'</td><td>';
461 $start = dol_print_date($object->date_start, 'day');
462 print($start ? $start : '?');
463 $end = dol_print_date($object->date_end, 'day');
464 print ' <span class="opacitymedium">-</span> ';
465 print($end ? $end : '?');
466 if ($object->hasDelay()) {
467 print img_warning("Late");
468 }
469 print '</td></tr>';
470
471 // Visibility
472 print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
473 if ($object->public) {
474 print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
475 print $langs->trans('SharedProject');
476 } else {
477 print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
478 print $langs->trans('PrivateProject');
479 }
480 print '</td></tr>';
481
482 // Other attributes
483 $cols = 2;
484 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
485
486 print "</table>";
487
488 print '</div>';
489 print '<div class="fichehalfright">';
490 print '<div class="underbanner clearboth"></div>';
491
492 print '<table class="border tableforfield centpercent">';
493
494 // Categories
495 if (isModEnabled('category')) {
496 print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
497 print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
498 print "</td></tr>";
499 }
500
501 // Description
502 print '<tr><td class="titlefield'.($object->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
503 if ($object->description) {
504 print '<tr><td class="nottitleforfield" colspan="2">';
505 print '<div class="longmessagecut">';
506 print dolPrintHTML($object->description);
507 print '</div>';
508 print '</td></tr>';
509 }
510
511 print '</table>';
512
513 print '</div>';
514 print '</div>';
515
516 print '<div class="clearboth"></div>';
517
518 print dol_get_fiche_end();
519
520 print '<br>';
521
522 // Contacts lines (modules that overwrite templates must declare this into descriptor)
523 $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
524 foreach ($dirtpls as $reldir) {
525 $file = dol_buildpath($reldir.'/contacts.tpl.php');
526 if (file_exists($file)) {
527 $res = @include $file;
528 if ($res) {
529 break;
530 }
531 }
532 }
533}
534
535// End of page
536llxFooter();
537$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
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 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 tasks.
Class to manage user groups.
Class to manage Dolibarr users.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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, $morecssdiv='')
Show tabs of a record.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
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.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.