Exemplo n.º 1
0
 /**
  * Import information from a file
  */
 public function importAction()
 {
     $project = $this->byId(null, 'Project');
     if (!isset($_FILES['importfile']) && !isset($_FILES['importfile']['tmp_name'])) {
         throw new Exception("Import file not found");
     }
     if (!$project) {
         throw new Exception("Invalid project");
     }
     $this->projectService->importTasks($project, $_FILES['importfile']['tmp_name'], $this->_getParam('importtype'));
     $this->redirect('project', 'view', array('id' => $project->id, '#tasks'));
 }