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


PHP calendar::getCalendarData方法代碼示例

本文整理匯總了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;
 }
開發者ID:bqevin,項目名稱:processmaker,代碼行數:69,代碼來源:UsersProperties.php

示例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;
 }
開發者ID:norahmollo,項目名稱:processmaker,代碼行數:36,代碼來源:AppDelegation.php

示例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;
 }
開發者ID:bqevin,項目名稱:processmaker,代碼行數:24,代碼來源:Event.php

示例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);
開發者ID:nhenderson,項目名稱:processmaker,代碼行數:67,代碼來源:cron_single.php

示例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();

		}

	}
開發者ID:rrsc,項目名稱:processmaker,代碼行數:57,代碼來源:AppDelegation.php

示例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
開發者ID:hpx2206,項目名稱:processmaker-1,代碼行數:67,代碼來源:AppDelegation.php


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