本文整理汇总了PHP中CRM_Core_BAO_CustomGroup类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomGroup类的具体用法?PHP CRM_Core_BAO_CustomGroup怎么用?PHP CRM_Core_BAO_CustomGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Core_BAO_CustomGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false);
if ($cid) {
// not sure why this is needed :(
// also add the cid params to the Menu array
CRM_Core_Menu::addParam('cid', $cid);
// create menus ..
$startWeight = CRM_Core_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_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'display_name');
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);
}
开发者ID:ksecor,项目名称:civicrm,代码行数:34,代码来源:SMS.php
示例2: 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);
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:34,代码来源:Relationship.php
示例3: 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;
$emails = CRM_Contact_BAO_Contact::allEmails($cid);
$this->_emails = array();
$toName = CRM_Contact_BAO_Contact::displayName($cid);
foreach ($emails as $email => $item) {
if (!$email && count($emails) <= 1) {
$this->_emails[$email] = '"' . $toName . '"';
$this->_noEmails = true;
} else {
if ($email) {
$this->_emails[$email] = '"' . $toName . '" <' . $email . '> ' . $item['locationType'];
}
}
if ($item['is_primary']) {
$this->_emails[$email] .= ' ' . ts('(preferred)');
}
$this->_emails[$email] = htmlspecialchars($this->_emails[$email]);
}
} else {
parent::preProcess();
}
$this->assign('single', $this->_single);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:41,代码来源:Email.php
示例4: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm()
{
parent::buildQuickForm();
$multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup();
$this->add('select', 'multipleCustomData', ts('Multi-value Custom Data'), array('' => ts('- select -')) + $multipleCustomData, TRUE);
$this->addContactTypeSelector();
}
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:12,代码来源:DataSource.php
示例5: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
function preProcess()
{
require_once 'CRM/Contribute/BAO/Contribution.php';
$values = array();
$ids = array();
$params = array('id' => $this->get('id'));
CRM_Contribute_BAO_Contribution::getValues($params, $values, $ids);
CRM_Contribute_BAO_Contribution::resolveDefaults($values);
$groupTree =& CRM_Core_BAO_CustomGroup::getTree('Contribution', $this->get('id'));
CRM_Core_BAO_CustomGroup::buildViewHTML($this, $groupTree);
$id = $this->get('id');
if ($id) {
require_once 'CRM/Contribute/DAO/ContributionProduct.php';
$dao =& new CRM_Contribute_DAO_ContributionProduct();
$dao->contribution_id = $id;
if ($dao->find(true)) {
$premiumId = $dao->id;
$productID = $dao->product_id;
}
}
if ($premiumId) {
require_once 'CRM/Contribute/DAO/Product.php';
$productDAO =& new CRM_Contribute_DAO_Product();
$productDAO->id = $productID;
$productDAO->find(true);
$this->assign('premium', $productDAO->name);
$this->assign('option', $dao->product_option);
$this->assign('fulfilled', $dao->fulfilled_date);
}
$this->assign($values);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:37,代码来源:ContributionView.php
示例6: view
/**
* View details of a recurring contribution.
*/
public function view()
{
$recur = new CRM_Contribute_DAO_ContributionRecur();
$recur->id = $this->_id;
if ($recur->find(TRUE)) {
$values = array();
CRM_Core_DAO::storeValues($recur, $values);
// if there is a payment processor ID, get the name of the payment processor
if (!empty($values['payment_processor_id'])) {
$values['payment_processor'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', $values['payment_processor_id'], 'name');
}
$idFields = array('contribution_status_id', 'campaign_id');
if (CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($values['id'])) {
$idFields[] = 'financial_type_id';
}
foreach ($idFields as $idField) {
if (!empty($values[$idField])) {
$values[substr($idField, 0, -3)] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_ContributionRecur', $idField, $values[$idField]);
}
}
// Get financial type name
if (!empty($values['financial_type_id'])) {
$values['financial_type_name'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'financial_type_id', $values['financial_type_id']);
}
// Get Paid By label
if (!empty($values['payment_instrument_id'])) {
$values['payment_instrument'] = CRM_Core_OptionGroup::getLabel('payment_instrument', $values['payment_instrument_id']);
}
$this->assign('recur', $values);
$this->assign('customDataType', 'ContributionRecur');
$groupTree = CRM_Core_BAO_CustomGroup::getTree('ContributionRecur', $this, $this->_id);
CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
}
}
开发者ID:Kajakaran,项目名称:uk.co.vedaconsulting.offlinerecurringcontributions,代码行数:37,代码来源:ContributionRecur.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);
$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
示例8: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
* @access public
*
*/
function run()
{
// get the callback, module and activity id
$action = CRM_Utils_Request::retrieve('action', $this, false, 'browse');
$id = CRM_Utils_Request::retrieve('id', $this);
$dao =& new CRM_Core_DAO_ActivityHistory();
$dao->activity_id = $id;
$dao->activity_type = ts('SMS Sent');
if ($dao->find(true)) {
$cid = $dao->entity_id;
}
require_once 'CRM/SMS/DAO/History.php';
$dao =& new CRM_SMS_DAO_History();
$dao->id = $id;
if ($dao->find(true)) {
$this->assign('fromName', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $dao->contact_id, 'display_name'));
$this->assign('toName', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'display_name'));
$this->assign('sentDate', $dao->sent_date);
$this->assign('message', $dao->message);
// get the display name and images for the contact
list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($dao->contact_id);
CRM_Utils_System::setTitle($contactImage . ' ' . $displayName);
require_once 'CRM/Utils/Menu.php';
// 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++;
require_once 'CRM/Core/BAO/CustomGroup.php';
CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($cid), 'civicrm/contact/view/cd', $startWeight);
}
parent::run();
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:42,代码来源:SMS.php
示例9: preProcess
/**
* 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 preProcess()
{
parent::preProcess();
//Custom Groups Inline
$entityType = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
$groupTree =& CRM_Core_BAO_CustomGroup::getTree($entityType, $this->_contactId);
CRM_Core_BAO_CustomGroup::buildViewHTML($this, $groupTree);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:16,代码来源:Basic.php
示例10: 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);
$locBlockNo = CRM_Utils_Request::retrieve('locno', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$addressId = CRM_Utils_Request::retrieve('aid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST);
$address = array();
if ($addressId > 0) {
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name'));
$entityBlock = array('id' => $addressId);
$address = CRM_Core_BAO_Address::getValues($entityBlock, FALSE, 'id');
if (!empty($address)) {
foreach ($address as $key => &$value) {
$value['location_type'] = $locationTypes[$value['location_type_id']];
}
}
}
// we just need current address block
$currentAddressBlock['address'][$locBlockNo] = array_pop($address);
if (!empty($currentAddressBlock['address'][$locBlockNo])) {
// get contact name of shared contact names
$sharedAddresses = array();
$shareAddressContactNames = CRM_Contact_BAO_Contact_Utils::getAddressShareContactNames($currentAddressBlock['address']);
foreach ($currentAddressBlock['address'] as $key => $addressValue) {
if (!empty($addressValue['master_id']) && !$shareAddressContactNames[$addressValue['master_id']]['is_deleted']) {
$sharedAddresses[$key]['shared_address_display'] = array('address' => $addressValue['display'], 'name' => $shareAddressContactNames[$addressValue['master_id']]['name']);
}
}
$idValue = $currentAddressBlock['address'][$locBlockNo]['id'];
if (!empty($currentAddressBlock['address'][$locBlockNo]['master_id'])) {
$idValue = $currentAddressBlock['address'][$locBlockNo]['master_id'];
}
// add custom data of type address
$groupTree = CRM_Core_BAO_CustomGroup::getTree('Address', $this, $idValue);
// we setting the prefix to dnc_ below so that we don't overwrite smarty's grouptree var.
$currentAddressBlock['address'][$locBlockNo]['custom'] = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, "dnc_");
$this->assign("dnc_viewCustomData", NULL);
$this->assign('add', $currentAddressBlock['address'][$locBlockNo]);
$this->assign('sharedAddresses', $sharedAddresses);
}
$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('locationIndex', $locBlockNo);
$this->assign('addressId', $addressId);
$this->assign('privacy', $privacy);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:63,代码来源:Address.php
示例11: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
function preProcess()
{
parent::preProcess();
$this->assign('intro_text', $this->_values['intro_text']);
$this->assign('footer_text', $this->_values['footer_text']);
// to process Custom data that are appended to URL
require_once 'CRM/Core/BAO/CustomGroup.php';
CRM_Core_BAO_CustomGroup::extractGetParams($this, 'Contribution');
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:15,代码来源:Main.php
示例12: __construct
function __construct(&$formValues)
{
parent::__construct($formValues);
require_once 'CRM/Core/BAO/CustomGroup.php';
$this->_groupTree = CRM_Core_BAO_CustomGroup::getTree("'Contact', 'Individual', 'Organization', 'Household'", CRM_Core_DAO::$_nullObject, NULL, -1);
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name');
$this->_customGroupIDs = CRM_Utils_Array::value('custom_group', $formValues);
if (!empty($this->_customGroupIDs)) {
$this->addColumns();
}
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:11,代码来源:MultiValue.php
示例13: 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);
$locBlockNo = CRM_Utils_Request::retrieve('locno', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$addressId = CRM_Utils_Request::retrieve('aid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST);
$address = array();
if ($addressId > 0) {
$locationTypes = CRM_Core_PseudoConstant::locationDisplayName();
$entityBlock = array('id' => $addressId);
$address = CRM_Core_BAO_Address::getValues($entityBlock, FALSE, 'id');
if (!empty($address)) {
foreach ($address as $key => &$value) {
$value['location_type'] = $locationTypes[$value['location_type_id']];
}
}
}
// we just need current address block
$currentAddressBlock['address'][$locBlockNo] = array_pop($address);
if (!empty($currentAddressBlock['address'][$locBlockNo])) {
// get contact name of shared contact names
$sharedAddresses = array();
$shareAddressContactNames = CRM_Contact_BAO_Contact_Utils::getAddressShareContactNames($currentAddressBlock['address']);
foreach ($currentAddressBlock['address'] as $key => $addressValue) {
if (CRM_Utils_Array::value('master_id', $addressValue) && !$shareAddressContactNames[$addressValue['master_id']]['is_deleted']) {
$sharedAddresses[$key]['shared_address_display'] = array('address' => $addressValue['display'], 'name' => $shareAddressContactNames[$addressValue['master_id']]['name']);
}
}
// add custom data of type address
$groupTree = CRM_Core_BAO_CustomGroup::getTree('Address', $this, $currentAddressBlock['address'][$locBlockNo]['id']);
// we setting the prefix to dnc_ below so that we don't overwrite smarty's grouptree var.
$currentAddressBlock['address'][$locBlockNo]['custom'] = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, "dnc_");
$this->assign("dnc_viewCustomData", NULL);
$this->assign('add', $currentAddressBlock['address'][$locBlockNo]);
$this->assign('sharedAddresses', $sharedAddresses);
}
$this->assign('contactId', $contactId);
$this->assign('locationIndex', $locBlockNo);
$this->assign('addressId', $addressId);
$appendBlockIndex = CRM_Core_BAO_Address::getAddressCount($contactId);
// check if we are adding new address, then only append add link
if ($appendBlockIndex == $locBlockNo) {
if ($appendBlockIndex) {
$appendBlockIndex++;
}
} else {
$appendBlockIndex = 0;
}
$this->assign('appendBlockIndex', $appendBlockIndex);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:63,代码来源:Address.php
示例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);
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:59,代码来源:PledgeView.php
示例15: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
require_once 'CRM/Pledge/BAO/Pledge.php';
$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::honor();
$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 (CRM_Utils_Array::value('contribution_page_id', $values)) {
$values['contribution_page'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $values['contribution_page_id'], 'title');
}
$values['contribution_type'] = CRM_Utils_Array::value($values['contribution_type_id'], CRM_Contribute_PseudoConstant::contributionType());
if ($values['status_id']) {
$values['pledge_status'] = CRM_Utils_Array::value($values['status_id'], CRM_Contribute_PseudoConstant::contributionStatus());
}
require_once 'CRM/Utils/Recent.php';
require_once 'CRM/Contact/BAO/Contact.php';
$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");
}
require_once 'CRM/Utils/Money.php';
$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['contribution_type'] . ')';
// add Pledge to Recent Items
CRM_Utils_Recent::add($title, $url, $values['id'], 'Pledge', $values['contact_id'], null, $recentOther);
$this->assign($values);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:52,代码来源:PledgeView.php
示例16: buildQuickForm
/**
* Function to actually build the form
*
* @param null
*
* @return void
* @access public
*/
public function buildQuickForm()
{
$subTypeId = CRM_Core_DAO::getFieldValue('CRM_Campaign_DAO_Survey', $this->_surveyId, 'activity_type_id');
if (!CRM_Core_BAO_CustomGroup::autoCreateByActivityType($subTypeId)) {
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE);
// everything
// FIXME: Displays weird "/\ Array" message; doesn't work with tabs
CRM_Core_Session::setStatus(ts('There are no custom data sets for activity type "%1". To create one, <a href="%2" target="%3">click here</a>.', array(1 => $activityTypes[$subTypeId], 2 => CRM_Utils_System::url('civicrm/admin/custom/group', 'action=add&reset=1'), 3 => '_blank')));
}
$allowCoreTypes = CRM_Campaign_BAO_Survey::surveyProfileTypes();
$allowSubTypes = array('ActivityType' => array($subTypeId));
$entities = array(array('entity_name' => 'contact_1', 'entity_type' => 'IndividualModel'), array('entity_name' => 'activity_1', 'entity_type' => 'ActivityModel', 'entity_sub_type' => $subTypeId));
$this->addProfileSelector('contact_profile_id', ts('Contact Info'), $allowCoreTypes, $allowSubTypes, $entities);
$this->addProfileSelector('activity_profile_id', ts('Questions'), $allowCoreTypes, $allowSubTypes, $entities);
// Note: Because this is in a tab, we also preload the schema via CRM_Campaign_Form_Survey::preProcess
parent::buildQuickForm();
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:25,代码来源:Questions.php
示例17: 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;
$this->assign('totalSelectedContacts', 1);
} else {
parent::preProcess();
}
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:24,代码来源:Delete.php
示例18: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
$multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup();
$this->add('select', 'multipleCustomData', ts('Multi-value Custom Data'), array('' => ts('- select -')) + $multipleCustomData, TRUE);
//Setting Upload File Size
$config = CRM_Core_Config::singleton();
if ($config->maxImportFileSize >= 8388608) {
$uploadFileSize = 8388608;
} else {
$uploadFileSize = $config->maxImportFileSize;
}
$uploadSize = round($uploadFileSize / (1024 * 1024), 2);
$this->assign('uploadSize', $uploadSize);
$this->add('file', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
$this->setMaxFileSize($uploadFileSize);
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
$this->addElement('checkbox', 'skipColumnHeader', ts('First row contains column headers'));
//get the saved mapping details
$mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type', 'Import Multi value custom data', 'name'));
$this->assign('savedMapping', $mappingArray);
$this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
if ($loadeMapping = $this->get('loadedMapping')) {
$this->assign('loadedMapping', $loadeMapping);
$this->setDefaults(array('savedMapping' => $loadeMapping));
}
//contact types option
$contactOptions = array();
if (CRM_Contact_BAO_ContactType::isActive('Individual')) {
$contactOptions[] = $this->createElement('radio', NULL, NULL, ts('Individual'), CRM_Import_Parser::CONTACT_INDIVIDUAL);
}
if (CRM_Contact_BAO_ContactType::isActive('Household')) {
$contactOptions[] = $this->createElement('radio', NULL, NULL, ts('Household'), CRM_Import_Parser::CONTACT_HOUSEHOLD);
}
if (CRM_Contact_BAO_ContactType::isActive('Organization')) {
$contactOptions[] = $this->createElement('radio', NULL, NULL, ts('Organization'), CRM_Import_Parser::CONTACT_ORGANIZATION);
}
$this->addGroup($contactOptions, 'contactType', ts('Contact Type'));
$this->setDefaults(array('contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL));
//build date formats
CRM_Core_Form_Date::buildAllowedDateFormats($this);
$this->addButtons(array(array('type' => 'upload', 'name' => ts('Continue >>'), 'spacing' => ' ', 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:50,代码来源:DataSource.php
示例19: view
/**
* View details of a relationship.
*/
public function view()
{
$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);
$employerId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'employer_id');
$this->assign('isCurrentEmployer', FALSE);
$relTypes = CRM_Utils_Array::index(array('name_a_b'), CRM_Core_PseudoConstant::relationshipType('name'));
if ($viewRelationship[$this->_id]['employer_id'] == $this->_contactId) {
$this->assign('isCurrentEmployer', TRUE);
} elseif ($relType == $relTypes['Employee of']['id'] && $viewRelationship[$this->_id]['cid'] == $employerId) {
// make sure we are viewing employee of relationship
$this->assign('isCurrentEmployer', TRUE);
}
$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, FALSE, NULL, NULL, NULL, $this->_id);
$rType = CRM_Utils_Array::value('rtype', $viewRelationship[$this->_id]);
// add viewed contribution to recent items list
$url = CRM_Utils_System::url('civicrm/contact/view/rel', "action=view&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&context=home");
$session = CRM_Core_Session::singleton();
$recentOther = array();
if ($session->get('userID') == $this->_contactId || CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
$recentOther = array('editUrl' => CRM_Utils_System::url('civicrm/contact/view/rel', "action=update&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&rtype={$rType}&context=home"), 'deleteUrl' => CRM_Utils_System::url('civicrm/contact/view/rel', "action=delete&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&rtype={$rType}&context=home"));
}
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
CRM_Utils_System::setTitle(ts('View Relationship for') . ' ' . $displayName);
$title = $displayName . ' (' . $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, $recentOther);
}
开发者ID:konadave,项目名称:civicrm-core,代码行数:46,代码来源:Relationship.php
示例20: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
* @a
|
请发表评论