~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to htdocs/reports/customer_stats.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:
41
41
 
42
42
// check if this project has customer integration
43
43
$prj_id = Auth::getCurrentProject();
44
 
if (!Customer::hasCustomerIntegration($prj_id)) {
 
44
if (!CRM::hasCustomerIntegration($prj_id)) {
45
45
    $tpl->assign("no_customer_integration", 1);
46
46
    $tpl->displayTemplate();
47
47
    exit;
48
48
}
 
49
$crm = CRM::getInstance($prj_id);
49
50
 
50
51
if (count(@$_POST["start"]) > 0 &&
51
52
        (@$_POST["start"]["Year"] != 0) &&
70
71
}
71
72
 
72
73
$support_levels = array('Aggregate' => 'Aggregate');
73
 
$grouped_levels = Customer::getGroupedSupportLevels($prj_id);
 
74
$grouped_levels = $crm->getGroupedSupportLevels();
74
75
foreach ($grouped_levels as $level_name => $level_ids) {
75
76
    $support_levels[$level_name] = $level_name;
76
77
}
79
80
    $_POST["support_level"] = array('Aggregate');
80
81
}
81
82
 
82
 
// XXX: internal only - Remove all mentions of InnoDB
83
 
 
84
83
$prj_id = Auth::getCurrentProject();
85
84
$tpl->assign(array(
86
 
    "has_support_levels"=>  Customer::doesBackendUseSupportLevels($prj_id),
87
85
    "project_name"      =>  Auth::getCurrentProjectName(),
88
86
    "support_levels"    =>  $support_levels,
89
87
    "support_level"     =>  @$_POST["support_level"],
91
89
    "end_date"          =>  $end_date,
92
90
    "sections"          =>  Customer_Stats_Report::getDisplaySections(),
93
91
    "display_sections"  =>  $_POST["display_sections"],
94
 
    "split_innoDB"      =>  @$_POST["split_innoDB"],
95
92
    "include_expired"   =>  @$_POST["include_expired"],
96
93
    "graphs"            =>  Customer_Stats_Report::getGraphTypes()
97
94
));
99
96
// only set customers if user has role of manager or above
100
97
if (Auth::getCurrentRole() >= User::getRoleID('manager')) {
101
98
    $tpl->assign(array(
102
 
    "customers"         =>  Customer::getAssocList($prj_id),
 
99
    "customers"         =>  $crm->getCustomerAssocList(),
103
100
    "customer"          =>  @$_POST["customer"]
104
101
    ));
105
102
}