public function actionAddAgreementRelation($relationModuleId, $portletId, $uniqueLayoutId, $id, $relationModelId, $relationAttributeName, $redirect) { $agmntProduct = AgreementProduct::GetById(intval($id)); $agmnt = Agreement::GetById(intval($relationModelId)); if ($agmntProduct->agreement != $agmnt) { $agmntProduct->agreement = $agmnt; $agmntProduct->save(); } if ((bool) $redirect) { $isViewLocked = ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView'); $redirectUrl = Yii::app()->createUrl('/' . $relationModuleId . '/default/details', array('id' => $relationModelId)); $this->redirect(array('/' . $relationModuleId . '/defaultPortlet/modalRefresh', 'portletId' => $portletId, 'uniqueLayoutId' => $uniqueLayoutId, 'redirectUrl' => $redirectUrl, 'portletParams' => array('relationModuleId' => $relationModuleId, 'relationModelId' => $relationModelId), 'portletsAreRemovable' => !$isViewLocked)); } }
public function actionDelete($id) { $agmnt = Agreement::GetById(intval($id)); $agmnt->delete(); $this->redirect(array($this->getId() . '/index')); }