Ejemplo n.º 1
0
 public function executeIndex(sfWebRequest $request)
 {
     /** @var Roadmap $roadmap */
     $this->roadmap = RoadmapTable::getInstance()->createQuery('r')->where('token = ?', $request->getParameter('token', false))->andWhere('active = ?', true)->fetchOne();
     $this->forward404Unless(is_object($this->roadmap));
     if ($this->roadmap->getWorkspaceMode() == 'list') {
         $this->prepareDataForListView();
     } else {
         $this->prepareDataForTimelineView();
     }
 }
Ejemplo n.º 2
0
 /**
  * @param $event
  */
 public function preInsert($event)
 {
     if (!$this->user_id) {
         $this->user_id = sfContext::getInstance()->getUser()->getGuardUser()->id;
     }
     $token = substr(md5(uniqid()), 0, 6);
     while (RoadmapTable::getInstance()->findOneBy('token', $token)) {
         $token = substr(md5(uniqid()), 0, 6);
     }
     $this->token = $token;
 }
Ejemplo n.º 3
0
 public function executeExport(sfWebRequest $request)
 {
     $roadmap = RoadmapTable::getInstance()->getRoadmapForUser($this->getUser()->getGuardUser(), $request->getParameter('id'));
     $this->forward404Unless(is_object($roadmap));
     header('Content-type: application/force-download');
     header('Content-Disposition: attachment; filename="' . $roadmap->name . '.pptx"');
     $exporter = new RoadmapPowerPointExporter();
     $exporter->setRoadmap($roadmap);
     $exporter->export();
     exit;
 }
Ejemplo n.º 4
0
 /**
  * Get all user roadmaps for top menu
  **/
 public function executeTopMenu()
 {
     $this->roadmaps = RoadmapTable::getInstance()->getForUser($this->getUser()->getGuardUser());
 }