/**
  * retrieves default currency
  *
  * @return Gpf_Db_Currency
  */
 protected function getDefaultCurrency() {
 	try {
 		$obj = new Gpf_Db_Currency();
 		return $obj->getDefaultCurrency();
 	} catch (Gpf_DbEngine_NoRowException $e) {
 		throw new Pap_Tracking_Exception("    Critical error - No default currency is defined");
 	}
 } 
    protected function loadSetting() {
        parent::loadSetting();

        $this->addSetting(Pap_Settings::AFF_NOTIFICATION_ON_NEW_SALE_ENABLED_SETTING_NAME);

        $this->addSetting(Pap_Settings::AFF_NOTIFICATION_ON_SUBAFF_SIGNUP_ENABLED_SETTING_NAME);
        $this->addSetting(Pap_Settings::AFF_NOTIFICATION_ON_SUBAFF_SALE_ENABLED_SETTING_NAME);

    	$this->addSetting(Pap_Settings::SUPPORT_DIRECT_LINKING);
        $this->addSetting(Pap_Settings::MAIN_SITE_URL);

        $this->addSetting(Pap_Settings::TEXT_BANNER_FORMAT_SETTING_NAME);
        $this->addSetting(Pap_Settings::IMAGE_BANNER_FORMAT_SETTING_NAME);
        $this->addSetting(Pap_Settings::FLASH_BANNER_FORMAT_SETTING_NAME);

        $this->addSetting(Pap_Settings::BRANDING_TEXT_POST_AFFILIATE_PRO);
        $this->addSetting(Gpf_Settings_Gpf::BRANDING_QUALITY_UNIT);
        $this->addSetting(Pap_Settings::BRANDING_KNOWLEDGEBASE_LINK);
        $this->addSetting(Pap_Settings::BRANDING_POST_AFFILIATE_PRO_HELP_LINK);
        $this->addSetting(Pap_Settings::BRANDING_TUTORIAL_VIDEOS_ENABLED);
        $this->addSetting(Pap_Settings::SETTING_LINKING_METHOD);
        
        Gpf_Plugins_Engine::extensionPoint('PostAffiliate.ApplicationSettings.loadSetting', $this);
        
        $this->addValue(Pap_Settings::PARAM_NAME_USER_ID, Pap_Tracking_Request::getAffiliateClickParamName());
        $this->addValue(Pap_Settings::PARAM_NAME_BANNER_ID, Pap_Tracking_Request::getBannerClickParamName());
        
        $currentTheme = new Gpf_Desktop_Theme();
        $this->addValue("desktopMode", $currentTheme->getDesktopMode());

        //TODO - IIF Export Format - easy solution for adding other export button than CSV, if needed other formats need to refactor (find out if plugin is active)
        $this->addValue("quickBooksPluginActive", $this->isPluginActive('QuickBooks'));


       	try {
       	    $defaultCurrency = Gpf_Db_Currency::getDefaultCurrency();
       	    $this->addValue("currency_symbol", $defaultCurrency->getSymbol());
       	    $this->addValue("currency_precision", $defaultCurrency->getPrecision());
       	    $this->addValue("currency_wheredisplay", $defaultCurrency->getWhereDisplay());
       	} catch(Gpf_Exception $e) {
       	    $this->addValue("currency_symbol", "Unknown");
       	    $this->addValue("currency_precision", 2);
       	    $this->addValue("currency_wheredisplay", 1);
       	}
    }    
    protected function setCurrency(Pap_Contexts_Click $context) {
        try {
            $defaultCurrency = Gpf_Db_Currency::getDefaultCurrency();
        } catch(Gpf_Exception $e) {
            $context->debug('        ERROR, Cannot get default curency');
            return false;
        }

        $context->debug("    Currency set to ".$defaultCurrency->getName());
        $context->setDefaultCurrencyObject($defaultCurrency);
        return true;
    }
 /**
  * retrieves default currency
  *
  * @return Gpf_Db_Currency
  */
 private function getDefaultCurrency() {
     try {
         return Gpf_Db_Currency::getDefaultCurrency();
     } catch (Gpf_DbEngine_NoRowException $e) {
         throw new Pap_Tracking_Exception("    Critical error - No default currency is defined");
     }
 }
	protected function loadDefaultCurrency() {
		$obj = new Gpf_Db_Currency();
		return $obj->getDefaultCurrency();
	}
Beispiel #6
0
 protected function initFields() {
     $this->addTextBox($this->_('Days of validity'), self::VALIDITY_DAYS, $this->_('Number of days that defines validity of this plugin action (in days)'));
     $this->addListBox($this->_('Bonus type'), self::BONUS_TYPE, array('currency_symbol' => Gpf_Db_Currency::getDefaultCurrency()->getSymbol(), '%' => '%'));
     $this->addTextBox($this->_('Bonus amount'), self::BONUS_AMOUNT);
 }