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

class ilTimingCache More...

+ Collaboration diagram for ilTimingCache:

Static Public Member Functions

static & _getTimings ($a_ref_id)
 
static _showWarning ($a_ref_id, $a_usr_id)
 

Detailed Description

class ilTimingCache

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 35 of file class.ilTimingCache.php.

Member Function Documentation

◆ _getTimings()

static& ilTimingCache::_getTimings (   $a_ref_id)
static

Definition at line 37 of file class.ilTimingCache.php.

References ilTimingPlaned\_getPlanedTimingsByItem(), array, and ilObjectActivation\getItem().

Referenced by _showWarning(), and ilLPTableBaseGUI\showTimingsWarning().

38  {
39  static $cache = array();
40 
41  if(isset($cache[$a_ref_id]))
42  {
43  return $cache[$a_ref_id];
44  }
45  $cache[$a_ref_id]['item'] = ilObjectActivation::getItem($a_ref_id);
46  $cache[$a_ref_id]['user'] = ilTimingPlaned::_getPlanedTimingsByItem($a_ref_id);
47 
48  return $cache[$a_ref_id];
49  }
static getItem($a_ref_id)
Get item data.
static _getPlanedTimingsByItem($a_item_id)
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:

◆ _showWarning()

static ilTimingCache::_showWarning (   $a_ref_id,
  $a_usr_id 
)
static

Definition at line 51 of file class.ilTimingCache.php.

References _getTimings(), ilLPStatus\_hasUserCompleted(), ilObjectLP\getInstance(), time, and ilObjectActivation\TIMINGS_PRESETTING.

Referenced by ilLPTableBaseGUI\showTimingsWarning().

52  {
53  global $ilObjDataCache;
54 
55  $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
56 
57  // if completed no warning
58  include_once './Services/Tracking/classes/class.ilLPStatus.php';
59  if(ilLPStatus::_hasUserCompleted($obj_id, $a_usr_id))
60  {
61  return false;
62  }
63 
64  // if editing time reached => show warning
65  $timings =& ilTimingCache::_getTimings($a_ref_id);
66  if($timings['item']['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING)
67  {
68  if($timings['item']['changeable'] and $timings['user'][$a_usr_id]['end'])
69  {
70  $end = $timings['user'][$a_usr_id]['end'];
71  }
72  else
73  {
74  $end = $timings['item']['suggestion_end'];
75  }
76  if($end < time())
77  {
78  return true;
79  }
80  }
81 
82  include_once './Services/Object/classes/class.ilObjectLP.php';
83  $olp = ilObjectLP::getInstance($obj_id);
84  $collection = $olp->getCollectionInstance();
85  if($collection instanceof ilLPCollectionOfRepositoryObjects)
86  {
87  foreach($collection->getItems() as $item)
88  {
89  if(ilTimingCache::_showWarning($item, $a_usr_id))
90  {
91  return true;
92  }
93  }
94  }
95 
96  // Really ???
97  return false;
98  }
static _showWarning($a_ref_id, $a_usr_id)
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static getInstance($a_obj_id)
static & _getTimings($a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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