本文整理汇总了PHP中CRM_Core_DAO::commonRetrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_DAO::commonRetrieve方法的具体用法?PHP CRM_Core_DAO::commonRetrieve怎么用?PHP CRM_Core_DAO::commonRetrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_DAO
的用法示例。
在下文中一共展示了CRM_Core_DAO::commonRetrieve方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateFileName
function getTemplateFileName()
{
$profID = CRM_Utils_Request::retrieve('gid', 'String', $this);
$this->_params['contact_type'] = 'Individual';
$selector = new CRM_Profile_Selector_Listings($this->_params, $this->_customFields, $profID, $this->_map, FALSE, 0);
$extraWhereClause = NULL;
$grpParams = array('name' => 'HRJobContract_Summary');
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomGroup', $grpParams, $cGrp);
$fdParams = array('name' => 'Final_Termination_Date', 'custom_group_id' => $cGrp['id']);
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $fdParams, $fdField);
$idParams = array('name' => 'Initial_Join_Date', 'custom_group_id' => $cGrp['id']);
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $idParams, $idField);
$extraWhereClause = " (({$cGrp['table_name']}.{$fdField['column_name']} >= CURDATE() OR {$cGrp['table_name']}.{$fdField['column_name']} IS NULL) AND\n ({$cGrp['table_name']}.{$idField['column_name']} IS NOT NULL AND {$cGrp['table_name']}.{$idField['column_name']} <= CURDATE()))";
$column = $columnHeaders = $selector->getColumnHeaders();
$rows = $selector->getRows(4, 0, 0, NULL, NULL, $extraWhereClause);
CRM_Utils_Hook::searchColumns('profile', $columnHeaders, $rows, $this);
$this->assign('aaData', json_encode($rows));
/* to bring column names in [
{ "sTitle": "Engine" },
{ "sTitle": "Browser" },] format*/
$colunmH = "[";
foreach ($column as $k => $v) {
if (!empty($v['name'])) {
$name = '{"sTitle":"' . $v['name'] . '"}';
} else {
$name = '{"bSortable": false}';
}
$colunmH .= $name . ",";
}
$colunmH .= "]";
$this->assign('aaColumn', $colunmH);
return 'CRM/HRProfile/Page/HRProfile.tpl';
}
示例2: setDefaultValues
/**
* Set default values for the form.
*
*
* @return void
*/
public function setDefaultValues()
{
$defaults = array();
$defaults = array();
if (isset($this->_id)) {
$title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'title');
CRM_Utils_System::setTitle(ts('Personal Campaign Page Settings (%1)', array(1 => $title)));
$params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_event');
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $params, $defaults);
$defaults['pcp_active'] = CRM_Utils_Array::value('is_active', $defaults);
// Assign contribution page ID to pageId for referencing in PCP.hlp - since $id is overwritten there. dgg
$this->assign('pageId', $this->_id);
}
if (empty($defaults['id'])) {
$defaults['target_entity_type'] = 'event';
$defaults['is_approval_needed'] = 1;
$defaults['is_tellfriend_enabled'] = 1;
$defaults['tellfriend_limit'] = 5;
$defaults['link_text'] = ts('Promote this event with a personal campaign page');
$defaults['owner_notify_id'] = CRM_Core_OptionGroup::getDefaultValue('pcp_owner_notify');
if ($this->_id && ($ccReceipt = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'cc_receipt'))) {
$defaults['notify_email'] = $ccReceipt;
}
}
return $defaults;
}
示例3: 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);
}
示例4: preProcess
/**
* Pre processing work done here.
*
* gets session variables for group or field id
*
* @return void
*/
public function preProcess()
{
// get the controller vars
$this->_groupId = $this->get('groupId');
$this->_fieldId = $this->get('fieldId');
if ($this->_fieldId) {
// field preview
$defaults = array();
$params = array('id' => $this->_fieldId);
$fieldDAO = new CRM_Core_DAO_CustomField();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults);
if (!empty($defaults['is_view'])) {
CRM_Core_Error::statusBounce(ts('This field is view only so it will not display on edit form.'));
} elseif (CRM_Utils_Array::value('is_active', $defaults) == 0) {
CRM_Core_Error::statusBounce(ts('This field is inactive so it will not display on edit form.'));
}
$groupTree = array();
$groupTree[$this->_groupId]['id'] = 0;
$groupTree[$this->_groupId]['fields'] = array();
$groupTree[$this->_groupId]['fields'][$this->_fieldId] = $defaults;
$this->_groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1, $this);
$this->assign('preview_type', 'field');
} else {
$groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail($this->_groupId);
$this->_groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, TRUE, $this);
$this->assign('preview_type', 'group');
}
}
示例5: preProcess
public function preProcess()
{
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this);
$this->_entityId = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE);
$pcomponent = CRM_Utils_Request::retrieve('pcomponent', 'String', $this, TRUE);
if (in_array($pcomponent, array('contribute', 'event'))) {
$values = array();
$params = array('id' => $this->_entityId);
CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage', $params, $values, array('title', 'campaign_id'));
$this->_title = CRM_Utils_Array::value('title', $values);
$this->_campaignId = CRM_Utils_Array::value('campaign_id', $values);
$this->_entityTable = 'civicrm_contribution_page';
if ($pcomponent == 'event') {
$this->_entityTable = 'civicrm_event';
}
} elseif ($pcomponent == 'pcp') {
$this->_pcpBlockId = CRM_Utils_Request::retrieve('blockId', 'Positive', $this, TRUE);
$values = array();
$params = array('id' => $this->_pcpBlockId);
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $params, $values, array('is_tellfriend_enabled', 'tellfriend_limit'));
if (!CRM_Utils_Array::value('is_tellfriend_enabled', $values)) {
CRM_Core_Error::fatal(ts('Tell Friend is disable for this Personal Campaign Page'));
}
$this->_mailLimit = $values['tellfriend_limit'];
$this->_entityTable = 'civicrm_pcp';
$sql = '
SELECT pcp.title,
contrib.campaign_id
FROM civicrm_pcp pcp
INNER JOIN civicrm_contribution_page contrib ON ( pcp.page_id = contrib.id AND pcp.page_type = "contribute" )
WHERE pcp.id = %1';
$pcp = CRM_Core_DAO::executeQuery($sql, array(1 => array($this->_entityId, 'Positive')));
while ($pcp->fetch()) {
$this->_title = $pcp->title;
$this->_campaignId = $pcp->campaign_id;
$pcp->free();
}
$this->assign('pcpTitle', $this->_title);
} else {
CRM_Core_Error::fatal(ts('page argument missing or invalid'));
}
$this->assign('context', $pcomponent);
$session = CRM_Core_Session::singleton();
$this->_contactID = $session->get('userID');
if (!$this->_contactID) {
$this->_contactID = $session->get('transaction.userID');
}
if (!$this->_contactID) {
CRM_Core_Error::fatal(ts('Could not get the contact ID'));
}
// we do not want to display recently viewed items, so turn off
$this->assign('displayRecent', FALSE);
}
示例6: setDefaultValues
function setDefaultValues()
{
$defaults = array();
if ($this->_action & CRM_Core_Action::DELETE) {
return $defaults;
}
if ($this->_id) {
$params = array('id' => $this->_id);
$defaults = array();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_OptionValue', $params, $defaults);
} else {
$defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', array('option_group_id' => $this->_opID));
}
return $defaults;
}
示例7: setValues
static function setValues($id, &$values)
{
$params = array('id' => $id);
CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage', $params, $values);
// get the amounts and the label
require_once 'CRM/Core/OptionGroup.php';
$values['amount'] = array();
CRM_Core_OptionGroup::getAssoc("civicrm_contribution_page.amount.{$id}", $values['amount'], true);
// get the profile ids
require_once 'CRM/Core/BAO/UFJoin.php';
$ufJoinParams = array('entity_table' => 'civicrm_contribution_page', 'entity_id' => $id);
list($values['custom_pre_id'], $values['custom_post_id']) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
// add an accounting code also
if ($values['contribution_type_id']) {
$values['accountingCode'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionType', $values['contribution_type_id'], 'accounting_code');
}
}
示例8: setValues
static function setValues($id, &$values)
{
$params = array('id' => $id);
CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage', $params, $values);
// get the profile ids
$ufJoinParams = array('module' => 'CiviContribute', 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $id);
list($values['custom_pre_id'], $customPostIds) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
if (!empty($customPostIds)) {
$values['custom_post_id'] = $customPostIds[0];
} else {
$values['custom_post_id'] = '';
}
// add an accounting code also
if (CRM_Utils_Array::value('contribution_type_id', $values)) {
$values['accountingCode'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionType', $values['contribution_type_id'], 'accounting_code');
}
}
示例9: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
function preProcess()
{
// current contribution page id
$this->_id = $this->get('id');
// get all the values from the dao object
$params = array('id' => $this->_id);
$this->_values = array();
CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage', $params, $this->_values);
// get the amounts and the label
require_once 'CRM/Core/BAO/CustomOption.php';
CRM_Core_BAO_CustomOption::getAssoc('civicrm_contribution_page', $this->_id, $this->_values);
// get the profile ids
require_once 'CRM/Core/BAO/UFJoin.php';
$ufJoinParams = array('entity_table' => 'civicrm_contribution_page', 'entity_id' => $this->_id, 'weight' => 1);
$this->_values['custom_pre_id'] = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams);
$ufJoinParams['weight'] = 2;
$this->_values['custom_post_id'] = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams);
}
示例10: setDefaultValues
/**
* This function sets the default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
* @access public
* @return void
*/
function setDefaultValues()
{
$title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title');
CRM_Utils_System::setTitle(ts('Personal Campaign Page Settings (%1)', array(1 => $title)));
$defaults = array();
if (isset($this->_id)) {
$params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_contribution_page');
CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_PCPBlock', $params, $defaults);
// Assign contribution page ID to pageId for referencing in PCP.hlp - since $id is overwritten there. dgg
$this->assign('pageId', $this->_id);
}
if (!CRM_Utils_Array::value('id', $defaults)) {
$defaults['is_approval_needed'] = 1;
$defaults['is_tellfriend_enabled'] = 1;
$defaults['tellfriend_limit'] = 5;
$defaults['link_text'] = ts('Create your own fundraising page');
if ($ccReceipt = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'cc_receipt')) {
$defaults['notify_email'] = $ccReceipt;
}
}
return $defaults;
}
示例11: preProcess
/**
* pre processing work done here.
*
* gets session variables for group or field id
*
* @param null
*
* @return void
* @access public
*/
function preProcess()
{
// get the controller vars
$groupId = $this->get('groupId');
$fieldId = $this->get('fieldId');
if ($fieldId) {
// field preview
$defaults = array();
$params = array('id' => $fieldId);
$fieldDAO =& new CRM_Core_DAO_CustomField();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults);
$this->_groupTree = array();
$this->_groupTree[0]['id'] = 0;
$this->_groupTree[0]['fields'] = array();
$this->_groupTree[0]['fields'][$fieldId] = $defaults;
$this->assign('preview_type', 'field');
} else {
// group preview
$this->_groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail($groupId);
$this->assign('preview_type', 'group');
}
}
示例12: preProcess
public function preProcess()
{
parent::preProcess();
$this->assign('currentEventId', $this->_id);
$checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($this->_id, 'civicrm_event');
//If this ID has parent, send parent id
if ($checkParentExistsForThisId) {
/**
* Get connected event information list
*/
//Get all connected event ids
$allEventIdsArray = CRM_Core_BAO_RecurringEntity::getEntitiesForParent($checkParentExistsForThisId, 'civicrm_event');
$allEventIds = array();
if (!empty($allEventIdsArray)) {
foreach ($allEventIdsArray as $key => $val) {
$allEventIds[] = $val['id'];
}
if (!empty($allEventIds)) {
$params = array();
$query = "\n SELECT *\n FROM civicrm_event\n WHERE id IN (" . implode(",", $allEventIds) . ")\n ORDER BY start_date asc\n ";
$dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Event_DAO_Event');
$permissions = CRM_Event_BAO_Event::checkPermission();
while ($dao->fetch()) {
if (in_array($dao->id, $permissions[CRM_Core_Permission::VIEW])) {
$manageEvent[$dao->id] = array();
CRM_Core_DAO::storeValues($dao, $manageEvent[$dao->id]);
}
}
}
$this->assign('rows', $manageEvent);
}
}
$parentEventParams = array('id' => $this->_id);
$parentEventValues = array();
$parentEventReturnProperties = array('start_date', 'end_date');
$parentEventAttributes = CRM_Core_DAO::commonRetrieve('CRM_Event_DAO_Event', $parentEventParams, $parentEventValues, $parentEventReturnProperties);
$this->_parentEventStartDate = $parentEventAttributes->start_date;
$this->_parentEventEndDate = $parentEventAttributes->end_date;
}
示例13: setDefaultValues
/**
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
*
* @return void
*/
public function setDefaultValues()
{
$defaults = array();
if (isset($this->_id)) {
$params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_contribution_page');
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $params, $defaults);
$defaults['pcp_active'] = CRM_Utils_Array::value('is_active', $defaults);
// Assign contribution page ID to pageId for referencing in PCP.hlp - since $id is overwritten there. dgg
$this->assign('pageId', $this->_id);
}
if (empty($defaults['id'])) {
$defaults['target_entity_type'] = 'contribute';
$defaults['is_approval_needed'] = 1;
$defaults['is_tellfriend_enabled'] = 1;
$defaults['tellfriend_limit'] = 5;
$defaults['link_text'] = ts('Create your own fundraising page');
$defaults['owner_notify_id'] = CRM_Core_OptionGroup::getDefaultValue('pcp_owner_notify');
if ($ccReceipt = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'cc_receipt')) {
$defaults['notify_email'] = $ccReceipt;
}
}
return $defaults;
}
示例14: buildQuickForm
//.........这里部分代码省略.........
if ($this->_priceSetId && empty($this->_ccid)) {
$is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config');
if ($is_quick_config) {
$this->_useForMember = 0;
$this->set('useForMember', $this->_useForMember);
}
}
//we allow premium for pledge during pledge creation only.
if (empty($this->_values['pledge_id']) && empty($this->_ccid)) {
CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, TRUE);
}
//don't build pledge block when mid is passed
if (!$this->_mid && empty($this->_ccid)) {
$config = CRM_Core_Config::singleton();
if (in_array('CiviPledge', $config->enableComponents) && !empty($this->_values['pledge_block_id'])) {
CRM_Pledge_BAO_PledgeBlock::buildPledgeBlock($this);
}
}
//to create an cms user
if (!$this->_contactID && empty($this->_ccid)) {
$createCMSUser = FALSE;
if ($this->_values['custom_pre_id']) {
$profileID = $this->_values['custom_pre_id'];
$createCMSUser = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileID, 'is_cms_user');
}
if (!$createCMSUser && $this->_values['custom_post_id']) {
if (!is_array($this->_values['custom_post_id'])) {
$profileIDs = array($this->_values['custom_post_id']);
} else {
$profileIDs = $this->_values['custom_post_id'];
}
foreach ($profileIDs as $pid) {
if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $pid, 'is_cms_user')) {
$profileID = $pid;
$createCMSUser = TRUE;
break;
}
}
}
if ($createCMSUser) {
CRM_Core_BAO_CMSUser::buildForm($this, $profileID, TRUE);
}
}
if ($this->_pcpId && empty($this->_ccid)) {
if ($pcpSupporter = CRM_PCP_BAO_PCP::displayName($this->_pcpId)) {
$pcp_supporter_text = ts('This contribution is being made thanks to the effort of <strong>%1</strong>, who supports our campaign.', array(1 => $pcpSupporter));
// Only tell people that can also create a PCP if the contribution page has a non-empty value in the "Create Personal Campaign Page link" field.
$text = CRM_PCP_BAO_PCP::getPcpBlockStatus($this->_id, 'contribute');
if (!empty($text)) {
$pcp_supporter_text .= ts("You can support it as well - once you complete the donation, you will be able to create your own Personal Campaign Page!");
}
$this->assign('pcpSupporterText', $pcp_supporter_text);
}
$prms = array('id' => $this->_pcpId);
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $prms, $pcpInfo);
if ($pcpInfo['is_honor_roll']) {
$this->assign('isHonor', TRUE);
$this->add('checkbox', 'pcp_display_in_roll', ts('Show my contribution in the public honor roll'), NULL, NULL, array('onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID|personalNoteID','block','radio',false); pcpAnonymous( );"));
$extraOption = array('onclick' => "return pcpAnonymous( );");
$elements = array();
$elements[] =& $this->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption);
$elements[] =& $this->createElement('radio', NULL, '', ts('List my contribution anonymously'), 1, $extraOption);
$this->addGroup($elements, 'pcp_is_anonymous', NULL, ' ');
$this->add('text', 'pcp_roll_nickname', ts('Name'), array('maxlength' => 30));
$this->add('textarea', 'pcp_personal_note', ts('Personal Note'), array('style' => 'height: 3em; width: 40em;'));
}
}
if (empty($this->_values['fee']) && empty($this->_ccid)) {
CRM_Core_Error::fatal(ts('This page does not have any price fields configured or you may not have permission for them. Please contact the site administrator for more details.'));
}
//we have to load confirm contribution button in template
//when multiple payment processor as the user
//can toggle with payment processor selection
$billingModePaymentProcessors = 0;
if (!empty($this->_paymentProcessors)) {
foreach ($this->_paymentProcessors as $key => $values) {
if ($values['billing_mode'] == CRM_Core_Payment::BILLING_MODE_BUTTON) {
$billingModePaymentProcessors++;
}
}
}
if ($billingModePaymentProcessors && count($this->_paymentProcessors) == $billingModePaymentProcessors) {
$allAreBillingModeProcessors = TRUE;
} else {
$allAreBillingModeProcessors = FALSE;
}
if (!($allAreBillingModeProcessors && !$this->_values['is_pay_later'])) {
$submitButton = array('type' => 'upload', 'name' => CRM_Utils_Array::value('is_confirm_enabled', $this->_values) ? ts('Confirm Contribution') : ts('Contribute'), 'spacing' => ' ', 'isDefault' => TRUE);
// Add submit-once behavior when confirm page disabled
if (empty($this->_values['is_confirm_enabled'])) {
$submitButton['js'] = array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');");
}
//change button name for updating contribution
if (!empty($this->_ccid)) {
$submitButton['name'] = ts('Confirm Payment');
}
$this->addButtons(array($submitButton));
}
$this->addFormRule(array('CRM_Contribute_Form_Contribution_Main', 'formRule'), $this);
}
示例15: where
function where()
{
parent::where();
$params = array('name' => 'HRJobContract_Summary');
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomGroup', $params, $cGrp);
$params = array('name' => 'Final_Termination_Date', 'custom_group_id' => $cGrp['id']);
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $cField);
$dbAlias = $this->_columns[$cGrp['table_name']]['fields']["custom_{$cField['id']}"]['dbAlias'];
if (!$this->isFieldSelected($this->_columns[$cGrp['table_name']])) {
$whereClauses[] = "({$dbAlias} >= CURDATE() OR {$dbAlias} IS NULL)";
}
$params = array('name' => 'Initial_Join_Date', 'custom_group_id' => $cGrp['id']);
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $cField);
$dbAlias = $this->_columns[$cGrp['table_name']]['fields']["custom_{$cField['id']}"]['dbAlias'];
$addWhereClauses = "({$this->_aliases['civicrm_hrjobcontract']}.is_primary IS NULL AND {$dbAlias} IS NOT NULL AND {$dbAlias} <= CURDATE())";
if (!empty($this->_params['current_employee_value'])) {
$whereClauses[] = "(({$this->_aliases['civicrm_hrjobcontract']}.is_primary = 1 OR {$this->_aliases['civicrm_hrjobcontract']}.is_primary IS NULL) AND ({$this->_aliases['civicrm_hrjobcontract_details']}.period_start_date IS NOT NULL AND {$this->_aliases['civicrm_hrjobcontract_details']}.period_start_date <= CURDATE()))";
$this->_where = str_replace("AND ( hrjobcontract_civireport.current_employee = 1 )", '', $this->_where);
}
$whereClauses[] = "{$this->_aliases['civicrm_contact']}.contact_type = 'Individual'";
$where = implode(' AND ', $whereClauses);
if ($this->_where == "WHERE ( 1 )") {
$this->_where = $where;
} else {
$this->_where .= " AND {$where}";
}
}