<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $tab = $AppUI->processIntState('ProjIdxTab', $_GET, 'tab', 5); $project = new CProject(); $structprojs = $project->getProjects(); $search_string = w2PgetParam($_POST, 'search_string', ''); $AppUI->setState($m . '_search_string', $search_string); $search_string = w2PformSafe($search_string, true); $canCreate = $project->canCreate(); $company_id = w2PgetConfig('company_filter_default', 'user') == 'user' ? $AppUI->user_company : '-1'; $orderby = isset($_GET['orderby']) && property_exists('CProject', $_GET['orderby']) ? $_GET['orderby'] : 'project_name'; $project_type = $AppUI->processIntState('ProjIdxType', $_POST, 'project_type', -1); $owner = $AppUI->processIntState('ProjIdxowner', $_POST, 'project_owner', -1); $orderdir = $AppUI->getState('ProjIdxOrderDir') ? $AppUI->getState('ProjIdxOrderDir') : 'asc'; if (isset($_GET['orderby'])) { if ($AppUI->getState('ProjIdxOrderDir') == 'asc') { $orderdir = 'desc'; } else { $orderdir = 'asc'; } } $AppUI->setState('ProjIdxOrderDir', $orderdir); // collect the full projects list data via function in projects.class.php $search_text = $search_string; // @note this is only because the projects_list_data function takes a bunch of globals //$projects = projects_list_data(); $oCompany = new CCompany(); $allowedCompanies[-1] = $AppUI->_('all');