protected function setVariableValues() {
     parent::setVariableValues();
     $this->setVariable('campaignid', $this->campaign->getId());
     $this->setVariable('campaignname', Gpf_Lang::_localizeRuntime($this->campaign->getName(), $this->getRecipientLanguage()));
     $this->setVariable('campaignstatus', Pap_Common_Constants::getStatusAsText($this->campaign->getCampaignStatus()));
     $this->setVariable('campaigntype', $this->getTypeAsText($this->campaign->getCampaignType()));
     $this->setVariable('campaigndescription', Gpf_Lang::_localizeRuntime($this->campaign->getDescription(), $this->getRecipientLanguage()));
     $this->setVariable('campaignlongdescription', Gpf_Lang::_localizeRuntime($this->campaign->getLongDescription(), $this->getRecipientLanguage()));
 }
示例#2
0
 protected function setVariableValues() {
 	parent::setVariableValues();
 	
 	$this->setVariable('payment', $this->payout->getAmountAsText());
 	$this->setVariable('payoutcurrency', $this->payout->getCurrency()->getSymbol());
 	$this->setVariable('invoicenumber', $this->payout->getInvoiceNumber());
 	if ($this->payout->getPayoutOption() != null) {
         $this->setVariable('payoutmethod', Gpf_Lang::_localizeRuntime($this->payout->getPayoutOption()->getName(), $this->getRecipientLanguage()));
 	}
 }
 function __construct() {
     parent::__construct("signup_fields.tpl", "affiliateForm", "signup");
     $this->addStaticField("username", $this->_("Username (Email)"), "T", "M");
     $this->addStaticField("firstname", $this->_("First name"), "T", "M");
     $this->addStaticField("lastname", $this->_("Last name"), "T", "M");
     
     $this->addStaticField("agreeWithTerms", $this->_("I agree with terms & conditions"), "B", "O");
     
     $terms = Gpf_Lang::_localizeRuntime(Gpf_Settings::get(Pap_Settings::SIGNUP_TERMS_SETTING_NAME));
     $this->add("<label>" . $this->_('Terms & conditions') . "</label><textarea>" . $terms . "</textarea>",  'termsAndConditions');
     
 }
 protected function loadSetting() {
     parent::loadSetting();
     $this->addSetting(Pap_Settings::POST_SIGNUP_TYPE_SETTING_NAME);
     $this->addSetting(Pap_Settings::POST_SIGNUP_URL_SETTING_NAME);
     $this->addValue(Pap_Settings::SIGNUP_TERMS_SETTING_NAME, Gpf_Lang::_localizeRuntime(Gpf_Settings::get(Pap_Settings::SIGNUP_TERMS_SETTING_NAME)));
     $this->addSetting(Pap_Settings::INCLUDE_PAYOUT_OPTIONS);
     $this->addSetting(Pap_Settings::PAYOUT_OPTIONS);
     $this->addSetting(Pap_Settings::FORCE_PAYOUT_OPTION);
     $this->addSetting(Pap_Settings::FORCE_TERMS_ACCEPTANCE_SETTING_NAME);
     $this->addSetting(Pap_Settings::DEFAULT_PAYOUT_METHOD);
     $this->loadParentFromRequest();
     $this->addDefaultCountry();
 }
示例#5
0
    protected function setVariableValues() {
        parent::setVariableValues();

        $transactionFields = Pap_Common_TransactionFields::getInstance();
        $this->updateTransactionFields($transactionFields);
        $transactionValues = $transactionFields->getTransactionFieldsValues();
        foreach($transactionValues as $code => $value) {
            if ($code == Pap_Common_TransactionFields::CAMPAIGNNAME) {
                $value = Gpf_Lang::_localizeRuntime($value, $this->getRecipientLanguage());
            }
            if ($code == Pap_Common_TransactionFields::STATUS) {
                $value = Gpf_Lang::_($value, null, $this->getRecipientLanguage());
            }
            $this->setVariable($code, $value);
        }
    }
    public static function getAllPayoutOptionNames() {
    	$result = new Gpf_Data_RecordSet('id');

    	$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
    	$selectBuilder->select->add(Gpf_Db_Table_FieldGroups::ID, 'id');
    	$selectBuilder->select->add(Gpf_Db_Table_FieldGroups::NAME, 'name');
    	$selectBuilder->from->add(Gpf_Db_Table_FieldGroups::getName());
    	$selectBuilder->where->add(Gpf_Db_Table_FieldGroups::TYPE, '=', Pap_Common_Constants::FIELDGROUP_TYPE_PAYOUTOPTION);

    	$result->load($selectBuilder);
    	
    	$resultArray = array();
    	foreach($result as $record) {
    		$resultArray[$record->get('id')] = Gpf_Lang::_localizeRuntime($record->get('name'));
    	}
    	return $resultArray;
    }
