Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Kimai
  3. Add custom export templates: where to create the folder "export" and how to modify export.en.xlf?

Add custom export templates: where to create the folder "export" and how to modify export.en.xlf?

Scheduled Pinned Locked Moved Kimai
15 Posts 3 Posters 4.2k Views 3 Watching
  • 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.
  • M Offline
    M Offline
    marylou
    wrote on last edited by marylou
    #1

    I am trying to add custom templates to our Kimai installation.

    I tried to follow the Kimai documentation and adapt it to the Cloudron installation.

    • I copied, renamed and adapted one of the default templates. ✔

    • I created a folder in "data" called "export".
      Since in Cloudron plugins are installed in /data/plugins rather than in var/plugins, I thought it might work. ❓

    • Similarly, I created a folder "translations" and added a copy of export.en.xlf that included my custom template. ❓

    • I reloaded the kimai cache and restarted the app. ✔

    bin/console kimai:reload --env=prod
    

    Unfortunately, my template is not shown in the export window.

    I suppose that adding a folder "export" to "data" does not work. With regard to invoice templates, @girish suggested that you can perhaps add a default directory for templates.

    Maybe configuring the directory data/export through the config key kimai.export.documents in local.yaml could do the trick as suggested in the Kimai documentation, but I don't know how to do that.

    And I am not sure how to modify the export.en.xlf either.

    Any help would be much appreciated.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      marylou
      wrote on last edited by
      #2

      Hi @joseph,

      Thank you for your reply in the other thread on invoice templates, but I am trying to add export templates, not invoice templates.

      They need to be in a directory called "export": https://www.kimai.org/documentation/export.html

      So I tried adding to local.yaml

      kimai:
          export:    
                      documents:    
                              - '/app/data/export/'
      

      Unfortunately,my templates are not added to the dropdown menu.

      When I try to change documents to "templates", I get the following error message when I try to rebuild the cache:

      ERROR] Unrecognized option "template" under "kimai.export". Available options are "defaults", "documents".      
      

      When I use "defaults", the default templates disappear from the menu.

      kimai:
          export:    
                     defaults:    
                              - '/app/data/export/'
      

      So I guess I could try to copy the defaults into the folder and point to defaults.

      1 Reply Last reply
      0
      • M marylou referenced this topic on
      • M Offline
        M Offline
        marylou
        wrote on last edited by
        #3

        Copying the default files into the folder did not work.

        1 Reply Last reply
        0
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #4

          Have you tried settings documents instead of defaults ?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            marylou
            wrote on last edited by
            #5

            I tried documents first, then defaults.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              marylou
              wrote on last edited by marylou
              #6

              What I don't understand is how Kimai should know what to call the additional template in the dropdown menu.
              This is why I think it it's necessary to also modify the export-en.xlf.

              Edit: I suppose it will get an id once it is located and the translation file would translate the ID into whatever "resname" you select. So I should expect to see an ID in the dropdown.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                marylou
                wrote on last edited by
                #7

                I also tried.

                • 'app/data/export/'
                • '/data/export/'
                  I reloaded the cache every time. The additional templates do not appear.
                1 Reply Last reply
                0
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #8

                  @marylou maybe https://git.cloudron.io/apps/kimai-app/-/merge_requests/6 works... I have published a new package that uses /app/data/export . Can you try?

                  M 1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    marylou
                    wrote on last edited by
                    #9

                    Updating now.
                    Just to be sure: I delete the path I added to local.yaml, correct?

                    1 Reply Last reply
                    1
                    • M Offline
                      M Offline
                      marylou
                      wrote on last edited by
                      #10

                      YEAH!!!!!!!

                      Thank you SO SO SO much, @girish.

                      Fun fact: the order of the menu buttons changed (for lack of a better word, it is also the word used in the kimai documentation) from CSV / Excel / Print / PDF to CSV / Excel / PDF / Print.

                      But there is now a fifth template in the PDF dropdown and it has the file name as a name.
                      Again, thank you so much!!!

                      1 Reply Last reply
                      1
                      • girishG girish

                        @marylou maybe https://git.cloudron.io/apps/kimai-app/-/merge_requests/6 works... I have published a new package that uses /app/data/export . Can you try?

                        M Offline
                        M Offline
                        msbt
                        App Dev
                        wrote on last edited by
                        #11

                        @girish I'm afraid this update removed the custom invoices templates, I can't create new invoices because the templates are now "missing". Could you symlink that path again? /app/data/invoices was used for templates, /app/data/data/invoices/ for exported pdfs (https://www.kimai.org/documentation/invoices.html#create-your-own-invoice-document for reference)

                        Happy Hosting & Web Development

                        1 Reply Last reply
                        0
                        • girishG Offline
                          girishG Offline
                          girish
                          Staff
                          wrote on last edited by
                          #12

                          @msbt oh, i didn't realize that path was in use. will put it back

                          1 Reply Last reply
                          1
                          • girishG Offline
                            girishG Offline
                            girish
                            Staff
                            wrote on last edited by
                            #13

                            @msbt published

                            M 1 Reply Last reply
                            0
                            • girishG girish

                              @msbt published

                              M Offline
                              M Offline
                              msbt
                              App Dev
                              wrote on last edited by
                              #14

                              @girish thanks, appreciate it! already tested, templates are back 🙂

                              Happy Hosting & Web Development

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                marylou
                                wrote on last edited by
                                #15

                                And mine are still there. 👏

                                1 Reply Last reply
                                0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Bookmarks
                                • Search