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