-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#4248 - Fix missing price-set usage table #26090
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,11 @@ | |
| and copyright information, see https://civicrm.org/licensing | | ||
+--------------------------------------------------------------------+ | ||
*} | ||
{* The price field can be used somewhere but not necessarily in a page/event. In that case we still want to display some message. *} | ||
{assign var='showGenericMessage' value=true} | ||
{foreach from=$contexts item=context} | ||
{if $context EQ "Event"} | ||
{assign var='showGenericMessage' value=false} | ||
{if $action eq 8} | ||
{ts}If you no longer want to use this price set, click the event title below, and modify the fees for that event.{/ts} | ||
{else} | ||
|
@@ -34,6 +37,7 @@ | |
</table> | ||
{/if} | ||
{if $context EQ "Contribution"} | ||
{assign var='showGenericMessage' value=false} | ||
{if $action eq 8} | ||
{ts}If you no longer want to use this price set, click the contribution page title below, and modify the Amounts or Membership tab configuration.{/ts} | ||
{else} | ||
|
@@ -57,6 +61,7 @@ | |
</table> | ||
{/if} | ||
{if $context EQ "EventTemplate"} | ||
{assign var='showGenericMessage' value=false} | ||
{if $action eq 8} | ||
{ts}If you no longer want to use this price set, click the event template title below, and modify the fees for that event.{/ts} | ||
{else} | ||
|
@@ -79,3 +84,9 @@ | |
</table> | ||
{/if} | ||
{/foreach} | ||
{if $showGenericMessage} | ||
{if $action neq 8} | ||
{* We don't have to do anything for delete action because the calling tpl already displays something. *} | ||
{ts}This price set is used by at least one contribution, but is not used by any active events or contribution pages or event templates.{/ts} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically could be a contribution or participant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @larssandergreen. I tried to re-use the wording that was used in all the other messages. And in the future it might be even more things, which is also one reason I was trying to get rid of the hardcode of all the possible array keys in multiple places (e.g. the addition of event template missed some places, so it would likely happen again). I'm open to changing it but then maybe to something more generic. What it's actually checking is usage in line items and in civicrm_price_set_entity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just "is used at least one record" or "is used by at least one existing record"? Or contribution, not a big deal. |
||
{/if} | ||
{/if} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a similar extra space here as well (before
or contribution pages
), while you're in there.