/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate($issueId) { $model = new Opendocs(); $model->issueId = $issueId; $model->userId = Yii::app()->user->id; $model->createTime = new CDbExpression('GETDATE()'); $model->save(); }
public function actionunlockIssue($id) { $opened = Opendocs::model()->find("issueId={$id}"); if ($opened->delete()) { //crea otro opendoc $model = new Opendocs(); $model->issueId = $id; $model->userId = Yii::app()->user->id; $model->createTime = new CDbExpression('GETDATE()'); $model->save(); //carga issue $issue = $this->loadIssue($id); $traveler = $issue->traveler; $issueId = $id; /* $this->render('update', array( 'model' => $issue, 'traveler' => $issue->traveler, 'issueId' => $issueId, )); */ $this->render('opened', array('issueId' => $issueId)); } }