$pdfdata = array(); $columns = array('<b>' . $AppUI->_('Task Name') . '</b>', '<b>' . $AppUI->_('Task Description') . '</b>', '<b>' . $AppUI->_('Assigned To') . '</b>', '<b>' . $AppUI->_('Task Start Date') . '</b>', '<b>' . $AppUI->_('Task End Date') . '</b>', '<b>' . $AppUI->_('Completion') . '</b>'); if ($project_id == 0) { array_unshift($columns, '<b>' . $AppUI->_('Project Name') . '</b>'); } $htmlHelper = new w2p_Output_HTMLHelper($AppUI); if ($project_id == 0) { $myProject = new CProject(); $projects = $myProject->getAllowedProjects($AppUI->user_id); $project_ids = array_keys($projects); } else { $project_ids = array($project_id); } $obj = new CTask(); foreach ($project_ids as $project_id) { $taskTree = $obj->getTaskTree($project_id, 0); foreach ($taskTree as $task) { $str = '<tr>'; if (count($project_ids) > 1) { $str .= '<td>' . $task['project_name'] . '</td>'; } $str .= '<td>'; $indent_count = substr_count($task['task_path_enumeration'], '/') * 3; $str .= $task['task_id'] == $task['task_parent'] ? '' : str_repeat(' ', $indent_count) . '<img src="' . w2PfindImage('corner-dots.gif') . '" />'; $str .= ' <a href="?m=tasks&a=view&task_id=' . $task['task_id'] . '">' . $task['task_name'] . '</a></td>'; $str .= '<td>' . nl2br($task['task_description']) . '</td>'; $users = array(); $assignees = $obj->assignees($task['task_id']); foreach ($assignees as $assignee) { $users[] = $assignee['contact_name']; }
global $project_id; $project = $obj; include $AppUI->getTheme()->resolveTemplate('projects/view'); $module = new w2p_System_Module(); $fields = $module->loadSettings('projectdesigner', 'task_list_print'); if (0 == count($fields)) { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v3.0 // At some point at/after v4.0, this should be deprecated $fieldList = array('task_name', 'task_percent_complete', 'task_owner', 'task_start_date', 'task_duration', 'task_end_date'); $fieldNames = array('Task Name', 'Work', 'Owner', 'Start', 'Duration', 'Finish'); $module->storeSettings('projectdesigner', 'task_list_print', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $taskobj = new CTask(); $taskTree = $taskobj->getTaskTree($project_id); $listTable = new w2p_Output_HTML_TaskTable($AppUI); echo $listTable->startTable(); echo $listTable->buildHeader($fields); echo $listTable->buildRows($taskTree); echo $listTable->endTable(); ?> <table class="tbl" cellspacing="1" cellpadding="2" border="0" width="100%"> <tr> <td align="center"> <?php echo '<strong>Gantt Chart</strong>'; ?> </td> </tr> <tr>
<input type="hidden" name="pd_option_view_files" value="<?php echo isset($view_options[0]['pd_option_view_files']) ? $view_options[0]['pd_option_view_files'] : 1; ?> " /> <input type="hidden" name="bulk_task_hperc_assign" value="" /> <?php echo $listTable->startTable(); echo $listTable->buildHeader($fields, false, $m); $status = w2PgetSysVal('TaskStatus'); $priority = w2PgetSysVal('TaskPriority'); $customLookups = array('task_status' => $status, 'task_priority' => $priority); if ($task_id) { $task = new CTask(); $task->load($task_id); $taskTree = $tempTask->getTaskTree($task->task_project, $task_id); echo $listTable->buildRows($taskTree, $customLookups); } else { reset($projects); foreach ($projects as $k => $p) { $tnums = isset($p['tasks']) ? count($p['tasks']) : 0; if ($tnums && $m == 'tasks') { $width = $p['project_percent_complete'] < 30 ? 30 : $p['project_percent_complete']; ?> <tr> <td colspan="<?php echo count($fieldList) + 3; ?> "> <div style="border: outset #eeeeee 1px;background-color:#<?php echo $p['project_color_identifier'];