55 $this->lng->loadLanguageModule(
'event');
56 $this->lng->loadLanguageModule(
'crs');
58 $this->course_ref_id = $a_crs_ref_id;
71 $next_class = $this->ctrl->getNextClass($this);
72 $cmd = $this->ctrl->getCmd();
79 $cmd =
"listSessions";
94 global
$ilErr,$ilAccess, $ilUser,$tree;
96 if(!$ilAccess->checkAccess(
'write',
'',$this->course_ref_id))
98 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
101 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_list.html',
'Modules/Session');
102 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
105 $this->tpl->setCurrentBlock(
"btn_cell");
106 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'exportCSV'));
107 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
'event_csv_export'));
108 $this->tpl->parseCurrentBlock();
110 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
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');
117 $members = $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";
146 for ($i = 1; $i <= count($events); $i++)
149 $headerVars[] =
"event_".$i;
150 $colWidth[] = 80/count($events).
"%";
153 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
154 $tbl->setHeaderNames($headerNames);
155 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,
'listSessions'));
156 $tbl->setColumnWidth($colWidth);
158 $tbl->setOrderColumn($_GET[
"sort_by"]);
159 $tbl->setOrderDirection($_GET[
"sort_order"]);
160 $tbl->setOffset($_GET[
"offset"]);
161 $tbl->setLimit($ilUser->getPref(
"hits_per_page"));
162 $tbl->setMaxCount(count($members));
163 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
165 $sliced_users = array_slice($members,$_GET[
'offset'],
$_SESSION[
'tbl_limit']);
166 $tbl->disable(
'sort');
170 foreach($sliced_users as $user_id)
172 foreach($events as $event_obj)
174 $this->tpl->setCurrentBlock(
"eventcols");
179 $this->tpl->setVariable(
"IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
183 $this->tpl->setVariable(
"PARTICIPATED", $event_part->hasParticipated($user_id) ?
184 $this->lng->txt(
'event_participated') :
185 $this->lng->txt(
'event_not_participated'));
188 $this->tpl->parseCurrentBlock();
191 $this->tpl->setCurrentBlock(
"tbl_content");
194 $this->tpl->setVariable(
"LASTNAME",$name[
'lastname']);
195 $this->tpl->setVariable(
"FIRSTNAME",$name[
'firstname']);
197 $this->tpl->parseCurrentBlock();
200 $this->tpl->setVariable(
"HEAD_TXT_LEGEND", $this->lng->txt(
"legend"));
201 $this->tpl->setVariable(
"HEAD_TXT_DIGIT", $this->lng->txt(
"event_digit"));
202 $this->tpl->setVariable(
"HEAD_TXT_EVENT", $this->lng->txt(
"event"));
203 $this->tpl->setVariable(
"HEAD_TXT_LOCATION", $this->lng->txt(
"event_location"));
204 $this->tpl->setVariable(
"HEAD_TXT_DATE_TIME",$this->lng->txt(
"event_date_time"));
206 foreach($events as $event_obj)
208 $this->tpl->setCurrentBlock(
"legend_loop");
209 $this->tpl->setVariable(
"LEGEND_CSS_ROW",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
210 $this->tpl->setVariable(
"LEGEND_DIGIT", $i++);
211 $this->tpl->setVariable(
"LEGEND_EVENT_TITLE", $event_obj->getTitle());
212 $this->tpl->setVariable(
"LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
213 $this->tpl->setVariable(
"LEGEND_EVENT_LOCATION", $event_obj->getLocation());
214 $this->tpl->setVariable(
"LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
215 $this->tpl->parseCurrentBlock();
229 global $tree,$ilAccess;
231 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
232 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
233 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
236 $members = $members_obj->getParticipants();
240 foreach($tree->getSubtree($tree->getNodeData($this->course_ref_id),
false,
'sess') as $event_id)
243 if(!is_object($tmp_event) or !$ilAccess->checkAccess(
'write',
'',$event_id))
247 $events[] = $tmp_event;
251 $this->csv->addColumn($this->lng->txt(
"lastname"));
252 $this->csv->addColumn($this->lng->txt(
"firstname"));
253 $this->csv->addColumn($this->lng->txt(
"login"));
255 foreach($events as $event_obj)
258 $this->csv->addColumn($event_obj->getTitle().
' ('.$event_obj->getFirstAppointment()->appointmentToString().
')');
261 $this->csv->addRow();
263 foreach($members as $user_id)
267 $this->csv->addColumn($name[
'lastname']);
268 $this->csv->addColumn($name[
'firstname']);
271 foreach($events as $event_obj)
275 $this->csv->addColumn($event_part->hasParticipated($user_id) ?
276 $this->lng->txt(
'event_participated') :
277 $this->lng->txt(
'event_not_participated'));
280 $this->csv->addRow();