Skip to content
Snippets Groups Projects
Commit 9c0d59e9 authored by efalcy's avatar efalcy
Browse files

dev #33376 : redmine script , user form refacto revert zendafi action previous modification

parent 116f53f5
Branches
Tags
8 merge requests!1553Master,!1502Master,!1501Stable,!1363Master,!1362Master,!1361Dev#33376 api redmine,!1359Dev#33376 api redmine,!1341Dev#33376 api redmine
......@@ -147,9 +147,9 @@ class ZendAfi_Controller_Action extends Zend_Controller_Action {
$this->view->titre = $this->_getEditActionTitle($model);
$this->_addModelToView($model);
if ($this->_setupFormAndSave($model)) {
$this->_helper->notify($this->_definitions->successfulSaveMessage($model));
$this->_redirectToEdit($model);
$this->_definitions->doAfterEdit($model);
}
......@@ -249,6 +249,7 @@ class ZendAfi_Controller_Action extends Zend_Controller_Action {
protected function _setupFormAndSave($model) {
$form = $this->_getForm($model);
$this->view->form = $form;
if (!$this->_request->isPost())
return false;
......@@ -269,6 +270,7 @@ class ZendAfi_Controller_Action extends Zend_Controller_Action {
}
$model->updateAttributes($post);
if ((!$form->isValidModelAndArray($model,$this->_getPost())))
return false;
......@@ -315,12 +317,10 @@ class ZendAfi_Controller_Action extends Zend_Controller_Action {
}
return $form
->populate($this->_getParams())
->populate($this->_request->getParams())
->populate($this->_getFormValues($model));
}
protected function _getParams() {
return $this->_request->getParams();
}
protected function _getFormValues($model) {
return $model->toArray();
......@@ -336,7 +336,7 @@ class ZendAfi_Controller_Action extends Zend_Controller_Action {
}
$form = $formClass::newWith(
array_merge($this->_getFormValues($model), $this->_getParams()),
array_merge($this->_getFormValues($model), $this->_request->getParams()),
$custom_form
);
$form->setAction($this->view->url());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment