CC-4312: Smart Block: Please don't save the change of title when there is any warning after click 'Save'
-done
This commit is contained in:
parent
8b5f94fa9f
commit
5effb253bf
|
@ -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;
|
||||
|
|
|
@ -19,7 +19,12 @@ if (isset($this->obj)) {
|
|||
<input id='obj_type' type='hidden' value='block'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="obj_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->obj->getName(); ?></a>
|
||||
<a id="playlist_name_display" contenteditable="true">
|
||||
<?php
|
||||
if (isset($this->unsavedName)) echo $this->unsavedName;
|
||||
else echo $this->obj->getName();
|
||||
?>
|
||||
</a>
|
||||
</h3>
|
||||
<h4 id="obj_length"><?php echo $this->length; ?></h4>
|
||||
</div>
|
||||
|
@ -30,7 +35,10 @@ if (isset($this->obj)) {
|
|||
<dl class="zend_form">
|
||||
<dt id="description-label"><label for="description">Description</label></dt>
|
||||
<dd id="description-element">
|
||||
<textarea cols="80" rows="24" id="description" name="description"><?php echo $this->obj->getDescription(); ?></textarea>
|
||||
<textarea cols="80" rows="24" id="description" name="description"><?php
|
||||
if (isset($this->unsavedDesc)) echo $this->unsavedDesc;
|
||||
else echo $this->obj->getDescription();?>
|
||||
</textarea>
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
|
Loading…
Reference in New Issue