diff --git a/LICENSE b/LICENSE index da5082c1..312dbe21 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2018 Kevin Papst +Copyright (c) 2017-2019 Kevin Papst @ https://www.kevinpapst.de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Constants.php b/src/Constants.php index 42ac89d3..00df31c9 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -37,5 +37,5 @@ class Constants /** * Used in multiple views */ - public const HOMEPAGE = 'https://v2.kimai.org'; + public const HOMEPAGE = 'https://www.kimai.org'; } diff --git a/src/Controller/InvoiceController.php b/src/Controller/InvoiceController.php index 361fd4f7..d42fae5f 100644 --- a/src/Controller/InvoiceController.php +++ b/src/Controller/InvoiceController.php @@ -70,7 +70,6 @@ class InvoiceController extends AbstractController $query->setOrder(InvoiceQuery::ORDER_ASC); $query->setBegin($begin); $query->setEnd($end); - $query->setUser($this->getUser()); $query->setState(InvoiceQuery::STATE_STOPPED); return $query; diff --git a/src/Form/TimesheetEditForm.php b/src/Form/TimesheetEditForm.php index 38abe7de..7c1a30ab 100644 --- a/src/Form/TimesheetEditForm.php +++ b/src/Form/TimesheetEditForm.php @@ -120,7 +120,7 @@ class TimesheetEditForm extends AbstractType ]); } else { $builder->add('end', DateTimePickerType::class, [ - 'label' => 'label.begin', + 'label' => 'label.end', 'model_timezone' => $timezone, 'view_timezone' => $timezone, 'required' => false, diff --git a/src/Voter/TimesheetVoter.php b/src/Voter/TimesheetVoter.php index 69be44b8..1eb411af 100644 --- a/src/Voter/TimesheetVoter.php +++ b/src/Voter/TimesheetVoter.php @@ -119,8 +119,17 @@ class TimesheetVoter extends AbstractVoter */ protected function canStart(Timesheet $timesheet, User $user, TokenInterface $token) { - // we could check the amount of active entries - // if a teamlead starts an entry for another user, check that this user is part of his team + // possible improvements for the future: + // we could check the amount of active entries (maybe slow) + // if a teamlead starts an entry for another user, check that this user is part of his team (needs to be done for teams) + + if (null === $timesheet->getActivity()) { + return false; + } + + if (null === $timesheet->getProject()) { + return false; + } if (!$timesheet->getActivity()->getVisible() || !$timesheet->getProject()->getVisible()) { return false; diff --git a/templates/invoice/index.html.twig b/templates/invoice/index.html.twig index e59d953c..cb99583e 100644 --- a/templates/invoice/index.html.twig +++ b/templates/invoice/index.html.twig @@ -60,7 +60,7 @@ {% endif %}