ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilCourseContentGUI Class Reference

Class ilCourseContentGUI. More...

+ Inheritance diagram for ilCourseContentGUI:
+ Collaboration diagram for ilCourseContentGUI:

Public Member Functions

 __construct ($container_gui_obj)
 Constructor public. More...
 
 executeCommand ()
 
 __getDefaultCommand ()
 
 __checkStartObjects ()
 
 showStartObjects ()
 
 view ()
 Output course content. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 
 __forwardToColumnGUI ()
 Get columngui output. More...
 
 editTimings ()
 
 __showUserAcceptanceTable ()
 
 saveAcceptance ()
 
 editUserTimings ()
 
 returnToMembers ()
 
 showUserTimings ()
 
 __renderUserItem ($item, $level)
 
 __editAdvancedUserTimings ()
 
 __editUserTimings ()
 
 __renderItem ($item, $level)
 
 __showTimingsPanel ()
 
 timingsOn ()
 
 timingsOff ()
 
 updateUserTimings ()
 
__loadFromPost (&$item)
 
 updateTimings ()
 
 __setSubTabs ()
 
 __initCourseObject ()
 
 __toUnix ($date, $time=array())
 
 __prepareDateSelect ($a_unix_time)
 
 __prepareTimeSelect ($a_unix_time)
 
 __buildPath ($a_ref_id)
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $container_gui
 
 $container_obj
 
 $course_obj
 
 $tpl
 
 $ctrl
 
 $lng
 
 $tabs_gui
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCourseContentGUI::__construct (   $container_gui_obj)

Constructor public.

Parameters
ilObjectGUI

Definition at line 31 of file class.ilCourseContentGUI.php.

References $ilCtrl, $lng, $tpl, and __initCourseObject().

32  {
33  global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;
34 
35  $this->tpl = $tpl;
36  $this->ctrl = $ilCtrl;
37  $this->lng = $lng;
38  $this->lng->loadLanguageModule('crs');
39  $this->tabs_gui = $ilTabs;
40 
41  $this->container_gui =& $container_gui_obj;
42  $this->container_obj =& $this->container_gui->object;
43 
44  $this->__initCourseObject();
45  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ __buildPath()

ilCourseContentGUI::__buildPath (   $a_ref_id)

Definition at line 1308 of file class.ilCourseContentGUI.php.

References $counter, ilObjectGUI\$data, $path, and ilObjectGUI\$tree.

1309  {
1310  global $tree;
1311 
1312  $path_arr = $tree->getPathFull($a_ref_id,$this->course_obj->getRefId());
1313  $counter = 0;
1314  foreach($path_arr as $data)
1315  {
1316  if($counter++)
1317  {
1318  $path .= " -> ";
1319  }
1320  $path .= $data['title'];
1321  }
1322 
1323  return $path;
1324  }
$path
Definition: aliased.php:25
$counter

◆ __checkStartObjects()

ilCourseContentGUI::__checkStartObjects ( )

Definition at line 125 of file class.ilCourseContentGUI.php.

References $ilUser.

Referenced by executeCommand().

126  {
127  include_once './Modules/Course/classes/class.ilCourseStart.php';
128 
129  global $ilAccess,$ilUser;
130 
131  if($ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
132  {
133  return true;
134  }
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()))
137  {
138  return false;
139  }
140  return true;
141  }
Class ilObj<module_name>
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ __editAdvancedUserTimings()

ilCourseContentGUI::__editAdvancedUserTimings ( )

Definition at line 830 of file class.ilCourseContentGUI.php.

References $_SESSION, __renderItem(), __showTimingsPanel(), __showUserAcceptanceTable(), ilUtil\getImagePath(), and ilObjectActivation\getTimingsItems().

Referenced by editUserTimings().

831  {
832  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_usr_edit_timings_adv.html','Modules/Course');
833  $this->__showTimingsPanel();
834  $this->__showUserAcceptanceTable();
835 
836  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
837  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.svg'));
838  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_crs'));
839  $this->tpl->setVariable("BLOCK_HEADER_CONTENT",$this->lng->txt('timings_usr_edit'));
840 
841  if(!$_SESSION['crs_timings_user_hidden'])
842  {
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'));
846  }
847  else
848  {
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'));
852  }
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'));
857 
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'));
860 
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'));
863 
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'));
866 
867  $this->tpl->setVariable("TXT_BTN_UPDATE",$this->lng->txt('save'));
868  $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));
869 
870  include_once 'Services/Object/classes/class.ilObjectActivation.php';
871  $sorted_items = ilObjectActivation::getTimingsItems($this->course_obj->getRefId());
872 
873  $this->counter = 0;
874  foreach($sorted_items as $item)
875  {
876  switch($item['type'])
877  {
878  case 'itgr':
879  break;
880 
881  default:
882  $this->__renderItem($item,0);
883  break;
884  }
885  }
886  }
$_SESSION["AccountId"]
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __editUserTimings()

ilCourseContentGUI::__editUserTimings ( )

Definition at line 888 of file class.ilCourseContentGUI.php.

References $_SESSION, __renderItem(), __showTimingsPanel(), __showUserAcceptanceTable(), ilUtil\getImagePath(), and ilObjectActivation\getTimingsItems().

Referenced by editUserTimings().

889  {
890  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_usr_edit_timings.html','Modules/Course');
891 
892  $this->__showTimingsPanel();
893  $this->__showUserAcceptanceTable();
894 
895  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
896  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.svg'));
897  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_crs'));
898 
899  if(!$_SESSION['crs_timings_user_hidden'])
900  {
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'));
904  }
905  else
906  {
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'));
910  }
911  $this->ctrl->clearParameters($this);
912 
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'));
917 
918  include_once 'Services/Object/classes/class.ilObjectActivation.php';
919  $sorted_items = ilObjectActivation::getTimingsItems($this->course_obj->getRefId());
920 
921  $this->counter = 0;
922  foreach($sorted_items as $item)
923  {
924  switch($item['type'])
925  {
926  case 'itgr':
927  break;
928 
929  default:
930  $this->__renderItem($item,0);
931  break;
932  }
933  }
934  }
$_SESSION["AccountId"]
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __forwardToColumnGUI()

ilCourseContentGUI::__forwardToColumnGUI ( )

Get columngui output.

Definition at line 377 of file class.ilCourseContentGUI.php.

References $html, $ilCtrl, ilObjectGUI\$obj_id, ilObject\_lookupObjId(), ilObject\_lookupType(), ilColumnGUI\getCmdSide(), ilColumnGUI\getScreenMode(), IL_COL_LEFT, IL_COL_RIGHT, IL_SCREEN_SIDE, and setColumnSettings().

