本文整理汇总了PHP中CRM_Contact_Page_View类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_Page_View类的具体用法?PHP CRM_Contact_Page_View怎么用?PHP CRM_Contact_Page_View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Contact_Page_View类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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->_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);
CRM_Pledge_Page_Tab::setContext();
if ($this->_action & CRM_Core_Action::UPDATE) {
$this->edit();
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
} else {
$pledgeId = CRM_Utils_Request::retrieve('pledgeId', 'Positive', $this);
$paymentDetails = CRM_Pledge_BAO_PledgePayment::getPledgePayments($pledgeId);
$this->assign('rows', $paymentDetails);
$this->assign('pledgeId', $pledgeId);
$this->assign('contactId', $this->_contactId);
// check if we can process credit card contribs
$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);
}
// check is the user has view/edit signer permission
$permission = 'view';
if (CRM_Core_Permission::check('edit pledges')) {
$permission = 'edit';
}
$this->assign('permission', $permission);
}
return parent::run();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:40,代码来源:Payment.php
示例2: 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);
CRM_Pledge_Page_Tab::setContext();
if ($this->_action & CRM_Core_Action::UPDATE) {
$this->edit();
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
} else {
$pledgeId = CRM_Utils_Request::retrieve('pledgeId', 'Positive', $this);
$paymentDetails = CRM_Pledge_BAO_PledgePayment::getPledgePayments($pledgeId);
$this->assign('rows', $paymentDetails);
$this->assign('pledgeId', $pledgeId);
$this->assign('contactId', $this->_contactId);
// check if we can process credit card contribs
CRM_Core_Payment::allowBackofficeCreditCard($this);
// check is the user has view/edit signer permission
$permission = 'view';
if (CRM_Core_Permission::check('edit pledges')) {
$permission = 'edit';
}
$this->assign('permission', $permission);
}
return parent::run();
}
开发者ID:hguru,项目名称:224Civi,代码行数:35,代码来源:Payment.php
示例3: preProcessSingle
static function preProcessSingle(&$form, $cid)
{
$form->_contactIds = array($cid);
// put contact display name in title for single contact mode
require_once 'CRM/Contact/Page/View.php';
CRM_Contact_Page_View::setTitle($cid);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:7,代码来源:PDFLetterCommon.php
示例4: preProcess
function preProcess()
{
// Make sure case types have been configured for the component
require_once 'CRM/Core/OptionGroup.php';
$caseType = CRM_Core_OptionGroup::values('case_type');
if (empty($caseType)) {
$this->assign('notConfigured', 1);
return;
}
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse');
if ($this->_contactId) {
$this->assign('contactId', $this->_contactId);
// check logged in url permission
require_once 'CRM/Contact/Page/View.php';
CRM_Contact_Page_View::checkUserPermission($this);
} else {
if ($this->_action & CRM_Core_Action::VIEW) {
CRM_Core_Error::fatal('Contact Id is required for view action.');
}
}
$activityTypes = CRM_Case_PseudoConstant::activityType();
$this->assign('openCaseId', $activityTypes['Open Case']['id']);
$this->assign('changeCaseTypeId', $activityTypes['Change Case Type']['id']);
$this->assign('changeCaseStatusId', $activityTypes['Change Case Status']['id']);
$this->assign('changeCaseStartDateId', $activityTypes['Change Case Start Date']['id']);
}
开发者ID:bhirsch,项目名称:civicrm,代码行数:29,代码来源:Tab.php
示例5: preProcess
function preProcess()
{
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$this->assign('contactId', $this->_contactId);
$contact = new CRM_Contact_BAO_Contact();
$contact->get('id', $this->_contactId);
$this->_apiKey = $contact->api_key;
$this->assign('apiKey', $this->_apiKey);
// check logged in url permission
CRM_Contact_Page_View::checkUserPermission($this);
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->assign('action', $this->_action);
$isAdmin = CRM_Core_Permission::check('administer CiviCRM') && CRM_Core_Permission::check('edit all contacts');
$session = CRM_Core_Session::singleton();
$isMyself = $this->_contactId && $this->_contactId == $session->get('userID');
$this->assign('isAdmin', $isAdmin);
$this->assign('isMyself', $isMyself);
$urlParam = 'reset=1&action=add&cid=' . $this->_contactId;
if ($this->_apiKey) {
$urlParam = 'reset=1&action=edit&cid=' . $this->_contactId;
}
$this->assign('addApiKeyUrl', CRM_Utils_System::url('civicrm/contact/apikey', $urlParam));
}
开发者ID:Beltline,项目名称:com.cividesk.apikey,代码行数:25,代码来源:APIKey.php
示例6: run
/**
* Run the page.
*
* This method is called after the page is created.
*/
public function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$cgId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$customRecId = CRM_Utils_Request::retrieve('customRecId', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1, $_REQUEST);
$cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1, $_REQUEST);
//custom groups Inline
$entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
$entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
$groupTree =& CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId, $cgId, $entitySubType);
$details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, NULL, $contactId);
//get the fields of single custom group record
if ($customRecId == 1) {
$fields = reset($details[$cgId]);
} else {
$fields = CRM_Utils_Array::value($customRecId, $details[$cgId]);
}
$this->assign('cgcount', $cgcount);
$this->assign('customRecId', $customRecId);
$this->assign('contactId', $contactId);
$this->assign('customGroupId', $cgId);
$this->assign_by_ref('cd_edit', $fields);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:scardinius,项目名称:civicrm-core,代码行数:33,代码来源:CustomData.php
示例7: run
/**
* Run the page.
*
* This method is called after the page is created.
*/
public function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name'));
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$entityBlock = array('contact_id' => $contactId);
$phones = CRM_Core_BAO_Phone::getValues($entityBlock);
if (!empty($phones)) {
foreach ($phones as $key => &$value) {
$value['location_type'] = $locationTypes[$value['location_type_id']];
$value['phone_type'] = $phoneTypes[$value['phone_type_id']];
}
}
$contact = new CRM_Contact_BAO_Contact();
$contact->id = $contactId;
$contact->find(TRUE);
$privacy = array();
foreach (CRM_Contact_BAO_Contact::$_commPrefs as $name) {
if (isset($contact->{$name})) {
$privacy[$name] = $contact->{$name};
}
}
$this->assign('contactId', $contactId);
$this->assign('phone', $phones);
$this->assign('privacy', $privacy);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:36,代码来源:Phone.php
示例8: preProcess
public function preProcess()
{
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$this->assign('contactId', $this->_contactId);
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
// check logged in url permission
CRM_Contact_Page_View::checkUserPermission($this);
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:9,代码来源:ContactSmartGroup.php
示例9: preProcess
function preProcess()
{
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$this->assign('contactId', $this->_contactId);
// check logged in url permission
CRM_Contact_Page_View::checkUserPermission($this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->assign('action', $this->_action);
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:9,代码来源:Tag.php
示例10: preProcess
function preProcess()
{
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, true);
$this->assign('contactId', $this->_contactId);
// check logged in url permission
require_once 'CRM/Contact/Page/View.php';
CRM_Contact_Page_View::checkUserPermission($this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse');
$this->assign('action', $this->_action);
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:10,代码来源:GroupContact.php
示例11: preProcess
/**
* Add a few specific things to view contact.
*
* @return void
*/
public function preProcess()
{
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$this->assign('contactId', $this->_contactId);
// check logged in url permission
CRM_Contact_Page_View::checkUserPermission($this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->assign('action', $this->_action);
$this->_groupId = CRM_Utils_Request::retrieve('gid', 'Positive', $this, TRUE);
$this->assign('groupId', $this->_groupId);
$this->_multiRecordDisplay = CRM_Utils_Request::retrieve('multiRecordDisplay', 'String', $this, FALSE);
$this->_cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', $this, FALSE);
$this->_recId = CRM_Utils_Request::retrieve('recId', 'Positive', $this, FALSE);
}
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:19,代码来源:CustomData.php
示例12: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
* @access public
*
*/
function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$params = array('id' => $contactId);
$defaults = array();
CRM_Contact_BAO_Contact::getValues($params, $defaults);
$defaults['privacy_values'] = CRM_Core_SelectValues::privacy();
$this->assign('contactId', $contactId);
$this->assign($defaults);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:CommunicationPreferences.php
示例13: run
/**
* Run the page.
*
* This method is called after the page is created.
*/
public function run()
{
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$this->assign('contactId', $contactId);
$this->assign('actionsMenuList', CRM_Contact_BAO_Contact::contextMenu($contactId));
CRM_Contact_Page_View::addUrls($this, $contactId);
// also create the form element for the activity links box
$controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_ActivityLinks', ts('Activity Links'), NULL);
$controller->setEmbedded(TRUE);
$controller->run();
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:20,代码来源:Actions.php
示例14: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
*/
public function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$isDeleted = (bool) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'is_deleted');
$this->assign('contactId', $contactId);
$title = CRM_Contact_Page_View::setTitle($contactId, $isDeleted);
$this->assign('title', $title);
// Check if this is default domain contact CRM-10482
$this->assign('domainContact', CRM_Contact_BAO_Contact::checkDomainContact($contactId));
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:22,代码来源:ContactName.php
示例15: preProcess
public function preProcess()
{
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'view');
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$this->assign('contactId', $this->_contactId);
// check logged in url permission
CRM_Contact_Page_View::checkUserPermission($this);
$this->assign('action', $this->_action);
if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit contributions')) {
// demote to view since user does not have edit contrib rights
$this->_permission = CRM_Core_Permission::VIEW;
$this->assign('permission', 'view');
}
}
开发者ID:konadave,项目名称:civicrm-core,代码行数:16,代码来源:ContributionRecur.php
示例16: preProcess
function preProcess()
{
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
if ($cid) {
CRM_Contact_Page_View::setTitle($cid);
}
CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this);
if (!$cid && $this->_context != 'standalone') {
parent::preProcess();
}
$this->assign('single', $this->_single);
if (CRM_Core_Permission::check('administer CiviCRM')) {
$this->assign('isAdmin', 1);
}
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:16,代码来源:SMS.php
示例17: preProcess
function preProcess()
{
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse');
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
//validate case configuration.
require_once 'CRM/Case/BAO/Case.php';
$configured = CRM_Case_BAO_Case::isCaseConfigured($this->_contactId);
$this->assign('notConfigured', !$configured['configured']);
$this->assign('allowToAddNewCase', $configured['allowToAddNewCase']);
$this->assign('redirectToCaseAdmin', $configured['redirectToCaseAdmin']);
if (!$configured['configured'] || $configured['redirectToCaseAdmin']) {
return;
}
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($this->_contactId) {
$this->assign('contactId', $this->_contactId);
// check logged in user permission
require_once 'CRM/Contact/Page/View.php';
if ($this->_id && $this->_action & CRM_Core_Action::VIEW) {
//user might have special permissions to view this case, CRM-5666
if (!CRM_Core_Permission::check('access all cases and activities')) {
$session = CRM_Core_Session::singleton();
$userCases = CRM_Case_BAO_Case::getCases(false, $session->get('userID'));
if (!array_key_exists($this->_id, $userCases)) {
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
}
} else {
CRM_Contact_Page_View::checkUserPermission($this);
}
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
} else {
if ($this->_action & CRM_Core_Action::VIEW) {
CRM_Core_Error::fatal('Contact Id is required for view action.');
}
}
$activityTypes = CRM_Case_PseudoConstant::activityType();
$this->assign('openCaseId', $activityTypes['Open Case']['id']);
$this->assign('changeCaseTypeId', $activityTypes['Change Case Type']['id']);
$this->assign('changeCaseStatusId', $activityTypes['Change Case Status']['id']);
$this->assign('changeCaseStartDateId', $activityTypes['Change Case Start Date']['id']);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:44,代码来源:Tab.php
示例18: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
*/
public function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name'));
$entityBlock = array('contact_id' => $contactId);
$openids = CRM_Core_BAO_OpenID::getValues($entityBlock);
if (!empty($openids)) {
foreach ($openids as $key => &$value) {
$value['location_type'] = $locationTypes[$value['location_type_id']];
}
}
$this->assign('contactId', $contactId);
$this->assign('openid', $openids);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:kidaa30,项目名称:yes,代码行数:26,代码来源:OpenID.php
示例19: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
*/
public function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$params = array('contact_id' => $contactId);
$websites = CRM_Core_BAO_Website::getValues($params, CRM_Core_DAO::$_nullArray);
if (!empty($websites)) {
foreach ($websites as $key => &$value) {
$value['website_type'] = $websiteTypes[$value['website_type_id']];
}
}
$this->assign('contactId', $contactId);
$this->assign('website', $websites);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:26,代码来源:Website.php
示例20: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
* @access public
*
*/
function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$cgId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
//custom groups Inline
$entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
$entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
$groupTree =& CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId, $cgId, $entitySubType);
$details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
$fields = array_pop($details[$cgId]);
$this->assign('contactId', $contactId);
$this->assign('customGroupId', $cgId);
$this->assign_by_ref('cd_edit', $fields);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:28,代码来源:CustomData.php
注:本文中的CRM_Contact_Page_View类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论