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
|
@ -163,6 +163,13 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
|
|
||||||
$historyService = new Application_Service_HistoryService();
|
$historyService = new Application_Service_HistoryService();
|
||||||
$json = $historyService->createPlayedItem($params);
|
$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);
|
$this->_helper->json->sendJson($json);
|
||||||
}
|
}
|
||||||
|
@ -213,6 +220,13 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
|
|
||||||
$historyService = new Application_Service_HistoryService();
|
$historyService = new Application_Service_HistoryService();
|
||||||
$json = $historyService->editPlayedItem($params);
|
$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);
|
$this->_helper->json->sendJson($json);
|
||||||
}
|
}
|
||||||
|
|
|
@ -719,6 +719,7 @@ class Application_Service_HistoryService
|
||||||
$msgs = $form->getMessages();
|
$msgs = $form->getMessages();
|
||||||
Logging::info($msgs);
|
Logging::info($msgs);
|
||||||
|
|
||||||
|
$json["form"] = $form;
|
||||||
$json["error"] = $msgs;
|
$json["error"] = $msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,6 +757,7 @@ class Application_Service_HistoryService
|
||||||
$msgs = $form->getMessages();
|
$msgs = $form->getMessages();
|
||||||
Logging::info($msgs);
|
Logging::info($msgs);
|
||||||
|
|
||||||
|
$json["form"] = $form;
|
||||||
$json["error"] = $msgs;
|
$json["error"] = $msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -460,8 +460,9 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
$.post(url, data, function(json) {
|
$.post(url, data, function(json) {
|
||||||
|
|
||||||
//TODO put errors on form.
|
//TODO put errors on form.
|
||||||
if (json.error !== undefined) {
|
if (json.form !== undefined) {
|
||||||
|
var $newForm = $(json.form);
|
||||||
|
$hisDialogEl.html($newForm.html());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
removeHistoryDialog();
|
removeHistoryDialog();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue