$dd = $this_week->getDay(); $mm = $this_week->getMonth(); $yy = $this_week->getYear(); // prepare time period for 'events' $first_time = new w2p_Utilities_Date(Date_Calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $first_time->setTime(0, 0, 0); $last_time = new w2p_Utilities_Date(Date_Calc::endOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $last_time->setTime(23, 59, 59); $prev_week = new w2p_Utilities_Date(Date_Calc::beginOfPrevWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $next_week = new w2p_Utilities_Date(Date_Calc::beginOfNextWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $links = array(); // assemble the links for the tasks $links = getTaskLinks($first_time, $last_time, $links, 50, $company_id); // assemble the links for the events $links += getEventLinks($first_time, $last_time, $links, 50); $hooks = new w2p_System_HookHandler($AppUI); $hooks->links = $links; $links = $hooks->calendar_links(); // 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); $event_filter_list = array('my' => 'My Events', 'own' => 'Events I Created', 'all' => 'All Events'); // setup the title block $titleBlock = new w2p_Theme_TitleBlock('Week View', 'icon.png', $m); $titleBlock->addCrumb('?m=events&a=year_view&date=' . $this_week->format(FMT_TIMESTAMP_DATE), 'year view'); $titleBlock->addCrumb('?m=events&date=' . $this_week->format(FMT_TIMESTAMP_DATE), 'month view'); $titleBlock->addCrumb('?m=events&a=week_view&date=' . $this_week->format(FMT_TIMESTAMP_DATE), 'week view'); $titleBlock->addCrumb('?m=events&a=day_view&date=' . $this_week->format(FMT_TIMESTAMP_DATE), 'day view'); $titleBlock->addCell('<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">' . arraySelect($companies, 'company_id', 'onchange="document.pickCompany.submit()" class="text"', $company_id) . '</form>'); $titleBlock->addCell($AppUI->_('Company') . ':');
$AppUI = new w2p_Core_CAppUI(); $token = w2PgetParam($_GET, 'token', ''); $token = preg_replace("/[^A-Za-z0-9]/", "", $token); $format = w2PgetParam($_GET, 'format', 'ical'); $user = new CUser(); $userId = $user->getIdByToken($token); $AppUI->loadPrefs($userId); $AppUI->user_id = $userId; $AppUI->setUserLocale(); include W2P_BASE_DIR . '/locales/' . $AppUI->user_locale . '/locales.php'; include W2P_BASE_DIR . '/locales/core.php'; $defaultTZ = w2PgetConfig('system_timezone', 'UTC'); $defaultTZ = '' == $defaultTZ ? 'UTC' : $defaultTZ; date_default_timezone_set($defaultTZ); switch ($format) { //TODO: We only output in vCal, are there others we need to consider? case 'vcal': default: $format = 'vcal'; header('Content-Type: text/calendar'); header('Content-disposition: attachment; filename="calendar.ics"'); break; } if ($userId > 0) { $myTimezoneName = date('e'); $calendarHeader = "BEGIN:VCALENDAR\nPRODID:-//web2project//EN\nVERSION:2.0\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nX-WR-TIMEZONE:UTC\n"; $calendarFooter = "END:VCALENDAR"; $hooks = new w2p_System_HookHandler($AppUI); $buffer = $hooks->calendar(); echo $calendarHeader . $buffer . $calendarFooter; }
public function __construct(w2p_Core_CAppUI $AppUI) { parent::__construct($AppUI); trigger_error(get_class($this) . " has been deprecated in v3.1 and will be removed by v4.0. Please use " . get_parent_class($this) . " instead.", E_USER_NOTICE); }
<?php // Function to scan the event queue and execute any functions required. require_once 'base.php'; require_once W2P_BASE_DIR . '/includes/config.php'; require_once W2P_BASE_DIR . '/includes/main_functions.php'; require_once W2P_BASE_DIR . '/includes/db_adodb.php'; $defaultTZ = w2PgetConfig('system_timezone', 'UTC'); date_default_timezone_set($defaultTZ); $AppUI = new w2p_Core_CAppUI(); $AppUI->setUserLocale(); $queue = new w2p_System_EventQueue(); $queue->scan(); /* This is the first piece of a simple hook system to allow for regularly scheduled maintenance tasks to occur. This could be data validation and cleanup, sending email notifications, or workflow related tasks. */ $hooks = new w2p_System_HookHandler($AppUI); $hooks->process('cron');