32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/bookcal/lib/bookcal_calendar.lib.php';
41require_once __DIR__.
'/class/calendar.class.php';
44$langs->loadLangs(array(
"agenda",
"other"));
49$action =
GETPOST(
'action',
'aZ09');
52$fieldid = (!empty($ref) ?
'ref' :
'rowid');
54 $socid = $user->socid;
62if ($id > 0 || !empty($ref)) {
63 $ret =
$object->fetch($id, $ref);
64 $isdraft = ((
$object->status == Calendar::STATUS_DRAFT) ? 1 : 0);
72$enablepermissioncheck = 0;
73if ($enablepermissioncheck) {
74 $permissiontoread = $user->hasRight(
'bookcal',
'calendar',
'read');
75 $permissiontoadd = $user->hasRight(
'bookcal',
'calendar',
'write');
76 $permissiontodelete = $user->hasRight(
'bookcal',
'calendar',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
77 $permissionnote = $user->hasRight(
'bookcal',
'calendar',
'write');
78 $permissiondellink = $user->hasRight(
'bookcal',
'calendar',
'write');
80 $permissiontoread = 1;
82 $permissiontodelete = 1;
84 $permissiondellink = 1;
87if (!isModEnabled(
"bookcal")) {
90if (!$permissiontoread) {
100$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
110$form =
new Form($db);
113$title = $langs->trans(
'Calendar').
" - ".$langs->trans(
'Bookings');
115llxHeader(
'', $title, $helpurl,
'', 0, 0,
'',
'',
'',
'mod-bookcal page-list');
121 print
dol_get_fiche_head($head,
'booking', $langs->trans(
"Calendar"), -1,
$object->picto, 0,
'',
'', 0,
'', 1);
126 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
127 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
128 if (empty($reshook)) {
129 $formconfirm .= $hookmanager->resPrint;
130 } elseif ($reshook > 0) {
131 $formconfirm = $hookmanager->resPrint;
140 $linkback =
'<a href="'.dol_buildpath(
'/bookcal/calendar_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
142 $morehtmlref =
'<div class="refidno">';
143 $morehtmlref .=
'</div>';
146 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
149 print
'<div class="fichecenter">';
150 print
'<div class="fichehalfleft">';
151 print
'<div class="underbanner clearboth"></div>';
152 print
'<table class="border centpercent tableforfield">'.
"\n";
155 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
158 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
161 print
'<tr><td>Link</td>';
162 print
'<td><a href="'. DOL_URL_ROOT.
'/public/bookcal/index.php?id='.
$object->id.
'" target="_blank">Public page</a>';
169 print
'<div class="clearboth"></div>';
178 print
'<div class="div-table-responsive-no-min">';
179 print
'<table class="noborder centpercent">';
181 print
'<tr class="liste_titre">';
183 print
'<td class="left">'.$langs->trans(
"Ref").
'</td>';
184 print
'<td>'.$langs->trans(
"Title").
'</td>';
185 print
'<td class="center">'.$langs->trans(
"DateStart").
'</td>';
186 print
'<td class="center">'.$langs->trans(
"DateEnd").
'</td>';
187 print
'<td class="left">'.$langs->trans(
"Contact").
'</td>';
191 $sql =
"SELECT ac.id, ac.ref, ac.datep as date_start, ac.datep2 as date_end, ac.label, acr.fk_element as elementid";
192 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as ac";
193 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"actioncomm_resources as acr on acr.fk_actioncomm = ac.id";
194 $sql .=
" WHERE ac.fk_bookcal_calendar = ".((int)
$object->id);
195 $sql .=
" AND ac.code = 'AC_RDV'";
196 $sql .=
" AND acr.element_type = 'socpeople'";
198 $resql = $db->query($sql);
204 $tmpcontact =
new Contact($db);
207 $num = $db->num_rows($resql);
209 $obj = $db->fetch_object($resql);
210 $tmpcontact->fetch($obj->elementid);
211 $tmpactioncomm->fetch($obj->id);
213 print
'<tr class="oddeven">';
216 print
'<td class="nowraponall">'.$tmpactioncomm->getNomUrl(1, -1).
"</td>\n";
219 print
'<td class="tdoverflowmax125">';
224 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_start),
"dayhour").
'</td>';
227 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_end),
"dayhour").
'</td>';
230 print
'<td class="minwidth75">';
231 print $tmpcontact->getNomUrl(1, -1);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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)
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.
dol_now($mode='auto')
Return date for now.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.