114
* Updates an existing WorkgroupDocument model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
Yii::$app->user->identity->DocumentAdminExc($model->id);
$workgroup = WorkgroupController::findModel ($model-
>id_workgroup);
Yii::$app->user->identity->WorkgroupUserExc($workgroup-
>id);
$project = ProjectController::findModel($workgroup-
>id_project);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$model->UploadFile();
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
'workgroup' => $workgroup,
'project' => $project,
]);
}
}
/**
* Deletes an existing WorkgroupDocument model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id