Commit f55b45d4 authored by Nigel McNie's avatar Nigel McNie
Browse files

Allow callers of ensure_composite_values for resume items to set the display_order.


Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 5d90ec47
...@@ -409,8 +409,13 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume { ...@@ -409,8 +409,13 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume {
update_record($table, (object)$values, 'id'); update_record($table, (object)$values, 'id');
} }
else { else {
$max = get_field($table, 'MAX(displayorder)', 'artefact', $values['artefact']); if (isset($values['displayorder'])) {
$values['displayorder'] = is_numeric($max) ? $max + 1 : 0; $values['displayorder'] = intval($values['displayorder']);
}
else {
$max = get_field($table, 'MAX(displayorder)', 'artefact', $values['artefact']);
$values['displayorder'] = is_numeric($max) ? $max + 1 : 0;
}
insert_record($table, (object)$values); insert_record($table, (object)$values);
} }
} }
......
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