$this->assign('action', $this->_action);
- $this->setContext();
+ self::setContext($this);
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
return self::$_links;
}
- public function setContext() {
- $context = $this->get('context');
+ /**
+ * @param CRM_Core_Form $form
+ */
+ public static function setContext(&$form) {
+ $context = $form->get('context');
+ CRM_Core_Error::Debug("context", $context);
$url = NULL;
- $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
+ $qfKey = CRM_Utils_Request::retrieve('key', 'String', $form);
//validate the qfKey
if (!CRM_Utils_Rule::qfKey($qfKey)) {
$qfKey = NULL;
switch ($context) {
case 'activity':
- if ($this->_contactId) {
+ if ($form->_contactId) {
$url = CRM_Utils_System::url('civicrm/contact/view',
- "reset=1&force=1&cid={$this->_contactId}&selectedChild=activity"
+ "reset=1&force=1&cid={$form->_contactId}&selectedChild=activity"
);
}
break;
break;
case 'fulltext':
- $action = CRM_Utils_Request::retrieve('action', 'String', $this);
+ $action = CRM_Utils_Request::retrieve('action', 'String', $form);
$urlParams = 'force=1';
$urlString = 'civicrm/contact/search/custom';
if ($action == CRM_Core_Action::RENEW) {
- if ($this->_contactId) {
- $urlParams .= '&cid=' . $this->_contactId;
+ if ($form->_contactId) {
+ $urlParams .= '&cid=' . $form->_contactId;
}
$urlParams .= '&context=fulltext&action=view';
$urlString = 'civicrm/contact/view/case';
break;
default:
- if ($this->_contactId) {
+ if ($form->_contactId) {
$url = CRM_Utils_System::url('civicrm/contact/view',
- "reset=1&force=1&cid={$this->_contactId}&selectedChild=case"
+ "reset=1&force=1&cid={$form->_contactId}&selectedChild=case"
);
}
break;