Custom fields

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, so the access can be restricted:
    • to certain customer/project/activity combinations (eg. a “location” field will only be shown for customer X and project Y)
    • to users with certain permissions or roles
  • can be described with a name and help text
  • has a maximum length of 255 character

The custom-field data is then available in:

  • Data-tables will display all visible fields
  • Exports (HTML and Spreadsheets include all visible fields)
  • Timesheet exports (include visible timesheet fields)
  • API (collections and entities)
  • Invoice templates (custom templates have access to all fields)

You can change the “weight” of custom-fields, so they show up in the order you define.

Be aware:

  • 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 fields will only be shown in the edit forms
  • Sensitive data can be configured as “invisible”, so it will not show up in the above mentioned places
  • Custom fields for users are not exported via the API (this is a limitation in the core application)

Permissions

Permission Name Description
configure_meta_fields allows to administrate the custom field definitions

By default, these are assigned to each user with the role ROLE_SUPER_ADMIN.

Field types

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

Input field type Description
string simple text field
integer number without decimal point
number number with decimal places
duration enter a duration in various formats
money  
language dropdown of languages, shown in the user language
currency dropdown of currencies, shown in the user language
country dropdown of countries, shown in the user language
color browser specific input element to select a color
date type a date or select it from the datepicker
datetime type a date and time or select it from the picker
email enter an email address (with basic validation)
textarea multi-line text field
invoice template dropdown
checkbox on/off
choice-list drop-down with custom entries

Checkbox

Use the value 1 as default value for a pre-checked box or 0 for an unchecked box.

If a checkbox is marked as mandatory, the user has to check it in order to submit the form.

Choice-list

“Choice-list” is a different word for “Select-box” or “Drop-down”. You have to add the entries as comma separated list into the default-value field. For example a list consisting of fruits would look like this: Banana,Apple,Orange,Pineapple,Peach.

As the first entry is pre-selected, you can add an empty field to the dropdown by starting the list with a leading , like this: ,Banana,Apple,Orange,Pineapple,Peach. Combined with the mandatory flag, this will force your users to select an entry from the list to be able to submit the form.

Choice list is also capable to configure title and values independently. Let’s assume you have non-human friendly IDs for the value, but want to show a human friendly text, you can separate each value from its title by using a pipe | character: ,01|Banana,02|Apple,Orange,foo|Pineapple,0815|Peach.

Invoice template

A select box that is useful if you want to generate automatic invoices via command line / cronjobs.

The Kimai command bin/console kimai:invoice:create supports invoice templates via custom-field (see docs). The option parameter --template-meta takes the internal name of the custom field that will identify the invoice template to be used.