Giter Site home page Giter Site logo

sharedprojecttimesheetsbundle's Introduction

Shared Project Timesheets Bundle - Kimai 2 Plugin

A Kimai 2 plugin that allows you to share your project timesheets with anyone you want to grant access to.

Features

  • Create publicly accessible urls for the project timesheets you want to share
  • Access control feature
    • protect the shared project timesheets with a password
  • View control feature
    • show or hide user of records (name of user)
    • show or hide rates of records (hour rate, total rate)
    • show or hide chart with day comparison by selected month
    • show or hide chart with month comparison by selected year
  • View customizations
    • define whether and how to merge records of a day (e.g. merge records of one day, use description of last record)

Installation

First clone this plugin to your Kimai installation plugins directory:

cd /kimai/var/plugins/
git clone https://github.com/dexterity42/SharedProjectTimesheetsBundle.git

Go back to the root of your Kimai installation and clear the cache:

cd /kimai/
bin/console cache:clear
bin/console cache:warmup

Execute database migrations:

bin/console kimai:bundle:shared-project-timesheets:install

You're done. Open up your browser and navigate to "Shared project timesheets".

Permissions

Currently, there are no specific plugin permissions. The role ROLE_SUPER_ADMIN is required to manage the shared project timesheets.

sharedprojecttimesheetsbundle's People

Contributors

dexterity42 avatar kevinpapst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sharedprojecttimesheetsbundle's Issues

database migration error

I tried to install the plugin but got the following error:

Migration 2020120600000 failed during Execution. Error Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.

[ERROR] Failed to install SharedProjectTimesheetsBundle database: Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.

I am using MariaDB. Any idea how to solve the issue?

Permissions for non-admin users

It would be great if non admin users could use the plugin as well. I have contacted the developer of kimai and his response was as follow:

'The decision was made by the developer to hard-wire it to the Super-Admin, see eg. these lines:
https://github.com/dexterity42/SharedProjectTimesheetsBundle/blob/master/EventSubscriber/MenuSubscriber.php#L49
https://github.com/dexterity42/SharedProjectTimesheetsBundle/blob/master/Controller/ManageController.php#L28

While the CustomCSSBundle ships its own permissions:
https://github.com/Keleo/CustomCSSBundle/blob/master/DependencyInjection/CustomCSSExtension.php#L39
And then make use of them:
https://github.com/Keleo/CustomCSSBundle/blob/master/Controller/CustomCssController.php#L23
https://github.com/Keleo/CustomCSSBundle/blob/master/EventSubscriber/MenuSubscriber.php#L56

With these links, it should be easy for @dexterity42 to introduce a set of permissions.'

Maybe it helps to amend the plugin?

Error 404 when selecting something on the shared timesheet

Kimai version: 1.19.3
PHP v : 8.0.17
SharedProjectTimesheetsBundle v: 2.1.0

Error 404 occurs when:

  1. Selecting a month or a year
  2. Clicking on button 'chart' or 'table'

The url *.com/public/en/auth/shared-project-timesheets/17/40e35562f616 works, but when clicking on a button it changes to *.com/en/auth/shared-project-timesheets/17/40e35562f616?year=2023&month=4 which gives the 404 Error.

If I manually add /public/ in the url with the request, it works again. How can I fix this?

fails: *.com/en/auth/shared-project-timesheets/17/40e35562f616?year=2023&month=4
works: *.com/public/en/auth/shared-project-timesheets/17/40e35562f616?year=2023&month=4

Merge mode: split records by user

Current state / Issue
Merge mode combines records of all users.

Feature / Improvement
Only merge records from the same user (one per user per day).

SharedProjectTimesheetsBundle with an exception

Hi there,
I installed your plugin on a Kimai 1.6.1 and Debian 11 Linux. Unfortunately that does not start, but throws out these log messages:

