4 require_once
'./Modules/Forum/classes/class.ilObjForum.php';
34 global $ilObjDataCache,
$lng,$ilias;
37 $this->ilias = $ilias;
39 $this->forum_id = $ilObjDataCache->lookupObjId(
$ref_id);
45 $this->notification_id = $a_notification_id;
53 $this->user_id = $a_user_id;
62 $this->forum_id = $a_forum_id;
71 $this->thread_id = $a_thread_id;
81 $this->admin_force = $a_admin_force;
91 $this->user_toggle = $a_user_toggle;
100 $this->ref_id = $a_ref_id;
110 $this->user_id_noti = $a_user_id_noti;
115 return $this->user_id_noti;
122 $res = $ilDB->queryF(
'
123 SELECT admin_force_noti FROM frm_notification
126 AND user_id_noti > %s ',
127 array(
'integer',
'integer',
'integer'),
130 while(
$row = $ilDB->fetchAssoc(
$res))
132 return $row[
'admin_force_noti'];
139 $res = $ilDB->queryF(
'
140 SELECT user_toggle_noti FROM frm_notification
143 AND user_id_noti > %s',
144 array(
'integer',
'integer',
'integer'),
147 while(
$row = $ilDB->fetchAssoc(
$res))
149 return $row[
'user_toggle_noti'];
158 $next_id = $ilDB->nextId(
'frm_notification');
159 $res = $ilDB->manipulateF(
'
160 INSERT INTO frm_notification
161 (notification_id, user_id, frm_id, admin_force_noti, user_toggle_noti, user_id_noti)
162 VALUES(%s,%s,%s,%s,%s,%s)',
163 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
171 $res = $ilDB->manipulateF(
'
172 DELETE FROM frm_notification
175 AND admin_force_noti = %s
176 AND user_id_noti > %s' ,
177 array(
'integer',
'integer',
'integer',
'integer'),
185 $res = $ilDB->manipulateF(
'
186 DELETE FROM frm_notification
189 AND admin_force_noti = %s
190 AND user_toggle_noti = %s
191 AND user_id_noti > %s' ,
192 array(
'integer',
'integer',
'integer',
'integer',
'integer'),
201 $res = $ilDB->manipulateF(
'
202 UPDATE frm_notification
203 SET user_toggle_noti = %s
206 AND admin_force_noti = %s',
207 array(
'integer',
'integer',
'integer',
'integer'),
226 include_once
'Modules/Forum/classes/class.ilForumProperties.php';
228 $node_data = $tree->getChildsByType(
$ref_id,
'frm');
229 foreach($node_data as
$data)
237 else $frm_noti->setUserId($ilUser->getId());
248 $frm_noti->setForumId($data[
'obj_id']);
249 if($frm_noti->existsNotification() ==
false)
251 $frm_noti->insertAdminForce();
261 $node_data = $tree->getChildsByType(
$ref_id,
'frm');
263 include_once
'Modules/Forum/classes/class.ilForumModerators.php';
265 foreach($node_data as
$data)
270 $moderator_ids = $objFrmMods->getCurrentModerators();
276 else $frm_noti->setUserId($ilUser->getId());
278 $frm_noti->setForumId($data[
'obj_id']);
279 if(!in_array($frm_noti->getUserId(), $moderator_ids))
281 $frm_noti->deleteAdminForce();
290 $parent_ref_id = $tree->getParentId($a_ref_id);
293 if($parent_obj->getType() ==
'crs' || $parent_obj->getType() ==
'grp')
294 return $parent_obj->getType();
301 global $ilDB, $ilObjDataCache;
303 if(!$a_parameter[
'tree'] ==
'tree')
308 $ref_id = $a_parameter[
'source_id'];
316 DELETE FROM frm_notification
318 AND admin_force_noti = %s',
319 array(
'integer',
'integer'),
328 $parent_ref_id = $tree->getParentId(
$ref_id);
331 if($parent_obj->getType() ==
'crs')
333 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
336 else if($parent_obj->getType() ==
'grp')
338 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
343 if($parent_obj->getType() ==
'crs' || $parent_obj->getType() ==
'grp')
346 $admin_ids = $oParticipants->getAdmins();
347 $tutor_ids = $oParticipants->getTutors();
349 $result = array_unique(array_merge($moderator_ids,$admin_ids,$tutor_ids));
365 $rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
366 $role_arr = $rbacreview->getRolesOfRoleFolder($rolf[
"ref_id"]);
368 foreach ($role_arr as $role_id)
372 if (
$title ==
"il_frm_moderator_".$a_ref_id)
374 #return $rbacreview->assignedUsers($roleObj->getId());
375 return $title = $rbacreview->assignedUsers($role_id);
386 $res = $ilDB->manipulateF(
'
387 UPDATE frm_notification
388 SET admin_force_noti = %s,
389 user_toggle_noti = %s
392 array(
'integer',
'integer',
'integer',
'integer'),
400 $res = $ilDB->manipulateF(
'
401 DELETE FROM frm_notification
403 AND user_id_noti > %s',
404 array(
'integer',
'integer'),
414 SELECT * FROM frm_notification WHERE
434 $res = $ilDB->queryF(
'
435 SELECT * FROM frm_notification
438 AND admin_force_noti = %s',
439 array(
'integer',
'integer',
'integer'),