beginning of displaying form errors, need to keep working on this.
This commit is contained in:
parent
b2828d466d
commit
dbe160c5d9
3 changed files with 19 additions and 2 deletions
|
@ -164,6 +164,13 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->createPlayedItem($params);
|
||||
|
||||
if (isset($json["form"])) {
|
||||
$this->view->form = $json["form"];
|
||||
$json["form"] = $this->view->render('playouthistory/dialog.phtml');
|
||||
|
||||
unset($this->view->form);
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson($json);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
@ -214,6 +221,13 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->editPlayedItem($params);
|
||||
|
||||
if (isset($json["form"])) {
|
||||
$this->view->form = $json["form"];
|
||||
$json["form"] = $this->view->render('playouthistory/dialog.phtml');
|
||||
|
||||
unset($this->view->form);
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson($json);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
|
|
@ -719,6 +719,7 @@ class Application_Service_HistoryService
|
|||
$msgs = $form->getMessages();
|
||||
Logging::info($msgs);
|
||||
|
||||
$json["form"] = $form;
|
||||
$json["error"] = $msgs;
|
||||
}
|
||||
|
||||
|
@ -756,6 +757,7 @@ class Application_Service_HistoryService
|
|||
$msgs = $form->getMessages();
|
||||
Logging::info($msgs);
|
||||
|
||||
$json["form"] = $form;
|
||||
$json["error"] = $msgs;
|
||||
}
|
||||
|
||||
|
|
|
@ -460,8 +460,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$.post(url, data, function(json) {
|
||||
|
||||
//TODO put errors on form.
|
||||
if (json.error !== undefined) {
|
||||
|
||||
if (json.form !== undefined) {
|
||||
var $newForm = $(json.form);
|
||||
$hisDialogEl.html($newForm.html());
|
||||
}
|
||||
else {
|
||||
removeHistoryDialog();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue