?>
</h4>
                <!-- widget action, you can also use btn, btn-group, nav-tabs or nav-pills (also support dropdown). enjoy! -->
                <div class="widget-action">
                    <button data-toggle="collapse" data-collapse="#widget-correo_electronico" class="btn">
                        <i class="aweso-chevron-up color-teal" data-toggle-icon="aweso-chevron-down  aweso-chevron-up"></i>
                    </button>
                </div>
            </div><!-- /widget header -->
            <div class="widget-content form bg-white">

                <div  style='overflow:auto'> 

                    <?php 
$modelCorreos = new ContactoElectronico();
$correo = $modelCorreos->model()->activos()->de_empleado($model->id)->count();
?>
                    <div id="div-contacto-electronico-grid" style="<?php 
echo !$correo ? 'display: none;' : '';
?>
">
                        <?php 
$this->widget('ext.selgridview.BootSelGridView', array('id' => 'contacto-electronico-grid', 'type' => 'striped bordered hover advance condensed ', 'template' => '{summary}{items}{pager}', 'dataProvider' => $modelCorreos->model()->activos()->de_empleado($model->id)->search(), 'pagerCssClass' => 'pagination text-center', 'selectableRows' => 2, 'columns' => array('email', array('name' => 'principal', 'filter' => array('SI' => 'SI', 'NO' => 'NO')), array('name' => 'estado', 'filter' => array('ACTIVO' => 'ACTIVO', 'INACTIVO' => 'INACTIVO')), array('class' => 'CButtonColumn', 'template' => '{update} {delete}', 'deleteConfirmation' => CrugeTranslator::t('admin', 'Are you sure you want to delete this user'), 'buttons' => array('update' => array('label' => '<button class="btn btn-info"><i class="aweso-pencil"></i></button>', 'options' => array('title' => Yii::t('AweCrud.app', 'Update')), 'url' => '"personal/contactoElectronico/update/id/".$data->id', 'click' => 'function(e){e.preventDefault(); viewModal($(this).attr("href"),false,function() {maskAttributes();});  return false; }', 'imageUrl' => false), 'delete' => array('label' => '<button class="btn btn-danger"><i class="aweso-trash"></i></button>', 'options' => array('title' => Yii::t('AweCrud.app', 'Delete')), 'url' => 'array("contactoElectronico/delete","id"=>$data->getPrimaryKey())', 'imageUrl' => false)), 'htmlOptions' => array('width' => '80px')))));
?>
                    </div> 
                    <?php 
$this->widget('bootstrap.widgets.TbButton', array('id' => 'add-Correo', 'label' => $correo ? 'Correo Electrónico' : '<h3>Correo Electrónico</h3>', 'encodeLabel' => false, 'icon' => $correo ? 'plus-sign' : 'envelope', 'htmlOptions' => array('onClick' => 'viewModal("personal/contactoElectronico/create/idEmpleado/' . $model->id . '",false,function(){' . 'maskAttributes();})', 'class' => $correo ? '' : 'empty-portlet')));
?>


                </div>
 /**
  * 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.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id, $modelClass = __CLASS__)
 {
     $model = ContactoElectronico::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }