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