diff --git a/www/protected/config/mode_development.php b/www/protected/config/mode_development.php index dc4facc..091e15a 100644 --- a/www/protected/config/mode_development.php +++ b/www/protected/config/mode_development.php @@ -39,6 +39,7 @@ $configSpecific = array( ), 'mail' => array( 'class' => 'application.extensions.yii-mail.YiiMail', + 'viewPath' => 'application.views.mail', 'transportType' => 'smtp', 'transportOptions' => array( 'host' => 'mail.rodax-software.com', diff --git a/www/protected/config/mode_production.php b/www/protected/config/mode_production.php index 028a620..40f3919 100644 --- a/www/protected/config/mode_production.php +++ b/www/protected/config/mode_production.php @@ -35,6 +35,7 @@ $configSpecific = array( 'mail' => array( 'class' => 'application.extensions.yii-mail.YiiMail', + 'viewPath' => 'application.views.mail', 'transportType' => 'smtp', 'transportOptions' => array( 'host' => 'smtp-04.servidoresdns.net', diff --git a/www/protected/controllers/EmpresaController.php b/www/protected/controllers/EmpresaController.php index eb05f52..e8356bd 100644 --- a/www/protected/controllers/EmpresaController.php +++ b/www/protected/controllers/EmpresaController.php @@ -2,6 +2,8 @@ class EmpresaController extends Controller { + public $defaultAction = 'modificar'; + /** * @return array action filters */ @@ -19,7 +21,7 @@ class EmpresaController extends Controller { public function accessRules() { return array( array('allow', // allow authenticated user to perform 'create' and 'update' actions - 'actions' => array('index', 'modificar'), + 'actions' => array('modificar'), 'users' => array('@'), ), array('deny', // deny all users @@ -82,13 +84,6 @@ class EmpresaController extends Controller { )); } - /** - * Lists all models. - */ - public function actionIndex() { - $this->actionModificar(Yii::app()->user->id_empresa); - } - /** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. diff --git a/www/protected/controllers/EquipoController.php b/www/protected/controllers/EquipoController.php index 7052d6b..d80e757 100644 --- a/www/protected/controllers/EquipoController.php +++ b/www/protected/controllers/EquipoController.php @@ -19,7 +19,7 @@ class EquipoController extends Controller { public function accessRules() { return array( array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions' => array('index'), + 'actions' => array('index', 'delete'), 'users' => array('@'), ), array('deny', // deny all users @@ -66,6 +66,14 @@ class EquipoController extends Controller { 'invitacion' => $invitacion, )); } + + public function actionDelete($id) { + $agente = Usuario::model()->equipo()->findByPk($id); + + // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser + if(!isset($_GET['ajax'])) + $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index')); + } /** * Envía un mail de registro a un usuario diff --git a/www/protected/controllers/RegistroUsuarioController.php b/www/protected/controllers/RegistroUsuarioController.php index 09483df..c7e8a94 100644 --- a/www/protected/controllers/RegistroUsuarioController.php +++ b/www/protected/controllers/RegistroUsuarioController.php @@ -15,7 +15,7 @@ class RegistroUsuarioController extends Controller { public function accessRules() { return array( array('allow', - 'actions' => array('registrar', 'registrarAgente', 'activar'), + 'actions' => array('registrar', 'registrarAgente', 'activar', 'cancelar'), 'users' => array('*') ), array('deny'), @@ -193,7 +193,7 @@ class RegistroUsuarioController extends Controller { } elseif (isset($usuario->clave_seguridad) && ($usuario->clave_seguridad == $clave_seguridad)) { // Hay que activar el usuario $usuario->estado = Usuario::ESTADO_ACTIVO; - $usuario->clave_seguridad = $usuario->encrypt(microtime()); + $usuario->clave_seguridad = $usuario->encrypt(microtime() . $usuario->password); $usuario->save(); $this->enviarMailConfirmacionActivacion($usuario); @@ -214,6 +214,53 @@ class RegistroUsuarioController extends Controller { } } + public function actionCancelar() { + $email = $_GET['email']; + $clave_seguridad = $_GET['key']; + + if ($email && $clave_seguridad) { + $usuario = Usuario::model()->findByAttributes(array('email' => $email)); + + // Comprobamos si se ha encontrado un usuario con ese email + if (!isset($usuario)) { + $this->render('//site/error', array( + 'titulo' => Yii::t('profind', 'Error de cancelación'), + 'mensaje' => Yii::t('profind', 'No se puede cancelar la cuenta.
La URL de cancelación es incorrecta.'), + )); + } elseif ($usuario->estado == Usuario::ESTADO_NOACTIVO) { + $this->render('//site/error', array( + 'titulo' => Yii::t('profind', 'Cuenta ya cancelada'), + 'mensaje' => Yii::t('profind', 'No se ha realizado ningún cambio.
La cuenta ya estaba cancelada.'), + )); + } elseif ($usuario->estado == Usuario::ESTADO_DENEGADO) { + $this->render('//site/error', array( + 'titulo' => Yii::t('profind', 'Cuenta bloqueada'), + 'mensaje' => Yii::t('profind', 'La cuenta ha sido bloqueada.
Contacte con el administrador del sitio para obtener más información.'), + )); + } elseif (isset($usuario->clave_seguridad) && ($usuario->clave_seguridad == $clave_seguridad)) { + // Hay que desactivar el usuario + $usuario->estado = Usuario::ESTADO_NOACTIVO; + $usuario->clave_seguridad = $usuario->encrypt(microtime() . $usuario->password); + $usuario->save(); + + $this->enviarMailConfirmacionCancelacion($usuario); + + $this->layout = '//layouts/mensaje'; + $this->render('confirmacion_cancelacion_usuario', array()); + } else { + $this->render('//site/error', array( + 'titulo' => Yii::t('profind', 'Error de cancelación'), + 'mensaje' => Yii::t('profind', 'No se puede cancelar la cuenta.
La URL de cancelación es incorrecta.'), + )); + } + } else { + $this->render('//site/error', array( + 'titulo' => Yii::t('profind', 'Error de cancelación'), + 'mensaje' => Yii::t('profind', 'No se puede cancelar la cuenta.
La URL de cancelación es incorrecta.'), + )); + } + } + /** * Envía un mail de registro a un usuario * con una URL de confirmación. @@ -259,4 +306,17 @@ class RegistroUsuarioController extends Controller { return Yii::app()->mail->send($mensaje); } + private function enviarMailConfirmacionCancelacion($usuario) { + Yii::import('ext.yii-mail.YiiMailMessage'); + + $mensaje = new YiiMailMessage; + + $mensaje->from = Yii::app()->params['email_remitente']; + $mensaje->setTo($usuario->email); + $mensaje->subject = Yii::t('profind', 'Confirmación de cancelación de su cuenta en PROFIND'); + $mensaje->view = 'confirmacion_cancelacion_usuario'; + $mensaje->setBody(array('email' => $usuario->email), 'text/html'); + + return Yii::app()->mail->send($mensaje); + } } \ No newline at end of file diff --git a/www/protected/controllers/UsuarioController.php b/www/protected/controllers/UsuarioController.php index e8de574..7b77bd8 100644 --- a/www/protected/controllers/UsuarioController.php +++ b/www/protected/controllers/UsuarioController.php @@ -21,7 +21,7 @@ class UsuarioController extends Controller { public function accessRules() { return array( array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions' => array('modificar', 'cambiarPassword', 'twitter', 'twitter2'), + 'actions' => array('modificar', 'delete'), 'users' => array('@'), ), array('deny', // deny all users @@ -83,6 +83,25 @@ class UsuarioController extends Controller { )); } + public function actionDelete($id) { + if ($id != Yii::app()->user->id) + throw new CHttpException(404, Yii::t('profind', 'La página solicitada no existe.')); + + if (Yii::app()->request->isAjaxRequest) { + $resultado = array(); + $usuario = $this->loadModel($id); + + if ($this->enviarMailSolicitudBaja($usuario)) + $resultado['status'] = 'success'; + else + $resultado['status'] = 'failure'; + + echo function_exists('json_encode') ? json_encode($resultado) : CJSON::encode($resultado); + Yii::app()->end(); + } else + $this->redirect($this->createUrl('modificar', array('id' => $id))); + } + public function loadModelwithSocialData($id, $provider) { $usuario = $this->loadModel($id); @@ -137,4 +156,25 @@ class UsuarioController extends Controller { } } + /** + * Envía un mail de registro a un usuario + * con una URL de confirmación. + * @param Usuario $usuario Usuario al que se le enviará el mail de registro + */ + private function enviarMailSolicitudBaja($usuario) { + Yii::import('ext.yii-mail.YiiMailMessage'); + + $url_cancelacion = $this->createAbsoluteUrl('registroUsuario/cancelar', array("key" => $usuario->clave_seguridad, "email" => $usuario->email)); + $mensaje = new YiiMailMessage; + + $mensaje->from = Yii::app()->params['email_remitente']; + $mensaje->setTo($usuario->email); + $mensaje->subject = Yii::t('profind', 'Solicitud de cancelación de su cuenta en PROFIND'); + $mensaje->view = 'solicitud_cancelacion_usuario'; + $mensaje->setBody(array('url' => $url_cancelacion), 'text/html'); + + return Yii::app()->mail->send($mensaje); + } + + } diff --git a/www/protected/views/empresa/_form.php b/www/protected/views/empresa/_form.php deleted file mode 100644 index f6b766c..0000000 --- a/www/protected/views/empresa/_form.php +++ /dev/null @@ -1,66 +0,0 @@ - - -
- -beginWidget('CActiveForm', array( - 'id'=>'empresa-form', - 'enableAjaxValidation'=>false, -)); ?> - -

Fields with * are required.

- - errorSummary($model); ?> - -
- labelEx($model,'cif'); ?> - textField($model,'cif',array('size'=>60,'maxlength'=>255)); ?> - error($model,'cif'); ?> -
- -
- labelEx($model,'nombre'); ?> - textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?> - error($model,'nombre'); ?> -
- -
- labelEx($model,'email'); ?> - textField($model,'email',array('size'=>60,'maxlength'=>255)); ?> - error($model,'email'); ?> -
- -
- labelEx($model,'pagina_web'); ?> - textField($model,'pagina_web',array('size'=>60,'maxlength'=>255)); ?> - error($model,'pagina_web'); ?> -
- -
- labelEx($model,'empleados'); ?> - textField($model,'empleados'); ?> - error($model,'empleados'); ?> -
- -
- labelEx($model,'direccion'); ?> - textField($model,'direccion',array('size'=>60,'maxlength'=>255)); ?> - error($model,'direccion'); ?> -
- -
- labelEx($model,'descripcion'); ?> - textArea($model,'descripcion',array('rows'=>6, 'cols'=>50)); ?> - error($model,'descripcion'); ?> -
- -
- isNewRecord ? 'Create' : 'Save'); ?> -
- -endWidget(); ?> - -
\ No newline at end of file diff --git a/www/protected/views/empresa/_search.php b/www/protected/views/empresa/_search.php deleted file mode 100644 index 157c1e2..0000000 --- a/www/protected/views/empresa/_search.php +++ /dev/null @@ -1,60 +0,0 @@ - - -
- -beginWidget('CActiveForm', array( - 'action'=>Yii::app()->createUrl($this->route), - 'method'=>'get', -)); ?> - -
- label($model,'id'); ?> - textField($model,'id'); ?> -
- -
- label($model,'cif'); ?> - textField($model,'cif',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'nombre'); ?> - textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'email'); ?> - textField($model,'email',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'pagina_web'); ?> - textField($model,'pagina_web',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'empleados'); ?> - textField($model,'empleados'); ?> -
- -
- label($model,'direccion'); ?> - textField($model,'direccion',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'descripcion'); ?> - textArea($model,'descripcion',array('rows'=>6, 'cols'=>50)); ?> -
- -
- -
- -endWidget(); ?> - -
\ No newline at end of file diff --git a/www/protected/views/empresa/_view.php b/www/protected/views/empresa/_view.php deleted file mode 100644 index 4f790b7..0000000 --- a/www/protected/views/empresa/_view.php +++ /dev/null @@ -1,43 +0,0 @@ - - -
- - getAttributeLabel('id')); ?>: - id), array('view', 'id'=>$data->id)); ?> -
- - getAttributeLabel('cif')); ?>: - cif); ?> -
- - getAttributeLabel('nombre')); ?>: - nombre); ?> -
- - getAttributeLabel('email')); ?>: - email); ?> -
- - getAttributeLabel('pagina_web')); ?>: - pagina_web); ?> -
- - getAttributeLabel('empleados')); ?>: - empleados); ?> -
- - getAttributeLabel('direccion')); ?>: - direccion); ?> -
- - getAttributeLabel('descripcion')); ?>: - descripcion); ?> -
- - */ ?> - -
\ No newline at end of file diff --git a/www/protected/views/empresa/admin.php b/www/protected/views/empresa/admin.php deleted file mode 100644 index 47b9809..0000000 --- a/www/protected/views/empresa/admin.php +++ /dev/null @@ -1,62 +0,0 @@ -breadcrumbs=array( - 'Empresas'=>array('index'), - 'Manage', -); - -$this->menu=array( - array('label'=>'List Empresa', 'url'=>array('index')), - array('label'=>'Create Empresa', 'url'=>array('create')), -); - -Yii::app()->clientScript->registerScript('search', " -$('.search-button').click(function(){ - $('.search-form').toggle(); - return false; -}); -$('.search-form form').submit(function(){ - $.fn.yiiGridView.update('empresa-grid', { - data: $(this).serialize() - }); - return false; -}); -"); -?> - -

