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
87bc4be3
Commit
87bc4be3
authored
Jun 06, 2007
by
Penny Leach
Browse files
Fixing up view based rendering issues for the resume plugin (fixes [#666])
parent
a9e38bea
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/composite.json.php
View file @
87bc4be3
...
...
@@ -32,6 +32,7 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$limit
=
param_integer
(
'limit'
,
10
);
$offset
=
param_integer
(
'offset'
,
0
);
$type
=
param_alpha
(
'type'
);
$view
=
param_integer
(
'view'
,
0
);
$data
=
array
();
$count
=
0
;
...
...
@@ -39,14 +40,29 @@ $count = 0;
$prefix
=
get_config
(
'dbprefix'
);
$othertable
=
'artefact_resume_'
.
$type
;
$owner
=
$USER
->
get
(
'id'
);
$sql
=
'SELECT ar.*, a.owner
FROM '
.
$prefix
.
'artefact a
JOIN '
.
$prefix
.
$othertable
.
' ar ON ar.artefact = a.id
WHERE a.owner = ? AND a.artefacttype = ?
LIMIT '
.
$limit
.
' OFFSET '
.
$offset
;
if
(
!
$data
=
get_records_sql_array
(
$sql
,
array
(
$USER
->
get
(
'id'
),
$type
)))
{
if
(
!
empty
(
$view
))
{
if
(
!
can_view_view
(
$view
))
{
throw
new
AccessDeniedException
();
}
require_once
(
'view.php'
);
$v
=
new
View
(
$view
);
$owner
=
$v
->
get
(
'owner'
);
}
if
(
!
$data
=
get_records_sql_array
(
$sql
,
array
(
$owner
,
$type
)))
{
$data
=
array
();
}
$count
=
count_records
(
'artefact'
,
'owner'
,
$owner
,
'artefacttype'
,
$type
);
foreach
(
$data
as
&
$row
)
{
foreach
(
array
(
'date'
,
'startdate'
,
'enddate'
)
as
$key
)
{
if
(
array_key_exists
(
$key
,
$row
))
{
...
...
@@ -54,7 +70,6 @@ foreach ($data as &$row) {
}
}
}
$count
=
count_records
(
'artefact'
,
'owner'
,
$USER
->
get
(
'id'
),
'artefacttype'
,
$type
);
echo
json_encode
(
array
(
'data'
=>
$data
,
'limit'
=>
$limit
,
...
...
htdocs/artefact/resume/lib.php
View file @
87bc4be3
...
...
@@ -133,7 +133,7 @@ class ArtefactTypeCoverletter extends ArtefactTypeResume {
}
public
function
render_full
(
$options
)
{
return
array
(
'html'
=>
$this
->
title
);
return
array
(
'html'
=>
$this
->
description
);
}
}
...
...
@@ -505,6 +505,12 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume {
{
$type
}
list.type = '
{
$type
}
';
{
$type
}
list.statevars.push('type');
"
.
((
array_key_exists
(
'viewid'
,
$options
))
?
"
{
$type
}
list.view = "
.
$options
[
'viewid'
]
.
";
{
$type
}
list.statevars.push('view');"
:
""
)
.
"
{
$type
}
list.updateOnLoad();
"
);
return
$content
;
...
...
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