A Kimai 2 plugin, which allows to configure additional fields for timesheets, customers, projects and activities.
You can test it in the “Plugins” demo.
Configure additional fields in various formats for the following data types:
You can create as many fields as you want for each data type, where each field:
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:
The custom fields / the entered values are available in:
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.
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;
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);
Extract the ZIP file and upload the included directory and all files to your Kimai installation to the new directory:
The file structure needs to like like this afterwards:
var/plugins/ ├── MetaFieldsBundle │ ├── MetaFieldsBundle.php | └ ... more files and directories follow here ...
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
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.
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
permissions: roles: ROLE_ADMIN: ['configure_meta_fields']
After changing the permissions, you need to clear the cache one more time.
Records detailed change/audit logs for timesheets, customers, projects and activities and displays them in a per-item timeline.
Create free configurable additional (optional and mandatory) fields for timesheets, customers, projects and activities in various formats.
|Custom CSS Plugin||
|Installation & Update support||
|Recalculate rates plugin||