Manage Empresas

- -

-You may optionally enter a comparison operator (<, <=, >, >=, <> -or =) at the beginning of each of your search values to specify how the comparison should be done. -

- -'search-button')); ?> - - -widget('zii.widgets.grid.CGridView', array( - 'id'=>'empresa-grid', - 'dataProvider'=>$model->search(), - 'filter'=>$model, - 'columns'=>array( - 'id', - 'cif', - 'nombre', - 'email', - 'pagina_web', - 'empleados', - /* - 'direccion', - 'descripcion', - */ - array( - 'class'=>'CButtonColumn', - ), - ), -)); ?> diff --git a/www/protected/views/empresa/create.php b/www/protected/views/empresa/create.php deleted file mode 100644 index ee79363..0000000 --- a/www/protected/views/empresa/create.php +++ /dev/null @@ -1,18 +0,0 @@ -breadcrumbs=array( - 'Empresas'=>array('index'), - 'Create', -); - -$this->menu=array( - array('label'=>'List Empresa', 'url'=>array('index')), - array('label'=>'Manage Empresa', 'url'=>array('admin')), -); -?> - -

Create Empresa

- -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/www/protected/views/empresa/delete.php b/www/protected/views/empresa/delete.php deleted file mode 100644 index 7826c08..0000000 --- a/www/protected/views/empresa/delete.php +++ /dev/null @@ -1,14 +0,0 @@ -breadcrumbs=array( - 'Empresa'=>array('/empresa'), - 'Delete', -); -?> -

id . '/' . $this->action->id; ?>

- -

- You may change the content of this page by modifying - the file . -

diff --git a/www/protected/views/empresa/index.php b/www/protected/views/empresa/index.php deleted file mode 100644 index 16784ba..0000000 --- a/www/protected/views/empresa/index.php +++ /dev/null @@ -1,20 +0,0 @@ -breadcrumbs=array( - 'Empresas', -); - -$this->menu=array( - array('label'=>'Create Empresa', 'url'=>array('create')), - array('label'=>'Manage Empresa', 'url'=>array('admin')), -); -?> - -

Empresas

- -widget('zii.widgets.CListView', array( - 'dataProvider'=>$dataProvider, - 'itemView'=>'_view', -)); ?> diff --git a/www/protected/views/empresa/update.php b/www/protected/views/empresa/update.php deleted file mode 100644 index 3f01899..0000000 --- a/www/protected/views/empresa/update.php +++ /dev/null @@ -1,21 +0,0 @@ -breadcrumbs=array( - 'Empresas'=>array('index'), - $model->id=>array('view','id'=>$model->id), - 'Update', -); - -$this->menu=array( - array('label'=>'List Empresa', 'url'=>array('index')), - array('label'=>'Create Empresa', 'url'=>array('create')), - array('label'=>'View Empresa', 'url'=>array('view', 'id'=>$model->id)), - array('label'=>'Manage Empresa', 'url'=>array('admin')), -); -?> - -

