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
bdf9ae5a
Verified
Commit
bdf9ae5a
authored
5 years ago
by
Christian Wach
Committed by
Kevin Cristiano
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ensure Dashboard respects multiple Domains
parent
55fb38e0
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
+10
-5
10 additions, 5 deletions
civicrm/CRM/Core/BAO/Dashboard.php
with
10 additions
and
5 deletions
civicrm/CRM/Core/BAO/Dashboard.php
+
10
−
5
View file @
bdf9ae5a
...
...
@@ -109,6 +109,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
'contact_id'
=>
$contactID
,
'is_active'
=>
1
,
'dashboard_id.is_active'
=>
1
,
'dashboard_id.domain_id'
=>
CRM_Core_Config
::
domainID
(),
'options'
=>
[
'sort'
=>
'weight'
,
'limit'
=>
0
],
'return'
=>
[
'id'
,
...
...
@@ -143,7 +144,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
// If empty, then initialize default dashlets for this user.
if
(
!
$results
[
'count'
])
{
// They may just have disabled all their dashlets. Check if any records exist for this contact.
if
(
!
civicrm_api3
(
'DashboardContact'
,
'getcount'
,
[
'contact_id'
=>
$contactID
]))
{
if
(
!
civicrm_api3
(
'DashboardContact'
,
'getcount'
,
[
'contact_id'
=>
$contactID
,
'dashboard_id.domain_id'
=>
CRM_Core_Config
::
domainID
()
]))
{
$dashlets
=
self
::
initializeDashlets
();
}
}
...
...
@@ -388,7 +389,13 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
$dashlet
=
new
CRM_Core_DAO_Dashboard
();
if
(
!
$dashboardID
)
{
// check url is same as exiting entries, if yes just update existing
// Assign domain before search to allow identical dashlets in different domains.
if
(
empty
(
$params
[
'domain_id'
]))
{
$dashlet
->
domain_id
=
CRM_Core_Config
::
domainID
();
}
// Try and find an existing dashlet - it will be updated if found.
if
(
!
empty
(
$params
[
'name'
]))
{
$dashlet
->
name
=
CRM_Utils_Array
::
value
(
'name'
,
$params
);
$dashlet
->
find
(
TRUE
);
...
...
@@ -397,9 +404,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
$dashlet
->
url
=
CRM_Utils_Array
::
value
(
'url'
,
$params
);
$dashlet
->
find
(
TRUE
);
}
if
(
empty
(
$params
[
'domain_id'
]))
{
$dashlet
->
domain_id
=
CRM_Core_Config
::
domainID
();
}
}
else
{
$dashlet
->
id
=
$dashboardID
;
...
...
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