How to Add User Dashboard Theme Settings in Vtiger CRM?

·

,

Hello guys, How are you? Welcome back to my blog therichpost.com. Guys today in this blog post I am going to tell you How to Add User Dashboard Theme Settings in Vtiger CRM?

Guys see the main thing in this post, my client wants that each user has different dashboard color so I added on php code and one code inside tpl file to test and that works and I am sharing the same and this is demo code only.

1. Guys here is php code that I added my dashboard.php file also this is dynamic because I am getting from DB:

$currentUser = Users_Record_Model::getCurrentUserModel();

$db = PearDatabase::getInstance();

$result = $db->pquery(
    "SELECT theme_color
     FROM vtiger_user_dashboard_theme
     WHERE userid = ?",
    array($currentUser->getId())
);

$themeC = 'purple';

if ($db->num_rows($result)) {
    $themeC = $db->query_result($result, 0, 'theme_color');
}

$viewer->assign('USERTHEME', $themeC);

2. Guys this code I added inside my header.tpl file:

<body class="theme-{$USERTHEME}">

Guys this worked for me and if you will have any kind of query then feel free to contact me.

Ajay

Thanks

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.