/**
  * Create Image Timeline for Dashboard
  *
  * @return image
  */
 function timelineDashboardAction()
 {
     // workaround for unit tests 'Action Helper by name Layout not found'
     if ($this->_helper->hasHelper('layout')) {
         $this->_helper->layout->disableLayout();
         // disable layouts
     }
     // http://localhost/webacula/chart/timeline/datetimeline/2010-01-08
     // check GD lib (php-gd)
     if (!extension_loaded('gd')) {
         // No GD lib (php-gd) found
         $this->view->result = null;
         return;
     }
     $timeline = new Timeline();
     $img = $timeline->createTimelineImage(date('Y-m-d', time()), true, $this->view->translate, 'small');
     // Set the headers
     $this->getResponse()->setHeader('Content-Type', 'image/png');
     // Output a PNG image to either the browser or a file :
     // bool imagepng ( resource image [, string filename [, int quality [, int filters]]] )
     $res = imagepng($img, null, 5);
 }
Beispiel #2
0
 function timelineDashboardAction()
 {
     if ($this->_helper->hasHelper('layout')) {
         $this->_helper->layout->setLayout('dashboard');
     }
     if (!extension_loaded('gd')) {
         // No GD lib (php-gd) found
         $this->view->result = null;
         $this->_helper->viewRenderer->setNoRender();
         return;
     }
     $datetimeline = date('Y-m-d', time());
     $this->view->title = $this->view->translate->_("Timeline for date") . " " . $datetimeline;
     $timeline = new Timeline();
     $this->view->img_map = $timeline->createTimelineImage($datetimeline, false, null, 'small');
     $this->view->show_job_description = Zend_Registry::get('show_job_description');
     if (empty($this->view->img_map)) {
         $this->_helper->viewRenderer->setNoRender();
     } else {
         $this->_helper->viewRenderer->setResponseSegment('job_timeline');
     }
 }