}
break;
- case 'CRM_Price_BAO_Set':
+ case 'CRM_Price_BAO_PriceSet':
require_once (str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . '.php');
- $usedBy = CRM_Price_BAO_Set::getUsedBy($recordID);
- $priceSet = CRM_Price_BAO_Set::getTitle($recordID);
+ $usedBy = CRM_Price_BAO_PriceSet::getUsedBy($recordID);
+ $priceSet = CRM_Price_BAO_PriceSet::getTitle($recordID);
if (!CRM_Utils_System::isNull($usedBy)) {
$template = CRM_Core_Smarty::singleton();
$status = ts('Are you sure you want to disable this membership status rule?');
break;
- case 'CRM_Price_BAO_Field':
+ case 'CRM_Price_BAO_PriceField':
$status = ts('Are you sure you want to disable this price field?');
break;
);
// get the price set associated with offline contribution record.
- $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', 'default_contribution_amount', 'id', 'name');
- $this->_priceSet = current(CRM_Price_BAO_Set::getSetDetail($priceSetId));
+ $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_contribution_amount', 'id', 'name');
+ $this->_priceSet = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId));
$fieldID = key($this->_priceSet['fields']);
if (isset($params['field'])) {
$value['price_'.$fieldID] = 1;
$lineItem = array();
- CRM_Price_BAO_Set::processAmount($this->_priceSet['fields'], $value, $lineItem[$priceSetId]);
+ CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'], $value, $lineItem[$priceSetId]);
//unset amount level since we always use quick config price set
unset($value['amount_level']);
);
// get the price set associated with offline memebership
- $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', 'default_membership_type_amount', 'id', 'name');
- $this->_priceSet = $priceSets = current(CRM_Price_BAO_Set::getSetDetail($priceSetId));
+ $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name');
+ $this->_priceSet = $priceSets = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId));
if (isset($params['field'])) {
$customFields = array();
);
$editedResults = array();
- CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (!empty($editedResults)) {
unset($this->_priceSet['fields']);
);
$editedResults = array();
- CRM_Price_BAO_FieldValue::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceFieldValue::retrieve($editedFieldParams, $editedResults);
$this->_priceSet['fields'][$fid]['options'][$editedResults['id']] = $priceSets['fields'][$fid]['options'][$editedResults['id']];
if (CRM_Utils_Array::value('total_amount', $value)) {
$this->_priceSet['fields'][$fid]['options'][$editedResults['id']]['amount'] = $value['total_amount'];
$value['price_' . $fieldID] = $editedResults['id'];
$lineItem = array();
- CRM_Price_BAO_Set::processAmount($this->_priceSet['fields'],
+ CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
$value, $lineItem[$priceSetId]
);
}
// get all the fields and all the option values associated with it
- $priceSet = CRM_Price_BAO_Set::getSetDetail($dao->price_set_id);
+ $priceSet = CRM_Price_BAO_PriceSet::getSetDetail($dao->price_set_id);
if (is_array($priceSet[$dao->price_set_id])) {
foreach ($priceSet[$dao->price_set_id]['fields'] as $key => $value) {
if (is_array($value['options'])) {
CRM_Pledge_BAO_PledgePayment::resetPledgePayment($id);
// remove entry from civicrm_price_set_entity, CRM-5095
- if (CRM_Price_BAO_Set::getFor('civicrm_contribution', $id)) {
- CRM_Price_BAO_Set::removeFrom('civicrm_contribution', $id);
+ if (CRM_Price_BAO_PriceSet::getFor('civicrm_contribution', $id)) {
+ CRM_Price_BAO_PriceSet::removeFrom('civicrm_contribution', $id);
}
// cleanup line items.
$participantId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $id, 'participant_id', 'contribution_id');
}
}
$values['lineItem'][0] = $lineItem;
- $values['priceSetID'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItem[$itemId]['price_field_id'], 'price_set_id');
+ $values['priceSetID'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItem[$itemId]['price_field_id'], 'price_set_id');
}
}
));
//copy price sets
- CRM_Price_BAO_Set::copyPriceSet('civicrm_contribution_page', $id, $copy->id);
+ CRM_Price_BAO_PriceSet::copyPriceSet('civicrm_contribution_page', $id, $copy->id);
$copyTellFriend = &CRM_Core_DAO::copyGeneric('CRM_Friend_DAO_Friend', array(
'entity_id' => $id,
}
$this->set('priceSetId', $this->_priceSetId);
- CRM_Price_BAO_Set::buildPriceSet($this);
+ CRM_Price_BAO_PriceSet::buildPriceSet($this);
// get only price set form elements.
if ($getOnlyPriceSetElements) {
$totalAmount = NULL;
if (empty($this->_lineItems)) {
$buildPriceSet = FALSE;
- $priceSets = CRM_Price_BAO_Set::getAssoc(FALSE, 'CiviContribute');
+ $priceSets = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviContribute');
if (!empty($priceSets) && !$this->_ppID) {
$buildPriceSet = TRUE;
}
// do the amount validations.
if (!CRM_Utils_Array::value('total_amount', $fields) && empty($self->_lineItems)) {
if ($priceSetId = CRM_Utils_Array::value('price_set_id', $fields)) {
- CRM_Price_BAO_Field::priceSetValidation($priceSetId, $fields, $errors);
+ CRM_Price_BAO_PriceField::priceSetValidation($priceSetId, $fields, $errors);
}
}
if (CRM_Utils_Array::value('price_set_id', $submittedValues) && $this->_action & CRM_Core_Action::UPDATE) {
$line = CRM_Price_BAO_LineItem::getLineItems($this->_id, 'contribution');
$lineID = key($line);
- $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', CRM_Utils_Array::value('price_field_id', $line[$lineID]), 'price_set_id');
- $quickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config');
+ $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', CRM_Utils_Array::value('price_field_id', $line[$lineID]), 'price_set_id');
+ $quickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config');
if ($quickConfig) {
CRM_Price_BAO_LineItem::deleteLineItems($this->_id, 'civicrm_contribution');
}
$priceSetId = $pId = NULL;
$priceSetId = CRM_Utils_Array::value('price_set_id', $submittedValues);
if (empty($priceSetId) && !$this->_id) {
- $this->_priceSetId = $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', 'default_contribution_amount', 'id', 'name');
- $this->_priceSet = current(CRM_Price_BAO_Set::getSetDetail($priceSetId));
+ $this->_priceSetId = $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_contribution_amount', 'id', 'name');
+ $this->_priceSet = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId));
$fieldID = key($this->_priceSet['fields']);
$fieldValueId = key($this->_priceSet['fields'][$fieldID]['options']);
$this->_priceSet['fields'][$fieldID]['options'][$fieldValueId]['amount'] = $submittedValues['total_amount'];
}
if ($priceSetId) {
- CRM_Price_BAO_Set::processAmount($this->_priceSet['fields'],
+ CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
$submittedValues, $lineItem[$priceSetId]);
$submittedValues['total_amount'] = CRM_Utils_Array::value('amount', $submittedValues);
$itemId = key($lineItems);
$fieldType = NULL;
if ($itemId && CRM_Utils_Array::value('price_field_id', $lineItems[$itemId])) {
- $fieldType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItems[$itemId]['price_field_id'], 'html_type');
+ $fieldType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'html_type');
}
$lineItems[$itemId]['unit_price'] = $lineItems[$itemId]['line_total'] = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('total_amount', $submittedValues));
$lineItems[$itemId]['id'] = $itemId;
// 10117 update th line items for participants
- $this->_priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItems[$itemId]['price_field_id'], 'price_set_id');
+ $this->_priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'price_set_id');
$lineItem[$this->_priceSetId] = $lineItems;
}
$isQuickConfig = 0;
- if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$isQuickConfig = 1;
}
//CRM-11529 for quick config backoffice transactions
$this->_useForMember = $this->get('useForMember');
if (isset($this->_params['amount'])) {
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $this->_params['priceSetId'];
$priceField->orderBy('weight');
$priceField->find();
$contriPriceId = NULL;
- $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_params['priceSetId'], 'is_quick_config');
+ $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_params['priceSetId'], 'is_quick_config');
while ($priceField->fetch()) {
if ($priceField->name == "contribution_amount") {
$contriPriceId = $priceField->id;
}
if ($isQuickConfig && !empty($this->_params["price_{$priceField->id}"])) {
if ($this->_values['fee'][$priceField->id]['html_type'] != 'Text') {
- $this->_params['amount_level'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue',
+ $this->_params['amount_level'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue',
$this->_params["price_{$priceField->id}"], 'label');
}
if ($priceField->name == "membership_amount") {
- $this->_params['selectMembership'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue',
+ $this->_params['selectMembership'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue',
$this->_params["price_{$priceField->id}"], 'membership_type_id');
}
} // if seperate payment we set contribution amount to be null, so that it will not show contribution amount same as membership amount.
$this->_params['is_recur'] = $this->_values['is_recur'] = 1;
// check if price set is not quick config
if (CRM_Utils_Array::value('priceSetId', $this->_params) && !$isQuickConfig) {
- list($this->_params['frequency_interval'], $this->_params['frequency_unit']) = CRM_Price_BAO_Set::getRecurDetails($this->_params['priceSetId']);
+ list($this->_params['frequency_interval'], $this->_params['frequency_unit']) = CRM_Price_BAO_PriceSet::getRecurDetails($this->_params['priceSetId']);
}
else {
// FIXME: set interval and unit based on selected membership type
$this->_separateMembershipPayment = $this->get('separateMembershipPayment');
$this->assign('is_separate_payment', $this->_separateMembershipPayment);
- if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->assign('lineItem', $this->_lineItem);
} else {
$this->assign('is_quick_config', 1);
$priceFieldIds = $this->get('memberPriceFieldIDS');
if (!empty($priceFieldIds)) {
- $contributionTypeID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceFieldIds['id'], 'financial_type_id');
+ $contributionTypeID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceFieldIds['id'], 'financial_type_id');
unset($priceFieldIds['id']);
$membershipTypeIds = array();
$membershipTypeTerms = array();
foreach ($priceFieldIds as $priceFieldId) {
- if ($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $priceFieldId, 'membership_type_id')) {
+ if ($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldId, 'membership_type_id')) {
$membershipTypeIds[] = $id;
$term = 1;
- if ($term = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $priceFieldId, 'membership_num_terms')) {
+ if ($term = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldId, 'membership_num_terms')) {
$membershipTypeTerms[$id] = ($term > 1) ? $term : 1;
}
else {
}
}
else {
- CRM_Price_BAO_Set::setDefaultPriceSet($this, $this->_defaults);
+ CRM_Price_BAO_PriceSet::setDefaultPriceSet($this, $this->_defaults);
}
}
$this->add('hidden', 'priceSetId', $this->_priceSetId);
// build price set form.
$this->set('priceSetId', $this->_priceSetId);
- CRM_Price_BAO_Set::buildPriceSet($this);
+ CRM_Price_BAO_PriceSet::buildPriceSet($this);
if ($this->_values['is_monetary'] &&
$this->_values['is_recur'] && !CRM_Utils_Array::value('pledge_id', $this->_values)
) {
}
if ($this->_priceSetId) {
- $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config');
+ $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);
//check for atleast one pricefields should be selected
if (CRM_Utils_Array::value('priceSetId', $fields)) {
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $fields['priceSetId'];
$priceField->orderBy('weight');
$priceField->find();
if (!empty($lifeMember)) {
foreach ($priceFieldIDS as $priceFieldId) {
- if (($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $priceFieldId, 'membership_type_id')) &&
+ if (($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldId, 'membership_type_id')) &&
in_array($membershipOrgDetails[$id], $unallowedOrgs)
) {
$errors['_qf_default'] = ts('You already have a lifetime membership and cannot select a membership with a shorter term.');
$priceFieldIDS['id'] = $fields['priceSetId'];
$self->set('memberPriceFieldIDS', $priceFieldIDS);
- $count = CRM_Price_BAO_Set::getMembershipCount($ids);
+ $count = CRM_Price_BAO_PriceSet::getMembershipCount($ids);
foreach ($count as $id => $occurance) {
if ($occurance > 1) {
$errors['_qf_default'] = ts('You have selected multiple memberships for the same organization or entity. Please review your selections and choose only one membership per entity. Contact the site administrator if you need assistance.');
}
}
- CRM_Price_BAO_Set::processAmount($self->_values['fee'],
+ CRM_Price_BAO_PriceSet::processAmount($self->_values['fee'],
$fields, $lineItem
);
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
if (CRM_Utils_Array::value('priceSetId', $params)) {
- $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config');
+ $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config');
$formValue = array();
if ($is_quick_config) {
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $params['priceSetId'];
$priceField->orderBy('weight');
$priceField->find();
$check = array();
$otherAmount = FALSE;
while ($priceField->fetch()) {
- CRM_Price_BAO_FieldValue::getValues($priceField->id, $values);
+ CRM_Price_BAO_PriceFieldValue::getValues($priceField->id, $values);
if ($priceField->name == 'membership_amount') {
if ($priceFiledID = CRM_Utils_Array::value("price_{$priceField->id}", $params)) {
$this->_params['selectMembership'] = $params['selectMembership'] = CRM_Utils_Array::value('membership_type_id', $values[$priceFiledID]);
$fieldId = $memPresent = $membershipLabel = $fieldOption = $is_quick_config = NULL;
$proceFieldAmount = 0;
if ($this->_separateMembershipPayment == 0) {
- $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config');
+ $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config');
if ($is_quick_config) {
foreach ($this->_priceSet['fields'] as $fieldKey => $fieldVal) {
if ($fieldVal['name'] == 'membership_amount' && CRM_Utils_Array::value('price_' . $fieldKey , $params)) {
if ($priceSetId = CRM_Utils_Array::value('priceSetId', $params)) {
$lineItem = array();
- $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config' );
+ $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config' );
if ( $is_quick_config ) {
foreach ( $this->_values['fee'] as $key => & $val ) {
if ( $val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists( 'price_'.$key, $params ) && $params['price_'.$key] != 0 ) {
if ($this->_membershipBlock) {
$component = 'membership';
}
- CRM_Price_BAO_Set::processAmount($this->_values['fee'], $params, $lineItem[$priceSetId], $component);
+ CRM_Price_BAO_PriceSet::processAmount($this->_values['fee'], $params, $lineItem[$priceSetId], $component);
if ($proceFieldAmount) {
$lineItem[$params['priceSetId']][$fieldOption]['line_total'] = $proceFieldAmount;
if ($productID) {
CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, FALSE, $productID, $option);
}
- if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->assign('lineItem', $this->_lineItem);
} else {
if (is_array($membershipTypeID)) {
// get price info
// CRM-5095
- CRM_Price_BAO_Set::initSet($this, $this->_id, 'civicrm_contribution_page');
+ CRM_Price_BAO_PriceSet::initSet($this, $this->_id, 'civicrm_contribution_page');
// this avoids getting E_NOTICE errors in php
$setNullFields = array(
// get price set of type contributions
//this is the value for stored in db if price set extends contribution
$usedFor = 2;
- $this->_priceSetID = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, $usedFor, 1);
+ $this->_priceSetID = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, $usedFor, 1);
if ($this->_priceSetID) {
$defaults['price_set_id'] = $this->_priceSetID;
}
//add partial payment options
// add price set fields
- $price = CRM_Price_BAO_Set::getAssoc(FALSE, 'CiviContribute');
+ $price = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviContribute');
if (CRM_Utils_System::isNull($price)) {
$this->assign('price', FALSE);
}
if (CRM_Utils_Array::value('amount_block_is_active', $defaults)) {
- if ($priceSetId = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, NULL)) {
- if ($isQuick = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config')) {
+ if ($priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, NULL)) {
+ if ($isQuick = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config')) {
$this->assign('isQuick', $isQuick);
- //$priceField = CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_Field', $priceSetId, 'id', 'price_set_id' );
+ //$priceField = CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_PriceField', $priceSetId, 'id', 'price_set_id' );
$options = $pFIDs = array();
$priceFieldParams = array('price_set_id' => $priceSetId);
- $priceFields = CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_Field', 'price_set_id', $priceSetId, $pFIDs, $return = array('html_type', 'name', 'is_active'));
+ $priceFields = CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array('html_type', 'name', 'is_active'));
foreach ($priceFields as $priceField) {
if ($priceField['id'] && $priceField['html_type'] == 'Radio' && $priceField['name'] == 'contribution_amount') {
$defaults['price_field_id'] = $priceField['id'];
- $priceFieldOptions = CRM_Price_BAO_FieldValue::getValues($priceField['id'], $options, 'id', 1);
+ $priceFieldOptions = CRM_Price_BAO_PriceFieldValue::getValues($priceField['id'], $options, 'id', 1);
$countRow = 0;
foreach ($options as $optionId => $optionValue) {
$countRow++;
$hasMembershipBlk = FALSE;
if ($membershipBlock->find(TRUE)) {
if (CRM_Utils_Array::value('amount_block_is_active', $fields) &&
- ($setID = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $self->_id, NULL, 1))
+ ($setID = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $self->_id, NULL, 1))
) {
- $extends = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $setID, 'extends');
+ $extends = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $setID, 'extends');
if ($extends && $extends == CRM_Core_Component::getComponentID('CiviMember')) {
$errors['amount_block_is_active'] = ts('You cannot use a Membership Price Set when the Contribution Amounts section is enabled. Click the Memberships tab above, and select your Membership Price Set on that form. Membership Price Sets may include additional fields for non-membership options that require an additional fee (e.g. magazine subscription) or an additional voluntary contribution.');
return $errors;
$deleteAmountBlk = TRUE;
}
- CRM_Price_BAO_Set::addTo('civicrm_contribution_page', $contributionPageID, $priceSetID);
+ CRM_Price_BAO_PriceSet::addTo('civicrm_contribution_page', $contributionPageID, $priceSetID);
}
else {
if (!empty($options) || CRM_Utils_Array::value('is_allow_other_amount', $params)) {
$fieldParams['is_quick_config'] = 1;
$noContriAmount = NULL;
- $usedPriceSetId = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, 3);
+ $usedPriceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 3);
if (!(CRM_Utils_Array::value('price_field_id', $params) || CRM_Utils_Array::value('price_field_other', $params)) && !$usedPriceSetId) {
$pageTitle = strtolower(CRM_Utils_String::munge($this->_values['title'], '_', 245));
$setParams['title'] = $this->_values['title'];
- if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle, 'id', 'name')) {
+ if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $pageTitle, 'id', 'name')) {
$setParams['name'] = $pageTitle;
}
- elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle . '_' . $this->_id, 'id', 'name')) {
+ elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $pageTitle . '_' . $this->_id, 'id', 'name')) {
$setParams['name'] = $pageTitle . '_' . $this->_id;
}
else {
}
$setParams['is_quick_config'] = 1;
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviContribute');
- $priceSet = CRM_Price_BAO_Set::create($setParams);
+ $priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetId = $priceSet->id;
}
elseif ($usedPriceSetId && !CRM_Utils_Array::value('price_field_id', $params)) {
if ($priceFieldId = CRM_Utils_Array::value('price_field_id', $params)) {
foreach ($params['price_field_value'] as $arrayID => $fieldValueID) {
if (empty($params['label'][$arrayID]) && empty($params['value'][$arrayID]) && !empty($fieldValueID)) {
- CRM_Price_BAO_FieldValue::setIsActive($fieldValueID, '0');
+ CRM_Price_BAO_PriceFieldValue::setIsActive($fieldValueID, '0');
unset($params['price_field_value'][$arrayID]);
}
}
}
else {
$noContriAmount = 0;
- CRM_Price_BAO_Field::setIsActive($priceFieldId, '0');
+ CRM_Price_BAO_PriceField::setIsActive($priceFieldId, '0');
}
}
else $priceFieldId = CRM_Utils_Array::value('price_field_other', $params);
- $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $priceFieldId, 'price_set_id');
+ $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $priceFieldId, 'price_set_id');
}
- CRM_Price_BAO_Set::addTo('civicrm_contribution_page', $this->_id, $priceSetId);
+ CRM_Price_BAO_PriceSet::addTo('civicrm_contribution_page', $this->_id, $priceSetId);
if (!empty($options)) {
$editedFieldParams = array(
'price_set_id' => $priceSetId,
);
$editedResults = array();
$noContriAmount = 1;
- CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (!CRM_Utils_Array::value('id', $editedResults)) {
$fieldParams['name'] = strtolower(CRM_Utils_String::munge("Contribution Amount", '_', 245));
$fieldParams['label'] = "Contribution Amount";
$fieldParams['option_weight'][$value['weight']] = $value['weight'];
}
$fieldParams['default_option'] = $params['default'];
- $priceField = CRM_Price_BAO_Field::create($fieldParams);
+ $priceField = CRM_Price_BAO_PriceField::create($fieldParams);
}
if (CRM_Utils_Array::value('is_allow_other_amount', $params) && !CRM_Utils_Array::value('price_field_other', $params)) {
$editedFieldParams = array(
);
$editedResults = array();
- CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (!$priceFieldID = CRM_Utils_Array::value('id', $editedResults)) {
$fieldParams = array(
$fieldParams['option_label'][1] = 'Other Amount';
}
- $priceField = CRM_Price_BAO_Field::create($fieldParams);
+ $priceField = CRM_Price_BAO_PriceField::create($fieldParams);
} else {
if (!CRM_Utils_Array::value('is_active', $editedResults)) {
- CRM_Price_BAO_Field::setIsActive($priceFieldID, '1');
+ CRM_Price_BAO_PriceField::setIsActive($priceFieldID, '1');
}
}
} elseif (!CRM_Utils_Array::value('is_allow_other_amount', $params) && CRM_Utils_Array::value('price_field_other', $params)) {
- CRM_Price_BAO_Field::setIsActive($params['price_field_other'], '0');
+ CRM_Price_BAO_PriceField::setIsActive($params['price_field_other'], '0');
} elseif ($priceFieldID = CRM_Utils_Array::value('price_field_other', $params)) {
- $priceFieldValueID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $priceFieldID, 'id', 'price_field_id' );
+ $priceFieldValueID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldID, 'id', 'price_field_id' );
if (!$noContriAmount) {
- CRM_Core_DAO::setFieldValue('CRM_Price_DAO_Field', $priceFieldID, 'is_required', 1);
- CRM_Core_DAO::setFieldValue('CRM_Price_DAO_FieldValue', $priceFieldValueID, 'label', 'Contribution Amount' );
+ CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $priceFieldID, 'is_required', 1);
+ CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldValueID, 'label', 'Contribution Amount' );
} else {
- CRM_Core_DAO::setFieldValue('CRM_Price_DAO_Field', $priceFieldID, 'is_required', 0 );
- CRM_Core_DAO::setFieldValue('CRM_Price_DAO_FieldValue', $priceFieldValueID, 'label', 'Other Amount' );
+ CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $priceFieldID, 'is_required', 0 );
+ CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldValueID, 'label', 'Other Amount' );
}
}
}
}
else {
if (CRM_Utils_Array::value('price_field_id', $params) || CRM_Utils_Array::value('price_field_other', $params)) {
- $usedPriceSetId = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, 3);
+ $usedPriceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 3);
if ($usedPriceSetId) {
if (CRM_Utils_Array::value('price_field_id', $params)) {
- CRM_Price_BAO_Field::setIsActive($params['price_field_id'], '0');
+ CRM_Price_BAO_PriceField::setIsActive($params['price_field_id'], '0');
}
if (CRM_Utils_Array::value('price_field_other', $params)) {
- CRM_Price_BAO_Field::setIsActive($params['price_field_other'], '0');
+ CRM_Price_BAO_PriceField::setIsActive($params['price_field_other'], '0');
}
}
else {
// delete previous price set.
if ($deletePriceSet) {
- CRM_Price_BAO_Set::removeFrom('civicrm_contribution_page', $contributionPageID);
+ CRM_Price_BAO_PriceSet::removeFrom('civicrm_contribution_page', $contributionPageID);
}
if ($deleteAmountBlk ) {
$priceField = CRM_Utils_Array::value('price_field_id', $params)?$params['price_field_id']:CRM_Utils_Array::value('price_field_other', $params);
if ($priceField) {
- $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $priceField, 'price_set_id');
- CRM_Price_BAO_Set::setIsQuickConfig($priceSetID,0);
+ $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $priceField, 'price_set_id');
+ CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetID,0);
}
}
}
CRM_Contribute_BAO_Premium::deletePremium($this->_id);
// price set cleanup, CRM-5527
- CRM_Price_BAO_Set::removeFrom('civicrm_contribution_page', $this->_id);
+ CRM_Price_BAO_PriceSet::removeFrom('civicrm_contribution_page', $this->_id);
// finally delete the contribution page
$dao = new CRM_Contribute_DAO_ContributionPage();
if (!$id || !in_array($context, array('civicrm_event', 'civicrm_contribution_page'))) {
return false;
}
- $priceSetId = CRM_Price_BAO_Set::getFor($context, $id, NULL);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor($context, $id, NULL);
if ($priceSetId) {
- $result = CRM_Price_BAO_Set::setIsQuickConfig($priceSetId, 0);
+ $result = CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetId, 0);
if ($context == 'civicrm_event') {
$sql = "UPDATE
civicrm_price_set cps
$lineItems = CRM_Price_BAO_LineItem::getLineItems($contriID, 'contribution');
if (!empty($lineItems)) {
foreach ($lineItems as $key => $value) {
- $pricesetID = new CRM_Price_DAO_Field();
+ $pricesetID = new CRM_Price_DAO_PriceField();
$pricesetID->id = $value['price_field_id'];
$pricesetID->find(TRUE);
$lineSets[$pricesetID->price_set_id][] = $value;
}
// price set cleanup, CRM-5527
- CRM_Price_BAO_Set::removeFrom('civicrm_event', $id);
+ CRM_Price_BAO_PriceSet::removeFrom('civicrm_event', $id);
$event = new CRM_Event_DAO_Event();
$event->id = $id;
$fieldsFix
);
}
- CRM_Price_BAO_Set::copyPriceSet('civicrm_event', $id, $copyEvent->id);
+ CRM_Price_BAO_PriceSet::copyPriceSet('civicrm_event', $id, $copyEvent->id);
$copyUF = &CRM_Core_DAO::copyGeneric('CRM_Core_DAO_UFJoin',
array(
'entity_id' => $id,
static function usesPriceSet($id) {
static $usesPriceSet = array();
if (!array_key_exists($id, $usesPriceSet)) {
- $usesPriceSet[$id] = CRM_Price_BAO_Set::getFor('civicrm_event', $id);
+ $usesPriceSet[$id] = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $id);
}
return $usesPriceSet[$id];
}
$checkDiscount = CRM_Core_BAO_Discount::findSet($eventID,'civicrm_event');
if (!empty($checkDiscount)) {
$feeLevel = current($feeLevel);
- $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_event', $eventID, NULL);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventID, NULL);
$query = "SELECT cpfv.amount FROM `civicrm_price_field_value` cpfv
LEFT JOIN civicrm_price_field cpf ON cpfv.price_field_id = cpf.id
WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2";
return;
case 'participant_fee_id':
- $feeLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $value, 'label');
+ $feeLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $value, 'label');
$feeLabel = CRM_Core_DAO::escapeString(trim($feeLabel));
if ($value) {
$query->_where[$grouping][] = "civicrm_participant.fee_level $op '$feeLabel'";
function build_price_options($event) {
$price_fields_for_event = array();
$base_field_name = "event_{$event->id}_amount";
- $price_set_id = CRM_Price_BAO_Set::getFor('civicrm_event', $event->id);
+ $price_set_id = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $event->id);
if ($price_set_id) {
- $price_sets = CRM_Price_BAO_Set::getSetDetail($price_set_id, TRUE, TRUE);
+ $price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE, TRUE);
$price_set = $price_sets[$price_set_id];
$index = -1;
foreach ($price_set['fields'] as $field) {
$index++;
$field_name = "event_{$event->id}_price_{$field['id']}";
- CRM_Price_BAO_Field::addQuickFormElement($this, $field_name, $field['id'], FALSE);
+ CRM_Price_BAO_PriceField::addQuickFormElement($this, $field_name, $field['id'], FALSE);
$price_fields_for_event[] = $field_name;
}
}
foreach ($this->cart->get_main_events_in_carts() as $event_in_cart) {
$price_set_id = CRM_Event_BAO_Event::usesPriceSet($event_in_cart->event_id);
if ($price_set_id) {
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $price_set_id;
$priceField->find();
$lineItem = array();
if (is_array($this->_values['fee']['fields'])) {
- CRM_Price_BAO_Set::processAmount($this->_values['fee']['fields'], $fields, $lineItem);
+ CRM_Price_BAO_PriceSet::processAmount($this->_values['fee']['fields'], $fields, $lineItem);
//XXX total...
if ($fields['amount'] < 0) {
$this->_errors['_qf_default'] = ts("Price Levels can not be less than zero. Please select the options accordingly");
function process_event_line_item(&$event_in_cart, $class = NULL) {
$cost = 0;
- $price_set_id = CRM_Price_BAO_Set::getFor("civicrm_event", $event_in_cart->event_id);
+ $price_set_id = CRM_Price_BAO_PriceSet::getFor("civicrm_event", $event_in_cart->event_id);
$amount_level = NULL;
if ($price_set_id) {
$event_price_values = array();
$event_price_values[$matches[1]] = $value;
}
}
- $price_sets = CRM_Price_BAO_Set::getSetDetail($price_set_id, TRUE);
+ $price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE);
$price_set = $price_sets[$price_set_id];
$price_set_amount = array();
- CRM_Price_BAO_Set::processAmount($price_set['fields'], $event_price_values, $price_set_amount);
+ CRM_Price_BAO_PriceSet::processAmount($price_set['fields'], $event_price_values, $price_set_amount);
$cost = $event_price_values['amount'];
$amount_level = $event_price_values['amount_level'];
}
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_BAO_Discount', $discountId, 'price_set_id');
}
else {
- $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_event', $form->_eventId);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $form->_eventId);
}
if (($form->_action == CRM_Core_Action::ADD) && $form->_eventId && $discountId) {
}
// get price set ID.
- $priceSetID = CRM_Price_BAO_Set::getFor('civicrm_event', $eventID);
+ $priceSetID = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventID);
if (!$priceSetID) {
return $defaults;
}
CRM_Event_BAO_Event::retrieve($params, $defaults);
if (isset($eventId)) {
- $price_set_id = CRM_Price_BAO_Set::getFor('civicrm_event', $eventId, NULL, 1);
+ $price_set_id = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventId, NULL, 1);
if ($price_set_id) {
$defaults['price_set_id'] = $price_set_id;
}
else {
- $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_event', $eventId, NULL);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventId, NULL);
if ($priceSetId) {
- if ($isQuick = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config')) {
+ if ($isQuick = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config')) {
$this->assign('isQuick', $isQuick);
- $priceField = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $priceSetId, 'id', 'price_set_id');
+ $priceField = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $priceSetId, 'id', 'price_set_id');
$options = array();
- $priceFieldOptions = CRM_Price_BAO_FieldValue::getValues($priceField, $options, 'weight', true);
+ $priceFieldOptions = CRM_Price_BAO_PriceFieldValue::getValues($priceField, $options, 'weight', true);
$defaults['price_field_id'] = $priceField;
$countRow = 0;
foreach ($options as $optionId => $optionValue) {
$totalLables = $maxSize = $defaultDiscounts = array();
foreach ($discountedEvent as $optionGroupId) {
$defaults['discount_price_set'][] = $optionGroupId;
- $name = $defaults["discount_name[$i]"] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $optionGroupId, 'title');
+ $name = $defaults["discount_name[$i]"] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $optionGroupId, 'title');
list($defaults["discount_start_date[$i]"]) = CRM_Utils_Date::setDateDefaults(CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $optionGroupId,
'start_date', 'price_set_id'
list($defaults["discount_end_date[$i]"]) = CRM_Utils_Date::setDateDefaults(CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $optionGroupId,
'end_date', 'price_set_id'
));
- $defaultDiscounts[] = CRM_Price_BAO_Set::getSetDetail($optionGroupId);
+ $defaultDiscounts[] = CRM_Price_BAO_PriceSet::getSetDetail($optionGroupId);
$i++;
}
$this->add('text', 'fee_label', ts('Fee Label'));
- $price = CRM_Price_BAO_Set::getAssoc(FALSE, 'CiviEvent');
+ $price = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviEvent');
if (CRM_Utils_System::isNull($price)) {
$this->assign('price', FALSE);
}
//discount name
$this->add('text', 'discount_name[' . $i . ']', ts('Discount Name'),
- CRM_Core_DAO::getAttribute('CRM_Price_DAO_Set', 'title')
+ CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceSet', 'title')
);
$this->add('hidden', "discount_price_set[$i]", '', array('id' => "discount_price_set[$i]"));
// delete all the prior label values or discounts in the custom options table
// and delete a price set if one exists
- if (CRM_Price_BAO_Set::removeFrom('civicrm_event', $this->_id)) {
+ if (CRM_Price_BAO_PriceSet::removeFrom('civicrm_event', $this->_id)) {
CRM_Core_BAO_Discount::del($this->_id,'civicrm_event');
}
}
if ($params['is_monetary']) {
if (CRM_Utils_Array::value('price_set_id', $params)) {
- CRM_Price_BAO_Set::addTo('civicrm_event', $this->_id, $params['price_set_id']);
+ CRM_Price_BAO_PriceSet::addTo('civicrm_event', $this->_id, $params['price_set_id']);
if (CRM_Utils_Array::value('price_field_id', $params)) {
- $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $params['price_field_id'], 'price_set_id');
- CRM_Price_BAO_Set::setIsQuickConfig($priceSetID,0);
+ $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $params['price_field_id'], 'price_set_id');
+ CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetID,0);
}
}
else {
if (!CRM_Utils_Array::value('price_field_id', $params)) {
$setParams['title'] = $eventTitle = ($this->_isTemplate) ? $this->_defaultValues['template_title'] : $this->_defaultValues['title'];
$eventTitle = strtolower(CRM_Utils_String::munge($eventTitle, '_', 245));
- if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $eventTitle, 'id', 'name')) {
+ if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $eventTitle, 'id', 'name')) {
$setParams['name'] = $eventTitle;
}
- elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $eventTitle . '_' . $this->_id, 'id', 'name')) {
+ elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $eventTitle . '_' . $this->_id, 'id', 'name')) {
$setParams['name'] = $eventTitle . '_' . $this->_id;
}
else {
}
$setParams['is_quick_config'] = 1;
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviEvent');
- $priceSet = CRM_Price_BAO_Set::create($setParams);
+ $priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$fieldParams['name'] = $fieldParams['label'] = $params['fee_label'];
$fieldParams['price_set_id'] = $priceSet->id;
else {
foreach ($params['price_field_value'] as $arrayID => $fieldValueID) {
if (empty($params['label'][$arrayID]) && empty($params['value'][$arrayID]) && !empty($fieldValueID)) {
- CRM_Price_BAO_FieldValue::setIsActive($fieldValueID, '0');
+ CRM_Price_BAO_PriceFieldValue::setIsActive($fieldValueID, '0');
unset($params['price_field_value'][$arrayID]);
}
}
$fieldParams['id'] = CRM_Utils_Array::value('price_field_id', $params);
$fieldParams['option_id'] = $params['price_field_value'];
- $priceSet = new CRM_Price_BAO_Set();
- $priceSet->id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', CRM_Utils_Array::value('price_field_id', $params), 'price_set_id');
+ $priceSet = new CRM_Price_BAO_PriceSet();
+ $priceSet->id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', CRM_Utils_Array::value('price_field_id', $params), 'price_set_id');
}
$fieldParams['html_type'] = 'Radio';
- CRM_Price_BAO_Set::addTo('civicrm_event', $this->_id, $priceSet->id);
+ CRM_Price_BAO_PriceSet::addTo('civicrm_event', $this->_id, $priceSet->id);
$fieldParams['option_label'] = $params['label'];
$fieldParams['option_amount'] = $params['value'];
$fieldParams['financial_type_id'] = $params['financial_type_id'];
foreach ($options as $value) $fieldParams['option_weight'][$value['weight']] = $value['weight'];
$fieldParams['default_option'] = $params['default'];
- $priceField = CRM_Price_BAO_Field::create($fieldParams);
+ $priceField = CRM_Price_BAO_PriceField::create($fieldParams);
}
}
}
$eventTitle = strtolower(CRM_Utils_String::munge($this->_defaultValues['title'], '_', 200));
}
$setParams['title'] = $params['discount_name'][$j];
- if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $eventTitle . '_' . $params['discount_name'][$j], 'id', 'name')) {
+ if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $eventTitle . '_' . $params['discount_name'][$j], 'id', 'name')) {
$setParams['name'] = $eventTitle . '_' . $params['discount_name'][$j];
}
- elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $eventTitle . '_' . $params['discount_name'][$j] . '_' . $this->_id, 'id', 'name')) {
+ elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $eventTitle . '_' . $params['discount_name'][$j] . '_' . $this->_id, 'id', 'name')) {
$setParams['name'] = $eventTitle . '_' . $params['discount_name'][$j] . '_' . $this->_id;
}
else {
}
$setParams['is_quick_config'] = 1;
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviEvent');
- $priceSet = CRM_Price_BAO_Set::create($setParams);
+ $priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
} else {
$priceSetID = $discountPriceSets[$j-1];
unset($discountPriceSets[$j-1]);
- $fieldParams['id'] = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Field', $priceSetID, 'id', 'price_set_id');
+ $fieldParams['id'] = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceField', $priceSetID, 'id', 'price_set_id');
}
$fieldParams['name'] = $fieldParams['label'] = $params['fee_label'];
}
}
//create discount priceset
- $priceField = CRM_Price_BAO_Field::create($fieldParams);
+ $priceField = CRM_Price_BAO_PriceField::create($fieldParams);
if (!empty($discountFieldIDs)) {
foreach($discountFieldIDs as $fID){
- CRM_Price_BAO_FieldValue::setIsActive($fID, '0');
+ CRM_Price_BAO_PriceFieldValue::setIsActive($fID, '0');
}
}
}
if (!empty($discountPriceSets)) {
foreach ($discountPriceSets as $setId) {
- CRM_Price_BAO_Set::setIsQuickConfig($setId, 0);
+ CRM_Price_BAO_PriceSet::setIsQuickConfig($setId, 0);
}
}
}
}
else {
if (CRM_Utils_Array::value('price_field_id', $params)) {
- $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $params['price_field_id'], 'price_set_id');
- CRM_Price_BAO_Set::setIsQuickConfig($priceSetID,0);
+ $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $params['price_field_id'], 'price_set_id');
+ CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetID,0);
}
$params['financial_type_id'] = '';
$params['is_pay_later'] = 0;
($self->_id && !$self->_paymentId && isset($self->_values['line_items']) && is_array($self->_values['line_items']))
) {
if ($priceSetId = CRM_Utils_Array::value('priceSetId', $values)) {
- CRM_Price_BAO_Field::priceSetValidation($priceSetId, $values, $errorMsg, TRUE);
+ CRM_Price_BAO_PriceField::priceSetValidation($priceSetId, $values, $errorMsg, TRUE);
}
}
return CRM_Utils_Array::crmIsEmptyArray($errorMsg) ? TRUE : $errorMsg;
if (CRM_Utils_Array::value('contact_select_id', $params)) {
$this->_contactId = $params['contact_select_id'][1];
}
- if ($this->_priceSetId && $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->_quickConfig = $isQuickConfig;
}
//lets carry currency, CRM-4453
$params['fee_currency'] = $config->defaultCurrency;
- CRM_Price_BAO_Set::processAmount($this->_values['fee'],
+ CRM_Price_BAO_PriceSet::processAmount($this->_values['fee'],
$params, $lineItem[0]
);
//CRM-11529 for quick config backoffice transactions
}
if ($discountId) {
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_BAO_Discount', $discountId, 'price_set_id');
- $price = CRM_Price_BAO_Set::initSet($form, $eventID, 'civicrm_event', TRUE, $priceSetId);
+ $price = CRM_Price_BAO_PriceSet::initSet($form, $eventID, 'civicrm_event', TRUE, $priceSetId);
}
else {
- $price = CRM_Price_BAO_Set::initSet($form, $eventID, 'civicrm_event', TRUE);
+ $price = CRM_Price_BAO_PriceSet::initSet($form, $eventID, 'civicrm_event', TRUE);
}
if (property_exists($form, '_context') && ($form->_context == 'standalone'
$discountedEvent = CRM_Core_BAO_Discount::getOptionGroup($eventID, 'civicrm_event');
if (is_array( $discountedEvent)) {
foreach ($discountedEvent as $key => $priceSetId) {
- $priceSet = CRM_Price_BAO_Set::getSetDetail($priceSetId);
+ $priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId);
$priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
$form->_values['discount'][$key] = CRM_Utils_Array::value('fields', $priceSet);
$fieldID = key($form->_values['discount'][$key]);
$form->_values['discount'][$key][$fieldID]['name'] = CRM_Core_DAO::getFieldValue(
- 'CRM_Price_DAO_Set',
+ 'CRM_Price_DAO_PriceSet',
$priceSetId,
'title'
);
$includeSkipButton = TRUE;
$this->_resetAllowWaitlist = FALSE;
- $pricesetFieldsCount = CRM_Price_BAO_Set::getPricesetCount($this->_priceSetId);
+ $pricesetFieldsCount = CRM_Price_BAO_PriceSet::getPricesetCount($this->_priceSetId);
if ($this->_lastParticipant || $pricesetFieldsCount) {
//get the participant total.
}
if ($button == 'skip' && $self->_lastParticipant && CRM_Utils_Array::value('priceSetId', $fields)) {
- $pricesetFieldsCount = CRM_Price_BAO_Set::getPricesetCount($fields['priceSetId']);
+ $pricesetFieldsCount = CRM_Price_BAO_PriceSet::getPricesetCount($fields['priceSetId']);
if (($pricesetFieldsCount < 1) || $self->_allowConfirmation) {
return $errors;
}
$validatePayement = FALSE;
if (CRM_Utils_Array::value('priceSetId', $fields)) {
$lineItem = array();
- CRM_Price_BAO_Set::processAmount($self->_values['fee'], $fields, $lineItem);
+ CRM_Price_BAO_PriceSet::processAmount($self->_values['fee'], $fields, $lineItem);
if ($fields['amount'] > 0) {
$validatePayement = TRUE;
// $self->_forcePayement = true;
}
else {
$lineItem = array();
- CRM_Price_BAO_Set::processAmount($this->_values['fee'], $params, $lineItem);
+ CRM_Price_BAO_PriceSet::processAmount($this->_values['fee'], $params, $lineItem);
//build the line item..
if (array_key_exists($addParticipantNum, $this->_lineItem)) {
$this->set('totalAmount', $this->_totalAmount);
}
- if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$lineItemForTemplate = array();
foreach ($this->_lineItem as $key => $value) {
if (!empty($value)) {
$this->assign('isRequireApproval', $this->_requireApproval);
// Assign Participant Count to Lineitem Table
- $this->assign('pricesetFieldsCount', CRM_Price_BAO_Set::getPricesetCount($this->_priceSetId));
+ $this->assign('pricesetFieldsCount', CRM_Price_BAO_PriceSet::getPricesetCount($this->_priceSetId));
}
/**
}
//build the element.
- CRM_Price_BAO_Field::addQuickFormElement($form,
+ CRM_Price_BAO_PriceField::addQuickFormElement($form,
$elementName,
$fieldId,
FALSE,
}
$lineItem = array();
- CRM_Price_BAO_Set::processAmount($self->_values['fee'], $fields, $lineItem);
+ CRM_Price_BAO_PriceSet::processAmount($self->_values['fee'], $fields, $lineItem);
if ($fields['amount'] < 0) {
$errors['_qf_default'] = ts('Event Fee(s) can not be less than zero. Please select the options accordingly');
}
}
else {
$lineItem = array();
- CRM_Price_BAO_Set::processAmount($this->_values['fee'], $params, $lineItem);
+ CRM_Price_BAO_PriceSet::processAmount($this->_values['fee'], $params, $lineItem);
$this->set('lineItem', array($lineItem));
$this->set('lineItemParticipantsCount', array($primaryParticipantCount));
}
}
$this->assignToTemplate();
- if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$lineItemForTemplate = array();
foreach ($this->_lineItem as $key => $value) {
if (!empty($value)) {
}
// Assign Participant Count to Lineitem Table
- $this->assign('pricesetFieldsCount', CRM_Price_BAO_Set::getPricesetCount($this->_priceSetId));
+ $this->assign('pricesetFieldsCount', CRM_Price_BAO_PriceSet::getPricesetCount($this->_priceSetId));
// can we blow away the session now to prevent hackery
$this->controller->reset();
if ($discountId) {
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $discountId, 'price_set_id');
} else {
- $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_event', $this->_id);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $this->_id);
}
// get price set options, - CRM-5209
if ($priceSetId) {
- $setDetails = CRM_Price_BAO_Set::getSetDetail($priceSetId, TRUE, TRUE);
+ $setDetails = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId, TRUE, TRUE);
$priceSetFields = $setDetails[$priceSetId]['fields'];
if (is_array($priceSetFields)) {
$mailingGroup = new CRM_Mailing_DAO_MailingGroup();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mg = CRM_Mailing_DAO_MailingGroup::getTableName();
$eq = CRM_Mailing_Event_DAO_Queue::getTableName();
$ed = CRM_Mailing_Event_DAO_Delivered::getTableName();
* CRM_Mailing_Form_Schedule::postProcess() or via API.
*/
if (isset($params['approval_status_id']) && $params['approval_status_id']) {
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->mailing_id = $mailing->id;
$job->status = 'Scheduled';
$job->is_test = 0;
'mailing' => self::getTableName(),
'mailing_group' => CRM_Mailing_DAO_MailingGroup::getTableName(),
'group' => CRM_Contact_BAO_Group::getTableName(),
- 'job' => CRM_Mailing_BAO_Job::getTableName(),
+ 'job' => CRM_Mailing_BAO_MailingJob::getTableName(),
'queue' => CRM_Mailing_Event_BAO_Queue::getTableName(),
'delivered' => CRM_Mailing_Event_BAO_Delivered::getTableName(),
'opened' => CRM_Mailing_Event_BAO_Opened::getTableName(),
$row['optout'] = CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($mailing_id, $mailing->id, TRUE, FALSE);
$report['event_totals']['optout'] += $row['optout'];
- foreach (array_keys(CRM_Mailing_BAO_Job::fields()) as $field) {
+ foreach (array_keys(CRM_Mailing_BAO_MailingJob::fields()) as $field) {
$row[$field] = $mailing->$field;
}
*/
public function &getRows($offset, $rowCount, $sort, $additionalClause = NULL, $additionalParams = NULL) {
$mailing = self::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$group = CRM_Mailing_DAO_MailingGroup::getTableName();
$session = CRM_Core_Session::singleton();
CRM_Core_Error::fatal();
}
- $dao = new CRM_Mailing_BAO_Job();
+ $dao = new CRM_Mailing_BAO_MailingJob();
$dao->id = $id;
$dao->delete();
}
// load bootstrap to call hooks
// Split up the parent jobs into multiple child jobs
- CRM_Mailing_BAO_Job::runJobs_pre($config->mailerJobSize, $mode);
- CRM_Mailing_BAO_Job::runJobs(NULL, $mode);
- CRM_Mailing_BAO_Job::runJobs_post($mode);
+ CRM_Mailing_BAO_MailingJob::runJobs_pre($config->mailerJobSize, $mode);
+ CRM_Mailing_BAO_MailingJob::runJobs(NULL, $mode);
+ CRM_Mailing_BAO_MailingJob::runJobs_post($mode);
// lets release the global cron lock if we do have one
if ($gotCronLock) {
*/
require_once 'Mail.php';
-class CRM_Mailing_BAO_Job extends CRM_Mailing_DAO_Job {
+class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
CONST MAX_CONTACTS_TO_PROCESS = 1000;
/**
}
function create ($params){
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->mailing_id = $params['mailing_id'];
$job->status = $params['status'];
$job->scheduled_date = $params['scheduled_date'];
* @static
*/
public static function runJobs($testParams = NULL, $mode = NULL) {
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$config = CRM_Core_Config::singleton();
- $jobTable = CRM_Mailing_DAO_Job::getTableName();
+ $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
$mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
if (!empty($testParams)) {
$job->queue($testParams);
// Mark up the starting time
- $saveJob = new CRM_Mailing_DAO_Job();
+ $saveJob = new CRM_Mailing_DAO_MailingJob();
$saveJob->id = $job->id;
$saveJob->start_date = date('YmdHis');
$saveJob->status = 'Running';
$transaction = new CRM_Core_Transaction();
- $saveJob = new CRM_Mailing_DAO_Job();
+ $saveJob = new CRM_Mailing_DAO_MailingJob();
$saveJob->id = $job->id;
$saveJob->end_date = date('YmdHis');
$saveJob->status = 'Complete';
// as well as the mailing is complete after the run
public static function runJobs_post($mode = NULL) {
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$mailing = new CRM_Mailing_BAO_Mailing();
$config = CRM_Core_Config::singleton();
- $jobTable = CRM_Mailing_DAO_Job::getTableName();
+ $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
$mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
$currentTime = date('YmdHis');
// For each parent job that is running, let's look at their child jobs
while ($job->fetch()) {
- $child_job = new CRM_Mailing_BAO_Job();
+ $child_job = new CRM_Mailing_BAO_MailingJob();
$child_job_sql = "
SELECT count(j.id)
$transaction = new CRM_Core_Transaction();
- $saveJob = new CRM_Mailing_DAO_Job();
+ $saveJob = new CRM_Mailing_DAO_MailingJob();
$saveJob->id = $job->id;
$saveJob->end_date = date('YmdHis');
$saveJob->status = 'Complete';
// before we run jobs, we need to split the jobs
public static function runJobs_pre($offset = 200, $mode = NULL) {
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$config = CRM_Core_Config::singleton();
- $jobTable = CRM_Mailing_DAO_Job::getTableName();
+ $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
$mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
$currentTime = date('YmdHis');
$mailingACL = CRM_Mailing_BAO_Mailing::mailingACL('m');
- $workflowClause = CRM_Mailing_BAO_Job::workflowClause();
+ $workflowClause = CRM_Mailing_BAO_MailingJob::workflowClause();
$domainID = CRM_Core_Config::domainID();
// update the status of the parent job
$transaction = new CRM_Core_Transaction();
- $saveJob = new CRM_Mailing_DAO_Job();
+ $saveJob = new CRM_Mailing_DAO_MailingJob();
$saveJob->id = $job->id;
$saveJob->start_date = date('YmdHis');
$saveJob->status = 'Running';
public function split_job($offset = 200) {
$recipient_count = CRM_Mailing_BAO_Recipients::mailingSize($this->mailing_id);
- $jobTable = CRM_Mailing_DAO_Job::getTableName();
+ $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
$dao = new CRM_Core_DAO();
in_array($job->status, array('Scheduled', 'Running', 'Paused'))
) {
- $newJob = new CRM_Mailing_BAO_Job();
+ $newJob = new CRM_Mailing_BAO_MailingJob();
$newJob->id = $job->id;
$newJob->end_date = date('YmdHis');
$newJob->status = 'Canceled';
return PEAR::raiseError( 'Unable to create spooled mailing.' );
}
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->is_test = 0; // if set to 1 it doesn't show in the UI
$job->status = 'Complete';
$job->scheduled_date = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s'));
$job->save();
$job_id = $job->id; // need this for parent_id below
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->is_test = 0;
$job->status = 'Complete';
$job->scheduled_date = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s'));
$bounce = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($bounce.id) as bounce
$bounceType = CRM_Mailing_DAO_BounceType::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$bounce = CRM_Mailing_Event_BAO_Bounce::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($delivered.id) as delivered
$bounce = CRM_Mailing_Event_BAO_Bounce::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$location = CRM_Core_BAO_Location::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$queueTable = CRM_Mailing_Event_BAO_Queue::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
$forward = self::getTableName();
$forward = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($forward.id) as forward
$forward = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$open = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($open.id) as opened
$open = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mailingIDs = implode(',', $mailingIDs);
$query = "
$open = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$queue = self::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$dao->query("
SELECT COUNT(*) as queued
$queue = self::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
*/
public function &getMailing() {
$mailing = new CRM_Mailing_BAO_Mailing();
- $jobs = CRM_Mailing_BAO_Job::getTableName();
+ $jobs = CRM_Mailing_BAO_MailingJob::getTableName();
$mailings = CRM_Mailing_BAO_Mailing::getTableName();
$queue = self::getTableName();
$mailing = new CRM_Mailing_BAO_Mailing();
$mailings = CRM_Mailing_BAO_Mailing::getTableName();
- $jobs = CRM_Mailing_BAO_Job::getTableName();
+ $jobs = CRM_Mailing_BAO_MailingJob::getTableName();
$mailing->query(
"SELECT * FROM $mailings
INNER JOIN $jobs
$reply = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($reply.id) as reply
$reply = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$do = new CRM_Core_DAO();
$mg = CRM_Mailing_DAO_MailingGroup::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
$group = CRM_Contact_BAO_Group::getTableName();
$gc = CRM_Contact_BAO_GroupContact::getTableName();
$config = CRM_Core_Config::singleton();
$domain = CRM_Core_BAO_Domain::getDomain();
- $jobTable = CRM_Mailing_BAO_Job::getTableName();
+ $jobTable = CRM_Mailing_BAO_MailingJob::getTableName();
$mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
$contacts = CRM_Contact_DAO_Contact::getTableName();
$email = CRM_Core_DAO_Email::getTableName();
* prevents foreign key violations. */
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$eq = CRM_Mailing_Event_BAO_Queue::getTableName();
$turl = CRM_Mailing_BAO_TrackableURL::getTableName();
$click = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($click.id) as opened
$click = self::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mailingIDs = implode(',', $mailingIDs);
$query = "
$url = CRM_Mailing_BAO_TrackableURL::getTableName();
$queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
$email = CRM_Core_BAO_Email::getTableName();
$do = new CRM_Core_DAO();
$mgObject = new CRM_Mailing_DAO_MailingGroup();
$mg = $mgObject->getTableName();
- $jobObject = new CRM_Mailing_BAO_Job();
+ $jobObject = new CRM_Mailing_BAO_MailingJob();
$job = $jobObject->getTableName();
$mailingObject = new CRM_Mailing_BAO_Mailing();
$mailing = $mailingObject->getTableName();
$config = CRM_Core_Config::singleton();
$domain = CRM_Core_BAO_Domain::getDomain();
- $jobObject = new CRM_Mailing_BAO_Job();
+ $jobObject = new CRM_Mailing_BAO_MailingJob();
$jobTable = $jobObject->getTableName();
$mailingObject = new CRM_Mailing_DAO_Mailing();
$mailingTable = $mailingObject->getTableName();
$queue = $queueObject->getTableName();
$mailingObject = new CRM_Mailing_BAO_Mailing();
$mailing = $mailingObject->getTableName();
- $jobObject = new CRM_Mailing_BAO_Job();
+ $jobObject = new CRM_Mailing_BAO_MailingJob();
$job = $jobObject->getTableName();
$query = "
$queue = $queueObject->getTableName();
$mailingObject = new CRM_Mailing_BAO_Mailing();
$mailing = $mailingObject->getTableName();
- $jobObject = new CRM_Mailing_BAO_Job();
+ $jobObject = new CRM_Mailing_BAO_MailingJob();
$job = $jobObject->getTableName();
$contactObject = new CRM_Contact_BAO_Contact();
$contact = $contactObject->getTableName();
$params['scheduled_date'] = 'null';
// also delete any jobs associated with this mailing
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->mailing_id = $ids['mailing_id'];
$job->delete();
}
CRM_Mailing_BAO_Mailing::del($this->_mailingId);
}
elseif ($this->_action & CRM_Core_Action::DISABLE) {
- CRM_Mailing_BAO_Job::cancel($this->_mailingId);
+ CRM_Mailing_BAO_MailingJob::cancel($this->_mailingId);
}
elseif ($this->_action & CRM_Core_Action::RENEW) {
//set is_archived to 1
return $error;
}
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->mailing_id = $self->get('mailing_id');
$job->is_test = TRUE;
$job->save();
$testParams['job_id'] = $job->id;
$isComplete = FALSE;
while (!$isComplete) {
- $isComplete = CRM_Mailing_BAO_Job::runJobs($testParams);
+ $isComplete = CRM_Mailing_BAO_MailingJob::runJobs($testParams);
}
if (CRM_Utils_Array::value('sendtest', $testParams)) {
$newArgs = $newArgs[0];
if (isset($_GET['runJobs']) || CRM_Utils_Array::value('2', $newArgs) == 'queue') {
$config = CRM_Core_Config::singleton();
- CRM_Mailing_BAO_Job::runJobs_pre($config->mailerJobSize);
- CRM_Mailing_BAO_Job::runJobs();
- CRM_Mailing_BAO_Job::runJobs_post();
+ CRM_Mailing_BAO_MailingJob::runJobs_pre($config->mailerJobSize);
+ CRM_Mailing_BAO_MailingJob::runJobs();
+ CRM_Mailing_BAO_MailingJob::runJobs_post();
}
$this->_sortByCharacter =
if ($this->_action & CRM_Core_Action::DISABLE) {
if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', $this)) {
- CRM_Mailing_BAO_Job::cancel($this->_mailingId);
+ CRM_Mailing_BAO_MailingJob::cancel($this->_mailingId);
CRM_Utils_System::redirect($context);
}
else {
*/
function &getColumnHeaders($action = NULL, $output = NULL) {
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
if (!isset(self::$_columnHeaders)) {
$completedOrder = NULL;
* @access public
*/
function getTotalCount($action) {
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
$mailingACL = CRM_Mailing_BAO_Mailing::mailingACL();
$actionMask = CRM_Core_Action::ADD;
}
//get status strings as per locale settings CRM-4411.
- $rows[$key]['status'] = CRM_Mailing_BAO_Job::status($row['status']);
+ $rows[$key]['status'] = CRM_Mailing_BAO_MailingJob::status($row['status']);
$rows[$key]['action'] = CRM_Core_Action::formLink($actionLinks,
$actionMask,
$email = CRM_Core_BAO_Email::getTableName();
- $job = CRM_Mailing_BAO_Job::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
if (!isset($this->_columnHeaders)) {
$this->_columnHeaders = array(
$form->addRule('selectMembership', ts('Please select one of the memberships.'), 'required');
}
else {
- $autoRenewOption = CRM_Price_BAO_Set::checkAutoRenewForPriceSet($form->_priceSetId);
+ $autoRenewOption = CRM_Price_BAO_PriceSet::checkAutoRenewForPriceSet($form->_priceSetId);
$form->assign('autoRenewOption', $autoRenewOption);
}
* @static
*/
static function createLineItems(&$qf, $membershipType, &$priceSetId) {
- $qf->_priceSetId = $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', 'default_membership_type_amount', 'id', 'name');
+ $qf->_priceSetId = $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name');
if ($priceSetId) {
- $qf->_priceSet = $priceSets = current(CRM_Price_BAO_Set::getSetDetail($priceSetId));
+ $qf->_priceSet = $priceSets = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId));
}
$editedFieldParams = array(
'price_set_id' => $priceSetId,
'name' => $membershipType[0],
);
$editedResults = array();
- CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (!empty($editedResults)) {
unset($qf->_priceSet['fields']);
'membership_type_id' => $membershipType[1],
);
$editedResults = array();
- CRM_Price_BAO_FieldValue::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceFieldValue::retrieve($editedFieldParams, $editedResults);
$qf->_priceSet['fields'][$fid]['options'][$editedResults['id']] = $priceSets['fields'][$fid]['options'][$editedResults['id']];
if (CRM_Utils_Array::value('total_amount', $qf->_params)) {
$qf->_priceSet['fields'][$fid]['options'][$editedResults['id']]['amount'] = $qf->_params['total_amount'];
public static function createMembershipPriceField($params, $ids, $previousID, $membershipTypeId) {
- $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', 'default_membership_type_amount', 'id', 'name');
+ $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name');
if (CRM_Utils_Array::value('member_of_contact_id', $params)) {
$fieldName = $params['member_of_contact_id'];
'name' => $fieldName,
);
$results = array();
- CRM_Price_BAO_Field::retrieve($fieldParams, $results);
+ CRM_Price_BAO_PriceField::retrieve($fieldParams, $results);
if (empty($results)) {
$fieldParams = array();
$fieldParams['label'] = $fieldLabel;
CRM_Member_Form_MembershipType::checkPreviousPriceField($previousID, $priceSetId, $membershipTypeId, $optionsIds);
$fieldParams['option_id'] = CRM_Utils_Array::value('option_id', $optionsIds);
}
- $priceField = CRM_Price_BAO_Field::create($fieldParams);
+ $priceField = CRM_Price_BAO_PriceField::create($fieldParams);
}
else {
$fieldID = $results['id'];
'membership_type_id' => $membershipTypeId,
);
$results = array();
- CRM_Price_BAO_FieldValue::retrieve($fieldValueParams, $results);
+ CRM_Price_BAO_PriceFieldValue::retrieve($fieldValueParams, $results);
if (!empty($results)) {
$results['label'] = $results['name'] = $params['name'];
$results['amount'] = empty($params['minimum_fee']) ? 0 : $params['minimum_fee'];
}
$results['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params);
$results['description'] = CRM_Utils_Array::value('description', $params);
- CRM_Price_BAO_FieldValue::add($results, $optionsIds);
+ CRM_Price_BAO_PriceFieldValue::add($results, $optionsIds);
}
}
}
if ($this->_priceSetId) {
- return CRM_Price_BAO_Set::setDefaultPriceSet($this, $defaults);
+ return CRM_Price_BAO_PriceSet::setDefaultPriceSet($this, $defaults);
}
$defaults = parent::setDefaultValues();
}
$this->set('priceSetId', $this->_priceSetId);
- CRM_Price_BAO_Set::buildPriceSet($this);
+ CRM_Price_BAO_PriceSet::buildPriceSet($this);
$optionsMembershipTypes = array();
foreach ($this->_priceSet['fields'] as $pField) {
}
}
- $this->assign('autoRenewOption', CRM_Price_BAO_Set::checkAutoRenewForPriceSet($this->_priceSetId));
+ $this->assign('autoRenewOption', CRM_Price_BAO_PriceSet::checkAutoRenewForPriceSet($this->_priceSetId));
$this->assign('optionsMembershipTypes', $optionsMembershipTypes);
$this->assign('contributionType', CRM_Utils_Array::value('financial_type_id', $this->_priceSet));
if ($this->_action & CRM_Core_Action::ADD) {
$buildPriceSet = FALSE;
- $priceSets = CRM_Price_BAO_Set::getAssoc(FALSE, 'CiviMember');
+ $priceSets = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviMember');
if (!empty($priceSets)) {
$buildPriceSet = TRUE;
}
$priceSetId = CRM_Utils_Array::value('price_set_id', $params);
if ($priceSetId) {
- CRM_Price_BAO_Field::priceSetValidation($priceSetId, $params, $errors);
+ CRM_Price_BAO_PriceField::priceSetValidation($priceSetId, $params, $errors);
$priceFieldIDS = array();
foreach ($self->_priceSet['fields'] as $priceIds => $dontCare) {
if (!empty($priceFieldIDS)) {
$ids = implode(',', $priceFieldIDS);
- $count = CRM_Price_BAO_Set::getMembershipCount($ids);
+ $count = CRM_Price_BAO_PriceSet::getMembershipCount($ids);
foreach ($count as $id => $occurance) {
if ($occurance > 1) {
$errors['_qf_default'] = ts('Select at most one option associated with the same membership type.');
}
foreach ($priceFieldIDS as $priceFieldId) {
- if ($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $priceFieldId, 'membership_type_id')) {
+ if ($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldId, 'membership_type_id')) {
$self->_memTypeSelected[$id] = $id;
}
}
CRM_Member_BAO_Membership::createLineItems($this, $formValues['membership_type_id'], $priceSetId);
}
$isQuickConfig = 0;
- if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
+ if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$isQuickConfig = 1;
}
$termsByType = array();
if ($priceSetId) {
- CRM_Price_BAO_Set::processAmount($this->_priceSet['fields'],
+ CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
$this->_params, $lineItem[$priceSetId]);
$params['total_amount'] = CRM_Utils_Array::value('amount', $this->_params);
$submittedFinancialType = CRM_Utils_Array::value('financial_type_id', $formValues);
}
if ($priceSetId && !$isQuickConfig) {
- $params['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_Set',
+ $params['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_PriceSet',
$priceSetId,
'financial_type_id'
);
$lineItem = array();
$lineItems = CRM_Price_BAO_LineItem::getLineItems($params['contribution_id'], 'contribution');
$itemId = key($lineItems);
- $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItems[$itemId]['price_field_id'], 'price_set_id');
+ $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'price_set_id');
$fieldType = NULL;
if ($itemId && CRM_Utils_Array::value('price_field_id', $lineItems[$itemId])) {
- $fieldType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItems[$itemId]['price_field_id'], 'html_type');
+ $fieldType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'html_type');
}
$lineItems[$itemId]['unit_price'] = $params['total_amount'];
$lineItems[$itemId]['line_total'] = $params['total_amount'];
$this->assign('membershipBlockId', $defaults['id']);
}
if ($this->_id &&
- ($priceSetId = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, 3, 1))
+ ($priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 3, 1))
) {
$defaults['member_price_set_id'] = $priceSetId;
$this->_memPriceSetId = $priceSetId;
else {
// for membership_types
// if ( isset( $defaults['membership_types'] ) ) {
- $priceSetId = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, 3);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 3);
$this->assign('isQuick', 1);
$this->_memPriceSetId = $priceSetId;
$pFIDs = array();
if ($priceSetId) {
- CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_Field', 'price_set_id', $priceSetId, $pFIDs, $return = array('html_type', 'name'));
+ CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array('html_type', 'name'));
foreach ($pFIDs as $pid => $pValue) {
if ($pValue['html_type'] == 'Radio' && $pValue['name'] == 'membership_amount') {
$defaults['mem_price_field_id'] = $pValue['id'];
if (CRM_Utils_Array::value('mem_price_field_id', $defaults)) {
$options = array();
- $priceFieldOptions = CRM_Price_BAO_FieldValue::getValues($defaults['mem_price_field_id'], $options, 'id', 1);
+ $priceFieldOptions = CRM_Price_BAO_PriceFieldValue::getValues($defaults['mem_price_field_id'], $options, 'id', 1);
foreach ($options as $k => $v) {
$newMembershipType[$v['membership_type_id']] = 1;
if ( !empty($defaults['auto_renew']) ) {
$this->addFormRule(array('CRM_Member_Form_MembershipBlock', 'formRule'), $this->_id);
}
- $price = CRM_Price_BAO_Set::getAssoc(FALSE, 'CiviMember');
+ $price = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviMember');
if (CRM_Utils_System::isNull($price)) {
$this->assign('price', FALSE);
}
if (CRM_Utils_Array::value('member_price_set_id', $params)) {
//check if this price set has membership type both auto-renew and non-auto-renew memberships.
- $bothTypes = CRM_Price_BAO_Set::checkMembershipPriceSet($params['member_price_set_id']);
+ $bothTypes = CRM_Price_BAO_PriceSet::checkMembershipPriceSet($params['member_price_set_id']);
//check for supporting payment processors
//if both auto-renew and non-auto-renew memberships
if (CRM_Utils_Array::value('member_is_active', $params)) {
// don't allow price set w/ membership signup, CRM-5095
- if ($contributionPageId && ($setID = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $contributionPageId, NULL, 1))) {
+ if ($contributionPageId && ($setID = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $contributionPageId, NULL, 1))) {
- $extends = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $setID, 'extends');
+ $extends = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $setID, 'extends');
if ($extends != CRM_Core_Component::getComponentID('CiviMember')) {
$errors['member_is_active'] = ts('You cannot enable both Membership Signup and a Contribution Price Set on the same online contribution page.');
return $errors;
// check for price set.
$priceSetID = CRM_Utils_Array::value('member_price_set_id', $params);
if (CRM_Utils_Array::value('member_is_active', $params) && is_array($membershipTypes) && !$priceSetID) {
- $usedPriceSetId = CRM_Price_BAO_Set::getFor('civicrm_contribution_page', $this->_id, 2);
+ $usedPriceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 2);
if (!CRM_Utils_Array::value('mem_price_field_id', $params) && !$usedPriceSetId) {
$pageTitle = strtolower(CRM_Utils_String::munge($this->_values['title'], '_', 245));
$setParams['title'] = $this->_values['title'];
- if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle, 'id', 'name')) {
+ if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $pageTitle, 'id', 'name')) {
$setParams['name'] = $pageTitle;
}
- elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle . '_' . $this->_id, 'id', 'name')) {
+ elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $pageTitle . '_' . $this->_id, 'id', 'name')) {
$setParams['name'] = $pageTitle . '_' . $this->_id;
}
else {
$setParams['is_quick_config'] = 1;
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember');
$setParams['financial_type_id'] = CRM_Utils_Array::value( 'financial_type_id', $this->_values );
- $priceSet = CRM_Price_BAO_Set::create($setParams);
+ $priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
$fieldParams['price_set_id'] = $priceSet->id;
}
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember');
$setParams['financial_type_id'] = CRM_Utils_Array::value( 'financial_type_id', $this->_values );
$setParams['id'] = $usedPriceSetId;
- $priceSet = CRM_Price_BAO_Set::create($setParams);
+ $priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
$fieldParams['price_set_id'] = $priceSet->id;
}
else {
$fieldParams['id'] = CRM_Utils_Array::value('mem_price_field_id', $params);
- $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', CRM_Utils_Array::value('mem_price_field_id', $params), 'price_set_id');
+ $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', CRM_Utils_Array::value('mem_price_field_id', $params), 'price_set_id');
}
$editedFieldParams = array(
'price_set_id' => $priceSetID,
'name' => 'membership_amount',
);
$editedResults = array();
- CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (!CRM_Utils_Array::value('id', $editedResults)) {
$fieldParams['name'] = strtolower(CRM_Utils_String::munge('Membership Amount', '_', 245));
$fieldParams['label'] = CRM_Utils_Array::value('new_title', $params) ? $params['new_title'] : ts('Membership');
if (!CRM_Utils_Array::value('mem_price_field_id', $params)) {
- CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_Field', 0, 1, array('price_set_id' => $priceSetID));
+ CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_PriceField', 0, 1, array('price_set_id' => $priceSetID));
}
$fieldParams['weight'] = 1;
}
$rowCount = 1;
$options = array();
if (CRM_Utils_Array::value('id', $fieldParams)) {
- CRM_Core_PseudoConstant::populate($options, 'CRM_Price_DAO_FieldValue', TRUE, 'membership_type_id', NULL, " price_field_id = {$fieldParams['id']} ");
+ CRM_Core_PseudoConstant::populate($options, 'CRM_Price_DAO_PriceFieldValue', TRUE, 'membership_type_id', NULL, " price_field_id = {$fieldParams['id']} ");
}
foreach ($membershipTypes as $memType => $memAutoRenew) {
$rowCount++;
}
foreach ($options as $priceFieldID => $memType) {
- CRM_Price_BAO_FieldValue::setIsActive($priceFieldID, '0');
+ CRM_Price_BAO_PriceFieldValue::setIsActive($priceFieldID, '0');
}
- $priceField = CRM_Price_BAO_Field::create($fieldParams);
+ $priceField = CRM_Price_BAO_PriceField::create($fieldParams);
}
elseif (!$priceSetID){
$deletePriceSet = 1;
$dao->save();
if ($priceSetID && $params['is_active']) {
- CRM_Price_BAO_Set::addTo('civicrm_contribution_page', $this->_id, $priceSetID);
+ CRM_Price_BAO_PriceSet::addTo('civicrm_contribution_page', $this->_id, $priceSetID);
}
if ($deletePriceSet || !CRM_Utils_Array::value('member_is_active', $params, FALSE)) {
'name' => 'contribution_amount',
);
- CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_Field', $conditionParams, $pFIDs);
+ CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceField', $conditionParams, $pFIDs);
if (!CRM_Utils_Array::value('id', $pFIDs)) {
- CRM_Price_BAO_Set::removeFrom('civicrm_contribution_page', $this->_id);
- CRM_Price_BAO_Set::setIsQuickConfig($this->_memPriceSetId, '0');
+ CRM_Price_BAO_PriceSet::removeFrom('civicrm_contribution_page', $this->_id);
+ CRM_Price_BAO_PriceSet::setIsQuickConfig($this->_memPriceSetId, '0');
}
else {
- CRM_Price_BAO_Field::setIsActive($params['mem_price_field_id'], '0');
+ CRM_Price_BAO_PriceField::setIsActive($params['mem_price_field_id'], '0');
}
}
}
$lineItem = array();
$priceSetId = null;
CRM_Member_BAO_Membership::createLineItems($this, $formValues['membership_type_id'], $priceSetId);
- CRM_Price_BAO_Set::processAmount($this->_priceSet['fields'],
+ CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
$this->_params, $lineItem[$priceSetId]
);
//CRM-11529 for quick config backoffice transactions
'name' => $previousID,
);
$editedResults = array();
- CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (!empty($editedResults)) {
$editedFieldParams = array(
'price_field_id' => $editedResults['id'],
'membership_type_id' => $membershipTypeId,
);
$editedResults = array();
- CRM_Price_BAO_FieldValue::retrieve($editedFieldParams, $editedResults);
+ CRM_Price_BAO_PriceFieldValue::retrieve($editedFieldParams, $editedResults);
$optionsIds['option_id'][1] = CRM_Utils_Array::value('id', $editedResults);
}
}
$options = $fields['options'];
}
else {
- CRM_Price_BAO_FieldValue::getValues($fid, $options, 'weight', TRUE);
+ CRM_Price_BAO_PriceFieldValue::getValues($fid, $options, 'weight', TRUE);
}
$fieldTitle = CRM_Utils_Array::value('label', $fields);
if (!$fieldTitle) {
- $fieldTitle = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $fid, 'label');
+ $fieldTitle = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $fid, 'label');
}
foreach ($params["price_{$fid}"] as $oid => $qty) {
// if financial type is not set and if price field value is NOT NULL
// get financial type id of price field value
if (CRM_Utils_Array::value('price_field_value_id', $line) && !CRM_Utils_Array::value('financial_type_id', $line)) {
- $line['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $line['price_field_value_id'], 'financial_type_id');
+ $line['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $line['price_field_value_id'], 'financial_type_id');
}
$lineItems = CRM_Price_BAO_LineItem::create($line);
if (!$update && $contributionDetails) {
static function getLineItemArray(&$params, $entityId = NULL, $entityTable = 'contribution') {
if (!$entityId) {
- $priceSetDetails = CRM_Price_BAO_Set::getDefaultPriceSet();
+ $priceSetDetails = CRM_Price_BAO_PriceSet::getDefaultPriceSet();
foreach ($priceSetDetails as $values) {
$params['line_item'][$values['setID']][$values['priceFieldID']] = array(
'price_field_id' => $values['priceFieldID'],
$lineItems = CRM_Price_BAO_LineItem::getLineItems($id, $entityTable);
foreach ($lineItems as $key => $values) {
if (!$setID) {
- $setID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $values['price_field_id'], 'price_set_id');
- $params['is_quick_config'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $setID, 'is_quick_config');
+ $setID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $values['price_field_id'], 'price_set_id');
+ $params['is_quick_config'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $setID, 'is_quick_config');
}
if (CRM_Utils_Array::value('is_quick_config', $params) && array_key_exists('total_amount', $params)
&& $totalEntityId == 1) {
* Business objects for managing price fields.
*
*/
-class CRM_Price_BAO_Field extends CRM_Price_DAO_Field {
+class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
protected $_options;
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $ids the array that holds all the db ids
*
- * @return object CRM_Price_BAO_Field object
+ * @return object CRM_Price_BAO_PriceField object
* @access public
* @static
*/
static function &add(&$params) {
- $priceFieldBAO = new CRM_Price_BAO_Field();
+ $priceFieldBAO = new CRM_Price_BAO_PriceField();
$priceFieldBAO->copyValues($params);
*
* @param array $params (reference) an assoc array of name/value pairs
*
- * @return object CRM_Price_DAO_Field object
+ * @return object CRM_Price_DAO_PriceField object
* @access public
* @static
*/
if ($priceField->html_type == 'Text') {
$maxIndex = 1;
- $fieldValue = new CRM_Price_DAO_FieldValue();
+ $fieldValue = new CRM_Price_DAO_PriceFieldValue();
$fieldValue->price_field_id = $priceField->id;
// update previous field values( if any )
$optionsIds['id'] = NULL;
}
}
- CRM_Price_BAO_FieldValue::create($options, $optionsIds);
+ CRM_Price_BAO_PriceFieldValue::create($options, $optionsIds);
}
}
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the flattened values
*
- * @return object CRM_Price_DAO_Field object
+ * @return object CRM_Price_DAO_PriceField object
* @access public
* @static
*/
static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_Field', $params, $defaults);
+ return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceField', $params, $defaults);
}
/**
* @static
*/
static function setIsActive($id, $is_active) {
- return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_Field', $id, 'is_active', $is_active);
+ return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $id, 'is_active', $is_active);
}
/**
*
*/
public static function getTitle($id) {
- return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $id, 'label');
+ return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $id, 'label');
}
/**
$feezeOptions = array()
) {
- $field = new CRM_Price_DAO_Field();
+ $field = new CRM_Price_DAO_PriceField();
$field->id = $fieldId;
if (!$field->find(TRUE)) {
/* FIXME: failure! */
$customOption = $fieldOptions;
if (!is_array($customOption)) {
- $customOption = CRM_Price_BAO_Field::getOptions($field->id, $inactiveNeeded);
+ $customOption = CRM_Price_BAO_PriceField::getOptions($field->id, $inactiveNeeded);
}
//use value field.
if ($reset || empty($options[$fieldId])) {
$values = array();
- CRM_Price_BAO_FieldValue::getValues($fieldId, $values, 'weight', !$inactiveNeeded);
+ CRM_Price_BAO_PriceFieldValue::getValues($fieldId, $values, 'weight', !$inactiveNeeded);
$options[$fieldId] = $values;
}
*
*/
public static function deleteField($id) {
- $field = new CRM_Price_DAO_Field();
+ $field = new CRM_Price_DAO_PriceField();
$field->id = $id;
if ($field->find(TRUE)) {
// delete the options for this field
- CRM_Price_BAO_FieldValue::deleteValues($id);
+ CRM_Price_BAO_PriceFieldValue::deleteValues($id);
// reorder the weight before delete
$fieldValues = array('price_set_id' => $field->price_set_id);
- CRM_Utils_Weight::delWeight('CRM_Price_DAO_Field', $field->id, $fieldValues);
+ CRM_Utils_Weight::delWeight('CRM_Price_DAO_PriceField', $field->id, $fieldValues);
// now delete the field
return $field->delete();
public static function priceSetValidation($priceSetId, $fields, &$error, $allowNoneSelection = FALSE) {
// check for at least one positive
// amount price field should be selected.
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $priceSetId;
$priceField->find();
foreach ($htmlTypes as $fieldId => $type) {
$options = array();
- CRM_Price_BAO_FieldValue::getValues($fieldId, $options);
+ CRM_Price_BAO_PriceFieldValue::getValues($fieldId, $options);
if (empty($options)) {
continue;
* Business objects for managing price fields values.
*
*/
-class CRM_Price_BAO_FieldValue extends CRM_Price_DAO_FieldValue {
+class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue {
/**
* insert/update a new entry in the database.
*
* @param array $params (reference), array $ids
*
- * @return object CRM_Price_DAO_FieldValue object
+ * @return object CRM_Price_DAO_PriceFieldValue object
* @access public
* @static
*/
static function &add(&$params, $ids) {
- $fieldValueBAO = new CRM_Price_BAO_FieldValue();
+ $fieldValueBAO = new CRM_Price_BAO_PriceFieldValue();
$fieldValueBAO->copyValues($params);
if ($id = CRM_Utils_Array::value('id', $ids)) {
*
* @param array $params (reference), array $ids
*
- * @return object CRM_Price_DAO_FieldValue object
+ * @return object CRM_Price_DAO_PriceFieldValue object
* @access public
* @static
*/
$oldWeight = NULL;
if ($id) {
- $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $id, 'weight', 'id');
+ $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $id, 'weight', 'id');
}
$fieldValues = array('price_field_id' => CRM_Utils_Array::value('price_field_id', $params, 0));
- $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_FieldValue', $oldWeight, $params['weight'], $fieldValues);
+ $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_PriceFieldValue', $oldWeight, $params['weight'], $fieldValues);
}
else {
if (!CRM_Utils_Array::value('name', $params)) {
* @param array $params (reference ) an assoc array
* @param array $defaults (reference ) an assoc array to hold the flattened values
*
- * @return object CRM_Price_DAO_FieldValue object
+ * @return object CRM_Price_DAO_PriceFieldValue object
* @access public
* @static
*/
static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_FieldValue', $params, $defaults);
+ return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceFieldValue', $params, $defaults);
}
/**
* @static
*/
static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) {
- $fieldValueDAO = new CRM_Price_DAO_FieldValue();
+ $fieldValueDAO = new CRM_Price_DAO_PriceFieldValue();
$fieldValueDAO->price_field_id = $fieldId;
$fieldValueDAO->orderBy($orderBy, 'label');
if ($isActive) {
*
*/
public static function getOptionLabel($id) {
- return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue', $id, 'label');
+ return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $id, 'label');
}
/**
* @static
*/
static function setIsActive($id, $is_active) {
- return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_FieldValue', $id, 'is_active', $is_active);
+ return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceFieldValue', $id, 'is_active', $is_active);
}
/**
return FALSE;
}
- $fieldValueDAO = new CRM_Price_DAO_FieldValue();
+ $fieldValueDAO = new CRM_Price_DAO_PriceFieldValue();
$fieldValueDAO->price_field_id = $fieldId;
$fieldValueDAO->delete();
}
return FALSE;
}
- $fieldValueDAO = new CRM_Price_DAO_FieldValue();
+ $fieldValueDAO = new CRM_Price_DAO_PriceFieldValue();
$fieldValueDAO->id = $id;
return $fieldValueDAO->delete();
}
* Business object for managing price sets
*
*/
-class CRM_Price_BAO_Set extends CRM_Price_DAO_Set {
+class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet {
/**
* class constructor
*
* @param array $params (reference) an assoc array of name/value pairs
*
- * @return object CRM_Price_DAO_Set object
+ * @return object CRM_Price_DAO_PriceSet object
* @access public
* @static
*/
static function create(&$params) {
- $priceSetBAO = new CRM_Price_BAO_Set();
+ $priceSetBAO = new CRM_Price_BAO_PriceSet();
$priceSetBAO->copyValues($params);
if (self::eventPriceSetDomainID()) {
$priceSetBAO->domain_id = CRM_Core_Config::domainID();
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the flattened values
*
- * @return object CRM_Price_DAO_Set object
+ * @return object CRM_Price_DAO_PriceSet object
* @access public
* @static
*/
static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_Set', $params, $defaults);
+ return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceSet', $params, $defaults);
}
/**
* @access public
*/
static function setIsActive($id, $isActive) {
- return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_Set', $id, 'is_active', $isActive);
+ return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceSet', $id, 'is_active', $isActive);
}
/**
*
*/
public static function getTitle($id) {
- return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $id, 'title');
+ return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $id, 'title');
}
/**
}
// delete price fields
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $id;
$priceField->find();
while ($priceField->fetch()) {
// delete options first
- CRM_Price_BAO_Field::deleteField($priceField->id);
+ CRM_Price_BAO_PriceField::deleteField($priceField->id);
}
- $set = new CRM_Price_DAO_Set();
+ $set = new CRM_Price_DAO_PriceSet();
$set->id = $id;
return $set->delete();
}
*/
public static function addTo($entityTable, $entityId, $priceSetId) {
// verify that the price set exists
- $dao = new CRM_Price_DAO_Set();
+ $dao = new CRM_Price_DAO_PriceSet();
$dao->id = $priceSetId;
if (!$dao->find()) {
return FALSE;
}
unset($dao);
- $dao = new CRM_Price_DAO_SetEntity();
+ $dao = new CRM_Price_DAO_PriceSetEntity();
// find if this already exists
$dao->entity_id = $entityId;
$dao->entity_table = $entityTable;
* @param integer $entityId
*/
public static function removeFrom($entityTable, $entityId) {
- $dao = new CRM_Price_DAO_SetEntity();
+ $dao = new CRM_Price_DAO_PriceSetEntity();
$dao->entity_table = $entityTable;
$dao->entity_id = $entityId;
return $dao->delete();
$fid = NULL;
if ($oid = CRM_Utils_Array::value('oid', $params)) {
- $fieldValue = new CRM_Price_DAO_FieldValue();
+ $fieldValue = new CRM_Price_DAO_PriceFieldValue();
$fieldValue->id = $oid;
if ($fieldValue->find(TRUE)) {
$fid = $fieldValue->price_field_id;
}
if (isset($fid)) {
- return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $fid, 'price_set_id');
+ return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $fid, 'price_set_id');
}
return NULL;
}
$setTree[$setID]['fields'][$fieldID][$field] = $dao->$field;
}
- $setTree[$setID]['fields'][$fieldID]['options'] = CRM_Price_BAO_Field::getOptions($fieldID, FALSE);
+ $setTree[$setID]['fields'][$fieldID]['options'] = CRM_Price_BAO_PriceField::getOptions($fieldID, FALSE);
}
// also get the pre and post help from this price set
//check if priceset is is_config
if (is_numeric($priceSetId)) {
- if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
+ if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
$form->assign('quickConfig', 1);
}
}
$priceSet = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
$form->_priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
$form->_quickConfig = $quickConfig = 0;
- if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config')) {
+ if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config')) {
$quickConfig = 1;
}
if (!is_array($options)) {
continue;
}
- CRM_Price_BAO_Field::addQuickFormElement($form,
+ CRM_Price_BAO_PriceField::addQuickFormElement($form,
'price_' . $field['id'],
$field['id'],
FALSE,
* @static
*/
public static function getFieldIds($id) {
- $priceField = new CRM_Price_DAO_Field();
+ $priceField = new CRM_Price_DAO_PriceField();
$priceField->price_set_id = $id;
$priceField->find();
while ($priceField->fetch()) {
),
);
- $copy = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_Set',
+ $copy = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_PriceSet',
array('id' => $id),
NULL,
$fieldsFix
);
//copying all the blocks pertaining to the price set
- $copyPriceField = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_Field',
+ $copyPriceField = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_PriceField',
array('price_set_id' => $id),
array('price_set_id' => $copy->id)
);
//copy option group and values
foreach ($price as $originalId => $copyId) {
- CRM_Core_DAO::copyGeneric('CRM_Price_DAO_FieldValue',
+ CRM_Core_DAO::copyGeneric('CRM_Price_DAO_PriceFieldValue',
array('price_field_id' => $originalId),
array('price_field_id' => $copyId)
);
*/
static function checkPermission($sid) {
if ($sid && self::eventPriceSetDomainID()) {
- $domain_id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $sid, 'domain_id', 'id');
+ $domain_id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $sid, 'domain_id', 'id');
if (CRM_Core_Config::domainID() != $domain_id) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
}
* @access public
*/
static function setIsQuickConfig($id, $isQuickConfig) {
- return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_Set', $id, 'is_quick_config', $isQuickConfig);
+ return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceSet', $id, 'is_quick_config', $isQuickConfig);
}
/**
*
*/
static function copyPriceSet($baoName, $id, $newId) {
- $priceSetId = CRM_Price_BAO_Set::getFor($baoName, $id);
+ $priceSetId = CRM_Price_BAO_PriceSet::getFor($baoName, $id);
if ($priceSetId) {
- $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $priceSetId, 'is_quick_config');
+ $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config');
if($isQuickConfig) {
- $copyPriceSet = &CRM_Price_BAO_Set::copy($priceSetId);
- CRM_Price_BAO_Set::addTo($baoName, $newId, $copyPriceSet->id);
+ $copyPriceSet = &CRM_Price_BAO_PriceSet::copy($priceSetId);
+ CRM_Price_BAO_PriceSet::addTo($baoName, $newId, $copyPriceSet->id);
}
else {
- $copyPriceSet = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_SetEntity',
+ $copyPriceSet = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_PriceSetEntity',
array(
'entity_id' => $id,
'entity_table' => $baoName,
$discount = CRM_Core_BAO_Discount::getOptionGroup($id, 'civicrm_event');
foreach ($discount as $discountId => $setId) {
- $copyPriceSet = &CRM_Price_BAO_Set::copy($setId);
+ $copyPriceSet = &CRM_Price_BAO_PriceSet::copy($setId);
$copyDiscount = &CRM_Core_DAO::copyGeneric(
'CRM_Core_DAO_Discount',
*/ function preProcess() {
$this->_fid = $this->get('fid');
- $this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field',
+ $this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField',
$this->_fid,
'label', 'id'
);
*/
public function postProcess() {
- if (CRM_Price_BAO_Field::deleteField($this->_fid)) {
+ if (CRM_Price_BAO_PriceField::deleteField($this->_fid)) {
CRM_Core_Session::setStatus(ts('The Price Field \'%1\' has been deleted.', array(1 => $this->_title)), '', 'success');
}
}
*/ function preProcess() {
$this->_sid = $this->get('sid');
- $this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set',
+ $this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet',
$this->_sid, 'title'
);
}
* @access public
*/
public function postProcess() {
- if (CRM_Price_BAO_Set::deleteSet($this->_sid)) {
+ if (CRM_Price_BAO_PriceSet::deleteSet($this->_sid)) {
CRM_Core_Session::setStatus(ts('The Price Set \'%1\' has been deleted.',
array(1 => $this->_title), ts('Deleted'), 'success'
));
));
$this->_extendComponentId = array();
- $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'extends', 'id');
+ $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
if ($extendComponentId) {
$this->_extendComponentId = explode(CRM_Core_DAO::VALUE_SEPARATOR, $extendComponentId);
}
if (isset($this->_fid)) {
$params = array('id' => $this->_fid);
$this->assign('fid', $this->_fid);
- CRM_Price_BAO_Field::retrieve($params, $defaults);
+ CRM_Price_BAO_PriceField::retrieve($params, $defaults);
$this->_sid = $defaults['price_set_id'];
// if text, retrieve price
if ($defaults['html_type'] == 'Text') {
$valueParams = array('price_field_id' => $this->_fid);
- CRM_Price_BAO_FieldValue::retrieve($valueParams, $defaults);
+ CRM_Price_BAO_PriceFieldValue::retrieve($valueParams, $defaults);
// fix the display of the monetary value, CRM-4038
$defaults['price'] = CRM_Utils_Money::format($defaults['amount'], NULL, '%a');
if ($this->_action & CRM_Core_Action::ADD) {
$fieldValues = array('price_set_id' => $this->_sid);
- $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Price_DAO_Field', $fieldValues);
+ $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Price_DAO_PriceField', $fieldValues);
$defaults['options_per_line'] = 1;
$defaults['is_display_amounts'] = 1;
}
$eventComponentId = CRM_Core_Component::getComponentID('CiviEvent');
if (isset($this->_sid) && $this->_action == CRM_Core_Action::ADD) {
- $financialTypeId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'financial_type_id');
+ $financialTypeId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'financial_type_id');
$defaults['financial_type_id'] = $financialTypeId;
for ($i = 1; $i <= self::NUM_OPTION; $i++) {
$defaults['option_financial_type_id[' . $i . ']'] = $financialTypeId;
$this->add('hidden', 'fid', $this->_fid);
// label
- $this->add('text', 'label', ts('Field Label'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_Field', 'label'), TRUE);
+ $this->add('text', 'label', ts('Field Label'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'label'), TRUE);
// html_type
$javascript = 'onchange="option_html_type(this.form)";';
- $htmlTypes = CRM_Price_BAO_Field::htmlTypes();
+ $htmlTypes = CRM_Price_BAO_PriceField::htmlTypes();
// Text box for Participant Count for a field
$eventComponentId = CRM_Core_Component::getComponentID('CiviEvent');
$memberComponentId = CRM_Core_Component::getComponentID('CiviMember');
- $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_FieldValue');
+ $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
$this->add('select', 'financial_type_id',
ts('Financial Type'),
$this->add('checkbox', 'is_display_amounts', ts('Display Amount?'));
// weight
- $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_Field', 'weight'), TRUE);
+ $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'weight'), TRUE);
$this->addRule('weight', ts('is a numeric field'), 'numeric');
// checkbox / radio options per line
// help post, mask, attributes, javascript ?
$this->add('textarea', 'help_post', ts('Field Help'),
- CRM_Core_DAO::getAttribute('CRM_Price_DAO_Field', 'help_post')
+ CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'help_post')
);
// active_on
}
//avoid the same price field label in Within PriceSet
- $priceFieldLabel = new CRM_Price_DAO_Field();
+ $priceFieldLabel = new CRM_Price_DAO_PriceField();
$priceFieldLabel->label = $fields['label'];
$priceFieldLabel->price_set_id = $form->_sid;
if ($foundAutorenew) {
// if so, check for other fields in this price set which also have auto-renew membership options
- $otherFieldAutorenew = CRM_Price_BAO_Set::checkAutoRenewForPriceSet($form->_sid);
+ $otherFieldAutorenew = CRM_Price_BAO_PriceSet::checkAutoRenewForPriceSet($form->_sid);
if ($otherFieldAutorenew) {
$errors['_qf_default'] = ts('You can include auto-renew membership choices for only one price field in a price set. Another field in this set already contains one or more auto-renew membership options.');
}
$fieldValues = array('price_set_id' => $this->_sid);
$oldWeight = NULL;
if ($this->_fid) {
- $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $this->_fid, 'weight', 'id');
+ $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'weight', 'id');
}
- $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_Field', $oldWeight, $params['weight'], $fieldValues);
+ $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_PriceField', $oldWeight, $params['weight'], $fieldValues);
}
// make value <=> name consistency.
$params['membership_num_terms'] = (!empty($params['membership_type_id'])) ? CRM_Utils_Array::value('membership_num_terms', $params, 1) : NULL;
- $priceField = CRM_Price_BAO_Field::create($params);
+ $priceField = CRM_Price_BAO_PriceField::create($params);
if (!is_a($priceField, 'CRM_Core_Error')) {
CRM_Core_Session::setStatus(ts('Price Field \'%1\' has been saved.', array(1 => $priceField->label)), ts('Saved'), 'success');
if (isset($this->_oid)) {
$params = array('id' => $this->_oid);
- CRM_Price_BAO_FieldValue::retrieve($params, $defaults);
+ CRM_Price_BAO_PriceFieldValue::retrieve($params, $defaults);
// fix the display of the monetary value, CRM-4038
$defaults['value'] = CRM_Utils_Money::format(CRM_Utils_Array::value('value', $defaults), NULL, '%a');
}
$memberComponentId = CRM_Core_Component::getComponentID('CiviMember');
- $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'extends', 'id');
+ $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
if (!isset($defaults['membership_num_terms']) && $memberComponentId == $extendComponentId) {
$defaults['membership_num_terms'] = 1;
}
// set financial type used for price set to set default for new option
if (!$this->_oid) {
- $defaults['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'financial_type_id', 'id');;
+ $defaults['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'financial_type_id', 'id');;
}
if (!isset($defaults['weight']) || !$defaults['weight']) {
$fieldValues = array('price_field_id' => $this->_fid);
- $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Price_DAO_FieldValue', $fieldValues);
+ $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Price_DAO_PriceFieldValue', $fieldValues);
$defaults['is_active'] = 1;
}
return;
}
else {
- $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_FieldValue');
+ $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
// lets trim all the whitespace
$this->applyFilter('__ALL__', 'trim');
elseif ($this->_action == CRM_Core_Action::ADD ||
$this->_action == CRM_Core_Action::VIEW
) {
- $this->_sid = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $this->_fid, 'price_set_id', 'id');
+ $this->_sid = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'price_set_id', 'id');
}
$this->isEvent = False;
- $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'extends', 'id');
+ $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
$this->assign('showMember', FALSE);
if ($memberComponentId == $extendComponentId) {
$this->assign('showMember', TRUE);
true
);
- //CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_Field', $this->_fid, 'weight', 'id' );
+ //CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_PriceField', $this->_fid, 'weight', 'id' );
// FIX ME: duplicate rule?
/*
$this->addRule( 'label',
if ($this->_fid) {
//hide the default checkbox option for text field
- $htmlType = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Field', $this->_fid, 'html_type');
+ $htmlType = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceField', $this->_fid, 'html_type');
$this->assign('hideDefaultOption', FALSE);
if ($htmlType == 'Text') {
$this->assign('hideDefaultOption', TRUE);
public function postProcess() {
if ($this->_action == CRM_Core_Action::DELETE) {
$fieldValues = array('price_field_id' => $this->_fid);
- $wt = CRM_Utils_Weight::delWeight('CRM_Price_DAO_FieldValue', $this->_oid, $fieldValues);
- $label = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_FieldValue',
+ $wt = CRM_Utils_Weight::delWeight('CRM_Price_DAO_PriceFieldValue', $this->_oid, $fieldValues);
+ $label = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue',
$this->_oid,
'label', 'id'
);
- if (CRM_Price_BAO_FieldValue::del($this->_oid)) {
+ if (CRM_Price_BAO_PriceFieldValue::del($this->_oid)) {
CRM_Core_Session::setStatus(ts('%1 option has been deleted.', array(1 => $label)), ts('Record Deleted'), 'success');
}
return;
else {
$params = $ids = array();
$params = $this->controller->exportValues('Option');
- $fieldLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $this->_fid, 'label');
+ $fieldLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'label');
$params['amount'] = CRM_Utils_Rule::cleanMoney(trim($params['amount']));
$params['price_field_id'] = $this->_fid;
if ($this->_oid) {
$ids['id'] = $this->_oid;
}
- $optionValue = CRM_Price_BAO_FieldValue::create($params, $ids);
+ $optionValue = CRM_Price_BAO_PriceFieldValue::create($params, $ids);
CRM_Core_Session::setStatus(ts("The option '%1' has been saved.", array(1 => $params['label'])), ts('Value Saved'), 'success');
}
$fieldId = $this->get('fieldId');
if ($fieldId) {
- $groupTree = CRM_Price_BAO_Set::getSetDetail($groupId);
+ $groupTree = CRM_Price_BAO_PriceSet::getSetDetail($groupId);
$this->_groupTree[$groupId]['fields'][$fieldId] = $groupTree[$groupId]['fields'][$fieldId];
$this->assign('preview_type', 'field');
$url = CRM_Utils_System::url('civicrm/admin/price/field', "reset=1&action=browse&sid={$groupId}");
}
else {
// group preview
- $this->_groupTree = CRM_Price_BAO_Set::getSetDetail($groupId);
+ $this->_groupTree = CRM_Price_BAO_PriceSet::getSetDetail($groupId);
$this->assign('preview_type', 'group');
- $this->assign('setTitle', CRM_Price_BAO_Set::getTitle($groupId));
+ $this->assign('setTitle', CRM_Price_BAO_PriceSet::getTitle($groupId));
$url = CRM_Utils_System::url('civicrm/admin/price', 'reset=1');
$breadCrumb = array(array('title' => ts('Price Sets'),
'url' => $url,
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'price_' . $fieldId;
- CRM_Price_BAO_Field::addQuickFormElement($this, $elementName, $fieldId, FALSE, $field['is_required']);
+ CRM_Price_BAO_PriceField::addQuickFormElement($this, $elementName, $fieldId, FALSE, $field['is_required']);
}
}
}
// setting title for html page
$title = ts('New Price Set');
if ($this->_sid) {
- $title = CRM_Price_BAO_Set::getTitle($this->_sid);
+ $title = CRM_Price_BAO_PriceSet::getTitle($this->_sid);
}
if ($this->_action & CRM_Core_Action::UPDATE) {
$title = ts('Edit %1', array(1 => $title));
$this->assign('sid', $this->_sid);
// title
- $this->add('text', 'title', ts('Set Name'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_Set', 'title'), TRUE);
+ $this->add('text', 'title', ts('Set Name'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceSet', 'title'), TRUE);
$this->addRule('title', ts('Name already exists in Database.'),
- 'objectExists', array('CRM_Price_DAO_Set', $this->_sid, 'title')
+ 'objectExists', array('CRM_Price_DAO_PriceSet', $this->_sid, 'title')
);
$priceSetUsedTables = $extends = array();
if ($this->_action == CRM_Core_Action::UPDATE && $this->_sid) {
- $priceSetUsedTables = CRM_Price_BAO_Set::getUsedBy($this->_sid, 'table');
+ $priceSetUsedTables = CRM_Price_BAO_PriceSet::getUsedBy($this->_sid, 'table');
}
$config = CRM_Core_Config::singleton();
// help text
$this->add('textarea', 'help_pre', ts('Pre-form Help'),
- CRM_Core_DAO::getAttribute('CRM_Price_DAO_Set', 'help_pre')
+ CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceSet', 'help_pre')
);
$this->add('textarea', 'help_post', ts('Post-form Help'),
- CRM_Core_DAO::getAttribute('CRM_Price_DAO_Set', 'help_post')
+ CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceSet', 'help_post')
);
// is this set active ?
$defaults = array('is_active' => TRUE);
if ($this->_sid) {
$params = array('id' => $this->_sid);
- CRM_Price_BAO_Set::retrieve($params, $defaults);
+ CRM_Price_BAO_PriceSet::retrieve($params, $defaults);
$extends = explode(CRM_Core_DAO::VALUE_SEPARATOR, $defaults['extends']);
unset($defaults['extends']);
foreach ($extends as $compId) $defaults['extends'][$compId] = 1;
public function postProcess() {
// get the submitted form values.
$params = $this->controller->exportValues('Set');
- $nameLength = CRM_Core_DAO::getAttribute('CRM_Price_DAO_Set', 'name');
+ $nameLength = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceSet', 'name');
$params['name'] = CRM_Utils_String::titleToVar($params['title'], CRM_Utils_Array::value('maxlength', $nameLength));
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params, FALSE);
$params['id'] = $this->_sid;
}
- $set = CRM_Price_BAO_Set::create($params);
+ $set = CRM_Price_BAO_PriceSet::create($params);
if ($this->_action & CRM_Core_Action::UPDATE) {
CRM_Core_Session::setStatus(ts('The Set \'%1\' has been saved.', array(1 => $set->title)), ts('Saved'), 'success');
}
),
CRM_Core_Action::DISABLE => array(
'name' => ts('Disable'),
- 'extra' => 'onclick = "enableDisable( %%fid%%,\'' . 'CRM_Price_BAO_Field' . '\',\'' . 'enable-disable' . '\' );"',
+ 'extra' => 'onclick = "enableDisable( %%fid%%,\'' . 'CRM_Price_BAO_PriceField' . '\',\'' . 'enable-disable' . '\' );"',
'ref' => 'disable-action',
'title' => ts('Disable Price'),
),
CRM_Core_Action::ENABLE => array(
'name' => ts('Enable'),
- 'extra' => 'onclick = "enableDisable( %%fid%%,\'' . 'CRM_Price_BAO_Field' . '\',\'' . 'disable-enable' . '\' );"',
+ 'extra' => 'onclick = "enableDisable( %%fid%%,\'' . 'CRM_Price_BAO_PriceField' . '\',\'' . 'disable-enable' . '\' );"',
'ref' => 'enable-action',
'title' => ts('Enable Price'),
),
*/
function browse() {
$priceField = array();
- $priceFieldBAO = new CRM_Price_BAO_Field();
+ $priceFieldBAO = new CRM_Price_BAO_PriceField();
// fkey is sid
$priceFieldBAO->price_set_id = $this->_sid;
$optionValues = array();
$params = array('price_field_id' => $priceFieldBAO->id);
- CRM_Price_BAO_FieldValue::retrieve($params, $optionValues);
+ CRM_Price_BAO_PriceFieldValue::retrieve($params, $optionValues);
$priceField[$priceFieldBAO->id]['price'] = CRM_Utils_Array::value('amount', $optionValues);
}
}
// need to translate html types from the db
- $htmlTypes = CRM_Price_BAO_Field::htmlTypes();
+ $htmlTypes = CRM_Price_BAO_PriceField::htmlTypes();
$priceField[$priceFieldBAO->id]['html_type'] = $htmlTypes[$priceField[$priceFieldBAO->id]['html_type']];
$priceField[$priceFieldBAO->id]['order'] = $priceField[$priceFieldBAO->id]['weight'];
$priceField[$priceFieldBAO->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action,
$returnURL = CRM_Utils_System::url('civicrm/admin/price/field', "reset=1&action=browse&sid={$this->_sid}");
$filter = "price_set_id = {$this->_sid}";
- CRM_Utils_Weight::addOrder($priceField, 'CRM_Price_DAO_Field',
+ CRM_Utils_Weight::addOrder($priceField, 'CRM_Price_DAO_PriceField',
'id', $returnURL, $filter
);
$this->assign('priceField', $priceField);
);
if ($this->_sid) {
- $usedBy = CRM_Price_BAO_Set::getUsedBy($this->_sid);
+ $usedBy = CRM_Price_BAO_PriceSet::getUsedBy($this->_sid);
$this->assign('usedBy', $usedBy);
- $this->_isSetReserved= CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'is_reserved');
+ $this->_isSetReserved= CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'is_reserved');
$this->assign('isReserved', $this->_isSetReserved);
- CRM_Price_BAO_Set::checkPermission($this->_sid);
+ CRM_Price_BAO_PriceSet::checkPermission($this->_sid);
$comps = array(
'Event' => 'civicrm_event',
'Contribution' => 'civicrm_contribution_page',
CRM_Utils_System::appendBreadCrumb(ts('Price'),
$url
);
- $this->assign('usedPriceSetTitle', CRM_Price_BAO_Field::getTitle($fid));
+ $this->assign('usedPriceSetTitle', CRM_Price_BAO_PriceField::getTitle($fid));
}
}
if ($this->_sid) {
- $groupTitle = CRM_Price_BAO_Set::getTitle($this->_sid);
+ $groupTitle = CRM_Price_BAO_PriceSet::getTitle($this->_sid);
$this->assign('sid', $this->_sid);
$this->assign('groupTitle', $groupTitle);
CRM_Utils_System::setTitle(ts('%1 - Price Fields', array(1 => $groupTitle)));
),
CRM_Core_Action::DISABLE => array(
'name' => ts('Disable'),
- 'extra' => 'onclick = "enableDisable( %%oid%%,\'' . 'CRM_Price_BAO_FieldValue' . '\',\'' . 'enable-disable' . '\' );"',
+ 'extra' => 'onclick = "enableDisable( %%oid%%,\'' . 'CRM_Price_BAO_PriceFieldValue' . '\',\'' . 'enable-disable' . '\' );"',
'ref' => 'disable-action',
'title' => ts('Disable Price Option'),
),
CRM_Core_Action::ENABLE => array(
'name' => ts('Enable'),
- 'extra' => 'onclick = "enableDisable( %%oid%%,\'' . 'CRM_Price_BAO_FieldValue' . '\',\'' . 'disable-enable' . '\' );"',
+ 'extra' => 'onclick = "enableDisable( %%oid%%,\'' . 'CRM_Price_BAO_PriceFieldValue' . '\',\'' . 'disable-enable' . '\' );"',
'ref' => 'enable-action',
'title' => ts('Enable Price Option'),
),
*/
function browse() {
$customOption = array();
- CRM_Price_BAO_FieldValue::getValues($this->_fid, $customOption);
+ CRM_Price_BAO_PriceFieldValue::getValues($this->_fid, $customOption);
$config = CRM_Core_Config::singleton();
$financialType = CRM_Contribute_PseudoConstant::financialType();
foreach ($customOption as $id => $values) {
// Add order changing widget to selector
$returnURL = CRM_Utils_System::url('civicrm/admin/price/field/option', "action=browse&reset=1&fid={$this->_fid}&sid={$this->_sid}");
$filter = "price_field_id = {$this->_fid}";
- CRM_Utils_Weight::addOrder($customOption, 'CRM_Price_DAO_FieldValue',
+ CRM_Utils_Weight::addOrder($customOption, 'CRM_Price_DAO_PriceFieldValue',
'id', $returnURL, $filter
);
$params = array();
if ($oid) {
$params['oid'] = $oid;
- $sid = CRM_Price_BAO_Set::getSetId($params);
+ $sid = CRM_Price_BAO_PriceSet::getSetId($params);
- $usedBy = CRM_Price_BAO_Set::getUsedBy($sid);
+ $usedBy = CRM_Price_BAO_PriceSet::getUsedBy($sid);
}
// set the userContext stack
$session = CRM_Core_Session::singleton();
CRM_Utils_System::appendBreadCrumb(ts('Price Option'),
$url
);
- $this->assign('usedPriceSetTitle', CRM_Price_BAO_FieldValue::getOptionLabel($oid));
+ $this->assign('usedPriceSetTitle', CRM_Price_BAO_PriceFieldValue::getOptionLabel($oid));
$this->assign('usedBy', $usedBy);
$comps = array(
"Event" => "civicrm_event",
}
if ($this->_sid) {
- CRM_Price_BAO_Set::checkPermission($this->_sid);
- $this->_isSetReserved= CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'is_reserved');
+ CRM_Price_BAO_PriceSet::checkPermission($this->_sid);
+ $this->_isSetReserved= CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'is_reserved');
$this->assign('isReserved', $this->_isSetReserved);
}
//as url contain $sid so append breadcrumb dynamically.
CRM_Utils_System::appendBreadCrumb($breadcrumb);
if ($this->_fid) {
- $fieldTitle = CRM_Price_BAO_Field::getTitle($this->_fid);
+ $fieldTitle = CRM_Price_BAO_PriceField::getTitle($this->_fid);
$this->assign('fid', $this->_fid);
$this->assign('fieldTitle', $fieldTitle);
CRM_Utils_System::setTitle(ts('%1 - Price Options', array(1 => $fieldTitle)));
- $htmlType = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Field', $this->_fid, 'html_type');
+ $htmlType = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceField', $this->_fid, 'html_type');
$this->assign('addMoreFields', TRUE);
//for text price field only single option present
if ($htmlType == 'Text') {
),
CRM_Core_Action::DISABLE => array(
'name' => ts('Disable'),
- 'extra' => 'onclick = "enableDisable( %%sid%%,\'' . 'CRM_Price_BAO_Set' . '\',\'' . 'enable-disable' . '\' );"',
+ 'extra' => 'onclick = "enableDisable( %%sid%%,\'' . 'CRM_Price_BAO_PriceSet' . '\',\'' . 'enable-disable' . '\' );"',
'ref' => 'disable-action',
'title' => ts('Disable Price Set'),
),
CRM_Core_Action::ENABLE => array(
'name' => ts('Enable'),
- 'extra' => 'onclick = "enableDisable( %%sid%%,\'' . 'CRM_Price_BAO_Set' . '\',\'' . 'disable-enable' . '\' );"',
+ 'extra' => 'onclick = "enableDisable( %%sid%%,\'' . 'CRM_Price_BAO_PriceSet' . '\',\'' . 'disable-enable' . '\' );"',
'ref' => 'enable-action',
'title' => ts('Enable Price Set'),
),
);
if ($sid) {
- CRM_Price_BAO_Set::checkPermission($sid);
+ CRM_Price_BAO_PriceSet::checkPermission($sid);
}
// what action to take ?
if ($action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD)) {
// if action is delete do the needful.
if ($action & (CRM_Core_Action::DELETE)) {
- $usedBy = CRM_Price_BAO_Set::getUsedBy($sid);
+ $usedBy = CRM_Price_BAO_PriceSet::getUsedBy($sid);
if (empty($usedBy)) {
// prompt to delete
// add breadcrumb
$url = CRM_Utils_System::url('civicrm/admin/price', 'reset=1');
CRM_Utils_System::appendBreadCrumb(ts('Price Sets'), $url);
- $this->assign('usedPriceSetTitle', CRM_Price_BAO_Set::getTitle($sid));
+ $this->assign('usedPriceSetTitle', CRM_Price_BAO_PriceSet::getTitle($sid));
$this->assign('usedBy', $usedBy);
$comps = array(
'CiviMember' => ts('Membership'),
);
- $dao = new CRM_Price_DAO_Set();
- if (CRM_Price_BAO_Set::eventPriceSetDomainID()) {
+ $dao = new CRM_Price_DAO_PriceSet();
+ if (CRM_Price_BAO_PriceSet::eventPriceSetDomainID()) {
$dao->domain_id = CRM_Core_Config::domainID();
}
$dao->is_quick_config = 0;
$this, TRUE, 0, 'GET'
);
- CRM_Price_BAO_Set::copy($id);
+ CRM_Price_BAO_PriceSet::copy($id);
CRM_Utils_System::redirect(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'));
}
return array(
'civicrm_price_field_value' =>
array(
- 'dao' => 'CRM_Price_BAO_FieldValue',
+ 'dao' => 'CRM_Price_BAO_PriceFieldValue',
'fields' => array(
'price_field_value_label' =>
array('title' => ts('Price Field Value Label'),
return array(
'civicrm_price_field' =>
array(
- 'dao' => 'CRM_Price_BAO_Field',
+ 'dao' => 'CRM_Price_BAO_PriceField',
'fields' =>
array(
'price_field_label' =>
$priceSetId = $result->price_set_id;
}
else{
- $defaultPriceSets = CRM_Price_BAO_Set::getDefaultPriceSet();
+ $defaultPriceSets = CRM_Price_BAO_PriceSet::getDefaultPriceSet();
foreach ($defaultPriceSets as $key => $pSet) {
if ($pSet['name'] == 'contribution_amount'){
$priceSetId = $pSet['setID'];
CRM_Core_DAO::executeQuery($updateLineItem1);
- $priceFieldDAO = new CRM_Price_DAO_Field();
+ $priceFieldDAO = new CRM_Price_DAO_PriceField();
$priceFieldDAO->find();
$ids = array();
while ($priceFieldDAO->fetch()) {
$fieldValue['count'] = $priceFieldDAO->count;
}
- $fieldValueDAO = CRM_Price_BAO_FieldValue::add($fieldValue, $ids);
+ $fieldValueDAO = CRM_Price_BAO_PriceFieldValue::add($fieldValue, $ids);
$lineItemDAO = new CRM_Price_DAO_LineItem();
$lineItemDAO->option_group_id = $opGroupDAO->id;
'CRM_Contribute_DAO_ContributionProduct' => NULL,
'CRM_Contribute_DAO_Widget' => 'is_active = 1',
'CRM_Core_DAO_Discount' => NULL,
- 'CRM_Price_DAO_SetEntity' => NULL,
+ 'CRM_Price_DAO_PriceSetEntity' => NULL,
'CRM_Core_DAO_UFGroup' => 'is_active = 1',
'CRM_Event_DAO_Event' => 'is_active = 1',
'CRM_Event_DAO_Participant' => 'is_test = 0',
$ids['id'] = $params['id'];
}
- $bao = CRM_Price_BAO_FieldValue::create($params, $ids);
+ $bao = CRM_Price_BAO_PriceFieldValue::create($params, $ids);
$values = array();
_civicrm_api3_object_to_array($bao, $values[$bao->id]);
foreach ($entityId as $eid) {
$eid = (int) trim($eid);
if ($eid) {
- CRM_Price_BAO_Set::addTo($params['entity_table'], $eid, $result['id']);
+ CRM_Price_BAO_PriceSet::addTo($params['entity_table'], $eid, $result['id']);
}
}
}
$result = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE);
// Fetch associated entities
foreach ($result as &$item) {
- $item['entity'] = CRM_Price_BAO_Set::getUsedBy($item['id'], 'entity');
+ $item['entity'] = CRM_Price_BAO_PriceSet::getUsedBy($item['id'], 'entity');
}
return civicrm_api3_create_success($result, $params);
}
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 720,
+ 'id' => 722,
'values' => array(
- '720' => array(
- 'id' => '720',
+ '722' => array(
+ 'id' => '722',
'option_group_id' => '2',
'label' => 'send out letters',
'value' => '46',
*/
function activity_type_delete_example(){
$params = array(
- 'activity_type_id' => 722,
+ 'activity_type_id' => 724,
'version' => 3,
);
'frequency_interval' => '1',
'installments' => '12',
'start_date' => '20120101000000',
- 'create_date' => '20130622083552',
+ 'create_date' => '20130713234826',
'modified_date' => '2012-11-14 16:02:35',
'cancel_date' => '',
'end_date' => '',
'frequency_interval' => '1',
'installments' => '12',
'start_date' => '2012-01-01 00:00:00',
- 'create_date' => '2013-06-22 08:35:53',
+ 'create_date' => '2013-07-13 23:48:27',
'contribution_status_id' => '1',
'is_test' => 0,
'cycle_day' => '1',
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 15,
+ 'id' => 3,
'values' => array(
- '15' => array(
- 'id' => '15',
+ '3' => array(
+ 'id' => '3',
'domain_id' => '',
'name' => 'default_goat_priceset',
'title' => 'Goat accessories',
function price_set_delete_example(){
$params = array(
'version' => 3,
- 'id' => 17,
+ 'id' => 5,
);
$result = civicrm_api( 'price_set','delete',$params );
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 16,
+ 'id' => 4,
'values' => array(
- '16' => array(
- 'id' => '16',
+ '4' => array(
+ 'id' => '4',
'domain_id' => '',
'name' => 'event price',
'title' => 'event price',
$name = 'Contact';
}
- //hack to deal with incorrectly named BAO/DAO - see CRM-10859 - remove after rename
- if($name == 'price_set' || $name == 'PriceSet'){
- return 'CRM_Price_DAO_Set';
- }
- if($name == 'price_field' || $name == 'PriceField'){
- return 'CRM_Price_DAO_Field';
- }
- if($name == 'price_field_value' || $name == 'PriceFieldValue'){
- return 'CRM_Price_DAO_FieldValue';
- }
- // these aren't listed on ticket CRM-10859 - but same problem - lack of standardisation
- if($name == 'mailing_job' || $name == 'MailingJob'){
- return 'CRM_Mailing_BAO_Job';
- }
+ //hack to deal with incorrectly named BAO/DAO - see CRM-10859 -
+ // several of these have been removed but am not confident mailing_recipients is
+ // tests so have not tackled.
+ // correct approach for im is unclear
if($name == 'mailing_recipients' || $name == 'MailingRecipients'){
return 'CRM_Mailing_BAO_Recipients';
}
$mailing->is_completed = 1;
$mailing->save();
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->mailing_id = $mailing->id;
$job->scheduled_date = generateRandomDate();
$job->start_date = generateRandomDate();
'sample' => 'Public',
),
),
- 'CRM_Price_DAO_Field' => array(
+ 'CRM_Price_DAO_PriceField' => array(
array(
'fieldName' => 'visibility_id',
'sample' => 'Public',
$paramsSet['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$paramsSet['extends'] = 1;
- $priceset = CRM_Price_BAO_Set::create($paramsSet);
+ $priceset = CRM_Price_BAO_PriceSet::create($paramsSet);
//Checking for priceset added in the table.
- $this->assertDBCompareValue('CRM_Price_BAO_Set', $priceset->id, 'title',
+ $this->assertDBCompareValue('CRM_Price_BAO_PriceSet', $priceset->id, 'title',
'id', $paramsSet['title'], 'Check DB for created priceset'
);
$paramsField = array(
);
$ids = array();
- $pricefield = CRM_Price_BAO_Field::create($paramsField, $ids);
+ $pricefield = CRM_Price_BAO_PriceField::create($paramsField, $ids);
//Checking for priceset added in the table.
- $this->assertDBCompareValue('CRM_Price_BAO_Field', $pricefield->id, 'label',
+ $this->assertDBCompareValue('CRM_Price_BAO_PriceField', $pricefield->id, 'label',
'id', $paramsField['label'], 'Check DB for created pricefield'
);
CRM_Event_BAO_Participant::fixEventLevel($values[$participant->id]['fee_level']);
}
- $deletePricefield = CRM_Price_BAO_Field::deleteField($pricefield->id);
- $this->assertDBNull('CRM_Price_BAO_Field', $pricefield->id, 'name',
+ $deletePricefield = CRM_Price_BAO_PriceField::deleteField($pricefield->id);
+ $this->assertDBNull('CRM_Price_BAO_PriceField', $pricefield->id, 'name',
'id', 'Check DB for non-existence of Price Field.'
);
- $deletePriceset = CRM_Price_BAO_Set::deleteSet($priceset->id);
- $this->assertDBNull('CRM_Price_BAO_Set', $priceset->id, 'title',
+ $deletePriceset = CRM_Price_BAO_PriceSet::deleteSet($priceset->id);
+ $this->assertDBNull('CRM_Price_BAO_PriceSet', $priceset->id, 'title',
'id', 'Check DB for non-existence of Price Set.'
);
- CRM_Mailing_BAO_Job::runJobs();
+ CRM_Mailing_BAO_MailingJob::runJobs();
sleep($config->mailerPeriod);
}
}
else {
- CRM_Mailing_BAO_Job::runJobs();
+ CRM_Mailing_BAO_MailingJob::runJobs();
}
<table>
<base>CRM/Mailing</base>
- <class>Job</class>
+ <class>MailingJob</class>
<name>civicrm_mailing_job</name>
<comment>Stores information about the job that executes this mailing</comment>
<archive>true</archive>
<xi:include href="Mailing.xml" parse="xml" />
<xi:include href="MailingGroup.xml" parse="xml" />
<xi:include href="TrackableURL.xml" parse="xml" />
-<xi:include href="Job.xml" parse="xml" />
+<xi:include href="MailingJob.xml" parse="xml" />
<xi:include href="Recipients.xml" parse="xml" />
<xi:include href="BounceType.xml" parse="xml" />
<xi:include href="BouncePattern.xml" parse="xml" />
<table>
<base>CRM/Price</base>
- <class>Field</class>
+ <class>PriceField</class>
<name>civicrm_price_field</name>
<add>1.8</add>
<log>true</log>
<table>
<base>CRM/Price</base>
- <class>FieldValue</class>
+ <class>PriceFieldValue</class>
<name>civicrm_price_field_value</name>
<add>3.3</add>
<field>
<table>
<base>CRM/Price</base>
- <class>Set</class>
+ <class>PriceSet</class>
<name>civicrm_price_set</name>
<add>1.8</add>
<log>true</log>
<table>
<base>CRM/Price</base>
- <class>SetEntity</class>
+ <class>PriceSetEntity</class>
<name>civicrm_price_set_entity</name>
<add>1.8</add>
<log>true</log>
<?xml version="1.0" encoding="iso-8859-1" ?>
<tables xmlns:xi="http://www.w3.org/2001/XInclude">
-<xi:include href="Field.xml" parse="xml" />
-<xi:include href="FieldValue.xml" parse="xml" />
+<xi:include href="PriceField.xml" parse="xml" />
+<xi:include href="PriceFieldValue.xml" parse="xml" />
<xi:include href="LineItem.xml" parse="xml" />
-<xi:include href="Set.xml" parse="xml" />
-<xi:include href="SetEntity.xml" parse="xml" />
+<xi:include href="PriceSet.xml" parse="xml" />
+<xi:include href="PriceSetEntity.xml" parse="xml" />
</tables>