[2021-11-18 08:37:59] request.INFO: Matched route "manage_shared_project_timesheets". {"route":"manage_shared_project_timesheets","route_parameters":{"_route":"manage_sh,"_controller":"KimaiPlugin\\SharedProjectTimesheetsBundle\\Controller\\ManageController::index","_locale":"de"},"request_uri":"http://timerecording.example.tld/de/adheets","method":"GET"} []
[2021-11-18 08:37:59] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area","token_class":"Symfony\\Component\\Security\\Core\\AernamePasswordToken"} []
[2021-11-18 08:37:59] security.DEBUG: User was reloaded from a user provider. {"provider":"App\\Security\\KimaiUserProvider","username":"Admin"} []
[2021-11-18 08:37:59] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"secured_area","authenticators":1} []
[2021-11-18 08:37:59] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2021-11-18 08:37:59] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator
[2021-11-18 08:37:59] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: "An exception occurred while executing 'SELECT k0_.id AS iare_key_1, k0_.password AS password_2, k0_.entry_user_visible AS entry_user_visible_3, k0_.entry_rate_visible AS entry_rate_visible_4, k0_.record_merge_mode AS record_mehart_visible AS annual_chart_visible_6, k0_.monthly_chart_visible AS monthly_chart_visible_7, k0_.project_id AS project_id_8 FROM kimai2_shared_project_timesheets k0_ IN k1_ ON (k0_.project_id = k1_.id) ORDER BY k1_.name ASC, k0_.share_key ASC':  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai2.kimai2_shared_project_timat /srv/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 61 {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundExceptio occurred while executing 'SELECT k0_.id AS id_0, k0_.share_key AS share_key_1, k0_.password AS password_2, k0_.entry_user_visible AS entry_user_visible_3, k0_.entry_ratvisible_4, k0_.record_merge_mode AS record_merge_mode_5, k0_.annual_chart_visible AS annual_chart_visible_6, k0_.monthly_chart_visible AS monthly_chart_visible_7, k0_.pr FROM kimai2_shared_project_timesheets k0_ INNER JOIN kimai2_projects k1_ ON (k0_.project_id = k1_.id) ORDER BY k1_.name ASC, k0_.share_key ASC':\n\nSQLSTATE[42S02]: Basd: 1146 Table 'kimai2.kimai2_shared_project_timesheets' doesn't exist at /srv/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:61, Doctrixception(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai2.kimai2_shared_project_timesheets' doesn't exist at /srv/www/kimai2/vendor/doctriL/Driver/PDO/Exception.php:18, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai2.kimai2_shared_project_timesheets' doesn't exindor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:137)"} []
[2021-11-18 08:37:59] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

Can you help me fix this error?

Thanks and best regards

Andreas

Error going to menu item

Installed SharedProjectTimesheetsBundle and it displays in my plugin screen as active. When I click on the menu item for SPT in the left hand column I get a message "A critical error occurred, please try again. You may have found a software problem, please contact your administrator if the problem persists."

Support customer currency

Current state
Currently, there is only one currency supported (EUR).

Issue
None

Feature/Improvement
Add support for the currency of the customer.
Determine the currency of the timesheet by using the projects customer.

Can not install plugin

Hey,

the following error occurs on installing, making kimai unusable:
[ERROR] Failed to install SharedProjectTimesheetsBundle database: Migrations configuration key "table_storage" does not exist.

I performed the installation as documented in the README, including cache clear & warmup.

Chart to compare days

Current state / Issue
There is no chart available.

Feature / Improvement
Implement a chart which consists of duration and rate for each day of the selected month.

Enhancement: SharedClientTimesheetsBundle

I wondered if it was possible to extend your plugin so that also complete client timesheets (with more than one project) could be shared in the same way as project based timesheets are now? Let's say you're a freelancer and work with someone on different projects as a case scenario.

For this purpose I've already tried the Readonly Access Plugin, but your solution is way more elegant and better to use for clients, because it doens't need any explanation to it: you just send the link and you're done.

Thanks for a fantastic plugin and all the work you put into it!

Option to copy link

First of all, thanks for the great plugin.

