~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to htdocs/faq.php

  • Committer: Bryan Alsdorf
  • Date: 2013-08-23 03:50:34 UTC
  • mto: (4033.1.168 eventum-skysql)
  • mto: This revision was merged to the branch mainline in revision 4660.
  • Revision ID: bryan@montyprogram.com-20130823035034-7f5r3pt1xg0xnnhk
Initial commit of CRM migration

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
$usr_id = Auth::getUserID();
38
38
$prj_id = Auth::getCurrentProject();
39
39
 
40
 
if (!Customer::hasCustomerIntegration($prj_id)) {
 
40
if (!CRM::hasCustomerIntegration($prj_id)) {
41
41
    // show all FAQ entries
42
42
    $support_level_ids = array();
43
43
} else {
44
 
    if (!Customer::doesBackendUseSupportLevels($prj_id)) {
 
44
    $crm = CRM::getInstance($prj_id);
 
45
    if (Auth::getCurrentRole() != User::getRoleID('Customer')) {
45
46
        // show all FAQ entries
46
47
        $support_level_ids = array();
47
48
    } else {
48
 
        if (Auth::getCurrentRole() != User::getRoleID('Customer')) {
49
 
            // show all FAQ entries
50
 
            $support_level_ids = array();
51
 
        } else {
52
 
            $customer_id = User::getCustomerID(Auth::getUserID());
53
 
            $details = Customer::getDetails($prj_id, $customer_id);
54
 
            $support_level_ids = array();
55
 
            foreach ($details['contracts'] as $contract) {
56
 
                $support_level_ids[] = $contract['support_level_id'];
57
 
            }
 
49
        $customer_id = User::getCustomerID(Auth::getUserID());
 
50
        $contact = Auth::getCurrentContact();
 
51
        $support_level_ids = array();
 
52
        // TODOCRM: only active contracts?
 
53
        foreach ($contact->getContracts() as $contract) {
 
54
            $support_level_ids[] = $contract['support_level_id'];
58
55
        }
59
56
    }
60
57
}