Multiple dashboard

94 views
Skip to first unread message

Michele Tarantino

unread,
Sep 4, 2015, 11:09:54 AM9/4/15
to Xataface
 Can i have different dashboards for more users?

Mads Mammen

unread,
Sep 5, 2015, 6:25:01 AM9/5/15
to Xataface
Hi

Just to be courious - nothing to do with multiple dashboards (I think you can, you just need another dumy table or view to the table)

Did you scessed with the mssql driver ?

Best regards
Mads Mammen

Michele Tarantino

unread,
Sep 7, 2015, 6:29:52 AM9/7/15
to Xataface
Hello
Due to other commitments I had to stop working with the db mssql, but we hope to resume as soon as possible and let you know meanwhile thanks for asking

Avi Silverman

unread,
Sep 9, 2015, 9:26:32 AM9/9/15
to Xataface
If you want to do multiple dashboards the simplest thing is probably to do something like this in your dashboard action php file (presumably dashboard.php):

class actions_dashboard {
function handle(&$params){

$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();

if($user == "user1")
df_display(array(), 'dashboard1.html');
elseif($user == "user2")
df_display(array(), 'dashboard2.html');

}
}

Alternately, what I do, since in my case there are several options that can go in to determining what information gets displayed to a user on the dashboard, is use the php to check for various permissions/settings that I have defined in my user table (eg. a user might have access to something like a customer list, but not employee data), which then get passed to the dashboard template file. (I just save everything to an array, because it's easier for me, but you could also pass each variable individually.) The template file then checks the given variables to determine which sections to display. So, based on the previous example, something like:

php:
df_display(array("user" = $user, 'dashboard.html');

html:
{use_macro file="Dataface_Main_Template.html"}
{fill_slot name="main_column"}

General Dashboard Stuff

{if $user == "user1"}
User 1 specific dashboard stuff
{elseif $user == "user2"}
User 2 specific dashboard stuff
{/if}

{/fill_slot}
{/use_macro}

Hope that helps.

Michele Tarantino

unread,
Sep 15, 2015, 6:47:16 AM9/15/15
to Xataface
Thanks take your advice
Reply all
Reply to author
Forward
0 new messages