本文整理汇总了PHP中CRM_Contact_Page_View::run方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_Page_View::run方法的具体用法?PHP CRM_Contact_Page_View::run怎么用?PHP CRM_Contact_Page_View::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_Page_View
的用法示例。
在下文中一共展示了CRM_Contact_Page_View::run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
$pid = CRM_Utils_Request::retrieve('pid', $this);
$log = CRM_Utils_Request::retrieve('log', $this);
if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_VIEW | CRM_CORE_ACTION_DELETE)) {
$this->edit();
}
return parent::run();
}
示例2: run
/**
* Heart of the viewing process. The runner gets all the meta data for
* the contact and calls the appropriate type of page to view.
*
* @return void
* @access public
*
*/
function run()
{
$this->preProcess();
if ($this->_action & CRM_Core_Action::UPDATE) {
$this->edit();
} else {
$this->view();
}
return parent::run();
}
示例3: run
/**
* Heart of the viewing process. The runner gets all the meta data for
* the contact and calls the appropriate type of page to view.
*
* @return void
* @access public
*
*/
function run()
{
$this->preProcess();
if ($this->_action & CRM_CORE_ACTION_UPDATE) {
$this->edit();
} else {
$this->view();
}
return parent::run();
}
示例4: 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();
$this->setContext();
if ($this->_action & CRM_CORE_ACTION_VIEW) {
$this->view();
} else {
if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_DELETE)) {
$this->edit();
} else {
$this->browse();
}
}
return parent::run();
}
示例5: run
/**
* perform actions and display for activities.
*
* @return none
*
* @access public
*/
function run()
{
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
$action = CRM_Utils_Request::retrieve('action', 'String', $this);
$activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
if ($context == 'standalone' || !$contactId && $action != CRM_Core_Action::DELETE && !$activityId) {
$this->_action = CRM_Core_Action::ADD;
$this->assign('action', $this->_action);
} else {
// we should call contact view, preprocess only for activity in contact summary
$this->preProcess();
}
// route behaviour of contact/view/activity based on action defined
if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::VIEW)) {
$this->edit();
$activityTypeId = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
if ($activityTypeId == 3) {
return;
}
} elseif ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::DETACH)) {
$this->delete();
} else {
$this->browse();
}
return parent::run();
}
示例6: run
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
* @access public
* @param object $page - the view page which created this one
* @return none
* @static
*
*/
function run()
{
$this->preProcess();
// get permission detail view or edit
$permUser = CRM_Core_Permission::getPermission();
$editCustomData = CRM_CORE_PERMISSION_VIEW == $permUser ? 0 : 1;
$this->assign('editCustomData', $editCustomData);
$controller =& new CRM_Core_Controller_Simple('CRM_Contact_Form_CustomData', ts('Custom Data'), $this->_action);
$controller->setEmbedded(true);
// set the userContext stack
$doneURL = 'civicrm/contact/view/cd';
$session =& CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url($doneURL, 'action=browse&gid=' . $this->_groupId), false);
$controller->set('tableId', $this->_contactId);
$controller->set('groupId', $this->_groupId);
$controller->set('entityType', CRM_Contact_BAO_Contact::getContactType($this->_contactId));
$controller->process();
$controller->run();
return parent::run();
}
示例7: 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();
if ($this->_action == CRM_CORE_ACTION_DELETE) {
$groupContactId = CRM_Utils_Request::retrieve('gcid', $this);
$status = CRM_Utils_Request::retrieve('st', $this);
if (is_numeric($groupContactId) && $status) {
$this->del($groupContactId, $status);
}
}
$this->edit(CRM_CORE_ACTION_ADD);
$this->browse();
return parent::run();
}
示例8: 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()
{
$contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($context == 'standalone' && !$contactID) {
$this->_action = CRM_Core_Action::ADD;
$this->assign('action', $this->_action);
} else {
// we should call contact view, preprocess only for pledge in contact summary
$this->preProcess();
}
if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit pledges')) {
$this->_permission = CRM_Core_Permission::VIEW;
// demote to view since user does not have edit pledge rights
$this->assign('permission', 'view');
}
// check if we can process credit card registration
$processors = CRM_Core_PseudoConstant::paymentProcessor(false, false, "billing_mode IN ( 1, 3 )");
if (count($processors) > 0) {
$this->assign('newCredit', true);
} else {
$this->assign('newCredit', false);
}
$this->setContext();
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
} else {
if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
$this->edit();
} else {
if ($this->_action & CRM_Core_Action::DETACH) {
require_once 'CRM/Pledge/BAO/Payment.php';
require_once 'CRM/Contribute/PseudoConstant.php';
CRM_Pledge_BAO_Payment::updatePledgePaymentStatus($this->_id, null, null, array_search('Cancelled', CRM_Contribute_PseudoConstant::contributionStatus()));
$session =& CRM_Core_Session::singleton();
$session->setStatus(ts('Pledge has been Cancelled and all scheduled (not completed) payments have been cancelled.<br />'));
CRM_Utils_System::redirect($session->popUserContext());
} else {
$this->browse();
}
}
}
return parent::run();
}
示例9: run
/**
* perform actions and display for activities.
*
* @return none
*
* @access public
*/
function run()
{
$this->preProcess();
CRM_Utils_System::setTitle(ts('CiviCRM Home'));
//Get the id of Logged in User
$session =& CRM_Core_Session::singleton();
$contactId = $session->get('userID');
$admin = CRM_Core_Permission::check('view all activities') || CRM_Core_Permission::check('administer CiviCRM');
$this->browse($contactId, $admin);
return parent::run();
}
示例10: 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();
if ($this->_action & CRM_CORE_ACTION_VIEW) {
$this->view();
} else {
if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD)) {
$this->edit();
} else {
if ($this->_action & CRM_CORE_ACTION_DELETE) {
// we use the edit screen the confirm the delete
$this->edit();
}
}
}
$this->browse();
return parent::run();
}
示例11: run
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
* @access public
* @param object $page - the view page which created this one
* @return none
* @static
*
*/
function run()
{
$this->preProcess();
//set the userContext stack
$doneURL = 'civicrm/contact/view';
$session =& CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url($doneURL, 'action=browse&selectedChild=custom_' . $this->_groupId), false);
// get permission detail view or edit
$permUser = CRM_Core_Permission::getPermission();
$editCustomData = CRM_Core_Permission::VIEW == $permUser ? 0 : 1;
$this->assign('editCustomData', $editCustomData);
if ($this->_action == CRM_Core_Action::BROWSE) {
//Custom Groups Inline
$entityType = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
$entitySubType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId);
$groupTree =& CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId, $this->_groupId, $entitySubType);
CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
} else {
$controller =& new CRM_Core_Controller_Simple('CRM_Contact_Form_CustomData', ts('Custom Data'), $this->_action);
$controller->setEmbedded(true);
$controller->set('tableId', $this->_contactId);
$controller->set('groupId', $this->_groupId);
$controller->set('entityType', CRM_Contact_BAO_Contact::getContactType($this->_contactId));
$controller->set('entitySubType', CRM_Contact_BAO_Contact::getContactSubType($this->_contactId));
$controller->process();
$controller->run();
}
return parent::run();
}
示例12: 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()
{
$contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($context == 'standalone' && !$contactID) {
$this->_action = CRM_Core_Action::ADD;
$this->assign('action', $this->_action);
} else {
// we should call contact view, preprocess only for grant in contact summary
$this->preProcess();
}
$this->setContext();
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
} else {
if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
$this->edit();
} else {
$this->browse();
}
}
return parent::run();
}
示例13: 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();
if ($this->_action & CRM_CORE_ACTION_VIEW) {
$this->view();
} else {
if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_DELETE)) {
$this->edit();
} else {
if ($this->_action & CRM_CORE_ACTION_DISABLE) {
CRM_Contact_BAO_Relationship::setIsActive($this->_id, 0);
} else {
if ($this->_action & CRM_CORE_ACTION_ENABLE) {
CRM_Contact_BAO_Relationship::setIsActive($this->_id, 1);
}
}
}
}
$this->browse();
return parent::run();
}
示例14: 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()
{
$contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($context == 'standalone' && !$contactID) {
$this->_action = CRM_Core_Action::ADD;
$this->assign('action', $this->_action);
} else {
// we should call contact view, preprocess only for membership in contact summary
if ($this->_action != CRM_Core_Action::VIEW) {
$this->preProcess();
}
}
if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit memberships')) {
$this->_permission = CRM_Core_Permission::VIEW;
// demote to view since user does not have edit membership rights
$this->assign('permission', 'view');
}
// check if we can process credit card membership
$processors = CRM_Core_PseudoConstant::paymentProcessor(false, false, "billing_mode IN ( 1, 3 )");
if (count($processors) > 0) {
$this->assign('newCredit', true);
$this->_isPaymentProcessor = true;
} else {
$this->assign('newCredit', false);
$this->_isPaymentProcessor = false;
}
// Only show credit card membership signup if user has CiviContribute permission
if (CRM_Core_Permission::access('CiviContribute')) {
$this->_accessContribution = true;
$this->assign('accessContribution', true);
} else {
$this->_accessContribution = false;
$this->assign('accessContribution', false);
}
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
} else {
if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) {
$this->setContext();
$this->edit();
} else {
$this->setContext();
$this->browse();
}
}
return parent::run();
}
示例15: 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();
$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) {
$this->del($groupContactId, $status, $this->_contactId);
}
$session =& CRM_Core_Session::singleton();
CRM_Utils_System::redirect($session->popUserContext());
}
$this->edit(null, CRM_Core_Action::ADD);
$this->browse();
return parent::run();
}