示例#7
0
    private function getCustomFields(Pap_Common_User $user) {
        $customFields = explode(',', Gpf_Settings::get(GetResponseSignup_Config::CUSTOM_DATA_FIELDS));

        $select = new Gpf_SqlBuilder_SelectBuilder();
        $select->select->add(Gpf_Db_Table_FormFields::NAME);
        $select->select->add(Gpf_Db_Table_FormFields::CODE);
        $select->from->add(Gpf_Db_Table_FormFields::getName());

        array_walk($customFields, create_function('&$val', '$val = trim(strtolower($val));'));
        $select->where->add(Gpf_Db_Table_FormFields::CODE, 'IN', $customFields);
        $select->where->add(Gpf_Db_Table_FormFields::FORMID, '=', Pap_Merchants_Config_AffiliateFormDefinition::FORMID);
        $customs = array();
        $x = $select->toString();
        foreach($select->getAllRows() as $row) {
            $customs[] = array(
                'name' => str_replace(' ', '_', Gpf_Lang::_localizeRuntime($row->get(Gpf_Db_Table_FormFields::NAME))),
                'content' => $user->getData(str_replace('data', '', $row->get(Gpf_Db_Table_FormFields::CODE)))
            );
        }
        return $customs;
    }
	protected function addUserAdditionalViewColumns() {
		foreach (self::getUserFields() as $field) {
			$this->addViewColumn($field->get('code'), Gpf_Lang::_localizeRuntime($field->get('name')), true);
		}
	}
示例#9
0
 /**
  * Send mail (schedule to outbox)
  * @throws Gpf_Exception
  * @param $now boolean if true, mail is sent immediately
  */
 public function send($now = false, $delayMinutes = 0)
 {
     if (count($this->recipients) == 0) {
         throw new Gpf_Exception('Failed to send mail, recipients empty.');
     }
     $recipients = $this->getRecipients();
     if (count($recipients) == 0) {
         Gpf_Log::error('Email will not be sent, recipients empty.');
         return;
     }
     $this->loadTemplate();
     foreach ($recipients as $language => $timeOffsets) {
         foreach ($timeOffsets as $timeOffset => $emails) {
             $this->subjectTemplate = new Gpf_Templates_Template(Gpf_Lang::_localizeRuntime($this->getSubject(), $language), '', Gpf_Templates_Template::FETCH_TEXT);
             $this->bodyHtmlTemplate = new Gpf_Templates_Template(Gpf_Lang::_localizeRuntime($this->getBodyHtml(), $language), '', Gpf_Templates_Template::FETCH_TEXT);
             $this->bodyTextTemplate = new Gpf_Templates_Template(Gpf_Lang::_localizeRuntime($this->getBodyText(), $language), '', Gpf_Templates_Template::FETCH_TEXT);
             $this->setRecipientLanguage($language);
             $this->loadVariableValues($timeOffset);
             $mail = $this->createMail(implode(',', $emails), $this->getBccRecipients($this->bccRecipient));
             $mail->scheduleNow($now, $delayMinutes);
         }
     }
 }
示例#10
0
 /**
  * Translates text enclosed in ##any text##
  * This function is not parsed by language parser, because as input should be used e.g. texts loaded from database
  *
  * @param string $message String to translate
  * @return string Translated text
  */
 public function _localize($message)
 {
     return Gpf_Lang::_localizeRuntime($message);
 }
示例#11
0
 protected function getCountryName($country_code){
     if($country_code == null) {
         return '';
     }
     $country = new Gpf_Db_Country();
     $country->setCountryCode($country_code);
     try {
         $country->loadFromData();
         return Gpf_Lang::_localizeRuntime($country->getCountry());
     } catch (Gpf_Exception $e) {
         return '';
     }
 }