/** * Method to store user activity after a delete event * * @param string $context The item context * @param object $table The item table object * @param boolean $store Indicates whether to store the data or not * * @return boolean True on success, False on error */ public function onUserActivityAfterDelete($context, $table, $store = true) { parent::onUserActivityAfterDelete($context, $table, false); $this->item_data['xref_id'] = $table->project_id; // Set meta data for a task if ($context == 'com_pftasks.task') { $item = $this->getTask($table->id); $this->item_data['metadata']->set('p_alias', $item->p_alias); $this->item_data['metadata']->set('p_title', $item->p_title); $this->item_data['metadata']->set('m_id', $item->milestone_id); $this->item_data['metadata']->set('m_alias', $item->m_alias); $this->item_data['metadata']->set('m_title', $item->m_title); $this->item_data['metadata']->set('l_id', $item->list_id); $this->item_data['metadata']->set('l_alias', $item->l_alias); $this->item_data['metadata']->set('l_title', $item->l_title); } // Set meta data for a list if ($context == 'com_pftasks.tasklist') { $item = $this->getTaskList($table->id); $this->item_data['metadata']->set('p_alias', $item->p_alias); $this->item_data['metadata']->set('p_title', $item->p_title); $this->item_data['metadata']->set('m_id', $item->milestone_id); $this->item_data['metadata']->set('m_alias', $item->m_alias); $this->item_data['metadata']->set('m_title', $item->m_title); } if ($store) { return $this->save(); } return true; }
/** * Method to store user activity after a delete event * * @param string $context The item context * @param object $table The item table object * @param boolean $store Indicates whether to store the data or not * * @return boolean True on success, False on error */ public function onUserActivityAfterDelete($context, $table, $store = true) { parent::onUserActivityAfterDelete($context, $table, $is_new, false); if ($this->item_data['name'] == 'reply') { $item = $this->getReply($table->id); if (!$item) { return false; } $this->item_data['title'] = $item->title; // Set meta data $this->item_data['metadata']->set('alias', $item->alias); $this->item_data['metadata']->set('p_alias', $item->p_alias); $this->item_data['metadata']->set('p_title', $item->p_title); $this->item_data['metadata']->set('t_id', $item->topic_id); $this->item_data['metadata']->set('t_alias', $item->alias); $this->item_data['metadata']->set('t_title', $item->title); } if ($this->item_data['name'] == 'topic') { // Set meta data $p = $this->getProject($table->project_id); $this->item_data['metadata']->set('p_alias', $p->alias); $this->item_data['metadata']->set('p_title', $p->title); } $this->item_data['xref_id'] = $table->project_id; if ($store) { return $this->save(); } return true; }
/** * Method to store user activity after a delete event * * @param string $context The item context * @param object $table The item table object * @param boolean $store Indicates whether to store the data or not * * @return boolean True on success, False on error */ public function onUserActivityAfterDelete($context, $table, $store = true) { parent::onUserActivityAfterDelete($context, $table, false); $this->item_data['xref_id'] = $table->project_id; // Set meta data $p = $this->getProject($table->project_id); $this->item_data['metadata']->set('p_alias', $p->alias); $this->item_data['metadata']->set('p_title', $p->title); if ($store) { return $this->save(); } return true; }
/** * Method to store user activity after a delete event * * @param string $context The item context * @param object $table The item table object * @param boolean $store Indicates whether to store the data or not * * @return boolean True on success, False on error */ public function onUserActivityAfterDelete($context, $table, $store = true) { parent::onUserActivityAfterDelete($context, $table, false); $project = $this->getProject($table->project_id); $this->item_data['xref_id'] = $table->project_id; $this->item_data['metadata']->set('p_alias', $project->alias); $this->item_data['metadata']->set('p_title', $project->title); if ($context == 'com_pfdesigns.design') { if ($table->album_id) { $album = $this->getItem('album', $table->album_id); if ($album) { $this->item_data['metadata']->set('a_id', $table->album_id); $this->item_data['metadata']->set('a_alias', $album->alias); $this->item_data['metadata']->set('a_title', $album->title); } else { $this->item_data['metadata']->set('a_id', 0); $this->item_data['metadata']->set('a_alias', ''); $this->item_data['metadata']->set('a_title', ''); } } else { $this->item_data['metadata']->set('a_id', 0); $this->item_data['metadata']->set('a_alias', ''); $this->item_data['metadata']->set('a_title', ''); } } if ($context == 'com_pfdesigns.revision') { $design = $this->getItem('design', $table->parent_id); $this->item_data['metadata']->set('d_id', $table->parent_id); if ($design) { $this->item_data['metadata']->set('d_alias', $design->alias); $this->item_data['metadata']->set('d_title', $design->title); $this->item_data['metadata']->set('a_id', $design->album_id); $this->item_data['metadata']->set('a_alias', $design->a_alias); $this->item_data['metadata']->set('a_title', $design->a_title); } else { $this->item_data['metadata']->set('d_alias', ''); $this->item_data['metadata']->set('d_title', ''); $this->item_data['metadata']->set('a_id', 0); $this->item_data['metadata']->set('a_alias', ''); $this->item_data['metadata']->set('a_title', ''); } } if ($store) { return $this->save(); } return true; }
/** * Method to store user activity after a delete event * * @param string $context The item context * @param object $table The item table object * @param boolean $store Indicates whether to store the data or not * * @return boolean True on success, False on error */ public function onUserActivityAfterDelete($context, $table, $store = true) { parent::onUserActivityAfterDelete($context, $table, false); $this->item_data['xref_id'] = $table->id; // Set meta data $this->item_data['metadata']->set('cat_alias', ''); $this->item_data['metadata']->set('cat_title', ''); if ($table->catid) { $cat = $this->getCategory($table->catid); if ($cat) { $this->item_data['metadata']->set('cat_alias', $cat->alias); $this->item_data['metadata']->set('cat_title', $cat->title); } } if ($store) { return $this->save(); } return true; }
/** * Method to store user activity after a delete event * * @param string $context The item context * @param object $table The item table object * @param boolean $store Indicates whether to store the data or not * * @return boolean True on success, False on error */ public function onUserActivityAfterDelete($context, $table, $store = true) { parent::onUserActivityAfterDelete($context, $table, false); $item = $this->getProject($table->project_id); $this->item_data['xref_id'] = $table->project_id; $this->item_data['metadata']->set('alias', $table->alias); $this->item_data['metadata']->set('p_alias', $item->alias); $this->item_data['metadata']->set('p_title', $item->title); list($ext, $type) = explode('.', $context, 2); if ($type == 'attachment') { return true; } if ($context != 'com_pfrepo.directory') { $this->item_data['metadata']->set('d_id', $table->dir_id); } if ($store) { return $this->save(); } return true; }