Commit db1b441d authored by Penny Leach's avatar Penny Leach
Browse files

fixes [#672] - allow resume composite types to specify their order field...

fixes [#672] - allow resume composite types to specify their order field (mostly startdate, but sometimes just 'date')
parent 76ddc32c
......@@ -28,6 +28,7 @@ define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'resume');
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
......@@ -46,6 +47,7 @@ $sql = 'SELECT ar.*, a.owner
FROM ' . $prefix . 'artefact a
JOIN ' . $prefix . $othertable . ' ar ON ar.artefact = a.id
WHERE a.owner = ? AND a.artefacttype = ?
ORDER BY ' . call_static_method(generate_artefact_class_name($type), 'get_order_field') . ' DESC
LIMIT ' . $limit . ' OFFSET ' . $offset;
if (!empty($view)) {
......
......@@ -362,6 +362,10 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume {
);
}
public static function get_order_field() {
return 'startdate';
}
/**
* This function should return a snippet of javascript
* to be plugged into a table renderer instantiation
......@@ -744,6 +748,10 @@ class ArtefactTypeCertification extends ArtefactTypeResumeComposite {
return "r.description";
}
public static function get_order_field() {
return 'date';
}
public static function get_addform_elements() {
return array(
'date' => array(
......@@ -801,6 +809,10 @@ class ArtefactTypeBook extends ArtefactTypeResumeComposite {
return "r.description";
}
public static function get_order_field() {
return 'date';
}
public static function get_addform_elements() {
return array(
'date' => array(
......
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