From 4a9d44ff065e3fa3bdcb1b99c57ad46ec57f4c05 Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Thu, 14 May 2026 18:55:36 +0100 Subject: [PATCH] Refactor currency formatting and enhance admin UI features (#3539) * Remove currency format fields & refactor formatting * Handle missing currency and remove bold * Adjust column widths in redirect settings form * Add unified filter panel & request globals * Normalize admin path and revamp activity UI * Fix ADMIN_PREFIX check and ignore search filter * Point docs links to docs.fossbilling.org * ci: make live installer step retry before phpunit-live Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/3c14643b-8b1c-441d-8592-c3ba09df048f Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> * ci: avoid duplicate install attempt in live test retries Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/3c14643b-8b1c-441d-8592-c3ba09df048f Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> * Remove currency_format and simplify request handling * Ensure request exists in DI for Twig tests --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> --- .github/scripts/run-docker-live-tests.sh | 37 +- AGENTS.md | 2 +- CONTRIBUTING.md | 8 +- README.md | 7 +- composer.json | 2 +- src/.htaccess | 2 +- src/config-sample.php | 2 +- src/install/assets/install.html.twig | 4 +- src/install/install.php | 6 +- src/install/sql/content.sql | 6 +- src/install/sql/structure.sql | 2 - src/library/Box/Url.php | 20 + .../FOSSBilling/Http/RequestFactory.php | 1 - src/library/FOSSBilling/Twig/TwigFactory.php | 28 +- src/library/FOSSBilling/UpdatePatcher.php | 19 + .../admin/mod_activity_index.html.twig | 485 +++++++++--------- src/modules/Client/Controller/Admin.php | 7 - .../admin/mod_client_index.html.twig | 190 ++++--- .../admin/mod_client_login_history.html.twig | 94 ++-- .../admin/mod_client_manage.html.twig | 12 +- src/modules/Currency/Api/Admin.php | 9 +- src/modules/Currency/Api/Guest.php | 51 +- src/modules/Currency/Entity/Currency.php | 31 -- src/modules/Currency/Service.php | 34 +- .../admin/mod_currency_manage.html.twig | 1 + .../admin/mod_custompages_index.html.twig | 1 - .../client/mod_index_dashboard.html.twig | 6 +- src/modules/Invoice/Controller/Admin.php | 14 - .../admin/mod_invoice_index.html.twig | 201 ++++---- .../admin/mod_invoice_transactions.html.twig | 154 +++--- src/modules/Order/Controller/Admin.php | 7 - .../templates/admin/mod_order_index.html.twig | 166 +++--- .../admin/mod_redirect_settings.html.twig | 6 +- .../mod_servicehosting_activated.html.twig | 12 +- .../admin/mod_staff_login_history.html.twig | 78 +-- .../admin/mod_staff_settings.html.twig | 2 +- src/modules/Support/Controller/Admin.php | 7 - .../admin/mod_support_tickets.html.twig | 166 +++--- .../client/mod_support_kb_index.html.twig | 1 - src/rewrite-missing.html | 2 +- .../assets/scss/fossbilling.scss | 15 + .../html/layout_default.html.twig | 2 +- .../html/macro_functions.html.twig | 1 - .../html/mod_index_dashboard.html.twig | 1 - .../html/partial_search.html.twig | 16 +- .../html/partial_search_action.html.twig | 12 +- src/themes/huraga/html/mobile_menu.html.twig | 6 +- src/themes/huraga/html/partial_menu.html.twig | 8 +- .../FOSSBilling/RequestFactoryTest.php | 1 - .../modules/Currency/Api/Api_AdminTest.php | 14 +- .../modules/Currency/Api/Api_GuestTest.php | 96 +--- tests-legacy/modules/Currency/ServiceTest.php | 28 +- tests-legacy/modules/System/ServiceTest.php | 26 +- 53 files changed, 1011 insertions(+), 1098 deletions(-) diff --git a/.github/scripts/run-docker-live-tests.sh b/.github/scripts/run-docker-live-tests.sh index 885a4484b..8f539775e 100644 --- a/.github/scripts/run-docker-live-tests.sh +++ b/.github/scripts/run-docker-live-tests.sh @@ -78,6 +78,26 @@ done docker run --rm --network "${network}" "${image}" curl -fsS "http://${app_container}/install/" >/dev/null +install_payload=( + -H 'Content-type: multipart/form-data' + -F error_reporting=0 + -F "database_hostname=${db_container}" + -F "database_port=${db_port}" + -F "database_name=${db_name}" + -F "database_username=${db_user}" + -F "database_password=${db_pass}" + -F admin_name=test + -F "admin_email=${test_email}" + -F "admin_password=${test_pass}" + -F currency_code=USD + -F 'currency_title=US Dollar' + -F "admin_api_token=${test_api_key}" + -X POST + "http://${app_container}/install/install.php?a=install" +) + +docker run --rm --network "${network}" "${image}" curl -fsS "${install_payload[@]}" >/dev/null + docker run --rm \ --network "${network}" \ --env APP_ENV=test \ @@ -85,22 +105,5 @@ docker run --rm \ --env TEST_API_KEY="${test_api_key}" \ "${image}" \ sh -euxc " - curl -fsS \ - -H 'Content-type: multipart/form-data' \ - -F error_reporting=0 \ - -F database_hostname='${db_container}' \ - -F database_port='${db_port}' \ - -F database_name='${db_name}' \ - -F database_username='${db_user}' \ - -F database_password='${db_pass}' \ - -F admin_name='test' \ - -F admin_email='${test_email}' \ - -F admin_password='${test_pass}' \ - -F currency_code='USD' \ - -F currency_title='US Dollar' \ - -F admin_api_token='${test_api_key}' \ - -X POST \ - 'http://${app_container}/install/install.php?a=install' - ./src/vendor/bin/phpunit --configuration phpunit-live.xml " diff --git a/AGENTS.md b/AGENTS.md index 89753bd39..f79c6e6d4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -240,7 +240,7 @@ tests-legacy/ # Legacy PHPUnit tests ## Additional Resources -* **Documentation:** [fossbilling.org/docs](https://fossbilling.org/docs) +* **Documentation:** [FOSSBilling Docs](https://docs.fossbilling.org/) * **Issues:** [GitHub Issues](https://github.com/FOSSBilling/FOSSBilling/issues) ## Important Notes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b029d054c..e7cc431f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -144,15 +144,15 @@ Before a PR can be merged it must pass all of the automated tests and also be re Great code is only one-half of any successful project, and great documentation is just as important. The reality is that open source projects can stand or fall based on the quality of their documentation. -The documentation for FOSSBilling is hosted here: [FOSSBilling Docs](https://fossbilling.org/docs) +The documentation for FOSSBilling is hosted here: [FOSSBilling Docs](https://docs.fossbilling.org/) -Documentation is built using [Nextra](https://nextra.site/) from this [GitHub repository](https://github.com/FOSSBilling/docs). You can contribute directly to the repo on GitHub or using the *Edit this page* links on each page of the docs site. +Documentation is built using [Starlight](https://starlight.astro.build/) from the [docs](https://github.com/FOSSBilling/docs) GitHub repository. You can contribute directly to the repo on GitHub or using the *Edit this page* links on each page of the docs site. -Please try to be thorough and clear when writing directions. Something might seem obvious to you, but do not assume that it is to everybody else. +Please try to be thorough and clear when writing directions. Something might seem obvious to you, but do not assume that it is to everybody else. ### Translating FOSSBilling -We would like FOSSBilling to be available to as many people in as many languages as possible. +We would like FOSSBilling to be available to as many people in as many languages as possible. The software is primarily written in English. If you are a native or fluent speaker of another language then we could use your help with the translations. diff --git a/README.md b/README.md index b4055b5dc..58155f6d3 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ ### Requirements -FOSSBilling runs on standard LAMP/LEMP stacks. For the latest system requirements (PHP version, extensions, database, etc.), see the official [requirements](https://fossbilling.org/docs/getting-started/requirements). +FOSSBilling runs on standard LAMP/LEMP stacks. For the latest system requirements (PHP version, extensions, database, etc.), see the official [requirements](https://docs.fossbilling.org/getting-started/requirements/). ### Installation -Follow the step-by-step [Getting Started guide](https://fossbilling.org/docs/getting-started). +Follow the step-by-step [Getting Started guide](https://docs.fossbilling.org/getting-started/). **Just exploring?** Try the public [demo](https://fossbilling.org/demo). @@ -79,7 +79,6 @@ This project includes third-party work: ## Links - Website: https://www.fossbilling.org/ -- Documentation: https://fossbilling.org/docs -- Forum: https://forum.fossbilling.org +- Documentation: https://docs.fossbilling.org/ - Discord: https://fossbilling.org/discord - Twitter/X: https://twitter.com/FOSSBilling diff --git a/composer.json b/composer.json index 293027ea1..b983bf9bf 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "fossbilling/fossbilling", "description": "Free and Open Source Billing System", "support": { - "docs": "https://fossbilling.org/docs", + "docs": "https://docs.fossbilling.org/", "source": "https://github.com/FOSSBilling/FOSSBilling", "issues": "https://github.com/FOSSBilling/FOSSBilling/issues", "chat": "https://fossbilling.org/discord" diff --git a/src/.htaccess b/src/.htaccess index 893677e17..a33654a1d 100644 --- a/src/.htaccess +++ b/src/.htaccess @@ -1,5 +1,5 @@ # BEGIN FOSSBilling -# Read documentation https://fossbilling.org/docs for more information. +# Read documentation https://docs.fossbilling.org/ for more information. Options -Indexes +SymLinksIfOwnerMatch DirectoryIndex rewrite-missing.html diff --git a/src/config-sample.php b/src/config-sample.php index 92d2a8cc2..f314a9024 100644 --- a/src/config-sample.php +++ b/src/config-sample.php @@ -11,7 +11,7 @@ declare(strict_types=1); * Open browser https://www.yourdomain.com/admin to create a new admin account. * Remove /install directory * - * For more information, see the documentation: https://fossbilling.org/docs/customizing-fossbilling/config + * For more information, see the documentation: https://docs.fossbilling.org/customizing-fossbilling/config/ */ return [ diff --git a/src/install/assets/install.html.twig b/src/install/assets/install.html.twig index b055dcbaf..60bfdb25e 100644 --- a/src/install/assets/install.html.twig +++ b/src/install/assets/install.html.twig @@ -168,7 +168,7 @@
Step 5) Configure the default currency -

