Example #1
0
 public function getRemoteApiUrl($url = null)
 {
     if ($url == null) {
         return $this->settingsModel->getOption(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME) . '/api/index.php';
     } else {
         return $url . '/api/index.php';
     }
 }
Example #2
0
 protected function getInputBox($name, $value)
 {
     $params = $this->getRequest()->getParams();
     if (isset($params[$name])) {
         return parent::getInputBox($name, base64_decode(trim($this->getRequest()->getParam($name))));
     }
     $settings = new Qualityunit_Liveagent_Helper_Settings();
     return parent::getInputBox($name, $settings->getOption($name));
 }
Example #3
0
 public static function convertOldButton()
 {
     $settings = new Qualityunit_Liveagent_Helper_Settings();
     $setting = $settings->getOption(Qualityunit_Liveagent_Helper_Settings::BUTTON_CODE);
     if ($setting != '') {
         return;
     }
     $collection = Mage::getModel('liveagent/buttons')->getCollection();
     $buttonId = null;
     foreach ($collection as $button) {
         if ($buttonId === null && $button->getOnlinestatus() == 'Y' && $button->getContenttype() == 'F') {
             $buttonId = $button->getButtonid();
         }
         $button->delete();
     }
     if ($buttonId == null) {
         return;
     }
     $settings->saveButtonCodeForButtonId($buttonId);
 }
 private function getLoginUrl(Qualityunit_Liveagent_Helper_Settings $settings)
 {
     $authToken = $settings->getOwnerAuthToken();
     if ($authToken == '') {
         $sessionId = $settingsgetOwnerSessionId();
         if ($sessionId != '') {
             return $settings->getLiveAgentUrl() . '/agent?S=' . $settings->getOwnerSessionId();
         }
         return $settings->getLiveAgentUrl() . '/agent';
     }
     return $settings->getLiveAgentUrl() . '/agent?AuthToken=' . $authToken;
 }
 private function skipWaitAction()
 {
     $this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::ACCOUNT_STATUS, Qualityunit_Liveagent_Helper_Base::ACCOUNT_STATUS_SET);
     $this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::ACCOUNT_NOT_REACHABLE_TIMES, 0);
 }