From a01f7d7f19fb0fff473cb1c61ea78e5d34e3de49 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Thu, 29 Dec 2022 11:43:36 +0000 Subject: [PATCH] Move navigation menu and settings --- civiquickbooks.php | 38 ------------------------------------- managed/navigation.mgd.php | 29 ++++++++++++++++++++++++++++ xml/Menu/civiquickbooks.xml | 2 +- 3 files changed, 30 insertions(+), 39 deletions(-) create mode 100644 managed/navigation.mgd.php diff --git a/civiquickbooks.php b/civiquickbooks.php index 183916c..842eaba 100644 --- a/civiquickbooks.php +++ b/civiquickbooks.php @@ -66,44 +66,6 @@ function civiquickbooks_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { return _civiquickbooks_civix_civicrm_upgrade($op, $queue); } -/** - * Implements hook_civicrm_navigationMenu(). - * - * Adds entries to the navigation menu. - */ -function civiquickbooks_civicrm_navigationMenu(&$menu) { - $item[] = [ - 'label' => E::ts('QuickBooks'), - 'name' => 'QuickBooks', - 'url' => NULL, - 'permission' => 'administer CiviCRM', - 'operator' => NULL, - 'separator' => NULL, - ]; - _civiquickbooks_civix_insert_navigation_menu($menu, 'Administer', $item[0]); - - $item[] = [ - 'label' => E::ts('Quickbooks Settings'), - 'name' => 'Quickbooks Settings', - 'url' => 'civicrm/quickbooks/settings', - 'permission' => 'administer CiviCRM', - 'operator' => NULL, - 'separator' => NULL, - ]; - _civiquickbooks_civix_insert_navigation_menu($menu, 'Administer/QuickBooks', $item[1]); - - $item[] = [ - 'label' => E::ts('Synchronize contacts'), - 'name' => 'Contact Sync', - 'url' => 'civicrm/a/#/accounts/contact/sync/quickbooks', - 'permission' => 'administer CiviCRM', - 'operator' => NULL, - 'separator' => NULL, - ]; - _civiquickbooks_civix_insert_navigation_menu($menu, 'Administer/QuickBooks', $item[2]); - _civiquickbooks_civix_navigationMenu($menu); -} - /** * Map quickbooks accounts data to generic data. * diff --git a/managed/navigation.mgd.php b/managed/navigation.mgd.php new file mode 100644 index 0000000..cf74736 --- /dev/null +++ b/managed/navigation.mgd.php @@ -0,0 +1,29 @@ + 'Navigation_Accountsync_Quickbooks_Settings', + 'entity' => 'Navigation', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'domain_id' => 'current_domain', + 'label' => E::ts('Quickbooks Settings'), + 'name' => 'Quickbooks Settings', + 'url' => 'civicrm/admin/setting/quickbooks', + 'icon' => NULL, + 'permission' => [ + 'administer CiviCRM system', + ], + 'permission_operator' => 'AND', + 'parent_id.name' => 'Accounts_System', + 'is_active' => TRUE, + 'has_separator' => 0, + 'weight' => 10, + ], + ], + ], +]; diff --git a/xml/Menu/civiquickbooks.xml b/xml/Menu/civiquickbooks.xml index f6d254b..c9c5844 100644 --- a/xml/Menu/civiquickbooks.xml +++ b/xml/Menu/civiquickbooks.xml @@ -9,7 +9,7 @@ access CiviCRM - civicrm/quickbooks/settings + civicrm/admin/setting/quickbooks CRM_Civiquickbooks_Form_Settings QuickBooks Online Settings access CiviCRM