/** * changes status for commissiontype record * * @service commission write * @param $fields * @return Gpf_Rpc_Action */ public function changeCommissionTypeStatus(Gpf_Rpc_Params $params) { $action = new Gpf_Rpc_Action($params); $action->setErrorMessage($this->_('Failed to change status')); $action->setInfoMessage($this->_('Status successfully changed')); $commType = new Pap_Db_CommissionType(); $commType->set(Pap_Db_Table_CommissionTypes::ID, $action->getParam('commtypeid')); $commType->load(); $commType->set(Pap_Db_Table_CommissionTypes::STATUS, $action->getParam('rstatus')); $commType->save(); if ($action->getParam('rstatus')==Pap_Common_Constants::ESTATUS_DISABLED) { $this->changeCommissionTypeChildsStatus($action->getParam('commtypeid'), $action->getParam('rstatus')); } $action->addOk(); return $action; }