Redes sociales para usuario y empresa -> Twitter y LinkedIn
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_PROFIND_Web/trunk@38 3fe1ab16-cfe0-e34b-8c9f-7d8c168d430d
This commit is contained in:
parent
02f2b779be
commit
5753c6c14e
@ -1,5 +1,5 @@
|
||||
RewriteEngine on
|
||||
RewriteBase /usuarios/
|
||||
RewriteBase /profind/
|
||||
|
||||
# if a directory or a file exists, use it directly
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
|
||||
@ -23,29 +23,6 @@ $configSpecific = array(
|
||||
'class' => 'system.gii.GiiModule',
|
||||
'password' => 'password',
|
||||
),
|
||||
'socialConnect' => array(
|
||||
'callbackUrl' => 'site/callback',
|
||||
'debug_mode' => true,
|
||||
'debug_file' => 'socialconnect.log',
|
||||
'providers' => array(
|
||||
'facebook' => array(
|
||||
'enabled' => true,
|
||||
'keys' => array('id' => '', 'secret' => ''),
|
||||
'scope' => 'email,publish_stream',
|
||||
),
|
||||
'twitter' => array(
|
||||
'enabled' => true,
|
||||
'keys' => array(
|
||||
'key' => '0aBDNeQOFTPMxHb7TMjHlA',
|
||||
'secret' => 'qjVCKdLjRngBUpGnbPw3NXRiIK1BdJWYCnHhZ4pClXk'
|
||||
)
|
||||
),
|
||||
'linkedin' => array(
|
||||
'enabled' => true,
|
||||
'keys' => array('key' => '', 'secret' => '')
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
// Application components
|
||||
@ -75,7 +52,7 @@ $configSpecific = array(
|
||||
'socialConnect' => array(
|
||||
'class' => 'application.extensions.yii-socialconnect.YiiSocialConnect',
|
||||
'callbackUrl' => 'site/callback',
|
||||
'debug_mode' => true,
|
||||
'debug_mode' => false,
|
||||
'debug_file' => dirname(__FILE__) . '/../runtime/socialconnect.log',
|
||||
'providers' => array(
|
||||
'Facebook' => array(
|
||||
@ -90,9 +67,12 @@ $configSpecific = array(
|
||||
'secret' => 'qjVCKdLjRngBUpGnbPw3NXRiIK1BdJWYCnHhZ4pClXk'
|
||||
)
|
||||
),
|
||||
'Linkedin' => array(
|
||||
'LinkedIn' => array(
|
||||
'enabled' => true,
|
||||
'keys' => array('key' => '', 'secret' => '')
|
||||
'keys' => array(
|
||||
'key' => 'zgiloy0zgkcw',
|
||||
'secret' => 'x0WGj5CvjDlWsLC9'
|
||||
)
|
||||
),
|
||||
)
|
||||
),
|
||||
|
||||
@ -32,26 +32,39 @@ class EmpresaController extends Controller {
|
||||
* Updates a particular model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id the ID of the model to be updated
|
||||
* @param string $provider
|
||||
*/
|
||||
public function actionModificar($id) {
|
||||
public function actionModificar($id, $provider = '') {
|
||||
if ($id != Yii::app()->user->id_empresa)
|
||||
throw new CHttpException(404, Yii::t('profind', 'La página solicitada no existe.'));
|
||||
|
||||
$model = $this->loadModel($id);
|
||||
if (($provider != '') && (!isset($_POST['Empresa']))) {
|
||||
switch ($provider) {
|
||||
case 'Twitter':
|
||||
case 'Facebook':
|
||||
case 'LinkedIn':
|
||||
$empresa = $this->loadModelwithSocialData($id, $provider);
|
||||
break;
|
||||
default:
|
||||
throw new CHttpException(404, Yii::t('profind', 'La página solicitada no existe.'));
|
||||
}
|
||||
}
|
||||
else
|
||||
$empresa = $this->loadModel($id);
|
||||
|
||||
// Uncomment the following line if AJAX validation is needed
|
||||
// $this->performAjaxValidation($model);
|
||||
|
||||
if (isset($_POST['Empresa'])) {
|
||||
$model->attributes = $_POST['Empresa'];
|
||||
if ($model->save()) {
|
||||
$empresa->attributes = $_POST['Empresa'];
|
||||
if ($empresa->save()) {
|
||||
Yii::app()->user->setFlash('success', Yii::t('profind', 'Se ha actualizado los datos de la empresa'));
|
||||
$this->redirect(array('modificar', 'id' => $model->id));
|
||||
$this->redirect(array('modificar', 'id' => $empresa->id));
|
||||
}
|
||||
}
|
||||
|
||||
$this->render('modificar', array(
|
||||
'model' => $model,
|
||||
'model' => $empresa,
|
||||
));
|
||||
}
|
||||
|
||||
@ -74,6 +87,38 @@ class EmpresaController extends Controller {
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function loadModelwithSocialData($id, $provider) {
|
||||
$empresa = $this->loadModel($id);
|
||||
|
||||
if (!Yii::app()->socialConnect->loadUserProfile($provider)) {
|
||||
throw new CHttpException(
|
||||
Yii::app()->socialConnect->errorCode,
|
||||
Yii::t('profind', Yii::app()->socialConnect->errorMessage)
|
||||
);
|
||||
}
|
||||
|
||||
$profile = Yii::app()->socialConnect->userProfile;
|
||||
|
||||
Yii::log(CVarDumper::dumpAsString($profile));
|
||||
|
||||
$empresa->nombre = $profile->displayName;
|
||||
$empresa->pagina_web = $profile->webSiteURL;
|
||||
$empresa->email = $profile->email;
|
||||
$empresa->descripcion = $profile->description;
|
||||
|
||||
switch ($provider) {
|
||||
case 'Twitter':
|
||||
$empresa->direccion = $profile->region;
|
||||
break;
|
||||
case 'Facebook':
|
||||
case 'LinkedIn':
|
||||
$empresa->direccion = $profile->city;
|
||||
break;
|
||||
}
|
||||
|
||||
return $empresa;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the AJAX validation.
|
||||
* @param CModel the model to be validated
|
||||
|
||||
@ -41,16 +41,16 @@ class UsuarioController extends Controller {
|
||||
|
||||
if (($provider != '') && (!isset($_POST['Usuario']))) {
|
||||
switch ($provider) {
|
||||
case 'twitter':
|
||||
case 'facebook':
|
||||
case 'linkedin':
|
||||
case 'Twitter':
|
||||
case 'Facebook':
|
||||
case 'LinkedIn':
|
||||
$usuario = $this->loadModelwithSocialData($id, $provider);
|
||||
break;
|
||||
default:
|
||||
throw new CHttpException(404, Yii::t('profind', 'La página solicitada no existe.'));
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
$usuario = $this->loadModel($id);
|
||||
|
||||
// Uncomment the following line if AJAX validation is needed
|
||||
@ -80,15 +80,31 @@ class UsuarioController extends Controller {
|
||||
|
||||
public function loadModelwithSocialData($id, $provider) {
|
||||
$usuario = $this->loadModel($id);
|
||||
|
||||
$profile = Yii::app()->socialConnect->getUserProfile($provider);
|
||||
|
||||
if ($twitter) {
|
||||
$usuario->email = $twitter['email'];
|
||||
$usuario->nombre = $twitter['displayName'];
|
||||
$usuario->apellidos = $twitter['displayName'];
|
||||
$usuario->descripcion = $twitter['photoURL'];
|
||||
|
||||
if (!Yii::app()->socialConnect->loadUserProfile($provider)) {
|
||||
throw new CHttpException(
|
||||
Yii::app()->socialConnect->errorCode,
|
||||
Yii::t('profind', Yii::app()->socialConnect->errorMessage)
|
||||
);
|
||||
}
|
||||
|
||||
$profile = Yii::app()->socialConnect->userProfile;
|
||||
|
||||
//$usuario->email = $profile->email; <-- el email no lo cambio
|
||||
$usuario->nombre = $profile->firstName;
|
||||
$usuario->apellidos = $profile->lastName;
|
||||
$usuario->descripcion = $profile->description;
|
||||
|
||||
switch ($provider) {
|
||||
case 'Twitter':
|
||||
$usuario->localidad = $profile->region;
|
||||
break;
|
||||
case 'Facebook':
|
||||
case 'LinkedIn':
|
||||
$usuario->localidad = $profile->city;
|
||||
break;
|
||||
}
|
||||
|
||||
return $usuario;
|
||||
}
|
||||
|
||||
|
||||
@ -38,18 +38,18 @@ class YiiSocialConnect extends CApplicationComponent {
|
||||
* @var integer código de error. Si hay algún error, el código de error será distinto de 0.
|
||||
*/
|
||||
public $errorCode = self::ERROR_UNSPECIFIED;
|
||||
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
public $userProfile = NULL;
|
||||
|
||||
|
||||
/**
|
||||
* Inicialización del componente
|
||||
*/
|
||||
public function init() {
|
||||
$this->registerScripts();
|
||||
parent::init();
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,14 +72,16 @@ class YiiSocialConnect extends CApplicationComponent {
|
||||
* @return array configuración
|
||||
*/
|
||||
public function getConfig() {
|
||||
|
||||
return array(
|
||||
$config = array(
|
||||
'baseUrl' => Yii::app()->getBaseUrl(true),
|
||||
'base_url' => Yii::app()->createAbsoluteUrl($this->callbackUrl), // URL for Hybrid_Auth callback
|
||||
'providers' => $this->providers,
|
||||
'debug_file' => $this->debug_file,
|
||||
'debug_mode' => $this->debug_mode,
|
||||
);
|
||||
if ($this->debug_mode) {
|
||||
$config['debug_file'] = $this->debug_file;
|
||||
$config['debug_mode'] = $this->debug_mode;
|
||||
}
|
||||
return $config;
|
||||
}
|
||||
|
||||
public function callback() {
|
||||
@ -139,10 +141,10 @@ class YiiSocialConnect extends CApplicationComponent {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->errorCode)
|
||||
Yii::log($this->getErrorMessage(), CLogger::LEVEL_ERROR);
|
||||
|
||||
|
||||
return !$this->errorCode;
|
||||
}
|
||||
|
||||
@ -183,6 +185,7 @@ class YiiSocialConnect extends CApplicationComponent {
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
64
www/protected/extensions/yii-socialconnect/vendors/CHANGELOG
vendored
Normal file
64
www/protected/extensions/yii-socialconnect/vendors/CHANGELOG
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
Hybridauth Change log
|
||||
=====================
|
||||
|
||||
2.1.0 - 04 aug 2012
|
||||
Yahoo! provider adapter is now based on OAuth1 protocol (by Lukasz Koprowski)
|
||||
Windows Live provider adapter is now based on OAuth2 protocol (by Lukasz Koprowski)
|
||||
Yahoo! and Google openid based are now part of the "additional providers package"
|
||||
Add proxy config for providers API (by fedetorre)
|
||||
Fix Hybrid_Providers_Google::getUserContacts()
|
||||
Fix Twitter user's profile url
|
||||
Fix the user profile url on Hybrid_Providers_Facebook::getUserActivity()
|
||||
...
|
||||
|
||||
|
||||
|
||||
2.0.11 - 25 jan 2012
|
||||
Fix a bug with Twitter update status
|
||||
Add a way to specify adapters and wrappers from config
|
||||
Added emailVerified property to profile object.
|
||||
Added ability to pass display type to Facebook SDK.
|
||||
Refactored endpoind
|
||||
Add user contacts list for Google Hybrid_Providers_Google::getUserContacts()
|
||||
Add Hybrid_Auth::getProviders() to return array listing all enabled providers as well as a flag if you are connected.
|
||||
|
||||
|
||||
|
||||
2.0.10 - 05 dec 2011
|
||||
Fix a bug with Facebook update status setUserStatus()
|
||||
Fix a bug with linkedin get contacts list getUserContacts()
|
||||
Fix refresh token issue with oauth2 client
|
||||
Remove https://www.googleapis.com/auth/plus.me from the default Google scope
|
||||
Fix an issue with openid identifier verification
|
||||
Fix an issue where a user cancel the auth it will persist for some providers
|
||||
Another numbers of bug fixes and improvments
|
||||
|
||||
|
||||
|
||||
2.0.9 - 24 nov 2011
|
||||
Move Google to work with OAuth 2 protocol.
|
||||
Get back Foursquare and AOL to library core as supported networks
|
||||
Add 2 new examples "Sign-in/Sign-up Users" and "Basic Facebook integration"
|
||||
Fix a bug with linkedin update status setUserStatus()
|
||||
|
||||
|
||||
|
||||
2.0.8 - 18 nov 2011
|
||||
Add an auto insaller to make life a bit easier.
|
||||
Change the configuration file name from hybridauth.php to config.php
|
||||
Setting facebook scope from the configuration, now override the default requested scope
|
||||
Fix a bug with twitter update status setUserStatus()
|
||||
Fix a bug with logoutAllProviders()
|
||||
Hubrid_Auth_Activity::$date return now a timestamp across supproted social networks
|
||||
Introduce the refresh_token as its needed for some providers
|
||||
fixed some minor issues and improved bunch of other stuff
|
||||
Thanks for KVC, RB Lin and danhstevens!
|
||||
|
||||
|
||||
|
||||
2.0.7 - 12 oct 2011
|
||||
Add some generic functions: Hybrid_Provider_Adapter::getUserContacts(), Hybrid_Provider_Adapter::setUserStatus() and Hybrid_Provider_Adapter::getUserActivity() to Facebook, MySpace, Twitter, Identica and LinkedIn.
|
||||
Add a generic function to logout all connected provider at once Hybrid_Auth::logoutAllProviders()
|
||||
Correct a bug with Hybrid_Auth::getCurrentUrl()
|
||||
Split HybridAuth into 2 packages. i) a core library which come with 8 major providers by default, ii) the others one which containt some additional providers
|
||||
fixed some minors issues and improved some stuff and whatnot
|
||||
@ -14,7 +14,7 @@
|
||||
*/
|
||||
class Hybrid_Auth
|
||||
{
|
||||
public static $version = "2.1.0";
|
||||
public static $version = "2.1.0-dev";
|
||||
|
||||
public static $config = array();
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ class Hybrid_Logger
|
||||
// if debug mode is set to true, then check for the writable log file
|
||||
if ( Hybrid_Auth::$config["debug_mode"] ){
|
||||
if ( ! file_exists( Hybrid_Auth::$config["debug_file"] ) ){
|
||||
throw new Exception( "'debug_mode' is set to 'true', but no log file path 'debug_file' given.", 1 );
|
||||
throw new Exception( "'debug_mode' is set to 'true', but the file " . Hybrid_Auth::$config['debug_file'] . " in 'debug_file' does not exit.", 1 );
|
||||
}
|
||||
|
||||
if ( ! is_writable( Hybrid_Auth::$config["debug_file"] ) ){
|
||||
|
||||
@ -26,7 +26,7 @@ class Hybrid_Providers_Facebook extends Hybrid_Provider_Model
|
||||
throw new Exception( "Your application id and secret are required in order to connect to {$this->providerId}.", 4 );
|
||||
}
|
||||
|
||||
if ( ! class_exists('FacebookApiException') ) {
|
||||
if ( ! class_exists('FacebookApiException', false) ) {
|
||||
require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/base_facebook.php";
|
||||
require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/facebook.php";
|
||||
}
|
||||
|
||||
@ -89,8 +89,8 @@ class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model
|
||||
function getUserProfile()
|
||||
{
|
||||
try{
|
||||
// http://developer.linkedin.com/docs/DOC-1061
|
||||
$response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,email-address,date-of-birth,phone-numbers,summary)');
|
||||
// http://developer.linkedin.com/docs/DOC-1061
|
||||
$response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,email-address,main-address,date-of-birth,phone-numbers,summary)');
|
||||
}
|
||||
catch( LinkedInException $e ){
|
||||
throw new Exception( "User profile request failed! {$this->providerId} returned an error: $e", 6 );
|
||||
@ -103,6 +103,8 @@ class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model
|
||||
throw new Exception( "User profile request failed! {$this->providerId} returned an invalide xml data.", 6 );
|
||||
}
|
||||
|
||||
Yii::log(CVarDumper::dumpAsString($data));
|
||||
|
||||
$this->user->profile->identifier = (string) $data->{'id'};
|
||||
$this->user->profile->firstName = (string) $data->{'first-name'};
|
||||
$this->user->profile->lastName = (string) $data->{'last-name'};
|
||||
@ -115,7 +117,9 @@ class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model
|
||||
$this->user->profile->profileURL = (string) $data->{'public-profile-url'};
|
||||
$this->user->profile->description = (string) $data->{'summary'};
|
||||
|
||||
$this->user->profile->phone = (string) $data->{'phone-numbers'}->{'phone-number'}->{'phone-number'};
|
||||
$this->user->profile->phone = (string) $data->{'phone-numbers'};
|
||||
|
||||
$this->user->webSiteURL = (string) $data->{'main-address'};
|
||||
|
||||
if( $data->{'date-of-birth'} ) {
|
||||
$this->user->profile->birthDay = (string) $data->{'date-of-birth'}->day;
|
||||
|
||||
@ -25,7 +25,7 @@ return
|
||||
|
||||
"Yahoo" => array (
|
||||
"enabled" => #YAHOO_ADAPTER_STATUS#,
|
||||
"keys" => array ( "id" => "#YAHOO_APPLICATION_KEY#", "secret" => "#YAHOO_APPLICATION_SECRET#" )
|
||||
"keys" => array ( "key" => "#YAHOO_APPLICATION_KEY#", "secret" => "#YAHOO_APPLICATION_SECRET#" )
|
||||
),
|
||||
|
||||
"Google" => array (
|
||||
|
||||
@ -78,7 +78,7 @@ class OAuth1Client{
|
||||
if ( $callback ) {
|
||||
$this->redirect_uri = $parameters['oauth_callback'] = $callback;
|
||||
}
|
||||
|
||||
|
||||
$request = $this->signedRequest( $this->request_token_url, $this->request_token_method, $parameters );
|
||||
$token = OAuthUtil::parse_parameters( $request );
|
||||
$this->token = new OAuthConsumer( $token['oauth_token'], $token['oauth_token_secret'] );
|
||||
|
||||
@ -67,7 +67,6 @@ class UsuarioFotografia {
|
||||
* Guarda una fotografía subida por el usuario
|
||||
* return CUploadedFile fichero subido
|
||||
*/
|
||||
|
||||
public function guardarFotografia($fichero) {
|
||||
if (!$this->usuario)
|
||||
throw new CException(Yii::t('profind', 'Usuario no asignado.'));
|
||||
@ -84,7 +83,6 @@ class UsuarioFotografia {
|
||||
* Elimina la fotografía del usuario
|
||||
* return bool
|
||||
*/
|
||||
|
||||
public function eliminarFotografia() {
|
||||
if (!$this->usuario)
|
||||
throw new CException(Yii::t('profind', 'Usuario no asignado.'));
|
||||
|
||||
@ -1,6 +1,16 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<h3 class="heading"><?php echo Yii::t('profind', 'Empresa'); ?></h3>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<p>Recoger datos desde la red:
|
||||
<?php echo CHtml::link('LinkedIn', Yii::app()->createUrl('empresa/modificar', array('id' => $model->id, 'provider' => 'LinkedIn'))); ?>,
|
||||
Facebook,
|
||||
<?php echo CHtml::link('Twitter', Yii::app()->createUrl('empresa/modificar', array('id' => $model->id, 'provider' => 'Twitter'))); ?>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<?php if($model->hasErrors()) { ?>
|
||||
@ -54,7 +64,7 @@
|
||||
<div class="control-group formSep">
|
||||
<?php echo $form->labelEx($model, 'direccion', array('class' => 'control-label')); ?>
|
||||
<div class="controls">
|
||||
<?php echo $form->textField($model, 'direccion', array('class' => 'input-xlarge')); ?>
|
||||
<?php echo $form->textArea($model, 'direccion', array('class' => 'input-xlarge')); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group formSep">
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<?php
|
||||
$form = $this->beginWidget('CActiveForm', array(
|
||||
'id' => 'invitacion-agente-form',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableAjaxValidation' => false,
|
||||
'htmlOptions' => array(
|
||||
'class' => ''
|
||||
),
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
<!-- Chosen CSS -->
|
||||
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/lib/chosen/chosen.css" />
|
||||
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/bootstrap/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/bootstrap/css/bootstrap-responsive.min.css" />
|
||||
@ -20,7 +20,7 @@
|
||||
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/profind.css" />
|
||||
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/media.css" />
|
||||
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/azul.css" />
|
||||
|
||||
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
@ -49,35 +49,48 @@
|
||||
<nav>
|
||||
<div class="nav-collapse">
|
||||
<?php
|
||||
$itemsMenu = array();
|
||||
|
||||
// Perfil
|
||||
$itemsMenu[] = array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-file icon-white'), '') . ' ' . Yii::t('profind', 'Perfil del agente'),
|
||||
'url' => array('/usuario/modificar', 'id' => Yii::app()->user->id),
|
||||
'linkOptions' => array(),
|
||||
);
|
||||
|
||||
// Empresa
|
||||
if (Yii::app()->user->esCoordinador)
|
||||
$itemsMenu[] = array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-briefcase icon-white'), '') . ' ' . Yii::t('profind', 'Empresa'),
|
||||
'url' => array('/empresa/modificar', 'id' => Yii::app()->user->id_empresa),
|
||||
'linkOptions' => array(),
|
||||
);
|
||||
|
||||
// Producto
|
||||
if (Yii::app()->user->esCoordinador)
|
||||
$itemsMenu[] = array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-tag icon-white'), '') . ' ' . Yii::t('profind', 'Producto'),
|
||||
'url' => array('/subscripcion/modificar', 'id' => Yii::app()->user->subscripcion->id),
|
||||
'linkOptions' => array(),
|
||||
);
|
||||
|
||||
// Equipo
|
||||
if ((Yii::app()->user->esCoordinador) && (Yii::app()->user->tieneEquipo))
|
||||
$itemsMenu[] = array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-user icon-white'), '') . ' ' . Yii::t('profind', 'Equipo'),
|
||||
'url' => array('/equipo/index'),
|
||||
'linkOptions' => array('class' => 'icon_block contacto'),
|
||||
);
|
||||
|
||||
|
||||
|
||||
$this->widget('zii.widgets.CMenu', array(
|
||||
'activeCssClass' => 'active',
|
||||
'encodeLabel' => false,
|
||||
'htmlOptions' => array(
|
||||
'class' => 'nav',
|
||||
),
|
||||
'items' => array(
|
||||
array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-file icon-white'), '') . ' ' . Yii::t('profind', 'Perfil del agente'),
|
||||
'url' => array('/usuario/modificar', 'id' => Yii::app()->user->id),
|
||||
'linkOptions' => array(),
|
||||
),
|
||||
array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-briefcase icon-white'), '') . ' ' . Yii::t('profind', 'Empresa'),
|
||||
'url' => array('/empresa/modificar', 'id' => Yii::app()->user->id_empresa),
|
||||
'linkOptions' => array(),
|
||||
),
|
||||
array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-tag icon-white'), '') . ' ' . Yii::t('profind', 'Producto'),
|
||||
'url' => array('/subcripcion/modificar', 'id' => Yii::app()->user->id),
|
||||
'linkOptions' => array(),
|
||||
),
|
||||
|
||||
/*array(
|
||||
'label' => CHtml::tag('i', array('class' => 'icon-user icon-white'), '') . ' ' . Yii::t('profind', 'Equipo'),
|
||||
'url' => array('/equipo/index'),
|
||||
'linkOptions' => array('class' => 'icon_block contacto'),
|
||||
),*/
|
||||
),
|
||||
'items' => $itemsMenu,
|
||||
));
|
||||
?>
|
||||
|
||||
|
||||
@ -28,6 +28,16 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<h3 class="heading"><?php echo Yii::t('profind', 'Perfil del agente'); ?></h3>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<p>Recoger datos desde la red:
|
||||
<?php echo CHtml::link('LinkedIn', Yii::app()->createUrl('usuario/modificar', array('id' => $model->id, 'provider' => 'LinkedIn'))); ?>,
|
||||
Facebook,
|
||||
<?php echo CHtml::link('Twitter', Yii::app()->createUrl('usuario/modificar', array('id' => $model->id, 'provider' => 'Twitter'))); ?>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<?php if ($model->hasErrors()) { ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user