From da39950fb8192f48ad40f6777ff3c5cd52459bcd Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 22 Dec 2018 14:58:30 +0000 Subject: [PATCH] Introduced balance output for monthly quotas. --- WEB-INF/resources/ca.lang.php | 2 ++ WEB-INF/resources/cs.lang.php | 2 ++ WEB-INF/resources/da.lang.php | 3 +++ WEB-INF/resources/de.lang.php | 3 +++ WEB-INF/resources/en.lang.php | 2 ++ WEB-INF/resources/es.lang.php | 2 ++ WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 2 ++ WEB-INF/resources/fi.lang.php | 2 ++ WEB-INF/resources/fr.lang.php | 3 +++ WEB-INF/resources/gr.lang.php | 3 +++ WEB-INF/resources/he.lang.php | 2 ++ WEB-INF/resources/hu.lang.php | 2 ++ WEB-INF/resources/it.lang.php | 3 +++ WEB-INF/resources/ja.lang.php | 2 ++ WEB-INF/resources/ko.lang.php | 2 ++ WEB-INF/resources/nl.lang.php | 3 +++ WEB-INF/resources/no.lang.php | 2 ++ WEB-INF/resources/pl.lang.php | 2 ++ WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 2 ++ WEB-INF/resources/ro.lang.php | 2 ++ WEB-INF/resources/ru.lang.php | 2 ++ WEB-INF/resources/sk.lang.php | 2 ++ WEB-INF/resources/sl.lang.php | 2 ++ WEB-INF/resources/sr.lang.php | 2 ++ WEB-INF/resources/sv.lang.php | 3 +++ WEB-INF/resources/tr.lang.php | 2 ++ WEB-INF/resources/zh-cn.lang.php | 2 ++ WEB-INF/resources/zh-tw.lang.php | 2 ++ WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/time.tpl | 12 ++++++++++-- plugins/MonthlyQuota.class.php | 19 +++++++++++++++++++ time.php | 7 ++++++- 34 files changed, 103 insertions(+), 4 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 549241b0..b4d86993 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -405,6 +405,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Aquest historial s\\\'ha guardat únicament amb l\\\'hora d\\\'inici. Aixó no és un error.', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index d66af403..d12be155 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -415,6 +415,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Záznam byl uložen pouze s časem zahájení. Není to chyba.', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 061b1fb6..c4974513 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -376,6 +376,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Uafsluttet', 'form.time.remaining_quota' => 'Resterende kvota', 'form.time.over_quota' => 'Over kvota', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Denne post blev kun gemt med starttidspunkt. Det er ikke en fejl.', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 82599a62..eab807e8 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -357,6 +357,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Unvollständig', 'form.time.remaining_quota' => 'Verbleibende Quote', 'form.time.over_quota' => 'Über der Quote', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Dieser Eintrag wurde ohne Startzeit gespeichert. Dies ist kein Fehler.', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 5d2acd56..aadf6f5a 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -355,6 +355,8 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Uncompleted', 'form.time.remaining_quota' => 'Remaining quota', 'form.time.over_quota' => 'Over quota', +'form.time.remaining_balance' => 'Remaining balance', +'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'This record was saved with only start time. It is not an error.', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 684d60a3..cc4fe034 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -418,6 +418,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Este historial fue guardado solamente con la hora de Inicio. Esto no es un error.', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 97b92fc7..a29929af 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -414,6 +414,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Kanne salvestati ainult alguse ajaga. See ei ole viga.', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 4e298f3b..f1a37b4f 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -398,6 +398,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). // TODO: translate form.time_edit.uncompleted. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 7322bf90..065f71c1 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -384,6 +384,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Vain aloitusaika tallennettiin tietueeseen. Kyseessä ei ole virhe.', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 7584f9c6..4c6d7674 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -373,6 +373,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Non terminée', 'form.time.remaining_quota' => 'Quota restant', 'form.time.over_quota' => 'Quota dépassé', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Cet enregistrement a été sauvegardé avec une heure de début seulement. Il ne s\\\'agit pas d\\\'une erreur.', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index c354b28a..6be29a04 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -365,6 +365,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Μη ολοκληρωμένο', 'form.time.remaining_quota' => 'Υπολειπόμενη ποσόστωση', 'form.time.over_quota' => 'Πάνω από το όριο', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Η καταχώρηση αποθηκεύτηκε μόνο με ώρα έναρξης. Δεν είναι λάθος.', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index d81832cc..d27edb8c 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -405,6 +405,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'רישום זה נשמר עם שעת התחלה בלבד. זאת איננה טעות.', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 2097f990..27642b47 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -407,6 +407,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). // TODO: translate the following. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 77581731..8f35a78e 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -378,6 +378,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Incompleti', 'form.time.remaining_quota' => 'Quota rimanente', 'form.time.over_quota' => 'Sopra quota', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Questo record è stato salvato con la sola ora di inzio attività. Non è un errore.', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 3cb26d69..ea158793 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -414,6 +414,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'このレコードは開始時間だけで保存されました。これはエラーではありません。', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index dc5a1a41..27cbe669 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -413,6 +413,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => '이 기록은 시작 시간으로만 저장되었습니다. 이것은 오류는 아닙니다.', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 99cab30c..b0ada311 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -358,6 +358,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Onvolledig', 'form.time.remaining_quota' => 'Te werken uren voor de doelstelling', 'form.time.over_quota' => 'Meer gewerkte uren dan de doelstelling', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Dit tijdrecord is opgeslagen met alleen een starttijd. Dit is geen fout.', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index e3273ca0..34f4f6d3 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -410,6 +410,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Denne oppføringen ble lagret kun med starttid. Det er ikke en feil.', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 461e6561..a9220c4e 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -386,6 +386,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Ten wpis ma określony jedynie czas rozpoczęcia. To nie jest błąd.', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 241f4544..ee699e11 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -381,6 +381,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Eesta entrada foi salva somente com hora de início. Não é um erro.', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index dad9124a..8a96bc88 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -392,6 +392,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). // TODO: translate the following. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index c3a6077b..4f027f6b 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -415,6 +415,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Aceasta inregistrare a fost salvata numei cu timpul de inceput. Nu este o eroare.', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 727ff51e..466f7cd1 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -352,6 +352,8 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Не завершено', 'form.time.remaining_quota' => 'Доступная квота', 'form.time.over_quota' => 'Превышение квоты', +'form.time.remaining_balance' => 'Доступный баланс', +'form.time.over_balance' => 'Превышение баланса', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Эта запись сохранена только со временем начала. Это не ошибка.', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 1a87dd80..0077e713 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -396,6 +396,8 @@ $i18n_key_words = array( // TODO: translate the folllowing. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Tento záznam bol uložený iba s časom začiatku. Nie je to chyba.', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 5b036edd..9be563c4 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -388,6 +388,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). // TODO: translate the following. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index a8d2bf8f..270984d4 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -384,6 +384,8 @@ $i18n_key_words = array( // TODO: translate the folllowing. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Izmena vremenske forme. Pogledajte primer na https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Ovaj zapis je sačuvan sa početnim vremenom i nije greška.', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index e009c0c5..815ad80e 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -380,6 +380,9 @@ $i18n_key_words = array( 'form.time.uncompleted' => 'Oavslutad', 'form.time.remaining_quota' => 'Återstående kvot', 'form.time.over_quota' => 'Kvoten överstigen', +// TODO: translate the following. +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Den här tidsregistreringen har sparats utan sluttid. Fyll i en sluttid och klicka på Spara för att avsluta.', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 48359a94..720475be 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -425,6 +425,8 @@ $i18n_key_words = array( // 'form.time.uncompleted' => 'Uncompleted', // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Bu kayıt sadece başlangıç zamanıyla silindi. Bu hata değildir.', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index e753c32c..aa9e7dea 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -397,6 +397,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => '该记录只保存了开始时间。这不是错误。', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index b9951b1c..7346c9ad 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -406,6 +406,8 @@ $i18n_key_words = array( // TODO: translate the following. // 'form.time.remaining_quota' => 'Remaining quota', // 'form.time.over_quota' => 'Over quota', +// 'form.time.remaining_balance' => 'Remaining balance', +// 'form.time.over_balance' => 'Over balance', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => '該記錄只保存了開始時間。這不是錯誤。', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 19832de8..44b5b180 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.34.4679 | Copyright © Anuko | +  Anuko Time Tracker 1.18.35.4680 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/time.tpl b/WEB-INF/templates/time.tpl index 76338706..7a360800 100644 --- a/WEB-INF/templates/time.tpl +++ b/WEB-INF/templates/time.tpl @@ -149,7 +149,7 @@
-{if $time_records} + @@ -158,6 +158,14 @@ {if $user->isPluginEnabled('mq')} + {if $over_balance} + + {else} + + {/if} + + + {if $over_quota} {else} @@ -166,5 +174,5 @@ {/if}
{$i18n.label.week_total}: {$week_total}
{$i18n.label.month_total}: {$month_total}{$i18n.form.time.over_balance}: {$balance_remaining}{$i18n.form.time.remaining_balance}: {$balance_remaining}
{$i18n.form.time.over_quota}: {$quota_remaining}
-{/if} + {$forms.timeRecordForm.close} diff --git a/plugins/MonthlyQuota.class.php b/plugins/MonthlyQuota.class.php index a1c1b5d0..21854672 100644 --- a/plugins/MonthlyQuota.class.php +++ b/plugins/MonthlyQuota.class.php @@ -94,6 +94,25 @@ class MonthlyQuota { return $userMinutes; } + // getUserQuotaFrom1st - obtains a quota for user + // from 1st of the month up to and inclusive of $selected_date. + public function getUserQuotaFrom1st($selected_date) { + // TODO: we may need a better algorithm here. Review. + $monthQuotaMinutes = $this->getUserQuota($selected_date->mYear, $selected_date->mMonth); + $workdaysInMonth = $this->getNumWorkdays($selected_date->mMonth, $selected_date->mYear); + + // Iterate from 1st up to selected date. + $workdaysFrom1st = 0; + for ($i = 1; $i <= $selected_date->mDate; $i++) { + $date = "$selected_date->mYear-$selected_date->mMonth-$i"; + if (!ttTimeHelper::isWeekend($date) && !ttTimeHelper::isHoliday($date)) { + $workdaysFrom1st++; + } + } + $quotaMinutesFrom1st = (int) ($monthQuotaMinutes * $workdaysFrom1st / $workdaysInMonth); + return $quotaMinutesFrom1st; + } + // getMany - returns an array of quotas for a given year for group. private function getMany($year){ $sql = "select month, minutes from tt_monthly_quotas". diff --git a/time.php b/time.php index ac6b69b5..8dbffecf 100644 --- a/time.php +++ b/time.php @@ -86,10 +86,15 @@ if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth); + $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date); $month_total = ttTimeHelper::getTimeForMonth($selected_date); - $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total); + $month_total_minutes = ttTimeHelper::toMinutes($month_total); + $balance_left = $quota_minutes_from_1st - $month_total_minutes; + $minutes_left = $month_quota_minutes - $month_total_minutes; $smarty->assign('month_total', $month_total); + $smarty->assign('over_balance', $balance_left < 0); + $smarty->assign('balance_remaining', ttTimeHelper::toAbsDuration($balance_left)); $smarty->assign('over_quota', $minutes_left < 0); $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); } -- 2.20.1