Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Calendario terminado sin estilos

  • Loading branch information...
commit 08f4dc0e158680c58eadff79792c75b50aa37f27 1 parent c62c4d7
@AlexandrosV AlexandrosV authored
View
16 protected/modules/crmColaboracion/controllers/CalendarioController.php
@@ -19,7 +19,11 @@ public function actionIndex()
//formato fecha universal Ymd
$fechaGet = "$anio-$mes-$dia";
$llamadas = $this->getAllLlamadas($fechaGet);
+ $reuniones = $this->getAllReuniones($fechaGet);
+ $tareas = $this->getAllTareas($fechaGet);
$eventos['llamadas'][$dia] = $llamadas->getData();
+ $eventos['reuniones'][$dia] = $reuniones->getData();
+ $eventos['tareas'][$dia] = $tareas->getData();
}
$this->renderPartial('index',array(
@@ -35,6 +39,18 @@ private function getAllLlamadas($fecha)
$llamadas = Llamada::model()->getAllLlamadas($fecha);
return $llamadas;
}
+
+ private function getAllReuniones($fecha)
+ {
+ $reuniones = Reunion::model()->getAllReuniones($fecha);
+ return $reuniones;
+ }
+
+ private function getAllTareas($fecha)
+ {
+ $tareas = Tarea::model()->getAllTareas($fecha);
+ return $tareas;
+ }
// Uncomment the following methods and override them if needed
/*
View
11 protected/modules/crmColaboracion/models/Reunion.php
@@ -128,4 +128,15 @@ public function search()
'criteria'=>$criteria,
));
}
+
+ public static function getAllReuniones($fecha)
+ {
+ $criteria=new CDbCriteria;
+ $criteria->addCondition("fecha_inicio <= '$fecha'");
+ $criteria->addCondition("fecha_fin >= '$fecha'");
+
+ return new CActiveDataProvider(Reunion::model(), array(
+ 'criteria'=>$criteria,
+ ));
+ }
}
View
11 protected/modules/crmColaboracion/models/Tarea.php
@@ -122,4 +122,15 @@ public function search()
'criteria'=>$criteria,
));
}
+
+ public static function getAllTareas($fecha)
+ {
+ $criteria=new CDbCriteria;
+ $criteria->addCondition("fecha_inicio <= '$fecha'");
+ $criteria->addCondition("fecha_fin >= '$fecha'");
+
+ return new CActiveDataProvider(Tarea::model(), array(
+ 'criteria'=>$criteria,
+ ));
+ }
}
View
21 protected/modules/crmColaboracion/views/calendario/index.php
@@ -111,7 +111,26 @@
foreach($eventos['llamadas'][$day_num] as $row)
{
- echo '<p><a onclick="sendPage(\'null\', \''.Yii::app()->request->baseUrl.'/index.php/crmColaboracion/llamada/view/id/'.$row->id.'\', \'colaboracion\');">'.$row->asunto.'</a></p>';
+ echo '<p><a onclick="sendPage(\'null\', \''.Yii::app()->request->baseUrl.'/index.php/crmColaboracion/llamada/view/id/'.$row->id.'\', \'colaboracion\');">LLamada: '.$row->asunto.'</a></p>';
+ }
+ }
+ //imprimir reuniones
+
+ if(!is_null($eventos['reuniones'][$day_num]))
+ {
+ foreach($eventos['reuniones'][$day_num] as $row)
+ {
+
+ echo '<p><a onclick="sendPage(\'null\', \''.Yii::app()->request->baseUrl.'/index.php/crmColaboracion/reunion/view/id/'.$row->id.'\', \'colaboracion\');">Reunion: '.$row->asunto.'</a></p>';
+ }
+ }
+ //imprimir tareas
+ if(!is_null($eventos['tareas'][$day_num]))
+ {
+ foreach($eventos['tareas'][$day_num] as $row)
+ {
+
+ echo '<p><a onclick="sendPage(\'null\', \''.Yii::app()->request->baseUrl.'/index.php/crmColaboracion/tarea/view/id/'.$row->id.'\', \'colaboracion\');">Tarea: '.$row->nombre_tarea.'</a></p>';
}
}
echo '</td>';
Please sign in to comment.
Something went wrong with that request. Please try again.