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