</table> <?php // tabbed information boxes $tabBox = new CTabBox('?m=calendar&a=day_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), W2P_BASE_DIR . '/modules/calendar/', $tab); $tabBox->add('vw_day_events', 'Events'); $tabBox->add('vw_day_tasks', 'Tasks'); $tabBox->show(); ?> </td> <?php if ($w2Pconfig['cal_day_view_show_minical']) { ?> <td valign="top" width="175"> <?php $minical = new CMonthCalendar($this_day); $minical->setStyles('minititle', 'minical'); $minical->showArrows = false; $minical->showWeek = false; $minical->clickMonth = true; $minical->setLinkFunctions('clickDay'); $first_time = new w2p_Utilities_Date($minical->prev_month); $first_time->setDay(1); $first_time->setTime(0, 0, 0); $last_time = new w2p_Utilities_Date($minical->prev_month); $last_time->setDay($minical->prev_month->getDaysInMonth()); $last_time->setTime(23, 59, 59); $links = array(); require_once W2P_BASE_DIR . '/modules/calendar/links_tasks.php'; getTaskLinks($first_time, $last_time, $links, 20, $company_id, true); require_once W2P_BASE_DIR . '/modules/calendar/links_events.php';
foreach ($itemList as $item) { $dateIndex = str_replace('/', '', $item['startDate']); $links[$dateIndex][] = $object->getCalendarLink($AppUI, $item); } } } } // create the main calendar $cal = new CMonthCalendar($date); $cal->setStyles('motitle', 'mocal'); $cal->setLinkFunctions('clickDay', 'clickWeek'); $cal->setEvents($links); echo $cal->show(); //echo '<pre>';print_r($cal);echo '</pre>'; // create the mini previous and next month calendars under $minical = new CMonthCalendar($cal->prev_month); $minical->setStyles('minititle', 'minical'); $minical->showArrows = false; $minical->showWeek = false; $minical->clickMonth = true; $minical->setLinkFunctions('clickDay'); $first_time = new w2p_Utilities_Date($cal->prev_month); $first_time->setDay(1); $first_time->setTime(0, 0, 0); $last_time = new w2p_Utilities_Date($cal->prev_month); $last_time->setDay($cal->prev_month->getDaysInMonth()); $last_time->setTime(23, 59, 59); $links = array(); getTaskLinks($first_time, $last_time, $links, 20, $company_id, true); getEventLinks($first_time, $last_time, $links, 20); $minical->setEvents($links);
/* PUBLIC $Id: calendar.php,v 1.7 2006/04/10 15:34:24 Attest sw-libre@attest.es Exp $ */ /* PUBLIC $Id: calendar.php,v 1.6 2005/04/03 19:33:48 gregorerhardt Exp $ */ require_once "{$baseDir}/classes/ui.class.php"; require_once "{$baseDir}/modules/calendar/calendar.class.php"; $callback = isset($_GET['callback']) ? $_GET['callback'] : 0; $date = dpGetParam($_GET, 'date', null); $prev_date = dpGetParam($_GET, 'uts', null); // if $date is empty, set to null $date = $date !== '' ? $date : null; $this_month = new CDate($date); $uistyle = $AppUI->getPref('UISTYLE') ? $AppUI->getPref('UISTYLE') : $dPconfig['host_style']; ?> <a href="javascript: void(0);" onClick="clickDay('', '');">borrar fecha</a> <?php $cal = new CMonthCalendar($this_month); $cal->setStyles('poptitle', 'popcal'); $cal->showWeek = false; $cal->callback = $callback; $cal->setLinkFunctions('clickDay'); if (isset($prev_date)) { $highlights = array($prev_date => "#FF8888"); $cal->setHighlightedDays($highlights); $cal->showHighlightedDays = true; } echo $cal->show(); ?> <script language="javascript"> /** * @param string Input date in the format YYYYMMDD * @param string Formatted date
<td> <a href="<?php echo '?m=calendar&a=year_view&date=' . $next_year; ?> "><img src="<?php echo w2PfindImage('next.gif'); ?> " width="16" height="16" alt="next" title="next" border="0"></a> </td> </tr> </table> </td> </tr> </table> <?php $minical = new CMonthCalendar($date); $minical->setStyles('minititle', 'minical'); $minical->showArrows = false; $minical->showWeek = true; $minical->clickMonth = true; $minical->setLinkFunctions('clickDay', 'clickWeek'); $s = ''; for ($j = 0; $j < 3; $j++) { $s .= '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>'; $s .= '<td valign="top" align="center" width="20%"> </td>'; for ($i = 0; $i <= 3; $i++) { // prepare time period for minical'events' $first_time = new CDate($date); $first_time->setDay(1); $first_time->setTime(0, 0, 0); $last_time = new CDate($date);
</table> <?php // tabbed information boxes $tabBox = new CTabBox("?m=calendar&a=day_view&date=" . $this_day->format(FMT_TIMESTAMP_DATE), $tab); $tabBox->add('vw_day_events', 'Events'); $tabBox->add('vw_day_tasks', 'Tasks'); $tabBox->show(); ?> </td> <?php if ($dPconfig['cal_day_view_show_minical']) { ?> <td valign="top" width="175"> <?php $minical = new CMonthCalendar($this_day); $minical->setStyles('minititle', 'minical'); $minical->showArrows = false; $minical->showWeek = false; $minical->clickMonth = true; $minical->setLinkFunctions('clickDay'); $minical->setDate($minical->prev_month); ?> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr><td class="minicalb"><?php echo $minical->show(); ?> </td></tr> <tr><td><img src="images/shim.gif" height="4"></td></tr> <?php echo $minical->setDate($minical->next_month);
if ($other_users) { $html .= $AppUI->_("Show Events for") . ":" . '<select name="show_user_events" onchange="document.pickFilter.submit()"' . ' class="text">'; $q = new DBQuery(); $q->addTable('users', 'u'); $q->addTable('contacts', 'con'); $q->addQuery('user_id, user_username, contact_first_name, contact_last_name'); $q->addWhere('user_contact = contact_id'); if ($rows = $q->loadList()) { foreach ($rows as $row) { $html .= '<option value="' . $row['user_id'] . '"' . ($user_id == $row['user_id'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($row['user_username']) . '</option>'; } } $html .= '</select>'; } $html .= '</form>'; $cal = new CMonthCalendar(); $html .= $cal->_drawBirthdays($this_day->format('%Y%m%d')); $html .= '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">'; $this_day->setTime($start, 0, 0); for ($i = 0, $n = ($end - $start) * 60 / $inc; $i < $n; $i++) { $html .= "\n<tr>"; $tm = $this_day->format($tf); $html .= "\n\t" . '<td width="1%" align="right" nowrap="nowrap">' . ($this_day->getMinute() ? $tm : '<b>' . $tm . '</b>') . '</td>'; $timeStamp = $this_day->format('%H%M%S'); if (@$events2[$timeStamp]) { $count = count($events2[$timeStamp]); for ($j = 0; $j < $count; $j++) { $row = $events2[$timeStamp][$j]; $et = new CDate($row['event_end_date']); $et_date = new CDate($row['event_end_date']); $et_date->setTime(0, 0, 0);
$first_time->setTime(0, 0, 0); $first_time->subtractSeconds(1); $last_time = new CDate(Date_calc::endOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $last_time->setTime(23, 59, 59); $prev_week = new CDate(Date_calc::beginOfPrevWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $next_week = new CDate(Date_calc::beginOfNextWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY)); $tasks = CTask::getTasksForPeriod($first_time, $last_time, $company_id); $events = CEvent::getEventsForPeriod($first_time, $last_time); $links = array(); // assemble the links for the tasks require_once DP_BASE_DIR . '/modules/calendar/links_tasks.php'; getTaskLinks($first_time, $last_time, $links, 50, $company_id); // assemble the links for the events require_once DP_BASE_DIR . '/modules/calendar/links_events.php'; getEventLinks($first_time, $last_time, $links, 50); $cal_week = new CMonthCalendar($date); $cal_week->setEvents($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); // setup the title block $titleBlock = new CTitleBlock('Week View', 'myevo-appointments.png', $m, "{$m}.{$a}"); $titleBlock->addCrumb('?m=calendar&date=' . $this_week->format(FMT_TIMESTAMP_DATE), 'month view'); $titleBlock->addCell($AppUI->_('Company') . ':'); $titleBlock->addCell(arraySelect($companies, 'company_id', 'onchange="javascript:document.pickCompany.submit()" class="text"', $company_id), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany">', '</form>'); $titleBlock->addCell($AppUI->_('Event Filter') . ':'); $titleBlock->addCell(arraySelect($event_filter_list, 'event_filter', 'onchange="javascript:document.pickFilter.submit()" class="text"', $event_filter, true), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickFilter">', '</form>'); $titleBlock->show(); ?>