本文整理汇总了PHP中calendar::getCalendarData方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::getCalendarData方法的具体用法?PHP calendar::getCalendarData怎么用?PHP calendar::getCalendarData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calendar
的用法示例。
在下文中一共展示了calendar::getCalendarData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validatePassword
public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime)
{
if (!defined('PPP_MINIMUM_LENGTH')) {
define('PPP_MINIMUM_LENGTH', 5);
}
if (!defined('PPP_MAXIMUM_LENGTH')) {
define('PPP_MAXIMUM_LENGTH', 20);
}
if (!defined('PPP_NUMERICAL_CHARACTER_REQUIRED')) {
define('PPP_NUMERICAL_CHARACTER_REQUIRED', 0);
}
if (!defined('PPP_UPPERCASE_CHARACTER_REQUIRED')) {
define('PPP_UPPERCASE_CHARACTER_REQUIRED', 0);
}
if (!defined('PPP_SPECIAL_CHARACTER_REQUIRED')) {
define('PPP_SPECIAL_CHARACTER_REQUIRED', 0);
}
if (!defined('PPP_EXPIRATION_IN')) {
define('PPP_EXPIRATION_IN', 0);
}
if (!defined('PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN')) {
define('PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN', 0);
}
if (function_exists('mb_strlen')) {
$iLength = mb_strlen($sPassword);
} else {
$iLength = strlen($sPassword);
}
$aErrors = array();
if ($iLength < PPP_MINIMUM_LENGTH) {
$aErrors[] = 'ID_PPP_MINIMUM_LENGTH';
}
if ($iLength > PPP_MAXIMUM_LENGTH) {
$aErrors[] = 'ID_PPP_MAXIMUM_LENGTH';
}
if (PPP_NUMERICAL_CHARACTER_REQUIRED == 1) {
if (preg_match_all('/[0-9]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0) {
$aErrors[] = 'ID_PPP_NUMERICAL_CHARACTER_REQUIRED';
}
}
if (PPP_UPPERCASE_CHARACTER_REQUIRED == 1) {
if (preg_match_all('/[A-Z]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0) {
$aErrors[] = 'ID_PPP_UPPERCASE_CHARACTER_REQUIRED';
}
}
if (PPP_SPECIAL_CHARACTER_REQUIRED == 1) {
if (preg_match_all('/[��\\!|"@�#$~%�&�\\/()=\'?��*+\\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0) {
$aErrors[] = 'ID_PPP_SPECIAL_CHARACTER_REQUIRED';
}
}
if (PPP_EXPIRATION_IN > 0) {
G::LoadClass('calendar');
$oCalendar = new calendar();
if ($oCalendar->pmCalendarUid == '') {
$oCalendar->pmCalendarUid = '00000000000000000000000000000001';
$oCalendar->getCalendarData();
}
$fDays = $oCalendar->calculateDuration(date('Y-m-d H:i:s'), $sLastUpdate);
if ($fDays > PPP_EXPIRATION_IN * 24) {
$aErrors[] = 'ID_PPP_EXPIRATION_IN';
}
}
if (PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN == 1) {
if ($iChangePasswordNextTime == 1) {
$aErrors[] = 'ID_PPP_CHANGE_PASSWORD_AFTER_NEXT_LOGIN';
}
}
return $aErrors;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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();
$appFields = $case->loadCase($appcacheAppUid);
示例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
//.........这里部分代码省略.........
$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 );
$delayDuration = $delayDuration / (24 * 60 * 60); //Days