public function edit() { if (!$this->permissions['mod']) { $this->render('invalid', array('message' => $this->_getMessage('no permission'), 'back_url' => 'index.php?r=alms/communication/show')); return; } //Course info $id_course = Get::req('id_course', DOTY_INT, 0); $id_edition = Get::req('id_edition', DOTY_INT, 0); $model = new EditionAlms($id_course, $id_edition); $edition_info = $model->getEditionInfo($id_edition); if (isset($_POST['undo'])) { Util::jump_to('index.php?r=' . $this->base_link_edition . '/show&id_course=' . $model->getIdCourse()); } elseif (isset($_POST['mod'])) { if ($model->modEdition()) { Util::jump_to('index.php?r=' . $this->base_link_edition . '/show&id_course=' . $model->getIdCourse() . '&result=ok'); } Util::jump_to('index.php?r=' . $this->base_link_edition . '/show&id_course=' . $model->getIdCourse() . '&result=err_mod'); } else { $this->render('edit', array('model' => $model, 'edition_info' => $edition_info, 'base_link_course' => $this->base_link_course, 'base_link_edition' => $this->base_link_edition)); } }