Skip to content

Commit

Permalink
1618: add group by priority to dashboard/home
Browse files Browse the repository at this point in the history
  • Loading branch information
sinejespersen committed Jun 6, 2024
1 parent 8e64c9e commit 35b64b6
Show file tree
Hide file tree
Showing 42 changed files with 101 additions and 0 deletions.
44 changes: 44 additions & 0 deletions app/Domain/Tickets/Services/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,48 @@ public function getOpenUserTicketsByProject($userId, $projectId): array
return $tickets;
}

/**
* @param $userId
* @param $projectId
* @return array
*/
public function getOpenUserTicketsByPriority($userId, $projectId): array
{

$searchCriteria = $this->prepareTicketSearchArray(array("users" => $userId, "status" => "", "sprint" => ""));
$allTickets = $this->ticketRepository->getAllBySearchCriteria($searchCriteria, "priority");

$statusLabels = $this->getAllStatusLabelsByUserId($userId);

$tickets = array();

foreach ($allTickets as $row) {
//Only include todos that are not done
if (
isset($statusLabels[$row['projectId']]) &&
isset($statusLabels[$row['projectId']][$row['status']]) &&
$statusLabels[$row['projectId']][$row['status']]['statusType'] != "DONE"
) {
$label = $this->ticketRepository->priority[$row['priority']];
if (isset($tickets[$row['priority']])) {
$tickets[$row['priority']]['tickets'][] = $row;
} else {
// If the priority is not set, the label for priority not defined is used.
if (empty($this->ticketRepository->priority[$row['priority']])) {
$label =$this->language->__("label.priority_not_defined");
}
$tickets[$row['priority']] = array(
"labelName" =>$label,
"tickets" => array($row),
"groupValue" => $row['time'],
);
}
}
}

return $tickets;
}


/**
* @param $userId
Expand Down Expand Up @@ -1941,6 +1983,8 @@ public function getToDoWidgetAssignments($params)
$tickets = $this->getOpenUserTicketsThisWeekAndLater($_SESSION["userdata"]["id"], $projectFilter);
} elseif ($groupBy == "project") {
$tickets = $this->getOpenUserTicketsByProject($_SESSION["userdata"]["id"], $projectFilter);
} elseif ($groupBy == "priority") {
$tickets = $this->getOpenUserTicketsByPriority($_SESSION["userdata"]["id"], $projectFilter);
} elseif ($groupBy == "sprint") {
$tickets = $this->getOpenUserTicketsBySprint($_SESSION["userdata"]["id"], $projectFilter);
}
Expand Down
16 changes: 16 additions & 0 deletions app/Domain/Widgets/Templates/partials/myToDos.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ class="btn btn-primary"
<label for="groupByProject">{!! __("label.project") !!}</label>
</span>
</li>
<li>
<span class="radio">
<input type="radio"
name="groupBy"
@if($groupBy == "priority") checked='checked' @endif
value="priority" id="groupByPriority"
hx-get="{{BASE_URL}}/widgets/myToDos/get"
hx-trigger="click"
hx-target="#yourToDoContainer"
hx-swap="outerHTML"
hx-indicator="#todos .htmx-indicator"
hx-vals='{"projectFilter": {{ $projectFilter }}, "groupBy": "priority" }'
/>
<label for="groupByPriority">{!! __("label.priority") !!}</label>
</span>
</li>

</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/Language/ar-SA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/da-DK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Prioritet"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/de-DE-inf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="Liste"
groupByLabel.sprint="Liste"
groupByLabel.project="Projekt"
groupByLabel.time="Fälligkeitsdatum"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Daten"

Expand Down
1 change: 1 addition & 0 deletions app/Language/de-DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="Liste"
groupByLabel.sprint="Liste"
groupByLabel.project="Projekt"
groupByLabel.time="Fälligkeitsdatum"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Daten"

Expand Down
1 change: 1 addition & 0 deletions app/Language/el-GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/en-PT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/en-UD.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/es-419.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/es-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/es-MX.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/et-EE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/fa-IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/he-IL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
2 changes: 2 additions & 0 deletions app/Language/hr-HR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,8 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/is-IS.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/it-IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/kaa.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/km-KH.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,7 @@ dropdown.choose_list="បញ្ជី"
groupByLabel.sprint="បញ្ជី"
groupByLabel.project="គម្រោង"
groupByLabel.time="កាលបរិច្ឆេទ​កំណត់"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/ko-KR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/ks-IN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/lv-LV.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/nl-NL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/no-NO.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/pl-PL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/pt-BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/pt-PT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/ro-RO.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/ru-RU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/sk-SK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/sl-SI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/sr-SP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/sv-SE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/tr-TR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/vi-VN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="List"
groupByLabel.sprint="List"
groupByLabel.project="Project"
groupByLabel.time="Due Date"
groupByLabel.priority="Priority"

label.sprint_dates="Sprint Dates"

Expand Down
1 change: 1 addition & 0 deletions app/Language/zh-CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ dropdown.choose_list="选择列表"
groupByLabel.sprint="列表"
groupByLabel.project="项目"
groupByLabel.time="截止日期"
groupByLabel.priority="Priority"

label.sprint_dates="冲刺日期"

Expand Down
Loading

0 comments on commit 35b64b6

Please sign in to comment.