本文整理汇总了PHP中CRM_Contact_Page_View::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_Page_View::setTitle方法的具体用法?PHP CRM_Contact_Page_View::setTitle怎么用?PHP CRM_Contact_Page_View::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_Page_View
的用法示例。
在下文中一共展示了CRM_Contact_Page_View::setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
// 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']);
}
示例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
$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();
}
示例3: 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));
}
示例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->_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();
}
示例5: 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);
}
示例6: 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();
}
示例7: 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);
}
}
示例8: preProcess
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);
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
$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');
}
}
示例9: 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']);
}
示例10: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
// store case id if present
$this->_caseId = CRM_Utils_Request::retrieve('caseid', 'Positive', $this, FALSE);
$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_EmailCommon::preProcessFromAddress($this);
if (!$cid && $this->_context != 'standalone') {
parent::preProcess();
}
//early prevent, CRM-6209
if (count($this->_contactIds) > CRM_Contact_Form_Task_EmailCommon::MAX_EMAILS_KILL_SWITCH) {
CRM_Core_Error::statusBounce(ts('Please do not use this task to send a lot of emails (greater than %1). We recommend using CiviMail instead.', array(1 => CRM_Contact_Form_Task_EmailCommon::MAX_EMAILS_KILL_SWITCH)));
}
$this->assign('single', $this->_single);
if (CRM_Core_Permission::check('administer CiviCRM')) {
$this->assign('isAdmin', 1);
}
}
示例11: preProcess
function preProcess()
{
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
if ($this->_id && CRM_Core_BAO_Note::getNotePrivacyHidden($this->_id)) {
CRM_Core_Error::statusBounce(ts('You do not have access to this note.'));
}
$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);
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
CRM_Utils_System::setTitle(ts('Notes for') . ' ' . $displayName);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->assign('action', $this->_action);
}
示例12: preProcess
/**
* Function to build the form
*
* @return None
* @access public
*/
function preProcess()
{
$this->_cdType = CRM_Utils_Array::value('type', $_GET);
$this->assign('cdType', FALSE);
if ($this->_cdType) {
$this->assign('cdType', TRUE);
return CRM_Custom_Form_CustomData::preProcess($this);
}
$this->_atypefile = CRM_Utils_Array::value('atypefile', $_GET);
$this->assign('atypefile', FALSE);
if ($this->_atypefile) {
$this->assign('atypefile', TRUE);
}
$session = CRM_Core_Session::singleton();
$this->_currentUserId = $session->get('userID');
$this->_currentlyViewedContactId = $this->get('contactId');
if (!$this->_currentlyViewedContactId) {
$this->_currentlyViewedContactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
}
$this->assign('contactId', $this->_currentlyViewedContactId);
if ($this->_currentlyViewedContactId) {
CRM_Contact_Page_View::setTitle($this->_currentlyViewedContactId);
}
//give the context.
if (!isset($this->_context)) {
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
if (CRM_Contact_Form_Search::isSearchContext($this->_context)) {
$this->_context = 'search';
} elseif (!in_array($this->_context, array('dashlet', 'dashletFullscreen')) && $this->_currentlyViewedContactId) {
$this->_context = 'activity';
}
$this->_compContext = CRM_Utils_Request::retrieve('compContext', 'String', $this);
}
$this->assign('context', $this->_context);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this);
if ($this->_action & CRM_Core_Action::DELETE) {
if (!CRM_Core_Permission::check('delete activities')) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
}
}
//CRM-6957
//when we come from contact search, activity id never comes.
//so don't try to get from object, it might gives you wrong one.
// if we're not adding new one, there must be an id to
// an activity we're trying to work on.
if ($this->_action != CRM_Core_Action::ADD && get_class($this->controller) != 'CRM_Contact_Controller_Search') {
$this->_activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
}
$this->_activityTypeId = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
$this->assign('atype', $this->_activityTypeId);
//check for required permissions, CRM-6264
if ($this->_activityId && in_array($this->_action, array(CRM_Core_Action::UPDATE, CRM_Core_Action::VIEW)) && !CRM_Activity_BAO_Activity::checkPermission($this->_activityId, $this->_action)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
if ($this->_action & CRM_Core_Action::VIEW && CRM_Activity_BAO_Activity::checkPermission($this->_activityId, CRM_Core_Action::UPDATE)) {
$this->assign('permission', 'edit');
}
if (!$this->_activityTypeId && $this->_activityId) {
$this->_activityTypeId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_activityId, 'activity_type_id');
}
//Assigning Activity type name
if ($this->_activityTypeId) {
$activityTName = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $this->_activityTypeId, 'name');
if ($activityTName[$this->_activityTypeId]) {
$this->_activityTypeName = $activityTName[$this->_activityTypeId];
$this->assign('activityTName', $activityTName[$this->_activityTypeId]);
}
}
// Assign pageTitle to be "Activity - "+ activity name
if (isset($activityTName)) {
$pageTitle = 'Activity - ' . CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
$this->assign('pageTitle', $pageTitle);
}
//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;
//.........这里部分代码省略.........
示例13: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse');
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
if ($context == 'standalone') {
$this->_action = CRM_Core_Action::ADD;
} else {
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, true);
require_once 'CRM/Contact/BAO/Contact.php';
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('contactId', $this->_contactId);
$this->assign('displayName', $displayName);
// check logged in url permission
require_once 'CRM/Contact/Page/View.php';
CRM_Contact_Page_View::checkUserPermission($this);
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
}
$this->assign('action', $this->_action);
if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit grants')) {
$this->_permission = CRM_Core_Permission::VIEW;
// demote to view since user does not have edit grant rights
$this->assign('permission', 'view');
}
}
示例14: preProcessSingle
static function preProcessSingle(&$form, $cid)
{
$form->_contactIds = array($cid);
// put contact display name in title for single contact mode
CRM_Contact_Page_View::setTitle($cid);
}
示例15: preProcess
/**
* Function to build the form
*
* @return None
* @access public
*/
function preProcess()
{
$this->_caseId = CRM_Utils_Request::retrieve('caseid', 'Positive', $this);
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
if (!$this->_context) {
$this->_context = 'caseActivity';
}
$this->_crmDir = 'Case';
$this->assign('context', $this->_context);
$result = parent::preProcess();
$scheduleStatusId = CRM_Core_OptionGroup::getValue('activity_status', 'Scheduled', 'name');
$this->assign('scheduleStatusId', $scheduleStatusId);
if ($this->_cdType || $this->_addAssigneeContact || $this->_addTargetContact) {
return $result;
}
if (!$this->_caseId && $this->_activityId) {
$this->_caseId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseActivity', $this->_activityId, 'case_id', 'activity_id');
}
if ($this->_caseId) {
$this->assign('caseId', $this->_caseId);
}
if (!$this->_caseId || !$this->_activityId && !$this->_activityTypeId) {
CRM_Core_Error::fatal('required params missing.');
}
//check for case activity access.
if (!CRM_Case_BAO_Case::accessCiviCase()) {
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
//validate case id.
if ($this->_caseId && !CRM_Core_Permission::check('access all cases and activities')) {
$session = CRM_Core_Session::singleton();
$allCases = CRM_Case_BAO_Case::getCases(TRUE, $session->get('userID'));
if (!array_key_exists($this->_caseId, $allCases)) {
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
}
//validate case activity id.
if ($this->_activityId && $this->_action & CRM_Core_Action::UPDATE) {
$valid = CRM_Case_BAO_Case::checkPermission($this->_activityId, 'edit', $this->_activityTypeId);
if (!$valid) {
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
}
$this->_caseType = CRM_Case_BAO_Case::getCaseType($this->_caseId, 'name');
$this->assign('caseType', $this->_caseType);
$xmlProcessorProcess = new CRM_Case_XMLProcessor_Process();
$isMultiClient = $xmlProcessorProcess->getAllowMultipleCaseClients();
$this->assign('multiClient', $isMultiClient);
if ($isMultiClient) {
$clients = CRM_Case_BAO_Case::getContactNames($this->_caseId);
$this->assign('client_names', $clients);
} else {
$clientName = $this->_getDisplayNameById($this->_currentlyViewedContactId);
$this->assign('client_name', $clientName);
}
// set context for pushUserContext and for statusBounce
if ($this->_context == 'fulltext') {
if ($this->_action == CRM_Core_Action::UPDATE || $this->_action == CRM_Core_Action::DELETE) {
$url = CRM_Utils_System::url('civicrm/contact/view/case', "reset=1&action=view&cid={$this->_currentlyViewedContactId}&id={$this->_caseId}&show=1&context={$this->_context}");
} else {
$url = CRM_Utils_System::url('civicrm/contact/search/custom', 'force=1');
}
} else {
$url = CRM_Utils_System::url('civicrm/contact/view/case', "reset=1&action=view&cid={$this->_currentlyViewedContactId}&id={$this->_caseId}&show=1");
}
if (!$this->_activityId) {
$caseTypes = CRM_Case_PseudoConstant::caseType();
if (empty($caseTypes) && $this->_activityTypeName == 'Change Case Type' && !$this->_caseId) {
$url = CRM_Utils_System::url('civicrm/contact/view/case', "reset=1&action=view&cid={$this->_currentlyViewedContactId}&id={$this->_caseId}&show=1");
$session = CRM_Core_Session::singleton();
$session->pushUserContext($url);
CRM_Core_Error::statusBounce(ts("You do not have any active Case Types"));
}
// check if activity count is within the limit
$xmlProcessor = new CRM_Case_XMLProcessor_Process();
$activityInst = $xmlProcessor->getMaxInstance($this->_caseType);
// If not bounce back and also provide activity edit link
if (isset($activityInst[$this->_activityTypeName])) {
$activityCount = CRM_Case_BAO_Case::getCaseActivityCount($this->_caseId, $this->_activityTypeId);
if ($activityCount >= $activityInst[$this->_activityTypeName]) {
if ($activityInst[$this->_activityTypeName] == 1) {
$atArray = array('activity_type_id' => $this->_activityTypeId);
$activities = CRM_Case_BAO_Case::getCaseActivity($this->_caseId, $atArray, $this->_currentUserId);
$activities = array_keys($activities);
$activities = $activities[0];
$editUrl = CRM_Utils_System::url('civicrm/case/activity', "reset=1&cid={$this->_currentlyViewedContactId}&caseid={$this->_caseId}&action=update&id={$activities}");
}
CRM_Core_Error::statusBounce(ts("You can not add another '%1' activity to this case. %2", array(1 => $this->_activityTypeName, 2 => "Do you want to <a href='{$editUrl}'>edit the existing activity</a> ?")), $url);
}
}
}
if ($this->_currentlyViewedContactId) {
CRM_Contact_Page_View::setTitle($this->_currentlyViewedContactId);
}
//.........这里部分代码省略.........