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

Comm prefs: add condition param for {privacyFlag} #17307

Merged
merged 1 commit into from
May 15, 2020

Conversation

agh1
Copy link
Contributor

@agh1 agh1 commented May 12, 2020

Overview

This is a follow-up for #17283 that adds a condition parameter for {privacyFlag} to simplify the code a bit and make it work more similarly to {icon}.

In the process, this also displays on hold status alongside do not email status. This was handled inconsistently before (the on hold would take precedence in search results, while the do not email would take precedence on the contact summary). Both pieces of information are also independently useful.

Before

If you want to use {privacyFlag} to show "Do not mail", etc., you need to wrap it in an {if}.

After

You can supply a value as a condition to {privacyFlag}, and it will only display the icon if the value is true.

@civibot
Copy link

civibot bot commented May 12, 2020

(Standard links)

@colemanw
Copy link
Member

I like the array_key_exists check for condition. Maybe we should do that for the {icon} as well.

@agh1
Copy link
Contributor Author

agh1 commented May 12, 2020

@colemanw it's in there for {icon}:

$condition = array_key_exists('condition', $params) ? $params['condition'] : 1;

The difference is just that CRM_Core_Page::crmIcon() is where the condition is handled.

@agh1
Copy link
Contributor Author

agh1 commented May 13, 2020

Found EXITCODES=" sequentialcreditnotes"

Something is breaking with tests recently.

Jenkins retest this please

@eileenmcnaughton
Copy link
Contributor

test this please

@seamuslee001
Copy link
Contributor

Test fails unrelated

@seamuslee001 seamuslee001 merged commit b5140bf into civicrm:master May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants