本文整理汇总了PHP中CRM_Core_Controller_Simple::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Controller_Simple::reset方法的具体用法?PHP CRM_Core_Controller_Simple::reset怎么用?PHP CRM_Core_Controller_Simple::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Controller_Simple
的用法示例。
在下文中一共展示了CRM_Core_Controller_Simple::reset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* called when action is update.
*
* @param int $groupId
*
* @return null
*/
public function edit($groupId = NULL)
{
$this->assign('edit', $this->_edit);
if (!$this->_edit) {
return NULL;
}
$action = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject, FALSE, 'browse');
if ($action == CRM_Core_Action::DELETE) {
$groupContactId = CRM_Utils_Request::retrieve('gcid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
$status = CRM_Utils_Request::retrieve('st', 'String', CRM_Core_DAO::$_nullObject, TRUE);
if (is_numeric($groupContactId) && $status) {
CRM_Contact_Page_View_GroupContact::del($groupContactId, $status, $this->_contactId);
}
$url = CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}");
CRM_Utils_System::redirect($url);
}
$controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact', ts("Contact's Groups"), CRM_Core_Action::ADD, FALSE, FALSE, TRUE, FALSE);
$controller->setEmbedded(TRUE);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}"), FALSE);
$controller->reset();
$controller->set('contactId', $this->_contactId);
$controller->set('groupId', $groupId);
$controller->set('context', 'user');
$controller->set('onlyPublicGroups', $this->_onlyPublicGroups);
$controller->process();
$controller->run();
}
示例2: listParticipations
/**
* Function to list participations for the UF user
*
* return null
* @access public
*/
function listParticipations()
{
$controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('Events'), NULL);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('context', 'user');
$controller->set('cid', $this->_contactId);
$controller->set('force', 1);
$controller->process();
$controller->run();
}
示例3: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
$controller->setEmbedded(TRUE);
// set the userContext stack
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=tag'), FALSE);
$controller->reset();
$controller->set('contactId', $this->_contactId);
$controller->process();
$controller->run();
}
示例4: edit
/**
* This function is called when action is update
*
* @param int $groupID group id
*
* return null
* @access public
*/
function edit($groupId = NULL)
{
$controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact', ts('Contact\'s Groups'), $this->_action);
$controller->setEmbedded(TRUE);
// set the userContext stack
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', "action=browse&selectedChild=group&cid={$this->_contactId}"), FALSE);
$controller->reset();
$controller->set('contactId', $this->_contactId);
$controller->set('groupId', $groupId);
$controller->process();
$controller->run();
}
示例5: 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->preProcess();
$controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('grants'), NULL);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('limit', 10);
$controller->set('force', 1);
$controller->set('context', 'dashboard');
$controller->process();
$controller->run();
return parent::run();
}
示例6: edit
/**
* This function is called when action is update or new
*
* return null
* @access public
*/
function edit()
{
$controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_APIKey', ts('API Key'), $this->_action);
$controller->setEmbedded(TRUE);
// set the userContext stack
$session = CRM_Core_Session::singleton();
$url = CRM_Utils_System::url('civicrm/contact/view/apikey', 'action=browse&selectedChild=apikey&cid=' . $this->_contactId);
$session->pushUserContext($url);
$controller->reset();
$controller->set('contactId', $this->_contactId);
$controller->process();
$controller->run();
}
示例7: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('Events'), $this->_action);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('context', 'participant');
$controller->process();
$controller->run();
if ($this->_contactId) {
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
}
}
示例8: listActivities
/**
* Function to list participations for the UF user
*
* return null
* @access public
*/
function listActivities()
{
$controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('context', 'user');
$controller->set('cid', $this->_contactId);
$controller->set('status', array(1 => 'on', 7 => 'on'));
$controller->set('activity_role', 2);
$controller->set('force', 1);
$controller->process();
$controller->run();
return;
}
示例9: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
require_once 'CRM/Contribute/BAO/Contribution.php';
// add annual contribution
$annual = array();
list($annual['count'], $annual['amount'], $annual['avg']) = CRM_Contribute_BAO_Contribution::annual($this->_contactId);
$this->assign('annual', $annual);
$controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), $this->_action);
$controller->setEmbedded(true);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('id', $this->_id);
$controller->set('context', 'contribution');
$controller->process();
$controller->run();
//add honor block
// form all action links
$action = array_sum(array_keys($this->honorLinks()));
$params = array();
$params = CRM_Contribute_BAO_Contribution::getHonorContacts($this->_contactId);
if (!empty($params)) {
foreach ($params as $ids => $honorId) {
$params[$ids]['action'] = CRM_Core_Action::formLink(self::honorLinks(), $action, array('cid' => $honorId['honorId'], 'id' => $ids, 'cxt' => 'contribution', 'contributionType' => $honorId['type_id'], 'honorId' => $this->_contactId));
}
// assign vars to templates
$this->assign('action', $this->_action);
$this->assign('honorRows', $params);
$this->assign('honor', true);
}
//enable/disable soft credit records for test contribution
$isTest = 0;
if (CRM_Utils_Request::retrieve('isTest', 'Positive', $this)) {
$isTest = 1;
}
$this->assign('isTest', $isTest);
$softCreditList = CRM_Contribute_BAO_Contribution::getSoftContributionList($this->_contactId, $isTest);
if (!empty($softCreditList)) {
$softCreditTotals = array();
list($softCreditTotals['amount'], $softCreditTotals['avg'], $softCreditTotals['currency']) = CRM_Contribute_BAO_Contribution::getSoftContributionTotals($this->_contactId, $isTest);
$this->assign('softCredit', true);
$this->assign('softCreditRows', $softCreditList);
$this->assign('softCreditTotals', $softCreditTotals);
}
if ($this->_contactId) {
require_once 'CRM/Contact/BAO/Contact.php';
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
}
}
示例10: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('Grants'), $this->_action);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('context', 'grant');
$controller->process();
$controller->run();
if ($this->_contactId) {
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
$this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('grant', $this->_contactId);
}
}
示例11: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action);
$controller->setEmbedded(true);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('context', 'pledge');
$controller->process();
$controller->run();
if ($this->_contactId) {
require_once 'CRM/Contact/BAO/Contact.php';
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
}
}
示例12: listActivities
/**
* List participations for the UF user.
*
* @return bool
*/
public function listActivities()
{
$controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('context', 'user');
$controller->set('cid', $this->_contactId);
// Limit to status "Scheduled" and "Available"
$controller->set('status', array('IN' => array(1, 7)));
$controller->set('activity_role', 2);
$controller->set('force', 1);
$controller->process();
$controller->run();
return FALSE;
}
示例13: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$controller = new CRM_Core_Controller_Simple('CRM_Booking_Form_Search', ts('Booking'), $this->_action);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('context', 'booking');
$controller->process();
$controller->run();
if ($this->_contactId) {
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
}
$bookings = CRM_Booking_BAO_Booking::getContactAssociatedBooking($this->_contactId);
$this->assign('associatedBooking', $bookings);
}
示例14: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
$controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('Events'), $this->_action);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('context', 'participant');
$controller->process();
$controller->run();
if ($this->_contactId) {
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
$this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('participant', $this->_contactId);
// Refresh other tabs with related data
$this->ajaxResponse['updateTabs'] = array('#tab_contribute' => CRM_Contact_BAO_Contact::getCountComponent('contribution', $this->_contactId), '#tab_activity' => CRM_Contact_BAO_Contact::getCountComponent('activity', $this->_contactId));
}
}
示例15: listPledges
/**
* called when action is browse.
*/
public function listPledges()
{
$controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), NULL, FALSE, FALSE, TRUE, FALSE);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('limit', 12);
$controller->set('cid', $this->_contactId);
$controller->set('context', 'user');
$controller->set('force', 1);
$controller->process();
$controller->run();
// add honor block.
$honorParams = array();
$honorParams = CRM_Pledge_BAO_Pledge::getHonorContacts($this->_contactId);
if (!empty($honorParams)) {
// assign vars to templates
$this->assign('pledgeHonorRows', $honorParams);
$this->assign('pledgeHonor', TRUE);
}
$session = CRM_Core_Session::singleton();
$loggedUserID = $session->get('userID');
$this->assign('loggedUserID', $loggedUserID);
}