- Tarea #1113 -> Poder dar de baja la cuenta de usuario
- Limpieza de ficheros - Cambiados ficheros de configuración para poner en el apartado de YiiMail la ruta de las plantillas de correo git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_PROFIND_Web/trunk@50 3fe1ab16-cfe0-e34b-8c9f-7d8c168d430d
This commit is contained in:
parent
932770f5b6
commit
8afe5926dc
@ -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',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.<br>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.<br>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.<br>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.<br>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.<br>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);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $model Empresa */
|
||||
/* @var $form CActiveForm */
|
||||
?>
|
||||
|
||||
<div class="form">
|
||||
|
||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||
'id'=>'empresa-form',
|
||||
'enableAjaxValidation'=>false,
|
||||
)); ?>
|
||||
|
||||
<p class="note">Fields with <span class="required">*</span> are required.</p>
|
||||
|
||||
<?php echo $form->errorSummary($model); ?>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'cif'); ?>
|
||||
<?php echo $form->textField($model,'cif',array('size'=>60,'maxlength'=>255)); ?>
|
||||
<?php echo $form->error($model,'cif'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'nombre'); ?>
|
||||
<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?>
|
||||
<?php echo $form->error($model,'nombre'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'email'); ?>
|
||||
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
|
||||
<?php echo $form->error($model,'email'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'pagina_web'); ?>
|
||||
<?php echo $form->textField($model,'pagina_web',array('size'=>60,'maxlength'=>255)); ?>
|
||||
<?php echo $form->error($model,'pagina_web'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'empleados'); ?>
|
||||
<?php echo $form->textField($model,'empleados'); ?>
|
||||
<?php echo $form->error($model,'empleados'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'direccion'); ?>
|
||||
<?php echo $form->textField($model,'direccion',array('size'=>60,'maxlength'=>255)); ?>
|
||||
<?php echo $form->error($model,'direccion'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'descripcion'); ?>
|
||||
<?php echo $form->textArea($model,'descripcion',array('rows'=>6, 'cols'=>50)); ?>
|
||||
<?php echo $form->error($model,'descripcion'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row buttons">
|
||||
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
|
||||
</div>
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
|
||||
</div><!-- form -->
|
||||
@ -1,60 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $model Empresa */
|
||||
/* @var $form CActiveForm */
|
||||
?>
|
||||
|
||||
<div class="wide form">
|
||||
|
||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||
'action'=>Yii::app()->createUrl($this->route),
|
||||
'method'=>'get',
|
||||
)); ?>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'id'); ?>
|
||||
<?php echo $form->textField($model,'id'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'cif'); ?>
|
||||
<?php echo $form->textField($model,'cif',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'nombre'); ?>
|
||||
<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'email'); ?>
|
||||
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'pagina_web'); ?>
|
||||
<?php echo $form->textField($model,'pagina_web',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'empleados'); ?>
|
||||
<?php echo $form->textField($model,'empleados'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'direccion'); ?>
|
||||
<?php echo $form->textField($model,'direccion',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'descripcion'); ?>
|
||||
<?php echo $form->textArea($model,'descripcion',array('rows'=>6, 'cols'=>50)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row buttons">
|
||||
<?php echo CHtml::submitButton('Search'); ?>
|
||||
</div>
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
|
||||
</div><!-- search-form -->
|
||||
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $data Empresa */
|
||||
?>
|
||||
|
||||
<div class="view">
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
|
||||
<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
|
||||
<br />
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('cif')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->cif); ?>
|
||||
<br />
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('nombre')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->nombre); ?>
|
||||
<br />
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('email')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->email); ?>
|
||||
<br />
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('pagina_web')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->pagina_web); ?>
|
||||
<br />
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('empleados')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->empleados); ?>
|
||||
<br />
|
||||
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('direccion')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->direccion); ?>
|
||||
<br />
|
||||
|
||||
<?php /*
|
||||
<b><?php echo CHtml::encode($data->getAttributeLabel('descripcion')); ?>:</b>
|
||||
<?php echo CHtml::encode($data->descripcion); ?>
|
||||
<br />
|
||||
|
||||
*/ ?>
|
||||
|
||||
</div>
|
||||
@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $model Empresa */
|
||||
|
||||
$this->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;
|
||||
});
|
||||
");
|
||||
?>
|
||||
|
||||
<h1>Manage Empresas</h1>
|
||||
|
||||
<p>
|
||||
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
|
||||
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
|
||||
</p>
|
||||
|
||||
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
|
||||
<div class="search-form" style="display:none">
|
||||
<?php $this->renderPartial('_search',array(
|
||||
'model'=>$model,
|
||||
)); ?>
|
||||
</div><!-- search-form -->
|
||||
|
||||
<?php $this->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',
|
||||
),
|
||||
),
|
||||
)); ?>
|
||||
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $model Empresa */
|
||||
|
||||
$this->breadcrumbs=array(
|
||||
'Empresas'=>array('index'),
|
||||
'Create',
|
||||
);
|
||||
|
||||
$this->menu=array(
|
||||
array('label'=>'List Empresa', 'url'=>array('index')),
|
||||
array('label'=>'Manage Empresa', 'url'=>array('admin')),
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>Create Empresa</h1>
|
||||
|
||||
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
|
||||
$this->breadcrumbs=array(
|
||||
'Empresa'=>array('/empresa'),
|
||||
'Delete',
|
||||
);
|
||||
?>
|
||||
<h1><?php echo $this->id . '/' . $this->action->id; ?></h1>
|
||||
|
||||
<p>
|
||||
You may change the content of this page by modifying
|
||||
the file <tt><?php echo __FILE__; ?></tt>.
|
||||
</p>
|
||||
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $dataProvider CActiveDataProvider */
|
||||
|
||||
$this->breadcrumbs=array(
|
||||
'Empresas',
|
||||
);
|
||||
|
||||
$this->menu=array(
|
||||
array('label'=>'Create Empresa', 'url'=>array('create')),
|
||||
array('label'=>'Manage Empresa', 'url'=>array('admin')),
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>Empresas</h1>
|
||||
|
||||
<?php $this->widget('zii.widgets.CListView', array(
|
||||
'dataProvider'=>$dataProvider,
|
||||
'itemView'=>'_view',
|
||||
)); ?>
|
||||
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $model Empresa */
|
||||
|
||||
$this->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')),
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>Update Empresa <?php echo $model->id; ?></h1>
|
||||
|
||||
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
|
||||
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
/* @var $this EmpresaController */
|
||||
/* @var $model Empresa */
|
||||
|
||||
$this->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')),
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>View Empresa #<?php echo $model->id; ?></h1>
|
||||
|
||||
<?php $this->widget('zii.widgets.CDetailView', array(
|
||||
'data'=>$model,
|
||||
'attributes'=>array(
|
||||
'id',
|
||||
'cif',
|
||||
'nombre',
|
||||
'email',
|
||||
'pagina_web',
|
||||
'empleados',
|
||||
'direccion',
|
||||
'descripcion',
|
||||
),
|
||||
)); ?>
|
||||
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Cancelación de cuenta en PROFIND</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Se cuenta de usuario ha sido cancelada en PROFIND</h3>
|
||||
<p>
|
||||
Se ha confirmado su solicitud de cancelación. Su cuenta <?php echo $email; ?> en PROFIND ha sido cancelada.
|
||||
</p>
|
||||
<p>No responda a este correo ya que ha sido generado automáticamente para su información.</p>
|
||||
<p>El equipo de <a href="http://www.profindtic.com/">PROFIND</a></p>
|
||||
</body>
|
||||
</html>
|
||||
17
www/protected/views/mails/solicitud_cancelacion_usuario.php
Normal file
17
www/protected/views/mails/solicitud_cancelacion_usuario.php
Normal file
@ -0,0 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Solicitud de cancelación de su cuenta en PROFIND</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Solicitud de cancelación de su cuenta en PROFIND</h3>
|
||||
<p>Ha recibido este correo en respuesta a su solicitud de cancelación de su cuenta en <a href="http://www.profindtic.com/">PROFIND</a>.</p>
|
||||
<p>Para completar el proceso de baja pulse en el siguiente enlace<br>
|
||||
<a href="<?php echo $url; ?>"><?php echo $url; ?></a>
|
||||
</p>
|
||||
<p>
|
||||
Este correo se ha enviado desde <a href="http://www.profindtic.com/">http://www.profindtic.com</a>.<br>
|
||||
No responda a este correo ya que ha sido generado automáticamente para su información.
|
||||
</p>
|
||||
<p>El equipo de <a href="http://www.profindtic.com/">PROFIND</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
/* @var $this SubscripcionController */
|
||||
|
||||
$this->breadcrumbs=array(
|
||||
'Subscripcion'=>array('/subscripcion'),
|
||||
'Update',
|
||||
);
|
||||
?>
|
||||
<h1><?php echo $this->id . '/' . $this->action->id; ?></h1>
|
||||
|
||||
<p>
|
||||
You may change the content of this page by modifying
|
||||
the file <tt><?php echo __FILE__; ?></tt>.
|
||||
</p>
|
||||
@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<label><?php echo Yii::t('intranet', 'Agentes'); ?></label>
|
||||
<?php
|
||||
echo CHtml::link(
|
||||
Yii::t('intranet', 'Nuevo agente'),
|
||||
// $this->createUrl('candidatoCapacidad/create', array('cid'=>$candidatoId)),
|
||||
array(
|
||||
'class' => 'anchorbutton button_white',
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<div class="marginleft150">
|
||||
<?php $this->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',
|
||||
),
|
||||
));
|
||||
?>
|
||||
|
||||
|
||||
<div class="marginleft150">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
?>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'email2'); ?>
|
||||
<div class="marginleft150">
|
||||
|
||||
<!--?php// echo $form->textField($model->empresa,'nombre_empresa',array('maxlength'=>255,'class'=>'mf')); ?-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -1,98 +0,0 @@
|
||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||
'id'=>'usuario-form',
|
||||
'enableAjaxValidation'=>false,
|
||||
)); ?>
|
||||
|
||||
|
||||
<div class="two_third last">
|
||||
<div class="notification msginfo">
|
||||
<a class="close"></a>
|
||||
<p>Los campos marcados con <span class="required">*</span> son obligatorios.</p>
|
||||
</div><!-- notification msginfo -->
|
||||
|
||||
<?php echo $form->errorSummary($model, "<a class='close'></a>", "", array('class'=>"notification msgerror")); ?>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
<div class="widgetbox two_third last form_default">
|
||||
<h3>
|
||||
<span>
|
||||
<legend>Datos del usuario</legend>
|
||||
</span>
|
||||
</h3>
|
||||
<div class="content nopadding">
|
||||
<div class="padding1020 ">
|
||||
<?php echo $form->labelEx($model,'nombre'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textField($model,'nombre',array('maxlength'=>255,'class'=>'mf')); ?>
|
||||
<?php echo $form->error($model,'nombre', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'apellidos'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textField($model,'apellidos',array('maxlength'=>255, 'class'=>'sf')); ?>
|
||||
<?php echo $form->error($model,'apellidos', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'email'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textField($model,'email',array('maxlength'=>255,'class'=>'mf')); ?>
|
||||
<?php echo $form->error($model,'email', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'titulo'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textField($model,'titulo',array('maxlength'=>255, 'class'=>'sf')); ?>
|
||||
<?php echo $form->error($model,'titulo', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'localidad'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textField($model,'localidad',array('maxlength'=>255, 'class'=>'sf')); ?>
|
||||
<?php echo $form->error($model,'localidad', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'telefono'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textField($model,'telefono',array('maxlength'=>255, 'class'=>'sf')); ?>
|
||||
<?php echo $form->error($model,'telefono', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding1020 borderbottom">
|
||||
<?php echo $form->labelEx($model,'descripcion'); ?>
|
||||
<div class="marginleft150">
|
||||
<?php echo $form->textArea($model,'descripcion',array('class'=>'sf')); ?>
|
||||
<?php echo $form->error($model,'descripcion', array('class'=>'errortext')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
/* $this->renderPartial('_empresa', array(
|
||||
'model'=>$model->empresa,
|
||||
'form'=>$form,
|
||||
));
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="padding1020">
|
||||
<button type="submit"><?php echo $model->isNewRecord ? 'Crear' : 'Guardar'; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--widgetbox-->
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
<div class="wide form">
|
||||
|
||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||
'action'=>Yii::app()->createUrl($this->route),
|
||||
'method'=>'get',
|
||||
)); ?>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'id'); ?>
|
||||
<?php echo $form->textField($model,'id'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'email'); ?>
|
||||
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'nombre'); ?>
|
||||
<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'apellidos'); ?>
|
||||
<?php echo $form->textField($model,'apellidos',array('size'=>60,'maxlength'=>255)); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->label($model,'last_login_time'); ?>
|
||||
<?php echo $form->textField($model,'last_login_time'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row buttons">
|
||||
<?php echo CHtml::submitButton(Yii::t('intranet', 'Search')); ?>
|
||||
</div>
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
|
||||
</div><!-- search-form -->
|
||||
@ -1,43 +0,0 @@
|
||||
<div class="invoice three_fourth last">
|
||||
<div class="invoice_inner">
|
||||
<span>[Logo here]</span>
|
||||
|
||||
<h2 class="title">Usuario</h2>
|
||||
<br clear="all" /><br />
|
||||
<div class="one_fourth">
|
||||
<strong>
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('nombre')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('apellidos')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('email')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('titulo')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('localidad')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('telefono')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('descripción')); ?>: <br />
|
||||
<?php echo CHtml::encode($data->getAttributeLabel('last_login_time')); ?>: <br />
|
||||
</strong>
|
||||
</div><!-- one_third -->
|
||||
|
||||
<div class="three_fourth last">
|
||||
<?php echo CHtml::encode($data->nombre); ?><br />
|
||||
<?php echo CHtml::encode($data->apellidos); ?><br />
|
||||
<?php echo CHtml::mailto(CHtml::encode($data->email)); ?><br/>
|
||||
<?php echo CHtml::encode($data->titulo); ?><br/>
|
||||
<?php echo CHtml::encode($data->localidad); ?><br/>
|
||||
<?php echo CHtml::encode($data->telefono); ?><br/>
|
||||
<?php echo CHtml::encode($data->descripcion); ?><br/>
|
||||
<?php echo CHtml::encode($data->last_login_time); ?>
|
||||
</div><!-- three_fourth last -->
|
||||
<br clear="all" /><br />
|
||||
|
||||
|
||||
<?php
|
||||
/* $this->renderPartial('_agentes', array(
|
||||
'model'=>$data,
|
||||
// 'form'=>$form,
|
||||
));
|
||||
*/
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
$this->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;
|
||||
});
|
||||
");
|
||||
?>
|
||||
|
||||
<h1>Manage Usuarios</h1>
|
||||
|
||||
<p>
|
||||
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
|
||||
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
|
||||
</p>
|
||||
|
||||
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
|
||||
<div class="search-form" style="display:none">
|
||||
<?php $this->renderPartial('_search',array(
|
||||
'model'=>$model,
|
||||
)); ?>
|
||||
</div><!-- search-form -->
|
||||
|
||||
<?php $this->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',
|
||||
),
|
||||
),
|
||||
)); ?>
|
||||
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
$this->breadcrumbs=array(
|
||||
Yii::t('intranet', 'Usuarios')=>array('index'),
|
||||
Yii::t('intranet', 'Nuevo usuario'),
|
||||
);
|
||||
$this->menu=array(
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Lista de usuarios" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Lista de usuarios',
|
||||
'url'=>array('index'),
|
||||
'linkOptions'=>array('class'=>'iconlink'),
|
||||
),
|
||||
);
|
||||
$this->pageTitle=Yii::t('intranet', 'Nuevo usuario');
|
||||
?>
|
||||
|
||||
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
|
||||
@ -1,135 +0,0 @@
|
||||
<?php
|
||||
$this->breadcrumbs = array(
|
||||
Yii::t('intranet', 'Sistema') => array('sistema/index'),
|
||||
Yii::t('intranet', 'Usuarios'),
|
||||
);
|
||||
|
||||
$this->menu = array(
|
||||
array(
|
||||
'label' => '<img class="mgright5" alt="' . Yii::t('intranet', 'Nuevo usuario') . '" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>' . Yii::t('intranet', 'Nuevo usuario'),
|
||||
'url' => array('create', 'tipo' => 'C'),
|
||||
'linkOptions' => array('class' => 'iconlink'),
|
||||
),
|
||||
array(
|
||||
'label' => '<img class="mgright5" alt="' . Yii::t('intranet', 'Búsqueda avanzada') . '" src="' . Yii::app()->baseUrl . '/images/icons/small/white/search.png"/>' . 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;
|
||||
});
|
||||
");
|
||||
?>
|
||||
|
||||
<div class="search-form" style="display:none">
|
||||
<?php
|
||||
$this->renderPartial('_search', array(
|
||||
'model' => $model,
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="dataTables_wrapper">
|
||||
<div class="top">
|
||||
<div class="dataTables_length">
|
||||
<?php
|
||||
/* $this->widget('application.extensions.PageSize.PageSize', array(
|
||||
'mGridId' => 'usuario-grid',
|
||||
'mPageSize' => @$_GET['pageSize'],
|
||||
'mDefPageSize' => Yii::app()->params['defaultPageSize'],
|
||||
'mPageSizeOptions' => Yii::app()->params['pageSizeOptions'],
|
||||
)); */
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="dataTables_filter">
|
||||
<label class="disabled">Buscar: <input type="text" disabled /></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$columns = array(
|
||||
array(
|
||||
'header' => 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,
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
$this->breadcrumbs=array(
|
||||
Yii::t('intranet', 'Usuarios')=>array('index'),
|
||||
Yii::t('intranet', 'Modificar usuario'),
|
||||
);
|
||||
$this->menu=array(
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Lista de usuarios" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Lista de usuarios',
|
||||
'url'=>array('index'),
|
||||
'linkOptions'=>array('class'=>'iconlink'),
|
||||
),
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Nuevo usuario" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Nuevo usuario',
|
||||
'url'=>array('create'),
|
||||
'linkOptions'=>array('class'=>'iconlink2'),
|
||||
),
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Ver usuario" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Ver usuario',
|
||||
'url'=>array('view', 'id'=>$model->id),
|
||||
'linkOptions'=>array('class'=>'iconlink2'),
|
||||
),
|
||||
);
|
||||
$this->pageTitle=Yii::t('intranet', 'Modificar usuario ') . $model->nombre . ' ' . $model->apellidos;
|
||||
?>
|
||||
|
||||
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
|
||||
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
$this->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'=>'<img class="mgright5" alt="Lista de usuarios" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Lista de usuarios',
|
||||
'url'=>array('index'),
|
||||
'linkOptions'=>array('class'=>'iconlink'),
|
||||
),
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Nuevo usuario" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Nuevo usuario',
|
||||
'url'=>array('create'),
|
||||
'linkOptions'=>array('class'=>'iconlink2'),
|
||||
),
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Modificar usuario" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Modificar usuario',
|
||||
//'url'=>array('view', 'id'=>$model->id),
|
||||
'linkOptions'=>array('class'=>'iconlink2'),
|
||||
),
|
||||
array(
|
||||
'label'=>'<img class="mgright5" alt="Eliminar usuario" src="' . Yii::app()->baseUrl . '/images/icons/small/white/user.png"/>Eliminar usuario',
|
||||
'url'=>'#',
|
||||
'linkOptions'=>array(
|
||||
'class'=>'iconlink2',
|
||||
//'submit'=>array('delete','id'=>$model->id),
|
||||
'confirm'=>'Are you sure you want to delete this item?',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->widget('zii.widgets.CListView', array(
|
||||
'dataProvider'=>$dataProvider,
|
||||
'itemView'=>'_view',
|
||||
'enablePagination'=>false,
|
||||
'summaryText'=>'',
|
||||
)); ?>
|
||||
|
||||
@ -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%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
@ -1,5 +1,21 @@
|
||||
<?php $this->pageTitle = Yii::t('profind', 'Lista de agentes'); ?>
|
||||
|
||||
<?php /*Yii::app()->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();
|
||||
});
|
||||
");*/
|
||||
?>
|
||||
|
||||
|
||||
<div class="row-fluid">
|
||||
<div id="lista-agentes" class="span8">
|
||||
<h3 class="heading"><?php echo Yii::t('profind', 'Lista de agentes'); ?></h3>
|
||||
@ -41,6 +57,7 @@
|
||||
<span class="label pull-right sl_status <?php echo ($agente->estaActivo) ? 'label-success' : ''; ?>">
|
||||
<?php echo ($agente->estaActivo) ? Yii::t('profind', 'activo') : Yii::t('profind', 'no activo'); ?>
|
||||
</span>
|
||||
|
||||
<div class="span1">
|
||||
<?php
|
||||
echo CHtml::image($agente->fotografia->getThumbnail(), $agente->nombreCompleto, array(
|
||||
@ -50,11 +67,20 @@
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<a class="sl_name" href="#"><?php echo $agente->nombreCompleto; ?></a><br>
|
||||
<a class="sl_name" href="#"><?php echo $agente->nombreCompleto; ?></a><br>
|
||||
<?php if ($agente->titulo) : ?>
|
||||
<small><?php echo $agente->titulo; ?></small><br>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<small class="s_color sl_email"><?php echo CHtml::link($agente->email, $agente->email); ?></small><br>
|
||||
|
||||
<?php echo CHtml::link(
|
||||
//CHtml::tag('i', array('class' => 'icon-trash')),
|
||||
'holaaaaa',
|
||||
array('delete', 'id' => $agente->id),
|
||||
array('class' => 'close pull-right delete')
|
||||
);
|
||||
?>
|
||||
<!-- a class="close pull-right delete" href="#"><i class="icon-trash"></i></a> -->
|
||||
<div class="clearfix"> </div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
<?php $this->pageTitle = Yii::t('profind', 'Gracias por registrarse en PROFIND'); ?>
|
||||
|
||||
<div class="message_box">
|
||||
<h3>Se cuenta de usuario ha sido cancelada en PROFIND</h3>
|
||||
<p>
|
||||
Se ha confirmado su solicitud de cancelación. Su cuenta <?php echo $email; ?> en PROFIND ha sido cancelada.
|
||||
</p>
|
||||
<p>No responda a este correo ya que ha sido generado automáticamente para su información.</p>
|
||||
<p>El equipo de <a href="http://www.profindtic.com/">PROFIND</a></p>
|
||||
</div>
|
||||
76
www/themes/profind/views/usuario/_cerrarCuenta.php
Normal file
76
www/themes/profind/views/usuario/_cerrarCuenta.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
$ajax_options = array(
|
||||
'url' => 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();
|
||||
}",
|
||||
);
|
||||
?>
|
||||
|
||||
<?php $this->beginClip('cerrarCuenta'); ?>
|
||||
|
||||
<?php Yii::app()->clientScript->registerScript('someName',
|
||||
'$("#target").click(function() {
|
||||
$("#writerating").focus();
|
||||
});'
|
||||
);
|
||||
?>
|
||||
|
||||
<div class="w-box">
|
||||
<div class="w-box-header">
|
||||
<?php echo Yii::t('profind', 'Dar de baja la cuenta'); ?>
|
||||
<div class="pull-right"><i class="icon-info-sign"></i></div>
|
||||
</div>
|
||||
<div class="w-box-content cnt_a">
|
||||
<?php echo Yii::t('profind', 'Puede solicitar dar de baja su cuenta pulsando en el botón de abajo.'); ?>
|
||||
</div>
|
||||
<div class="w-box-footer pagination-centered">
|
||||
<?php echo CHtml::link(Yii::t('profind', 'Dar de baja la cuenta'), '#', array(
|
||||
'class' => 'btn btn-small btn-danger',
|
||||
'onclick' => '$("#msj_pregunta").modal()'
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="msj_pregunta" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3><?php echo Yii::t('profind', 'Solicitud de baja de cuenta'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo Yii::t('profind', '¿Desea cancelar su cuenta en PROFIND?'); ?></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true"><?php echo Yii::t('profind', 'Volver'); ?></a>
|
||||
<?php echo CHtml::ajaxLink(
|
||||
Yii::t('profind', 'Dar de baja la cuenta'),
|
||||
$this->createUrl('delete', array('id' => $model->id)),
|
||||
$ajax_options, array(
|
||||
'class' => 'btn btn-danger',
|
||||
'data-dismiss' => 'modal'
|
||||
));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="msj_info" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3><?php echo Yii::t('profind', 'Solicitud de cancelación de su cuenta en PROFIND'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->endClip(); ?>
|
||||
@ -129,7 +129,7 @@ Yii::app()->clientScript->registerScript(
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="span3 offset1">
|
||||
<div class="span4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<?php echo $form->labelEx($model, 'ficheroFotografia', array('class' => '')); ?>
|
||||
@ -149,6 +149,7 @@ Yii::app()->clientScript->registerScript(
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php $this->renderClip('cerrarCuenta'); ?>
|
||||
</div>
|
||||
<?php $this->endWidget(); ?>
|
||||
</div>
|
||||
|
||||
@ -1,2 +1,5 @@
|
||||
<?php $this->pageTitle=Yii::t('profind', 'Modificación del perfil') . ' - ' . $model->nombre . ' ' . $model->apellidos; ?>
|
||||
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
|
||||
<?php $this->pageTitle = Yii::t('profind', 'Modificación del perfil') . ' - ' . $model->nombre . ' ' . $model->apellidos; ?>
|
||||
|
||||
<?php echo $this->renderPartial('_cerrarCuenta', array('model' => $model)); ?>
|
||||
<?php echo $this->renderPartial('_form', array('model' => $model)); ?>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user