-
Notifications
You must be signed in to change notification settings - Fork 1
/
teammemberpatch_new.patch
233 lines (224 loc) · 10.4 KB
/
teammemberpatch_new.patch
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
diff -Naur stormteammember/stormteammember.admin.inc stormteammemberNew/stormteammember.admin.inc
--- stormteammember/stormteammember.admin.inc 2009-06-03 02:53:48.000000000 +0200
+++ stormteammemberNew/stormteammember.admin.inc 2009-07-01 03:03:41.000000000 +0200
@@ -13,9 +13,11 @@
unset($_SESSION['stormteammember_list_filter']['project_nid']);
unset($_SESSION['stormteammember_list_filter']['task_nid']);
unset($_SESSION['stormteammember_list_filter']['ticket_nid']);
+ unset($_SESSION['stormteammember_list_filter']['person_title']);
}
if (array_key_exists('project_nid', $_GET)) {
+
if ($_SESSION['stormteammember_list_filter']['project_nid'] != $_GET['project_nid']) {
$_SESSION['stormteammember_list_filter']['project_nid'] = $_GET['project_nid'];
}
@@ -24,6 +26,7 @@
unset($_SESSION['stormteammember_list_filter']['task_nid']);
unset($_SESSION['stormteammember_list_filter']['ticket_nid']);
+ unset($_SESSION['stormteammember_list_filter']['person_title']);
}
if (array_key_exists('task_nid', $_GET)) {
@@ -34,6 +37,7 @@
$t = node_load($_GET['task_nid']);
$_SESSION['stormteammember_list_filter']['organization_nid'] = $t->organization_nid;
$_SESSION['stormteammember_list_filter']['project_nid'] = $t->project_nid;
+ $_SESSION['stormteammember_list_filter']['person_title'] = $t->person_title;
unset($_SESSION['stormteammember_list_filter']['ticket_nid']);
}
@@ -46,8 +50,24 @@
$_SESSION['stormteammember_list_filter']['organization_nid'] = $ti->organization_nid;
$_SESSION['stormteammember_list_filter']['project_nid'] = $ti->project_nid;
$_SESSION['stormteammember_list_filter']['task_nid'] = $ti->task_nid;
+ $_SESSION['stormteammember_list_filter']['person_title'] = $t->person_title;
}
+ if (array_key_exists('person_nid', $_GET)) {
+
+ if ($_SESSION['stormteammember_list_filter']['person_nid'] != $_GET['person_nid']) {
+ $_SESSION['stormteammember_list_filter']['person_nid'] = $_GET['person_nid'];
+ }
+
+ $ti = node_load($_GET['person_nid']);
+ $_SESSION['stormteammember_list_filter']['organization_nid'] = $ti->organization_nid;
+ $_SESSION['stormteammember_list_filter']['project_nid'] = $ti->project_nid;
+ $_SESSION['stormteammember_list_filter']['task_nid'] = $ti->task_nid;
+ $_SESSION['stormteammember_list_filter']['person_title'] = $t->person_title;
+ }
+
+
+
$o = drupal_get_form('stormteammember_list_filter');
$i = new stdClass();
@@ -71,6 +91,10 @@
'field' => 'stm.ticket_title',
),
array(
+ 'data' => t('Person'),
+ 'field' => 'stm.person_title ',
+ ),
+ array(
'data' => storm_icon_add('storm/teammembers/add', $i, $_GET),
'class' => 'storm_list_operations',
),
@@ -87,6 +111,9 @@
if ($_SESSION['stormteammember_list_filter']['task_nid']) {
$where[] = 'stm.task_nid='. $_SESSION['stormteammember_list_filter']['task_nid'];
}
+ if ($_SESSION['stormteammember_list_filter']['person_nid']) {
+ $where[] = 'stm.person_nid='. $_SESSION['stormteammember_list_filter']['person_nid'];
+ }
if ($_SESSION['stormteammember_list_filter']['ticket_nid']) {
$where[] = 'stm.ticket_nid='. $_SESSION['stormteammember_list_filter']['ticket_nid'];
}
@@ -114,6 +141,7 @@
function stormteammember_list_filter() {
$organization_nid = $_SESSION['stormteammember_list_filter']['organization_nid'];
$project_nid = $_SESSION['stormteammember_list_filter']['project_nid'];
+ $person_nid = $_SESSION['stormteammember_list_filter']['person_nid'];
$task_nid = $_SESSION['stormteammember_list_filter']['task_nid'];
$ticket_nid = $_SESSION['stormteammember_list_filter']['ticket_nid'];
$itemsperpage = $_SESSION['stormteammember_list_filter']['itemsperpage'];
@@ -175,6 +203,24 @@
'#attributes' => array('onchange' => "stormticket_project_task_tickets(this, 'edit-organization-nid', 'edit-task-nid', 'edit-ticket-nid', true, 'All')"),
);
+ $s = "SELECT n.nid, n.title FROM {node} AS n INNER JOIN {stormperson} AS sor ON sor.vid=n.vid
+ WHERE n.status=1 AND n.type='stormperson' ORDER BY n.title";
+ $s = stormorganization_access_sql($s);
+ $s = db_rewrite_sql($s);
+ $r = db_query($s);
+ $persons = array();
+ while ($person = db_fetch_object($r)) {
+ $persons[$person->nid] = $person->title;
+ }
+ $persons = array(0 => t('All')) + $persons;
+ $form['filter']['group1']['person_nid'] = array(
+ '#type' => 'select',
+ '#title' => t('Person'),
+ '#default_value' => $person_nid,
+ '#options' => $persons,
+ );
+
+
$tree = _stormtask_get_tree($project_nid);
$tasks = _stormtask_plain_tree($tree);
$tasks = array(0 => t('All')) + $tasks;
@@ -187,6 +233,8 @@
'#attributes' => array('onchange' => "stormticket_task_tickets(this, 'edit-organization-nid', 'edit-project-nid', 'edit-ticket-nid', true, 'All')"),
);
+
+
$s = "SELECT n.nid, n.title FROM {node} AS n INNER JOIN {stormticket} AS sti
ON sti.vid=n.vid WHERE n.status=1 AND n.type='stormticket' AND sti.organization_nid=%d AND sti.project_nid=%d AND sti.task_nid=%d ORDER BY title ";
$s = stormticket_access_sql($s);
@@ -238,6 +286,7 @@
$_SESSION['stormteammember_list_filter']['organization_nid'] = $form_state['values']['organization_nid'];
$_SESSION['stormteammember_list_filter']['project_nid'] = $form_state['values']['project_nid'];
$_SESSION['stormteammember_list_filter']['task_nid'] = $form_state['values']['task_nid'];
+ $_SESSION['stormteammember_list_filter']['person_nid'] = $form_state['values']['person_nid'];
$_SESSION['stormteammember_list_filter']['ticket_nid'] = $form_state['values']['ticket_nid'];
$_SESSION['stormteammember_list_filter']['itemsperpage'] = $form_state['values']['itemsperpage'];
}
@@ -370,6 +419,12 @@
$p = node_load($teammember->project_nid);
$teammember->organization_nid = $p->organization_nid;
}
+ if (array_key_exists('person_nid', $_GET) && !$teammember->person_nid) {
+ $teammember->person_nid = $_GET['person_nid'];
+ $p = node_load($teammember->person_nid);
+ $teammember->organization_nid = $p->organization_nid;
+ }
+
if (array_key_exists('task_nid', $_GET) && !$teammember->task_nid) {
$teammember->task_nid = $_GET['task_nid'];
$t = node_load($teammember->task_nid);
@@ -390,6 +445,9 @@
if ($_SESSION['stormteammember_list_filter']['project_nid'] && !$teammember->project_nid) {
$teammember->project_nid = $_SESSION['stormteammember_list_filter']['project_nid'];
}
+ if ($_SESSION['stormteammember_list_filter']['person_nid'] && !$teammember->person_nid) {
+ $teammember->person_nid = $_SESSION['stormteammember_list_filter']['person_nid'];
+ }
if ($_SESSION['stormteammember_list_filter']['task_nid'] && !$teammember->task_nid) {
$teammember->task_nid = $_SESSION['stormteammember_list_filter']['task_nid'];
}
@@ -398,6 +456,7 @@
}
if (array_key_exists('organization_nid', $_GET)) $teammember->organization_nid = $_GET['organization_nid'];
if (array_key_exists('project_nid', $_GET)) $teammember->project_nid = $_GET['project_nid'];
+ if (array_key_exists('person_nid', $_GET)) $teammember->person_nid = $_GET['person_nid'];
if (array_key_exists('task_nid', $_GET)) $teammember->task_nid = $_GET['task_nid'];
if (array_key_exists('ticket_nid', $_GET)) $teammember->ticket_nid = $_GET['ticket_nid'];
diff -Naur stormteammember/stormteammember.theme.inc stormteammemberNew/stormteammember.theme.inc
--- stormteammember/stormteammember.theme.inc 2009-02-15 10:03:35.000000000 +0100
+++ stormteammemberNew/stormteammember.theme.inc 2009-07-01 02:59:43.000000000 +0200
@@ -16,6 +16,7 @@
l($teammember->project_title, 'node/'. $teammember->project_nid),
l($teammember->task_title, 'node/'. $teammember->task_nid),
l($teammember->ticket_title, 'node/'. $teammember->ticket_nid),
+ l($teammember->person_title, 'node/'. $teammember->person_nid),
array(
'data' => storm_icon_edit('storm/teammembers/edit/'. $teammember->tid, $i, $_GET) .' '. storm_icon_delete('storm/teammembers/delete/'. $teammember->tid, $i, $_GET),
'class' => 'storm_list_operations',
@@ -78,6 +79,7 @@
t('Organization', array(), $language),
t('Project', array(), $language),
t('Title', array(), $language),
+ t('Person', array(), $language),
t('Date', array(), $language),
t('Duration (hours)', array(), $language));
$total_duration = 0;
@@ -86,6 +88,7 @@
$teammember->organization_title,
$teammember->project_title,
$teammember->title,
+ $teammember->person_title,
format_date($teammember->trackingdate, 'small'),
array('data' => sprintf('%.2f', $teammember->duration), 'align' => 'right'),
);
@@ -98,6 +101,7 @@
$header = array(
t('Project', array(), $language),
t('Title', array(), $language),
+ t('Person', array(), $language),
t('Date', array(), $language),
t('Duration (hours)', array(), $language));
$total_duration = 0;
@@ -105,6 +109,7 @@
$rows[] = array(
$teammember->project_title,
$teammember->title,
+ $teammember->person_title,
format_date($teammember->trackingdate, 'small'),
array('data' => sprintf('%.2f', $teammember->duration), 'align' => 'right'),
);
@@ -119,6 +124,7 @@
t('Project', array(), $language),
t('Task', array(), $language),
t('Title', array(), $language),
+ t('Person', array(), $language),
t('Date', array(), $language),
t('Duration (hours)', array(), $language));
$total_duration = 0;
@@ -127,6 +133,7 @@
$teammember->project_title,
$teammember->task_title,
$teammember->title,
+ $teammember->person_title,
format_date($teammember->trackingdate, 'small'),
array('data' => sprintf('%.2f', $teammember->duration), 'align' => 'right'),
);
@@ -142,6 +149,7 @@
$header = array(
t('Task', array(), $language),
t('Title', array(), $language),
+ t('Person', array(), $language),
t('Date', array(), $language),
t('Duration (hours)', array(), $language));
$total_duration = 0;
@@ -149,6 +157,7 @@
$rows[] = array(
$teammember->task_title,
$teammember->title,
+ $teammember->person_title,
format_date($teammember->trackingdate, 'small'),
array('data' => sprintf('%.2f', $teammember->duration), 'align' => 'right'),
);