Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes #75

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function mayImpersonate(User $realUser, $simulatedUserId): bool
if ($realUser->getType() === 'CTL' || $realUser->getType() === 'PL') {
return true;
}
return in_array($realUser->getUsername(), $serviceUserNames);
return parent::mayImpersonate($realUser, $simulatedUserId);
}

public function sortByName($a, $b)
Expand Down Expand Up @@ -128,6 +128,7 @@ public function groupByCustomerAction(Request $request)

if(!isset($customers[$customer])) {
$customers[$customer] = array(
'id' => $customer,
'name' => $entry->getCustomer()->getName(),
'hours' => 0,
'quota' => 0,
Expand Down Expand Up @@ -168,6 +169,7 @@ public function groupByProjectAction(Request $request)

if(!isset($projects[$project])) {
$projects[$project] = array(
'id' => $project,
'name' => $entry->getProject()->getName(),
'hours' => 0,
'quota' => 0,
Expand Down Expand Up @@ -208,6 +210,7 @@ public function groupByTicketAction(Request $request)
if(!empty($ticket) && $ticket != '-'){
if(!isset($tickets[$ticket])) {
$tickets[$ticket] = array(
'id' => $entry->getId(),
'name' => $ticket,
'hours' => 0,
'quota' => 0,
Expand Down Expand Up @@ -257,6 +260,7 @@ public function groupByUserAction(Request $request)

if (!isset($users[$user])) {
$users[$user] = array(
'id' => $user,
'name' => $entry->getUser()->getUsername(),
'hours' => 0,
'quota' => 0,
Expand Down
4 changes: 3 additions & 1 deletion src/Netresearch/TimeTrackerBundle/Services/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public function getUsername($userId = null)
$user = $this->container->get('doctrine')
->getRepository('NetresearchTimeTrackerBundle:User')
->find($userId);
$username = $user->getUsername();
if ($user !== null) {
$username = $user->getUsername();
}
}

return $username;
Expand Down
4 changes: 4 additions & 0 deletions web/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,10 @@ components:
ChartDataSuccessResponse:
type: object
properties:
id:
type: integer
example: 1
description: id of user/customer/projekt/activity
name:
type: string
example: "Kunde1"
Expand Down