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

accounts tab always visible #411

Open
BennHi opened this issue Jan 26, 2024 · 9 comments
Open

accounts tab always visible #411

BennHi opened this issue Jan 26, 2024 · 9 comments

Comments

@BennHi
Copy link

BennHi commented Jan 26, 2024

When I set the menu position of the accounts tab in the settings to not show or show in the contributions tab, this doesn't seem to change anything. The tab is still visible which is especially problematic with users who shall have no business in contributions whatsoever.

On a sidenote: I also noticed, that the tab doesn't show in the "Contact Summary Editor" Extension. Maybe this helps tracking down the issue.

@eptbertram
Copy link

The tab shows in my "Contact Layout Editor" (v 2.2.2) and is editable & able to hide.

CiviCRM 5.67.0 with Drupal 10.2.2 or WordPress 6.4.2. What is your CMS and version, @BennHi ?

@BennHi
Copy link
Author

BennHi commented Jan 30, 2024

I am using "org.project60.banking" v0.8.3 with "Contact Layout Editor" v2.2.2 in CiviCRM 5.69.0 with WordPress 6.4.2.

Bildschirmfoto 2024-01-30 um 17 05 49 Bildschirmfoto 2024-01-30 um 17 05 31

@eptbertram
Copy link

Your versions are good :) A big difference: I installed the theme The Island, an extension from https://lab.civicrm.org/extensions/theisland/ Maybe you like to give it a try? After installation it needs to be configured via admin-menu > display settings > display preferences. Maybe your error is solved with this new template?

I noticed in my Drupal 10 install that the tab for Relationships has gone after upgrading to 5,69.x. This is very strange, too. Maybe your issue isn't from banking extension, but a tab-related problem?

@BennHi
Copy link
Author

BennHi commented Jan 30, 2024

Hmm.. yes maybe it's a tab related issue. I'll try installing the theme in a minute but in the mean time here is the view of the display preferences (if I translated to german correctly). There seems to be no option for Accounts (ger. Konten) visible.
image

@eptbertram
Copy link

There is no option for Bank Accounts (Bankkonto) here, because it belongs to an extension and not CRM core. This is no problem.
Please scroll to the buttom "Theme for Backend" to switch themes.

@BennHi
Copy link
Author

BennHi commented Jan 30, 2024

I see, thanks for explaining. I just installed The Island and it looks great but the tab issue persists.
Bildschirmfoto 2024-01-30 um 18 04 12

EDIT: There isn't by chance a WordPress Permission I could disable for a certain role? I have looked through the list and nothing obvious appeared to me but maybe I overlooked something?

@eptbertram
Copy link

I guess there are no permissions for CiviBanking.
Sorry that I couldn't help further.

@jensschuppe
Copy link
Collaborator

When I set the menu position of the accounts tab in the settings to not show or show in the contributions tab, this doesn't seem to change anything. The tab is still visible

This option isn't about the Accounts tab but the CiviBanking submenu within the navigation menu. The Accounts tab currently can not be hidden:

/**
* Implements hook_civicrm_tabset()
*
* Will inject the "Banking Accounts" tab
*/
function banking_civicrm_tabset($tabsetName, &$tabs, $context) {
if ($tabsetName == 'civicrm/contact/view' && !empty($context['contact_id'])) {
$contactID = (int) $context['contact_id'];
$count = CRM_Core_DAO::singleValueQuery("SELECT COUNT(id) FROM civicrm_bank_account WHERE contact_id={$contactID};");
$tabs[] = [
'id' => 'bank_accounts',
'url' => CRM_Utils_System::url('civicrm/banking/accounts_tab', "snippet=1&cid=$contactID"),
'title' => E::ts("Bank Accounts"),
'count' => $count,
'weight' => 95
];
}
}

As this code also checks for a contact ID as context, the tab isn't available to the Contact Layout Editor. This should be adjusted. Also, a permission would be useful - as being done here.

Would any of you be able to provide a PR for this?

@BennHi
Copy link
Author

BennHi commented Feb 2, 2024

I am currently only running one in production instance and I am afraid to mess it up as I am still pretty new to civi.
Also I updated to using smarty v3 today and thus deactivated the banking extension for now. Fun fact: The tab is still there ;) But it throws an error and doesn't load any content.

Edit: The tab disappeared. Not sure anymore if this "fun fact" wasn't user error after all. But the main issue persists.

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

No branches or pull requests

3 participants