Esempio n. 1
0
 /**
  * PauseSchedule
  * If a scheduled job is a "splittest" type, then this will pause the schedule
  * and set an appropriate message in the "GLOBALS[Message]" field.
  *
  * If it's not a splittest job, then this will just return.
  *
  * @param EventData_IEM_SCHEDULE_PAUSEJOB $data The data array contains the jobtype and the jobid to process.
  *
  * @uses InterspireEventData::preventDefault()
  * @uses Splittest_Send_API::PauseJob()
  */
 public static function PauseSchedule(EventData_IEM_SCHEDULE_PAUSEJOB $data)
 {
     $jobinfo =& $data->jobrecord;
     if ($jobinfo['jobtype'] != 'splittest') {
         return;
     }
     $data->preventDefault();
     require_once dirname(__FILE__) . '/api/splittest_send.php';
     $send_api = new Splittest_Send_API();
     $paused = $send_api->PauseJob($jobinfo['jobid']);
     if ($paused) {
         FlashMessage(GetLang('Addon_splittest_Send_Paused_Success'), SS_FLASH_MSG_SUCCESS);
     } else {
         FlashMessage(GetLang('Addon_splittest_Send_Paused_Failure'), SS_FLASH_MSG_ERROR);
     }
     $GLOBALS['Message'] = GetFlashMessages();
 }