当前位置: 首页>>代码示例>>PHP>>正文


PHP CEvent::getEventsForPeriod方法代码示例

本文整理汇总了PHP中CEvent::getEventsForPeriod方法的典型用法代码示例。如果您正苦于以下问题:PHP CEvent::getEventsForPeriod方法的具体用法?PHP CEvent::getEventsForPeriod怎么用?PHP CEvent::getEventsForPeriod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEvent的用法示例。


在下文中一共展示了CEvent::getEventsForPeriod方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEventLinks

/**
* Sub-function to collect events within a period
* @param Date the starting date of the period
* @param Date the ending date of the period
* @param array by-ref an array of links to append new items to
* @param int the length to truncate entries by
* @author Andrew Eddie <eddieajau@users.sourceforge.net>
*/
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen)
{
    global $AppUI, $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new CDate($row['event_start_date']);
        $end = new CDate($row['event_end_date']);
        $date = $start;
        $date->setTime(0, 0, 0);
        $cwd = explode(',', $GLOBALS['dPconfig']['cal_working_days']);
        for ($i = 0, $x = $end->dateDiff($start); $i <= $x; $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                $link['href'] = '?m=calendar&a=view&event_id=' . $row['event_id'];
                $link['alt'] = $row['event_description'];
                $link['text'] = dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16) . htmlspecialchars($row['event_title']);
                if ($i == 0) {
                    $link['alt'] .= ' [' . $AppUI->_('START') . ']';
                }
                if ($i == $x) {
                    $link['alt'] .= ' [' . $AppUI->_('END') . ']';
                }
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
开发者ID:illuminate3,项目名称:dotproject,代码行数:38,代码来源:links_events.php

示例2: getEventLinks

/**
 * Sub-function to collect events within a period
 * @param Date the starting date of the period
 * @param Date the ending date of the period
 * @param array by-ref an array of links to append new items to
 * @param int the length to truncate entries by
 * @author Andrew Eddie <eddieajau@users.sourceforge.net>
 */
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen, $minical = false)
{
    global $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    $cwd = explode(',', w2PgetConfig('cal_working_days'));
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new CDate($row['event_start_date']);
        $end = new CDate($row['event_end_date']);
        $date = $start;
        for ($i = 0, $i_cmp = $start->dateDiff($end); $i <= $i_cmp; $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                if ($minical) {
                    $link = array();
                } else {
                    $url = '?m=calendar&a=view&event_id=' . $row['event_id'];
                    $link['href'] = '';
                    $link['alt'] = '';
                    $link['text'] = w2PtoolTip($row['event_title'], getEventTooltip($row['event_id']), true) . w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar') . '</a>&nbsp;' . '<a href="' . $url . '"><span class="event">' . $row['event_title'] . '</span></a>' . w2PendTip();
                }
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
开发者ID:joly,项目名称:web2project,代码行数:36,代码来源:links_events.php

示例3: getEventLinks

/**
* Sub-function to collect events within a period
* @param Date the starting date of the period
* @param Date the ending date of the period
* @param array by-ref an array of links to append new items to
* @param int the length to truncate entries by
* @author Andrew Eddie <eddieajau@users.sourceforge.net>
*/
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen)
{
    global $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new CDate($row['event_start_date']);
        $end = new CDate($row['event_end_date']);
        $date = $start;
        $cwd = explode(",", $GLOBALS["dPconfig"]['cal_working_days']);
        for ($i = 0; $i <= $start->dateDiff($end); $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                $url = '?m=calendar&a=view&event_id=' . $row['event_id'];
                $link['href'] = '';
                $link['alt'] = $row['event_description'];
                $link['text'] = '<table cellspacing="0" cellpadding="0" border="0"><tr>' . '<td><a href=' . $url . '>' . dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16, '') . '</a></td>' . '<td><a href="' . $url . '" title="' . $row['event_description'] . '"><span class="event">' . $row['event_title'] . '</span></a>' . '</td></tr></table>';
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
开发者ID:magsilva,项目名称:dotproject,代码行数:32,代码来源:links_events.php

示例4: array

        // check tasks access
        $result = array();
        foreach ($tasks as $key => $row) {
            $obj->load($row['task_id']);
            $canAccess = $obj->canAccess();
            if (!$canAccess) {
                continue;
            }
            $result[$key] = $row;
        }
        // execute and return
        return $result;
    }
}
// assemble the links for the events
$events = CEvent::getEventsForPeriod($first_time, $last_time, $event_filter, $user_id);
$events2 = array();
$tasks = CTask_ex::getAllTasksForPeriod($first_time, $last_time, $company_id);
$start_hour = w2PgetConfig('cal_day_start');
$end_hour = w2PgetConfig('cal_day_end');
foreach ($events as $row) {
    $start = new w2p_Utilities_Date($row['event_start_date']);
    $end = new w2p_Utilities_Date($row['event_end_date']);
    $events2[$start->format('%H%M%S')][] = $row;
    if ($start_hour > $start->format('%H')) {
        $start_hour = $start->format('%H');
    }
    if ($end_hour < $end->format('%H')) {
        $end_hour = $end->format('%H');
    }
}
开发者ID:caseysoftware,项目名称:web2project-planner,代码行数:31,代码来源:vw_day_planner.php

