4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
22 $this->
setId(
"ilobjpollusr");
26 $this->
addColumn($lng->txt(
"login"),
"login");
27 $this->
addColumn($lng->txt(
"lastname"),
"lastname");
28 $this->
addColumn($lng->txt(
"firstname"),
"firstname");
32 $this->answer_ids[] = $answer[
"id"];
33 $this->
addColumn($answer[
"answer"],
"answer".$answer[
"id"]);
38 $this->
setTitle($this->lng->txt(
"poll_question").
": \"".
41 $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
49 protected function getItems(array $a_answer_ids)
53 foreach($this->
getParentObject()->object->getVotesByUsers() as $user_id => $vote)
55 $answers = $vote[
"answers"];
56 unset($vote[
"answers"]);
58 foreach($a_answer_ids as $answer_id)
60 $vote[
"answer".$answer_id] = in_array($answer_id, $answers);
71 $this->tpl->setCurrentBlock(
"answer_bl");
72 foreach($this->answer_ids as $answer_id)
74 if($a_set[
"answer".$answer_id])
80 $this->tpl->setVariable(
"ANSWER",
" ");
82 $this->tpl->parseCurrentBlock();
85 $this->tpl->setVariable(
"LOGIN", $a_set[
"login"]);
86 $this->tpl->setVariable(
"FIRSTNAME", $a_set[
"firstname"]);
87 $this->tpl->setVariable(
"LASTNAME", $a_set[
"lastname"]);
92 $a_csv->addColumn($a_set[
"login"]);
93 $a_csv->addColumn($a_set[
"lastname"]);
94 $a_csv->addColumn($a_set[
"firstname"]);
95 foreach($this->answer_ids as $answer_id)
97 if($a_set[
"answer".$answer_id])
99 $a_csv->addColumn(
true);
103 $a_csv->addColumn(
false);
111 $a_worksheet->write($a_row, 0, $a_set[
"login"]);
112 $a_worksheet->write($a_row, 1, $a_set[
"lastname"]);
113 $a_worksheet->write($a_row, 2, $a_set[
"firstname"]);
115 foreach($this->answer_ids as $answer_id)
117 if($a_set[
"answer".$answer_id])
119 $a_worksheet->write($a_row, ++$col,
true);
123 $a_worksheet->write($a_row, ++$col,
false);