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

    How to remove color property from calendar item

    Scripting
    2
    9
    955
    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.
    • vcordes79
      vcordes79 last edited by

      Hello,

      I used kopano-migration-pst to import an existing calender. Most of the items had the color property set. So in webapp these items are shown grey (category color ignored) with the categories “important”, “required”, “birthday”, … I want to remove this property with kopano-python. How can I achieve this? With other properties like Subject this is possible (with delete(prop)), but there is no constant defined for color prop like PR_SUBJECT_W for subjects.

      Thanks,
      Volker

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

        @vcordes79

        This is possible with item.delete(item.prop(proptag="public:Keywords"))

        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 0
        • vcordes79
          vcordes79 last edited by vcordes79

          Hello,

          thanks for the reply. Unfortunately this does not work. It deletes only the categories (those I want to keep), the color prop (for old clients) stays the same.

          Here’s an example:
          Screenshot_20200211_091409.png

          I wouldn’t mind the extra categories, the problem is the category color (red, purple) doesn’t show in the calendar view - the items are displayed grey.

          Volker

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

            That’s saved in your WebApp settings.
            You can use https://stash.kopano.io/projects/KSC/repos/webapp-tools/browse/webapp_admin to make a export and import the new version

            python3 webapp_admin.py --export-categories -u username
            

            This wil create a json file username-categories.json and then change the color that matches the category name

                {
                    "additional": false,
                    "color": "#DCB6E9",
                    "name": "Birthday",
                    "quickAccess": false,
                    "sortIndex": 100000,
                    "standardIndex": "",
                    "used": ""
                },
            

            Then import the new file

            python3 webapp_admin.py --import-categories -u username
            

            Use the --file parameter if you changed the json file name.

            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 0
            • vcordes79
              vcordes79 last edited by vcordes79

              Hello,

              that also does not help, because the “important” category is not in the categories array but in the color prop:

              print(item.categories)
              

              shows:

              ['Uta']
              

              and

              print(item.color)
              

              shows

              red
              

              So I need a way to remove the color prop. I have items were item.color is None, these are okay.

              Thanks,
              Volker

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

                I hope this is what you need otherwise i’m out of ideas

                item.create_prop("PT_LONG:PSETID_Appointment:0x8214", 0x00000000)
                or delete the property item.delete(item.prop("PT_LONG:PSETID_Appointment:0x8214"))

                If this works you can find the right numbers for the color here
                https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidappointmentcolor-canonical-property

                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 0
                • vcordes79
                  vcordes79 last edited by

                  Thanks,

                  that’s excactly what I needed. Now my calendar is colorful again.

                  Volker

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

                    Hi,

                    another question: If a calendar item has multiple categories, how is determined what color is used? Can you make “transparent” categories?

                    Thanks,
                    Volker

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

                      Normally it should take the color of the last added category.
                      if you use the new categories you can define anything you like in the color value it will just copy over that value so this also works "color": "rgba(255, 0, 0, 0.5)", , but a color needs to be set otherwise it will use gray as default color.

                      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 0
                      • First post
                        Last post