Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
civicrm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plugins
civicrm
Commits
2544491a
Verified
Commit
2544491a
authored
5 years ago
by
Christian Wach
Committed by
Kevin Cristiano
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Restrict inactive Dashlet query to Dashlets in the current domain
Signed-off-by:
Kevin Cristiano
<
kcristiano@kcristiano.com
>
parent
c6314782
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
civicrm/CRM/Core/BAO/Dashboard.php
+21
-2
21 additions, 2 deletions
civicrm/CRM/Core/BAO/Dashboard.php
with
21 additions
and
2 deletions
civicrm/CRM/Core/BAO/Dashboard.php
+
21
−
2
View file @
2544491a
...
...
@@ -357,11 +357,30 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
}
}
// Disable inactive widgets
// Find dashlets in this domain.
$domainDashlets
=
civicrm_api3
(
'Dashboard'
,
'get'
,
[
'return'
=>
array
(
'id'
),
'domain_id'
=>
CRM_Core_Config
::
domainID
(),
]);
// Get the array of IDs.
$domainDashletIDs
=
[];
if
(
$domainDashlets
[
'is_error'
]
==
0
)
{
foreach
(
$domainDashlets
[
'values'
]
as
$domainDashlet
)
{
$domainDashletIDs
[]
=
$domainDashlet
[
'id'
];
}
}
// Restrict query to Dashlets in this domain.
$domainDashletClause
=
!
empty
(
$domainDashletIDs
)
?
"dashboard_id IN ("
.
implode
(
','
,
$domainDashletIDs
)
.
")"
:
'(1)'
;
// Disable inactive widgets.
$dashletClause
=
$dashletIDs
?
"dashboard_id NOT IN ("
.
implode
(
','
,
$dashletIDs
)
.
")"
:
'(1)'
;
$updateQuery
=
"UPDATE civicrm_dashboard_contact
SET is_active = 0
WHERE
$dashletClause
AND contact_id =
{
$contactID
}
"
;
WHERE
$domainDashletClause
AND
$dashletClause
AND contact_id =
{
$contactID
}
"
;
CRM_Core_DAO
::
executeQuery
(
$updateQuery
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment