55 $this->lng->loadLanguageModule(
'event');
56 $this->lng->loadLanguageModule(
'crs');
58 $this->course_ref_id = $a_crs_ref_id;
60 $this->members_obj = $a_members;
72 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd();
80 $cmd =
"listSessions";
97 if(!$ilAccess->checkAccess(
'write',
'',$this->course_ref_id))
99 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
102 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_list.html',
'Modules/Session');
103 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
106 $this->tpl->setCurrentBlock(
"btn_cell");
107 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'exportCSV'));
108 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
'event_csv_export'));
109 $this->tpl->parseCurrentBlock();
111 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
113 $this->tpl->addBlockfile(
"EVENTS_TABLE",
"events_table",
"tpl.table.html");
114 $this->tpl->addBlockfile(
'TBL_CONTENT',
'tbl_content',
'tpl.sess_list_row.html',
'Modules/Session');
116 $members = $this->members_obj->getParticipants();
122 $tbl->setTitle($this->lng->txt(
"event_overview"),
124 $this->lng->txt(
'obj_usr'));
125 $this->ctrl->setParameter($this,
'offset',(
int)
$_GET[
'offset']);
128 foreach($tree->getSubtree($tree->getNodeData($this->course_ref_id),
false,
'sess') as $event_id)
131 if(!is_object($tmp_event) or !$ilAccess->checkAccess(
'write',
'',$event_id))
135 $events[] = $tmp_event;
138 $headerNames = array();
139 $headerVars = array();
142 $headerNames[] = $this->lng->txt(
'name');
143 $headerVars[] =
"name";
145 $headerNames[] = $this->lng->txt(
'login');
146 $headerVars[] =
"login";
149 for ($i = 1; $i <= count($events); $i++)
152 $headerVars[] =
"event_".$i;
153 $colWidth[] = 80/count($events).
"%";
156 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
157 $tbl->setHeaderNames($headerNames);
158 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,
'listSessions'));
159 $tbl->setColumnWidth($colWidth);
161 $tbl->setOrderColumn($_GET[
"sort_by"]);
162 $tbl->setOrderDirection($_GET[
"sort_order"]);
163 $tbl->setOffset($_GET[
"offset"]);
164 $tbl->setLimit($ilUser->getPref(
"hits_per_page"));
165 $tbl->setMaxCount(count($members));
166 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
168 $sliced_users = array_slice($members,$_GET[
'offset'],
$_SESSION[
'tbl_limit']);
169 $tbl->disable(
'sort');
173 foreach($sliced_users as $user_id)
175 foreach($events as $event_obj)
177 $this->tpl->setCurrentBlock(
"eventcols");
182 $this->tpl->setVariable(
"IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
186 $this->tpl->setVariable(
"PARTICIPATED", $event_part->hasParticipated($user_id) ?
187 $this->lng->txt(
'event_participated') :
188 $this->lng->txt(
'event_not_participated'));
191 $this->tpl->parseCurrentBlock();
194 $this->tpl->setCurrentBlock(
"tbl_content");
197 $this->tpl->setVariable(
"LASTNAME",$name[
'lastname']);
198 $this->tpl->setVariable(
"FIRSTNAME",$name[
'firstname']);
200 $this->tpl->parseCurrentBlock();
203 $this->tpl->setVariable(
"HEAD_TXT_LEGEND", $this->lng->txt(
"legend"));
204 $this->tpl->setVariable(
"HEAD_TXT_DIGIT", $this->lng->txt(
"event_digit"));
205 $this->tpl->setVariable(
"HEAD_TXT_EVENT", $this->lng->txt(
"event"));
206 $this->tpl->setVariable(
"HEAD_TXT_LOCATION", $this->lng->txt(
"event_location"));
207 $this->tpl->setVariable(
"HEAD_TXT_DATE_TIME",$this->lng->txt(
"event_date_time"));
209 foreach($events as $event_obj)
211 $this->tpl->setCurrentBlock(
"legend_loop");
212 $this->tpl->setVariable(
"LEGEND_CSS_ROW",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
213 $this->tpl->setVariable(
"LEGEND_DIGIT", $i++);
214 $this->tpl->setVariable(
"LEGEND_EVENT_TITLE", $event_obj->getTitle());
215 $this->tpl->setVariable(
"LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
216 $this->tpl->setVariable(
"LEGEND_EVENT_LOCATION", $event_obj->getLocation());
217 $this->tpl->setVariable(
"LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
218 $this->tpl->parseCurrentBlock();
232 global $tree,$ilAccess;
234 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
235 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
237 $members = $this->members_obj->getParticipants();
241 foreach($tree->getSubtree($tree->getNodeData($this->course_ref_id),
false,
'sess') as $event_id)
244 if(!is_object($tmp_event) or !$ilAccess->checkAccess(
'write',
'',$event_id))
248 $events[] = $tmp_event;
252 $this->csv->addColumn($this->lng->txt(
"lastname"));
253 $this->csv->addColumn($this->lng->txt(
"firstname"));
254 $this->csv->addColumn($this->lng->txt(
"login"));
256 foreach($events as $event_obj)
259 $this->csv->addColumn($event_obj->getTitle().
' ('.$event_obj->getFirstAppointment()->appointmentToString().
')');
262 $this->csv->addRow();
264 foreach($members as $user_id)
268 $this->csv->addColumn($name[
'lastname']);
269 $this->csv->addColumn($name[
'firstname']);
272 foreach($events as $event_obj)
276 $this->csv->addColumn($event_part->hasParticipated($user_id) ?
277 $this->lng->txt(
'event_participated') :
278 $this->lng->txt(
'event_not_participated'));
281 $this->csv->addRow();