38 $this->lng->loadLanguageModule(
'crs');
39 $this->tabs_gui = $ilTabs;
41 $this->container_gui =& $container_gui_obj;
42 $this->container_obj =& $this->container_gui->object;
51 if(!$ilAccess->checkAccess(
'read',
'',$this->container_obj->getRefId()))
53 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
60 $this->tabs_gui->setTabActive(
'view_content');
61 $cmd = $this->ctrl->getCmd();
63 switch($this->ctrl->getNextClass($this))
65 case 'ilcoursearchivesgui':
66 $this->__forwardToArchivesGUI();
70 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
71 $ilTabs->setSubTabActive(
"crs_content");
83 if((!$this->is_tutor
and 84 $this->container_obj->getType() ==
'crs' and 85 $this->container_obj->enabledObjectiveView()) ||
86 $_GET[
"col_return"] ==
"objectives")
88 $this->use_objective_presentation =
true;
109 if(
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()])
111 return 'editTimings';
113 if($ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
117 if($this->container_obj->getType() ==
'crs' and 120 return 'editUserTimings';
127 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
131 if($ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
135 $this->start_obj =
new ilCourseStart($this->course_obj->getRefId(),$this->course_obj->getId());
136 if(count($this->start_obj->getStartObjects())
and !$this->start_obj->allFullfilled($ilUser->getId()))
145 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
146 include_once
'./Services/Repository/classes/class.ilRepositoryExplorer.php';
147 include_once
'./Services/Link/classes/class.ilLink.php';
151 $this->tabs_gui->setSubTabActive(
'crs_content');
153 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
154 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_info_start'));
155 $this->tpl->setVariable(
"TBL_TITLE_START",$this->lng->txt(
'crs_table_start_objects'));
156 $this->tpl->setVariable(
"HEADER_NR",$this->lng->txt(
'crs_nr'));
157 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
158 $this->tpl->setVariable(
"HEADER_EDITED",$this->lng->txt(
'crs_objective_accomplished'));
161 $lm_continue =
new ilCourseLMHistory($this->course_obj->getRefId(),$ilUser->getId());
165 foreach($this->start_obj->getStartObjects() as
$start)
167 $obj_id = $ilObjDataCache->lookupObjId(
$start[
'item_ref_id']);
169 $type = $ilObjDataCache->lookupType(
$obj_id);
175 $obj_frame = $obj_frame ? $obj_frame :
'';
178 $obj_frame = $type ==
'tst' ?
'' : $obj_frame;
182 if($ilAccess->checkAccess(
'read',
'',
$ref_id))
184 $this->tpl->setCurrentBlock(
"start_read");
185 $this->tpl->setVariable(
"READ_TITLE_START",$ilObjDataCache->lookupTitle(
$obj_id));
186 $this->tpl->setVariable(
"READ_TARGET_START",$obj_frame);
187 $this->tpl->setVariable(
"READ_LINK_START", $obj_link.
'&crs_show_result='.$this->course_obj->getRefId());
188 $this->tpl->parseCurrentBlock();
192 $this->tpl->setCurrentBlock(
"start_visible");
193 $this->tpl->setVariable(
"VISIBLE_LINK_START",$ilObjDataCache->lookupTitle(
$obj_id));
194 $this->tpl->parseCurrentBlock();
198 if(isset($continue_data[
$ref_id]))
200 $this->tpl->setCurrentBlock(
"link");
202 $continue_data[$ref_id][
'lm_page_id'])));
203 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target); 204 $this->tpl->setVariable(
"LINK_NAME",$this->lng->txt(
'continue_work'));
205 $this->tpl->parseCurrentBlock();
209 if(!$ilUser->isDesktopItem($ref_id,$type)
and 210 $this->course_obj->getAboStatus())
212 if ($ilAccess->checkAccess(
'read',
'',$ref_id))
214 $this->tpl->setCurrentBlock(
"link");
215 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id',$ref_id);
216 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id',$ref_id);
217 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',$type);
219 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,
'addToDesk'));
220 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
221 $this->tpl->parseCurrentBlock();
224 elseif($this->course_obj->getAboStatus())
226 $this->tpl->setCurrentBlock(
"link");
227 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id',$ref_id);
228 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id',$ref_id);
229 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',$type);
231 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,
'removeFromDesk'));
232 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
233 $this->tpl->parseCurrentBlock();
238 if(strlen($ilObjDataCache->lookupDescription(
$obj_id)))
240 $this->tpl->setCurrentBlock(
"start_description");
241 $this->tpl->setVariable(
"DESCRIPTION_START",$ilObjDataCache->lookupDescription(
$obj_id));
242 $this->tpl->parseCurrentBlock();
246 if($this->start_obj->isFullfilled($ilUser->getId(),
$ref_id))
248 $accomplished =
'accomplished';
253 $accomplished =
'not_accomplished';
256 $this->tpl->setCurrentBlock(
"start_row");
257 $this->tpl->setVariable(
"EDITED_IMG", $icon);
258 $this->tpl->setVariable(
"EDITED_ALT",$this->lng->txt(
'crs_objective_'.$accomplished));
259 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
260 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
261 $this->tpl->setVariable(
"OBJ_NR_START",++
$counter.
'.');
262 $this->tpl->parseCurrentBlock();
273 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
277 $this->container_obj->getType(), $this->container_obj->getRefId(),
283 if (!$this->no_right_column)
296 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
301 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
311 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
316 $html = $ilCtrl->forwardCommand($column_gui);
320 if (!$ilCtrl->isAsynch())
322 $html = $ilCtrl->getHTML($column_gui);
331 global $ilAccess,
$lng;
333 $column_gui->setRepositoryMode(
true);
334 $column_gui->setEnableEdit(
false);
335 $column_gui->setBlockProperty(
"news",
"title",
336 $lng->txt(
"crs_news"));
338 include_once
"Services/Object/classes/class.ilObjectActivation.php";
339 $grouped_items =
array();
342 $grouped_items[$item[
"type"]][] = $item;
345 $column_gui->setRepositoryItems($grouped_items);
346 if ($ilAccess->checkAccess(
"write",
"", $this->container_obj->getRefId()))
348 $column_gui->setEnableEdit(
true);
352 if ($this->is_tutor &&
353 $this->container_gui->isActiveAdministrationPanel())
355 $column_gui->setEnableMovement(
true);
361 $column_gui->setBlockProperty(
"news",
"settings",
true);
363 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
364 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
367 if ($this->container_gui->isActiveAdministrationPanel())
369 $column_gui->setAdminCommands(
true);
381 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
386 if (!$ilCtrl->isAsynch())
396 $html = $ilCtrl->forwardCommand($column_gui);
403 $html = $ilCtrl->forwardCommand($column_gui);
409 $this->getDefaultView();
421 include_once
'Services/MetaData/classes/class.ilMDEducational.php';
422 include_once
'./Services/Link/classes/class.ilLink.php';
424 $this->lng->loadLanguageModule(
'meta');
426 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
428 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$ilErr->WARNING);
431 $this->tabs_gui->setSubTabActive(
'timings_timings');
433 include_once
'Services/Object/classes/class.ilObjectActivation.php';
436 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_items.html',
'Modules/Course');
437 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
439 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'crs_materials'));
440 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT",$this->lng->txt(
'edit_timings_list'));
441 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
444 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'crs_timings_time_frame'));
445 $this->tpl->setVariable(
"TXT_INFO_DURATION",$this->lng->txt(
'crs_timings_in_days'));
447 $this->tpl->setVariable(
"TXT_START_END",$this->lng->txt(
'crs_timings_short_start_end'));
448 $this->tpl->setVariable(
"TXT_INFO_START_END",$this->lng->txt(
'crs_timings_start_end_info'));
450 $this->tpl->setVariable(
"TXT_CHANGEABLE",$this->lng->txt(
'crs_timings_short_changeable'));
452 $this->tpl->setVariable(
"TXT_INFO_LIMIT",$this->lng->txt(
'crs_timings_from_until'));
453 $this->tpl->setVariable(
"TXT_LIMIT",$this->lng->txt(
'crs_timings_short_limit_start_end'));
454 $this->tpl->setVariable(
"TXT_ACTIVE",$this->lng->txt(
'crs_timings_short_active'));
455 $this->tpl->setVariable(
"TXT_INFO_ACTIVE",$this->lng->txt(
'crs_timings_info_active'));
458 foreach($this->cont_arr as $item)
460 if($item[
'type'] ==
'itgr')
465 $item_prefix =
"item[$item[ref_id]]";
466 $item_change_prefix =
"item_change[$item[ref_id]]";
467 $item_active_prefix =
"item_active[$item[ref_id]]";
469 if($item[
'type'] ==
'grp' or 470 $item[
'type'] ==
'fold')
472 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'],$item[
'type']));
474 $this->tpl->setVariable(
"TITLE_LINK_NAME",$item[
'title']);
478 if(!$item[
'title'] &&
479 $item[
'type'] ==
'sess')
481 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
486 $this->tpl->setVariable(
"TITLE",$item[
'title']);
489 if(strlen($item[
'description']))
491 $this->tpl->setCurrentBlock(
"item_description");
492 $this->tpl->setVariable(
"DESC",$item[
'description']);
493 $this->tpl->parseCurrentBlock();
498 $this->tpl->setCurrentBlock(
"tlt");
499 $this->tpl->setVariable(
"TXT_TLT",$this->lng->txt(
'meta_typical_learning_time'));
501 $this->tpl->parseCurrentBlock();
504 $this->tpl->setCurrentBlock(
"container_standard_row");
507 if(is_array(
$_POST[
'item'][
"$item[ref_id]"][
'sug_start']))
513 $start = $item[
'suggestion_start'];
515 $end = $item[
'suggestion_end'];
517 $this->tpl->setVariable(
"SUG_START",
519 $date[
'y'],$date[
'm'],$date[
'd'],
date(
'Y',
time()),
false));
521 $this->tpl->setVariable(
"NAME_DURATION_A",$item_prefix.
"[duration_a]");
522 if(isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a']))
524 $this->tpl->setVariable(
"VAL_DURATION_A",abs(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a']));
528 $this->tpl->setVariable(
"VAL_DURATION_A",intval(($end-
$start)/(60*60*24)));
534 if(is_array(
$_POST[
'item'][
"$item[ref_id]"][
'lim_end']))
536 $end = $this->
__toUnix(
$_POST[
'item'][
"$item[ref_id]"][
'lim_end']);
540 $end = $item[
'latest_end'];
544 $this->tpl->setVariable(
"LIM_END",
546 $date[
'y'],$date[
'm'],$date[
'd'],
date(
'Y',
time()),
false));
548 $this->tpl->setVariable(
"NAME_CHANGE",$item_change_prefix.
"[change]");
549 $this->tpl->setVariable(
"NAME_ACTIVE",$item_active_prefix.
"[active]");
553 $change =
$_POST[
'item_change'][
"$item[ref_id]"][
'change'];
554 $active =
$_POST[
'item_active'][
"$item[ref_id]"][
'active'];
558 $change = $item[
'changeable'];
562 $this->tpl->setVariable(
"CHECKED_ACTIVE",$active ?
'checked="checked"' :
'');
563 $this->tpl->setVariable(
"CHECKED_CHANGE",$change ?
'checked="checked"' :
'');
565 if(isset($this->failed[
"$item[ref_id]"]))
567 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
573 $this->tpl->parseCurrentBlock();
578 $this->tpl->setVariable(
"SELECT_ALL",$this->lng->txt(
'select_all'));
580 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
581 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
589 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
590 $accept_obj =
new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
592 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
594 $form->setFormAction($this->ctrl->getFormAction($this,
'saveAcceptance'));
595 $form->setTitle($this->lng->txt(
'timing_accept_table'));
598 $accept->
setChecked($accept_obj->isAccepted());
599 $form->addItem($accept);
602 $remark->
setValue($accept_obj->getRemark());
603 $form->addItem($remark);
607 $form->addItem($tutor);
609 $form->addCommandButton(
'saveAcceptance', $this->lng->txt(
'save'));
610 $this->tpl->setVariable(
"FORM", $form->getHTML());
617 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
618 $accept_obj =
new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
621 $accept_obj->accept(
$_POST[
'accepted']);
622 $accept_obj->setVisible(
$_POST[
'tutor']);
623 $accept_obj->update();
630 if(
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()])
636 if(!$ilAccess->checkAccess(
'read',
'',$this->container_obj->getRefId()))
638 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
640 $this->tabs_gui->setSubTabActive(
'timings_timings');
644 include_once
'Services/Object/classes/class.ilObjectActivation.php';
657 $this->ctrl->returnToParent($this);
662 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_user_timings.html',
'Modules/Course');
663 $this->tabs_gui->clearSubTabs();
664 $this->tabs_gui->setTabActive(
'members');
666 if(!
$_GET[
'member_id'])
669 $this->ctrl->returnToParent($this);
674 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
675 $this->tpl->setCurrentBlock(
"btn_cell");
676 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'returnToMembers'));
677 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"back"));
678 $this->tpl->parseCurrentBlock();
680 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
683 if($usr_accepted->isAccepted())
686 $this->tpl->setVariable(
"ACC_ALT",$this->lng->txt(
'timing_accepted'));
691 $this->tpl->setVariable(
"ACC_ALT",$this->lng->txt(
'timing_not_accepted'));
693 if($usr_accepted->isVisible()
and strlen($usr_accepted->getRemark()))
695 $this->tpl->setVariable(
"REMARK",nl2br($usr_accepted->getRemark()));
699 $this->tpl->setVariable(
"REMARK",$this->lng->txt(
'not_available'));
702 $this->tpl->setVariable(
"TIMING_ACCEPT",$this->lng->txt(
'timing_accept_table'));
703 $this->tpl->setVariable(
"TXT_ACCEPTED",$this->lng->txt(
'timing_user_accepted'));
704 $this->tpl->setVariable(
"TXT_REMARK",$this->lng->txt(
'timing_remark'));
707 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'obj_usr'));
708 $this->tpl->setVariable(
"TABLE_HEADER",$this->lng->txt(
'timings_of'));
710 $this->tpl->setVariable(
"USER_NAME",$name[
'lastname'].
', '.$name[
'firstname']);
712 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
713 $this->tpl->setVariable(
"TXT_START_END",$this->lng->txt(
'crs_timings_short_start_end'));
714 $this->tpl->setVariable(
"TXT_INFO_START_END",$this->lng->txt(
'crs_timings_start_end_info'));
715 $this->tpl->setVariable(
"TXT_CHANGED",$this->lng->txt(
'crs_timings_changed'));
716 $this->tpl->setVariable(
"TXT_OWN_PRESETTING",$this->lng->txt(
'crs_timings_planed_start'));
717 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING",$this->lng->txt(
'crs_timings_from_until'));
719 include_once
'Services/Object/classes/class.ilObjectActivation.php';
721 foreach($items as $item)
733 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
734 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
736 $this->lng->loadLanguageModule(
'meta');
739 for($i = 0;$i < $level;$i++)
741 $this->tpl->touchBlock(
'start_indent');
742 $this->tpl->touchBlock(
'end_indent');
744 if(strlen($item[
'description']))
746 $this->tpl->setCurrentBlock(
"item_description");
747 $this->tpl->setVariable(
"DESC",$item[
'description']);
748 $this->tpl->parseCurrentBlock();
752 $this->tpl->setCurrentBlock(
"tlt");
753 $this->tpl->setVariable(
"TXT_TLT",$this->lng->txt(
'meta_typical_learning_time'));
755 $this->tpl->parseCurrentBlock();
758 if(!$item[
'title'] &&
759 $item[
'type'] ==
'sess')
761 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
766 $this->tpl->setCurrentBlock(
"title_plain");
767 $this->tpl->setVariable(
"TITLE",$item[
'title']);
768 $this->tpl->parseCurrentBlock();
770 $this->tpl->setCurrentBlock(
"container_standard_row");
772 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
773 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg')); 775 $this->tpl->setVariable(
"TYPE_ALT_IMG",$this->lng->txt(
'obj_'.$item[
'type']));
785 if($usr_planed->getPlanedStartingTime())
787 $start = $usr_planed->getPlanedStartingTime();
791 $start = $item[
'suggestion_start'];
795 if($usr_planed->getPlanedEndingTime())
797 $end = $usr_planed->getPlanedEndingTime();
801 $end = $item[
'suggestion_end'];
803 if(
$start != $item[
'suggestion_start']
or $end != $item[
'suggestion_end'])
806 $this->tpl->setVariable(
"OK_ALT",$this->lng->txt(
'crs_timings_changed'));
811 $this->tpl->setVariable(
"OK_ALT",$this->lng->txt(
'crs_timings_not_changed'));
816 $this->tpl->parseCurrentBlock();
832 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings_adv.html',
'Modules/Course');
836 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
838 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'obj_crs'));
839 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT",$this->lng->txt(
'timings_usr_edit'));
841 if(!
$_SESSION[
'crs_timings_user_hidden'])
843 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'show_details'));
844 $this->ctrl->setParameter($this,
'show_details',1);
845 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
849 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'hide_details'));
850 $this->ctrl->setParameter($this,
'show_details',0);
851 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
853 $this->ctrl->clearParameters($this);
854 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
855 $this->tpl->setVariable(
"TXT_START_END",$this->lng->txt(
'crs_timings_short_start_end'));
856 $this->tpl->setVariable(
"TXT_INFO_START_END",$this->lng->txt(
'crs_timings_start_end_info'));
858 $this->tpl->setVariable(
"TXT_LIMIT",$this->lng->txt(
'crs_timings_short_limit_start_end'));
859 $this->tpl->setVariable(
"TXT_INFO_LIMIT",$this->lng->txt(
'crs_timings_from_until'));
861 $this->tpl->setVariable(
"TXT_OWN_PRESETTING",$this->lng->txt(
'crs_timings_planed_start'));
862 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING",$this->lng->txt(
'crs_timings_start_end_info'));
864 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'crs_timings_time_frame'));
865 $this->tpl->setVariable(
"TXT_INFO_DURATION",$this->lng->txt(
'crs_timings_in_days'));
867 $this->tpl->setVariable(
"TXT_BTN_UPDATE",$this->lng->txt(
'save'));
868 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
870 include_once
'Services/Object/classes/class.ilObjectActivation.php';
874 foreach($sorted_items as $item)
876 switch($item[
'type'])
890 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings.html',
'Modules/Course');
895 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
897 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'obj_crs'));
899 if(!
$_SESSION[
'crs_timings_user_hidden'])
901 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'show_details'));
902 $this->ctrl->setParameter($this,
'show_details',1);
903 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
907 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'hide_details'));
908 $this->ctrl->setParameter($this,
'show_details',0);
909 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
911 $this->ctrl->clearParameters($this);
913 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT",$this->lng->txt(
'timings_timings'));
914 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
915 $this->tpl->setVariable(
"TXT_START",$this->lng->txt(
'crs_timings_sug_begin'));
916 $this->tpl->setVariable(
"TXT_END",$this->lng->txt(
'crs_timings_sug_end'));
918 include_once
'Services/Object/classes/class.ilObjectActivation.php';
922 foreach($sorted_items as $item)
924 switch($item[
'type'])
940 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
941 include_once
'./Services/Link/classes/class.ilLink.php';
942 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
944 if(!$ilAccess->checkAccess(
'visible',
'',$item[
'ref_id']))
949 $this->lng->loadLanguageModule(
'meta');
951 $usr_planed =
new ilTimingPlaned($item[
'ref_id'],$ilUser->getId());
953 for($i = 0;$i < $level;$i++)
955 $this->tpl->touchBlock(
'start_indent');
956 $this->tpl->touchBlock(
'end_indent');
958 if(strlen($item[
'description']))
960 $this->tpl->setCurrentBlock(
"item_description");
961 $this->tpl->setVariable(
"DESC",$item[
'description']);
962 $this->tpl->parseCurrentBlock();
966 $this->tpl->setCurrentBlock(
"tlt");
967 $this->tpl->setVariable(
"TXT_TLT",$this->lng->txt(
'meta_typical_learning_time'));
969 $this->tpl->parseCurrentBlock();
972 if(!$item[
'title'] &&
973 $item[
'type'] ==
'sess')
975 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
980 if($ilAccess->checkAccess(
'read',
'',$item[
'ref_id']))
982 $this->tpl->setCurrentBlock(
"title_as_link");
983 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'],$item[
'type']));
984 $this->tpl->setVariable(
"TITLE_NAME",$item[
'title']);
985 $this->tpl->parseCurrentBlock();
989 $this->tpl->setCurrentBlock(
"title_plain");
990 $this->tpl->setVariable(
"TITLE",$item[
'title']);
991 $this->tpl->parseCurrentBlock();
993 $this->tpl->setCurrentBlock(
"container_standard_row");
995 if(isset($this->invalid[
"$item[ref_id]"]))
997 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
1001 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
1003 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg')); 1005 $this->tpl->setVariable(
"TYPE_ALT_IMG",$this->lng->txt(
'obj_'.$item[
'type']));
1014 if($item[
'changeable'])
1016 $item_prefix =
"item[".$item[
'ref_id'].
']';
1018 if(is_array(
$_POST[
'item'][
"$item[ref_id]"][
'own_start']))
1020 #echo "Start post<br>"; 1023 elseif($usr_planed->getPlanedStartingTime())
1025 #echo "Own start<br>"; 1026 $start = $usr_planed->getPlanedStartingTime();
1030 #echo "Empfehlung start<br>"; 1031 $start = $item[
'suggestion_start'];
1035 $this->tpl->setVariable(
"OWN_START",
1037 $date[
'y'],$date[
'm'],$date[
'd'],
date(
'Y',
time()),
false));
1039 if($usr_planed->getPlanedEndingTime())
1041 #echo "Own End<br>"; 1042 $end = $usr_planed->getPlanedEndingTime();
1046 #echo "Empfehlung end<br>"; 1047 $end = $item[
'suggestion_end'];
1050 $this->tpl->setVariable(
"NAME_DURATION",$item_prefix.
"[duration]");
1053 if(isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration']))
1055 $this->tpl->setVariable(
"VAL_DURATION",
$_POST[
'item'][
"$item[ref_id]"][
'duration']);
1059 $this->tpl->setVariable(
"VAL_DURATION",intval(($end -
$start) / (60 * 60 * 24)));
1065 $this->tpl->parseCurrentBlock();
1067 if(!
$_SESSION[
'crs_timings_user_hidden'])
1080 global $ilAccess, $ilToolbar;
1082 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
1087 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1090 if(!
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()])
1092 $btn->setCaption(
"timings_timings_on");
1093 $btn->setUrl($this->ctrl->getLinkTarget($this,
'timingsOn'));
1097 $btn->setCaption(
"timings_timings_off");
1098 $btn->setUrl($this->ctrl->getLinkTarget($this,
'timingsOff'));
1101 $ilToolbar->addButtonInstance($btn);
1107 $_SESSION[
'crs_timings_panel'][$this->course_obj->getId()] = 1;
1109 $ilTabs->clearSubTabs();
1117 $_SESSION[
'crs_timings_panel'][$this->course_obj->getId()] = 0;
1119 $ilTabs->clearSubTabs();
1127 global
$ilUser,$ilObjDataCache;
1128 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1131 $this->invalid =
array();
1137 if(isset(
$data[
'duration']))
1139 $data[
'own_start'][
'd'] +=
$data[
'duration'];
1140 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start'],
array(
'h' => 23,
'm' => 55)));
1144 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start']),
array(
'h' => 23,
'm' => 55));
1146 if(!$tmp_planed->validate())
1148 $this->invalid[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$ref_id));
1150 $all_items[] = $tmp_planed;
1152 if(count($this->invalid))
1154 $message = $this->lng->txt(
'crs_timings_update_error');
1155 $message .= (
"<br />".$this->lng->txt(
'crs_materials').
': ');
1156 $message .= (implode(
',',$this->invalid));
1161 foreach($all_items as $new_item_obj)
1163 $new_item_obj->update();
1180 $item[
'suggestion_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_start']);
1181 if(isset(
$_POST[
'item'][$obj_id][
'sug_end']))
1184 $item[
'suggestion_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_end']);
1186 $item[
'earliest_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'lim_start']);
1187 $item[
'latest_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'lim_end']);
1190 $item[
'duration_a'] =
$_POST[
'item'][
$obj_id][
'duration_a'];
1191 $item[
'duration_b'] =
$_POST[
'item'][
$obj_id][
'duration_b'];
1198 include_once
'Services/Object/classes/class.ilObjectActivation.php';
1202 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
1204 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$ilErr->WARNING);
1206 $this->failed =
array();
1210 $all_items =
array();
1217 $item_obj->setTimingType(
$_POST[
'item_active'][
$ref_id][
'active'] ?
1220 $item_obj->setTimingStart($old_data[
'timing_start']);
1221 $item_obj->setTimingEnd($old_data[
'timing_end']);
1222 $item_obj->setSuggestionStart($this->
__toUnix(
$data[
"sug_start"]));
1225 $data[
'sug_start'][
'd'] += abs(
$data[
'duration_a']);
1226 $item_obj->setSuggestionEnd($this->
__toUnix(
$data[
'sug_start'],
array(
'h' => 23,
'm' => 55)));
1228 $item_obj->setEarliestStart(
time());
1229 $item_obj->setLatestEnd($this->
__toUnix(
$data[
'lim_end'],
array(
'h' => 23,
'm' => 55)));
1231 $item_obj->toggleVisible($old_data[
'visible']);
1232 $item_obj->toggleChangeable(
$_POST[
'item_change'][
$ref_id][
'change']);
1234 if(!$item_obj->validateActivation())
1236 $this->failed[
$ref_id] = $old_data[
'title'];
1238 $all_items[
$ref_id] =& $item_obj;
1242 if(count($this->failed))
1244 $message = $this->lng->txt(
'crs_timings_update_error');
1245 $message .= (
"<br />".$this->lng->txt(
'crs_materials').
': ');
1246 $message .= (implode(
',',$this->failed));
1253 foreach($all_items as
$ref_id => $item_obj_new)
1255 $item_obj_new->update(
$ref_id);
1264 if($this->container_obj->getType() ==
'crs')
1266 $this->container_gui->setContentSubTabs();
1274 if($this->container_obj->getType() ==
'crs')
1282 $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),
'crs');
1290 return gmmktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
1295 return array(
'y' =>
date(
'Y',$a_unix_time),
1296 'm' =>
date(
'm',$a_unix_time),
1297 'd' =>
date(
'd',$a_unix_time));
1302 return array(
'h' =>
date(
'G',$a_unix_time),
1303 'm' =>
date(
'i',$a_unix_time),
1304 's' =>
date(
's',$a_unix_time));
1312 $path_arr = $tree->getPathFull($a_ref_id,$this->course_obj->getRefId());
1314 foreach($path_arr as
$data)
1320 $path .= $data[
'title'];
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
__toUnix($date, $time=array())
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.
static getCmdSide()
Get Column Side of Current Command.
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
setColumnSettings($column_gui)
__renderItem($item, $level)
view()
Output course content.
getRightColumnHTML()
Display right column.
__editAdvancedUserTimings()
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static getItem($a_ref_id)
Get item data.
setValue($a_value)
Set Value.
const TIMINGS_DEACTIVATED
__showUserAcceptanceTable()
__prepareTimeSelect($a_unix_time)
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
getCenterColumnHTML()
Get center column.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
Column user interface class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)
static _lookupObjId($a_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static _appointmentToString($start, $end, $fulltime)
static formatDate(ilDateTime $date)
Format a date public.
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
static makeDateSelect($prefix, $year="", $month="", $day="", $startyear="", $a_long_month=true, $a_further_options=array(), $emptyoption=false)
Creates a combination of HTML selects for date inputs.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getScreenMode()
Get Screen Mode for current command.
__construct($container_gui_obj)
Constructor public.
setPlanedStartingTime($a_time)
This class represents a text area property in a property form.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
Class ilCourseContentGUI.
static _lookupAppointment($a_obj_id)
lookup appointment
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
__forwardToColumnGUI()
Get columngui output.
__prepareDateSelect($a_unix_time)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
__renderUserItem($item, $level)
Class ilObjectActivation.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")