From 934fdeb1079523ce78c4eb31885ac3dc628ed3a4 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Wed, 12 Mar 2025 18:26:08 +0100 Subject: [PATCH 01/72] Translated using Weblate (#5383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dawid Kiełkowski Co-authored-by: Massimo Pissarello Co-authored-by: Wellington Terumi Uemura Co-authored-by: Xyruz Co-authored-by: Yaron Shahrabani Co-authored-by: hugompd Co-authored-by: Максим Горпиніч --- translations/email.ru.xlf | 4 +-- translations/messages.ar.xlf | 24 +++++++------- translations/messages.cs.xlf | 24 +++++++------- translations/messages.da.xlf | 22 ++++++------- translations/messages.de_CH.xlf | 24 +++++++------- translations/messages.el.xlf | 24 +++++++------- translations/messages.eo.xlf | 24 +++++++------- translations/messages.es.xlf | 24 +++++++------- translations/messages.eu.xlf | 20 ++++++------ translations/messages.fa.xlf | 24 +++++++------- translations/messages.fi.xlf | 24 +++++++------- translations/messages.fo.xlf | 20 ++++++------ translations/messages.fr.xlf | 24 +++++++------- translations/messages.he.xlf | 36 ++++++++++++--------- translations/messages.hr.xlf | 24 +++++++------- translations/messages.hu.xlf | 24 +++++++------- translations/messages.it.xlf | 24 +++++++------- translations/messages.ja.xlf | 20 ++++++------ translations/messages.ko.xlf | 24 +++++++------- translations/messages.nb_NO.xlf | 24 +++++++------- translations/messages.nl.xlf | 24 +++++++------- translations/messages.pl.xlf | 32 ++++++++++-------- translations/messages.pt.xlf | 54 +++++++++++++++++++++++-------- translations/messages.pt_BR.xlf | 24 +++++++------- translations/messages.ro.xlf | 24 +++++++------- translations/messages.ru.xlf | 24 +++++++------- translations/messages.sk.xlf | 24 +++++++------- translations/messages.sv.xlf | 12 +++---- translations/messages.ta.xlf | 12 +++---- translations/messages.tr.xlf | 24 +++++++------- translations/messages.uk.xlf | 14 ++++---- translations/messages.vi.xlf | 24 +++++++------- translations/messages.zh_CN.xlf | 24 +++++++------- translations/messages.zh_Hant.xlf | 24 +++++++------- 34 files changed, 417 insertions(+), 381 deletions(-) diff --git a/translations/email.ru.xlf b/translations/email.ru.xlf index 368e6bf8c..96ce6a3af 100644 --- a/translations/email.ru.xlf +++ b/translations/email.ru.xlf @@ -32,11 +32,11 @@ reset.button - Сбросить пароль + Войти Don't worry, Kimai will help you create a new one! - … вы забыли пароль? Не беспокойтесь: Kimai поможет Вам создать новый: + Данная ссылка будет активна только в течении 15 минут. diff --git a/translations/messages.ar.xlf b/translations/messages.ar.xlf index f5d1fd157..2f94d7b32 100644 --- a/translations/messages.ar.xlf +++ b/translations/messages.ar.xlf @@ -342,25 +342,25 @@ ROLE_USER مستخدم - + stats.durationToday - ساعات العمل اليوم + ساعات العمل اليوم - + stats.durationWeek - ساعات العمل هذا الأسبوع + ساعات العمل هذا الأسبوع - + stats.durationMonth - ساعات العمل هذا الشهر + ساعات العمل هذا الشهر - + stats.durationYear - ساعات العمل هذا العام + ساعات العمل هذا العام - + stats.durationTotal - مجموع ساعات العمل + مجموع ساعات العمل stats.amountToday @@ -742,9 +742,9 @@ set_as_default حفظ الإعدادات كمفضلة البحث - + stats.durationFinancialYear - ساعات العمل هذه السنة المالية + ساعات العمل هذه السنة المالية stats.activeUsersFinancialYear diff --git a/translations/messages.cs.xlf b/translations/messages.cs.xlf index 91eb1e497..5ae62b0f5 100644 --- a/translations/messages.cs.xlf +++ b/translations/messages.cs.xlf @@ -438,25 +438,25 @@ ROLE_USER Uživatel - + stats.durationToday - Dnešní pracovní doba + Dnešní pracovní doba - + stats.durationWeek - Pracovní doba tento týden + Pracovní doba tento týden - + stats.durationMonth - Pracovní doba tento měsíc + Pracovní doba tento měsíc - + stats.durationYear - Pracovní doba tento rok + Pracovní doba tento rok - + stats.durationTotal - Pracovní doba celkem + Pracovní doba celkem stats.yourWorkingHours @@ -974,9 +974,9 @@ revenue Příjmy - + stats.durationFinancialYear - Pracovní doba tento finanční rok + Pracovní doba tento finanční rok stats.activeUsersFinancialYear diff --git a/translations/messages.da.xlf b/translations/messages.da.xlf index c02a85f5e..65932dfc4 100644 --- a/translations/messages.da.xlf +++ b/translations/messages.da.xlf @@ -486,25 +486,25 @@ ROLE_USER Bruger - + stats.durationToday - Arbejdstimer i dag + Arbejdstimer i dag - + stats.durationWeek - Arbejdstimer denne uge + Arbejdstimer denne uge - + stats.durationMonth - Arbejdstimer denne måned + Arbejdstimer denne måned - + stats.durationYear - Arbejdstimer dette år + Arbejdstimer dette år - + stats.durationTotal - Arbejdstimer i alt + Arbejdstimer i alt stats.yourWorkingHours @@ -1344,7 +1344,7 @@ stats.durationFinancialYear - Arbejdstimer dette finansielle år + Arbejdstimer dette finansielle år stats.userAmountMonth diff --git a/translations/messages.de_CH.xlf b/translations/messages.de_CH.xlf index 1923214de..bda602590 100644 --- a/translations/messages.de_CH.xlf +++ b/translations/messages.de_CH.xlf @@ -354,25 +354,25 @@ stats.yourWorkingHours Meine Arbeitszeiten - + stats.durationTotal - Arbeitszeit total + Arbeitszeit total - + stats.durationYear - Arbeitszeit dieses Jahr + Arbeitszeit dieses Jahr - + stats.durationMonth - Arbeitszeit diesen Monat + Arbeitszeit diesen Monat - + stats.durationWeek - Arbeitszeit diese Woche + Arbeitszeit diese Woche - + stats.durationToday - Arbeitszeit heute + Arbeitszeit heute stats.workingTimeYear @@ -1010,9 +1010,9 @@ stats.amountFinancialYear Umsatz dieses Geschäftsjahr - + stats.durationFinancialYear - Arbeitszeit dieses Geschäftsjahr + Arbeitszeit dieses Geschäftsjahr stats.workingTimeFinancialYear diff --git a/translations/messages.el.xlf b/translations/messages.el.xlf index a6cf1c265..483f6e0be 100644 --- a/translations/messages.el.xlf +++ b/translations/messages.el.xlf @@ -626,25 +626,25 @@ stats.workingTimeYear Πλήρες έτος %year% - + stats.durationToday - Σημερινές ώρες εργασίας + Σημερινές ώρες εργασίας - + stats.durationWeek - Ώρες εργασίας τρέχουσας εβδομάδας + Ώρες εργασίας τρέχουσας εβδομάδας - + stats.durationMonth - Ώρες εργασίας τρέχοντος μηνός + Ώρες εργασίας τρέχοντος μηνός - + stats.durationYear - Ώρες εργασίας τρέχοντος έτους + Ώρες εργασίας τρέχοντος έτους - + stats.durationTotal - Συνολικές ώρες εργασίας + Συνολικές ώρες εργασίας stats.yourWorkingHours @@ -998,9 +998,9 @@ stats.amountFinancialYear Έσοδα τρέχοντος οικονομικού έτους - + stats.durationFinancialYear - Ώρες εργασίας κατά το τρέχον οικονομικό έτος + Ώρες εργασίας κατά το τρέχον οικονομικό έτος revenue diff --git a/translations/messages.eo.xlf b/translations/messages.eo.xlf index d3c9efe6c..e7bbbf8b4 100644 --- a/translations/messages.eo.xlf +++ b/translations/messages.eo.xlf @@ -530,25 +530,25 @@ ROLE_USER Uzanto - + stats.durationToday - Laborhoroj hodiaŭ + Laborhoroj hodiaŭ - + stats.durationWeek - Laborhoroj ĉi-semajne + Laborhoroj ĉi-semajne - + stats.durationMonth - Laborhoroj ĉi-monate + Laborhoroj ĉi-monate - + stats.durationYear - Laborhoroj ĉi-jare + Laborhoroj ĉi-jare - + stats.durationTotal - Laborhoroj entute + Laborhoroj entute stats.yourWorkingHours @@ -994,9 +994,9 @@ stats.activeUsersFinancialYear Aktivaj uzantoj ĉi-financjare - + stats.durationFinancialYear - Laborhoroj ĉi-financjare + Laborhoroj ĉi-financjare stats.amountFinancialYear diff --git a/translations/messages.es.xlf b/translations/messages.es.xlf index 883f8d9fa..b41e3136f 100644 --- a/translations/messages.es.xlf +++ b/translations/messages.es.xlf @@ -462,25 +462,25 @@ ROLE_USER Usuario - + stats.durationToday - Horas trabajadas hoy + Horas trabajadas hoy - + stats.durationWeek - Horas trabajadas esta semana + Horas trabajadas esta semana - + stats.durationMonth - Horas trabajadas este mes + Horas trabajadas este mes - + stats.durationYear - Horas trabajadas este año + Horas trabajadas este año - + stats.durationTotal - Total de horas trabajadas + Total de horas trabajadas stats.yourWorkingHours @@ -970,9 +970,9 @@ stats.amountFinancialYear Ingresos este año fiscal - + stats.durationFinancialYear - Horas laborables este año fiscal + Horas laborables este año fiscal stats.workingTimeFinancialYear diff --git a/translations/messages.eu.xlf b/translations/messages.eu.xlf index dbdc5aeee..8512fe699 100644 --- a/translations/messages.eu.xlf +++ b/translations/messages.eu.xlf @@ -498,25 +498,25 @@ ROLE_USER Erabiltzailea - + stats.durationToday - Gaurko lan orduak + Gaurko lan orduak - + stats.durationWeek - Asteko lan orduak + Asteko lan orduak - + stats.durationMonth - Hilabeteko lan orduak + Hilabeteko lan orduak - + stats.durationYear - Urteko lan orduak + Urteko lan orduak - + stats.durationTotal - Lan orduak GUZTIRA + Lan orduak GUZTIRA stats.yourWorkingHours diff --git a/translations/messages.fa.xlf b/translations/messages.fa.xlf index 4e96050ac..de0e8eb0e 100644 --- a/translations/messages.fa.xlf +++ b/translations/messages.fa.xlf @@ -622,29 +622,29 @@ Working hours زمان کار - + stats.durationToday - ساعت کاری امروز + ساعت کاری امروز - + stats.durationWeek - ساعت کاری این هفته + ساعت کاری این هفته - + stats.durationMonth - ساعت کاری این ماه + ساعت کاری این ماه - + stats.durationYear - ساعت کاری امسال + ساعت کاری امسال - + stats.durationFinancialYear - ساعات کار در این سال مالی + ساعات کار در این سال مالی - + stats.durationTotal - کل ساعت کاری + کل ساعت کاری stats.yourWorkingHours diff --git a/translations/messages.fi.xlf b/translations/messages.fi.xlf index a20253a39..a146c2269 100644 --- a/translations/messages.fi.xlf +++ b/translations/messages.fi.xlf @@ -582,25 +582,25 @@ stats.workingTimeYear Koko vuosi %year% - + stats.durationToday - Työaika tänään + Työaika tänään - + stats.durationWeek - Työaika tällä viikolla + Työaika tällä viikolla - + stats.durationMonth - Työaika tässä kuussa + Työaika tässä kuussa - + stats.durationYear - Työaika tänä vuonna + Työaika tänä vuonna - + stats.durationTotal - Työtunteja yhteensä + Työtunteja yhteensä stats.yourWorkingHours @@ -970,9 +970,9 @@ stats.amountFinancialYear Tulo tällä tilikaudella - + stats.durationFinancialYear - Työaika tällä tilikaudella + Työaika tällä tilikaudella revenue diff --git a/translations/messages.fo.xlf b/translations/messages.fo.xlf index 64167829e..1c1d01a58 100644 --- a/translations/messages.fo.xlf +++ b/translations/messages.fo.xlf @@ -530,25 +530,25 @@ stats.yourWorkingHours Mínir arbeiðistímar - + stats.durationTotal - Arbeiðistímar tilsamans + Arbeiðistímar tilsamans - + stats.durationYear - Arbeiðistímar hetta árið + Arbeiðistímar hetta árið - + stats.durationMonth - Arbeiðistímar hendan mánaðin + Arbeiðistímar hendan mánaðin - + stats.durationWeek - Arbeiðistímar hesa vikuna + Arbeiðistímar hesa vikuna - + stats.durationToday - Arbeiðistímar í dag + Arbeiðistímar í dag stats.activeUsersTotal diff --git a/translations/messages.fr.xlf b/translations/messages.fr.xlf index d7d8197ea..51ff334b3 100644 --- a/translations/messages.fr.xlf +++ b/translations/messages.fr.xlf @@ -422,25 +422,25 @@ ROLE_USER Utilisateur - + stats.durationToday - Heures travaillées aujourd'hui + Heures travaillées aujourd'hui - + stats.durationWeek - Heures travaillées cette semaine + Heures travaillées cette semaine - + stats.durationMonth - Heures travaillées ce mois + Heures travaillées ce mois - + stats.durationYear - Heures travaillées cette année + Heures travaillées cette année - + stats.durationTotal - Total des heures travaillées + Total des heures travaillées stats.yourWorkingHours @@ -1010,9 +1010,9 @@ stats.amountFinancialYear Revenus pour cette année fiscale - + stats.durationFinancialYear - Heures de travail pour cette année fiscale + Heures de travail pour cette année fiscale stats.workingTimeFinancialYear diff --git a/translations/messages.he.xlf b/translations/messages.he.xlf index 22b8e42b5..00e07ee2f 100644 --- a/translations/messages.he.xlf +++ b/translations/messages.he.xlf @@ -542,25 +542,25 @@ ROLE_USER משתמשים - + stats.durationToday - שעות עבודה היום + היום - + stats.durationWeek - שעות עבודה השבוע + השבוע - + stats.durationMonth - שעות עבודה החודש + החודש - + stats.durationYear - שעות עבודה השנה + השנה - + stats.durationTotal - סך שעות העבודה + סך הכול stats.yourWorkingHours @@ -934,9 +934,9 @@ stats.amountFinancialYear הכנסות בשנה הפיננסית הזאת - + stats.durationFinancialYear - שעות עבודה בשנה הפיננסית הזאת + שנה פיננסית stats.workingTimeFinancialYear @@ -1214,9 +1214,9 @@ profile.2fa_confirmation נא לאשר את הקוד שיפעיל את האימות הדו־שלבי לחשבון הזה. - + stats.userDurationWeek - שעות העבודה שלי השבוע + שעות העבודה שלי השבוע stats.userDurationTotal @@ -1338,9 +1338,9 @@ plugin.installed תוספים מותקנים - + stats.userDurationToday - שעות העבודה שלי היום + שעות העבודה שלי היום help.globalActivities @@ -1926,6 +1926,10 @@ Log out of all devices הוצאת כל המכשירים + + attendance_only_project + למנות רק רשומות של המיזמים הנבחרים כשעות עבודה + diff --git a/translations/messages.hr.xlf b/translations/messages.hr.xlf index 4c0ca5b5e..e7f8370c5 100644 --- a/translations/messages.hr.xlf +++ b/translations/messages.hr.xlf @@ -650,29 +650,29 @@ revenue Prihodi - + stats.durationToday - Radno vrijeme danas + Radno vrijeme danas - + stats.durationWeek - Radno vrijeme ovaj tjedan + Radno vrijeme ovaj tjedan - + stats.durationMonth - Radno vrijeme ovaj mjesec + Radno vrijeme ovaj mjesec - + stats.durationYear - Radno vrijeme ove godine + Radno vrijeme ove godine - + stats.durationFinancialYear - Radno vrijeme ove fiskalne godine + Radno vrijeme ove fiskalne godine - + stats.durationTotal - Radno vrijeme ukupno + Radno vrijeme ukupno stats.yourWorkingHours diff --git a/translations/messages.hu.xlf b/translations/messages.hu.xlf index 01e78bd80..6e54fbc32 100644 --- a/translations/messages.hu.xlf +++ b/translations/messages.hu.xlf @@ -422,25 +422,25 @@ ROLE_USER Felhasználó - + stats.durationToday - Mai munkaórák + Mai munkaórák - + stats.durationWeek - Eheti munkaórák + Eheti munkaórák - + stats.durationMonth - E havi munkaórák + E havi munkaórák - + stats.durationYear - Idei munkaórák + Idei munkaórák - + stats.durationTotal - Összes munkaórák + Összes munkaórák stats.yourWorkingHours @@ -954,9 +954,9 @@ stats.workingTimeFinancialYear Pénzügyi év - + stats.durationFinancialYear - Munkaórák ebben a pénzügyi évben + Munkaórák ebben a pénzügyi évben stats.percentUsedLeft_month diff --git a/translations/messages.it.xlf b/translations/messages.it.xlf index 01eeb3811..c61238d5a 100644 --- a/translations/messages.it.xlf +++ b/translations/messages.it.xlf @@ -582,25 +582,25 @@ stats.workingTimeYear Anno intero %year% - + stats.durationToday - Ore lavorative oggi + Oggi - + stats.durationWeek - Ore lavorative questa settimana + Questa settimana - + stats.durationMonth - Ore lavorative questo mese + Questo mese - + stats.durationYear - Ore lavorative quest'anno + Quest'anno - + stats.durationTotal - Totale ore lavorative + Totale stats.yourWorkingHours @@ -994,9 +994,9 @@ stats.activeUsersFinancialYear Utenti attivi in quest'anno finanziario - + stats.durationFinancialYear - Ore lavorative in quest'anno finanziario + Anno finanziario stats.workingTimeFinancialYear diff --git a/translations/messages.ja.xlf b/translations/messages.ja.xlf index b44e40488..373273182 100644 --- a/translations/messages.ja.xlf +++ b/translations/messages.ja.xlf @@ -422,25 +422,25 @@ ROLE_USER ユーザー - + stats.durationToday - 今日の活動時間 + 今日の活動時間 - + stats.durationWeek - 今週の活動時間 + 今週の活動時間 - + stats.durationMonth - 今月の活動時間 + 今月の活動時間 - + stats.durationYear - 今年の活動時間 + 今年の活動時間 - + stats.durationTotal - 活動時間の合計 + 活動時間の合計 stats.yourWorkingHours diff --git a/translations/messages.ko.xlf b/translations/messages.ko.xlf index 1766445d0..e3624d365 100644 --- a/translations/messages.ko.xlf +++ b/translations/messages.ko.xlf @@ -434,25 +434,25 @@ ROLE_USER 사용자 - + stats.durationToday - 오늘 근무시간 + 오늘 근무시간 - + stats.durationWeek - 이번 주 근무시간 + 이번 주 근무시간 - + stats.durationMonth - 이번 달 근무시간 + 이번 달 근무시간 - + stats.durationYear - 올해 근무시간 + 올해 근무시간 - + stats.durationTotal - 총 근무시간 + 총 근무시간 stats.yourWorkingHours @@ -1014,9 +1014,9 @@ revenue 수익 - + stats.durationFinancialYear - 이번 회계 연도 근무 시간 + 이번 회계 연도 근무 시간 includeBudgetType_full diff --git a/translations/messages.nb_NO.xlf b/translations/messages.nb_NO.xlf index 61e3aadc4..04d4e357d 100644 --- a/translations/messages.nb_NO.xlf +++ b/translations/messages.nb_NO.xlf @@ -646,21 +646,21 @@ revenue Inntekter - + stats.durationToday - Arbeidstimer i dag + Arbeidstimer i dag - + stats.durationWeek - Arbeidstimer denne uken + Arbeidstimer denne uken - + stats.durationMonth - Arbeidstimer denne måneden + Arbeidstimer denne måneden - + stats.durationYear - Arbeidstimer dette året + Arbeidstimer dette året export_decimal @@ -690,9 +690,9 @@ stats.workingTimeMonth %month% %year% - + stats.durationTotal - Arbeidstimer totalt + Arbeidstimer totalt stats.yourWorkingHours @@ -782,9 +782,9 @@ total_rate Total pris - + stats.durationFinancialYear - Arbeidstimer dette budsjettåret + Arbeidstimer dette budsjettåret stats.amountFinancialYear diff --git a/translations/messages.nl.xlf b/translations/messages.nl.xlf index 6b3ce98f6..2077e0d86 100644 --- a/translations/messages.nl.xlf +++ b/translations/messages.nl.xlf @@ -462,25 +462,25 @@ stats.workingTimeWeek Kalenderweek %week% - + stats.durationToday - Werkuren vandaag + Werkuren vandaag - + stats.durationWeek - Werkuren deze week + Werkuren deze week - + stats.durationMonth - Werkuren deze maand + Werkuren deze maand - + stats.durationYear - Werkuren dit jaar + Werkuren dit jaar - + stats.durationTotal - Totaal van werkuren + Totaal van werkuren stats.yourWorkingHours @@ -1026,9 +1026,9 @@ Working hours Werktijd - + stats.durationFinancialYear - Werkuren dit boekjaar + Werkuren dit boekjaar stats.activeUsersFinancialYear diff --git a/translations/messages.pl.xlf b/translations/messages.pl.xlf index abf691f70..9e518ad18 100644 --- a/translations/messages.pl.xlf +++ b/translations/messages.pl.xlf @@ -506,25 +506,25 @@ ROLE_USER Użytkownik - + stats.durationToday - Przepracowane godziny dzisiaj + Dzisiaj - + stats.durationWeek - Przepracowane godziny w tym tygodniu + W tym tygodniu - + stats.durationMonth - Przepracowane godziny w tym miesiącu + W tym miesiącu - + stats.durationYear - Przepracowane godziny w tym roku + W tym roku - + stats.durationTotal - Łacznie przepracowanych godzin + Łącznie stats.yourWorkingHours @@ -950,9 +950,9 @@ stats.amountFinancialYear Przychód w tym roku budżetowym - + stats.durationFinancialYear - Godziny pracy w roku budżetowym + W roku budżetowym revenue @@ -990,9 +990,9 @@ file Pliki - + orderBy - Zamówione przez + Sortuj według desc @@ -1926,6 +1926,10 @@ training Trenowanie + + attendance_only_project + Uwzględniaj tylko wpisy z wybranego projektu jako czas pracy + diff --git a/translations/messages.pt.xlf b/translations/messages.pt.xlf index 3bdbbe235..4d3c6a01e 100644 --- a/translations/messages.pt.xlf +++ b/translations/messages.pt.xlf @@ -422,25 +422,25 @@ ROLE_USER Utilizador - + stats.durationToday - Horas de trabalho hoje + Horas de trabalho hoje - + stats.durationWeek - Horas de trabalho esta semana + Horas de trabalho esta semana - + stats.durationMonth - Horas de trabalho este mês + Horas de trabalho este mês - + stats.durationYear - Horas de trabalho este ano + Horas de trabalho este ano - + stats.durationTotal - Total de horas de trabalho + Total de horas de trabalho stats.yourWorkingHours @@ -1006,9 +1006,9 @@ stats.amountFinancialYear Receita deste ano financeiro - + stats.durationFinancialYear - Horas de trabalho neste ano fiscal + Horas de trabalho neste ano fiscal Working hours @@ -1432,7 +1432,7 @@ You have submitted %used% of your available %days% vacation days so far. - Você tirou %used% dos seus %days% dias de férias disponíveis até agora. + Já gozou %used% dos seus %days% dias de férias. time_off.intro @@ -1902,6 +1902,34 @@ import Importar + + Rejected + Rejeitado + + + result + Resultado + + + attendance_only_project + Contabilizar apenas registos do projeto selecionado + + + Sessions + Sessões + + + Log out of all devices + Desligar em todos os equipamentos + + + training + Formação + + + reject + Rejeitar + diff --git a/translations/messages.pt_BR.xlf b/translations/messages.pt_BR.xlf index 8cdc63dfa..a065971f9 100644 --- a/translations/messages.pt_BR.xlf +++ b/translations/messages.pt_BR.xlf @@ -422,25 +422,25 @@ ROLE_USER Usuário - + stats.durationToday - Horas trabalhadas hoje + Hoje - + stats.durationWeek - Horas trabalhadas esta semana + Esta semana - + stats.durationMonth - Horas trabalhadas este mês + Este mês - + stats.durationYear - Horas trabalhadas este ano + Este ano - + stats.durationTotal - Total de horas trabalhadas + Total stats.yourWorkingHours @@ -982,9 +982,9 @@ stats.amountFinancialYear Receita deste ano fiscal - + stats.durationFinancialYear - Horários de trabalho neste ano fiscal + Ano fiscal stats.workingTimeFinancialYear diff --git a/translations/messages.ro.xlf b/translations/messages.ro.xlf index 07214434a..1a9da68c8 100644 --- a/translations/messages.ro.xlf +++ b/translations/messages.ro.xlf @@ -514,25 +514,25 @@ ROLE_USER Utilizator - + stats.durationToday - Ore lucrate azi + Ore lucrate azi - + stats.durationWeek - Ore lucrate săptămâna aceasta + Ore lucrate săptămâna aceasta - + stats.durationMonth - Ore lucrate luna aceasta + Ore lucrate luna aceasta - + stats.durationYear - Ore lucrate anul aceasta + Ore lucrate anul aceasta - + stats.durationTotal - Număr total de ore lucrate + Număr total de ore lucrate stats.yourWorkingHours @@ -1014,9 +1014,9 @@ stats.amountFinancialYear Venituri în acest exercițiu financiar - + stats.durationFinancialYear - Ore de lucru în acest exercițiu financiar + Ore de lucru în acest exercițiu financiar revenue diff --git a/translations/messages.ru.xlf b/translations/messages.ru.xlf index 84bb53936..9aa075bd1 100644 --- a/translations/messages.ru.xlf +++ b/translations/messages.ru.xlf @@ -338,25 +338,25 @@ ROLE_USER Пользователь - + stats.durationToday - Отработано сегодня + Отработано сегодня - + stats.durationWeek - Отработано за эту неделю + Отработано за эту неделю - + stats.durationMonth - Отработано за этот месяц + Отработано за этот месяц - + stats.durationYear - Отработано за этот год + Отработано за этот год - + stats.durationTotal - Отработано всего + Отработано всего stats.amountToday @@ -962,9 +962,9 @@ stats.amountFinancialYear Выручка в этом финансовом году - + stats.durationFinancialYear - Часы работы в этом финансовом году + Часы работы в этом финансовом году stats.workingTimeFinancialYear diff --git a/translations/messages.sk.xlf b/translations/messages.sk.xlf index 927390a38..fa011cfc0 100644 --- a/translations/messages.sk.xlf +++ b/translations/messages.sk.xlf @@ -506,25 +506,25 @@ ROLE_USER User - + stats.durationToday - Pracovný čas dnes + Pracovný čas dnes - + stats.durationWeek - Pracovný čas tento týždeň + Pracovný čas tento týždeň - + stats.durationMonth - Pracovný čas tento mesiac + Pracovný čas tento mesiac - + stats.durationYear - Pracovný čas tento rok + Pracovný čas tento rok - + stats.durationTotal - Celkový pracovný čas + Celkový pracovný čas stats.amountToday @@ -1006,9 +1006,9 @@ revenue Tržby - + stats.durationFinancialYear - Pracovné hodiny tento finančný rok + Pracovné hodiny tento finančný rok stats.amountFinancialYear diff --git a/translations/messages.sv.xlf b/translations/messages.sv.xlf index ced32a0c9..7b86b5c09 100644 --- a/translations/messages.sv.xlf +++ b/translations/messages.sv.xlf @@ -420,23 +420,23 @@ stats.durationToday - Tid idag + Tid idag stats.durationWeek - Tid denna vecka + Tid denna vecka stats.durationMonth - Tid denna månad + Tid denna månad stats.durationYear - Tid innevarande år + Tid innevarande år stats.durationTotal - Tid, summa + Tid, summa stats.amountToday @@ -1004,7 +1004,7 @@ stats.durationFinancialYear - Tid innevarande budgetår + Tid innevarande budgetår stats.workingTimeFinancialYear diff --git a/translations/messages.ta.xlf b/translations/messages.ta.xlf index 065f6981d..be1c18a89 100644 --- a/translations/messages.ta.xlf +++ b/translations/messages.ta.xlf @@ -72,23 +72,23 @@ stats.durationToday - இன்றைய வேலை நேரம் + இன்றைய வேலை நேரம் stats.durationWeek - இந்த வார வேலை நேரம் + இந்த வார வேலை நேரம் stats.durationMonth - இந்த மாத வேலை நேரம் + இந்த மாத வேலை நேரம் stats.durationYear - இந்த ஆண்டு வேலை நேரம் + இந்த ஆண்டு வேலை நேரம் stats.durationFinancialYear - இந்தப் பொருள் ஆண்டு வேலை நேரம் + இந்தப் பொருள் ஆண்டு வேலை நேரம் stats.userDurationWeek @@ -376,7 +376,7 @@ stats.durationTotal - வேலை நேரம் மொத்தம் + வேலை நேரம் மொத்தம் stats.userDurationToday diff --git a/translations/messages.tr.xlf b/translations/messages.tr.xlf index bfe55d195..21de91773 100644 --- a/translations/messages.tr.xlf +++ b/translations/messages.tr.xlf @@ -462,25 +462,25 @@ ROLE_USER Kullanıcı - + stats.durationToday - Bugünün çalışma saatleri + Bugünün çalışma saatleri - + stats.durationWeek - Bu haftanın çalışma saatleri + Bu haftanın çalışma saatleri - + stats.durationMonth - Bu ayın çalışma saatleri + Bu ayın çalışma saatleri - + stats.durationYear - Bu yılın çalışma saatleri + Bu yılın çalışma saatleri - + stats.durationTotal - Toplam çalışma saati + Toplam çalışma saati stats.yourWorkingHours @@ -990,9 +990,9 @@ stats.amountFinancialYear Bu mali yılın geliri - + stats.durationFinancialYear - Bu mali yılın çalışma saatleri + Bu mali yılın çalışma saatleri stats.workingTimeFinancialYear diff --git a/translations/messages.uk.xlf b/translations/messages.uk.xlf index fbf58e606..f978f834a 100644 --- a/translations/messages.uk.xlf +++ b/translations/messages.uk.xlf @@ -444,27 +444,27 @@ stats.durationToday - Робочий час сьогодні + Сьогодні stats.durationWeek - Робочий час за поточний тиждень + Цього тижня stats.durationMonth - Робочий час за поточний місяць + Цей місяць stats.durationYear - Робочий час за поточний рік + Цього року stats.durationFinancialYear - Робочий час за поточний фінансовий рік + Фінансовий рік - + stats.durationTotal - Всього робочих годин + Всього stats.yourWorkingHours diff --git a/translations/messages.vi.xlf b/translations/messages.vi.xlf index 8d1f2ebed..b93e96d2e 100644 --- a/translations/messages.vi.xlf +++ b/translations/messages.vi.xlf @@ -538,25 +538,25 @@ ROLE_USER Người dùng - + stats.durationToday - Giờ làm việc hôm nay + Giờ làm việc hôm nay - + stats.durationWeek - Giờ làm việc trong tuần này + Giờ làm việc trong tuần này - + stats.durationMonth - Giờ làm việc trong tháng này + Giờ làm việc trong tháng này - + stats.durationYear - Giờ làm việc năm nay + Giờ làm việc năm nay - + stats.durationTotal - Tổng số giờ làm việc + Tổng số giờ làm việc stats.yourWorkingHours @@ -982,9 +982,9 @@ revenue Doanh thu - + stats.durationFinancialYear - Tổng số giờ làm việc trong năm tài chính này + Tổng số giờ làm việc trong năm tài chính này set_as_default diff --git a/translations/messages.zh_CN.xlf b/translations/messages.zh_CN.xlf index df7fc2322..3ded2df5e 100644 --- a/translations/messages.zh_CN.xlf +++ b/translations/messages.zh_CN.xlf @@ -482,25 +482,25 @@ ROLE_USER 用户 - + stats.durationToday - 今日工作时长 + 今日工作时长 - + stats.durationWeek - 本周工作时长 + 本周工作时长 - + stats.durationMonth - 本月工作时长 + 本月工作时长 - + stats.durationYear - 本年工作时长 + 本年工作时长 - + stats.durationTotal - 总工作时长 + 总工作时长 stats.yourWorkingHours @@ -918,9 +918,9 @@ Working hours 工作时间 - + stats.durationFinancialYear - 本财政年度工作时间 + 本财政年度工作时间 revenue diff --git a/translations/messages.zh_Hant.xlf b/translations/messages.zh_Hant.xlf index 55d590765..feecd904b 100644 --- a/translations/messages.zh_Hant.xlf +++ b/translations/messages.zh_Hant.xlf @@ -570,29 +570,29 @@ revenue 營收 - + stats.durationToday - 本日工時 + 本日工時 - + stats.durationWeek - 本週工時 + 本週工時 - + stats.durationMonth - 本月工時 + 本月工時 - + stats.durationFinancialYear - 本會計年度工時 + 本會計年度工時 - + stats.durationYear - 本年度工時 + 本年度工時 - + stats.durationTotal - 總工時 + 總工時 stats.yourWorkingHours From 2a75cd6230238b668ab9e1e363f53956b6cacb78 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Thu, 13 Mar 2025 18:00:50 +0100 Subject: [PATCH 02/72] random improvements (#5382) * remove permission check, as own timesheets should always be visible * new methods to create datetime * allow access to user roles in javascript * support class for dropdown actions * allow to edit internal rate * support human readable duration in export via user configuration * allow to order timesheet listing by user, exported and billable field * bump codecov action --- .github/workflows/testing.yaml | 2 +- assets/js/plugins/KimaiUser.js | 7 ++ assets/js/widgets/KimaiPaginatedBoxWidget.js | 3 +- .../TimesheetAbstractController.php | 6 +- src/Controller/TimesheetTeamController.php | 1 + src/Export/Base/SpreadsheetRenderer.php | 10 ++- .../DurationDecimalFormatter.php | 31 +++++++++ .../CellFormatter/DurationFormatter.php | 13 +++- src/Form/TimesheetEditForm.php | 4 ++ src/Form/Toolbar/TimesheetToolbarForm.php | 8 ++- src/Form/Type/InternalRateType.php | 38 +++++++++++ src/Repository/Query/BaseQuery.php | 25 +++++++ src/Repository/Query/TimesheetQuery.php | 6 +- src/Repository/TimesheetRepository.php | 5 -- src/Repository/UserRepository.php | 3 + src/Timesheet/DateTimeFactory.php | 27 ++++++++ src/Twig/LocaleFormatExtensions.php | 4 +- src/Utils/Duration.php | 13 ++-- src/Widget/Type/AbstractWidget.php | 2 +- templates/macros/widgets.html.twig | 2 +- templates/project/embed_activities.html.twig | 6 +- templates/timesheet/edit-default.html.twig | 5 +- tests/Export/Base/CsvRendererTest.php | 6 +- .../DurationDecimalFormatterTest.php | 68 +++++++++++++++++++ .../CellFormatter/DurationFormatterTest.php | 10 +-- tests/Twig/LocaleFormatExtensionsTest.php | 2 + 26 files changed, 271 insertions(+), 36 deletions(-) create mode 100644 src/Export/Package/CellFormatter/DurationDecimalFormatter.php create mode 100644 src/Form/Type/InternalRateType.php create mode 100644 tests/Export/Package/CellFormatter/DurationDecimalFormatterTest.php diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index cf4061573..325293e65 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -104,7 +104,7 @@ jobs: - name: Upload code coverage if: matrix.php == '8.2' - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml diff --git a/assets/js/plugins/KimaiUser.js b/assets/js/plugins/KimaiUser.js index b3b7e13b1..f60ea8f4d 100644 --- a/assets/js/plugins/KimaiUser.js +++ b/assets/js/plugins/KimaiUser.js @@ -49,4 +49,11 @@ export default class KimaiUser extends KimaiPlugin { return this.user.superAdmin; } + /** + * @returns {array} + */ + getRoles() { + return this.user.roles; + } + } diff --git a/assets/js/widgets/KimaiPaginatedBoxWidget.js b/assets/js/widgets/KimaiPaginatedBoxWidget.js index 6e5665cf1..1515c032e 100644 --- a/assets/js/widgets/KimaiPaginatedBoxWidget.js +++ b/assets/js/widgets/KimaiPaginatedBoxWidget.js @@ -16,7 +16,6 @@ export default class KimaiPaginatedBoxWidget { constructor(boxId) { this.selector = boxId; const widget = document.querySelector(this.selector); - this.href = widget.dataset['href']; if (widget.dataset['reload'] !== undefined) { this.events = widget.dataset['reload'].split(' '); @@ -93,7 +92,7 @@ export default class KimaiPaginatedBoxWidget { if (node.tagName !== undefined && node.tagName === 'SCRIPT') { const script = document.createElement('script'); script.text = node.innerHTML; - node.parentNode.replaceChild(script, node ); + node.parentNode.replaceChild(script, node); } else { for (const child of node.childNodes) { this._makeScriptExecutable(child); diff --git a/src/Controller/TimesheetAbstractController.php b/src/Controller/TimesheetAbstractController.php index c5ef9e1ec..092445650 100644 --- a/src/Controller/TimesheetAbstractController.php +++ b/src/Controller/TimesheetAbstractController.php @@ -106,11 +106,11 @@ abstract class TimesheetAbstractController extends AbstractController } if ($canSeeUsername) { - $table->addColumn('username', ['class' => 'd-none d-md-table-cell', 'orderBy' => false]); + $table->addColumn('username', ['class' => 'd-none d-md-table-cell', 'orderBy' => 'user']); } - $table->addColumn('billable', ['class' => 'text-center d-none w-min', 'orderBy' => false]); - $table->addColumn('exported', ['class' => 'text-center d-none w-min', 'orderBy' => false]); + $table->addColumn('billable', ['class' => 'text-center d-none w-min']); + $table->addColumn('exported', ['class' => 'text-center d-none w-min']); $table->addColumn('actions', ['class' => 'actions']); $page = $this->createPageSetup(); diff --git a/src/Controller/TimesheetTeamController.php b/src/Controller/TimesheetTeamController.php index 67a758359..63ad00c0a 100644 --- a/src/Controller/TimesheetTeamController.php +++ b/src/Controller/TimesheetTeamController.php @@ -45,6 +45,7 @@ final class TimesheetTeamController extends TimesheetAbstractController public function indexAction(int $page, Request $request): Response { $query = $this->createDefaultQuery(); + $query->addAllowedOrderColumns('user'); $query->setPage($page); return $this->index($query, $request, 'admin_timesheet', 'admin_timesheet_paginated', TimesheetMetaDisplayEvent::TEAM_TIMESHEET); diff --git a/src/Export/Base/SpreadsheetRenderer.php b/src/Export/Base/SpreadsheetRenderer.php index ee5c02f9e..50bb0b4fb 100644 --- a/src/Export/Base/SpreadsheetRenderer.php +++ b/src/Export/Base/SpreadsheetRenderer.php @@ -11,6 +11,7 @@ namespace App\Export\Base; use App\Entity\ExportableItem; use App\Entity\MetaTableTypeInterface; +use App\Entity\User; use App\Event\ActivityMetaDisplayEvent; use App\Event\CustomerMetaDisplayEvent; use App\Event\MetaDisplayEventInterface; @@ -22,6 +23,7 @@ use App\Export\Package\CellFormatter\BooleanFormatter; use App\Export\Package\CellFormatter\CellFormatterInterface; use App\Export\Package\CellFormatter\DateFormatter; use App\Export\Package\CellFormatter\DefaultFormatter; +use App\Export\Package\CellFormatter\DurationDecimalFormatter; use App\Export\Package\CellFormatter\DurationFormatter; use App\Export\Package\CellFormatter\RateFormatter; use App\Export\Package\CellFormatter\TextFormatter; @@ -130,6 +132,7 @@ final class SpreadsheetRenderer 'date' => new DateFormatter(), 'time' => new TimeFormatter(), 'duration' => new DurationFormatter(), + 'duration_decimal' => new DurationDecimalFormatter(), default => new DefaultFormatter() }; } @@ -141,12 +144,17 @@ final class SpreadsheetRenderer { $showRates = $this->isRenderRate($query); + $durationFormatter = 'duration'; + if (($user = $this->voter->getUser()) instanceof User) { + $durationFormatter = $user->isExportDecimal() ? 'duration_decimal' : 'duration'; + } + $columns = []; $columns[] = (new Column('date', $this->getFormatter('date')))->withExtractor(fn (ExportableItem $exportableItem) => $exportableItem->getBegin()); $columns[] = (new Column('begin', $this->getFormatter('time')))->withExtractor(fn (ExportableItem $exportableItem) => $exportableItem->getBegin())->withColumnWidth(ColumnWidth::SMALL); $columns[] = (new Column('end', $this->getFormatter('time')))->withExtractor(fn (ExportableItem $exportableItem) => $exportableItem->getEnd())->withColumnWidth(ColumnWidth::SMALL); - $columns[] = (new Column('duration', $this->getFormatter('duration')))->withExtractor(fn (ExportableItem $exportableItem) => $exportableItem->getDuration())->withColumnWidth(ColumnWidth::SMALL); + $columns[] = (new Column('duration', $this->getFormatter($durationFormatter)))->withExtractor(fn (ExportableItem $exportableItem) => $exportableItem->getDuration())->withColumnWidth(ColumnWidth::SMALL); if ($showRates) { $columns[] = (new Column('currency', $this->getFormatter('default')))->withExtractor(fn (ExportableItem $exportableItem) => $exportableItem->getProject()?->getCustomer()?->getCurrency())->withColumnWidth(ColumnWidth::SMALL); diff --git a/src/Export/Package/CellFormatter/DurationDecimalFormatter.php b/src/Export/Package/CellFormatter/DurationDecimalFormatter.php new file mode 100644 index 000000000..55e9aee1c --- /dev/null +++ b/src/Export/Package/CellFormatter/DurationDecimalFormatter.php @@ -0,0 +1,31 @@ +duration = new Duration(); + } + + public function formatValue(mixed $value): mixed + { + if (is_numeric($value)) { + return $this->duration->formatDecimal((int) $value); + } + + return 0.0; + } +} diff --git a/src/Export/Package/CellFormatter/DurationFormatter.php b/src/Export/Package/CellFormatter/DurationFormatter.php index 30f1f00f0..9d380028c 100644 --- a/src/Export/Package/CellFormatter/DurationFormatter.php +++ b/src/Export/Package/CellFormatter/DurationFormatter.php @@ -9,14 +9,23 @@ namespace App\Export\Package\CellFormatter; +use App\Utils\Duration; + final class DurationFormatter implements CellFormatterInterface { + private Duration $duration; + + public function __construct() + { + $this->duration = new Duration(); + } + public function formatValue(mixed $value): mixed { if (is_numeric($value)) { - return (float) number_format($value / 3600, 2, '.', ''); + return $this->duration->format((int) $value); } - return 0.0; + return $this->duration->format(0); } } diff --git a/src/Form/TimesheetEditForm.php b/src/Form/TimesheetEditForm.php index d3812a745..aff4012d6 100644 --- a/src/Form/TimesheetEditForm.php +++ b/src/Form/TimesheetEditForm.php @@ -18,6 +18,7 @@ use App\Form\Type\DescriptionType; use App\Form\Type\DurationType; use App\Form\Type\FixedRateType; use App\Form\Type\HourlyRateType; +use App\Form\Type\InternalRateType; use App\Form\Type\MetaFieldsCollectionType; use App\Form\Type\TagsType; use App\Form\Type\TimePickerType; @@ -365,6 +366,9 @@ class TimesheetEditForm extends AbstractType ]) ->add('hourlyRate', HourlyRateType::class, [ 'currency' => $currency, + ]) + ->add('internalRate', InternalRateType::class, [ + 'currency' => $currency, ]); } diff --git a/src/Form/Toolbar/TimesheetToolbarForm.php b/src/Form/Toolbar/TimesheetToolbarForm.php index 2f397d771..d2d597a78 100644 --- a/src/Form/Toolbar/TimesheetToolbarForm.php +++ b/src/Form/Toolbar/TimesheetToolbarForm.php @@ -44,8 +44,12 @@ final class TimesheetToolbarForm extends AbstractType $this->addExportStateChoice($builder); $this->addPageSizeChoice($builder); $this->addHiddenPagination($builder); - $this->addOrder($builder); - $this->addOrderBy($builder, TimesheetQuery::TIMESHEET_ORDER_ALLOWED); + + $query = $options['data']; + if ($query instanceof TimesheetQuery) { + $this->addOrder($builder); + $this->addOrderBy($builder, $query->getAllowedOrderColumns()); + } } public function configureOptions(OptionsResolver $resolver): void diff --git a/src/Form/Type/InternalRateType.php b/src/Form/Type/InternalRateType.php new file mode 100644 index 000000000..99a7faee5 --- /dev/null +++ b/src/Form/Type/InternalRateType.php @@ -0,0 +1,38 @@ +setDefaults([ + // documentation is for NelmioApiDocBundle + 'documentation' => [ + 'type' => 'number', + 'description' => 'Internal (hourly) rate', + ], + 'required' => false, + 'label' => 'internalRate', + ]); + } + + public function getParent(): string + { + return MoneyType::class; + } +} diff --git a/src/Repository/Query/BaseQuery.php b/src/Repository/Query/BaseQuery.php index f553d3ae1..3cad20cd5 100644 --- a/src/Repository/Query/BaseQuery.php +++ b/src/Repository/Query/BaseQuery.php @@ -44,6 +44,10 @@ class BaseQuery * @var array */ private array $orderGroups = []; + /** + * @var array + */ + private array $allowedOrderColumns = []; private ?User $currentUser = null; /** * @var array @@ -428,4 +432,25 @@ class BaseQuery { return $this->isApiCall; } + + /** + * @return string[] + */ + public function getAllowedOrderColumns(): array + { + return $this->allowedOrderColumns; + } + + /** + * @param array $allowedOrderColumns + */ + public function setAllowedOrderColumns(array $allowedOrderColumns): void + { + $this->allowedOrderColumns = $allowedOrderColumns; + } + + public function addAllowedOrderColumns(string $allowedOrderColumn): void + { + $this->allowedOrderColumns[] = $allowedOrderColumn; + } } diff --git a/src/Repository/Query/TimesheetQuery.php b/src/Repository/Query/TimesheetQuery.php index 0d935c41c..b7885cd74 100644 --- a/src/Repository/Query/TimesheetQuery.php +++ b/src/Repository/Query/TimesheetQuery.php @@ -25,7 +25,10 @@ class TimesheetQuery extends ActivityQuery implements BillableInterface, DateRan public const STATE_EXPORTED = 4; public const STATE_NOT_EXPORTED = 5; - public const TIMESHEET_ORDER_ALLOWED = ['begin', 'end', 'duration', 'rate', 'hourlyRate', 'customer', 'project', 'activity', 'description']; + /** + * @deprecated since 2.31.0 + */ + public const TIMESHEET_ORDER_ALLOWED = ['begin', 'end', 'duration', 'rate', 'hourlyRate', 'customer', 'project', 'activity', 'description', 'billable', 'exported']; private ?User $timesheetUser = null; /** @var array */ @@ -61,6 +64,7 @@ class TimesheetQuery extends ActivityQuery implements BillableInterface, DateRan 'users' => [], 'activities' => [], ]); + $this->setAllowedOrderColumns(self::TIMESHEET_ORDER_ALLOWED); // @phpstan-ignore-line } public function addQueryHint(TimesheetQueryHint $hint): void diff --git a/src/Repository/TimesheetRepository.php b/src/Repository/TimesheetRepository.php index 43254c673..28e2ed9a4 100644 --- a/src/Repository/TimesheetRepository.php +++ b/src/Repository/TimesheetRepository.php @@ -730,11 +730,6 @@ class TimesheetRepository extends EntityRepository ->setParameter('begin', \DateTimeImmutable::createFromInterface($startFrom), Types::DATETIME_IMMUTABLE); } - $qb->join('t.project', 'p'); - $qb->join('p.customer', 'c'); - - $this->addPermissionCriteria($qb, $user); - $results = $qb->getQuery()->getScalarResult(); if (empty($results)) { diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index b41e3d77a..c6773408d 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -169,6 +169,9 @@ class UserRepository extends EntityRepository implements UserLoaderInterface, Us public function refreshUser(UserInterface $user): User { + // TODO 3.0 add a last_updated field to user and ONLY load this for comparison. + // TODO then only execute the below code if last_updated != session.last_updated + return $this->loadUserByIdentifier($user->getUserIdentifier()); } diff --git a/src/Timesheet/DateTimeFactory.php b/src/Timesheet/DateTimeFactory.php index 9ec101761..339cf0a84 100644 --- a/src/Timesheet/DateTimeFactory.php +++ b/src/Timesheet/DateTimeFactory.php @@ -69,6 +69,19 @@ final class DateTimeFactory return DateTime::createFromInterface($date); } + private function createDate(DateTimeInterface|string|null $date = null): \DateTimeImmutable + { + if ($date === null) { + $date = 'now'; + } + + if (\is_string($date)) { + return $this->create($date); + } + + return \DateTimeImmutable::createFromInterface($date); + } + public function getStartOfWeek(DateTimeInterface|string|null $date = null): DateTime { $date = $this->getDate($date); @@ -139,6 +152,20 @@ final class DateTimeFactory return new \DateTimeImmutable($datetime, $this->getTimezone()); } + public function createStartOfDay(DateTimeInterface|string|null $date = null): \DateTimeImmutable + { + $date = $this->createDate($date); + + return $date->modify('00:00:00'); + } + + public function createEndOfDay(DateTimeInterface|string|null $date = null): \DateTimeImmutable + { + $date = $this->createDate($date); + + return $date->modify('23:59:59'); + } + /** * @param string $format * @param null|string $datetime diff --git a/src/Twig/LocaleFormatExtensions.php b/src/Twig/LocaleFormatExtensions.php index 3b30d18d7..ce2de883a 100644 --- a/src/Twig/LocaleFormatExtensions.php +++ b/src/Twig/LocaleFormatExtensions.php @@ -191,6 +191,7 @@ final class LocaleFormatExtensions extends AbstractExtension implements LocaleAw $admin = false; $superAdmin = false; $timezone = date_default_timezone_get(); + $roles = []; if ($user !== null) { $browserTitle = (bool) $user->getPreferenceValue('update_browser_title'); @@ -200,6 +201,7 @@ final class LocaleFormatExtensions extends AbstractExtension implements LocaleAw $admin = $user->isAdmin(); $superAdmin = $user->isSuperAdmin(); $timezone = $user->getTimezone(); + $roles = $user->getRoles(); } $language ??= $this->locale ?? User::DEFAULT_LANGUAGE; @@ -213,7 +215,7 @@ final class LocaleFormatExtensions extends AbstractExtension implements LocaleAw 'twentyFourHours' => $this->localeService->is24Hour($this->locale), 'updateBrowserTitle' => $browserTitle, 'timezone' => $timezone, - 'user' => ['id' => $id, 'name' => $name, 'admin' => $admin, 'superAdmin' => $superAdmin], + 'user' => ['id' => $id, 'name' => $name, 'admin' => $admin, 'superAdmin' => $superAdmin, 'roles' => $roles], ]; } diff --git a/src/Utils/Duration.php b/src/Utils/Duration.php index c6914379a..6f2b37581 100644 --- a/src/Utils/Duration.php +++ b/src/Utils/Duration.php @@ -19,12 +19,17 @@ final class Duration public const FORMAT_DECIMAL = 'decimal'; public const FORMAT_DEFAULT = '%h:%m'; + public function formatDecimal(?int $seconds): float + { + if ($seconds === null || $seconds === 0) { + return 0.0; + } + + return (float) number_format($seconds / 3600, 2, '.', ''); + } + /** * Transforms seconds into a duration string. - * - * @param int|null $seconds - * @param string $format - * @return string|null */ public function format(?int $seconds, string $format = self::FORMAT_DEFAULT): ?string { diff --git a/src/Widget/Type/AbstractWidget.php b/src/Widget/Type/AbstractWidget.php index 6dd92d1ef..395bc92c9 100644 --- a/src/Widget/Type/AbstractWidget.php +++ b/src/Widget/Type/AbstractWidget.php @@ -40,7 +40,7 @@ abstract class AbstractWidget implements WidgetInterface public function getWidth(): int { - return WidgetInterface::WIDTH_SMALL; + return WidgetInterface::WIDTH_HALF; } public function getPermissions(): array diff --git a/templates/macros/widgets.html.twig b/templates/macros/widgets.html.twig index 2ecf1a82a..c06e82205 100644 --- a/templates/macros/widgets.html.twig +++ b/templates/macros/widgets.html.twig @@ -61,7 +61,7 @@ {# what to do here ? #} {% else %} {% if values.children is defined and values.children|length > 0 %} - {{ form_row(form.language) }} - {{ form_row(form.separator, {row_attr: {class: 'mb-3 export-type csv'}}) }} {{ form_row(form.columns) }} {{ form_rest(form) }} {% endblock %} @@ -26,9 +25,9 @@ +{% endif %} diff --git a/templates/partials/ticktack.html.twig b/templates/partials/ticktack.html.twig index 9bf0edf5c..b225083eb 100644 --- a/templates/partials/ticktack.html.twig +++ b/templates/partials/ticktack.html.twig @@ -6,19 +6,15 @@ {% endif %}