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';
 
   52$langs->loadLangs(array(
"agenda", 
"other"));
 
   57$action = 
GETPOST(
'action', 
'aZ09');
 
   60$fieldid = (!empty($ref) ? 
'ref' : 
'rowid');
 
   62  $socid = $user->socid;
 
   70if ($id > 0 || !empty($ref)) {
 
   71  $ret = 
$object->fetch($id, $ref);
 
   72  $isdraft = ((
$object->status == Calendar::STATUS_DRAFT) ? 1 : 0);
 
   80$enablepermissioncheck = 0;
 
   81if ($enablepermissioncheck) {
 
   82  $permissiontoread = $user->hasRight(
'bookcal', 
'calendar', 
'read');
 
   83  $permissiontoadd = $user->hasRight(
'bookcal', 
'calendar', 
'write'); 
 
   84  $permissiontodelete = $user->hasRight(
'bookcal', 
'calendar', 
'delete') || ($permissiontoadd && isset(
$object->status) && 
$object->status == $object::STATUS_DRAFT);
 
   85  $permissionnote = $user->hasRight(
'bookcal', 
'calendar', 
'write'); 
 
   86  $permissiondellink = $user->hasRight(
'bookcal', 
'calendar', 
'write'); 
 
   88  $permissiontoread = 1;
 
   90  $permissiontodelete = 1;
 
   92  $permissiondellink = 1;
 
   95if (!isModEnabled(
"bookcal")) {
 
   98if (!$permissiontoread) {
 
  106$parameters = array();
 
  108$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action); 
 
  118$form = 
new Form($db);
 
  121$title = $langs->trans(
'Calendar').
" - ".$langs->trans(
'Bookings');
 
  123llxHeader(
'', $title, $helpurl, 
'', 0, 0, 
'', 
'', 
'', 
'mod-bookcal page-list');
 
  129  print 
dol_get_fiche_head($head, 
'booking', $langs->trans(
"Calendar"), -1, 
$object->picto, 0, 
'', 
'', 0, 
'', 1);
 
  134  $parameters = array(
'formConfirm' => $formconfirm, 
'lineid' => $lineid);
 
  135  $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action); 
 
  136  if (empty($reshook)) {
 
  137    $formconfirm .= $hookmanager->resPrint;
 
  138  } elseif ($reshook > 0) {
 
  139    $formconfirm = $hookmanager->resPrint;
 
  148  $linkback = 
'<a href="'.dol_buildpath(
'/bookcal/calendar_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ? 
'&socid='.$socid : 
'').
'">'.$langs->trans(
"BackToList").
'</a>';
 
  150  $morehtmlref = 
'<div class="refidno">';
 
  151  $morehtmlref .= 
'</div>';
 
  154  dol_banner_tab($object, 
'ref', $linkback, 1, 
'ref', 
'ref', $morehtmlref);
 
  157  print 
'<div class="fichecenter">';
 
  158  print 
'<div class="fichehalfleft">';
 
  159  print 
'<div class="underbanner clearboth"></div>';
 
  160  print 
'<table class="border centpercent tableforfield">'.
"\n";
 
  163  include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
 
  166  include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
 
  169  print 
'<tr><td>Link</td>';
 
  170  print 
'<td><a href="'. DOL_URL_ROOT.
'/public/bookcal/index.php?id='.
$object->id.
'" target="_blank">Public page</a>';
 
  177  print 
'<div class="clearboth"></div>';
 
  186  print 
'<div class="div-table-responsive-no-min">';
 
  187  print 
'<table class="noborder centpercent">';
 
  189  print 
'<tr class="liste_titre">';
 
  191  print 
'<td class="left">'.$langs->trans(
"Ref").
'</td>';
 
  192  print 
'<td>'.$langs->trans(
"Title").
'</td>';
 
  193  print 
'<td class="center">'.$langs->trans(
"DateStart").
'</td>';
 
  194  print 
'<td class="center">'.$langs->trans(
"DateEnd").
'</td>';
 
  195  print 
'<td class="left">'.$langs->trans(
"Contact").
'</td>';
 
  199  $sql = 
"SELECT ac.id, ac.ref, ac.datep as date_start, ac.datep2 as date_end, ac.label, acr.fk_element as elementid";
 
  200  $sql .= 
" FROM ".MAIN_DB_PREFIX.
"actioncomm as ac";
 
  201  $sql .= 
" JOIN ".MAIN_DB_PREFIX.
"actioncomm_resources as acr on acr.fk_actioncomm = ac.id";
 
  202  $sql .= 
" WHERE ac.fk_bookcal_calendar = ".((int) 
$object->id);
 
  203  $sql .= 
" AND ac.code = 'AC_RDV'";
 
  204  $sql .= 
" AND acr.element_type = 'socpeople'";
 
  206  $resql = $db->query($sql);
 
  212    $tmpcontact = 
new Contact($db);
 
  215    $num = $db->num_rows($resql);
 
  217      $obj = $db->fetch_object($resql);
 
  218      $tmpcontact->fetch($obj->elementid);
 
  219      $tmpactioncomm->fetch($obj->id);
 
  221      print 
'<tr class="oddeven">';
 
  224      print 
'<td class="nowraponall">'.$tmpactioncomm->getNomUrl(1, -1).
"</td>\n";
 
  227      print 
'<td class="tdoverflowmax125">';
 
  232      print 
'<td class="center">'.dol_print_date($db->jdate($obj->date_start), 
"dayhour").
'</td>';
 
  235      print 
'<td class="center">'.dol_print_date($db->jdate($obj->date_end), 
"dayhour").
'</td>';
 
  238      print 
'<td class="minwidth75">';
 
  239      print $tmpcontact->getNomUrl(1, -1);
 
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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)
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.