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