public function browse() {
$customOption = array();
CRM_Price_BAO_PriceFieldValue::getValues($this->_fid, $customOption);
+
+ // CRM-15378 - check if these price options are in an Event price set
+ $isEvent = FALSE;
+ $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
+ $allComponents = explode(CRM_Core_DAO::VALUE_SEPARATOR, $extendComponentId);
+ $eventComponentId = CRM_Core_Component::getComponentID('CiviEvent');
+ if (in_array($eventComponentId, $allComponents)) {
+ $isEvent = TRUE;
+ }
+
$config = CRM_Core_Config::singleton();
$financialType = CRM_Contribute_PseudoConstant::financialType();
$taxRate = CRM_Core_PseudoConstant::getTaxRates();
$this->assign('getTaxDetails', $getTaxDetails);
$this->assign('customOption', $customOption);
$this->assign('sid', $this->_sid);
+ $this->assign('isEvent', $isEvent);
}
/**
<tr>
<th>{ts}Option Label{/ts}</th>
<th>{ts}Option Amount{/ts}</th>
+ {if $isEvent}
+ <th>{ts}Participant Count{/ts}</th>
+ <th>{ts}Maximum{/ts}</th>
+ {/if}
<th>{ts}Default{/ts}</th>
<th>{ts}Financial Type{/ts}</th>
<th>{ts}Order{/ts}</th>
<tr id="price_field_value-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
<td class="crm-price-option-label crm-editable" data-field="label">{$row.label}</td>
<td class="crm-price-option-value">{$row.amount|crmMoney}</td>
+ {if $isEvent}
+ <td class="crm-price-option-count">{$row.count}</td>
+ <td class="crm-price-option-max">{$row.max_value}</td>
+ {/if}
<td class="crm-price-option-is_default">{if $row.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}</td>
<td class="nowrap crm-price-option-financial-type-id">{$row.financial_type_id}</td>
<td class="nowrap crm-price-option-order">{$row.weight}</td>