added project detail report (#2651)

- avatars via css only
- random colors for entities
- improves print view
- added colors for teams
- added color to tag
This commit is contained in:
Kevin Papst
2021-07-06 22:01:20 +02:00
committed by GitHub
parent cc6031bfde
commit 9ddb87a6fd
122 changed files with 2736 additions and 1549 deletions

View File

@@ -43,7 +43,6 @@ class DoctorController extends AbstractController
'var/data/',
'var/log/',
'var/sessions/',
'public/avatars/',
];
/**

View File

@@ -62,7 +62,6 @@ final class ProfileController extends AbstractController
'user' => $profile,
'stats' => $userStats,
'years' => $monthlyStats,
'stat_date_format' => $localeSettings->getDatePickerFormat(),
];
return $this->render('user/stats.html.twig', $viewVars);
@@ -111,7 +110,7 @@ final class ProfileController extends AbstractController
return $this->redirectToRoute('user_profile_password', ['username' => $profile->getUsername()]);
}
return $this->render('user/profile.html.twig', [
return $this->render('user/form.html.twig', [
'tab' => 'password',
'user' => $profile,
'form' => $form->createView(),
@@ -169,7 +168,7 @@ final class ProfileController extends AbstractController
return $this->redirectToRoute('user_profile_roles', ['username' => $profile->getUsername()]);
}
return $this->render('user/profile.html.twig', [
return $this->render('user/form.html.twig', [
'tab' => 'roles',
'user' => $profile,
'form' => $form->createView(),
@@ -195,7 +194,7 @@ final class ProfileController extends AbstractController
return $this->redirectToRoute('user_profile_teams', ['username' => $profile->getUsername()]);
}
return $this->render('user/profile.html.twig', [
return $this->render('user/form.html.twig', [
'tab' => 'teams',
'user' => $profile,
'form' => $form->createView(),
@@ -276,7 +275,7 @@ final class ProfileController extends AbstractController
}
}
return $this->render('user/form.html.twig', [
return $this->render('user/preferences.html.twig', [
'tab' => 'preferences',
'user' => $profile,
'form' => $form->createView(),

View File

@@ -0,0 +1,53 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Controller\Reporting;
use App\Controller\AbstractController;
use App\Entity\Project;
use App\Project\ProjectStatisticService;
use App\Reporting\ProjectDetails\ProjectDetailsForm;
use App\Reporting\ProjectDetails\ProjectDetailsQuery;
use App\Utils\LocaleSettings;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
final class ProjectDetailsController extends AbstractController
{
/**
* @Route(path="/reporting/project_details", name="report_project_details", methods={"GET"})
* @Security("is_granted('view_reporting') and is_granted('details_project')")
*/
public function __invoke(Request $request, ProjectStatisticService $service, LocaleSettings $localeSettings)
{
$dateFactory = $this->getDateTimeFactory();
$user = $this->getUser();
$query = new ProjectDetailsQuery($dateFactory->createDateTime(), $user);
$form = $this->createForm(ProjectDetailsForm::class, $query);
$form->submit($request->query->all(), false);
$projectView = null;
$projectDetails = null;
if ($query->getProject() !== null && $this->isGranted('details', $query->getProject())) {
$projectViews = $service->getProjectView($user, [$query->getProject()], $query->getToday());
$projectView = $projectViews[0];
$projectDetails = $service->getProjectsDetails($query);
}
return $this->render('reporting/project_details.html.twig', [
'project_view' => $projectView,
'project_details' => $projectDetails,
'form' => $form->createView(),
'now' => $this->getDateTimeFactory()->createDateTime(),
]);
}
}

View File

@@ -531,6 +531,20 @@ final class SystemConfigurationController extends AbstractController
->setOptions(['help' => 'help.theme.color_choices'])
->setConstraints([new ColorChoices()])
->setTranslationDomain('system-configuration'),
// allow avatar URLs
(new Configuration())
->setName('theme.avatar_url')
->setRequired(false)
->setLabel('theme.avatar_url')
->setType(CheckboxType::class)
->setTranslationDomain('system-configuration'),
// random colors as fallback
(new Configuration())
->setName('theme.random_colors')
->setRequired(false)
->setLabel('theme.random_colors')
->setType(CheckboxType::class)
->setTranslationDomain('system-configuration'),
]),
(new SystemConfigurationModel())
->setSection(SystemConfigurationModel::SECTION_CALENDAR)