Screenshots
Click to enlarge
Logo - Keleo

Keleo

Software development company founded by Kevin Papst

Create free configurable additional fields for timesheets, customers, projects and activities.
Last update: 25 Jun 2019

A Kimai 2 plugin, which allows to configure additional fields for timesheets, customers, projects and activities.

You can test it in the “Plugins” demo.

Features

Configure additional fields in various formats for the following data types:

  • Timesheets
  • Customers
  • Projects
  • Activities

You can create as many fields as you want for each data type, where each field:

  • is either optional or mandatory
  • has its own visibility (see below)
  • can be restricted to certain combinations (eg. a “location” field will only be shown for customer X and project Y)

Be aware, that restricted fields won’t be visible on the create forms, as Kimai initially can’t know if the rule will apply. In these cases the form will only be shown in the edit forms.

The custom fields will be shown on the “create and edit entity” forms and can have the following types:

  • string
  • integer
  • number
  • duration
  • money
  • date
  • checkbox
  • language
  • currency
  • country
  • color

The custom fields / the entered values are available in:

  • Invoice templates (custom templates only)
  • Export module (spreadsheets and custom renderer show them automatically)
  • API (collections and entities)

Sensitive data can be configured as “invisible”, so it will not show up in the above mentioned places.

More information about custom fields can be found in the documentation.

Installation

Database

Create the required tables for your database engine.

Either MySQL / MariaDB:

CREATE TABLE kimai2_meta_field_rules (id INT AUTO_INCREMENT NOT NULL, customer_id INT DEFAULT NULL, project_id INT DEFAULT NULL, activity_id INT DEFAULT NULL, entity_type VARCHAR(100) NOT NULL, name VARCHAR(50) NOT NULL, value VARCHAR(255) DEFAULT NULL, type VARCHAR(100) NOT NULL, visible TINYINT(1) NOT NULL, required TINYINT(1) NOT NULL, INDEX IDX_C7D8A2619395C3F3 (customer_id), INDEX IDX_C7D8A261166D1F9C (project_id), INDEX IDX_C7D8A26181C06096 (activity_id), INDEX meta_field_rule_entity_type_idx (entity_type), UNIQUE INDEX UNIQ_C7D8A261C412EE025E237E06 (entity_type, name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;
ALTER TABLE kimai2_meta_field_rules ADD CONSTRAINT FK_C7D8A2619395C3F3 FOREIGN KEY (customer_id) REFERENCES kimai2_customers (id) ON DELETE CASCADE;
ALTER TABLE kimai2_meta_field_rules ADD CONSTRAINT FK_C7D8A261166D1F9C FOREIGN KEY (project_id) REFERENCES kimai2_projects (id) ON DELETE CASCADE;
ALTER TABLE kimai2_meta_field_rules ADD CONSTRAINT FK_C7D8A26181C06096 FOREIGN KEY (activity_id) REFERENCES kimai2_activities (id) ON DELETE CASCADE;

or SQLite:

CREATE TABLE kimai2_meta_field_rules (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, customer_id INTEGER DEFAULT NULL, project_id INTEGER DEFAULT NULL, activity_id INTEGER DEFAULT NULL, entity_type VARCHAR(100) NOT NULL, name VARCHAR(50) NOT NULL, value VARCHAR(255) DEFAULT NULL, type VARCHAR(100) NOT NULL, visible BOOLEAN NOT NULL, required BOOLEAN NOT NULL);
CREATE INDEX IDX_C7D8A2619395C3F3 ON kimai2_meta_field_rules (customer_id);
CREATE INDEX IDX_C7D8A261166D1F9C ON kimai2_meta_field_rules (project_id);
CREATE INDEX IDX_C7D8A26181C06096 ON kimai2_meta_field_rules (activity_id);
CREATE INDEX meta_field_rule_entity_type_idx ON kimai2_meta_field_rules (entity_type);
CREATE UNIQUE INDEX UNIQ_C7D8A261C412EE025E237E06 ON kimai2_meta_field_rules (entity_type, name);

Files

Extract the ZIP file and upload the included directory and all files to your Kimai installation to the new directory:
var/plugins/MetaFieldsBundle/

The file structure needs to like like this afterwards:

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

Rebuild the cache

After uploading the files, Kimai needs to know about the new plugin. It will be found, when the cache is re-build:

cd kimai2/
bin/console cache:clear --env=prod
bin/console cache:warmup --env=prod

or when using FTP: delete the folder var/cache/prod/.

First test

When logged in as SUPER_ADMIN, you should now see the custom-fields administration screen.

If this was successful, you can now think about giving permissions to other users as well.

Permissions

This bundle ships a new administration screen, which will be available for the following users:

  • ROLE_SUPER_ADMIN - every super administrator
  • configure_meta_fields - allows to adminstrate the custom field definitions

You can add the new permissions to your local.yml. For more information, read the permissions documentation.

    permissions:
        roles:
            ROLE_ADMIN: ['configure_meta_fields']

After changing the permissions, you need to clear the cache one more time.

Screenshot

Screenshot

All items by Keleo

Audit-Trail plugin
New

Records detailed change/audit logs for timesheets, customers, projects and activities and displays them in a per-item timeline.
plugin
29€

Custom-fields plugin
New

Create free configurable additional (optional and mandatory) fields for timesheets, customers, projects and activities in various formats.
plugin
49€
Custom CSS Plugin
plugin
free
Installation & Update support
support
upon request
Recalculate rates plugin
plugin
free