Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

feat: add indonesian language (#842)

Miguel Ribeiro48db4e300df6
diff --git a/endpoints/notifications/savegotifynotifications.php b/endpoints/notifications/savegotifynotifications.php
index bad8285..b97b7ef 100644
--- a/endpoints/notifications/savegotifynotifications.php
+++ b/endpoints/notifications/savegotifynotifications.php
@@ -27,6 +27,19 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$token = $data["token"];
$ignore_ssl = $data["ignore_ssl"];
+ // Validate URL scheme
+ $parsedUrl = parse_url($url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
$query = "SELECT COUNT(*) FROM gotify_notifications WHERE user_id = :userId";
$stmt = $db->prepare($query);
$stmt->bindParam(":userId", $userId, SQLITE3_INTEGER);
diff --git a/endpoints/notifications/saventfynotifications.php b/endpoints/notifications/saventfynotifications.php
index ce160ad..0e3032e 100644
--- a/endpoints/notifications/saventfynotifications.php
+++ b/endpoints/notifications/saventfynotifications.php
@@ -29,6 +29,20 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$headers = $data["headers"];
$ignore_ssl = $data["ignore_ssl"];
+ $url = rtrim($host, '/') . '/' . ltrim($topic, '/');
+ // Validate URL scheme
+ $parsedUrl = parse_url($url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
$query = "SELECT COUNT(*) FROM ntfy_notifications WHERE user_id = :userId";
$stmt = $db->prepare($query);
$stmt->bindParam(":userId", $userId, SQLITE3_INTEGER);
diff --git a/endpoints/notifications/savewebhooknotifications.php b/endpoints/notifications/savewebhooknotifications.php
index 6cb0791..45c9cd9 100644
--- a/endpoints/notifications/savewebhooknotifications.php
+++ b/endpoints/notifications/savewebhooknotifications.php
@@ -28,6 +28,19 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$cancelation_payload = $data["cancelation_payload"];
$ignore_ssl = $data["ignore_ssl"];
+ // Validate URL scheme
+ $parsedUrl = parse_url($url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
$query = "SELECT COUNT(*) FROM webhook_notifications WHERE user_id = :userId";
$stmt = $db->prepare($query);
$stmt->bindParam(":userId", $userId, SQLITE3_INTEGER);
diff --git a/endpoints/notifications/testdiscordnotifications.php b/endpoints/notifications/testdiscordnotifications.php
index d87eec0..a8be959 100644
--- a/endpoints/notifications/testdiscordnotifications.php
+++ b/endpoints/notifications/testdiscordnotifications.php
@@ -30,6 +30,19 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$bot_username = $data["bot_username"];
$bot_avatar_url = $data["bot_avatar"];
+ // Validate URL scheme
+ $parsedUrl = parse_url($webhook_url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($webhook_url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
$postfields = [
'content' => $message,
'embeds' => [
diff --git a/endpoints/notifications/testgotifynotifications.php b/endpoints/notifications/testgotifynotifications.php
index dfab43f..6c66f1b 100644
--- a/endpoints/notifications/testgotifynotifications.php
+++ b/endpoints/notifications/testgotifynotifications.php
@@ -31,6 +31,19 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$token = $data["token"];
$ignore_ssl = $data["ignore_ssl"];
+ // Validate URL scheme
+ $parsedUrl = parse_url($url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
$ch = curl_init();
// Set the URL and other options
diff --git a/endpoints/notifications/testntfynotifications.php b/endpoints/notifications/testntfynotifications.php
index 4d5c3cf..d18fb96 100644
--- a/endpoints/notifications/testntfynotifications.php
+++ b/endpoints/notifications/testntfynotifications.php
@@ -33,9 +33,22 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
return "$key: $value";
}, array_keys($headers), $headers);
- $url = "$host/$topic";
+ $url = rtrim($host, '/') . '/' . ltrim($topic, '/');
$ignore_ssl = $data["ignore_ssl"];
+ // Validate URL scheme
+ $parsedUrl = parse_url($url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
// Set the message parameters
$message = translate('test_notification', $i18n);
diff --git a/endpoints/notifications/testwebhooknotifications.php b/endpoints/notifications/testwebhooknotifications.php
index 075aa50..d10a402 100644
--- a/endpoints/notifications/testwebhooknotifications.php
+++ b/endpoints/notifications/testwebhooknotifications.php
@@ -42,6 +42,19 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$url = $data["url"];
$payload = $data["payload"];
+ // Validate URL scheme
+ $parsedUrl = parse_url($url);
+ if (
+ !isset($parsedUrl['scheme']) ||
+ !in_array(strtolower($parsedUrl['scheme']), ['http', 'https']) ||
+ !filter_var($url, FILTER_VALIDATE_URL)
+ ) {
+ die(json_encode([
+ "success" => false,
+ "message" => translate("error", $i18n)
+ ]));
+ }
+
// Replace placeholders in the payload with fake subscription data
foreach ($fakeSubscription as $key => $value) {
$placeholder = "{{" . $key . "}}";
diff --git a/endpoints/user/save_user.php b/endpoints/user/save_user.php
index 4e96b7c..7cbdb15 100644
--- a/endpoints/user/save_user.php
+++ b/endpoints/user/save_user.php
@@ -198,8 +198,8 @@ function resizeAndUploadAvatar($uploadedFile, $uploadDir, $name)
if (
isset($_SESSION['username'])
- && isset($_POST['firstname']) && $_POST['firstname'] !== ""
- && isset($_POST['lastname']) && $_POST['lastname'] !== ""
+ && isset($_POST['firstname'])
+ && isset($_POST['lastname'])
&& isset($_POST['email']) && $_POST['email'] !== ""
&& isset($_POST['avatar']) && $_POST['avatar'] !== ""
&& isset($_POST['main_currency']) && $_POST['main_currency'] !== ""
diff --git a/includes/header.php b/includes/header.php
index 7410447..a123b67 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -163,7 +163,7 @@ $mobileNavigation = $settings['mobile_nav'] ? "mobile-navigation" : "";
<div class="dropdown">
<button class="dropbtn" onClick="toggleDropdown()">
<img src="<?= htmlspecialchars($userData['avatar'], ENT_QUOTES, 'UTF-8') ?>" alt="me" id="avatar">
- <span id="user" class="mobileNavigationHideOnMobile"><?= $userData['firstname'] ?></span>
+ <span id="user" class="mobileNavigationHideOnMobile"><?= $userData['username'] ?></span>
</button>
<div class="dropdown-content">
<a href="profile.php" class="mobileNavigationHideOnMobile">
diff --git a/includes/i18n/cs.php b/includes/i18n/cs.php
index c9b19df..ce2cd95 100644
--- a/includes/i18n/cs.php
+++ b/includes/i18n/cs.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Žádné odpovídající předplatné",
"clone" => "Klonovat",
"renew" => "Obnovit",
+ "calculate_next_payment_date" => "Vypočítat datum další platby",
// Subscription form
"add_subscription" => "Přidat předplatné",
"edit_subscription" => "Upravit předplatné",
diff --git a/includes/i18n/da.php b/includes/i18n/da.php
index 5397725..82085c6 100644
--- a/includes/i18n/da.php
+++ b/includes/i18n/da.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Ingen matchende abonnementer",
"clone" => "Klon",
"renew" => "Forny",
+ "calculate_next_payment_date" => "Beregn næste betalingsdato",
// Subscription form
"add_subscription" => "Tilføj abonnement",
"edit_subscription" => "Rediger abonnement",
diff --git a/includes/i18n/de.php b/includes/i18n/de.php
index 10a39ab..3a4e249 100644
--- a/includes/i18n/de.php
+++ b/includes/i18n/de.php
@@ -79,7 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Keine passenden Abonnements gefunden",
"clone" => "Klonen",
"renew" => "Verlängern",
- "autofill_next_payment" => "Nächste Zahlung automatisch ausfüllen anhand von Startdatum und Interval",
+ "calculate_next_payment_date" => "Berechne nächstes Zahlungsdatum",
// Subscription form
"add_subscription" => "Abonnement hinzufügen",
"edit_subscription" => "Abonnement editieren",
diff --git a/includes/i18n/el.php b/includes/i18n/el.php
index a582e65..f0aa556 100644
--- a/includes/i18n/el.php
+++ b/includes/i18n/el.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Δεν υπάρχουν συνδρομές που ταιριάζουν με τα φίλτρα σου",
"clone" => "Κλώνος",
"renew" => "Ανανέωση",
+ "calculate_next_payment_date" => "Υπολογισμός ημερομηνίας επόμενης πληρωμής",
// Subscription form
"add_subscription" => "Προσθήκη συνδρομής",
"edit_subscription" => "Επεξεργασία συνδρομής",
diff --git a/includes/i18n/en.php b/includes/i18n/en.php
index 3a7d794..25f5d6b 100644
--- a/includes/i18n/en.php
+++ b/includes/i18n/en.php
@@ -79,7 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "No matching subscriptions",
"clone" => "Clone",
"renew" => "Renew",
- "autofill_next_payment" => "Autofill Next Payment by Interval and Start Date",
+ "calculate_next_payment_date" => "Calculate Next Payment Date",
// Subscription form
"add_subscription" => "Add subscription",
"edit_subscription" => "Edit subscription",
diff --git a/includes/i18n/es.php b/includes/i18n/es.php
index c888462..a747efc 100644
--- a/includes/i18n/es.php
+++ b/includes/i18n/es.php
@@ -6,7 +6,7 @@ $i18n = [
"username" => "Nombre de Usuario",
"password" => "Contraseña",
"email" => "Correo Electrónico",
- "firstname" => "Nombre de pila",
+ "firstname" => "Nombre",
"lastname" => "Apellido",
"confirm_password" => "Confirmar Contraseña",
"main_currency" => "Moneda Principal",
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "No hay suscripciones que coincidan con los filtros",
"clone" => "Clonar",
"renew" => "Renovar",
+ "calculate_next_payment_date" => "Calcular Fecha del Próximo Pago",
// Subscription form
"add_subscription" => "Añadir suscripción",
"edit_subscription" => "Editar suscripción",
diff --git a/includes/i18n/fr.php b/includes/i18n/fr.php
index 1baef8e..849c1d8 100644
--- a/includes/i18n/fr.php
+++ b/includes/i18n/fr.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Aucun abonnement ne correspond à vos critères de recherche",
"clone" => "Cloner",
"renew" => "Renouveler",
+ "calculate_next_payment_date" => "Calculer la date du prochain paiement",
// Formulaire d'abonnement
"add_subscription" => "Ajouter un abonnement",
"edit_subscription" => "Modifier l'abonnement",
diff --git a/includes/i18n/id.php b/includes/i18n/id.php
index f9b4a55..08d956b 100644
--- a/includes/i18n/id.php
+++ b/includes/i18n/id.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Tidak ada langganan yang cocok",
"clone" => "Duplikat",
"renew" => "Perpanjang",
+ "calculate_next_payment_date" => "Hitung Tanggal Pembayaran Berikutnya",
// Subscription form
"add_subscription" => "Tambahkan langganan",
"edit_subscription" => "Edit langganan",
diff --git a/includes/i18n/it.php b/includes/i18n/it.php
index 9026d1a..4776ec8 100644
--- a/includes/i18n/it.php
+++ b/includes/i18n/it.php
@@ -83,6 +83,7 @@ $i18n = [
"no_matching_subscriptions" => 'Nessun abbonamento corrispondente',
"clone" => "Clona",
"renew" => "Rinnova",
+ "calculate_next_payment_date" => "Calcola la prossima data di pagamento",
// Add/Edit Subscription
"add_subscription" => 'Aggiungi abbonamento',
diff --git a/includes/i18n/jp.php b/includes/i18n/jp.php
index da4694a..168fad8 100644
--- a/includes/i18n/jp.php
+++ b/includes/i18n/jp.php
@@ -6,7 +6,7 @@ $i18n = [
"username" => "ユーザー名",
"password" => "パスワード",
"email" => "メール",
- "firstname" => "ファーストネーム",
+ "firstname" => "名",
"lastname" => "苗字",
"confirm_password" => "パスワードの確認",
"main_currency" => "主要通貨",
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "一致する定期購入がありません",
"clone" => "複製",
"renew" => "更新",
+ "calculate_next_payment_date" => "次回支払い日を計算",
// Subscription form
"add_subscription" => "定期購入の追加",
"edit_subscription" => "定期購入の編集",
diff --git a/includes/i18n/ko.php b/includes/i18n/ko.php
index cb55149..b66feff 100644
--- a/includes/i18n/ko.php
+++ b/includes/i18n/ko.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "해당하는 구독이 없습니다.",
"clone" => "복제",
"renew" => "갱신",
+ "calculate_next_payment_date" => "다음 결제일 계산",
// Subscription form
"add_subscription" => "구독 추가",
"edit_subscription" => "구독 편집",
diff --git a/includes/i18n/nl.php b/includes/i18n/nl.php
index b46aaed..90a42da 100644
--- a/includes/i18n/nl.php
+++ b/includes/i18n/nl.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Geen overeenkomende abonnementen",
"clone" => "Klonen",
"renew" => "Verlengen",
+ "calculate_next_payment_date" => "Bereken volgende betalingsdatum",
// Subscription form
"add_subscription" => "Abonnement toevoegen",
"edit_subscription" => "Abonnement bewerken",
diff --git a/includes/i18n/pl.php b/includes/i18n/pl.php
index 06c65ab..06c036e 100644
--- a/includes/i18n/pl.php
+++ b/includes/i18n/pl.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Brak pasujących subskrypcji",
"clone" => "Klonuj",
"renew" => "Odnów",
+ "calculate_next_payment_date" => "Oblicz datę następnej płatności",
// Subscription form
"add_subscription" => "Dodaj subskrypcję",
"edit_subscription" => "Edytuj subskrypcję",
diff --git a/includes/i18n/pt.php b/includes/i18n/pt.php
index 2e7a59b..98df33b 100644
--- a/includes/i18n/pt.php
+++ b/includes/i18n/pt.php
@@ -7,7 +7,7 @@ $i18n = [
"password" => "Password",
"email" => "Email",
"firstname" => "Nome próprio",
- "lastname" => "Último nome",
+ "lastname" => "Apelido",
"confirm_password" => "Confirmar Password",
"main_currency" => "Moeda Principal",
"language" => "Linguagem",
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Sem subscrições correspondentes",
"clone" => "Clonar",
"renew" => "Renovar",
+ "calculate_next_payment_date" => "Calcular Próxima Data de Pagamento",
// Subscription form
"add_subscription" => "Adicionar subscrição",
"edit_subscription" => "Modificar subscrição",
diff --git a/includes/i18n/pt_br.php b/includes/i18n/pt_br.php
index e239fdb..0f8c9e0 100644
--- a/includes/i18n/pt_br.php
+++ b/includes/i18n/pt_br.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Nenhuma assinatura encontrada",
"clone" => "Clonar",
"renew" => "Renovar",
+ "calculate_next_payment_date" => "Calcular próxima data de pagamento",
// Subscription form
"add_subscription" => "Adicionar assinatura",
"edit_subscription" => "Editar assinatura",
diff --git a/includes/i18n/ru.php b/includes/i18n/ru.php
index 0062315..68a65dd 100644
--- a/includes/i18n/ru.php
+++ b/includes/i18n/ru.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Нет подходящих подписок",
"clone" => "Клонировать",
"renew" => "Продлить",
+ "calculate_next_payment_date" => "Рассчитать дату следующего платежа",
// Subscription form
"add_subscription" => "Добавить подписку",
"edit_subscription" => "Изменить подписку",
diff --git a/includes/i18n/sl.php b/includes/i18n/sl.php
index ea0bf15..5c7ec8f 100644
--- a/includes/i18n/sl.php
+++ b/includes/i18n/sl.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Ni ustreznih naročnin",
"clone" => "Klon",
"renew" => "Obnovi",
+ "calculate_next_payment_date" => "Izračunaj datum naslednjega plačila",
// Subscription form
"add_subscription" => "Dodaj naročnino",
"edit_subscription" => "Uredi naročnino",
diff --git a/includes/i18n/sr.php b/includes/i18n/sr.php
index 0c8d4dc..c8e401d 100644
--- a/includes/i18n/sr.php
+++ b/includes/i18n/sr.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Нема подударајућих претплата",
"clone" => "Клонирај",
"renew" => "Обнови",
+ "calculate_next_payment_date" => "Израчунајте датум следеће уплате",
// Форма за претплату
"add_subscription" => "Додај претплату",
"edit_subscription" => "Уреди претплату",
diff --git a/includes/i18n/sr_lat.php b/includes/i18n/sr_lat.php
index 6cb0438..576b793 100644
--- a/includes/i18n/sr_lat.php
+++ b/includes/i18n/sr_lat.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Nema podudarajućih pretplata",
"clone" => "Kloniraj",
"renew" => "Obnovi",
+ "calculate_next_payment_date" => "Izračunaj datum sledeće uplate",
// Forma za pretplatu
"add_subscription" => "Dodaj pretplatu",
"edit_subscription" => "Uredi pretplatu",
diff --git a/includes/i18n/tr.php b/includes/i18n/tr.php
index 841c4da..341fd2a 100644
--- a/includes/i18n/tr.php
+++ b/includes/i18n/tr.php
@@ -6,7 +6,7 @@ $i18n = [
"username" => "Kullanıcı Adı",
"password" => "Şifre",
"email" => "E-posta",
- "firstname" => "İlk adı",
+ "firstname" => "Ad",
"lastname" => "Soy isim",
"confirm_password" => "Şifreyi Onayla",
"main_currency" => "Ana Para Birimi",
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Eşleşen abonelik bulunamadı",
"clone" => "Kopyala",
"renew" => "Yenile",
+ "calculate_next_payment_date" => "Sonraki ödeme tarihini hesapla",
// Subscription form
"add_subscription" => "Abonelik ekle",
"edit_subscription" => "Aboneliği düzenle",
diff --git a/includes/i18n/uk.php b/includes/i18n/uk.php
index b290e15..cdd2a3b 100644
--- a/includes/i18n/uk.php
+++ b/includes/i18n/uk.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Немає відповідних підписок",
"clone" => "Клонувати",
"renew" => "Продовжити",
+ "calculate_next_payment_date" => "Розрахувати дату наступного платежу",
// Subscription form
"add_subscription" => "Додати підписку",
"edit_subscription" => "Змінити підписку",
diff --git a/includes/i18n/vi.php b/includes/i18n/vi.php
index 56cd72a..fdecf11 100644
--- a/includes/i18n/vi.php
+++ b/includes/i18n/vi.php
@@ -6,7 +6,7 @@ $i18n = [
"username" => "Tên người dùng",
"password" => "Mật khẩu",
"email" => "Email",
- "firstname" => "Tên đầu tiên",
+ "firstname" => "Tên",
"lastname" => "Họ",
"confirm_password" => "Xác nhận mật khẩu",
"main_currency" => "Tiền tệ chính",
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "Không có đăng ký phù hợp",
"clone" => "Nhân bản",
"renew" => "Gia hạn",
+ "calculate_next_payment_date" => "Tính toán ngày thanh toán tiếp theo",
// Subscription form
"add_subscription" => "Thêm đăng ký",
"edit_subscription" => "Chỉnh sửa đăng ký",
diff --git a/includes/i18n/zh_cn.php b/includes/i18n/zh_cn.php
index 0c26b29..9a021fc 100644
--- a/includes/i18n/zh_cn.php
+++ b/includes/i18n/zh_cn.php
@@ -83,6 +83,7 @@ $i18n = [
"no_matching_subscriptions" => "没有匹配的订阅",
"clone" => "克隆",
"renew" => "续订",
+ "calculate_next_payment_date" => "计算下次支付日期",
// 订阅表单
"add_subscription" => "添加订阅",
diff --git a/includes/i18n/zh_tw.php b/includes/i18n/zh_tw.php
index 29d411b..c9f0a2b 100644
--- a/includes/i18n/zh_tw.php
+++ b/includes/i18n/zh_tw.php
@@ -79,6 +79,7 @@ $i18n = [
"no_matching_subscriptions" => "沒有符合的訂閱服務",
"clone" => "複製",
"renew" => "續訂",
+ "calculate_next_payment_date" => "計算下次付款日期",
// 訂閱表單
"add_subscription" => "新增訂閱服務",
"edit_subscription" => "編輯訂閱服務",
diff --git a/includes/version.php b/includes/version.php
index 0236427..8187927 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v3.1.1";
+$version = "v3.2.0";
?>
\ No newline at end of file
diff --git a/index.php b/index.php
index 1288b42..313ff79 100644
--- a/index.php
+++ b/index.php
@@ -387,12 +387,21 @@ $headerClass = count($subscriptions) > 0 ? "main-actions" : "main-actions hidden
<label for="start_date"><?= translate('start_date', $i18n) ?></label>
<input type="date" id="start_date" name="start_date">
</div>
- <div id="autofill-next-payment-button" class="image-button medium disabled autofill-next-payment-button" title="<?= translate('autofill_next_payment', $i18n) ?>" onClick="autoFillNextPaymentDate()">
- <i class="fa-solid fa-wand-magic-sparkles"></i>
- </div>
+ <button type="button" id="autofill-next-payment-button" class="button secondary-button autofill-next-payment hideOnMobile"
+ title="<?= translate('calculate_next_payment_date', $i18n) ?>" onClick="autoFillNextPaymentDate(event)">
+ <i class="fa-solid fa-wand-magic-sparkles"></i>
+ </button>
<div class="split50">
- <label for="next_payment"><?= translate('next_payment', $i18n) ?></label>
- <input type="date" id="next_payment" name="next_payment" required>
+ <label for="next_payment" class="split-label">
+ <?= translate('next_payment', $i18n) ?>
+ <div id="autofill-next-payment-button" class="autofill-next-payment hideOnDesktop"
+ title="<?= translate('calculate_next_payment_date', $i18n) ?>" onClick="autoFillNextPaymentDate(event)">
+ <i class="fa-solid fa-wand-magic-sparkles"></i>
+ </div>
+ </label>
+ <div>
+ <input type="date" id="next_payment" name="next_payment" required>
+ </div>
</div>
</div>
</div>
diff --git a/registration.php b/registration.php
index 392e9a4..261119d 100644
--- a/registration.php
+++ b/registration.php
@@ -358,11 +358,11 @@ if (isset($_POST['username'])) {
</div>
<div class="form-group">
<label for="firstname"><?= translate('firstname', $i18n) ?>:</label>
- <input type="text" id="firstname" name="firstname" required>
+ <input type="text" id="firstname" name="firstname">
</div>
<div class="form-group">
<label for="lastname"><?= translate('lastname', $i18n) ?>:</label>
- <input type="text" id="lastname" name="lastname" required>
+ <input type="text" id="lastname" name="lastname">
</div>
<div class="form-group">
<label for="email"><?= translate('email', $i18n) ?>:</label>
@@ -456,6 +456,12 @@ if (isset($_POST['username'])) {
accept=".zip">
</div>
<?php
+ } else {
+ ?>
+ <div class="separator">
+ <input id="goToLoginButton" type="button" class="secondary-button" value="<?= translate('login', $i18n) ?>">
+ </div>
+ <?php
}
?>
</section>
diff --git a/scripts/dashboard.js b/scripts/dashboard.js
index 64960bb..df1f30a 100644
--- a/scripts/dashboard.js
+++ b/scripts/dashboard.js
@@ -799,11 +799,18 @@ function swipeHintAnimation() {
}
}
-function autoFillNextPaymentDate() {
+function autoFillNextPaymentDate(e) {
+ e.preventDefault();
const frequencySelect = document.querySelector("#frequency");
const cycleSelect = document.querySelector("#cycle");
const startDate = document.querySelector("#start_date");
const nextPayment = document.querySelector("#next_payment");
+
+ // Do nothing if frequency, cycle, or start date is not set
+ if (!frequencySelect.value || !cycleSelect.value || !startDate.value || isNaN(Date.parse(startDate.value))) {
+ console.log(frequencySelect.value, cycleSelect.value, startDate.value);
+ return;
+ }
const today = new Date();
const cycle = cycleSelect.value;
diff --git a/scripts/registration.js b/scripts/registration.js
index d0e34dd..727d601 100644
--- a/scripts/registration.js
+++ b/scripts/registration.js
@@ -176,9 +176,19 @@ function checkThemeNeedsUpdate() {
}
}
+function enableGoToLoginButton() {
+ const goToLoginButton = document.getElementById('goToLoginButton');
+ if (goToLoginButton) {
+ goToLoginButton.addEventListener('click', function () {
+ window.location.href = 'login.php';
+ });
+ }
+}
+
window.onload = function () {
restoreFormFields();
removeFromStorage();
runDatabaseMigration();
checkThemeNeedsUpdate();
+ enableGoToLoginButton();
};
diff --git a/styles/styles.css b/styles/styles.css
index 1bc5ef7..09e959b 100644
--- a/styles/styles.css
+++ b/styles/styles.css
@@ -1280,6 +1280,12 @@ label {
cursor: pointer;
}
+label.split-label {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+}
+
input {
box-sizing: border-box;
}
@@ -2832,6 +2838,27 @@ input[type="radio"]:checked+label::after {
}
}
-.autofill-next-payment-button {
- margin-top: 20px;
+.button.autofill-next-payment {
+ padding: 15px 15px !important;
+ margin-top: 22px;
+}
+
+.autofill-next-payment {
+ color: var(--main-color);
+ cursor: pointer;
+}
+
+.autofill-next-payment.hideOnDesktop {
+ display: none;
+}
+
+@media (max-width: 768px) {
+ .button.autofill-next-payment.hideOnMobile {
+ display: none !important;
+ }
+
+
+ .autofill-next-payment.hideOnDesktop {
+ display: block;
+ }
}
\ No newline at end of file