GithubHelp home page GithubHelp logo

bizley / timeclock Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 11.0 436 KB

Simple work time clocking service

License: MIT License

CSS 1.83% PHP 98.17%
timeclock yii holidays clock work register hacktoberfest

timeclock's Introduction

TimeClock

Latest Stable Version Total Downloads Yii2

Simple work time clocking service built on Yii 2 framework.

screen

Installation

  1. Install TimeClock using Composer:

    composer create-project --prefer-dist bizley/timeclock timeclock

  2. Prepare virtual host pointing to /public directory.

  3. Prepare configuration for DB of your choice. Place it in /src/config/db.php.

  4. Modify the /src/config/web.php file to change:

    • timeZone (default UTC),
    • language (default en-US; pl and de translations are provided in /src/messages/ folder),
    • components > mailer configuration to actually send emails (needed for password reset),
    • components > formatter configuration of date and time formats,
    • params > company (default Company Name; displayed in footer and other layout places),
    • params > email (default [email protected]; used as the email sender address for emails),
    • params > allowedDomains (default ['@company.com']; array with email domains allowed for registration).
  5. Change /public/index.php file to set YII_DEBUG mode to false and YII_ENV environment to prod.

  6. Apply migrations by running in console php yii migrate.

  7. Start webserver and register first account.

  8. If you want to make an account to be admin run in console php yii admin/set ID where ID is DB identifier of account to be set (usually first one is 1).

Ground rules

  • Registering account requires its email address to be in one of the provided domains. If you want to change this behavior you must prepare your own code. Current implementation is at /src/models/RegisterForm.php and /src/views/site/register.php.
  • Session can be started at any time but it must be ended not overlapping any other ended session.
  • There can be many sessions in one day.
  • Session can not be longer than midnight.
  • Not ended sessions not count for work hours.
  • Off-time must not overlap any other off-time period.
  • Holidays are automatically fetched from https://www.kalendarzswiat.pl which is Polish holiday list. If you want to use something different you must prepare your own code for this. Current implementation is at /src/models/Holiday.php.

Features

  • account registration
  • password reset
  • profile update
  • themes
  • signing in with login or PIN
  • session time with note
  • off-time with note
  • session and off-time history
  • calendar
  • holidays
  • admin section
  • REST API
  • Bootstrap 4 layout

New in 2.3.0

  • vacations requests
  • projects
  • sessions time CSV download for admins
  • deactivating accounts for admins

Upgrading from 2.2.1 to 2.3.0

  1. Update all the project files to match the repository.
  2. Apply migrations by running in console php yii migrate.

General help

Read TimeClock Wiki first.

For anything related to Yii go to the Yii 2 Guide.
I really don't want to point obvious links with solutions from there.

Usage of this project

You can use this project in whatever way you like as long as you mention where did you get it from.

Screenshots

screen2

screen3

screen4

screen5

timeclock's People

Contributors

bizley avatar dependabot[bot] avatar hunwalk avatar niclasku avatar rniedzwiecki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

timeclock's Issues

API access for clock in/out terminal

Hello,
I would like to add a special API access for a hardware clock in/out terminal and wonder what the right way would look like. My current solution only adds an additional role to the User class and checks for each request if it came from a normal user or the terminal. This is messy because I also have to filter the users based on their roles to let the terminal user not show up anywhere else.

I think a better solution would consist out of a new API controller class and a terminal class that implements the IdentityInterface. As I have no experience with Yii I would like to ask for your thoughts on this beforehand.

Best regards,
Niclas

/public/site/login not found

Hello,
Thank you for the tip about composer. I have followed your installation notes. I have made the configs and everything did well. I have a new error about the login. The sub folder /public/site/login can not be found. What should I do at this step please ?
Regards,
Stéphane

dwowload csv with the notes included

Hello,
Really enjoy by your soft, thx !
Is there a way to download the csv file with the notes people have written please ?
Regards
Stéphane

Cannot create a project with assigned users

Hello,

Thank you for your software, it is really useful.

I have a trouble creating a project with assigned users.

