Commit Graph

46 Commits

Author SHA1 Message Date
SeriousKen 38070b0111 Fix ability to clear RecodFinder when useRelation = false (#4256)
Fixes #4255. Credit to @SeriousKen
2019-04-15 16:49:29 -06:00
Luke Towers 920eb15af5 Added support for using the record finder without a model relationship
Added useRelation and modelClass config options
2019-01-18 18:16:16 -06:00
Nathan van der Werf 0f0d108da0
Remove unused imports 2018-08-24 19:51:59 +02:00
Nathan van der Werf a3d7a028b4 Replace is_null with "=== null" comparison 2018-08-15 18:54:46 +02:00
Samuel Georges 358a6337df We probably don't need to call this twice
Refs f8d9667f0e
2017-07-13 19:15:47 +10:00
Luke Towers f8d9667f0e Support field being disabled in filterFields()
Completes support for the underlying field object being disabled in model's filterFields() method by rechecking status immediately before rendering.
2017-06-22 09:45:29 -06:00
Quezler cc17b679f1 Code dusting (#2826)
Code cleaning according to PSR-2 w/ exemptions (mostly dust).
2017-04-24 21:38:19 +10:00
Samuel Georges f8e7fa03e0 Refactor remove option implementation
Refs #2756

Add disabled support
Fixes #1199
2017-03-22 09:26:05 +11:00
Samuel Georges b841f9e066 {@inheritDoc} -> @inheritDoc 2017-03-16 06:26:14 +11:00
Samuel Georges 29040b416c Allow redirect: false on importExportController
Implement getFieldName() method
2016-11-28 07:50:06 +11:00
Luke Towers 567e464550 Pass current model to record finder scope method
This improves the extensibility of the record finder form widget by passing the current model to the query scope that will be applied to the records being displayed. It allows the use of attributes of the current model in the query scope applied to the records being displayed as options to select.

In my use case, I have a main Survey model with related Field models. Field models can have parents and children for a tree structure, but I only want fields to have parents and children that are:
**a) Not the main record itself**
**and b) Members of / related to the same Survey model**

By passing the current model to my query scope, I can filter out ineligible records like so:
```
/**
 * Limit results to only records that are eligible to be parents of the provided model
 *
 * @param Query $query
 * @param Model $model The model to check for eligible parents agains
 * @return Query
 */
public function scopeEligibleParents($query, $model) {
    return $query->where('id', '!=', $model->id)
            ->where('parent_id', '!=', $model->id)
            ->where('survey_id', '=', $model->survey_id);
}
```
2016-10-11 17:15:40 -06:00
Samuel Georges 0573e0593a Search should persist across pagination
The search term is now reset only when the record finder is first opened
Fixes #2161
2016-07-30 11:46:36 +10:00
Samuel Georges 536a4b382c RecordFinder can specify number of records per page
Fixes #2082
Fix spacing on composer.json
2016-06-11 13:37:36 +10:00
Samuel Georges 3bad70f041 Relation controller now applies the defined constraints by default
Relation controller now supports scope and conditions for the manage mode (list)
Logic has been modified across recordfinder and filter that only allows one constraint in this order (1. conditions, 2. scope, 3. defined constraints (where applicable))
Fixes #1203
2016-05-17 05:17:40 +10:00
Samuel Georges 1608d80127 Reorganise code editor prefs
Fixes visual bugs
Update dashboard icon
Restyle flash messages
2016-04-30 04:53:33 +10:00
Alexander Guth 13276a500e Add conditions config to RecordFinder
Fixes #1524
2016-04-21 05:36:53 +10:00
Samuel Georges f2d8fcaf14 Record finder now supports scopes and search options 2016-04-21 05:36:29 +10:00
Samuel Georges 23f4d40ef2 Merge common functionality in to FormModelWidget 2016-03-25 18:01:58 +11:00
Jeferson Oliveira 6ae4742ff4 Fix hardcoded column name `id` by reading the `keyFrom` option defined in the .yaml file. 2016-02-10 08:45:21 -02:00
Samuel Georges ca4a6e9679 Remove some unnecessary code from #1575 2015-11-28 11:24:34 +11:00
Saifur Rahman Mohsin 3c67c2f8bc Make recordfinder's popup list title configurable
When selecting record using the recordfinder, by default the popup list
shows **Find Record** as the title. Made this field a user configurable
field, and kept **Find Record** as default if not specified. Also,
added this default string to the lang file.
2015-11-02 00:09:26 +05:30
Samuel Georges b010732796 These methods should be protected, update client lang 2015-08-04 10:01:17 +10:00
Gonzalo Henríquez 13606ac770 Translatable prompt on recordfinder
Prompt could only be hardcoded into yaml files. Now able to work with language files.
2015-07-18 13:34:30 -03:00
Samuel Georges 3c2494aa83 Improve DataTable form widget, fixes vague error in RecordFinder 2015-03-24 20:10:45 +11:00
Samuel Georges 398177b006 Full pivot support added to RelationController 2015-03-19 20:01:08 +11:00
Samuel Georges f8ae611ec9 Refactor form widgets to use new fillFromConfig() helper 2015-02-28 14:43:34 +11:00
Samuel Georges 85c47c4e01 public -> protected $defaultAlias 2015-02-28 12:43:53 +11:00
Samuel Georges 6a2f64757b *** REMOVED ALL DEPRECATED CODE ** 2015-02-14 14:11:25 +11:00
Samuel Georges 9d649ebb1e Remove deprecated path symbols 2015-02-07 16:20:34 +11:00
Samuel Georges b1b700368f Radical reorg of some classes 2015-01-28 11:49:54 +11:00
Samuel Georges a0490c3a4e Fix bad error message 2015-01-21 20:02:16 +11:00
Samuel Georges b74b19741b Unify the logic for getting field values from a dataset
Amongst Form Widgets and "the" Form widget
ping @alekseybobkov
2015-01-05 12:54:14 +11:00
Samuel Georges 5d2a177646 getModelArrayAttribute -> resolveModelAttribute 2015-01-05 11:18:43 +11:00
Samuel Georges d91d4112a5 getLoadData -> getLoadValue 2015-01-05 09:45:04 +11:00
Samuel Georges 0be582c42d getSaveData -> getSaveValue 2015-01-05 09:43:39 +11:00
Stefan Talen f29151100b Updating modules/backend/formwidgets 2014-10-10 23:50:05 +02:00
Sam Georges 4f00fbdbc6 Minor. keyField -> keyFrom 2014-09-17 16:47:55 +10:00
Sam Georges c8f3c640b8 columnName -> fieldName + general improvements to FormWidgetBase 2014-09-17 16:07:06 +10:00
Sam Georges 109df00340 nameColumn -> nameFrom
descriptionColumn -> descriptionFrom
2014-09-17 13:39:37 +10:00
Sam Georges 347e25babc Add search capability to manage mode (lists) 2014-09-06 13:18:55 +10:00
Sam Georges 34bedb0b33 Minor fixes 2014-08-01 13:39:51 +10:00
Sam Georges 3fc226b0ad Add search to record finder 2014-07-08 12:23:32 +10:00
Sam Georges d912b73aab Clean up event parameters to dev standards 2014-07-04 19:14:14 +10:00
alekseybobkov 634bacb203 Record finder styling 2014-07-03 23:03:01 +11:00
Sam Georges b09b6d6863 Improved naming onReload -> onRefresh
Improved Record finder
2014-07-03 18:37:51 +10:00
Sam Georges 005f2848c7 Start work on record finder 2014-07-02 20:49:46 +10:00