/** * Easily insert an item in the timeline. * * @param mixed Item to be inserted * @param IDF_Project Project of the item * @param Pluf_User Author of the item (null) * @param string GMT creation date time (null) * @return bool Success */ public static function insert($item, $project, $author = null, $creation = null) { $t = new IDF_Timeline(); $t->project = $project; $t->author = $author; $t->creation_dtime = is_null($creation) ? '' : $creation; $t->model_id = $item->id; $t->model_class = $item->_model; $t->create(); return $t; }
function postSave($create = false) { if ($create) { IDF_Timeline::insert($this, $this->get_review()->get_project(), $this->get_review()->get_submitter()); IDF_Search::index($this->get_review()); } }
function postSave($create = false) { if ($create) { // Check if more than one revision for this page. We do // not want to insert the first revision in the timeline // as the page itself is inserted. We do not insert on // update as update is performed to change the is_head // flag. $sql = new Pluf_SQL('wikipage=%s', array($this->wikipage)); $rev = Pluf::factory('IDF_WikiRevision')->getList(array('filter' => $sql->gen())); if ($rev->count() > 1) { IDF_Timeline::insert($this, $this->get_wikipage()->get_project(), $this->get_submitter()); foreach ($rev as $r) { if ($r->id != $this->id and $r->is_head) { $r->is_head = false; $r->update(); } } } $page = $this->get_wikipage(); $page->update(); // Will update the modification timestamp. IDF_Search::index($page); } }
function postSave($create = false) { // Note: No indexing is performed here. The indexing is // triggered in the postSave step of the comment to ensure // that the issue as at least one comment in the database when // doing the indexing. if ($create) { IDF_Timeline::insert($this, $this->get_project(), $this->get_submitter()); } }
function postSave($create = false) { if ($create) { // Check if more than one comment for this issue. We do // not want to insert the first comment in the timeline as // the issue itself is inserted. $sql = new Pluf_SQL('issue=%s', array($this->issue)); $co = Pluf::factory('IDF_IssueComment')->getList(array('filter' => $sql->gen())); if ($co->count() > 1) { IDF_Timeline::insert($this, $this->get_issue()->get_project(), $this->get_submitter()); } } IDF_Search::index($this->get_issue()); }
function preDelete() { IDF_Timeline::remove($this); IDF_Search::remove($this); }
function preDelete() { IDF_Timeline::remove($this); IDF_Search::remove($this); IDF_Gconf::dropForModel($this); }
/** * We drop the information from the timeline. */ function preDelete() { IDF_Timeline::remove($this); @unlink(Pluf::f('upload_path') . '/' . $this->project->shortname . '/files/' . $this->file); }