Commit 8b76f567 authored by Penny Leach's avatar Penny Leach
Browse files

resume: fixing bug [#562] - personal information fields should not

be required
parent ccb2c4ba
......@@ -122,36 +122,24 @@ $form = array(
'defaultvalue' => ((!empty($personalinformation))
? strtotime($personalinformation->get_composite('dateofbirth')) : null),
'title' => get_string('dateofbirth', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'placeofbirth' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('placeofbirth') : null),
'title' => get_string('placeofbirth', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'citizenship' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('citizenship') : null),
'title' => get_string('citizenship', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'visastatus' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('visastatus') : null),
'title' => get_string('visastatus', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'gender' => array(
'type' => 'radio',
......@@ -162,18 +150,12 @@ $form = array(
'male' => get_string('male', 'artefact.resume'),
),
'title' => get_string('gender', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'maritalstatus' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('maritalstatus') : null),
'title' => get_string('maritalstatus', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
),
),
......
......@@ -219,7 +219,7 @@ class ArtefactTypePersonalinformation extends ArtefactTypeResume {
// only set it to dirty if it's changed
$this->dirty = true;
$this->mtime = time();
if ($field == 'dateofbirth') {
if ($field == 'dateofbirth' && !empty($value)) {
$value = db_format_timestamp($value);
}
$this->composites[$field] = $value;
......@@ -255,12 +255,12 @@ class ArtefactTypePersonalinformation extends ArtefactTypeResume {
public static function get_composite_fields() {
static $composites = array(
'dateofbirth' => '',
'placeofbirth' => '',
'citizenship' => '',
'visastatus' => '',
'gender' => '',
'maritalstatus' => '',
'dateofbirth' => null,
'placeofbirth' => null,
'citizenship' => null,
'visastatus' => null,
'gender' => null,
'maritalstatus' => null,
);
return $composites;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment