From 1bb9fe8a6ebeb18d103dfa0f3886976c004fe869 Mon Sep 17 00:00:00 2001 From: BlackXel Date: Thu, 24 Oct 2019 10:12:48 -0300 Subject: [PATCH 1/2] Added ability to use 'scope' in a form relation field --- classes/StandardControlsRegistry.php | 8 ++++++++ lang/en/lang.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/classes/StandardControlsRegistry.php b/classes/StandardControlsRegistry.php index ae7c8d98..bc9eac6d 100644 --- a/classes/StandardControlsRegistry.php +++ b/classes/StandardControlsRegistry.php @@ -1172,6 +1172,14 @@ protected function registerRelationWidget() 'type' => 'string', 'ignoreIfEmpty' => true, 'sortOrder' => 84 + ], + 'scope' => [ + 'title' => Lang::get('rainlab.builder::lang.form.property_relation_scope'), + 'description' => Lang::get('rainlab.builder::lang.form.property_relation_scope_description'), + 'group' => Lang::get('rainlab.builder::lang.form.property_group_relation'), + 'type' => 'string', + 'ignoreIfEmpty' => true, + 'sortOrder' => 85 ] ]; diff --git a/lang/en/lang.php b/lang/en/lang.php index 92c566cf..5efd7bbd 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -250,6 +250,8 @@ 'property_name_from_description' => 'Relation column name to use for displaying a name.', 'property_relation_select' => 'Select', 'property_relation_select_description' => 'CONCAT multiple columns together for displaying a name', + 'property_relation_scope' => 'Scope', + 'property_relation_scope_description' => 'Specifies a query scope method defined in the related form model to apply to the list query always.', 'property_description_from' => 'Description column', 'property_description_from_description' => 'Relation column name to use for displaying a description.', 'property_recordfinder_prompt' => 'Prompt', From 4f8e1cb4b7899c1cf9766f553b03fdddffc9cd6a Mon Sep 17 00:00:00 2001 From: blackxel Date: Fri, 25 Oct 2019 09:29:15 -0300 Subject: [PATCH 2/2] Update lang.php --- lang/en/lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/en/lang.php b/lang/en/lang.php index 5efd7bbd..e167c033 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -251,7 +251,7 @@ 'property_relation_select' => 'Select', 'property_relation_select_description' => 'CONCAT multiple columns together for displaying a name', 'property_relation_scope' => 'Scope', - 'property_relation_scope_description' => 'Specifies a query scope method defined in the related form model to apply to the list query always.', + 'property_relation_scope_description' => 'Specifies a query scope method that\'s defined in the related form model to always apply to the list query.', 'property_description_from' => 'Description column', 'property_description_from_description' => 'Relation column name to use for displaying a description.', 'property_recordfinder_prompt' => 'Prompt',