/**
  * 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 $id the ID of the model to be loaded
  * @return Prospectos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Prospectos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 2
0
}
?>

<h1><?php 
echo $titulo;
?>
</h1>

<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' => 'seguimiento-comercial-prospectos-grid', 'dataProvider' => $model->search(), 'afterAjaxUpdate' => 'reinstallDatePickerSeguimiento', 'filter' => $model, 'columns' => array(array('header' => 'ID.', 'name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('width' => '20')), array('header' => 'Fecha de acción', 'name' => 'fecha_seguimiento', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha_seguimiento', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '2014:2025'), 'htmlOptions' => array('id' => 'datepicker_for_fecha_seguimiento', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha_seguimiento\']);', 'htmlOptions' => array('width' => '80')), array('header' => 'Prospecto', 'name' => 'prospecto_id', 'filter' => CHtml::listData(Prospectos::model()->findAll(), 'id', 'nombreCompleto'), 'value' => '$data->prospecto->nombreCompleto', 'htmlOptions' => array('width' => '220')), array('header' => 'Tema', 'name' => 'tema_id', 'filter' => CHtml::listData(TemaSeguimiento::model()->findAll(), 'id', 'tema'), 'value' => '$data[\'tema\'][\'tema\']'), array('header' => 'Observaciones', 'name' => 'comentario', 'value' => '$data->comentario'), array('header' => 'Responsable de Seguimiento', 'name' => 'responsable_id', 'filter' => CHtml::listData(Empleados::model()->findAll(), 'id', 'nombreCompleto'), 'value' => '$data[\'responsable\'][\'nombreCompleto\']'), 'usuario_id', 'ultimo_seguimiento')));
?>

<?php 
Yii::app()->clientScript->registerScript('re-install-date-picker', "\n\tfunction reinstallDatePickerSeguimiento(id, data) {\n\t        //use the same parameters that you had set in your widget else the datepicker will be refreshed by default\n\t    \$('#datepicker_for_fecha_seguimiento').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n\t    //\$('#datepicker_for_fecha_seguimiento').datepicker(\$.datepicker.regional[ 'es' ]);\n\t  //\$('#datepicker_for_fecha_seguimiento').datepicker({dateFormat: 'dd-mm-yy'});\n\t}\n\t");
?>

<script>
    $(document).ready(function()
    {
        $('body').on('dblclick', '#seguimiento-comercial-prospectos-grid tbody tr', function(event)
        {
            var
                rowNum = $(this).index(),
                keys = $('#seguimiento-comercial-prospectos-grid > div.keys > span'),
                rowId = keys.eq(rowNum).text();