| @@ 291-303 (lines=13) @@ | ||
| 288 | * @param $id |
|
| 289 | * @return \yii\web\Response |
|
| 290 | */ |
|
| 291 | public function actionPriorityUp($id) |
|
| 292 | { |
|
| 293 | $options[$id] = ['id' => $id, 'priority' => 'high']; |
|
| 294 | if ($this->_ticketChange($options)) { |
|
| 295 | Yii::$app->getSession()->setFlash('success', |
|
| 296 | Yii::t('hipanel:ticket', 'Priority has been changed to high')); |
|
| 297 | } else { |
|
| 298 | Yii::$app->getSession()->setFlash('error', |
|
| 299 | Yii::t('hipanel:ticket', 'Some error occurred! Priority has not been changed to high')); |
|
| 300 | } |
|
| 301 | ||
| 302 | return $this->redirect(Yii::$app->request->referrer); |
|
| 303 | } |
|
| 304 | ||
| 305 | /** |
|
| 306 | * @param $id |
|
| @@ 309-320 (lines=12) @@ | ||
| 306 | * @param $id |
|
| 307 | * @return \yii\web\Response |
|
| 308 | */ |
|
| 309 | public function actionPriorityDown($id) |
|
| 310 | { |
|
| 311 | $options[$id] = ['id' => $id, 'priority' => 'medium']; |
|
| 312 | if ($this->_ticketChange($options)) { |
|
| 313 | Yii::$app->getSession()->setFlash('success', |
|
| 314 | Yii::t('hipanel:ticket', 'Priority has been changed to medium')); |
|
| 315 | } else { |
|
| 316 | Yii::$app->getSession()->setFlash('error', Yii::t('hipanel:ticket', 'Something goes wrong!')); |
|
| 317 | } |
|
| 318 | ||
| 319 | return $this->redirect(Yii::$app->request->referrer); |
|
| 320 | } |
|
| 321 | ||
| 322 | /** |
|
| 323 | * Numerous ticket changes in one method, like BladeRoot did :). |
|