/** * The main function that is called when the page loads. * * It decides the which action has to be taken for the page. * * @return null */ public function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->assign('action', $this->_action); $this->assign('context', $this->_context); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this); $caseId = CRM_Utils_Request::retrieve('caseId', 'Positive', $this); CRM_Case_Page_Tab::setContext(); $this->assign('caseID', $caseId); $this->assign('contactID', $this->_contactId); $this->assign('userID', CRM_Core_Session::singleton()->get('userID')); return parent::run(); }
/** * This function is the main function that is called when the page loads, * it decides the which action has to be taken for the page. * * return null * @access public */ function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); $type = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject); $this->assign('action', $this->_action); $this->assign('context', $this->_context); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this); $caseId = CRM_Utils_Request::retrieve('caseId', 'Positive', $this); CRM_Case_Page_Tab::setContext(); $params = array('date_range' => 0); $caseDetails = array(); if (CRM_Case_BAO_Case::accessCiviCase()) { $caseDetails = CRM_Case_BAO_Case::getCaseActivity($caseId, $params, $this->_contactId, NULL, NULL, $type); } $this->assign('rows', $caseDetails); $this->assign('caseId', $caseId); $this->assign('contactId', $this->_contactId); return parent::run(); }
/** * the main function that is called when the page loads, * it decides the which action has to be taken for the page. * * @return null */ public function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); $type = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject); $this->assign('action', $this->_action); $this->assign('context', $this->_context); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this); $caseId = CRM_Utils_Request::retrieve('caseId', 'Positive', $this); CRM_Case_Page_Tab::setContext(); $params = array('date_range' => 0); $caseDetails = array(); if (CRM_Case_BAO_Case::accessCiviCase()) { $caseDetails = CRM_Case_BAO_Case::getCaseActivity($caseId, $params, $this->_contactId, NULL, NULL, $type); } $this->assign('rows', $caseDetails); $this->assign('caseId', $caseId); $this->assign('contactId', $this->_contactId); // Make it easy to refresh this table $params = array('caseId' => $caseId, 'type' => $type, 'context' => $this->_context, 'cid' => $this->_contactId, 'action' => $this->_action, 'snippet' => 4); $this->assign('data_params', json_encode($params)); return parent::run(); }
/** * This function is the main function that is called when the page loads, * it decides the which action has to be taken for the page. * * return null * @access public */ function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->assign('action', $this->_action); $this->assign('context', $this->_context); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this); $caseId = CRM_Utils_Request::retrieve('caseId', 'Positive', $this); require_once 'CRM/Case/Page/Tab.php'; CRM_Case_Page_Tab::setContext(); require_once 'CRM/Case/BAO/Case.php'; $params = array('date_range' => 0); $caseDetails = CRM_Case_BAO_Case::getCaseActivity($caseId, $params, $this->_contactId); $this->assign('rows', $caseDetails); $this->assign('caseId', $caseId); $this->assign('contactId', $this->_contactId); // check is the user has view/edit signer permission $permission = 'view'; if (CRM_Core_Permission::check('edit cases')) { $permission = 'edit'; } $this->assign('permission', $permission); return parent::run(); }
/** * Get action links * * @return array (reference) of action links * @static */ static function &links() { $config = CRM_Core_Config::singleton(); if (!self::$_links) { $deleteExtra = ts('Are you sure you want to delete this case?'); self::$_links = array(CRM_Core_Action::VIEW => array('name' => ts('Manage'), 'url' => 'civicrm/contact/view/case', 'qs' => 'action=view&reset=1&cid=%%cid%%&id=%%id%%', 'title' => ts('Manage Case')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/contact/view/case', 'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%', 'title' => ts('Delete Case'))); } return self::$_links; }