$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
     }
     if ($recalculateDate) {
         $aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
     } elseif ($recalculateTime) {
         //                                $Fields = $oCaseScheduler->Load($aData['SCH_UID']);
         //                                $Fields['SCH_LAST_STATE'] = $aRow['SCH_STATE'];
         //                                $Fields['SCH_STATE'] = 'PROCESSED';
         //                                $this->Update($Fields);
         $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d") . " " . $_POST['form']['SCH_START_TIME'] . ":00";
     }
     //                var_dump($recalculateTime);
     //                var_dump($aData['SCH_TIME_NEXT_RUN']);
     //                die;
     if ($sOption == '5') {
         $date = $oCaseScheduler->getSchLastRunTime();
         if ($date == null) {
             $date = $oCaseScheduler->getSchStartTime();
         }
         $date = strtotime($date);
         $nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
         $aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
         $date += $nextRun;
         $date = date("Y-m-d H:i", $date);
         $aData['SCH_TIME_NEXT_RUN'] = $date;
     }
 }
 if (!empty($_POST['form']['SCH_REPEAT_TASK_CHK'])) {
     $nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
     if ($nOptEvery == 2) {
         $aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;