378  {
379  global $ilCtrl, $ilAccess;
380 
381  include_once("Services/Block/classes/class.ilColumnGUI.php");
382 
383  $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
384  $obj_type = ilObject::_lookupType($obj_id);
385 
386  if (!$ilCtrl->isAsynch())
387  {
388  //if ($column_gui->getScreenMode() != IL_SCREEN_SIDE)
390  {
391  // right column wants center
393  {
394  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
395  $this->setColumnSettings($column_gui);
396  $html = $ilCtrl->forwardCommand($column_gui);
397  }
398  // left column wants center
400  {
401  $column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
402  $this->setColumnSettings($column_gui);
403  $html = $ilCtrl->forwardCommand($column_gui);
404  }
405  }
406  else
407  {
408  {
409  $this->getDefaultView();
410  }
411  }
412  }
413 
414  return $html;
415  }
static getCmdSide()
Get Column Side of Current Command.
const IL_COL_RIGHT
global $ilCtrl
Definition: ilias.php:18
Column user interface class.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static getScreenMode()
Get Screen Mode for current command.
const IL_SCREEN_SIDE
$html
Definition: example_001.php:87
const IL_COL_LEFT
+ Here is the call graph for this function:

◆ __getDefaultCommand()

ilCourseContentGUI::__getDefaultCommand ( )

Definition at line 104 of file class.ilCourseContentGUI.php.

References $_SESSION, and IL_CRS_VIEW_TIMING.

Referenced by executeCommand().

105  {
106  global $ilAccess;
107 
108  // edit timings if panel is on
109  if($_SESSION['crs_timings_panel'][$this->course_obj->getId()])
110  {
111  return 'editTimings';
112  }
113  if($ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
114  {
115  return 'view';
116  }
117  if($this->container_obj->getType() == 'crs' and
118  $this->course_obj->getViewMode() == IL_CRS_VIEW_TIMING)
119  {
120  return 'editUserTimings';
121  }
122  return 'view';
123  }
$_SESSION["AccountId"]
const IL_CRS_VIEW_TIMING
+ Here is the caller graph for this function:

◆ __initCourseObject()

ilCourseContentGUI::__initCourseObject ( )

Definition at line 1270 of file class.ilCourseContentGUI.php.

References $container_obj, ilObjectGUI\$tree, and ilObjectFactory\getInstanceByRefId().

Referenced by __construct().

1271  {
1272  global $tree;
1273 
1274  if($this->container_obj->getType() == 'crs')
1275  {
1276  // Container is course
1277  $this->course_obj =& $this->container_obj;
1278  }
1279  else
1280  {
1281 
1282  $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),'crs');
1283  $this->course_obj =& ilObjectFactory::getInstanceByRefId($course_ref_id);
1284  }
1285  return true;
1286  }
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __loadFromPost()

& ilCourseContentGUI::__loadFromPost ( $item)

Definition at line 1172 of file class.ilCourseContentGUI.php.

References $_POST, ilObjectGUI\$obj_id, __toUnix(), and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by editTimings().

1173  {
1174  $obj_id = $item['obj_id'];
1175 
1176  if(!isset($_POST['item'][$obj_id]))
1177  {
1178  return $item;
1179  }
1180  $item['suggestion_start'] = $this->__toUnix($_POST['item'][$obj_id]['sug_start']);
1181  if(isset($_POST['item'][$obj_id]['sug_end']))
1182  {
1183  // #9325
1184  $item['suggestion_end'] = $this->__toUnix($_POST['item'][$obj_id]['sug_end']);
1185  }
1186  $item['earliest_start'] = $this->__toUnix($_POST['item'][$obj_id]['lim_start']);
1187  $item['latest_end'] = $this->__toUnix($_POST['item'][$obj_id]['lim_end']);
1188  $item['changeable'] = $_POST['item'][$obj_id]['change'];
1189  $item['timing_type'] = $_POST['item'][$obj_id]['active'] ? ilObjectActivation::TIMINGS_PRESETTING : $item['timing_type'];
1190  $item['duration_a'] = $_POST['item'][$obj_id]['duration_a'];
1191  $item['duration_b'] = $_POST['item'][$obj_id]['duration_b'];
1192 
1193  return $item;
1194  }
__toUnix($date, $time=array())
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __prepareDateSelect()

ilCourseContentGUI::__prepareDateSelect (   $a_unix_time)

Definition at line 1293 of file class.ilCourseContentGUI.php.

References array, and date.

Referenced by __renderItem(), and editTimings().

