Commit Graph
37 Commits
Author SHA1 Message Date
Adam DaleyandCopilot be32531432 Add Client Dashboard API endpoint (#3142)
* Add Client Dashboard API endpoint

Add new consolidated API endpoint for the client dashboard that reduces the number of individual API calls needed to render the dashboard.

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add batch API methods for orders and tickets

Introduces `getBatchForApi` methods in Order and Support services to efficiently fetch multiple orders or tickets for API responses. Refactors Index Service to use these batch methods for recent orders and tickets on the client dashboard, improving performance and reducing database queries.

* Refactor DB queries and total calculation logic

Updated `Index/Service.php` to use getAll and array_column for fetching IDs, improving clarity and consistency. Refactored `Order/Service.php` to centralise total calculation in a new private method, ensuring type safety and reducing code duplication.

* Remove unused parameter from `get_dashboard` method

The get_dashboard method in Client no longer requires the $data parameter, simplifying its signature.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-07 04:01:21 +00:00
Belle Aerni 0a156f4161 Fix CS automation (#3209)
* Restore needed gitignore

* Ran the fixes since they are far behind

* Fix for rector causing a problem. Re-ran.

* Update ServiceTest.php
2026-01-26 11:18:35 -08:00
Adam Daley 711bd07a84 Sort KB articles alphabetically by title (#3168)
Fix: Sort KB articles alphabetically by title (#2882)
2026-01-17 00:57:32 +00:00
Adam Daley 37deea9d38 Add parentheses to SQL WHERE clauses for correct logic (#3156)
Wrapped `OR` conditions in SQL `WHERE` clauses with parentheses across multiple service classes to ensure correct logical grouping and prevent operator precedence issues during search queries.
2026-01-14 14:46:13 +00:00
Adam Daley edd322f2c6 Fix search query logic in Support service (#3155)
Wraps the title and content LIKE conditions in parentheses to ensure correct SQL operator precedence when filtering support entries by search term.
2026-01-14 14:20:03 +00:00
Yağızhan Burak YakarandAdam Daley 58956422c7 Support module improvements (#2997)
* Use Monolog instead

* Method types

* Use Symfony's HTML Sanitizer to actually sanitize content

* Fixed tests

* Types and sanitization

* Make sanitizeContent a static method instead

* Updated composer.lock

* Update lockfiles

* Copilot suggestions

* Fixed method signatures

* Fixed tests

* Added basic sanitizeContent tests

* Fixed SQL query

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2025-12-14 18:52:58 +03:00
Adam Daley a9b903c222 Codebase modernisation, configuration cleanup, and improved type safety (#2957)
* Refactor tests to replace depreciated functions

* Update Rector config and dependencies

* Rector: Add explicit string casting for stricter type safety

* Rector: Add return type hints to methods across codebase

* Rector: Increase dead code level and refactor invoice item logic

* Remove unnecessary `willReturn` from test mocks

Eliminate redundant `willReturn(null)` and similar calls from PHPUnit mock setups in legacy module tests, leaving only method expectations. Also update some test values to use floats for consistency.

* Refactor API controller and email adapter return values

* Update formatting and guidelines in `AGENTS.md`
2025-10-11 23:39:44 +01:00
Yağızhan f2bb4179d2 Reworked the Pagination class (#2759)
* Introduce the new Paginator class

* Rename it back to Pagination

* Move #2756 here

* Use HttpFoundation\Request

* Restore Box_Paginator

* Tests

* Replace the deprecated methods wherever used

* No need

* Tests

* Tests again

* tests

* Tests hopefully for the last time

* Use a subquery instead

* Found a faulty query

`m.*` already includes `client_id`. was getting a duplicated column error.

* New pagination logic in Huraga & a couple of improvements

* Type safety

* Accessibility and other improvements

* Fixed tests

* Make aria tags translatable

* Update partial_pagination.html.twig

* Dot operator and little docblock improvement

---------
2025-06-04 15:21:09 +03:00
Adam Daley bc4dd1d459 Replace FOSSBilling\Request with Symfony\HttpFoundation (#2645)
Replace `FOSSBilling\Request` with `Symfony\HttpFoundation` functionality.
2025-04-17 07:43:38 +01:00
Belle Aerni 368f8cd6ad Bump the year (#2581) 2025-01-23 15:11:53 -08:00
Belle Aerni 3449537c92 Fixed CS / Rector workflow and ran both (#2580) 2025-01-20 16:19:45 -08:00
4b5121e78e Fix some display inconsistencies that annoy me (#2516)
* Add space after language, before language code

* Add space in locale.title instead of editing layout

* Consistency & improvements regarding Knowledge Base

* Improve ticket dashboard (at least in my opinion)

* More consistency

* Improve footer copyright in admin panel

* Fix a little display issue - copyright notice should now look great.

* Save some bytes - because why not?

* GitHub is a brand name and does not have to be translated - even more space saved!

* Another improvement

* Sign up -> Register

* Remove hidden useless space after footer

* Improve wording

* Improve wording in ticket dashboard for clarity

* Fix little mistake in the copyright notice

---------

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2024-12-17 05:38:56 -08:00
Belle Aerni 650b091623 Sort categories and articles by alphabetical order (#2528)
* Sort categories and articles by alphabetical order

* Update ServiceTest.php
2024-12-03 15:42:22 -08:00
Belle Aerni 303f4cfa2d Code styling & rector config improvements (#2254)
* Bumped the Rector deadcode level

* Added the instanceof setlist

* Increasded type coverage and updated tests config too

* Bumped type coverage & ran PHP-cs-fixer
2024-04-23 10:38:18 -07:00
Belle AerniandJohn @ S4 037acce702 Bulk fix of many grammar / phraseology mistakes (#2166)
* Bulk fix of many grammar / phraseology mistakes

* Small fixes after self-review

* Corrections

* Update mod_currency_settings.html.twig

* Update mod_currency_settings.html.twig

* Update mod_formbuilder_field.html.twig

---------

Co-authored-by: John @ S4 <64874788+John-S4@users.noreply.github.com>
2024-02-27 03:01:07 -08:00
Belle Aerni d771457efc Bump the year (#2167)
* Bump the year

* And fix the spelling
2024-02-25 02:45:38 -08:00
FOSSBilling BotandFOSSBilling Bot 667f721090 Apply PHP Code Styling & Quality Changes (#2123)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-02-06 12:46:22 -08:00
Belle Aerni 6e438b1a59 Add a option to disable public tickets (#2113)
* Add a option to disable public tickets

* Replaced legacy test, written a new one

* Fix an unrelated error that appeared in the error log
2024-02-02 12:18:46 -08:00
FOSSBilling BotandFOSSBilling Bot 9e85bcecef Apply PHP Code Styling & Quality Changes (#1793)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2023-11-08 06:51:20 +00:00
Adam DaleyandBelle Aerni b35b2efc52 Merge Kb and Support modules (#1180)
* Merge Kb and Support modules

Merge the Kb and Support modules as they contain related functionality.

* General improvements to Support module UI

Update Support module copy and navigation to be more consistent, and other general improvements.

* This was missed.. and now it's not 😉

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-11-06 04:10:09 +00:00
Belle Aerni 602b537996 Opt-in error reporting via Sentry.io (#1732)
* Began implementing Sentry.io support

* Added to the installer

* Added the ID to the bug report template and UI

* Hook it into our error handler, added the ability to filter by error code

* Attempting to add the DSN via GH actions

* Spelling and making PHPstan happy

* Skip exceptions for various incomplete configurations

Also brings in some of the category suggestions made by @Anuril in #195

* Update tests to account for changes

* Added & renamed exception classes

* Fix tests

* Change a bunch of items to be InformationExceptions

* Use a lighter HTTP client, fixed API error reporting

* I guess that's not needed now?

Arighty then

* Improvements, additional info added

* Update SentryHelper.php

* Improved error logging, added instance ID to error page

Also made it so that errors are correctly sent to Sentry rather than exclusively exceptions

* Make the tests happy

* Added the link, improved wording

Also removed the "performance" part of the reporting as it needs to be added to the front-end and I'm not currently implementing that

* Began implementing UI alerts and info

* Added the ability to toggle, fixed tests, use path constants

* Added some useful info & links to the page

* These should be InformationException

* Fix the automated Sentry DSN entry

* Fix the install number text

* Minor cleanup, converted more to InformationException

* Replaced some direct config references with constants

We have the BB_DEBUG constant to indicate if we have debug mode enabled or not, so we shouldn't be directly referencing it in the config file unless we actually need to do so.

Using the constant means there's less locations to update the reference if the config structure is changed

* Bugfix

* Consistency & fixed a PHPDoc

* Corrections

* We actually do want exceptions thrown here

* Change how we get the instance ID

* Stability improvements

Having support for translatable error pages was proving to be problematic, so I had to remove it.

I also had to update the exception class to handle cases where the trans function wasn't setup yet (needed for the /run-patcher page if an error occurs)

* Missed this change on git

* Also fix the variable names...

* Re-added new deps after rebase

* This should also accept "Error" types

* Added more info to the bug report and removed a dug line

* This wasn't supposed to get renamed

* Updated some missed references to Box_Exception
2023-10-28 18:40:39 -07:00
FOSSBilling BotandFOSSBilling Bot 6afde30ea7 Apply PHP Code Styling & Quality Changes (#1708)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2023-10-10 14:29:34 +02:00
Belle Aerni c4c67be42f Prevent fatal errors on missing message authors (#1706) 2023-10-10 07:43:54 +02:00
fefbcd21b0 Apply PHP Code Styling & Quality Changes (#1498)
* Apply PHP Code Styling & Quality Changes

* Delete these

* Update .gitignore

* Fixes for PHPStan

* Ignore spelling in the gitnore

* Allow null for that type

Honestly doing so makes ZERO sense, but it matches the current behavior.

---------

Co-authored-by: FOSSBilling Bot <fossbilling-bot>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-07-30 08:57:44 -07:00
Yağızhanandfossbilling-bot fd872ac941 Implement PHP-CS-Fixer as an automated workflow (#1240)
* Implement PHP-CS-Fixer as an automated workflow

* Apply PHP-CS-Fixer changes

---------

Co-authored-by: fossbilling-bot <121974958+fossbilling-bot@users.noreply.github.com>
2023-07-30 06:49:11 -07:00
Belle AerniandJohn @ S4 20e38a162f Exception messages cleanup (#1376)
* Misc exception messages improvements

* Cleanup / improve server manager exceptions

* Tests :)

* Some registrar exception cleanup

* Clean up payment gateway exceptions

* Some other misc improvements

* Update Resellerclub.php

* Fix typo in Namecheap error message

---------

Co-authored-by: John @ S4 <64874788+John-S4@users.noreply.github.com>
2023-07-03 14:54:23 -07:00
Belle Aerni 3752db5096 Beef up invoice & ticket hash generation (#1309)
* Beef up invoice & ticket hash generation

* Update test for the new length
2023-06-22 09:51:27 +03:00
Belle Aerni 748d93e112 Prevent upgrade requests for invalid upgrades (#1310) 2023-06-11 19:33:20 -07:00
Adam Daley 8708d9d895 Fix error with PHPUnit tests (#1217)
Fix error with PHPUnit tests introduced by changes to `FOSSBilling\Validate` class.
2023-05-08 14:06:09 -07:00
Yağızhan d909d77f7e -Unnecessary whitespace in the class headers (#1219) 2023-05-07 13:24:29 -07:00
Yağızhan 412e4a9fbd Standardized the class headers (#1212) 2023-05-06 13:06:17 +01:00
Adam Daley e54569d2cd Introduce namespaces and strict typing for FOSSBilling library classes (#1206) 2023-05-04 01:02:06 +01:00
Yağızhan 950e4dccef Type hinting the DI methods and variables (#1201) 2023-05-01 21:01:35 +03:00
Yağızhan 884e66aa4b Removed getSettingsRoutes & hasSettingsRoutes (#1196) 2023-05-01 13:27:39 +03:00
Belle Aerni 9faa981c58 Replace usage of array_get (#989)
* Replace usage of array_get

* Fixes

* And a few more

* Remove remaining references

* Update Service.php

* Few more fixes

* Fix.. I think?

* Fix Client / Invoice updates

* Fix stats

* Fix issues noticed during code review

* More fixes

* And some more fixes :)
2023-03-27 23:44:30 -07:00
Belle Aerni dcdf1ea83c Make module's settings labels translatable 2023-01-26 15:40:03 -08:00
Belle Aerni edd6f72634 Drop the "BB" prefix 2022-11-28 17:22:50 +03:00