CRM_Core_Error::deprecatedFunctionWarning('forms require a price set ID');
}
$this->_priceSet = $this->get('priceSet');
-
+ $this->assign('quickConfig', $this->isQuickConfig());
if (!$this->_values) {
// get all the values from the dao object
$this->_values = [];
));
$this->assignPaymentProcessor($isPayLater);
- $this->assign('quickConfig', $this->isQuickConfig());
// get price info
// CRM-5095
$this->initSet($this);
$priceSetID = $this->getPriceSetID();
if ($priceSetID) {
self::initEventFee($this, $this->_eventId, TRUE, $priceSetID);
+ $this->assign('quickConfig', $this->isQuickConfig());
}
// get the profile ids
CRM_Core_Error::deprecatedWarning('this should not be reachable');
return;
}
- //check if price set is is_config
- if (is_numeric($priceSetId)) {
- if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
- $form->assign('quickConfig', 1);
- }
- else {
- $form->assign('quickConfig', 0);
- }
- }
+
// get price info
if ($priceSetId) {
if ($form->_action & CRM_Core_Action::UPDATE) {
return $this->_priceSetId ?: NULL;
}
+ /**
+ * Is the price set quick config.
+ *
+ * @return bool
+ */
+ public function isQuickConfig(): bool {
+ return $this->getPriceSetID() && CRM_Price_BAO_PriceSet::isQuickConfig($this->getPriceSetID());
+ }
+
}
*/
public static function initSet(&$form, $entityTable = 'civicrm_event', $doNotIncludeExpiredFields = FALSE, $priceSetId = NULL) {
CRM_Core_Error::deprecatedFunctionWarning('no alternative');
- //check if price set is is_config
- if (is_numeric($priceSetId)) {
- if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
- $form->assign('quickConfig', 1);
- }
- }
+
// get price info
if ($priceSetId) {
if ($form->_action & CRM_Core_Action::UPDATE) {
$priceSet = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
$form->_priceSet = $priceSet[$priceSetId] ?? NULL;
$validPriceFieldIds = array_keys($form->_priceSet['fields']);
- $form->assign('quickConfig', (int) CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config'));
// Mark which field should have the auto-renew checkbox, if any. CRM-18305
if (!empty($form->_membershipTypeValues) && is_array($form->_membershipTypeValues)) {
{* this template is used for adding/editing/deleting contributions and pledge payments *}
{if $priceSetId}
- {include file="CRM/Price/Form/PriceSet.tpl" context="standalone" extends="Contribution"}
+ {include file="CRM/Price/Form/PriceSet.tpl" context="standalone" extends="Contribution" hideTotal=false}
{elseif !empty($showAdditionalInfo) and !empty($formType)}
{include file="CRM/Contribute/Form/AdditionalInfo/$formType.tpl"}
{else}
{/if}
{else}
<div id="priceset-div">
- {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
+ {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution" hideTotal=$quickConfig}
</div>
{/if}
{/if}
{/foreach}
{/if}
- {include file="CRM/Price/Form/PriceSet.tpl" extends="Membership"}
+ {include file="CRM/Price/Form/PriceSet.tpl" extends="Membership" hideTotal=$quickConfig}
</fieldset>
</div>
{literal}
<fieldset id="priceset" class="crm-group priceset-group">
<tr class="crm-event-eventfees-form-block-price_set_amount">
<td class="label" style="padding-top: 10px;">{$form.amount.label}</td>
- <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}</td>
+ <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" hideTotal=false}</td>
</fieldset>
{else}
{assign var=isRecordPayment value=0 }
<table class='form-layout'>
<tr class="crm-event-eventfees-form-block-price_set_amount">
<td class="label" style="padding-top: 10px;">{$form.amount.label}</td>
- <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" noCalcValueDisplay=0 context="participant"}</table></td>
+ <td class="view-value"><table class="form-layout">{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" hideTotal=false context="participant"}</table></td>
</tr>
{if $paymentInfo}
<tr><td></td><td>
</div>
<div class='label'><strong>{ts}Balance Owed{/ts}</strong></div><div class='content'><strong id='balance-fee'></strong></div>
</div>
- {include file='CRM/Price/Form/Calculate.tpl' currencySymbol=$currencySymbol noCalcValueDisplay=1 displayOveride='true'}
+ {include file='CRM/Price/Form/Calculate.tpl' currencySymbol=$currencySymbol hideTotal=1 displayOveride='true'}
{/if}
</table>
</fieldset>
<div class="crm-event-id-{$event.id} crm-block crm-event-additionalparticipant-form-block">
{if $priceSet}
<fieldset id="priceset" class="crm-public-form-item crm-group priceset-group"><legend>{$event.fee_label}</legend>
- {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}
+ {include file="CRM/Price/Form/PriceSet.tpl" extends="Event" hideTotal=false}
</fieldset>
{else}
{if $paidEvent}
{if $priceSet}
{if ! $quickConfig}<fieldset id="priceset" class="crm-public-form-item crm-group priceset-group">
<legend>{$event.fee_label}</legend>{/if}
- {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"}
+ {include file="CRM/Price/Form/PriceSet.tpl" extends="Event" hideTotal=$quickConfig}
{include file="CRM/Price/Form/ParticipantCount.tpl"}
{if ! $quickConfig}</fieldset>{/if}
{/if}
{/if}
<div class="spacer"></div>
{if $priceSetId}
- {include file="CRM/Price/Form/PriceSet.tpl" context="standalone" extends="Membership"}
+ {include file="CRM/Price/Form/PriceSet.tpl" context="standalone" extends="Membership" hideTotal=false}
{literal}
<script type="text/javascript">
CRM.$(function($) {
<span id='totalAmountORPriceSet'> {ts}OR{/ts}</span>
<span id='selectPriceSet'>{$form.price_set_id.html}</span>
{if $buildPriceSet && $priceSet}
- <div id="priceset"><br/>{include file="CRM/Price/Form/PriceSet.tpl" extends="Membership"}</div>
+ <div id="priceset"><br/>{include file="CRM/Price/Form/PriceSet.tpl" extends="Membership" hideTotal=false}</div>
{else}
<div id="priceset" class="hiddenElement"></div>
{/if}
+--------------------------------------------------------------------+
*}
-{assign var='hideTotal' value=$quickConfig+$noCalcValueDisplay}
-
<div id="pricesetTotal" class="crm-section section-pricesetTotal">
<div id="pricelabel" class="label {if $hideTotal}hiddenElement{/if}">
{if ($extends eq 'Contribution') || ($extends eq 'Membership')}
{foreach from=$groupTree item=priceSet key=group_id}
<fieldset>
{if $preview_type eq 'group'}<legend>{$setTitle}</legend>{/if}
- {include file="CRM/Price/Form/PriceSet.tpl"}
+ {include file="CRM/Price/Form/PriceSet.tpl" hideTotal=false}
</fieldset>
{/foreach}
{/strip}