Skip to content
GitLab
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
204805bf
Commit
204805bf
authored
Aug 27, 2009
by
Nigel McNie
Browse files
Add strategy for importing employment history.
parent
3744e602
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/import/leap/lib.php
View file @
204805bf
...
...
@@ -49,6 +49,11 @@ class LeapImportResume extends LeapImportArtefactPlugin {
*/
const
STRATEGY_IMPORT_AS_ACHIEVEMENT
=
3
;
/**
* Activities in category life_area:Work map to employment history
*/
const
STRATEGY_IMPORT_AS_EMPLOYMENT
=
4
;
/**
* Description of strategies used
*/
...
...
@@ -101,6 +106,17 @@ class LeapImportResume extends LeapImportArtefactPlugin {
}
// Employment
$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="Work"]'
))
==
1
;
if
(
$correctrdftype
&&
$correctcategoryscheme
)
{
$strategies
[]
=
array
(
'strategy'
=>
self
::
STRATEGY_IMPORT_AS_EMPLOYMENT
,
'score'
=>
100
,
'other_required_entries'
=>
array
(),
// TODO: we need is_supported_by entries, which in mahara usually refer to organisations
);
}
return
$strategies
;
}
...
...
@@ -164,6 +180,21 @@ class LeapImportResume extends LeapImportArtefactPlugin {
);
ArtefactTypeResumeComposite
::
ensure_composite_value
(
$values
,
'certification'
,
$importer
->
get
(
'usr'
));
break
;
case
self
::
STRATEGY_IMPORT_AS_EMPLOYMENT
:
$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
,
'employer'
=>
''
,
// TODO - get from related organisation
'jobtitle'
=>
$entry
->
title
,
'positiondescription'
=>
PluginImportLeap
::
get_entry_content
(
$entry
,
$importer
),
'displayorder'
=>
''
,
// TODO: get from the grouping, or failing that, from this entry itself
);
ArtefactTypeResumeComposite
::
ensure_composite_value
(
$values
,
'employmenthistory'
,
$importer
->
get
(
'usr'
));
break
;
default
:
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
.
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