43 Commits

Author SHA1 Message Date
snipe 5976e93de2 Fixed RB-4136 - array to string conversion when people throw random crap at the API 2026-05-20 18:04:43 +01:00
snipe 762ea9b4db One more try I guess 2026-05-11 19:44:41 +01:00
snipe f4bd2a68c9 Fix for compound is:not_null 2026-05-11 16:03:59 +01:00
snipe 6debb3a65d Added is_not: as search modifier 2026-05-11 09:46:05 +01:00
snipe 40e89756bf Extend new operators to custom fields 2026-05-07 10:36:59 +01:00
snipe 62e5b71dc1 Added loads of comments - this is gnarly stuff 2026-05-06 12:40:40 +01:00
snipe 9131dbf09b Added more filter options 2026-05-06 12:03:55 +01:00
snipe 03bd3517be Added ablity to use “not:” or “!” to exclude results 2026-05-05 12:40:42 +01:00
snipe 3aa175b36d Added and/or operator 2026-05-05 11:32:08 +01:00
snipe fde6ff1571 Pint 2026-04-09 12:16:46 +01:00
snipe 8c9a48b38a Fixed custom field search nesting 2026-04-09 12:16:40 +01:00
snipe f9e16e16d1 Avoid searching by human readable custom field name to avoid collisions with normal attributes 2026-04-06 10:45:10 +01:00
snipe 53ce14dddf Switched to AND operator 2026-04-06 08:48:56 +01:00
snipe 2c2de8719b Exclude encrypted custom fields in search 2026-04-03 12:25:09 +01:00
snipe bca93b57ec Pint fixes 2026-04-03 11:08:35 +01:00
snipe d929c87bbd Final fixes, tests 2026-04-03 11:08:16 +01:00
snipe 70a30a96fa Try to resolve polymorism for checkout 2026-04-02 19:23:45 +01:00
snipe bdd44061f3 Added ability to support aliased count/sum fields in search 2026-03-27 20:18:05 +00:00
snipe 61f3180d74 Small fixes to Searchable trait 2026-03-27 19:21:41 +00:00
snipe 582b8858bc Pint 2026-03-27 18:34:15 +00:00
snipe 6d4264bc58 Refactor Searchable Trait to allow for filters 2026-03-27 18:34:05 +00:00
snipe 9623fa4d87 Use pint on models directory 2026-03-13 15:55:28 +00:00
snipe 95f867b267 Code formatting fixes
Signed-off-by: snipe <snipe@snipe.net>
2025-07-09 21:48:53 +01:00
snipe 130669a2f9 Added adminuser relationship in Searchable to concat first name and last name
Signed-off-by: snipe <snipe@snipe.net>
2025-06-17 13:01:57 +01:00
Jeremy Price afd9282785 Update remaining comments from snipe/snipe-it to grokability/snipe-it 2025-04-03 12:07:05 -07:00
Marcus Moore 0a3d46824e Automatically add table prefixes when building multi-column search string 2023-05-23 15:58:58 -07:00
Marcus Moore 054d71aedc Add docblock 2023-05-23 13:37:04 -07:00
Marcus Moore 9078d4c71c Add dynamic scope for prettier multiple column search 2023-05-23 13:35:19 -07:00
Marcus Moore 05a2e568d7 Add comment 2023-05-23 11:37:09 -07:00
Marcus Moore f40e722397 Add docblock 2023-05-22 17:44:17 -07:00
Marcus Moore 9b512648a3 Update searchRelations in Searchable trait 2023-05-22 17:33:19 -07:00
Marcus Moore ffbde46180 Simplify sqlite query 2023-05-18 13:06:50 -07:00
Marcus Moore d8d672c4c1 Move multiple column search function to Searchable trait 2023-05-18 13:05:40 -07:00
snipe 1651dbb68d Use null coalescing operator
Signed-off-by: snipe <snipe@snipe.net>
2023-02-06 12:43:00 -08:00
Ivan Nieto Vivanco 8cee5060af Remove unused DB statement 2022-08-10 19:16:04 -05:00
Ivan Nieto Vivanco a7de97f060 Found a better place for the where condition 2022-08-10 19:13:28 -05:00
Ivan Nieto Vivanco c1074000f9 Add a concat to search for full name when the relationship search in the users table 2022-08-10 18:27:28 -05:00
Laravel Shift 934afa036f Adopt Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions.

You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started.

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
2021-06-10 20:15:52 +00:00
snipe 9168979d9e Fixed #6027 - added model to asset maintenances listing 2018-08-01 18:24:52 -07:00
Till Deeke e1c095adca Removes the typehint for search term string (#5904)
The „string“ typehint only works in PHP >= 7.0.0.
Since we are still supporting versions below that, remove the type hint.
2018-07-20 13:23:44 -07:00
Till Deeke 45a2932f4b Fixes the generation of where conditions (#5902) 2018-07-20 13:23:29 -07:00
Till Deeke b5de5ac19c Fix: Searching for multiple terms on assets (#5860)
* Give advancedTextSearch all search terms at one

The additional conditions for assets had some problems, since they were joining tables for the additional attributes. The method was called once for every search term, so the join was added multiple times if the user entered multiple search terms.

* Allows search to handle multiple search terms better

The search now better handles multiple search terms, adding additional orWhere clauses, instead of duplicating all queries.

* Fixing typo
2018-07-16 17:44:31 -07:00
Till Deeke baa3be728d Refactoring: A nicer and easier syntax for searching models (#5841)
* Adds the ability to search by dates

Adding extra „where“-conditions to the „TextSearch“ queries, allowing the users to search by dates

* Adds missing dates to $dates in models

* Removes duplicated „where“ conditions

* Adds the Searchable trait to models, defining the searchable attributes and relations

* Removes the old text search methods

* Adds back additional conditions to the search

These conditions could not be modeled in the „attributes“ or „relations“, so we include them here

* Removes unnecessary check for the deleted_at attribute

* Fixes typo in comments

* suppresses errors from Codacy

We can safely ignore the error codacy is throwing here, since this method is a standin/noop for models who need to implement more advanced searches
2018-07-16 14:13:07 -07:00