add ticket installment

This commit is contained in:
2016-01-22 14:45:56 +01:00
parent bb5978c1df
commit a2a6b1f240
51 changed files with 1498 additions and 113 deletions

View File

@@ -25,6 +25,7 @@ class TicketInstallmentRequestController extends Controller
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
'accept' => ['post'],
],
],
];
@@ -65,6 +66,25 @@ class TicketInstallmentRequestController extends Controller
]);
}
public function actionAccept( $id )
{
$model = $this->findModel($id);
if ( !$model->isStatusAccepted() ){
$model->applyStatus(TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL,true);
\Yii::$app->session->setFlash('success',"Megbízás teljesítve");
}
// else{
// }
// echo "asdff";
return $this->redirect(['ticket-installment-request/view',
'id' => $model->id_ticket_installment_request,
]);
}
/**
* Lists pending TicketInstallmentRequest models.
* @return mixed

View File

@@ -8,6 +8,9 @@ use backend\models\UgiroSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\components\DetStatProcessor;
use backend\models\DestaUploadForm;
use yii\web\UploadedFile;
/**
* UgiroController implements the CRUD actions for Ugiro model.
@@ -40,7 +43,25 @@ class UgiroController extends Controller
'dataProvider' => $dataProvider,
]);
}
/**
* Lists all Ugiro models.
* @return mixed
*/
public function actionItems($id)
{
$searchModel = new UgiroSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
public function actionActivate(){
}
/**
* Displays a single Ugiro model.
* @param integer $id
@@ -48,6 +69,20 @@ class UgiroController extends Controller
*/
public function actionView($id)
{
$model = $this->findModel($id);
if (Yii::$app->request->isPost) {
if ($model->status == Ugiro::$STATUS_RECIEVED){
set_time_limit(1200);//20 perc
$processor = new DetStatProcessor(
['koteg' => $model]
);
$processor->run();
}else{
\Yii::$app->session->setFlash('danger','Nem lehet futtatni a fájlt');
\Yii::error("a koteg státusza nem STATUS_RECIEVED. A koteg azonosíótja:" . $model->id_ugiro );
}
}
return $this->render('view', [
'model' => $this->findModel($id),
]);
@@ -102,6 +137,35 @@ class UgiroController extends Controller
return $this->redirect(['index']);
}
public function actionDetsta(){
$ugiro = Ugiro::findOne(31);
$model = new DetStatProcessor(
['koteg' => $ugiro]
);
return $this->render('detsta', [
'model' => $model,
]);
}
public function actionUpload(){
$model = new DestaUploadForm();
if (Yii::$app->request->isPost) {
$model->destaFile = UploadedFile::getInstance($model, 'destaFile');
if ($model->upload()) {
// file is uploaded successfully
return $this->redirect(['view', 'id' => $model->koteg->id_ugiro]);
}
}
return $this->render('upload', ['model' => $model]);
}
/**
* Finds the Ugiro model based on its primary key value.