47 $this->lng->loadLanguageModule(
'barometer');
59 if(isset(
$_SESSION[
'error_post_vars'][
'cmd'][
'update'])){
61 $this->ctrl->setCmd(
'edit');
63 $this->ctrl->setCmd(
'addBarometer');
65 $params = $this->ctrl->getParameterArray($this);
67 $cmd = $this->ctrl->getCmd(
'fbList');
70 if((!$ilAccess->checkAccess(
'write',
'edit',$params[
'ref_id']))&&(in_array(
$cmd,array(
'fbList',
'save',
'delete',
'update',
'edit'))))
71 $cmd =
'showBarometer';
73 $next_class = $this->ctrl->getNextClass($this);
76 return($this->
$cmd());
84 $tpl =
new ilTemplate(
"tpl.feedbacklist.html",
true,
true,
"Services/Feedback");
85 $tpl->setVariable(
"TXT_FEEDBACK_TITLE", $lng->txt(
"stimmungsb"));
86 $tpl->setVariable(
"TXT_TITLE", $lng->txt(
"title"));
87 $tpl->setVariable(
"TXT_STATUS", $lng->txt(
"status"));
88 $tpl->setVariable(
"TXT_ACTIVE_TIME", $lng->txt(
"active_time"));
89 $tpl->setVariable(
"TXT_OPTIONS", $lng->txt(
"options"));
91 $tpl->setVariable(
"TXT_NEW_VOTE", $lng->txt(
"options"));
92 $tpl->parseCurrentBlock();
101 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
105 $ilFeedback->setRefId(
$_GET[
'ref_id']);
106 $barometers = $ilFeedback->getAllBarometer();
108 if(is_Array($barometers)){
109 foreach($barometers as $barometer){
111 $rows[$cnt][
'title'] = $barometer->getTitle();
112 $rows[$cnt][
'status'] =
'Aktive';
113 if(($barometer->getStarttime()>0) && ($barometer->getStarttime()>0)){
114 $rows[$cnt][
'running'] = date(
'd.m.Y H:i',$barometer->getStarttime()).
' - '.date(
'd.m.Y H:i',$barometer->getEndtime());
115 if(($barometer->getStarttime()<=time())&&($barometer->getEndtime()>=time()))
116 $rows[$cnt][
'status'] = $this->lng->txt(
'active');
118 $rows[$cnt][
'status'] = $this->lng->txt(
'inactive');
121 $rows[$cnt][
'running'] =
'';
122 $rows[$cnt][
'status'] = $this->lng->txt(
'active');
124 $rows[$cnt][
'options'] = $this->
getButtons($barometer->getId());
125 $barometer_ids[]=$barometer->getId();
130 $tbl->tpl->setCurrentBlock(
"tbl_form_header");
131 $tbl->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
132 $tbl->tpl->parseCurrentBlock();
133 $tbl->setTitle($this->lng->txt(
"feedb_feedback_list"),
134 "icon_feedb.gif", $this->lng->txt(
"feedb_feedback_list"));
135 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"title"),$this->lng->txt(
"status"),$this->lng->txt(
"time"),$this->lng->txt(
"options")));
136 $tbl->setHeaderVars(array(
"checkbox",
"title",
"stauts",
"running",
"options"));
137 $tbl->setData($rows);
140 $tbl->disable(
'sort');
141 $tbl->setMaxCount(count($rows));
142 $tbl->tpl->setCurrentBlock(
"plain_button");
143 $tbl->tpl->setVariable(
"PBTN_NAME",
"addBarometer");
144 $tbl->tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"barometer_add"));
145 $tbl->tpl->parseCurrentBlock();
146 $tbl->tpl->setCurrentBlock(
"plain_buttons");
147 $tbl->tpl->parseCurrentBlock();
151 $tbl->tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
152 $tbl->tpl->setVariable(
"JS_VARNAME",
"barometer");
154 $tbl->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
155 $tbl->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
156 $tbl->tpl->parseCurrentBlock();
160 $tbl->tpl->setVariable(
"COLUMN_COUNTS",5);
163 $tbl->tpl->setCurrentBlock(
"tbl_action_select");
165 $tbl->tpl->setVariable(
"BTN_NAME",
"delete");
166 $tbl->tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
167 $tbl->tpl->parseCurrentBlock();
169 $tbl->setOrderDirection(
'asc');
170 $tbl->setColumnWidth(array(
"",
"25%",
"25%",
"25%",
""));
171 #$tbl->disable('sort');
172 $tbl->setFooter(
"tblfooter");
175 return($tbl->tpl->get());
180 include_once
"./Services/Table/classes/class.ilTableGUI.php";
185 if(is_Array($_POST[
'barometer'])){
186 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
188 $ilFB->setIds($_POST[
'barometer']);
195 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
198 $tpl =
new ilTemplate(
"tpl.feedback_stats.html",
true,
true,
"Services/Feedback");
201 $feedback->setId(
$_GET[
'barometer_id']);
202 $chartdata = $feedback->getChartData();
203 $data = $chartdata[
'data'];
204 $legend = $chartdata[
'legend'];
205 $legendpie = $chartdata[
'legendpie'];
206 $datapie = $chartdata[
'datapie'];
207 $datatable = $chartdata[
'table'];
209 $chartlines =
'<img src="Services/Feedback/showchart.php?chart_type=lines&title='.base64_encode($this->lng->txt(
'chart_users')).
'&data='.base64_encode(serialize(
$data)).
'&legend='.base64_encode(serialize(
$legend)).
'">';
210 $chartpie =
'<img src="Services/Feedback/showchart.php?chart_type=pie&title='.base64_encode($this->lng->txt(
'chart_votes')).
'&data='.base64_encode(serialize($datapie)).
'&legend='.base64_encode(serialize($legendpie)).
'">';
216 $chart_user[0] = $this->lng->txt(
'all_users');
217 $chart_user = $feedback->getResultUsers();
219 $tpl->setVariable(
"TXT_USER",$this->lng->txt(
'user'));
220 $tpl->setVariable(
"TXT_CHART_TYPE",$this->lng->txt(
'chart_type'));
221 switch($_POST[
'chart_type']){
223 $tpl->setVariable(
"CHART_PIE", $chartpie);
226 if(is_array($datatable)){
227 $tpl->setCurrentBlock(
'tablerow');
228 $tpl->setVariable(
'TXT_TABLE_USERNAME',$this->lng->txt(
'username'));
229 $tpl->setVariable(
'TXT_TABLE_VOTE',$this->lng->txt(
'vote'));
230 $tpl->setVariable(
'TXT_TABLE_DATE', $this->lng->txt(
'date'));
231 $tpl->parseCurrentBlock();
233 foreach($datatable as $tablerow){
234 $tpl->setVariable(
'VALUE_NUM',(($i++ % 2) ? 1 : 2));
235 $tpl->setVariable(
'VALUE_VOTETIME', $tablerow[
'votetime']);
236 $tpl->setVariable(
'VALUE_USER', $tablerow[
'user']);
237 $tpl->setVariable(
'VALUE_VOTE', $tablerow[
'vote']);
238 $tpl->parseCurrentBlock();
243 $tpl->setVariable(
"CHART_LINES", $chartlines);
247 $tpl->setVariable(
"SELECTBOX_USER", $this->
selectbox(
ilUtil::stripSlashes($_POST[
'chart_user']),
'chart_user',$chart_user,
'onChange="document.forms[0].submit()"',$this->lng->txt(
'all_users')));
252 $comments = $feedback->getNotes();
253 if(is_Array($comments)){
254 $tpl->setCurrentBlock(
'comment_row');
255 $tpl->setVariable(
'TXT_USERNAME',$this->lng->txt(
'username'));
256 $tpl->setVariable(
'TXT_COMMENT',$this->lng->txt(
'comment'));
257 $tpl->setVariable(
'TXT_DATE', $this->lng->txt(
'date'));
258 $tpl->parseCurrentBlock();
261 $tpl->setVariable(
'VALUE_NUM',(($i++ % 2) ? 1 : 2));
262 $tpl->setVariable(
'VALUE_LOGIN',$comment[
'user']);
263 $tpl->setVariable(
'VALUE_DATE',$comment[
'votetime']);
264 $tpl->setVariable(
'VALUE_NOTE',$comment[
'note']);
265 $tpl->parseCurrentBlock();
268 $tpl->parseCurrentBlock();
278 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
280 $ilFB =
new ilFeedback($_REQUEST[
'barometer_id']);
281 $tpl =
new ilTemplate(
"tpl.feedback_edit.html",
true,
true,
"Services/Feedback");
283 $data[
'title'] = $_POST[
'title'] ? $_POST[
'title'] : $ilFB->getTitle();
284 $data[
'description'] = $_POST[
'text'] ? $_POST[
'text'] : $ilFB->getDescription();
285 $data[
'anonymous'] = ($_POST[
'anonymous']!=
'') ? $_POST[
'anonymous'] : $ilFB->getAnonymous();
286 $data[
'required'] = ($_POST[
'required']!=
'') ? $_POST[
'required'] : $ilFB->getRequired();
287 $data[
'show_on'] = $_POST[
'show_on'] ? $_POST[
'show_on'] : $ilFB->getShowOn();
288 $data[
'vote'] = $_POST[
'vote'] ? $_POST[
'vote'] : unserialize($ilFB->getVotes());
289 if($_POST[
'extra_votes']==
'')
290 $_POST[
'extra_votes'] = count(
$data[
'votes']);
291 $data[
'text_answer'] = ($_POST[
'text_answer']!=
'') ? $_POST[
'text_answer'] : $ilFB->getTextAnswer();
292 if($ilFB->getStarttime()>=0||isset($_POST[
'start_day'])){
293 $data[
'start_day'] = $_POST[
'start_day'] ? $_POST[
'start_day'] : date(
'd',$ilFB->getStarttime());
294 $data[
'start_month'] =$_POST[
'start_month'] ? $_POST[
'start_month'] : date(
'm',$ilFB->getStarttime());
295 $data[
'start_year'] = $_POST[
'start_year'] ? $_POST[
'start_year'] :date(
'Y',$ilFB->getStarttime());
296 $data[
'start_hour'] = $_POST[
'start_hour'] ? $_POST[
'start_hour'] :date(
'H',$ilFB->getStarttime());
297 $data[
'start_minute'] = $_POST[
'start_minute'] ? $_POST[
'start_minute'] :date(
'i',$ilFB->getStarttime());
299 if($ilFB->getEndtime()>=0||isset($_POST[
'end_day'])){
300 $data[
'end_day'] = $_POST[
'end_day'] ? $_POST[
'end_day'] :date(
'd',$ilFB->getEndtime());
301 $data[
'end_month'] = $_POST[
'end_month'] ? $_POST[
'end_month'] :date(
'm',$ilFB->getEndtime());
302 $data[
'end_year'] = $_POST[
'end_year'] ? $_POST[
'end_year'] :date(
'Y',$ilFB->getEndtime());
303 $data[
'end_hour'] = $_POST[
'end_hour'] ? $_POST[
'end_hour'] :date(
'H',$ilFB->getEndtime());
304 $data[
'end_minute'] = $_POST[
'end_minute'] ? $_POST[
'end_minute'] :date(
'i',$ilFB->getEndtime());
307 $data[
'interval'] = $_POST[
'interval'] ? $_POST[
'interval'] : $ilFB->getInterval();
308 $data[
'interval_unit'] = $_POST[
'interval_unit'] ? $_POST[
'interval_unit'] : $ilFB->getIntervalUnit();
309 $data[
'first_vote_best'] = ($_POST[
'first_vote_best']!=
'') ? $_POST[
'first_vote_best'] : $ilFB->getFirstVoteBest();
311 $this->ctrl->setParameter($this,
"barometer_id",
$_GET[
'barometer_id']);
312 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
313 $tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"feedb_edit_feedback"));
315 $tpl->setVariable(
"ALT_FEEDB", $this->lng->txt(
"feedb_edit_feedback"));
316 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
317 $tpl->setVariable(
"VALUE_TITLE",
$data[
'title']);
318 $tpl->setVariable(
"TXT_TOP_TEXT", $this->lng->txt(
"text"));
319 $tpl->setVariable(
"TXT_TIME", $this->lng->txt(
"feedb_time"));
320 $tpl->setVariable(
"VALUE_TEXT",
$data[
'description']);
321 $tpl->setVariable(
"TXT_ANONYMOUS", $this->lng->txt(
"anonymous"));
323 if(
$data[
"anonymous"]==
"0")
324 $tpl->setVariable(
"ANONYMOUS_NO",
" checked");
326 $tpl->setVariable(
"ANONYMOUS_YES",
" checked");
327 $tpl->setVariable(
"TXT_YES", $this->lng->txt(
"yes"));
328 $tpl->setVariable(
"TXT_NO", $this->lng->txt(
"no"));
329 $tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
330 $typeSB[0] = $this->lng->txt(
'optional');
331 $typeSB[1] = $this->lng->txt(
'required');
333 $tpl->setVariable(
"SELECT_TYPE",
336 $tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required"));
337 if(
$data[
"show_on"]==
"course")
338 $tpl->setVariable(
"SHOW_CHANGE_COURSE_SELECTED",
"selected");
340 $tpl->setVariable(
"SHOW_LOGIN_SELECTED",
"selected");
341 $tpl->setVariable(
"TXT_LOGIN", $this->lng->txt(
"login"));
342 $tpl->setVariable(
"TXT_CHANGE_COURSE", $this->lng->txt(
"change_course"));
343 if(
$data[
"text_answer"]==
"1")
344 $tpl->setVariable(
"TEXT_ANSWER_YES",
" checked");
346 $tpl->setVariable(
"TEXT_ANSWER_NO",
" checked");
347 $tpl->setVariable(
"TXT_TEXT_ANSWER", $this->lng->txt(
"text_answer"));
348 $tpl->setVariable(
"TXT_VOTES", $this->lng->txt(
"votes"));
349 $extra_votes = $_POST[
"extra_votes"] ? $_POST[
"extra_votes"]+1 : (count(
$data[
"vote"])-2);
350 if ($extra_votes<1) $extra_votes=1;
351 $tpl->setVariable(
"VALUE_EXTRA_VOTES", $extra_votes);
353 for($i=1;$i < 3+$extra_votes ;$i++){
354 $tpl->setCurrentBlock(
"vote");
355 $tpl->setVariable(
"TXT_TEXT",$this->lng->txt(
"text"));
356 $tpl->setVariable(
"VALUE_VOTE_TEXT",
$data[
"vote"][$i]);
357 $tpl->setVariable(
"VOTE_NUM",$i);
358 $tpl->parseCurrentBlock();
361 $tpl->setVariable(
"TXT_DAY",$this->lng->txt(
"day"));
362 $tpl->setVariable(
"SELECT_ACTIVATION_START_DAY",$this->
getDateSelect(
'day',
'start_day',
$data[
'start_day']));
363 $tpl->setVariable(
"SELECT_ACTIVATION_START_MONTH",$this->
getDateSelect(
'month',
'start_month',
$data[
'start_month']));
364 $tpl->setVariable(
"SELECT_ACTIVATION_START_YEAR",$this->
getDateSelect(
'year',
'start_year',
$data[
'start_year']));
365 $tpl->setVariable(
"SELECT_ACTIVATION_START_HOUR",$this->
getDateSelect(
'hour',
'start_hour',
$data[
'start_hour']));
366 $tpl->setVariable(
"SELECT_ACTIVATION_START_MINUTE",$this->
getDateSelect(
'minute',
'start_minute',
$data[
'start_minute']));
368 $tpl->setVariable(
"SELECT_ACTIVATION_END_MONTH",$this->
getDateSelect(
'month',
'end_month',
$data[
'end_month']));
369 $tpl->setVariable(
"SELECT_ACTIVATION_END_YEAR",$this->
getDateSelect(
'year',
'end_year',
$data[
'end_year']));
370 $tpl->setVariable(
"SELECT_ACTIVATION_END_HOUR",$this->
getDateSelect(
'hour',
'end_hour',
$data[
'end_hour']));
371 $tpl->setVariable(
"SELECT_ACTIVATION_END_MINUTE",$this->
getDateSelect(
'minute',
'end_minute',
$data[
'end_minute']));
373 $tpl->setVariable(
"TXT_MONTH",$this->lng->txt(
"month"));
374 $tpl->setVariable(
"TXT_YEAR",$this->lng->txt(
"year"));
375 $tpl->setVariable(
"TXT_FROM",$this->lng->txt(
"from"));
376 $tpl->setVariable(
"TXT_UNTIL",$this->lng->txt(
"until"));
378 $tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
"duration"));
379 $tpl->setVariable(
"TXT_HOURS",$this->lng->txt(
"hours"));
380 $tpl->setVariable(
"TXT_DAYS",$this->lng->txt(
"days"));
381 $tpl->setVariable(
"TXT_WEEKS",$this->lng->txt(
"weeks"));
382 $tpl->setVariable(
"TXT_MONTHS",$this->lng->txt(
"months"));
383 $tpl->setVariable(
"TXT_REPEAT",$this->lng->txt(
"repeat"));
384 $tpl->setVariable(
"TXT_FTEXT",$this->lng->txt(
"text"));
386 for($i=0;$i < 25;$i++){
391 $interval_unitSB[0] = $this->lng->txt(
'hours');
392 $interval_unitSB[1] = $this->lng->txt(
'days');
393 $interval_unitSB[2] = $this->lng->txt(
'weeks');
394 $interval_unitSB[3] = $this->lng->txt(
'months');
397 $tpl->setVariable(
"TXT_FIRST_VOTE",$this->lng->txt(
"first_vote"));
398 $tpl->setVariable(
"TXT_BEST",$this->lng->txt(
"best"));
399 $tpl->setVariable(
"TXT_WORST",$this->lng->txt(
"worst"));
400 if(
$data[
"first_vote_best"]==1)
401 $tpl->setVariable(
"BEST_CHECKED",
"checked");
403 $tpl->setVariable(
"WORST_CHECKED",
"checked");
404 $tpl->setVariable(
"TXT_VOTE", $this->lng->txt(
"vote"));
405 $tpl->setVariable(
"TXT_NEW_VOTE", $this->lng->txt(
"new_vote"));
406 $tpl->setVariable(
"CMD_ADDVOTE",
'edit');
407 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
408 $tpl->setVariable(
"CMD_SUBMIT",
"update");
409 $tpl->parseCurrentBlock();
416 return $this->
save();
421 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
422 $params = $this->ctrl->getParameterArray($this);
426 if($_POST[
'anonymous'] and $_POST[
'type'])
429 #$this->ctrl->setParameter($this,'barometer_id',(int) $_GET['barometer_id']);
430 #$this->ctrl->redirect($this,'edit');
431 --$_POST[
'extra_votes'];
432 return $this->
edit();
434 foreach ($_POST[
'vote'] as $k=>$v)
438 $tmp_votes[$vote_cnt]=$v;
442 if(($_POST[
'title']==
'')||($_POST[
'text']==
'')|| $vote_cnt<3)
445 --$_POST[
'extra_votes'];
446 return $this->
edit();
447 #$this->ctrl->setParameter($this,'a','32');
448 #$ilias->raiseError($this->lng->txt('missing_fields'),$ilias->error_obj->MESSAGE);
457 $ilFeedback->setVotes(serialize($tmp_votes));
463 $ilFeedback->setEndtime(mktime(
469 $ilFeedback->setInterval(
471 $ilFeedback->setIntervalUnit(
473 $ilFeedback->setFirstVoteBest(
475 $ilFeedback->setObjId($params[
'obj_id']);
476 $ilFeedback->setRefId($params[
'ref_id']);
479 $ilFeedback->setId(
$_GET[
'barometer_id']);
480 $ilFeedback->update();
483 $ilFeedback->create();
493 if (!empty($_POST[$a_var]))
$result=$_POST[$a_var];
506 $tpl =
new ilTemplate(
"tpl.feedback_edit.html",
true,
true,
"Services/Feedback");
507 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
508 $tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"bar_create"));
510 $tpl->setVariable(
"ALT_FEEDB", $this->lng->txt(
"bar_create"));
511 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
512 $tpl->setVariable(
"TXT_TIME", $this->lng->txt(
"feedb_time"));
513 $tpl->setVariable(
"VALUE_TITLE",$this->
get_last(
"title"));
514 $tpl->setVariable(
"TXT_TOP_TEXT", $this->lng->txt(
"text"));
515 $tpl->setVariable(
"VALUE_TEXT", $this->
get_last(
"text"));
516 $tpl->setVariable(
"TXT_ANONYMOUS", $this->lng->txt(
"anonymous"));
517 if($this->
get_last(
"anonymous")==
"0")
518 $tpl->setVariable(
"ANONYMOUS_NO",
" checked");
520 $tpl->setVariable(
"ANONYMOUS_YES",
" checked");
521 $tpl->setVariable(
"TXT_YES", $this->lng->txt(
"yes"));
522 $tpl->setVariable(
"TXT_NO", $this->lng->txt(
"no"));
523 $tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"type"));
524 $typeSB[0] = $this->lng->txt(
'optional');
525 $typeSB[1] = $this->lng->txt(
'required');
528 $tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required"));
529 if($this->
get_last(
"show_on")==
"course")
530 $tpl->setVariable(
"SHOW_CHANGE_COURSE_SELECTED",
"selected");
532 $tpl->setVariable(
"SHOW_LOGIN_SELECTED",
"selected");
533 $tpl->setVariable(
"TXT_LOGIN", $this->lng->txt(
"login"));
534 $tpl->setVariable(
"TXT_CHANGE_COURSE", $this->lng->txt(
"change_course"));
535 if($this->
get_last(
"text_answer")==
"1")
536 $tpl->setVariable(
"TEXT_ANSWER_YES",
" checked");
538 $tpl->setVariable(
"TEXT_ANSWER_NO",
" checked");
539 $tpl->setVariable(
"TXT_TEXT_ANSWER", $this->lng->txt(
"text_answer"));
540 $tpl->setVariable(
"TXT_VOTES", $this->lng->txt(
"votes"));
541 $extra_votes = $this->
get_last(
"extra_votes",0);
542 if ($_POST[
'cmd'][
'addBarometer']) $extra_votes+=1;
543 $tpl->setVariable(
"VALUE_EXTRA_VOTES", $extra_votes);
544 $vote_txt=$this->
get_last(
'vote',array(),
false);
545 for($i=1;$i < 3+$extra_votes ;$i++){
546 $tpl->setCurrentBlock(
"vote");
547 $tpl->setVariable(
"TXT_TEXT",$this->lng->txt(
"text"));
549 $tpl->setVariable(
"VOTE_NUM",$i);
550 $tpl->parseCurrentBlock();
552 $tpl->setVariable(
"TXT_DAY",$this->lng->txt(
"day"));
554 $tpl->setVariable(
"SELECT_ACTIVATION_START_MONTH",$this->
getDateSelect(
'month',
'start_month',$this->
get_last(
'start_month')));
555 $tpl->setVariable(
"SELECT_ACTIVATION_START_YEAR",$this->
getDateSelect(
'year',
'start_year',$this->
get_last(
'start_year')));
556 $tpl->setVariable(
"SELECT_ACTIVATION_START_HOUR",$this->
getDateSelect(
'hour',
'start_hour',$this->
get_last(
'start_hour')));
557 $tpl->setVariable(
"SELECT_ACTIVATION_START_MINUTE",$this->
getDateSelect(
'minute',
'start_minute',$this->
get_last(
'start_minute')));
562 $tpl->setVariable(
"SELECT_ACTIVATION_END_MINUTE",$this->
getDateSelect(
'minute',
'end_minute',$this->
get_last(
'end_minute')));
564 $tpl->setVariable(
"TXT_MONTH",$this->lng->txt(
"month"));
565 $tpl->setVariable(
"TXT_YEAR",$this->lng->txt(
"year"));
566 $tpl->setVariable(
"TXT_FROM",$this->lng->txt(
"from"));
567 $tpl->setVariable(
"TXT_UNTIL",$this->lng->txt(
"until"));
569 $tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
"duration"));
570 $tpl->setVariable(
"TXT_HOURS",$this->lng->txt(
"hours"));
571 $tpl->setVariable(
"TXT_DAYS",$this->lng->txt(
"days"));
572 $tpl->setVariable(
"TXT_WEEKS",$this->lng->txt(
"weeks"));
573 $tpl->setVariable(
"TXT_MONTHS",$this->lng->txt(
"months"));
574 $tpl->setVariable(
"TXT_REPEAT",$this->lng->txt(
"repeat"));
576 for($i=0;$i < 25;$i++){
580 $tpl->setVariable(
"TXT_EVERY",$this->lng->txt(
"every"));
582 $interval_unitSB[0] = $this->lng->txt(
'hours');
583 $interval_unitSB[1] = $this->lng->txt(
'days');
584 $interval_unitSB[2] = $this->lng->txt(
'weeks');
585 $interval_unitSB[3] = $this->lng->txt(
'months');
588 $tpl->setVariable(
"TXT_FIRST_VOTE",$this->lng->txt(
"first_vote"));
589 $tpl->setVariable(
"TXT_BEST",$this->lng->txt(
"best"));
590 $tpl->setVariable(
"TXT_WORST",$this->lng->txt(
"worst"));
591 if($this->
get_last(
"first_vote_best")==1)
592 $tpl->setVariable(
"BEST_CHECKED",
"checked");
594 $tpl->setVariable(
"WORST_CHECKED",
"checked");
596 $tpl->setVariable(
"TXT_NEW_VOTE", $this->lng->txt(
"new_vote"));
597 $tpl->setVariable(
"CMD_ADDVOTE",
'addBarometer');
598 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
599 $tpl->setVariable(
"CMD_SUBMIT",
"save");
600 $tpl->parseCurrentBlock();
606 $tpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"Services/Feedback");
608 $tpl->setCurrentBlock(
"btn_cell");
609 $this->ctrl->setParameter($this,
"barometer_id",$a_barometer_id);
610 $this->ctrl->setParameter($this,
"ref_id",
$_GET[
'ref_id']);
611 $tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
'stats'));
612 $tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"statistics"));
613 $tpl->parseCurrentBlock();
614 $tpl->setCurrentBlock(
"btn_cell");
615 $tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
'edit'));
616 $tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"edit"));
617 $tpl->parseCurrentBlock();
627 $days[$i] = $i < 10 ?
"0".$i : $i;
634 $days[$i] = $i < 10 ?
"0".$i : $i;
641 $days[$i] = $i < 10 ?
"0".$i : $i;
649 $month[$i] = $i < 10 ?
"0".$i : $i;
655 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
665 global $ilAccess,$ilUser;
666 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
668 $bid = $a_id ? $a_id :
$_GET[
'barometer_id'];
669 $feedback->setId($bid);
670 $feedback->getBarometer();
671 if($feedback->getId()&& ($feedback->canVote($ilUser->getId(),$feedback->getId())==1)){
672 $tpl =
new ilTemplate(
"tpl.feedback_vote.html",
true,
true,
"Services/Feedback");
676 $tpl->setCurrentBlock(
"vote_head");
679 $tpl->parseCurrentBlock();
682 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this).
'&fb_id='.$feedback->getId());
683 $tpl->setVariable(
"TXT_TITLE", $feedback->getTitle());
684 $tpl->setVariable(
"TXT_DESCRIPTION", $feedback->getDescription());
685 $votes = unserialize($feedback->getVotes());
687 foreach($votes as $vote => $votetext){
691 $tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save_vote'));
693 $tpl->setVariable(
"RADIO_VOTES",$radios);
694 if($feedback->getTextAnswer()){
695 $tpl->setCurrentBlock(
"text_answer");
696 $tpl->setVariable(
"TXT_NOTE",$this->lng->txt(
'note'));
699 $tpl->parseCurrentBlock();
707 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
708 include_once(
'Modules/Course/classes/class.ilCourseParticipants.php');
712 $feedback->getFeedback();
715 if(($feedback->getId()) && ($members_obj->isAssigned($ilUser->getId())))
717 return($feedback->getRefId());
725 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
728 $ilfeedback->setRefId(
$_GET[
'ref_id']);
729 $feedbacks = $ilfeedback->getAllBarometer();
733 foreach($feedbacks as $feedback){
735 if($feedback->getId()&& ($feedback->canVote($ilUser->getId(),$feedback->getId())==1)){
736 $tpl =
new ilTemplate(
"tpl.feedback_vote.html",
true,
true,
"Services/Feedback");
737 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this).
'&fb_id='.$feedback->getId());
738 $tpl->setVariable(
"TXT_TITLE", $feedback->getTitle());
739 $tpl->setVariable(
"TXT_DESCRIPTION", $feedback->getDescription());
740 $votes = unserialize($feedback->getVotes());
742 foreach($votes as $vote => $votetext){
746 $tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save_vote'));
747 $tpl->setVariable(
"RADIO_VOTES",$radios);
748 if($feedback->getTextAnswer()){
749 $tpl->setCurrentBlock(
"text_answer");
750 $tpl->setVariable(
"TXT_NOTE",$this->lng->txt(
'note'));
753 $tpl->parseCurrentBlock();
761 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
764 $feedback->setId(
$_GET[
'fb_id']);
765 $feedback->getBarometer();
768 if($feedback->getAnonymous())
769 $feedback->setUserId(0);
771 $feedback->setUserId($ilUser->getId());
772 $feedback->saveResult();
773 $this->ctrl->returnToParent($this);
775 function selectbox($selected_itm, $name, $items, $params=
'',$first=
''){
777 $options = $first ?
'<option value="">'.$first.
'</option>'.chr(10) :
'';
778 if(is_Array($items)){
779 foreach($items as $key => $item){
780 $selected = ($key == $selected_itm) ?
' selected' :
'';
781 $options.=
'<option value="'.$key.
'"'.$selected.
'>'.$item.
'</option>'.chr(10);
785 $content =
'<select name="'.$name.
'" '.$params.
'>
792 global $ilUser, $ilAccess;
794 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
796 $barometers = $feedback->getAllBarometer(0);
798 $tpl =
new ilTemplate(
"tpl.feedback_pdbox.html",
true,
true,
"Services/Feedback");
799 $tpl->setVariable(
'TXT_TITLE',$this->lng->txt(
'feedback'));
801 if(count($barometers)){
802 foreach ($barometers as $barometer)
805 if ($ilAccess->checkAccess(
"write",
"", $barometer->getRefId()))
809 if($barometer->canVote($ilUser->getId(),$barometer->getId())==1)
811 $tpl->setCurrentBlock(
'tbl_row');
812 $tpl->setVariable(
'ROWCOL',
'tblrow'.(($rownum++ % 2)+1));
813 $this->ctrl->setParameter($this,
"barometer_id",$barometer->getId());
814 $link =
'<a href="'.$this->ctrl->getLinkTargetByClass(
'ilfeedbackgui',
'voteform').
'">'.$barometer->getTitle().
'</a>';
816 $tpl->setVariable(
'BAROMETER_LINK',$link);
817 $tpl->parseCurrentBlock();
821 $output = $rownum ?
$tpl->get() :
'' ;
828 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
830 $feedback->setRefId(
$_GET[
'ref_id']);
831 $barometers = $feedback->getAllBarometer(0);
833 $tpl =
new ilTemplate(
"tpl.feedback_pdbox.html",
true,
true,
"Services/Feedback");
834 $tpl->setVariable(
'TXT_TITLE',$this->lng->txt(
'feedback'));
836 if(count($barometers)){
837 foreach ($barometers as $barometer){
838 if($barometer->canVote($ilUser->getId(),$barometer->getId())==1){
839 $tpl->setCurrentBlock(
'tbl_row');
840 $tpl->setVariable(
'ROWCOL',
'tblrow'.(($rownum++ % 2)+1));
841 $this->ctrl->setParameter($this,
"barometer_id",$barometer->getId());
842 $link =
'<a href="'.$this->ctrl->getLinkTargetByClass(array(
'ilinfoscreengui',
'ilfeedbackgui'),
'fbList').
'">'.$barometer->getTitle().
'</a>';
844 $tpl->setVariable(
'BAROMETER_LINK',$link);
845 $tpl->parseCurrentBlock();
849 $output = $rownum ?
$tpl->get() :
'' ;
857 include_once(
'Services/Feedback/classes/class.ilFeedback.php');
861 $feedback->setRefId($a_ref_id);
863 $barometers = $feedback->getAllBarometer(0,1);
866 if(count($barometers))
868 foreach ($barometers as $barometer)
870 if($barometer->canVote($ilUser->getId(),$barometer->getId())==1){
871 $this->ctrl->setParameter($this,
"barometer_id",$barometer->getId());
872 $this->ctrl->redirectByClass(array(
"ilinfoscreengui",
"ilfeedbackgui"),
"showBarometerById");
881 $barometer_id = $a_barometer_id ? $a_barometer_id :
$_GET[
'barometer_id'];