當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CEvent::loadFull方法代碼示例

本文整理匯總了PHP中CEvent::loadFull方法的典型用法代碼示例。如果您正苦於以下問題:PHP CEvent::loadFull方法的具體用法?PHP CEvent::loadFull怎麽用?PHP CEvent::loadFull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CEvent的用法示例。


在下文中一共展示了CEvent::loadFull方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getEventTooltip

function getEventTooltip($event_id)
{
    global $AppUI;
    if (!$event_id) {
        return '';
    }
    $df = $AppUI->getPref('SHDATEFORMAT');
    $tf = $AppUI->getPref('TIMEFORMAT');
    // load the record data
    $event = new CEvent();
    $event->loadFull($event_id);
    // load the event types
    $types = w2PgetSysVal('EventType');
    // load the event recurs types
    $recurs = array('Never', 'Hourly', 'Daily', 'Weekly', 'Bi-Weekly', 'Every Month', 'Quarterly', 'Every 6 months', 'Every Year');
    $obj = new CEvent();
    $obj->event_id = $event_id;
    $assigned = $obj->getAssigned();
    $start_date = $event->event_start_date ? new CDate($event->event_start_date) : null;
    $end_date = $event->event_end_date ? new CDate($event->event_end_date) : null;
    if ($event->event_project) {
        $event_project = $event->project_name;
        $event_company = $event->company_name;
    }
    $tt = '<table border="0" cellpadding="0" cellspacing="0" width="96%">';
    $tt .= '<tr>';
    $tt .= '	<td valign="top" width="50%">';
    $tt .= '		<strong>' . $AppUI->_('Details') . '</strong>';
    $tt .= '		<table cellspacing="3" cellpadding="2" width="100%">';
    $tt .= '		<tr>';
    $tt .= '			<td style="text-color:white;border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Type') . '</td>';
    $tt .= '			<td width="100%" nowrap="nowrap">' . $AppUI->_($types[$event->event_type]) . '</td>';
    $tt .= '		</tr>	';
    if ($event->event_project) {
        $tt .= '		<tr>';
        $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Company') . '</td>';
        $tt .= '			<td width="100%">' . $event_company . '</td>';
        $tt .= '		</tr>';
        $tt .= '		<tr>';
        $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Project') . '</td>';
        $tt .= '			<td width="100%">' . $event_project . '</td>';
        $tt .= '		</tr>';
    }
    $tt .= '		<tr>';
    $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Starts') . '</td>';
    $tt .= '			<td nowrap="nowrap">' . ($start_date ? $start_date->format($df . ' ' . $tf) : '-') . '</td>';
    $tt .= '		</tr>';
    $tt .= '		<tr>';
    $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Ends') . '</td>';
    $tt .= '			<td nowrap="nowrap">' . ($end_date ? $end_date->format($df . ' ' . $tf) : '-') . '</td>';
    $tt .= '		</tr>';
    $tt .= '		<tr>';
    $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Recurs') . '</td>';
    $tt .= '			<td nowrap="nowrap">' . $AppUI->_($recurs[$event->event_recurs]) . ($event->event_recurs ? ' (' . $event->event_times_recuring . '&nbsp;' . $AppUI->_('times') . ')' : '') . '</td>';
    $tt .= '		</tr>';
    $tt .= '		<tr>';
    $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Attendees') . '</td>';
    $tt .= '			<td nowrap="nowrap">';
    if (is_array($assigned)) {
        $start = false;
        foreach ($assigned as $user) {
            if ($start) {
                $tt .= '<br />';
            } else {
                $start = true;
            }
            $tt .= $user;
        }
    }
    $tt .= '		</tr>';
    $tt .= '		</table>';
    $tt .= '	</td>';
    $tt .= '	<td width="50%" valign="top">';
    $tt .= '		<strong>' . $AppUI->_('Note') . '</strong>';
    $tt .= '		<table cellspacing="0" cellpadding="2" border="0" width="100%">';
    $tt .= '		<tr>';
    $tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;">';
    $tt .= '				' . mb_str_replace(chr(10), "<br />", $event->event_description) . '&nbsp;';
    $tt .= '			</td>';
    $tt .= '		</tr>';
    $tt .= '		</table>';
    $tt .= '	</td>';
    $tt .= '</tr>';
    $tt .= '</table>';
    return $tt;
}
開發者ID:joly,項目名稱:web2project,代碼行數:86,代碼來源:links_events.php

