32require
'../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/bookcal/lib/bookcal_calendar.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/bookcal/class/calendar.class.php';
50$langs->loadLangs(array(
"agenda",
"other"));
55$action =
GETPOST(
'action',
'aZ09');
58$fieldid = (!empty($ref) ?
'ref' :
'rowid');
60 $socid = $user->socid;
68if ($id > 0 || !empty($ref)) {
69 $ret =
$object->fetch($id, $ref);
70 $isdraft = ((
$object->status == Calendar::STATUS_DRAFT) ? 1 : 0);
78$enablepermissioncheck = 0;
79if ($enablepermissioncheck) {
80 $permissiontoread = $user->hasRight(
'bookcal',
'calendar',
'read');
81 $permissiontoadd = $user->hasRight(
'bookcal',
'calendar',
'write');
82 $permissiontodelete = $user->hasRight(
'bookcal',
'calendar',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
83 $permissionnote = $user->hasRight(
'bookcal',
'calendar',
'write');
84 $permissiondellink = $user->hasRight(
'bookcal',
'calendar',
'write');
86 $permissiontoread = 1;
88 $permissiontodelete = 1;
90 $permissiondellink = 1;
96if (!$permissiontoread) {
104$parameters = array();
106$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
116$form =
new Form($db);
119$title = $langs->trans(
'Calendar').
" - ".$langs->trans(
'Bookings');
121llxHeader(
'', $title, $helpurl,
'', 0, 0,
'',
'',
'',
'mod-bookcal page-list');
127 print
dol_get_fiche_head($head,
'booking', $langs->trans(
"Calendar"), -1,
$object->picto, 0,
'',
'', 0,
'', 1);
132 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
133 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
134 if (empty($reshook)) {
135 $formconfirm .= $hookmanager->resPrint;
136 } elseif ($reshook > 0) {
137 $formconfirm = $hookmanager->resPrint;
146 $linkback =
'<a href="'.dol_buildpath(
'/bookcal/calendar_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
148 $morehtmlref =
'<div class="refidno">';
149 $morehtmlref .=
'</div>';
152 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
155 print
'<div class="fichecenter">';
156 print
'<div class="fichehalfleft">';
157 print
'<div class="underbanner clearboth"></div>';
158 print
'<table class="border centpercent tableforfield">'.
"\n";
161 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
164 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
167 print
'<tr><td>Link</td>';
168 print
'<td><a href="'. DOL_URL_ROOT.
'/public/bookcal/index.php?id='.
$object->id.
'" target="_blank">Public page</a>';
175 print
'<div class="clearboth"></div>';
184 print
'<div class="div-table-responsive-no-min">';
185 print
'<table class="noborder centpercent">';
187 print
'<tr class="liste_titre">';
189 print
'<td class="left">'.$langs->trans(
"Ref").
'</td>';
190 print
'<td>'.$langs->trans(
"Title").
'</td>';
191 print
'<td class="center">'.$langs->trans(
"DateStart").
'</td>';
192 print
'<td class="center">'.$langs->trans(
"DateEnd").
'</td>';
193 print
'<td class="left">'.$langs->trans(
"Contact").
'</td>';
197 $sql =
"SELECT ac.id, ac.ref, ac.datep as date_start, ac.datep2 as date_end, ac.label, acr.fk_element as elementid";
198 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as ac";
199 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"actioncomm_resources as acr on acr.fk_actioncomm = ac.id";
200 $sql .=
" WHERE ac.fk_bookcal_calendar = ".((int)
$object->id);
201 $sql .=
" AND ac.code = 'AC_RDV'";
202 $sql .=
" AND acr.element_type = 'socpeople'";
204 $resql = $db->query($sql);
210 $tmpcontact =
new Contact($db);
213 $num = $db->num_rows($resql);
215 $obj = $db->fetch_object($resql);
216 $tmpcontact->fetch($obj->elementid);
217 $tmpactioncomm->fetch($obj->id);
219 print
'<tr class="oddeven">';
222 print
'<td class="nowraponall">'.$tmpactioncomm->getNomUrl(1, -1).
"</td>\n";
225 print
'<td class="tdoverflowmax125">';
230 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_start),
"dayhour").
'</td>';
233 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_end),
"dayhour").
'</td>';
236 print
'<td class="minwidth75">';
237 print $tmpcontact->getNomUrl(1,
'-1');
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
calendarPrepareHead($object)
Prepare array of tabs for Calendar.
Class to manage agenda events (actions)
dol_now($mode='gmt')
Return date for now.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.