Release 1.19.8 (#3296)

* unify extension check
* fix updating one config section redirects to all sections
* weekly times: configure number of weeks for recent activities
* weekly times: configure minimum number of rows
* added explicit formats for en_GB and pt
This commit is contained in:
Kevin Papst
2022-05-17 11:52:45 +02:00
committed by GitHub
parent 27c60d9fc4
commit 9e2a295182
13 changed files with 122 additions and 60 deletions

View File

@@ -99,7 +99,13 @@ class QuickEntryController extends AbstractController
// attach recent activities
$amount = $this->configuration->getQuickEntriesRecentAmount();
$timesheets = $this->repository->getRecentActivities($this->getUser(), null, $amount);
$startFrom = null;
$takeOverWeeks = $this->configuration->find('quick_entry.recent_activity_weeks');
if ($takeOverWeeks !== null && \intval($takeOverWeeks) > 0) {
$startFrom = clone $startWeek;
$startFrom->modify(sprintf('-%s weeks', $takeOverWeeks));
}
$timesheets = $this->repository->getRecentActivities($this->getUser(), $startFrom, $amount);
foreach ($timesheets as $timesheet) {
$id = $timesheet->getProject()->getId() . '_' . $timesheet->getActivity()->getId();
if (\array_key_exists($id, $rows)) {
@@ -145,7 +151,7 @@ class QuickEntryController extends AbstractController
}
// add empty rows for simpler starting
$minRows = 3;
$minRows = \intval($this->configuration->find('quick_entry.minimum_rows'));
if (\count($models) < $minRows) {
$newRows = $minRows - \count($models);
for ($a = 0; $a < $newRows; $a++) {