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
f25980be
Commit
f25980be
authored
Sep 06, 2009
by
Nigel McNie
Browse files
Import qualification type/description from related achievement for education history entries.
Signed-off-by:
Nigel McNie
<
nigel@catalyst.net.nz
>
parent
a80dd73b
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/import/leap/lib.php
View file @
f25980be
...
...
@@ -167,15 +167,31 @@ class LeapImportResume extends LeapImportArtefactPlugin {
}
// Education
$other_required_entries
=
array
();
$correctrdftype
=
count
(
$entry
->
xpath
(
'rdf:type['
.
$importer
->
curie_xpath
(
'@rdf:resource'
,
PluginImportLeap
::
NS_LEAPTYPE
,
'activity'
)
.
']'
))
==
1
;
$correctcategoryscheme
=
count
(
$entry
->
xpath
(
'a:category[('
.
$importer
->
curie_xpath
(
'@scheme'
,
PluginImportLeap
::
NS_CATEGORIES
,
'life_area#'
)
.
') and @term="Education"]'
))
==
1
;
if
(
$correctrdftype
&&
$correctcategoryscheme
)
{
// If this entry supports an achievement, that achievement will be
// the qualification the user gained in relation to this entry
foreach
(
$entry
->
link
as
$link
)
{
if
(
$importer
->
curie_equals
(
$link
[
'rel'
],
PluginImportLeap
::
NS_LEAP
,
'supports'
)
&&
isset
(
$link
[
'href'
]))
{
if
(
$potentialqualification
=
$importer
->
get_entry_by_id
((
string
)
$link
[
'href'
]))
{
$correctrdftype
=
count
(
$potentialqualification
->
xpath
(
'rdf:type['
.
$importer
->
curie_xpath
(
'@rdf:resource'
,
PluginImportLeap
::
NS_LEAPTYPE
,
'achievement'
)
.
']'
))
==
1
;
if
(
$correctrdftype
)
{
// We have a related achievement!
$other_required_entries
[]
=
(
string
)
$link
[
'href'
];
break
;
}
}
}
}
$strategies
[]
=
array
(
'strategy'
=>
self
::
STRATEGY_IMPORT_AS_EDUCATION
,
'score'
=>
100
,
'other_required_entries'
=>
array
(),
// TODO: we need is_supported_by entries, which in mahara usually refer to organisations
'other_required_entries'
=>
$other_required_entries
,
);
}
...
...
@@ -288,11 +304,18 @@ class LeapImportResume extends LeapImportArtefactPlugin {
$startdate
=
(
isset
(
$dates
[
'start'
]))
?
self
::
convert_leap_date_to_resume_date
(
$dates
[
'start'
])
:
''
;
$enddate
=
(
isset
(
$dates
[
'end'
]))
?
self
::
convert_leap_date_to_resume_date
(
$dates
[
'end'
])
:
''
;
$qualtype
=
$qualname
=
''
;
if
(
count
(
$otherentries
))
{
$qualification
=
$importer
->
get_entry_by_id
(
$otherentries
[
0
]);
$qualtype
=
$qualification
->
title
;
$qualname
=
PluginImportLeap
::
get_entry_content
(
$qualification
,
$importer
);
}
$values
=
array
(
'startdate'
=>
$startdate
,
'enddate'
=>
$enddate
,
'qualtype'
=>
''
,
// TODO - get from related entry (achievement)
'qualname'
=>
$
entry
->
titl
e
,
'qualtype'
=>
$qualtype
,
'qualname'
=>
$
qualnam
e
,
'institution'
=>
''
,
// TODO - get from related entry (organisation)
'qualdescription'
=>
PluginImportLeap
::
get_entry_content
(
$entry
,
$importer
),
'displayorder'
=>
''
,
// TODO: get from the grouping, or failing that, from this entry itself
...
...
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