I am missing an option to copy the link by simply clicking somewhere. When I click the link, the link is opened (which is good for checking). Also marking the link is tricky because at least my browser opens the entry so that I cannot copy the link address. The drop down menu has just one option namely to delete the link. The only way (I managed) to copy the link is to firstly click the link and then to copy the address from the bowser bar in the new tab.

Maybe, the link symbol could be used for a "click and copy action" and/or an option "copy link" could be offered in the drop down menu?

Add record date

Current state
The shared view shows the duration of entries.

Issue
None.

Feature/Improvement
Add date of the record to the view table.

URL Rewrite

Within the Admin Panel of SharedProjectTimesheets the link to add the first shared Project points to Server IP instead of the currently used URL as you can see in the screenshot.
Using the Add Button at the top right corner uses the correct URL.

image

Shared Links use the incorrect URL too.

image

edit: Proxy didnt passed the host-header correctly - now working for the URL, used internally

Maybe you can add an option to rewrite the URL's used by the plugin to a specific one (e.g. if using split-brain DNS)

error if i delete the sharedprojecttimesheet plugin

I deleted the SharedProjectTimesheet Plugin as follow:

delete of the folder in /var/www/kimai2/var/plugins/

then i reload the cache via:

cd /var/www/kimai2
bin/console kimai:reload --env=prod

and now i have the following error:

13:03:00 WARNING [php] Warning: include(): Failed opening '/var/www/kimai2/vendor/composer/../../var/plugins/SharedProjectTimesheetsBundle/Controller/ManageController.php' for inclusion (include_path='.:/usr/share/php') ["exception" => ErrorException { …}]
13:03:00 WARNING [php] Warning: include(/var/www/kimai2/vendor/composer/../../var/plugins/SharedProjectTimesheetsBundle/Controller/ViewController.php): Failed to open stream: No such file or directory ["exception" => ErrorException { …}]
13:03:00 WARNING [php] Warning: include(): Failed opening '/var/www/kimai2/vendor/composer/../../var/plugins/SharedProjectTimesheetsBundle/Controller/ViewController.php' for inclusion (include_path='.:/usr/share/php') ["exception" => ErrorException { …}]
13:03:00 WARNING [php] Warning: include(/var/www/kimai2/vendor/composer/../../var/plugins/SharedProjectTimesheetsBundle/Entity/SharedProjectTimesheet.php): Failed to open stream: No such file or directory ["exception" => ErrorException { …}]
13:03:00 WARNING [php] Warning: include(): Failed opening '/var/www/kimai2/vendor/composer/../../var/plugins/SharedProjectTimesheetsBundle/Entity/SharedProjectTimesheet.php' for inclusion (include_path='.:/usr/share/php') ["exception" => ErrorException { …}]

Kimai is running, but does anyone know, how to fix this?

Kimai 2.0 support

Hello.

I am a heavy user of this feature.

My company uses this feature to inform our clients of our work status and it has been very helpful.

So I am hesitant to upgrade Kimai until this feature is supported by Kimai 2.0.

It would be very nice if you could support Kimai 2.0!

Kimai 2.0 compatible version inside

There has been no activity here since a a very long time, your personal profile shows no GitHub activity since more than a year.

This plugin was used by many companies and they postpone upgrading to 2.0.x right now, because of the missing compatibility.

To circumvent that I cloned the plugin to https://github.com/Keleo/SharedProjectTimesheetsBundle and upgraded it for the new major version.

The latest release, compatible with 2.0.26, can be grabbed from here: https://github.com/Keleo/SharedProjectTimesheetsBundle/releases/tag/3.0.0

[ERROR] Failed to install SharedProjectTimesheetsBundle database: Migrations configuration key "name" does not exist.

Hi,
with the latest update to 1.15.1 (stable) the install of the plugin is not working anymore:

`bash-5.1$ git clone https://github.com/dexterity42/SharedProjectTimesheetsBundle.git
Cloning into 'SharedProjectTimesheetsBundle'...
remote: Enumerating objects: 196, done.
remote: Counting objects: 100% (196/196), done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 196 (delta 83), reused 172 (delta 62), pack-reused 0
Receiving objects: 100% (196/196), 53.58 KiB | 2.06 MiB/s, done.
Resolving deltas: 100% (83/83), done.
bash-5.1$ ls -ltr
total 4
drwxr-xr-x 15 www-data www-data 4096 Sep 24 19:15 SharedProjectTimesheetsBundle
bash-5.1$ cd /opt/kimai/
bash-5.1$ bin/console cache:clear

// Clearing the cache for the prod environment with debug false

[OK] Cache for the "prod" environment (debug=false) was successfully cleared.

bash-5.1$ bin/console cache:warmup

// Warming up the cache for the prod environment with debug false

[OK] Cache for the "prod" environment (debug=false) was successfully warmed.

bash-5.1$ bin/console
Kimai 1.15.1 (env: prod, debug: false)

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-e, --env=ENV The Environment name. [default: "prod"]
--no-debug Switches off debug mode.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
about Display information about the current project
help Display help for a command
list List commands
assets
assets:install Install bundle's web assets under a public directory
cache
cache:clear Clear the cache
cache:pool:clear Clear cache pools
cache:pool:delete Delete an item from a cache pool
cache:pool:list List available cache pools
cache:pool:prune Prune cache pools
cache:warmup Warm up an empty cache
config
config:dump-reference Dump the default configuration for an extension
dbal
dbal:run-sql Executes arbitrary SQL directly from the command line.
debug
debug:autowiring List classes/interfaces you can use for autowiring
debug:config Dump the current configuration for an extension
debug:container Display current services for an application
debug:event-dispatcher Display configured listeners for an application
debug:form Display form type information
debug:router Display current routes for an application
debug:translation Display translation messages information
debug:twig Show a list of twig functions, filters, globals and tests
doctrine
doctrine:cache:clear-collection-region Clear a second-level cache collection region
doctrine:cache:clear-entity-region Clear a second-level cache entity region
doctrine:cache:clear-metadata Clears all metadata cache for an entity manager
doctrine:cache:clear-query Clears all query cache for an entity manager
doctrine:cache:clear-query-region Clear a second-level cache query region
doctrine:cache:clear-result Clears result cache for an entity manager
doctrine:database:create Creates the configured database
doctrine:database:drop Drops the configured database
doctrine:database:import Import SQL file(s) directly to Database.
doctrine:ensure-production-settings Verify that Doctrine is properly configured for a production environment
doctrine:mapping:convert [orm:convert:mapping] Convert mapping information between supported formats
doctrine:mapping:import Imports mapping information from an existing database
doctrine:mapping:info
doctrine:migrations:current [current] Outputs the current version
doctrine:migrations:diff [diff] Generate a migration by comparing your current database to your mapping information.
doctrine:migrations:dump-schema [dump-schema] Dump the schema for your database to a migration.
doctrine:migrations:execute [execute] Execute one or more migration versions up or down manually.
doctrine:migrations:generate [generate] Generate a blank migration class.
doctrine:migrations:latest [latest] Outputs the latest version
doctrine:migrations:list [list-migrations] Display a list of all available migrations and their status.
doctrine:migrations:migrate [migrate] Execute a migration to a specified version or the latest available version.
doctrine:migrations:rollup [rollup] Rollup migrations by deleting all tracked versions and insert the one version that exists.
doctrine:migrations:status [status] View the status of a set of migrations.
doctrine:migrations:sync-metadata-storage [sync-metadata-storage] Ensures that the metadata storage is at the latest version.
doctrine:migrations:up-to-date [up-to-date] Tells you if your schema is up-to-date.
doctrine:migrations:version [version] Manually add and delete migration versions from the version table.
doctrine:query:dql Executes arbitrary DQL directly from the command line
doctrine:query:sql Executes arbitrary SQL directly from the command line.
doctrine:schema:create Executes (or dumps) the SQL needed to generate the database schema
doctrine:schema:drop Executes (or dumps) the SQL needed to drop the current database schema
doctrine:schema:update Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata
doctrine:schema:validate Validate the mapping files
kimai
kimai:bundle:shared-project-timesheets:install Install bundle/plugin shared-project-timesheets
kimai:import:customer Import customer from CSV file
kimai:import:project Import projects from CSV file
kimai:import:timesheet Import timesheets from CSV file
kimai:import:v1 [kimai:import-v1] Import data from a Kimai v1 installation
kimai:install Basic installation for Kimai
kimai:invoice:create Create invoices
kimai:plugins Receive plugin information
kimai:reload Reload Kimai caches
kimai:update Update your Kimai installation
kimai:user:activate [fos:user:activate] Activate a user
kimai:user:create [kimai:create-user] Create a new user
kimai:user:deactivate [fos:user:deactivate] Deactivate a user
kimai:user:demote [fos:user:demote] Demote a user by removing a role
kimai:user:password [fos:user:change-password] Change the password of a user.
kimai:user:promote [fos:user:promote] Promotes a user by adding a role
kimai:version Receive version information
lint
lint:container Ensure that arguments injected into services match type declarations
lint:twig Lint a template and outputs encountered errors
lint:xliff Lint an XLIFF file and outputs encountered errors
lint:yaml Lint a file and outputs encountered errors
router
router:match Help debug routes by simulating a path info match
secrets
secrets:decrypt-to-local Decrypt all secrets and stores them in the local vault.
secrets:encrypt-from-local Encrypt all local secrets to the vault.
secrets:generate-keys Generate new encryption keys.
secrets:list List all secrets.
secrets:remove Remove a secret from the vault.
secrets:set Set a secret in the vault.
security
security:encode-password Encode a password.
translation
translation:update Update the translation file
bash-5.1$ bin/console kimai:bundle:shared-project-timesheets:install

[ERROR] Failed to install SharedProjectTimesheetsBundle database: Migrations configuration key "name" does not exist.

bash-5.1$
`

