Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
CiviDiscount
Commits
3e7014b8
Commit
3e7014b8
authored
Jul 22, 2014
by
Keith Morgan
Browse files
Backported
8f6a4cac
to 4.4.
parent
1c47efee
Changes
1
Hide whitespace changes
Inline
Side-by-side
CRM/CiviDiscount/Utils.php
View file @
3e7014b8
...
...
@@ -65,9 +65,13 @@ class CRM_CiviDiscount_Utils {
static
function
getPriceSetsInfo
(
$priceSetId
=
null
)
{
$params
=
array
();
$psTableName
=
'civicrm_price_set_entity'
;
if
(
$priceSetId
)
{
$additionalWhere
=
'ps.id = %1'
;
$params
=
array
(
1
=>
array
(
$priceSetId
,
'Positive'
));
if
(
CRM_Core_DAO
::
getFieldValue
(
'CRM_Core_DAO_Discount'
,
$priceSetId
,
'id'
,
'price_set_id'
))
{
$psTableName
=
'civicrm_discount'
;
}
}
else
{
$additionalWhere
=
'ps.is_quick_config = 0'
;
...
...
@@ -82,7 +86,7 @@ SELECT pfv.id as item_id,
FROM civicrm_price_field_value as pfv
LEFT JOIN civicrm_price_field as pf on (pf.id = pfv.price_field_id)
LEFT JOIN civicrm_price_set as ps on (ps.id = pf.price_set_id AND ps.is_active = 1)
INNER JOIN
civicrm_price_set_entity
as pse on (ps.id = pse.price_set_id)
INNER JOIN
{
$psTableName
}
as pse on (ps.id = pse.price_set_id)
WHERE
{
$additionalWhere
}
ORDER BY pf_label, pfv.price_field_id, pfv.weight
"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment