mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
getNotificationsBy[User|Group] uses the new methods in SeedDMS_Core_User and SeedDMS_Core_Group
This commit is contained in:
parent
e0de75d160
commit
879a67ab84
|
@ -1529,57 +1529,27 @@ class SeedDMS_Core_DMS {
|
||||||
/**
|
/**
|
||||||
* Get all notifications for a group
|
* Get all notifications for a group
|
||||||
*
|
*
|
||||||
|
* deprecated: User {@link SeedDMS_Core_Group::getNotifications()}
|
||||||
|
*
|
||||||
* @param object $group group for which notifications are to be retrieved
|
* @param object $group group for which notifications are to be retrieved
|
||||||
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
|
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
|
||||||
* @return array array of notifications
|
* @return array array of notifications
|
||||||
*/
|
*/
|
||||||
function getNotificationsByGroup($group, $type=0) { /* {{{ */
|
function getNotificationsByGroup($group, $type=0) { /* {{{ */
|
||||||
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
|
return $group->getNotifications($type);
|
||||||
"WHERE `tblNotify`.`groupID` = ". $group->getID();
|
|
||||||
if($type) {
|
|
||||||
$queryStr .= " AND `tblNotify`.`targetType` = ". (int) $type;
|
|
||||||
}
|
|
||||||
|
|
||||||
$resArr = $this->db->getResultArray($queryStr);
|
|
||||||
if (is_bool($resArr) && !$resArr)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$notifications = array();
|
|
||||||
foreach ($resArr as $row) {
|
|
||||||
$not = new SeedDMS_Core_Notification($row["target"], $row["targetType"], $row["userID"], $row["groupID"]);
|
|
||||||
$not->setDMS($this);
|
|
||||||
array_push($notifications, $cat);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $notifications;
|
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all notifications for a user
|
* Get all notifications for a user
|
||||||
*
|
*
|
||||||
|
* deprecated: User {@link SeedDMS_Core_User::getNotifications()}
|
||||||
|
*
|
||||||
* @param object $user user for which notifications are to be retrieved
|
* @param object $user user for which notifications are to be retrieved
|
||||||
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
|
* @param integer $type type of item (T_DOCUMENT or T_FOLDER)
|
||||||
* @return array array of notifications
|
* @return array array of notifications
|
||||||
*/
|
*/
|
||||||
function getNotificationsByUser($user, $type=0) { /* {{{ */
|
function getNotificationsByUser($user, $type=0) { /* {{{ */
|
||||||
$queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ".
|
return $user->getNotifications($type);
|
||||||
"WHERE `tblNotify`.`userID` = ". $user->getID();
|
|
||||||
if($type) {
|
|
||||||
$queryStr .= " AND `tblNotify`.`targetType` = ". (int) $type;
|
|
||||||
}
|
|
||||||
|
|
||||||
$resArr = $this->db->getResultArray($queryStr);
|
|
||||||
if (is_bool($resArr) && !$resArr)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$notifications = array();
|
|
||||||
foreach ($resArr as $row) {
|
|
||||||
$not = new SeedDMS_Core_Notification($row["target"], $row["targetType"], $row["userID"], $row["groupID"]);
|
|
||||||
$not->setDMS($this);
|
|
||||||
array_push($notifications, $cat);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $notifications;
|
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user