if ($canEdit) { $titleBlock = new CTitleBlock('', '', $m, "{$m}.{$a}"); $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new link') . '">', '', '<form action="?m=links&a=addedit&project_id=' . $project_id . '&task_id=' . $task_id . '" method="post" accept-charset="utf-8">', '</form>'); $titleBlock->show(); } $page = (int) w2PgetParam($_GET, 'page', 1); $search = w2PgetParam($_POST, 'search', ''); if (!isset($project_id)) { $project_id = (int) w2PgetParam($_POST, 'project_id', 0); } $df = $AppUI->getPref('SHDATEFORMAT'); $tf = $AppUI->getPref('TIMEFORMAT'); $link_types = w2PgetSysVal('LinkType'); if ($canRead) { $link = new CLink(); $links = $link->getProjectTaskLinksByCategory($AppUI, $project_id, $task_id, $tab - 1, $search); } else { $AppUI->redirect('m=public&a=access_denied'); } $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($links); echo buildPaginationNav($AppUI, $m, $tab, $xpg_totalrecs, $xpg_pagesize, $page); ?> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"> <tr> <th nowrap="nowrap"> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Link Name');
die('You should not access this file directly.'); } // @todo convert to template global $AppUI, $project_id, $task_id, $showProject, $tab, $search_string, $m; $type_filter = $m == 'links' ? $tab - 1 : -1; if ($task_id && !$project_id) { $task = new CTask(); $task->load($task_id); $project_id = $task->task_project; } $page = (int) w2PgetParam($_GET, 'page', 1); if (!isset($project_id)) { $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);