Example #1
0
if ($role_id == User::getRoleID('customer')) {
    $crm = CRM::getInstance($prj_id);
    // need the activity dashboard here
    $contact_id = User::getCustomerContactID($usr_id);
    $customer_id = Auth::getCurrentCustomerID();
    $tpl->assign(array('contact' => $crm->getContact($contact_id), 'customer' => $crm->getCustomer($customer_id)));
} else {
    if (Auth::getCurrentRole() <= User::getRoleID('Reporter') && Project::getSegregateReporters($prj_id)) {
        $tpl->assign('hide_stats', true);
    } else {
        $tpl->assign('hide_stats', false);
        $tpl->assign('status', Stats::getStatus());
        $tpl->assign('releases', Stats::getRelease($hide_closed));
        $tpl->assign('categories', Stats::getCategory($hide_closed));
        $tpl->assign('priorities', Stats::getPriority($hide_closed));
        $tpl->assign('users', Stats::getUser($hide_closed));
        $tpl->assign('emails', Stats::getEmailStatus($hide_closed));
        $tpl->assign('pie_chart', Stats::getPieChart($hide_closed));
    }
}
if (@$_REQUEST['hide_closed'] == '') {
    $Stats_Search_Profile = Search_Profile::getProfile($usr_id, $prj_id, 'stats');
    if (!empty($Stats_Search_Profile)) {
        $tpl->assign('hide_closed', $Stats_Search_Profile['hide_closed']);
    }
} else {
    $tpl->assign('hide_closed', @$_REQUEST['hide_closed']);
    Search_Profile::save($usr_id, $prj_id, 'stats', array('hide_closed' => @$_REQUEST['hide_closed']));
}
$tpl->assign('news', News::getListByProject($prj_id));
$tpl->displayTemplate();
Example #2
0
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.user.php";
include_once APP_INC_PATH . "class.stats.php";
include_once APP_INC_PATH . "class.misc.php";
include_once APP_INC_PATH . "class.news.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("main.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$prj_id = Auth::getCurrentProject();
$role_id = Auth::getCurrentRole();
if ($role_id == User::getRoleID('customer')) {
    // need the activity dashboard here
    $usr_id = Auth::getUserID();
    $customer_id = User::getCustomerID($usr_id);
    $tpl->assign("customer_stats", Customer::getOverallStats($prj_id, $customer_id));
    $tpl->assign("profile", Customer::getProfile($prj_id, $usr_id));
} else {
    $tpl->assign("status", Stats::getStatus());
    $tpl->assign("releases", Stats::getRelease());
    $tpl->assign("categories", Stats::getCategory());
    $tpl->assign("priorities", Stats::getPriority());
    $tpl->assign("users", Stats::getUser());
    $tpl->assign("emails", Stats::getEmailStatus());
    $tpl->assign("pie_chart", Stats::getPieChart());
    if ($_GET['tips']) {
        $tpl->assign("random_tip", Misc::getRandomTip($tpl));
    }
}
$tpl->assign("news", News::getListByProject($prj_id));
$tpl->displayTemplate();