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; }
<?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();
<?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();
?> <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 if ($canAuthor) { ?> <input type="button" class="button right" value="<?php echo $AppUI->_('start a new topic');
} $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();