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


PHP calendar::calculateDate方法代碼示例

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


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

示例1: 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

示例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: executeCaseSelfService


//.........這裏部分代碼省略.........

            $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);



                $appFields["APP_DATA"]["APPLICATION"] = $appcacheAppUid;

開發者ID:nhenderson,項目名稱:processmaker,代碼行數:65,代碼來源:cron_single.php


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