From c468f24af28f63af4fe1f098521a8887a22cfc5c Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 14 Jun 2021 23:03:40 -0700 Subject: [PATCH] msgtplui - ListCtrl - Bind the filter-text to "?f=..." --- ext/msgtplui/ang/msgtplui.ang.php | 1 + ext/msgtplui/ang/msgtplui/ListCtrl.js | 6 ++++++ ext/msgtplui/ang/msgtplui/User.html | 4 ++-- ext/msgtplui/ang/msgtplui/User.js | 1 + ext/msgtplui/ang/msgtplui/Workflow.html | 4 ++-- ext/msgtplui/ang/msgtplui/Workflow.js | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ext/msgtplui/ang/msgtplui.ang.php b/ext/msgtplui/ang/msgtplui.ang.php index 02ffdc3fa0..5f6e466429 100644 --- a/ext/msgtplui/ang/msgtplui.ang.php +++ b/ext/msgtplui/ang/msgtplui.ang.php @@ -18,6 +18,7 @@ return [ 'bootstrap3', ], 'requires' => [ + 'crmRouteBinder', 'crmUi', 'crmUtil', 'ngRoute', diff --git a/ext/msgtplui/ang/msgtplui/ListCtrl.js b/ext/msgtplui/ang/msgtplui/ListCtrl.js index 3fc0e8cf79..3a308e9370 100644 --- a/ext/msgtplui/ang/msgtplui/ListCtrl.js +++ b/ext/msgtplui/ang/msgtplui/ListCtrl.js @@ -9,6 +9,12 @@ $scope.checkPerm = CRM.checkPerm; $scope.help = CRM.help; + $scope.$bindToRoute({ + param: 'f', + expr: 'filters', + default: {text: ''} + }); + var ctrl = this; ctrl.records = records; diff --git a/ext/msgtplui/ang/msgtplui/User.html b/ext/msgtplui/ang/msgtplui/User.html index a0cb2ebebd..bf688c14ee 100644 --- a/ext/msgtplui/ang/msgtplui/User.html +++ b/ext/msgtplui/ang/msgtplui/User.html @@ -5,7 +5,7 @@
- + @@ -23,7 +23,7 @@ - + {{record.msg_title}} {{record.msg_subject}} {{record.is_active ? ts('Yes') : ts('No')}} diff --git a/ext/msgtplui/ang/msgtplui/User.js b/ext/msgtplui/ang/msgtplui/User.js index 61a4f433cb..a912b7129c 100644 --- a/ext/msgtplui/ang/msgtplui/User.js +++ b/ext/msgtplui/ang/msgtplui/User.js @@ -3,6 +3,7 @@ // Display a list of user-driven message-templates. angular.module('msgtplui').config(function($routeProvider) { $routeProvider.when('/user', { + reloadOnSearch: false, controller: 'MsgtpluiListCtrl', controllerAs: '$ctrl', templateUrl: '~/msgtplui/User.html', diff --git a/ext/msgtplui/ang/msgtplui/Workflow.html b/ext/msgtplui/ang/msgtplui/Workflow.html index 7775c41be1..fcc52a8f94 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.html +++ b/ext/msgtplui/ang/msgtplui/Workflow.html @@ -5,7 +5,7 @@
- +
@@ -19,7 +19,7 @@ - +
{{record.msg_title}} {{record['tx.language:label']}} diff --git a/ext/msgtplui/ang/msgtplui/Workflow.js b/ext/msgtplui/ang/msgtplui/Workflow.js index c73768330a..2121aee7b4 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.js +++ b/ext/msgtplui/ang/msgtplui/Workflow.js @@ -3,6 +3,7 @@ // Display a list of system-workflow message-templates. angular.module('msgtplui').config(function($routeProvider) { $routeProvider.when('/workflow', { + reloadOnSearch: false, controller: 'MsgtpluiListCtrl', controllerAs: '$ctrl', templateUrl: '~/msgtplui/Workflow.html', -- 2.25.1