Changing default categories for WebApp
-
Hi,
I want to change the default categories for WebApp serverwide and didn’t find the defaults.php, where this should / could be done.
I’m using Kopano on UCS and wanted to know, if I could just copy the defaults.php from github to /etc/kopano/webapp/ and edit it afterwards for changing the categories or if there is another way to do this.Thanks in advanced,
Christian. -
Hi @onex-de
You should add it to your config,
for example:
define('DEFAULT_CATEGORIES', json_encode(array( array( 'name' => _('NumberOne'), 'color' => '#e40023', 'standardIndex' => 6, 'quickAccess' => true, 'sortIndex' => 0, 'used' => false ), array( 'name' => _('Number2'), 'color' => '#f99406', 'standardIndex' => 2, 'quickAccess' => true, 'sortIndex' => 1, 'used' => false ) )));
But it probably won’t work if you already wrote categories in the persistent settings, so if you have used them before
-
@marty said in Changing default categories for WebApp:
But it probably won’t work if you already wrote categories in the persistent settings, so if you have used them before
Thanks … how can I check if there are some already?
Is it possible, to delete/reset them?Christian.
-
@onex-de Not that trivial, but you could remove it from the persistent settings via python-kopano.
The property isPR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON
-
@marty cool, do you have an example, because I don’t know, what you mean with the JSON thing, mentioned above.
-
something like this (untested)
import kopano from MAPI.Util import * import sys # Define the persistent setting property PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON = PROP_TAG(PT_STRING8, PR_EC_BASE+0x74) parser = kopano.parser('skp') parser.add_option("-u", dest="user", action="store", help="Username") parser.add_option("-d", dest="delete", action='store_true', help="delete persistent setting") parser, args = parser.parse_args() server = kopano.Server(parser) if parser.user: user = server.user(parser.user) # Define the prop in users store try: prop = user.store.prop(PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON) except Exception: print "Property does not exist in store" sys.exit() if parser.delete: try: # Delete the persistent setting property user.store.delete(prop) print "Property deleted" except Exception: print "Property does not exist in your store" sys.exit()
-
Hi,
sorry for bringing this thread up again.
Is there still no way to change the categories for a user once a name was added to a colour? I get more and more requests to change categories because they aren’t used anymore. Is this feature on the roadmap?
Thanks in advance for a quick answer and best regards,
Mathias -
End users can change the category color in WebApp (right click on an item -> Categories -> Manage Categories)
For the default colors this can only be changed once but with webapp_admin you can export the categories for a user and alter them https://stash.kopano.io/projects/KSC/repos/webapp-tools/raw/webapp_admin/webapp_admin.pyExport the categories
python3 webapp_admin.py --export-categories -u username
and to import them for the same user
python3 webapp_admin.py --import-categories -u username
Or if restoring it from a different user export
python3 webapp_admin.py --import-categories -u username --file /path/to/json/file
-
Hi Robin,
thanks for the hint with the python-script. This was new to me.
kind regards,
Mathias