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