本文整理汇总了PHP中calendar::getCalendar方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::getCalendar方法的具体用法?PHP calendar::getCalendar怎么用?PHP calendar::getCalendar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calendar
的用法示例。
在下文中一共展示了calendar::getCalendar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculateDueDate
public function calculateDueDate($sNextTasParam)
{
//Get Task properties
$task = TaskPeer::retrieveByPK($this->getTasUid());
$aData['TAS_UID'] = $this->getTasUid();
//Added to allow User defined Timing Control at Run time from Derivation screen
if (isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
$aData['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
$aData['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
$aData['TAS_TYPE_DAY'] = $sNextTasParam['NEXT_TASK']['TAS_TYPE_DAY'];
if (isset($sNextTasParam['NEXT_TASK']['TAS_CALENDAR']) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '') {
$aCalendarUID = $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'];
} else {
$aCalendarUID = '';
}
//Updating the task Table , so that user will see updated values in the assign screen in consequent cases
$oTask = new Task();
$oTask->update($aData);
} else {
if (is_null($task)) {
return 0;
}
$aData['TAS_DURATION'] = $task->getTasDuration();
$aData['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
$aData['TAS_TYPE_DAY'] = $task->getTasTypeDay();
$aCalendarUID = '';
}
//use the dates class to calculate dates
$calendar = new calendar();
if ($calendar->pmCalendarUid == '') {
$calendar->getCalendar(null, $task->getProUid(), $aData['TAS_UID']);
$calendar->getCalendarData();
}
$iDueDate = $calendar->calculateDate($this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT']);
return $iDueDate;
}
示例2: toCalculateTime
public function toCalculateTime($aData, $iDate = null)
{
G::LoadClass('calendar');
$oCalendar = new calendar();
$iDate = isset($iDate) ? $iDate : date('Y-m-d H:i:s');
$estimatedDuration = $aData['EVN_TAS_ESTIMATED_DURATION'];
//task duration
$when = $aData['EVN_WHEN'];
//how many days
$whenOccurs = $aData['EVN_WHEN_OCCURS'];
//time on action (AFTER_TIME/TASK_STARTED)
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->getCalendar(null, $aData['PRO_UID'], $aData['TAS_UID']);
$oCalendar->getCalendarData();
}
if ($whenOccurs == 'TASK_STARTED') {
$calculatedDueDateA = $oCalendar->calculateDate($iDate, $when, 'days');
$sActionDate = date('Y-m-d H:i:s', $calculatedDueDateA['DUE_DATE_SECONDS']);
} else {
$calculatedDueDateA = $oCalendar->calculateDate($iDate, $estimatedDuration + $when, 'days');
$sActionDate = date('Y-m-d H:i:s', $calculatedDueDateA['DUE_DATE_SECONDS']);
}
return $sActionDate;
}
示例3: executeCaseSelfService
//.........这里部分代码省略.........
$row = $rsCriteria->getRow();
$flag = false;
$appcacheAppUid = $row["APP_UID"];
$appcacheDelIndex = $row["DEL_INDEX"];
$appcacheDelDelegateDate = $row["DEL_DELEGATE_DATE"];
$appcacheAppNumber = $row["APP_NUMBER"];
$appcacheProUid = $row["PRO_UID"];
$taskUid = $row["TAS_UID"];
$taskSelfServiceTime = intval($row["TAS_SELFSERVICE_TIME"]);
$taskSelfServiceTimeUnit = $row["TAS_SELFSERVICE_TIME_UNIT"];
$taskSelfServiceTriggerUid = $row["TAS_SELFSERVICE_TRIGGER_UID"];
/*----------------------------------********---------------------------------*/
if ($calendar->pmCalendarUid == '') {
$calendar->getCalendar(null, $appcacheProUid, $taskUid);
$calendar->getCalendarData();
}
$dueDate = $calendar->calculateDate(
$appcacheDelDelegateDate,
$taskSelfServiceTime,
$taskSelfServiceTimeUnit //HOURS|DAYS|MINUTES
//1
);
if (time() > $dueDate["DUE_DATE_SECONDS"] && $flag == false) {
$sessProcess = null;
$sessProcessSw = 0;
//Load data
$case = new Cases();
示例4: run
/**
* @return unknown_type
*/
public function run()
{
$tpl = new template();
$helper = new helper();
if (!$this->userHasWidgets($_SESSION['userdata']['id'])) {
$this->setDefaultWidgets($_SESSION['userdata']['id']);
}
// CALENDAR
$calendar = new calendar();
$tpl->assign('calendar', $calendar->getCalendar($_SESSION['userdata']['id']));
// TICKETS
$tickets = new tickets();
$tpl->assign('myTickets', $tickets->getUserTickets(3, $_SESSION['userdata']['id']));
// PROJECTS
$projects = new projects();
$allProjects = $projects->getAll(false, 5);
$myProjects = array();
foreach ($allProjects as $project) {
$opentickets = $projects->getOpenTickets($project['id']);
$closedTickets = $project['numberOfTickets'] - $opentickets['openTickets'];
if ($project['numberOfTickets'] != 0) {
$projectPercentage = round($closedTickets / $project['numberOfTickets'] * 100, 2);
} else {
$projectPercentage = 0;
}
$values = array('id' => $project['id'], 'name' => $project['name'], 'projectPercentage' => $projectPercentage);
$myProjects[] = $values;
}
// HOURS
$ts = new timesheets();
$myHours = $ts->getUsersHours($_SESSION['userdata']['id']);
$tpl->assign('myHours', $myHours);
// NOTES
if (isset($_POST['save'])) {
if (isset($_POST['title']) && isset($_POST['description'])) {
$values = array('title' => $_POST['title'], 'description' => $_POST['description']);
$this->addNote($_SESSION['userdata']['id'], $values);
$tpl->setNotification('SAVE_SUCCESS', 'success');
} else {
$tpl->setNotification('MISSING_FIELDS', 'error');
}
}
// Statistics
$tpl->assign('closedTicketsPerWeek', $this->getClosedTicketsPerWeek());
$tpl->assign('hoursPerTicket', round($this->getHoursPerTicket()));
$tpl->assign('hoursBugFixing', round($this->getHoursBugFixing(), 1));
// WIDGET CUSTOMIZATION
if (isset($_POST['updateWidgets'])) {
$widgets = array();
foreach ($this->getWidgets() as $widget) {
if (isset($_POST['widget-' . $widget['id']])) {
$widgets[] = $widget['id'];
}
}
if (count($widgets)) {
$this->updateWidgets($_SESSION['userdata']['id'], $widgets);
$tpl->setNotification('SAVE_SUCCESS', 'success');
} else {
$tpl->setNotification('ONE_WIDGET_REQUIRED', 'error');
}
}
// HOT LEADS
$leads = new leads();
$hotLeads = $leads->getHotLeads();
$tpl->assign('hotLeads', $hotLeads);
$tpl->assign('notes', $this->getNotes($_SESSION['userdata']['id']));
$tpl->assign('availableWidgets', $this->getAvailableWidgets($_SESSION['userdata']['id']));
$tpl->assign('myProjects', $myProjects);
$tpl->assign('widgetTypes', $this->getWidgets());
$tpl->assign('widgets', $this->getUsersWidgets($_SESSION['userdata']['id']));
$tpl->assign('helper', $helper);
$tpl->display('dashboard.show');
}
示例5: calculateDuration
public function calculateDuration($cron = 0)
{
$this->writeFileIfCalledFromCronForCalculateDuration($cron);
$this->patchDataWithValuesForCalculateDuration();
$rs = $this->recordSetForCalculateDuration();
$rs->next();
$row = $rs->getRow();
$i = 0;
$calendar = new calendar();
$now = new DateTime();
while (is_array ($row)) {
$oAppDel = AppDelegationPeer::retrieveByPk( $row['APP_UID'], $row['DEL_INDEX'] );
$calendar = new calendar();
$calendar->getCalendar($row['USR_UID'], $row['PRO_UID'], $row['TAS_UID']);
$calData = $calendar->getCalendarData();
$calculatedValues = $this->getValuesToStoreForCalculateDuration($row, $calendar, $calData, $now);
$oAppDel->setDelStarted($calculatedValues['isStarted']);
$oAppDel->setDelFinished($calculatedValues['isFinished']);
$oAppDel->setDelDelayed($calculatedValues['isDelayed']);
$oAppDel->setDelQueueDuration($calculatedValues['queueTime']);
$oAppDel->setDelDelayDuration($calculatedValues['delayTime']);
$oAppDel->setDelDuration($calculatedValues['durationTime']);
$oAppDel->setAppOverduePercentage($calculatedValues['percentDelay']);
$RES = $oAppDel->save();
$rs->next();
$row = $rs->getRow();
}
}
示例6: calculateDuration
//.........这里部分代码省略.........
$fTaskDurationUnit = $row['TAS_TIMEUNIT'];
$iDelegateDate = strtotime( $row['DEL_DELEGATE_DATE'] );
$iInitDate = strtotime( $row['DEL_INIT_DATE'] );
$iDueDate = strtotime( $row['DEL_TASK_DUE_DATE'] );
$iFinishDate = strtotime( $row['DEL_FINISH_DATE'] );
$isStarted = intval( $row['DEL_STARTED'] );
$isFinished = intval( $row['DEL_FINISHED'] );
$isDelayed = intval( $row['DEL_DELAYED'] );
$queueDuration = $this->getDiffDate( $iInitDate, $iDelegateDate );
$delDuration = 0;
$delayDuration = 0;
$overduePercentage = 0.0;
//get the object,
$oAppDel = AppDelegationPeer::retrieveByPk( $row['APP_UID'], $row['DEL_INDEX'] );
//getting the calendar
$calendar->getCalendar($row['USR_UID'], $row['PRO_UID'], $row['TAS_UID']);
$calData = $calendar->getCalendarData();
//if the task is not started
if ($isStarted == 0) {
if ($row['DEL_INIT_DATE'] != null && $row['DEL_INIT_DATE'] != '') {
$oAppDel->setDelStarted( 1 );
$queueDuration = $this->getDiffDate( $iInitDate, $iDelegateDate );
$oAppDel->setDelQueueDuration( $queueDuration );
} else {
//the task was not started
$queueDuration = $this->getDiffDate( $now, $iDelegateDate );
$oAppDel->setDelQueueDuration( $queueDuration );
//we are putting negative number if the task is not delayed, and positive number for the time the task is delayed
//$delayDuration = $this->getDiffDate( $now, $iDueDate );
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $row['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"), $calData );