コード例 #1
0
    /**
     * @service affiliate_email_notification read
     * @param $fields
     */
    public function load(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        $this->attribute = Gpf_Db_Table_UserAttributes::getInstance();
        $this->attribute->loadAttributes(Gpf_Session::getAuthUser()->getAccountUserId());

        $form->setField("aff_notification_on_new_sale", $this->attribute->getAttributeWithDefaultValue("aff_notification_on_new_sale", "N"));
        $form->setField("aff_notification_on_change_comm_status", $this->attribute->getAttributeWithDefaultValue("aff_notification_on_change_comm_status", "N"));
        $form->setField("aff_notification_on_subaff_signup", $this->attribute->getAttributeWithDefaultValue("aff_notification_on_subaff_signup", "N"));
        $form->setField("aff_notification_on_subaff_sale", $this->attribute->getAttributeWithDefaultValue("aff_notification_on_subaff_sale", "N"));
        $form->setField("aff_notification_on_direct_link_enabled", $this->attribute->getAttributeWithDefaultValue("aff_notification_on_direct_link_enabled", "N"));
        $form->setField("aff_notification_daily_report", $this->attribute->getAttributeWithDefaultValue("aff_notification_daily_report", "N"));
        $form->setField("aff_notification_weekly_report", $this->attribute->getAttributeWithDefaultValue("aff_notification_weekly_report", "N"));
        $form->setField("aff_notification_monthly_report", $this->attribute->getAttributeWithDefaultValue("aff_notification_monthly_report", "N"));


       	return $form;
    }
コード例 #2
0
    /**
     * @service affiliate_email_notification read
     * @param $fields
     */
    public function load(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        $this->attribute = Gpf_Db_Table_UserAttributes::getInstance();
        $this->attribute->loadAttributes(Gpf_Session::getAuthUser()->getAccountUserId());

        $data = new Gpf_Db_UserAttribute();
        $data->setAccountUserId(Gpf_Session::getAuthUser()->getUserId());
        $data->setName('RecipientsList');
        try {
            $data->loadFromData(array(Gpf_Db_Table_UserAttributes::ACCOUNT_USER_ID,Gpf_Db_Table_UserAttributes::NAME));
            $form->setField("recipients",$data->getValue());

        } catch(Gpf_DbEngine_NoRowException $e) {
            $form->setField("recipients","");
        }
        $form->setField('affEmail',Gpf_Session::getAuthUser()->getUsername());

       	return $form;
    }
コード例 #3
0
 /**
  * Get recordset of all selected wallpaper
  *
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Data_RecordSet
  */
 public function loadSelectedWallpaperNoRpc()
 {
     $response = new Gpf_Data_RecordSet();
     $response->addColumn(self::WALLPAPER_TYPE);
     $response->addColumn(self::WALLPAPER_POSITION);
     $response->addColumn(self::BACKGROUND_COLOR);
     $response->addColumn("fileId");
     $response->addColumn("url");
     $record = $response->createRecord();
     try {
         Gpf_Db_Table_UserAttributes::getInstance()->loadAttributes(Gpf_Session::getAuthUser()->getAccountUserId());
         $wallpaperType = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::WALLPAPER_TYPE, self::TYPE_THEME);
         $theme = new Gpf_Desktop_Theme();
         $wallpaperId = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::WALLPAPER, $theme->getDefaultWallpaper());
         $position = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::WALLPAPER_POSITION, $theme->getDefaultWallpaperPosition());
         $color = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue(self::BACKGROUND_COLOR, $theme->getDefaultBackgroundColor());
         $record->set(self::WALLPAPER_POSITION, $position);
         $record->set(self::BACKGROUND_COLOR, $color);
         $record->set(self::WALLPAPER_TYPE, $wallpaperType);
         if ($wallpaperType == self::TYPE_THEME) {
             $record->set("url", Gpf_Paths::getInstance()->getResourceUrl($wallpaperId, Gpf_Paths::IMAGE_DIR . Gpf_Paths::WALLPAPER_DIR));
         } else {
             if ($wallpaperType == self::TYPE_CUSTOM) {
                 $wallpaper = new Gpf_Db_Wallpaper();
                 $wallpaper->setPrimaryKeyValue($wallpaperId);
                 $wallpaper->load();
                 $record->set("fileId", $wallpaper->getFileId());
                 $record->set("url", $wallpaper->getUrl());
             }
         }
     } catch (Gpf_Exception $e) {
         $theme = new Gpf_Desktop_Theme();
         $record->set(self::WALLPAPER_POSITION, "S");
         $record->set(self::BACKGROUND_COLOR, "#000000");
         $record->set(self::WALLPAPER_TYPE, self::TYPE_NONE);
         $record->set("fileId", null);
         $record->set("url", "");
     }
     $response->addRecord($record);
     return $response;
 }
コード例 #4
0
ファイル: User.class.php プロジェクト: AmineCherrai/rostanvo
 protected function loadAuthData(Gpf_Data_Record $data)
 {
     $this->username = $data->get("username");
     $this->accountUserId = $data->get("accountuserid");
     $this->authtoken = $data->get("authtoken");
     $this->accountid = $data->get("accountid");
     $this->roletypeid = $data->get("roletypeid");
     $this->roleid = $data->get('roleid');
     $this->authId = $data->get('authid');
     $this->firstname = $data->get('firstname');
     $this->lastname = $data->get('lastname');
     $this->ip = $data->get('ip');
     $attributes = Gpf_Db_Table_UserAttributes::getInstance();
     $attributes->loadAttributes($this->accountUserId);
     $this->setLanguage($attributes->getAttributeWithDefaultValue(self::LANGUAGE_ATTRIBUTE_NAME, Gpf_Lang_Dictionary::getDefaultLanguage()));
 }
コード例 #5
0
 function init()
 {
     $this->setTable(Gpf_Db_Table_UserAttributes::getInstance());
     parent::init();
 }
コード例 #6
0
 /**
  * @return Gpf_Db_Table_UserAttributes
  */
 protected function getUserAttributes() {
     $userAttributes = Gpf_Db_Table_UserAttributes::getInstance();
     $userAttributes->loadAttributes($this->user->getAccountUserId());
     return $userAttributes;
 }
コード例 #7
0
 public function __construct() {
     $this->attribute = Gpf_Db_Table_UserAttributes::getInstance();
 }
コード例 #8
0
 protected function loadAttributes($accountUserId) {
     $attribute = Gpf_Db_Table_UserAttributes::getInstance();
     $attribute->loadAttributes($accountUserId);
     return $attribute;
 }
コード例 #9
0
    protected function sendNewSubAffSignupMail(Pap_Common_User $parentUser, Pap_Common_User $newUser) {
        $attribute = Gpf_Db_Table_UserAttributes::getInstance();
        $attribute->loadAttributes($parentUser->getAccountUserId());    	

		if (Gpf_Settings::get(Pap_Settings::AFF_NOTIFICATION_ON_SUBAFF_SIGNUP_ENABLED_SETTING_NAME) == Gpf::YES) {
            $isNotify = $attribute->getAttributeWithDefaultValue('aff_notification_on_subaff_signup',
			Gpf_Settings::get(Pap_Settings::AFF_NOTIFICATION_ON_SUBAFF_SIGNUP_DEFAULT_SETTING_NAME));
		} else {
			$isNotify = Gpf_Settings::get(Pap_Settings::AFF_NOTIFICATION_ON_SUBAFF_SIGNUP_DEFAULT_SETTING_NAME);
		}
		    	
		if ($isNotify == Gpf::YES) {
			$signupMail = new Pap_Mail_OnSubAffiliateSignup();
			$signupMail->setUser($newUser);
        	$signupMail->addRecipient($parentUser->getEmail());
			$signupMail->sendNow();
		}
    }
コード例 #10
0
    /**
     * @param String $affAttribute
     * @param String $changeableByAffSettingName
     * @param String $defaultValueSettingName
     * @return boolean
     */
    private function hasNotifyEnabled($affAttribute, $changeableByAffSettingName, $defaultValueSettingName) {    	
    	if ($this->accountSettings->get($changeableByAffSettingName) == Gpf::YES) {
            $isNotify = Gpf_Db_Table_UserAttributes::getInstance()->getAttributeWithDefaultValue($affAttribute, $this->accountSettings->get($defaultValueSettingName));
		} else {
			$isNotify = $this->accountSettings->get($defaultValueSettingName);
		}    	
        return $isNotify === Gpf::YES;
    }