I have the following error :

SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `project.assignees` failed for `timeclock`.`project`
The SQL being executed was: INSERT INTO `project` (`name`, `color`, `assignees`, `created_at`, `updated_at`) VALUES ('test', '#60a193', 'Array', 1652104178, 1652104178)

Error Info: Array
(
    [0] => 23000
    [1] => 4025
    [2] => CONSTRAINT `project.assignees` failed for `timeclock`.`project`
)

↵
Caused by: PDOException
SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `project.assignees` failed for `timeclock`.`project`

Please tell me if I can give you any other information.

Have a nice day, thank you

Theme switcher

Hello, first of all I'd like to congragulate you for your amazing work. I just have a slight problem with the theme switcher, it doesn't seem to work for me as the route "profile/theme/dark" is not found.

Autoload.php

Hi,
I did install your software and as I have tried to point to /public/index.php I had errors I paste here

Warning: require(/home/clients/ea27f7cbee09d7101a32496af37c62cf/web/pointeuse/public/../vendor/autoload.php): failed to open stream: No such file or directory in /home/clients/ea27f7cbee09d7101a32496af37c62cf/web/pointeuse/public/index.php on line 6

Warning: require(/home/clients/ea27f7cbee09d7101a32496af37c62cf/web/pointeuse/public/../vendor/autoload.php): failed to open stream: No such file or directory in /home/clients/ea27f7cbee09d7101a32496af37c62cf/web/pointeuse/public/index.php on line 6

Fatal error: require(): Failed opening required '/home/clients/ea27f7cbee09d7101a32496af37c62cf/web/pointeuse/public/../vendor/autoload.php' (include_path='.:/opt/php7.3/lib/php') in /home/clients/ea27f7cbee09d7101a32496af37c62cf/web/pointeuse/public/index.php on line 6

The soft does not find the autoload.php. The file seems not to be included in sub folder. Did I miss a step ? What should I do please ?

Regards

Stéphane

Change first day of week

Hello,

It would be very useful to be able to change the first day of week, for example in calendar, as first day of week in France is Monday, not Sunday.

Have a nice day, and keep up the good work, it's damn good !

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - yiisoft/yii2 2.0.38 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.37 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.36 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.35 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.34 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.33 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.32 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.31 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.30 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.29 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.28 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.27 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.26 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.25 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.24 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.23 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.22 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.21 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.20 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.19 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.18 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.17 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.16.1 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.16 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - yiisoft/yii2 2.0.15.1 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found.
    - Installation request for yiisoft/yii2 >=2.0.15.1 <2.1.0 -> satisfiable by yiisoft/yii2[2.0.15.1, 2.0.16, 2.0.16.1, 2.0.17, 2.0.18, 2.0.19, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.25, 2.0.26, 2.0.27, 2.0.28, 2.0.29, 2.0.30, 2.0.31, 2.0.32, 2.0.33, 2.0.34, 2.0.35, 2.0.36, 2.0.37, 2.0.38].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

3rd party service support?

Hi, so i've asked my boss in our company, and he liked this project. He also mentioned it would be a great feature if this project could synchronize data with toggl(https://toggl.com/), or would be capable using trello(https://trello.com/) cards to mark sessions. This is just an idea.
What do you think?

enablePrettyUrl "404 NotFound"

Hi, I'm having issues if I leave "'enablePrettyUrl' => true," I have to set it to "false" for the application to work. I've enabled mod_rewrite, and I've created an htaccess file inside the public folder with the following code:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule ^(.*)$ index.php/$1 [L]

I've also tried with the following htaccess and it doesn't work either:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

In the Apache virtualhost, I've added the following:

<Directory />
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
	Allow from all    
</Directory>

I can't think of any other ideas. Can you help me?
Thank you very much.
PS: If I set enablePrettyUrl to false, it works fine.

UTC bug

The app has a bug with UTC. When the time transitions to the next day in the central time zone (UTC 0), but you have your time zone set to (-6 UTC), it bugs out, and you can no longer record times (The time is created in the database, but the clock no longer works).

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.