Update Empresa id; ?>

- -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/www/protected/views/empresa/view.php b/www/protected/views/empresa/view.php deleted file mode 100644 index 032d76d..0000000 --- a/www/protected/views/empresa/view.php +++ /dev/null @@ -1,33 +0,0 @@ -breadcrumbs=array( - 'Empresas'=>array('index'), - $model->id, -); - -$this->menu=array( - array('label'=>'List Empresa', 'url'=>array('index')), - array('label'=>'Create Empresa', 'url'=>array('create')), - array('label'=>'Update Empresa', 'url'=>array('update', 'id'=>$model->id)), - array('label'=>'Delete Empresa', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')), - array('label'=>'Manage Empresa', 'url'=>array('admin')), -); -?> - -

View Empresa #id; ?>

- -widget('zii.widgets.CDetailView', array( - 'data'=>$model, - 'attributes'=>array( - 'id', - 'cif', - 'nombre', - 'email', - 'pagina_web', - 'empleados', - 'direccion', - 'descripcion', - ), -)); ?> diff --git a/www/protected/views/mails/confirmacion_cancelacion_usuario.php b/www/protected/views/mails/confirmacion_cancelacion_usuario.php new file mode 100644 index 0000000..efd2744 --- /dev/null +++ b/www/protected/views/mails/confirmacion_cancelacion_usuario.php @@ -0,0 +1,13 @@ + + + Cancelación de cuenta en PROFIND + + +

Se cuenta de usuario ha sido cancelada en PROFIND

+

+ Se ha confirmado su solicitud de cancelación. Su cuenta en PROFIND ha sido cancelada. +

+

No responda a este correo ya que ha sido generado automáticamente para su información.

+

El equipo de PROFIND

+ + \ No newline at end of file diff --git a/www/protected/views/mails/solicitud_cancelacion_usuario.php b/www/protected/views/mails/solicitud_cancelacion_usuario.php new file mode 100644 index 0000000..38bad31 --- /dev/null +++ b/www/protected/views/mails/solicitud_cancelacion_usuario.php @@ -0,0 +1,17 @@ + + + Solicitud de cancelación de su cuenta en PROFIND + + +

Solicitud de cancelación de su cuenta en PROFIND

+

Ha recibido este correo en respuesta a su solicitud de cancelación de su cuenta en PROFIND.

+

Para completar el proceso de baja pulse en el siguiente enlace
+ +

+

+ Este correo se ha enviado desde http://www.profindtic.com.
+ No responda a este correo ya que ha sido generado automáticamente para su información. +

+

El equipo de PROFIND

+ + diff --git a/www/protected/views/subcripcion/update.php b/www/protected/views/subcripcion/update.php deleted file mode 100644 index c24eeab..0000000 --- a/www/protected/views/subcripcion/update.php +++ /dev/null @@ -1,14 +0,0 @@ -breadcrumbs=array( - 'Subscripcion'=>array('/subscripcion'), - 'Update', -); -?> -

id . '/' . $this->action->id; ?>

- -

- You may change the content of this page by modifying - the file . -

diff --git a/www/protected/views/usuario/_agentes.php b/www/protected/views/usuario/_agentes.php deleted file mode 100644 index 6372c8d..0000000 --- a/www/protected/views/usuario/_agentes.php +++ /dev/null @@ -1,53 +0,0 @@ - - -
- -createUrl('candidatoCapacidad/create', array('cid'=>$candidatoId)), - array( - 'class' => 'anchorbutton button_white', - ) - ); - - ?> - -
- widget('ext.multimodelform.MultiModelForm',array( - 'id' => 'id_idioma', //the unique widget id - 'addItemText' => '', // no quiero mostrar el enlace de añadir - 'removeText' => 'Eliminar', - 'removeConfirm' => '¿Desea eliminar este idioma?', - 'tableHtmlOptions' => array( - 'class' => 'sTable2', - 'width' => '100%', - ), - 'tableView' => true, -// 'formConfig' => $idiomaFormConfig, //the form configuration array -// 'model' => $model, //instance of the form model - - //if submitted not empty from the controller, - //the form will be rendered with validation errors -// 'validatedItems' => $agentesValidos, - - //array of member instances loaded from db - 'data' => $model->findAll('id_empresa=:id_empresa', array(':id_empresa'=>$model->id_empresa)), - - 'removeHtmlOptions' => array( - 'class' => 'button plain', - ), - )); - ?> - - -
- -
-
\ No newline at end of file diff --git a/www/protected/views/usuario/_empresa.php b/www/protected/views/usuario/_empresa.php deleted file mode 100644 index aea35c7..0000000 --- a/www/protected/views/usuario/_empresa.php +++ /dev/null @@ -1,16 +0,0 @@ - - -
- labelEx($model,'email2'); ?> -
- - - - - - -
- -
- diff --git a/www/protected/views/usuario/_form.php b/www/protected/views/usuario/_form.php deleted file mode 100644 index 17f65d9..0000000 --- a/www/protected/views/usuario/_form.php +++ /dev/null @@ -1,98 +0,0 @@ -beginWidget('CActiveForm', array( - 'id'=>'usuario-form', - 'enableAjaxValidation'=>false, -)); ?> - - -
-
- -

Los campos marcados con * son obligatorios.

-
- - errorSummary($model, "", "", array('class'=>"notification msgerror")); ?> -
-
- -
-

- - Datos del usuario - -

-
-
- labelEx($model,'nombre'); ?> -
- textField($model,'nombre',array('maxlength'=>255,'class'=>'mf')); ?> - error($model,'nombre', array('class'=>'errortext')); ?> -
-
- -
- labelEx($model,'apellidos'); ?> -
- textField($model,'apellidos',array('maxlength'=>255, 'class'=>'sf')); ?> - error($model,'apellidos', array('class'=>'errortext')); ?> -
-
- -
- labelEx($model,'email'); ?> -
- textField($model,'email',array('maxlength'=>255,'class'=>'mf')); ?> - error($model,'email', array('class'=>'errortext')); ?> -
-
- -
- labelEx($model,'titulo'); ?> -
- textField($model,'titulo',array('maxlength'=>255, 'class'=>'sf')); ?> - error($model,'titulo', array('class'=>'errortext')); ?> -
-
- -
- labelEx($model,'localidad'); ?> -
- textField($model,'localidad',array('maxlength'=>255, 'class'=>'sf')); ?> - error($model,'localidad', array('class'=>'errortext')); ?> -
-
- -
- labelEx($model,'telefono'); ?> -
- textField($model,'telefono',array('maxlength'=>255, 'class'=>'sf')); ?> - error($model,'telefono', array('class'=>'errortext')); ?> -
-
- -
- labelEx($model,'descripcion'); ?> -
- textArea($model,'descripcion',array('class'=>'sf')); ?> - error($model,'descripcion', array('class'=>'errortext')); ?> -
-
- - - renderPartial('_empresa', array( - 'model'=>$model->empresa, - 'form'=>$form, - )); - */ - ?> - -
- -
-
-
- -
- -endWidget(); ?> - diff --git a/www/protected/views/usuario/_search.php b/www/protected/views/usuario/_search.php deleted file mode 100644 index 87c2e03..0000000 --- a/www/protected/views/usuario/_search.php +++ /dev/null @@ -1,39 +0,0 @@ -
- -beginWidget('CActiveForm', array( - 'action'=>Yii::app()->createUrl($this->route), - 'method'=>'get', -)); ?> - -
- label($model,'id'); ?> - textField($model,'id'); ?> -
- -
- label($model,'email'); ?> - textField($model,'email',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'nombre'); ?> - textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'apellidos'); ?> - textField($model,'apellidos',array('size'=>60,'maxlength'=>255)); ?> -
- -
- label($model,'last_login_time'); ?> - textField($model,'last_login_time'); ?> -
- -
- -
- -endWidget(); ?> - -
\ No newline at end of file diff --git a/www/protected/views/usuario/_view.php b/www/protected/views/usuario/_view.php deleted file mode 100644 index 3137165..0000000 --- a/www/protected/views/usuario/_view.php +++ /dev/null @@ -1,43 +0,0 @@ -
-
- [Logo here] - -

Usuario

-

-
- - getAttributeLabel('nombre')); ?>:
- getAttributeLabel('apellidos')); ?>:
- getAttributeLabel('email')); ?>:
- getAttributeLabel('titulo')); ?>:
- getAttributeLabel('localidad')); ?>:
- getAttributeLabel('telefono')); ?>:
- getAttributeLabel('descripción')); ?>:
- getAttributeLabel('last_login_time')); ?>:
-
-
- -
- nombre); ?>
- apellidos); ?>
- email)); ?>
- titulo); ?>
- localidad); ?>
- telefono); ?>
- descripcion); ?>
- last_login_time); ?> -
-

