From 5effb253bf7adb6a2125aebf00c36049789d9fee Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 29 Aug 2012 11:38:47 -0400 Subject: [PATCH] CC-4312: Smart Block: Please don't save the change of title when there is any warning after click 'Save' -done --- .../application/controllers/PlaylistController.php | 7 ++++--- .../views/scripts/playlist/smart-block.phtml | 12 ++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index a2e55034a..d5ee2b89f 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -446,14 +446,13 @@ class PlaylistController extends Zend_Controller_Action $request = $this->getRequest(); $params = $request->getPost(); $result = array(); - - $this->setPlaylistNameDescAction(); - + if ($params['type'] == 'block') { $form = new Application_Form_SmartBlockCriteria(); $form->startForm($params['obj_id']); $bl = new Application_Model_Block($params['obj_id']); if ($form->isValid($params)) { + $this->setPlaylistNameDescAction(); $bl->saveSmartBlockCriteria($params['data']); $result['html'] = $this->createFullResponse($bl, true, true); $result['result'] = 0; @@ -461,6 +460,8 @@ class PlaylistController extends Zend_Controller_Action $this->view->obj = $bl; $this->view->id = $bl->getId(); $this->view->form = $form; + $this->view->unsavedName = $params['name']; + $this->view->unsavedDesc = $params['description']; $viewPath = 'playlist/smart-block.phtml'; $result['html'] = $this->view->render($viewPath); $result['result'] = 1; diff --git a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml index 9b43655f6..9c37dfffa 100644 --- a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml +++ b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml @@ -19,7 +19,12 @@ if (isset($this->obj)) {

- obj->getName(); ?> + + unsavedName)) echo $this->unsavedName; + else echo $this->obj->getName(); + ?> +

length; ?>

@@ -30,7 +35,10 @@ if (isset($this->obj)) {
- +