Samuel Georges
8eafcaa090
Encode extra config to isolate the logic
...
Fixes #2417
2016-10-15 10:10:11 +11:00
Samuel Georges
b3fe8de7fb
Prevent extra config from bleeding to other definitions
2016-09-28 13:26:28 +10:00
Samuel Georges
baefa3e50d
Allow passing arbitrary recordUrl to relationRender
2016-09-27 20:39:29 +10:00
Samuel Georges
0d336151d2
Improvements to data persistence, rework readOnly
...
Fixes #2308
2016-09-27 20:21:32 +10:00
Samuel Georges
1e3f5a22ef
Provides an opportunity to manipulate the field configuration.
...
Refs #2245
2016-09-27 17:00:26 +10:00
Samuel Georges
cd0cd260b5
Make manage[form] config optional
...
There are times when manage form mode just isn't needed. This will make the view[list] unclickable, which is OK
2016-09-27 16:53:46 +10:00
Jack Dark
a6b0d3da7d
Merge remote-tracking branch 'remotes/upstream/develop' into develop
...
# Conflicts:
# modules/backend/behaviors/RelationController.php
2016-08-18 02:02:43 +03:00
Samuel Georges
5c53b10c20
Merge pull request #2295 from gabsource/fix-relation-manage-readonly
...
Propagate the RelationController readOnly option to the viewClickList AJAX action
2016-08-13 15:30:58 +10:00
Samuel Georges
618a035616
Apply defined constraints to view mode
...
In the same way it is currently applied to manage mode
Fixes #2292
2016-08-13 15:21:17 +10:00
Samuel Georges
c2d2250a1c
RelationController "Remove" now works with deferred bindings
...
This brings the logic in line with the "Add" logic, using session keys where applicable
Fixes #1150
2016-08-13 12:41:03 +10:00
Jérémy Gaulin
7f22ba62dc
Propagate the readOnly option to the viewClickList AJAX action
2016-08-08 08:35:57 +02:00
Samuel Georges
61ac68fd5e
Allows relationRender to specify readOnly mode
...
Fixes #2245
2016-08-06 13:15:08 +10:00
Jack Dark
aaab9c2eaa
Added support for Many To Many polymorphic relations.(morphToMany and morphedByMany)
2016-08-02 17:56:49 +03:00
Samuel Georges
fdcfe801a7
Write tests for #2258
...
Prevent nulling when model fails validation
2016-07-30 10:59:25 +10:00
Samuel Georges
dbdf8f780a
Merge pull request #2128 from slipgrom/develop
...
morphMany Relation support
2016-07-16 14:08:35 +10:00
Samuel Georges
8e4142558b
Merge pull request #1741 from ARH-Digital/develop
...
Add morphic relations to backend
2016-07-09 20:38:21 +10:00
Roman Gerasimov
587b8a449d
morphMany Relation support
2016-06-17 10:55:03 +03: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
a585fe3316
Share pivot|list title logic
...
We already had a key for this... spooky!
Refs #1755
2016-03-25 14:24:38 +11:00
Samuel Georges
762c5e754b
Switch the manage popup title according to the button pressed
...
Fixes #1755
2016-03-25 14:03:11 +11:00
Samuel Georges
d76863a3ec
Merge branch 'develop' into stable
...
Conflicts:
composer.json
2016-02-27 14:55:52 +11:00
Samuel Georges
2e819f0142
Remove deprecated method
2016-02-20 08:19:14 +11:00
Samuel Georges
3ee2ec86f8
Allow toolbarButtons: false
2016-02-15 17:58:59 +11:00
Samuel Georges
e0fc27b0cb
Refs #1727 - Tabs to spaces
2016-02-13 15:47:34 +11:00
Samuel Georges
7d3a73cd31
Merge pull request #1727 from tschallacka/fix_for_static_primary_key_naming_relationcontroller
...
Fix for static primary key naming relationcontroller
2016-02-13 15:46:07 +11:00
Aaron
0c4c39fddb
Add morphic relations to backend
2016-02-01 14:53:53 +10:00
tschallacka
e4b0c0fe27
Fixed static id naming primary key
...
RelationController forced belongs to relations to have a primary key named id.
If primary key was named differently it wouldn't register the onclick.
This fixes that by taking the primary key name from the model.
2016-01-26 14:17:18 +01:00
myst6re
55bceba32c
Commit deferred data when creating/updating a pivot table.
2015-12-12 11:44:59 +11:00
Samuel Georges
c30b34e4d9
In special cases, has one/many will require a foreign key set
...
For example: to pass any constraints imposed by the database
This new logic emulates the "create" method on the relation object
Fixes #1541
2015-10-31 16:40:16 +11:00
Samuel Georges
af657e9399
Fixes #1042 - remove fillable constraint on models when saving
...
Form fields are already constrained by their fields.yaml definition (values not defined in the yaml will not be saved) so we don't need to double dip by enforcing fillable too.
2015-10-17 11:41:40 +11:00
Samuel Georges
dd6e0a3836
Persist the search term across AJAX requests only
...
Fixes #1448
2015-09-28 10:52:24 +10:00
Samuel Georges
d4ce89e9ba
Fixes relation render onclick in list view to obey $model->primaryKey value
...
Fixes #1454
2015-09-28 10:12:06 +10:00
Samuel Georges
e8b4bf9d72
If the pivot model fails for some reason, abort the sync
...
Refs #1408
2015-09-12 07:53:33 +10:00
Samuel Georges
52fa1b4f66
Relation create for belongsTo support deferring - refs #1329
2015-08-01 13:03:30 +10:00
Samuel Georges
ce4636d59a
Add support for deferred binding for belongsTo relations - Refs #1329
2015-08-01 11:34:22 +10:00
Samuel Georges
f715fa4228
Grants an opportunity to manipulate the primary widgets
2015-07-25 14:48:17 +10:00
Samuel Georges
ccb28a2cfe
The RelationController::relationExtendQuery method should be removed when scopes are respected - a relation scope is an extension of the query #1203
2015-07-25 14:28:33 +10:00
Samuel Georges
fc62ca7c7f
Event is supposed to come *after* default constraints
2015-07-25 14:22:31 +10:00
Samuel Georges
3866ccbb20
This really shouldn't be here
2015-07-25 14:19:34 +10:00
Samuel Georges
f0f1c549c9
Use a non logging exception, constructors return void is implied
2015-07-15 16:56:01 +10:00
Samuel Georges
f85493e333
Don't use Deferred Binding if it is disabled
2015-07-04 13:42:37 +10:00
Samuel Georges
f4efcb455e
Use fill()+save() instead of save()
2015-06-27 14:32:52 +10:00
Samuel Georges
b2e5d24e9d
Fixes pivot model add with showCheckboxes enabled
2015-04-29 08:01:28 +10:00
plexnum
a20712b73c
fix related model update when deferred binding
2015-04-09 07:28:01 +03:00
Samuel Georges
13b14729fd
Don't allow a record to be clicked if there is no form to display
2015-04-06 16:57:53 +10:00
Samuel Georges
264cb0119d
recordUrl should be taking priority over the default onClick behavior
2015-03-31 09:57:44 +11:00
Samuel Georges
a8bcc6aab8
Allow pivot data to be entered when creating
2015-03-30 18:41:25 +11:00
Samuel Georges
c4027b8bc6
Added a defaultFrom option to form fields
...
Default context of manage and pivot forms is now create and update respectively, instead of the old value relation
2015-03-28 16:14:22 +11:00
Samuel Georges
3eede4a7b7
Reorganise and improve RelationController
...
Fix bug in DataTable limited to 10 records
2015-03-27 22:20:52 +11:00
Samuel Georges
f64497c5f3
Minor bug fix blocking new config approach
2015-03-26 19:05:07 +11:00
Samuel Georges
398177b006
Full pivot support added to RelationController
2015-03-19 20:01:08 +11:00
Samuel Georges
a1ac5edbf7
Various minor fixes and improvements
2015-03-18 19:28:14 +11:00
Ariel Ponce
ff4e221c6a
Fix relation controller JS issue on Chrome
...
When loading a relation, an "Uncaught token :" javascript error is thrown when using Chrome, which makes the select all checkbox not to work and most of the JS on the page to fail.
2015-03-10 09:50:12 +01:00
Samuel Georges
625030f03e
Minor
2015-02-28 23:43:06 +11:00
Samuel Georges
ce77c0f89e
Return a query that includes pivot data for belongsToMany relations
2015-02-28 22:08:25 +11:00
Samuel Georges
f2277b61dc
More efficient approach to locating a pivot record
2015-02-28 19:53:41 +11:00
Samuel Georges
e48963b1e9
Improve mode detection for relations by using an event target
2015-02-28 19:33:11 +11:00
Samuel Georges
032d8aafce
Manage onCreate now looks to the deferredBinding property
2015-02-28 15:27:03 +11:00
Samuel Georges
5c78140268
Adds compact column, explicit option for deferred binding in relation controller, fix to list head width
2015-02-27 21:54:58 +11:00
Samuel Georges
93f48d87ea
Minor fix
2015-02-19 22:17:07 +11:00
Samuel Georges
c7881ff2dc
Tidy up code from #940
2015-02-19 19:38:50 +11:00
Samuel Georges
8d0d46ffc7
Merge pull request #940 from Flynsarmy/customRelationContext
...
Support passing custom contexts to relationcontroller
2015-02-19 19:24:41 +11:00
flynsarmy
8768ec64d6
Fix order
2015-02-11 10:17:41 +10:00
flynsarmy
40ebb9bfa2
Support passing custom contexts to relationcontroller
2015-02-11 09:53:21 +10:00
Samuel Georges
03eb949e71
Add illuminate/html package, DB -> Db, HTML -> Html
2015-02-04 20:03:44 +11:00
Samuel Georges
b1b700368f
Radical reorg of some classes
2015-01-28 11:49:54 +11:00
Samuel Georges
228982ed0f
Minor
2015-01-25 13:37:03 +11:00
Samuel Georges
ff415a8542
Tidy up
2015-01-25 13:10:17 +11:00
Samuel Georges
e4d4a29bdd
withDeferred() will add constraints for us
2015-01-25 13:02:28 +11:00
Samuel Georges
b58666b4a0
Massive improvements to RelationController, most button types are available
2015-01-25 13:02:06 +11:00
Samuel Georges
25835e5f55
Implement belongsTo RelationController type
2015-01-21 20:53:19 +11:00
Samuel Georges
39daf773bc
Implement hasOne RelationController type
2015-01-21 19:47:38 +11:00
Carlos Arroyo
90d5bde28c
When building a relationship Belongs to Many with Pivot Data the lack of a table name causes an sql ambiguous ID error.
2014-12-17 19:14:21 +11:00
Samuel Georges
ea34622840
Clicking a record in readOnly mode will open the manage form in preview mode
...
Use "recordOnClick: null" to retain the original behavior
2014-12-06 15:46:02 +11:00
Samuel Georges
906d97dce4
Add new options to RelationController (view mode): recordUrl, recordOnClick, toolbarButtons
2014-12-06 15:32:20 +11:00
Samuel Georges
cafe636f58
Merge pull request #807 from nicolas-lescop/patch-6
...
Permit to display checkBoxes with config file
2014-12-06 09:14:28 +11:00
nicolas-lescop
d0cc667c8b
Extend query on relation behavior
...
From a relation behavior config file like this
status:
label: Status
list: @/plugins/path/to/your/relation/config/columns.yaml
emptyMessage: backend::lang.list.no_records
You can extend the list query with this method :
relationExtendQuery($query, $field, $manageMode)
{
if ($field == 'status') $query->where('thing', '=', $this->thing);
}
2014-12-02 15:03:06 +01:00
nicolas-lescop
89cdb3af8b
Permit to display checkBoxes with config file
...
Can be used for those wanting to make a deletable only list.
2014-12-02 11:35:15 +01:00
nicolas-lescop
03ccead584
Delete all selected related elements and not just the first element
2014-11-14 14:19:08 +01:00
Sam Georges
c32ba4cbad
Minor code clean
2014-11-04 17:41:48 +11:00
Stefan Talen
347dff7e75
Merge branch 'develop' of https://github.com/octobercms/october into feature/PSR-2
...
Conflicts:
modules/backend/behaviors/RelationController.php
modules/backend/classes/WidgetManager.php
modules/cms/classes/CmsCompoundObject.php
modules/cms/twig/Extension.php
modules/cms/twig/PlaceholderNode.php
modules/cms/widgets/TemplateList.php
2014-10-18 11:07:17 +02:00
Sam Georges
df98ae9196
Use getQualifiedKeyName when finding existing IDs
2014-10-17 08:15:16 +11:00
Kris Arnold
c75df3a120
when building belongsToMany relationships in controllers, the lack of a table name
...
alias causes an sql ambigious Id error
2014-10-16 14:28:36 -05:00
Stefan Talen
b01d3e540f
Updating backend/behaviours
2014-10-10 22:34:57 +02:00
Sam Georges
bf47eb94ed
Str::getRealClass -> class_basename
2014-09-29 13:12:34 +10:00
Sam Georges
04462f5b4c
The manage form should not share its session key with the parent
2014-09-17 09:46:48 +10:00
Sam Georges
001a9f92ff
Fixes manage form so widgets fileupload can work correctly inside
2014-09-16 17:40:06 +10:00
Sam Georges
347e25babc
Add search capability to manage mode (lists)
2014-09-06 13:18:55 +10:00
Sam Georges
c916c40fc2
Add search support to the view mode
2014-09-06 12:51:39 +10:00
Sam Georges
fe3f0bd34e
More silly logic errors
2014-09-06 12:11:42 +10:00
Sam Georges
2460e54028
Update changelog, move relation config under view/manage array respectively
2014-09-06 12:09:00 +10:00
Sam Georges
31447df5d4
Minor bug - this should be getKeyName
2014-09-06 11:45:19 +10:00
Sam Georges
a1998e4348
Fixes #500 - Handle custom related key names, don't use session keys for existing parent models
2014-08-05 17:40:49 +10:00
Sam Georges
56d0c3351b
private -> protected
2014-08-01 14:54:16 +10:00
Sam Georges
6388ecef52
private -> protected
2014-08-01 13:58:59 +10:00
Sam Georges
3c1e6ea846
Fixes #481 - Native widget handlers should still initialize
2014-07-29 19:22:18 +10:00
Sam Georges
a19cd6f76b
For Kerensky
2014-07-11 22:24:43 +10:00
Sam Georges
3e1932e7ff
Minor
2014-07-11 18:52:48 +10:00
Sam Georges
1d4d4c0899
Bugfix to relation controller now allowing multiple relations in the same instance
2014-07-11 18:51:01 +10:00
Sam Georges
ca529d19d4
Use fully qualified primary key name
2014-07-07 19:50:07 +10:00