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