本文整理汇总了PHP中CRM_Contact_BAO_Contact::displayName方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::displayName方法的具体用法?PHP CRM_Contact_BAO_Contact::displayName怎么用?PHP CRM_Contact_BAO_Contact::displayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact::displayName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
$contactID = CRM_Utils_Request::retrieve('cid', 'Integer');
if (!empty($contactID)) {
if (!self::checkPermissions($contactID, 'viewWidget')) {
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm'));
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page'));
}
CRM_Utils_System::setTitle(ts('Absences for %1', array(1 => CRM_Contact_BAO_Contact::displayName($contactID))));
self::registerResources($contactID);
} else {
$session = CRM_Core_Session::singleton();
if (is_numeric($session->get('userID'))) {
if (!self::checkPermissions($session->get('userID'), 'viewWidget')) {
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm'));
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page'));
}
CRM_Utils_System::setTitle(ts('My Absences'));
self::registerResources($session->get('userID'));
} else {
throw new CRM_Core_Exception("Failed to determine contact ID");
}
}
parent::run();
}
示例2: 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);
}
示例3: 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);
}
示例4: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', $this, false);
if ($cid) {
// not sure why this is needed :(
// also add the cid params to the Menu array
CRM_Utils_Menu::addParam('cid', $cid);
// create menus ..
$startWeight = CRM_Utils_Menu::getMaxWeight('civicrm/contact/view');
$startWeight++;
CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($cid), 'civicrm/contact/view/cd', $startWeight);
$this->_contactIds = array($cid);
$this->_single = true;
$smsNumbers = CRM_Contact_BAO_Contact::allPhones($cid, 'Mobile');
$this->_emails = array();
$toName = CRM_Contact_BAO_Contact::displayName($cid);
foreach ($smsNumbers as $number => $item) {
$this->_smsNumbers[$number] = '"' . $toName . '" <' . $number . '> ' . $item['locationType'];
if ($item['is_primary']) {
$this->_smsNumbers[$number] .= ' ' . ts('(preferred)');
}
$this->_smsNumbers[$number] = htmlspecialchars($this->_emails[$email]);
}
} else {
parent::preProcess();
}
$this->assign('single', $this->_single);
}
示例5: buildLineItems
function buildLineItems()
{
foreach ($this->cart->events_in_carts as $event_in_cart) {
$event_in_cart->load_location();
}
$line_items = $this->get('line_items');
foreach ($line_items as $line_item) {
$event_in_cart = $this->cart->get_event_in_cart_by_event_id($line_item['event_id']);
$not_waiting_participants = array();
foreach ($event_in_cart->not_waiting_participants() as $participant) {
$not_waiting_participants[] = array('display_name' => CRM_Contact_BAO_Contact::displayName($participant->contact_id));
}
$waiting_participants = array();
foreach ($event_in_cart->waiting_participants() as $participant) {
$waiting_participants[] = array('display_name' => CRM_Contact_BAO_Contact::displayName($participant->contact_id));
}
$line_item['event'] = $event_in_cart->event;
$line_item['num_participants'] = count($not_waiting_participants);
$line_item['participants'] = $not_waiting_participants;
$line_item['num_waiting_participants'] = count($waiting_participants);
$line_item['waiting_participants'] = $waiting_participants;
$line_item['location'] = $event_in_cart->location;
$line_item['class'] = $event_in_cart->event->parent_event_id ? 'subevent' : NULL;
$this->sub_total += $line_item['amount'];
$this->line_items[] = $line_item;
}
$this->assign('line_items', $this->line_items);
}
示例6: postProcess
static function postProcess(&$form)
{
$values = $form->exportValues();
$teamId = $values['pcp_team_contact'];
$teampcpId = CRM_Pcpteams_Utils::getPcpIdByContactAndEvent($form->get('component_page_id'), $teamId);
$userId = CRM_Pcpteams_Utils::getloggedInUserId();
// Create Team Member of relation to this Team
$cfpcpab = CRM_Pcpteams_Utils::getPcpABCustomFieldId();
$cfpcpba = CRM_Pcpteams_Utils::getPcpBACustomFieldId();
$customParams = array("custom_{$cfpcpab}" => $form->get('page_id'), "custom_{$cfpcpba}" => $teampcpId);
CRM_Pcpteams_Utils::createTeamRelationship($userId, $teamId, $customParams);
$form->_teamName = CRM_Contact_BAO_Contact::displayName($teamId);
$form->set('teamName', $form->_teamName);
$form->set('teamContactID', $teamId);
$form->set('teamPcpId', $teampcpId);
$teamAdminId = CRM_Pcpteams_Utils::getTeamAdmin($teampcpId);
// Team Join: create activity
$actParams = array('target_contact_id' => $teamId, 'assignee_contact_id' => $teamAdminId);
CRM_Pcpteams_Utils::createPcpActivity($actParams, CRM_Pcpteams_Constant::C_AT_REQ_MADE);
CRM_Core_Session::setStatus(ts('A notification has been sent to the team. Once approved, team should be visible on your page.'), ts('Team Request Sent'));
//send email once the team request has done.
list($teamAdminName, $teamAdminEmail) = CRM_Contact_BAO_Contact::getContactDetails($teamAdminId);
$contactDetails = civicrm_api('Contact', 'get', array('version' => 3, 'sequential' => 1, 'id' => $userId));
$emailParams = array('tplParams' => array('teamAdminName' => $teamAdminName, 'userFirstName' => $contactDetails['values'][0]['first_name'], 'userlastName' => $contactDetails['values'][0]['last_name'], 'teamName' => $form->_teamName, 'pageURL' => CRM_Utils_System::url('civicrm/pcp/manage', "reset=1&id={$teampcpId}", TRUE, NULL, FALSE, TRUE)), 'email' => array($teamAdminName => array('first_name' => $teamAdminName, 'last_name' => $teamAdminName, 'email-Primary' => $teamAdminEmail, 'display_name' => $teamAdminName)), 'valueName' => CRM_Pcpteams_Constant::C_MSG_TPL_JOIN_REQUEST);
$sendEmail = CRM_Pcpteams_Utils::sendMail($userId, $emailParams);
}
示例7: view
/**
* View details of a relationship
*
* @return void
*
* @access public
*/
function view()
{
require_once 'CRM/Core/DAO.php';
$viewRelationship = CRM_Contact_BAO_Relationship::getRelationship($this->_contactId, null, null, null, $this->_id);
//To check whether selected contact is a contact_id_a in
//relationship type 'a_b' in relationship table, if yes then
//revert the permissionship text in template
$relationship =& new CRM_Contact_DAO_Relationship();
$relationship->id = $viewRelationship[$this->_id]['id'];
if ($relationship->find(true)) {
if ($viewRelationship[$this->_id]['rtype'] == 'a_b' && $this->_contactId == $relationship->contact_id_a) {
$this->assign("is_contact_id_a", true);
}
}
$relType = $viewRelationship[$this->_id]['civicrm_relationship_type_id'];
$this->assign('viewRelationship', $viewRelationship);
$viewNote = CRM_Core_BAO_Note::getNote($this->_id);
$this->assign('viewNote', $viewNote);
$groupTree =& CRM_Core_BAO_CustomGroup::getTree('Relationship', $this, $this->_id, 0, $relType);
CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
// add viewed contribution to recent items list
require_once 'CRM/Utils/Recent.php';
$url = CRM_Utils_System::url('civicrm/contact/view/rel', "action=view&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&context=home");
$title = CRM_Contact_BAO_Contact::displayName($this->_contactId) . ' (' . $viewRelationship[$this->_id]['relation'] . ' ' . CRM_Contact_BAO_Contact::displayName($viewRelationship[$this->_id]['cid']) . ')';
// add the recently viewed Relationship
CRM_Utils_Recent::add($title, $url, $viewRelationship[$this->_id]['id'], 'Relationship', $this->_contactId, null);
}
示例8: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
$this->_contactID = $this->get('cid');
$this->_caseID = $this->get('id');
$this->assign('caseID', $this->_caseID);
$this->assign('contactID', $this->_contactID);
//retrieve details about case
$params = array('id' => $this->_caseID);
$returnProperties = array('case_type_id', 'subject', 'status_id', 'start_date');
CRM_Core_DAO::commonRetrieve('CRM_Case_BAO_Case', $params, $values, $returnProperties);
$values['case_type_id'] = explode(CRM_Case_BAO_Case::VALUE_SEPERATOR, CRM_Utils_Array::value('case_type_id', $values));
$statuses = CRM_Case_PseudoConstant::caseStatus();
$caseTypeName = CRM_Case_PseudoConstant::caseTypeName($this->_caseID);
$caseType = CRM_Core_OptionGroup::getLabel('case_type', $caseTypeName['id']);
$this->_caseDetails = array('case_type' => $caseType, 'case_status' => $statuses[$values['case_status_id']], 'case_subject' => CRM_Utils_Array::value('subject', $values), 'case_start_date' => $values['case_start_date']);
$this->_caseType = $caseTypeName['name'];
$this->assign('caseDetails', $this->_caseDetails);
$newActivityUrl = CRM_Utils_System::url('civicrm/case/activity', "action=add&reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&atype=", false, null, false);
$this->assign('newActivityUrl', $newActivityUrl);
$reportUrl = CRM_Utils_System::url('civicrm/case/report', "reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&asn=", false, null, false);
$this->assign('reportUrl', $reportUrl);
// add to recently viewed
require_once 'CRM/Utils/Recent.php';
require_once 'CRM/Contact/BAO/Contact.php';
$url = CRM_Utils_System::url('civicrm/contact/view/case', "action=view&reset=1&id={$this->_caseID}&cid={$this->_contactID}&context=home");
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactID);
$this->assign('displayName', $displayName);
$title = $displayName . ' - ' . $caseType;
// add the recently created case
CRM_Utils_Recent::add($title, $url, $this->_caseID, 'Case', $this->_contactID, null);
}
示例9: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm()
{
parent::buildQuickForm();
$this->setPageTitle(ts('Financial Batch'));
if (isset($this->_id)) {
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'title');
CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Accounting Batch'));
$this->assign('batchTitle', $this->_title);
$contactID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'created_id');
$contactName = CRM_Contact_BAO_Contact::displayName($contactID);
$this->assign('contactName', $contactName);
}
$this->applyFilter('__ALL__', 'trim');
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'next', 'name' => ts('Save and New'), 'subName' => 'new'), array('type' => 'cancel', 'name' => ts('Cancel'))));
if ($this->_action & CRM_Core_Action::UPDATE && $this->_id) {
$batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
//unset exported status
$exportedStatusId = CRM_Utils_Array::key('Exported', $batchStatus);
unset($batchStatus[$exportedStatusId]);
$this->add('select', 'status_id', ts('Batch Status'), array('' => ts('- select -')) + $batchStatus, TRUE);
$this->freeze(array('status_id'));
}
$attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch');
$this->add('text', 'title', ts('Batch Name'), $attributes['name'], TRUE);
$this->add('textarea', 'description', ts('Description'), $attributes['description']);
$this->add('select', 'payment_instrument_id', ts('Payment Method'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), FALSE);
$this->add('text', 'total', ts('Total Amount'), $attributes['total']);
$this->add('text', 'item_count', ts('Number of Transactions'), $attributes['item_count']);
$this->addFormRule(array('CRM_Financial_Form_FinancialBatch', 'formRule'), $this);
}
示例10: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
parent::preProcess();
$details = CRM_Booking_BAO_Booking::getBookingDetails($this->_id);
$this->_values['slots'] = CRM_Utils_Array::value('slots', $details);
$this->_values['sub_slots'] = CRM_Utils_Array::value('sub_slots', $details);
$this->_values['adhoc_charges'] = CRM_Utils_Array::value('adhoc_charges', $details);
$this->_values['cancellation_charges'] = CRM_Utils_Array::value('cancellation_charges', $details);
$this->_values['contribution'] = CRM_Utils_Array::value('contribution', $details);
$this->_values['sub_total'] = CRM_Utils_Array::value('total_amount', $this->_values) + CRM_Utils_Array::value('discount_amount', $this->_values);
//total_amount has been deducted from discount
$this->assign($this->_values);
$displayName = CRM_Contact_BAO_Contact::displayName($this->_values['primary_contact_id']);
$secondaryContactDisplayName = CRM_Contact_BAO_Contact::displayName(CRM_Utils_Array::value('secondary_contact_id', $this->_values));
$this->assign('displayName', $displayName);
$this->assign('secondaryContactDisplayName', $secondaryContactDisplayName);
$this->assign('contact_id', $this->_cid);
$params = array('option_group_name' => CRM_Booking_Utils_Constants::OPTION_BOOKING_STATUS, 'name' => CRM_Booking_Utils_Constants::OPTION_VALUE_CANCELLED);
$result = civicrm_api3('OptionValue', 'get', $params);
$this->_cancelStatusId = $cancelStatus = CRM_Utils_Array::value('value', CRM_Utils_Array::value($result['id'], $result['values']));
if ($this->_values['status_id'] == $cancelStatus) {
$this->assign('is_cancelled', TRUE);
}
// omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
CRM_Utils_System::setTitle(ts('View Booking for') . ' ' . $displayName);
self::registerScripts($this);
}
示例11: createUser
/**
* @inheritDoc
*/
public function createUser(&$params, $mail)
{
$baseDir = JPATH_SITE;
require_once $baseDir . '/components/com_users/models/registration.php';
$userParams = JComponentHelper::getParams('com_users');
$model = new UsersModelRegistration();
$ufID = NULL;
// get the default usertype
$userType = $userParams->get('new_usertype');
if (!$userType) {
$userType = 2;
}
if (isset($params['name'])) {
$fullname = trim($params['name']);
} elseif (isset($params['contactID'])) {
$fullname = trim(CRM_Contact_BAO_Contact::displayName($params['contactID']));
} else {
$fullname = trim($params['cms_name']);
}
// Prepare the values for a new Joomla user.
$values = array();
$values['name'] = $fullname;
$values['username'] = trim($params['cms_name']);
$values['password1'] = $values['password2'] = $params['cms_pass'];
$values['email1'] = $values['email2'] = trim($params[$mail]);
$lang = JFactory::getLanguage();
$lang->load('com_users', $baseDir);
$register = $model->register($values);
$ufID = JUserHelper::getUserId($values['username']);
return $ufID;
}
示例12: 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);
}
示例13: addContributionToBatch
/**
* Given an array of contributionIDs, add them to a batch
*
* @param array $contributionIDs (reference ) the array of contribution ids to be added
* @param int $batchID - the batchID to be added to
*
* @return array (total, added, notAdded) ids of contributions added to the batch
* @access public
* @static
*/
static function addContributionToBatch($contributionIDs, $batchID)
{
$date = date('YmdHis');
$contributionsAdded = array();
$contributionsNotAdded = array();
require_once "GiftAid/Utils/GiftAid.php";
require_once "CRM/Contribute/BAO/Contribution.php";
require_once 'CRM/Core/DAO/EntityBatch.php';
require_once "CRM/Core/BAO/Address.php";
require_once "CRM/Contact/BAO/Contact.php";
require_once "CRM/Utils/Address.php";
$charityColumnExists = CRM_Core_DAO::checkFieldExists('civicrm_value_gift_aid_submission', 'charity');
foreach ($contributionIDs as $contributionID) {
$batchContribution =& new CRM_Core_DAO_EntityBatch();
$batchContribution->entity_table = 'civicrm_contribution';
$batchContribution->entity_id = $contributionID;
// check if the selected contribution id already in a batch
// if not, add to batchContribution else keep the count of contributions that are not added
if ($batchContribution->find(true)) {
$contributionsNotAdded[] = $contributionID;
continue;
}
// get additional info
// get contribution details from Contribution using contribution id
$params = array('id' => $contributionID);
CRM_Contribute_BAO_Contribution::retrieve($params, $contribution, $ids);
$contactId = $contribution['contact_id'];
// check if contribution is valid for gift aid
if (GiftAid_Utils_GiftAid::isEligibleForGiftAid($contactId, $contribution['receive_date'], $contributionID)) {
$batchContribution->batch_id = $batchID;
$batchContribution->save();
// get display name
$displayName = CRM_Contact_BAO_Contact::displayName($contactId);
// get Address & Postal Code from Address
$params = array('contact_id' => $contactId, 'is_primary' => 1);
$address = CRM_Core_BAO_Address::getValues($params);
$address = $address[1];
//adds all address lines to the report
$fullFormatedAddress = CRM_Utils_Address::format($address);
// get gift aid amount
$giftAidAmount = self::_calculateGiftAidAmt($contribution['total_amount']);
// FIXME: check if there is customTable method
$query = "\nINSERT INTO civicrm_value_gift_aid_submission \n(entity_id, eligible_for_gift_aid, name, address, post_code, amount, gift_aid_amount) \nVALUES \n ( %1, 1, %2, %3, %4, %5, %6 )\nON DUPLICATE KEY UPDATE \nname = %2, \naddress = %3,\npost_code = %4,\namount = %5,\ngift_aid_amount = %6\n";
$sqlParams = array(1 => array($contributionID, 'Integer'), 2 => array($displayName, 'String'), 3 => array($fullFormatedAddress, 'String'), 4 => array($address['postal_code'], 'String'), 5 => array($contribution['total_amount'], 'Money'), 6 => array($giftAidAmount, 'Money'));
CRM_Core_DAO::executeQuery($query, $sqlParams);
$contributionsAdded[] = $contributionID;
} else {
$contributionsNotAdded[] = $contributionID;
}
}
if (!empty($contributionsAdded)) {
// if there is any extra work required to be done for contributions that are batched,
// should be done via hook
GiftAid_Utils_Hook::batchContributions($batchID, $contributionsAdded);
}
return array(count($contributionIDs), count($contributionsAdded), count($contributionsNotAdded));
}
示例14: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
$values = $ids = array();
$params = array('id' => $this->get('id'));
CRM_Pledge_BAO_Pledge::getValues($params, $values, $ids);
$values['frequencyUnit'] = ts('%1(s)', array(1 => $values['frequency_unit']));
if (isset($values["honor_contact_id"]) && $values["honor_contact_id"]) {
$sql = "SELECT display_name FROM civicrm_contact WHERE id = " . $values["honor_contact_id"];
$dao = new CRM_Core_DAO();
$dao->query($sql);
if ($dao->fetch()) {
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$values['honor_contact_id']}");
$values["honor_display"] = "<A href = {$url}>" . $dao->display_name . "</A>";
}
$honor = CRM_Core_PseudoConstant::get('CRM_Pledge_DAO_Pledge', 'honor_type_id');
$values['honor_type'] = $honor[$values['honor_type_id']];
}
//handle custom data.
$groupTree = CRM_Core_BAO_CustomGroup::getTree('Pledge', $this, $params['id']);
CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
if (!empty($values['contribution_page_id'])) {
$values['contribution_page'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $values['contribution_page_id'], 'title');
}
$values['financial_type'] = CRM_Utils_Array::value($values['financial_type_id'], CRM_Contribute_PseudoConstant::financialType());
if ($values['status_id']) {
$values['pledge_status'] = CRM_Utils_Array::value($values['status_id'], CRM_Contribute_PseudoConstant::contributionStatus());
}
$url = CRM_Utils_System::url('civicrm/contact/view/pledge', "action=view&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home");
$recentOther = array();
if (CRM_Core_Permission::checkActionPermission('CiviPledge', CRM_Core_Action::UPDATE)) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/view/pledge', "action=update&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home");
}
if (CRM_Core_Permission::checkActionPermission('CiviPledge', CRM_Core_Action::DELETE)) {
$recentOther['deleteUrl'] = CRM_Utils_System::url('civicrm/contact/view/pledge', "action=delete&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home");
}
$displayName = CRM_Contact_BAO_Contact::displayName($values['contact_id']);
$this->assign('displayName', $displayName);
$title = $displayName . ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format($values['pledge_amount']) . ' - ' . $values['financial_type'] . ')';
// add Pledge to Recent Items
CRM_Utils_Recent::add($title, $url, $values['id'], 'Pledge', $values['contact_id'], NULL, $recentOther);
// Check if this is default domain contact CRM-10482
if (CRM_Contact_BAO_Contact::checkDomainContact($values['contact_id'])) {
$displayName .= ' (' . ts('default organization') . ')';
}
// omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
CRM_Utils_System::setTitle(ts('View Pledge by') . ' ' . $displayName);
//do check for campaigns
if ($campaignId = CRM_Utils_Array::value('campaign_id', $values)) {
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId);
$values['campaign'] = $campaigns[$campaignId];
}
$this->assign($values);
}
示例15: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('contactId', $this->_contactId);
$this->assign('displayName', $displayName);
// Check logged in url permission.
CRM_Contact_Page_View::checkUserPermission($this);
CRM_Utils_System::setTitle(ts('Mailings sent to %1', array(1 => $displayName)));
}