Possibility to add 2. Global Adressbook ?
Closed this issue ยท 9 comments
Thank you very much for your great work.
Global Addressbook is more stable than the Carddav Solutions.
I would like to have a second "Globaladdressbook" (one for members, and one for non-members)
Would it be possible in any way?
Thanks, regards
Joerg
This plugins supports groups, see globaladdressbook_groups
could you split you contacts into 2 groups?
I know, and we use it very intensive. We are a sportsclub. Our Members are organized in 7 divisions (basketball, volleyball, etc) . Each division has between 5 and 15 groups (BB-Men, BB-Women, BB-Kids etc.) So we have actually 72 groups in our members addressbook.
It seems not senseful, to build another 20 groups in the same addressbook, for non-members. I tried to use an additional caldav-addressbook. it works, but not as stable as your globaladdressbook.
Regards
Joerg
The short answer is no, this plugin creates a single address book.
The longer answer is it would be quite a big change to support multiple address books, the config would need to be rewritten so each instance can have its own settings and the (currently static) address book id would need to be made dynamic.
If you know a little PHP you could clone this plugin and create globaladdressbook2 then you would need to change the $abook_id
and the names of the config vars, enable the plugin in your Roundcube config and you should get a second instance. Don't forget to change the value of the globaladdressbook2_user
config var.
I'll leave this ticket open so people can ๐ if they want multiple global address books, I'd like to gauge popularity before implementing such a change.
Yes, thanks a lot. That was exactly, what I hoped to get.
The way for a second instance of globaladdressbook worked well for me. From my poitn of view theres only one "bug" in this way: No automatic updates. But this will not be a problem for me. For everybody who will try it out. Here are the few steps:
Copy globaladdressbook*.* to globaladdressbook2
rename globaladdressbook.php to globaladdressbook2.php
rename composer.json to composer.json.old (composer update would not work)
Make changes in globaladdressbook2.php
line 29 class globaladdressbook2 extends rcube_plugin
line 32 private $abook_id = 'global2';
line 53 $username = self::parse_user($this->rcube->config->get('globaladdressbook_user', '[global_addressbook2_user]'));
Make changes in config.inc.php (of the plugin=
$config['globaladdressbook_user'] = '[global_addressbook2_user]';line 13
Make changes in \localization\de_DE.inc (I've changed the german file only)
line 5 : $labels['globaladdressbook'] = 'Allgemeines Adressbuch 2'
Don't forget to activate the second instance in roundcube\config\config.inc.php
$config['plugins'] = array(
'globaladdressbook',
'globaladdressbook2',
);
Thanks to johndoo for this great plugin and the excellent support
Regards
Joerg
@JMA-Github If you can please give the current git-master version a try. I've just committed a big change with a rewritten config file which will support multiple address books.
Sound great, I think I will test at end of this week.
Meanwhile, I think there is another unexpected thing:
I've set the $config['globaladdressbook_perms'] = 3; and it works fine during editing contacts.
But than I tried a vcard import with option "replace" complete addressbook = yes.
I would expect, that this should not work, because delete of contacts is not allowed.
But, it has worked. 100 contacts deleted, one vcard imported. (I#ve had a backup of course ;-)
Is there a chance to handle this in globaladdressbook, or should I look to RC to avoid the option "Replace"
I've analyzed the behaviour during import of Vcard (in the release version).
With $config['globaladdressbook_perms'] = 0 : GlobalAddressbok is hidden in the Import-Popup. => ok
With $config['globaladdressbook_perms'] = 1 (or user is admin) : All options in Import Pop Window are available => ok
With $config['globaladdressbook_perms'] = 2+3 : All options in Import Pop Window are available => not ok, because "Replace" Option deletes all contacts in the addressbook.
Ih there is no chance to hide the "Replace" option in import popup, you should hide the whole import for $config['globaladdressbook_perms'] = 2+3 . => "Safety first"
Good catch on the import function. Thanks. Plugins cannot interact with the import process though so I think the answer here is to block the import option unless the user has full access. I think it gets too complicated otherwise. See be43d47.
I've just released version 2.0. Please open a new ticket if you find any new issues.