From 2b2fa12d0ea16b34eefffddbea13cb67b8ce2b48 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 7 Sep 2007 21:24:47 +0000 Subject: [PATCH] Dashboard now shows the default view to anyone who hasn't personalized it --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Dashboard.pm | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f51c24400..7e93eec94 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -29,6 +29,7 @@ - add: DataForm template variable for the group to view entries - fix: EMS Badge Reporting overlaps with other EMS on the system - fix: SQLReport templatable download doesn't run nested queries + - Dashboard now shows default view if user hasn't configured their own view 7.4.5 - fix: Apostrophy incorrectly escaped as double quote in some places diff --git a/lib/WebGUI/Asset/Wobject/Dashboard.pm b/lib/WebGUI/Asset/Wobject/Dashboard.pm index 6c8113d0c..51b5a8921 100644 --- a/lib/WebGUI/Asset/Wobject/Dashboard.pm +++ b/lib/WebGUI/Asset/Wobject/Dashboard.pm @@ -100,7 +100,24 @@ sub getContentPositions { my $self = shift; my $dummy = $self->initialize unless $self->get("isInitialized"); my $u = WebGUI::User->new($self->session, $self->discernUserId); - return $u->profileField($self->getId.'contentPositions'); + return $u->profileField($self->getId.'contentPositions') + || $self->getContentPositionsDefault; +} + +#------------------------------------------------------------------- + +=head2 getContentPositionsDefault ( ) + +Returns the default content positions for this Dashboard. + +=cut + +sub getContentPositionsDefault { + my $self = shift; + my $dummy = $self->initialize unless $self->get("isInitialized"); + # The default positions are saved under the "Visitor" user + my $u = WebGUI::User->new($self->session, 1); + return $u->profileField($self->getId.'contentPositions'); } #-------------------------------------------------------------------