Skip to content

Commit

Permalink
Coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppekroghitk committed Jan 9, 2025
1 parent 16ea014 commit 5857015
Show file tree
Hide file tree
Showing 5 changed files with 2,760 additions and 2,721 deletions.
8 changes: 4 additions & 4 deletions Helpers/TimeTableActionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public function saveTicket(array $postData, string $redirectUrl): string
* Deletes a ticket based on the provided POST data and redirects to the specified URL.
* Outputs a JSON-encoded response indicating success or failure status.
*
* @param array<string, mixed> $postData Postdata
* @param string $redirectUrl Redirect url.
* @param array<string, mixed> $postData Postdata
* @param string $redirectUrl Redirect url.
* @return string JSON-encoded response.
*/
public function deleteTicket(array $postData, string $redirectUrl): string
Expand Down Expand Up @@ -153,8 +153,8 @@ private function appendQueryParams(array $postData, string $redirectUrl): string
/**
* Copies time log entries forward from a specified start date to an end date for a given ticket.
*
* @param array<string, mixed> $postData Postdata
* @param string $redirectUrl Redirect url
* @param array<string, mixed> $postData Postdata
* @param string $redirectUrl Redirect url
* @return string The redirect URL with appended query parameters after processing.
*/
public function copyEntryForward(array $postData, string $redirectUrl): string
Expand Down
38 changes: 17 additions & 21 deletions Templates/timetable.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ class="timetable-to-today btn btn-default">{{ __('timeTable.button_show_this_wee
<input type="hidden" name="timetable-current-week-first-day"
value="{{ reset($weekDates)->format('Y-m-d') }}" />
<input type="hidden" name="timetable-current-week-last-day"
value="{{ end($weekDates)->format('Y-m-d') }}" />
<input type="hidden" name="timetable-days-loaded"
value="{{ count($weekDates) }}" />
value="{{ end($weekDates)->format('Y-m-d') }}" />
<input type="hidden" name="timetable-days-loaded" value="{{ count($weekDates) }}" />
<input type="hidden" name="timetable-current-week"
value="{{ reset($weekDates)->format('W') }}" />

Expand Down Expand Up @@ -67,8 +66,9 @@ class="timetable-to-today btn btn-default">{{ __('timeTable.button_show_this_wee
@if (!empty($timesheetsByTicket))
@foreach ($timesheetsByTicket as $ticketId => $timesheet)
<tr data-ticketId="{{ $ticketId }}">
<td class="ticket-title" scope="row"><a
href="{{ $timesheet['ticketLink'] }}" data-tippy-content="#{{ $timesheet['ticketId'] }} - {{ $timesheet['ticketTitle'] }}" data-tippy-placement="top">{{ $timesheet['ticketTitle'] }}</a>
<td class="ticket-title" scope="row"><a href="{{ $timesheet['ticketLink'] }}"
data-tippy-content="#{{ $timesheet['ticketId'] }} - {{ $timesheet['ticketTitle'] }}"
data-tippy-placement="top">{{ $timesheet['ticketTitle'] }}</a>
<span>{{ $timesheet['projectName'] }}</span>
<?php if ($timesheet['ticketType'] !== "task"): ?>
<small>(<?php echo $timesheet['ticketType']; ?>)</small>
Expand All @@ -85,7 +85,7 @@ class="timetable-to-today btn btn-default">{{ __('timeTable.button_show_this_wee
$hoursLeft = $timesheetDate[0]['hourRemaining'] ?? null;
$description = $timesheetDate[0]['description'] ?? null;
$isMissingDescription = isset($hours) && trim($description) === '';
// accumulate hours
if ($hours) {
if (isset($totalHours[$weekDateAccessor])) {
Expand All @@ -95,7 +95,7 @@ class="timetable-to-today btn btn-default">{{ __('timeTable.button_show_this_wee
}
$rowTotal += $hours; // add to row total
}
$weekendClass = isset($weekDate) && $weekDate->isWeekend() ? 'weekend' : '';
$todayClass = isset($weekDate) && $weekDate->isToday() ? 'today' : '';
$newWeekClass = isset($weekDate) && $weekDate->isMonday() ? 'new-week' : ''; // Add new-week class for Mondays
Expand All @@ -109,7 +109,8 @@ class="timetable-edit-entry {{ $weekendClass }} {{ $todayClass }} {{ $newWeekCla
title="{{ $isMissingDescription ? __('timeTable.description_missing') : '' }}">
<span>{{ $hours }}</span>
@if (!is_null($hours))
<div class="entry-copy-button"><i class="fa-solid fa-angle-right"></i></div>
<div class="entry-copy-button"><i class="fa-solid fa-angle-right"></i>
</div>
@endif
</td>
@endforeach
Expand All @@ -127,8 +128,8 @@ class="timetable-edit-entry {{ $weekendClass }} {{ $todayClass }} {{ $newWeekCla
@else
<!-- A little something for when the week has no logs -->
<tr class="empty-row"">
<td class="empty-row" colspan="{{ count($weekDates) + 2 }}">
{{ __("It seems the 'WORK-IT' fairy forgot to sprinkle her magic dust here! 🧚‍🪄✨") }}
<td class=" empty-row" colspan="{{ count($weekDates) + 2 }}">
{{ __("It seems the 'WORK-IT' fairy forgot to sprinkle her magic dust here! 🧚‍🪄✨") }}
</td>
</tr>
<tr>
Expand Down Expand Up @@ -184,13 +185,8 @@ class="timetable-edit-entry {{ $weekendClass }} {{ $todayClass }} {{ $newWeekCla
<div class="timetable-hours">
<div class="timesheet-input-wrapper">
<input
type="number"
name="timesheet-hours"
step="0.01"
placeholder="{{ __('timeTable.hours') }}"
required
/>
<input type="number" name="timesheet-hours" step="0.01" placeholder="{{ __('timeTable.hours') }}"
required />
<div title="{{ __('timeTable.hours_left') }}" class="timetable-hours-left">
<input type="number" name="timesheet-hours-left" disabled="disabled" />
</div>
Expand Down Expand Up @@ -221,8 +217,8 @@ class="timetable-modal-submit btn btn-primary">{{ __('timeTable.button_modal_sav
<input type="hidden" name="entryCopyTicketId" class="entry-copy-ticketId">
<input type="hidden" name="entryCopyHours" class="entry-copy-hours">
<input type="hidden" name="entryCopyDescription" class="entry-copy-description">
<input type="hidden" name="entryCopyFromDate"/>
<input type="hidden" name="entryCopyToDate"/>
<input type="hidden" name="entryCopyFromDate" />
<input type="hidden" name="entryCopyToDate" />
<p class="entry-copy-headline"></p>
<p class="entry-copy-text"></p>
<div class="entry-copy-overwrite-checkbox">
Expand All @@ -231,9 +227,9 @@ class="timetable-modal-submit btn btn-primary">{{ __('timeTable.button_modal_sav
</div>
<div class="buttons flex-container gap-1">
<button type="button"
class="entry-copy-modal-cancel btn btn-default ml-auto">{{ __('timeTable.entry_copy_button_close') }}</button>
class="entry-copy-modal-cancel btn btn-default ml-auto">{{ __('timeTable.entry_copy_button_close') }}</button>
<button type="submit"
class="entry-copy-modal-apply btn btn-primary">{{ __('timeTable.entry_copy_button_apply') }}</button>
class="entry-copy-modal-apply btn btn-primary">{{ __('timeTable.entry_copy_button_apply') }}</button>
</div>
</form>
Expand Down
Loading

0 comments on commit 5857015

Please sign in to comment.