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-20332 Added support for third column of actions list to be modifi… #10046

Merged
merged 2 commits into from
Mar 29, 2017

Conversation

Edzelopez
Copy link
Contributor

…ed by hook summaryActions


@Edzelopez
Copy link
Contributor Author

@monishdeb could you please QA this?

@monishdeb
Copy link
Member

sure

@eileenmcnaughton
Copy link
Contributor

@monishdeb you might be able to trade QA on this with @jitendrapurohit who has a few things awaiting QA I believe.

Based on a quick look at the code I do think we should try not to be deriving the urls from the smarty variables -ie

$userRecordUrl = CRM_Core_Config::singleton()->userSystem->getUserRecordUrl($cid);
rather than
if ($userRecordUrl = CRM_Core_Smarty::singleton()->get_template_vars('userRecordUrl')) {
although there might be some issues to resolve.

Question - won't this break things for people who are already overriding existing actions? Perhaps instead of putting more layers into the menu you need to add some fields to the items in the array - since I assume you are using the layers to denote which column to use?

@Edzelopez
Copy link
Contributor Author

@eileenmcnaughton I have now changed the function to prevent modification of the original array.

@monishdeb could you please QA or assign to someone appropriate for QA?

Thanks!

@monishdeb
Copy link
Member

@jitendrapurohit could you please QA this PR?

'key' => 'dashboard',
'tab' => 'dashboard',
'class' => 'dashboard',
'href' => CRM_Utils_System::url('civicrm/user',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise this drupal-specific method was already in use, but, could you add a todo suggesting it be derived in a CMS-based way similar to CRM_Core_Config::singleton()->userSystem->getUserRecordUrl($contactId), to make it clear that it's a short-cut

…ed by hook summaryActions

----------------------------------------
* CRM-20332: Refactor summaryActions hook to allow user-defined actions in third column
  https://issues.civicrm.org/jira/browse/CRM-20332
----------------------------------------
* CRM-20332: Refactor summaryActions hook to allow user-defined actions in third column
  https://issues.civicrm.org/jira/browse/CRM-20332
@monishdeb
Copy link
Member

@eileenmcnaughton I have updated the PR, ready for QA

@jitendrapurohit
Copy link
Contributor

Checked the hook by inserting menu from $actions['otherActions']['casework'] = array(...) and confirmed that it gets inserted to the third column correctly.

@monishdeb
Copy link
Member

@eileenmcnaughton can you merge the PR as @jitendrapurohit has approved the changes. Thanks

@eileenmcnaughton eileenmcnaughton merged commit 2522469 into civicrm:master Mar 29, 2017
@monishdeb monishdeb deleted the CRM-20332 branch March 30, 2017 04:59
@davejenx
Copy link
Contributor

davejenx commented Apr 24, 2017

@Edzelopez This PR appears to cause CRM-20467 PHP notices on contact search for ACL'd user due to use of undefined $values in checkUserMenuPermissions().

@Edzelopez
Copy link
Contributor Author

Sorry about that @davejenx, it was a typo that was introduced in an effort to generalize code which has been fixed by @monishdeb here

@davejenx
Copy link
Contributor

@Edzelopez Thanks, confirmed that #10243 fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants