Commit Graph

672 Commits

Author SHA1 Message Date
Denis Denisov ec2a0d5fb0 Tabs and tabels scrolling fix (#4069)
Fixes #4037. Credit to @w20k
2019-01-21 23:35:27 -06:00
Luke Towers 8c9be817cc Added support for min, max, and step for the number field type 2019-01-18 18:14:25 -06:00
Luke Towers 3ff77120c6 Improved disabled support for balloon-selector and fileupload fields 2019-01-16 13:32:31 -06:00
Anže Časar 74484b1ec2 Fix default value translation (#4062)
Credit to @acasar
2019-01-15 13:38:22 -06:00
Luke Towers 2d6b9c76a9 Recompile assets 2019-01-15 13:35:12 -06:00
Luke Towers a9a0544ab0 recompiled stylesheets, retaining newlines for improved diff readability 2019-01-14 11:52:16 -06:00
Luke Towers 1c0fd1b419 Yet another change to perfect the getParentForm() method 2019-01-10 18:59:29 -06:00
Luke Towers 1b3263d4c7 Pass the containing Form widget to the FormFields that it generates.
This enables complex FormWidgets that need to know what Form widget they belong to to access that information with $this->formField->form; This also enables a fix for: https://github.com/rainlab/location-plugin/issues/48
2019-01-10 10:22:59 -06:00
fansaien 5db5522d4d Fix the filter options being escaped twice (#4032)
Credit to @fansaien.

Reference: https://github.com/octobercms/october/pull/3793.  This commit added the e() function for translation results. 

Because the filter is using the mustache template, and the manual said: All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache: {{{name}}} (https://mustache.github.io/mustache.5.html)

That means the string will be escaped twice. So, I removed the e().
2019-01-03 14:04:26 -06:00
Ben Thomson ee003c416c Redirect user to last available page in list widget if current page is unavailable (#4020)
Credit to @bennothommo. Fixes #4008.
2018-12-30 12:49:42 -06:00
Ben Thomson b6bd643e21 Rename prepareModel to prepareQuery, deprecate prepareModel 2018-12-30 16:25:01 +08:00
Luke Towers 26173486d3 Fix issue where the clear search button would submit a form if the search widget is within an HTML form 2018-12-28 11:51:51 -06:00
Luke Towers a2708ee0f5 Added backend.manage_default_dashboard permission to lock down who has access to change the default dashboard for the system. Fixes #2176 2018-12-20 17:26:49 -06:00
Luke Towers 44ac62abeb Recompiled LESS using new CSS minification 2018-12-20 13:41:09 -06:00
Woo eb1d3fadbc Add format property to list columns (#3990)
Credit to @vicrly. Fixes #3967.
2018-12-19 20:52:07 -06:00
Jim Cottrell 34da61805b Replace URL parameters dynamically without needing a list in advance (#3361)
Fixes #3358. Credit to @jimcottrell
2018-12-18 10:03:03 -06:00
Ben Thomson 14c4d1392e Datatable dropdown usability tweaks (#3980)
Adds a couple of usability tweaks to the dropdown cell type in the data table widget, to more closely mimic a native dropdown field.

Pressing the up or down arrow keys when the cell is focused but with the dropdown closed will select the previous or next item automatically and set it as the cell value. This does prevent the usual table function of going to the previous or next row when focused on a dropdown cell, but I think it's a worthwhile trade-off. When the dropdown is open, the up and down arrows work the same as previously implemented.

Typing out characters will initiate a search and select the first matching option automatically and set it as the cell value. For example, for the following options:

Apples
Oranges
Bananas
Typing out o and r on the keyboard will automatically select the Oranges option.

Credit to @bennothommo
2018-12-16 09:30:23 -06:00
vosco88 a11868169e Add reset search (X) to toolbar search input (#3975)
Credit to @vosco88
2018-12-14 09:04:01 -06:00
ayumihamsaki2 28061bf3e9 Update jquery.isotope library from v1.5.26 to v3.0.6 (#3966)
Update jquery.isotope library from v1.5.26 to v3.0.6. Credit to @ayumihamsaki2. Refs: https://github.com/octobercms/october/issues/3958
2018-12-07 18:31:51 -06:00
Luke Towers d53e174469
Change number field type to use HTML5 number type
Credit to @w20k for the solution. Fixes #2311.
2018-12-06 14:40:33 -06:00
Ayumi Hamasaki dcec14b2e9 Update Dashboard Columns from 10 to 12
This PR has been re-coded to split the old PR into two separate PR's. This PR relates to github Issue: https://github.com/octobercms/october/issues/3823
2018-12-06 12:32:57 +00:00
Farrow a1fb23a984 Adds i18n support for the form field default property (#3546)
Credit to @Farrow. Previously when creating a backend form with RainLab.Builder if you filled in the "Default" property using the i18n (to get, for example, acme.plugin::lang.field.default) then that string would be output exactly on the form (i.e. <input value="acme.plugin::lang.field.default"...>) instead of being replaced with the actual value of that key from the lang file.
2018-12-01 13:05:47 -06:00
Romaldy Minaya cca3c704a3 Fixes #3119 (#3163)
Added readOnly support to RecordFinder, Switch widget and relation widget including dropdown Fixes #3119. Credit to @romaldyminaya
2018-11-23 00:33:01 -06:00
Nathan van der Werf 6fb6211c56 Escape output to prevent XSS injections (#3924)
Credit to @nathan-van-der-werf
2018-11-15 15:05:44 -06:00
Luke Towers e726165554
Add Tab icons functionality (#3901)
Credit to @ayumihamsaki for the original proposal, @Teranode for the initial work. Related #3888, #3856.
2018-10-30 20:06:33 -06:00
Rike-cz cf8a73f0a2 Ensure that fields are defined before attempting to render a specific field (#3812)
Credit to @Rike-cz
2018-09-22 19:22:02 -06:00
LucasZdv 9d126a0ab6 Filter group translatable options (#3793)
Fixes #3789. Credit to @LucasZdv
2018-09-17 09:33:13 -06:00
vosco88 55575e316b Update reportcontainer.less (#3737)
Fix minor padding issue in Firefox. Fixes #3731. Credit to @vosco88
2018-08-31 00:36:47 -06:00
Samuel Georges e32de7b753 Annotate class methods 2018-08-30 13:37:39 +10:00
Nathan van der Werf 743252c3ff
Merge branch 'develop' into feature/cleanup
# Conflicts:
#	modules/backend/widgets/Form.php
2018-08-29 19:18:01 +02:00
Samuel Georges 2d77565e6c Peer review 52d1388e4e
This uses a simpler approach and leverages improvements to the validation trait
See 574031d3ee
Refs #2489
2018-08-29 12:19:33 +10:00
Luke Towers fcec026dff Add support for checking if nested form fields are required for visual indicator 2018-08-26 12:29:37 -06:00
Nathan van der Werf 8fd16d4db6
Merge branch 'develop' into feature/cleanup
# Conflicts:
#	modules/backend/formwidgets/FileUpload.php
2018-08-24 19:52:54 +02:00
Nathan van der Werf 0f0d108da0
Remove unused imports 2018-08-24 19:51:59 +02:00
Nathan van der Werf 66fa03f17e
Revert "Remove unused imports"
This reverts commit 742a5f415b.
2018-08-24 19:40:40 +02:00
Luke Towers 1c7b311ea9 Added inline API documentation for media manager:
Added documentation for the following events:
media.folder.delete
media.file.delete
media.folder.rename
media.file.rename
media.folder.create
media.folder.move
media.file.move
media.file.upload
2018-08-18 08:49:57 -06:00
Luke Towers be839d0a07 Documented FilterWidget events:
Added inline documentation for the following filter widget events:
backend.filter.extendQuery
backend.filter.extendScopesBefore
backend.filter.extendScopes
2018-08-15 21:42:56 -06:00
Luke Towers 4078e6a56f Provide inline documentation for the FormWidget events:
Documented the following:
backend.form.beforeRefresh
backend.form.refreshFields
backend.form.refresh
backend.form.extendFieldsBefore
backend.form.extendFields
model.form.filterFields
2018-08-15 21:00:31 -06:00
Nathan van der Werf ee9414f3fd Simplify ternary operators 2018-08-15 19:26:20 +02:00
Nathan van der Werf 8b6f11e6ac Extract child instructions 2018-08-15 19:25:42 +02:00
Nathan van der Werf fbca3bea92 Remove redundant variables 2018-08-15 19:23:12 +02:00
Nathan van der Werf ab73442e3d Add missing break statement 2018-08-15 19:18:52 +02:00
Nathan van der Werf 62c59a4903 Refactor ternary operators to null coalescing operators 2018-08-15 19:15:13 +02:00
Nathan van der Werf a3d7a028b4 Replace is_null with "=== null" comparison 2018-08-15 18:54:46 +02:00
Nathan van der Werf 77b6f07291 Modify conditions to use elvis operators 2018-08-15 18:53:11 +02:00
Nathan van der Werf 123145fd54 Remove unnecessary parentheses 2018-08-15 18:49:52 +02:00
Nathan van der Werf a075be206b Replace class references with "self" 2018-08-15 18:47:06 +02:00
Nathan van der Werf 02bd38cfb1 Merge if constructs 2018-08-15 18:45:37 +02:00
Nathan van der Werf 3a918ad200 Remove "null" assignments 2018-08-15 18:33:24 +02:00
Nathan van der Werf 742a5f415b Remove unused imports 2018-08-15 18:27:36 +02:00
Luke Towers 8cbfd6611a Finished documenting Lists widget's events:
backend.list.extendQueryBefore
backend.list.extendQuery
backend.list.extendRecords
backend.list.extendColumns
backend.list.overrideHeaderValue
backend.list.injectRowClass

Also improved:
backend.list.overrideColumnValue
backend.list.overrideColumnValueRaw
2018-08-13 08:11:35 -06:00
Alexander Shapoval 1e7c3691e7 Cast outside field config to array (#3670)
This is necessary to enable the setting of tabs for SECTION_OUTSIDE: http://octobercms.com/docs/backend/forms#form-tab-options. Credit to @ebashu-on-holidays
2018-08-06 10:49:19 -06:00
Steve Mortimer 5936107c07 Reset pagination on filter scope change (#3632)
Fixes #3610. Credit to @stevemortimer
2018-07-16 09:43:47 -04:00
Szabolcs Palmer 157b08202b Adds align support to non-sortable list column headers (#3638)
Credit to @Szasza
2018-07-15 00:56:09 -04:00
Luke Towers c55a7cd2e2 Target only immediate children when determining if a tab should be hidden
Fixes #3627. This changes the logic for hiding tabs when all of their fields are hidden to specifically only target direct children of the tab pane when looking for visible fields because repeaters will have fields present that are only hidden by virtue of the parent field being hidden however the previous behaviour would consider it visible.
2018-07-05 10:14:41 -04:00
Samuel Georges 000a880742 Alternative fix to #3607
Fixes #3607
Fixes #3606
2018-06-29 14:20:55 +10:00
Samuel Georges fb2aa1730c Fixes security issue
Refs #3604
2018-06-22 22:57:38 +10:00
Christian 0eac53bdd1 Fix pathing issue in media manager (#3604)
Fix pathing issue in media manager

Currently there is a way to manipulate folder names using the request headers for the medafinder folder path. since `validatePath` does not validate file names but rather only validates the existence of a folder in a parent/subdirectory. We can utilize `validateFileName` to verify if the name of the folder path being created is valid during the folder creation process and the name applying process.
2018-06-22 16:35:33 +10:00
Viamage 667b82e6ce Replace keyup listener with input listener (#3567)
Fixes #1270. Credit to @viamage
2018-05-30 20:26:38 -06:00
Sebastian Hilger 07dbd0c729 Add searchOnEnter option to make the Search widget fire on enter key (#3524)
Documented in e56468a95b. Credit to @manogi. 
Added an option to change from the "search on every keystroke" functionality to one where the serach is only fired when hitting the enter key. This makes sense when having larger datasets or CMS users who are slow typers.
2018-04-23 10:09:37 -06:00
Luke Towers 4d304645d7 Added readonly support to the mediamanager widget and the ability to set the MediaLibary cache key through code 2018-04-19 10:23:15 -06:00
Tobias Kündig 2b22b26676 Added align property to list columns definition (#3509)
Documented in https://github.com/octobercms/docs/pull/289; credit to @tobias-kuendig
2018-04-17 23:34:08 -06:00
Tobias Kündig 55d49cbf2b Cache the last visited page in the list widget (#3432)
Stores the last visited page of list widgets in the session to restore to on next page load. Does not apply when filters / searches are applied. Credit to @tobias-kuendig
2018-03-08 10:52:21 -06:00
Luke Towers 8cb57cf353
Add useRelationCount column property
Adds the `useRelationCount` property to tell the list controller to use the number of related records for the specified `relation` as the value for that column.
2018-01-25 16:54:06 -06:00
Flakerim Ismani 55ff460895 Added colorpicker column type (#3338)
Renders 30px by 30px square of the selected colour. `type: colorpicker` in the columns config. Credit to @flakerimi
2018-01-04 12:54:30 -06:00
Pásztor Gábor da9369bb14 Fix deprecated calls. (#3283)
Credit to @gpasztor87
2017-12-04 06:13:27 -06:00
Samuel Georges 0b68668d14 Adds a constraint of 500 records at a time
Example given with 5000 records cripples the filter, this cap will keep it usable until we develop a better solution.
Refs #3202
2017-11-23 10:00:50 +11:00
Christophe Vuagniaux cbcdd76ff2 Add filter of type text in backend list (#3094)
Fixes #3048, credit to @ChVuagniaux
2017-11-06 12:07:53 -06:00
Samuel Georges 712dcf9412 Use alias instead of leading slash
Refs d292eeb85e
2017-11-03 07:57:33 +11:00
Luke Towers 014bac1232
Simplify 51b6f64418
Simplifies 51b6f64418 by using the pre-existing HTML array name parsing functionality.
2017-11-02 13:13:08 -06:00
Luke Towers 51b6f64418
Convert field name to dot syntax before checking validation rules
Converts a field name in the form of `model_json_attribute[subproperty]` to the dot syntax version used by validation rules `model_json_attribute.subproperty` for more accurate checking of the validation rules in the form widget.
2017-11-02 12:35:50 -06:00
arifnyet eb0e5c74c1 Support default config option for list filters (#3201)
Fixes #2329
2017-10-26 11:12:02 -06:00
Luke Towers d292eeb85e Remove ambiguity around what classes are being used
Fixes https://github.com/octobercms/october/issues/3184.
2017-10-20 21:39:54 -06:00
Luke Towers a62a6e6493 Support on and off options for the switch field
Adds support for custom on and off options for the switch field type.
2017-10-20 11:47:30 -06:00
Luke Towers ac2e5937f0 Document list widget column value events
Documents `backend.list.overrideColumnValue` and adds and documents `backend.list.overrideColumnValueRaw`. See https://github.com/octobercms/october/issues/3180 for why this is necessary.
2017-10-18 10:57:17 -06:00
Samuel Georges 669a4cee6e Merge branch 'maintenance-mediamanager' into develop 2017-10-16 17:56:34 +11:00
Samuel Georges 2a1234d21c Update MM lang refs 2017-10-16 17:52:50 +11:00
Samuel Georges fdc2891734 Update deprecated refs 2017-10-14 22:06:34 +11:00
Luke Towers 4203e65549 Deprecated Cms\Controllers\Media in favour of the backend one. Fixed other references to moved pieces of the Media Manager. Finally a proper fix for https://github.com/octobercms/october/pull/2604 2017-10-08 23:12:04 -06:00
datune 4a0a488ff6 Account for NestedTree Trait setting (#3143)
* Account for NestedTree Trait setting

See https://github.com/rainlab/blog-plugin/issues/338. The Lists Widget did not account for the NestedTree setting.

* Update Lists.php
2017-10-04 14:04:12 -06:00
jimcottrell 263200fd7b Support form field commentHtml flag for section, checkbox, and switch types (#3150) 2017-10-03 13:41:14 -06:00
Luke Towers c2f204008b Moved the MediaManager widget from the CMS module to the System module 2017-09-27 22:23:58 -06:00
Samuel Georges 58aa360eab The text input value should be explicit, not mutated, ever.
Rollback fb893efb9ca3a0fa25e3bb9fd01f55cef6216473
Refs #2942
Refs #3101
2017-09-15 08:41:05 +10:00
Samuel Georges cd76f2e04f Field definition should override magic 2017-09-13 14:29:42 +10:00
Luke Towers 9565565865 Add ignoreTimezone option to datepicker field and column types.
Adds the ability to specify an `ignoreTimezone: true` option on the config for a datepicker form widget or date column type. This will ignore both October's and the backend user's timezone settings to display the date exactly as it is stored.
2017-09-10 22:39:15 -06:00
Samuel Georges 8a1b060a29 Tidy up from #3084 2017-09-06 09:00:53 +10:00
Jofry S 2c97c55ea8 Allow simple pagination option on ListControllers 2017-09-05 13:33:51 +10:00
Luke Towers 7c3d4705fc Support firstDay in date & date range filters
Ref: 962aa32a60 (commitcomment-23597564)
2017-08-11 08:59:06 -06:00
Luke Towers a705a70f35 Cleanup for #2856
Removed `minNumber` and `maxNumber` options, they are not enforceable on the client side without a lot more work. Added `number` filter type, added missing numberrange filter template, consolidated styles for filter-date and filter-number filters.
2017-08-05 18:10:36 -06:00
Luke Towers be87fbbb87 added feature to allow filtering over a number range (#2856)
Original by @purposebuiltscott in #2856
2017-08-05 14:01:59 -06:00
Luke Towers e41f047722 Support yearRange property on the daterange scopetype 2017-08-05 12:40:15 -06:00
Luke Towers 67fb168e6c Support yearRange property on the date scopetype 2017-08-05 12:39:20 -06:00
Luke Towers 962aa32a60 Improve flexibility of scope type properties
Improves the flexibility of scope type properties by removing conditional logic specific to the date and daterange scope types and laying the groundwork for scopes to define their own custom properties that can be loaded from the scope configuration defined by the developer.
2017-08-05 12:38:20 -06:00
Samuel Georges 953336d250 Option "searching" defaults to false 2017-07-15 14:34:53 +10:00
Samuel Georges db943c077b This doesn't need to be a form 2017-07-15 12:29:20 +10:00
Samuel Georges 4239caf9eb Enable searching via config
Only the ServerEventDataSource supports this for now. This is purely to satisfy https://github.com/rainlab/translate-plugin/pull/272
Clean up and fix net spam
2017-07-15 12:18:11 +10:00
Samuel Georges 3145611150 Add search to table widget
Refs https://github.com/rainlab/translate-plugin/pull/272
Recompile assets
2017-07-15 12:06:50 +10:00
Samuel Georges dc3e521c36 Merge pull request #2968 from slowpokefarm/master
Allow using zero-keys in Filter widget options
2017-07-15 00:05:39 +10:00
Stanislav Rimsha 6f691680cf Allow using zero-keys in Filter widget options 2017-07-14 15:57:47 +02:00
Samuel Georges 1db67af8e8 Merge remote-tracking branch 'remotes/origin/develop' into l55upgrade
Conflicts:
	modules/system/lang/en/lang.php
2017-07-11 10:48:54 +10:00
Luke Towers c9e31fd83b Support previewMode for the balloon-selector
Add support for previewMode in the Balloon Selector form field type.
Refs: #2724, 5f91c45
2017-07-09 12:53:29 -06:00
Szabó Gergő f7f507dbdc Translate the value of the text field (#2942)
It is a useful feature, if you like to add translatable value.
2017-06-26 09:38:31 -06:00
Samuel Georges c3570ffd7e The event emitter should not be a dependency
Fixes #2938
2017-06-23 08:11:41 +10:00
Samuel Georges 9eb0cc24ae Opens a channel for model to talk with form widget
.. and controller and beyond.
2017-06-17 21:20:34 +10:00
Samuel Georges 41cc1744f1 Tab panes now support CSS spec
See form docs > paneCssClass
2017-06-05 17:37:13 +10:00
Samuel Georges f0df1f458b Merge branch 'develop' into l55upgrade
Conflicts:
	modules/system/assets/ui/storm.css
2017-05-27 22:24:57 +10:00
Priit Perna 2b3b6ece46 Made checkbox quick selection configurable
With this change the following configuration will show the quick selection links:
"quickselect" => true
2017-05-18 15:16:42 +03:00
Samuel Georges 7e76f39e6c Add app.name config
Various other refittings
2017-05-16 18:50:41 +10:00
Quezler cc17b679f1 Code dusting (#2826)
Code cleaning according to PSR-2 w/ exemptions (mostly dust).
2017-04-24 21:38:19 +10:00
CSNWEB 3cfb8c7587 DRY up the code 2017-04-09 04:01:34 +02:00
CSNWEB ee2dd7ac1c Add readOnly / disabled support for checkboxlist
Relations rendered with the relation formwidget using checkboxlist are now correctly rendered like in the previewMode.
2017-04-07 21:04:20 +02:00
Samuel Georges 5daf4365ae Move the change event to the input element
This should bubble to the parent control element and persist any logic that depends on the old event
Fixes #2684
2017-04-06 08:08:50 +10:00
Samuel Georges b841f9e066 {@inheritDoc} -> @inheritDoc 2017-03-16 06:26:14 +11:00
Samuel Georges 5f91c45f79 Implement disabled support for some form widgets
Recompile assets
Fixes #2749 (Media Finder)
Fixes #2750 (File upload)
Fixes #2751 (Rich Editor)
Refs #2724
2017-03-14 13:52:47 +11:00
Samuel Georges e7fa4b832a Rollback 84b533454e
See #2749, #2750 & #2751 on notes for how to better handle this. Put simply, the control of disabled VS previewMode should be given to the individual form widget, as opposed to the spawning parent.
2017-03-14 06:49:33 +11:00
Luke Towers 3876dc61d1 Rollback c836d92f9f
Rollback due to discussion on c836d92f9f. Will be looked into again later when addressing #2311.
2017-03-13 09:36:49 -06:00
Luke Towers 84b533454e Allow FormWidgets to be disabled like regular FormFields
Adds support for the `disabled` property to FormWidgets so that they will match the behaviour present in regular FormFields. Fixes #2724 and a personal annoyance of mine :)
2017-03-11 02:12:47 -06:00
Luke Towers c836d92f9f Make number field an HTML5 number field
Makes the `number` form field actually be an HTML5 `type="number"` field.
2017-02-15 08:44:12 -06:00
Samuel Georges d9a2b88852 Pass records by reference to overcome halting event issue
Refs https://github.com/octobercms/october/pull/1853
2017-02-15 05:58:44 +11:00
Luke Towers 9f3c2b8bf6 Switched backend.list.extendRecords event triggering
Made the event triggering for the new backend.list.extendRecords event triggering more consistent with the rest of the class.
2017-02-14 02:20:23 -06:00
Luke Towers fd3fbf5e52 Merge pull request #1853 from leocavalcante/feature-list-extend-records
Make available to extends Lists records
2017-02-14 02:17:16 -06:00
Samuel Georges 0d1fc43212 Add isSelected() helper to form field
Fixes an issue where dropdown NULL and 0 are treated as the same
Fixes #2612
2017-02-03 06:35:23 +11:00
Aleksey Bobkov 761b03ef16 Merge branch 'develop' of github.com:octobercms/october into develop 2017-01-25 20:16:23 -08:00
Aleksey Bobkov 0d30931045 Minor styling fixes in the table widget. Fixed a bug where empty values in the table widget could be rendered as 'undefined' in Safari. 2017-01-25 20:15:12 -08:00
Samuel Georges 513a75c87e Remove data-title from table data
This was utilized by an older responsive table implementation, no longer in use
2017-01-26 11:00:23 +11:00
Samuel Georges 6b56476f66 Merge pull request #2469 from joseph-d/patch-1
Update Filter.php
2017-01-13 06:29:54 +11:00
Samuel Georges f9c659343b Further styling improvements
Refs #2575
2017-01-09 08:37:36 +11:00
Samuel Georges 62d7ff9532 Merge pull request #2575 from triasrahman/develop
Enhance usability of list pagination.
2017-01-09 07:51:01 +11:00
Pásztor Gábor 039a49979a Style improvements on reportcontainer's manage widget dropdown. 2016-12-21 20:15:07 +01:00
Trias Nur Rahman 897c875fa9 Enhance usability of list pagination. 2016-12-21 21:50:44 +07:00
Samuel Georges c644f8b66d Fixes issue where nested columns forcibly hide
Eg: "myrelation[attribute]" as a column name would cause the list setup to hide these fields with no ability to bring them back
2016-12-14 19:14:41 +11:00
Samuel Georges b85c4f9b7b Improve list tree styling and minor fix
Fixes bug with non standard primary key on model when using tree mode
Fixes #2532
Recompile assets
2016-12-10 13:19:32 +11:00
Samuel Georges 0a2b343047 Simplify system events
This pipes all event calls through a new EventEmitter trait, which substitutes the October Rain event emitter trait. The view event has been moved to this trait also.
Pass some variables by reference to allow multi-extension.
Fixes #2420
2016-12-10 09:02:06 +11:00
Pásztor Gábor 94ab13cd8b Fix exception message, remove some unneded imports. 2016-12-07 21:33:05 +01:00
Samuel Georges f771887ee5 When refreshing fields, forceFill is a bit too flaky
- Using a proxy field would populate a relation with an array of attributes, this is not good or consistent. Instead the FormModelSaver trait is used to bring the behavior in line with FormController and others. This should improve consistency in the behavior and developer expectations.

- The noticeable difference will be that relations and their values are now set by the postback data where possible. In cases where this is undesirable -- eg: updating a relation triggers proxy fields to update with existing values, when they should seed from the relation instead (desire to lose prior changes) -- the formExtendRefreshData controller override can be used to prune the existing values from the dataset, where they will then be seeded from the model as normal.

- Also the $data property is only rebuilt if it differs from the model. Previously it would corrupt the model-based dataset by converting to an array then back to an object. If the two objects are the same, they will be passed by reference and values will replicate this way.
2016-11-30 07:08:12 +11:00
Samuel Georges b39ebec812 Pass columns to search scope
This allows the default search to be applied and combined with any custom constraints
2016-11-29 06:46:52 +11:00
joseph-d af7950b9d0 Update Filter.php
There is an addScopes function for extensibility but no way to remove scopes which are already there.
2016-11-08 09:46:27 +00:00
Samuel Georges 46c473e2f2 Fixes fetching multi tiered pivot relation values
Refs https://github.com/daftspunk/oc-crm-plugin/issues/3
Minor code clean on select.js
2016-11-08 07:02:31 +11:00
Samuel Georges 4aca2d40ff Remove "allowClear" and tidy up #2459
Allow clear is not necessary, equivalent of allowClear false is "placeholder" and allowClear true is "emptyOption".
2016-11-07 08:43:52 +11:00
Joseba Juániz 1ee0250441 Dropdown can support either placeholder / emptyOption
The difference between a placeholder and an emptyOption is that the placeholder cannot be reselected,whereas the emptyOption can.
Fixes #2450
2016-11-07 08:29:49 +11:00
Samuel Georges 50d3ffb035 Halycon models do not declare forceFill
Only bind purgeable fallback event once (only needed once)
Refs https://github.com/rainlab/translate-plugin/issues/54#issuecomment-256067096
2016-11-05 10:59:53 +11:00
Samuel Georges 7b0f33e9b3 Adds an isNested flag to Form widget
This is useful when a form renders another form inside, specifically the repeater. In these cases the model and data will diverge, and it also provides an opportunity to not apply extension logic to nested form fields.
Fixes #2257
2016-11-05 09:53:23 +11:00
Samuel Georges 57b10704ce Support for overriding list views
For consistency, entry partial for controller behaviors should be called "container"
Added addViewPath() method to ViewMaker
Remove "fa" from icon docs (not necessary)
Fixes #2439
2016-10-29 14:10:21 +11:00
Samuel Georges ee2dd78b3d Exception handling for type: relation
It would appear many plugins incorrectly use type: relation as a list column, when this does nothing. Previously it would fallback to the text type, now that invalid types fail hard, this adds a softer landing by spamming the trace log instead.
Refs #2438
2016-10-22 04:18:28 +11:00
Samuel Georges 91e7e8b950 List column number type was falling back to text
Since custom list column types an exception is thrown for unknowns. This makes number known.
Fixes #2438
2016-10-22 03:10:50 +11:00
Samuel Georges f9dd5b2f57 Plugins can now define custom list column types 2016-10-21 07:15:08 +11:00
Samuel Georges 733158060e Fixes indentation
Refs #2400
2016-10-13 19:52:37 +11:00
Samuel Georges 19c3c19a00 Added extended useList options, including raw output 2016-10-06 18:44:26 +11:00
Samuel Georges fe74fcb8e0 Comma concat all single dimension arrays, for text columns
This is useful when the attribute is a basic jsonable store and needs to be in a suitable format for "useList" export mode
2016-09-28 16:31:21 +10:00
Samuel Georges 9b5851fbd5 Improves exception handling for invalid model resolver
A more specific error message is now shown when trying to resolve a model from an invalid source (eg: an array)
Fixes #2354
2016-09-18 13:44:13 +10:00