Giter Club home page Giter Club logo

demobundle's Introduction

Kimai - Developer Demo Bundle

CI Status

A plugin to showcase some developer options within Kimai.

What's included?

  • a new System configuration
  • a new menu entry
  • a demo controller with a view and repository
  • a new permission
  • a theme event, adding a css rule for "magic color dots" (customers, projects, activities)
  • a new API method
  • a new invoice template (plus a new search path via bundle extension)
  • a new dashboard widget
  • a event subscriber to sort the bundle permissions in a new section (see user roles & permission screen)
  • a listener to attach new action items in the plugin screen
  • a meta field for timesheets
  • a user preference
  • a doctrine migration for creating a simple database
  • an installation command (that will be used for future database updates as well)

Demo configuration

You users could set a default value via local.yaml like this:

demo:
    some_setting: testing

But that should not be required, as they can change the configuration through the "System configuration" screen in Kimai.

Installation

This plugin is compatible with the following Kimai releases:

Bundle version Minimum Kimai version
2.1.0 - 2.2.0 2.1.0
2.0 2.0.0
0.9 - 0.10 1.11
0.9 1.11
0.8 1.10
0.5 - 0.7 1.7
0.1 - 0.4 1.6

You find the most notable changes between the versions in the file CHANGELOG.md.

Download and extract the compatible release in var/plugins/ (see plugin docs).

The file structure needs to look like this afterward:

var/plugins/
├── DemoBundle
│   ├── DemoBundle.php
|   └ ... more files and directories follow here ... 

Then rebuild the cache:

bin/console kimai:reload -n

And install the database:

bin/console kimai:bundle:demo:install

Permissions

This bundle ships a new permission:

  • demo - show all demo options to the user

By default, it is assigned to each user with the role ROLE_SUPER_ADMIN.

Read how to assign this permission to your user roles in the permission documentation.

demobundle's People

Contributors

katjaglassconsulting avatar kevinpapst avatar ymarkus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

demobundle's Issues

Error running `kimai:bundle:demo:install` on new installation

I set kimai up by following the documentation (development install), and kimai (in dev environment) is working fine.

Then I cloned this repo into var/plugins. When I run bin/console kimai:bundle:demo:install, I get following error:

❯ bin/console kimai:bundle:demo:install

Starting installation of plugin: DemoBundle ...
===============================================

                                                                                                                        
 [ERROR] Failed to install database for bundle DemoBundle. Migrations configuration key "name" does not exist.

Commenting out the line just moves the error to "table_name" does not exist

Extending export controler / adding calculated values to pdf.twig export template

I have created a copy of an already existing PDF template and saved it unter var/export/myexport.pdf.twig. I modified it to my needs and this worked pretty well.

Now I want to add custom rounding to the duration field where some math is implied. Since I was not able to achieve this just with twig filters, I would like to add an extra field like duration_rounded and do the calculation of this value in PHP.

What would be the best / update safe way to implement this?
Is it possible to register to a hook or extend the controller?

Error rendering template

Fresh installation: when calling up the plug-in page, the error appears:
An exception has been thrown during the rendering of a template ("Warning: Array to string conversion").

The solution was:
Line 171 in var/plugins/DemoBundle/Resources/views/index.html.twig

{{ value }}
replace with
{{ value is iterable ? value|join(', ') : value }}

Question on Invoice without Templates

Hi Kevin
Thanks for this extensive hero demo of a plugin.
I was able to achieve some things with it, and learn how to survive better, in general...
Still, Symfony is a long way to go.

I'm now trying to re-implement my old Indesign XML Exporter from V1.

But at this stage I think I need to ask directly, since I seem to hit a solid wall, and from the past hours of trial'n'error it seems wise:

I extended the plugin with an exporter, that I think will serve as a minimum to get Indesign XML out in the end. However I also tried the "Invoice" route, since it allows userland'ish restrictions.

  • Is it true that all of the up-to-now implemented ways to do Invoice are (forced) template based?
  • Is it true that everything based on RendererInterface does require a template?
  • Is final class ServiceInvoice the place where templates-are-mandatory is hardcoded? Or where would be the place to build a hook on?

I'm not sure if there is a benefit in a template for this kind of playout, but maybe I'm wrong.

Best wishes
Manu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.