Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
05e22a3b
Commit
05e22a3b
authored
Nov 08, 2006
by
Penny Leach
Browse files
added support to handle_activity for community watchlist. fixed a few
columns that had been renamed
parent
2c46ee5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/activity.php
View file @
05e22a3b
...
...
@@ -64,7 +64,7 @@ function activity_occured($activitytype, $data) {
* <b>maharamessage</b> must contain $users, an array of userids.
* <b>usermessage</b> must contain $userto, id of recipient user.
* <b>feedback</b> must contain either $view (id of view) or $artefact (id of artefact)
* <b>watchlist</b> must contain either $view (id of view) or $artefact (id of artefact)
* <b>watchlist</b> must contain either $view (id of view) or $artefact (id of artefact)
or $community (id of community)
* <b>newview</b> must contain $owner userid of view owner AND $view (id of new view)
*/
function
handle_activity
(
$activitytype
,
$data
)
{
...
...
@@ -101,11 +101,11 @@ function handle_activity($activitytype, $data) {
case
'watchlist'
:
if
(
$data
->
view
)
{
$sql
=
'SELECT u.*, p.method
FROM '
.
$prefix
.
'watchlist_view wv
FROM '
.
$prefix
.
'
usr_
watchlist_view wv
JOIN '
.
$prefix
.
'usr u
ON wa.user = u.id
JOIN '
.
$prefix
.
'usr_preference p
ON p.us
e
r = u.id
ON p.usr = u.id
WHERE pc.activity = ?
AND wv.view = ?
'
;
...
...
@@ -113,18 +113,30 @@ function handle_activity($activitytype, $data) {
}
else
if
(
$data
->
artefact
)
{
$sql
=
'SELECT DISTINCT u.*, p.method
FROM '
.
$prefix
.
'watchlist_artefact wa
FROM '
.
$prefix
.
'
usr_
watchlist_artefact wa
JOIN '
.
$prefix
.
'artefact_parent_cache pc
ON (pc.parent = wa.artefact OR pc.artefact = wa.artefact)
JOIN '
.
$prefix
.
'usr u
ON wa.user = u.id
JOIN '
.
$prefix
.
'usr_preference p
ON p.us
e
r = u.id
ON p.usr = u.id
WHERE pc.activity = ?
AND (pc.parent = ? OR wa.artefact = ?)
'
;
$users
=
get_records_sql
(
$sql
,
array
(
'watchlist'
,
$data
->
artefact
));
}
else
if
(
$data
->
community
)
{
$sql
=
'SELECT DISTINCT u.*, p.method
FROM '
.
$prefix
.
'usr_watchlist_community c
JOIN '
.
$prefix
.
'usr u
ON c.usr = u.id
JOIN '
.
$prefix
.
'usr_preference p
ON p.usr = u.id
WHERE pc.activity = ?
AND c.community = ?
'
;
$users
=
get_records_sql
(
$sql
,
array
(
'watchlist'
,
$data
->
community
));
}
else
{
throw
new
InvalidArgumentException
(
"Invalid watchlist type"
);
}
...
...
@@ -180,7 +192,7 @@ function activity_get_users($activitytype, $userids=null, $userobjs=null, $admin
$sql
=
'SELECT u.*, p.method
FROM '
.
get_config
(
'dbprefix'
)
.
'usr u
JOIN '
.
get_config
(
'dbprefix'
)
.
'usr_activity_preference p
ON p.us
e
r = u.id
ON p.usr = u.id
WHERE p.activity = ? '
;
if
(
!
empty
(
$adminonly
))
{
$sql
.
=
' AND u.admin = ? '
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment