public function actionDeactivateQueue()
{
if (!($queue = models\Queue::model()->findByPk((int) @$_POST['id']))) {
throw new \CHttpException(404, 'Queue not found with id ' . @$_POST['id']);
}
$transaction = Yii::app()->db->beginTransaction();
try {
$this->deactivateQueue($queue);
$transaction->commit();
} catch (Exception $e) {
$transaction->rollback();
throw new \CHttpException(500, 'Could not change queue state');
}
echo 1;
}