} ?> </tr> <?php $none = true; $projectArray = array(); for ($i = ($page - 1) * $xpg_pagesize; $i < $page * $xpg_pagesize && $i < $xpg_totalrecs; $i++) { $row = $projects[$i]; if ($show_all_projects || $row['project_active'] && $row['project_status'] == $project_status_filter && $is_tabbed || $row['project_active'] && $row['project_status'] == $project_status_filter && !$is_tabbed || !$row['project_active'] && $project_status_filter == -3 && !$is_tabbed) { $st_projects_arr = array(); if ($row['project_id'] == $row['project_original_parent']) { if ($project_status_filter == -2) { $structprojects = getStructuredProjects($row['project_original_parent'], '-1', true); } else { $structprojects = getStructuredProjects($row['project_original_parent'], '-1'); } } else { $st_projects_arr[0][1] = 0; } $tmpProject = new CProject(); foreach ($st_projects_arr as $st_project) { $multiproject_id = 0; $project = $st_project[0]; $project_id = $project['project_id']; $level = $st_project[1]; if ($project_id) { if ($is_tabbed) { $row = $all_projects[getProjectIndex($all_projects, $project_id)]; } else { $row = $projects[getProjectIndex($projects, $project_id)];
/** * Tests getting structured projects that are active */ public function testGetStructedProjectsActiveOnly() { global $AppUI, $st_projects_arr; $st_projects_arr = array(); getStructuredProjects(0, -1, true); $this->assertEquals(1, count($st_projects_arr)); $this->assertEquals(3, count($st_projects_arr[0][0])); $this->assertEquals(1, $st_projects_arr[0][0]['project_id']); $this->assertEquals('Test Project', $st_projects_arr[0][0]['project_name']); $this->assertEquals(1, $st_projects_arr[0][0]['project_parent']); $this->assertEquals(0, $st_projects_arr[0][1]); }
<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } global $project_id; global $st_projects_arr; $df = $AppUI->getPref('SHDATEFORMAT'); $projectPriority = w2PgetSysVal('ProjectPriority'); $projectStatus = w2PgetSysVal('ProjectStatus'); $sp_obj = new CProject(); $sp_obj->load($project_id); $original_project_id = $sp_obj->project_original_parent; $structprojects = getStructuredProjects($original_project_id); ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="black"> <tr> <th width="12"> </th> <th class="hilite" width="12"><?php echo $AppUI->_('ID'); ?> </th> <th><?php echo $AppUI->_('Project'); ?> </th> <th><?php echo $AppUI->_('Company'); ?> </th>
$project_status_filter = $currentTabId; //Project not defined if ($currentTabId == count($project_types) - 1) { $project_status_filter = 0; } foreach ($projects as $row_proj) { if (!$perms->checkModuleItem('projects', 'view', $row_proj['project_id'])) { continue; } if ($row_proj['project_type'] == $currentTabId && $row_proj['project_type'] != 0 || !$currentTabId && $row_proj['project_id'] == $row_proj['project_original_parent'] || $currentTabId && $row_proj['project_type'] == 0 && $currentTabId == count($project_types)) { //unset($st_projects_arr); $st_projects_arr = array(); $sp_obj = new CProject(); $sp_obj->load($project_id); if ($row_proj['project_id'] == $row_proj['project_original_parent']) { $structprojects = getStructuredProjects($row_proj['project_original_parent']); } else { $st_projects_arr[0][0] = $row_proj; $st_projects_arr[0][1] = 0; } $tmpProject = new CProject(); $st_projects_counter = 1; foreach ($st_projects_arr as $st_project) { $multiproject_id = 0; $project = $st_project[0]; $level = $st_project[1]; $row_st = new CProject(); $row_st->load($project['project_id']); if (!$perms->checkModuleItem('projects', 'view', $row['project_id'])) { continue; }