Feature Request: graphical Dashboard for the projects runtime

Hi there,
thank you very much for this extension. We would find it very helpful if there would be a graphical visualisation of the time consumption per month based on the year. One could choose the time like you can choose time frames when invoicing (last month, last year, custom timeframe...) .
Maybe something interesting for more users?
Best regards,
Markus

Time records of current month not shown

Current state / Issue
The shared view doesnt show entries of the current month (December 2020 right now).

Feature / Improvement / Fix
Adjust query to provide data for the current month, but only when record end is set.

Merge time records of one day

Current state
The shared view provides a table of time records.
Each time record results in a separate table row with duration and rate.

Issue
None

Feature/Improvement
Enable possiblity to merge the records of one day into one table row. Sum up the duration and rate.

Possible values of "Merge records" option in manage view:

  • None (default, every record results in one table row)
  • Merge (combine descriptions of day records into one table row)
  • Merge and use first of day (use description of the first record)
  • Merge and use last of day (use description of the last record)

Link to past months not working

For me in shared view links to other months than the present one selected via the dropdown are missing the /public/ part in the url, so eg example.com/de/auth/shared-project-timesheets/1/* and not example.com/public/de/auth/shared-project-timesheets/1/*

Danke für das Plugin

Chart to compare months

Current state / Issue
There is no chart available.

Feature / Improvement
Implement a chart which consists of duration and rate for each month of the selected year.

Expenses werden nicht angezeigt

Hallo,
leider werden keine Expenses angezeigt. Ich vermute mal weil es ein zusätzliches Addon ist.
Gibt's die Möglichkeit das anzupassen?

FTP Install

Hi,

There is a way to install via FTP? I have a shared host and don't have access to the OS console, and after I copied the files and clear the cache, I receive an error when I tried to open the plugin page.

Something is wrong
A critical error occurred, please try again. You may have found a software problem, please contact your administrator if the problem persists.

Thanks.

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.