+ // {{{ function handler_result() : show the results of the votes to a survey
+ function handler_result($page, $id = -1, $qid = 'all')
+ {
+ $id = intval($id);
+ if ($id == -1) {
+ return $this->show_error($page, "Un identifiant de sondage doit être précisé.", '');
+ }
+ require_once dirname(__FILE__).'/survey/survey.inc.php';
+ $survey = Survey::retrieveSurvey($id); // retrieves the survey object structure
+ if ($survey == null || !$survey->isValid()) {
+ return $this->show_error($page, "Sondage ".$id." introuvable.", '');
+ } elseif (!$survey->isEnded()) {
+ return $this->show_error($page, "Le sondage ".$survey->getTitle()." n'est pas encore terminé.");
+ }
+ if (!$this->check_surveyPerms($page, $survey)) {
+ return;
+ }
+ $page->assign('survey_resultmode', true);
+ $this->show_survey($page, $survey);
+ }
+ // }}}
+