ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTimingCache Class Reference

class ilTimingCache More...

+ Collaboration diagram for ilTimingCache:

Public Member Functions

_getTimings ($a_ref_id)
 
 _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()

& ilTimingCache::_getTimings (   $a_ref_id)

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

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.
_getPlanedTimingsByItem($a_item_id)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _showWarning()

ilTimingCache::_showWarning (   $a_ref_id,
  $a_usr_id 
)

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

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 _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
static getInstance($a_obj_id)
& _getTimings($a_ref_id)
_showWarning($a_ref_id, $a_usr_id)

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

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

+ 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: