* 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>
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.
* 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`
* 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
---------
* 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>
* Bumped the Rector deadcode level
* Added the instanceof setlist
* Increasded type coverage and updated tests config too
* Bumped type coverage & ran PHP-cs-fixer
* 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>
* 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
* 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>
* 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 :)