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:
Thomas Keller
2011-12-24 01:07:25 +01:00
parent 6875e62942
commit 608e7a40e4
8 changed files with 193 additions and 60 deletions

View File

@@ -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();
}
}
}