Completed
Pull Request — master (#1795)
by Christian
09:16
created
drupal/sites/default/boinc/modules/boincteam/boincteam_forum.views.inc 2 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -13,80 +13,80 @@
 block discarded – undo
13 13
  */
14 14
 function boincteam_forum_views_data() {
15 15
   
16
-  // -----------------------------------------------------------------------------------------------
17
-  // Definition for team table
18
-  // -----------------------------------------------------------------------------------------------
16
+    // -----------------------------------------------------------------------------------------------
17
+    // Definition for team table
18
+    // -----------------------------------------------------------------------------------------------
19 19
   
20
-  $data['boincteam_forum_node']['table']['group'] = t('BOINC');
20
+    $data['boincteam_forum_node']['table']['group'] = t('BOINC');
21 21
   
22
-  $data['boincteam_forum_node']['table']['base'] = array(
23
-      'field' => 'nid',
24
-      'title' => t('BOINC team forum topic'),
25
-      'help' => t('Forum topics for a team'),
26
-  );
22
+    $data['boincteam_forum_node']['table']['base'] = array(
23
+        'field' => 'nid',
24
+        'title' => t('BOINC team forum topic'),
25
+        'help' => t('Forum topics for a team'),
26
+    );
27 27
 
28
-  // Describe each of the individual fields in this table to Views. For
29
-  // each field, you may define what field, sort, argument, and/or filter
30
-  // handlers it supports. This will determine where in the Views interface you
31
-  // may use the field.
28
+    // Describe each of the individual fields in this table to Views. For
29
+    // each field, you may define what field, sort, argument, and/or filter
30
+    // handlers it supports. This will determine where in the Views interface you
31
+    // may use the field.
32 32
   
33
-  // Primary keys allowed as arguments
33
+    // Primary keys allowed as arguments
34 34
   
35
-  $data['boincteam_forum_node']['tfid'] = array(
35
+    $data['boincteam_forum_node']['tfid'] = array(
36 36
     'title' => t('Team forum ID'),
37 37
     'help' => t('The ID of the team forum containing this topic.'),
38 38
     'field' => array(
39
-      'handler' => 'views_handler_field_numeric',
40
-      'click sortable' => TRUE
39
+        'handler' => 'views_handler_field_numeric',
40
+        'click sortable' => TRUE
41 41
     ),
42 42
     'argument' => array(
43
-      'handler' => 'views_handler_argument_numeric',
44
-      'name field' => 'title', // the field to display in the summary.
45
-      'numeric' => TRUE,
46
-      'validate type' => 'id'
43
+        'handler' => 'views_handler_argument_numeric',
44
+        'name field' => 'title', // the field to display in the summary.
45
+        'numeric' => TRUE,
46
+        'validate type' => 'id'
47 47
     ),
48 48
     'relationship' => array(
49
-      'base' => 'boincteam_forum',
50
-      'field' => 'tfid',
51
-      'handler' => 'views_handler_relationship',
52
-      'label' => t('Team Forum')
49
+        'base' => 'boincteam_forum',
50
+        'field' => 'tfid',
51
+        'handler' => 'views_handler_relationship',
52
+        'label' => t('Team Forum')
53 53
     ),
54 54
     'filter' => array(
55
-      'handler' => 'views_handler_filter_numeric'
55
+        'handler' => 'views_handler_filter_numeric'
56 56
     ),
57 57
     'sort' => array(
58
-      'handler' => 'views_handler_sort_numeric'
58
+        'handler' => 'views_handler_sort_numeric'
59 59
     )
60
-  );
60
+    );
61 61
   
62
-  // Foreign key fields
62
+    // Foreign key fields
63 63
   
64
-  $data['boincteam_forum_node']['nid'] = array(
64
+    $data['boincteam_forum_node']['nid'] = array(
65 65
     'title' => t('Team forum node'),
66 66
     'help' => t('The node containing the content of this team forum topic.'),
67 67
     // This is a foreign key to the {node} table. When the view is configured
68 68
     // with this relationship, all the fields for the related user node will be 
69 69
     // available.
70 70
     'relationship' => array(
71
-      'base' => 'node',
72
-      'field' => 'nid',
73
-      'handler' => 'views_handler_relationship',
74
-      'label' => t('Team Forum Topic Node')
71
+        'base' => 'node',
72
+        'field' => 'nid',
73
+        'handler' => 'views_handler_relationship',
74
+        'label' => t('Team Forum Topic Node')
75 75
     ),
76 76
     'field' => array(
77
-      'handler' => 'views_handler_field_numeric',
78
-      'click sortable' => TRUE
77
+        'handler' => 'views_handler_field_numeric',
78
+        'click sortable' => TRUE
79 79
     ),
80 80
     'filter' => array(
81
-      'handler' => 'views_handler_filter_numeric'
81
+        'handler' => 'views_handler_filter_numeric'
82 82
     ),
83 83
     'sort' => array(
84
-      'handler' => 'views_handler_sort_numeric'
84
+        'handler' => 'views_handler_sort_numeric'
85 85
     )
86
-  );
86
+    );
87 87
   
88
-  // Descriptions of general fields (alphabetized)
89
-  // ...
88
+    // Descriptions of general fields (alphabetized)
89
+    // ...
90 90
   
91
-  return $data;
91
+    return $data;
92 92
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
     'help' => t('The ID of the team forum containing this topic.'),
38 38
     'field' => array(
39 39
       'handler' => 'views_handler_field_numeric',
40
-      'click sortable' => TRUE
40
+      'click sortable' => true
41 41
     ),
42 42
     'argument' => array(
43 43
       'handler' => 'views_handler_argument_numeric',
44 44
       'name field' => 'title', // the field to display in the summary.
45
-      'numeric' => TRUE,
45
+      'numeric' => true,
46 46
       'validate type' => 'id'
47 47
     ),
48 48
     'relationship' => array(
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     ),
76 76
     'field' => array(
77 77
       'handler' => 'views_handler_field_numeric',
78
-      'click sortable' => TRUE
78
+      'click sortable' => true
79 79
     ),
80 80
     'filter' => array(
81 81
       'handler' => 'views_handler_filter_numeric'
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/boincteam.module 4 patches
Indentation   +566 added lines, -566 removed lines patch added patch discarded remove patch
@@ -26,113 +26,113 @@  discard block
 block discarded – undo
26 26
  * Implementation of hook_menu()
27 27
  */
28 28
 function boincteam_menu() {
29
-  $items = array();
30
-  $items['community/teams/%/assume-foundership'] = array(
29
+    $items = array();
30
+    $items['community/teams/%/assume-foundership'] = array(
31 31
     'page callback' => 'boincteam_assume_foundership',
32 32
     'page arguments' => array(2),
33 33
     'access callback' => 'boincteam_is_member',
34 34
     'access arguments' => array(2),
35 35
     'type' => MENU_CALLBACK
36
-  );
37
-  $items['community/teams/%/join'] = array(
36
+    );
37
+    $items['community/teams/%/join'] = array(
38 38
     'page callback' => 'boincteam_join',
39 39
     'page arguments' => array(2),
40 40
     'access arguments' => array('join boincteam'),
41 41
     'type' => MENU_CALLBACK
42
-  );
43
-  $items['community/teams/%/leave'] = array(
42
+    );
43
+    $items['community/teams/%/leave'] = array(
44 44
     'page callback' => 'boincteam_leave',
45 45
     'page arguments' => array(2),
46 46
     'access arguments' => array('join boincteam'),
47 47
     'type' => MENU_CALLBACK
48
-  );
49
-  $items['community/teams/%/delete'] = array(
48
+    );
49
+    $items['community/teams/%/delete'] = array(
50 50
     'page callback' => 'boincteam_delete',
51 51
     'page arguments' => array(2),
52 52
     'access callback' => 'boincteam_is_founder',
53 53
     'access arguments' => array(2),
54 54
     'type' => MENU_CALLBACK
55
-  );
56
-  $items['community/teams/%/deny-foundership-request'] = array(
55
+    );
56
+    $items['community/teams/%/deny-foundership-request'] = array(
57 57
     'page callback' => 'boincteam_deny_foundership_request',
58 58
     'page arguments' => array(2),
59 59
     'access callback' => 'boincteam_is_founder',
60 60
     'access arguments' => array(2),
61 61
     'type' => MENU_CALLBACK
62
-  );
63
-  $items['community/teams/%/edit/admins/remove/%'] = array(
62
+    );
63
+    $items['community/teams/%/edit/admins/remove/%'] = array(
64 64
     'page callback' => 'boincteam_remove_admin',
65 65
     'page arguments' => array(2,6),
66 66
     'access callback' => 'boincteam_is_founder',
67 67
     'access arguments' => array(2),
68 68
     'type' => MENU_CALLBACK
69
-  );
70
-  $items['community/teams/%/edit/founder/set/%'] = array(
69
+    );
70
+    $items['community/teams/%/edit/founder/set/%'] = array(
71 71
     'page callback' => 'boincteam_set_founder',
72 72
     'page arguments' => array(2,6),
73 73
     'access callback' => 'boincteam_is_founder',
74 74
     'access arguments' => array(2),
75 75
     'type' => MENU_CALLBACK
76
-  );
77
-  $items['community/teams/%/edit/members/remove/%'] = array(
76
+    );
77
+    $items['community/teams/%/edit/members/remove/%'] = array(
78 78
     'page callback' => 'boincteam_remove_member',
79 79
     'page arguments' => array(2,6),
80 80
     'access callback' => 'boincteam_is_founder',
81 81
     'access arguments' => array(2),
82 82
     'type' => MENU_CALLBACK
83
-  );
84
-  $items['community/teams/%/history/xml'] = array(
83
+    );
84
+    $items['community/teams/%/history/xml'] = array(
85 85
     'page callback' => 'boincteam_history_xml',
86 86
     'page arguments' => array(2),
87 87
     'access callback' => 'boincteam_is_admin',
88 88
     'access arguments' => array(2),
89 89
     'type' => MENU_CALLBACK
90
-  );
91
-  $items['community/teams/%/members/email'] = array(
90
+    );
91
+    $items['community/teams/%/members/email'] = array(
92 92
     'page callback' => 'boincteam_members_email_list',
93 93
     'page arguments' => array(2),
94 94
     'access callback' => 'boincteam_is_admin',
95 95
     'access arguments' => array(2),
96 96
     'type' => MENU_CALLBACK
97
-  );
98
-  $items['community/teams/%/request-foundership'] = array(
97
+    );
98
+    $items['community/teams/%/request-foundership'] = array(
99 99
     'page callback' => 'boincteam_request_foundership',
100 100
     'page arguments' => array(2),
101 101
     'access callback' => 'boincteam_is_member',
102 102
     'access arguments' => array(2),
103 103
     'type' => MENU_CALLBACK
104
-  );
104
+    );
105 105
    
106
-  return $items;
106
+    return $items;
107 107
 }
108 108
 
109 109
 /**
110 110
 * Implementation of hook_views_api().
111 111
 */
112 112
 function boincteam_views_api() {
113
-  return array(
113
+    return array(
114 114
     'api' => 2.0,
115 115
     'path' => drupal_get_path('module', 'boincteam')
116
-  );
116
+    );
117 117
 }
118 118
 
119 119
 /**
120 120
  * Implementation of hook_perm()
121 121
  */
122 122
 function boincteam_perm() {
123
-  return array('join boincteam', 'create boincteam', 'manage boincteam');
123
+    return array('join boincteam', 'create boincteam', 'manage boincteam');
124 124
 }
125 125
 
126 126
 /**
127 127
  * Implementation of hook_cron()
128 128
  */
129 129
 function boincteam_cron() {
130
-  // Sync teams from BOINC DB every day to catch BOINC-wide team updates
131
-  $last_sync = variable_get('boincteam_last_sync', 0);
132
-  if ($last_sync < time() - 24*60*60) {
130
+    // Sync teams from BOINC DB every day to catch BOINC-wide team updates
131
+    $last_sync = variable_get('boincteam_last_sync', 0);
132
+    if ($last_sync < time() - 24*60*60) {
133 133
     boincteam_sync();
134 134
     variable_set('boincteam_last_sync', time());
135
-  }
135
+    }
136 136
 }
137 137
 
138 138
 /**
@@ -152,49 +152,49 @@  discard block
 block discarded – undo
152 152
  * assume the role of founder
153 153
  */
154 154
 function boincteam_assume_foundership($team_id) {
155
-  global $user;
156
-  $account = user_load($user->uid);
157
-  $team = node_load($team_id);
158
-  $boincteam_id = boincteam_lookup_id($team_id);
159
-  $boincteam = boincteam_load($boincteam_id);
160
-  $boincuser_id = $account->boincuser_id;
155
+    global $user;
156
+    $account = user_load($user->uid);
157
+    $team = node_load($team_id);
158
+    $boincteam_id = boincteam_lookup_id($team_id);
159
+    $boincteam = boincteam_load($boincteam_id);
160
+    $boincuser_id = $account->boincuser_id;
161 161
   
162
-  if (boincteam_foundership_transfer_ok($boincteam)) {
162
+    if (boincteam_foundership_transfer_ok($boincteam)) {
163 163
     if ($boincuser_id == $boincteam->ping_user) {
164
-      db_set_active('boinc');
165
-      db_query("
164
+        db_set_active('boinc');
165
+        db_query("
166 166
         UPDATE {team}
167 167
         SET userid = '%d', ping_user = '0', ping_time = '0'
168 168
         WHERE id = '%d'",
169 169
         $boincuser_id, $boincteam_id
170
-      );
171
-      db_set_active('default');
172
-      drupal_set_message(t('You are now the founder of @team', array(
170
+        );
171
+        db_set_active('default');
172
+        drupal_set_message(t('You are now the founder of @team', array(
173 173
         '@team' => $team->title
174
-      )));
175
-      watchdog('boincteam', 'User @user assumed foundership of team @nid',
174
+        )));
175
+        watchdog('boincteam', 'User @user assumed foundership of team @nid',
176 176
         array(
177
-          '@current_user' => $account->uid,
178
-          '@nid' => $team_id
177
+            '@current_user' => $account->uid,
178
+            '@nid' => $team_id
179 179
         ), WATCHDOG_NOTICE
180
-      );
180
+        );
181 181
     }
182
-  }
183
-  else {
182
+    }
183
+    else {
184 184
     drupal_set_message(t('You are not allowed to assume foundership of this
185 185
       team.'
186 186
     ));
187
-  }
188
-  drupal_goto("community/teams/{$team_id}");
187
+    }
188
+    drupal_goto("community/teams/{$team_id}");
189 189
 }
190 190
 
191 191
 /**
192 192
  * Delete the team, if empty
193 193
  */
194 194
 function boincteam_delete($team_id) {
195
-  $team = node_load($team_id);
196
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
197
-  if ($boincteam->nusers == 1) {
195
+    $team = node_load($team_id);
196
+    $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
197
+    if ($boincteam->nusers == 1) {
198 198
     require_boinc('team');
199 199
     $boincuser = boincuser_load();
200 200
     user_quit_team($boincuser);
@@ -203,35 +203,35 @@  discard block
 block discarded – undo
203 203
     $team->uid = 0;
204 204
     node_save($team);
205 205
     drupal_set_message(t('@team has been removed.',
206
-      array('@team' => $boincteam->name)));
206
+        array('@team' => $boincteam->name)));
207 207
     drupal_goto('community/teams');
208
-  }
209
-  else {
208
+    }
209
+    else {
210 210
     drupal_set_message(t('All members must be removed from @team before the
211 211
       team can be deleted.', array('@team' => $boincteam->name)), 'error');
212 212
     drupal_goto(strstr($_GET['q'], '/delete', TRUE));
213
-  }
213
+    }
214 214
 }
215 215
 
216 216
 /**
217 217
  * Deny a foundership transfer request
218 218
  */
219 219
 function boincteam_deny_foundership_request($team_id) {
220
-  $boincteam_id = boincteam_lookup_id($team_id);
221
-  // Remove the request from the BOINC database
222
-  db_set_active('boinc');
223
-  db_query("
220
+    $boincteam_id = boincteam_lookup_id($team_id);
221
+    // Remove the request from the BOINC database
222
+    db_set_active('boinc');
223
+    db_query("
224 224
     UPDATE {team}
225 225
     SET ping_user=0
226 226
     WHERE id = '%d'",
227 227
     $boincteam_id
228
-  );
229
-  db_set_active('default');
228
+    );
229
+    db_set_active('default');
230 230
   
231
-  drupal_set_message(t('The transfer request has been denied. No additional
231
+    drupal_set_message(t('The transfer request has been denied. No additional
232 232
     requests will be allowed until 90 days have passed since this request was
233 233
     made.'));
234
-  drupal_goto("community/teams/{$team_id}/edit/founder");
234
+    drupal_goto("community/teams/{$team_id}/edit/founder");
235 235
 }
236 236
   
237 237
 
@@ -239,62 +239,62 @@  discard block
 block discarded – undo
239 239
  * Get the join date of a user
240 240
  */
241 241
 function boincteam_get_member_join_date($boincteam_id, $boincuser_id = NULL) {
242
-  if (!$boincuser_id) {
242
+    if (!$boincuser_id) {
243 243
     global $user;
244 244
     $account = user_load($user->uid);
245 245
     $boincuser_id = $account->boincuser_id;
246
-  }
247
-  db_set_active('boinc');
248
-  $timestamp = db_result(db_query("
246
+    }
247
+    db_set_active('boinc');
248
+    $timestamp = db_result(db_query("
249 249
     SELECT timestamp FROM {team_delta} WHERE
250 250
     userid = %d AND teamid = %d AND joining = 1
251 251
     ORDER BY timestamp DESC LIMIT 1",
252 252
     $boincuser_id, $boincteam_id
253
-  ));
254
-  db_set_active('default');
255
-  return $timestamp;
253
+    ));
254
+    db_set_active('default');
255
+    return $timestamp;
256 256
 }
257 257
 
258 258
 /**
259 259
  * Get the team type for display
260 260
  */
261 261
 function boincteam_get_type($team_id) {
262
-  //$vid = boincteam_get_vocabulary_by_name('Teams'); $team->vid = $vid;
263
-  $team = node_load($team_id);
264
-  $terms = taxonomy_node_get_terms($team);
265
-  if ($terms) {
262
+    //$vid = boincteam_get_vocabulary_by_name('Teams'); $team->vid = $vid;
263
+    $team = node_load($team_id);
264
+    $terms = taxonomy_node_get_terms($team);
265
+    if ($terms) {
266 266
     $term = reset($terms);
267 267
     return $term->name;
268
-  } else {
268
+    } else {
269 269
     return null;
270
-  }
270
+    }
271 271
 }
272 272
 
273 273
 /**
274 274
  * Access a vocabulary of terms by name
275 275
  */ 
276 276
 function boincteam_get_vocabulary_by_name($name) {
277
-  $vocabs = taxonomy_get_vocabularies('team');
278
-  foreach ($vocabs as $vocab) {
277
+    $vocabs = taxonomy_get_vocabularies('team');
278
+    foreach ($vocabs as $vocab) {
279 279
     if ($vocab->name == $name) return $vocab->vid;
280
-  }
281
-  return null;
280
+    }
281
+    return null;
282 282
 }
283 283
 
284 284
 /**
285 285
  * Output the XML of the team history
286 286
  */
287 287
 function boincteam_history_xml($team_id) {
288
-  $team = node_load($team_id);
289
-  $boincteam_id = boincteam_lookup_id($team_id);
290
-  $team_history = array(
288
+    $team = node_load($team_id);
289
+    $boincteam_id = boincteam_lookup_id($team_id);
290
+    $team_history = array(
291 291
     'actions' => array(
292
-      'action' => array(),
292
+        'action' => array(),
293 293
     ),
294
-  );
294
+    );
295 295
   
296
-  db_set_active('boinc');
297
-  $result = db_query("
296
+    db_set_active('boinc');
297
+    $result = db_query("
298 298
     SELECT 
299 299
       td.userid AS id,
300 300
       u.name,
@@ -306,40 +306,40 @@  discard block
 block discarded – undo
306 306
     WHERE td.teamid = %d
307 307
     ORDER BY timestamp ASC",
308 308
     $boincteam_id
309
-  );
310
-  db_set_active('default');
309
+    );
310
+    db_set_active('default');
311 311
   
312
-  while ($record = db_fetch_array($result)) {
312
+    while ($record = db_fetch_array($result)) {
313 313
     $team_history['actions']['action'][] = $record;
314
-  }
314
+    }
315 315
   
316
-  header('Content-type: text/xml');
317
-  echo xml_to_text(array_to_xml($team_history));
316
+    header('Content-type: text/xml');
317
+    echo xml_to_text(array_to_xml($team_history));
318 318
 }
319 319
 
320 320
 /**
321 321
  * Convert a BOINC team ID to a Drupal team ID
322 322
  */
323 323
 function boincteam_lookup_nid($boinc_id) {
324
-  $drupal_id = db_result(db_query("SELECT nid FROM {boincteam} WHERE team_id='%d'", $boinc_id));
325
-  return $drupal_id;
324
+    $drupal_id = db_result(db_query("SELECT nid FROM {boincteam} WHERE team_id='%d'", $boinc_id));
325
+    return $drupal_id;
326 326
 }
327 327
 
328 328
 /**
329 329
  * Convert a Drupal team ID to a BOINC team ID
330 330
  */
331 331
 function boincteam_lookup_id($nid) {
332
-  $boinc_id = db_result(db_query("SELECT team_id FROM {boincteam} WHERE nid = '%d'", $nid));
333
-  return $boinc_id;
332
+    $boinc_id = db_result(db_query("SELECT team_id FROM {boincteam} WHERE nid = '%d'", $nid));
333
+    return $boinc_id;
334 334
 }
335 335
 
336 336
 /**
337 337
  * Get a BOINC team object
338 338
  */
339 339
 function boincteam_load($boincteam_id, $full_object = FALSE) {
340
-  require_boinc(array('team'));
341
-  $team = BoincTeam::lookup_id($boincteam_id);
342
-  if ($team AND $full_object) {
340
+    require_boinc(array('team'));
341
+    $team = BoincTeam::lookup_id($boincteam_id);
342
+    if ($team AND $full_object) {
343 343
     $team->nusers = BoincUser::count("teamid={$team->id}");
344 344
     $team->nusers_worked = BoincUser::count("teamid={$team->id} and total_credit>0");
345 345
     $team->nusers_active = BoincUser::count("teamid={$team->id} and expavg_credit>0.1");
@@ -347,340 +347,340 @@  discard block
 block discarded – undo
347 347
     $team->new_members = new_member_list($boincteam_id);
348 348
     $team->admins = admin_list($boincteam_id);
349 349
     $team->founder = BoincUser::lookup_id($team->userid);
350
-  }
351
-  return $team;
350
+    }
351
+    return $team;
352 352
 }
353 353
 
354 354
 /**
355 355
  * Check if a user is the team founder
356 356
  */
357 357
 function boincteam_is_founder($nid, $uid = NULL) {
358
-  if (!$uid) {
358
+    if (!$uid) {
359 359
     global $user;
360 360
     $uid = $user->uid;
361
-  }
362
-  if (!boincteam_is_member($nid, $uid)) {
361
+    }
362
+    if (!boincteam_is_member($nid, $uid)) {
363 363
     return FALSE;
364
-  }
365
-  $team_id = boincteam_lookup_id($nid);
366
-  require_boinc('team');
367
-  return is_team_founder(boincuser_load($uid, TRUE), boincteam_load($team_id));
364
+    }
365
+    $team_id = boincteam_lookup_id($nid);
366
+    require_boinc('team');
367
+    return is_team_founder(boincuser_load($uid, TRUE), boincteam_load($team_id));
368 368
 }
369 369
 
370 370
 /**
371 371
  * Check if a user is a team admin
372 372
  */
373 373
 function boincteam_is_admin($nid, $uid = NULL) {
374
-  if (!$uid) {
374
+    if (!$uid) {
375 375
     global $user;
376 376
     $uid = $user->uid;
377
-  }
378
-  if (!boincteam_is_member($nid, $uid)) {
377
+    }
378
+    if (!boincteam_is_member($nid, $uid)) {
379 379
     return FALSE;
380
-  }
381
-  $team_id = boincteam_lookup_id($nid);
382
-  require_boinc('team');
383
-  return is_team_admin(boincuser_load($uid, TRUE), boincteam_load($team_id));
380
+    }
381
+    $team_id = boincteam_lookup_id($nid);
382
+    require_boinc('team');
383
+    return is_team_admin(boincuser_load($uid, TRUE), boincteam_load($team_id));
384 384
 }
385 385
 
386 386
 /**
387 387
  * Check if a user is a team member
388 388
  */
389 389
 function boincteam_is_member($nid, $uid = NULL) {
390
-  if (!$uid) {
390
+    if (!$uid) {
391 391
     global $user;
392 392
     $uid = $user->uid;
393
-  }
394
-  $account = user_load($uid);
395
-  return ($account->team == $nid);
393
+    }
394
+    $account = user_load($uid);
395
+    return ($account->team == $nid);
396 396
 }
397 397
 
398 398
 /**
399 399
  * Display any persistent team messages
400 400
  */
401 401
 function boincteam_show_messages() {
402
-  global $user;
403
-  $uid = $user->uid;
404
-  $account = user_load($uid);
405
-  if ($account->team) {
402
+    global $user;
403
+    $uid = $user->uid;
404
+    $account = user_load($uid);
405
+    if ($account->team) {
406 406
     if (boincteam_is_founder($account->team, $account->uid)) {
407
-      // Set a notice of any pending foundership requests
408
-      $boincteam_id = boincteam_lookup_id($account->team);
409
-      $boincteam = boincteam_load($boincteam_id);
410
-      if ($boincteam->ping_user > 0) {
407
+        // Set a notice of any pending foundership requests
408
+        $boincteam_id = boincteam_lookup_id($account->team);
409
+        $boincteam = boincteam_load($boincteam_id);
410
+        if ($boincteam->ping_user > 0) {
411 411
         $foundership_url = "community/teams/{$account->team}/edit/founder";
412 412
         if (substr($_GET['q'], 0, strlen($foundership_url)) != $foundership_url) {
413
-          drupal_set_message(
413
+            drupal_set_message(
414 414
             bts(
415
-              'A foundership transfer request has been made for your team. Please !respond.',
416
-              array('!respond' => l(bts('respond to the request'), $foundership_url))
415
+                'A foundership transfer request has been made for your team. Please !respond.',
416
+                array('!respond' => l(bts('respond to the request'), $foundership_url))
417 417
             ),
418 418
             'warning', FALSE
419
-          );
419
+            );
420
+        }
420 421
         }
421
-      }
422 422
     }
423
-  }
423
+    }
424 424
 }
425 425
 
426 426
 /**
427 427
  * Add a user to a team
428 428
  */
429 429
 function boincteam_join($team_id) {
430
-  global $user;
431
-  $account = user_load($user->uid);
430
+    global $user;
431
+    $account = user_load($user->uid);
432 432
   
433
-  $boincteam_id = boincteam_lookup_id($team_id);
434
-  $boincteam = boincteam_load($boincteam_id);
435
-  if ($boincteam->joinable AND $account->team != $team_id) {
433
+    $boincteam_id = boincteam_lookup_id($team_id);
434
+    $boincteam = boincteam_load($boincteam_id);
435
+    if ($boincteam->joinable AND $account->team != $team_id) {
436 436
     require_boinc('team');
437 437
     $boincuser = boincuser_load();
438 438
     if (user_join_team($boincteam, $boincuser)) {
439
-      drupal_set_message(t('You are now a member of @team!',
439
+        drupal_set_message(t('You are now a member of @team!',
440 440
         array('@team' => $boincteam->name)));
441
-      watchdog('boincteam', 'added user @uid to team @nid',
441
+        watchdog('boincteam', 'added user @uid to team @nid',
442 442
         array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
443 443
     }
444 444
     else {
445
-      drupal_set_message(t('There was a problem joining @team, please try again
445
+        drupal_set_message(t('There was a problem joining @team, please try again
446 446
         later', array('@team' => $boincteam->name)));
447
-      watchdog('boincteam', 'error adding user @uid to team @nid',
447
+        watchdog('boincteam', 'error adding user @uid to team @nid',
448 448
         array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_ERROR);
449 449
     }
450
-  }
451
-  drupal_goto("community/teams/{$team_id}");
450
+    }
451
+    drupal_goto("community/teams/{$team_id}");
452 452
 }
453 453
 
454 454
 /**
455 455
  * Leave a team
456 456
  */
457 457
 function boincteam_leave($team_id) {
458
-  global $user;
459
-  $account = user_load($user->uid);
458
+    global $user;
459
+    $account = user_load($user->uid);
460 460
   
461
-  $boincteam_id = boincteam_lookup_id($team_id);
462
-  $boincteam = boincteam_load($boincteam_id);
463
-  if ($account->team == $team_id) {
461
+    $boincteam_id = boincteam_lookup_id($team_id);
462
+    $boincteam = boincteam_load($boincteam_id);
463
+    if ($account->team == $team_id) {
464 464
     require_boinc('team');
465 465
     $boincuser = boincuser_load();
466 466
     user_quit_team($boincuser);
467 467
     drupal_set_message(t('You are no longer a member of @team.',
468
-      array('@team' => $boincteam->name)));
468
+        array('@team' => $boincteam->name)));
469 469
     watchdog('boincteam', 'removed user @uid from team @nid',
470
-      array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
471
-  }
472
-  else {
473
-      drupal_set_message(t('You are not a member of @team, so you cannot revoke
470
+        array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
471
+    }
472
+    else {
473
+        drupal_set_message(t('You are not a member of @team, so you cannot revoke
474 474
         your membership to it.', array('@team' => $boincteam->name)));
475
-  }
476
-  drupal_goto("community/teams/{$team_id}");
475
+    }
476
+    drupal_goto("community/teams/{$team_id}");
477 477
 }
478 478
 
479 479
 /**
480 480
  * Output a plain text list of member email addresses
481 481
  */
482 482
 function boincteam_members_email_list($team_id) {
483
-  $team = node_load($team_id);
484
-  $boincteam_id = boincteam_lookup_id($team_id);
485
-  $output = '';
483
+    $team = node_load($team_id);
484
+    $boincteam_id = boincteam_lookup_id($team_id);
485
+    $output = '';
486 486
   
487
-  db_set_active('boinc');
488
-  $result = db_query("
487
+    db_set_active('boinc');
488
+    $result = db_query("
489 489
     SELECT 
490 490
       u.name, u.email_addr
491 491
     FROM {user} u
492 492
     WHERE u.teamid = %d
493 493
     ORDER BY u.email_addr ASC",
494 494
     $boincteam_id
495
-  );
496
-  db_set_active('default');
495
+    );
496
+    db_set_active('default');
497 497
   
498
-  while ($member = db_fetch_object($result)) {
498
+    while ($member = db_fetch_object($result)) {
499 499
     $output .= "{$member->name} <{$member->email_addr}>\n";
500
-  }
500
+    }
501 501
   
502
-  header('Content-type: text/plain');
503
-  print $output;
502
+    header('Content-type: text/plain');
503
+    print $output;
504 504
 }
505 505
 
506 506
 /**
507 507
  * Remove team admin status from a user
508 508
  */
509 509
 function boincteam_remove_admin($team_id, $user_id) {
510
-  global $user;
511
-  $account = user_load($user_id);
512
-  $team = node_load($team_id);
513
-  $boincteam_id = boincteam_lookup_id($team_id);
514
-  $boincuser_id = $account->boincuser_id;
510
+    global $user;
511
+    $account = user_load($user_id);
512
+    $team = node_load($team_id);
513
+    $boincteam_id = boincteam_lookup_id($team_id);
514
+    $boincuser_id = $account->boincuser_id;
515 515
   
516
-  if (boincteam_is_admin($team_id, $account->uid)) {
516
+    if (boincteam_is_admin($team_id, $account->uid)) {
517 517
     // Update the team in the BOINC db
518 518
     db_set_active('boinc');
519 519
     db_query("
520 520
       DELETE FROM {team_admin} WHERE
521 521
         teamid = '%d' AND userid = '%d'",
522
-      $boincteam_id,
523
-      $boincuser_id
522
+        $boincteam_id,
523
+        $boincuser_id
524 524
     );
525 525
     db_set_active('default');
526 526
     drupal_set_message(t('@user is no longer an admin of @team.',
527
-      array(
527
+        array(
528 528
         '@user' => $account->boincuser_name,
529 529
         '@team' => $team->title
530
-      )
530
+        )
531 531
     ));
532 532
     watchdog('boincteam', 'User @current_user removed admin status for user
533 533
       @uid from team @nid',
534
-      array(
534
+        array(
535 535
         '@current_user' => $user->uid,
536 536
         '@uid' => $account->uid, 
537 537
         '@nid' => $team_id
538
-      ), WATCHDOG_NOTICE);
539
-  }
540
-  drupal_goto("community/teams/{$team_id}/edit/admins");
538
+        ), WATCHDOG_NOTICE);
539
+    }
540
+    drupal_goto("community/teams/{$team_id}/edit/admins");
541 541
 }
542 542
 
543 543
 /**
544 544
  * Remove a user from a team
545 545
  */
546 546
 function boincteam_remove_member($team_id, $user_id) {
547
-  global $user;
548
-  $account = user_load($user_id);
547
+    global $user;
548
+    $account = user_load($user_id);
549 549
   
550
-  $boincteam_id = boincteam_lookup_id($team_id);
551
-  $boincteam = boincteam_load($boincteam_id);
552
-  if ($account->team == $team_id) {
550
+    $boincteam_id = boincteam_lookup_id($team_id);
551
+    $boincteam = boincteam_load($boincteam_id);
552
+    if ($account->team == $team_id) {
553 553
     require_boinc('team');
554 554
     $boincuser = boincuser_load($user_id, TRUE);
555 555
     user_quit_team($boincuser);
556 556
     drupal_set_message(t('@user has been removed from @team.',
557
-      array(
557
+        array(
558 558
         '@user' => $account->boincuser_name,
559 559
         '@team' => $boincteam->name
560
-      )
560
+        )
561 561
     ));
562 562
     watchdog('boincteam', 'User @current_user removed user @uid from team @nid',
563
-      array(
563
+        array(
564 564
         '@current_user' => $user->uid,
565 565
         '@uid' => $account->uid, 
566 566
         '@nid' => $team_id
567
-      ), WATCHDOG_NOTICE);
568
-  }
569
-  else {
570
-      drupal_set_message(t('@user is not a member of @team, so you cannot
567
+        ), WATCHDOG_NOTICE);
568
+    }
569
+    else {
570
+        drupal_set_message(t('@user is not a member of @team, so you cannot
571 571
         revoke the membership.', array(
572
-          '@user' => $account->boincuser_name,
573
-          '@team' => $boincteam->name
572
+            '@user' => $account->boincuser_name,
573
+            '@team' => $boincteam->name
574 574
         )
575
-      ));
576
-  }
577
-  drupal_goto("community/teams/{$team_id}/edit/members");
575
+        ));
576
+    }
577
+    drupal_goto("community/teams/{$team_id}/edit/members");
578 578
 }
579 579
 
580 580
 /**
581 581
  * Request a foundership transfer
582 582
  */
583 583
 function boincteam_request_foundership($team_id) {
584
-  global $user;
585
-  $account = user_load($user->uid);
586
-  $team = node_load($team_id);
587
-  $boincteam_id = boincteam_lookup_id($team_id);
588
-  $boincteam = boincteam_load($boincteam_id);
589
-  $boincuser_id = $account->boincuser_id;
584
+    global $user;
585
+    $account = user_load($user->uid);
586
+    $team = node_load($team_id);
587
+    $boincteam_id = boincteam_lookup_id($team_id);
588
+    $boincteam = boincteam_load($boincteam_id);
589
+    $boincuser_id = $account->boincuser_id;
590 590
   
591
-  if (boincteam_is_founder($team_id, $account->uid)) {
591
+    if (boincteam_is_founder($team_id, $account->uid)) {
592 592
     // Shouldn't even be here...
593 593
     drupal_set_message(t('@user is already the team founder.',
594
-      array(
594
+        array(
595 595
         '@user' => $account->boincuser_name
596
-      )
596
+        )
597 597
     ), 'warning');
598
-  }
599
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
598
+    }
599
+    elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
600 600
     // It hasn't been long enough since the last transfer request
601 601
     drupal_set_message(t('A foundership change was requested during the last 90
602 602
       days, so new requests are not allowed. Please try again later.'
603 603
     ), 'warning');
604
-  }
605
-  elseif (boincteam_is_member($team_id, $account->uid)) {
604
+    }
605
+    elseif (boincteam_is_member($team_id, $account->uid)) {
606 606
     // Log the transfer request
607 607
     db_set_active('boinc');
608 608
     db_query("
609 609
       UPDATE {team}
610 610
       SET ping_user = '%d', ping_time='%d'
611 611
       WHERE id = '%d'",
612
-      $boincuser_id, time(), $boincteam_id
612
+        $boincuser_id, time(), $boincteam_id
613 613
     );
614 614
     db_set_active('default');
615 615
     drupal_set_message(t('You have requested foundership of @team. The current
616 616
       founder has 60 days to respond to this request.',
617
-      array(
617
+        array(
618 618
         '@team' => $team->title
619
-      )
619
+        )
620 620
     ));
621 621
     watchdog('boincteam', 'User @user requested foundership of team @nid',
622
-      array(
622
+        array(
623 623
         '@current_user' => $account->uid,
624 624
         '@nid' => $team_id
625
-      ), WATCHDOG_NOTICE);
626
-  }
627
-  drupal_goto("community/teams/{$team_id}");
625
+        ), WATCHDOG_NOTICE);
626
+    }
627
+    drupal_goto("community/teams/{$team_id}");
628 628
 }
629 629
 
630 630
 /**
631 631
  * Transfer foundership to another team member
632 632
  */
633 633
 function boincteam_set_founder($team_id, $user_id) {
634
-  global $user;
635
-  $account = user_load($user_id);
636
-  $team = node_load($team_id);
637
-  $boincteam_id = boincteam_lookup_id($team_id);
638
-  $boincuser_id = $account->boincuser_id;
634
+    global $user;
635
+    $account = user_load($user_id);
636
+    $team = node_load($team_id);
637
+    $boincteam_id = boincteam_lookup_id($team_id);
638
+    $boincuser_id = $account->boincuser_id;
639 639
   
640
-  if (boincteam_is_member($team_id, $account->uid)) {
640
+    if (boincteam_is_member($team_id, $account->uid)) {
641 641
     // Update the team in the BOINC db
642 642
     db_set_active('boinc');
643 643
     db_query("
644 644
       UPDATE {team}
645 645
       SET userid = '%d', ping_user=0
646 646
       WHERE id = '%d'",
647
-      $boincuser_id, $boincteam_id
647
+        $boincuser_id, $boincteam_id
648 648
     );
649 649
     db_set_active('default');
650 650
     drupal_set_message(t('Foundership of @team has been transfered to @user.',
651
-      array(
651
+        array(
652 652
         '@user' => $account->boincuser_name,
653 653
         '@team' => $team->title
654
-      )
654
+        )
655 655
     ));
656 656
     watchdog('boincteam', 'User @current_user transferred foundership of team
657 657
       @nid to user @uid',
658
-      array(
658
+        array(
659 659
         '@current_user' => $user->uid,
660 660
         '@uid' => $account->uid, 
661 661
         '@nid' => $team_id
662
-      ), WATCHDOG_NOTICE);
663
-  }
664
-  drupal_goto("community/teams/{$team_id}");
662
+        ), WATCHDOG_NOTICE);
663
+    }
664
+    drupal_goto("community/teams/{$team_id}");
665 665
 }
666 666
 
667 667
 /**
668 668
  * See if a new foundership transfer request is allowed
669 669
  */
670 670
 function boincteam_new_foundership_transfer_request_ok($team_id) {
671
-  $boincteam_id = boincteam_lookup_id($team_id);
672
-  $boincteam = boincteam_load($boincteam_id);
673
-  $now = time();
674
-  if ($boincteam->ping_user <= 0) {
671
+    $boincteam_id = boincteam_lookup_id($team_id);
672
+    $boincteam = boincteam_load($boincteam_id);
673
+    $now = time();
674
+    if ($boincteam->ping_user <= 0) {
675 675
     if ($boincteam->ping_time < $now - 60 * (24*60*60)) {
676
-      return TRUE;
676
+        return TRUE;
677 677
     }
678 678
     return FALSE;
679
-  }
680
-  if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
679
+    }
680
+    if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
681 681
     return TRUE;
682
-  }
683
-  return FALSE;
682
+    }
683
+    return FALSE;
684 684
 }
685 685
 
686 686
 /** 
@@ -702,18 +702,18 @@  discard block
 block discarded – undo
702 702
  * Check if a user has an active foundership request with a team
703 703
  */
704 704
 function boincteam_user_requested_foundership($team_id, $user_id = NULL) {
705
-  if (!$user_id) {
705
+    if (!$user_id) {
706 706
     global $user;
707 707
     $user_id = $user->uid;
708
-  }
709
-  $account = user_load($user_id);
710
-  $boincteam_id = boincteam_lookup_id($team_id);
711
-  $boincteam = boincteam_load($boincteam_id);
708
+    }
709
+    $account = user_load($user_id);
710
+    $boincteam_id = boincteam_lookup_id($team_id);
711
+    $boincteam = boincteam_load($boincteam_id);
712 712
   
713
-  if ($boincteam->ping_user == $account->boincuser_id) {
713
+    if ($boincteam->ping_user == $account->boincuser_id) {
714 714
     // Be sure the request is still active
715 715
     return !boincteam_new_foundership_transfer_request_ok($team_id);
716
-  }
716
+    }
717 717
 }
718 718
 
719 719
 
@@ -725,124 +725,124 @@  discard block
 block discarded – undo
725 725
  * General info about team admins
726 726
  */                                         
727 727
 function boincteam_about_admins_panel() {
728
-  $output = '';
729
-  $output .= '<h2 class="pane-title">' . bts('About team admins') . '</h2>';
730
-  $output .= '<div>';
731
-  $output .= '<p>' . bts('Team admins can:') . '</p>';
732
-  $output .= '<ul>';
733
-  $output .= '  <li>' . bts('Edit team information') . '</li>';
734
-  $output .= '  <li>' . bts("View the team's join / quit history") . '</li>';
735
-  $output .= '  <li>' . bts('Moderate the team forum') . '</li>';
736
-  $output .= '  <li>' . bts('Remove members from the team') . '</li>';
737
-  $output .= '  <li>' . bts('Disband a team if it has no members') . '</li>';
738
-  $output .= '</ul>';
739
-  $output .= '</div>';
740
-  $output .= '<div>';
741
-  $output .= '<p>' . bts('Team admins cannot:') . '</p>';
742
-  $output .= '<ul>';
743
-  $output .= '  <li>' . bts('Change the team founder') . '</li>';
744
-  $output .= '  <li>' . bts('Remove members') . '</li>';
745
-  $output .= '  <li>' . bts('Add / Remove team admins') . '</li>';
746
-  $output .= '</ul>';
747
-  $output .= '</div>';
748
-  $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
728
+    $output = '';
729
+    $output .= '<h2 class="pane-title">' . bts('About team admins') . '</h2>';
730
+    $output .= '<div>';
731
+    $output .= '<p>' . bts('Team admins can:') . '</p>';
732
+    $output .= '<ul>';
733
+    $output .= '  <li>' . bts('Edit team information') . '</li>';
734
+    $output .= '  <li>' . bts("View the team's join / quit history") . '</li>';
735
+    $output .= '  <li>' . bts('Moderate the team forum') . '</li>';
736
+    $output .= '  <li>' . bts('Remove members from the team') . '</li>';
737
+    $output .= '  <li>' . bts('Disband a team if it has no members') . '</li>';
738
+    $output .= '</ul>';
739
+    $output .= '</div>';
740
+    $output .= '<div>';
741
+    $output .= '<p>' . bts('Team admins cannot:') . '</p>';
742
+    $output .= '<ul>';
743
+    $output .= '  <li>' . bts('Change the team founder') . '</li>';
744
+    $output .= '  <li>' . bts('Remove members') . '</li>';
745
+    $output .= '  <li>' . bts('Add / Remove team admins') . '</li>';
746
+    $output .= '</ul>';
747
+    $output .= '</div>';
748
+    $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
749 749
     . ' team admin. We recommend only selecting people you know and trust')
750 750
     . '</p>';
751
-  return $output;
751
+    return $output;
752 752
 }
753 753
 
754 754
 /**
755 755
  * General info about changing the team founder
756 756
  */                                         
757 757
 function boincteam_about_founder_panel() {
758
-  $output = '';
759
-  $output .= '<h2 class="pane-title">' . bts('Changing the team founder')
758
+    $output = '';
759
+    $output .= '<h2 class="pane-title">' . bts('Changing the team founder')
760 760
     . '</h2>';
761
-  $output .= '<div>';
762
-  $output .= '<p>' . bts('Notes about changes in foundership:') . '</p>';
763
-  $output .= '<ul>';
764
-  $output .= '  <li>' . bts('Any member of the team is eligible') . '</li>';
765
-  $output .= '  <li>' . bts('Current founder becomes a normal user') . '</li>';
766
-  $output .= '</ul>';
767
-  $output .= '</div>';
768
-  $output .= '<div>';
769
-  $output .= '<p>' . bts('Foundership can be requested by team members:')
761
+    $output .= '<div>';
762
+    $output .= '<p>' . bts('Notes about changes in foundership:') . '</p>';
763
+    $output .= '<ul>';
764
+    $output .= '  <li>' . bts('Any member of the team is eligible') . '</li>';
765
+    $output .= '  <li>' . bts('Current founder becomes a normal user') . '</li>';
766
+    $output .= '</ul>';
767
+    $output .= '</div>';
768
+    $output .= '<div>';
769
+    $output .= '<p>' . bts('Foundership can be requested by team members:')
770 770
     . '</p>';
771
-  $output .= '<ul>';
772
-  $output .= '  <li>' . bts('One request is allowed at a time') . '</li>';
773
-  $output .= '  <li>' . bts('It must be 60 days since any previous request')
771
+    $output .= '<ul>';
772
+    $output .= '  <li>' . bts('One request is allowed at a time') . '</li>';
773
+    $output .= '  <li>' . bts('It must be 60 days since any previous request')
774 774
     . '</li>';
775
-  $output .= '  <li>' . bts('Any active request must be older than 90 days')
775
+    $output .= '  <li>' . bts('Any active request must be older than 90 days')
776 776
     . '</li>';
777
-  $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
777
+    $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
778 778
     . ' request') . '</li>';
779
-  $output .= '</ul>';
780
-  $output .= '</div>';
781
-  return $output;
779
+    $output .= '</ul>';
780
+    $output .= '</div>';
781
+    return $output;
782 782
 }
783 783
 
784 784
 /**
785 785
  * Link to create a new team
786 786
  */
787 787
 function boincteam_create_team_link_panel() {
788
-  global $user;
789
-  $account = user_load($user->uid);
790
-  $unrestricted_role = array_search('verified contributor', user_roles(true));
791
-  $output = '';
792
-  $output .= '<h2 class="pane-title">' . bts('Create a new team') . '</h2>';
793
-  $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
788
+    global $user;
789
+    $account = user_load($user->uid);
790
+    $unrestricted_role = array_search('verified contributor', user_roles(true));
791
+    $output = '';
792
+    $output .= '<h2 class="pane-title">' . bts('Create a new team') . '</h2>';
793
+    $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
794 794
     . ' can create a team.') . '</p>';
795
-  $output .= '<ul class="tab-list">';
796
-  $output .= '  <li class="first last tab">';
797
-  if (isset($account->roles[$unrestricted_role])) {
795
+    $output .= '<ul class="tab-list">';
796
+    $output .= '  <li class="first last tab">';
797
+    if (isset($account->roles[$unrestricted_role])) {
798 798
     $output .= l(bts('Create new team'), 'community/teams/add');
799
-  } elseif ($account->uid <= 0) {
799
+    } elseif ($account->uid <= 0) {
800 800
     $output .= l(
801
-      bts('Login to create a new team'),
802
-      'user/login',
803
-      array('query' => drupal_get_destination())
801
+        bts('Login to create a new team'),
802
+        'user/login',
803
+        array('query' => drupal_get_destination())
804 804
     );
805
-  } else {
805
+    } else {
806 806
     $min_credit_needed = variable_get('boinc_comment_min_credit', 0);
807 807
     $credit_needed = $min_credit_needed - $account->boincuser_total_credit;
808 808
     $output .= '[';
809 809
     if ($credit_needed == 1) {
810
-      $output .= bts('You must earn 1 more credit!');
810
+        $output .= bts('You must earn 1 more credit!');
811 811
     }
812 812
     else {
813
-      $output .= bts('You must earn @count more credits!',
813
+        $output .= bts('You must earn @count more credits!',
814 814
         array('@count' => $credit_needed)
815
-      );
815
+        );
816 816
     }
817 817
     $output .= ']';
818
-  }
819
-  $output .= '  </li>';
820
-  $output .= '</ul>';
821
-  return $output;
818
+    }
819
+    $output .= '  </li>';
820
+    $output .= '</ul>';
821
+    return $output;
822 822
 }
823 823
 
824 824
 /**
825 825
  * Create team form
826 826
  */
827 827
 function boincteam_create_team_panel() {
828
-  $output = '';
829
-  $output .= '<h2 class="pane-title">' . bts('Create a team') . '</h2>';
830
-  $output .= drupal_get_form('boincteam_create_form');
828
+    $output = '';
829
+    $output .= '<h2 class="pane-title">' . bts('Create a team') . '</h2>';
830
+    $output .= drupal_get_form('boincteam_create_form');
831 831
   
832
-  return $output;
832
+    return $output;
833 833
 }
834 834
 
835 835
 /**
836 836
  * Link to user's team
837 837
  */
838 838
 function boincteam_dashboard_panel($uid = NULL) {
839
-  if (!$uid) {
839
+    if (!$uid) {
840 840
     global $user;
841 841
     $uid = $user->uid;
842
-  }
843
-  $output = '';
844
-  $account = user_load($uid);
845
-  if ($account->team) {
842
+    }
843
+    $output = '';
844
+    $account = user_load($uid);
845
+    if ($account->team) {
846 846
     $team = boincteam_load(boincteam_lookup_id($account->team));
847 847
     $output .= '<h2 class="pane-title">' . bts('Team') . '</h2>';
848 848
     $output .= '<div class="stats">';
@@ -861,244 +861,244 @@  discard block
 block discarded – undo
861 861
     $output .= '  <label>' . bts('Total credit') . ': </label>';
862 862
     $output .= '  <span>' . number_format($team->total_credit, 2) . '</span>';
863 863
     $output .= '</div>' . "\n";
864
-  }
865
-  return $output;
864
+    }
865
+    return $output;
866 866
 }
867 867
 
868 868
 /**
869 869
  * Edit team form
870 870
  */
871 871
 function boincteam_edit_team_panel($team_id) {
872
-  $team = node_load($team_id);
873
-  $output = '';
874
-  $output .= '<h2 class="pane-title">' . $team->title . '</h2>';
875
-  $output .= drupal_get_form('boincteam_edit_form', $team_id);
872
+    $team = node_load($team_id);
873
+    $output = '';
874
+    $output .= '<h2 class="pane-title">' . $team->title . '</h2>';
875
+    $output .= drupal_get_form('boincteam_edit_form', $team_id);
876 876
   
877
-  return $output;
877
+    return $output;
878 878
 }
879 879
 
880 880
 /**
881 881
  * Link to join a team
882 882
  */
883 883
 function boincteam_join_team_panel($team_id) {
884
-  $team = node_load($team_id);
885
-  $output = '';
886
-  $output .= '<h2 class="pane-title">' . bts('Join team') . '</h2>';
887
-  $output .= '<p>' . bts('Click here to become a member of @this_team',
884
+    $team = node_load($team_id);
885
+    $output = '';
886
+    $output .= '<h2 class="pane-title">' . bts('Join team') . '</h2>';
887
+    $output .= '<p>' . bts('Click here to become a member of @this_team',
888 888
     array('@this_team' =>$team->title)) . '</p>';
889
-  $output .= '<ul class="tab-list">';
890
-  $output .= '  <li class="first last tab">' . 
889
+    $output .= '<ul class="tab-list">';
890
+    $output .= '  <li class="first last tab">' . 
891 891
     l(bts('Join this team'), "community/teams/{$team_id}/join") . '</li>';
892
-  $output .= '</ul>';
893
-  return $output;
892
+    $output .= '</ul>';
893
+    return $output;
894 894
 }
895 895
 
896 896
 /**
897 897
  * Link to leave a team
898 898
  */
899 899
 function boincteam_leave_team_panel($team_id) {
900
-  $team = node_load($team_id);
901
-  $output = '';
902
-  $output .= '<h2 class="pane-title">' . bts('Leave team') . '</h2>';
903
-  $output .= '<p>' . bts('Click here to revoke your membership with'
900
+    $team = node_load($team_id);
901
+    $output = '';
902
+    $output .= '<h2 class="pane-title">' . bts('Leave team') . '</h2>';
903
+    $output .= '<p>' . bts('Click here to revoke your membership with'
904 904
     . ' @this_team', array('@this_team' =>$team->title)) . '</p>';
905
-  $output .= '<ul class="tab-list">';
906
-  $output .= '  <li class="first last tab">' . 
905
+    $output .= '<ul class="tab-list">';
906
+    $output .= '  <li class="first last tab">' . 
907 907
     l(bts('Leave this team'), "community/teams/{$team_id}/leave") . '</li>';
908
-  $output .= '</ul>';
909
-  return $output;
908
+    $output .= '</ul>';
909
+    return $output;
910 910
 }
911 911
 
912 912
 /**
913 913
  * General info about team admins
914 914
  */                                         
915 915
 function boincteam_manage_admins_panel_header($team_id) {
916
-  $output = '';
917
-  $output .= '<h4>' . bts('Add team admin') . '</h4>';
918
-  $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
919
-  $output .= '<div class="clearfix"></div>';
920
-  $output .= '<h4>' . bts('Current team admins') . '</h4>';
916
+    $output = '';
917
+    $output .= '<h4>' . bts('Add team admin') . '</h4>';
918
+    $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
919
+    $output .= '<div class="clearfix"></div>';
920
+    $output .= '<h4>' . bts('Current team admins') . '</h4>';
921 921
   
922
-  return $output;
922
+    return $output;
923 923
 }
924 924
 
925 925
 /**
926 926
  * Team management tools
927 927
  */
928 928
 function boincteam_management_panel($team_id) {
929
-  $is_founder = boincteam_is_founder($team_id);
930
-  $team = node_load($team_id);
931
-  $output = '';
932
-  $output .= '<h2 class="pane-title">' . bts('Manage team') . '</h2>';
929
+    $is_founder = boincteam_is_founder($team_id);
930
+    $team = node_load($team_id);
931
+    $output = '';
932
+    $output .= '<h2 class="pane-title">' . bts('Manage team') . '</h2>';
933 933
   
934
-  // Member list
935
-  $output .= '<div class="form-item">';
936
-  $output .= '  <label>' . bts('View member list') . '</label>';
937
-  $output .= '  <ul class="tab-list">';
938
-  $output .= '    <li class="first tab primary">' . 
934
+    // Member list
935
+    $output .= '<div class="form-item">';
936
+    $output .= '  <label>' . bts('View member list') . '</label>';
937
+    $output .= '  <ul class="tab-list">';
938
+    $output .= '    <li class="first tab primary">' . 
939 939
     l('HTML', "community/teams/{$team_id}/members") . '</li>';
940
-  $output .= '    <li class="last tab primary">' .
940
+    $output .= '    <li class="last tab primary">' .
941 941
     l('text', "community/teams/{$team_id}/members/email") . '</li>';
942
-  $output .= '  </ul>';
943
-  $output .= '  <div class="description">';
944
-  $output .=   bts('Member names and emails');
945
-  $output .= '  </div>';
946
-  $output .= '</div>'; 
942
+    $output .= '  </ul>';
943
+    $output .= '  <div class="description">';
944
+    $output .=   bts('Member names and emails');
945
+    $output .= '  </div>';
946
+    $output .= '</div>'; 
947 947
   
948
-  // Team history
949
-  $output .= '<div class="form-item">';
950
-  $output .= '  <label>' . bts('View change history') . '</label>';
951
-  $output .= '  <ul class="tab-list">';
952
-  $output .= '    <li class="first tab primary">' . 
948
+    // Team history
949
+    $output .= '<div class="form-item">';
950
+    $output .= '  <label>' . bts('View change history') . '</label>';
951
+    $output .= '  <ul class="tab-list">';
952
+    $output .= '    <li class="first tab primary">' . 
953 953
     l('HTML', "community/teams/{$team_id}/history") . '</li>';
954
-  $output .= '    <li class="last tab primary">' .
954
+    $output .= '    <li class="last tab primary">' .
955 955
     l('XML', "community/teams/{$team_id}/history/xml") . '</li>';
956
-  $output .= '  </ul>';
957
-  $output .= '  <div class="description">';
958
-  $output .=   bts('See member activity');
959
-  $output .= '  </div>';
960
-  $output .= '</div>';
956
+    $output .= '  </ul>';
957
+    $output .= '  <div class="description">';
958
+    $output .=   bts('See member activity');
959
+    $output .= '  </div>';
960
+    $output .= '</div>';
961 961
   
962
-  // Team forum
963
-  if (module_exists('boincteam_forum')) {
962
+    // Team forum
963
+    if (module_exists('boincteam_forum')) {
964 964
     if ($is_founder) {
965
-      // Determine whether to create a forum or edit the existing forum
966
-      // (multiple forums per team could be supported in the future)
967
-      $team_forum_link_path = 'add';
968
-      $team_forums = boincteam_forum_list();
969
-      if ($team_forums) {
965
+        // Determine whether to create a forum or edit the existing forum
966
+        // (multiple forums per team could be supported in the future)
967
+        $team_forum_link_path = 'add';
968
+        $team_forums = boincteam_forum_list();
969
+        if ($team_forums) {
970 970
         $team_forum = reset($team_forums);
971 971
         $team_forum_link_path = "{$team_forum->tfid}/edit";
972
-      }
973
-      $output .= '<div class="form-item">';
974
-      $output .= '  <ul class="tab-list action-list">';
975
-      $output .= '    <li class="first tab primary">' .   
972
+        }
973
+        $output .= '<div class="form-item">';
974
+        $output .= '  <ul class="tab-list action-list">';
975
+        $output .= '    <li class="first tab primary">' .   
976 976
         l(bts('Manage team message board'),
977
-          "community/teams/{$team_id}/forum/{$team_forum_link_path}"
977
+            "community/teams/{$team_id}/forum/{$team_forum_link_path}"
978 978
         );
979
-      $output .= '    </li>';
980
-      $output .= '  <div class="description">';
981
-      $output .=   bts('Create or manage message board');
982
-      $output .= '  </div>';
983
-      $output .= '</div>';
979
+        $output .= '    </li>';
980
+        $output .= '  <div class="description">';
981
+        $output .=   bts('Create or manage message board');
982
+        $output .= '  </div>';
983
+        $output .= '</div>';
984
+    }
984 985
     }
985
-  }
986 986
   
987
-  // Remove members
988
-  $output .= '<div class="form-item">';
989
-  $output .= '  <ul class="tab-list action-list">';
990
-  $output .= '    <li class="first tab primary">' . 
987
+    // Remove members
988
+    $output .= '<div class="form-item">';
989
+    $output .= '  <ul class="tab-list action-list">';
990
+    $output .= '    <li class="first tab primary">' . 
991 991
     l(bts('Remove members'), "community/teams/{$team_id}/edit/members") . '</li>';
992 992
   
993
-  if ($is_founder) {
993
+    if ($is_founder) {
994 994
     
995 995
     // Change founder
996 996
     $output .= '    <li class="tab primary">' . 
997
-      l(bts('Change founder'), "community/teams/{$team_id}/edit/founder") . '</li>';
997
+        l(bts('Change founder'), "community/teams/{$team_id}/edit/founder") . '</li>';
998 998
       
999
-      // Manage admins
999
+        // Manage admins
1000 1000
     $output .= '    <li class="tab primary">' . 
1001
-      l(bts('Manage team admins'), "community/teams/{$team_id}/edit/admins") . '</li>';
1002
-  }
1001
+        l(bts('Manage team admins'), "community/teams/{$team_id}/edit/admins") . '</li>';
1002
+    }
1003 1003
   
1004
-  // Edit team information
1005
-  $output .= '    <li class="tab primary">' . 
1004
+    // Edit team information
1005
+    $output .= '    <li class="tab primary">' . 
1006 1006
     l(bts('Edit team info'), "community/teams/{$team_id}/edit/info") . '</li>';
1007 1007
     
1008
-  if ($is_founder) {
1008
+    if ($is_founder) {
1009 1009
     
1010 1010
     // Delete the team
1011 1011
     $output .= '    <li class="last tab primary">' . 
1012
-      l(bts('Remove team'), "community/teams/{$team_id}/delete") . '</li>';
1013
-  }
1012
+        l(bts('Remove team'), "community/teams/{$team_id}/delete") . '</li>';
1013
+    }
1014 1014
   
1015
-  $output .= '  </ul>';
1016
-  $output .= '</div>';
1015
+    $output .= '  </ul>';
1016
+    $output .= '</div>';
1017 1017
   
1018
-  return $output;
1018
+    return $output;
1019 1019
 }
1020 1020
 
1021 1021
 /**
1022 1022
  * Link to user's team
1023 1023
  */
1024 1024
 function boincteam_member_link_panel() {
1025
-  global $user;
1026
-  $account = user_load($user->uid);
1027
-  $team = node_load($account->team);
1028
-  $output = '';
1029
-  $output .= '<h2 class="pane-title">' . bts('My team') . '</h2>';
1030
-  $output .= '<p>' . bts('You are a member of @team.', 
1025
+    global $user;
1026
+    $account = user_load($user->uid);
1027
+    $team = node_load($account->team);
1028
+    $output = '';
1029
+    $output .= '<h2 class="pane-title">' . bts('My team') . '</h2>';
1030
+    $output .= '<p>' . bts('You are a member of @team.', 
1031 1031
     array('@team' => $team->title)) . '</p>';
1032
-  $output .= '<ul class="tab-list">';
1033
-  $output .= '  <li class="first last tab">' . 
1032
+    $output .= '<ul class="tab-list">';
1033
+    $output .= '  <li class="first last tab">' . 
1034 1034
     l(bts('View my team'), "community/teams/{$account->team}") . '</li>';
1035
-  $output .= '</ul>';
1036
-  return $output;
1035
+    $output .= '</ul>';
1036
+    return $output;
1037 1037
 }
1038 1038
 
1039 1039
 /**
1040 1040
  * Link to request foundership transfer of a team
1041 1041
  */
1042 1042
 function boincteam_request_foundership_panel($team_id) {
1043
-  global $user;
1044
-  $account = user_load($user->uid);
1045
-  $team = node_load($team_id);
1046
-  $boincteam_id = boincteam_lookup_id($team_id);
1047
-  $boincteam = boincteam_load($boincteam_id);
1048
-  $boincuser_id = $account->boincuser_id;
1049
-  $output = '';
1050
-  $output .= '<h2 class="pane-title">' . bts('Request foundership') . '</h2>';
1043
+    global $user;
1044
+    $account = user_load($user->uid);
1045
+    $team = node_load($team_id);
1046
+    $boincteam_id = boincteam_lookup_id($team_id);
1047
+    $boincteam = boincteam_load($boincteam_id);
1048
+    $boincuser_id = $account->boincuser_id;
1049
+    $output = '';
1050
+    $output .= '<h2 class="pane-title">' . bts('Request foundership') . '</h2>';
1051 1051
   
1052
-  if (boincteam_user_requested_foundership($team_id)) {
1052
+    if (boincteam_user_requested_foundership($team_id)) {
1053 1053
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
1054 1054
     $days_to_deadline = ceil(($deadline - time()) / (24*60*60));
1055 1055
     $request_age = 60 - $days_to_deadline;
1056 1056
     $days_to_respond = 30 + $days_to_deadline;
1057 1057
     if (time() > $deadline) {
1058
-      $output .= '<p>';
1059
-      if ($request_age == 1) {
1058
+        $output .= '<p>';
1059
+        if ($request_age == 1) {
1060 1060
         $output .= bts('1 day has elapsed since your request and'
1061
-          . ' the founder has not responded.');
1062
-      }
1063
-      else {
1061
+            . ' the founder has not responded.');
1062
+        }
1063
+        else {
1064 1064
         $output .= bts('@count days have elapsed since your request and'
1065
-          . ' the founder has not responded.',
1066
-          array('@count' => $request_age)
1065
+            . ' the founder has not responded.',
1066
+            array('@count' => $request_age)
1067 1067
         );
1068
-      }
1069
-      $output .= ' ';
1070
-      if ($days_to_respond == 1) {
1068
+        }
1069
+        $output .= ' ';
1070
+        if ($days_to_respond == 1) {
1071 1071
         $output .= bts('You now have 1 day to assume foundership before'
1072
-          . ' another team member may submit a request.');
1073
-      }
1074
-      else {
1072
+            . ' another team member may submit a request.');
1073
+        }
1074
+        else {
1075 1075
         $output .= bts('You now have @count days to assume foundership before'
1076
-          . ' another team member may submit a request.',
1077
-          array('@count' => $days_to_respond)
1076
+            . ' another team member may submit a request.',
1077
+            array('@count' => $days_to_respond)
1078 1078
         );
1079
-      }
1080
-      $output .= '</p>';
1081
-      $output .= '<ul class="tab-list">';
1082
-      $output .= '  <li class="first last tab">' . 
1079
+        }
1080
+        $output .= '</p>';
1081
+        $output .= '<ul class="tab-list">';
1082
+        $output .= '  <li class="first last tab">' . 
1083 1083
         l(bts('Assume foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1084
-      $output .= '</ul>';
1084
+        $output .= '</ul>';
1085 1085
     }
1086 1086
     else {
1087
-      $output .= '<p>';
1088
-      if ($days_to_deadline == 1) {
1087
+        $output .= '<p>';
1088
+        if ($days_to_deadline == 1) {
1089 1089
         $output .= bts('The team founder has 1 day to respond to your'
1090
-          . ' transfer request.'
1090
+            . ' transfer request.'
1091 1091
         );
1092
-      }
1093
-      else {
1092
+        }
1093
+        else {
1094 1094
         $output .= bts('The team founder has @count days to respond to your'
1095
-          . ' transfer request.', array('@count' => $days_to_deadline)
1095
+            . ' transfer request.', array('@count' => $days_to_deadline)
1096 1096
         );
1097
-      }
1098
-      $output .= '</p>';
1097
+        }
1098
+        $output .= '</p>';
1099 1099
     }
1100
-  }
1101
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1100
+    }
1101
+    elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1102 1102
     // If this user does not have a transfer request pending, but new requests
1103 1103
     // are not allowed, set the deadline to 90 days instead of 60 (as the user
1104 1104
     // who made the request has 30 additional days to assume foundership if 
@@ -1107,131 +1107,131 @@  discard block
 block discarded – undo
1107 1107
     $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30;
1108 1108
     $output .= '<p>';
1109 1109
     $output .= bts('A team foundership change was already requested recently.'
1110
-      . ' Only one request is allowed within a period of 90 days.'
1110
+        . ' Only one request is allowed within a period of 90 days.'
1111 1111
     );
1112 1112
     if ($days_to_deadline == 1) {
1113
-      $output .= ' (' . bts('1 day remaining') . ')';
1113
+        $output .= ' (' . bts('1 day remaining') . ')';
1114 1114
     }
1115 1115
     else {
1116
-      $output .= ' (' . bts('@count days remaining',
1116
+        $output .= ' (' . bts('@count days remaining',
1117 1117
         array('@count' => $days_to_deadline)
1118
-      ) . ')';
1118
+        ) . ')';
1119 1119
     }
1120 1120
     $output .= '</p>';
1121
-  }
1122
-  else {
1121
+    }
1122
+    else {
1123 1123
     $output .= '<p>' . bts('If the team founder is not active and you want to'
1124
-      . ' assume the role of founder, click below to request foundership of'
1125
-      . ' @this_team.',
1126
-      array('@this_team' =>$team->title)) . '</p>';
1124
+        . ' assume the role of founder, click below to request foundership of'
1125
+        . ' @this_team.',
1126
+        array('@this_team' =>$team->title)) . '</p>';
1127 1127
     $output .= '<ul class="tab-list">';
1128 1128
     $output .= '  <li class="first last tab">' . 
1129
-      l(bts('Initiate request'), "community/teams/{$team_id}/request-foundership") . '</li>';
1129
+        l(bts('Initiate request'), "community/teams/{$team_id}/request-foundership") . '</li>';
1130 1130
     $output .= '</ul>';
1131
-  }
1132
-  return $output;
1131
+    }
1132
+    return $output;
1133 1133
 }
1134 1134
 
1135 1135
 /**
1136 1136
  * Respond to foundership transfer requests for a team
1137 1137
  */
1138 1138
 function boincteam_request_foundership_response_panel($team_id) {
1139
-  global $user;
1140
-  $account = user_load($user->uid);
1141
-  $team = node_load($team_id);
1142
-  $boincteam_id = boincteam_lookup_id($team_id);
1143
-  $boincteam = boincteam_load($boincteam_id);
1144
-  $boincuser_id = $account->boincuser_id;
1145
-  $output = '';
1139
+    global $user;
1140
+    $account = user_load($user->uid);
1141
+    $team = node_load($team_id);
1142
+    $boincteam_id = boincteam_lookup_id($team_id);
1143
+    $boincteam = boincteam_load($boincteam_id);
1144
+    $boincuser_id = $account->boincuser_id;
1145
+    $output = '';
1146 1146
   
1147
-  if ($boincteam->ping_user) {
1147
+    if ($boincteam->ping_user) {
1148 1148
     if ($boincteam->ping_user < 0) {
1149
-      $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1150
-      $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request')
1149
+        $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1150
+        $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request')
1151 1151
         . '</h2>';
1152
-      $output .= '<p>' . bts('Team member @name requested team foundership on'
1152
+        $output .= '<p>' . bts('Team member @name requested team foundership on'
1153 1153
         . ' @date, but then left the team. This request is now canceled.',
1154 1154
         array(
1155
-          '@name' => $member->boincuser_name,
1156
-          '@date' => date('j M Y', $boincteam->ping_time),
1155
+            '@name' => $member->boincuser_name,
1156
+            '@date' => date('j M Y', $boincteam->ping_time),
1157 1157
         )
1158
-      ) . '</p>';
1159
-      // Automatically cancel the request
1160
-      db_set_active('boinc');
1161
-      db_query("
1158
+        ) . '</p>';
1159
+        // Automatically cancel the request
1160
+        db_set_active('boinc');
1161
+        db_query("
1162 1162
         UPDATE {team}
1163 1163
         SET ping_user=0
1164 1164
         WHERE id = '%d'",
1165 1165
         $boincteam_id
1166
-      );
1167
-      db_set_active('default');
1166
+        );
1167
+        db_set_active('default');
1168 1168
     }
1169 1169
     else {
1170
-      $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1171
-      $output .= '<h2 class="pane-title">' . bts('Respond to transfer request')
1170
+        $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1171
+        $output .= '<h2 class="pane-title">' . bts('Respond to transfer request')
1172 1172
         . '</h2>';
1173
-      $output .= '<p>' . bts('Team member @name has requested team foundership.'
1173
+        $output .= '<p>' . bts('Team member @name has requested team foundership.'
1174 1174
         . ' This may be because you left the team or have not had contact with'
1175 1175
         . ' the team for a long time.', array(
1176
-          '@name' => $member->boincuser_name,
1176
+            '@name' => $member->boincuser_name,
1177 1177
         )
1178
-      ) . '</p>';
1179
-      $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1178
+        ) . '</p>';
1179
+        $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1180 1180
         . ' will have the option of assuming team foundership. (note: To'
1181 1181
         . ' accept the request, assign foundership to @name using the form'
1182 1182
         . ' below)',
1183 1183
         array(
1184
-          '@name' => $member->boincuser_name,
1185
-          '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1184
+            '@name' => $member->boincuser_name,
1185
+            '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1186 1186
         )
1187
-      ) . '</p>';
1188
-      $output .= '<ul class="tab-list">';
1189
-      $output .= '  <li class="first last tab">' . 
1187
+        ) . '</p>';
1188
+        $output .= '<ul class="tab-list">';
1189
+        $output .= '  <li class="first last tab">' . 
1190 1190
         l(bts('Deny request'), "community/teams/{$team_id}/deny-foundership-request") . '</li>';
1191
-      $output .= '</ul>';
1191
+        $output .= '</ul>';
1192 1192
     }
1193
-  }
1194
-  return $output;
1193
+    }
1194
+    return $output;
1195 1195
 }
1196 1196
 
1197 1197
 function boincteam_search_panel() {
1198
-  $output = '';
1199
-  if (module_exists('global_search_teams_solr')) {
1198
+    $output = '';
1199
+    if (module_exists('global_search_teams_solr')) {
1200 1200
     $output .= '<h2 class="pane-title">' . bts('Search teams') . '</h2>';
1201 1201
     //$output .= '<p>' . bts('Render a search form here.') . '</p>';
1202 1202
     $output .= '<p>' . boincteam_search_view() . '</p>';
1203
-  }
1204
-  return $output;
1203
+    }
1204
+    return $output;
1205 1205
 }
1206 1206
 
1207 1207
 function boincteam_search_view($type = 'team') {
1208
-  // Get the team search form
1209
-  $search_page = apachesolr_search_page_load('team_search');
1210
-  module_load_include('inc', 'apachesolr_search', 'apachesolr_search.pages');
1211
-  return drupal_get_form('apachesolr_search_custom_page_search_form', $search_page);
1208
+    // Get the team search form
1209
+    $search_page = apachesolr_search_page_load('team_search');
1210
+    module_load_include('inc', 'apachesolr_search', 'apachesolr_search.pages');
1211
+    return drupal_get_form('apachesolr_search_custom_page_search_form', $search_page);
1212 1212
 }
1213 1213
 
1214 1214
 /**
1215 1215
  * General info about the concept of teams
1216 1216
  */                                         
1217 1217
 function boincteam_topic_overview_panel() {
1218
-  $site_name =  variable_get('site_name', bts('Project'));
1219
-  $output = '';
1220
-  $output .= '<h2 class="pane-title">' . bts('Teams') . '</h2>';
1221
-  $output .= '<div class="">';
1222
-  $output .= '<p>' . bts('@project participants may form teams. You may belong'
1218
+    $site_name =  variable_get('site_name', bts('Project'));
1219
+    $output = '';
1220
+    $output .= '<h2 class="pane-title">' . bts('Teams') . '</h2>';
1221
+    $output .= '<div class="">';
1222
+    $output .= '<p>' . bts('@project participants may form teams. You may belong'
1223 1223
     . ' to only one team. You can join or quit a team at any time. To join a'
1224 1224
     . ' team, visit its team page and click "Join this team". Each team has a'
1225 1225
     . ' founder who may:', array('@project' => $site_name)) . '</p>';
1226
-  $output .= '<ul>';
1227
-  $output .= '  <li>' . bts("access team members' email addresses") . '</li>';
1228
-  $output .= '  <li>' . bts("edit the team's name and description") . '</li>';
1229
-  $output .= '  <li>' . bts('add or remove team admins') . '</li>';
1230
-  $output .= '  <li>' . bts('remove members from the team') . '</li>';
1231
-  $output .= '  <li>' . bts('disband a team if it has no members') . '</li>';
1232
-  $output .= '</ul>';
1233
-  $output .= '</div>';
1234
-  return $output;
1226
+    $output .= '<ul>';
1227
+    $output .= '  <li>' . bts("access team members' email addresses") . '</li>';
1228
+    $output .= '  <li>' . bts("edit the team's name and description") . '</li>';
1229
+    $output .= '  <li>' . bts('add or remove team admins') . '</li>';
1230
+    $output .= '  <li>' . bts('remove members from the team') . '</li>';
1231
+    $output .= '  <li>' . bts('disband a team if it has no members') . '</li>';
1232
+    $output .= '</ul>';
1233
+    $output .= '</div>';
1234
+    return $output;
1235 1235
 }
1236 1236
 
1237 1237
 /**
@@ -1259,50 +1259,50 @@  discard block
 block discarded – undo
1259 1259
  * Link to view a team
1260 1260
  */
1261 1261
 function boincteam_view_team_panel($team_id) {
1262
-  $team = node_load($team_id);
1263
-  if ($team->type != "team") {
1262
+    $team = node_load($team_id);
1263
+    if ($team->type != "team") {
1264 1264
     return;
1265
-  }
1266
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
1267
-  $founder = user_load(get_drupal_id($boincteam->userid));
1268
-  $new_members = array();
1269
-  if ($boincteam->new_members) {
1265
+    }
1266
+    $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
1267
+    $founder = user_load(get_drupal_id($boincteam->userid));
1268
+    $new_members = array();
1269
+    if ($boincteam->new_members) {
1270 1270
     foreach ($boincteam->new_members as $member) {
1271
-      $account = user_load(get_drupal_id($member->id));
1272
-      $new_members[] = l($account->boincuser_name, "account/{$account->uid}");
1271
+        $account = user_load(get_drupal_id($member->id));
1272
+        $new_members[] = l($account->boincuser_name, "account/{$account->uid}");
1273 1273
     }
1274
-  }
1275
-  $output = '';
1276
-  $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>';
1277
-  $output .= '<div>';
1278
-  $output .= '<div class="left-column">';
1279
-  $output .= '<ul class="stats">';
1280
-  $output .= '  <li>' . bts('Total credits') . ': ' . number_format($boincteam->total_credit, 2) . '</li>';
1281
-  $output .= '  <li>' . bts('Recent avg credits') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1282
-  $output .= '  <li>' . bts('Country') . ': ' . $boincteam->country . '</li>';
1283
-  $output .= '  <li>' . bts('Type') . ': ' . boincteam_get_type($team_id) . '</li>';
1284
-  $output .= '</ul>';
1285
-  $output .= '</div>';
1286
-  $output .= '<div class="right-column">';
1287
-  $output .= '<ul class="stats">';
1288
-  $output .= '  <li>' . bts('Founder') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1289
-  $output .= '  <li>' . bts('New members in last day') . ': ' . implode('&middot;', $new_members) . '</li>';
1290
-  $output .= '  <li>' . bts('Total members') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1291
-  $output .= '  <li>' . bts('Active members') . ': ' . $boincteam->nusers_active . '</li>';
1292
-  $output .= '  <li>' . bts('Members with credit') . ': ' . $boincteam->nusers_worked . '</li>';
1293
-  $output .= '</ul>';
1294
-  $output .= '</div>';
1295
-  $output .= '</div>';
1296
-  $output .= '<div class="clearfix"></div>';
1297
-  if ($boincteam->url) {
1274
+    }
1275
+    $output = '';
1276
+    $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>';
1277
+    $output .= '<div>';
1278
+    $output .= '<div class="left-column">';
1279
+    $output .= '<ul class="stats">';
1280
+    $output .= '  <li>' . bts('Total credits') . ': ' . number_format($boincteam->total_credit, 2) . '</li>';
1281
+    $output .= '  <li>' . bts('Recent avg credits') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1282
+    $output .= '  <li>' . bts('Country') . ': ' . $boincteam->country . '</li>';
1283
+    $output .= '  <li>' . bts('Type') . ': ' . boincteam_get_type($team_id) . '</li>';
1284
+    $output .= '</ul>';
1285
+    $output .= '</div>';
1286
+    $output .= '<div class="right-column">';
1287
+    $output .= '<ul class="stats">';
1288
+    $output .= '  <li>' . bts('Founder') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1289
+    $output .= '  <li>' . bts('New members in last day') . ': ' . implode('&middot;', $new_members) . '</li>';
1290
+    $output .= '  <li>' . bts('Total members') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1291
+    $output .= '  <li>' . bts('Active members') . ': ' . $boincteam->nusers_active . '</li>';
1292
+    $output .= '  <li>' . bts('Members with credit') . ': ' . $boincteam->nusers_worked . '</li>';
1293
+    $output .= '</ul>';
1294
+    $output .= '</div>';
1295
+    $output .= '</div>';
1296
+    $output .= '<div class="clearfix"></div>';
1297
+    if ($boincteam->url) {
1298 1298
     $output .= '<div class="stats">';
1299 1299
     $output .= bts('Web site') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}");
1300 1300
     $output .= '</div>';
1301
-  }
1302
-  if ($team->body) {
1301
+    }
1302
+    if ($team->body) {
1303 1303
     $output .= '<h3>' . bts('Description') . '</h3>';
1304 1304
     $output .= check_markup($team->body, $team->format);
1305 1305
     $output .= '</div>';
1306
-  }
1307
-  return $output;
1306
+    }
1307
+    return $output;
1308 1308
 }
Please login to merge, or discard this patch.
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -62,21 +62,21 @@  discard block
 block discarded – undo
62 62
   );
63 63
   $items['community/teams/%/edit/admins/remove/%'] = array(
64 64
     'page callback' => 'boincteam_remove_admin',
65
-    'page arguments' => array(2,6),
65
+    'page arguments' => array(2, 6),
66 66
     'access callback' => 'boincteam_is_founder',
67 67
     'access arguments' => array(2),
68 68
     'type' => MENU_CALLBACK
69 69
   );
70 70
   $items['community/teams/%/edit/founder/set/%'] = array(
71 71
     'page callback' => 'boincteam_set_founder',
72
-    'page arguments' => array(2,6),
72
+    'page arguments' => array(2, 6),
73 73
     'access callback' => 'boincteam_is_founder',
74 74
     'access arguments' => array(2),
75 75
     'type' => MENU_CALLBACK
76 76
   );
77 77
   $items['community/teams/%/edit/members/remove/%'] = array(
78 78
     'page callback' => 'boincteam_remove_member',
79
-    'page arguments' => array(2,6),
79
+    'page arguments' => array(2, 6),
80 80
     'access callback' => 'boincteam_is_founder',
81 81
     'access arguments' => array(2),
82 82
     'type' => MENU_CALLBACK
@@ -672,12 +672,12 @@  discard block
 block discarded – undo
672 672
   $boincteam = boincteam_load($boincteam_id);
673 673
   $now = time();
674 674
   if ($boincteam->ping_user <= 0) {
675
-    if ($boincteam->ping_time < $now - 60 * (24*60*60)) {
675
+    if ($boincteam->ping_time < $now - 60*(24*60*60)) {
676 676
       return TRUE;
677 677
     }
678 678
     return FALSE;
679 679
   }
680
-  if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
680
+  if ($boincteam->ping_time < $now - 90*(24*60*60)) {
681 681
     return TRUE;
682 682
   }
683 683
   return FALSE;
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
  * responded to the request
689 689
  */
690 690
 function boincteam_foundership_transfer_ok_time($boincteam) {
691
-    return $boincteam->ping_time + 60 * (24*60*60);
691
+    return $boincteam->ping_time + 60*(24*60*60);
692 692
 }
693 693
 
694 694
 /**
@@ -726,26 +726,26 @@  discard block
 block discarded – undo
726 726
  */                                         
727 727
 function boincteam_about_admins_panel() {
728 728
   $output = '';
729
-  $output .= '<h2 class="pane-title">' . bts('About team admins') . '</h2>';
729
+  $output .= '<h2 class="pane-title">'.bts('About team admins').'</h2>';
730 730
   $output .= '<div>';
731
-  $output .= '<p>' . bts('Team admins can:') . '</p>';
731
+  $output .= '<p>'.bts('Team admins can:').'</p>';
732 732
   $output .= '<ul>';
733
-  $output .= '  <li>' . bts('Edit team information') . '</li>';
734
-  $output .= '  <li>' . bts("View the team's join / quit history") . '</li>';
735
-  $output .= '  <li>' . bts('Moderate the team forum') . '</li>';
736
-  $output .= '  <li>' . bts('Remove members from the team') . '</li>';
737
-  $output .= '  <li>' . bts('Disband a team if it has no members') . '</li>';
733
+  $output .= '  <li>'.bts('Edit team information').'</li>';
734
+  $output .= '  <li>'.bts("View the team's join / quit history").'</li>';
735
+  $output .= '  <li>'.bts('Moderate the team forum').'</li>';
736
+  $output .= '  <li>'.bts('Remove members from the team').'</li>';
737
+  $output .= '  <li>'.bts('Disband a team if it has no members').'</li>';
738 738
   $output .= '</ul>';
739 739
   $output .= '</div>';
740 740
   $output .= '<div>';
741
-  $output .= '<p>' . bts('Team admins cannot:') . '</p>';
741
+  $output .= '<p>'.bts('Team admins cannot:').'</p>';
742 742
   $output .= '<ul>';
743
-  $output .= '  <li>' . bts('Change the team founder') . '</li>';
744
-  $output .= '  <li>' . bts('Remove members') . '</li>';
745
-  $output .= '  <li>' . bts('Add / Remove team admins') . '</li>';
743
+  $output .= '  <li>'.bts('Change the team founder').'</li>';
744
+  $output .= '  <li>'.bts('Remove members').'</li>';
745
+  $output .= '  <li>'.bts('Add / Remove team admins').'</li>';
746 746
   $output .= '</ul>';
747 747
   $output .= '</div>';
748
-  $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
748
+  $output .= '<p>'.bts('If a team admin quits the team, they cease to be a'
749 749
     . ' team admin. We recommend only selecting people you know and trust')
750 750
     . '</p>';
751 751
   return $output;
@@ -756,26 +756,26 @@  discard block
 block discarded – undo
756 756
  */                                         
757 757
 function boincteam_about_founder_panel() {
758 758
   $output = '';
759
-  $output .= '<h2 class="pane-title">' . bts('Changing the team founder')
759
+  $output .= '<h2 class="pane-title">'.bts('Changing the team founder')
760 760
     . '</h2>';
761 761
   $output .= '<div>';
762
-  $output .= '<p>' . bts('Notes about changes in foundership:') . '</p>';
762
+  $output .= '<p>'.bts('Notes about changes in foundership:').'</p>';
763 763
   $output .= '<ul>';
764
-  $output .= '  <li>' . bts('Any member of the team is eligible') . '</li>';
765
-  $output .= '  <li>' . bts('Current founder becomes a normal user') . '</li>';
764
+  $output .= '  <li>'.bts('Any member of the team is eligible').'</li>';
765
+  $output .= '  <li>'.bts('Current founder becomes a normal user').'</li>';
766 766
   $output .= '</ul>';
767 767
   $output .= '</div>';
768 768
   $output .= '<div>';
769
-  $output .= '<p>' . bts('Foundership can be requested by team members:')
769
+  $output .= '<p>'.bts('Foundership can be requested by team members:')
770 770
     . '</p>';
771 771
   $output .= '<ul>';
772
-  $output .= '  <li>' . bts('One request is allowed at a time') . '</li>';
773
-  $output .= '  <li>' . bts('It must be 60 days since any previous request')
772
+  $output .= '  <li>'.bts('One request is allowed at a time').'</li>';
773
+  $output .= '  <li>'.bts('It must be 60 days since any previous request')
774 774
     . '</li>';
775
-  $output .= '  <li>' . bts('Any active request must be older than 90 days')
775
+  $output .= '  <li>'.bts('Any active request must be older than 90 days')
776 776
     . '</li>';
777
-  $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
778
-    . ' request') . '</li>';
777
+  $output .= '  <li>'.bts('Current founder has 60 days to respond to a'
778
+    . ' request').'</li>';
779 779
   $output .= '</ul>';
780 780
   $output .= '</div>';
781 781
   return $output;
@@ -789,9 +789,9 @@  discard block
 block discarded – undo
789 789
   $account = user_load($user->uid);
790 790
   $unrestricted_role = array_search('verified contributor', user_roles(true));
791 791
   $output = '';
792
-  $output .= '<h2 class="pane-title">' . bts('Create a new team') . '</h2>';
793
-  $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
794
-    . ' can create a team.') . '</p>';
792
+  $output .= '<h2 class="pane-title">'.bts('Create a new team').'</h2>';
793
+  $output .= '<p>'.bts('If you cannot find a team that is right for you, you'
794
+    . ' can create a team.').'</p>';
795 795
   $output .= '<ul class="tab-list">';
796 796
   $output .= '  <li class="first last tab">';
797 797
   if (isset($account->roles[$unrestricted_role])) {
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
  */
827 827
 function boincteam_create_team_panel() {
828 828
   $output = '';
829
-  $output .= '<h2 class="pane-title">' . bts('Create a team') . '</h2>';
829
+  $output .= '<h2 class="pane-title">'.bts('Create a team').'</h2>';
830 830
   $output .= drupal_get_form('boincteam_create_form');
831 831
   
832 832
   return $output;
@@ -844,23 +844,23 @@  discard block
 block discarded – undo
844 844
   $account = user_load($uid);
845 845
   if ($account->team) {
846 846
     $team = boincteam_load(boincteam_lookup_id($account->team));
847
-    $output .= '<h2 class="pane-title">' . bts('Team') . '</h2>';
847
+    $output .= '<h2 class="pane-title">'.bts('Team').'</h2>';
848 848
     $output .= '<div class="stats">';
849
-    $output .= '  <label>' . bts('Name') . ': </label>';
850
-    $output .= '  <span>' . l($team->name, "community/teams/{$account->team}") . '</span>';
851
-    $output .= '</div>' . "\n";
849
+    $output .= '  <label>'.bts('Name').': </label>';
850
+    $output .= '  <span>'.l($team->name, "community/teams/{$account->team}").'</span>';
851
+    $output .= '</div>'."\n";
852 852
     $output .= '<div class="stats">';
853
-    $output .= '  <label>' . bts('Member since') . ': </label>';
854
-    $output .= '  <span>' . date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)) . '</span>';
855
-    $output .= '</div>' . "\n";
853
+    $output .= '  <label>'.bts('Member since').': </label>';
854
+    $output .= '  <span>'.date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)).'</span>';
855
+    $output .= '</div>'."\n";
856 856
     $output .= '<div class="stats">';
857
-    $output .= '  <label>' . bts('Country') . ': </label>';
858
-    $output .= '  <span>' . $team->country . '</span>';
859
-    $output .= '</div>' . "\n";
857
+    $output .= '  <label>'.bts('Country').': </label>';
858
+    $output .= '  <span>'.$team->country.'</span>';
859
+    $output .= '</div>'."\n";
860 860
     $output .= '<div class="stats">';
861
-    $output .= '  <label>' . bts('Total credit') . ': </label>';
862
-    $output .= '  <span>' . number_format($team->total_credit, 2) . '</span>';
863
-    $output .= '</div>' . "\n";
861
+    $output .= '  <label>'.bts('Total credit').': </label>';
862
+    $output .= '  <span>'.number_format($team->total_credit, 2).'</span>';
863
+    $output .= '</div>'."\n";
864 864
   }
865 865
   return $output;
866 866
 }
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 function boincteam_edit_team_panel($team_id) {
872 872
   $team = node_load($team_id);
873 873
   $output = '';
874
-  $output .= '<h2 class="pane-title">' . $team->title . '</h2>';
874
+  $output .= '<h2 class="pane-title">'.$team->title.'</h2>';
875 875
   $output .= drupal_get_form('boincteam_edit_form', $team_id);
876 876
   
877 877
   return $output;
@@ -883,12 +883,12 @@  discard block
 block discarded – undo
883 883
 function boincteam_join_team_panel($team_id) {
884 884
   $team = node_load($team_id);
885 885
   $output = '';
886
-  $output .= '<h2 class="pane-title">' . bts('Join team') . '</h2>';
887
-  $output .= '<p>' . bts('Click here to become a member of @this_team',
888
-    array('@this_team' =>$team->title)) . '</p>';
886
+  $output .= '<h2 class="pane-title">'.bts('Join team').'</h2>';
887
+  $output .= '<p>'.bts('Click here to become a member of @this_team',
888
+    array('@this_team' =>$team->title)).'</p>';
889 889
   $output .= '<ul class="tab-list">';
890
-  $output .= '  <li class="first last tab">' . 
891
-    l(bts('Join this team'), "community/teams/{$team_id}/join") . '</li>';
890
+  $output .= '  <li class="first last tab">'. 
891
+    l(bts('Join this team'), "community/teams/{$team_id}/join").'</li>';
892 892
   $output .= '</ul>';
893 893
   return $output;
894 894
 }
@@ -899,12 +899,12 @@  discard block
 block discarded – undo
899 899
 function boincteam_leave_team_panel($team_id) {
900 900
   $team = node_load($team_id);
901 901
   $output = '';
902
-  $output .= '<h2 class="pane-title">' . bts('Leave team') . '</h2>';
903
-  $output .= '<p>' . bts('Click here to revoke your membership with'
904
-    . ' @this_team', array('@this_team' =>$team->title)) . '</p>';
902
+  $output .= '<h2 class="pane-title">'.bts('Leave team').'</h2>';
903
+  $output .= '<p>'.bts('Click here to revoke your membership with'
904
+    . ' @this_team', array('@this_team' =>$team->title)).'</p>';
905 905
   $output .= '<ul class="tab-list">';
906
-  $output .= '  <li class="first last tab">' . 
907
-    l(bts('Leave this team'), "community/teams/{$team_id}/leave") . '</li>';
906
+  $output .= '  <li class="first last tab">'. 
907
+    l(bts('Leave this team'), "community/teams/{$team_id}/leave").'</li>';
908 908
   $output .= '</ul>';
909 909
   return $output;
910 910
 }
@@ -914,10 +914,10 @@  discard block
 block discarded – undo
914 914
  */                                         
915 915
 function boincteam_manage_admins_panel_header($team_id) {
916 916
   $output = '';
917
-  $output .= '<h4>' . bts('Add team admin') . '</h4>';
917
+  $output .= '<h4>'.bts('Add team admin').'</h4>';
918 918
   $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
919 919
   $output .= '<div class="clearfix"></div>';
920
-  $output .= '<h4>' . bts('Current team admins') . '</h4>';
920
+  $output .= '<h4>'.bts('Current team admins').'</h4>';
921 921
   
922 922
   return $output;
923 923
 }
@@ -929,33 +929,33 @@  discard block
 block discarded – undo
929 929
   $is_founder = boincteam_is_founder($team_id);
930 930
   $team = node_load($team_id);
931 931
   $output = '';
932
-  $output .= '<h2 class="pane-title">' . bts('Manage team') . '</h2>';
932
+  $output .= '<h2 class="pane-title">'.bts('Manage team').'</h2>';
933 933
   
934 934
   // Member list
935 935
   $output .= '<div class="form-item">';
936
-  $output .= '  <label>' . bts('View member list') . '</label>';
936
+  $output .= '  <label>'.bts('View member list').'</label>';
937 937
   $output .= '  <ul class="tab-list">';
938
-  $output .= '    <li class="first tab primary">' . 
939
-    l('HTML', "community/teams/{$team_id}/members") . '</li>';
940
-  $output .= '    <li class="last tab primary">' .
941
-    l('text', "community/teams/{$team_id}/members/email") . '</li>';
938
+  $output .= '    <li class="first tab primary">'. 
939
+    l('HTML', "community/teams/{$team_id}/members").'</li>';
940
+  $output .= '    <li class="last tab primary">'.
941
+    l('text', "community/teams/{$team_id}/members/email").'</li>';
942 942
   $output .= '  </ul>';
943 943
   $output .= '  <div class="description">';
944
-  $output .=   bts('Member names and emails');
944
+  $output .= bts('Member names and emails');
945 945
   $output .= '  </div>';
946 946
   $output .= '</div>'; 
947 947
   
948 948
   // Team history
949 949
   $output .= '<div class="form-item">';
950
-  $output .= '  <label>' . bts('View change history') . '</label>';
950
+  $output .= '  <label>'.bts('View change history').'</label>';
951 951
   $output .= '  <ul class="tab-list">';
952
-  $output .= '    <li class="first tab primary">' . 
953
-    l('HTML', "community/teams/{$team_id}/history") . '</li>';
954
-  $output .= '    <li class="last tab primary">' .
955
-    l('XML', "community/teams/{$team_id}/history/xml") . '</li>';
952
+  $output .= '    <li class="first tab primary">'. 
953
+    l('HTML', "community/teams/{$team_id}/history").'</li>';
954
+  $output .= '    <li class="last tab primary">'.
955
+    l('XML', "community/teams/{$team_id}/history/xml").'</li>';
956 956
   $output .= '  </ul>';
957 957
   $output .= '  <div class="description">';
958
-  $output .=   bts('See member activity');
958
+  $output .= bts('See member activity');
959 959
   $output .= '  </div>';
960 960
   $output .= '</div>';
961 961
   
@@ -972,13 +972,13 @@  discard block
 block discarded – undo
972 972
       }
973 973
       $output .= '<div class="form-item">';
974 974
       $output .= '  <ul class="tab-list action-list">';
975
-      $output .= '    <li class="first tab primary">' .   
975
+      $output .= '    <li class="first tab primary">'.   
976 976
         l(bts('Manage team message board'),
977 977
           "community/teams/{$team_id}/forum/{$team_forum_link_path}"
978 978
         );
979 979
       $output .= '    </li>';
980 980
       $output .= '  <div class="description">';
981
-      $output .=   bts('Create or manage message board');
981
+      $output .= bts('Create or manage message board');
982 982
       $output .= '  </div>';
983 983
       $output .= '</div>';
984 984
     }
@@ -987,29 +987,29 @@  discard block
 block discarded – undo
987 987
   // Remove members
988 988
   $output .= '<div class="form-item">';
989 989
   $output .= '  <ul class="tab-list action-list">';
990
-  $output .= '    <li class="first tab primary">' . 
991
-    l(bts('Remove members'), "community/teams/{$team_id}/edit/members") . '</li>';
990
+  $output .= '    <li class="first tab primary">'. 
991
+    l(bts('Remove members'), "community/teams/{$team_id}/edit/members").'</li>';
992 992
   
993 993
   if ($is_founder) {
994 994
     
995 995
     // Change founder
996
-    $output .= '    <li class="tab primary">' . 
997
-      l(bts('Change founder'), "community/teams/{$team_id}/edit/founder") . '</li>';
996
+    $output .= '    <li class="tab primary">'. 
997
+      l(bts('Change founder'), "community/teams/{$team_id}/edit/founder").'</li>';
998 998
       
999 999
       // Manage admins
1000
-    $output .= '    <li class="tab primary">' . 
1001
-      l(bts('Manage team admins'), "community/teams/{$team_id}/edit/admins") . '</li>';
1000
+    $output .= '    <li class="tab primary">'. 
1001
+      l(bts('Manage team admins'), "community/teams/{$team_id}/edit/admins").'</li>';
1002 1002
   }
1003 1003
   
1004 1004
   // Edit team information
1005
-  $output .= '    <li class="tab primary">' . 
1006
-    l(bts('Edit team info'), "community/teams/{$team_id}/edit/info") . '</li>';
1005
+  $output .= '    <li class="tab primary">'. 
1006
+    l(bts('Edit team info'), "community/teams/{$team_id}/edit/info").'</li>';
1007 1007
     
1008 1008
   if ($is_founder) {
1009 1009
     
1010 1010
     // Delete the team
1011
-    $output .= '    <li class="last tab primary">' . 
1012
-      l(bts('Remove team'), "community/teams/{$team_id}/delete") . '</li>';
1011
+    $output .= '    <li class="last tab primary">'. 
1012
+      l(bts('Remove team'), "community/teams/{$team_id}/delete").'</li>';
1013 1013
   }
1014 1014
   
1015 1015
   $output .= '  </ul>';
@@ -1026,12 +1026,12 @@  discard block
 block discarded – undo
1026 1026
   $account = user_load($user->uid);
1027 1027
   $team = node_load($account->team);
1028 1028
   $output = '';
1029
-  $output .= '<h2 class="pane-title">' . bts('My team') . '</h2>';
1030
-  $output .= '<p>' . bts('You are a member of @team.', 
1031
-    array('@team' => $team->title)) . '</p>';
1029
+  $output .= '<h2 class="pane-title">'.bts('My team').'</h2>';
1030
+  $output .= '<p>'.bts('You are a member of @team.', 
1031
+    array('@team' => $team->title)).'</p>';
1032 1032
   $output .= '<ul class="tab-list">';
1033
-  $output .= '  <li class="first last tab">' . 
1034
-    l(bts('View my team'), "community/teams/{$account->team}") . '</li>';
1033
+  $output .= '  <li class="first last tab">'. 
1034
+    l(bts('View my team'), "community/teams/{$account->team}").'</li>';
1035 1035
   $output .= '</ul>';
1036 1036
   return $output;
1037 1037
 }
@@ -1047,11 +1047,11 @@  discard block
 block discarded – undo
1047 1047
   $boincteam = boincteam_load($boincteam_id);
1048 1048
   $boincuser_id = $account->boincuser_id;
1049 1049
   $output = '';
1050
-  $output .= '<h2 class="pane-title">' . bts('Request foundership') . '</h2>';
1050
+  $output .= '<h2 class="pane-title">'.bts('Request foundership').'</h2>';
1051 1051
   
1052 1052
   if (boincteam_user_requested_foundership($team_id)) {
1053 1053
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
1054
-    $days_to_deadline = ceil(($deadline - time()) / (24*60*60));
1054
+    $days_to_deadline = ceil(($deadline - time())/(24*60*60));
1055 1055
     $request_age = 60 - $days_to_deadline;
1056 1056
     $days_to_respond = 30 + $days_to_deadline;
1057 1057
     if (time() > $deadline) {
@@ -1079,8 +1079,8 @@  discard block
 block discarded – undo
1079 1079
       }
1080 1080
       $output .= '</p>';
1081 1081
       $output .= '<ul class="tab-list">';
1082
-      $output .= '  <li class="first last tab">' . 
1083
-        l(bts('Assume foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1082
+      $output .= '  <li class="first last tab">'. 
1083
+        l(bts('Assume foundership'), "community/teams/{$team_id}/assume-foundership").'</li>';
1084 1084
       $output .= '</ul>';
1085 1085
     }
1086 1086
     else {
@@ -1104,29 +1104,29 @@  discard block
 block discarded – undo
1104 1104
     // who made the request has 30 additional days to assume foundership if 
1105 1105
     // there is no response to the request)
1106 1106
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
1107
-    $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30;
1107
+    $days_to_deadline = ceil(($deadline - time())/(24*60*60)) + 30;
1108 1108
     $output .= '<p>';
1109 1109
     $output .= bts('A team foundership change was already requested recently.'
1110 1110
       . ' Only one request is allowed within a period of 90 days.'
1111 1111
     );
1112 1112
     if ($days_to_deadline == 1) {
1113
-      $output .= ' (' . bts('1 day remaining') . ')';
1113
+      $output .= ' ('.bts('1 day remaining').')';
1114 1114
     }
1115 1115
     else {
1116
-      $output .= ' (' . bts('@count days remaining',
1116
+      $output .= ' ('.bts('@count days remaining',
1117 1117
         array('@count' => $days_to_deadline)
1118
-      ) . ')';
1118
+      ).')';
1119 1119
     }
1120 1120
     $output .= '</p>';
1121 1121
   }
1122 1122
   else {
1123
-    $output .= '<p>' . bts('If the team founder is not active and you want to'
1123
+    $output .= '<p>'.bts('If the team founder is not active and you want to'
1124 1124
       . ' assume the role of founder, click below to request foundership of'
1125 1125
       . ' @this_team.',
1126
-      array('@this_team' =>$team->title)) . '</p>';
1126
+      array('@this_team' =>$team->title)).'</p>';
1127 1127
     $output .= '<ul class="tab-list">';
1128
-    $output .= '  <li class="first last tab">' . 
1129
-      l(bts('Initiate request'), "community/teams/{$team_id}/request-foundership") . '</li>';
1128
+    $output .= '  <li class="first last tab">'. 
1129
+      l(bts('Initiate request'), "community/teams/{$team_id}/request-foundership").'</li>';
1130 1130
     $output .= '</ul>';
1131 1131
   }
1132 1132
   return $output;
@@ -1147,15 +1147,15 @@  discard block
 block discarded – undo
1147 1147
   if ($boincteam->ping_user) {
1148 1148
     if ($boincteam->ping_user < 0) {
1149 1149
       $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1150
-      $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request')
1150
+      $output .= '<h2 class="pane-title">'.bts('Obsolete transfer request')
1151 1151
         . '</h2>';
1152
-      $output .= '<p>' . bts('Team member @name requested team foundership on'
1152
+      $output .= '<p>'.bts('Team member @name requested team foundership on'
1153 1153
         . ' @date, but then left the team. This request is now canceled.',
1154 1154
         array(
1155 1155
           '@name' => $member->boincuser_name,
1156 1156
           '@date' => date('j M Y', $boincteam->ping_time),
1157 1157
         )
1158
-      ) . '</p>';
1158
+      ).'</p>';
1159 1159
       // Automatically cancel the request
1160 1160
       db_set_active('boinc');
1161 1161
       db_query("
@@ -1168,15 +1168,15 @@  discard block
 block discarded – undo
1168 1168
     }
1169 1169
     else {
1170 1170
       $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1171
-      $output .= '<h2 class="pane-title">' . bts('Respond to transfer request')
1171
+      $output .= '<h2 class="pane-title">'.bts('Respond to transfer request')
1172 1172
         . '</h2>';
1173
-      $output .= '<p>' . bts('Team member @name has requested team foundership.'
1173
+      $output .= '<p>'.bts('Team member @name has requested team foundership.'
1174 1174
         . ' This may be because you left the team or have not had contact with'
1175 1175
         . ' the team for a long time.', array(
1176 1176
           '@name' => $member->boincuser_name,
1177 1177
         )
1178
-      ) . '</p>';
1179
-      $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1178
+      ).'</p>';
1179
+      $output .= '<p>'.bts("If you don't decline the request by @date, @name"
1180 1180
         . ' will have the option of assuming team foundership. (note: To'
1181 1181
         . ' accept the request, assign foundership to @name using the form'
1182 1182
         . ' below)',
@@ -1184,10 +1184,10 @@  discard block
 block discarded – undo
1184 1184
           '@name' => $member->boincuser_name,
1185 1185
           '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1186 1186
         )
1187
-      ) . '</p>';
1187
+      ).'</p>';
1188 1188
       $output .= '<ul class="tab-list">';
1189
-      $output .= '  <li class="first last tab">' . 
1190
-        l(bts('Deny request'), "community/teams/{$team_id}/deny-foundership-request") . '</li>';
1189
+      $output .= '  <li class="first last tab">'. 
1190
+        l(bts('Deny request'), "community/teams/{$team_id}/deny-foundership-request").'</li>';
1191 1191
       $output .= '</ul>';
1192 1192
     }
1193 1193
   }
@@ -1197,9 +1197,9 @@  discard block
 block discarded – undo
1197 1197
 function boincteam_search_panel() {
1198 1198
   $output = '';
1199 1199
   if (module_exists('global_search_teams_solr')) {
1200
-    $output .= '<h2 class="pane-title">' . bts('Search teams') . '</h2>';
1200
+    $output .= '<h2 class="pane-title">'.bts('Search teams').'</h2>';
1201 1201
     //$output .= '<p>' . bts('Render a search form here.') . '</p>';
1202
-    $output .= '<p>' . boincteam_search_view() . '</p>';
1202
+    $output .= '<p>'.boincteam_search_view().'</p>';
1203 1203
   }
1204 1204
   return $output;
1205 1205
 }
@@ -1215,20 +1215,20 @@  discard block
 block discarded – undo
1215 1215
  * General info about the concept of teams
1216 1216
  */                                         
1217 1217
 function boincteam_topic_overview_panel() {
1218
-  $site_name =  variable_get('site_name', bts('Project'));
1218
+  $site_name = variable_get('site_name', bts('Project'));
1219 1219
   $output = '';
1220
-  $output .= '<h2 class="pane-title">' . bts('Teams') . '</h2>';
1220
+  $output .= '<h2 class="pane-title">'.bts('Teams').'</h2>';
1221 1221
   $output .= '<div class="">';
1222
-  $output .= '<p>' . bts('@project participants may form teams. You may belong'
1222
+  $output .= '<p>'.bts('@project participants may form teams. You may belong'
1223 1223
     . ' to only one team. You can join or quit a team at any time. To join a'
1224 1224
     . ' team, visit its team page and click "Join this team". Each team has a'
1225
-    . ' founder who may:', array('@project' => $site_name)) . '</p>';
1225
+    . ' founder who may:', array('@project' => $site_name)).'</p>';
1226 1226
   $output .= '<ul>';
1227
-  $output .= '  <li>' . bts("access team members' email addresses") . '</li>';
1228
-  $output .= '  <li>' . bts("edit the team's name and description") . '</li>';
1229
-  $output .= '  <li>' . bts('add or remove team admins') . '</li>';
1230
-  $output .= '  <li>' . bts('remove members from the team') . '</li>';
1231
-  $output .= '  <li>' . bts('disband a team if it has no members') . '</li>';
1227
+  $output .= '  <li>'.bts("access team members' email addresses").'</li>';
1228
+  $output .= '  <li>'.bts("edit the team's name and description").'</li>';
1229
+  $output .= '  <li>'.bts('add or remove team admins').'</li>';
1230
+  $output .= '  <li>'.bts('remove members from the team').'</li>';
1231
+  $output .= '  <li>'.bts('disband a team if it has no members').'</li>';
1232 1232
   $output .= '</ul>';
1233 1233
   $output .= '</div>';
1234 1234
   return $output;
@@ -1273,34 +1273,34 @@  discard block
 block discarded – undo
1273 1273
     }
1274 1274
   }
1275 1275
   $output = '';
1276
-  $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>';
1276
+  $output .= '<h2 class="pane-title">'.$boincteam->name.'</h2>';
1277 1277
   $output .= '<div>';
1278 1278
   $output .= '<div class="left-column">';
1279 1279
   $output .= '<ul class="stats">';
1280
-  $output .= '  <li>' . bts('Total credits') . ': ' . number_format($boincteam->total_credit, 2) . '</li>';
1281
-  $output .= '  <li>' . bts('Recent avg credits') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1282
-  $output .= '  <li>' . bts('Country') . ': ' . $boincteam->country . '</li>';
1283
-  $output .= '  <li>' . bts('Type') . ': ' . boincteam_get_type($team_id) . '</li>';
1280
+  $output .= '  <li>'.bts('Total credits').': '.number_format($boincteam->total_credit, 2).'</li>';
1281
+  $output .= '  <li>'.bts('Recent avg credits').': '.number_format($boincteam->expavg_credit, 2).'</li>';
1282
+  $output .= '  <li>'.bts('Country').': '.$boincteam->country.'</li>';
1283
+  $output .= '  <li>'.bts('Type').': '.boincteam_get_type($team_id).'</li>';
1284 1284
   $output .= '</ul>';
1285 1285
   $output .= '</div>';
1286 1286
   $output .= '<div class="right-column">';
1287 1287
   $output .= '<ul class="stats">';
1288
-  $output .= '  <li>' . bts('Founder') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1289
-  $output .= '  <li>' . bts('New members in last day') . ': ' . implode('&middot;', $new_members) . '</li>';
1290
-  $output .= '  <li>' . bts('Total members') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1291
-  $output .= '  <li>' . bts('Active members') . ': ' . $boincteam->nusers_active . '</li>';
1292
-  $output .= '  <li>' . bts('Members with credit') . ': ' . $boincteam->nusers_worked . '</li>';
1288
+  $output .= '  <li>'.bts('Founder').': '.l($founder->boincuser_name, "account/{$founder->uid}").'</li>';
1289
+  $output .= '  <li>'.bts('New members in last day').': '.implode('&middot;', $new_members).'</li>';
1290
+  $output .= '  <li>'.bts('Total members').': '.l($boincteam->nusers, "community/teams/{$team_id}/members").'</li>';
1291
+  $output .= '  <li>'.bts('Active members').': '.$boincteam->nusers_active.'</li>';
1292
+  $output .= '  <li>'.bts('Members with credit').': '.$boincteam->nusers_worked.'</li>';
1293 1293
   $output .= '</ul>';
1294 1294
   $output .= '</div>';
1295 1295
   $output .= '</div>';
1296 1296
   $output .= '<div class="clearfix"></div>';
1297 1297
   if ($boincteam->url) {
1298 1298
     $output .= '<div class="stats">';
1299
-    $output .= bts('Web site') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}");
1299
+    $output .= bts('Web site').': '.l("http://{$boincteam->url}", "http://{$boincteam->url}");
1300 1300
     $output .= '</div>';
1301 1301
   }
1302 1302
   if ($team->body) {
1303
-    $output .= '<h3>' . bts('Description') . '</h3>';
1303
+    $output .= '<h3>'.bts('Description').'</h3>';
1304 1304
     $output .= check_markup($team->body, $team->format);
1305 1305
     $output .= '</div>';
1306 1306
   }
Please login to merge, or discard this patch.
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -179,8 +179,7 @@  discard block
 block discarded – undo
179 179
         ), WATCHDOG_NOTICE
180 180
       );
181 181
     }
182
-  }
183
-  else {
182
+  } else {
184 183
     drupal_set_message(t('You are not allowed to assume foundership of this
185 184
       team.'
186 185
     ));
@@ -205,8 +204,7 @@  discard block
 block discarded – undo
205 204
     drupal_set_message(t('@team has been removed.',
206 205
       array('@team' => $boincteam->name)));
207 206
     drupal_goto('community/teams');
208
-  }
209
-  else {
207
+  } else {
210 208
     drupal_set_message(t('All members must be removed from @team before the
211 209
       team can be deleted.', array('@team' => $boincteam->name)), 'error');
212 210
     drupal_goto(strstr($_GET['q'], '/delete', TRUE));
@@ -440,8 +438,7 @@  discard block
 block discarded – undo
440 438
         array('@team' => $boincteam->name)));
441 439
       watchdog('boincteam', 'added user @uid to team @nid',
442 440
         array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
443
-    }
444
-    else {
441
+    } else {
445 442
       drupal_set_message(t('There was a problem joining @team, please try again
446 443
         later', array('@team' => $boincteam->name)));
447 444
       watchdog('boincteam', 'error adding user @uid to team @nid',
@@ -468,8 +465,7 @@  discard block
 block discarded – undo
468 465
       array('@team' => $boincteam->name)));
469 466
     watchdog('boincteam', 'removed user @uid from team @nid',
470 467
       array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
471
-  }
472
-  else {
468
+  } else {
473 469
       drupal_set_message(t('You are not a member of @team, so you cannot revoke
474 470
         your membership to it.', array('@team' => $boincteam->name)));
475 471
   }
@@ -565,8 +561,7 @@  discard block
 block discarded – undo
565 561
         '@uid' => $account->uid, 
566 562
         '@nid' => $team_id
567 563
       ), WATCHDOG_NOTICE);
568
-  }
569
-  else {
564
+  } else {
570 565
       drupal_set_message(t('@user is not a member of @team, so you cannot
571 566
         revoke the membership.', array(
572 567
           '@user' => $account->boincuser_name,
@@ -595,14 +590,12 @@  discard block
 block discarded – undo
595 590
         '@user' => $account->boincuser_name
596 591
       )
597 592
     ), 'warning');
598
-  }
599
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
593
+  } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
600 594
     // It hasn't been long enough since the last transfer request
601 595
     drupal_set_message(t('A foundership change was requested during the last 90
602 596
       days, so new requests are not allowed. Please try again later.'
603 597
     ), 'warning');
604
-  }
605
-  elseif (boincteam_is_member($team_id, $account->uid)) {
598
+  } elseif (boincteam_is_member($team_id, $account->uid)) {
606 599
     // Log the transfer request
607 600
     db_set_active('boinc');
608 601
     db_query("
@@ -808,8 +801,7 @@  discard block
 block discarded – undo
808 801
     $output .= '[';
809 802
     if ($credit_needed == 1) {
810 803
       $output .= bts('You must earn 1 more credit!');
811
-    }
812
-    else {
804
+    } else {
813 805
       $output .= bts('You must earn @count more credits!',
814 806
         array('@count' => $credit_needed)
815 807
       );
@@ -1059,8 +1051,7 @@  discard block
 block discarded – undo
1059 1051
       if ($request_age == 1) {
1060 1052
         $output .= bts('1 day has elapsed since your request and'
1061 1053
           . ' the founder has not responded.');
1062
-      }
1063
-      else {
1054
+      } else {
1064 1055
         $output .= bts('@count days have elapsed since your request and'
1065 1056
           . ' the founder has not responded.',
1066 1057
           array('@count' => $request_age)
@@ -1070,8 +1061,7 @@  discard block
 block discarded – undo
1070 1061
       if ($days_to_respond == 1) {
1071 1062
         $output .= bts('You now have 1 day to assume foundership before'
1072 1063
           . ' another team member may submit a request.');
1073
-      }
1074
-      else {
1064
+      } else {
1075 1065
         $output .= bts('You now have @count days to assume foundership before'
1076 1066
           . ' another team member may submit a request.',
1077 1067
           array('@count' => $days_to_respond)
@@ -1082,23 +1072,20 @@  discard block
 block discarded – undo
1082 1072
       $output .= '  <li class="first last tab">' . 
1083 1073
         l(bts('Assume foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1084 1074
       $output .= '</ul>';
1085
-    }
1086
-    else {
1075
+    } else {
1087 1076
       $output .= '<p>';
1088 1077
       if ($days_to_deadline == 1) {
1089 1078
         $output .= bts('The team founder has 1 day to respond to your'
1090 1079
           . ' transfer request.'
1091 1080
         );
1092
-      }
1093
-      else {
1081
+      } else {
1094 1082
         $output .= bts('The team founder has @count days to respond to your'
1095 1083
           . ' transfer request.', array('@count' => $days_to_deadline)
1096 1084
         );
1097 1085
       }
1098 1086
       $output .= '</p>';
1099 1087
     }
1100
-  }
1101
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1088
+  } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1102 1089
     // If this user does not have a transfer request pending, but new requests
1103 1090
     // are not allowed, set the deadline to 90 days instead of 60 (as the user
1104 1091
     // who made the request has 30 additional days to assume foundership if 
@@ -1111,15 +1098,13 @@  discard block
 block discarded – undo
1111 1098
     );
1112 1099
     if ($days_to_deadline == 1) {
1113 1100
       $output .= ' (' . bts('1 day remaining') . ')';
1114
-    }
1115
-    else {
1101
+    } else {
1116 1102
       $output .= ' (' . bts('@count days remaining',
1117 1103
         array('@count' => $days_to_deadline)
1118 1104
       ) . ')';
1119 1105
     }
1120 1106
     $output .= '</p>';
1121
-  }
1122
-  else {
1107
+  } else {
1123 1108
     $output .= '<p>' . bts('If the team founder is not active and you want to'
1124 1109
       . ' assume the role of founder, click below to request foundership of'
1125 1110
       . ' @this_team.',
@@ -1165,8 +1150,7 @@  discard block
 block discarded – undo
1165 1150
         $boincteam_id
1166 1151
       );
1167 1152
       db_set_active('default');
1168
-    }
1169
-    else {
1153
+    } else {
1170 1154
       $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1171 1155
       $output .= '<h2 class="pane-title">' . bts('Respond to transfer request')
1172 1156
         . '</h2>';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
  */
194 194
 function boincteam_delete($team_id) {
195 195
   $team = node_load($team_id);
196
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
196
+  $boincteam = boincteam_load(boincteam_lookup_id($team_id), true);
197 197
   if ($boincteam->nusers == 1) {
198 198
     require_boinc('team');
199 199
     $boincuser = boincuser_load();
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
   else {
210 210
     drupal_set_message(t('All members must be removed from @team before the
211 211
       team can be deleted.', array('@team' => $boincteam->name)), 'error');
212
-    drupal_goto(strstr($_GET['q'], '/delete', TRUE));
212
+    drupal_goto(strstr($_GET['q'], '/delete', true));
213 213
   }
214 214
 }
215 215
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 /**
239 239
  * Get the join date of a user
240 240
  */
241
-function boincteam_get_member_join_date($boincteam_id, $boincuser_id = NULL) {
241
+function boincteam_get_member_join_date($boincteam_id, $boincuser_id = null) {
242 242
   if (!$boincuser_id) {
243 243
     global $user;
244 244
     $account = user_load($user->uid);
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
 /**
337 337
  * Get a BOINC team object
338 338
  */
339
-function boincteam_load($boincteam_id, $full_object = FALSE) {
339
+function boincteam_load($boincteam_id, $full_object = false) {
340 340
   require_boinc(array('team'));
341 341
   $team = BoincTeam::lookup_id($boincteam_id);
342
-  if ($team AND $full_object) {
342
+  if ($team and $full_object) {
343 343
     $team->nusers = BoincUser::count("teamid={$team->id}");
344 344
     $team->nusers_worked = BoincUser::count("teamid={$team->id} and total_credit>0");
345 345
     $team->nusers_active = BoincUser::count("teamid={$team->id} and expavg_credit>0.1");
@@ -354,39 +354,39 @@  discard block
 block discarded – undo
354 354
 /**
355 355
  * Check if a user is the team founder
356 356
  */
357
-function boincteam_is_founder($nid, $uid = NULL) {
357
+function boincteam_is_founder($nid, $uid = null) {
358 358
   if (!$uid) {
359 359
     global $user;
360 360
     $uid = $user->uid;
361 361
   }
362 362
   if (!boincteam_is_member($nid, $uid)) {
363
-    return FALSE;
363
+    return false;
364 364
   }
365 365
   $team_id = boincteam_lookup_id($nid);
366 366
   require_boinc('team');
367
-  return is_team_founder(boincuser_load($uid, TRUE), boincteam_load($team_id));
367
+  return is_team_founder(boincuser_load($uid, true), boincteam_load($team_id));
368 368
 }
369 369
 
370 370
 /**
371 371
  * Check if a user is a team admin
372 372
  */
373
-function boincteam_is_admin($nid, $uid = NULL) {
373
+function boincteam_is_admin($nid, $uid = null) {
374 374
   if (!$uid) {
375 375
     global $user;
376 376
     $uid = $user->uid;
377 377
   }
378 378
   if (!boincteam_is_member($nid, $uid)) {
379
-    return FALSE;
379
+    return false;
380 380
   }
381 381
   $team_id = boincteam_lookup_id($nid);
382 382
   require_boinc('team');
383
-  return is_team_admin(boincuser_load($uid, TRUE), boincteam_load($team_id));
383
+  return is_team_admin(boincuser_load($uid, true), boincteam_load($team_id));
384 384
 }
385 385
 
386 386
 /**
387 387
  * Check if a user is a team member
388 388
  */
389
-function boincteam_is_member($nid, $uid = NULL) {
389
+function boincteam_is_member($nid, $uid = null) {
390 390
   if (!$uid) {
391 391
     global $user;
392 392
     $uid = $user->uid;
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
               'A foundership transfer request has been made for your team. Please !respond.',
416 416
               array('!respond' => l(bts('respond to the request'), $foundership_url))
417 417
             ),
418
-            'warning', FALSE
418
+            'warning', false
419 419
           );
420 420
         }
421 421
       }
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
   
433 433
   $boincteam_id = boincteam_lookup_id($team_id);
434 434
   $boincteam = boincteam_load($boincteam_id);
435
-  if ($boincteam->joinable AND $account->team != $team_id) {
435
+  if ($boincteam->joinable and $account->team != $team_id) {
436 436
     require_boinc('team');
437 437
     $boincuser = boincuser_load();
438 438
     if (user_join_team($boincteam, $boincuser)) {
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
   $boincteam = boincteam_load($boincteam_id);
552 552
   if ($account->team == $team_id) {
553 553
     require_boinc('team');
554
-    $boincuser = boincuser_load($user_id, TRUE);
554
+    $boincuser = boincuser_load($user_id, true);
555 555
     user_quit_team($boincuser);
556 556
     drupal_set_message(t('@user has been removed from @team.',
557 557
       array(
@@ -673,14 +673,14 @@  discard block
 block discarded – undo
673 673
   $now = time();
674 674
   if ($boincteam->ping_user <= 0) {
675 675
     if ($boincteam->ping_time < $now - 60 * (24*60*60)) {
676
-      return TRUE;
676
+      return true;
677 677
     }
678
-    return FALSE;
678
+    return false;
679 679
   }
680 680
   if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
681
-    return TRUE;
681
+    return true;
682 682
   }
683
-  return FALSE;
683
+  return false;
684 684
 }
685 685
 
686 686
 /** 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 /**
702 702
  * Check if a user has an active foundership request with a team
703 703
  */
704
-function boincteam_user_requested_foundership($team_id, $user_id = NULL) {
704
+function boincteam_user_requested_foundership($team_id, $user_id = null) {
705 705
   if (!$user_id) {
706 706
     global $user;
707 707
     $user_id = $user->uid;
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 /**
836 836
  * Link to user's team
837 837
  */
838
-function boincteam_dashboard_panel($uid = NULL) {
838
+function boincteam_dashboard_panel($uid = null) {
839 839
   if (!$uid) {
840 840
     global $user;
841 841
     $uid = $user->uid;
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
   if ($team->type != "team") {
1264 1264
     return;
1265 1265
   }
1266
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
1266
+  $boincteam = boincteam_load(boincteam_lookup_id($team_id), true);
1267 1267
   $founder = user_load(get_drupal_id($boincteam->userid));
1268 1268
   $new_members = array();
1269 1269
   if ($boincteam->new_members) {
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/boincteam.views.inc 3 patches
Indentation   +206 added lines, -206 removed lines patch added patch discarded remove patch
@@ -13,103 +13,103 @@  discard block
 block discarded – undo
13 13
  */
14 14
 function boincteam_views_data() {
15 15
   
16
-  // -----------------------------------------------------------------------------------------------
17
-  // Definition for team table
18
-  // -----------------------------------------------------------------------------------------------
16
+    // -----------------------------------------------------------------------------------------------
17
+    // Definition for team table
18
+    // -----------------------------------------------------------------------------------------------
19 19
   
20
-  $data['team']['table']['group'] = t('BOINC');
20
+    $data['team']['table']['group'] = t('BOINC');
21 21
   
22
-  $data['team']['table']['base'] = array(
23
-      'field' => 'id',
24
-      'title' => t('BOINC team'),
25
-      'help' => t('BOINC data for a team'),
26
-      'database' => 'boinc'
27
-  );
22
+    $data['team']['table']['base'] = array(
23
+        'field' => 'id',
24
+        'title' => t('BOINC team'),
25
+        'help' => t('BOINC data for a team'),
26
+        'database' => 'boinc'
27
+    );
28 28
   
29
-  // This table references the {user} table.
30
-  // This join creates an 'implicit' relationship to the user table, so that when
31
-  // "User" is the base table, the fields are automatically available.
29
+    // This table references the {user} table.
30
+    // This join creates an 'implicit' relationship to the user table, so that when
31
+    // "User" is the base table, the fields are automatically available.
32 32
   
33
-  // Index this array by the table name to which this table refers.
34
-  // 'left_field' is the primary key in the referenced table.
35
-  // 'field' is the foreign key in this table.
33
+    // Index this array by the table name to which this table refers.
34
+    // 'left_field' is the primary key in the referenced table.
35
+    // 'field' is the foreign key in this table.
36 36
   
37
-  $data['team']['table']['join'] = array(
37
+    $data['team']['table']['join'] = array(
38 38
     'user' => array(
39
-      'left_field' => 'id',
40
-      'field' => 'userid',
39
+        'left_field' => 'id',
40
+        'field' => 'userid',
41 41
     ),
42
-  );
42
+    );
43 43
 
44
-  // Describe each of the individual fields in this table to Views. For
45
-  // each field, you may define what field, sort, argument, and/or filter
46
-  // handlers it supports. This will determine where in the Views interface you
47
-  // may use the field.
44
+    // Describe each of the individual fields in this table to Views. For
45
+    // each field, you may define what field, sort, argument, and/or filter
46
+    // handlers it supports. This will determine where in the Views interface you
47
+    // may use the field.
48 48
   
49
-  // Primary keys allowed as arguments
49
+    // Primary keys allowed as arguments
50 50
   
51
-  $data['team']['id'] = array(
51
+    $data['team']['id'] = array(
52 52
     'title' => bts('Id'),
53 53
     'help' => t('The BOINC ID of the team.'),
54 54
     'field' => array(
55
-      'handler' => 'views_handler_field_numeric',
56
-      'click sortable' => TRUE
55
+        'handler' => 'views_handler_field_numeric',
56
+        'click sortable' => TRUE
57 57
     ),
58 58
     'argument' => array(
59
-      'handler' => 'views_handler_argument_boincteam_id', // custom handler
60
-      'name field' => 'title', // the field to display in the summary.
61
-      'numeric' => TRUE,
62
-      'validate type' => 'id'
59
+        'handler' => 'views_handler_argument_boincteam_id', // custom handler
60
+        'name field' => 'title', // the field to display in the summary.
61
+        'numeric' => TRUE,
62
+        'validate type' => 'id'
63 63
     ),
64 64
     'relationship' => array(
65
-      'base' => 'team_delta',
66
-      'field' => 'id',
67
-      'base field' => 'teamid',
68
-      'handler' => 'views_handler_relationship',
69
-      'label' => t('Team History')
65
+        'base' => 'team_delta',
66
+        'field' => 'id',
67
+        'base field' => 'teamid',
68
+        'handler' => 'views_handler_relationship',
69
+        'label' => t('Team History')
70 70
     ),
71 71
     'filter' => array(
72
-      'handler' => 'views_handler_filter_numeric'
72
+        'handler' => 'views_handler_filter_numeric'
73 73
     ),
74 74
     'sort' => array(
75
-      'handler' => 'views_handler_sort_numeric'
75
+        'handler' => 'views_handler_sort_numeric'
76 76
     )
77
-  );
77
+    );
78 78
   
79
-  // Foreign key fields
79
+    // Foreign key fields
80 80
   
81
-  $data['team']['userid'] = array(
81
+    $data['team']['userid'] = array(
82 82
     'title' => bts('Founder'),
83 83
     'help' => t('The founder of this team.'),
84 84
     // This is a foreign key to the {user} table. When the view is configured
85 85
     // with this relationship, all the fields for the related user node will be 
86 86
     // available.
87 87
     'argument' => array(
88
-      'handler' => 'views_handler_argument_boincuser_id',
89
-      'name field' => 'title',
90
-      'numeric' => TRUE,
91
-      'validate type' => 'id'
88
+        'handler' => 'views_handler_argument_boincuser_id',
89
+        'name field' => 'title',
90
+        'numeric' => TRUE,
91
+        'validate type' => 'id'
92 92
     ),
93 93
     'relationship' => array(
94
-      'base' => 'user',
95
-      'field' => 'userid',
96
-      'handler' => 'views_handler_relationship',
97
-      'label' => t('User')
94
+        'base' => 'user',
95
+        'field' => 'userid',
96
+        'handler' => 'views_handler_relationship',
97
+        'label' => t('User')
98 98
     ),
99 99
     'field' => array(
100
-      'handler' => 'views_handler_field_numeric',
101
-      'click sortable' => TRUE
100
+        'handler' => 'views_handler_field_numeric',
101
+        'click sortable' => TRUE
102 102
     ),
103 103
     'filter' => array(
104
-      'handler' => 'views_handler_filter_numeric'
104
+        'handler' => 'views_handler_filter_numeric'
105 105
     ),
106 106
     'sort' => array(
107
-      'handler' => 'views_handler_sort_numeric'
107
+        'handler' => 'views_handler_sort_numeric'
108 108
     )
109
-  );
109
+    );
110 110
   
111
-  // Descriptions of general fields (alphabetized)
112
-  /*
111
+    // Descriptions of general fields (alphabetized)
112
+    /*
113 113
   $data['team']['create_time'] = array(
114 114
     'title' => bts('Team established'),
115 115
     'help' => t('When the BOINC team was created.'),
@@ -140,298 +140,298 @@  discard block
 block discarded – undo
140 140
   );
141 141
   */
142 142
    
143
-  $data['team']['country'] = array(
143
+    $data['team']['country'] = array(
144 144
     'title' => bts('Country'),
145 145
     'help' => t('The country of a team.'),
146 146
     'field' => array(
147
-      'handler' => 'views_handler_field',
148
-      'click sortable' => TRUE
147
+        'handler' => 'views_handler_field',
148
+        'click sortable' => TRUE
149 149
     ),
150 150
     'filter' => array(
151
-      'handler' => 'views_handler_filter_string'
151
+        'handler' => 'views_handler_filter_string'
152 152
     ),
153 153
     'sort' => array(
154
-      'handler' => 'views_handler_sort_string'
154
+        'handler' => 'views_handler_sort_string'
155 155
     )
156
-  );
157
-  $data['team']['expavg_credit'] = array(
156
+    );
157
+    $data['team']['expavg_credit'] = array(
158 158
     'title' => bts('Recent average credit'),
159 159
     'help' => t('A decaying average of team credit per day.'),
160 160
     'field' => array(
161
-      'handler' => 'views_handler_field_numeric',
162
-      'click sortable' => TRUE,
163
-      'float' => TRUE
161
+        'handler' => 'views_handler_field_numeric',
162
+        'click sortable' => TRUE,
163
+        'float' => TRUE
164 164
     ),
165 165
     'filter' => array(
166
-      'handler' => 'views_handler_filter_numeric'
166
+        'handler' => 'views_handler_filter_numeric'
167 167
     ),
168 168
     'sort' => array(
169
-      'handler' => 'views_handler_sort_numeric'
169
+        'handler' => 'views_handler_sort_numeric'
170 170
     )
171
-  );
172
-  $data['team']['name'] = array(
171
+    );
172
+    $data['team']['name'] = array(
173 173
     'title' => bts('Name'),
174 174
     'help' => t('The name of the team.'),
175 175
     'field' => array(
176
-      'handler' => 'views_handler_field',
177
-      'click sortable' => TRUE
176
+        'handler' => 'views_handler_field',
177
+        'click sortable' => TRUE
178 178
     ),
179 179
     'filter' => array(
180
-      'handler' => 'views_handler_filter_string'
180
+        'handler' => 'views_handler_filter_string'
181 181
     ),
182 182
     'sort' => array(
183
-      'handler' => 'views_handler_sort_string'
183
+        'handler' => 'views_handler_sort_string'
184 184
     )
185
-  );
186
-  $data['team']['nusers'] = array(
185
+    );
186
+    $data['team']['nusers'] = array(
187 187
     'title' => bts('Members'),
188 188
     'help' => t('Count of team members.'),
189 189
     'field' => array(
190
-      'handler' => 'views_handler_field_numeric',
191
-      'click sortable' => TRUE
190
+        'handler' => 'views_handler_field_numeric',
191
+        'click sortable' => TRUE
192 192
     ),
193 193
     'filter' => array(
194
-      'handler' => 'views_handler_filter_numeric'
194
+        'handler' => 'views_handler_filter_numeric'
195 195
     ),
196 196
     'sort' => array(
197
-      'handler' => 'views_handler_sort_numeric'
197
+        'handler' => 'views_handler_sort_numeric'
198 198
     )
199
-  );
200
-  $data['team']['total_credit'] = array(
199
+    );
200
+    $data['team']['total_credit'] = array(
201 201
     'title' => bts('Total Credit'),
202 202
     'help' => t('The total team accumulated BOINC credit.'),
203 203
     'field' => array(
204
-      'handler' => 'views_handler_field_numeric',
205
-      'click sortable' => TRUE,
206
-      'float' => TRUE
204
+        'handler' => 'views_handler_field_numeric',
205
+        'click sortable' => TRUE,
206
+        'float' => TRUE
207 207
     ),
208 208
     'filter' => array(
209
-      'handler' => 'views_handler_filter_numeric'
209
+        'handler' => 'views_handler_filter_numeric'
210 210
     ),
211 211
     'sort' => array(
212
-      'handler' => 'views_handler_sort_numeric'
212
+        'handler' => 'views_handler_sort_numeric'
213 213
     )
214
-  );
214
+    );
215 215
   
216
-  // -----------------------------------------------------------------------------------------------
217
-  // Definition for team_admin table
218
-  // -----------------------------------------------------------------------------------------------
216
+    // -----------------------------------------------------------------------------------------------
217
+    // Definition for team_admin table
218
+    // -----------------------------------------------------------------------------------------------
219 219
   
220
-  $data['team_admin']['table']['group'] = t('BOINC');
220
+    $data['team_admin']['table']['group'] = t('BOINC');
221 221
   
222
-  $data['team_admin']['table']['base'] = array(
223
-      'field' => 'id',
224
-      'title' => t('BOINC team admins'),
225
-      'help' => t('BOINC admins for a team'),
226
-      'database' => 'boinc'
227
-  );
222
+    $data['team_admin']['table']['base'] = array(
223
+        'field' => 'id',
224
+        'title' => t('BOINC team admins'),
225
+        'help' => t('BOINC admins for a team'),
226
+        'database' => 'boinc'
227
+    );
228 228
   
229
-  // This table references the {team} table.
230
-  // This join creates an 'implicit' relationship to the team table, so that when
231
-  // "Team" is the base table, the fields are automatically available.
229
+    // This table references the {team} table.
230
+    // This join creates an 'implicit' relationship to the team table, so that when
231
+    // "Team" is the base table, the fields are automatically available.
232 232
   
233
-  // Index this array by the table name to which this table refers.
234
-  // 'left_field' is the primary key in the referenced table.
235
-  // 'field' is the foreign key in this table.
233
+    // Index this array by the table name to which this table refers.
234
+    // 'left_field' is the primary key in the referenced table.
235
+    // 'field' is the foreign key in this table.
236 236
   
237
-  $data['team_admin']['table']['join'] = array(
237
+    $data['team_admin']['table']['join'] = array(
238 238
     'team' => array(
239
-      'left_field' => 'id',
240
-      'field' => 'teamid',
239
+        'left_field' => 'id',
240
+        'field' => 'teamid',
241 241
     ),
242
-  );
242
+    );
243 243
 
244
-  // Describe each of the individual fields in this table to Views. For
245
-  // each field, you may define what field, sort, argument, and/or filter
246
-  // handlers it supports. This will determine where in the Views interface you
247
-  // may use the field.
244
+    // Describe each of the individual fields in this table to Views. For
245
+    // each field, you may define what field, sort, argument, and/or filter
246
+    // handlers it supports. This will determine where in the Views interface you
247
+    // may use the field.
248 248
   
249
-  // Primary keys allowed as arguments
249
+    // Primary keys allowed as arguments
250 250
   
251
-  $data['team_admin']['teamid'] = array(
251
+    $data['team_admin']['teamid'] = array(
252 252
     'title' => bts('Id'),
253 253
     'help' => t('The BOINC ID of the team on which this user is an admin.'),
254 254
     'field' => array(
255
-      'handler' => 'views_handler_field_numeric',
256
-      'click sortable' => TRUE
255
+        'handler' => 'views_handler_field_numeric',
256
+        'click sortable' => TRUE
257 257
     ),
258 258
     'argument' => array(
259
-      'handler' => 'views_handler_argument_boincteam_id', // custom handler
260
-      'name field' => 'title', // the field to display in the summary.
261
-      'numeric' => TRUE,
262
-      'validate type' => 'id'
259
+        'handler' => 'views_handler_argument_boincteam_id', // custom handler
260
+        'name field' => 'title', // the field to display in the summary.
261
+        'numeric' => TRUE,
262
+        'validate type' => 'id'
263 263
     ),
264 264
     'relationship' => array(
265
-      'base' => 'team',
266
-      'field' => 'teamid',
267
-      'handler' => 'views_handler_relationship',
268
-      'label' => t('Team')
265
+        'base' => 'team',
266
+        'field' => 'teamid',
267
+        'handler' => 'views_handler_relationship',
268
+        'label' => t('Team')
269 269
     ),
270 270
     'filter' => array(
271
-      'handler' => 'views_handler_filter_numeric'
271
+        'handler' => 'views_handler_filter_numeric'
272 272
     ),
273 273
     'sort' => array(
274
-      'handler' => 'views_handler_sort_numeric'
274
+        'handler' => 'views_handler_sort_numeric'
275 275
     )
276
-  );
276
+    );
277 277
   
278
-  // Foreign key fields
278
+    // Foreign key fields
279 279
   
280
-  $data['team_admin']['userid'] = array(
280
+    $data['team_admin']['userid'] = array(
281 281
     'title' => bts('User ID'),
282 282
     'help' => t('The user that is a team admin.'),
283 283
     // This is a foreign key to the {user} table. When the view is configured
284 284
     // with this relationship, all the fields for the related user node will be 
285 285
     // available.
286 286
     'argument' => array(
287
-      'handler' => 'views_handler_argument_boincteam_id',
288
-      'name field' => 'title',
289
-      'numeric' => TRUE,
290
-      'validate type' => 'id'
287
+        'handler' => 'views_handler_argument_boincteam_id',
288
+        'name field' => 'title',
289
+        'numeric' => TRUE,
290
+        'validate type' => 'id'
291 291
     ),
292 292
     'relationship' => array(
293
-      'base' => 'user',
294
-      'field' => 'userid',
295
-      'handler' => 'views_handler_relationship',
296
-      'label' => bts('User')
293
+        'base' => 'user',
294
+        'field' => 'userid',
295
+        'handler' => 'views_handler_relationship',
296
+        'label' => bts('User')
297 297
     ),
298 298
     'field' => array(
299
-      'handler' => 'views_handler_field_numeric',
300
-      'click sortable' => TRUE
299
+        'handler' => 'views_handler_field_numeric',
300
+        'click sortable' => TRUE
301 301
     ),
302 302
     'filter' => array(
303
-      'handler' => 'views_handler_filter_numeric'
303
+        'handler' => 'views_handler_filter_numeric'
304 304
     ),
305 305
     'sort' => array(
306
-      'handler' => 'views_handler_sort_numeric'
306
+        'handler' => 'views_handler_sort_numeric'
307 307
     )
308
-  );
308
+    );
309 309
   
310
-  // Descriptions of general fields (alphabetized)
310
+    // Descriptions of general fields (alphabetized)
311 311
   
312
-  $data['team_admin']['create_time'] = array(
312
+    $data['team_admin']['create_time'] = array(
313 313
     'title' => bts('Admin since'),
314 314
     'help' => t('When the BOINC user became a team admin.'),
315 315
     'field' => array(
316
-      'handler' => 'views_handler_field_date',
317
-      'click sortable' => TRUE
316
+        'handler' => 'views_handler_field_date',
317
+        'click sortable' => TRUE
318 318
     ),
319 319
     'filter' => array(
320
-      'handler' => 'views_handler_filter_date'
320
+        'handler' => 'views_handler_filter_date'
321 321
     ),
322 322
     'sort' => array(
323
-      'handler' => 'views_handler_sort_date'
323
+        'handler' => 'views_handler_sort_date'
324 324
     )
325
-  );
325
+    );
326 326
   
327
-  // -----------------------------------------------------------------------------------------------
328
-  // Definition for team_delta table
329
-  // -----------------------------------------------------------------------------------------------
327
+    // -----------------------------------------------------------------------------------------------
328
+    // Definition for team_delta table
329
+    // -----------------------------------------------------------------------------------------------
330 330
   
331
-  $data['team_delta']['table']['group'] = t('BOINC');
331
+    $data['team_delta']['table']['group'] = t('BOINC');
332 332
 
333
-  // Describe each of the individual fields in this table to Views. For
334
-  // each field, you may define what field, sort, argument, and/or filter
335
-  // handlers it supports. This will determine where in the Views interface you
336
-  // may use the field.
333
+    // Describe each of the individual fields in this table to Views. For
334
+    // each field, you may define what field, sort, argument, and/or filter
335
+    // handlers it supports. This will determine where in the Views interface you
336
+    // may use the field.
337 337
   
338
-  // Primary keys allowed as arguments
338
+    // Primary keys allowed as arguments
339 339
   
340
-  $data['team_delta']['teamid'] = array(
340
+    $data['team_delta']['teamid'] = array(
341 341
     'title' => bts('Team ID'),
342 342
     'help' => t('The team ID for this team history event.'),
343 343
     // This is a foreign key to the {team} table. When the view is configured
344 344
     // with this relationship, all the fields for the related user node will be 
345 345
     // available.
346 346
     'argument' => array(
347
-      'handler' => 'views_handler_argument_boincteam_id',
348
-      'name field' => 'title',
349
-      'numeric' => TRUE,
350
-      'validate type' => 'id'
347
+        'handler' => 'views_handler_argument_boincteam_id',
348
+        'name field' => 'title',
349
+        'numeric' => TRUE,
350
+        'validate type' => 'id'
351 351
     ),
352 352
     'field' => array(
353
-      'handler' => 'views_handler_field_numeric',
354
-      'click sortable' => TRUE
353
+        'handler' => 'views_handler_field_numeric',
354
+        'click sortable' => TRUE
355 355
     ),
356 356
     'filter' => array(
357
-      'handler' => 'views_handler_filter_numeric'
357
+        'handler' => 'views_handler_filter_numeric'
358 358
     ),
359 359
     'sort' => array(
360
-      'handler' => 'views_handler_sort_numeric'
360
+        'handler' => 'views_handler_sort_numeric'
361 361
     )
362
-  );
362
+    );
363 363
   
364
-  // Foreign key fields
364
+    // Foreign key fields
365 365
   
366
-  $data['team_delta']['userid'] = array(
366
+    $data['team_delta']['userid'] = array(
367 367
     'title' => bts('User ID'),
368 368
     'help' => t('The user for this team history event.'),
369 369
     'relationship' => array(
370
-      'base' => 'user',
371
-      'field' => 'userid',
372
-      'handler' => 'views_handler_relationship',
373
-      'label' => t('User')
370
+        'base' => 'user',
371
+        'field' => 'userid',
372
+        'handler' => 'views_handler_relationship',
373
+        'label' => t('User')
374 374
     ),
375 375
     'field' => array(
376
-      'handler' => 'views_handler_field_numeric',
377
-      'click sortable' => TRUE
376
+        'handler' => 'views_handler_field_numeric',
377
+        'click sortable' => TRUE
378 378
     ),
379 379
     'filter' => array(
380
-      'handler' => 'views_handler_filter_numeric'
380
+        'handler' => 'views_handler_filter_numeric'
381 381
     ),
382 382
     'sort' => array(
383
-      'handler' => 'views_handler_sort_numeric'
383
+        'handler' => 'views_handler_sort_numeric'
384 384
     )
385
-  );
385
+    );
386 386
   
387
-  // Descriptions of general fields (alphabetized)
387
+    // Descriptions of general fields (alphabetized)
388 388
   
389
-  $data['team_delta']['joining'] = array(
389
+    $data['team_delta']['joining'] = array(
390 390
     'title' => bts('User joined'),
391 391
     'help' => t('Whether the event is the user joining the team or leaving.'),
392 392
     'field' => array(
393
-      'handler' => 'views_handler_field_numeric',
394
-      'click sortable' => TRUE
393
+        'handler' => 'views_handler_field_numeric',
394
+        'click sortable' => TRUE
395 395
     ),
396 396
     'filter' => array(
397
-      'handler' => 'views_handler_filter_numeric'
397
+        'handler' => 'views_handler_filter_numeric'
398 398
     ),
399 399
     'sort' => array(
400
-      'handler' => 'views_handler_sort_numeric'
400
+        'handler' => 'views_handler_sort_numeric'
401 401
     )
402
-  );
403
-  $data['team_delta']['timestamp'] = array(
402
+    );
403
+    $data['team_delta']['timestamp'] = array(
404 404
     'title' => bts('Timestamp'),
405 405
     'help' => t('When the BOINC team history event took place.'),
406 406
     'field' => array(
407
-      'handler' => 'views_handler_field_date',
408
-      'click sortable' => TRUE
407
+        'handler' => 'views_handler_field_date',
408
+        'click sortable' => TRUE
409 409
     ),
410 410
     'filter' => array(
411
-      'handler' => 'views_handler_filter_date'
411
+        'handler' => 'views_handler_filter_date'
412 412
     ),
413 413
     'sort' => array(
414
-      'handler' => 'views_handler_sort_date'
414
+        'handler' => 'views_handler_sort_date'
415 415
     )
416
-  );
417
-  $data['team_delta']['total_credit'] = array(
416
+    );
417
+    $data['team_delta']['total_credit'] = array(
418 418
     'title' => bts('Total Credit'),
419 419
     'help' => t('The total accumulated BOINC credit of the user when the
420 420
       history event took place.'),
421 421
     'field' => array(
422
-      'handler' => 'views_handler_field_numeric',
423
-      'click sortable' => TRUE,
424
-      'float' => TRUE
422
+        'handler' => 'views_handler_field_numeric',
423
+        'click sortable' => TRUE,
424
+        'float' => TRUE
425 425
     ),
426 426
     'filter' => array(
427
-      'handler' => 'views_handler_filter_numeric'
427
+        'handler' => 'views_handler_filter_numeric'
428 428
     ),
429 429
     'sort' => array(
430
-      'handler' => 'views_handler_sort_numeric'
430
+        'handler' => 'views_handler_sort_numeric'
431 431
     )
432
-  ); 
432
+    ); 
433 433
   
434
-  return $data;
434
+    return $data;
435 435
 }
436 436
 
437 437
 /*
@@ -442,14 +442,14 @@  discard block
 block discarded – undo
442 442
  */
443 443
 
444 444
 function boincteam_views_handlers() {
445
-  return array(
445
+    return array(
446 446
     'info' => array(
447
-      'path' => drupal_get_path('module', 'boincteam') . '/views',
447
+        'path' => drupal_get_path('module', 'boincteam') . '/views',
448 448
     ),
449 449
     'handlers' => array(
450
-      'views_handler_argument_boincteam_id' => array(
450
+        'views_handler_argument_boincteam_id' => array(
451 451
         'parent' => 'views_handler_argument_numeric'
452
-      )
452
+        )
453 453
     )
454
-  );
454
+    );
455 455
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -444,7 +444,7 @@
 block discarded – undo
444 444
 function boincteam_views_handlers() {
445 445
   return array(
446 446
     'info' => array(
447
-      'path' => drupal_get_path('module', 'boincteam') . '/views',
447
+      'path' => drupal_get_path('module', 'boincteam').'/views',
448 448
     ),
449 449
     'handlers' => array(
450 450
       'views_handler_argument_boincteam_id' => array(
Please login to merge, or discard this patch.
Upper-Lower-Casing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
     'help' => t('The BOINC ID of the team.'),
54 54
     'field' => array(
55 55
       'handler' => 'views_handler_field_numeric',
56
-      'click sortable' => TRUE
56
+      'click sortable' => true
57 57
     ),
58 58
     'argument' => array(
59 59
       'handler' => 'views_handler_argument_boincteam_id', // custom handler
60 60
       'name field' => 'title', // the field to display in the summary.
61
-      'numeric' => TRUE,
61
+      'numeric' => true,
62 62
       'validate type' => 'id'
63 63
     ),
64 64
     'relationship' => array(
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     'argument' => array(
88 88
       'handler' => 'views_handler_argument_boincuser_id',
89 89
       'name field' => 'title',
90
-      'numeric' => TRUE,
90
+      'numeric' => true,
91 91
       'validate type' => 'id'
92 92
     ),
93 93
     'relationship' => array(
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     ),
99 99
     'field' => array(
100 100
       'handler' => 'views_handler_field_numeric',
101
-      'click sortable' => TRUE
101
+      'click sortable' => true
102 102
     ),
103 103
     'filter' => array(
104 104
       'handler' => 'views_handler_filter_numeric'
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     'help' => t('The country of a team.'),
146 146
     'field' => array(
147 147
       'handler' => 'views_handler_field',
148
-      'click sortable' => TRUE
148
+      'click sortable' => true
149 149
     ),
150 150
     'filter' => array(
151 151
       'handler' => 'views_handler_filter_string'
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
     'help' => t('A decaying average of team credit per day.'),
160 160
     'field' => array(
161 161
       'handler' => 'views_handler_field_numeric',
162
-      'click sortable' => TRUE,
163
-      'float' => TRUE
162
+      'click sortable' => true,
163
+      'float' => true
164 164
     ),
165 165
     'filter' => array(
166 166
       'handler' => 'views_handler_filter_numeric'
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     'help' => t('The name of the team.'),
175 175
     'field' => array(
176 176
       'handler' => 'views_handler_field',
177
-      'click sortable' => TRUE
177
+      'click sortable' => true
178 178
     ),
179 179
     'filter' => array(
180 180
       'handler' => 'views_handler_filter_string'
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     'help' => t('Count of team members.'),
189 189
     'field' => array(
190 190
       'handler' => 'views_handler_field_numeric',
191
-      'click sortable' => TRUE
191
+      'click sortable' => true
192 192
     ),
193 193
     'filter' => array(
194 194
       'handler' => 'views_handler_filter_numeric'
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
     'help' => t('The total team accumulated BOINC credit.'),
203 203
     'field' => array(
204 204
       'handler' => 'views_handler_field_numeric',
205
-      'click sortable' => TRUE,
206
-      'float' => TRUE
205
+      'click sortable' => true,
206
+      'float' => true
207 207
     ),
208 208
     'filter' => array(
209 209
       'handler' => 'views_handler_filter_numeric'
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
     'help' => t('The BOINC ID of the team on which this user is an admin.'),
254 254
     'field' => array(
255 255
       'handler' => 'views_handler_field_numeric',
256
-      'click sortable' => TRUE
256
+      'click sortable' => true
257 257
     ),
258 258
     'argument' => array(
259 259
       'handler' => 'views_handler_argument_boincteam_id', // custom handler
260 260
       'name field' => 'title', // the field to display in the summary.
261
-      'numeric' => TRUE,
261
+      'numeric' => true,
262 262
       'validate type' => 'id'
263 263
     ),
264 264
     'relationship' => array(
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     'argument' => array(
287 287
       'handler' => 'views_handler_argument_boincteam_id',
288 288
       'name field' => 'title',
289
-      'numeric' => TRUE,
289
+      'numeric' => true,
290 290
       'validate type' => 'id'
291 291
     ),
292 292
     'relationship' => array(
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     ),
298 298
     'field' => array(
299 299
       'handler' => 'views_handler_field_numeric',
300
-      'click sortable' => TRUE
300
+      'click sortable' => true
301 301
     ),
302 302
     'filter' => array(
303 303
       'handler' => 'views_handler_filter_numeric'
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     'help' => t('When the BOINC user became a team admin.'),
315 315
     'field' => array(
316 316
       'handler' => 'views_handler_field_date',
317
-      'click sortable' => TRUE
317
+      'click sortable' => true
318 318
     ),
319 319
     'filter' => array(
320 320
       'handler' => 'views_handler_filter_date'
@@ -346,12 +346,12 @@  discard block
 block discarded – undo
346 346
     'argument' => array(
347 347
       'handler' => 'views_handler_argument_boincteam_id',
348 348
       'name field' => 'title',
349
-      'numeric' => TRUE,
349
+      'numeric' => true,
350 350
       'validate type' => 'id'
351 351
     ),
352 352
     'field' => array(
353 353
       'handler' => 'views_handler_field_numeric',
354
-      'click sortable' => TRUE
354
+      'click sortable' => true
355 355
     ),
356 356
     'filter' => array(
357 357
       'handler' => 'views_handler_filter_numeric'
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
     ),
375 375
     'field' => array(
376 376
       'handler' => 'views_handler_field_numeric',
377
-      'click sortable' => TRUE
377
+      'click sortable' => true
378 378
     ),
379 379
     'filter' => array(
380 380
       'handler' => 'views_handler_filter_numeric'
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     'help' => t('Whether the event is the user joining the team or leaving.'),
392 392
     'field' => array(
393 393
       'handler' => 'views_handler_field_numeric',
394
-      'click sortable' => TRUE
394
+      'click sortable' => true
395 395
     ),
396 396
     'filter' => array(
397 397
       'handler' => 'views_handler_filter_numeric'
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
     'help' => t('When the BOINC team history event took place.'),
406 406
     'field' => array(
407 407
       'handler' => 'views_handler_field_date',
408
-      'click sortable' => TRUE
408
+      'click sortable' => true
409 409
     ),
410 410
     'filter' => array(
411 411
       'handler' => 'views_handler_filter_date'
@@ -420,8 +420,8 @@  discard block
 block discarded – undo
420 420
       history event took place.'),
421 421
     'field' => array(
422 422
       'handler' => 'views_handler_field_numeric',
423
-      'click sortable' => TRUE,
424
-      'float' => TRUE
423
+      'click sortable' => true,
424
+      'float' => true
425 425
     ),
426 426
     'filter' => array(
427 427
       'handler' => 'views_handler_filter_numeric'
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincwork/boincwork.admin.inc 3 patches
Indentation   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -10,80 +10,80 @@  discard block
 block discarded – undo
10 10
  * Allow configuration of general options for preference pages
11 11
  */
12 12
 function boincwork_admin_prefs_options_form(&$form_state) {
13
-  $form = array(); 
14
-  $form['beta'] = array(
13
+    $form = array(); 
14
+    $form['beta'] = array(
15 15
     '#type' => 'checkbox',
16 16
     '#title' => t('Allow users to opt in to test beta applications'),
17 17
     '#default_value' => variable_get('boinc_prefs_options_beta', 0),
18 18
     '#required' => TRUE
19
-  );
20
-  $form['submit'] = array(
19
+    );
20
+    $form['submit'] = array(
21 21
     '#type' => 'submit',
22 22
     '#value' => t('Submit')
23
-  );
24
-  // Add the official mechanical things and return
25
-  //drupal_prepare_form('boincwork_admin_prefs_upload_form', $form, $form_state);
26
-  return $form;
23
+    );
24
+    // Add the official mechanical things and return
25
+    //drupal_prepare_form('boincwork_admin_prefs_upload_form', $form, $form_state);
26
+    return $form;
27 27
 } 
28 28
 
29 29
 /**
30
-  * Handle validation of preference general settings form.
31
-  */
30
+ * Handle validation of preference general settings form.
31
+ */
32 32
 function boincwork_admin_prefs_options_form_validate($form, &$form_state) {
33 33
 }
34 34
 
35 35
 /**
36
-  * Handle submission of preference general settings form.
37
-  */
36
+ * Handle submission of preference general settings form.
37
+ */
38 38
 function boincwork_admin_prefs_options_form_submit($form, &$form_state) {
39
-  variable_set('boinc_prefs_options_beta', $form_state['values']['beta']);
40
-  drupal_set_message('Preference options have been updated.');
39
+    variable_set('boinc_prefs_options_beta', $form_state['values']['beta']);
40
+    drupal_set_message('Preference options have been updated.');
41 41
 }
42 42
 
43 43
 /**
44 44
  * 
45 45
  */
46 46
 function boincwork_admin_prefs_upload_form(&$form_state) {
47
-  $form = array(); 
48
-  $form['prefs_xml'] = array(
47
+    $form = array(); 
48
+    $form['prefs_xml'] = array(
49 49
     '#type' => 'textarea',
50 50
     '#title' => t('Project specific preferences XML'),
51 51
     '#default_value' => variable_get('boinc_project_specific_prefs_config', "<project_specific_preferences>\n\n</project_specific_preferences>"),
52 52
     '#required' => TRUE
53
-  );
54
-  $form['submit'] = array(
53
+    );
54
+    $form['submit'] = array(
55 55
     '#type' => 'submit',
56 56
     '#value' => t('Submit')
57
-  );
58
-  // Add the official mechanical things and return
59
-  //drupal_prepare_form('boincwork_admin_prefs_upload_form', $form, $form_state);
60
-  return $form;
57
+    );
58
+    // Add the official mechanical things and return
59
+    //drupal_prepare_form('boincwork_admin_prefs_upload_form', $form, $form_state);
60
+    return $form;
61 61
 } 
62 62
 
63 63
 /**
64
-  * Handle validation of preference upload form.
65
-  */
64
+ * Handle validation of preference upload form.
65
+ */
66 66
 function boincwork_admin_prefs_upload_form_validate($form, &$form_state) {
67 67
   
68
-  $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd';
69
-  libxml_use_internal_errors(true);
70
-  $xml = new DomDocument();
71
-  $xml->loadXML($form_state['values']['prefs_xml'], LIBXML_NOBLANKS);
72
-  if (!$xml->schemaValidate($xsd)) {
68
+    $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd';
69
+    libxml_use_internal_errors(true);
70
+    $xml = new DomDocument();
71
+    $xml->loadXML($form_state['values']['prefs_xml'], LIBXML_NOBLANKS);
72
+    if (!$xml->schemaValidate($xsd)) {
73 73
     $errors = libxml_get_errors();
74 74
     $lines = explode("\r", $form_state['values']['prefs_xml']);
75 75
     drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}" .
76
-      ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
76
+        ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
77 77
     form_set_error('upload', t('XML file failed validation'));
78
-  }
78
+    }
79 79
 }
80 80
 
81 81
 /**
82
-  * Handle submission of preference upload form.
83
-  */
82
+ * Handle submission of preference upload form.
83
+ */
84 84
 function boincwork_admin_prefs_upload_form_submit($form, &$form_state) {
85
-  variable_set('boinc_project_specific_prefs_config', $form_state['values']['prefs_xml']);
86
-  drupal_set_message('The XML has been validated and any changes to
85
+    variable_set('boinc_project_specific_prefs_config', $form_state['values']['prefs_xml']);
86
+    drupal_set_message('The XML has been validated and any changes to
87 87
       preferences are now in place.');
88 88
 }
89 89
 
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
  * 
92 92
  */
93 93
 function boincwork_admin_prefs_presets_page($preset = 'standard') {
94
-  // Configure preference presets
95
-  if (function_exists('jump_quickly')) {
94
+    // Configure preference presets
95
+    if (function_exists('jump_quickly')) {
96 96
     $path = 'admin/boinc/prefs/presets';
97 97
     $preset_options = array(
98
-      "{$path}/standard" => t('Standard'),
99
-      "{$path}/maximum" => t('Maximum'),
100
-      "{$path}/green" => t('Green'),
101
-      "{$path}/minimum" => t('Minimum')
98
+        "{$path}/standard" => t('Standard'),
99
+        "{$path}/maximum" => t('Maximum'),
100
+        "{$path}/green" => t('Green'),
101
+        "{$path}/minimum" => t('Minimum')
102 102
     );
103 103
     variable_set('jump_use_js_presets-Array', 1);
104 104
     drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
     $output .= '<label>Preset:</label>';
107 107
     $output .= jump_quickly($preset_options, 'presets');
108 108
     $output .= '</div></div>';
109
-  }
110
-  $output .= drupal_get_form('boincwork_admin_prefs_presets_form', $preset);
109
+    }
110
+    $output .= drupal_get_form('boincwork_admin_prefs_presets_form', $preset);
111 111
 
112
-  $output .= '<div>';
113
-  $output .= bts('Usage: \'Save configuration\' will save the above preferences into the drupal database. These will be the preset computing (global) preferences that will fill in the preferences form once a user loads the Account Preferences page.');
114
-  $output .= '<p>';
115
-  $output .= bts('\'Save configuration with disk usage settings from config.xml\' will save the above preferences into the drupal database, but also load disk usage settings from the BOINC project\'s config.xml file. These will overwrite any disk usage settings you have placed above. Caution: A user\'s personal preferences will not change if you load the disk usage settings from config.xml here into the drupal database. They must change their preference settings manually.');
116
-  $output .= '</div>';
117
-  return $output;
112
+    $output .= '<div>';
113
+    $output .= bts('Usage: \'Save configuration\' will save the above preferences into the drupal database. These will be the preset computing (global) preferences that will fill in the preferences form once a user loads the Account Preferences page.');
114
+    $output .= '<p>';
115
+    $output .= bts('\'Save configuration with disk usage settings from config.xml\' will save the above preferences into the drupal database, but also load disk usage settings from the BOINC project\'s config.xml file. These will overwrite any disk usage settings you have placed above. Caution: A user\'s personal preferences will not change if you load the disk usage settings from config.xml here into the drupal database. They must change their preference settings manually.');
116
+    $output .= '</div>';
117
+    return $output;
118 118
 }
119 119
 
120 120
 /**
@@ -122,141 +122,141 @@  discard block
 block discarded – undo
122 122
  */
123 123
 function boincwork_admin_prefs_presets_form(&$form_state, $preset = 'standard') {
124 124
 
125
-  // Check database for preset prefs
126
-  if (!variable_get('boincwork_preset_prefs', null))
125
+    // Check database for preset prefs
126
+    if (!variable_get('boincwork_preset_prefs', null))
127 127
     drupal_set_message(bts('No presets found in database, loading a default set of preferences for each preset. These will be saved to the database once you click \'Save configuration\'.'), 'status');
128 128
 
129
-  // Load a copy of the general prefs form
130
-  $form = boincwork_generalprefs_form($form_state, NULL, $preset);
131
-  if ($key = array_search('boincwork_generalprefs_form_submit', $form['#submit'])) {
129
+    // Load a copy of the general prefs form
130
+    $form = boincwork_generalprefs_form($form_state, NULL, $preset);
131
+    if ($key = array_search('boincwork_generalprefs_form_submit', $form['#submit'])) {
132 132
     unset($form['#submit'][$key]);
133
-  }
134
-  $form['#submit'][] = 'boincwork_admin_prefs_presets_form_submit';
133
+    }
134
+    $form['#submit'][] = 'boincwork_admin_prefs_presets_form_submit';
135 135
   
136
-  // Just keep the necessary items
137
-  $form['processor'] = $form['prefs']['advanced']['processor'];
138
-  $form['storage'] = $form['prefs']['advanced']['storage'];
139
-  $form['network'] = $form['prefs']['advanced']['network'];
140
-  unset($form['prefs']);
136
+    // Just keep the necessary items
137
+    $form['processor'] = $form['prefs']['advanced']['processor'];
138
+    $form['storage'] = $form['prefs']['advanced']['storage'];
139
+    $form['network'] = $form['prefs']['advanced']['network'];
140
+    unset($form['prefs']);
141 141
   
142
-  // Tweak some things so it behaves a little better
143
-  $form['#tree'] = TRUE;
144
-  $form['processor']['#collapsible'] = TRUE;
145
-  $form['storage']['#collapsible'] = TRUE;
146
-  $form['network']['#collapsible'] = TRUE;
142
+    // Tweak some things so it behaves a little better
143
+    $form['#tree'] = TRUE;
144
+    $form['processor']['#collapsible'] = TRUE;
145
+    $form['storage']['#collapsible'] = TRUE;
146
+    $form['network']['#collapsible'] = TRUE;
147 147
   
148
-  // Add a submit button and a hidden field to pass the preset
149
-  $form['submit'] = array(
148
+    // Add a submit button and a hidden field to pass the preset
149
+    $form['submit'] = array(
150 150
     '#type' => 'submit',
151 151
     '#value' => t('Save configuration')
152
-  );
153
-  $form['saveuseconfigxml'] = array (
154
-      '#type' => 'submit',
155
-      '#value' => t('Save configuration with disk usage settings from config.xml'),
156
-      '#validate' => array('boincwork_admin_prefs_preset_saveuseconfigxml'),
157
-  );
158
-  $form['preset'] = array(
152
+    );
153
+    $form['saveuseconfigxml'] = array (
154
+        '#type' => 'submit',
155
+        '#value' => t('Save configuration with disk usage settings from config.xml'),
156
+        '#validate' => array('boincwork_admin_prefs_preset_saveuseconfigxml'),
157
+    );
158
+    $form['preset'] = array(
159 159
     '#type' => 'hidden',
160 160
     '#value' => $preset
161
-  );
161
+    );
162 162
   
163
-  // Add the official mechanical things and return
164
-  drupal_prepare_form('boincwork_admin_prefs_presets_form', $form, $form_state);
165
-  return $form;
163
+    // Add the official mechanical things and return
164
+    drupal_prepare_form('boincwork_admin_prefs_presets_form', $form, $form_state);
165
+    return $form;
166 166
 }
167 167
 
168 168
 /**
169
-  * Validate the preference presets form.
170
-  */
169
+ * Validate the preference presets form.
170
+ */
171 171
 function boincwork_admin_prefs_presets_form_validate($form, &$form_state) {
172
-  require_boinc('util');
173
-  $values = $form_state['values'];
172
+    require_boinc('util');
173
+    $values = $form_state['values'];
174 174
   
175
-  // Verify all non-boolean user input values and notify form API of failures
175
+    // Verify all non-boolean user input values and notify form API of failures
176 176
   
177
-  // Processing preferences
178
-  if (!verify_numeric($values['processor']['idle_time_to_run'], 1, 9999)) form_set_error('idle_time_to_run', t('Invalid setting for') . " \"{$form['processor']['idle_time_to_run']['#title']} [x] {$form['processor']['idle_time_to_run']['#field_suffix']}\"");
179
-  if (!verify_numeric($values['processor']['suspend_if_no_recent_input'], 0, 9999)) form_set_error('suspend_if_no_recent_input', t('Invalid setting for') . " \"{$form['processor']['suspend_if_no_recent_input']['#title']} [x] {$form['processor']['suspend_if_no_recent_input']['#field_suffix']}\"");
180
-  if (!verify_numeric($values['processor']['suspend_cpu_usage'], 0, 100)) form_set_error('suspend_cpu_usage', t('Invalid setting for') . " \"{$form['processor']['suspend_cpu_usage']['#title']} [x] {$form['processor']['suspend_cpu_usage']['#field_suffix']}\"");
181
-  if (!verify_numeric($values['processor']['start_hour'], 0, 23)) form_set_error('start_hour', t('Invalid setting for') . " \"{$form['processor']['start_hour']['#title']} [x] {$form['processor']['start_hour']['#field_suffix']}\"");
182
-  if (!verify_numeric($values['processor']['end_hour'], 0, 23)) form_set_error('end_hour', t('Invalid setting for') . " \"{$form['processor']['end_hour']['#title']} [x] {$form['processor']['end_hour']['#field_suffix']}\"");
183
-  if (!verify_numeric($values['processor']['cpu_scheduling_period_minutes'], 1, 9999)) form_set_error('cpu_scheduling_period_minutes', t('Invalid setting for') . " \"{$form['processor']['cpu_scheduling_period_minutes']['#title']} [x] {$form['processor']['cpu_scheduling_period_minutes']['#field_suffix']}\"");
184
-  if (!verify_numeric($values['processor']['max_ncpus_pct'], 0, 100)) form_set_error('max_ncpus_pct', t('Invalid setting for') . " \"{$form['processor']['max_ncpus_pct']['#title']} [x] {$form['processor']['max_ncpus_pct']['#field_suffix']}\"");
185
-  if (!verify_numeric($values['processor']['cpu_usage_limit'], 0, 100)) form_set_error('cpu_usage_limit', t('Invalid setting for') . " \"{$form['processor']['cpu_usage_limit']['#title']} [x] {$form['processor']['cpu_usage_limit']['#field_suffix']}\"");
177
+    // Processing preferences
178
+    if (!verify_numeric($values['processor']['idle_time_to_run'], 1, 9999)) form_set_error('idle_time_to_run', t('Invalid setting for') . " \"{$form['processor']['idle_time_to_run']['#title']} [x] {$form['processor']['idle_time_to_run']['#field_suffix']}\"");
179
+    if (!verify_numeric($values['processor']['suspend_if_no_recent_input'], 0, 9999)) form_set_error('suspend_if_no_recent_input', t('Invalid setting for') . " \"{$form['processor']['suspend_if_no_recent_input']['#title']} [x] {$form['processor']['suspend_if_no_recent_input']['#field_suffix']}\"");
180
+    if (!verify_numeric($values['processor']['suspend_cpu_usage'], 0, 100)) form_set_error('suspend_cpu_usage', t('Invalid setting for') . " \"{$form['processor']['suspend_cpu_usage']['#title']} [x] {$form['processor']['suspend_cpu_usage']['#field_suffix']}\"");
181
+    if (!verify_numeric($values['processor']['start_hour'], 0, 23)) form_set_error('start_hour', t('Invalid setting for') . " \"{$form['processor']['start_hour']['#title']} [x] {$form['processor']['start_hour']['#field_suffix']}\"");
182
+    if (!verify_numeric($values['processor']['end_hour'], 0, 23)) form_set_error('end_hour', t('Invalid setting for') . " \"{$form['processor']['end_hour']['#title']} [x] {$form['processor']['end_hour']['#field_suffix']}\"");
183
+    if (!verify_numeric($values['processor']['cpu_scheduling_period_minutes'], 1, 9999)) form_set_error('cpu_scheduling_period_minutes', t('Invalid setting for') . " \"{$form['processor']['cpu_scheduling_period_minutes']['#title']} [x] {$form['processor']['cpu_scheduling_period_minutes']['#field_suffix']}\"");
184
+    if (!verify_numeric($values['processor']['max_ncpus_pct'], 0, 100)) form_set_error('max_ncpus_pct', t('Invalid setting for') . " \"{$form['processor']['max_ncpus_pct']['#title']} [x] {$form['processor']['max_ncpus_pct']['#field_suffix']}\"");
185
+    if (!verify_numeric($values['processor']['cpu_usage_limit'], 0, 100)) form_set_error('cpu_usage_limit', t('Invalid setting for') . " \"{$form['processor']['cpu_usage_limit']['#title']} [x] {$form['processor']['cpu_usage_limit']['#field_suffix']}\"");
186 186
 
187
-  // Storage preferences
188
-  if (!verify_numeric($values['storage']['disk_max_used_gb'], 0, 9999999)) form_set_error('disk_max_used_gb', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_gb']['#title']} [x] {$form['storage']['disk_max_used_gb']['#field_suffix']}\"");
189
-  if (!verify_numeric($values['storage']['disk_min_free_gb'], 0.001, 9999999)) form_set_error('disk_min_free_gb', t('Invalid setting for') . " \"{$form['storage']['disk_min_free_gb']['#title']} [x] {$form['storage']['disk_min_free_gb']['#field_suffix']}\"");
190
-  if (!verify_numeric($values['storage']['disk_max_used_pct'], 0, 100)) form_set_error('disk_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_pct']['#title']} [x] {$form['storage']['disk_max_used_pct']['#field_suffix']}\"");
191
-  if (!verify_numeric($values['storage']['disk_interval'], 0, 9999999)) form_set_error('disk_interval', t('Invalid setting for') . " \"{$form['storage']['disk_interval']['#title']} [x] {$form['storage']['disk_interval']['#field_suffix']}\"");
192
-  if (!verify_numeric($values['storage']['vm_max_used_pct'], 0, 100)) form_set_error('vm_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['vm_max_used_pct']['#title']} [x] {$form['storage']['vm_max_used_pct']['#field_suffix']}\"");
193
-  if (!verify_numeric($values['storage']['ram_max_used_busy_pct'], 0, 100)) form_set_error('ram_max_used_busy_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_busy_pct']['#title']} [x] {$form['storage']['ram_max_used_busy_pct']['#field_suffix']}\"");
194
-  if (!verify_numeric($values['storage']['ram_max_used_idle_pct'], 0, 100)) form_set_error('ram_max_used_idle_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_idle_pct']['#title']} [x] {$form['storage']['ram_max_used_idle_pct']['#field_suffix']}\"");
187
+    // Storage preferences
188
+    if (!verify_numeric($values['storage']['disk_max_used_gb'], 0, 9999999)) form_set_error('disk_max_used_gb', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_gb']['#title']} [x] {$form['storage']['disk_max_used_gb']['#field_suffix']}\"");
189
+    if (!verify_numeric($values['storage']['disk_min_free_gb'], 0.001, 9999999)) form_set_error('disk_min_free_gb', t('Invalid setting for') . " \"{$form['storage']['disk_min_free_gb']['#title']} [x] {$form['storage']['disk_min_free_gb']['#field_suffix']}\"");
190
+    if (!verify_numeric($values['storage']['disk_max_used_pct'], 0, 100)) form_set_error('disk_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_pct']['#title']} [x] {$form['storage']['disk_max_used_pct']['#field_suffix']}\"");
191
+    if (!verify_numeric($values['storage']['disk_interval'], 0, 9999999)) form_set_error('disk_interval', t('Invalid setting for') . " \"{$form['storage']['disk_interval']['#title']} [x] {$form['storage']['disk_interval']['#field_suffix']}\"");
192
+    if (!verify_numeric($values['storage']['vm_max_used_pct'], 0, 100)) form_set_error('vm_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['vm_max_used_pct']['#title']} [x] {$form['storage']['vm_max_used_pct']['#field_suffix']}\"");
193
+    if (!verify_numeric($values['storage']['ram_max_used_busy_pct'], 0, 100)) form_set_error('ram_max_used_busy_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_busy_pct']['#title']} [x] {$form['storage']['ram_max_used_busy_pct']['#field_suffix']}\"");
194
+    if (!verify_numeric($values['storage']['ram_max_used_idle_pct'], 0, 100)) form_set_error('ram_max_used_idle_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_idle_pct']['#title']} [x] {$form['storage']['ram_max_used_idle_pct']['#field_suffix']}\"");
195 195
 
196
-  // Network preferences
197
-  if (!verify_numeric($values['network']['work_buf_min_days'], 0, 10)) form_set_error('work_buf_min_days', t('Invalid setting for') . " \"{$form['network']['work_buf_min_days']['#title']} [x] {$form['network']['work_buf_min_days']['#field_suffix']}\"");
198
-  if (!verify_numeric($values['network']['work_buf_additional_days'], 0, 10)) form_set_error('work_buf_additional_days', t('Invalid setting for') . " \"{$form['network']['work_buf_additional_days']['#title']} [x] {$form['network']['work_buf_additional_days']['#field_suffix']}\"");
199
-  if (!verify_numeric($values['network']['max_bytes_sec_down'], 0, 9999.999)) form_set_error('max_bytes_sec_down', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_down']['#title']} [x] {$form['network']['max_bytes_sec_down']['#field_suffix']}\"");
200
-  if (!verify_numeric($values['network']['max_bytes_sec_up'], 0, 9999.999)) form_set_error('max_bytes_sec_up', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_up']['#title']} [x] {$form['network']['max_bytes_sec_up']['#field_suffix']}\"");
201
-  if (!verify_numeric($values['network']['net_start_hour'], 0, 23)) form_set_error('net_start_hour', t('Invalid setting for') . " \"{$form['network']['net_start_hour']['#title']} [x] {$form['network']['net_start_hour']['#field_suffix']}\"");
202
-  if (!verify_numeric($values['network']['net_end_hour'], 0, 23)) form_set_error('net_end_hour', t('Invalid setting for') . " \"{$form['network']['net_end_hour']['#title']} [x] {$form['network']['net_end_hour']['#field_suffix']}\"");
203
-  if (!verify_numeric($values['network']['daily_xfer_limit_mb'], 0, 9999999)) form_set_error('daily_xfer_limit_mb', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
204
-  if (!verify_numeric($values['network']['daily_xfer_period_days'], 0, 9999999)) form_set_error('daily_xfer_period_days', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
196
+    // Network preferences
197
+    if (!verify_numeric($values['network']['work_buf_min_days'], 0, 10)) form_set_error('work_buf_min_days', t('Invalid setting for') . " \"{$form['network']['work_buf_min_days']['#title']} [x] {$form['network']['work_buf_min_days']['#field_suffix']}\"");
198
+    if (!verify_numeric($values['network']['work_buf_additional_days'], 0, 10)) form_set_error('work_buf_additional_days', t('Invalid setting for') . " \"{$form['network']['work_buf_additional_days']['#title']} [x] {$form['network']['work_buf_additional_days']['#field_suffix']}\"");
199
+    if (!verify_numeric($values['network']['max_bytes_sec_down'], 0, 9999.999)) form_set_error('max_bytes_sec_down', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_down']['#title']} [x] {$form['network']['max_bytes_sec_down']['#field_suffix']}\"");
200
+    if (!verify_numeric($values['network']['max_bytes_sec_up'], 0, 9999.999)) form_set_error('max_bytes_sec_up', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_up']['#title']} [x] {$form['network']['max_bytes_sec_up']['#field_suffix']}\"");
201
+    if (!verify_numeric($values['network']['net_start_hour'], 0, 23)) form_set_error('net_start_hour', t('Invalid setting for') . " \"{$form['network']['net_start_hour']['#title']} [x] {$form['network']['net_start_hour']['#field_suffix']}\"");
202
+    if (!verify_numeric($values['network']['net_end_hour'], 0, 23)) form_set_error('net_end_hour', t('Invalid setting for') . " \"{$form['network']['net_end_hour']['#title']} [x] {$form['network']['net_end_hour']['#field_suffix']}\"");
203
+    if (!verify_numeric($values['network']['daily_xfer_limit_mb'], 0, 9999999)) form_set_error('daily_xfer_limit_mb', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
204
+    if (!verify_numeric($values['network']['daily_xfer_period_days'], 0, 9999999)) form_set_error('daily_xfer_period_days', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
205 205
 }
206 206
 
207 207
 /**
208
-  * Handle post-validation submission of preference presets form.
209
-  */
208
+ * Handle post-validation submission of preference presets form.
209
+ */
210 210
 function boincwork_admin_prefs_presets_form_submit($form, &$form_state) {
211
-  $values = $form_state['values'];
212
-  $preset = $form_state['values']['preset'];
211
+    $values = $form_state['values'];
212
+    $preset = $form_state['values']['preset'];
213 213
   
214
-  // Load baseline settings from configuration
215
-  $prefs = boincwork_get_preset_prefs($preset);
214
+    // Load baseline settings from configuration
215
+    $prefs = boincwork_get_preset_prefs($preset);
216 216
   
217
-  // Processing preferences
218
-  $prefs['run_on_batteries'] = ($values['processor']['run_on_batteries']) ? 0 : 1;
219
-  $prefs['run_if_user_active'] = ($values['processor']['run_if_user_active']) ? 0 : 1;
220
-  $prefs['run_gpu_if_user_active'] = ($values['processor']['run_gpu_if_user_active']) ? 0: 1;
221
-  $prefs['idle_time_to_run'] = $values['processor']['idle_time_to_run'];
222
-  $prefs['suspend_if_no_recent_input'] = $values['processor']['suspend_if_no_recent_input'];
223
-  $prefs['suspend_cpu_usage'] = $values['processor']['suspend_cpu_usage'];
224
-  $prefs['start_hour'] = $values['processor']['start_hour'];
225
-  $prefs['end_hour'] = $values['processor']['end_hour'];
226
-  $prefs['leave_apps_in_memory'] = ($values['processor']['leave_apps_in_memory']) ? 1 : 0;
227
-  $prefs['cpu_scheduling_period_minutes'] = $values['processor']['cpu_scheduling_period_minutes'];
228
-  $prefs['max_ncpus_pct'] = $values['processor']['max_ncpus_pct'];
229
-  $prefs['cpu_usage_limit'] = $values['processor']['cpu_usage_limit'];
217
+    // Processing preferences
218
+    $prefs['run_on_batteries'] = ($values['processor']['run_on_batteries']) ? 0 : 1;
219
+    $prefs['run_if_user_active'] = ($values['processor']['run_if_user_active']) ? 0 : 1;
220
+    $prefs['run_gpu_if_user_active'] = ($values['processor']['run_gpu_if_user_active']) ? 0: 1;
221
+    $prefs['idle_time_to_run'] = $values['processor']['idle_time_to_run'];
222
+    $prefs['suspend_if_no_recent_input'] = $values['processor']['suspend_if_no_recent_input'];
223
+    $prefs['suspend_cpu_usage'] = $values['processor']['suspend_cpu_usage'];
224
+    $prefs['start_hour'] = $values['processor']['start_hour'];
225
+    $prefs['end_hour'] = $values['processor']['end_hour'];
226
+    $prefs['leave_apps_in_memory'] = ($values['processor']['leave_apps_in_memory']) ? 1 : 0;
227
+    $prefs['cpu_scheduling_period_minutes'] = $values['processor']['cpu_scheduling_period_minutes'];
228
+    $prefs['max_ncpus_pct'] = $values['processor']['max_ncpus_pct'];
229
+    $prefs['cpu_usage_limit'] = $values['processor']['cpu_usage_limit'];
230 230
   
231
-  // Storage preferences
232
-  $prefs['disk_max_used_gb'] = $values['storage']['disk_max_used_gb'];
233
-  $prefs['disk_min_free_gb'] = $values['storage']['disk_min_free_gb'];
234
-  $prefs['disk_max_used_pct'] = $values['storage']['disk_max_used_pct'];
235
-  $prefs['disk_interval'] = $values['storage']['disk_interval'];
236
-  $prefs['vm_max_used_pct'] = $values['storage']['vm_max_used_pct'];
237
-  $prefs['ram_max_used_busy_pct'] = $values['storage']['ram_max_used_busy_pct'];
238
-  $prefs['ram_max_used_idle_pct'] = $values['storage']['ram_max_used_idle_pct'];
231
+    // Storage preferences
232
+    $prefs['disk_max_used_gb'] = $values['storage']['disk_max_used_gb'];
233
+    $prefs['disk_min_free_gb'] = $values['storage']['disk_min_free_gb'];
234
+    $prefs['disk_max_used_pct'] = $values['storage']['disk_max_used_pct'];
235
+    $prefs['disk_interval'] = $values['storage']['disk_interval'];
236
+    $prefs['vm_max_used_pct'] = $values['storage']['vm_max_used_pct'];
237
+    $prefs['ram_max_used_busy_pct'] = $values['storage']['ram_max_used_busy_pct'];
238
+    $prefs['ram_max_used_idle_pct'] = $values['storage']['ram_max_used_idle_pct'];
239 239
   
240
-  // Network preferences
241
-  $prefs['work_buf_min_days'] = $values['network']['work_buf_min_days'];
242
-  $prefs['work_buf_additional_days'] = $values['network']['work_buf_additional_days'];
243
-  $prefs['confirm_before_connecting'] = ($values['network']['confirm_before_connecting']) ? 1 : 0;
244
-  $prefs['hangup_if_dialed'] = ($values['network']['hangup_if_dialed']) ? 1 : 0;
245
-  $prefs['max_bytes_sec_down'] = $values['network']['max_bytes_sec_down']*1000;
246
-  $prefs['max_bytes_sec_up'] = $values['network']['max_bytes_sec_up']*1000;
247
-  $prefs['net_start_hour'] = $values['network']['net_start_hour'];
248
-  $prefs['net_end_hour'] = $values['network']['net_end_hour'];
249
-  $prefs['daily_xfer_limit_mb'] = $values['network']['daily_xfer_limit_mb'];
250
-  $prefs['daily_xfer_period_days'] = $values['network']['daily_xfer_period_days'];
251
-  $prefs['dont_verify_images'] = ($values['network']['dont_verify_images']) ? 1 : 0;
240
+    // Network preferences
241
+    $prefs['work_buf_min_days'] = $values['network']['work_buf_min_days'];
242
+    $prefs['work_buf_additional_days'] = $values['network']['work_buf_additional_days'];
243
+    $prefs['confirm_before_connecting'] = ($values['network']['confirm_before_connecting']) ? 1 : 0;
244
+    $prefs['hangup_if_dialed'] = ($values['network']['hangup_if_dialed']) ? 1 : 0;
245
+    $prefs['max_bytes_sec_down'] = $values['network']['max_bytes_sec_down']*1000;
246
+    $prefs['max_bytes_sec_up'] = $values['network']['max_bytes_sec_up']*1000;
247
+    $prefs['net_start_hour'] = $values['network']['net_start_hour'];
248
+    $prefs['net_end_hour'] = $values['network']['net_end_hour'];
249
+    $prefs['daily_xfer_limit_mb'] = $values['network']['daily_xfer_limit_mb'];
250
+    $prefs['daily_xfer_period_days'] = $values['network']['daily_xfer_period_days'];
251
+    $prefs['dont_verify_images'] = ($values['network']['dont_verify_images']) ? 1 : 0;
252 252
   
253
-  //Remove @attributes to match new format (see boincwork.forms.inc
254
-  //function boincwork_generalprefs_form)
255
-  unset($prefs['@attributes']['preset']);
253
+    //Remove @attributes to match new format (see boincwork.forms.inc
254
+    //function boincwork_generalprefs_form)
255
+    unset($prefs['@attributes']['preset']);
256 256
   
257
-  // Update the configuration
258
-  boincwork_save_preset_prefs($prefs, $preset);
259
-  drupal_set_message(t('The "@name" preset has been updated.',
257
+    // Update the configuration
258
+    boincwork_save_preset_prefs($prefs, $preset);
259
+    drupal_set_message(t('The "@name" preset has been updated.',
260 260
     array('@name' => $preset)));
261 261
 }
262 262
 
@@ -265,26 +265,26 @@  discard block
 block discarded – undo
265 265
  */
266 266
 function boincwork_save_preset_prefs($updated_prefs, $preset = 'standard') {
267 267
   
268
-  // Get the full configuration
269
-  $all_presets = boincwork_get_preset_prefs();
270
-  $all_presets = (array) $all_presets['general_preferences'];
268
+    // Get the full configuration
269
+    $all_presets = boincwork_get_preset_prefs();
270
+    $all_presets = (array) $all_presets['general_preferences'];
271 271
   
272
-  // Check for sane config
273
-  if (isset($all_presets['preset'])) {
272
+    // Check for sane config
273
+    if (isset($all_presets['preset'])) {
274 274
     if (!is_numeric(key($all_presets['preset']))) {
275
-      $all_presets['preset'] = array($all_presets['preset']);
275
+        $all_presets['preset'] = array($all_presets['preset']);
276 276
     }
277 277
     foreach ($all_presets['preset'] as $key => $old_preset) {
278
-      // Find the preset being updated and... update it
279
-      if (isset($old_preset['@attributes']['name']) AND $old_preset['@attributes']['name'] == $preset) {
278
+        // Find the preset being updated and... update it
279
+        if (isset($old_preset['@attributes']['name']) AND $old_preset['@attributes']['name'] == $preset) {
280 280
         $all_presets['preset'][$key] = $updated_prefs + $old_preset;
281
-      }
281
+        }
282
+    }
282 283
     }
283
-  }
284 284
   
285
-  // Convert prefs back to XML and save to database
286
-  $all_presets = array('general_preferences' => $all_presets);
287
-  variable_set('boincwork_preset_prefs', save_configuration($all_presets));
285
+    // Convert prefs back to XML and save to database
286
+    $all_presets = array('general_preferences' => $all_presets);
287
+    variable_set('boincwork_preset_prefs', save_configuration($all_presets));
288 288
 }
289 289
 
290 290
 /**
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
   */
66 66
 function boincwork_admin_prefs_upload_form_validate($form, &$form_state) {
67 67
   
68
-  $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd';
68
+  $xsd = './'.drupal_get_path('module', 'boincwork').'/includes/projectprefs.xsd';
69 69
   libxml_use_internal_errors(true);
70 70
   $xml = new DomDocument();
71 71
   $xml->loadXML($form_state['values']['prefs_xml'], LIBXML_NOBLANKS);
72 72
   if (!$xml->schemaValidate($xsd)) {
73 73
     $errors = libxml_get_errors();
74 74
     $lines = explode("\r", $form_state['values']['prefs_xml']);
75
-    drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}" .
76
-      ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
75
+    drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}".
76
+      ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), 'error');
77 77
     form_set_error('upload', t('XML file failed validation'));
78 78
   }
79 79
 }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
       "{$path}/minimum" => t('Minimum')
102 102
     );
103 103
     variable_set('jump_use_js_presets-Array', 1);
104
-    drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
104
+    drupal_add_js(drupal_get_path('module', 'jump').'/jump.js');
105 105
     $output .= '<div class="simple-form-controls"><div class="form-item venue">';
106 106
     $output .= '<label>Preset:</label>';
107 107
     $output .= jump_quickly($preset_options, 'presets');
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     '#type' => 'submit',
151 151
     '#value' => t('Save configuration')
152 152
   );
153
-  $form['saveuseconfigxml'] = array (
153
+  $form['saveuseconfigxml'] = array(
154 154
       '#type' => 'submit',
155 155
       '#value' => t('Save configuration with disk usage settings from config.xml'),
156 156
       '#validate' => array('boincwork_admin_prefs_preset_saveuseconfigxml'),
@@ -175,33 +175,33 @@  discard block
 block discarded – undo
175 175
   // Verify all non-boolean user input values and notify form API of failures
176 176
   
177 177
   // Processing preferences
178
-  if (!verify_numeric($values['processor']['idle_time_to_run'], 1, 9999)) form_set_error('idle_time_to_run', t('Invalid setting for') . " \"{$form['processor']['idle_time_to_run']['#title']} [x] {$form['processor']['idle_time_to_run']['#field_suffix']}\"");
179
-  if (!verify_numeric($values['processor']['suspend_if_no_recent_input'], 0, 9999)) form_set_error('suspend_if_no_recent_input', t('Invalid setting for') . " \"{$form['processor']['suspend_if_no_recent_input']['#title']} [x] {$form['processor']['suspend_if_no_recent_input']['#field_suffix']}\"");
180
-  if (!verify_numeric($values['processor']['suspend_cpu_usage'], 0, 100)) form_set_error('suspend_cpu_usage', t('Invalid setting for') . " \"{$form['processor']['suspend_cpu_usage']['#title']} [x] {$form['processor']['suspend_cpu_usage']['#field_suffix']}\"");
181
-  if (!verify_numeric($values['processor']['start_hour'], 0, 23)) form_set_error('start_hour', t('Invalid setting for') . " \"{$form['processor']['start_hour']['#title']} [x] {$form['processor']['start_hour']['#field_suffix']}\"");
182
-  if (!verify_numeric($values['processor']['end_hour'], 0, 23)) form_set_error('end_hour', t('Invalid setting for') . " \"{$form['processor']['end_hour']['#title']} [x] {$form['processor']['end_hour']['#field_suffix']}\"");
183
-  if (!verify_numeric($values['processor']['cpu_scheduling_period_minutes'], 1, 9999)) form_set_error('cpu_scheduling_period_minutes', t('Invalid setting for') . " \"{$form['processor']['cpu_scheduling_period_minutes']['#title']} [x] {$form['processor']['cpu_scheduling_period_minutes']['#field_suffix']}\"");
184
-  if (!verify_numeric($values['processor']['max_ncpus_pct'], 0, 100)) form_set_error('max_ncpus_pct', t('Invalid setting for') . " \"{$form['processor']['max_ncpus_pct']['#title']} [x] {$form['processor']['max_ncpus_pct']['#field_suffix']}\"");
185
-  if (!verify_numeric($values['processor']['cpu_usage_limit'], 0, 100)) form_set_error('cpu_usage_limit', t('Invalid setting for') . " \"{$form['processor']['cpu_usage_limit']['#title']} [x] {$form['processor']['cpu_usage_limit']['#field_suffix']}\"");
178
+  if (!verify_numeric($values['processor']['idle_time_to_run'], 1, 9999)) form_set_error('idle_time_to_run', t('Invalid setting for')." \"{$form['processor']['idle_time_to_run']['#title']} [x] {$form['processor']['idle_time_to_run']['#field_suffix']}\"");
179
+  if (!verify_numeric($values['processor']['suspend_if_no_recent_input'], 0, 9999)) form_set_error('suspend_if_no_recent_input', t('Invalid setting for')." \"{$form['processor']['suspend_if_no_recent_input']['#title']} [x] {$form['processor']['suspend_if_no_recent_input']['#field_suffix']}\"");
180
+  if (!verify_numeric($values['processor']['suspend_cpu_usage'], 0, 100)) form_set_error('suspend_cpu_usage', t('Invalid setting for')." \"{$form['processor']['suspend_cpu_usage']['#title']} [x] {$form['processor']['suspend_cpu_usage']['#field_suffix']}\"");
181
+  if (!verify_numeric($values['processor']['start_hour'], 0, 23)) form_set_error('start_hour', t('Invalid setting for')." \"{$form['processor']['start_hour']['#title']} [x] {$form['processor']['start_hour']['#field_suffix']}\"");
182
+  if (!verify_numeric($values['processor']['end_hour'], 0, 23)) form_set_error('end_hour', t('Invalid setting for')." \"{$form['processor']['end_hour']['#title']} [x] {$form['processor']['end_hour']['#field_suffix']}\"");
183
+  if (!verify_numeric($values['processor']['cpu_scheduling_period_minutes'], 1, 9999)) form_set_error('cpu_scheduling_period_minutes', t('Invalid setting for')." \"{$form['processor']['cpu_scheduling_period_minutes']['#title']} [x] {$form['processor']['cpu_scheduling_period_minutes']['#field_suffix']}\"");
184
+  if (!verify_numeric($values['processor']['max_ncpus_pct'], 0, 100)) form_set_error('max_ncpus_pct', t('Invalid setting for')." \"{$form['processor']['max_ncpus_pct']['#title']} [x] {$form['processor']['max_ncpus_pct']['#field_suffix']}\"");
185
+  if (!verify_numeric($values['processor']['cpu_usage_limit'], 0, 100)) form_set_error('cpu_usage_limit', t('Invalid setting for')." \"{$form['processor']['cpu_usage_limit']['#title']} [x] {$form['processor']['cpu_usage_limit']['#field_suffix']}\"");
186 186
 
187 187
   // Storage preferences
188
-  if (!verify_numeric($values['storage']['disk_max_used_gb'], 0, 9999999)) form_set_error('disk_max_used_gb', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_gb']['#title']} [x] {$form['storage']['disk_max_used_gb']['#field_suffix']}\"");
189
-  if (!verify_numeric($values['storage']['disk_min_free_gb'], 0.001, 9999999)) form_set_error('disk_min_free_gb', t('Invalid setting for') . " \"{$form['storage']['disk_min_free_gb']['#title']} [x] {$form['storage']['disk_min_free_gb']['#field_suffix']}\"");
190
-  if (!verify_numeric($values['storage']['disk_max_used_pct'], 0, 100)) form_set_error('disk_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_pct']['#title']} [x] {$form['storage']['disk_max_used_pct']['#field_suffix']}\"");
191
-  if (!verify_numeric($values['storage']['disk_interval'], 0, 9999999)) form_set_error('disk_interval', t('Invalid setting for') . " \"{$form['storage']['disk_interval']['#title']} [x] {$form['storage']['disk_interval']['#field_suffix']}\"");
192
-  if (!verify_numeric($values['storage']['vm_max_used_pct'], 0, 100)) form_set_error('vm_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['vm_max_used_pct']['#title']} [x] {$form['storage']['vm_max_used_pct']['#field_suffix']}\"");
193
-  if (!verify_numeric($values['storage']['ram_max_used_busy_pct'], 0, 100)) form_set_error('ram_max_used_busy_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_busy_pct']['#title']} [x] {$form['storage']['ram_max_used_busy_pct']['#field_suffix']}\"");
194
-  if (!verify_numeric($values['storage']['ram_max_used_idle_pct'], 0, 100)) form_set_error('ram_max_used_idle_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_idle_pct']['#title']} [x] {$form['storage']['ram_max_used_idle_pct']['#field_suffix']}\"");
188
+  if (!verify_numeric($values['storage']['disk_max_used_gb'], 0, 9999999)) form_set_error('disk_max_used_gb', t('Invalid setting for')." \"{$form['storage']['disk_max_used_gb']['#title']} [x] {$form['storage']['disk_max_used_gb']['#field_suffix']}\"");
189
+  if (!verify_numeric($values['storage']['disk_min_free_gb'], 0.001, 9999999)) form_set_error('disk_min_free_gb', t('Invalid setting for')." \"{$form['storage']['disk_min_free_gb']['#title']} [x] {$form['storage']['disk_min_free_gb']['#field_suffix']}\"");
190
+  if (!verify_numeric($values['storage']['disk_max_used_pct'], 0, 100)) form_set_error('disk_max_used_pct', t('Invalid setting for')." \"{$form['storage']['disk_max_used_pct']['#title']} [x] {$form['storage']['disk_max_used_pct']['#field_suffix']}\"");
191
+  if (!verify_numeric($values['storage']['disk_interval'], 0, 9999999)) form_set_error('disk_interval', t('Invalid setting for')." \"{$form['storage']['disk_interval']['#title']} [x] {$form['storage']['disk_interval']['#field_suffix']}\"");
192
+  if (!verify_numeric($values['storage']['vm_max_used_pct'], 0, 100)) form_set_error('vm_max_used_pct', t('Invalid setting for')." \"{$form['storage']['vm_max_used_pct']['#title']} [x] {$form['storage']['vm_max_used_pct']['#field_suffix']}\"");
193
+  if (!verify_numeric($values['storage']['ram_max_used_busy_pct'], 0, 100)) form_set_error('ram_max_used_busy_pct', t('Invalid setting for')." \"{$form['storage']['ram_max_used_busy_pct']['#title']} [x] {$form['storage']['ram_max_used_busy_pct']['#field_suffix']}\"");
194
+  if (!verify_numeric($values['storage']['ram_max_used_idle_pct'], 0, 100)) form_set_error('ram_max_used_idle_pct', t('Invalid setting for')." \"{$form['storage']['ram_max_used_idle_pct']['#title']} [x] {$form['storage']['ram_max_used_idle_pct']['#field_suffix']}\"");
195 195
 
196 196
   // Network preferences
197
-  if (!verify_numeric($values['network']['work_buf_min_days'], 0, 10)) form_set_error('work_buf_min_days', t('Invalid setting for') . " \"{$form['network']['work_buf_min_days']['#title']} [x] {$form['network']['work_buf_min_days']['#field_suffix']}\"");
198
-  if (!verify_numeric($values['network']['work_buf_additional_days'], 0, 10)) form_set_error('work_buf_additional_days', t('Invalid setting for') . " \"{$form['network']['work_buf_additional_days']['#title']} [x] {$form['network']['work_buf_additional_days']['#field_suffix']}\"");
199
-  if (!verify_numeric($values['network']['max_bytes_sec_down'], 0, 9999.999)) form_set_error('max_bytes_sec_down', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_down']['#title']} [x] {$form['network']['max_bytes_sec_down']['#field_suffix']}\"");
200
-  if (!verify_numeric($values['network']['max_bytes_sec_up'], 0, 9999.999)) form_set_error('max_bytes_sec_up', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_up']['#title']} [x] {$form['network']['max_bytes_sec_up']['#field_suffix']}\"");
201
-  if (!verify_numeric($values['network']['net_start_hour'], 0, 23)) form_set_error('net_start_hour', t('Invalid setting for') . " \"{$form['network']['net_start_hour']['#title']} [x] {$form['network']['net_start_hour']['#field_suffix']}\"");
202
-  if (!verify_numeric($values['network']['net_end_hour'], 0, 23)) form_set_error('net_end_hour', t('Invalid setting for') . " \"{$form['network']['net_end_hour']['#title']} [x] {$form['network']['net_end_hour']['#field_suffix']}\"");
203
-  if (!verify_numeric($values['network']['daily_xfer_limit_mb'], 0, 9999999)) form_set_error('daily_xfer_limit_mb', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
204
-  if (!verify_numeric($values['network']['daily_xfer_period_days'], 0, 9999999)) form_set_error('daily_xfer_period_days', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
197
+  if (!verify_numeric($values['network']['work_buf_min_days'], 0, 10)) form_set_error('work_buf_min_days', t('Invalid setting for')." \"{$form['network']['work_buf_min_days']['#title']} [x] {$form['network']['work_buf_min_days']['#field_suffix']}\"");
198
+  if (!verify_numeric($values['network']['work_buf_additional_days'], 0, 10)) form_set_error('work_buf_additional_days', t('Invalid setting for')." \"{$form['network']['work_buf_additional_days']['#title']} [x] {$form['network']['work_buf_additional_days']['#field_suffix']}\"");
199
+  if (!verify_numeric($values['network']['max_bytes_sec_down'], 0, 9999.999)) form_set_error('max_bytes_sec_down', t('Invalid setting for')." \"{$form['network']['max_bytes_sec_down']['#title']} [x] {$form['network']['max_bytes_sec_down']['#field_suffix']}\"");
200
+  if (!verify_numeric($values['network']['max_bytes_sec_up'], 0, 9999.999)) form_set_error('max_bytes_sec_up', t('Invalid setting for')." \"{$form['network']['max_bytes_sec_up']['#title']} [x] {$form['network']['max_bytes_sec_up']['#field_suffix']}\"");
201
+  if (!verify_numeric($values['network']['net_start_hour'], 0, 23)) form_set_error('net_start_hour', t('Invalid setting for')." \"{$form['network']['net_start_hour']['#title']} [x] {$form['network']['net_start_hour']['#field_suffix']}\"");
202
+  if (!verify_numeric($values['network']['net_end_hour'], 0, 23)) form_set_error('net_end_hour', t('Invalid setting for')." \"{$form['network']['net_end_hour']['#title']} [x] {$form['network']['net_end_hour']['#field_suffix']}\"");
203
+  if (!verify_numeric($values['network']['daily_xfer_limit_mb'], 0, 9999999)) form_set_error('daily_xfer_limit_mb', t('Invalid setting for')." \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
204
+  if (!verify_numeric($values['network']['daily_xfer_period_days'], 0, 9999999)) form_set_error('daily_xfer_period_days', t('Invalid setting for')." \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\"");
205 205
 }
206 206
 
207 207
 /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
   // Processing preferences
218 218
   $prefs['run_on_batteries'] = ($values['processor']['run_on_batteries']) ? 0 : 1;
219 219
   $prefs['run_if_user_active'] = ($values['processor']['run_if_user_active']) ? 0 : 1;
220
-  $prefs['run_gpu_if_user_active'] = ($values['processor']['run_gpu_if_user_active']) ? 0: 1;
220
+  $prefs['run_gpu_if_user_active'] = ($values['processor']['run_gpu_if_user_active']) ? 0 : 1;
221 221
   $prefs['idle_time_to_run'] = $values['processor']['idle_time_to_run'];
222 222
   $prefs['suspend_if_no_recent_input'] = $values['processor']['suspend_if_no_recent_input'];
223 223
   $prefs['suspend_cpu_usage'] = $values['processor']['suspend_cpu_usage'];
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
   
268 268
   // Get the full configuration
269 269
   $all_presets = boincwork_get_preset_prefs();
270
-  $all_presets = (array) $all_presets['general_preferences'];
270
+  $all_presets = (array)$all_presets['general_preferences'];
271 271
   
272 272
   // Check for sane config
273 273
   if (isset($all_presets['preset'])) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     '#type' => 'checkbox',
16 16
     '#title' => t('Allow users to opt in to test beta applications'),
17 17
     '#default_value' => variable_get('boinc_prefs_options_beta', 0),
18
-    '#required' => TRUE
18
+    '#required' => true
19 19
   );
20 20
   $form['submit'] = array(
21 21
     '#type' => 'submit',
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     '#type' => 'textarea',
50 50
     '#title' => t('Project specific preferences XML'),
51 51
     '#default_value' => variable_get('boinc_project_specific_prefs_config', "<project_specific_preferences>\n\n</project_specific_preferences>"),
52
-    '#required' => TRUE
52
+    '#required' => true
53 53
   );
54 54
   $form['submit'] = array(
55 55
     '#type' => 'submit',
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     drupal_set_message(bts('No presets found in database, loading a default set of preferences for each preset. These will be saved to the database once you click \'Save configuration\'.'), 'status');
128 128
 
129 129
   // Load a copy of the general prefs form
130
-  $form = boincwork_generalprefs_form($form_state, NULL, $preset);
130
+  $form = boincwork_generalprefs_form($form_state, null, $preset);
131 131
   if ($key = array_search('boincwork_generalprefs_form_submit', $form['#submit'])) {
132 132
     unset($form['#submit'][$key]);
133 133
   }
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
   unset($form['prefs']);
141 141
   
142 142
   // Tweak some things so it behaves a little better
143
-  $form['#tree'] = TRUE;
144
-  $form['processor']['#collapsible'] = TRUE;
145
-  $form['storage']['#collapsible'] = TRUE;
146
-  $form['network']['#collapsible'] = TRUE;
143
+  $form['#tree'] = true;
144
+  $form['processor']['#collapsible'] = true;
145
+  $form['storage']['#collapsible'] = true;
146
+  $form['network']['#collapsible'] = true;
147 147
   
148 148
   // Add a submit button and a hidden field to pass the preset
149 149
   $form['submit'] = array(
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     }
277 277
     foreach ($all_presets['preset'] as $key => $old_preset) {
278 278
       // Find the preset being updated and... update it
279
-      if (isset($old_preset['@attributes']['name']) AND $old_preset['@attributes']['name'] == $preset) {
279
+      if (isset($old_preset['@attributes']['name']) and $old_preset['@attributes']['name'] == $preset) {
280 280
         $all_presets['preset'][$key] = $updated_prefs + $old_preset;
281 281
       }
282 282
     }
Please login to merge, or discard this patch.
boinc/modules/boincwork/views/views_handler_argument_boincuser_id.inc 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 class views_handler_argument_boincuser_id extends views_handler_argument_numeric {
10
-  function construct() {
10
+    function construct() {
11 11
     parent::construct();
12
-  }
12
+    }
13 13
 
14
-  function set_argument($arg) {
14
+    function set_argument($arg) {
15 15
     // When setting the ID argument, convert to BOINC ID
16 16
     $id = is_numeric($arg) ? $arg : 0;
17 17
     $boinc_id = db_result(db_query("SELECT boinc_id FROM {boincuser} WHERE uid = %d", $id));
18 18
     $this->argument = $boinc_id;
19 19
     return $this->validate_arg($boinc_id);
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
modules/boincwork/views/views_handler_field_boincwork_host_app_et_avg.inc 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
  */
7 7
 
8 8
 class views_handler_field_boincwork_host_app_et_avg extends views_handler_field {
9
-  function construct() {
9
+    function construct() {
10 10
     parent::construct();
11
-  }
11
+    }
12 12
 
13
-  function render($values) {
13
+    function render($values) {
14 14
     $gflops = 0;
15 15
     if ($values->host_app_version_et_avg) {
16
-      $gflops = 1e-9 / $values->host_app_version_et_avg;
16
+        $gflops = 1e-9 / $values->host_app_version_et_avg;
17 17
     }
18 18
     return round($gflops, 2) . ' GFLOPS';
19
-  }
19
+    }
20 20
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
   function render($values) {
14 14
     $gflops = 0;
15 15
     if ($values->host_app_version_et_avg) {
16
-      $gflops = 1e-9 / $values->host_app_version_et_avg;
16
+      $gflops = 1e-9/$values->host_app_version_et_avg;
17 17
     }
18
-    return round($gflops, 2) . ' GFLOPS';
18
+    return round($gflops, 2).' GFLOPS';
19 19
   }
20 20
 }
Please login to merge, or discard this patch.
boincwork/views/views_handler_field_boincwork_host_app_turnaround_avg.inc 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@
 block discarded – undo
6 6
  */
7 7
 
8 8
 class views_handler_field_boincwork_host_app_turnaround_avg extends views_handler_field {
9
-  function construct() {
9
+    function construct() {
10 10
     parent::construct();
11
-  }
11
+    }
12 12
 
13
-  function render($values) {
13
+    function render($values) {
14 14
     $time_in_days = $values->host_app_version_turnaround_avg / (24*60*60);
15 15
     return round($time_in_days, 2) . ' ' . t('days');
16
-  }
16
+    }
17 17
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
   }
12 12
 
13 13
   function render($values) {
14
-    $time_in_days = $values->host_app_version_turnaround_avg / (24*60*60);
15
-    return round($time_in_days, 2) . ' ' . t('days');
14
+    $time_in_days = $values->host_app_version_turnaround_avg/(24*60*60);
15
+    return round($time_in_days, 2).' '.t('days');
16 16
   }
17 17
 }
Please login to merge, or discard this patch.
boincwork/views/views_handler_field_boincwork_app_version_number.inc 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
  */
7 7
 
8 8
 class views_handler_field_boincwork_app_version_number extends views_handler_field {
9
-  function construct() {
9
+    function construct() {
10 10
     parent::construct();
11
-  }
11
+    }
12 12
 
13
-  function render($values) {
13
+    function render($values) {
14 14
     return sprintf("%01.2f", $values->app_version_host_app_version_version_num / 100);
15
-  }
15
+    }
16 16
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
   }
12 12
 
13 13
   function render($values) {
14
-    return sprintf("%01.2f", $values->app_version_host_app_version_version_num / 100);
14
+    return sprintf("%01.2f", $values->app_version_host_app_version_version_num/100);
15 15
   }
16 16
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincwork/boincwork.views.inc 3 patches
Indentation   +776 added lines, -776 removed lines patch added patch discarded remove patch
@@ -13,1617 +13,1617 @@  discard block
 block discarded – undo
13 13
  */
14 14
 function boincwork_views_data() {
15 15
   
16
-  // -----------------------------------------------------------------------------------------------
17
-  // Definition for host table
18
-  // -----------------------------------------------------------------------------------------------
16
+    // -----------------------------------------------------------------------------------------------
17
+    // Definition for host table
18
+    // -----------------------------------------------------------------------------------------------
19 19
   
20
-  $data['host']['table']['group'] = t('BOINC');
20
+    $data['host']['table']['group'] = t('BOINC');
21 21
   
22
-  $data['host']['table']['base'] = array(
23
-      'field' => 'id',
24
-      'title' => t('BOINC host'),
25
-      'help' => t('Computers attached to BOINC'),
26
-      'database' => 'boinc'
27
-  );
22
+    $data['host']['table']['base'] = array(
23
+        'field' => 'id',
24
+        'title' => t('BOINC host'),
25
+        'help' => t('Computers attached to BOINC'),
26
+        'database' => 'boinc'
27
+    );
28 28
   
29
-  // This table references the {user} table.
30
-  // This join creates an 'implicit' relationship to the user table, so that when
31
-  // "User" is the base table, the fields are automatically available.
29
+    // This table references the {user} table.
30
+    // This join creates an 'implicit' relationship to the user table, so that when
31
+    // "User" is the base table, the fields are automatically available.
32 32
   
33
-  // Index this array by the table name to which this table refers.
34
-  // 'left_field' is the primary key in the referenced table.
35
-  // 'field' is the foreign key in this table.
33
+    // Index this array by the table name to which this table refers.
34
+    // 'left_field' is the primary key in the referenced table.
35
+    // 'field' is the foreign key in this table.
36 36
   
37
-  $data['host']['table']['join'] = array(
37
+    $data['host']['table']['join'] = array(
38 38
     'user' => array(
39
-      'left_field' => 'id',
40
-      'field' => 'userid',
39
+        'left_field' => 'id',
40
+        'field' => 'userid',
41 41
     )
42
-  );
42
+    );
43 43
 
44
-  // Describe each of the individual fields in this table to Views. For
45
-  // each field, you may define what field, sort, argument, and/or filter
46
-  // handlers it supports. This will determine where in the Views interface you
47
-  // may use the field.
44
+    // Describe each of the individual fields in this table to Views. For
45
+    // each field, you may define what field, sort, argument, and/or filter
46
+    // handlers it supports. This will determine where in the Views interface you
47
+    // may use the field.
48 48
   
49
-  // Primary keys allowed as arguments
49
+    // Primary keys allowed as arguments
50 50
   
51
-  $data['host']['id'] = array(
51
+    $data['host']['id'] = array(
52 52
     'title' => bts('Computer ID'),
53 53
     'help' => t('The ID number of this host.'),
54 54
     'field' => array(
55
-      'handler' => 'views_handler_field_numeric',
56
-      'click sortable' => TRUE
55
+        'handler' => 'views_handler_field_numeric',
56
+        'click sortable' => TRUE
57 57
     ),
58 58
     'argument' => array(
59
-      'handler' => 'views_handler_argument',
60
-      'name field' => 'title',
61
-      'numeric' => TRUE,
62
-      'validate type' => 'id'
59
+        'handler' => 'views_handler_argument',
60
+        'name field' => 'title',
61
+        'numeric' => TRUE,
62
+        'validate type' => 'id'
63 63
     ),
64 64
     'filter' => array(
65
-      'handler' => 'views_handler_filter_numeric'
65
+        'handler' => 'views_handler_filter_numeric'
66 66
     ),
67 67
     'sort' => array(
68
-      'handler' => 'views_handler_sort_numeric'
68
+        'handler' => 'views_handler_sort_numeric'
69 69
     )
70
-  );
71
-  $data['host']['venue'] = array(
70
+    );
71
+    $data['host']['venue'] = array(
72 72
     'title' => bts('Location'),
73 73
     'help' => t('The name of the preference set assigned to this host.'),
74 74
     'field' => array(
75
-      'handler' => 'views_handler_field',
76
-      'click sortable' => TRUE
75
+        'handler' => 'views_handler_field',
76
+        'click sortable' => TRUE
77 77
     ),
78 78
     'argument' => array(
79
-      'handler' => 'views_handler_argument',
80
-      'name field' => 'title'
79
+        'handler' => 'views_handler_argument',
80
+        'name field' => 'title'
81 81
     ),
82 82
     'filter' => array(
83
-      'handler' => 'views_handler_filter_string'
83
+        'handler' => 'views_handler_filter_string'
84 84
     ),
85 85
     'sort' => array(
86
-      'handler' => 'views_handler_sort_string'
86
+        'handler' => 'views_handler_sort_string'
87 87
     )
88
-  );
88
+    );
89 89
   
90
-  // Foreign key fields
90
+    // Foreign key fields
91 91
   
92
-  $data['host']['userid'] = array(
92
+    $data['host']['userid'] = array(
93 93
     'title' => bts('User ID'),
94 94
     'help' => t('The owner of this host.'),
95 95
     // Because this is a foreign key to the {user} table. This allows us to
96 96
     // have, when the view is configured with this relationship, all the fields
97 97
     // for the related node available.
98 98
     'argument' => array(
99
-      'handler' => 'views_handler_argument_boincuser_id',
100
-      'name field' => 'title',
101
-      'numeric' => TRUE,
102
-      'validate type' => 'id'
99
+        'handler' => 'views_handler_argument_boincuser_id',
100
+        'name field' => 'title',
101
+        'numeric' => TRUE,
102
+        'validate type' => 'id'
103 103
     ),
104 104
     'relationship' => array(
105
-      'base' => 'user',
106
-      'field' => 'userid',
107
-      'handler' => 'views_handler_relationship',
108
-      'label' => t('User')
105
+        'base' => 'user',
106
+        'field' => 'userid',
107
+        'handler' => 'views_handler_relationship',
108
+        'label' => t('User')
109 109
     ),
110 110
     'field' => array(
111
-      'handler' => 'views_handler_field_numeric',
112
-      'click sortable' => TRUE
111
+        'handler' => 'views_handler_field_numeric',
112
+        'click sortable' => TRUE
113 113
     ),
114 114
     'filter' => array(
115
-      'handler' => 'views_handler_filter_numeric'
115
+        'handler' => 'views_handler_filter_numeric'
116 116
     ),
117 117
     'sort' => array(
118
-      'handler' => 'views_handler_sort_numeric'
118
+        'handler' => 'views_handler_sort_numeric'
119 119
     )
120
-  );
120
+    );
121 121
   
122
-  // Descriptions of general host fields (alphabetized)
122
+    // Descriptions of general host fields (alphabetized)
123 123
   
124
-  $data['host']['active_frac'] = array(
124
+    $data['host']['active_frac'] = array(
125 125
     'title' => bts('While BOINC running, % of time work is allowed'),
126 126
     'help' => t('The percentage of time that work is allowed.'),
127 127
     'field' => array(
128
-      'handler' => 'views_handler_field_numeric',
129
-      'click sortable' => TRUE,
130
-      'float' => TRUE
128
+        'handler' => 'views_handler_field_numeric',
129
+        'click sortable' => TRUE,
130
+        'float' => TRUE
131 131
     ),
132 132
     'filter' => array(
133
-      'handler' => 'views_handler_filter_numeric'
133
+        'handler' => 'views_handler_filter_numeric'
134 134
     ),
135 135
     'sort' => array(
136
-      'handler' => 'views_handler_sort_numeric'
136
+        'handler' => 'views_handler_sort_numeric'
137 137
     )
138
-  );
139
-  $data['host']['avg_turnaround'] = array(
138
+    );
139
+    $data['host']['avg_turnaround'] = array(
140 140
     'title' => bts('Average turnaround time'),
141 141
     'help' => t('The average time required for work to be completed.'),
142 142
     'field' => array(
143
-      'handler' => 'views_handler_field_numeric',
144
-      'click sortable' => TRUE,
145
-      'float' => TRUE
143
+        'handler' => 'views_handler_field_numeric',
144
+        'click sortable' => TRUE,
145
+        'float' => TRUE
146 146
     ),
147 147
     'filter' => array(
148
-      'handler' => 'views_handler_filter_numeric'
148
+        'handler' => 'views_handler_filter_numeric'
149 149
     ),
150 150
     'sort' => array(
151
-      'handler' => 'views_handler_sort_numeric'
151
+        'handler' => 'views_handler_sort_numeric'
152 152
     )
153
-  );
154
-  $data['host']['create_time'] = array(
153
+    );
154
+    $data['host']['create_time'] = array(
155 155
     'title' => bts('Created'),
156 156
     'help' => t('The time the host record was created.'),
157 157
     'field' => array(
158
-      'handler' => 'views_handler_field_date',
159
-      'click sortable' => TRUE
158
+        'handler' => 'views_handler_field_date',
159
+        'click sortable' => TRUE
160 160
     ),
161 161
     'filter' => array(
162
-      'handler' => 'views_handler_filter_date'
162
+        'handler' => 'views_handler_filter_date'
163 163
     ),
164 164
     'sort' => array(
165
-      'handler' => 'views_handler_sort_date'
165
+        'handler' => 'views_handler_sort_date'
166 166
     )
167
-  );
168
-  $data['host']['connected_frac'] = array(
167
+    );
168
+    $data['host']['connected_frac'] = array(
169 169
     'title' => bts('While BOINC running, % of time host has an Internet connection'),
170 170
     'help' => t('The percentage of time that the host has an Internet connection.'),
171 171
     'field' => array(
172
-      'handler' => 'views_handler_field_numeric',
173
-      'click sortable' => TRUE,
174
-      'float' => TRUE
172
+        'handler' => 'views_handler_field_numeric',
173
+        'click sortable' => TRUE,
174
+        'float' => TRUE
175 175
     ),
176 176
     'filter' => array(
177
-      'handler' => 'views_handler_filter_numeric'
177
+        'handler' => 'views_handler_filter_numeric'
178 178
     ),
179 179
     'sort' => array(
180
-      'handler' => 'views_handler_sort_numeric'
180
+        'handler' => 'views_handler_sort_numeric'
181 181
     )
182
-  );
183
-  $data['host']['cpu_efficiency'] = array(
182
+    );
183
+    $data['host']['cpu_efficiency'] = array(
184 184
     'title' => bts('Average CPU efficiency'),
185 185
     'help' => t('The average efficiency of the host CPU.'),
186 186
     'field' => array(
187
-      'handler' => 'views_handler_field_numeric',
188
-      'click sortable' => TRUE,
189
-      'float' => TRUE
187
+        'handler' => 'views_handler_field_numeric',
188
+        'click sortable' => TRUE,
189
+        'float' => TRUE
190 190
     ),
191 191
     'filter' => array(
192
-      'handler' => 'views_handler_filter_numeric'
192
+        'handler' => 'views_handler_filter_numeric'
193 193
     ),
194 194
     'sort' => array(
195
-      'handler' => 'views_handler_sort_numeric'
195
+        'handler' => 'views_handler_sort_numeric'
196 196
     )
197
-  );
198
-  $data['host']['d_free'] = array(
197
+    );
198
+    $data['host']['d_free'] = array(
199 199
     'title' => bts('Free disk space'),
200 200
     'help' => t('The amount of disk space that is not in use.'),
201 201
     'field' => array(
202
-      'handler' => 'views_handler_field_numeric',
203
-      'click sortable' => TRUE
202
+        'handler' => 'views_handler_field_numeric',
203
+        'click sortable' => TRUE
204 204
     ),
205 205
     'filter' => array(
206
-      'handler' => 'views_handler_filter_numeric'
206
+        'handler' => 'views_handler_filter_numeric'
207 207
     ),
208 208
     'sort' => array(
209
-      'handler' => 'views_handler_sort_numeric'
209
+        'handler' => 'views_handler_sort_numeric'
210 210
     )
211
-  );
212
-  $data['host']['d_total'] = array(
211
+    );
212
+    $data['host']['d_total'] = array(
213 213
     'title' => bts('Total disk space'),
214 214
     'help' => t('The size of the disk on which BOINC is installed.'),
215 215
     'field' => array(
216
-      'handler' => 'views_handler_field_numeric',
217
-      'click sortable' => TRUE
216
+        'handler' => 'views_handler_field_numeric',
217
+        'click sortable' => TRUE
218 218
     ),
219 219
     'filter' => array(
220
-      'handler' => 'views_handler_filter_numeric'
220
+        'handler' => 'views_handler_filter_numeric'
221 221
     ),
222 222
     'sort' => array(
223
-      'handler' => 'views_handler_sort_numeric'
223
+        'handler' => 'views_handler_sort_numeric'
224 224
     )
225
-  );
226
-  $data['host']['domain_name'] = array(
225
+    );
226
+    $data['host']['domain_name'] = array(
227 227
     'title' => bts('Name'),
228 228
     'help' => t('The name of the host.'),
229 229
     'field' => array(
230
-      'handler' => 'views_handler_field',
231
-      'click sortable' => TRUE
230
+        'handler' => 'views_handler_field',
231
+        'click sortable' => TRUE
232 232
     ),
233 233
     'filter' => array(
234
-      'handler' => 'views_handler_filter_string'
234
+        'handler' => 'views_handler_filter_string'
235 235
     ),
236 236
     'sort' => array(
237
-      'handler' => 'views_handler_sort_string'
237
+        'handler' => 'views_handler_sort_string'
238 238
     )
239
-  );
240
-  $data['host']['duration_correction_factor'] = array(
239
+    );
240
+    $data['host']['duration_correction_factor'] = array(
241 241
     'title' => bts('Task duration correction factor'),
242 242
     'help' => t('Task duration correction factor.'),
243 243
     'field' => array(
244
-      'handler' => 'views_handler_field_numeric',
245
-      'click sortable' => TRUE,
246
-      'float' => TRUE
244
+        'handler' => 'views_handler_field_numeric',
245
+        'click sortable' => TRUE,
246
+        'float' => TRUE
247 247
     ),
248 248
     'filter' => array(
249
-      'handler' => 'views_handler_filter_numeric'
249
+        'handler' => 'views_handler_filter_numeric'
250 250
     ),
251 251
     'sort' => array(
252
-      'handler' => 'views_handler_sort_numeric'
252
+        'handler' => 'views_handler_sort_numeric'
253 253
     )
254
-  );
255
-  $data['host']['expavg_credit'] = array(
254
+    );
255
+    $data['host']['expavg_credit'] = array(
256 256
     'title' => bts('Avg. credit'),
257 257
     'help' => t('A decaying average of credit per day.'),
258 258
     'field' => array(
259
-      'handler' => 'views_handler_field_numeric',
260
-      'click sortable' => TRUE,
261
-      'float' => TRUE
259
+        'handler' => 'views_handler_field_numeric',
260
+        'click sortable' => TRUE,
261
+        'float' => TRUE
262 262
     ),
263 263
     'filter' => array(
264
-      'handler' => 'views_handler_filter_numeric'
264
+        'handler' => 'views_handler_filter_numeric'
265 265
     ),
266 266
     'sort' => array(
267
-      'handler' => 'views_handler_sort_numeric'
267
+        'handler' => 'views_handler_sort_numeric'
268 268
     )
269
-  );
270
-  $data['host']['external_ip_addr'] = array(
269
+    );
270
+    $data['host']['external_ip_addr'] = array(
271 271
     'title' => bts('External IP address'),
272 272
     'help' => t('The IP address from which the host last communicated.'),
273 273
     'field' => array(
274
-      'handler' => 'views_handler_field',
275
-      'click sortable' => TRUE
274
+        'handler' => 'views_handler_field',
275
+        'click sortable' => TRUE
276 276
     ),
277 277
     'filter' => array(
278
-      'handler' => 'views_handler_filter_string'
278
+        'handler' => 'views_handler_filter_string'
279 279
     ),
280 280
     'sort' => array(
281
-      'handler' => 'views_handler_sort_string'
281
+        'handler' => 'views_handler_sort_string'
282 282
     )
283
-  );
284
-  $data['host']['host_cpid'] = array(
283
+    );
284
+    $data['host']['host_cpid'] = array(
285 285
     'title' => bts('Cross project ID'),
286 286
     'help' => t('The consistent identifier of the host across projects.'),
287 287
     'field' => array(
288
-      'handler' => 'views_handler_field',
289
-      'click sortable' => TRUE
288
+        'handler' => 'views_handler_field',
289
+        'click sortable' => TRUE
290 290
     ),
291 291
     'filter' => array(
292
-      'handler' => 'views_handler_filter_string'
292
+        'handler' => 'views_handler_filter_string'
293 293
     ),
294 294
     'sort' => array(
295
-      'handler' => 'views_handler_sort_string'
295
+        'handler' => 'views_handler_sort_string'
296 296
     )
297
-  );
298
-  $data['host']['last_ip_addr'] = array(
297
+    );
298
+    $data['host']['last_ip_addr'] = array(
299 299
     'title' => bts('Last IP address'),
300 300
     'help' => t('The IP address of the host at last communication.'),
301 301
     'field' => array(
302
-      'handler' => 'views_handler_field',
303
-      'click sortable' => TRUE
302
+        'handler' => 'views_handler_field',
303
+        'click sortable' => TRUE
304 304
     ),
305 305
     'filter' => array(
306
-      'handler' => 'views_handler_filter_string'
306
+        'handler' => 'views_handler_filter_string'
307 307
     ),
308 308
     'sort' => array(
309
-      'handler' => 'views_handler_sort_string'
309
+        'handler' => 'views_handler_sort_string'
310 310
     )
311
-  );
312
-  $data['host']['m_cache'] = array(
311
+    );
312
+    $data['host']['m_cache'] = array(
313 313
     'title' => bts('Cache'),
314 314
     'help' => t('The amount of cache on the processor(s).'),
315 315
     'field' => array(
316
-      'handler' => 'views_handler_field_numeric',
317
-      'click sortable' => TRUE
316
+        'handler' => 'views_handler_field_numeric',
317
+        'click sortable' => TRUE
318 318
     ),
319 319
     'filter' => array(
320
-      'handler' => 'views_handler_filter_numeric'
320
+        'handler' => 'views_handler_filter_numeric'
321 321
     ),
322 322
     'sort' => array(
323
-      'handler' => 'views_handler_sort_numeric'
323
+        'handler' => 'views_handler_sort_numeric'
324 324
     )
325
-  );
326
-  $data['host']['m_nbytes'] = array(
325
+    );
326
+    $data['host']['m_nbytes'] = array(
327 327
     'title' => bts('Memory'),
328 328
     'help' => t('The amount of memory installed.'),
329 329
     'field' => array(
330
-      'handler' => 'views_handler_field_numeric',
331
-      'click sortable' => TRUE
330
+        'handler' => 'views_handler_field_numeric',
331
+        'click sortable' => TRUE
332 332
     ),
333 333
     'filter' => array(
334
-      'handler' => 'views_handler_filter_numeric'
334
+        'handler' => 'views_handler_filter_numeric'
335 335
     ),
336 336
     'sort' => array(
337
-      'handler' => 'views_handler_sort_numeric'
337
+        'handler' => 'views_handler_sort_numeric'
338 338
     )
339
-  );
340
-  $data['host']['m_swap'] = array(
339
+    );
340
+    $data['host']['m_swap'] = array(
341 341
     'title' => bts('Swap space'),
342 342
     'help' => t('The amount of swap space configured.'),
343 343
     'field' => array(
344
-      'handler' => 'views_handler_field_numeric',
345
-      'click sortable' => TRUE
344
+        'handler' => 'views_handler_field_numeric',
345
+        'click sortable' => TRUE
346 346
     ),
347 347
     'filter' => array(
348
-      'handler' => 'views_handler_filter_numeric'
348
+        'handler' => 'views_handler_filter_numeric'
349 349
     ),
350 350
     'sort' => array(
351
-      'handler' => 'views_handler_sort_numeric'
351
+        'handler' => 'views_handler_sort_numeric'
352 352
     )
353
-  );
354
-  $data['host']['max_results_day'] = array(
353
+    );
354
+    $data['host']['max_results_day'] = array(
355 355
     'title' => bts('Maximum daily WU quota per CPU'),
356 356
     'help' => t('The maximum number of workunits to be allocated per CPU.'),
357 357
     'field' => array(
358
-      'handler' => 'views_handler_field_numeric',
359
-      'click sortable' => TRUE
358
+        'handler' => 'views_handler_field_numeric',
359
+        'click sortable' => TRUE
360 360
     ),
361 361
     'filter' => array(
362
-      'handler' => 'views_handler_filter_numeric'
362
+        'handler' => 'views_handler_filter_numeric'
363 363
     ),
364 364
     'sort' => array(
365
-      'handler' => 'views_handler_sort_numeric'
365
+        'handler' => 'views_handler_sort_numeric'
366 366
     )
367
-  );
368
-  $data['host']['n_bwdown'] = array(
367
+    );
368
+    $data['host']['n_bwdown'] = array(
369 369
     'title' => bts('Average download rate'),
370 370
     'help' => t('The average rate at which new work is downloaded.'),
371 371
     'field' => array(
372
-      'handler' => 'views_handler_field_numeric',
373
-      'click sortable' => TRUE,
374
-      'float' => TRUE
372
+        'handler' => 'views_handler_field_numeric',
373
+        'click sortable' => TRUE,
374
+        'float' => TRUE
375 375
     ),
376 376
     'filter' => array(
377
-      'handler' => 'views_handler_filter_numeric'
377
+        'handler' => 'views_handler_filter_numeric'
378 378
     ),
379 379
     'sort' => array(
380
-      'handler' => 'views_handler_sort_numeric'
380
+        'handler' => 'views_handler_sort_numeric'
381 381
     )
382
-  );
383
-  $data['host']['n_bwup'] = array(
382
+    );
383
+    $data['host']['n_bwup'] = array(
384 384
     'title' => bts('Average upload rate'),
385 385
     'help' => t('The average rate at which completed work is uploaded.'),
386 386
     'field' => array(
387
-      'handler' => 'views_handler_field_numeric',
388
-      'click sortable' => TRUE,
389
-      'float' => TRUE
387
+        'handler' => 'views_handler_field_numeric',
388
+        'click sortable' => TRUE,
389
+        'float' => TRUE
390 390
     ),
391 391
     'filter' => array(
392
-      'handler' => 'views_handler_filter_numeric'
392
+        'handler' => 'views_handler_filter_numeric'
393 393
     ),
394 394
     'sort' => array(
395
-      'handler' => 'views_handler_sort_numeric'
395
+        'handler' => 'views_handler_sort_numeric'
396 396
     )
397
-  );
398
-  $data['host']['nsame_ip_addr'] = array(
397
+    );
398
+    $data['host']['nsame_ip_addr'] = array(
399 399
     'title' => bts('Same IP address count'),
400 400
     'help' => t('The number of times the last IP address.'),
401 401
     'field' => array(
402
-      'handler' => 'views_handler_field',
403
-      'click sortable' => TRUE
402
+        'handler' => 'views_handler_field',
403
+        'click sortable' => TRUE
404 404
     ),
405 405
     'filter' => array(
406
-      'handler' => 'views_handler_filter_string'
406
+        'handler' => 'views_handler_filter_string'
407 407
     ),
408 408
     'sort' => array(
409
-      'handler' => 'views_handler_sort_string'
409
+        'handler' => 'views_handler_sort_string'
410 410
     )
411
-  );
412
-  $data['host']['on_frac'] = array(
411
+    );
412
+    $data['host']['on_frac'] = array(
413 413
     'title' => bts('% of time BOINC client is running'),
414 414
     'help' => t('The percentage of time that the BOINC client is running.'),
415 415
     'field' => array(
416
-      'handler' => 'views_handler_field_numeric',
417
-      'click sortable' => TRUE,
418
-      'float' => TRUE
416
+        'handler' => 'views_handler_field_numeric',
417
+        'click sortable' => TRUE,
418
+        'float' => TRUE
419 419
     ),
420 420
     'filter' => array(
421
-      'handler' => 'views_handler_filter_numeric'
421
+        'handler' => 'views_handler_filter_numeric'
422 422
     ),
423 423
     'sort' => array(
424
-      'handler' => 'views_handler_sort_numeric'
424
+        'handler' => 'views_handler_sort_numeric'
425 425
     )
426
-  );
427
-  $data['host']['os_name'] = array(
426
+    );
427
+    $data['host']['os_name'] = array(
428 428
     'title' => bts('Operating system'),
429 429
     'help' => t('The name of the host operating system.'),
430 430
     'field' => array(
431
-      'handler' => 'views_handler_field',
432
-      'click sortable' => TRUE
431
+        'handler' => 'views_handler_field',
432
+        'click sortable' => TRUE
433 433
     ),
434 434
     'filter' => array(
435
-      'handler' => 'views_handler_filter_string'
435
+        'handler' => 'views_handler_filter_string'
436 436
     ),
437 437
     'sort' => array(
438
-      'handler' => 'views_handler_sort_string'
438
+        'handler' => 'views_handler_sort_string'
439 439
     )
440
-  );  
441
-  $data['host']['os_version'] = array(
440
+    );  
441
+    $data['host']['os_version'] = array(
442 442
     'title' => bts('Operating system version'),
443 443
     'help' => t('The version of the host operating system.'),
444 444
     'field' => array(
445
-      'handler' => 'views_handler_field',
446
-      'click sortable' => TRUE
445
+        'handler' => 'views_handler_field',
446
+        'click sortable' => TRUE
447 447
     ),
448 448
     'filter' => array(
449
-      'handler' => 'views_handler_filter_string'
449
+        'handler' => 'views_handler_filter_string'
450 450
     ),
451 451
     'sort' => array(
452
-      'handler' => 'views_handler_sort_string'
452
+        'handler' => 'views_handler_sort_string'
453 453
     )
454
-  );
455
-  $data['host']['p_fpops'] = array(
454
+    );
455
+    $data['host']['p_fpops'] = array(
456 456
     'title' => bts('Measured floating point speed'),
457 457
     'help' => t('The capability of the host in floating point operations per second.'),
458 458
     'field' => array(
459
-      'handler' => 'views_handler_field_numeric',
460
-      'click sortable' => TRUE,
461
-      'float' => TRUE
459
+        'handler' => 'views_handler_field_numeric',
460
+        'click sortable' => TRUE,
461
+        'float' => TRUE
462 462
     ),
463 463
     'filter' => array(
464
-      'handler' => 'views_handler_filter_numeric'
464
+        'handler' => 'views_handler_filter_numeric'
465 465
     ),
466 466
     'sort' => array(
467
-      'handler' => 'views_handler_sort_numeric'
467
+        'handler' => 'views_handler_sort_numeric'
468 468
     )
469
-  );
470
-  $data['host']['p_iops'] = array(
469
+    );
470
+    $data['host']['p_iops'] = array(
471 471
     'title' => bts('Measured integer speed'),
472 472
     'help' => t('The capability of the host in integer operations per second.'),
473 473
     'field' => array(
474
-      'handler' => 'views_handler_field_numeric',
475
-      'click sortable' => TRUE,
476
-      'float' => TRUE
474
+        'handler' => 'views_handler_field_numeric',
475
+        'click sortable' => TRUE,
476
+        'float' => TRUE
477 477
     ),
478 478
     'filter' => array(
479
-      'handler' => 'views_handler_filter_numeric'
479
+        'handler' => 'views_handler_filter_numeric'
480 480
     ),
481 481
     'sort' => array(
482
-      'handler' => 'views_handler_sort_numeric'
482
+        'handler' => 'views_handler_sort_numeric'
483 483
     )
484
-  );
485
-  $data['host']['p_model'] = array(
484
+    );
485
+    $data['host']['p_model'] = array(
486 486
     'title' => bts('CPU model'),
487 487
     'help' => t('The model of the CPU in the host.'),
488 488
     'field' => array(
489
-      'handler' => 'views_handler_field',
490
-      'click sortable' => TRUE
489
+        'handler' => 'views_handler_field',
490
+        'click sortable' => TRUE
491 491
     ),
492 492
     'filter' => array(
493
-      'handler' => 'views_handler_filter_string'
493
+        'handler' => 'views_handler_filter_string'
494 494
     ),
495 495
     'sort' => array(
496
-      'handler' => 'views_handler_sort_string'
496
+        'handler' => 'views_handler_sort_string'
497 497
     )
498
-  );
499
-  $data['host']['p_ncpus'] = array(
498
+    );
499
+    $data['host']['p_ncpus'] = array(
500 500
     'title' => bts('Number of processors'),
501 501
     'help' => t('The count of CPU cores in the system.'),
502 502
     'field' => array(
503
-      'handler' => 'views_handler_field',
504
-      'click sortable' => TRUE
503
+        'handler' => 'views_handler_field',
504
+        'click sortable' => TRUE
505 505
     ),
506 506
     'filter' => array(
507
-      'handler' => 'views_handler_filter_string'
507
+        'handler' => 'views_handler_filter_string'
508 508
     ),
509 509
     'sort' => array(
510
-      'handler' => 'views_handler_sort_string'
510
+        'handler' => 'views_handler_sort_string'
511 511
     )
512
-  );
513
-  $data['host']['p_vendor'] = array(
512
+    );
513
+    $data['host']['p_vendor'] = array(
514 514
     'title' => bts('CPU'),
515 515
     'help' => t('The manufacturer of the CPU in the host.'),
516 516
     'field' => array(
517
-      'handler' => 'views_handler_field',
518
-      'click sortable' => TRUE
517
+        'handler' => 'views_handler_field',
518
+        'click sortable' => TRUE
519 519
     ),
520 520
     'filter' => array(
521
-      'handler' => 'views_handler_filter_string'
521
+        'handler' => 'views_handler_filter_string'
522 522
     ),
523 523
     'sort' => array(
524
-      'handler' => 'views_handler_sort_string'
524
+        'handler' => 'views_handler_sort_string'
525 525
     )
526
-  );
527
-  $data['host']['rpc_seqno'] = array(
526
+    );
527
+    $data['host']['rpc_seqno'] = array(
528 528
     'title' => bts('Number of times client has contacted server'),
529 529
     'help' => t('The number of times the client has contacted the server.'),
530 530
     'field' => array(
531
-      'handler' => 'views_handler_field_numeric',
532
-      'click sortable' => TRUE
531
+        'handler' => 'views_handler_field_numeric',
532
+        'click sortable' => TRUE
533 533
     ),
534 534
     'filter' => array(
535
-      'handler' => 'views_handler_filter_numeric'
535
+        'handler' => 'views_handler_filter_numeric'
536 536
     ),
537 537
     'sort' => array(
538
-      'handler' => 'views_handler_sort_numeric'
538
+        'handler' => 'views_handler_sort_numeric'
539 539
     )
540
-  );
541
-  $data['host']['rpc_time'] = array(
540
+    );
541
+    $data['host']['rpc_time'] = array(
542 542
     'title' => bts('Last contact'),
543 543
     'help' => t('The time of the last RPC contact with the host.'),
544 544
     'field' => array(
545
-      'handler' => 'views_handler_field_date',
546
-      'click sortable' => TRUE
545
+        'handler' => 'views_handler_field_date',
546
+        'click sortable' => TRUE
547 547
     ),
548 548
     'filter' => array(
549
-      'handler' => 'views_handler_filter_date'
549
+        'handler' => 'views_handler_filter_date'
550 550
     ),
551 551
     'sort' => array(
552
-      'handler' => 'views_handler_sort_date'
552
+        'handler' => 'views_handler_sort_date'
553 553
     )
554
-  );
555
-  $data['host']['serialnum'] = array(
554
+    );
555
+    $data['host']['serialnum'] = array(
556 556
     'title' => bts('Serial number'),
557 557
     'help' => t('Contains the release number of the BOINC application in use and the GPU of the host.'),
558 558
     'field' => array(
559
-      'handler' => 'views_handler_field',
560
-      'click sortable' => TRUE
559
+        'handler' => 'views_handler_field',
560
+        'click sortable' => TRUE
561 561
     ),
562 562
     'filter' => array(
563
-      'handler' => 'views_handler_filter_string'
563
+        'handler' => 'views_handler_filter_string'
564 564
     ),
565 565
     'sort' => array(
566
-      'handler' => 'views_handler_sort_string'
566
+        'handler' => 'views_handler_sort_string'
567 567
     )
568
-  );
569
-  $data['host']['timezone'] = array(
568
+    );
569
+    $data['host']['timezone'] = array(
570 570
     'title' => bts('Timezone'),
571 571
     'help' => t('The UTC offset of the local time.'),
572 572
     'field' => array(
573
-      'handler' => 'views_handler_field_numeric',
574
-      'click sortable' => TRUE
573
+        'handler' => 'views_handler_field_numeric',
574
+        'click sortable' => TRUE
575 575
     ),
576 576
     'filter' => array(
577
-      'handler' => 'views_handler_filter_numeric'
577
+        'handler' => 'views_handler_filter_numeric'
578 578
     ),
579 579
     'sort' => array(
580
-      'handler' => 'views_handler_sort_numeric'
580
+        'handler' => 'views_handler_sort_numeric'
581 581
     )
582
-  );
583
-  $data['host']['total_credit'] = array(
582
+    );
583
+    $data['host']['total_credit'] = array(
584 584
     'title' => bts('Total Credit'),
585 585
     'help' => t('The total accumulated BOINC credit.'),
586 586
     'field' => array(
587
-      'handler' => 'views_handler_field_numeric',
588
-      'click sortable' => TRUE,
589
-      'float' => TRUE
587
+        'handler' => 'views_handler_field_numeric',
588
+        'click sortable' => TRUE,
589
+        'float' => TRUE
590 590
     ),
591 591
     'filter' => array(
592
-      'handler' => 'views_handler_filter_numeric'
592
+        'handler' => 'views_handler_filter_numeric'
593 593
     ),
594 594
     'sort' => array(
595
-      'handler' => 'views_handler_sort_numeric'
595
+        'handler' => 'views_handler_sort_numeric'
596 596
     )
597
-  );
597
+    );
598 598
   
599
-  // ------------------------------------------------------------------------------------------------
600
-  // Definition for platform table
601
-  // ------------------------------------------------------------------------------------------------
599
+    // ------------------------------------------------------------------------------------------------
600
+    // Definition for platform table
601
+    // ------------------------------------------------------------------------------------------------
602 602
   
603
-  $data['platform']['table']['group'] = t('BOINC');
604
-  $data['platform']['table']['base'] = array(
605
-      'field' => 'id',
606
-      'title' => t('BOINC platform'),
607
-      'help' => t('Operating system platforms'),
608
-      'database' => 'boinc'
609
-  );
603
+    $data['platform']['table']['group'] = t('BOINC');
604
+    $data['platform']['table']['base'] = array(
605
+        'field' => 'id',
606
+        'title' => t('BOINC platform'),
607
+        'help' => t('Operating system platforms'),
608
+        'database' => 'boinc'
609
+    );
610 610
   
611
-  // Primary keys allowed as arguments
611
+    // Primary keys allowed as arguments
612 612
 
613
-  $data['platform']['id'] = array(
613
+    $data['platform']['id'] = array(
614 614
     'title' => bts('Platform ID'),
615 615
     'help' => t('The ID number of the platform.'),
616 616
     'field' => array(
617
-      'handler' => 'views_handler_field_numeric',
618
-      'click sortable' => TRUE
617
+        'handler' => 'views_handler_field_numeric',
618
+        'click sortable' => TRUE
619 619
     ),
620 620
     'argument' => array(
621
-      'handler' => 'views_handler_argument',
622
-      'name field' => 'title',
623
-      'numeric' => TRUE,
624
-      'validate type' => 'id'
621
+        'handler' => 'views_handler_argument',
622
+        'name field' => 'title',
623
+        'numeric' => TRUE,
624
+        'validate type' => 'id'
625 625
     ),
626 626
     'filter' => array(
627
-      'handler' => 'views_handler_filter_numeric'
627
+        'handler' => 'views_handler_filter_numeric'
628 628
     ),
629 629
     'sort' => array(
630
-      'handler' => 'views_handler_sort_numeric'
630
+        'handler' => 'views_handler_sort_numeric'
631 631
     )
632
-  );
632
+    );
633 633
   
634
-  // Descriptions of app fields (alphabetized)
634
+    // Descriptions of app fields (alphabetized)
635 635
   
636
-  $data['platform']['name'] = array(
636
+    $data['platform']['name'] = array(
637 637
     'title' => bts('Name'),
638 638
     'help' => t('The name of the platform.'),
639 639
     'field' => array(
640
-      'handler' => 'views_handler_field',
641
-      'click sortable' => TRUE
640
+        'handler' => 'views_handler_field',
641
+        'click sortable' => TRUE
642 642
     ),
643 643
     'filter' => array(
644
-      'handler' => 'views_handler_filter_string'
644
+        'handler' => 'views_handler_filter_string'
645 645
     ),
646 646
     'sort' => array(
647
-      'handler' => 'views_handler_sort_string'
647
+        'handler' => 'views_handler_sort_string'
648 648
     )
649
-  );
649
+    );
650 650
   
651
-  // ------------------------------------------------------------------------------------------------
652
-  // Definition for result (task) table
653
-  // ------------------------------------------------------------------------------------------------
651
+    // ------------------------------------------------------------------------------------------------
652
+    // Definition for result (task) table
653
+    // ------------------------------------------------------------------------------------------------
654 654
   
655
-  $data['result']['table']['group'] = t('BOINC');
656
-  $data['result']['table']['base'] = array(
657
-      'field' => 'id',
658
-      'title' => t('BOINC result'),
659
-      'help' => t('Results produced by BOINC'),
660
-      'database' => 'boinc'
661
-  );
655
+    $data['result']['table']['group'] = t('BOINC');
656
+    $data['result']['table']['base'] = array(
657
+        'field' => 'id',
658
+        'title' => t('BOINC result'),
659
+        'help' => t('Results produced by BOINC'),
660
+        'database' => 'boinc'
661
+    );
662 662
   
663
-  // Create implicit relationships to the user, workunit, and host tables
663
+    // Create implicit relationships to the user, workunit, and host tables
664 664
   
665
-  $data['result']['table']['join'] = array(
665
+    $data['result']['table']['join'] = array(
666 666
     'user' => array(
667
-      'left_field' => 'id',
668
-      'field' => 'userid'
667
+        'left_field' => 'id',
668
+        'field' => 'userid'
669 669
     ),
670 670
     'workunit' => array(
671
-      'left_field' => 'id',
672
-      'field' => 'workunitid'
671
+        'left_field' => 'id',
672
+        'field' => 'workunitid'
673 673
     ),
674 674
     'host' => array(
675
-      'left_field' => 'id',
676
-      'field' => 'hostid'
675
+        'left_field' => 'id',
676
+        'field' => 'hostid'
677 677
     )
678
-  );
678
+    );
679 679
   
680
-  // Primary keys allowed as arguments
680
+    // Primary keys allowed as arguments
681 681
 
682
-  $data['result']['id'] = array(
682
+    $data['result']['id'] = array(
683 683
     'title' => bts('Task ID'),
684 684
     'help' => t('The ID number of this result.'),
685 685
     'field' => array(
686
-      'handler' => 'views_handler_field_numeric',
687
-      'click sortable' => TRUE
686
+        'handler' => 'views_handler_field_numeric',
687
+        'click sortable' => TRUE
688 688
     ),
689 689
     'argument' => array(
690
-      'handler' => 'views_handler_argument',
691
-      'name field' => 'title',
692
-      'numeric' => TRUE,
693
-      'validate type' => 'id'
690
+        'handler' => 'views_handler_argument',
691
+        'name field' => 'title',
692
+        'numeric' => TRUE,
693
+        'validate type' => 'id'
694 694
     ),
695 695
     'filter' => array(
696
-      'handler' => 'views_handler_filter_numeric'
696
+        'handler' => 'views_handler_filter_numeric'
697 697
     ),
698 698
     'sort' => array(
699
-      'handler' => 'views_handler_sort_numeric'
699
+        'handler' => 'views_handler_sort_numeric'
700 700
     )
701
-  );
701
+    );
702 702
   
703
-  // Foreign key fields
703
+    // Foreign key fields
704 704
   
705
-  $data['result']['userid'] = array(
705
+    $data['result']['userid'] = array(
706 706
     'title' => bts('User ID'),
707 707
     'help' => t('The owner of this result.'),
708 708
     // Foreign key to the {user} table
709 709
     'argument' => array(
710
-      'handler' => 'views_handler_argument_boincuser_id',
711
-      'name field' => 'title',
712
-      'numeric' => TRUE,
713
-      'validate type' => 'id'
710
+        'handler' => 'views_handler_argument_boincuser_id',
711
+        'name field' => 'title',
712
+        'numeric' => TRUE,
713
+        'validate type' => 'id'
714 714
     ),
715 715
     'relationship' => array(
716
-      'base' => 'user',
717
-      'field' => 'userid',
718
-      'handler' => 'views_handler_relationship',
719
-      'label' => t('User')
716
+        'base' => 'user',
717
+        'field' => 'userid',
718
+        'handler' => 'views_handler_relationship',
719
+        'label' => t('User')
720 720
     )
721
-  );
722
-  $data['result']['workunitid'] = array(
721
+    );
722
+    $data['result']['workunitid'] = array(
723 723
     'title' => bts('Workunit ID'),
724 724
     'help' => t('The workunit associated with this result.'),
725 725
     // Foreign key to the {workunit} table
726 726
     'argument' => array(
727
-      'handler' => 'views_handler_argument',
728
-      'name field' => 'title',
729
-      'numeric' => TRUE,
730
-      'validate type' => 'id'
727
+        'handler' => 'views_handler_argument',
728
+        'name field' => 'title',
729
+        'numeric' => TRUE,
730
+        'validate type' => 'id'
731 731
     ),
732 732
     'relationship' => array(
733
-      'base' => 'workunit',
734
-      'field' => 'workunitid',
735
-      'handler' => 'views_handler_relationship',
736
-      'label' => t('Workunit')
733
+        'base' => 'workunit',
734
+        'field' => 'workunitid',
735
+        'handler' => 'views_handler_relationship',
736
+        'label' => t('Workunit')
737 737
     ),
738 738
     'field' => array(
739
-      'handler' => 'views_handler_field_numeric',
740
-      'click sortable' => TRUE
739
+        'handler' => 'views_handler_field_numeric',
740
+        'click sortable' => TRUE
741 741
     ),
742 742
     'filter' => array(
743
-      'handler' => 'views_handler_filter_numeric'
743
+        'handler' => 'views_handler_filter_numeric'
744 744
     ),
745 745
     'sort' => array(
746
-      'handler' => 'views_handler_sort_numeric'
746
+        'handler' => 'views_handler_sort_numeric'
747 747
     )
748
-  );
749
-  $data['result']['hostid'] = array(
748
+    );
749
+    $data['result']['hostid'] = array(
750 750
     'title' => bts('Host ID'),
751 751
     'help' => t('The host associated with this result.'),
752 752
     // Foreign key to the {host} table
753 753
     'argument' => array(
754
-      'handler' => 'views_handler_argument',
755
-      'name field' => 'title',
756
-      'numeric' => TRUE,
757
-      'validate type' => 'id'
754
+        'handler' => 'views_handler_argument',
755
+        'name field' => 'title',
756
+        'numeric' => TRUE,
757
+        'validate type' => 'id'
758 758
     ),
759 759
     'relationship' => array(
760
-      'base' => 'host',
761
-      'field' => 'hostid',
762
-      'handler' => 'views_handler_relationship',
763
-      'label' => t('Host')
760
+        'base' => 'host',
761
+        'field' => 'hostid',
762
+        'handler' => 'views_handler_relationship',
763
+        'label' => t('Host')
764 764
     ),
765 765
     'field' => array(
766
-      'handler' => 'views_handler_field_numeric',
767
-      'click sortable' => TRUE
766
+        'handler' => 'views_handler_field_numeric',
767
+        'click sortable' => TRUE
768 768
     ),
769 769
     'filter' => array(
770
-      'handler' => 'views_handler_filter_numeric'
770
+        'handler' => 'views_handler_filter_numeric'
771 771
     ),
772 772
     'sort' => array(
773
-      'handler' => 'views_handler_sort_numeric'
773
+        'handler' => 'views_handler_sort_numeric'
774 774
     )
775
-  );
775
+    );
776 776
   
777
-  // Descriptions of result fields (alphabetized)
777
+    // Descriptions of result fields (alphabetized)
778 778
   
779
-  $data['result']['appid'] = array(
779
+    $data['result']['appid'] = array(
780 780
     'title' => bts('Application ID'),
781 781
     'help' => t('The ID number of the application.'),
782 782
     'field' => array(
783
-      'handler' => 'views_handler_field_numeric',
784
-      'click sortable' => TRUE
783
+        'handler' => 'views_handler_field_numeric',
784
+        'click sortable' => TRUE
785 785
     ),
786 786
     'filter' => array(
787
-      'handler' => 'views_handler_filter_numeric'
787
+        'handler' => 'views_handler_filter_numeric'
788 788
     ),
789 789
     'sort' => array(
790
-      'handler' => 'views_handler_sort_numeric'
790
+        'handler' => 'views_handler_sort_numeric'
791 791
     )
792
-  );
793
-  $data['result']['app_version_id'] = array(
792
+    );
793
+    $data['result']['app_version_id'] = array(
794 794
     'title' => bts('Application version'),
795 795
     'help' => t('The version number of the application.'),
796 796
     'field' => array(
797
-      'handler' => 'views_handler_field_numeric',
798
-      'click sortable' => TRUE
797
+        'handler' => 'views_handler_field_numeric',
798
+        'click sortable' => TRUE
799 799
     ),
800 800
     'filter' => array(
801
-      'handler' => 'views_handler_filter_numeric'
801
+        'handler' => 'views_handler_filter_numeric'
802 802
     ),
803 803
     'sort' => array(
804
-      'handler' => 'views_handler_sort_numeric'
804
+        'handler' => 'views_handler_sort_numeric'
805 805
     )
806
-  );
807
-  $data['result']['claimed_credit'] = array(
806
+    );
807
+    $data['result']['claimed_credit'] = array(
808 808
     'title' => bts('Claimed credit'),
809 809
     'help' => t('The credit claimed for this result.'),
810 810
     'field' => array(
811
-      'handler' => 'views_handler_field_numeric',
812
-      'click sortable' => TRUE,
813
-      'float' => TRUE
811
+        'handler' => 'views_handler_field_numeric',
812
+        'click sortable' => TRUE,
813
+        'float' => TRUE
814 814
     ),
815 815
     'filter' => array(
816
-      'handler' => 'views_handler_filter_numeric'
816
+        'handler' => 'views_handler_filter_numeric'
817 817
     ),
818 818
     'sort' => array(
819
-      'handler' => 'views_handler_sort_numeric'
819
+        'handler' => 'views_handler_sort_numeric'
820 820
     )
821
-  );
822
-  $data['result']['client_state'] = array(
821
+    );
822
+    $data['result']['client_state'] = array(
823 823
     'title' => bts('Client state'),
824 824
     'help' => t('The state of the task on the client side.'),
825 825
     'field' => array(
826
-      'handler' => 'views_handler_field_numeric',
827
-      'click sortable' => TRUE
826
+        'handler' => 'views_handler_field_numeric',
827
+        'click sortable' => TRUE
828 828
     ),
829 829
     'filter' => array(
830
-      'handler' => 'views_handler_filter_numeric'
830
+        'handler' => 'views_handler_filter_numeric'
831 831
     ),
832 832
     'sort' => array(
833
-      'handler' => 'views_handler_sort_numeric'
833
+        'handler' => 'views_handler_sort_numeric'
834 834
     )
835
-  );
836
-  $data['result']['cpu_time'] = array(
835
+    );
836
+    $data['result']['cpu_time'] = array(
837 837
     'title' => bts('CPU time'),
838 838
     'help' => t('The CPU time spent on the task.'),
839 839
     'field' => array(
840
-      'handler' => 'views_handler_field_numeric',
841
-      'click sortable' => TRUE,
842
-      'float' => TRUE
840
+        'handler' => 'views_handler_field_numeric',
841
+        'click sortable' => TRUE,
842
+        'float' => TRUE
843 843
     ),
844 844
     'filter' => array(
845
-      'handler' => 'views_handler_filter_numeric'
845
+        'handler' => 'views_handler_filter_numeric'
846 846
     ),
847 847
     'sort' => array(
848
-      'handler' => 'views_handler_sort_numeric'
848
+        'handler' => 'views_handler_sort_numeric'
849 849
     )
850
-  );
851
-  $data['result']['create_time'] = array(
850
+    );
851
+    $data['result']['create_time'] = array(
852 852
     'title' => bts('Created'),
853 853
     'help' => t('The time that the task was created.'),
854 854
     'field' => array(
855
-      'handler' => 'views_handler_field_date',
856
-      'click sortable' => TRUE
855
+        'handler' => 'views_handler_field_date',
856
+        'click sortable' => TRUE
857 857
     ),
858 858
     'filter' => array(
859
-      'handler' => 'views_handler_filter_date'
859
+        'handler' => 'views_handler_filter_date'
860 860
     ),
861 861
     'sort' => array(
862
-      'handler' => 'views_handler_sort_date'
862
+        'handler' => 'views_handler_sort_date'
863 863
     )
864
-  );
865
-  $data['result']['elapsed_time'] = array(
864
+    );
865
+    $data['result']['elapsed_time'] = array(
866 866
     'title' => bts('Run time'),
867 867
     'help' => t('The run time of the task.'),
868 868
     'field' => array(
869
-      'handler' => 'views_handler_field_numeric',
870
-      'click sortable' => TRUE,
871
-      'float' => TRUE
869
+        'handler' => 'views_handler_field_numeric',
870
+        'click sortable' => TRUE,
871
+        'float' => TRUE
872 872
     ),
873 873
     'filter' => array(
874
-      'handler' => 'views_handler_filter_numeric'
874
+        'handler' => 'views_handler_filter_numeric'
875 875
     ),
876 876
     'sort' => array(
877
-      'handler' => 'views_handler_sort_numeric'
877
+        'handler' => 'views_handler_sort_numeric'
878 878
     )
879
-  );
880
-  $data['result']['exit_status'] = array(
879
+    );
880
+    $data['result']['exit_status'] = array(
881 881
     'title' => bts('Exit status'),
882 882
     'help' => t('The exit code of the task.'),
883 883
     'field' => array(
884
-      'handler' => 'views_handler_field_numeric',
885
-      'click sortable' => TRUE
884
+        'handler' => 'views_handler_field_numeric',
885
+        'click sortable' => TRUE
886 886
     ),
887 887
     'filter' => array(
888
-      'handler' => 'views_handler_filter_numeric'
888
+        'handler' => 'views_handler_filter_numeric'
889 889
     ),
890 890
     'sort' => array(
891
-      'handler' => 'views_handler_sort_numeric'
891
+        'handler' => 'views_handler_sort_numeric'
892 892
     )
893
-  );
894
-  $data['result']['granted_credit'] = array(
893
+    );
894
+    $data['result']['granted_credit'] = array(
895 895
     'title' => bts('Granted credit'),
896 896
     'help' => t('The credit granted for this result.'),
897 897
     'field' => array(
898
-      'handler' => 'views_handler_field_numeric',
899
-      'click sortable' => TRUE,
900
-      'float' => TRUE
898
+        'handler' => 'views_handler_field_numeric',
899
+        'click sortable' => TRUE,
900
+        'float' => TRUE
901 901
     ),
902 902
     'filter' => array(
903
-      'handler' => 'views_handler_filter_numeric'
903
+        'handler' => 'views_handler_filter_numeric'
904 904
     ),
905 905
     'sort' => array(
906
-      'handler' => 'views_handler_sort_numeric'
906
+        'handler' => 'views_handler_sort_numeric'
907 907
     )
908
-  );
909
-  $data['result']['name'] = array(
908
+    );
909
+    $data['result']['name'] = array(
910 910
     'title' => bts('Name'),
911 911
     'help' => t('The name of the task.'),
912 912
     'field' => array(
913
-      'handler' => 'views_handler_field',
914
-      'click sortable' => TRUE
913
+        'handler' => 'views_handler_field',
914
+        'click sortable' => TRUE
915 915
     ),
916 916
     'filter' => array(
917
-      'handler' => 'views_handler_filter_string'
917
+        'handler' => 'views_handler_filter_string'
918 918
     ),
919 919
     'sort' => array(
920
-      'handler' => 'views_handler_sort_string'
920
+        'handler' => 'views_handler_sort_string'
921 921
     )
922
-  );
923
-  $data['result']['outcome'] = array(
922
+    );
923
+    $data['result']['outcome'] = array(
924 924
     'title' => bts('Outcome'),
925 925
     'help' => t('The outcome of the task.'),
926 926
     'field' => array(
927
-      'handler' => 'views_handler_field_numeric',
928
-      'click sortable' => TRUE
927
+        'handler' => 'views_handler_field_numeric',
928
+        'click sortable' => TRUE
929 929
     ),
930 930
     'filter' => array(
931
-      'handler' => 'views_handler_filter_numeric'
931
+        'handler' => 'views_handler_filter_numeric'
932 932
     ),
933 933
     'sort' => array(
934
-      'handler' => 'views_handler_sort_numeric'
934
+        'handler' => 'views_handler_sort_numeric'
935 935
     )
936
-  );
937
-  $data['result']['received_time'] = array(
936
+    );
937
+    $data['result']['received_time'] = array(
938 938
     'title' => bts('Received time'),
939 939
     'help' => t('The time that the result was received.'),
940 940
     'field' => array(
941
-      'handler' => 'views_handler_field_date',
942
-      'click sortable' => TRUE
941
+        'handler' => 'views_handler_field_date',
942
+        'click sortable' => TRUE
943 943
     ),
944 944
     'filter' => array(
945
-      'handler' => 'views_handler_filter_date'
945
+        'handler' => 'views_handler_filter_date'
946 946
     ),
947 947
     'sort' => array(
948
-      'handler' => 'views_handler_sort_date'
948
+        'handler' => 'views_handler_sort_date'
949 949
     )
950
-  );
951
-  $data['result']['report_deadline'] = array(
950
+    );
951
+    $data['result']['report_deadline'] = array(
952 952
     'title' => bts('Report deadline'),
953 953
     'help' => t('The deadline for the task.'),
954 954
     'field' => array(
955
-      'handler' => 'views_handler_field_date',
956
-      'click sortable' => TRUE
955
+        'handler' => 'views_handler_field_date',
956
+        'click sortable' => TRUE
957 957
     ),
958 958
     'filter' => array(
959
-      'handler' => 'views_handler_filter_date'
959
+        'handler' => 'views_handler_filter_date'
960 960
     ),
961 961
     'sort' => array(
962
-      'handler' => 'views_handler_sort_date'
962
+        'handler' => 'views_handler_sort_date'
963 963
     )
964
-  );
965
-  $data['result']['sent_time'] = array(
964
+    );
965
+    $data['result']['sent_time'] = array(
966 966
     'title' => bts('Sent'),
967 967
     'help' => t('The time that the task was sent.'),
968 968
     'field' => array(
969
-      'handler' => 'views_handler_field_date',
970
-      'click sortable' => TRUE
969
+        'handler' => 'views_handler_field_date',
970
+        'click sortable' => TRUE
971 971
     ),
972 972
     'filter' => array(
973
-      'handler' => 'views_handler_filter_date'
973
+        'handler' => 'views_handler_filter_date'
974 974
     ),
975 975
     'sort' => array(
976
-      'handler' => 'views_handler_sort_date'
976
+        'handler' => 'views_handler_sort_date'
977 977
     )
978
-  );
979
-  $data['result']['server_state'] = array(
978
+    );
979
+    $data['result']['server_state'] = array(
980 980
     'title' => bts('Server state'),
981 981
     'help' => t('The state of task on the server side.'),
982 982
     'field' => array(
983
-      'handler' => 'views_handler_field_numeric',
984
-      'click sortable' => TRUE
983
+        'handler' => 'views_handler_field_numeric',
984
+        'click sortable' => TRUE
985 985
     ),
986 986
     'filter' => array(
987
-      'handler' => 'views_handler_filter_numeric'
987
+        'handler' => 'views_handler_filter_numeric'
988 988
     ),
989 989
     'sort' => array(
990
-      'handler' => 'views_handler_sort_numeric'
990
+        'handler' => 'views_handler_sort_numeric'
991 991
     )
992
-  );
993
-  $data['result']['stderr_out'] = array(
992
+    );
993
+    $data['result']['stderr_out'] = array(
994 994
     'title' => bts('Stderr out'),
995 995
     'help' => t('The output to standard error.'),
996 996
     'field' => array(
997
-      'handler' => 'views_handler_field',
998
-      'click sortable' => TRUE
997
+        'handler' => 'views_handler_field',
998
+        'click sortable' => TRUE
999 999
     ),
1000 1000
     'filter' => array(
1001
-      'handler' => 'views_handler_filter_string'
1001
+        'handler' => 'views_handler_filter_string'
1002 1002
     ),
1003 1003
     'sort' => array(
1004
-      'handler' => 'views_handler_sort_string'
1004
+        'handler' => 'views_handler_sort_string'
1005 1005
     )
1006
-  );
1007
-  $data['result']['validate_state'] = array(
1006
+    );
1007
+    $data['result']['validate_state'] = array(
1008 1008
     'title' => bts('Validation state'),
1009 1009
     'help' => t('The state of validation of this result.'),
1010 1010
     'field' => array(
1011
-      'handler' => 'views_handler_field_numeric',
1012
-      'click sortable' => TRUE
1011
+        'handler' => 'views_handler_field_numeric',
1012
+        'click sortable' => TRUE
1013 1013
     ),
1014 1014
     'filter' => array(
1015
-      'handler' => 'views_handler_filter_numeric'
1015
+        'handler' => 'views_handler_filter_numeric'
1016 1016
     ),
1017 1017
     'sort' => array(
1018
-      'handler' => 'views_handler_sort_numeric'
1018
+        'handler' => 'views_handler_sort_numeric'
1019 1019
     )
1020
-  );
1020
+    );
1021 1021
   
1022
-  // ------------------------------------------------------------------------------------------------
1023
-  // Definition for workunit table
1024
-  // ------------------------------------------------------------------------------------------------
1022
+    // ------------------------------------------------------------------------------------------------
1023
+    // Definition for workunit table
1024
+    // ------------------------------------------------------------------------------------------------
1025 1025
   
1026
-  $data['workunit']['table']['group'] = t('BOINC');
1027
-  $data['workunit']['table']['base'] = array(
1028
-      'field' => 'id',
1029
-      'title' => t('BOINC workunit'),
1030
-      'help' => t('Workunits produced by BOINC'),
1031
-      'database' => 'boinc'
1032
-  );
1026
+    $data['workunit']['table']['group'] = t('BOINC');
1027
+    $data['workunit']['table']['base'] = array(
1028
+        'field' => 'id',
1029
+        'title' => t('BOINC workunit'),
1030
+        'help' => t('Workunits produced by BOINC'),
1031
+        'database' => 'boinc'
1032
+    );
1033 1033
   
1034
-  // Create implicit relationship to the app table
1034
+    // Create implicit relationship to the app table
1035 1035
   
1036
-  $data['workunit']['table']['join'] = array(
1036
+    $data['workunit']['table']['join'] = array(
1037 1037
     'app' => array(
1038
-      'left_field' => 'id',
1039
-      'field' => 'appid'
1038
+        'left_field' => 'id',
1039
+        'field' => 'appid'
1040 1040
     )
1041
-  );
1041
+    );
1042 1042
   
1043
-  // Primary keys allowed as arguments
1043
+    // Primary keys allowed as arguments
1044 1044
   
1045
-  $data['workunit']['id'] = array(
1045
+    $data['workunit']['id'] = array(
1046 1046
     'title' => bts('Workunit ID'),
1047 1047
     'help' => t('The ID number of this workunit.'),
1048 1048
     'field' => array(
1049
-      'handler' => 'views_handler_field_numeric',
1050
-      'click sortable' => TRUE
1049
+        'handler' => 'views_handler_field_numeric',
1050
+        'click sortable' => TRUE
1051 1051
     ),
1052 1052
     'argument' => array(
1053
-      'handler' => 'views_handler_argument',
1054
-      'name field' => 'title',
1055
-      'numeric' => TRUE,
1056
-      'validate type' => 'id'
1053
+        'handler' => 'views_handler_argument',
1054
+        'name field' => 'title',
1055
+        'numeric' => TRUE,
1056
+        'validate type' => 'id'
1057 1057
     ),
1058 1058
     'filter' => array(
1059
-      'handler' => 'views_handler_filter_numeric'
1059
+        'handler' => 'views_handler_filter_numeric'
1060 1060
     ),
1061 1061
     'sort' => array(
1062
-      'handler' => 'views_handler_sort_numeric'
1062
+        'handler' => 'views_handler_sort_numeric'
1063 1063
     )
1064
-  );
1064
+    );
1065 1065
   
1066
-  // Foreign key fields
1066
+    // Foreign key fields
1067 1067
   
1068
-  $data['workunit']['appid'] = array(
1068
+    $data['workunit']['appid'] = array(
1069 1069
     'title' => bts('App ID'),
1070 1070
     'help' => t('The application associated with this workunit.'), 
1071 1071
     'argument' => array( // foreign key to the {app} table
1072
-      'handler' => 'views_handler_argument',
1073
-      'name field' => 'title',
1074
-      'numeric' => TRUE,
1075
-      'validate type' => 'id'
1072
+        'handler' => 'views_handler_argument',
1073
+        'name field' => 'title',
1074
+        'numeric' => TRUE,
1075
+        'validate type' => 'id'
1076 1076
     ),
1077 1077
     'relationship' => array(
1078
-      'base' => 'app',
1079
-      'field' => 'appid',
1080
-      'handler' => 'views_handler_relationship',
1081
-      'label' => t('Application')
1078
+        'base' => 'app',
1079
+        'field' => 'appid',
1080
+        'handler' => 'views_handler_relationship',
1081
+        'label' => t('Application')
1082 1082
     ),
1083 1083
     'field' => array(
1084
-      'handler' => 'views_handler_field_numeric',
1085
-      'click sortable' => TRUE
1084
+        'handler' => 'views_handler_field_numeric',
1085
+        'click sortable' => TRUE
1086 1086
     ),
1087 1087
     'filter' => array(
1088
-      'handler' => 'views_handler_filter_numeric'
1088
+        'handler' => 'views_handler_filter_numeric'
1089 1089
     ),
1090 1090
     'sort' => array(
1091
-      'handler' => 'views_handler_sort_numeric'
1091
+        'handler' => 'views_handler_sort_numeric'
1092 1092
     )
1093
-  );
1093
+    );
1094 1094
   
1095
-  // Descriptions of workunit fields (alphabetized)
1095
+    // Descriptions of workunit fields (alphabetized)
1096 1096
   
1097
-  $data['workunit']['canonical_credit'] = array(
1097
+    $data['workunit']['canonical_credit'] = array(
1098 1098
     'title' => bts('Canonical credit'),
1099 1099
     'help' => t('The canonical credit of the workunit.'),
1100 1100
     'field' => array(
1101
-      'handler' => 'views_handler_field_numeric',
1102
-      'click sortable' => TRUE,
1103
-      'float' => TRUE
1101
+        'handler' => 'views_handler_field_numeric',
1102
+        'click sortable' => TRUE,
1103
+        'float' => TRUE
1104 1104
     ),
1105 1105
     'filter' => array(
1106
-      'handler' => 'views_handler_filter_numeric'
1106
+        'handler' => 'views_handler_filter_numeric'
1107 1107
     ),
1108 1108
     'sort' => array(
1109
-      'handler' => 'views_handler_sort_numeric'
1109
+        'handler' => 'views_handler_sort_numeric'
1110 1110
     )
1111
-  );
1112
-  $data['workunit']['canonical_resultid'] = array(
1111
+    );
1112
+    $data['workunit']['canonical_resultid'] = array(
1113 1113
     'title' => bts('Canonical result ID'),
1114 1114
     'help' => t('The ID of the canonical result associated with the workunit.'),
1115 1115
     'field' => array(
1116
-      'handler' => 'views_handler_field_numeric',
1117
-      'click sortable' => TRUE
1116
+        'handler' => 'views_handler_field_numeric',
1117
+        'click sortable' => TRUE
1118 1118
     ),
1119 1119
     'filter' => array(
1120
-      'handler' => 'views_handler_filter_numeric'
1120
+        'handler' => 'views_handler_filter_numeric'
1121 1121
     ),
1122 1122
     'sort' => array(
1123
-      'handler' => 'views_handler_sort_numeric'
1123
+        'handler' => 'views_handler_sort_numeric'
1124 1124
     )
1125
-  );
1126
-  $data['workunit']['create_time'] = array(
1125
+    );
1126
+    $data['workunit']['create_time'] = array(
1127 1127
     'title' => bts('Created time'),
1128 1128
     'help' => t('The time that the workunit was created.'),
1129 1129
     'field' => array(
1130
-      'handler' => 'views_handler_field_date',
1131
-      'click sortable' => TRUE
1130
+        'handler' => 'views_handler_field_date',
1131
+        'click sortable' => TRUE
1132 1132
     ),
1133 1133
     'filter' => array(
1134
-      'handler' => 'views_handler_filter_date'
1134
+        'handler' => 'views_handler_filter_date'
1135 1135
     ),
1136 1136
     'sort' => array(
1137
-      'handler' => 'views_handler_sort_date'
1137
+        'handler' => 'views_handler_sort_date'
1138 1138
     )
1139
-  );
1140
-  $data['workunit']['error_mask'] = array(
1139
+    );
1140
+    $data['workunit']['error_mask'] = array(
1141 1141
     'title' => bts('Error mask'),
1142 1142
     'help' => t('Error mask of the workunit.'),
1143 1143
     'field' => array(
1144
-      'handler' => 'views_handler_field_numeric',
1145
-      'click sortable' => TRUE
1144
+        'handler' => 'views_handler_field_numeric',
1145
+        'click sortable' => TRUE
1146 1146
     ),
1147 1147
     'filter' => array(
1148
-      'handler' => 'views_handler_filter_numeric'
1148
+        'handler' => 'views_handler_filter_numeric'
1149 1149
     ),
1150 1150
     'sort' => array(
1151
-      'handler' => 'views_handler_sort_numeric'
1151
+        'handler' => 'views_handler_sort_numeric'
1152 1152
     )
1153
-  );
1154
-  $data['workunit']['min_quorum'] = array(
1153
+    );
1154
+    $data['workunit']['min_quorum'] = array(
1155 1155
     'title' => bts('Minimum quorum'),
1156 1156
     'help' => t('Minimum quorum of the workunit.'),
1157 1157
     'field' => array(
1158
-      'handler' => 'views_handler_field_numeric',
1159
-      'click sortable' => TRUE
1158
+        'handler' => 'views_handler_field_numeric',
1159
+        'click sortable' => TRUE
1160 1160
     ),
1161 1161
     'filter' => array(
1162
-      'handler' => 'views_handler_filter_numeric'
1162
+        'handler' => 'views_handler_filter_numeric'
1163 1163
     ),
1164 1164
     'sort' => array(
1165
-      'handler' => 'views_handler_sort_numeric'
1165
+        'handler' => 'views_handler_sort_numeric'
1166 1166
     )
1167
-  );
1168
-  $data['workunit']['name'] = array(
1167
+    );
1168
+    $data['workunit']['name'] = array(
1169 1169
     'title' => bts('Name'),
1170 1170
     'help' => t('The name of the workunit.'),
1171 1171
     'field' => array(
1172
-      'handler' => 'views_handler_field',
1173
-      'click sortable' => TRUE
1172
+        'handler' => 'views_handler_field',
1173
+        'click sortable' => TRUE
1174 1174
     ),
1175 1175
     'filter' => array(
1176
-      'handler' => 'views_handler_filter_string'
1176
+        'handler' => 'views_handler_filter_string'
1177 1177
     ),
1178 1178
     'sort' => array(
1179
-      'handler' => 'views_handler_sort_string'
1179
+        'handler' => 'views_handler_sort_string'
1180 1180
     )
1181
-  );
1182
-  $data['workunit']['max_error_results'] = array(
1181
+    );
1182
+    $data['workunit']['max_error_results'] = array(
1183 1183
     'title' => bts('Max error tasks'),
1184 1184
     'help' => t('The maximum number of error tasks in the workunit.'),
1185 1185
     'field' => array(
1186
-      'handler' => 'views_handler_field_numeric',
1187
-      'click sortable' => TRUE
1186
+        'handler' => 'views_handler_field_numeric',
1187
+        'click sortable' => TRUE
1188 1188
     ),
1189 1189
     'filter' => array(
1190
-      'handler' => 'views_handler_filter_numeric'
1190
+        'handler' => 'views_handler_filter_numeric'
1191 1191
     ),
1192 1192
     'sort' => array(
1193
-      'handler' => 'views_handler_sort_numeric'
1193
+        'handler' => 'views_handler_sort_numeric'
1194 1194
     )
1195
-  );
1196
-  $data['workunit']['max_success_results'] = array(
1195
+    );
1196
+    $data['workunit']['max_success_results'] = array(
1197 1197
     'title' => bts('Max success tasks'),
1198 1198
     'help' => t('The maximum number of successful tasks in the workunit.'),
1199 1199
     'field' => array(
1200
-      'handler' => 'views_handler_field_numeric',
1201
-      'click sortable' => TRUE
1200
+        'handler' => 'views_handler_field_numeric',
1201
+        'click sortable' => TRUE
1202 1202
     ),
1203 1203
     'filter' => array(
1204
-      'handler' => 'views_handler_filter_numeric'
1204
+        'handler' => 'views_handler_filter_numeric'
1205 1205
     ),
1206 1206
     'sort' => array(
1207
-      'handler' => 'views_handler_sort_numeric'
1207
+        'handler' => 'views_handler_sort_numeric'
1208 1208
     )
1209
-  );
1210
-  $data['workunit']['max_total_results'] = array(
1209
+    );
1210
+    $data['workunit']['max_total_results'] = array(
1211 1211
     'title' => bts('Max total tasks'),
1212 1212
     'help' => t('The maximum number of total tasks in the workunit.'),
1213 1213
     'field' => array(
1214
-      'handler' => 'views_handler_field_numeric',
1215
-      'click sortable' => TRUE
1214
+        'handler' => 'views_handler_field_numeric',
1215
+        'click sortable' => TRUE
1216 1216
     ),
1217 1217
     'filter' => array(
1218
-      'handler' => 'views_handler_filter_numeric'
1218
+        'handler' => 'views_handler_filter_numeric'
1219 1219
     ),
1220 1220
     'sort' => array(
1221
-      'handler' => 'views_handler_sort_numeric'
1221
+        'handler' => 'views_handler_sort_numeric'
1222 1222
     )
1223
-  );
1224
-  $data['workunit']['need_validate'] = array(
1223
+    );
1224
+    $data['workunit']['need_validate'] = array(
1225 1225
     'title' => bts('Needs validation'),
1226 1226
     'help' => t('Whether or not a workunit needs validation.'),
1227 1227
     'field' => array(
1228
-      'handler' => 'views_handler_field_numeric',
1229
-      'click sortable' => TRUE
1228
+        'handler' => 'views_handler_field_numeric',
1229
+        'click sortable' => TRUE
1230 1230
     ),
1231 1231
     'filter' => array(
1232
-      'handler' => 'views_handler_filter_numeric'
1232
+        'handler' => 'views_handler_filter_numeric'
1233 1233
     ),
1234 1234
     'sort' => array(
1235
-      'handler' => 'views_handler_sort_numeric'
1235
+        'handler' => 'views_handler_sort_numeric'
1236 1236
     )
1237
-  );
1238
-  $data['workunit']['target_nresults'] = array(
1237
+    );
1238
+    $data['workunit']['target_nresults'] = array(
1239 1239
     'title' => bts('Initial replication'),
1240 1240
     'help' => t('The target number of results for the workunit.'),
1241 1241
     'field' => array(
1242
-      'handler' => 'views_handler_field_numeric',
1243
-      'click sortable' => TRUE
1242
+        'handler' => 'views_handler_field_numeric',
1243
+        'click sortable' => TRUE
1244 1244
     ),
1245 1245
     'filter' => array(
1246
-      'handler' => 'views_handler_filter_numeric'
1246
+        'handler' => 'views_handler_filter_numeric'
1247 1247
     ),
1248 1248
     'sort' => array(
1249
-      'handler' => 'views_handler_sort_numeric'
1249
+        'handler' => 'views_handler_sort_numeric'
1250 1250
     )
1251
-  );
1251
+    );
1252 1252
   
1253
-  // ------------------------------------------------------------------------------------------------
1254
-  // Definition for app table
1255
-  // ------------------------------------------------------------------------------------------------
1253
+    // ------------------------------------------------------------------------------------------------
1254
+    // Definition for app table
1255
+    // ------------------------------------------------------------------------------------------------
1256 1256
   
1257
-  $data['app']['table']['group'] = t('BOINC');
1258
-  $data['app']['table']['base'] = array(
1259
-      'field' => 'id',
1260
-      'title' => t('BOINC app'),
1261
-      'help' => t('Research applications run by BOINC'),
1262
-      'database' => 'boinc'
1263
-  );
1257
+    $data['app']['table']['group'] = t('BOINC');
1258
+    $data['app']['table']['base'] = array(
1259
+        'field' => 'id',
1260
+        'title' => t('BOINC app'),
1261
+        'help' => t('Research applications run by BOINC'),
1262
+        'database' => 'boinc'
1263
+    );
1264 1264
   
1265
-  // Primary keys allowed as arguments
1265
+    // Primary keys allowed as arguments
1266 1266
 
1267
-  $data['app']['id'] = array(
1267
+    $data['app']['id'] = array(
1268 1268
     'title' => bts('Application ID'),
1269 1269
     'help' => t('The ID number of this application.'),
1270 1270
     'field' => array(
1271
-      'handler' => 'views_handler_field_numeric',
1272
-      'click sortable' => TRUE
1271
+        'handler' => 'views_handler_field_numeric',
1272
+        'click sortable' => TRUE
1273 1273
     ),
1274 1274
     'argument' => array(
1275
-      'handler' => 'views_handler_argument',
1276
-      'name field' => 'title',
1277
-      'numeric' => TRUE,
1278
-      'validate type' => 'id'
1275
+        'handler' => 'views_handler_argument',
1276
+        'name field' => 'title',
1277
+        'numeric' => TRUE,
1278
+        'validate type' => 'id'
1279 1279
     ),
1280 1280
     'filter' => array(
1281
-      'handler' => 'views_handler_filter_numeric'
1281
+        'handler' => 'views_handler_filter_numeric'
1282 1282
     ),
1283 1283
     'sort' => array(
1284
-      'handler' => 'views_handler_sort_numeric'
1284
+        'handler' => 'views_handler_sort_numeric'
1285 1285
     )
1286
-  );
1286
+    );
1287 1287
   
1288
-  // Descriptions of app fields (alphabetized)
1288
+    // Descriptions of app fields (alphabetized)
1289 1289
   
1290
-  $data['app']['target_nresults'] = array(
1290
+    $data['app']['target_nresults'] = array(
1291 1291
     'title' => bts('Target number of results'),
1292 1292
     'help' => t('The number of times to replicate tasks in this application.'),
1293 1293
     'field' => array(
1294
-      'handler' => 'views_handler_field_numeric',
1295
-      'click sortable' => TRUE
1294
+        'handler' => 'views_handler_field_numeric',
1295
+        'click sortable' => TRUE
1296 1296
     ),
1297 1297
     'filter' => array(
1298
-      'handler' => 'views_handler_filter_numeric'
1298
+        'handler' => 'views_handler_filter_numeric'
1299 1299
     ),
1300 1300
     'sort' => array(
1301
-      'handler' => 'views_handler_sort_numeric'
1301
+        'handler' => 'views_handler_sort_numeric'
1302 1302
     )
1303
-  );
1304
-  $data['app']['user_friendly_name'] = array(
1303
+    );
1304
+    $data['app']['user_friendly_name'] = array(
1305 1305
     'title' => bts('Name'),
1306 1306
     'help' => t('The user friendly name of the application.'),
1307 1307
     'field' => array(
1308
-      'handler' => 'views_handler_field',
1309
-      'click sortable' => TRUE
1308
+        'handler' => 'views_handler_field',
1309
+        'click sortable' => TRUE
1310 1310
     ),
1311 1311
     'filter' => array(
1312
-      'handler' => 'views_handler_filter_string'
1312
+        'handler' => 'views_handler_filter_string'
1313 1313
     ),
1314 1314
     'sort' => array(
1315
-      'handler' => 'views_handler_sort_string'
1315
+        'handler' => 'views_handler_sort_string'
1316 1316
     )
1317
-  );
1317
+    );
1318 1318
   
1319
-  // ------------------------------------------------------------------------------------------------
1320
-  // Definition for app_version table
1321
-  // ------------------------------------------------------------------------------------------------
1319
+    // ------------------------------------------------------------------------------------------------
1320
+    // Definition for app_version table
1321
+    // ------------------------------------------------------------------------------------------------
1322 1322
   
1323
-  $data['app_version']['table']['group'] = t('BOINC');
1324
-  $data['app_version']['table']['base'] = array(
1325
-      'field' => 'id',
1326
-      'title' => t('BOINC app version'),
1327
-      'help' => t('Versions of research applications run by BOINC'),
1328
-      'database' => 'boinc'
1329
-  );
1323
+    $data['app_version']['table']['group'] = t('BOINC');
1324
+    $data['app_version']['table']['base'] = array(
1325
+        'field' => 'id',
1326
+        'title' => t('BOINC app version'),
1327
+        'help' => t('Versions of research applications run by BOINC'),
1328
+        'database' => 'boinc'
1329
+    );
1330 1330
   
1331
-  // Primary keys allowed as arguments
1331
+    // Primary keys allowed as arguments
1332 1332
 
1333
-  $data['app_version']['id'] = array(
1333
+    $data['app_version']['id'] = array(
1334 1334
     'title' => bts('Application version ID'),
1335 1335
     'help' => t('The ID number of this application version.'),
1336 1336
     'field' => array(
1337
-      'handler' => 'views_handler_field_numeric',
1338
-      'click sortable' => TRUE
1337
+        'handler' => 'views_handler_field_numeric',
1338
+        'click sortable' => TRUE
1339 1339
     ),
1340 1340
     'argument' => array(
1341
-      'handler' => 'views_handler_argument',
1342
-      'name field' => 'title',
1343
-      'numeric' => TRUE,
1344
-      'validate type' => 'id'
1341
+        'handler' => 'views_handler_argument',
1342
+        'name field' => 'title',
1343
+        'numeric' => TRUE,
1344
+        'validate type' => 'id'
1345 1345
     ),
1346 1346
     'filter' => array(
1347
-      'handler' => 'views_handler_filter_numeric'
1347
+        'handler' => 'views_handler_filter_numeric'
1348 1348
     ),
1349 1349
     'sort' => array(
1350
-      'handler' => 'views_handler_sort_numeric'
1350
+        'handler' => 'views_handler_sort_numeric'
1351 1351
     )
1352
-  );
1352
+    );
1353 1353
   
1354
-  // Foreign key fields
1354
+    // Foreign key fields
1355 1355
   
1356
-  $data['app_version']['appid'] = array(
1356
+    $data['app_version']['appid'] = array(
1357 1357
     'title' => bts('App ID'),
1358 1358
     'help' => t('The app ID associated with this app version.'),
1359 1359
     // Because this is a foreign key to the {app} table. This allows us to
1360 1360
     // have, when the view is configured with this relationship, all the fields
1361 1361
     // for the related node available.
1362 1362
     'argument' => array(
1363
-      'handler' => 'views_handler_argument_numeric',
1364
-      'name field' => 'title',
1365
-      'numeric' => TRUE,
1366
-      'validate type' => 'id'
1363
+        'handler' => 'views_handler_argument_numeric',
1364
+        'name field' => 'title',
1365
+        'numeric' => TRUE,
1366
+        'validate type' => 'id'
1367 1367
     ),
1368 1368
     'relationship' => array(
1369
-      'base' => 'app',
1370
-      'field' => 'id',
1371
-      'handler' => 'views_handler_relationship',
1372
-      'label' => t('App ID')
1369
+        'base' => 'app',
1370
+        'field' => 'id',
1371
+        'handler' => 'views_handler_relationship',
1372
+        'label' => t('App ID')
1373 1373
     ),
1374 1374
     'field' => array(
1375
-      'handler' => 'views_handler_field_numeric',
1376
-      'click sortable' => TRUE
1375
+        'handler' => 'views_handler_field_numeric',
1376
+        'click sortable' => TRUE
1377 1377
     ),
1378 1378
     'filter' => array(
1379
-      'handler' => 'views_handler_filter_numeric'
1379
+        'handler' => 'views_handler_filter_numeric'
1380 1380
     ),
1381 1381
     'sort' => array(
1382
-      'handler' => 'views_handler_sort_numeric'
1382
+        'handler' => 'views_handler_sort_numeric'
1383 1383
     )
1384
-  );
1384
+    );
1385 1385
   
1386
-  $data['app_version']['platformid'] = array(
1386
+    $data['app_version']['platformid'] = array(
1387 1387
     'title' => bts('Platform ID'),
1388 1388
     'help' => t('The platform ID associated with this app version.'),
1389 1389
     // Because this is a foreign key to the {platform} table. This allows us to
1390 1390
     // have, when the view is configured with this relationship, all the fields
1391 1391
     // for the related node available.
1392 1392
     'argument' => array(
1393
-      'handler' => 'views_handler_argument_numeric',
1394
-      'name field' => 'title',
1395
-      'numeric' => TRUE,
1396
-      'validate type' => 'id'
1393
+        'handler' => 'views_handler_argument_numeric',
1394
+        'name field' => 'title',
1395
+        'numeric' => TRUE,
1396
+        'validate type' => 'id'
1397 1397
     ),
1398 1398
     'relationship' => array(
1399
-      'base' => 'platform',
1400
-      'field' => 'id',
1401
-      'handler' => 'views_handler_relationship',
1402
-      'label' => t('Platform ID')
1399
+        'base' => 'platform',
1400
+        'field' => 'id',
1401
+        'handler' => 'views_handler_relationship',
1402
+        'label' => t('Platform ID')
1403 1403
     ),
1404 1404
     'field' => array(
1405
-      'handler' => 'views_handler_field_numeric',
1406
-      'click sortable' => TRUE
1405
+        'handler' => 'views_handler_field_numeric',
1406
+        'click sortable' => TRUE
1407 1407
     ),
1408 1408
     'filter' => array(
1409
-      'handler' => 'views_handler_filter_numeric'
1409
+        'handler' => 'views_handler_filter_numeric'
1410 1410
     ),
1411 1411
     'sort' => array(
1412
-      'handler' => 'views_handler_sort_numeric'
1412
+        'handler' => 'views_handler_sort_numeric'
1413 1413
     )
1414
-  );
1414
+    );
1415 1415
   
1416
-  // Descriptions of app fields (alphabetized)
1416
+    // Descriptions of app fields (alphabetized)
1417 1417
   
1418
-  $data['app_version']['plan_class'] = array(
1418
+    $data['app_version']['plan_class'] = array(
1419 1419
     'title' => bts('Plan class'),
1420 1420
     'help' => t('App version plan class.'),
1421 1421
     'field' => array(
1422
-      'handler' => 'views_handler_field',
1423
-      'click sortable' => TRUE
1422
+        'handler' => 'views_handler_field',
1423
+        'click sortable' => TRUE
1424 1424
     ),
1425 1425
     'filter' => array(
1426
-      'handler' => 'views_handler_filter_string'
1426
+        'handler' => 'views_handler_filter_string'
1427 1427
     ),
1428 1428
     'sort' => array(
1429
-      'handler' => 'views_handler_sort_string'
1429
+        'handler' => 'views_handler_sort_string'
1430 1430
     )
1431
-  );
1432
-  $data['app_version']['version_num'] = array(
1431
+    );
1432
+    $data['app_version']['version_num'] = array(
1433 1433
     'title' => bts('Version number'),
1434 1434
     'help' => t('The application version number.'),
1435 1435
     'field' => array(
1436
-      'handler' => 'views_handler_field_boincwork_app_version_number',
1437
-      'click sortable' => TRUE,
1438
-      'float' => TRUE,
1436
+        'handler' => 'views_handler_field_boincwork_app_version_number',
1437
+        'click sortable' => TRUE,
1438
+        'float' => TRUE,
1439 1439
     ),
1440 1440
     'filter' => array(
1441
-      'handler' => 'views_handler_filter_numeric'
1441
+        'handler' => 'views_handler_filter_numeric'
1442 1442
     ),
1443 1443
     'sort' => array(
1444
-      'handler' => 'views_handler_sort_numeric'
1444
+        'handler' => 'views_handler_sort_numeric'
1445 1445
     )
1446
-  );
1446
+    );
1447 1447
   
1448
-  // ------------------------------------------------------------------------------------------------
1449
-  // Definition for host_app_version table
1450
-  // ------------------------------------------------------------------------------------------------
1448
+    // ------------------------------------------------------------------------------------------------
1449
+    // Definition for host_app_version table
1450
+    // ------------------------------------------------------------------------------------------------
1451 1451
   
1452
-  $data['host_app_version']['table']['group'] = t('BOINC');
1452
+    $data['host_app_version']['table']['group'] = t('BOINC');
1453 1453
   
1454
-  // This table references the {host} table.
1455
-  // This join creates an 'implicit' relationship to the host table, so that when
1456
-  // "Host" is the base table, the fields are automatically available.
1454
+    // This table references the {host} table.
1455
+    // This join creates an 'implicit' relationship to the host table, so that when
1456
+    // "Host" is the base table, the fields are automatically available.
1457 1457
   
1458
-  // Index this array by the table name to which this table refers.
1459
-  // 'left_field' is the primary key in the referenced table.
1460
-  // 'field' is the foreign key in this table.
1458
+    // Index this array by the table name to which this table refers.
1459
+    // 'left_field' is the primary key in the referenced table.
1460
+    // 'field' is the foreign key in this table.
1461 1461
   
1462
-  $data['host_app_version']['table']['join'] = array(
1462
+    $data['host_app_version']['table']['join'] = array(
1463 1463
     'host' => array(
1464
-      'left_field' => 'id',
1465
-      'field' => 'host_id',
1464
+        'left_field' => 'id',
1465
+        'field' => 'host_id',
1466 1466
     )
1467
-  );
1467
+    );
1468 1468
   
1469
-  // Primary keys allowed as arguments
1469
+    // Primary keys allowed as arguments
1470 1470
 
1471
-  $data['host_app_version']['host_id'] = array(
1471
+    $data['host_app_version']['host_id'] = array(
1472 1472
     'title' => bts('Computer'),
1473 1473
     'help' => t('The host ID connected to this app version data.'),
1474 1474
     'field' => array(
1475
-      'handler' => 'views_handler_field_numeric',
1476
-      'click sortable' => TRUE
1475
+        'handler' => 'views_handler_field_numeric',
1476
+        'click sortable' => TRUE
1477 1477
     ),
1478 1478
     'argument' => array(
1479
-      'handler' => 'views_handler_argument',
1480
-      'name field' => 'title',
1481
-      'numeric' => TRUE,
1482
-      'validate type' => 'id'
1479
+        'handler' => 'views_handler_argument',
1480
+        'name field' => 'title',
1481
+        'numeric' => TRUE,
1482
+        'validate type' => 'id'
1483 1483
     ),
1484 1484
     'filter' => array(
1485
-      'handler' => 'views_handler_filter_numeric'
1485
+        'handler' => 'views_handler_filter_numeric'
1486 1486
     ),
1487 1487
     'sort' => array(
1488
-      'handler' => 'views_handler_sort_numeric'
1488
+        'handler' => 'views_handler_sort_numeric'
1489 1489
     )
1490
-  );
1490
+    );
1491 1491
   
1492
-  // Foreign key fields
1492
+    // Foreign key fields
1493 1493
   
1494
-  $data['host_app_version']['app_version_id'] = array(
1494
+    $data['host_app_version']['app_version_id'] = array(
1495 1495
     'title' => bts('App version ID'),
1496 1496
     'help' => t('The app version ID connected to this host data.'),
1497 1497
     // Because this is a foreign key to the {host} table. This allows us to
1498 1498
     // have, when the view is configured with this relationship, all the fields
1499 1499
     // for the related node available.
1500 1500
     'argument' => array(
1501
-      'handler' => 'views_handler_argument_numeric',
1502
-      'name field' => 'title',
1503
-      'numeric' => TRUE,
1504
-      'validate type' => 'id'
1501
+        'handler' => 'views_handler_argument_numeric',
1502
+        'name field' => 'title',
1503
+        'numeric' => TRUE,
1504
+        'validate type' => 'id'
1505 1505
     ),
1506 1506
     'relationship' => array(
1507
-      'base' => 'app_version',
1508
-      'field' => 'id',
1509
-      'handler' => 'views_handler_relationship',
1510
-      'label' => t('App version')
1507
+        'base' => 'app_version',
1508
+        'field' => 'id',
1509
+        'handler' => 'views_handler_relationship',
1510
+        'label' => t('App version')
1511 1511
     ),
1512 1512
     'field' => array(
1513
-      'handler' => 'views_handler_field_numeric',
1514
-      'click sortable' => TRUE
1513
+        'handler' => 'views_handler_field_numeric',
1514
+        'click sortable' => TRUE
1515 1515
     ),
1516 1516
     'filter' => array(
1517
-      'handler' => 'views_handler_filter_numeric'
1517
+        'handler' => 'views_handler_filter_numeric'
1518 1518
     ),
1519 1519
     'sort' => array(
1520
-      'handler' => 'views_handler_sort_numeric'
1520
+        'handler' => 'views_handler_sort_numeric'
1521 1521
     )
1522
-  );
1522
+    );
1523 1523
   
1524
-  // Descriptions of host_app_version fields (alphabetized)
1524
+    // Descriptions of host_app_version fields (alphabetized)
1525 1525
   
1526
-  $data['host_app_version']['consecutive_valid'] = array(
1526
+    $data['host_app_version']['consecutive_valid'] = array(
1527 1527
     'title' => bts('Consecutive valid tasks'),
1528 1528
     'help' => t('The number of consecutive valid tasks for this app and by this host.'),
1529 1529
     'field' => array(
1530
-      'handler' => 'views_handler_field_numeric',
1531
-      'click sortable' => TRUE
1530
+        'handler' => 'views_handler_field_numeric',
1531
+        'click sortable' => TRUE
1532 1532
     ),
1533 1533
     'filter' => array(
1534
-      'handler' => 'views_handler_filter_numeric'
1534
+        'handler' => 'views_handler_filter_numeric'
1535 1535
     ),
1536 1536
     'sort' => array(
1537
-      'handler' => 'views_handler_sort_numeric'
1537
+        'handler' => 'views_handler_sort_numeric'
1538 1538
     )
1539
-  );
1540
-  $data['host_app_version']['et_avg'] = array(
1539
+    );
1540
+    $data['host_app_version']['et_avg'] = array(
1541 1541
     'title' => t('Average processing rate'),
1542 1542
     'help' => t('The "et_avg" for this app and by this host.'),
1543 1543
     'field' => array(
1544
-      'handler' => 'views_handler_field_boincwork_host_app_et_avg',
1545
-      'click sortable' => TRUE
1544
+        'handler' => 'views_handler_field_boincwork_host_app_et_avg',
1545
+        'click sortable' => TRUE
1546 1546
     ),
1547 1547
     'filter' => array(
1548
-      'handler' => 'views_handler_filter_numeric'
1548
+        'handler' => 'views_handler_filter_numeric'
1549 1549
     ),
1550 1550
     'sort' => array(
1551
-      'handler' => 'views_handler_sort_numeric'
1551
+        'handler' => 'views_handler_sort_numeric'
1552 1552
     )
1553
-  );
1554
-  $data['host_app_version']['et_n'] = array(
1553
+    );
1554
+    $data['host_app_version']['et_n'] = array(
1555 1555
     'title' => bts('Number of tasks completed'),
1556 1556
     'help' => t('The tasks completed for this app and by this host.'),
1557 1557
     'field' => array(
1558
-      'handler' => 'views_handler_field_numeric',
1559
-      'click sortable' => TRUE
1558
+        'handler' => 'views_handler_field_numeric',
1559
+        'click sortable' => TRUE
1560 1560
     ),
1561 1561
     'filter' => array(
1562
-      'handler' => 'views_handler_filter_numeric'
1562
+        'handler' => 'views_handler_filter_numeric'
1563 1563
     ),
1564 1564
     'sort' => array(
1565
-      'handler' => 'views_handler_sort_numeric'
1565
+        'handler' => 'views_handler_sort_numeric'
1566 1566
     )
1567
-  );
1568
-  $data['host_app_version']['max_jobs_per_day'] = array(
1567
+    );
1568
+    $data['host_app_version']['max_jobs_per_day'] = array(
1569 1569
     'title' => bts('Max tasks per day'),
1570 1570
     'help' => t('The maximum tasks per day for this app and by this host.'),
1571 1571
     'field' => array(
1572
-      'handler' => 'views_handler_field_numeric',
1573
-      'click sortable' => TRUE
1572
+        'handler' => 'views_handler_field_numeric',
1573
+        'click sortable' => TRUE
1574 1574
     ),
1575 1575
     'filter' => array(
1576
-      'handler' => 'views_handler_filter_numeric'
1576
+        'handler' => 'views_handler_filter_numeric'
1577 1577
     ),
1578 1578
     'sort' => array(
1579
-      'handler' => 'views_handler_sort_numeric'
1579
+        'handler' => 'views_handler_sort_numeric'
1580 1580
     )
1581
-  );
1582
-  $data['host_app_version']['n_jobs_today'] = array(
1581
+    );
1582
+    $data['host_app_version']['n_jobs_today'] = array(
1583 1583
     'title' => bts('Number of tasks today'),
1584 1584
     'help' => t('The number of tasks today for this app and by this host.'),
1585 1585
     'field' => array(
1586
-      'handler' => 'views_handler_field_numeric',
1587
-      'click sortable' => TRUE
1586
+        'handler' => 'views_handler_field_numeric',
1587
+        'click sortable' => TRUE
1588 1588
     ),
1589 1589
     'filter' => array(
1590
-      'handler' => 'views_handler_filter_numeric'
1590
+        'handler' => 'views_handler_filter_numeric'
1591 1591
     ),
1592 1592
     'sort' => array(
1593
-      'handler' => 'views_handler_sort_numeric'
1593
+        'handler' => 'views_handler_sort_numeric'
1594 1594
     )
1595
-  );
1596
-  $data['host_app_version']['turnaround_avg'] = array(
1595
+    );
1596
+    $data['host_app_version']['turnaround_avg'] = array(
1597 1597
     'title' => bts('Average turnaround time'),
1598 1598
     'help' => t('The average turnaround time per task for this app and by this host.'),
1599 1599
     'field' => array(
1600
-      'handler' => 'views_handler_field_boincwork_host_app_turnaround_avg',
1601
-      'click sortable' => TRUE,
1602
-      'float' => TRUE,
1600
+        'handler' => 'views_handler_field_boincwork_host_app_turnaround_avg',
1601
+        'click sortable' => TRUE,
1602
+        'float' => TRUE,
1603 1603
     ),
1604 1604
     'filter' => array(
1605
-      'handler' => 'views_handler_filter_numeric'
1605
+        'handler' => 'views_handler_filter_numeric'
1606 1606
     ),
1607 1607
     'sort' => array(
1608
-      'handler' => 'views_handler_sort_numeric'
1608
+        'handler' => 'views_handler_sort_numeric'
1609 1609
     )
1610
-  );
1611
-  $data['host_app_version']['user_friendly_name'] = array(
1610
+    );
1611
+    $data['host_app_version']['user_friendly_name'] = array(
1612 1612
     'title' => bts('Name'),
1613 1613
     'help' => t('The user friendly name of the application.'),
1614 1614
     'field' => array(
1615
-      'handler' => 'views_handler_field',
1616
-      'click sortable' => TRUE
1615
+        'handler' => 'views_handler_field',
1616
+        'click sortable' => TRUE
1617 1617
     ),
1618 1618
     'filter' => array(
1619
-      'handler' => 'views_handler_filter_string'
1619
+        'handler' => 'views_handler_filter_string'
1620 1620
     ),
1621 1621
     'sort' => array(
1622
-      'handler' => 'views_handler_sort_string'
1622
+        'handler' => 'views_handler_sort_string'
1623 1623
     )
1624
-  );
1624
+    );
1625 1625
   
1626
-  return $data;
1626
+    return $data;
1627 1627
 }
1628 1628
 
1629 1629
 /*
@@ -1635,23 +1635,23 @@  discard block
 block discarded – undo
1635 1635
 
1636 1636
 function boincwork_views_handlers() {
1637 1637
   
1638
-  return array(
1638
+    return array(
1639 1639
     'info' => array(
1640
-      'path' => drupal_get_path('module', 'boincwork') . '/views',
1640
+        'path' => drupal_get_path('module', 'boincwork') . '/views',
1641 1641
     ),
1642 1642
     'handlers' => array(
1643
-      'views_handler_argument_boincuser_id' => array(
1643
+        'views_handler_argument_boincuser_id' => array(
1644 1644
         'parent' => 'views_handler_argument_numeric'
1645
-      ),
1646
-      'views_handler_field_boincwork_app_version_number' => array(
1645
+        ),
1646
+        'views_handler_field_boincwork_app_version_number' => array(
1647 1647
         'parent' => 'views_handler_field_numeric'
1648
-      ),
1649
-      'views_handler_field_boincwork_host_app_et_avg' => array(
1648
+        ),
1649
+        'views_handler_field_boincwork_host_app_et_avg' => array(
1650 1650
         'parent' => 'views_handler_field_numeric'
1651
-      ),
1652
-      'views_handler_field_boincwork_host_app_turnaround_avg' => array(
1651
+        ),
1652
+        'views_handler_field_boincwork_host_app_turnaround_avg' => array(
1653 1653
         'parent' => 'views_handler_field_numeric'
1654
-      ),
1654
+        ),
1655 1655
     )
1656
-  );
1656
+    );
1657 1657
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1637,7 +1637,7 @@
 block discarded – undo
1637 1637
   
1638 1638
   return array(
1639 1639
     'info' => array(
1640
-      'path' => drupal_get_path('module', 'boincwork') . '/views',
1640
+      'path' => drupal_get_path('module', 'boincwork').'/views',
1641 1641
     ),
1642 1642
     'handlers' => array(
1643 1643
       'views_handler_argument_boincuser_id' => array(
Please login to merge, or discard this patch.
Upper-Lower-Casing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
     'help' => t('The ID number of this host.'),
54 54
     'field' => array(
55 55
       'handler' => 'views_handler_field_numeric',
56
-      'click sortable' => TRUE
56
+      'click sortable' => true
57 57
     ),
58 58
     'argument' => array(
59 59
       'handler' => 'views_handler_argument',
60 60
       'name field' => 'title',
61
-      'numeric' => TRUE,
61
+      'numeric' => true,
62 62
       'validate type' => 'id'
63 63
     ),
64 64
     'filter' => array(
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     'help' => t('The name of the preference set assigned to this host.'),
74 74
     'field' => array(
75 75
       'handler' => 'views_handler_field',
76
-      'click sortable' => TRUE
76
+      'click sortable' => true
77 77
     ),
78 78
     'argument' => array(
79 79
       'handler' => 'views_handler_argument',
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     'argument' => array(
99 99
       'handler' => 'views_handler_argument_boincuser_id',
100 100
       'name field' => 'title',
101
-      'numeric' => TRUE,
101
+      'numeric' => true,
102 102
       'validate type' => 'id'
103 103
     ),
104 104
     'relationship' => array(
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     ),
110 110
     'field' => array(
111 111
       'handler' => 'views_handler_field_numeric',
112
-      'click sortable' => TRUE
112
+      'click sortable' => true
113 113
     ),
114 114
     'filter' => array(
115 115
       'handler' => 'views_handler_filter_numeric'
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
     'help' => t('The percentage of time that work is allowed.'),
127 127
     'field' => array(
128 128
       'handler' => 'views_handler_field_numeric',
129
-      'click sortable' => TRUE,
130
-      'float' => TRUE
129
+      'click sortable' => true,
130
+      'float' => true
131 131
     ),
132 132
     'filter' => array(
133 133
       'handler' => 'views_handler_filter_numeric'
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
     'help' => t('The average time required for work to be completed.'),
142 142
     'field' => array(
143 143
       'handler' => 'views_handler_field_numeric',
144
-      'click sortable' => TRUE,
145
-      'float' => TRUE
144
+      'click sortable' => true,
145
+      'float' => true
146 146
     ),
147 147
     'filter' => array(
148 148
       'handler' => 'views_handler_filter_numeric'
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     'help' => t('The time the host record was created.'),
157 157
     'field' => array(
158 158
       'handler' => 'views_handler_field_date',
159
-      'click sortable' => TRUE
159
+      'click sortable' => true
160 160
     ),
161 161
     'filter' => array(
162 162
       'handler' => 'views_handler_filter_date'
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
     'help' => t('The percentage of time that the host has an Internet connection.'),
171 171
     'field' => array(
172 172
       'handler' => 'views_handler_field_numeric',
173
-      'click sortable' => TRUE,
174
-      'float' => TRUE
173
+      'click sortable' => true,
174
+      'float' => true
175 175
     ),
176 176
     'filter' => array(
177 177
       'handler' => 'views_handler_filter_numeric'
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
     'help' => t('The average efficiency of the host CPU.'),
186 186
     'field' => array(
187 187
       'handler' => 'views_handler_field_numeric',
188
-      'click sortable' => TRUE,
189
-      'float' => TRUE
188
+      'click sortable' => true,
189
+      'float' => true
190 190
     ),
191 191
     'filter' => array(
192 192
       'handler' => 'views_handler_filter_numeric'
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     'help' => t('The amount of disk space that is not in use.'),
201 201
     'field' => array(
202 202
       'handler' => 'views_handler_field_numeric',
203
-      'click sortable' => TRUE
203
+      'click sortable' => true
204 204
     ),
205 205
     'filter' => array(
206 206
       'handler' => 'views_handler_filter_numeric'
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     'help' => t('The size of the disk on which BOINC is installed.'),
215 215
     'field' => array(
216 216
       'handler' => 'views_handler_field_numeric',
217
-      'click sortable' => TRUE
217
+      'click sortable' => true
218 218
     ),
219 219
     'filter' => array(
220 220
       'handler' => 'views_handler_filter_numeric'
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     'help' => t('The name of the host.'),
229 229
     'field' => array(
230 230
       'handler' => 'views_handler_field',
231
-      'click sortable' => TRUE
231
+      'click sortable' => true
232 232
     ),
233 233
     'filter' => array(
234 234
       'handler' => 'views_handler_filter_string'
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
     'help' => t('Task duration correction factor.'),
243 243
     'field' => array(
244 244
       'handler' => 'views_handler_field_numeric',
245
-      'click sortable' => TRUE,
246
-      'float' => TRUE
245
+      'click sortable' => true,
246
+      'float' => true
247 247
     ),
248 248
     'filter' => array(
249 249
       'handler' => 'views_handler_filter_numeric'
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
     'help' => t('A decaying average of credit per day.'),
258 258
     'field' => array(
259 259
       'handler' => 'views_handler_field_numeric',
260
-      'click sortable' => TRUE,
261
-      'float' => TRUE
260
+      'click sortable' => true,
261
+      'float' => true
262 262
     ),
263 263
     'filter' => array(
264 264
       'handler' => 'views_handler_filter_numeric'
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     'help' => t('The IP address from which the host last communicated.'),
273 273
     'field' => array(
274 274
       'handler' => 'views_handler_field',
275
-      'click sortable' => TRUE
275
+      'click sortable' => true
276 276
     ),
277 277
     'filter' => array(
278 278
       'handler' => 'views_handler_filter_string'
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     'help' => t('The consistent identifier of the host across projects.'),
287 287
     'field' => array(
288 288
       'handler' => 'views_handler_field',
289
-      'click sortable' => TRUE
289
+      'click sortable' => true
290 290
     ),
291 291
     'filter' => array(
292 292
       'handler' => 'views_handler_filter_string'
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     'help' => t('The IP address of the host at last communication.'),
301 301
     'field' => array(
302 302
       'handler' => 'views_handler_field',
303
-      'click sortable' => TRUE
303
+      'click sortable' => true
304 304
     ),
305 305
     'filter' => array(
306 306
       'handler' => 'views_handler_filter_string'
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     'help' => t('The amount of cache on the processor(s).'),
315 315
     'field' => array(
316 316
       'handler' => 'views_handler_field_numeric',
317
-      'click sortable' => TRUE
317
+      'click sortable' => true
318 318
     ),
319 319
     'filter' => array(
320 320
       'handler' => 'views_handler_filter_numeric'
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
     'help' => t('The amount of memory installed.'),
329 329
     'field' => array(
330 330
       'handler' => 'views_handler_field_numeric',
331
-      'click sortable' => TRUE
331
+      'click sortable' => true
332 332
     ),
333 333
     'filter' => array(
334 334
       'handler' => 'views_handler_filter_numeric'
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
     'help' => t('The amount of swap space configured.'),
343 343
     'field' => array(
344 344
       'handler' => 'views_handler_field_numeric',
345
-      'click sortable' => TRUE
345
+      'click sortable' => true
346 346
     ),
347 347
     'filter' => array(
348 348
       'handler' => 'views_handler_filter_numeric'
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     'help' => t('The maximum number of workunits to be allocated per CPU.'),
357 357
     'field' => array(
358 358
       'handler' => 'views_handler_field_numeric',
359
-      'click sortable' => TRUE
359
+      'click sortable' => true
360 360
     ),
361 361
     'filter' => array(
362 362
       'handler' => 'views_handler_filter_numeric'
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
     'help' => t('The average rate at which new work is downloaded.'),
371 371
     'field' => array(
372 372
       'handler' => 'views_handler_field_numeric',
373
-      'click sortable' => TRUE,
374
-      'float' => TRUE
373
+      'click sortable' => true,
374
+      'float' => true
375 375
     ),
376 376
     'filter' => array(
377 377
       'handler' => 'views_handler_filter_numeric'
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
     'help' => t('The average rate at which completed work is uploaded.'),
386 386
     'field' => array(
387 387
       'handler' => 'views_handler_field_numeric',
388
-      'click sortable' => TRUE,
389
-      'float' => TRUE
388
+      'click sortable' => true,
389
+      'float' => true
390 390
     ),
391 391
     'filter' => array(
392 392
       'handler' => 'views_handler_filter_numeric'
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
     'help' => t('The number of times the last IP address.'),
401 401
     'field' => array(
402 402
       'handler' => 'views_handler_field',
403
-      'click sortable' => TRUE
403
+      'click sortable' => true
404 404
     ),
405 405
     'filter' => array(
406 406
       'handler' => 'views_handler_filter_string'
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
     'help' => t('The percentage of time that the BOINC client is running.'),
415 415
     'field' => array(
416 416
       'handler' => 'views_handler_field_numeric',
417
-      'click sortable' => TRUE,
418
-      'float' => TRUE
417
+      'click sortable' => true,
418
+      'float' => true
419 419
     ),
420 420
     'filter' => array(
421 421
       'handler' => 'views_handler_filter_numeric'
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     'help' => t('The name of the host operating system.'),
430 430
     'field' => array(
431 431
       'handler' => 'views_handler_field',
432
-      'click sortable' => TRUE
432
+      'click sortable' => true
433 433
     ),
434 434
     'filter' => array(
435 435
       'handler' => 'views_handler_filter_string'
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     'help' => t('The version of the host operating system.'),
444 444
     'field' => array(
445 445
       'handler' => 'views_handler_field',
446
-      'click sortable' => TRUE
446
+      'click sortable' => true
447 447
     ),
448 448
     'filter' => array(
449 449
       'handler' => 'views_handler_filter_string'
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
     'help' => t('The capability of the host in floating point operations per second.'),
458 458
     'field' => array(
459 459
       'handler' => 'views_handler_field_numeric',
460
-      'click sortable' => TRUE,
461
-      'float' => TRUE
460
+      'click sortable' => true,
461
+      'float' => true
462 462
     ),
463 463
     'filter' => array(
464 464
       'handler' => 'views_handler_filter_numeric'
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
     'help' => t('The capability of the host in integer operations per second.'),
473 473
     'field' => array(
474 474
       'handler' => 'views_handler_field_numeric',
475
-      'click sortable' => TRUE,
476
-      'float' => TRUE
475
+      'click sortable' => true,
476
+      'float' => true
477 477
     ),
478 478
     'filter' => array(
479 479
       'handler' => 'views_handler_filter_numeric'
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
     'help' => t('The model of the CPU in the host.'),
488 488
     'field' => array(
489 489
       'handler' => 'views_handler_field',
490
-      'click sortable' => TRUE
490
+      'click sortable' => true
491 491
     ),
492 492
     'filter' => array(
493 493
       'handler' => 'views_handler_filter_string'
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
     'help' => t('The count of CPU cores in the system.'),
502 502
     'field' => array(
503 503
       'handler' => 'views_handler_field',
504
-      'click sortable' => TRUE
504
+      'click sortable' => true
505 505
     ),
506 506
     'filter' => array(
507 507
       'handler' => 'views_handler_filter_string'
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
     'help' => t('The manufacturer of the CPU in the host.'),
516 516
     'field' => array(
517 517
       'handler' => 'views_handler_field',
518
-      'click sortable' => TRUE
518
+      'click sortable' => true
519 519
     ),
520 520
     'filter' => array(
521 521
       'handler' => 'views_handler_filter_string'
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
     'help' => t('The number of times the client has contacted the server.'),
530 530
     'field' => array(
531 531
       'handler' => 'views_handler_field_numeric',
532
-      'click sortable' => TRUE
532
+      'click sortable' => true
533 533
     ),
534 534
     'filter' => array(
535 535
       'handler' => 'views_handler_filter_numeric'
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     'help' => t('The time of the last RPC contact with the host.'),
544 544
     'field' => array(
545 545
       'handler' => 'views_handler_field_date',
546
-      'click sortable' => TRUE
546
+      'click sortable' => true
547 547
     ),
548 548
     'filter' => array(
549 549
       'handler' => 'views_handler_filter_date'
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
     'help' => t('Contains the release number of the BOINC application in use and the GPU of the host.'),
558 558
     'field' => array(
559 559
       'handler' => 'views_handler_field',
560
-      'click sortable' => TRUE
560
+      'click sortable' => true
561 561
     ),
562 562
     'filter' => array(
563 563
       'handler' => 'views_handler_filter_string'
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
     'help' => t('The UTC offset of the local time.'),
572 572
     'field' => array(
573 573
       'handler' => 'views_handler_field_numeric',
574
-      'click sortable' => TRUE
574
+      'click sortable' => true
575 575
     ),
576 576
     'filter' => array(
577 577
       'handler' => 'views_handler_filter_numeric'
@@ -585,8 +585,8 @@  discard block
 block discarded – undo
585 585
     'help' => t('The total accumulated BOINC credit.'),
586 586
     'field' => array(
587 587
       'handler' => 'views_handler_field_numeric',
588
-      'click sortable' => TRUE,
589
-      'float' => TRUE
588
+      'click sortable' => true,
589
+      'float' => true
590 590
     ),
591 591
     'filter' => array(
592 592
       'handler' => 'views_handler_filter_numeric'
@@ -615,12 +615,12 @@  discard block
 block discarded – undo
615 615
     'help' => t('The ID number of the platform.'),
616 616
     'field' => array(
617 617
       'handler' => 'views_handler_field_numeric',
618
-      'click sortable' => TRUE
618
+      'click sortable' => true
619 619
     ),
620 620
     'argument' => array(
621 621
       'handler' => 'views_handler_argument',
622 622
       'name field' => 'title',
623
-      'numeric' => TRUE,
623
+      'numeric' => true,
624 624
       'validate type' => 'id'
625 625
     ),
626 626
     'filter' => array(
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
     'help' => t('The name of the platform.'),
639 639
     'field' => array(
640 640
       'handler' => 'views_handler_field',
641
-      'click sortable' => TRUE
641
+      'click sortable' => true
642 642
     ),
643 643
     'filter' => array(
644 644
       'handler' => 'views_handler_filter_string'
@@ -684,12 +684,12 @@  discard block
 block discarded – undo
684 684
     'help' => t('The ID number of this result.'),
685 685
     'field' => array(
686 686
       'handler' => 'views_handler_field_numeric',
687
-      'click sortable' => TRUE
687
+      'click sortable' => true
688 688
     ),
689 689
     'argument' => array(
690 690
       'handler' => 'views_handler_argument',
691 691
       'name field' => 'title',
692
-      'numeric' => TRUE,
692
+      'numeric' => true,
693 693
       'validate type' => 'id'
694 694
     ),
695 695
     'filter' => array(
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
     'argument' => array(
710 710
       'handler' => 'views_handler_argument_boincuser_id',
711 711
       'name field' => 'title',
712
-      'numeric' => TRUE,
712
+      'numeric' => true,
713 713
       'validate type' => 'id'
714 714
     ),
715 715
     'relationship' => array(
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
     'argument' => array(
727 727
       'handler' => 'views_handler_argument',
728 728
       'name field' => 'title',
729
-      'numeric' => TRUE,
729
+      'numeric' => true,
730 730
       'validate type' => 'id'
731 731
     ),
732 732
     'relationship' => array(
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
     ),
738 738
     'field' => array(
739 739
       'handler' => 'views_handler_field_numeric',
740
-      'click sortable' => TRUE
740
+      'click sortable' => true
741 741
     ),
742 742
     'filter' => array(
743 743
       'handler' => 'views_handler_filter_numeric'
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
     'argument' => array(
754 754
       'handler' => 'views_handler_argument',
755 755
       'name field' => 'title',
756
-      'numeric' => TRUE,
756
+      'numeric' => true,
757 757
       'validate type' => 'id'
758 758
     ),
759 759
     'relationship' => array(
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
     ),
765 765
     'field' => array(
766 766
       'handler' => 'views_handler_field_numeric',
767
-      'click sortable' => TRUE
767
+      'click sortable' => true
768 768
     ),
769 769
     'filter' => array(
770 770
       'handler' => 'views_handler_filter_numeric'
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
     'help' => t('The ID number of the application.'),
782 782
     'field' => array(
783 783
       'handler' => 'views_handler_field_numeric',
784
-      'click sortable' => TRUE
784
+      'click sortable' => true
785 785
     ),
786 786
     'filter' => array(
787 787
       'handler' => 'views_handler_filter_numeric'
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
     'help' => t('The version number of the application.'),
796 796
     'field' => array(
797 797
       'handler' => 'views_handler_field_numeric',
798
-      'click sortable' => TRUE
798
+      'click sortable' => true
799 799
     ),
800 800
     'filter' => array(
801 801
       'handler' => 'views_handler_filter_numeric'
@@ -809,8 +809,8 @@  discard block
 block discarded – undo
809 809
     'help' => t('The credit claimed for this result.'),
810 810
     'field' => array(
811 811
       'handler' => 'views_handler_field_numeric',
812
-      'click sortable' => TRUE,
813
-      'float' => TRUE
812
+      'click sortable' => true,
813
+      'float' => true
814 814
     ),
815 815
     'filter' => array(
816 816
       'handler' => 'views_handler_filter_numeric'
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
     'help' => t('The state of the task on the client side.'),
825 825
     'field' => array(
826 826
       'handler' => 'views_handler_field_numeric',
827
-      'click sortable' => TRUE
827
+      'click sortable' => true
828 828
     ),
829 829
     'filter' => array(
830 830
       'handler' => 'views_handler_filter_numeric'
@@ -838,8 +838,8 @@  discard block
 block discarded – undo
838 838
     'help' => t('The CPU time spent on the task.'),
839 839
     'field' => array(
840 840
       'handler' => 'views_handler_field_numeric',
841
-      'click sortable' => TRUE,
842
-      'float' => TRUE
841
+      'click sortable' => true,
842
+      'float' => true
843 843
     ),
844 844
     'filter' => array(
845 845
       'handler' => 'views_handler_filter_numeric'
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
     'help' => t('The time that the task was created.'),
854 854
     'field' => array(
855 855
       'handler' => 'views_handler_field_date',
856
-      'click sortable' => TRUE
856
+      'click sortable' => true
857 857
     ),
858 858
     'filter' => array(
859 859
       'handler' => 'views_handler_filter_date'
@@ -867,8 +867,8 @@  discard block
 block discarded – undo
867 867
     'help' => t('The run time of the task.'),
868 868
     'field' => array(
869 869
       'handler' => 'views_handler_field_numeric',
870
-      'click sortable' => TRUE,
871
-      'float' => TRUE
870
+      'click sortable' => true,
871
+      'float' => true
872 872
     ),
873 873
     'filter' => array(
874 874
       'handler' => 'views_handler_filter_numeric'
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
     'help' => t('The exit code of the task.'),
883 883
     'field' => array(
884 884
       'handler' => 'views_handler_field_numeric',
885
-      'click sortable' => TRUE
885
+      'click sortable' => true
886 886
     ),
887 887
     'filter' => array(
888 888
       'handler' => 'views_handler_filter_numeric'
@@ -896,8 +896,8 @@  discard block
 block discarded – undo
896 896
     'help' => t('The credit granted for this result.'),
897 897
     'field' => array(
898 898
       'handler' => 'views_handler_field_numeric',
899
-      'click sortable' => TRUE,
900
-      'float' => TRUE
899
+      'click sortable' => true,
900
+      'float' => true
901 901
     ),
902 902
     'filter' => array(
903 903
       'handler' => 'views_handler_filter_numeric'
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
     'help' => t('The name of the task.'),
912 912
     'field' => array(
913 913
       'handler' => 'views_handler_field',
914
-      'click sortable' => TRUE
914
+      'click sortable' => true
915 915
     ),
916 916
     'filter' => array(
917 917
       'handler' => 'views_handler_filter_string'
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
     'help' => t('The outcome of the task.'),
926 926
     'field' => array(
927 927
       'handler' => 'views_handler_field_numeric',
928
-      'click sortable' => TRUE
928
+      'click sortable' => true
929 929
     ),
930 930
     'filter' => array(
931 931
       'handler' => 'views_handler_filter_numeric'
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
     'help' => t('The time that the result was received.'),
940 940
     'field' => array(
941 941
       'handler' => 'views_handler_field_date',
942
-      'click sortable' => TRUE
942
+      'click sortable' => true
943 943
     ),
944 944
     'filter' => array(
945 945
       'handler' => 'views_handler_filter_date'
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
     'help' => t('The deadline for the task.'),
954 954
     'field' => array(
955 955
       'handler' => 'views_handler_field_date',
956
-      'click sortable' => TRUE
956
+      'click sortable' => true
957 957
     ),
958 958
     'filter' => array(
959 959
       'handler' => 'views_handler_filter_date'
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
     'help' => t('The time that the task was sent.'),
968 968
     'field' => array(
969 969
       'handler' => 'views_handler_field_date',
970
-      'click sortable' => TRUE
970
+      'click sortable' => true
971 971
     ),
972 972
     'filter' => array(
973 973
       'handler' => 'views_handler_filter_date'
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
     'help' => t('The state of task on the server side.'),
982 982
     'field' => array(
983 983
       'handler' => 'views_handler_field_numeric',
984
-      'click sortable' => TRUE
984
+      'click sortable' => true
985 985
     ),
986 986
     'filter' => array(
987 987
       'handler' => 'views_handler_filter_numeric'
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
     'help' => t('The output to standard error.'),
996 996
     'field' => array(
997 997
       'handler' => 'views_handler_field',
998
-      'click sortable' => TRUE
998
+      'click sortable' => true
999 999
     ),
1000 1000
     'filter' => array(
1001 1001
       'handler' => 'views_handler_filter_string'
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
     'help' => t('The state of validation of this result.'),
1010 1010
     'field' => array(
1011 1011
       'handler' => 'views_handler_field_numeric',
1012
-      'click sortable' => TRUE
1012
+      'click sortable' => true
1013 1013
     ),
1014 1014
     'filter' => array(
1015 1015
       'handler' => 'views_handler_filter_numeric'
@@ -1047,12 +1047,12 @@  discard block
 block discarded – undo
1047 1047
     'help' => t('The ID number of this workunit.'),
1048 1048
     'field' => array(
1049 1049
       'handler' => 'views_handler_field_numeric',
1050
-      'click sortable' => TRUE
1050
+      'click sortable' => true
1051 1051
     ),
1052 1052
     'argument' => array(
1053 1053
       'handler' => 'views_handler_argument',
1054 1054
       'name field' => 'title',
1055
-      'numeric' => TRUE,
1055
+      'numeric' => true,
1056 1056
       'validate type' => 'id'
1057 1057
     ),
1058 1058
     'filter' => array(
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
     'argument' => array( // foreign key to the {app} table
1072 1072
       'handler' => 'views_handler_argument',
1073 1073
       'name field' => 'title',
1074
-      'numeric' => TRUE,
1074
+      'numeric' => true,
1075 1075
       'validate type' => 'id'
1076 1076
     ),
1077 1077
     'relationship' => array(
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
     ),
1083 1083
     'field' => array(
1084 1084
       'handler' => 'views_handler_field_numeric',
1085
-      'click sortable' => TRUE
1085
+      'click sortable' => true
1086 1086
     ),
1087 1087
     'filter' => array(
1088 1088
       'handler' => 'views_handler_filter_numeric'
@@ -1099,8 +1099,8 @@  discard block
 block discarded – undo
1099 1099
     'help' => t('The canonical credit of the workunit.'),
1100 1100
     'field' => array(
1101 1101
       'handler' => 'views_handler_field_numeric',
1102
-      'click sortable' => TRUE,
1103
-      'float' => TRUE
1102
+      'click sortable' => true,
1103
+      'float' => true
1104 1104
     ),
1105 1105
     'filter' => array(
1106 1106
       'handler' => 'views_handler_filter_numeric'
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
     'help' => t('The ID of the canonical result associated with the workunit.'),
1115 1115
     'field' => array(
1116 1116
       'handler' => 'views_handler_field_numeric',
1117
-      'click sortable' => TRUE
1117
+      'click sortable' => true
1118 1118
     ),
1119 1119
     'filter' => array(
1120 1120
       'handler' => 'views_handler_filter_numeric'
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
     'help' => t('The time that the workunit was created.'),
1129 1129
     'field' => array(
1130 1130
       'handler' => 'views_handler_field_date',
1131
-      'click sortable' => TRUE
1131
+      'click sortable' => true
1132 1132
     ),
1133 1133
     'filter' => array(
1134 1134
       'handler' => 'views_handler_filter_date'
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
     'help' => t('Error mask of the workunit.'),
1143 1143
     'field' => array(
1144 1144
       'handler' => 'views_handler_field_numeric',
1145
-      'click sortable' => TRUE
1145
+      'click sortable' => true
1146 1146
     ),
1147 1147
     'filter' => array(
1148 1148
       'handler' => 'views_handler_filter_numeric'
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
     'help' => t('Minimum quorum of the workunit.'),
1157 1157
     'field' => array(
1158 1158
       'handler' => 'views_handler_field_numeric',
1159
-      'click sortable' => TRUE
1159
+      'click sortable' => true
1160 1160
     ),
1161 1161
     'filter' => array(
1162 1162
       'handler' => 'views_handler_filter_numeric'
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
     'help' => t('The name of the workunit.'),
1171 1171
     'field' => array(
1172 1172
       'handler' => 'views_handler_field',
1173
-      'click sortable' => TRUE
1173
+      'click sortable' => true
1174 1174
     ),
1175 1175
     'filter' => array(
1176 1176
       'handler' => 'views_handler_filter_string'
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
     'help' => t('The maximum number of error tasks in the workunit.'),
1185 1185
     'field' => array(
1186 1186
       'handler' => 'views_handler_field_numeric',
1187
-      'click sortable' => TRUE
1187
+      'click sortable' => true
1188 1188
     ),
1189 1189
     'filter' => array(
1190 1190
       'handler' => 'views_handler_filter_numeric'
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
     'help' => t('The maximum number of successful tasks in the workunit.'),
1199 1199
     'field' => array(
1200 1200
       'handler' => 'views_handler_field_numeric',
1201
-      'click sortable' => TRUE
1201
+      'click sortable' => true
1202 1202
     ),
1203 1203
     'filter' => array(
1204 1204
       'handler' => 'views_handler_filter_numeric'
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
     'help' => t('The maximum number of total tasks in the workunit.'),
1213 1213
     'field' => array(
1214 1214
       'handler' => 'views_handler_field_numeric',
1215
-      'click sortable' => TRUE
1215
+      'click sortable' => true
1216 1216
     ),
1217 1217
     'filter' => array(
1218 1218
       'handler' => 'views_handler_filter_numeric'
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
     'help' => t('Whether or not a workunit needs validation.'),
1227 1227
     'field' => array(
1228 1228
       'handler' => 'views_handler_field_numeric',
1229
-      'click sortable' => TRUE
1229
+      'click sortable' => true
1230 1230
     ),
1231 1231
     'filter' => array(
1232 1232
       'handler' => 'views_handler_filter_numeric'
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
     'help' => t('The target number of results for the workunit.'),
1241 1241
     'field' => array(
1242 1242
       'handler' => 'views_handler_field_numeric',
1243
-      'click sortable' => TRUE
1243
+      'click sortable' => true
1244 1244
     ),
1245 1245
     'filter' => array(
1246 1246
       'handler' => 'views_handler_filter_numeric'
@@ -1269,12 +1269,12 @@  discard block
 block discarded – undo
1269 1269
     'help' => t('The ID number of this application.'),
1270 1270
     'field' => array(
1271 1271
       'handler' => 'views_handler_field_numeric',
1272
-      'click sortable' => TRUE
1272
+      'click sortable' => true
1273 1273
     ),
1274 1274
     'argument' => array(
1275 1275
       'handler' => 'views_handler_argument',
1276 1276
       'name field' => 'title',
1277
-      'numeric' => TRUE,
1277
+      'numeric' => true,
1278 1278
       'validate type' => 'id'
1279 1279
     ),
1280 1280
     'filter' => array(
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
     'help' => t('The number of times to replicate tasks in this application.'),
1293 1293
     'field' => array(
1294 1294
       'handler' => 'views_handler_field_numeric',
1295
-      'click sortable' => TRUE
1295
+      'click sortable' => true
1296 1296
     ),
1297 1297
     'filter' => array(
1298 1298
       'handler' => 'views_handler_filter_numeric'
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
     'help' => t('The user friendly name of the application.'),
1307 1307
     'field' => array(
1308 1308
       'handler' => 'views_handler_field',
1309
-      'click sortable' => TRUE
1309
+      'click sortable' => true
1310 1310
     ),
1311 1311
     'filter' => array(
1312 1312
       'handler' => 'views_handler_filter_string'
@@ -1335,12 +1335,12 @@  discard block
 block discarded – undo
1335 1335
     'help' => t('The ID number of this application version.'),
1336 1336
     'field' => array(
1337 1337
       'handler' => 'views_handler_field_numeric',
1338
-      'click sortable' => TRUE
1338
+      'click sortable' => true
1339 1339
     ),
1340 1340
     'argument' => array(
1341 1341
       'handler' => 'views_handler_argument',
1342 1342
       'name field' => 'title',
1343
-      'numeric' => TRUE,
1343
+      'numeric' => true,
1344 1344
       'validate type' => 'id'
1345 1345
     ),
1346 1346
     'filter' => array(
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
     'argument' => array(
1363 1363
       'handler' => 'views_handler_argument_numeric',
1364 1364
       'name field' => 'title',
1365
-      'numeric' => TRUE,
1365
+      'numeric' => true,
1366 1366
       'validate type' => 'id'
1367 1367
     ),
1368 1368
     'relationship' => array(
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
     ),
1374 1374
     'field' => array(
1375 1375
       'handler' => 'views_handler_field_numeric',
1376
-      'click sortable' => TRUE
1376
+      'click sortable' => true
1377 1377
     ),
1378 1378
     'filter' => array(
1379 1379
       'handler' => 'views_handler_filter_numeric'
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
     'argument' => array(
1393 1393
       'handler' => 'views_handler_argument_numeric',
1394 1394
       'name field' => 'title',
1395
-      'numeric' => TRUE,
1395
+      'numeric' => true,
1396 1396
       'validate type' => 'id'
1397 1397
     ),
1398 1398
     'relationship' => array(
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
     ),
1404 1404
     'field' => array(
1405 1405
       'handler' => 'views_handler_field_numeric',
1406
-      'click sortable' => TRUE
1406
+      'click sortable' => true
1407 1407
     ),
1408 1408
     'filter' => array(
1409 1409
       'handler' => 'views_handler_filter_numeric'
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
     'help' => t('App version plan class.'),
1421 1421
     'field' => array(
1422 1422
       'handler' => 'views_handler_field',
1423
-      'click sortable' => TRUE
1423
+      'click sortable' => true
1424 1424
     ),
1425 1425
     'filter' => array(
1426 1426
       'handler' => 'views_handler_filter_string'
@@ -1434,8 +1434,8 @@  discard block
 block discarded – undo
1434 1434
     'help' => t('The application version number.'),
1435 1435
     'field' => array(
1436 1436
       'handler' => 'views_handler_field_boincwork_app_version_number',
1437
-      'click sortable' => TRUE,
1438
-      'float' => TRUE,
1437
+      'click sortable' => true,
1438
+      'float' => true,
1439 1439
     ),
1440 1440
     'filter' => array(
1441 1441
       'handler' => 'views_handler_filter_numeric'
@@ -1473,12 +1473,12 @@  discard block
 block discarded – undo
1473 1473
     'help' => t('The host ID connected to this app version data.'),
1474 1474
     'field' => array(
1475 1475
       'handler' => 'views_handler_field_numeric',
1476
-      'click sortable' => TRUE
1476
+      'click sortable' => true
1477 1477
     ),
1478 1478
     'argument' => array(
1479 1479
       'handler' => 'views_handler_argument',
1480 1480
       'name field' => 'title',
1481
-      'numeric' => TRUE,
1481
+      'numeric' => true,
1482 1482
       'validate type' => 'id'
1483 1483
     ),
1484 1484
     'filter' => array(
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
     'argument' => array(
1501 1501
       'handler' => 'views_handler_argument_numeric',
1502 1502
       'name field' => 'title',
1503
-      'numeric' => TRUE,
1503
+      'numeric' => true,
1504 1504
       'validate type' => 'id'
1505 1505
     ),
1506 1506
     'relationship' => array(
@@ -1511,7 +1511,7 @@  discard block
 block discarded – undo
1511 1511
     ),
1512 1512
     'field' => array(
1513 1513
       'handler' => 'views_handler_field_numeric',
1514
-      'click sortable' => TRUE
1514
+      'click sortable' => true
1515 1515
     ),
1516 1516
     'filter' => array(
1517 1517
       'handler' => 'views_handler_filter_numeric'
@@ -1528,7 +1528,7 @@  discard block
 block discarded – undo
1528 1528
     'help' => t('The number of consecutive valid tasks for this app and by this host.'),
1529 1529
     'field' => array(
1530 1530
       'handler' => 'views_handler_field_numeric',
1531
-      'click sortable' => TRUE
1531
+      'click sortable' => true
1532 1532
     ),
1533 1533
     'filter' => array(
1534 1534
       'handler' => 'views_handler_filter_numeric'
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
     'help' => t('The "et_avg" for this app and by this host.'),
1543 1543
     'field' => array(
1544 1544
       'handler' => 'views_handler_field_boincwork_host_app_et_avg',
1545
-      'click sortable' => TRUE
1545
+      'click sortable' => true
1546 1546
     ),
1547 1547
     'filter' => array(
1548 1548
       'handler' => 'views_handler_filter_numeric'
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
     'help' => t('The tasks completed for this app and by this host.'),
1557 1557
     'field' => array(
1558 1558
       'handler' => 'views_handler_field_numeric',
1559
-      'click sortable' => TRUE
1559
+      'click sortable' => true
1560 1560
     ),
1561 1561
     'filter' => array(
1562 1562
       'handler' => 'views_handler_filter_numeric'
@@ -1570,7 +1570,7 @@  discard block
 block discarded – undo
1570 1570
     'help' => t('The maximum tasks per day for this app and by this host.'),
1571 1571
     'field' => array(
1572 1572
       'handler' => 'views_handler_field_numeric',
1573
-      'click sortable' => TRUE
1573
+      'click sortable' => true
1574 1574
     ),
1575 1575
     'filter' => array(
1576 1576
       'handler' => 'views_handler_filter_numeric'
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
     'help' => t('The number of tasks today for this app and by this host.'),
1585 1585
     'field' => array(
1586 1586
       'handler' => 'views_handler_field_numeric',
1587
-      'click sortable' => TRUE
1587
+      'click sortable' => true
1588 1588
     ),
1589 1589
     'filter' => array(
1590 1590
       'handler' => 'views_handler_filter_numeric'
@@ -1598,8 +1598,8 @@  discard block
 block discarded – undo
1598 1598
     'help' => t('The average turnaround time per task for this app and by this host.'),
1599 1599
     'field' => array(
1600 1600
       'handler' => 'views_handler_field_boincwork_host_app_turnaround_avg',
1601
-      'click sortable' => TRUE,
1602
-      'float' => TRUE,
1601
+      'click sortable' => true,
1602
+      'float' => true,
1603 1603
     ),
1604 1604
     'filter' => array(
1605 1605
       'handler' => 'views_handler_filter_numeric'
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
     'help' => t('The user friendly name of the application.'),
1614 1614
     'field' => array(
1615 1615
       'handler' => 'views_handler_field',
1616
-      'click sortable' => TRUE
1616
+      'click sortable' => true
1617 1617
     ),
1618 1618
     'filter' => array(
1619 1619
       'handler' => 'views_handler_filter_string'
Please login to merge, or discard this patch.