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();
121 $tbl->setTitle($this->lng->txt(
"event_overview"),
123 $this->lng->txt(
'obj_usr'));
124 $this->ctrl->setParameter($this,
'offset',(
int)
$_GET[
'offset']);
127 foreach($tree->getSubtree($tree->getNodeData($this->course_ref_id),
false,
'sess') as $event_id)
130 if(!is_object($tmp_event) or !$ilAccess->checkAccess(
'write',
'',$event_id))
134 $events[] = $tmp_event;
137 $headerNames = array();
138 $headerVars = array();
141 $headerNames[] = $this->lng->txt(
'name');
142 $headerVars[] =
"name";
145 for ($i = 1; $i <= count($events); $i++)
148 $headerVars[] =
"event_".$i;
149 $colWidth[] = 80/count($events).
"%";
152 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
153 $tbl->setHeaderNames($headerNames);
154 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,
'listSessions'));
155 $tbl->setColumnWidth($colWidth);
157 $tbl->setOrderColumn($_GET[
"sort_by"]);
158 $tbl->setOrderDirection($_GET[
"sort_order"]);
159 $tbl->setOffset($_GET[
"offset"]);
160 $tbl->setLimit($ilUser->getPref(
"hits_per_page"));
161 $tbl->setMaxCount(count($members));
162 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
164 $sliced_users = array_slice($members,$_GET[
'offset'],
$_SESSION[
'tbl_limit']);
165 $tbl->disable(
'sort');
169 foreach($sliced_users as $user_id)
171 foreach($events as $event_obj)
173 $this->tpl->setCurrentBlock(
"eventcols");
178 $this->tpl->setVariable(
"IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
180 ilUtil::getImagePath(
'icon_not_ok.png'));
182 $this->tpl->setVariable(
"PARTICIPATED", $event_part->hasParticipated($user_id) ?
183 $this->lng->txt(
'event_participated') :
184 $this->lng->txt(
'event_not_participated'));
187 $this->tpl->parseCurrentBlock();
190 $this->tpl->setCurrentBlock(
"tbl_content");
193 $this->tpl->setVariable(
"LASTNAME",$name[
'lastname']);
194 $this->tpl->setVariable(
"FIRSTNAME",$name[
'firstname']);
196 $this->tpl->parseCurrentBlock();
199 $this->tpl->setVariable(
"HEAD_TXT_LEGEND", $this->lng->txt(
"legend"));
200 $this->tpl->setVariable(
"HEAD_TXT_DIGIT", $this->lng->txt(
"event_digit"));
201 $this->tpl->setVariable(
"HEAD_TXT_EVENT", $this->lng->txt(
"event"));
202 $this->tpl->setVariable(
"HEAD_TXT_LOCATION", $this->lng->txt(
"event_location"));
203 $this->tpl->setVariable(
"HEAD_TXT_DATE_TIME",$this->lng->txt(
"event_date_time"));
205 foreach($events as $event_obj)
207 $this->tpl->setCurrentBlock(
"legend_loop");
208 $this->tpl->setVariable(
"LEGEND_CSS_ROW",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
209 $this->tpl->setVariable(
"LEGEND_DIGIT", $i++);
210 $this->tpl->setVariable(
"LEGEND_EVENT_TITLE", $event_obj->getTitle());
211 $this->tpl->setVariable(
"LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
212 $this->tpl->setVariable(
"LEGEND_EVENT_LOCATION", $event_obj->getLocation());
213 $this->tpl->setVariable(
"LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
214 $this->tpl->parseCurrentBlock();
static _lookupName($a_user_id)
lookup user name
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Util class various functions, usage as namespace.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
_lookupLogin($a_user_id)
lookup login
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...