示例2: die

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$event_id = (int) w2PgetParam($_GET, 'event_id', 0);
// check permissions for this record
$perms =& $AppUI->acl();
$canRead = $perms->checkModuleItem($m, 'view', $event_id);
if (!$canRead) {
    $AppUI->redirect('m=public&a=access_denied');
}
$canEdit = $perms->checkModuleItem($m, 'edit', $event_id);
// check if this record has dependencies to prevent deletion
$msg = '';
$event = new CEvent();
$event->loadFull($event_id);
$canDelete = canDelete($m, $event_id);
// load the record data
if (!$event) {
    $AppUI->setMsg('Event');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect();
} else {
    $AppUI->savePlace();
}
//check if the user has view permission over the project
if ($event->event_project && !$perms->checkModuleItem('projects', 'view', $event->event_project)) {
    $AppUI->redirect('m=public&a=access_denied');
}
// load the event types
$types = w2PgetSysVal('EventType');
開發者ID:eureka2,項目名稱:web2project,代碼行數:31,代碼來源:view.php

示例3: getEventTooltip

function getEventTooltip($event_id)
{
    global $AppUI;
    if (!$event_id) {
        return '';
    }
    $df = $AppUI->getPref('SHDATEFORMAT');
    $tf = $AppUI->getPref('TIMEFORMAT');
    // load the record data
    $event = new CEvent();
    $event->loadFull($event_id);
    // load the event types
    $types = w2PgetSysVal('EventType');
    // load the event recurs types
    $recurs = array('Never', 'Hourly', 'Daily', 'Weekly', 'Bi-Weekly', 'Every Month', 'Quarterly', 'Every 6 months', 'Every Year');
    $obj = new CEvent();
    $obj->event_id = $event_id;
    $assigned = $obj->getAssigned();
    if ($event->event_project) {
        $event_project = $event->project_name;
        $event_company = $event->company_name;
    }
    $tt = '<table class="tool-tip">';
    $tt .= '<tr>';
    $tt .= '	<td valign="top" width="40%">';
    $tt .= '		<strong>' . $AppUI->_('Details') . '</strong>';
    $tt .= '		<table cellspacing="3" cellpadding="2" width="100%">';
    $tt .= '		<tr>';
    $tt .= '			<td class="tip-label">' . $AppUI->_('Type') . '</td>';
    $tt .= '			<td>' . $AppUI->_($types[$event->event_type]) . '</td>';
    $tt .= '		</tr>	';
    if ($event->event_project) {
        $tt .= '		<tr>';
        $tt .= '			<td class="tip-label">' . $AppUI->_('Company') . '</td>';
        $tt .= '			<td>' . $event_company . '</td>';
        $tt .= '		</tr>';
        $tt .= '		<tr>';
        $tt .= '			<td class="tip-label">' . $AppUI->_('Project') . '</td>';
        $tt .= '			<td>' . $event_project . '</td>';
        $tt .= '		</tr>';
    }
    $tt .= '		<tr>';
    $tt .= '			<td class="tip-label">' . $AppUI->_('Starts') . '</td>';
    $tt .= '			<td>' . $AppUI->formatTZAwareTime($event->event_start_date, $df . ' ' . $tf) . '</td>';
    $tt .= '		</tr>';
    $tt .= '		<tr>';
    $tt .= '			<td class="tip-label">' . $AppUI->_('Ends') . '</td>';
    $tt .= '			<td>' . $AppUI->formatTZAwareTime($event->event_end_date, $df . ' ' . $tf) . '</td>';
    $tt .= '		</tr>';
    $tt .= '		<tr>';
    $tt .= '			<td class="tip-label">' . $AppUI->_('Recurs') . '</td>';
    $tt .= '			<td>' . $AppUI->_($recurs[$event->event_recurs]) . ($event->event_recurs ? ' (' . $event->event_times_recuring . '&nbsp;' . $AppUI->_('times') . ')' : '') . '</td>';
    $tt .= '		</tr>';
    $tt .= '		<tr>';
    $tt .= '			<td class="tip-label">' . $AppUI->_('Attendees') . '</td>';
    $tt .= '			<td>';
    $tt .= implode('<br />', $assigned);
    $tt .= '		</tr>';
    $tt .= '		</table>';
    $tt .= '	</td>';
    $tt .= '	<td width="60%" valign="top">';
    $tt .= '		<strong>' . $AppUI->_('Note') . '</strong>';
    $tt .= '		<table cellspacing="0" cellpadding="2" border="0" width="100%">';
    $tt .= '		<tr>';
    $tt .= '			<td class="tip-label description">';
    $tt .= '				' . mb_str_replace(chr(10), "<br />", $event->event_description) . '&nbsp;';
    $tt .= '			</td>';
    $tt .= '		</tr>';
    $tt .= '		</table>';
    $tt .= '	</td>';
    $tt .= '</tr>';
    $tt .= '</table>';
    return $tt;
}
開發者ID:illuminate3,項目名稱:web2project,代碼行數:74,代碼來源:cleanup_functions.php


注:本文中的CEvent::loadFull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。