94 {
96
97 if(!$ilAccess->checkAccess('write','',$this->course_ref_id))
98 {
99 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),
$ilErr->MESSAGE);
100 }
101
102 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.sess_list.html','Modules/Session');
103 $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
104
105
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();
110
111 include_once 'Modules/Session/classes/class.ilEventParticipants.php';
112
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');
115
116 $members = $this->members_obj->getParticipants();
118
119
120
122 $tbl->setTitle($this->lng->txt("event_overview"),
123 '',
124 $this->lng->txt('obj_usr'));
125 $this->ctrl->setParameter($this,
'offset',(
int)
$_GET[
'offset']);
126
127 $events = array();
128 foreach($tree->getSubtree($tree->getNodeData($this->course_ref_id),false,'sess') as $event_id)
129 {
131 if(!is_object($tmp_event) or !$ilAccess->checkAccess('write','',$event_id))
132 {
133 continue;
134 }
135 $events[] = $tmp_event;
136 }
137
138 $headerNames = array();
139 $headerVars = array();
140 $colWidth = array();
141
142 $headerNames[] = $this->lng->txt('name');
143 $headerVars[] = "name";
144 $colWidth[] = '20%';
145 $headerNames[] = $this->lng->txt('login');
146 $headerVars[] = "login";
147 $colWidth[] = '20%';
148
149 for ($i = 1; $i <= count($events); $i++)
150 {
151 $headerNames[] = $i;
152 $headerVars[] = "event_".$i;
153 $colWidth[] = 80/count($events)."%";
154 }
155
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);
160
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"));
167
168 $sliced_users = array_slice($members,
$_GET[
'offset'],
$_SESSION[
'tbl_limit']);
169 $tbl->disable('sort');
170 $tbl->render();
171
172 $counter = 0;
173 foreach($sliced_users as $user_id)
174 {
175 foreach($events as $event_obj)
176 {
177 $this->tpl->setCurrentBlock("eventcols");
178
180
181 {
182 $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
185
186 $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
187 $this->lng->txt('event_participated') :
188 $this->lng->txt('event_not_participated'));
189 }
190
191 $this->tpl->parseCurrentBlock();
192 }
193
194 $this->tpl->setCurrentBlock("tbl_content");
197 $this->tpl->setVariable("LASTNAME",$name['lastname']);
198 $this->tpl->setVariable("FIRSTNAME",$name['firstname']);
200 $this->tpl->parseCurrentBlock();
201 }
202
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"));
208 $i = 1;
209 foreach($events as $event_obj)
210 {
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();
219 }
220
221 }
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)