Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20297 Display contribution having line items with no price set #10012

Merged
merged 4 commits into from
May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions CRM/Contribute/Form/ContributionView.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,23 @@ public function preProcess() {
if ($id) {
$lineItems = array(CRM_Price_BAO_LineItem::getLineItemsByContributionID(($id)));
$firstLineItem = reset($lineItems[0]);
$priceSet = civicrm_api3('PriceSet', 'getsingle', array('id' => $firstLineItem['price_set_id'], 'return' => 'is_quick_config, id'));
$displayLineItems = !$priceSet['is_quick_config'];
if (empty($firstLineItem['price_set_id'])) {
// CRM-20297 All we care is that it's not QuickConfig, so no price set
// is no problem.
$displayLineItems = TRUE;
}
else {
try {
$priceSet = civicrm_api3('PriceSet', 'getsingle', array(
'id' => $firstLineItem['price_set_id'],
'return' => 'is_quick_config, id',
));
$displayLineItems = !$priceSet['is_quick_config'];
}
catch (CiviCRM_API3_Exception $e) {
throw new CRM_Core_Exception('Cannot find price set by ID');
}
}
}
$this->assign('lineItem', $lineItems);
$this->assign('displayLineItems', $displayLineItems);
Expand Down Expand Up @@ -242,14 +257,13 @@ public function preProcess() {
public function buildQuickForm() {

$this->addButtons(array(
array(
'type' => 'cancel',
'name' => ts('Done'),
'spacing' => '         ',
'isDefault' => TRUE,
),
)
);
array(
'type' => 'cancel',
'name' => ts('Done'),
'spacing' => '         ',
'isDefault' => TRUE,
),
));
}

}
4 changes: 2 additions & 2 deletions templates/CRM/Contribute/Form/Contribution/Confirm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<strong> -------------------------------------------</strong><br />
{ts}Total{/ts}: <strong>{$amount+$minimum_fee|crmMoney}</strong><br />
{elseif $amount }
{ts}Amount{/ts}: <strong>{$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}</strong>
{ts}Amount{/ts}: <strong>{$amount|crmMoney} {if $amount_level } &ndash; {$amount_level} {/if}</strong>
{else}
{$membership_name} {ts}Membership{/ts}: <strong>{$minimum_fee|crmMoney}</strong>
{/if}
Expand All @@ -79,7 +79,7 @@
{ts}Total Tax Amount{/ts}: <strong>{$totalTaxAmount|crmMoney} </strong><br />
{/if}
{if $amount}
{if $installments}{ts}Installment Amount{/ts}{else}{ts}Total Amount{/ts}{/if} : <strong>{$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}</strong>
{if $installments}{ts}Installment Amount{/ts}{else}{ts}Total Amount{/ts}{/if}: <strong>{$amount|crmMoney}{if $amount_level } &ndash; {$amount_level}{/if}</strong>
{else}
{$membership_name} {ts}Membership{/ts}: <strong>{$minimum_fee|crmMoney}</strong>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ CRM.$(function($) {
<span class="bold">{$row.name} &nbsp;
{if ($membershipBlock.display_min_fee AND $context EQ "makeContribution") AND $row.minimum_fee GT 0 }
{if $is_separate_payment OR ! $form.amount.label}
- {$row.minimum_fee|crmMoney}
&ndash; {$row.minimum_fee|crmMoney}
{else}
{ts 1=$row.minimum_fee|crmMoney}(contribute at least %1 to be eligible for this membership){/ts}
{/if}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/Contribution/ThankYou.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{if $totalTaxAmount}
{ts}Tax Amount{/ts}: <strong>{$totalTaxAmount|crmMoney}</strong><br />
{/if}
{if $installments}{ts}Installment Amount{/ts}{else}{ts}Amount{/ts}{/if} : <strong>{$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}</strong>
{if $installments}{ts}Installment Amount{/ts}{else}{ts}Amount{/ts}{/if}: <strong>{$amount|crmMoney}{if $amount_level } &ndash; {$amount_level}{/if}</strong>
{/if}
{/if}
{if $receive_date}
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Contribute/Form/ContributionPage/Amount.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{crmRegion name="contribute-form-contributionpage-amount-main"}
<div class="crm-block crm-form-block crm-contribution-contributionpage-amount-form-block">
<div class="help">
{ts}Use this form to configure Contribution Amount options. You can give contributors the ability to enter their own contribution amounts - and/or provide a fixed list of amounts. For fixed amounts, you can enter a label for each 'level' of contribution (e.g. Friend, Sustainer, etc.). If you allow people to enter their own dollar amounts, you can also set minimum and maximum values. Depending on your choice of Payment Processor, you may be able to offer a recurring contribution option.{/ts} {docURL page="user/contributions/payment-processors"}
{ts}Use this form to configure Contribution Amount options. You can give contributors the ability to enter their own contribution amounts and/or provide a fixed list of amounts. For fixed amounts, you can enter a label for each 'level' of contribution (e.g. Friend, Sustainer, etc.). If you allow people to enter their own dollar amounts, you can also set minimum and maximum values. Depending on your choice of Payment Processor, you may be able to offer a recurring contribution option.{/ts} {docURL page="user/contributions/payment-processors"}
</div>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
{if !$paymentProcessor}
Expand Down Expand Up @@ -76,7 +76,7 @@
<tr class="crm-contribution-contributionpage-amount-form-block-amount_block_is_active">
<th scope="row" class="label">{$form.amount_block_is_active.label}</th>
<td>{$form.amount_block_is_active.html}<br />
<span class="description">{ts}Uncheck this box if you are using this contribution page for membership signup and renewal only - and you do NOT want users to select or enter any additional contribution amounts.{/ts}</span></td>
<span class="description">{ts}Uncheck this box if you are using this contribution page for membership signup and renewal only &ndash; and you do NOT want users to select or enter any additional contribution amounts.{/ts}</span></td>
</tr>
<tr id="priceSet" class="crm-contribution-contributionpage-amount-form-block-priceSet">
<th scope="row" class="label">{$form.price_set_id.label}</th>
Expand Down Expand Up @@ -423,7 +423,7 @@
function setDateDefaults() {
{/literal}{if !$pledge_calendar_date}{literal}
cj('#pledge_calendar_date').prop('disabled', 'disabled');
cj("#pledge_calendar_date").next('input').prop('disabled', 'disabled');
cj("#pledge_calendar_date").next('input').prop('disabled', 'disabled');
{/literal}{/if}

{if !$pledge_calendar_month}{literal}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/ContributionPage/Custom.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{/htxt}
{htxt id="contrib-profile"}
<p>
{ts}If you want collect additional information from contributors, you can include one or two CiviCRM Profiles - which are collections of standard or custom fields - in this contribution page. For example, you may need to collect information about the person (e.g. name and address if these are not already required by your payment processor, interest in subscribing to a newsletter or volunteering). You might also want to collect information specific to this contribution (e.g. target one or several projects or funds to support with this contribution).{/ts}
{ts}If you want collect additional information from contributors, you can include one or two CiviCRM Profiles&mdash;which are collections of standard or custom fields&mdash;in this contribution page. For example, you may need to collect information about the person (e.g. name and address if these are not already required by your payment processor, interest in subscribing to a newsletter or volunteering). You might also want to collect information specific to this contribution (e.g. target one or several projects or funds to support with this contribution).{/ts}
</p>
<p>
{ts}Your site may already have profile(s) which were previously created for this purpose, in which case you can re-use them for any number of online contribution pages.{/ts}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/ContributionPage/PCP.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{/htxt}
{htxt id="id-supporter_profile"}
{capture assign="createProfileURL"}{crmURL p="civicrm/admin/uf/group" q="reset=1"}{/capture}
{ts 1=$createProfileURL}This is used to collect or update basic information (e.g. name and email address) from users while they are creating a Personal Campaign Page. The profile you select must be configured with 'Account creation required' (under Profile Settings &raquo; Advanced Settings). You must include an Email address field - and you may include any number of other fields in the profile. If you don't yet have an appropriate Profile configured, you will need to <a href='%1'>create one first</a>, and then return to this form to select it.{/ts}
{ts 1=$createProfileURL}This is used to collect or update basic information (e.g. name and email address) from users while they are creating a Personal Campaign Page. The profile you select must be configured with 'Account creation required' (under Profile Settings &raquo; Advanced Settings). You must include an Email address field&mdash;and you may include any number of other fields in the profile. If you don't yet have an appropriate Profile configured, you will need to <a href='%1'>create one first</a>, and then return to this form to select it.{/ts}
{/htxt}

{htxt id="id-is_tellfriend-title"}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/ContributionPage/Premium.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</td>
<td class="html-adjust">{$form.premiums_intro_text.html}<br/>
<span class="description">
{ts}Enter content for the introductory message. This will be displayed below the Premiums section title. You may include HTML formatting tags. You can also include images, as long as they are already uploaded to a server - reference them using complete URLs.{/ts}
{ts}Enter content for the introductory message. This will be displayed below the Premiums section title. You may include HTML formatting tags. You can also include images, as long as they are already uploaded to a server&mdash;reference them using complete URLs.{/ts}
</span>
</td>
</tr>
Expand Down
3 changes: 1 addition & 2 deletions templates/CRM/Contribute/Form/ContributionPage/Settings.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{ts}Intro Content{/ts}
{/htxt}
{htxt id="id-intro_msg"}
{ts}Enter content for the introductory message. This will be displayed below the page title. You can include images, as long as they are already uploaded to a server - click the "Image" button in the button bar.{/ts}
{ts}Enter content for the introductory message. This will be displayed below the page title. You can include images, as long as they are already uploaded to a server: click the "Image" button in the button bar.{/ts}
{/htxt}

{htxt id="id-footer_msg-title"}
Expand Down Expand Up @@ -83,4 +83,3 @@
<p>{ts}When enabled, links allowing people to share this online contribution page with their social network will be displayed (e.g. Facebook "Like", Google+, and Twitter).{/ts}</p>
<p>{ts}Social media links will be included on the Contribution Thank-you page, Tell-a-Friend page (if enabled), and in contribution receipt emails.{/ts}</p>
{/htxt}

10 changes: 5 additions & 5 deletions templates/CRM/Contribute/Form/ContributionPage/Tab.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/amount' q="reset=1&action=update&id=`$contributionPageID`"}" id="idAmount">&raquo; {ts}Amount{/ts}</a></td>
<td>{ts}Use this form to configure Contribution Amount options. You can give contributors the ability to enter their own contribution amounts - and/or provide a fixed list of amounts. For fixed amounts, you can enter a label for each 'level' of contribution (e.g. Friend, Sustainer, etc.). If you allow people to enter their own dollar amounts, you can also set minimum and maximum values. Depending on your choice of Payment Processor, you may be able to offer a recurring contribution option.{/ts}</td>
<td>{ts}Use this form to configure Contribution Amount options. You can give contributors the ability to enter their own contribution amounts and/or provide a fixed list of amounts. For fixed amounts, you can enter a label for each 'level' of contribution (e.g. Friend, Sustainer, etc.). If you allow people to enter their own dollar amounts, you can also set minimum and maximum values. Depending on your choice of Payment Processor, you may be able to offer a recurring contribution option.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/membership' q="reset=1&action=update&id=`$contributionPageID`"}" id="idMembership">&raquo; {ts}Memberships{/ts}</a></td>
<td>{ts}Use this form to enable and configure a Membership Signup and Renewal section for this Online Contribution Page. If you're not using this page for membership signup, leave the Enabled box un-checked.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/thankYou' q="reset=1&action=update&id=`$contributionPageID`"}" id="idThanks">&raquo; {ts}Thank-you and Receipting{/ts}</a></td>
<td>{ts}Use this form to configure the thank-you message and receipting options. Contributors will see a confirmation and thank-you page after whenever an online contribution is successfully processed. You provide the content and layout of the thank-you section below. You also control whether an electronic receipt is automatically emailed to each contributor - and can add a custom message to that receipt.{/ts}</td>
<td>{ts}Use this form to configure the thank-you message and receipting options. Contributors will see a confirmation and thank-you page after whenever an online contribution is successfully processed. You provide the content and layout of the thank-you section below. You also control whether an electronic receipt is automatically emailed to each contributor, and you can add a custom message to that receipt.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/friend' q="reset=1&action=update&id=`$contributionPageID`"}" id="idFriend">&raquo; {ts}Tell a Friend{/ts}</a></td>
Expand All @@ -52,23 +52,23 @@
<td><a href="{crmURL p='civicrm/admin/contribute/custom' q="reset=1&action=update&id=`$contributionPageID`"}" id="idCustom">&raquo; {ts}Include Profiles{/ts}</a></td>
<td>{ts}You may want to collect information from contributors beyond what is required to make a contribution. For example, you may want to inquire about volunteer availability and skills. Add any number of fields to your contribution form by selecting CiviCRM Profiles (collections of fields) to include at the beginning of the page, and/or at the bottom.{/ts}<br />
{capture assign=adminGroupURL}{crmURL p="civicrm/admin/uf/group" q="reset=1&action=browse"}{/capture}
{ts 1=$adminGroupURL}You can use existing CiviCRM Profiles on your page - OR create profile(s) specifically for use in Online Contribution pages. Go to <a href="%1"><strong>Administer CiviCRM Profiles</strong></a> if you need to review, modify or create profiles (you can come back at any time to select or update the Profile(s) used for this page).{/ts}</td>
{ts 1=$adminGroupURL}You can use existing CiviCRM Profiles on your page or create profile(s) specifically for use in Online Contribution pages. Go to <a href="%1"><strong>Administer CiviCRM Profiles</strong></a> if you need to review, modify or create profiles (you can come back at any time to select or update the Profile(s) used for this page).{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/premium q="reset=1&action=update&id=`$contributionPageID`"}" id="idPremium">&raquo; {ts}Premiums{/ts}</a></td>
<td>{ts}Enable the Premiums section for this Online Contribution Page, and customize the title and introductory message (e.g ...in appreciation of your support, you will be able to select from a number of exciting thank-you gifts...). You can optionally provide a contact email address and/or phone number for inquiries. Then select and review the premiums that you want to offer on this contribution page.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/widget' q="reset=1&action=update&id=`$contributionPageID`"}" id="idWidget">&raquo; {ts}Widget{/ts}</a></td>
<td>{ts}Widgets allow you and your supporters to easily promote this fund-raising campaign. Widget code can be added to any web page - and will provide a real-time display of current contribution results, and a direct link to this contribution page.{/ts}</td>
<td>{ts}Widgets allow you and your supporters to easily promote this fund-raising campaign. Widget code can be added to any web page. They will provide a real-time display of current contribution results, and a direct link to this contribution page.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/admin/contribute/pcp' q="reset=1&action=update&id=`$contributionPageID`"}" id="idPCP">&raquo; {ts}Personal Campaign Pages{/ts}</a></td>
<td>{ts}Allow constituents to create their own personal fundraising pages linked to this contribution page.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/contribute/transact' q="reset=1&action=preview&id=`$contributionPageID`"}" id="idTest">&raquo; {ts}Online Contribution{/ts}</a><br /> ({ts}Test-drive{/ts})</td>
<td>{ts}Test-drive the entire contribution process - including custom fields, confirmation, thank-you page, and receipting. Transactions will be directed to your payment processor's test server. No live financial transactions will be submitted. However, a contact record will be created or updated and a test contribution record will be saved to the database. Use obvious test contact names so you can review and delete these records as needed. Test contributions are not visible on the Contributions tab, but can be viewed by searching for 'Test Contributions' in the CiviContribute search form.{/ts}</td>
<td>{ts}Test-drive the entire contribution process&mdash;including custom fields, confirmation, thank-you page, and receipting. Transactions will be directed to your payment processor's test server. No live financial transactions will be submitted. However, a contact record will be created or updated and a test contribution record will be saved to the database. Use obvious test contact names so you can review and delete these records as needed. Test contributions are not visible on the Contributions tab, but can be viewed by searching for 'Test Contributions' in the CiviContribute search form.{/ts}</td>
</tr>
<tr>
<td><a href="{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$contributionPageID`"}" id="idLive">&raquo; {ts}Online Contribution{/ts}</a><br /> ({ts}Live{/ts})</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{ts}Thank-you and Receipting{/ts}
{/htxt}
{htxt id="id_thank"}
<p>{ts}Use this form to configure the thank-you message and receipting options for this online contribution page. Contributors will see a thank-you page whenever an online contribution is successfully processed. You provide the content and layout of the thank-you section below. You also control whether an electronic receipt is automatically emailed to each contributor - and can add a custom message to that receipt.{/ts}</p>
<p>{ts}Use this form to configure the thank-you message and receipting options for this online contribution page. Contributors will see a thank-you page whenever an online contribution is successfully processed. You provide the content and layout of the thank-you section below. You also control whether an electronic receipt is automatically emailed to each contributor, and you can add a custom message to that receipt.{/ts}</p>
{/htxt}

{htxt id="id_thankyou-title-title"}
Expand Down
Loading