| @@ 173-179 (lines=7) @@ | ||
| 170 | 'class' => SmartPerformAction::class, |
|
| 171 | 'scenario' => 'close', |
|
| 172 | 'success' => Yii::t('hipanel/ticket', 'Ticket closed'), |
|
| 173 | 'on beforeSave' => function (Event $event) { |
|
| 174 | /** @var Action $action */ |
|
| 175 | $action = $event->sender; |
|
| 176 | foreach ($action->collection->models as $model) { |
|
| 177 | $model->{'state'} = Thread::STATE_CLOSE; |
|
| 178 | } |
|
| 179 | }, |
|
| 180 | 'POST pjax' => [ |
|
| 181 | 'save' => true, |
|
| 182 | 'success' => [ |
|
| @@ 195-201 (lines=7) @@ | ||
| 192 | 'class' => SmartPerformAction::class, |
|
| 193 | 'scenario' => 'open', |
|
| 194 | 'success' => Yii::t('hipanel/ticket', 'Ticket opened'), |
|
| 195 | 'on beforeSave' => function (Event $event) { |
|
| 196 | /** @var Action $action */ |
|
| 197 | $action = $event->sender; |
|
| 198 | foreach ($action->collection->models as $model) { |
|
| 199 | $model->{'state'} = Thread::STATE_OPEN; |
|
| 200 | } |
|
| 201 | }, |
|
| 202 | 'POST pjax' => [ |
|
| 203 | 'save' => true, |
|
| 204 | 'success' => [ |
|