dolibarr 23.0.3
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-2025 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
71$object = new IntracommReport($db);
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// Example : Adding jquery code
206// print '<script type="text/javascript">
207// jQuery(document).ready(function() {
208// function init_myfunc()
209// {
210// jQuery("#myid").removeAttr(\'disabled\');
211// jQuery("#myid").attr(\'disabled\',\'disabled\');
212// }
213// init_myfunc();
214// jQuery("#mybutton").click(function() {
215// init_myfunc();
216// });
217// });
218// </script>';
219
220
221// Part to create
222if ($action == 'create') {
223 if (empty($permissiontoadd)) {
224 accessforbidden('NotEnoughPermissions', 0, 1);
225 }
226
227 print load_fiche_titre($title, '', 'object_'.$object->picto);
228
229 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
230 print '<input type="hidden" name="token" value="'.newToken().'">';
231 print '<input type="hidden" name="action" value="add">';
232 if ($backtopage) {
233 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
234 }
235 if ($backtopageforcancel) {
236 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
237 }
238 if ($dol_openinpopup) {
239 print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">';
240 }
241
242 print dol_get_fiche_head(array(), '');
243
244
245 print '<table class="border centpercent tableforfieldcreate">'."\n";
246
247 // Common attributes
248 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
249
250 // Other attributes
251 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
252
253 print '</table>'."\n";
254
255 print dol_get_fiche_end();
256
257 print $form->buttonsSaveCancel("Create");
258
259 print '</form>';
260
261 //dol_set_focus('input[name="ref"]');
262}
263
264// Part to edit record
265if (($id || $ref) && $action == 'edit') {
266 print load_fiche_titre($langs->trans("IntraCommReport"), '', 'object_'.$object->picto);
267
268 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
269 print '<input type="hidden" name="token" value="'.newToken().'">';
270 print '<input type="hidden" name="action" value="update">';
271 print '<input type="hidden" name="id" value="'.$object->id.'">';
272 if ($backtopage) {
273 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
274 }
275 if ($backtopageforcancel) {
276 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
277 }
278
279 print dol_get_fiche_head();
280
281 print '<table class="border centpercent tableforfieldedit">'."\n";
282
283 // Common attributes
284 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
285
286 // Other attributes
287 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
288
289 print '</table>';
290
291 print dol_get_fiche_end();
292
293 print $form->buttonsSaveCancel();
294
295 print '</form>';
296}
297
298// Part to show record
299if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
300 $head = intracommreportPrepareHead($object);
301
302 print dol_get_fiche_head($head, 'card', $langs->trans("IntraCommReport"), -1, $object->picto, 0, '', '', 0, '', 1);
303
304 $formconfirm = '';
305
306 // Confirmation to delete (using preloaded confirm popup)
307 if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
308 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntraCommReport'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
309 }
310 // Confirmation to delete line
311 if ($action == 'deleteline') {
312 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
313 }
314
315 // Clone confirmation
316 if ($action == 'clone') {
317 // Create an array for form
318 $formquestion = array();
319 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
320 }
321
322 // Call Hook formConfirm
323 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
324 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
325 if (empty($reshook)) {
326 $formconfirm .= $hookmanager->resPrint;
327 } elseif ($reshook > 0) {
328 $formconfirm = $hookmanager->resPrint;
329 }
330
331 // Print form confirm
332 print $formconfirm;
333
334
335 // Object card
336 // ------------------------------------------------------------
337 $linkback = '<a href="'.dol_buildpath('/intracommreport/list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
338
339 $morehtmlref = '<div class="refidno">';
340 /*
341 // Ref customer
342 $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
343 $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);
344 // Thirdparty
345 $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
346 if (!getDolGlobalInt('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
347 $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
348 }
349 // Project
350 if (isModEnabled('project')) {
351 $langs->load("projects");
352 $morehtmlref .= '<br>';
353 if ($permissiontoadd) {
354 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
355 if ($action != 'classify') {
356 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
357 }
358 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
359 } else {
360 if (!empty($object->fk_project)) {
361 $proj = new Project($db);
362 $proj->fetch($object->fk_project);
363 $morehtmlref .= $proj->getNomUrl(1);
364 if ($proj->title) {
365 $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
366 }
367 }
368 }
369 }
370 */
371 $morehtmlref .= '</div>';
372
373
374 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
375
376
377 print '<div class="fichecenter">';
378 print '<div class="fichehalfleft">';
379 print '<div class="underbanner clearboth"></div>';
380 print '<table class="border centpercent tableforfield">'."\n";
381
382 // Common attributes
383 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
384 //unset($object->fields['fk_project']); // Hide field already shown in banner
385 //unset($object->fields['fk_soc']); // Hide field already shown in banner
386 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
387
388 // Other attributes. Fields from hook formObjectOptions and Extrafields.
389 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
390
391 print '</table>';
392 print '</div>';
393 print '</div>';
394
395 print '<div class="clearboth"></div>';
396
397 print dol_get_fiche_end();
398
399
400 /*
401 * Lines
402 */
403
404 if (!empty($object->table_element_line)) {
405 // Show object lines
406 $result = $object->getLinesArray();
407
408 print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
409 <input type="hidden" name="token" value="' . newToken().'">
410 <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
411 <input type="hidden" name="mode" value="">
412 <input type="hidden" name="page_y" value="">
413 <input type="hidden" name="id" value="' . $object->id.'">
414 ';
415
416 if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
417 include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
418 }
419
420 print '<div class="div-table-responsive-no-min">';
421 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
422 print '<table id="tablelines" class="noborder noshadow" width="100%">';
423 }
424
425 /*
426 if (!empty($object->lines)) {
427 $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
428 }
429 */
430
431 // Form to add new line
432 if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
433 if ($action != 'editline') {
434 // Add products/services form
435
436 $parameters = array();
437 $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
438 if ($reshook < 0) {
439 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
440 }
441 if (empty($reshook)) {
442 $object->formAddObjectLine(1, $mysoc, $soc);
443 }
444 }
445 }
446
447 if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
448 print '</table>';
449 }
450 print '</div>';
451
452 print "</form>\n";
453 }
454
455
456 // Buttons for actions
457
458 if ($action != 'presend' && $action != 'editline') {
459 print '<div class="tabsAction">'."\n";
460 $parameters = array();
461 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
462 if ($reshook < 0) {
463 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
464 }
465
466 if (empty($reshook)) {
467 // Send
468 if (empty($user->socid)) {
469 print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle');
470 }
471
472 // Back to draft
473 if ($object->status == $object::STATUS_VALIDATED) {
474 print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
475 }
476
477 // Modify
478 print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
479
480 // Validate
481 if ($object->status == $object::STATUS_DRAFT) {
482 if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
483 print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd);
484 } else {
485 $langs->load("errors");
486 print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0);
487 }
488 }
489
490 // Clone
491 if ($permissiontoadd) {
492 print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
493 }
494
495 /*
496 // Disable / Enable
497 if ($permissiontoadd) {
498 if ($object->status == $object::STATUS_ENABLED) {
499 print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
500 } else {
501 print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
502 }
503 }
504 if ($permissiontoadd) {
505 if ($object->status == $object::STATUS_VALIDATED) {
506 print dolGetButtonAction('', $langs->trans('Cancel'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
507 } else {
508 print dolGetButtonAction('', $langs->trans('Re-Open'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
509 }
510 }
511 */
512
513 // Delete (with preloaded confirm popup)
514 $deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
515 $buttonId = 'action-delete-no-ajax';
516 if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
517 $deleteUrl = '';
518 $buttonId = 'action-delete';
519 }
520 $params = array();
521 print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
522 }
523 print '</div>'."\n";
524 }
525
526
527 // Select mail models is same action as presend
528 if (GETPOST('modelselected')) {
529 $action = 'presend';
530 }
531
532 if ($action != 'presend') {
533 print '<div class="fichecenter"><div class="fichehalfleft">';
534 print '<a name="builddoc"></a>'; // ancre
535
536 $includedocgeneration = 0;
537
538 // Documents
539 if ($includedocgeneration) {
540 $objref = dol_sanitizeFileName($object->ref);
541 $relativepath = $objref.'/'.$objref.'.pdf';
542 $filedir = $conf->intracommreport->dir_output.'/'.$object->element.'/'.$objref;
543 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
544 $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content
545 $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card
546 print $formfile->showdocuments('intracommreport:IntraCommReport', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
547 }
548
549 // Show links to link elements
550 $tmparray = $form->showLinkToObjectBlock($object, array(), array('intracommreport'), 1);
551 $linktoelem = $tmparray['linktoelem'];
552 $htmltoenteralink = $tmparray['htmltoenteralink'];
553 print $htmltoenteralink;
554
555 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
556
557 print '</div><div class="fichehalfright">';
558
559 $MAXEVENT = 10;
560
561 $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/intracommreport/intracommreport_agenda.php', 1).'?id='.$object->id);
562
563 $includeeventlist = 0;
564
565 // List of actions on element
566 if ($includeeventlist) {
567 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
568 $formactions = new FormActions($db);
569 $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
570 }
571
572 print '</div></div>';
573 }
574
575 //Select mail models is same action as presend
576 if (GETPOST('modelselected')) {
577 $action = 'presend';
578 }
579
580 // Presend form
581 $modelmail = 'intracommreport';
582 $defaulttopic = 'InformationMessage';
583 $diroutput = $conf->intracommreport->dir_output;
584 $trackid = 'intracommreport'.$object->id;
585
586 include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
587}
588
589// End of page
590llxFooter();
591$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
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.
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'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
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.