Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.
feat: add ukranian translation (#756)
Miguel Ribeiro1bec973803e0
diff --git a/api/subscriptions/get_ical_feed.php b/api/subscriptions/get_ical_feed.phpindex 6d24020..4429f0d 100644--- a/api/subscriptions/get_ical_feed.php+++ b/api/subscriptions/get_ical_feed.php@@ -163,7 +163,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST" || $_SERVER["REQUEST_METHOD"] === "GET$subscription['price'] = number_format($subscription['price'], 2);$uid = uniqid();- $summary = $subscription['name'];+ $summary = html_entity_decode($subscription['name'], ENT_QUOTES, 'UTF-8');$description = "Price: {$subscription['currency']}{$subscription['price']}\\nCategory: {$subscription['category']}\\nPayment Method: {$subscription['payment_method']}\\nPayer: {$subscription['payer_user']}\\nNotes: {$subscription['notes']}";$dtstart = (new DateTime($subscription['next_payment']))->format('Ymd');$dtend = (new DateTime($subscription['next_payment']))->format('Ymd');diff --git a/endpoints/cronjobs/sendnotifications.php b/endpoints/cronjobs/sendnotifications.phpindex 0d029e7..bd31bd7 100644--- a/endpoints/cronjobs/sendnotifications.php+++ b/endpoints/cronjobs/sendnotifications.php@@ -233,7 +233,7 @@ while ($userToNotify = $usersToNotify->fetchArray(SQLITE3_ASSOC)) {echo "Next payment date: " . $nextPaymentDate->format('Y-m-d') . "<br />";echo "Current date: " . $currentDate->format('Y-m-d') . "<br />";echo "Difference: " . $difference . "<br />";- $notify[$rowSubscription['payer_user_id']][$i]['name'] = $rowSubscription['name'];+ $notify[$rowSubscription['payer_user_id']][$i]['name'] = html_entity_decode($rowSubscription['name'], ENT_QUOTES, 'UTF-8');$notify[$rowSubscription['payer_user_id']][$i]['price'] = $rowSubscription['price'] . $currencies[$rowSubscription['currency_id']]['symbol'];$notify[$rowSubscription['payer_user_id']][$i]['currency'] = $currencies[$rowSubscription['currency_id']]['name'];$notify[$rowSubscription['payer_user_id']][$i]['category'] = $categories[$rowSubscription['category_id']]['name'];diff --git a/endpoints/subscription/exportcalendar.php b/endpoints/subscription/exportcalendar.phpindex 6a8fe29..396179f 100644--- a/endpoints/subscription/exportcalendar.php+++ b/endpoints/subscription/exportcalendar.php@@ -39,13 +39,13 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {// Create ICS from subscription information$uid = uniqid();- $summary = "Wallos: " . $subscription['name'];+ $summary = html_entity_decode($subscription['name'], ENT_QUOTES, 'UTF-8');$description = "Price: {$subscription['currency']}{$subscription['price']}\nCategory: {$subscription['category']}\nPayment Method: {$subscription['payment_method']}\nPayer: {$subscription['payer_user']}\n\nNotes: {$subscription['notes']}";$dtstart = (new DateTime($subscription['next_payment']))->format('Ymd\THis\Z');$dtend = (new DateTime($subscription['next_payment']))->modify('+1 hour')->format('Ymd\THis\Z');$location = isset($subscription['url']) ? $subscription['url'] : '';- $alarm_trigger = '-' . $subscription['trigger'] . 'D';+ $alarm_trigger = '-P' . $subscription['trigger'] . 'D';$icsContent = <<<ICSBEGIN:VCALENDARdiff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.phpindex 8d61ae5..0a78952 100644--- a/endpoints/subscriptions/get.php+++ b/endpoints/subscriptions/get.php@@ -85,12 +85,17 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {$params[':inactive'] = $_GET['state'];}+ if (isset($_GET['renewalType']) && $_GET['renewalType'] != "") {+ $sql .= " AND auto_renew = :auto_renew";+ $params[':auto_renew'] = $_GET['renewalType'];+ }+if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") {$sort = $_COOKIE['sortOrder'];}$sortOrder = $sort;- $allowedSortCriteria = ['name', 'id', 'next_payment', 'price', 'payer_user_id', 'category_id', 'payment_method_id', 'inactive', 'alphanumeric'];+ $allowedSortCriteria = ['name', 'id', 'next_payment', 'price', 'payer_user_id', 'category_id', 'payment_method_id', 'inactive', 'alphanumeric', 'renewal_type'];$order = ($sort == "price" || $sort == "id") ? "DESC" : "ASC";if ($sort == "alphanumeric") {@@ -101,6 +106,10 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {$sort = "next_payment";}+ if ($sort == "renewal_type") {+ $sort = "auto_renew";+ }+$orderByClauses = [];if ($settings['disabledToBottom'] === 'true') {diff --git a/includes/filters_menu.php b/includes/filters_menu.phpnew file mode 100644index 0000000..123ae28--- /dev/null+++ b/includes/filters_menu.php@@ -0,0 +1,121 @@+<div class="filtermenu-content">+ <?php+ if (count($members) > 1) {+ ?>+ <div class="filtermenu-submenu">+ <div class="filter-title" onClick="toggleSubMenu('member')"><?= translate("member", $i18n) ?></div>+ <div class="filtermenu-submenu-content" id="filter-member">+ <?php+ foreach ($members as $member) {+ if ($member['count'] == 0) {+ continue;+ }+ $selectedClass = '';+ if (isset($_GET['member'])) {+ $memberIds = explode(',', $_GET['member']);+ if (in_array($member['id'], $memberIds)) {+ $selectedClass = 'selected';+ }+ }+ ?>+ <div class="filter-item <?= $selectedClass ?>" data-memberid="<?= $member['id'] ?>"><?= $member['name'] ?>+ </div>+ <?php+ }+ ?>+ </div>+ </div>+ <?php+ }+ ?>+ <?php+ if (count($categories) > 1) {+ ?>+ <div class="filtermenu-submenu">+ <div class="filter-title" onClick="toggleSubMenu('category')"><?= translate("category", $i18n) ?></div>+ <div class="filtermenu-submenu-content" id="filter-category">+ <?php+ foreach ($categories as $category) {+ if ($category['count'] == 0) {+ continue;+ }+ if ($category['name'] == "No category") {+ $category['name'] = translate("no_category", $i18n);+ }+ $selectedClass = '';+ if (isset($_GET['category'])) {+ $categoryIds = explode(',', $_GET['category']);+ if (in_array($category['id'], $categoryIds)) {+ $selectedClass = 'selected';+ }+ }+ ?>+ <div class="filter-item <?= $selectedClass ?>" data-categoryid="<?= $category['id'] ?>">+ <?= $category['name'] ?>+ </div>+ <?php+ }+ ?>+ </div>+ </div>+ <?php+ }+ ?>+ <?php+ if (count($payment_methods) > 1) {+ ?>+ <div class="filtermenu-submenu">+ <div class="filter-title" onClick="toggleSubMenu('payment')"><?= translate("payment_method", $i18n) ?></div>+ <div class="filtermenu-submenu-content" id="filter-payment">+ <?php+ foreach ($payment_methods as $payment) {+ if ($payment['count'] == 0) {+ continue;+ }+ $selectedClass = '';+ if (isset($_GET['payment'])) {+ $paymentIds = explode(',', $_GET['payment']);+ if (in_array($payment['id'], $paymentIds)) {+ $selectedClass = 'selected';+ }+ }+ ?>+ <div class="filter-item <?= $selectedClass ?>" data-paymentid="<?= $payment['id'] ?>">+ <?= $payment['name'] ?>+ </div>+ <?php+ }+ ?>+ </div>+ </div>+ <?php+ }+ ?>+ <?php+ if (!isset($settings['hideDisabledSubscriptions']) || $settings['hideDisabledSubscriptions'] !== 'true') {+ ?>+ <div class="filtermenu-submenu">+ <div class="filter-title" onClick="toggleSubMenu('state')"><?= translate("state", $i18n) ?></div>+ <div class="filtermenu-submenu-content" id="filter-state">+ <div class="filter-item capitalize" data-state="0"><?= translate("enabled", $i18n) ?></div>+ <div class="filter-item capitalize" data-state="1"><?= translate("disabled", $i18n) ?></div>+ </div>+ </div>+ <?php+ }+ ?>++ <div class="filtermenu-submenu">+ <div class="filter-title" onClick="toggleSubMenu('renewal_type')"><?= translate("renewal_type", $i18n) ?></div>+ <div class="filtermenu-submenu-content" id="filter-renewal_type">+ <div class="filter-item capitalize" data-renewaltype="1"><?= translate("auto_renewal", $i18n) ?></div>+ <div class="filter-item capitalize" data-renewaltype="0"><?= translate("manual_renewal", $i18n) ?></div>+ </div>+ </div>++ <div class="filtermenu-submenu hide" id="clear-filters">+ <div class="filter-title filter-clear" onClick="clearFilters()">+ <i class="fa-solid fa-times-circle"></i> <?= translate("clear", $i18n) ?>+ </div>+ </div>+</div>\ No newline at end of filediff --git a/includes/i18n/cs.php b/includes/i18n/cs.phpindex c6400cb..ac8088f 100644--- a/includes/i18n/cs.php+++ b/includes/i18n/cs.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Naposledy přidané","price" => "Cena","next_payment" => "Další platba",+ "renewal_type" => "Typ obnovení","auto_renewal" => "Automatické obnovení","automatically_renews" => "Automaticky se obnovuje","manual_renewal" => "Ruční obnovení",diff --git a/includes/i18n/de.php b/includes/i18n/de.phpindex f4759a9..f15cdc9 100644--- a/includes/i18n/de.php+++ b/includes/i18n/de.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Zuletzt hinzugefügt","price" => "Preis","next_payment" => "Nächste Zahlung",+ "renewal_type" => "Verlängerungstyp","auto_renewal" => "Automatische Verlängerung","automatically_renews" => "Automatisch verlängert","manual_renewal" => "Manuelle Verlängerung",diff --git a/includes/i18n/el.php b/includes/i18n/el.phpindex fb33d10..a024e8d 100644--- a/includes/i18n/el.php+++ b/includes/i18n/el.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Τελευταία προσθήκη","price" => "Τιμή","next_payment" => "Επόμενη πληρωμή",+ "renewal_type" => "Τύπος ανανέωσης","auto_renewal" => "Αυτόματη ανανέωση","automatically_renews" => "Ανανεώνεται αυτόματα","manual_renewal" => "Χειροκίνητη ανανέωση",diff --git a/includes/i18n/en.php b/includes/i18n/en.phpindex d2f6213..af26e3d 100644--- a/includes/i18n/en.php+++ b/includes/i18n/en.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Last Added","price" => "Price","next_payment" => "Next Payment",+ "renewal_type" => "Renewal Type","auto_renewal" => "Auto Renewal","automatically_renews" => "Automatically renews","manual_renewal" => "Manual Renewal",diff --git a/includes/i18n/es.php b/includes/i18n/es.phpindex 521c71f..2288e7b 100644--- a/includes/i18n/es.php+++ b/includes/i18n/es.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Última Añadida","price" => "Precio","next_payment" => "Próximo Pago",+ "renewal_type" => "Tipo de Renovación","auto_renewal" => "Renovación Automática","automatically_renews" => "Renovación Automática","manual_renewal" => "Renovación Manual",diff --git a/includes/i18n/fr.php b/includes/i18n/fr.phpindex b0d611d..e791c73 100644--- a/includes/i18n/fr.php+++ b/includes/i18n/fr.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Dernier ajouté","price" => "Prix","next_payment" => "Prochain paiement",+ "renewal_type" => "Type de renouvellement","auto_renewal" => "Renouvellement automatique","automatically_renews" => "Renouvellement automatique","manual_renewal" => "Renouvellement manuel",diff --git a/includes/i18n/it.php b/includes/i18n/it.phpindex bb72c9a..0762e27 100644--- a/includes/i18n/it.php+++ b/includes/i18n/it.php@@ -52,6 +52,7 @@ $i18n = ["last_added" => 'Ultimo aggiunto',"price" => 'Prezzo',"next_payment" => 'Prossimo pagamento',+ "renewal_type" => 'Tipo di rinnovo',"auto_renewal" => 'Rinnovo automatico',"automatically_renews" => 'Si rinnova automaticamente',"manual_renewal" => "Rinnovo manuale",diff --git a/includes/i18n/jp.php b/includes/i18n/jp.phpindex f6a5eed..30a482e 100644--- a/includes/i18n/jp.php+++ b/includes/i18n/jp.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "最終追加日","price" => "金額","next_payment" => "次回支払い",+ "renewal_type" => "更新タイプ","auto_renewal" => "自動更新","automatically_renews" => "自動更新","manual_renewal" => "手動更新",diff --git a/includes/i18n/ko.php b/includes/i18n/ko.phpindex c43a115..133680f 100644--- a/includes/i18n/ko.php+++ b/includes/i18n/ko.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "최근 등록","price" => "가격","next_payment" => "다음 결제일",+ "renewal_type" => "갱신 방법","auto_renewal" => "자동 갱신","automatically_renews" => "자동 갱신","manual_renewal" => "수동 갱신",diff --git a/includes/i18n/nl.php b/includes/i18n/nl.phpindex 0a2c6c1..3799f8d 100644--- a/includes/i18n/nl.php+++ b/includes/i18n/nl.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Laatst toegevoegd","price" => "Prijs","next_payment" => "Volgende betaling",+ "renewal_type" => "Verlengingstype","auto_renewal" => "Automatische verlenging","automatically_renews" => "Verlengt automatisch","manual_renewal" => "Handmatige verlenging",diff --git a/includes/i18n/pl.php b/includes/i18n/pl.phpindex d261767..f3ae12b 100644--- a/includes/i18n/pl.php+++ b/includes/i18n/pl.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Ostatnio dodane","price" => "Cena","next_payment" => "Następna płatność",+ "renewal_type" => "Typ odnowienia","auto_renewal" => "Automatyczne odnawianie","automatically_renews" => "Automatycznie odnawia się","manual_renewal" => "Ręczne odnawianie",diff --git a/includes/i18n/pt.php b/includes/i18n/pt.phpindex 6dcb685..2fbe79b 100644--- a/includes/i18n/pt.php+++ b/includes/i18n/pt.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Última Adicionada","price" => "Preço","next_payment" => "Próximo Pagamento",+ "renewal_type" => "Tipo de Renovação","auto_renewal" => "Renovação Automática","automatically_renews" => "Renova automaticamente","manual_renewal" => "Renovação Manual",diff --git a/includes/i18n/pt_br.php b/includes/i18n/pt_br.phpindex 04e032a..748a765 100644--- a/includes/i18n/pt_br.php+++ b/includes/i18n/pt_br.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Última adicionada","price" => "Preço","next_payment" => "Próximo pagamento",+ "renewal_type" => "Tipo de renovação","auto_renewal" => "Renovação automática","automatically_renews" => "Renova automaticamente","manual_renewal" => "Renovação manual",diff --git a/includes/i18n/ru.php b/includes/i18n/ru.phpindex d964972..9af6e02 100644--- a/includes/i18n/ru.php+++ b/includes/i18n/ru.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Дата создания","price" => "Стоимость","next_payment" => "Следующий платеж",+ "renewal_type" => "Тип продления","auto_renewal" => "Автоматическое продление","automatically_renews" => "Автоматическое продление","manual_renewal" => "Ручное продление",diff --git a/includes/i18n/sl.php b/includes/i18n/sl.phpindex a3eff0d..5180e7a 100644--- a/includes/i18n/sl.php+++ b/includes/i18n/sl.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Zadnje dodano","price" => "Cena","next_payment" => "Naslednje plačilo",+ "renewal_type" => "Vrsta obnove","auto_renewal" => "Samodejno obnavljanje","automatically_renews" => "Se samodejno obnavlja","manual_renewal" => "Ročno obnavljanje",diff --git a/includes/i18n/sr.php b/includes/i18n/sr.phpindex 0e4254a..11b39ba 100644--- a/includes/i18n/sr.php+++ b/includes/i18n/sr.php@@ -47,7 +47,8 @@ $i18n = ["name" => "Назив","last_added" => "Последње додато","price" => "Цена",- "next_payment" => "Следећа уплата",+ "next_payment" => "Следећа уплата",+ "renewal_type" => "Тип обнове","auto_renewal" => "Аутоматско обновљење","automatically_renews" => "Аутоматски обновља","manual_renewal" => "Ручно обновљење",diff --git a/includes/i18n/sr_lat.php b/includes/i18n/sr_lat.phpindex 814bc7b..47a92fe 100644--- a/includes/i18n/sr_lat.php+++ b/includes/i18n/sr_lat.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Poslednje dodato","price" => "Cena","next_payment" => "Sledeća uplata",+ "renewal_type" => "Tip obnove","auto_renewal" => "Automatsko obnavljanje","automatically_renews" => "Automatsko obnavljanje","manual_renewal" => "Ručno obnavljanje",diff --git a/includes/i18n/tr.php b/includes/i18n/tr.phpindex ef97818..0fd2177 100644--- a/includes/i18n/tr.php+++ b/includes/i18n/tr.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Son Eklenen","price" => "Fiyat","next_payment" => "Sonraki Ödeme",+ "renewal_type" => "Yenileme Türü","auto_renewal" => "Otomatik Yenileme","automatically_renews" => "Otomatik Yenileme","manual_renewal" => "Manuel Yenileme",diff --git a/includes/i18n/uk.php b/includes/i18n/uk.phpindex 2f0cfc0..41d6857 100644--- a/includes/i18n/uk.php+++ b/includes/i18n/uk.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Дата створення","price" => "Вартість","next_payment" => "Наступний платіж",+ "renewal_type" => "Тип продовження","auto_renewal" => "Автоматичне продовження","automatically_renews" => "Автоматичне продовження","manual_renewal" => "Ручне продовження",diff --git a/includes/i18n/vi.php b/includes/i18n/vi.phpindex dd6a292..7f8edbd 100644--- a/includes/i18n/vi.php+++ b/includes/i18n/vi.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "Thêm gần đây","price" => "Giá","next_payment" => "Thanh toán tiếp theo",+ "renewal_type" => "Loại gia hạn","auto_renewal" => "Tự động gia hạn","automatically_renews" => "Tự động gia hạn","manual_renewal" => "Gia hạn thủ công",diff --git a/includes/i18n/zh_cn.php b/includes/i18n/zh_cn.phpindex 279aadc..4938157 100644--- a/includes/i18n/zh_cn.php+++ b/includes/i18n/zh_cn.php@@ -52,6 +52,7 @@ $i18n = ["last_added" => "创建时间","price" => "价格","next_payment" => "下次支付时间",+ "renewal_type" => "续订类型","auto_renewal" => "自动续订","automatically_renews" => "自动续订","manual_renewal" => "手动续订",diff --git a/includes/i18n/zh_tw.php b/includes/i18n/zh_tw.phpindex afc8336..4371e65 100644--- a/includes/i18n/zh_tw.php+++ b/includes/i18n/zh_tw.php@@ -48,6 +48,7 @@ $i18n = ["last_added" => "最近新增","price" => "價格","next_payment" => "下次付款日期",+ "renewal_type" => "續訂方式","auto_renewal" => "自動續訂","automatically_renews" => "自動續訂","manual_renewal" => "手動續訂",diff --git a/includes/sort_options.php b/includes/sort_options.phpnew file mode 100644index 0000000..b55bd84--- /dev/null+++ b/includes/sort_options.php@@ -0,0 +1,35 @@+<div class="sort-options" id="sort-options">+ <ul>+ <li <?= $sortOrder == "name" ? 'class="selected"' : "" ?> onClick="setSortOption('name')" id="sort-name">+ <?= translate('name', $i18n) ?>+ </li>+ <li <?= $sortOrder == "id" ? 'class="selected"' : "" ?> onClick="setSortOption('id')" id="sort-id">+ <?= translate('last_added', $i18n) ?>+ </li>+ <li <?= $sortOrder == "price" ? 'class="selected"' : "" ?> onClick="setSortOption('price')" id="sort-price">+ <?= translate('price', $i18n) ?>+ </li>+ <li <?= $sortOrder == "next_payment" ? 'class="selected"' : "" ?> onClick="setSortOption('next_payment')"+ id="sort-next_payment"><?= translate('next_payment', $i18n) ?></li>+ <li <?= $sortOrder == "payer_user_id" ? 'class="selected"' : "" ?> onClick="setSortOption('payer_user_id')"+ id="sort-payer_user_id"><?= translate('member', $i18n) ?></li>+ <li <?= $sortOrder == "category_id" ? 'class="selected"' : "" ?> onClick="setSortOption('category_id')"+ id="sort-category_id"><?= translate('category', $i18n) ?></li>+ <li <?= $sortOrder == "payment_method_id" ? 'class="selected"' : "" ?> onClick="setSortOption('payment_method_id')"+ id="sort-payment_method_id">+ <?= translate('payment_method', $i18n) ?>+ </li>+ <?php+ if (!isset($settings['hideDisabledSubscriptions']) || $settings['hideDisabledSubscriptions'] !== 'true') {+ ?>+ <li <?= $sortOrder == "inactive" ? 'class="selected"' : "" ?> onClick="setSortOption('inactive')"+ id="sort-inactive"><?= translate('state', $i18n) ?></li>+ <?php+ }+ ?>+ <li <?= $sortOrder == "alphanumeric" ? 'class="selected"' : "" ?> onClick="setSortOption('alphanumeric')"+ id="sort-alphanumeric"><?= translate('alphanumeric', $i18n) ?></li>+ <li <?= $sortOrder == "renewal_type" ? 'class="selected"' : "" ?> onClick="setSortOption('renewal_type')"+ id="sort-renewal_type"><?= translate('renewal_type', $i18n) ?></li>+ </ul>+</div>\ No newline at end of filediff --git a/includes/version.php b/includes/version.phpindex f68e0b1..c5b9379 100644--- a/includes/version.php+++ b/includes/version.php@@ -1,3 +1,3 @@<?php-$version = "v2.46.1";+$version = "v2.47.0";?>\ No newline at end of filediff --git a/index.php b/index.phpindex 1812947..847c5de 100644--- a/index.php+++ b/index.php@@ -21,7 +21,7 @@ if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") {}$sortOrder = $sort;-$allowedSortCriteria = ['name', 'id', 'next_payment', 'price', 'payer_user_id', 'category_id', 'payment_method_id', 'inactive', 'alphanumeric'];+$allowedSortCriteria = ['name', 'id', 'next_payment', 'price', 'payer_user_id', 'category_id', 'payment_method_id', 'inactive', 'alphanumeric', 'renewal_type'];$order = ($sort == "price" || $sort == "id") ? "DESC" : "ASC";if ($sort == "alphanumeric") {@@ -32,6 +32,10 @@ if (!in_array($sort, $allowedSortCriteria)) {$sort = "next_payment";}+if ($sort == "renewal_type") {+ $sort = "auto_renew";+}+$sql = "SELECT * FROM subscriptions WHERE user_id = :userId";if (isset($_GET['member'])) {@@ -106,7 +110,6 @@ $sql .= " ORDER BY " . implode(", ", $orderByClauses);$stmt = $db->prepare($sql);$stmt->bindValue(':userId', $userId, SQLITE3_INTEGER);-if (!empty($params)) {foreach ($params as $key => $value) {$stmt->bindValue($key, $value, SQLITE3_INTEGER);@@ -196,119 +199,7 @@ $headerClass = count($subscriptions) > 0 ? "main-actions" : "main-actions hidden<button class="button secondary-button" id="filtermenu-button" title="<?= translate("filter", $i18n) ?>"><i class="fa-solid fa-filter"></i></button>- <div class="filtermenu-content">- <?php- if (count($members) > 1) {- ?>- <div class="filtermenu-submenu">- <div class="filter-title" onClick="toggleSubMenu('member')"><?= translate("member", $i18n) ?></div>- <div class="filtermenu-submenu-content" id="filter-member">- <?php- foreach ($members as $member) {- if ($member['count'] == 0) {- continue;- }- $selectedClass = '';- if (isset($_GET['member'])) {- $memberIds = explode(',', $_GET['member']);- if (in_array($member['id'], $memberIds)) {- $selectedClass = 'selected';- }- }- ?>- <div class="filter-item <?= $selectedClass ?>" data-memberid="<?= $member['id'] ?>"><?= $member['name'] ?>- </div>- <?php- }- ?>- </div>- </div>- <?php- }- ?>- <?php- if (count($categories) > 1) {- ?>- <div class="filtermenu-submenu">- <div class="filter-title" onClick="toggleSubMenu('category')"><?= translate("category", $i18n) ?></div>- <div class="filtermenu-submenu-content" id="filter-category">- <?php- foreach ($categories as $category) {- if ($category['count'] == 0) {- continue;- }- if ($category['name'] == "No category") {- $category['name'] = translate("no_category", $i18n);- }- $selectedClass = '';- if (isset($_GET['category'])) {- $categoryIds = explode(',', $_GET['category']);- if (in_array($category['id'], $categoryIds)) {- $selectedClass = 'selected';- }- }- ?>- <div class="filter-item <?= $selectedClass ?>" data-categoryid="<?= $category['id'] ?>">- <?= $category['name'] ?>- </div>- <?php- }- ?>- </div>- </div>- <?php- }- ?>- <?php- if (count($payment_methods) > 1) {- ?>- <div class="filtermenu-submenu">- <div class="filter-title" onClick="toggleSubMenu('payment')"><?= translate("payment_method", $i18n) ?></div>- <div class="filtermenu-submenu-content" id="filter-payment">- <?php- foreach ($payment_methods as $payment) {- if ($payment['count'] == 0) {- continue;- }- $selectedClass = '';- if (isset($_GET['payment'])) {- $paymentIds = explode(',', $_GET['payment']);- if (in_array($payment['id'], $paymentIds)) {- $selectedClass = 'selected';- }- }- ?>- <div class="filter-item <?= $selectedClass ?>" data-paymentid="<?= $payment['id'] ?>">- <?= $payment['name'] ?>- </div>- <?php- }- ?>- </div>- </div>- <?php- }- ?>- <?php- if (!isset($settings['hideDisabledSubscriptions']) || $settings['hideDisabledSubscriptions'] !== 'true') {- ?>- <div class="filtermenu-submenu">- <div class="filter-title" onClick="toggleSubMenu('state')"><?= translate("state", $i18n) ?></div>- <div class="filtermenu-submenu-content" id="filter-state">- <div class="filter-item capitalize" data-state="0"><?= translate("enabled", $i18n) ?></div>- <div class="filter-item capitalize" data-state="1"><?= translate("disabled", $i18n) ?></div>- </div>- </div>- <?php- }- ?>-- <div class="filtermenu-submenu hide" id="clear-filters">- <div class="filter-title filter-clear" onClick="clearFilters()">- <i class="fa-solid fa-times-circle"></i> <?= translate("clear", $i18n) ?>- </div>- </div>- </div>+ <?php include 'includes/filters_menu.php'; ?></div><div class="sort-container">@@ -316,39 +207,7 @@ $headerClass = count($subscriptions) > 0 ? "main-actions" : "main-actions hiddentitle="<?= translate('sort', $i18n) ?>"><i class="fa-solid fa-arrow-down-wide-short"></i></button>- <div class="sort-options" id="sort-options">- <ul>- <li <?= $sortOrder == "name" ? 'class="selected"' : "" ?> onClick="setSortOption('name')" id="sort-name">- <?= translate('name', $i18n) ?>- </li>- <li <?= $sortOrder == "id" ? 'class="selected"' : "" ?> onClick="setSortOption('id')" id="sort-id">- <?= translate('last_added', $i18n) ?>- </li>- <li <?= $sortOrder == "price" ? 'class="selected"' : "" ?> onClick="setSortOption('price')" id="sort-price">- <?= translate('price', $i18n) ?>- </li>- <li <?= $sortOrder == "next_payment" ? 'class="selected"' : "" ?> onClick="setSortOption('next_payment')"- id="sort-next_payment"><?= translate('next_payment', $i18n) ?></li>- <li <?= $sortOrder == "payer_user_id" ? 'class="selected"' : "" ?> onClick="setSortOption('payer_user_id')"- id="sort-payer_user_id"><?= translate('member', $i18n) ?></li>- <li <?= $sortOrder == "category_id" ? 'class="selected"' : "" ?> onClick="setSortOption('category_id')"- id="sort-category_id"><?= translate('category', $i18n) ?></li>- <li <?= $sortOrder == "payment_method_id" ? 'class="selected"' : "" ?>- onClick="setSortOption('payment_method_id')" id="sort-payment_method_id">- <?= translate('payment_method', $i18n) ?>- </li>- <?php- if (!isset($settings['hideDisabledSubscriptions']) || $settings['hideDisabledSubscriptions'] !== 'true') {- ?>- <li <?= $sortOrder == "inactive" ? 'class="selected"' : "" ?> onClick="setSortOption('inactive')"- id="sort-inactive"><?= translate('state', $i18n) ?></li>- <?php- }- ?>- <li <?= $sortOrder == "alphanumeric" ? 'class="selected"' : "" ?> onClick="setSortOption('alphanumeric')"- id="sort-alphanumeric"><?= translate('alphanumeric', $i18n) ?></li>- </ul>- </div>+ <?php include 'includes/sort_options.php'; ?></div></div></header>diff --git a/scripts/calendar.js b/scripts/calendar.jsindex fa3d9a1..83ba4ad 100644--- a/scripts/calendar.js+++ b/scripts/calendar.js@@ -73,6 +73,12 @@ function openSubscriptionModal(subscriptionId) {.catch(error => console.error('Error:', error));}+function decodeHtmlEntities(str) {+ const txt = document.createElement('textarea');+ txt.innerHTML = str;+ return txt.value;+}+function exportCalendar(subscriptionId) {fetch('endpoints/subscription/exportcalendar.php', {method: 'POST',@@ -89,7 +95,7 @@ function exportCalendar(subscriptionId) {const a = document.createElement('a');a.href = url;// Use the subscription name for the file name, replacing any characters that are invalid in file names- a.download = `${data.name.replace(/[\/\\:*?"<>|]/g, '_').toLowerCase()}.ics`;+ a.download = `${decodeHtmlEntities(data.name).replace(/[\/\\:*?"<>|]/g, '_').toLowerCase()}.ics`;document.body.appendChild(a);a.click();window.URL.revokeObjectURL(url);diff --git a/scripts/dashboard.js b/scripts/dashboard.jsindex ea0bbf1..b53f721 100644--- a/scripts/dashboard.js+++ b/scripts/dashboard.js@@ -358,6 +358,9 @@ function fetchSubscriptions(id, event, initiator) {if (activeFilters['state'] !== "") {getSubscriptions += getSubscriptions.includes("?") ? `&state=${activeFilters['state']}` : `?state=${activeFilters['state']}`;}+ if (activeFilters['renewalType'] !== "") {+ getSubscriptions += getSubscriptions.includes("?") ? `&renewalType=${activeFilters['renewalType']}` : `?renewalType=${activeFilters['renewalType']}`;+ }fetch(getSubscriptions).then(response => response.text())@@ -600,6 +603,7 @@ activeFilters['categories'] = [];activeFilters['members'] = [];activeFilters['payments'] = [];activeFilters['state'] = "";+activeFilters['renewalType'] = "";document.addEventListener("DOMContentLoaded", function () {var filtermenu = document.querySelector('#filtermenu-button');@@ -693,9 +697,23 @@ document.querySelectorAll('.filter-item').forEach(function (item) {});this.classList.add('selected');}+ } else if (this.hasAttribute('data-renewaltype')) {+ const renewalType = this.getAttribute('data-renewaltype');+ if (activeFilters['renewalType'] === renewalType) {+ activeFilters['renewalType'] = "";+ this.classList.remove('selected');+ } else {+ activeFilters['renewalType'] = renewalType;+ Array.from(this.parentNode.children).forEach(sibling => {+ sibling.classList.remove('selected');+ });+ this.classList.add('selected');+ }}- if (activeFilters['categories'].length > 0 || activeFilters['members'].length > 0 || activeFilters['payments'].length > 0) {+ if (activeFilters['categories'].length > 0 || activeFilters['members'].length > 0 ||+ activeFilters['payments'].length > 0 || activeFilters['state'] !== "" ||+ activeFilters['renewalType'] !== "") {document.querySelector('#clear-filters').classList.remove('hide');} else {document.querySelector('#clear-filters').classList.add('hide');@@ -711,6 +729,9 @@ function clearFilters() {activeFilters['categories'] = [];activeFilters['members'] = [];activeFilters['payments'] = [];+ activeFilters['state'] = "";+ activeFilters['renewalType'] = "";+document.querySelectorAll('.filter-item').forEach(function (item) {item.classList.remove('selected');});