christianwach / civicrm-admin-utilities

CiviCRM Admin Utilities is a WordPress plugin that modifies and enhances CiviCRM's appearance and behaviour in single site and multisite WordPress installs.
https://wordpress.org/plugins/civicrm-admin-utilities/
GNU General Public License v2.0
20 stars 10 forks source link

Add Report Listing to admin bar menu #2

Closed kcristiano closed 6 years ago

kcristiano commented 7 years ago

Update admin_bar_add to have a menu item for Reports

christianwach commented 6 years ago

@kcristiano Thanks for the PR! Could you convert to tab-indented whitespace please?

christianwach commented 6 years ago

I think this also needs a check for the CiviReport component being active - basically the same format as the other menu items: if ( array_key_exists( 'CiviReport', $components ) ) { ... since CiviReport can be switched off.

One last thing to check - I had problems when checking permissions with the access_civireport format - hence my use of the access CiviReport format throughout the menu method. Could you please double-check? Thanks!

kcristiano commented 6 years ago

@christianwach I never disable CiviReports, so it did not occur to me to add the check, thanks for pointing it out.

Both formats of permission checks work for me in Single Site. I went with Access CiviReport to be consistent.

I changed the code formatting from CiviCRM to WP. I think it's now correct.

christianwach commented 6 years ago

@kcristiano I think that's an algorithm for formatting whitespace in CiviCRM :-) Not to worry - thanks for including the checks - I'll convert to WordPress whitespace. Cheers!

christianwach commented 6 years ago

FWIW, done in 2c171567a664cd86df680b2cf5626e48af2d9533