コード例 #1
0
 /**
  * @service newsletter add
  * @param $fields
  */
 public function add(Gpf_Rpc_Params $params)
 {
     return parent::add($params);
 }
コード例 #2
0
    /**
     * @service campaign add
     * @return Gpf_Rpc_Form
     */
    public function add(Gpf_Rpc_Params $params) {
        $form = parent::add($params);

        if ($form->isSuccessful()) {
            $this->insertDefaultCommissionTypes();
        }
        return $form;
    }
コード例 #3
0
    /**
     * @service banners_categories write
     * @return Gpf_Rpc_Form
     */
    public function save(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        $name = $form->getFieldValue('name');
        $state = $form->getFieldValue('state');

        $node = $this->getTreeNode($form->getFieldValue('Id'));
        $node->setName($name);
        $node->setState($state);
        $node->save();
        $form = parent::save($params);
        if ($form->getErrorMessage() != '') {
            $this->categoryCode = $form->getFieldValue('Id');
            $form = parent::add($params);
        }
        return $form;
    }
コード例 #4
0
    /**
     *
     * @service affiliate_panel_settings add
     * @param $fields
     * @return Gpf_Rpc_Form
     */
    public function add(Gpf_Rpc_Params $params) {
        $form = parent::add($params);

        if ($form->isSuccessful() && $form->getFieldValue("code") == "Custom-Page") {
            try {
            	$templatePaths = Gpf_Paths::getInstance()->getTemplateSearchPaths("affiliates", "", true);
            	$fileName = $templatePaths[0] . $form->getFieldValue("templateName").".tpl";
            	$file = new Gpf_Io_File($fileName);
            	$file->open('w');
            	$file->write($form->getFieldValue("templateName").".tpl");
            	$file->close();
            } catch (Exception $e) {
                $form->setErrorMessage($e->getMessage());
                return $form;
            }
        }
        return $form;
    }
コード例 #5
0
 /**
  * @service transaction add
  * @return Gpf_Rpc_Form
  */
 public function add(Gpf_Rpc_Params $params) {
     $params = $this->processChannel($params);
     $form = new Gpf_Rpc_Form($params);
     if ($this->isMultiTierTransaction($form)) {
         try {
             return $this->processMultiTier($form);
         } catch (Gpf_Exception $e) {
             $form->setErrorMessage($e->getMessage());
             return $form;
         }
     }
     $form = parent::add($params);
     return $form;
 }
コード例 #6
0
 /**
  * @service banner add
  * @param Gpf_Rpc_Params $params
  */
 public function add(Gpf_Rpc_Params $params) {
     $this->form = new Gpf_Rpc_Form($params);
     try {
         $this->validateData();
     } catch (Gpf_Exception $e) {
         $this->form->setField(self::SUCCESS, Gpf::NO);
         $this->form->setErrorMessage($e->getMessage());
         return $this->form;
     }
     $this->form = parent::add($params);
     try {
         $this->removeRotatorFromCache($this->getBannerIdFromParams('parentbannerid', $params));
     } catch (Gpf_Exception $e) {}
     return $this->form;
 }