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