/**
     * @deprecated
     */
    public static function replaceConstantsInInvoice($params) {
        if(isset($params['applyVat']) && $params['applyVat'] == Gpf::YES) {
    		$text = $params['payoutInvoiceWithVat'];
    	}  else {
    		$text = $params['payoutInvoice'];
    	}

  		$userFields = Pap_Common_UserFields::getInstance();
  		$userFields->setUser($params['user']);
  		$text = $userFields->replaceUserConstantsInText($text);

  		$text = Pap_Common_UserFields::replaceCustomConstantInText('vat_number', $params['vat_number'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('reg_number', $params['reg_number'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText(Pap_Settings::VAT_PERCENTAGE_SETTING_NAME,
  		    $params['vatPercentage'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payoutcurrency', $params['payout_currency'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('affiliate_note', $params['affiliateNote'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment', $params['payout_clear'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payoutmethod', $params['payout_method'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment_vat_part', $params['payment_vat_part'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment_incl_vat', $params['payment_incl_vat'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment_excl_vat', $params['payment_excl_vat'], $text);

  		$text = Pap_Common_UserFields::replaceCustomConstantInText('date', Gpf_Common_DateUtils::getDateInLocaleFormat(), $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('time', Gpf_Common_DateUtils::getTimeInLocaleFormat(), $text);

  		return $text;
    }
예제 #2
0
	private function getTitle(Pap_Common_User $user) {
		$title = $this->get(Pap_Db_Table_Banners::DATA1);
		
		$userFields = Pap_Common_UserFields::getInstance();
		$userFields->setUser($user);
		$title = $userFields->replaceUserConstantsInText($title);
		
		return $title;
	}
예제 #3
0
    static function getAll(){
        $fields = Pap_Common_UserFields::getInstance()->getUserFields(array('M', 'O', 'R'), Gpf::YES);
        $fields[self::VAR_AFF_SIGN] = Gpf_Lang::_('Affiliate Signup');
        $fields[self::VAR_DEST_URL] = Gpf_Lang::_('Destination URL');
        $fields[self::VAR_AFF_ID] = Gpf_Lang::_('Affiliate ID');
        $fields[self::BANNER_ID] = Gpf_Lang::_('Banner ID');

        $valueContext = new Gpf_Plugins_ValueContext($fields);
        Gpf_Plugins_Engine::extensionPoint('PostAffiliate.RebrandPdfBanner_Variables.getAll', $valueContext);
        return $valueContext->get();
    }
예제 #4
0
 /**
  * Removes user constants like username, firstname, ... data25
  *
  * @return string
  */
 public function removeUserConstants($text, $mainFields = null)
 {
     $userFields = Pap_Common_UserFields::getInstance();
     $text = $userFields->removeUserConstantsInText($text, $mainFields);
     $text = Pap_Common_UserFields::removeCommentsInText($text);
     return $text;
 }
예제 #5
0
 private function replaceVariables() {
     $userFields = Pap_Common_UserFields::getInstance();
     $userFields->setUser($this->user);
     $this->content = $userFields->replaceUserConstantsInText($this->content);
     $this->content = $this->replaceRelativeLinks($this->content);
     $this->content = $this->replaceAbsoluteLinks($this->content);
 }
예제 #6
0
 public function __construct() {
     $this->user = null;
     $this->fields = Pap_Common_UserFields::getInstance();
 }
예제 #7
0
    private function setUserCustomFields(Pap_Common_User $user, $preffix = '') {
        Pap_Common_UserFields::getInstance()->setUser($user);
        $formFields = Pap_Common_UserFields::getInstance()->getUserFieldsValues(Gpf::YES);

        foreach($formFields as $code => $value) {
            $this->setVariable($preffix.$code, $value);
        }

        $this->setVariable($preffix.Pap_Db_Table_Users::PARENTUSERID, Pap_Common_UserFields::getInstance()->getUserFieldValue(Pap_Db_Table_Users::PARENTUSERID));
    }
예제 #8
0
    /**
     * @param Pap_Common_User $user
     * @return string
     */
    protected function getDescription(Pap_Common_User $user) {
        $description = $this->get(Pap_Db_Table_Banners::DATA2);

        $userFields = Pap_Common_UserFields::getInstance();
        $userFields->setUser($user);
        $description = $userFields->replaceUserConstantsInText($description);

        return $description;
    }