Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addhoras() {
- if (!empty($this->data)) {
- $this->Linea->create();
- if ($this->Linea->save($this->data)) {
- //$this->Session->setFlash(__('The linea has been saved', true));
- $this->redirect(array('action' => 'index'));
- } else {
- $this->Session->setFlash(__('The linea could not be saved. Please, try again.', true));
- }
- }
- $this->Linea->recursive = 2;
- $proyectos = $this->Linea->Tarea->find('all',array(
- 'conditions' => array(
- 'Tarea.usuario_id'=>$this->Session->Read('Usuario_id')
- )));
- $hitos = $this->Linea->Hito->find('all');
- $tareas = $this->Linea->Tarea->find('all');
- //$ultimos = $this->Linea->find('all', array('conditions' => array('Linea.fecha >= DATE_SUB(CURDATE(), INTERVAL 5 DAY)')));
- $ultimos = $this->Linea->find('all', array(
- 'conditions' => array('OR' => array(
- 'Linea.usuario_id'=>$this->Session->read('Usuario_id')
- )),
- 'order' => 'Linea.fecha DESC',
- 'limit' => '5'
- ));
- $this->set(compact('proyectos', 'tareas','hitos','ultimos'));
- //$this->set('proyectos','tareas');//, 'hitos', 'tareas', 'usuarios'));
- $this->paginate = array(
- 'Linea' => array(
- 'limit'=>'30',
- 'conditions' => array(
- 'Tarea.usuario_id'=>$this->Session->read('Usuario_id')),
- 'order'=>'Linea.fecha',
- 'group'=>array('Linea.proyecto_id','Linea.tarea_id')
- )
- );
- $this->set('lineas',$this->paginate());
- }
Advertisement
Add Comment
Please, Sign In to add comment