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