-
Notifications
You must be signed in to change notification settings - Fork 0
/
qa_report.module
102 lines (89 loc) · 2.48 KB
/
qa_report.module
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
module_load_include('inc','qa_report','includes/qa_report.helpers');
/**
* Implementation of hook_menu()
*/
function qa_report_menu(){
$items = array();
$items['admin/qa-report/test-plans'] = array(
'title' => 'Test plans',
'page callback' => 'qa_report_plan_settings',
'access arguments' => array('administer test plan'),
'file' => 'includes/qa_report.settings.inc',
'type' => MENU_CALLBACK,
);
$items['admin/qa'] = array(
'title' => 'QA Report',
'page callback' => 'drupal_get_form',
'page arguments' => array('qa_report_get_issue_list'),
'access arguments' => array('access QA issues'),
'file' => 'includes/qa_report.pages.inc',
);
$items['admin/qa/issues'] = array(
'title' => 'Issue overview',
'page callback' => 'drupal_get_form',
'page arguments' => array('qa_report_get_issue_list'),
'access arguments' => array('access QA issues'),
'file' => 'includes/qa_report.pages.inc',
);
$items['admin/qa/issue/%'] = array(
'title' => 'Issue report',
'page callback' => 'qa_report_issue_detail_page',
'page arguments' => array(3),
'access arguments' => array('access QA issues'),
'file' => 'includes/qa_report.pages.inc',
);
return $items;
}
/**
* Implementation of hook_perm()
*/
function qa_report_perm(){
return array('administer test plan','access QA issues');
}
/**
* Implementation of hook_init()
*/
function qa_report_init(){
// Track page hit
qa_report_set_tracking();
}
/**
* Implementation of hook_block()
*/
function qa_report_block($op = 'list', $delta = 0, $edit = array()){
if ($op == 'list') {
$blocks['stats'] = array(
'info' => t('QA Report'),
'admin' => TRUE,
);
return $blocks;
}
else if ($op == 'view') {
switch($delta) {
case 'stats':
module_load_include('inc','qa_report','includes/qa_report.forms');
$block = array('subject' => t('QA Report'),
'content' => drupal_get_form('qa_report_block_content_form'));
break;
}
return $block;
}
}
/**
* Implementation of hook_theme()
*/
function qa_report_theme() {
return array(
'qa_report_issue_list' => array(
'arguments' => array('form' => NULL),
'file' => 'includes/qa_report.theme.inc',
)
);
}
function qa_report_get_issue($id){
return db_fetch_object(db_query("SELECT * FROM {qa_report_issues} i
LEFT JOIN {qa_report_setups} s ON i.sid = s.sid
LEFT JOIN {qa_report_paths} p ON i.pid = p.pid
WHERE id = %d", $id));
}