Ejemplo n.º 1
0
 public function actionShow($id)
 {
     $project = $this->project->get($id);
     if (!$project) {
         $this->flashMessage($this->translator->translate('project.not_found'), 'warning');
         $this->redirect('Project:');
     }
     $this->template->project = $project;
     $this->template->surveys = $this->survey->getFromProject($id);
 }
Ejemplo n.º 2
0
 public function processDelete(Form $form)
 {
     $values = $form->getValues();
     $survey = $this->survey->get($values->id);
     if (!$survey) {
         $this->flashMessage($this->translator->translate('survey.not_found'), 'warning');
         $this->redirect('Project:');
     }
     $this->survey->delete($values->id);
     $this->flashMessage($this->translator->translate('survey.deleted'), 'info');
     $this->redirect('Project:show', ['id' => $survey->project]);
 }