-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Convert case activity links to 'actionLinks' #14349
Convert case activity links to 'actionLinks' #14349
Conversation
(Standard links)
|
@mattwire it looks like all the PRs you were waiting for have been merged. If you can do whatever rebase and style cleanup you need I'd be happy to look at it in Brooklyn next week. I've been in case-land recently, and the links hook is my favorite hook. |
f02b47f
to
71fdee1
Compare
@agh1 Thanks - now rebased and ready for review |
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.
This PR moves a sizable function and heavily reworks it, so @eileenmcnaughton recommended that I do the move as a separate first step. See #14512.
Overall, this is a good change, but it has a couple of issues.
- General standards
- Developer standards
- (
r-tech
) PASS: The change preserves compatibility with existing callers/code/downstream. - (
r-code
) PASS: However, while you're fixing things, see the comment about{assign}
instead of{capture}{/capture}
- (
r-maint
) PASS: It would be nice to have test coverage for getting the right action links in the right situations (permissions, available cases to reassign to, etc.), but that logic is a little outside the scope of this change, which does a lot to make the code more consistent. - (
r-test
) PASS: The test results are all-clear.
- (
CRM/Report/Form/Activity.php
Outdated
); | ||
if (!empty($this->_params['include_case_activities_value'])) { | ||
try { | ||
$caseId = civicrm_api3('Activity', 'getvalue', [ |
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.
A couple of things about this:
-
if a non-case activity follows a case activity the
$caseId
never gets set back to null: the API finds no case ID, throws an exception, and the catch never does anything. The result is that this creates broken links that are in the case activity style but for other activities. -
This is going to run 50 separate queries against the same table you've already queried. Instead, get the
case_id
as part of the main query by adding it to the big$this->_columns
array and making itno_display
andrequired
(likesource_record_id
).
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.
Right, makes sense I think. I'll need to come back to this to look at that :-)
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.
@agh1 That turned into a bit of an effort... but I've now done it! Could you test the reporting side again and confirm if you are happy?
71fdee1
to
889975f
Compare
889975f
to
e5ff399
Compare
e5ff399
to
8009202
Compare
8009202
to
b5c5dd7
Compare
I've tested this and confirm that links are loaded correctly on the case manage screen and view activity page. As the comments from @agh1 is resolved now, this is ok to be merged. |
I've added merge-ready based on @jitendrapurohit review - I just want to give @agh1 a last chance to weigh in / comment |
b5c5dd7
to
7bf3b68
Compare
erm @jitendrapurohit there are changes since your review - I guess you may need to recheck? |
@eileenmcnaughton @jitendrapurohit Only changes were comments in formButtons.tpl per comment. Annoying that there doesn't seem to be an easy way to show a comparison! |
Actually force-pushed is a link - https://github.com/civicrm/civicrm-core/compare/b5c5dd71cd00d10b722349e0adf9d02f712e608f..7bf3b68c5243fccac0a381858d4d2bf8e2c8350a - but since there is a rebase in there it's not readable. I'll take your word on no substantive change |
Overview
Convert the case activity links to use the standard "actionLinks()" method instead of hardcoding html and making it impossible to override cleanly.
Before
Really hard to override/edit case activity links. Fixed format.
After
Overrideable in standard way via hook. Formatted for display via the standard "formatLinks()" function.
Technical Details
Introduces the concept of "linkButtons" which are currently implemented in a custom way for each form that uses them. This allows the output of
actionLinks()
to be used to generate the standard set of "extra" links that appear when a table of entities is shown but also show them on the "detail" View/Edit form. So for cases "Move to Case" and "Copy to Case" are now also available on the "View activity" form.Comments