<?php /* $Id: index.php 1771 2011-03-26 20:51:31Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/calendar/index.php $ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // check permissions for this record $perms =& $AppUI->acl(); $canRead = canView($m); if (!$canRead) { $AppUI->redirect('m=public&a=access_denied'); } $AppUI->savePlace(); w2PsetMicroTime(); // retrieve any state parameters if (isset($_REQUEST['company_id'])) { $AppUI->setState('CalIdxCompany', intval(w2PgetParam($_REQUEST, 'company_id', 0))); } $company_id = $AppUI->getState('CalIdxCompany', 0); // Using simplified set/get semantics. Doesn't need as much code in the module. $event_filter = $AppUI->checkPrefState('CalIdxFilter', w2PgetParam($_REQUEST, 'event_filter', 'my'), 'EVENTFILTER', 'my'); // get the passed timestamp (today if none) $ctoday = new w2p_Utilities_Date(); $today = $ctoday->format(FMT_TIMESTAMP_DATE); $date = w2PgetParam($_GET, 'date', $today); // get the list of visible companies $company = new CCompany(); $companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name'); $companies = arrayMerge(array('0' => $AppUI->_('All')), $companies); // setup the title block $titleBlock = new CTitleBlock('Monthly Calendar', 'myevo-appointments.png', $m, $m . '.' . $a);
/** */ function w2PgetMicroDiff() { global $microTimeSet; $mt = $microTimeSet; w2PsetMicroTime(); return sprintf('%.3f', $microTimeSet - $mt); }