| 1 |
<?php |
<?php |
| 2 |
// $Id: stormtask.admin.inc,v 1.6 2008/05/20 08:13:05 robertogerola Exp $ |
// $Id: stormtask.admin.inc,v 1.7 2008/06/11 12:57:31 robertogerola Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 151 |
); |
); |
| 152 |
|
|
| 153 |
$where = array(); |
$where = array(); |
| 154 |
$s = "SELECT n.*, sta.* FROM {stormtask} sta INNER JOIN {node} n ON n.nid=sta.nid WHERE n.status=1 AND n.type='stormtask' "; |
$s = "SELECT n.*, sta.* FROM {node} AS n INNER JOIN {stormtask} AS sta ON n.vid=sta.vid WHERE n.status=1 AND n.type='stormtask' "; |
| 155 |
if ($_SESSION['stormtask_list_filter']['organization_nid']) { |
if ($_SESSION['stormtask_list_filter']['organization_nid']) { |
| 156 |
$where[] = 'sta.organization_nid='. $_SESSION['stormtask_list_filter']['organization_nid']; |
$where[] = 'sta.organization_nid='. $_SESSION['stormtask_list_filter']['organization_nid']; |
| 157 |
} |
} |
| 165 |
} |
} |
| 166 |
$itemsperpage = $_SESSION['stormtask_list_filter']['itemsperpage']; |
$itemsperpage = $_SESSION['stormtask_list_filter']['itemsperpage']; |
| 167 |
|
|
| 168 |
|
$s = db_rewrite_sql($s); |
| 169 |
$s = stormtask_access_sql($s, $where); |
$s = stormtask_access_sql($s, $where); |
| 170 |
$s = db_rewrite_sql($s, 'stormtask', 'nid'); |
$s = db_rewrite_sql($s, 'stormtask', 'nid'); |
| 171 |
|
|
| 216 |
'#weight' => -20, |
'#weight' => -20, |
| 217 |
); |
); |
| 218 |
|
|
| 219 |
$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"; |
| 220 |
$r = db_query(stormorganization_access_sql($s)); |
$r = db_query(stormorganization_access_sql($s)); |
| 221 |
$organizations = array(); |
$organizations = array(); |
| 222 |
while ($organization = db_fetch_object($r)) { |
while ($organization = db_fetch_object($r)) { |
| 231 |
'#attributes' => array('onchange' => "stormproject_organization_projects(this, 'edit-project-nid', true, 'All')"), |
'#attributes' => array('onchange' => "stormproject_organization_projects(this, 'edit-project-nid', true, 'All')"), |
| 232 |
); |
); |
| 233 |
|
|
| 234 |
$s = "SELECT n.nid, n.title FROM {stormproject} spr INNER JOIN {node} n ON spr.nid=n.nid |
$s = "SELECT n.nid, n.title FROM {node} AS n INNER JOIN {stormproject} AS spr ON spr.vid=n.vid |
| 235 |
WHERE n.status=1 AND spr.organization_nid=%d AND n.type='stormproject' ORDER BY n.title"; |
WHERE n.status=1 AND spr.organization_nid=%d AND n.type='stormproject' ORDER BY n.title"; |
| 236 |
$r = db_query(stormproject_access_sql($s), $organization_nid); |
$r = db_query(stormproject_access_sql($s), $organization_nid); |
| 237 |
$projects = array(); |
$projects = array(); |