- - - renderPartial('_agentes', array( - 'model'=>$data, -// 'form'=>$form, - )); -*/ - ?> - -
-
- diff --git a/www/protected/views/usuario/admin.php b/www/protected/views/usuario/admin.php deleted file mode 100644 index 9e647dc..0000000 --- a/www/protected/views/usuario/admin.php +++ /dev/null @@ -1,55 +0,0 @@ -breadcrumbs=array( - 'Usuarios'=>array('index'), - 'Manage', -); - -$this->menu=array( - array('label'=>'List Usuario', 'url'=>array('index')), - array('label'=>'Create Usuario', 'url'=>array('create')), -); - -Yii::app()->clientScript->registerScript('search', " -$('.search-button').click(function(){ - $('.search-form').toggle(); - return false; -}); -$('.search-form form').submit(function(){ - $.fn.yiiGridView.update('usuario-grid', { - data: $(this).serialize() - }); - return false; -}); -"); -?> - -

Manage Usuarios

- -

-You may optionally enter a comparison operator (<, <=, >, >=, <> -or =) at the beginning of each of your search values to specify how the comparison should be done. -

- -'search-button')); ?> - - -widget('zii.widgets.grid.CGridView', array( - 'id'=>'usuario-grid', - 'dataProvider'=>$model->search(), - 'filter'=>$model, - 'columns'=>array( - 'id', - 'email', - 'nombre', - 'apellidos', - 'password', - 'last_login_time', - array( - 'class'=>'CButtonColumn', - ), - ), -)); ?> diff --git a/www/protected/views/usuario/create.php b/www/protected/views/usuario/create.php deleted file mode 100644 index 832baf3..0000000 --- a/www/protected/views/usuario/create.php +++ /dev/null @@ -1,16 +0,0 @@ -breadcrumbs=array( - Yii::t('intranet', 'Usuarios')=>array('index'), - Yii::t('intranet', 'Nuevo usuario'), -); -$this->menu=array( - array( - 'label'=>'Lista de usuariosLista de usuarios', - 'url'=>array('index'), - 'linkOptions'=>array('class'=>'iconlink'), - ), -); -$this->pageTitle=Yii::t('intranet', 'Nuevo usuario'); -?> - -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/www/protected/views/usuario/index.php b/www/protected/views/usuario/index.php deleted file mode 100644 index b1baf1d..0000000 --- a/www/protected/views/usuario/index.php +++ /dev/null @@ -1,135 +0,0 @@ -breadcrumbs = array( - Yii::t('intranet', 'Sistema') => array('sistema/index'), - Yii::t('intranet', 'Usuarios'), -); - -$this->menu = array( - array( - 'label' => '' . Yii::t('intranet', 'Nuevo usuario') . '' . Yii::t('intranet', 'Nuevo usuario'), - 'url' => array('create', 'tipo' => 'C'), - 'linkOptions' => array('class' => 'iconlink'), - ), - array( - 'label' => '' . Yii::t('intranet', 'Búsqueda avanzada') . '' . Yii::t('intranet', 'Búsqueda avanzada'), - 'url' => array('#'), - 'linkOptions' => array('class' => 'iconlink search-button'), - ), -); - -/* $cs=Yii::app()->clientScript; - $cs->registerScriptFile(Yii::app()->baseUrl . '/js/star-rating/jquery.rating.pack.js', CClientScript::POS_HEAD); - $cs->registerScriptFile(Yii::app()->baseUrl . '/js/star-rating/jquery.MetaData.js', CClientScript::POS_HEAD); - $cs->registerCssFile(Yii::app()->baseUrl . '/js/star-rating/jquery.rating.css'); */ - -$this->pageTitle = Yii::t('intranet', 'Gestión de usuarios'); - -Yii::app()->clientScript->registerScript('search', " -$('.search-button').click(function(){ - $('.search-form').toggle(); - return false; -}); -$('.search-form form').submit(function(){ - $.fn.yiiGridView.update('usuario-grid', { - data: $(this).serialize() - }); - return false; -}); -"); -?> - - -
- -
-
-
- widget('application.extensions.PageSize.PageSize', array( - 'mGridId' => 'usuario-grid', - 'mPageSize' => @$_GET['pageSize'], - 'mDefPageSize' => Yii::app()->params['defaultPageSize'], - 'mPageSizeOptions' => Yii::app()->params['pageSizeOptions'], - )); */ - ?> -
- -
- -
-
- Yii::t('intranet', 'Acciones'), - 'class' => 'CButtonColumn', - 'headerHtmlOptions' => array( - 'style' => 'width:55px;', - 'class' => 'head1', - ), - 'cssClassExpression' => '"con1"', - 'template' => '{modificar}{delete}', - 'buttons' => array( - 'modificar' => array( - 'label' => 'Modificar el usuario', - 'url' => 'Yii::app()->createUrl("usuario/modificar", array("id"=>$data->id))', - ), - ), - ), - array( - 'type' => 'html', - 'name' => 'nombre', - 'value' => 'CHtml::link(CHtml::encode($data->nombre), array("update", "id"=>$data->id));', - 'headerHtmlOptions' => array( - 'class' => 'head0', - ), - 'cssClassExpression' => '"con0"', - ), - array( - 'type' => 'html', - 'name' => 'email', - 'value' => 'CHtml::mailto(CHtml::encode($data->email));', - 'headerHtmlOptions' => array( - 'class' => 'head1', - ), - 'cssClassExpression' => '"con1"', - ), - array( - 'type' => 'raw', - 'name' => 'last_login_time', - 'value' => '($data->last_login_time === NULL) ? CHtml::tag("span", array("class"=>"nodata"), "Nunca") : Time::timeAgoInWords($data->last_login_time);', - 'headerHtmlOptions' => array( - 'class' => 'head1', - ), - 'cssClassExpression' => '"con1"', - ), - ); - - $dataProvider = $model->search(); - $pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']); - $dataProvider->getPagination()->setPageSize($pageSize); - - //$this->widget('application.extensions.SelGridView', array( - $this->widget('zii.widgets.grid.CGridView', array( - 'id' => 'usuario-grid', - 'dataProvider' => $dataProvider, - 'columns' => $columns, - 'filter' => $model, - 'filterPosition' => 'footer', - 'cssFile' => Yii::app()->baseUrl . '/css/gridview2.css', - 'itemsCssClass' => 'display', - 'pagerCssClass' => 'dataTables_paginate', - 'template' => '{items}{summary}{pager}', - 'emptyText' => Yii::t('intranet', 'No hay usuarios'), - 'summaryCssClass' => 'dataTables_info', - 'summaryText' => 'Mostrando registros del {start} al {end} de {count} en total.', - 'selectableRows' => 1, - )); - ?> -
diff --git a/www/protected/views/usuario/modificar.php b/www/protected/views/usuario/modificar.php deleted file mode 100644 index a04cfa9..0000000 --- a/www/protected/views/usuario/modificar.php +++ /dev/null @@ -1,26 +0,0 @@ -breadcrumbs=array( - Yii::t('intranet', 'Usuarios')=>array('index'), - Yii::t('intranet', 'Modificar usuario'), -); -$this->menu=array( - array( - 'label'=>'Lista de usuariosLista de usuarios', - 'url'=>array('index'), - 'linkOptions'=>array('class'=>'iconlink'), - ), - array( - 'label'=>'Nuevo usuarioNuevo usuario', - 'url'=>array('create'), - 'linkOptions'=>array('class'=>'iconlink2'), - ), - array( - 'label'=>'Ver usuarioVer usuario', - 'url'=>array('view', 'id'=>$model->id), - 'linkOptions'=>array('class'=>'iconlink2'), - ), -); -$this->pageTitle=Yii::t('intranet', 'Modificar usuario ') . $model->nombre . ' ' . $model->apellidos; -?> - -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/www/protected/views/usuario/view.php b/www/protected/views/usuario/view.php deleted file mode 100644 index e44bb67..0000000 --- a/www/protected/views/usuario/view.php +++ /dev/null @@ -1,43 +0,0 @@ -breadcrumbs=array( - Yii::t('intranet', 'Usuarios')=>array('index'), - //(count($dataProvider) == 1) ? $dataProvider->name : 'Ver usuarios', - Yii::t('intranet', 'Ver usuarios'), -); - -$this->menu=array( - array( - 'label'=>'Lista de usuariosLista de usuarios', - 'url'=>array('index'), - 'linkOptions'=>array('class'=>'iconlink'), - ), - array( - 'label'=>'Nuevo usuarioNuevo usuario', - 'url'=>array('create'), - 'linkOptions'=>array('class'=>'iconlink2'), - ), - array( - 'label'=>'Modificar usuarioModificar usuario', - //'url'=>array('view', 'id'=>$model->id), - 'linkOptions'=>array('class'=>'iconlink2'), - ), - array( - 'label'=>'Eliminar usuarioEliminar usuario', - 'url'=>'#', - 'linkOptions'=>array( - 'class'=>'iconlink2', - //'submit'=>array('delete','id'=>$model->id), - 'confirm'=>'Are you sure you want to delete this item?', - ), - ), -); - -?> - -widget('zii.widgets.CListView', array( - 'dataProvider'=>$dataProvider, - 'itemView'=>'_view', - 'enablePagination'=>false, - 'summaryText'=>'', -)); ?> - diff --git a/www/themes/profind/css/profind.css b/www/themes/profind/css/profind.css index f4daaad..6efcd53 100644 --- a/www/themes/profind/css/profind.css +++ b/www/themes/profind/css/profind.css @@ -266,31 +266,6 @@ form .row-fluid + .row-fluid { padding: 3px 20px 3px 8px; position: relative; } -.modal-footer { - padding: 7px 15px 8px -} -.modal { - border: 8px solid rgba(0, 0, 0, 0.5); - -webkit-box-shadow: none; - -moz-box-shadow: none; - -ms-box-shadow: none; - box-shadow: none; -} -.modal-header { - background: #e4e4e4; - border-color: #d4d4d4; - padding: 5px 15px; -} -.modal-header .close { - margin-top: 5px -} -.modal-body { - padding: 20px 15px -} -.modal-backdrop, .modal-backdrop.fade.in { - opacity: .1; - background: #777; -} .main_content .accordion-heading .accordion-toggle { background-color: #f5f5f5; color: #222; @@ -1495,4 +1470,27 @@ label, input, button, select, textarea, select, textarea, input[type="text"], in margin-left: 0; margin-right: 2.5641%; width: 7.98291%; -} \ No newline at end of file +} + +/* Ventanas modales */ +.modal { + border: 4px solid rgba(0, 0, 0, 0.5); +} +.modal-header { + background: #e4e4e4; + border-color: #d4d4d4; + padding: 5px 15px; +} +.modal-header .close { + margin-top: 5px +} +.modal-body { + padding: 20px 15px +} +.modal-footer { + padding: 7px 15px 8px +} +.modal-backdrop, .modal-backdrop.fade.in { + opacity: .6; + background: #fff; +} diff --git a/www/themes/profind/views/equipo/index.php b/www/themes/profind/views/equipo/index.php index b98129b..4d973dc 100644 --- a/www/themes/profind/views/equipo/index.php +++ b/www/themes/profind/views/equipo/index.php @@ -1,5 +1,21 @@ pageTitle = Yii::t('profind', 'Lista de agentes'); ?> +clientScript->registerScript('ajax-link-handler', " + $('a.delete').live('click', function(event){ + $.ajax({ + 'type':'get', + 'url':$(this).attr('href') + '&ajax', + 'dataType': 'html', + 'success':function(data){ + $('#display').html(data); + } + }); + event.preventDefault(); + }); + ");*/ +?> + +

@@ -41,6 +57,7 @@ estaActivo) ? Yii::t('profind', 'activo') : Yii::t('profind', 'no activo'); ?> +
fotografia->getThumbnail(), $agente->nombreCompleto, array( @@ -50,11 +67,20 @@ ); ?>
- nombreCompleto; ?>
+ nombreCompleto; ?>
titulo) : ?> titulo; ?>
- + email, $agente->email); ?>
+ + 'icon-trash')), + 'holaaaaa', + array('delete', 'id' => $agente->id), + array('class' => 'close pull-right delete') + ); + ?> +
 
