Skip to content

Commit

Permalink
Move navigation menu and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jan 10, 2023
1 parent 2624070 commit a01f7d7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 39 deletions.
38 changes: 0 additions & 38 deletions civiquickbooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
29 changes: 29 additions & 0 deletions managed/navigation.mgd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
use CRM_Civiquickbooks_ExtensionUtil as E;

return [
[
'name' => '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,
],
],
],
];
2 changes: 1 addition & 1 deletion xml/Menu/civiquickbooks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<access_arguments>access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/quickbooks/settings</path>
<path>civicrm/admin/setting/quickbooks</path>
<page_callback>CRM_Civiquickbooks_Form_Settings</page_callback>
<title>QuickBooks Online Settings</title>
<access_arguments>access CiviCRM</access_arguments>
Expand Down

0 comments on commit a01f7d7

Please sign in to comment.