dolibarr 24.0.0-beta
card.php
1<?php
2/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) ---Put here your own copyright and developer email---
4 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
37// Load Dolibarr environment
38require "../main.inc.php";
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
42require_once DOL_DOCUMENT_ROOT.'/intracommreport/class/intracommreport.class.php';
43require_once DOL_DOCUMENT_ROOT.'/intracommreport/lib/intracommreport.lib.php';
44
54// Load translation files required by the page
55$langs->loadLangs(array("intracommreport", "other"));
56
57// Get parameters
58$id = GETPOSTINT('id');
59$ref = GETPOST('ref', 'alpha');
60$lineid = GETPOSTINT('lineid');
61
62$action = GETPOST('action', 'aZ09');
63$confirm = GETPOST('confirm', 'alpha');
64$cancel = GETPOST('cancel');
65$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
66$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
67$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
68$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
69
70// Initialize a technical objects
72$extrafields = new ExtraFields($db);
73$diroutputmassaction = $conf->intracommreport->dir_output.'/temp/massgeneration/'.$user->id;
74$hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array
75
76// Fetch optionals attributes and labels
77$extrafields->fetch_name_optionals_label($object->table_element);
78
79$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
80
81// Initialize array of search criteria
82$search_all = trim(GETPOST("search_all", 'alpha'));
83$search = array();
84foreach ($object->fields as $key => $val) {
85 if (GETPOST('search_'.$key, 'alpha')) {
86 $search[$key] = GETPOST('search_'.$key, 'alpha');
87 }
88}
89
90if (empty($action) && empty($id) && empty($ref)) {
91 $action = 'view';
92}
93
94// Load object
95include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
96
97// There is several ways to check permission.
98// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
99$enablepermissioncheck = 1;
100if ($enablepermissioncheck) {
101 $permissiontoread = $user->hasRight('intracommreport', 'read');
102 $permissiontoadd = $user->hasRight('intracommreport', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
103 $permissiontodelete = $user->hasRight('intracommreport', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
104 $permissionnote = $user->hasRight('intracommreport', 'write'); // Used by the include of actions_setnotes.inc.php
105 $permissiondellink = $user->hasRight('intracommreport', 'write'); // Used by the include of actions_dellink.inc.php
106} else {
107 $permissiontoread = 1;
108 $permissiontoadd = 1; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
109 $permissiontodelete = 1;
110 $permissionnote = 1;
111 $permissiondellink = 1;
112}
113
114$upload_dir = $conf->intracommreport->multidir_output[isset($object->entity) ? $object->entity : 1].'/intracommreport';
115
116// Security check (enable the most restrictive one)
117//if ($user->socid > 0) accessforbidden();
118//if ($user->socid > 0) $socid = $user->socid;
119//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
120//restrictedArea($user, $object->module, $object, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
121if (!isModEnabled("intracommreport")) {
122 accessforbidden("Module intracommreport not enabled");
123}
124if (!$permissiontoread) {
126}
127
128$error = 0;
129
130
131/*
132 * Actions
133 */
134
135$parameters = array();
136$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
137if ($reshook < 0) {
138 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
139}
140
141if (empty($reshook)) {
142 $backurlforlist = dol_buildpath('/intracommreport/list.php', 1);
143
144 if (empty($backtopage) || ($cancel && empty($id))) {
145 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
146 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
147 $backtopage = $backurlforlist;
148 } else {
149 $backtopage = dol_buildpath('/intracommreport/card.php', 1).'?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
150 }
151 }
152 }
153
154 $triggermodname = 'INTRACOMMREPORT_MODIFY'; // Name of trigger action code to execute when we modify record
155
156 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
157 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
158
159 // Actions when linking object each other
160 include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
161
162 // Actions when printing a doc from card
163 include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
164
165 // Action to move up and down lines of object
166 //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
167
168 // Action to build doc
169 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
170
171 if ($action == 'set_thirdparty' && $permissiontoadd) {
172 $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
173 }
174 if ($action == 'classin' && $permissiontoadd) {
175 $object->setProject(GETPOSTINT('projectid'));
176 }
177
178 // Actions to send emails
179 $triggersendname = 'INTRACOMMREPORT_SENTBYMAIL';
180 $autocopy = 'MAIN_MAIL_AUTOCOPY_INTRACOMMREPORT_TO';
181 $trackid = 'intracommreport'.$object->id;
182 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
183}
184
185
186
187
188/*
189 * View
190 */
191
192$form = new Form($db);
193$formfile = new FormFile($db);
194$formproject = new FormProjets($db);
195
196$title = $langs->trans("IntraCommReport")." - ".$langs->trans('Card');
197//$title = $object->ref." - ".$langs->trans('Card');
198if ($action == 'create') {
199 $title = $langs->trans("NewObject", $langs->transnoentitiesnoconv("IntraCommReport"));
200}
201$help_url = '';
202
203llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-mymodule page-card');
204
205// Part to create
206if ($action == 'create') {
207 if (empty($permissiontoadd)) {
208 accessforbidden('NotEnoughPermissions', 0, 1);
209 }
210
211 print load_fiche_titre($title, '', 'object_'.$object->picto);
212
213 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
214 print '<input type="hidden" name="token" value="'.newToken().'">';
215 print '<input type="hidden" name="action" value="add">';
216 if ($backtopage) {
217 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
218 }
219 if ($backtopageforcancel) {
220 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
221 }
222 if ($dol_openinpopup) {
223 print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">';
224 }
225
226 print dol_get_fiche_head(array(), '');
227
228
229 print '<table class="border centpercent tableforfieldcreate">'."\n";
230
231 // Common attributes
232 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
233
234 // Other attributes
235 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
236
237 print '</table>'."\n";
238
239 print dol_get_fiche_end();
240
241 print $form->buttonsSaveCancel("Create");
242
243 print '</form>';
244
245 //dol_set_focus('input[name="ref"]');
246}
247
248// Part to edit record
249if (($id || $ref) && $action == 'edit') {
250 print load_fiche_titre($langs->trans("IntraCommReport"), '', 'object_'.$object->picto);
251
252 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
253 print '<input type="hidden" name="token" value="'.newToken().'">';
254 print '<input type="hidden" name="action" value="update">';
255 print '<input type="hidden" name="id" value="'.$object->id.'">';
256 if ($backtopage) {
257 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
258 }
259 if ($backtopageforcancel) {
260 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
261 }
262
263 print dol_get_fiche_head();
264
265 print '<table class="border centpercent tableforfieldedit">'."\n";
266
267 // Common attributes
268 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
269
270 // Other attributes
271 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
272
273 print '</table>';
274
275 print dol_get_fiche_end();
276
277 print $form->buttonsSaveCancel();
278
279 print '</form>';
280}
281
282// Part to show record
283if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
284 $head = intracommreportPrepareHead($object);
285
286 print dol_get_fiche_head($head, 'card', $langs->trans("IntraCommReport"), -1, $object->picto, 0, '', '', 0, '', 1);
287
288 $formconfirm = '';
289
290 // Confirmation to delete (using preloaded confirm popup)
291 if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
292 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntraCommReport'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
293 }
294 // Confirmation to delete line
295 if ($action == 'deleteline') {
296 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
297 }
298
299 // Clone confirmation
300 if ($action == 'clone') {
301 // Create an array for form
302 $formquestion = array();
303 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
304 }
305
306 // Call Hook formConfirm
307 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
308 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
309 if (empty($reshook)) {
310 $formconfirm .= $hookmanager->resPrint;
311 } elseif ($reshook > 0) {
312 $formconfirm = $hookmanager->resPrint;
313 }
314
315 // Print form confirm
316 print $formconfirm;
317
318
319 // Object card
320 // ------------------------------------------------------------
321 $linkback = '<a href="'.dol_buildpath('/intracommreport/list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
322
323 $morehtmlref = '<div class="refidno">';
324 /*
325 // Ref customer
326 $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
327 $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(getDolGlobalInt('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalInt('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
328 // Thirdparty
329 $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
330 if (!getDolGlobalInt('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
331 $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
332 }
333 // Project
334 if (isModEnabled('project')) {
335 $langs->load("projects");
336 $morehtmlref .= '<br>';
337 if ($permissiontoadd) {
338 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
339 if ($action != 'classify') {
340 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
341 }
342 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
343 } else {
344 if (!empty($object->fk_project)) {
345 $proj = new Project($db);
346 $proj->fetch($object->fk_project);
347 $morehtmlref .= $proj->getNomUrl(1);
348 if ($proj->title) {
349 $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
350 }
351 }
352 }
353 }
354 */
355 $morehtmlref .= '</div>';
356
357
358 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
359
360
361 print '<div class="fichecenter">';
362 print '<div class="fichehalfleft">';
363 print '<div class="underbanner clearboth"></div>';
364 print '<table class="border centpercent tableforfield">'."\n";
365
366 // Common attributes
367 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
368 //unset($object->fields['fk_project']); // Hide field already shown in banner
369 //unset($object->fields['fk_soc']); // Hide field already shown in banner
370 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
371
372 // Other attributes. Fields from hook formObjectOptions and Extrafields.
373 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
374
375 print '</table>';
376 print '</div>';
377 print '</div>';
378
379 print '<div class="clearboth"></div>';
380
381 print dol_get_fiche_end();
382
383
384 /*
385 * Lines
386 */
387
388 if (!empty($object->table_element_line)) {
389 // Show object lines
390 $result = $object->getLinesArray();
391
392 print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
393 <input type="hidden" name="token" value="' . newToken().'">
394 <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
395 <input type="hidden" name="mode" value="">
396 <input type="hidden" name="page_y" value="">
397 <input type="hidden" name="id" value="' . $object->id.'">
398 ';
399
400 if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
401 include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
402 }
403
404 print '<div class="div-table-responsive-no-min">';
405 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
406 print '<table id="tablelines" class="noborder noshadow" width="100%">';
407 }
408
409 /*
410 if (!empty($object->lines)) {
411 $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
412 }
413 */
414
415 // Form to add new line
416 if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
417 if ($action != 'editline') {
418 // Add products/services form
419
420 $parameters = array();
421 $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
422 if ($reshook < 0) {
423 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
424 }
425 if (empty($reshook)) {
426 $object->formAddObjectLine(1, $mysoc, $soc);
427 }
428 }
429 }
430
431 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
432 print '</table>';
433 }
434 print '</div>';
435
436 print "</form>\n";
437 }
438
439
440 // Buttons for actions
441
442 if ($action != 'presend' && $action != 'editline') {
443 print '<div class="tabsAction">'."\n";
444 $parameters = array();
445 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
446 if ($reshook < 0) {
447 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
448 }
449
450 if (empty($reshook)) {
451 // Send
452 if (empty($user->socid)) {
453 print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle');
454 }
455
456 // Back to draft
457 if ($object->status == $object::STATUS_VALIDATED) {
458 print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
459 }
460
461 // Modify
462 print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
463
464 // Validate
465 if ($object->status == $object::STATUS_DRAFT) {
466 if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
467 print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd);
468 } else {
469 $langs->load("errors");
470 print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0);
471 }
472 }
473
474 // Clone
475 if ($permissiontoadd) {
476 print dolGetButtonAction('', $langs->trans('ToClone'), 'clone', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
477 }
478
479 /*
480 // Disable / Enable
481 if ($permissiontoadd) {
482 if ($object->status == $object::STATUS_ENABLED) {
483 print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
484 } else {
485 print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
486 }
487 }
488 if ($permissiontoadd) {
489 if ($object->status == $object::STATUS_VALIDATED) {
490 print dolGetButtonAction('', $langs->trans('Cancel'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
491 } else {
492 print dolGetButtonAction('', $langs->trans('Re-Open'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
493 }
494 }
495 */
496
497 // Delete (with preloaded confirm popup)
498 $deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
499 $buttonId = 'action-delete-no-ajax';
500 if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
501 $deleteUrl = '';
502 $buttonId = 'action-delete';
503 }
504 $params = array();
505 print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
506 }
507 print '</div>'."\n";
508 }
509
510
511 // Select mail models is same action as presend
512 if (GETPOST('modelselected')) {
513 $action = 'presend';
514 }
515
516 if ($action != 'presend') {
517 print '<div class="fichecenter"><div class="fichehalfleft">';
518 print '<a name="builddoc"></a>'; // ancre
519
520 $includedocgeneration = 0;
521
522 // Documents
523 if ($includedocgeneration) {
524 $objref = dol_sanitizeFileName($object->ref);
525 $relativepath = $objref.'/'.$objref.'.pdf';
526 $filedir = $conf->intracommreport->dir_output.'/'.$object->element.'/'.$objref;
527 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
528 $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content
529 $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card
530 print $formfile->showdocuments('intracommreport:IntraCommReport', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
531 }
532
533 // Show links to link elements
534 $tmparray = $form->showLinkToObjectBlock($object, array(), array('intracommreport'), 1);
535 $linktoelem = $tmparray['linktoelem'];
536 $htmltoenteralink = $tmparray['htmltoenteralink'];
537 print $htmltoenteralink;
538
539 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
540
541 print '</div><div class="fichehalfright">';
542
543 $MAXEVENT = 10;
544
545 $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/intracommreport/intracommreport_agenda.php', 1).'?id='.$object->id);
546
547 $includeeventlist = 0;
548
549 // List of actions on element
550 if ($includeeventlist) {
551 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
552 $formactions = new FormActions($db);
553 $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
554 }
555
556 print '</div></div>';
557 }
558
559 //Select mail models is same action as presend
560 if (GETPOST('modelselected')) {
561 $action = 'presend';
562 }
563
564 // Presend form
565 $modelmail = 'intracommreport';
566 $defaulttopic = 'InformationMessage';
567 $diroutput = $conf->intracommreport->dir_output;
568 $trackid = 'intracommreport'.$object->id;
569
570 include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
571}
572
573// End of page
574llxFooter();
575$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 standard extra fields.
Class to manage building of HTML components.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage building of HTML components.
Class to manage intracomm report.
global $mysoc
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.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isModEnabled($module)
Is Dolibarr module enabled.
intracommreportPrepareHead($object)
Prepare array of tabs for IntraCommReport.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.