public function Disable() { //$job_check = "SELECT COUNT(jobid) AS jobcount FROM [|PREFIX|]jobs WHERE jobtype='splittest' AND jobstatus NOT IN ('c')"; try { $status = parent::Disable(); } catch (Interspire_Addons_Exception $e) { throw new Interspire_Addons_Exception($e->getMessage(), $e->getCode()); } return true; }
public function Disable() { try { $status = parent::Disable(); } catch (Interspire_Addons_Exception $e) { throw new Interspire_Addons_Exception($e->getMessage(), $e->getCode()); } return true; }
/** * Disable * This disables the split test addon from the control panel. * Before it does it, it checks for any non-complete split test sending jobs * If any are found, the addon cannot be disabled. * * If that's ok, it deletes itself from the settings_cron_schedule table and any other settings it created (config_settings table). * * @uses Interspire_Addons::Disable * @uses Interspire_Addons_Exception * * @return Returns true if the addon was disabled successfully and there are no pending/in progress split test sends. * @throws If the parent::Disable method throws an exception, this will just re-throw that error. */ public function Disable() { $job_check = "SELECT COUNT(jobid) AS jobcount FROM [|PREFIX|]jobs WHERE jobtype='splittest' AND jobstatus NOT IN ('c')"; $count = $this->db->FetchOne($job_check); if ($count > 0) { throw new Interspire_Addons_Exception(GetLang('Addon_splittest_DisableFailed_SendsInProgress')); } $this->db->StartTransaction(); $result = $this->db->Query("DELETE FROM [|PREFIX|]settings_cron_schedule WHERE jobtype='" . $this->db->Quote($this->addon_id) . "'"); if (!$result) { $this->db->RollbackTransaction(); } $result = $this->db->Query("DELETE FROM [|PREFIX|]config_settings WHERE area='" . $this->db->Quote(strtoupper('CRON_' . $this->addon_id)) . "'"); if (!$result) { $this->db->RollbackTransaction(); } $this->db->CommitTransaction(); try { $status = parent::Disable(); } catch (Interspire_Addons_Exception $e) { throw new Interspire_Addons_Exception($e->getMessage(), $e->getCode()); } return true; }