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
c690f661
Commit
c690f661
authored
Sep 04, 2009
by
Nigel McNie
Browse files
Rudimentary importing of education history.
parent
c0859da6
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/import/leap/lib.php
View file @
c690f661
...
@@ -59,6 +59,11 @@ class LeapImportResume extends LeapImportArtefactPlugin {
...
@@ -59,6 +59,11 @@ class LeapImportResume extends LeapImportArtefactPlugin {
*/
*/
const
STRATEGY_IMPORT_AS_BOOK
=
5
;
const
STRATEGY_IMPORT_AS_BOOK
=
5
;
/**
* Activities in category life_area:Education map to education history
*/
const
STRATEGY_IMPORT_AS_EDUCATION
=
6
;
/**
/**
* Description of strategies used
* Description of strategies used
*/
*/
...
@@ -136,6 +141,19 @@ class LeapImportResume extends LeapImportArtefactPlugin {
...
@@ -136,6 +141,19 @@ class LeapImportResume extends LeapImportArtefactPlugin {
);
);
}
}
// Education
$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
)
{
$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
);
}
return
$strategies
;
return
$strategies
;
}
}
...
@@ -226,6 +244,22 @@ class LeapImportResume extends LeapImportArtefactPlugin {
...
@@ -226,6 +244,22 @@ class LeapImportResume extends LeapImportArtefactPlugin {
);
);
ArtefactTypeResumeComposite
::
ensure_composite_value
(
$values
,
'book'
,
$importer
->
get
(
'usr'
));
ArtefactTypeResumeComposite
::
ensure_composite_value
(
$values
,
'book'
,
$importer
->
get
(
'usr'
));
break
;
break
;
case
self
::
STRATEGY_IMPORT_AS_EDUCATION
:
$dates
=
PluginImportLeap
::
get_leap_dates
(
$entry
);
$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'
])
:
''
;
$values
=
array
(
'startdate'
=>
$startdate
,
'enddate'
=>
$enddate
,
'qualtype'
=>
''
,
// TODO - get from related entry (achievement)
'qualname'
=>
$entry
->
title
,
'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
);
ArtefactTypeResumeComposite
::
ensure_composite_value
(
$values
,
'educationhistory'
,
$importer
->
get
(
'usr'
));
break
;
default
:
default
:
throw
new
ImportException
(
$importer
,
'TODO: get_string: unknown strategy chosen for importing entry'
);
throw
new
ImportException
(
$importer
,
'TODO: get_string: unknown strategy chosen for importing entry'
);
}
}
...
...
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