| @@ 266-278 (lines=13) @@ | ||
| 263 | * @param $id |
|
| 264 | * @return \yii\web\Response |
|
| 265 | */ |
|
| 266 | public function actionPriorityUp($id) |
|
| 267 | { |
|
| 268 | $options[$id] = ['id' => $id, 'priority' => 'high']; |
|
| 269 | if ($this->_ticketChange($options)) { |
|
| 270 | Yii::$app->getSession()->setFlash('success', |
|
| 271 | Yii::t('hipanel:ticket', 'Priority has been changed to high')); |
|
| 272 | } else { |
|
| 273 | Yii::$app->getSession()->setFlash('error', |
|
| 274 | Yii::t('hipanel:ticket', 'Some error occurred! Priority has not been changed to high')); |
|
| 275 | } |
|
| 276 | ||
| 277 | return $this->redirect(Yii::$app->request->referrer); |
|
| 278 | } |
|
| 279 | ||
| 280 | /** |
|
| 281 | * @param $id |
|
| @@ 284-295 (lines=12) @@ | ||
| 281 | * @param $id |
|
| 282 | * @return \yii\web\Response |
|
| 283 | */ |
|
| 284 | public function actionPriorityDown($id) |
|
| 285 | { |
|
| 286 | $options[$id] = ['id' => $id, 'priority' => 'medium']; |
|
| 287 | if ($this->_ticketChange($options)) { |
|
| 288 | Yii::$app->getSession()->setFlash('success', |
|
| 289 | Yii::t('hipanel:ticket', 'Priority has been changed to medium')); |
|
| 290 | } else { |
|
| 291 | Yii::$app->getSession()->setFlash('error', Yii::t('hipanel:ticket', 'Something goes wrong!')); |
|
| 292 | } |
|
| 293 | ||
| 294 | return $this->redirect(Yii::$app->request->referrer); |
|
| 295 | } |
|
| 296 | ||
| 297 | /** |
|
| 298 | * Numerous ticket changes in one method, like BladeRoot did :). |
|