public function actionReorderWorkflowSteps()
{
foreach ($_POST as $id => $position) {
if ($id != 'YII_CSRF_TOKEN') {
if (!($step = models\OphCiExamination_ElementSet::model()->findByPk($id))) {
throw new \Exception("Unable to find workflow step: {$id}");
}
$step->position = $position;
if (!$step->save()) {
throw new \Exception('Unable to save workflow step: ' . print_r($step->getErrors(), true));
}
}
}
echo '1';
}