Диплом: Автоматизация и обеспечение информационной безопасности процесса ведения документации и отчетности в компании "Гарант"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
88
page.
* If update is successful, the browser will be redirected to the 'view'
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_edit');
$folder = FolderController::findModel($model->id_folder); if
($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
'folder' => $folder,
]);
}
}
page.
/**
* Deletes an existing Document model.
* If deletion is successful, the browser will be redirected to the 'index'
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
89
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_delete');
$folder = FolderController::findModel($model->id_folder);
$model->delete();
return $this->redirect(['index', 'id_folder' => $folder->id]);
}
/**
* Finds the Document model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Document the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
public static function findModel($id)
{
exist.');
if (($model = Document::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not
}
}
}
<?php
namespace app\controllers;
use Yii;
90
use app\models\Folder;
use app\models\FolderSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
/**
* FolderController implements the CRUD actions for Folder model.
*/
class FolderController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' =>
[
'update', 'delete'],
[
'actions' => ['index', 'view', 'create',
'allow' => true,
'roles' => ['@'],
91
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Folder models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new FolderSearch();
$dataProvider = $searchModel->search(Yii::$app->request-
>queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
92
* Displays a single Folder model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_view');
return $this->render('view', [
'model' => $model,
]);
}
page.
/**
* Creates a new Folder model.
* If creation is successful, the browser will be redirected to the 'view'
* @return mixed
*/
public function actionCreate()
{
$model = new Folder();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$model->registration_date = date('Y-m-d h:i:s');
$model->id_user = Yii::$app->user->identity->id;
$model->save();
return $this->redirect(['view', 'id' => $model->id]);
} else {
93
return $this->render('create', [
'model' => $model,
]);
}
}
page.
/**
* Updates an existing Folder model.
* If update is successful, the browser will be redirected to the 'view'
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_edit');
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Folder model.
94
page.
* If deletion is successful, the browser will be redirected to the 'index'
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_delete');
$model->delete();
return $this->redirect(['index']);
}
/**
* Finds the Folder model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Folder the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
public static function findModel($id)
{
exist.');
if (($model = Folder::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not
}
}
}

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)