ソースを参照

Modification d'un document : redirection vers download si document validé

refactoring
コミット
2860f40346
1個のファイルの変更5行の追加1行の削除
  1. +5
    -1
      backend/controllers/DocumentController.php

+ 5
- 1
backend/controllers/DocumentController.php ファイルの表示

@@ -111,8 +111,12 @@ class DocumentController extends BackendController
'id' => $id
]);

if(!$model) {
throw new NotFoundHttpException('Le document n\'a pas été trouvé.');
}

if ($model->isStatusValid()) {
throw new UserException('Vous ne pouvez pas modifier un document validé.');
return $this->redirect(['download', 'id' => $id]) ;
}

if ($model && $model->load(Yii::$app->request->post()) && $model->save()) {

読み込み中…
キャンセル
保存