diff --git a/www/themes/profind/views/registroUsuario/confirmacion_cancelacion_usuario.php b/www/themes/profind/views/registroUsuario/confirmacion_cancelacion_usuario.php new file mode 100644 index 0000000..0c6d0b0 --- /dev/null +++ b/www/themes/profind/views/registroUsuario/confirmacion_cancelacion_usuario.php @@ -0,0 +1,10 @@ +pageTitle = Yii::t('profind', 'Gracias por registrarse en PROFIND'); ?> + +
+

Se cuenta de usuario ha sido cancelada en PROFIND

+

+ Se ha confirmado su solicitud de cancelación. Su cuenta en PROFIND ha sido cancelada. +

+

No responda a este correo ya que ha sido generado automáticamente para su información.

+

El equipo de PROFIND

+
diff --git a/www/themes/profind/views/usuario/_cerrarCuenta.php b/www/themes/profind/views/usuario/_cerrarCuenta.php new file mode 100644 index 0000000..d86a022 --- /dev/null +++ b/www/themes/profind/views/usuario/_cerrarCuenta.php @@ -0,0 +1,76 @@ + array('usuario/delete'), + //'data'=> "js:$(this).serialize()", + 'type' => 'post', + 'dataType' => 'json', + 'success' => "function(data) { + if (data.status == 'failure') + $('#msj_info p').text('Se ha producido un fallo al tramitar su solicitud de baja. Inténtelo más tarde o contacte con PROFIND.'); + else + $('#msj_info p').text('Para realizar la cancelación de su cuenta, compruebe su correo electrónico. Recibirá un mensaje que deberá confirmar.'); + $('#msj_info').modal(); + }", +); +?> + +beginClip('cerrarCuenta'); ?> + +clientScript->registerScript('someName', + '$("#target").click(function() { + $("#writerating").focus(); + });' +); +?> + +
+
+ +
+
+
+ +
+ +
+ + + + + +endClip(); ?> diff --git a/www/themes/profind/views/usuario/_form.php b/www/themes/profind/views/usuario/_form.php index c65af1b..7d2ee10 100644 --- a/www/themes/profind/views/usuario/_form.php +++ b/www/themes/profind/views/usuario/_form.php @@ -129,7 +129,7 @@ Yii::app()->clientScript->registerScript(
-
+
labelEx($model, 'ficheroFotografia', array('class' => '')); ?> @@ -149,6 +149,7 @@ Yii::app()->clientScript->registerScript(
+ renderClip('cerrarCuenta'); ?>
endWidget(); ?>
diff --git a/www/themes/profind/views/usuario/modificar.php b/www/themes/profind/views/usuario/modificar.php index eeaa044..44b9372 100644 --- a/www/themes/profind/views/usuario/modificar.php +++ b/www/themes/profind/views/usuario/modificar.php @@ -1,2 +1,5 @@ -pageTitle=Yii::t('profind', 'Modificación del perfil') . ' - ' . $model->nombre . ' ' . $model->apellidos; ?> -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file +pageTitle = Yii::t('profind', 'Modificación del perfil') . ' - ' . $model->nombre . ' ' . $model->apellidos; ?> + +renderPartial('_cerrarCuenta', array('model' => $model)); ?> +renderPartial('_form', array('model' => $model)); ?> +