Save a link to the latest activity value in the project model and
render a simple green bar as activity measure in the project list view.
This commit is contained in:
@@ -64,4 +64,15 @@ class IDF_ProjectActivity extends Pluf_Model
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function postSave($create=false)
|
||||
{
|
||||
$prj = $this->get_project();
|
||||
$sql = new Pluf_SQL('project=%s', array($prj->id));
|
||||
$latest = Pluf::factory('IDF_ProjectActivity')->getOne(array('filter' => $sql->gen(), 'order' => 'date desc'));
|
||||
if ($prj->current_activity != $latest->id) {
|
||||
$prj->current_activity = $latest;
|
||||
$prj->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user