| 1 |
<?php |
<?php |
| 2 |
// $Id: stormticket.module,v 1.3 2008/06/18 15:25:32 robertogerola Exp $ |
// $Id: stormticket.module,v 1.4 2008/06/23 16:46:36 robertogerola Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 218 |
'#weight' => -20, |
'#weight' => -20, |
| 219 |
); |
); |
| 220 |
|
|
| 221 |
$s = "SELECT n.nid, n.title FROM {stormorganization} sor INNER JOIN {node} n ON sor.nid=n.nid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title"; |
$s = "SELECT n.nid, n.title FROM {node} AS n INNER JOIN {stormorganization} AS sor ON sor.vid=n.vid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title"; |
| 222 |
|
$s = db_rewrite_sql($s); |
| 223 |
$r = db_query(stormorganization_access_sql($s)); |
$r = db_query(stormorganization_access_sql($s)); |
| 224 |
$organizations = array(); |
$organizations = array(); |
| 225 |
while ($organization = db_fetch_object($r)) { |
while ($organization = db_fetch_object($r)) { |
| 235 |
'#attributes' => array('onchange' => "stormtask_organization_project_tasks(this, 'edit-project-nid', 'edit-parent-nid', true, '-')"), |
'#attributes' => array('onchange' => "stormtask_organization_project_tasks(this, 'edit-project-nid', 'edit-parent-nid', true, '-')"), |
| 236 |
); |
); |
| 237 |
|
|
| 238 |
$s = "SELECT n.nid, n.title FROM {stormproject} spr INNER JOIN {node} n ON spr.nid=n.nid WHERE spr.organization_nid=%d AND n.status=1 AND n.type='stormproject' ORDER BY n.title"; |
$s = "SELECT n.nid, n.title FROM {node} AS n ON INNER JOIN {stormproject} AS spr spr.vid=n.vid WHERE spr.organization_nid=%d AND n.status=1 AND n.type='stormproject' ORDER BY n.title"; |
| 239 |
|
$s = db_rewrite_sql($s); |
| 240 |
$r = db_query(stormproject_access_sql($s), $node->organization_nid); |
$r = db_query(stormproject_access_sql($s), $node->organization_nid); |
| 241 |
$projects = array(); |
$projects = array(); |
| 242 |
while ($project = db_fetch_object($r)) { |
while ($project = db_fetch_object($r)) { |
| 422 |
$rstatus_list = array_flip($status_list); |
$rstatus_list = array_flip($status_list); |
| 423 |
$ticketstatus = $rstatus_list['open']; |
$ticketstatus = $rstatus_list['open']; |
| 424 |
|
|
| 425 |
$s = "SELECT n.nid, n.title, n.uid, n.changed, sti.project_title, sti.project_nid, sti.task_title, sti.task_nid, sti.ticketcategory, sti.ticketstatus FROM {stormticket} sti INNER JOIN {node} n ON n.nid=sti.nid WHERE n.status=1 AND n.type='stormticket'"; |
$s = "SELECT n.nid, n.title, n.uid, n.changed, sti.project_title, sti.project_nid, sti.task_title, sti.task_nid, sti.ticketcategory, sti.ticketstatus FROM |
| 426 |
|
{node} AS n INNER JOIN {stormticket} AS sti ON n.vid=sti.vid WHERE n.status=1 AND n.type='stormticket'"; |
| 427 |
$v = str_replace(',', "','", $ticketstatus); |
$v = str_replace(',', "','", $ticketstatus); |
| 428 |
$where[] = "sti.ticketstatus IN ('". $v ."')"; |
$where[] = "sti.ticketstatus IN ('". $v ."')"; |
| 429 |
|
$s = db_rewrite_sql($s); |
| 430 |
$r = pager_query(stormticket_access_sql($s, $where) .' ORDER BY n.changed', 10, 0, NULL); |
$r = pager_query(stormticket_access_sql($s, $where) .' ORDER BY n.changed', 10, 0, NULL); |
| 431 |
|
|
| 432 |
$header = array( |
$header = array( |