public function renderContactTable($moduleName, array $contactList) { $module = new w2p_System_Module(); $fields = $module->loadSettings('contacts', $moduleName . '_view'); if (0 == count($fields)) { $fieldList = array('contact_name', 'contact_email', 'contact_phone', 'dept_name'); $fieldNames = array('Name', 'Email', 'Phone', 'Department'); $module->storeSettings('contacts', $moduleName . '_view', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $listTable = new w2p_Output_ListTable($this->AppUI); $output = $listTable->startTable(); $output .= $listTable->buildHeader($fields); $output .= $listTable->buildRows($contactList); $output .= $listTable->endTable(); return $output; }
public function buildHeader($fields = array(), $sortable = false, $m = '') { $header = parent::buildHeader($fields, $sortable, $m); if ('projectdesigner' == $m) { $checkAll = '<th width="1"><input type="checkbox" onclick="select_all_rows(this, \'selected_task[]\')" name="multi_check"/></th></tr>'; $header = str_replace('</tr>', $checkAll, $header); } return $header; }
<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // @todo convert to template global $AppUI, $project; $items = $project->getForumList(); $module = new w2p_System_Module(); $fields = $module->loadSettings('forums', 'projects_view'); if (0 == count($fields)) { $fieldList = array('forum_name', 'forum_description', 'forum_owner', 'forum_last_date'); $fieldNames = array('Forum Name', 'Description', 'Owner', 'Last Post Info'); $module->storeSettings('forums', 'projects_view', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } ?> <a name="forums-projects_view"> </a> <?php $listTable = new w2p_Output_ListTable($AppUI); $listTable->df .= ' ' . $AppUI->getPref('TIMEFORMAT'); echo $listTable->startTable(); echo $listTable->buildHeader($fields); echo $listTable->buildRows($items); echo $listTable->endTable();
?> <br /> <?php echo $AppUI->getTheme()->styleRenderBoxTop(); ?> <form name="watcher" action="?m=forums&a=viewer&forum_id=<?php echo $forum_id; ?> &f=<?php echo $f; ?> " method="post" accept-charset="utf-8"> <input type="hidden" name="dosql" value="do_watch_forum" /> <input type="hidden" name="watch" value="topic" /> <?php $listHelper = new w2p_Output_ListTable($AppUI); $listHelper->addBefore('watch', 'message_id'); echo $listHelper->startTable(); echo $listHelper->buildHeader($fields); echo $listHelper->buildRows($items); ?> <tr> <td colspan="12"> <div class="left"> <input type="submit" class="button" value="<?php echo $AppUI->_('update watches'); ?> " /> </div> <?php
<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // @todo convert to template global $AppUI, $search_string, $owner_filter_id, $tab, $orderby, $orderdir; $type_filter = $tab - 1; $dept = new CDepartment(); $items = $dept->getFilteredDepartmentList(null, $type_filter, $search_string, $owner_filter_id, $orderby, $orderdir); $module = new w2p_System_Module(); $fields = $module->loadSettings('departments', 'index_list'); if (0 == count($fields)) { $fieldList = array('dept_name', 'countp', 'inactive', 'dept_type'); $fieldNames = array('Department Name', 'Active Projects', 'Archived Projects', 'Type'); $module->storeSettings('departments', 'index_list', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $deptTypes = w2PgetSysVal('DepartmentType'); $customLookups = array('dept_type' => $deptTypes); $listTable = new w2p_Output_ListTable($AppUI); echo $listTable->startTable(); echo $listTable->buildHeader($fields); echo $listTable->buildRows($items, $customLookups); echo $listTable->endTable();
$projectPriority = w2PgetSysVal('ProjectPriority'); $projectStatus = w2PgetSysVal('ProjectStatus'); $original_project_id = $project->project_original_parent; $project->project_status = -1; $st_projects_arr = $project->getStructuredProjects(); $module = new w2p_System_Module(); $fields = $module->loadSettings('projects', 'subproject_list'); if (0 == count($fields)) { $fieldList = array('project_name', 'project_company', 'project_start_date', 'project_end_date', 'project_priority', 'project_status'); $fieldNames = array('Project', 'Company', 'Start', 'End', 'P', 'Status'); $module->storeSettings('projects', 'subproject_list', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $fieldList = array_keys($fields); $fieldNames = array_values($fields); $listTable = new w2p_Output_ListTable($AppUI); $listTable->addBefore('edit', 'project_id'); echo $listTable->startTable('list subprojects'); echo $listTable->buildHeader($fields); $s = ''; $customLookups = array('project_status' => $projectStatus, 'project_priority' => $projectPriority); if (is_array($st_projects_arr)) { foreach ($st_projects_arr as $project) { $line = $project[0]; $level = $project[1]; if ($line['project_id']) { $s_project = new CProject(); $s_project->load($line['project_id']); $row = get_object_vars($s_project); $row['company_id'] = $row['project_company']; $listTable->stageRowData($row);
} $orderby = $AppUI->getState('DeptProjIdxOrderBy') ? $AppUI->getState('DeptProjIdxOrderBy') : 'project_end_date'; $orderdir = $AppUI->getState('DeptProjIdxOrderDir') ? $AppUI->getState('DeptProjIdxOrderDir') : 'asc'; /* * TODO: This is a *nasty* *nasty* kludge that should be cleaned up. * Unfortunately due to the global variables from dotProject, we're stuck with * this mess for now. * * May God have mercy on our souls for the atrocity we're about to commit. */ $tmpDepartments = $department; $department = $dept_id; $project = new CProject(); $projects = projects_list_data($user_id); $department = $tmpDepartments; $items = $projects; $module = new w2p_System_Module(); $fields = $module->loadSettings('projects', 'department_view'); if (0 == count($fields)) { $fieldList = array('project_color_identifier', 'project_priority', 'project_name', 'company_name', 'project_start_date', 'project_duration', 'project_end_date', 'project_end_actual', 'task_log_problem', 'project_owner', 'project_task_count', 'project_status'); $fieldNames = array('Color', 'P', 'Project Name', 'Company', 'Start', 'Duration', 'End', 'Actual', 'LP', 'Owner', 'Tasks', 'Status'); $module->storeSettings('projects', 'department_view', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $pstatus = w2PgetSysVal('ProjectStatus'); $customLookups = array('project_status' => $pstatus); $listHelper = new w2p_Output_ListTable($AppUI); echo $listHelper->startTable(); echo $listHelper->buildHeader($fields, true, 'departments&a=view&dept_id=' . $dept_id); echo $listHelper->buildRows($items, $customLookups); echo $listHelper->endTable();
$fieldList = array('forum_project', 'forum_name', 'forum_description', 'forum_owner', 'forum_topics', 'forum_replies', 'forum_last_date'); $fieldNames = array('Project', 'Forum Name', 'Description', 'Owner', 'Topics', 'Replies', 'Last Post Info'); $module->storeSettings('forums', 'index_list', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } ?> <form name="watcher" action="./index.php?m=forums&f=<?php echo $f; ?> " method="post" accept-charset="utf-8"> <input type="hidden" name="dosql" value="do_watch_forum" /> <input type="hidden" name="watch" value="forum" /> <?php $listTable = new w2p_Output_ListTable($AppUI); $listTable->addBefore('watch', 'forum_id'); echo $listTable->startTable(); echo $listTable->buildHeader($fields, true, 'forums&f=' . $f); echo $listTable->buildRows($items); ?> <tr> <td colspan="<?php echo $listTable->cellCount; ?> "> <input type="submit" class="button" value="<?php echo $AppUI->_('update watches'); ?> " /> </td>
if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // @todo convert to template global $a, $addPwT, $AppUI, $buffer, $company_id, $department, $min_view, $m, $priority, $projects, $tab, $user_id, $orderdir, $orderby; if (isset($_GET['orderby'])) { $orderdir = $AppUI->getState('UsrProjIdxOrderDir') ? $AppUI->getState('UsrProjIdxOrderDir') == 'asc' ? 'desc' : 'asc' : 'desc'; $AppUI->setState('UsrProjIdxOrderBy', w2PgetParam($_GET, 'orderby', null)); $AppUI->setState('UsrProjIdxOrderDir', $orderdir); } $orderby = $AppUI->getState('UsrProjIdxOrderBy') ? $AppUI->getState('UsrProjIdxOrderBy') : 'project_end_date'; $orderdir = $AppUI->getState('UsrProjIdxOrderDir') ? $AppUI->getState('UsrProjIdxOrderDir') : 'asc'; $project = new CProject(); $projects = projects_list_data($user_id); $items = $projects; $module = new w2p_System_Module(); $fields = $module->loadSettings('projects', 'admin_view'); if (0 == count($fields)) { $fieldList = array('project_color_identifier', 'project_priority', 'project_name', 'company_name', 'project_start_date', 'project_duration', 'project_end_date', 'project_end_actual', 'task_log_problem', 'project_owner', 'project_task_count', 'project_status'); $fieldNames = array('Color', 'P', 'Project Name', 'Company', 'Start', 'Duration', 'End', 'Actual', 'LP', 'Owner', 'Tasks', 'Status'); $module->storeSettings('projects', 'admin_view', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $pstatus = w2PgetSysVal('ProjectStatus'); $customLookups = array('project_status' => $pstatus); $listHelper = new w2p_Output_ListTable($AppUI); echo $listHelper->startTable(); echo $listHelper->buildHeader($fields, true, 'admin&a=view&user_id=' . $user_id); echo $listHelper->buildRows($items, $customLookups); echo $listHelper->endTable();
$project_id = (int) w2PgetParam($_POST, 'project_id', 0); } $link = new CLink(); $items = $link->getProjectTaskLinksByCategory(null, $project_id, $task_id, $type_filter, $search_string); $module = new w2p_System_Module(); $fields = $module->loadSettings('links', 'index_list'); if (0 == count($fields)) { $fieldList = array('link_name', 'link_description', 'link_category', 'link_project', 'link_task', 'link_owner', 'link_date'); $fieldNames = array('Link Name', 'Description', 'Category', 'Project Task', 'Task Name', 'Owner', 'Date'); $module->storeSettings('links', 'index_list', $fieldList, $fieldNames); $fields = array_combine($fieldList, $fieldNames); } $xpg_pagesize = w2PgetConfig('page_size', 50); $xpg_min = $xpg_pagesize * ($page - 1); // This is where we start our record set from // counts total recs from selection $xpg_totalrecs = count($items); $items = array_slice($items, $xpg_min, $xpg_pagesize); $pageNav = buildPaginationNav($AppUI, $m, $tab, $xpg_totalrecs, $xpg_pagesize, $page); echo $pageNav; $link_types = w2PgetSysVal('LinkType'); $customLookups = array('link_category' => $link_types); $listTable = new w2p_Output_ListTable($AppUI); $listTable->df .= ' ' . $AppUI->getPref('TIMEFORMAT'); $listTable->addBefore('edit', 'link_id'); $listTable->addBefore('url', 'link_url'); echo $listTable->startTable(); echo $listTable->buildHeader($fields); echo $listTable->buildRows($items, $customLookups); echo $listTable->endTable(); echo $pageNav;
$fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // 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('contact_display_name', 'user_username', 'company_name', 'dept_name'); $fieldNames = array('Real Name', 'Login Name', 'Company', 'Department'); //TODO: This doesn't save the columns yet as we can't allow customization yet. } if ($display_last_login) { array_unshift($fieldList, ''); array_unshift($fieldNames, 'Login History'); } $fields = array_combine($fieldList, $fieldNames); $listTable = new w2p_Output_ListTable($AppUI); echo $listTable->startTable(); $listTable->addBefore(1); echo $listTable->buildHeader($fields, false, $m); $types = w2PgetSysVal('UserType'); $customLookups = array('user_type' => $types); $perms =& $AppUI->acl(); foreach ($users as $row) { if ($perms->isUserPermitted($row['user_id']) != $canLogin) { continue; } $listTable->stageRowData($row); ?> <tr> <td> <a href="./index.php?m=users&a=addedit&user_id=<?php