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();
$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); $s = '<tr>'; $s .= '<td><a href="./index.php?m=projects&a=addedit&project_id=' . $s_project->project_id . '"><img src="' . w2PfindImage('icons/' . ($project_id == $s_project->project_id ? 'pin' : 'pencil') . '.gif') . '" /></a></td>';
<?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 if ($canAuthor) { ?>
continue; } // @note this next line is a little hack so our templating can resolve which history_user is which user $item['user_id'] = $item['history_user']; $display[] = $item; } $items = $display; $module = new w2p_System_Module(); $fields = $module->loadSettings('history', 'index_list'); if (0 == count($fields)) { $fieldList = array('history_date', 'history_description', 'history_user'); $fieldNames = array('Date', 'Description', 'Owner'); $module->storeSettings('history', '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 $xpg_totalrecs = count($items); $items = array_slice($items, $xpg_min, $xpg_pagesize); $m .= '&filter=' . $filter_param; // This is a hack to get the pagination to work as expected $pageNav = buildPaginationNav($AppUI, $m, 0, $xpg_totalrecs, $xpg_pagesize, $page); $listTable = new w2p_Output_ListTable($AppUI); $listTable->df .= ' ' . $AppUI->getPref('TIMEFORMAT'); echo $pageNav; echo $listTable->startTable('tbl list history'); echo $listTable->buildHeader($fields); echo $listTable->buildRows($items); echo $listTable->endTable(); echo $pageNav;