Configure your default currency and price format.

+

Configure your default currency.

@@ -177,8 +177,6 @@ - -
diff --git a/src/install/install.php b/src/install/install.php index 691db8704..fe209b0b0 100644 --- a/src/install/install.php +++ b/src/install/install.php @@ -152,8 +152,6 @@ final class FOSSBilling_Installer // Set up default currency before validation to preserve user selection if validation fails $this->session->set('currency_code', $this->request->request->get('currency_code')); $this->session->set('currency_title', $this->request->request->get('currency_title')); - $this->session->set('currency_format', $this->request->request->get('currency_format', '${{price}}')); - // Handle database information $this->session->set('database_hostname', $this->request->request->get('database_hostname')); $this->session->set('database_port', $this->request->request->get('database_port')); @@ -226,7 +224,6 @@ final class FOSSBilling_Installer 'admin_password' => $this->session->get('admin_password'), 'currency_code' => $this->session->get('currency_code') ?: 'USD', 'currency_title' => $this->session->get('currency_title') ?: 'US Dollar', - 'currency_format' => $this->session->get('currency_format') ?: '${{price}}', 'install_module_path' => PATH_INSTALL, 'cron_path' => PATH_CRON, 'config_file_path' => PATH_CONFIG, @@ -394,11 +391,10 @@ final class FOSSBilling_Installer // Delete default currency from content file and use currency passed in the installer $stmt = $this->pdo->prepare("DELETE FROM currency WHERE code='USD'"); $stmt->execute(); - $stmt = $this->pdo->prepare('INSERT INTO currency (id, title, code, is_default, conversion_rate, format, price_format, created_at, updated_at) VALUES(1, :currency_title, :currency_code, 1, 1.000000, :currency_format, 1, NOW(), NOW());'); + $stmt = $this->pdo->prepare('INSERT INTO currency (id, title, code, is_default, conversion_rate, created_at, updated_at) VALUES(1, :currency_title, :currency_code, 1, 1.000000, NOW(), NOW());'); $stmt->execute([ 'currency_title' => $this->session->get('currency_title'), 'currency_code' => $this->session->get('currency_code'), - 'currency_format' => $this->session->get('currency_format'), ]); $stmt = $this->pdo->prepare('INSERT INTO setting (param, value, created_at, updated_at) VALUES (:param, :value, NOW(), NOW())'); diff --git a/src/install/sql/content.sql b/src/install/sql/content.sql index 906a6c6b3..fcd10bca8 100644 --- a/src/install/sql/content.sql +++ b/src/install/sql/content.sql @@ -106,9 +106,9 @@ UNLOCK TABLES; LOCK TABLES `currency` WRITE; /*!40000 ALTER TABLE `currency` DISABLE KEYS */; -INSERT INTO `currency` (`id`, `title`, `code`, `is_default`, `conversion_rate`, `format`, `price_format`, `created_at`, `updated_at`) +INSERT INTO `currency` (`id`, `title`, `code`, `is_default`, `conversion_rate`, `created_at`, `updated_at`) VALUES - (1,'US Dollar','USD',1,1.000000,'${{price}}','1','2022-12-01 12:00:00','2022-12-01 12:00:00'); + (1,'US Dollar','USD',1,1.000000,'2022-12-01 12:00:00','2022-12-01 12:00:00'); /*!40000 ALTER TABLE `currency` ENABLE KEYS */; UNLOCK TABLES; @@ -303,7 +303,7 @@ LOCK TABLES `setting` WRITE; INSERT INTO `setting` (`id`, `param`, `value`, `public`, `category`, `hash`, `created_at`, `updated_at`) VALUES - (1,'last_patch','60',0,NULL,NULL,'2024-12-30 12:00:00','2024-12-30 12:00:00'), + (1,'last_patch','61',0,NULL,NULL,'2024-12-30 12:00:00','2024-12-30 12:00:00'), (2,'company_name','Company Name',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'), (3,'company_email','support@yourcompany.com',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'), (4,'company_signature','FOSSBilling.org - Client Management, Invoicing and Support Software',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'), diff --git a/src/install/sql/structure.sql b/src/install/sql/structure.sql index 152decf42..2c5d0c9e6 100644 --- a/src/install/sql/structure.sql +++ b/src/install/sql/structure.sql @@ -394,8 +394,6 @@ CREATE TABLE `currency` ( `code` varchar(3) DEFAULT NULL, `is_default` tinyint(1) DEFAULT '0', `conversion_rate` decimal(13,6) DEFAULT '1.000000', - `format` varchar(30) DEFAULT NULL, - `price_format` varchar(50) DEFAULT '1', `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), diff --git a/src/library/Box/Url.php b/src/library/Box/Url.php index 34e1703f0..37e36a668 100644 --- a/src/library/Box/Url.php +++ b/src/library/Box/Url.php @@ -57,4 +57,24 @@ class Box_Url implements FOSSBilling\InjectionAwareInterface return $this->link($uri, $params); } + + public static function normalizeLinkPath(?string $uri = null): string + { + $uri = trim((string) $uri); + if ($uri === '' || $uri === '/') { + return ''; + } + + $uri = ltrim($uri, '/'); + $adminPrefix = defined('ADMIN_PREFIX') ? trim((string) ADMIN_PREFIX, '/') : ''; + if ($adminPrefix !== '' && str_starts_with($uri, $adminPrefix . '/')) { + return substr($uri, strlen($adminPrefix) + 1); + } + + if ($uri === $adminPrefix) { + return ''; + } + + return $uri; + } } diff --git a/src/library/FOSSBilling/Http/RequestFactory.php b/src/library/FOSSBilling/Http/RequestFactory.php index 2afbdb48d..eeed53e0a 100644 --- a/src/library/FOSSBilling/Http/RequestFactory.php +++ b/src/library/FOSSBilling/Http/RequestFactory.php @@ -55,7 +55,6 @@ final class RequestFactory } $request->attributes->set(self::ROUTE_PATH_ATTRIBUTE, $path); - $request->query->set('_url', $path); return $path; } diff --git a/src/library/FOSSBilling/Twig/TwigFactory.php b/src/library/FOSSBilling/Twig/TwigFactory.php index 047c65cec..88e3f1ba5 100644 --- a/src/library/FOSSBilling/Twig/TwigFactory.php +++ b/src/library/FOSSBilling/Twig/TwigFactory.php @@ -353,20 +353,23 @@ class TwigFactory private function configureGlobals(Environment $twig): void { + if (!$this->di->offsetExists('request') || !$this->di['request'] instanceof \Symfony\Component\HttpFoundation\Request) { + throw new \LogicException('TwigFactory requires a Symfony request in the container.'); + } + $csrfToken = $this->getCsrfToken(); - $requestData = $_GET; + $request = $this->di['request']; + $requestData = $request->query->all(); + unset($requestData['_url']); - if ($this->di->offsetExists('request')) { - $request = $this->di['request']; - if ($request instanceof \Symfony\Component\HttpFoundation\Request) { - $requestData = $request->query->all(); - $requestData['_url'] = RequestFactory::getRoutePath($request); + $requestQuery = $requestData; + $requestPath = \Box_Url::normalizeLinkPath(RequestFactory::getRoutePath($request)); + $requestHasFilters = count(array_diff_key($requestData, [ + 'page' => true, + 'search' => true, + ])) > 0; - if ($request->isXmlHttpRequest()) { - $requestData['ajax'] = true; - } - } - } elseif (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') { + if ($request->isXmlHttpRequest()) { $requestData['ajax'] = true; } @@ -378,6 +381,9 @@ class TwigFactory $twig->addGlobal('CSRFToken', $csrfToken); $twig->addGlobal('request', $requestData); + $twig->addGlobal('request_query', $requestQuery); + $twig->addGlobal('request_path', $requestPath); + $twig->addGlobal('request_has_filters', $requestHasFilters); $twig->addGlobal('guest', $this->di['api_guest']); $twig->addGlobal('FOSSBillingVersion', Version::VERSION); } diff --git a/src/library/FOSSBilling/UpdatePatcher.php b/src/library/FOSSBilling/UpdatePatcher.php index c4815ccad..fb8856ef6 100644 --- a/src/library/FOSSBilling/UpdatePatcher.php +++ b/src/library/FOSSBilling/UpdatePatcher.php @@ -324,6 +324,7 @@ class UpdatePatcher implements InjectionAwareInterface 58 => 'patch58', 59 => 'patch59', 60 => 'patch60', + 61 => 'patch61', ]; ksort($patches, SORT_NATURAL); @@ -1246,4 +1247,22 @@ class UpdatePatcher implements InjectionAwareInterface $this->di['cache']->deleteItem('config_mod_paidsupport'); } } + + private function patch61(): void + { + $table = $this->di['dbal']->createSchemaManager()->introspectTable('currency'); + $columns = []; + + if ($table->hasColumn('format')) { + $columns[] = 'DROP COLUMN format'; + } + + if ($table->hasColumn('price_format')) { + $columns[] = 'DROP COLUMN price_format'; + } + + if ($columns !== []) { + $this->executeSql('ALTER TABLE currency ' . implode(', ', $columns)); + } + } } diff --git a/src/modules/Activity/templates/admin/mod_activity_index.html.twig b/src/modules/Activity/templates/admin/mod_activity_index.html.twig index 2a523f40e..07837ce50 100644 --- a/src/modules/Activity/templates/admin/mod_activity_index.html.twig +++ b/src/modules/Activity/templates/admin/mod_activity_index.html.twig @@ -5,150 +5,11 @@ {% block meta_title %}{{ 'System Activity'|trans }}{% endblock %} {% set active_menu = 'activity' %} +{% set has_filter_panel = true %} +{% set filter_panel_id = 'page-search-filters' %} +{% set filter_panel_open = request_has_filters %} {% block top_content %} -{% if request.show_filter %} -
-
-
{{ 'Filter Activity Logs'|trans }}
-
-
- -
- -
-
- -
- -
- - {{ 'Show logs from a specific IP address'|trans }} -
-
- -
- -
-
- - -
-
- - -
-
- - -
-
-
- -
- -
- - {{ 'Leave empty to show all staff members'|trans }} -
-
- -
- -
- - {{ 'Leave empty to show all clients'|trans }} -
-
- -
- -
-
-
- - - - - - -
-
- {{ 'Filter activity logs by date range'|trans }} -
-
- -
- -
- - {{ 'Show logs with minimum priority level (disabled when exact priority is selected)'|trans }} -
-
- -
- -
- - {{ 'Show only logs with this exact priority level (takes precedence over minimum priority)'|trans }} -
-
- - - -
-
-
- -{% endif %} {% endblock %} {% block content %} -
+

