-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreportsconfig.php
85 lines (79 loc) · 2.14 KB
/
reportsconfig.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* Author: M.PRESS
* Date: 12/24/13
* Time: 1:12 PM
*/
/**
* Class ReportsConfig
* This class conatins helper functions to create a report
*/
class ReportsConfig {
private static $reportMap = array();
const TYPE ="type";
const NAME ="name";
const LOOKUP ="lookup";
/***
* Adds the report to the config static object
* @param $keyName the name of the report
* @param $setConfig the report to be added
*/
public static function addReport($keyName,$setConfig){
ReportsConfig::$reportMap[$keyName] = $setConfig;
}
/***
* Gets the report for a given name
* @param $reportName the name of the report
* @return mixed
*/
public static function getReport($reportName){
return ReportsConfig::$reportMap[$reportName];
}
/***
* returns the list of current Reports
* @return array (string)
*/
public static function getReportNames(){
return array_keys(ReportsConfig::$reportMap);
}
/***
* Creates A Column for a report
* @param string $type the type of column
* @param string $name the name of the column
* @param int $index the index in the database
* @return array
*/
public static function createColumn($type,$name,$index){
return array (ReportsConfig::TYPE => $type , ReportsConfig::NAME => $name, ReportsConfig::LOOKUP=>"keyValue$index");
}
}
/***
* Edit the following lines below to create / edit reports
*
* BEGIN REPORTS
*/
ReportsConfig::addReport ("UsedMentorPersonal",
array(
ReportsConfig::createColumn("int","Mentor Points",1),
ReportsConfig::createColumn("int","Personal Points",2),
ReportsConfig::createColumn("int","Tier Level",3),
)
);
ReportsConfig::addReport ("SpaceTime",
array(
ReportsConfig::createColumn("string","Space Type",1),
)
);
ReportsConfig::addReport ("RiskLevelAccepted",
array(
ReportsConfig::createColumn("int","Risk Level",1),
)
);
ReportsConfig::addReport ("EventMarkersAdded",
array(
ReportsConfig::createColumn("string","Event Marker Type",1)
)
);
/***
* End of Reports
*/