From 89fd23a7f63ef369d6c6a6aacbca542e1905a7fb Mon Sep 17 00:00:00 2001 From: david Date: Mon, 30 Jul 2012 08:34:10 +0000 Subject: [PATCH] =?UTF-8?q?-=20Actualizaci=C3=B3n=20del=20estado=20de=20un?= =?UTF-8?q?=20candidato=20a=20trav=C3=A9s=20de=20una=20ventana=20modal.=20?= =?UTF-8?q?-=20Actualizaci=C3=B3n=20framework=20YII?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@72 77cfc57b-8ef4-1849-9df6-4a38aa5da120 --- .../controllers/CandidatoController.php | 2 +- .../views/candidato/_form_estado.php | 16 --------------- www/protected/views/candidato/index.php | 20 +++++++------------ 3 files changed, 8 insertions(+), 30 deletions(-) diff --git a/www/protected/controllers/CandidatoController.php b/www/protected/controllers/CandidatoController.php index 0b31382..8c53665 100644 --- a/www/protected/controllers/CandidatoController.php +++ b/www/protected/controllers/CandidatoController.php @@ -160,7 +160,7 @@ class CandidatoController extends Controller } else { Yii::app()->user->setFlash('error', Yii::t('intranet', 'Algún dato del candidato no es válido.')); } - + if (!$foundInvalidChild && $model->save() ) { $masterValues = array ('candidato_id'=>$model->id); diff --git a/www/protected/views/candidato/_form_estado.php b/www/protected/views/candidato/_form_estado.php index 6dadf67..8ca3f27 100644 --- a/www/protected/views/candidato/_form_estado.php +++ b/www/protected/views/candidato/_form_estado.php @@ -23,22 +23,6 @@ echo $form->dropDownList( ?>
- $model->id)), - array( - "data"=>array("id"=>$model->id), - "success"=>"function(data){ - if (data.status == \"failure\") { - alert(\"mal\"); - } else { - alert(\"bien\"); - } - }" - ) -);*/ -?> endWidget(); ?> diff --git a/www/protected/views/candidato/index.php b/www/protected/views/candidato/index.php index d6d6ba5..c58ec49 100644 --- a/www/protected/views/candidato/index.php +++ b/www/protected/views/candidato/index.php @@ -37,12 +37,10 @@ $('.search-form form').submit(function(){ $updateJS = CHtml::ajax( array( 'url' => "js:url", 'data' => "js:form.serialize()", - 'type' => 'post', - 'dataType' => 'json', - 'success' => "function( data ) - { + 'type' => "post", + 'dataType' => "json", + 'success' => "function( data ) { if( data.status == 'failure' ) { - jQuery.blur(div.grid-view); setTimeout( \"jQuery( '#dlg-updateestado' ).dialog( 'close' );\", 1000 ); } else { if( data.status == 'success' ) // Update all grid views on success @@ -66,7 +64,6 @@ function updateEstado( url ) if(!url) { //action = '&action=' + act; url = form.attr( 'action' ); - console.log('url => ' + url); } {$updateJS} }"); @@ -172,13 +169,10 @@ $this->endWidget('zii.widgets.jui.CJuiDialog'); CHtml::encode($data->estado), array("candidato/updateEstado"), array( - "data"=>array("id"=>$data->id), - "success"=>"function(data){ - if (data.status == \"failure\") { - } else { - jQuery(\"#dlg-updateestado\").html(data); - jQuery(\"#dlg-updateestado\").dialog(\"open\"); - } + "data" => array("id" => $data->id), + "success" => "function(data){ + jQuery(\"#dlg-updateestado\").html(data); + jQuery(\"#dlg-updateestado\").dialog(\"open\"); }", ), array(