{{ 'System Activity'|trans }}

-
- {{ include('partial_search_action.html.twig') }} -
+ {{ include('partial_search.html.twig') }} +
+
{{ 'Filter Activity Logs'|trans }}
+
+
+ +
+ +
+
- - - - - - - - - - - - - - - {% set events = admin.activity_log_get_list({ 'per_page': 30, 'page': request.page }|merge(request)) %} - {% for i, event in events.list %} - - - - - - - - - - - {% else %} - - - - {% endfor %} - -
{{ '#'|trans }}{{ 'User'|trans }}{{ 'Priority'|trans }}{{ 'Message'|trans }}{{ 'IP'|trans }}{{ 'Country'|trans }}{{ 'Date'|trans }}
{{ event.id }} - {% if event.client %} - - {{ mf.avatar(event.client.email, 20, 'db-avatar avatar avatar-sm d-none d-md-inline-block') }} - - {% elseif event.staff %} - - {{ mf.avatar(event.staff.email, 24, 'db-avatar avatar avatar-sm d-none d-md-inline-block') }} - - {% else %} - {{ mf.avatar('guest@fossbilling.org', 24, 'db-avatar avatar avatar-sm d-none d-md-inline-block') }} - {% endif %} - - {% if event.client %} - {{ event.client.name }} - - - - - - {% elseif event.staff %} - {{ event.staff.name }} - - - - - - {% else %} - {{ 'Guest'|trans }} - {% endif %} - - {% if event.priority == 0 %} - EMERG - {% elseif event.priority == 1 %} - ALERT - {% elseif event.priority == 2 %} - CRIT - {% elseif event.priority == 3 %} - ERR - {% elseif event.priority == 4 %} - WARN - {% elseif event.priority == 5 %} - NOTICE - {% elseif event.priority == 6 %} - INFO - {% elseif event.priority == 7 %} - DEBUG - {% else %} - N/A - {% endif %} - {{ event.message }} - {{ mf.ip_lookup_link(event.ip) }} - {% if event.ip %} - - +
+ +
+ + {{ 'Show logs from a specific IP address'|trans }} +
+
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ +
+ + {{ 'Leave empty to show all staff members'|trans }} +
+
+ +
+ +
+ + {{ 'Leave empty to show all clients'|trans }} +
+
+ +
+ +
+
+
+ + + + + + +
+
+ {{ 'Filter activity logs by date range'|trans }} +
+
+ +
+ +
+ + {{ 'Show logs with minimum priority level (disabled when exact priority is selected)'|trans }} +
+
+ +
+ +
+ + {{ 'Show only logs with this exact priority level (takes precedence over minimum priority)'|trans }} +
+
+ +
+
{{ event.ip|ip_country_name|default('Unknown'|trans) }}{{ event.created_at|format_datetime }}
{{ 'The list is empty'|trans }}
+ {{ 'Filter'|trans }} + + {{ 'Reset'|trans }} +
+ + +
+ + + + + + + + + + + + + + + {% set events = admin.activity_log_get_list({ 'per_page': 30, 'page': request.page }|merge(request)) %} + {% for i, event in events.list %} + + + + + + + + + + + {% else %} + + + + {% endfor %} + +
{{ '#'|trans }}{{ 'User'|trans }}{{ 'Priority'|trans }}{{ 'Message'|trans }}{{ 'IP'|trans }}{{ 'Country'|trans }}{{ 'Date'|trans }}
{{ event.id }} + {% if event.client %} + + {{ mf.avatar(event.client.email, 20, 'db-avatar avatar avatar-sm d-none d-md-inline-block') }} + + {% elseif event.staff %} + + {{ mf.avatar(event.staff.email, 24, 'db-avatar avatar avatar-sm d-none d-md-inline-block') }} + + {% else %} + {{ mf.avatar('guest@fossbilling.org', 24, 'db-avatar avatar avatar-sm d-none d-md-inline-block') }} + {% endif %} + + {% if event.client %} + {{ event.client.name }} + + + + + + {% elseif event.staff %} + {{ event.staff.name }} + + + + + + {% else %} + {{ 'Guest'|trans }} + {% endif %} + + {% if event.priority == 0 %} + EMERG + {% elseif event.priority == 1 %} + ALERT + {% elseif event.priority == 2 %} + CRIT + {% elseif event.priority == 3 %} + ERR + {% elseif event.priority == 4 %} + WARN + {% elseif event.priority == 5 %} + NOTICE + {% elseif event.priority == 6 %} + INFO + {% elseif event.priority == 7 %} + DEBUG + {% else %} + N/A + {% endif %} + {{ event.message }} + {{ mf.ip_lookup_link(event.ip) }} + {% if event.ip %} + + + + + + + + + + + + {% endif %} + {{ event.ip|ip_country_name|default('Unknown'|trans) }}{{ event.created_at|format_datetime }}
{{ 'The list is empty'|trans }}
+