示例5: die

/* $Id: projects_tab.events.php 5691 2008-04-30 21:34:23Z merlinyoda $ */
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI, $project_id, $deny, $canRead, $canEdit, $dPconfig, $start_date, $end_date;
global $this_day, $event_filter, $event_filter_list;
require_once $AppUI->getModuleClass('calendar');
$perms =& $AppUI->acl();
$user_id = $AppUI->user_id;
$other_users = false;
$no_modify = false;
$start_date = isset($start_date) ? $start_date : new CDate('0000-00-00 00:00:00');
$end_date = isset($end_date) ? $end_date : new CDate('9999-12-31 23:59:59');
// assemble the links for the events
$events = CEvent::getEventsForPeriod($start_date, $end_date, 'all', null, $project_id);
//echo '<pre>' . print_r($events, true) .  '</pre>';
$start_hour = dPgetConfig('cal_day_start');
$end_hour = dPgetConfig('cal_day_end');
$tf = $AppUI->getPref('TIMEFORMAT');
$df = $AppUI->getPref('SHDATEFORMAT');
$types = dPgetSysVal('EventType');
?>
<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">
	<tr>
		<th><?php 
echo $AppUI->_('Date');
?>
</th>
		<th><?php 
echo $AppUI->_('Type');
开发者ID:klr2003,项目名称:sourceread,代码行数:30,代码来源:projects_tab.events.php

示例6: die

<?php

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI, $company_id, $deny, $canRead, $canEdit, $w2Pconfig, $start_date, $end_date, $this_day, $event_filter, $event_filter_list;
$perms =& $AppUI->acl();
$user_id = $AppUI->user_id;
$other_users = false;
$no_modify = false;
$start_date = new CDate('0000-00-00 00:00:00');
$end_date = new CDate('9999-12-31 23:59:59');
// assemble the links for the events
$events = CEvent::getEventsForPeriod($start_date, $end_date, 'all', 0, 0, $company_id);
$start_hour = w2PgetConfig('cal_day_start');
$end_hour = w2PgetConfig('cal_day_end');
$tf = $AppUI->getPref('TIMEFORMAT');
$df = $AppUI->getPref('SHDATEFORMAT');
$types = w2PgetSysVal('EventType');
$html = '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">';
$html .= '<tr><th>' . $AppUI->_('Date') . '</th><th>' . $AppUI->_('Type') . '</th><th>' . $AppUI->_('Event') . '</th></tr>';
foreach ($events as $row) {
    $html .= '<tr>';
    $start = new CDate($row['event_start_date']);
    $end = new CDate($row['event_end_date']);
    $html .= '<td width="25%" nowrap="nowrap">' . $start->format($df . ' ' . $tf) . '&nbsp;-&nbsp;';
    $html .= $end->format($df . ' ' . $tf) . '</td>';
    $href = '?m=calendar&a=view&event_id=' . $row['event_id'];
    $alt = $row['event_description'];
    $html .= '<td width="10%" nowrap="nowrap">';
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:companies_tab.view.events.php

示例7: CDate

$this_week = new CDate($date);
$dd = $this_week->getDay();
$mm = $this_week->getMonth();
$yy = $this_week->getYear();
// prepare time period for 'events'
$first_time = new CDate(Date_calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY));
$week_time = new CDate($first_time);
// Can't use first_time after we adjust it.
$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}");
开发者ID:srinivasulurao,项目名称:jonel,代码行数:31,代码来源:week_view.php

示例8: die

<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// @todo    convert to template
global $AppUI, $project_id;
$start_date = new w2p_Utilities_Date('2001-01-01 00:00:00');
$end_date = new w2p_Utilities_Date('2100-12-31 23:59:59');
$items = CEvent::getEventsForPeriod($start_date, $end_date, 'all', 0, $project_id);
$module = new w2p_System_Module();
$fields = $module->loadSettings('events', 'project_view');
if (0 == count($fields)) {
    $fieldList = array('event_start_date', 'event_end_date', 'event_type', 'event_name');
    $fieldNames = array('Start Date', 'End Date', 'Type', 'Event');
    $module->storeSettings('events', 'project_view', $fieldList, $fieldNames);
    $fields = array_combine($fieldList, $fieldNames);
}
?>
<a name="events-project_view"> </a><?php 
$event_types = w2PgetSysVal('EventType');
$customLookups = array('event_type' => $event_types);
$listTable = new w2p_Output_ListTable($AppUI);
$listTable->df .= ' ' . $AppUI->getPref('TIMEFORMAT');
// @todo cleanup this hack
echo $listTable->startTable();
echo $listTable->buildHeader($fields);
echo $listTable->buildRows($items, $customLookups);
echo $listTable->endTable();
开发者ID:illuminate3,项目名称:web2project,代码行数:29,代码来源:projects_tab.view.events.php


注:本文中的CEvent::getEventsForPeriod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。