1294  {
1295  return array('y' => date('Y',$a_unix_time),
1296  'm' => date('m',$a_unix_time),
1297  'd' => date('d',$a_unix_time));
1298  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ __prepareTimeSelect()

ilCourseContentGUI::__prepareTimeSelect (   $a_unix_time)

Definition at line 1300 of file class.ilCourseContentGUI.php.

References array, and date.

1301  {
1302  return array('h' => date('G',$a_unix_time),
1303  'm' => date('i',$a_unix_time),
1304  's' => date('s',$a_unix_time));
1305  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.

◆ __renderItem()

ilCourseContentGUI::__renderItem (   $item,
  $level 
)

Definition at line 936 of file class.ilCourseContentGUI.php.

References $_POST, $_SESSION, $ilUser, $start, __prepareDateSelect(), __toUnix(), ilSessionAppointment\_appointmentToString(), ilLink\_getLink(), ilMDEducational\_getTypicalLearningTimeSeconds(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), date, ilDatePresentation\formatDate(), ilObjectActivation\getTimingsItems(), ilUtil\getTypeIconPath(), IL_CAL_UNIX, ilUtil\makeDateSelect(), ilDatePresentation\secondsToString(), ilUtil\switchColor(), time, and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by __editAdvancedUserTimings(), and __editUserTimings().

937  {
938  global $ilUser,$ilAccess;
939 
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';
943 
944  if(!$ilAccess->checkAccess('visible','',$item['ref_id']))
945  {
946  return false;
947  }
948 
949  $this->lng->loadLanguageModule('meta');
950 
951  $usr_planed = new ilTimingPlaned($item['ref_id'],$ilUser->getId());
952 
953  for($i = 0;$i < $level;$i++)
954  {
955  $this->tpl->touchBlock('start_indent');
956  $this->tpl->touchBlock('end_indent');
957  }
958  if(strlen($item['description']))
959  {
960  $this->tpl->setCurrentBlock("item_description");
961  $this->tpl->setVariable("DESC",$item['description']);
962  $this->tpl->parseCurrentBlock();
963  }
964  if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
965  {
966  $this->tpl->setCurrentBlock("tlt");
967  $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
968  $this->tpl->setVariable("TLT_VAL",ilDatePresentation::secondsToString($tlt));
969  $this->tpl->parseCurrentBlock();
970  }
971 
972  if(!$item['title'] &&
973  $item['type'] == 'sess')
974  {
975  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
977  $item['title'] = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
978  }
979 
980  if($ilAccess->checkAccess('read','',$item['ref_id']))
981  {
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();
986  }
987  else
988  {
989  $this->tpl->setCurrentBlock("title_plain");
990  $this->tpl->setVariable("TITLE",$item['title']);
991  $this->tpl->parseCurrentBlock();
992  }
993  $this->tpl->setCurrentBlock("container_standard_row");
994 
995  if(isset($this->invalid["$item[ref_id]"]))
996  {
997  $this->tpl->setVariable("ROWCLASS",'tblrowmarked');
998  }
999  else
1000  {
1001  $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($this->counter++,'tblrow1','tblrow2'));
1002  }
1003  #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg'));
1004  $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($item['type'],$item['obj_id'],'small'));
1005  $this->tpl->setVariable("TYPE_ALT_IMG",$this->lng->txt('obj_'.$item['type']));
1006 
1007 
1008  if($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
1009  {
1010  $this->tpl->setVariable('SUG_START',ilDatePresentation::formatDate(new ilDate($item['suggestion_start'],IL_CAL_UNIX)));
1011  $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
1012  }
1013 
1014  if($item['changeable'])
1015  {
1016  $item_prefix = "item[".$item['ref_id'].']';
1017 
1018  if(is_array($_POST['item']["$item[ref_id]"]['own_start']))
1019  {
1020  #echo "Start post<br>";
1021  $start = $this->__toUnix($_POST['item']["$item[ref_id]"]['own_start']);
1022  }
1023  elseif($usr_planed->getPlanedStartingTime())
1024  {
1025  #echo "Own start<br>";
1026  $start = $usr_planed->getPlanedStartingTime();
1027  }
1028  else
1029  {
1030  #echo "Empfehlung start<br>";
1031  $start = $item['suggestion_start'];
1032  }
1033 
1034  $date = $this->__prepareDateSelect($start);
1035  $this->tpl->setVariable("OWN_START",
1036  ilUtil::makeDateSelect($item_prefix."[own_start]",
1037  $date['y'],$date['m'],$date['d'],date('Y',time()),false));
1038 
1039  if($usr_planed->getPlanedEndingTime())
1040  {
1041  #echo "Own End<br>";
1042  $end = $usr_planed->getPlanedEndingTime();
1043  }
1044  else
1045  {
1046  #echo "Empfehlung end<br>";
1047  $end = $item['suggestion_end'];
1048  }
1049  $this->tpl->setVariable('OWN_END',ilDatePresentation::formatDate(new ilDate($end,IL_CAL_UNIX)));
1050  $this->tpl->setVariable("NAME_DURATION",$item_prefix."[duration]");
1051 
1052  // Duration
1053  if(isset($_POST['item']["$item[ref_id]"]['duration']))
1054  {
1055  $this->tpl->setVariable("VAL_DURATION",$_POST['item']["$item[ref_id]"]['duration']);
1056  }
1057  else
1058  {
1059  $this->tpl->setVariable("VAL_DURATION",intval(($end - $start) / (60 * 60 * 24)));
1060  }
1061  $this->tpl->setVariable('LIM_START',ilDatePresentation::formatDate(new ilDate($item['earliest_start'],IL_CAL_UNIX)));
1062  $this->tpl->setVariable('LIM_END',ilDatePresentation::formatDate(new ilDate($item['latest_end'],IL_CAL_UNIX)));
1063  }
1064 
1065  $this->tpl->parseCurrentBlock();
1066 
1067  if(!$_SESSION['crs_timings_user_hidden'])
1068  {
1069  return true;
1070  }
1071 
1072  foreach(ilObjectActivation::getTimingsItems($item['ref_id']) as $item_data)
1073  {
1074  $this->__renderItem($item_data,$level+1);
1075  }
1076  }
__toUnix($date, $time=array())
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
$_SESSION["AccountId"]
class ilTimingPlaned
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
const IL_CAL_UNIX
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...
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
static _lookupObjId($a_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static _appointmentToString($start, $end, $fulltime)
static formatDate(ilDateTime $date)
Format a date public.
$ilUser
Definition: imgupload.php:18
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.
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 _lookupAppointment($a_obj_id)
lookup appointment
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __renderUserItem()

ilCourseContentGUI::__renderUserItem (   $item,
  $level 
)

Definition at line 731 of file class.ilCourseContentGUI.php.

References $_GET, $start, ilSessionAppointment\_appointmentToString(), ilMDEducational\_getTypicalLearningTimeSeconds(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilObjectActivation\getTimingsAdministrationItems(), ilUtil\getTypeIconPath(), ilObjectActivation\hasChangeableTimings(), IL_CAL_UNIX, ilDatePresentation\secondsToString(), ilUtil\switchColor(), and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by showUserTimings().

732  {
733  include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
734  include_once './Services/MetaData/classes/class.ilMDEducational.php';
735 
736  $this->lng->loadLanguageModule('meta');
737 
738  $usr_planed = new ilTimingPlaned($item['ref_id'],$_GET['member_id']);
739  for($i = 0;$i < $level;$i++)
740  {
741  $this->tpl->touchBlock('start_indent');
742  $this->tpl->touchBlock('end_indent');
743  }
744  if(strlen($item['description']))
745  {
746  $this->tpl->setCurrentBlock("item_description");
747  $this->tpl->setVariable("DESC",$item['description']);
748  $this->tpl->parseCurrentBlock();
749  }
750  if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
751  {
752  $this->tpl->setCurrentBlock("tlt");
753  $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
754  $this->tpl->setVariable("TLT_VAL",ilDatePresentation::secondsToString($tlt));
755  $this->tpl->parseCurrentBlock();
756  }
757 
758  if(!$item['title'] &&
759  $item['type'] == 'sess')
760  {
761  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
763  $item['title'] = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
764  }
765 
766  $this->tpl->setCurrentBlock("title_plain");
767  $this->tpl->setVariable("TITLE",$item['title']);
768  $this->tpl->parseCurrentBlock();
769 
770  $this->tpl->setCurrentBlock("container_standard_row");
771 
772  $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($this->counter++,'tblrow1','tblrow2'));
773  #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg'));
774  $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($item['type'],$item['obj_id'],'tiny'));
775  $this->tpl->setVariable("TYPE_ALT_IMG",$this->lng->txt('obj_'.$item['type']));
776 
777  if($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
778  {
779  $this->tpl->setVariable('SUG_START',ilDatePresentation::formatDate(new ilDate($item['suggestion_start'],IL_CAL_UNIX)));
780  $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
781  }
782 
783  if($item['changeable'] and $item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
784  {
785  if($usr_planed->getPlanedStartingTime())
786  {
787  $start = $usr_planed->getPlanedStartingTime();
788  }
789  else
790  {
791  $start = $item['suggestion_start'];
792  }
793  $this->tpl->setVariable('OWN_START',ilDatePresentation::formatDate(new ilDate($start,IL_CAL_UNIX)));
794 
795  if($usr_planed->getPlanedEndingTime())
796  {
797  $end = $usr_planed->getPlanedEndingTime();
798  }
799  else
800  {
801  $end = $item['suggestion_end'];
802  }
803  if($start != $item['suggestion_start'] or $end != $item['suggestion_end'])
804  {
805  $this->tpl->setVariable("OK_IMG",ilUtil::getImagePath('icon_ok.svg'));
806  $this->tpl->setVariable("OK_ALT",$this->lng->txt('crs_timings_changed'));
807  }
808  else
809  {
810  $this->tpl->setVariable("OK_IMG",ilUtil::getImagePath('icon_not_ok.svg'));
811  $this->tpl->setVariable("OK_ALT",$this->lng->txt('crs_timings_not_changed'));
812  }
813  $this->tpl->setVariable('OWN_END',ilDatePresentation::formatDate(new ilDate($end,IL_CAL_UNIX)));
814  }
815 
816  $this->tpl->parseCurrentBlock();
817 
818  foreach(ilObjectActivation::getTimingsAdministrationItems($item['ref_id']) as $item_data)
819  {
820  if(($item_data['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) or
821  ilObjectActivation::hasChangeableTimings($item_data['ref_id']))
822  {
823  $this->__renderUserItem($item_data,$level+1);
824  }
825  }
826  }
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
$_GET["client_id"]
class ilTimingPlaned
const IL_CAL_UNIX
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...
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
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)
static _appointmentToString($start, $end, $fulltime)
static formatDate(ilDateTime $date)
Format a date public.
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 _lookupAppointment($a_obj_id)
lookup appointment
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSubTabs()

ilCourseContentGUI::__setSubTabs ( )

Definition at line 1262 of file class.ilCourseContentGUI.php.

Referenced by executeCommand(), timingsOff(), and timingsOn().

1263  {
1264  if($this->container_obj->getType() == 'crs')
1265  {
1266  $this->container_gui->setContentSubTabs();
1267  }
1268  }
+ Here is the caller graph for this function:

◆ __showTimingsPanel()

ilCourseContentGUI::__showTimingsPanel ( )

Definition at line 1078 of file class.ilCourseContentGUI.php.

References $_SESSION, and ilLinkButton\getInstance().

Referenced by __editAdvancedUserTimings(), __editUserTimings(), and editTimings().

1079  {
1080  global $ilAccess, $ilToolbar;
1081 
1082  if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
1083  {
1084  return true;
1085  }
1086 
1087  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1088  $btn = ilLinkButton::getInstance();
1089 
1090  if(!$_SESSION['crs_timings_panel'][$this->course_obj->getId()])
1091  {
1092  $btn->setCaption("timings_timings_on");
1093  $btn->setUrl($this->ctrl->getLinkTarget($this,'timingsOn'));
1094  }
1095  else
1096  {
1097  $btn->setCaption("timings_timings_off");
1098  $btn->setUrl($this->ctrl->getLinkTarget($this,'timingsOff'));
1099  }
1100 
1101  $ilToolbar->addButtonInstance($btn);
1102  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showUserAcceptanceTable()

ilCourseContentGUI::__showUserAcceptanceTable ( )

Definition at line 585 of file class.ilCourseContentGUI.php.

References $ilUser, ilCheckboxInputGUI\setChecked(), and ilTextAreaInputGUI\setValue().

Referenced by __editAdvancedUserTimings(), and __editUserTimings().

586  {
587  global $ilUser;
588 
589  include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
590  $accept_obj = new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
591 
592  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
593  $form = new ilPropertyFormGUI();
594  $form->setFormAction($this->ctrl->getFormAction($this, 'saveAcceptance'));
595  $form->setTitle($this->lng->txt('timing_accept_table'));
596 
597  $accept = new ilCheckboxInputGUI($this->lng->txt('timing_user_accept'), "accepted");
598  $accept->setChecked($accept_obj->isAccepted());
599  $form->addItem($accept);
600 
601  $remark = new ilTextAreaInputGUI($this->lng->txt('timing_remark'), "remark");
602  $remark->setValue($accept_obj->getRemark());
603  $form->addItem($remark);
604 
605  $tutor = new ilCheckboxInputGUI($this->lng->txt('timing_tutor_visible'), "tutor");
606  $tutor->setChecked($accept_obj->isVisible());
607  $form->addItem($tutor);
608 
609  $form->addCommandButton('saveAcceptance', $this->lng->txt('save'));
610  $this->tpl->setVariable("FORM", $form->getHTML());
611  }
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
$ilUser
Definition: imgupload.php:18
class ilTimingAccepted
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __toUnix()

ilCourseContentGUI::__toUnix (   $date,
  $time = array() 
)

Definition at line 1288 of file class.ilCourseContentGUI.php.

Referenced by __loadFromPost(), __renderItem(), editTimings(), updateTimings(), and updateUserTimings().

1289  {
1290  return gmmktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1291  }
+ Here is the caller graph for this function:

◆ editTimings()

ilCourseContentGUI::editTimings ( )

Definition at line 417 of file class.ilCourseContentGUI.php.

References $_POST, $counter, $ilErr, $start, __loadFromPost(), __prepareDateSelect(), __showTimingsPanel(), __toUnix(), ilSessionAppointment\_appointmentToString(), ilFrameTargetInfo\_getFrame(), ilLink\_getLink(), ilMDEducational\_getTypicalLearningTimeSeconds(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), date, ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilObjectActivation\getTimingsAdministrationItems(), IL_CAL_UNIX, ilUtil\makeDateSelect(), ilDatePresentation\secondsToString(), ilUtil\switchColor(), time, and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by editUserTimings(), timingsOn(), and updateTimings().

418  {
419  global $ilAccess,$ilErr;
420 
421  include_once 'Services/MetaData/classes/class.ilMDEducational.php';
422  include_once './Services/Link/classes/class.ilLink.php';
423 
424  $this->lng->loadLanguageModule('meta');
425 
426  if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
427  {
428  $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
429  }
430  $this->__showTimingsPanel();
431  $this->tabs_gui->setSubTabActive('timings_timings');
432 
433  include_once 'Services/Object/classes/class.ilObjectActivation.php';
434  $this->cont_arr = ilObjectActivation::getTimingsAdministrationItems($this->container_obj->getRefId());
435 
436  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_edit_items.html','Modules/Course');
437  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
438  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_crs.svg'));
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'));
442 
443 
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'));
446 
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'));
449 
450  $this->tpl->setVariable("TXT_CHANGEABLE",$this->lng->txt('crs_timings_short_changeable'));
451 
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'));
456 
457  $counter = 0;
458  foreach($this->cont_arr as $item)
459  {
460  if($item['type'] == 'itgr')
461  {
462  continue;
463  }
464  $item = $this->__loadFromPost($item);
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]]";
468 
469  if($item['type'] == 'grp' or
470  $item['type'] == 'fold')
471  {
472  $this->tpl->setVariable("TITLE_LINK",ilLink::_getLink($item['ref_id'],$item['type']));
473  $this->tpl->setVariable("TITLE_FRAME",ilFrameTargetInfo::_getFrame('MainContent',$item['type']));
474  $this->tpl->setVariable("TITLE_LINK_NAME",$item['title']);
475  }
476  else
477  {
478  if(!$item['title'] &&
479  $item['type'] == 'sess')
480  {
481  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
483  $item['title'] = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
484  }
485 
486  $this->tpl->setVariable("TITLE",$item['title']);
487  }
488 
489  if(strlen($item['description']))
490  {
491  $this->tpl->setCurrentBlock("item_description");
492  $this->tpl->setVariable("DESC",$item['description']);
493  $this->tpl->parseCurrentBlock();
494  }
495 
496  if($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id']))
497  {
498  $this->tpl->setCurrentBlock("tlt");
499  $this->tpl->setVariable("TXT_TLT",$this->lng->txt('meta_typical_learning_time'));
500  $this->tpl->setVariable("TLT_VAL",ilDatePresentation::secondsToString($tlt));
501  $this->tpl->parseCurrentBlock();
502  }
503 
504  $this->tpl->setCurrentBlock("container_standard_row");
505 
506  // Suggested
507  if(is_array($_POST['item']["$item[ref_id]"]['sug_start']))
508  {
509  $start = $this->__toUnix($_POST['item']["$item[ref_id]"]['sug_start']);
510  }
511  else
512  {
513  $start = $item['suggestion_start'];
514  }
515  $end = $item['suggestion_end'];
516  $date = $this->__prepareDateSelect($start);
517  $this->tpl->setVariable("SUG_START",
518  ilUtil::makeDateSelect($item_prefix."[sug_start]",
519  $date['y'],$date['m'],$date['d'],date('Y',time()),false));
520 
521  $this->tpl->setVariable("NAME_DURATION_A",$item_prefix."[duration_a]");
522  if(isset($_POST['item']["$item[ref_id]"]['duration_a']))
523  {
524  $this->tpl->setVariable("VAL_DURATION_A",abs($_POST['item']["$item[ref_id]"]['duration_a']));
525  }
526  else
527  {
528  $this->tpl->setVariable("VAL_DURATION_A",intval(($end-$start)/(60*60*24)));
529  }
530 
531  $this->tpl->setVariable('SUG_END',ilDatePresentation::formatDate(new ilDate($item['suggestion_end'],IL_CAL_UNIX)));
532 
533  // Limit
534  if(is_array($_POST['item']["$item[ref_id]"]['lim_end']))
535  {
536  $end = $this->__toUnix($_POST['item']["$item[ref_id]"]['lim_end']);
537  }
538  else
539  {
540  $end = $item['latest_end'];
541  }
542 
543  $date = $this->__prepareDateSelect($end);
544  $this->tpl->setVariable("LIM_END",
545  ilUtil::makeDateSelect($item_prefix."[lim_end]",
546  $date['y'],$date['m'],$date['d'],date('Y',time()),false));
547 
548  $this->tpl->setVariable("NAME_CHANGE",$item_change_prefix."[change]");
549  $this->tpl->setVariable("NAME_ACTIVE",$item_active_prefix."[active]");
550 
551  if(isset($_POST['item']))
552  {
553  $change = $_POST['item_change']["$item[ref_id]"]['change'];
554  $active = $_POST['item_active']["$item[ref_id]"]['active'];
555  }
556  else
557  {
558  $change = $item['changeable'];
559  $active = ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING);
560  }
561 
562  $this->tpl->setVariable("CHECKED_ACTIVE",$active ? 'checked="checked"' : '');
563  $this->tpl->setVariable("CHECKED_CHANGE",$change ? 'checked="checked"' : '');
564 
565  if(isset($this->failed["$item[ref_id]"]))
566  {
567  $this->tpl->setVariable("ROWCLASS",'tblrowmarked');
568  }
569  else
570  {
571  $this->tpl->setVariable("ROWCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
572  }
573  $this->tpl->parseCurrentBlock();
574  }
575 
576  // Select all
577  $this->tpl->setVariable("CHECKCLASS",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
578  $this->tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
579 
580  $this->tpl->setVariable("BTN_SAVE",$this->lng->txt('save'));
581  $this->tpl->setVariable("BTN_CANCEL",$this->lng->txt('cancel'));
582 
583  }
global $ilErr
Definition: raiseError.php:16
__toUnix($date, $time=array())
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
const IL_CAL_UNIX
$counter
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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 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.
static _getFrame($a_class, $a_type='')
Get content frame name.
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 _lookupAppointment($a_obj_id)
lookup appointment
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editUserTimings()

ilCourseContentGUI::editUserTimings ( )

Definition at line 628 of file class.ilCourseContentGUI.php.

References $_GET, $_SESSION, $ilErr, __editAdvancedUserTimings(), __editUserTimings(), editTimings(), and ilObjectActivation\hasChangeableTimings().

Referenced by saveAcceptance(), timingsOff(), and updateUserTimings().

629  {
630  if($_SESSION['crs_timings_panel'][$this->course_obj->getId()])
631  {
632  return $this->editTimings();
633  }
634  global $ilAccess,$ilErr;
635 
636  if(!$ilAccess->checkAccess('read','',$this->container_obj->getRefId()))
637  {
638  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
639  }
640  $this->tabs_gui->setSubTabActive('timings_timings');
641 
642  $_SESSION['crs_timings_user_hidden'] = isset($_GET['show_details']) ? $_GET['show_details'] : $_SESSION['crs_timings_user_hidden'];
643 
644  include_once 'Services/Object/classes/class.ilObjectActivation.php';
645  if(ilObjectActivation::hasChangeableTimings($this->course_obj->getRefId()))
646  {
647  $this->__editAdvancedUserTimings();
648  }
649  else
650  {
651  $this->__editUserTimings();
652  }
653  }
global $ilErr
Definition: raiseError.php:16
$_SESSION["AccountId"]
$_GET["client_id"]
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCourseContentGUI::executeCommand ( )

Definition at line 47 of file class.ilCourseContentGUI.php.

References $_GET, $_SESSION, $cmd, $ilCtrl, $ilErr, __checkStartObjects(), __getDefaultCommand(), __setSubTabs(), showStartObjects(), and view().

48  {
49  global $ilAccess, $ilErr, $ilTabs, $ilCtrl;
50 
51  if(!$ilAccess->checkAccess('read','',$this->container_obj->getRefId()))
52  {
53  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
54  }
55 
56  // Handle timings view
57  $_SESSION['crs_timings'] = true;
58 
59  $this->__setSubTabs();
60  $this->tabs_gui->setTabActive('view_content');
61  $cmd = $this->ctrl->getCmd();
62 
63  switch($this->ctrl->getNextClass($this))
64  {
65  case 'ilcoursearchivesgui':
66  $this->__forwardToArchivesGUI();
67  break;
68 
69  case "ilcolumngui":
70  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
71  $ilTabs->setSubTabActive("crs_content");
72  $this->view();
73  break;
74 
75  default:
76  if(!$this->__checkStartObjects())
77  {
78  $this->showStartObjects();
79  break;
80  }
81 
82  // forward to objective presentation
83  if((!$this->is_tutor and
84  $this->container_obj->getType() == 'crs' and
85  $this->container_obj->enabledObjectiveView()) ||
86  $_GET["col_return"] == "objectives")
87  {
88  $this->use_objective_presentation = true;
89  $this->view();
90  //$this->__forwardToObjectivePresentation();
91  break;
92  }
93 
94 
95  if(!$cmd)
96  {
97  $cmd = $this->__getDefaultCommand();
98  }
99  $this->$cmd();
100  break;
101  }
102  }
global $ilErr
Definition: raiseError.php:16
$_SESSION["AccountId"]
view()
Output course content.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getRightColumnHTML()

ilCourseContentGUI::getRightColumnHTML ( )

Display right column.

Definition at line 292 of file class.ilCourseContentGUI.php.

References $html, $ilCtrl, $ilUser, $lng, ilObjectGUI\$obj_id, ilObject\_lookupObjId(), ilObject\_lookupType(), IL_COL_RIGHT, IL_SCREEN_FULL, IL_SCREEN_SIDE, and setColumnSettings().

Referenced by view().

293  {
294  global $ilUser, $lng, $ilCtrl, $ilAccess;
295 
296  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
297 
298  $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
299  $obj_type = ilObject::_lookupType($obj_id);
300 
301  include_once("Services/Block/classes/class.ilColumnGUI.php");
302  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
303 
304  if ($column_gui->getScreenMode() == IL_SCREEN_FULL)
305  {
306  return "";
307  }
308 
309  $this->setColumnSettings($column_gui);
310 
311  if ($ilCtrl->getNextClass() == "ilcolumngui" &&
312  $column_gui->getCmdSide() == IL_COL_RIGHT &&
313  $column_gui->getScreenMode() == IL_SCREEN_SIDE)
314  {
315 
316  $html = $ilCtrl->forwardCommand($column_gui);
317  }
318  else
319  {
320  if (!$ilCtrl->isAsynch())
321  {
322  $html = $ilCtrl->getHTML($column_gui);
323  }
324  }
325 
326  return $html;
327  }
const IL_COL_RIGHT
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_FULL
Column user interface class.
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
const IL_SCREEN_SIDE
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnToMembers()

ilCourseContentGUI::returnToMembers ( )

Definition at line 655 of file class.ilCourseContentGUI.php.

656  {
657  $this->ctrl->returnToParent($this);
658  }

◆ saveAcceptance()

ilCourseContentGUI::saveAcceptance ( )

Definition at line 613 of file class.ilCourseContentGUI.php.

References $_POST, $ilUser, editUserTimings(), ilUtil\sendSuccess(), ilTimingAccepted\setRemark(), and ilUtil\stripSlashes().

614  {
615  global $ilUser;
616 
617  include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
618  $accept_obj = new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
619 
620  $accept_obj->setRemark(ilUtil::stripSlashes($_POST['remark']));
621  $accept_obj->accept($_POST['accepted']);
622  $accept_obj->setVisible($_POST['tutor']);
623  $accept_obj->update();
624  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
625  $this->editUserTimings();
626  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
class ilTimingAccepted
$_POST["username"]
+ Here is the call graph for this function:

◆ setColumnSettings()

ilCourseContentGUI::setColumnSettings (   $column_gui)

Definition at line 329 of file class.ilCourseContentGUI.php.

References $lng, array, and ilObjectActivation\getItems().

Referenced by __forwardToColumnGUI(), and getRightColumnHTML().

330  {
331  global $ilAccess, $lng;
332 
333  $column_gui->setRepositoryMode(true);
334  $column_gui->setEnableEdit(false);
335  $column_gui->setBlockProperty("news", "title",
336  $lng->txt("crs_news"));
337 
338  include_once "Services/Object/classes/class.ilObjectActivation.php";
339  $grouped_items = array();
340  foreach(ilObjectActivation::getItems($this->container_obj->getRefId()) as $item)
341  {
342  $grouped_items[$item["type"]][] = $item;
343  }
344 
345  $column_gui->setRepositoryItems($grouped_items);
346  if ($ilAccess->checkAccess("write", "", $this->container_obj->getRefId()))
347  {
348  $column_gui->setEnableEdit(true);
349  }
350 
351  // Allow movement of blocks for tutors
352  if ($this->is_tutor &&
353  $this->container_gui->isActiveAdministrationPanel())
354  {
355  $column_gui->setEnableMovement(true);
356  }
357 
358  // Configure Settings, if administration panel is on
359  if ($this->is_tutor)
360  {
361  $column_gui->setBlockProperty("news", "settings", true);
362  //$column_gui->setBlockProperty("news", "public_notifications_option", true);
363  $column_gui->setBlockProperty("news", "default_visibility_option", true);
364  $column_gui->setBlockProperty("news", "hide_news_block_option", true);
365  }
366 
367  if ($this->container_gui->isActiveAdministrationPanel())
368  {
369  $column_gui->setAdminCommands(true);
370  }
371  }
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStartObjects()

ilCourseContentGUI::showStartObjects ( )

Definition at line 143 of file class.ilCourseContentGUI.php.

References $counter, ilObjectGUI\$ilias, $ilUser, ilObjectGUI\$obj_id, ilObjectGUI\$ref_id, $start, ilConditionHandler\_checkAllConditionsOfTarget(), ilLink\_getLink(), array, ilRepositoryExplorer\buildFrameTarget(), ilUtil\getImagePath(), and ilCourseLMHistory\getLMHistory().

Referenced by executeCommand().

144  {
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';
148 
149  global $rbacsystem,$ilias,$ilUser,$ilAccess,$ilObjDataCache;
150 
151  $this->tabs_gui->setSubTabActive('crs_content');
152 
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'));
159 
160 
161  $lm_continue = new ilCourseLMHistory($this->course_obj->getRefId(),$ilUser->getId());
162  $continue_data = $lm_continue->getLMHistory();
163 
164  $counter = 0;
165  foreach($this->start_obj->getStartObjects() as $start)
166  {
167  $obj_id = $ilObjDataCache->lookupObjId($start['item_ref_id']);
168  $ref_id = $start['item_ref_id'];
169  $type = $ilObjDataCache->lookupType($obj_id);
170 
172 
173  $obj_link = ilLink::_getLink($ref_id,$type);
175  $obj_frame = $obj_frame ? $obj_frame : '';
176 
177  // Tmp fix for tests
178  $obj_frame = $type == 'tst' ? '' : $obj_frame;
179 
180  $contentObj = false;
181 
182  if($ilAccess->checkAccess('read','',$ref_id))
183  {
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();
189  }
190  else
191  {
192  $this->tpl->setCurrentBlock("start_visible");
193  $this->tpl->setVariable("VISIBLE_LINK_START",$ilObjDataCache->lookupTitle($obj_id));
194  $this->tpl->parseCurrentBlock();
195  }
196 
197  // CONTINUE LINK
198  if(isset($continue_data[$ref_id]))
199  {
200  $this->tpl->setCurrentBlock("link");
201  $this->tpl->setVariable("LINK_HREF",ilLink::_getLink($ref_id,'',array('obj_id',
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();
206  }
207 
208  // add to desktop link
209  if(!$ilUser->isDesktopItem($ref_id,$type) and
210  $this->course_obj->getAboStatus())
211  {
212  if ($ilAccess->checkAccess('read','',$ref_id))
213  {
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);
218 
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();
222  }
223  }
224  elseif($this->course_obj->getAboStatus())
225  {
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);
230 
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();
234  }
235 
236 
237  // Description
238  if(strlen($ilObjDataCache->lookupDescription($obj_id)))
239  {
240  $this->tpl->setCurrentBlock("start_description");
241  $this->tpl->setVariable("DESCRIPTION_START",$ilObjDataCache->lookupDescription($obj_id));
242  $this->tpl->parseCurrentBlock();
243  }
244 
245 
246  if($this->start_obj->isFullfilled($ilUser->getId(),$ref_id))
247  {
248  $accomplished = 'accomplished';
249  $icon = ilUtil::getImagePath("icon_ok.svg");
250  }
251  else
252  {
253  $accomplished = 'not_accomplished';
254  $icon = ilUtil::getImagePath("icon_not_ok.svg");
255  }
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();
263  }
264  return true;
265  }
$counter
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
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
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
Create styles array
The data for the language used.
class ilCourseLMHistory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUserTimings()

ilCourseContentGUI::showUserTimings ( )

Definition at line 660 of file class.ilCourseContentGUI.php.

References $_GET, __renderUserItem(), ilObjUser\_lookupName(), ilUtil\getImagePath(), ilObjectActivation\getTimingsAdministrationItems(), ilObjectActivation\hasChangeableTimings(), ilUtil\sendFailure(), and ilObjectActivation\TIMINGS_PRESETTING.

661  {
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');
665 
666  if(!$_GET['member_id'])
667  {
668  ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
669  $this->ctrl->returnToParent($this);
670  }
671 
672 
673  // Back button
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();
679 
680  include_once 'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
681  $usr_accepted = new ilTimingAccepted($this->course_obj->getId(),(int) $_GET['member_id']);
682 
683  if($usr_accepted->isAccepted())
684  {
685  $this->tpl->setVariable("ACC_IMG",ilUtil::getImagePath('icon_ok.svg'));
686  $this->tpl->setVariable("ACC_ALT",$this->lng->txt('timing_accepted'));
687  }
688  else
689  {
690  $this->tpl->setVariable("ACC_IMG",ilUtil::getImagePath('icon_not_ok.svg'));
691  $this->tpl->setVariable("ACC_ALT",$this->lng->txt('timing_not_accepted'));
692  }
693  if($usr_accepted->isVisible() and strlen($usr_accepted->getRemark()))
694  {
695  $this->tpl->setVariable("REMARK",nl2br($usr_accepted->getRemark()));
696  }
697  else
698  {
699  $this->tpl->setVariable("REMARK",$this->lng->txt('not_available'));
700  }
701 
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'));
705 
706  $this->tpl->setVariable("HEADER_IMG",ilUtil::getImagePath('icon_usr.svg'));
707  $this->tpl->setVariable("HEADER_ALT",$this->lng->txt('obj_usr'));
708  $this->tpl->setVariable("TABLE_HEADER",$this->lng->txt('timings_of'));
709  $name = ilObjUser::_lookupName($_GET['member_id']);
710  $this->tpl->setVariable("USER_NAME",$name['lastname'].', '.$name['firstname']);
711 
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'));
718 
719  include_once 'Services/Object/classes/class.ilObjectActivation.php';
720  $items = ilObjectActivation::getTimingsAdministrationItems($this->course_obj->getRefId());
721  foreach($items as $item)
722  {
723  if(($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) or
725  {
726  $this->__renderUserItem($item,0);
727  }
728  }
729  }
static _lookupName($a_user_id)
lookup user name
$_GET["client_id"]
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
class ilTimingAccepted
+ Here is the call graph for this function:

◆ timingsOff()

ilCourseContentGUI::timingsOff ( )

Definition at line 1114 of file class.ilCourseContentGUI.php.

References $_SESSION, __setSubTabs(), and editUserTimings().

1115  {
1116  global $ilTabs;
1117  $_SESSION['crs_timings_panel'][$this->course_obj->getId()] = 0;
1118 
1119  $ilTabs->clearSubTabs();
1120  $this->__setSubTabs();
1121  $this->editUserTimings();
1122  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ timingsOn()

ilCourseContentGUI::timingsOn ( )

Definition at line 1104 of file class.ilCourseContentGUI.php.

References $_SESSION, __setSubTabs(), and editTimings().

1105  {
1106  global $ilTabs;
1107  $_SESSION['crs_timings_panel'][$this->course_obj->getId()] = 1;
1108 
1109  $ilTabs->clearSubTabs();
1110  $this->__setSubTabs();
1111  $this->editTimings();
1112  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ updateTimings()

ilCourseContentGUI::updateTimings ( )

Definition at line 1196 of file class.ilCourseContentGUI.php.

References $_POST, ilObjectGUI\$data, $ilErr, ilObjectGUI\$ref_id, __toUnix(), array, editTimings(), ilObjectActivation\getItem(), ilUtil\sendFailure(), ilUtil\sendSuccess(), time, ilObjectActivation\TIMINGS_DEACTIVATED, and ilObjectActivation\TIMINGS_PRESETTING.

1197  {
1198  include_once 'Services/Object/classes/class.ilObjectActivation.php';
1199 
1200  global $ilAccess,$ilErr;
1201 
1202  if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
1203  {
1204  $ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
1205  }
1206  $this->failed = array();
1207  // Validate
1208 
1209  $_POST['item'] = is_array($_POST['item']) ? $_POST['item'] : array();
1210  $all_items = array();
1211 
1212  foreach($_POST['item'] as $ref_id => $data)
1213  {
1214  $item_obj = new ilObjectActivation();
1215  $old_data = ilObjectActivation::getItem($ref_id);
1216 
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"]));
1223 
1224  // add duration
1225  $data['sug_start']['d'] += abs($data['duration_a']);
1226  $item_obj->setSuggestionEnd($this->__toUnix($data['sug_start'],array('h' => 23,'m' => 55)));
1227 
1228  $item_obj->setEarliestStart(time());
1229  $item_obj->setLatestEnd($this->__toUnix($data['lim_end'],array('h' => 23,'m' => 55)));
1230 
1231  $item_obj->toggleVisible($old_data['visible']);
1232  $item_obj->toggleChangeable($_POST['item_change'][$ref_id]['change']);
1233 
1234  if(!$item_obj->validateActivation())
1235  {
1236  $this->failed[$ref_id] = $old_data['title'];
1237  }
1238  $all_items[$ref_id] =& $item_obj;
1239  unset($item_obj);
1240  }
1241 
1242  if(count($this->failed))
1243  {
1244  $message = $this->lng->txt('crs_timings_update_error');
1245  $message .= ("<br />".$this->lng->txt('crs_materials').': ');
1246  $message .= (implode(',',$this->failed));
1247  ilUtil::sendFailure($message);
1248  $this->editTimings();
1249  return false;
1250  }
1251 
1252  // No do update
1253  foreach($all_items as $ref_id => $item_obj_new)
1254  {
1255  $item_obj_new->update($ref_id);
1256  }
1257  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1258  $this->editTimings();
1259  return false;
1260  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
__toUnix($date, $time=array())
static getItem($a_ref_id)
Get item data.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Class ilObjectActivation.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateUserTimings()

ilCourseContentGUI::updateUserTimings ( )

Definition at line 1125 of file class.ilCourseContentGUI.php.

References $_POST, ilObjectGUI\$data, $ilUser, ilObjectGUI\$ref_id, __toUnix(), array, editUserTimings(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilTimingPlaned\setPlanedStartingTime().

1126  {
1127  global $ilUser,$ilObjDataCache;
1128  include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1129 
1130  // Validate
1131  $this->invalid = array();
1132  foreach($_POST['item'] as $ref_id => $data)
1133  {
1134  $tmp_planed = new ilTimingPlaned($ref_id,$ilUser->getId());
1135 
1136  $tmp_planed->setPlanedStartingTime($this->__toUnix($data['own_start']));
1137  if(isset($data['duration']))
1138  {
1139  $data['own_start']['d'] += $data['duration'];
1140  $tmp_planed->setPlanedEndingTime($this->__toUnix($data['own_start'],array('h' => 23,'m' => 55)));
1141  }
1142  else
1143  {
1144  $tmp_planed->setPlanedEndingTime($this->__toUnix($data['own_start']),array('h' => 23,'m' => 55));
1145  }
1146  if(!$tmp_planed->validate())
1147  {
1148  $this->invalid[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1149  }
1150  $all_items[] = $tmp_planed;
1151  }
1152  if(count($this->invalid))
1153  {
1154  $message = $this->lng->txt('crs_timings_update_error');
1155  $message .= ("<br />".$this->lng->txt('crs_materials').': ');
1156  $message .= (implode(',',$this->invalid));
1157  ilUtil::sendFailure($message);
1158  $this->editUserTimings();
1159  return false;
1160  }
1161  foreach($all_items as $new_item_obj)
1162  {
1163  $new_item_obj->update();
1164  }
1165  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1166  $this->editUserTimings();
1167  return true;
1168 
1169  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
__toUnix($date, $time=array())
class ilTimingPlaned
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setPlanedStartingTime($a_time)
$_POST["username"]
+ Here is the call graph for this function:

◆ view()

ilCourseContentGUI::view ( )

Output course content.

Definition at line 270 of file class.ilCourseContentGUI.php.

References $ilUser, ilObjectGUI\$obj_id, ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), ilObjectGUI\getCenterColumnHTML(), and getRightColumnHTML().

Referenced by executeCommand().

271  {
272  // BEGIN ChangeEvent: record read event.
273  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
274  global $ilUser;
275  $obj_id = ilObject::_lookupObjId($this->container_obj->getRefId());
277  $this->container_obj->getType(), $this->container_obj->getRefId(),
278  $obj_id, $ilUser->getId());
279  // END ChangeEvent: record read event.
280 
281  $this->getCenterColumnHTML();
282 
283  if (!$this->no_right_column)
284  {
285  $this->tpl->setRightContent($this->getRightColumnHTML());
286  }
287  }
getRightColumnHTML()
Display right column.
getCenterColumnHTML()
Get center column.
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $container_gui

ilCourseContentGUI::$container_gui

Definition at line 17 of file class.ilCourseContentGUI.php.

◆ $container_obj

ilCourseContentGUI::$container_obj

Definition at line 18 of file class.ilCourseContentGUI.php.

Referenced by __initCourseObject().

◆ $course_obj

ilCourseContentGUI::$course_obj

Definition at line 19 of file class.ilCourseContentGUI.php.

◆ $ctrl

ilCourseContentGUI::$ctrl

Definition at line 22 of file class.ilCourseContentGUI.php.

◆ $lng

ilCourseContentGUI::$lng

Definition at line 23 of file class.ilCourseContentGUI.php.

Referenced by __construct(), getRightColumnHTML(), and setColumnSettings().

◆ $tabs_gui

ilCourseContentGUI::$tabs_gui

Definition at line 24 of file class.ilCourseContentGUI.php.

◆ $tpl

ilCourseContentGUI::$tpl

Definition at line 21 of file class.ilCourseContentGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: