Skip to content

Commit

Permalink
added alert plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Jul 29, 2024
1 parent 857a91d commit 45c5fdd
Show file tree
Hide file tree
Showing 53 changed files with 161 additions and 209 deletions.
2 changes: 1 addition & 1 deletion _docu_versioned/1.14/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Activities in Kimai are meant to explain the kind of work done for a specific ta

Activities can have two different types: `global` and `project specific`.

{% include alert.html icon="alarm-exclamation" type="warning" alert="Activities cannot be linked to a customer, the customer field in the edit form is only a filter for the project list." %}
{% alert warning %}Activities cannot be linked to a customer, the customer field in the edit form is only a filter for the project list.{% endalert %}

### Project specific

Expand Down
2 changes: 1 addition & 1 deletion _docu_versioned/1.14/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There are a couple of differences in these two Kimai modules, the most important

## Security and privacy

{% include alert.html type="danger" alert="The export extension DOES NOT check permissions, as this would defeat the purpose of an export." %}
{% alert danger %}The export extension DOES NOT check permissions, as this would defeat the purpose of an export.{% endalert %}

So giving a user the permission to export data allows to see most time related data in Kimai
(like customer, projects, activities, rates, time worked per user and more).
Expand Down
9 changes: 3 additions & 6 deletions _docu_versioned/1.14/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ And run the Kimai installer:
bin/console kimai:install -n
```

{% capture windows %}
{% alert warning %}
Windows users might have to prefix the composer and installation commands with `php`, eg.:
`php bin/console kimai:install -n`
{% endcapture %}
{% assign windows = windows|markdownify %}

{% include alert.html icon="fab fa-windows" type="warning" alert=windows %}
{% endalert %}

### File permissions

Expand All @@ -62,7 +59,7 @@ If you are going to [import data from Kimai v1]({% link _documentation/migration
Configure your web server (like Nginx or Apache) to point its DocumentRoot at the `public/` directory.
For more details, see the [Webserver How-To]({% link _documentation/webserver-configuration.md %}).

{% include alert.html icon="far fa-smile-beam" type="success" alert="Installation complete: enjoy time-tracking!" %}
{% alert %}Installation complete: enjoy time-tracking!{% endalert %}

Oh ... wait! Before you leave, please read the [initial setup guide]({% link _documentation/initial-setup.md %}).

Expand Down
8 changes: 3 additions & 5 deletions _docu_versioned/1.14/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ All examples represent the date `2019-07-09` (2019, July 9th):
Each replacer (x) can be combined with a length formatter, which will prepend (X) leading zeros, eg. `{x,X}`.
Example: to get a three digit long string with year counter use `{cy,3}`, which results in `001` for the first invoice of the year.

{% capture additional_chars %}
{% alert warning %}
Characters outside the replacer may **not** include `{` and `}`.
{% endcapture %}
{% assign additional_chars = additional_chars| markdownify %}
{% include alert.html icon="alarm-exclamation" type="warning" alert=additional_chars %}
{% endalert %}

To change the format, look out for the {% include demo-action-button.html icon="bx bx-cog" %} icon in the invoice screen, or change it from the `System configurations`.

Expand Down Expand Up @@ -137,7 +135,7 @@ Be aware of the following rules:
- You can hide the default templates by setting the key `kimai.invoice.defaults` to an empty array / null
- New or updated templates can be uploaded via the UI

{% include alert.html icon="alarm-exclamation" type="warning" alert="Do NOT change the default templates, but copy the file and save it (with a new filename) at var/invoices/" %}
{% alert warning %}Do NOT change the default templates, but copy the file and save it (with a new filename) at var/invoices/{% endalert %}

After you changed an invoice template, you have to [clear the cache]({% link _documentation/cache.md %}) to see the results:

Expand Down
10 changes: 5 additions & 5 deletions _docu_versioned/1.14/ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ User data is synchronized on each login, fetching the latest data from your LDAP
Obviously Kimai does not store the users password when logged-in via LDAP and there is
no fallback mechanism implemented, if your LDAP is not available (currently only ONE server can be configured).

{% include alert.html type="danger" alert="The default configuration allows a user to change the internal password. This manually chosen password is not overwritten by the LDAP plugin and would allow a user to login, even after you removed him from LDAP." %}
{% alert danger %}The default configuration allows a user to change the internal password. This manually chosen password is not overwritten by the LDAP plugin and would allow a user to login, even after you removed him from LDAP.{% endalert %}

To prevent that problem:
- disable the "[Password reset]({% link _documentation/users.md %})" function
Expand Down Expand Up @@ -257,7 +257,7 @@ kimai:
- { ldap_attr: mail, user_method: setEmail }
- { ldap_attr: cn, user_method: setAlias }
```
{% include alert.html type="warning" alert="You need to configure the attributes in lower-case, otherwise they won't be processed." %}
{% alert warning %}You need to configure the attributes in lower-case, otherwise they won't be processed.{% endalert %}

In this example we tell Kimai to sync the following fields:
- `uid` will be the username in Kimai (will fail with a 500 if not unique)
Expand All @@ -272,7 +272,7 @@ Its unlikely that you will need those, but they also exist: `setEnabled(bool)`,
Kimai can use your LDAP groups and map them to [user roles]({% link _documentation/users.md %}).
If configured, it will execute another `search` against your LDAP after authentication and importing the user attributes.

{% include alert.html type="warning" alert="Every user automatically owns the ROLE_USER role, you don't have to create a mapping for it." %}
{% alert warning %}Every user automatically owns the ROLE_USER role, you don't have to create a mapping for it.{% endalert %}

Assuming this `role` configuration:
```yaml
Expand Down Expand Up @@ -331,7 +331,7 @@ The rule is: either manage all roles in Kimai or in LDAP, mixing is not possible

## Examples

{% include alert.html type="info" alert="Before you start to configure your LDAP, switch to 'dev' environment and tail 'var/log/dev.log'." %}
{% alert %}Before you start to configure your LDAP, switch to 'dev' environment and tail 'var/log/dev.log'.{% endalert %}

Another simple solution to debug the generated queries is to start your OpenLDAP with `sudo /usr/libexec/slapd -d256`.

Expand Down Expand Up @@ -438,6 +438,6 @@ kimai:
- { ldap_value: Sysadmins, role: ROLE_SUPER_ADMIN }
- { ldap_value: Users, role: ROLE_USER }
```
{% include alert.html type="warning" alert="You need to configure the attributes in lower-case, otherwise they won't be processed." %}
{% alert warning %}You need to configure the attributes in lower-case, otherwise they won't be processed.{% endalert %}

The LDAP code is based on [the work](https://github.com/Maks3w/FR3DLdapBundle) by @Maks3w , thanks for sharing!
10 changes: 4 additions & 6 deletions _docu_versioned/1.14/migration-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ canonical: /documentation/migration-v1.html

This documentation covers all necessary steps to migrate from Kimai 1 to Kimai 2.

{% capture upgrade_note %}
{% alert %}
You can <a href="{% link _store/keleo-installation-support.md %}">get professional support</a> if you are not sure about performing the upgrade yourself.
{% endcapture %}

{% include alert.html type="success" icon="support" alert=upgrade_note %}
{% endalert %}

## Introduction

Expand Down Expand Up @@ -48,7 +46,7 @@ The database does not have to be on the same server and the database user (for t

## Database import

{% include alert.html type="warning" alert="It is strongly recommended to test the import, as unexpected problems may occur. If you already created data (like users and customers), backup your Kimai 2 database before performing the first tests!" %}
{% alert warning %}It is strongly recommended to test the import, as unexpected problems may occur. If you already created data (like users and customers), backup your Kimai 2 database before performing the first tests!{% endalert %}

See the help for the import command and all its arguments by executing:

Expand Down Expand Up @@ -80,7 +78,7 @@ Kimai 1 was written a long time ago, when MySQL was lacking proper UTF8 support
While [migrating dozens of customers installations]({% link _store/keleo-installation-support.md %}) I stumbled upon some recurring problems,
that can be solved with some SQL commands.

{% include alert.html type="warning" alert="Be aware, depending on your Kimai 1 version the field names might be different in the following snippets" %}
{% alert warning %}Be aware, depending on your Kimai 1 version the field names might be different in the following snippets{% endalert %}

#### Broken character

Expand Down
6 changes: 3 additions & 3 deletions _docu_versioned/1.14/saml.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ A brief description of the available fields:

If you have troubles with your certificate you could [try to use this SAML online tool](https://www.samltool.com/format_x509cert.php) to find the correct formatting (whether you trust this tool is up to you!). You could use it with fake data, check the result format and then apply it to your certificate manually.

{% include alert.html type="info" alert="User data and roles are synchronized during each login." %}
{% include alert.html type="info" alert="Every user automatically owns the ROLE_USER role, you don't have to create a mapping for it." %}
{% include alert.html type="warning" alert="Every user needs a username and email address, you cannot activate SAML without a mapping for the email. The username cannot be set from SAML attributes, but will always be taken from the SAML request." %}
{% alert %}User data and roles are synchronized during each login.{% endalert %}
{% alert %}Every user automatically owns the ROLE_USER role, you don't have to create a mapping for it.{% endalert %}
{% alert warning %}Every user needs a username and email address, you cannot activate SAML without a mapping for the email. The username cannot be set from SAML attributes, but will always be taken from the SAML request.{% endalert %}

### Connection details

Expand Down
2 changes: 1 addition & 1 deletion _docu_versioned/1.14/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Teams allow you to organize your users in groups and limit access to customers a
A team consists of a Teamlead and an unlimited amount of team members. The teamlead has access to all contents and timesheets of the team.
Every content object can be linked to an arbitrary amount of teams.

{% include alert.html type="warning" icon="alarm-exclamation" alert="Using teams is optional. But once a team is assigned to a customer or project, access to this object and its children is limited." %}
{% alert warning %}Using teams is optional. But once a team is assigned to a customer or project, access to this object and its children is limited.{% endalert %}

If you want to limit the access to Kimai functionality instead of content,
please read the [permissions documentation]({% link _documentation/permissions.md %}).
Expand Down
6 changes: 3 additions & 3 deletions _docu_versioned/1.14/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ There are four pre-defined roles in Kimai, which define the ACLs/permissions.
| ROLE_SUPER_ADMIN | Has permissions to manage everything in Kimai, from content to timesheets to users, plugins and system configurations |
{: .table }

{% include alert.html type="success" alert="Every user is automatically member of the ROLE_USER, this behaviour cannot be changed." %}
{% alert %}Every user is automatically member of the ROLE_USER, this behaviour cannot be changed.{% endalert %}

{% include alert.html type="warning" alert="ROLE_ADMIN and ROLE_SUPER_ADMIN are special roles and treated different internally: they are not bound to team permissions and can see all content, no matter what their team assignments looks like." %}
{% alert warning %}ROLE_ADMIN and ROLE_SUPER_ADMIN are special roles and treated different internally: they are not bound to team permissions and can see all content, no matter what their team assignments looks like.{% endalert %}

The applied permissions of your Kimai installation can be seen via the user administration,
e.g. [https://demo.kimai.org/en/admin/permissions](https://demo.kimai.org/en/admin/permissions).
Expand All @@ -43,7 +43,7 @@ e.g. [https://demo.kimai.org/en/admin/permissions](https://demo.kimai.org/en/adm

If the pre-defined roles are not sufficient for your use-case and you need more roles, you can create new ones.

{% include alert.html type="warning" alert="Allowed character are: `A-Z` and `_`. If you use different character, you might experience strange bugs." %}
{% alert warning %}Allowed character are: `A-Z` and `_`. If you use different character, you might experience strange bugs.{% endalert %}

Every user with the [permission]({% link _documentation/permissions.md %}) `role_permissions` can create new user roles
through the user administration. Navigate to the user role permission screen and check the pages action.
Expand Down
8 changes: 3 additions & 5 deletions _docu_versioned/1.15/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ All examples represent the date `2019-07-09` (2019, July 9th):
Each replacer (x) can be combined with a length formatter, which will prepend (X) leading zeros, eg. `{x,X}`.
Example: to get a three digit long string with year counter use `{cy,3}`, which results in `001` for the first invoice of the year.

{% capture additional_chars %}
{% alert warning %}
Characters outside the replacer **cannot** include `{` and `}`.
{% endcapture %}
{% assign additional_chars = additional_chars| markdownify %}
{% include alert.html icon="alarm-exclamation" type="warning" alert=additional_chars %}
{% endalert %}

To change the format, look out for the {% include demo-action-button.html icon="bx bx-cog" %} icon in the invoice screen, or change it from the `System configurations`.

Expand Down Expand Up @@ -143,7 +141,7 @@ Be aware of the following rules:
- You should store your templates in `var/invoices/`, as this directory is not shipped with Kimai and not touched during updates
- You can [configure different search directories]({% link _documentation/local-yaml.md %}) through the config key `kimai.invoice.documents` if you want to add additional template source directories

{% include alert.html icon="alarm-exclamation" type="warning" alert="Do NOT change the default templates, but copy the file and save it (with a new filename) at var/invoices/" %}
{% alert warning %}Do NOT change the default templates, but copy the file and save it (with a new filename) at var/invoices/{% endalert %}

After you changed an invoice template, you have to [clear the cache]({% link _documentation/cache.md %}) to see the results.

Expand Down
10 changes: 5 additions & 5 deletions _docu_versioned/1.30.0/ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ kimai:
- { ldap_attr: mail, user_method: setEmail }
- { ldap_attr: cn, user_method: setAlias }
```
{% include alert.html type="warning" alert="You need to configure the attributes in lower-case, otherwise they won't be processed." %}
{% alert warning %}You need to configure the attributes in lower-case, otherwise they won't be processed.{% endalert %}
In this example we tell Kimai to sync the following fields:
- `uid` will be the username in Kimai (will fail with a 500 if not unique)
Expand All @@ -241,7 +241,7 @@ Its unlikely that you will need those, but they also exist: `setEnabled(bool)`,
Kimai can use your LDAP groups and map them to [user roles]({% link _documentation/users.md %}).
If configured, it will execute another `search` against your LDAP after authentication and importing the user attributes.

{% include alert.html type="warning" alert="Every user automatically owns the ROLE_USER role, you don't have to create a mapping for it." %}
{% alert warning %}Every user automatically owns the ROLE_USER role, you don't have to create a mapping for it.{% endalert %}

Assuming this `role` configuration:
```yaml
Expand All @@ -267,7 +267,7 @@ After finding a list of group names, they will be converted to Kimai roles:

These converted names will be validated and [only existing roles]({% link _documentation/users.md %}) will pass to the user profile.

{% include alert.html type="info" alert="Remove the entire 'role' configuration block to deactivate role sync!" %}
{% alert %}Remove the entire 'role' configuration block to deactivate role sync!{% endalert %}

## Known limitations

Expand Down Expand Up @@ -302,7 +302,7 @@ The rule is: either manage all roles in Kimai or in LDAP, mixing is not possible

## Examples

{% include alert.html type="info" alert="Before you start to configure your LDAP, switch to 'dev' environment and tail 'var/log/dev.log'." %}
{% alert %}Before you start to configure your LDAP, switch to 'dev' environment and tail 'var/log/dev.log'.{% endalert %}

Another simple solution to debug the generated queries is to start your OpenLDAP with `sudo /usr/libexec/slapd -d256`.

Expand Down Expand Up @@ -412,7 +412,7 @@ kimai:
- { ldap_value: Sysadmins, role: ROLE_SUPER_ADMIN }
- { ldap_value: Users, role: ROLE_USER }
```
{% include alert.html type="warning" alert="You need to configure the attributes in lower-case, otherwise they won't be processed." %}
{% alert warning %}You need to configure the attributes in lower-case, otherwise they won't be processed.{% endalert %}

The LDAP code is based on [the work](https://github.com/Maks3w/FR3DLdapBundle) by @Maks3w , thanks for sharing!

Expand Down
11 changes: 4 additions & 7 deletions _docu_versioned/1.30.0/local-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ The most important configuration files of Kimai are:

There are several other configurations that could potentially be interesting for you in [config/packages/*.yaml]({{ site.kimai_v2_file }}/config/packages/).

{% capture dont_edit_configs %}
{% alert danger %}
Don't edit any of the configuration files (eg. `config/packages/kimai.yaml`) directly, as they will be overwritten during an update.
Adjust settings from any configuration file by adding them in your own configuration in `local.yaml` (see below).
{% endcapture %}
{% assign dont_edit_configs = dont_edit_configs|markdownify %}

{% include alert.html icon="alarm-exclamation" type="danger" alert=dont_edit_configs %}
{% endalert %}

### .env

Expand All @@ -39,7 +36,7 @@ These "environment specific settings" are required so Kimai can boot. They are s
- `DATABASE_URL` - database connection for storing all application data
- `APP_SECRET` - secret used to encrypt session cookies (users will be logged out if you change it)

{% include alert.html icon="alarm-exclamation" type="warning" alert="You don't need a .env file, but can set these environment values via webserver config as well. Later ones will take precedence over the .env entries." %}
{% alert warning %}You don't need a .env file, but can set these environment values via webserver config as well. Later ones will take precedence over the .env entries.{% endalert %}

### local.yaml

Expand Down Expand Up @@ -68,7 +65,7 @@ The `local.yaml` file will be imported as last configuration file, so you can ov
Whenever the documentation asks you to edit a yaml file from the `config/packages/` directory, it means you should copy
this specific configuration key to your `local.yaml` in order to overwrite the default configuration.

{% include alert.html icon="alarm-exclamation" type="warning" alert="Be consistent with the indentation and don't mix spaces and tabs, YAML is very sensitive about that!" %}
{% alert warning %}Be consistent with the indentation and don't mix spaces and tabs, YAML is very sensitive about that!{% endalert %}

### Reload configurations

Expand Down
2 changes: 1 addition & 1 deletion _docu_versioned/1.30.0/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The following [permissions]({% link _documentation/permissions.md %}) are genera
If the current user owns the `view_other_timesheet` permission the displayed username will be replaced by a user select box.
The available users to choose from are either all (if the user owns the permission `view_all_data`) or all his team member (if he is a team leader).

{% include alert.html type="info" alert="Plugins can ship their own reports, the following list contains the reports shipped in default installations." %}
{% alert %}Plugins can ship their own reports, the following list contains the reports shipped in default installations.{% endalert %}

## Single user

Expand Down
Loading

0 comments on commit 45c5fdd

Please sign in to comment.