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
4e88aee1
Commit
4e88aee1
authored
Jan 21, 2007
by
Nigel McNie
Committed by
Nigel McNie
Jan 21, 2007
Browse files
Merge with
git+ssh://git.catalyst.net.nz/var/git/mahara.git#master
parents
d44064c4
c11ce374
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/contacts/communities/view.json.php
View file @
4e88aee1
...
...
@@ -53,25 +53,40 @@ $dbnow = db_format_timestamp(time());
switch
(
$type
)
{
case
'views'
:
$where
=
'WHERE a.community = ?
$where
=
'WHERE v.submittedto = ?'
;
$values
=
array
(
$id
);
if
(
!
$submitted
)
{
$where
.
=
'AND (
a.community = ?
AND ( v.startdate IS NULL OR v.startdate < ? )
AND ( v.stopdate IS NULL OR v.stopdate
<
? )
AND ( v.stopdate IS NULL OR v.stopdate
>
? )
AND ( a.startdate IS NULL OR a.startdate < ? )
AND ( a.stopdate IS NULL OR a.stopdate < ? )'
;
$values
=
array
(
$id
,
$dbnow
,
$dbnow
,
$dbnow
,
$dbnow
);
if
(
$submitted
)
{
$where
.
=
' AND v.submittedto = ?'
;
AND ( a.stopdate IS NULL OR a.stopdate > ? )
)'
;
$values
[]
=
$id
;
$values
[]
=
$dbnow
;
$values
[]
=
$dbnow
;
$values
[]
=
$dbnow
;
$values
[]
=
$dbnow
;
}
$count
=
count_records_sql
(
'SELECT COUNT(v.id) FROM '
.
$prefix
.
'view_access_community a
JOIN '
.
$prefix
.
'view v ON a.view = v.id '
.
$where
,
$values
);
$count
=
count_records_sql
(
'
SELECT COUNT(v.id)
FROM '
.
$prefix
.
'view v
LEFT OUTER JOIN view_access_community a ON a.view=v.id
'
.
$where
,
$values
);
$data
=
get_records_sql_array
(
'SELECT v.*,u.firstname,u.lastname, u.preferredname,u.id AS usr
FROM '
.
$prefix
.
'view_access_community a
JOIN '
.
$prefix
.
'view v ON a.view = v.id
JOIN '
.
$prefix
.
'usr u ON v.owner = u.id '
.
$where
,
$values
,
$offset
,
$limit
);
$data
=
get_records_sql_array
(
'
SELECT v.*,u.firstname,u.lastname, u.preferredname,u.id AS usr
FROM '
.
$prefix
.
'view v
LEFT OUTER JOIN '
.
$prefix
.
'view_access_community a ON a.view=v.id
INNER JOIN '
.
$prefix
.
'usr u ON v.owner = u.id '
.
$where
,
$values
,
$offset
,
$limit
);
if
(
empty
(
$data
))
{
$data
=
array
();
}
...
...
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