ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilStudyProgrammeEvents Class Reference
+ Inheritance diagram for ilStudyProgrammeEvents:
+ Collaboration diagram for ilStudyProgrammeEvents:

Public Member Functions

 __construct (protected ilLogger $logger, protected ilAppEventHandler $app_event_handler, protected PRGEventHandler $prg_event_handler)
 
 raise (string $event, array $parameter)
 
 userAssigned (ilPRGAssignment $assignment)
 
 userDeassigned (ilPRGAssignment $a_assignment)
 
 userReAssigned (ilPRGAssignment $assignment)
 
 userSuccessful (ilPRGAssignment $assignment, int $pgs_node_id)
 
 informUserByMailToRestart (ilPRGAssignment $assignment)
 
 userRiskyToFail (ilPRGAssignment $assignment)
 
 validityChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 deadlineChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 scoreChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 userRevertSuccessful (ilPRGAssignment $assignment, int $pgs_node_id)
 

Data Fields

const PUBLIC_EVENTS
 
- Data Fields inherited from StudyProgrammeEvents
const COMPONENT = "components/ILIAS/StudyProgramme"
 
const EVENT_USER_ASSIGNED = 'userAssigned'
 
const EVENT_USER_REASSIGNED = 'userReAssigned'
 
const EVENT_USER_DEASSIGNED = 'userDeassigned'
 
const EVENT_USER_SUCCESSFUL = 'userSuccessful'
 
const EVENT_USER_TO_RESTART = 'informUserToRestart'
 
const EVENT_USER_ABOUT_TO_FAIL = 'userRiskyToFail'
 
const EVENT_VALIDITY_CHANGE = 'vqChange'
 
const EVENT_DEADLINE_CHANGE = 'deadlineChange'
 
const EVENT_SCORE_CHANGE = 'currentPointsChange'
 
const EVENT_USER_NOT_SUCCESSFUL = 'userNotSuccessful'
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeEvents::__construct ( protected ilLogger  $logger,
protected ilAppEventHandler  $app_event_handler,
protected PRGEventHandler  $prg_event_handler 
)

Definition at line 39 of file class.ilStudyProgrammeEvents.php.

43  {
44  }

Member Function Documentation

◆ deadlineChange()

ilStudyProgrammeEvents::deadlineChange ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 193 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

193  : void
194  {
195  $this->raise(self::EVENT_DEADLINE_CHANGE, [
196  "ass_id" => $assignment->getId(),
197  "root_prg_id" => $assignment->getRootId(),
198  "prg_id" => $pgs_node_id,
199  "usr_id" => $assignment->getUserId()
200  ]);
201  }
+ Here is the call graph for this function:

◆ informUserByMailToRestart()

ilStudyProgrammeEvents::informUserByMailToRestart ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 161 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ILIAS\Repository\int().

161  : void
162  {
163  $this->raise(
164  self::EVENT_USER_TO_RESTART,
165  [
166  "ass_id" => (int) $assignment->getId(),
167  "root_prg_id" => (int) $assignment->getRootId()
168  ]
169  );
170  }
+ Here is the call graph for this function:

◆ raise()

ilStudyProgrammeEvents::raise ( string  $event,
array  $parameter 
)

Definition at line 46 of file class.ilStudyProgrammeEvents.php.

References ILIAS\Repository\logger().

46  : void
47  {
48  $parameter_formatter = static function ($value) use (&$parameter_formatter) {
49  if (is_object($value)) {
50  return get_class($value);
51  }
52 
53  if (is_array($value)) {
54  return array_map(
55  $parameter_formatter,
56  $value
57  );
58  }
59 
60  return $value;
61  };
62 
63  $this->logger->debug("PRG raised: " . $event . ' (' . var_export(array_map(
64  $parameter_formatter,
65  $parameter
66  ), true) . ')');
67 
68  if (in_array($event, [
69  self::EVENT_USER_ASSIGNED,
70  self::EVENT_USER_DEASSIGNED,
71  self::EVENT_USER_SUCCESSFUL,
72  self::EVENT_USER_NOT_SUCCESSFUL,
73  self::EVENT_VALIDITY_CHANGE
74  ])) {
75  $this->prg_event_handler->updateLPStatus($parameter['prg_id'], $parameter['usr_id']);
76  }
77 
78  if (in_array($event, [
79  self::EVENT_USER_SUCCESSFUL,
80  self::EVENT_USER_NOT_SUCCESSFUL,
81  self::EVENT_VALIDITY_CHANGE,
82  self::EVENT_SCORE_CHANGE
83  ])
84  && $parameter["root_prg_id"] === $parameter["prg_id"]
85  ) {
86  $cert = fn() => $this->app_event_handler->raise(self::COMPONENT, self::EVENT_USER_SUCCESSFUL, $parameter);
87  $this->prg_event_handler->triggerCertificateOnce($cert, $parameter["root_prg_id"], $parameter["usr_id"]);
88  }
89 
90  if ($event === self::EVENT_USER_ABOUT_TO_FAIL) {
91  $this->prg_event_handler->sendRiskyToFailMail($parameter['ass_id'], $parameter['root_prg_id']);
92  }
93  if ($event === self::EVENT_USER_TO_RESTART) {
94  $this->prg_event_handler->sendInformToReAssignMail($parameter['ass_id'], $parameter['root_prg_id']);
95  }
96  if ($event === self::EVENT_USER_REASSIGNED) {
97  $this->prg_event_handler->sendReAssignedMail($parameter['ass_id'], $parameter['root_prg_id']);
98  }
99  if ($event === self::EVENT_VALIDITY_CHANGE) {
100  $this->prg_event_handler->resetMailFlagValidity($parameter['ass_id'], $parameter['root_prg_id']);
101  }
102  if ($event === self::EVENT_DEADLINE_CHANGE) {
103  $this->prg_event_handler->resetMailFlagDeadline($parameter['ass_id'], $parameter['root_prg_id']);
104  }
105 
106  if (in_array($event, self::PUBLIC_EVENTS)) {
107  $this->app_event_handler->raise(self::COMPONENT, $event, $parameter);
108  }
109  }
+ Here is the call graph for this function:

◆ scoreChange()

ilStudyProgrammeEvents::scoreChange ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 203 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

203  : void
204  {
205  $this->raise(self::EVENT_SCORE_CHANGE, [
206  "ass_id" => $assignment->getId(),
207  "root_prg_id" => $assignment->getRootId(),
208  "prg_id" => $pgs_node_id,
209  "usr_id" => $assignment->getUserId()
210  ]);
211  }
+ Here is the call graph for this function:

◆ userAssigned()

ilStudyProgrammeEvents::userAssigned ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 111 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

111  : void
112  {
113  $this->raise(
114  self::EVENT_USER_ASSIGNED,
115  [
116  "root_prg_id" => $assignment->getRootId(),
117  "prg_id" => $assignment->getRootId(),
118  "usr_id" => $assignment->getUserId(),
119  "ass_id" => $assignment->getId()
120  ]
121  );
122  }
+ Here is the call graph for this function:

◆ userDeassigned()

ilStudyProgrammeEvents::userDeassigned ( ilPRGAssignment  $a_assignment)

Implements StudyProgrammeEvents.

Definition at line 124 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

124  : void
125  {
126  $this->raise(
127  self::EVENT_USER_DEASSIGNED,
128  [
129  "root_prg_id" => $a_assignment->getRootId(),
130  "prg_id" => $a_assignment->getRootId(),
131  "usr_id" => $a_assignment->getUserId(),
132  "ass_id" => $a_assignment->getId()
133  ]
134  );
135  }
+ Here is the call graph for this function:

◆ userReAssigned()

ilStudyProgrammeEvents::userReAssigned ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 137 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ILIAS\Repository\int().

137  : void
138  {
139  $this->raise(
140  self::EVENT_USER_REASSIGNED,
141  [
142  "ass_id" => $assignment->getId(),
143  "root_prg_id" => (int) $assignment->getRootId()
144  ]
145  );
146  }
+ Here is the call graph for this function:

◆ userRevertSuccessful()

ilStudyProgrammeEvents::userRevertSuccessful ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 213 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

213  : void
214  {
215  $this->raise(self::EVENT_USER_NOT_SUCCESSFUL, [
216  "ass_id" => $assignment->getId(),
217  "root_prg_id" => $assignment->getRootId(),
218  "prg_id" => $pgs_node_id,
219  "usr_id" => $assignment->getUserId()
220  ]);
221  }
+ Here is the call graph for this function:

◆ userRiskyToFail()

ilStudyProgrammeEvents::userRiskyToFail ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 172 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ILIAS\Repository\int().

172  : void
173  {
174  $this->raise(
175  self::EVENT_USER_ABOUT_TO_FAIL,
176  [
177  "ass_id" => (int) $assignment->getId(),
178  "root_prg_id" => (int) $assignment->getRootId()
179  ]
180  );
181  }
+ Here is the call graph for this function:

◆ userSuccessful()

ilStudyProgrammeEvents::userSuccessful ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 148 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

148  : void
149  {
150  $this->raise(
151  self::EVENT_USER_SUCCESSFUL,
152  [
153  "root_prg_id" => $assignment->getRootId(),
154  "prg_id" => $pgs_node_id,
155  "usr_id" => $assignment->getUserId(),
156  "ass_id" => $assignment->getId()
157  ]
158  );
159  }
+ Here is the call graph for this function:

◆ validityChange()

ilStudyProgrammeEvents::validityChange ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 183 of file class.ilStudyProgrammeEvents.php.

References ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

183  : void
184  {
185  $this->raise(self::EVENT_VALIDITY_CHANGE, [
186  "ass_id" => $assignment->getId(),
187  "root_prg_id" => $assignment->getRootId(),
188  "prg_id" => $pgs_node_id,
189  "usr_id" => $assignment->getUserId()
190  ]);
191  }
+ Here is the call graph for this function:

Field Documentation

◆ PUBLIC_EVENTS

const ilStudyProgrammeEvents::PUBLIC_EVENTS
Initial value:
= [
self::EVENT_USER_ASSIGNED,
self::EVENT_USER_DEASSIGNED,
self::EVENT_USER_REASSIGNED,
]

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


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