Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Changing default categories for WebApp

    Kopano WebApp
    4
    9
    1110
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • onex.de
      onex.de last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • marty
        marty Kopano (Inactive) last edited by marty

        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

        https://documentation.kopano.io/deskapp_admin_manual
        http://documentation.kopano.io/webapp_smime_manual
        https://documentation.kopano.io/webapp_admin_manual

        onex.de 1 Reply Last reply Reply Quote 0
        • onex.de
          onex.de @marty last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • marty
            marty Kopano (Inactive) last edited by

            @onex-de Not that trivial, but you could remove it from the persistent settings via python-kopano.
            The property is PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON

            https://documentation.kopano.io/deskapp_admin_manual
            http://documentation.kopano.io/webapp_smime_manual
            https://documentation.kopano.io/webapp_admin_manual

            onex.de 1 Reply Last reply Reply Quote 0
            • onex.de
              onex.de @marty last edited by

              @marty cool, do you have an example, because I don’t know, what you mean with the JSON thing, mentioned above.

              1 Reply Last reply Reply Quote 0
              • marty
                marty Kopano (Inactive) last edited by

                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()
                

                https://documentation.kopano.io/deskapp_admin_manual
                http://documentation.kopano.io/webapp_smime_manual
                https://documentation.kopano.io/webapp_admin_manual

                1 Reply Last reply Reply Quote 0
                • msauer
                  msauer last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • robing
                    robing Kopano (Inactive) last edited by

                    @msauer,

                    End users can change the category color in WebApp (right click on an item -> Categories -> Manage Categories) 9b87024a-5c02-4254-b027-541e0546df91-image.png
                    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.py

                    Export 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
                    

                    Regards Robin,

                    Need support?
                    Have a look at https://kopano.com/support/ for options.

                    Helpful resources:
                    https://kopano.com/blog/how-to-get-kopano/
                    https://documentation.kopano.io/
                    https://kb.kopano.io/

                    1 Reply Last reply Reply Quote 1
                    • msauer
                      msauer last edited by

                      Hi Robin,

                      thanks for the hint with the python-script. This was new to me.

                      kind regards,
                      Mathias

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post