327 Commits

Author SHA1 Message Date
Alexander Guth
b3eb95bb62 Make default format options in ImportExportBehaviour configurable (#4200)
Credit to @alxy.

If the default format mode is selected, there is no chance to configure the format options for delimiter, enclosure, escape and encoding. This considers a new config file item `defaultFormatOptions` and falls back to `null` if it is not specified.

To keep things consistent, the old default values remain untouched.
2019-04-01 13:00:41 -06:00
Samuel Georges
5190c8177b Avoid terminating the app using exit() or die()
Refs #3783
Refs #3746
2019-03-29 07:10:07 +11:00
Alexander Guth
13d710b161 Reuse the model instance from Form widget (#4193)
Credit to @alxy & @jimcottrell . Refs:
https://github.com/rainlab/translate-plugin/issues/209
https://github.com/rainlab/translate-plugin/issues/242
https://github.com/rainlab/translate-plugin/issues/330
https://github.com/rainlab/translate-plugin/issues/380
https://github.com/jan-vince/smallextensions/issues/11
https://github.com/OFFLINE-GmbH/oc-mall-plugin/issues/128
https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/issues/21
https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/pull/55
df9c8fd365
https://github.com/octobercms/october/pull/3984
2019-03-15 22:32:36 -06:00
fansaien
8a60d3c19a Fire backend.list.extendRecords event during export useList (#4148)
Provides an opportunity to modify and / or return the $results collection object before the controller exports it. Credit to @fansaien
2019-02-19 17:14:32 -06:00
Luke Towers
5853cc54c4 Ensure that FormWidgets are correctly initialized with previewMode even on AJAX requests 2019-01-10 17:39:41 -06:00
Ben Thomson
63dfb7fad3 Replace deprecated prepareModel call in ImportExport behavior 2018-12-30 16:35:17 +08: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
Tobias Kündig
7a277b4b9c Added support for dependsOn with relationships (#3539)
Credit to @tobias-kuendig. Added $.oc.relationBehavior.changed function. To keep track of changes made using the relation controller this new "changed" function is called every time a record is created, added, removed or deleted. The function triggers the change.oc.formwidget event on the form field that belongs to this relation controller so other form fields are notified about the changes.
2018-12-03 10:08:00 -06:00
Francesco Passanti
329bb6f202 Fix relation controller lists onClick handling for VARCHAR keys (#3544)
Credit to @FrancescoPassanti
2018-11-23 00:58:28 -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
Kanstantsin
69a26aa8f2 Commit deferred bindings on model created with RelationController (#3843)
Fixes #3829. Credit to @iotch. Tested by the fantastic Octodock provided by @petehalverson
2018-10-04 08:35:30 -06: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 52d1388e4e7d7165695af889f8dcc861086ad012
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
52d1388e4e Automatically use field labels as custom attribute names for a nicer validation message
Fixes #2489
2018-08-26 13:39:49 -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
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
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
62c59a4903 Refactor ternary operators to null coalescing operators 2018-08-15 19:15:13 +02:00
Nathan van der Werf
123145fd54 Remove unnecessary parentheses 2018-08-15 18:49:52 +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
Steve Mortimer
5936107c07 Reset pagination on filter scope change (#3632)
Fixes #3610. Credit to @stevemortimer
2018-07-16 09:43:47 -04:00
danharrin
ce3c923c6f Translate "Row" in _import_result_form.htm (#3574)
Fixes #3566. Credit to @danharrin
2018-05-31 15:14:08 -06:00
Luke Towers
9840ff228f
Support absolute redirects in the formcontroller
Supports absolute redirects being used in the FormController behaviour.

If the form_config.yaml specifies 
```twig
create:
    redirect: https://api.example.com/oauth/authorize
```
Then the behaviour will now properly redirect the user to the URL provided where previously it would redirect to a url along the lines of `october.example.com/backend/https://api.example.com/oauth/authorize`. Relative backend redirect URLs are unchanged.
2018-02-06 14:42:24 -06:00
Samuel Georges
6ff6ab2996 Convert strings to ::class 2018-01-13 14:40:44 +11:00
tim0991
0783126249 Better check for default deletion redirect (#3324)
Adds a better check for the default redirect option.
2018-01-01 19:39:25 -06:00
Luke Towers
587d0d1993
Typo fix 2017-12-12 10:41:12 -06:00
Luke Towers
d0546599d1
Allow overriding form config in arbitrary contexts
This enables arbitrary form contexts to be defined to override the default values when using a form with custom contexts. I.e. `$this->update($id, 'mycustomcontext');` will load the form definition from `mycustomcontext[form]` instead of `update[form]`
2017-12-12 10:39:03 -06:00
Samuel Georges
2036823eee Removes non functional buttons in pivot mode
Refs https://github.com/daftspunk/oc-test-plugin/issues/28
2017-12-06 17:19:37 +11:00
Luke Towers
b1d0108227 Improved inline docs 2017-12-02 15:43:57 -06:00
Luke Towers
8a5d0c3b13 Correct row numbers displayed in the import result form (#3136)
* Add support for a source index offset

Improves the reporting of errors in the importing process by getting the correct offset for the displayed row where the error took place.

* Add the source index offset to the row number

Refs ce6df84b04
2017-10-15 13:45:35 -06:00
datune
8906b86027 Add return statement to listExtendRecords event (#3153)
Fixes #2965
2017-10-04 14:05:05 -06:00
Jofry S
2c97c55ea8 Allow simple pagination option on ListControllers 2017-09-05 13:33:51 +10: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
Tschallacka
e8e4209909 Fix inflexible relation toolbar (#2760)
Improves support for models that don't use `id` as their primary key.
2017-07-04 18:56:38 -06:00
Samuel Georges
605c8221a9 getPlainForeignKey -> getForeignKeyName 2017-05-20 20:03:48 +10:00
Samuel Georges
57aa723c23 filterExtendScopes -> listFilterExtendScopes
extendFilterScopes -> extendListFilterScopes
Filter still belongs to the "List", this would help resolve conflicts if there were ever a FilterController that would carry rightful claim to "filterExtendScopes"
2017-05-14 14:47:17 +10:00
CSNWEB
fe3e44efeb Add method to easily extend filter scopes (#2866)
* Add method to easily extend filter scopes
* Add non static method for filter scope extension
2017-05-13 17:31:09 -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
330a41f39c Improve form controller docs 2017-03-23 08:48:26 +11:00
Samuel Georges
0a981a25f7 API docs progress
Controller -> SystemController for consistency
2017-03-16 17:08:20 +11:00
Samuel Georges
51ac144049 Moves CMS components to directory where they belong
Improve inline docs
2017-03-16 07:00:39 +11:00
Samuel Georges
b841f9e066 {@inheritDoc} -> @inheritDoc 2017-03-16 06:26:14 +11:00
Samuel Georges
18c6bb63a2 API docs progress 2017-03-15 18:03:26 +11:00
Samuel Georges
e54cf7133b Improve some inline docs in preparation for API docs 2017-03-14 19:36:17 +11: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
Luke Towers
749835f73d Merge pull request #2642 from norotaro/patch-1
Update RelationController::onRelationManageUpdate
2017-02-01 15:07:46 -06:00
Samuel Georges
bf17fa44e6 Merge pull request #2610 from lukaszbanas-extremecoding/issue_2609
Support deferred binding for single view modes in RelationController
2017-02-02 06:46:09 +11:00