本文整理汇总了PHP中CRM_Utils_Rule::qfKey方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Rule::qfKey方法的具体用法?PHP CRM_Utils_Rule::qfKey怎么用?PHP CRM_Utils_Rule::qfKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Rule
的用法示例。
在下文中一共展示了CRM_Utils_Rule::qfKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preProcess();
require_once 'CRM/Utils/Rule.php';
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= '&qfKey=' . $qfKey;
}
$session = CRM_Core_Session::singleton();
$url = CRM_Utils_System::url('civicrm/contact/search/custom', $urlParams);
$session->replaceUserContext($url);
//get the survey id from user submitted values.
$this->_surveyId = CRM_Utils_Array::value('survey_id', $this->get('formValues'));
$isHeld = CRM_Utils_Array::value('status_id', $this->get('formValues'));
if (!$this->_surveyId || !$isHeld) {
CRM_Core_Error::statusBounce(ts("Please search with 'Is Held' and 'Survey Id' filters to apply this action."));
}
$session = CRM_Core_Session::singleton();
if (empty($this->_contactIds) || !$session->get('userID')) {
CRM_Core_Error::statusBounce(ts("Could not find contacts for release voters resevation Or Missing Interviewer contact."));
}
$this->_interviewerId = $session->get('userID');
$surveyDetails = array();
$params = array('id' => $this->_surveyId);
$this->_surveyDetails = CRM_Campaign_BAO_Survey::retrieve($params, $surveyDetails);
$numVoters = CRM_Core_DAO::singleValueQuery("SELECT COUNT(*) FROM " . self::ACTIVITY_SURVEY_DETAIL_TABLE . " WHERE status_id = 'H' AND survey_id = %1 AND interviewer_id = %2", array(1 => array($this->_surveyId, 'Integer'), 2 => array($this->_interviewerId, 'Integer')));
if (!isset($numVoters) || $numVoters < 1) {
CRM_Core_Error::statusBounce(ts("All voters held by you are already released for this survey."));
}
$this->assign('surveyTitle', $surveyDetails['title']);
}
示例2: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
public function preProcess()
{
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$this->_caseId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
//get current client name.
require_once 'CRM/Contact/BAO/Contact.php';
$this->assign('currentClientName', CRM_Contact_BAO_Contact::displayName($this->_contactId));
//set the context.
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$this->_contactId}&selectedChild=case");
if ($context == 'search') {
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
//validate the qfKey
require_once 'CRM/Utils/Rule.php';
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/case/search', $urlParams);
} else {
if ($context == 'dashboard') {
$url = CRM_Utils_System::url('civicrm/case', 'reset=1');
}
}
$session = CRM_Core_Session::singleton();
$session->pushUserContext($url);
}
示例3: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
//get current client name.
$this->assign('currentClientName', CRM_Contact_BAO_Contact::displayName($cid));
//set the context.
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$cid}&selectedChild=case");
if ($context == 'search') {
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
//validate the qfKey
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/case/search', $urlParams);
} elseif ($context == 'dashboard') {
$url = CRM_Utils_System::url('civicrm/case', 'reset=1');
} elseif (in_array($context, array('dashlet', 'dashletFullscreen'))) {
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
}
$session = CRM_Core_Session::singleton();
$session->pushUserContext($url);
}
示例4: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
if ($id) {
$this->_contributionIds = array($id);
$this->_componentClause = " civicrm_contribution.id IN ( {$id} ) ";
$this->_single = TRUE;
$this->assign('totalSelectedContributions', 1);
} else {
parent::preProcess();
}
// check that all the contribution ids have pending status
$query = "\nSELECT count(*)\nFROM civicrm_contribution\nWHERE contribution_status_id != 1\nAND {$this->_componentClause}";
$count = CRM_Core_DAO::singleValueQuery($query);
if ($count != 0) {
CRM_Core_Error::statusBounce("Please select only online contributions with Completed status.");
}
// we have all the contribution ids, so now we get the contact ids
parent::setContactIDs();
$this->assign('single', $this->_single);
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/contribute/search', $urlParams);
$breadCrumb = array(array('url' => $url, 'title' => ts('Search Results')));
CRM_Utils_System::appendBreadCrumb($breadCrumb);
CRM_Utils_System::setTitle(ts('Print Contribution Receipts'));
}
示例5: postProcess
/**
* Process the uploaded file.
*
* @return void
*/
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
$exportParams = $this->controller->exportValues('Select');
$currentPath = CRM_Utils_System::currentPath();
$urlParams = NULL;
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams = "&qfKey={$qfKey}";
}
//get the button name
$buttonName = $this->controller->getButtonName('done');
$buttonName1 = $this->controller->getButtonName('next');
if ($buttonName == '_qf_Map_done') {
$this->set('exportColumnCount', NULL);
$this->controller->resetPage($this->_name);
return CRM_Utils_System::redirect(CRM_Utils_System::url($currentPath, 'force=1' . $urlParams));
}
if ($this->controller->exportValue($this->_name, 'addMore')) {
$this->set('exportColumnCount', $this->_exportColumnCount);
return;
}
$mapperKeys = $params['mapper'][1];
$checkEmpty = 0;
foreach ($mapperKeys as $value) {
if ($value[0]) {
$checkEmpty++;
}
}
if (!$checkEmpty) {
$this->set('mappingId', NULL);
CRM_Utils_System::redirect(CRM_Utils_System::url($currentPath, '_qf_Map_display=true' . $urlParams));
}
if ($buttonName1 == '_qf_Map_next') {
if (!empty($params['updateMapping'])) {
//save mapping fields
CRM_Core_BAO_Mapping::saveMappingFields($params, $params['mappingId']);
}
if (!empty($params['saveMapping'])) {
$mappingParams = array('name' => $params['saveMappingName'], 'description' => $params['saveMappingDesc'], 'mapping_type_id' => $this->get('mappingTypeId'));
$saveMapping = CRM_Core_BAO_Mapping::add($mappingParams);
//save mapping fields
CRM_Core_BAO_Mapping::saveMappingFields($params, $saveMapping->id);
}
}
//get the csv file
CRM_Export_BAO_Export_Relationship::exportComponents($this->get('selectAll'), $this->get('componentIds'), $this->get('queryParams'), $this->get(CRM_Utils_Sort::SORT_ORDER), $mapperKeys, $this->get('returnProperties'), $this->get('exportMode'), $this->get('componentClause'), $this->get('componentTable'), $this->get('mergeSameAddress'), $this->get('mergeSameHousehold'), $exportParams);
}
示例6: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
$session = CRM_Core_Session::singleton();
$this->set('searchRows', '');
$ssID = $this->get('ssID');
if (isset($ssID)) {
$urlParams = 'reset=1&force=1&ssID=' . $ssID;
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/grant/search', $urlParams);
$session->replaceUserContext($url);
return;
}
}
示例7: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
$lid = CRM_Utils_Request::retrieve('lid', 'Positive', $this, FALSE);
$eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, FALSE);
$profileGID = CRM_Utils_Request::retrieve('profileGID', 'Integer', $this, FALSE);
$this->assign('profileGID', $profileGID);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$type = 'Contact';
if ($cid) {
$ids = array($cid);
$this->_single = TRUE;
if ($profileGID) {
// this does a check and ensures that the user has permission on this profile
// CRM-11766
$profileIDs = CRM_Profile_Page_Listings::getProfileContact($profileGID);
if (!in_array($cid, $profileIDs)) {
CRM_Core_Error::fatal();
}
} elseif ($context) {
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$session = CRM_Core_Session::singleton();
$urlString = "civicrm/contact/search/{$context}";
if ($context == 'search') {
$urlString = 'civicrm/contact/search';
}
$url = CRM_Utils_System::url($urlString, $urlParams);
$session->replaceUserContext($url);
}
} elseif ($eid) {
$ids = $eid;
$type = 'Event';
} else {
if ($profileGID) {
$ids = CRM_Profile_Page_Listings::getProfileContact($profileGID);
} else {
parent::preProcess();
$ids = $this->_contactIds;
}
}
self::createMapXML($ids, $lid, $this, TRUE, $type);
$this->assign('single', $this->_single);
}
示例8: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preProcess();
require_once 'CRM/Utils/Rule.php';
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= '&qfKey=' . $qfKey;
}
$session = CRM_Core_Session::singleton();
$url = CRM_Utils_System::url('civicrm/contact/search/custom', $urlParams);
$session->replaceUserContext($url);
if (empty($this->_contactIds) || !$session->get('userID')) {
CRM_Core_Error::statusBounce(ts("Could not find contacts for voter reservation Or Missing Interviewer contact."));
}
$this->_interviewerId = $session->get('userID');
}
示例9: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
$session = CRM_Core_Session::singleton();
//this is done to unset searchRows variable assign during AddToHousehold and AddToOrganization
$this->set('searchRows', '');
$ssID = $this->get('ssID');
$path = 'force=1';
if (isset($ssID)) {
$path .= "&reset=1&ssID={$ssID}";
}
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
if (CRM_Utils_Rule::qfKey($qfKey)) {
$path .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/event/search', $path);
$session->replaceUserContext($url);
CRM_Utils_System::redirect($url);
}
示例10: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$session = CRM_Core_Session::singleton();
//this is done to unset searchRows variable assign during AddToHousehold and AddToOrganization
$this->set('searchRows', '');
$context = $this->get('context');
if (in_array($context, array('smog', 'amtg'))) {
$urlParams = 'reset=1&force=1&context=smog&gid=';
$urlParams .= $context == 'smog' ? $this->get('gid') : $this->get('amtgID');
$session->replaceUserContext(CRM_Utils_System::url('civicrm/group/search', $urlParams));
return;
}
$ssID = $this->get('ssID');
if ($this->_action == CRM_Core_Action::BASIC) {
$fragment = 'search';
} else {
if ($this->_action == CRM_Core_Action::PROFILE) {
$fragment = 'search/builder';
} else {
if ($this->_action == CRM_Core_Action::ADVANCED) {
$fragment = 'search/advanced';
} else {
$fragment = 'search/custom';
}
}
}
$path = 'force=1';
if (isset($ssID)) {
$path .= "&reset=1&ssID={$ssID}";
}
if (!CRM_Contact_Form_Search::isSearchContext($context)) {
$context = 'search';
}
$path .= "&context={$context}";
//set the user context for redirection of task actions
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
require_once 'CRM/Utils/Rule.php';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$path .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $path);
$session->replaceUserContext($url);
return;
}
示例11: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false);
$lid = CRM_Utils_Request::retrieve('lid', 'Positive', $this, false);
$eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, false);
$profileGID = CRM_Utils_Request::retrieve('profileGID', 'Integer', $this, false);
$this->assign('profileGID', $profileGID);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$type = 'Contact';
if ($cid) {
$ids = array($cid);
$this->_single = true;
if ($context && !$profileGID) {
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$session = CRM_Core_Session::singleton();
$urlString = "civicrm/contact/search/{$context}";
if ($context == 'search') {
$urlString = 'civicrm/contact/search';
}
$url = CRM_Utils_System::url($urlString, $urlParams);
$session->replaceUserContext($url);
}
} else {
if ($eid) {
$ids = $eid;
$type = 'Event';
} else {
if ($profileGID) {
require_once "CRM/Profile/Page/Listings.php";
$ids = CRM_Profile_Page_Listings::getProfileContact($profileGID);
} else {
parent::preProcess();
$ids = $this->_contactIds;
}
}
}
self::createMapXML($ids, $lid, $this, true, $type);
$this->assign('single', $this->_single);
}
示例12: postProcess
//.........这里部分代码省略.........
}
}
if (is_array($outGroups)) {
foreach ($outGroups as $key => $id) {
if ($id) {
$groups['exclude'][] = $id;
}
}
}
$mailings = array();
if (is_array($inMailings)) {
foreach ($inMailings as $key => $id) {
if ($id) {
$mailings['include'][] = $id;
}
}
}
if (is_array($outMailings)) {
foreach ($outMailings as $key => $id) {
if ($id) {
$mailings['exclude'][] = $id;
}
}
}
$session = CRM_Core_Session::singleton();
$params['groups'] = $groups;
$params['mailings'] = $mailings;
if ($this->get('mailing_id')) {
$ids = array();
// don't create a new mailing if already exists
$ids['mailing_id'] = $this->get('mailing_id');
$groupTableName = CRM_Contact_BAO_Group::getTableName();
$mailingTableName = CRM_Mailing_BAO_Mailing::getTableName();
// delete previous includes/excludes, if mailing already existed
foreach (array('groups', 'mailings') as $entity) {
$mg = new CRM_Mailing_DAO_Group();
$mg->mailing_id = $ids['mailing_id'];
$mg->entity_table = $entity == 'groups' ? $groupTableName : $mailingTableName;
$mg->find();
while ($mg->fetch()) {
$mg->delete();
}
}
} else {
// new mailing, so lets set the created_id
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_date'] = date('YmdHis');
}
$mailing = CRM_Mailing_BAO_Mailing::create($params, $ids);
$this->set('mailing_id', $mailing->id);
$dedupeEmail = FALSE;
if (isset($params['dedupe_email'])) {
$dedupeEmail = $params['dedupe_email'];
}
// also compute the recipients and store them in the mailing recipients table
CRM_Mailing_BAO_Mailing::getRecipients($mailing->id, $mailing->id, NULL, NULL, TRUE, $dedupeEmail);
$count = CRM_Mailing_BAO_Recipients::mailingSize($mailing->id);
$this->set('count', $count);
$this->assign('count', $count);
$this->set('groups', $groups);
$this->set('mailings', $mailings);
if ($qf_Group_submit) {
//when user perform mailing from search context
//redirect it to search result CRM-3711.
$ssID = $this->get('ssID');
$context = $this->get('context');
if ($ssID && $this->_searchBasedMailing) {
if ($this->_action == CRM_Core_Action::BASIC) {
$fragment = 'search';
} elseif ($this->_action == CRM_Core_Action::PROFILE) {
$fragment = 'search/builder';
} elseif ($this->_action == CRM_Core_Action::ADVANCED) {
$fragment = 'search/advanced';
} else {
$fragment = 'search/custom';
}
$context = $this->get('context');
if (!CRM_Contact_Form_Search::isSearchContext($context)) {
$context = 'search';
}
$urlParams = "force=1&reset=1&ssID={$ssID}&context={$context}";
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$draftURL = CRM_Utils_System::url('civicrm/mailing/browse/unscheduled', 'scheduled=false&reset=1');
$status = ts("Your mailing has been saved. You can continue later by clicking the 'Continue' action to resume working on it.<br /> From <a href='%1'>Draft and Unscheduled Mailings</a>.", array(1 => $draftURL));
CRM_Core_Session::setStatus($status);
//replace user context to search.
$url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $urlParams);
return $this->controller->setDestination($url);
} else {
$status = ts("Your mailing has been saved. Click the 'Continue' action to resume working on it.");
CRM_Core_Session::setStatus($status);
$url = CRM_Utils_System::url('civicrm/mailing/browse/unscheduled', 'scheduled=false&reset=1');
return $this->controller->setDestination($url);
}
}
}
示例13: postProcess
//.........这里部分代码省略.........
}
}
if (is_array($outGroups)) {
foreach ($outGroups as $key => $id) {
if ($id) {
$groups['exclude'][] = $id;
}
}
}
$mailings = array();
if (is_array($inMailings)) {
foreach ($inMailings as $key => $id) {
if ($id) {
$mailings['include'][] = $id;
}
}
}
if (is_array($outMailings)) {
foreach ($outMailings as $key => $id) {
if ($id) {
$mailings['exclude'][] = $id;
}
}
}
$session = CRM_Core_Session::singleton();
$params['groups'] = $groups;
$params['mailings'] = $mailings;
if ($this->get('mailing_id')) {
$ids = array();
// don't create a new mailing if already exists
$ids['mailing_id'] = $this->get('mailing_id');
$groupTableName = CRM_Contact_BAO_Group::getTableName();
$mailingTableName = CRM_Mailing_BAO_Mailing::getTableName();
// delete previous includes/excludes, if mailing already existed
require_once 'CRM/Contact/DAO/Group.php';
foreach (array('groups', 'mailings') as $entity) {
$mg = new CRM_Mailing_DAO_Group();
$mg->mailing_id = $ids['mailing_id'];
$mg->entity_table = $entity == 'groups' ? $groupTableName : $mailingTableName;
$mg->find();
while ($mg->fetch()) {
$mg->delete();
}
}
} else {
// new mailing, so lets set the created_id
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_date'] = date('YmdHis');
}
require_once 'CRM/Mailing/BAO/Mailing.php';
$mailing = CRM_Mailing_BAO_Mailing::create($params, $ids);
$this->set('mailing_id', $mailing->id);
$count = CRM_Mailing_BAO_Mailing::getRecipientsCount(true, false, $mailing->id);
$this->set('count', $count);
$this->assign('count', $count);
$this->set('groups', $groups);
$this->set('mailings', $mailings);
if ($qf_Group_submit) {
//when user perform mailing from search context
//redirect it to search result CRM-3711.
$ssID = $this->get('ssID');
$context = $this->get('context');
if ($ssID && $this->_searchBasedMailing) {
if ($this->_action == CRM_Core_Action::BASIC) {
$fragment = 'search';
} else {
if ($this->_action == CRM_Core_Action::PROFILE) {
$fragment = 'search/builder';
} else {
if ($this->_action == CRM_Core_Action::ADVANCED) {
$fragment = 'search/advanced';
} else {
$fragment = 'search/custom';
}
}
}
$context = $this->get('context');
if (!CRM_Contact_Form_Search::isSearchContext($context)) {
$context = 'search';
}
$urlParams = "force=1&reset=1&ssID={$ssID}&context={$context}";
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$draftURL = CRM_Utils_System::url('civicrm/mailing/browse/unscheduled', 'scheduled=false&reset=1');
$status = ts("Your mailing has been saved. You can continue later by clicking the 'Continue' action to resume working on it.<br /> From <a href='%1'>Draft and Unscheduled Mailings</a>.", array(1 => $draftURL));
CRM_Core_Session::setStatus($status);
//replace user context to search.
$url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $urlParams);
CRM_Utils_System::redirect($url);
} else {
$status = ts("Your mailing has been saved. Click the 'Continue' action to resume working on it.");
CRM_Core_Session::setStatus($status);
$url = CRM_Utils_System::url('civicrm/mailing/browse/unscheduled', 'scheduled=false&reset=1');
CRM_Utils_System::redirect($url);
}
}
}
示例14: setContext
/**
* Get context.
*
* @param $form
*/
public static function setContext(&$form)
{
$context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search');
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $form);
//validate the qfKey
if (!CRM_Utils_Rule::qfKey($qfKey)) {
$qfKey = NULL;
}
switch ($context) {
case 'dashboard':
case 'pledgeDashboard':
$url = CRM_Utils_System::url('civicrm/pledge', 'reset=1');
break;
case 'search':
$urlParams = 'force=1';
if ($qfKey) {
$urlParams .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/pledge/search', $urlParams);
break;
case 'user':
$url = CRM_Utils_System::url('civicrm/user', 'reset=1');
break;
case 'pledge':
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$form->_contactId}&selectedChild=pledge");
break;
case 'home':
$url = CRM_Utils_System::url('civicrm/dashboard', 'force=1');
break;
case 'activity':
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$form->_contactId}&selectedChild=activity");
break;
case 'standalone':
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
break;
default:
$cid = NULL;
if ($form->_contactId) {
$cid = '&cid=' . $form->_contactId;
}
$url = CRM_Utils_System::url('civicrm/pledge/search', 'force=1' . $cid);
break;
}
$session = CRM_Core_Session::singleton();
$session->pushUserContext($url);
}
示例15: preProcess
//.........这里部分代码省略.........
// Check the mode when this form is called either single or as
// search task action.
if ($this->_activityTypeId || $this->_context == 'standalone' || $this->_currentlyViewedContactId) {
$this->_single = TRUE;
$this->assign('urlPath', 'civicrm/activity');
} else {
// Set the appropriate action.
$url = CRM_Utils_System::currentPath();
$urlArray = explode('/', $url);
$searchPath = array_pop($urlArray);
$searchType = 'basic';
$this->_action = CRM_Core_Action::BASIC;
switch ($searchPath) {
case 'basic':
$searchType = $searchPath;
$this->_action = CRM_Core_Action::BASIC;
break;
case 'advanced':
$searchType = $searchPath;
$this->_action = CRM_Core_Action::ADVANCED;
break;
case 'builder':
$searchType = $searchPath;
$this->_action = CRM_Core_Action::PROFILE;
break;
case 'custom':
$this->_action = CRM_Core_Action::COPY;
$searchType = $searchPath;
break;
}
parent::preProcess();
$this->_single = FALSE;
$this->assign('urlPath', "civicrm/contact/search/{$searchType}");
$this->assign('urlPathVar', "_qf_Activity_display=true&qfKey={$this->controller->_key}");
}
$this->assign('single', $this->_single);
$this->assign('action', $this->_action);
if ($this->_action & CRM_Core_Action::VIEW) {
// Get the tree of custom fields.
$this->_groupTree =& CRM_Core_BAO_CustomGroup::getTree('Activity', $this, $this->_activityId, 0, $this->_activityTypeId);
}
if ($this->_activityTypeId) {
// Set activity type name and description to template.
list($this->_activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
$this->assign('activityTypeName', $this->_activityTypeName);
$this->assign('activityTypeDescription', $activityTypeDescription);
}
// set user context
$urlParams = $urlString = NULL;
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
if (!$qfKey) {
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
}
// Validate the qfKey.
if (!CRM_Utils_Rule::qfKey($qfKey)) {
$qfKey = NULL;
}
if ($this->_context == 'fulltext') {
$keyName = '&qfKey';
$urlParams = 'force=1';
$urlString = 'civicrm/contact/search/custom';
if ($this->_action == CRM_Core_Action::UPDATE) {
$keyName = '&key';
$urlParams .= '&context=fulltext&action=view';
$urlString = 'civicrm/contact/view/activity';
}