isError()) { exit_error($ptf->getErrorMessage(),'pm'); } $_order = getStringFromRequest('_order'); $set = getStringFromRequest('set'); $_assigned_to = getIntFromRequest('_assigned_to'); $_status = getStringFromRequest('_status'); $_category_id = getIntFromRequest('_category_id'); $_view = getStringFromRequest('_view'); $paging = 0; if (session_loggedin()) { $u = UserManager::instance()->getCurrentUser(); if (getStringFromRequest('setpaging')) { /* store paging preferences */ $paging = getIntFromRequest('nres'); if (!$paging) { $paging = 25; } $u->setPreference("paging", $paging); } else $paging = $u->getPreference("paging"); } if (!$paging) { $paging = 25; } $ptf->setup($offset,$_order,$paging,$set,$_assigned_to,$_status,$_category_id,$_view); if ($ptf->isError()) { exit_error($ptf->getErrorMessage(),'pm'); } $pt_arr =& $ptf->getTasks(true); if ($ptf->isError()) { exit_error($ptf->getErrorMessage(),'pm'); } $_assigned_to=$ptf->assigned_to; $_status=$ptf->status; $_order=$ptf->order; $_category_id=$ptf->category; $_view=$ptf->view_type; html_use_coolfieldset(); pm_header(array('title'=>_('Browse tasks'),'group_project_id'=>$group_project_id)); /* creating a custom technician box which includes "any" and "unassigned" */ $engine = RBACEngine::getInstance () ; $techs = $engine->getUsersByAllowedAction ('pm', $pg->getID(), 'tech') ; $tech_id_arr = array () ; $tech_name_arr = array () ; foreach ($techs as $tech) { $tech_id_arr[] = $tech->getID() ; $tech_name_arr[] = $tech->getRealName() ; } $tech_id_arr[]='0'; $tech_name_arr[]=_('Any'); $tech_box=html_build_select_box_from_arrays ($tech_id_arr,$tech_name_arr,'_assigned_to',$_assigned_to,true,_('Unassigned')); /* creating a custom category box which includes "any" and "none" */ $res_cat=$pg->getCategories(); $cat_id_arr=util_result_column_to_array($res_cat,0); $cat_id_arr[]='0'; //this will be the 'any' row $cat_name_arr=util_result_column_to_array($res_cat,1); $cat_name_arr[]=_('Any'); $cat_box=html_build_select_box_from_arrays ($cat_id_arr,$cat_name_arr,'_category_id',$_category_id,true,'none'); /* Creating a custom sort box */ $order_title_arr=array(); $order_title_arr[]=_('Task Id'); $order_title_arr[]=_('Task Summary'); $order_title_arr[]=_('Start Date'); $order_title_arr[]=_('End Date'); $order_title_arr[]=_('Percent Complete'); $order_title_arr[]=_('Priority'); $order_col_arr=array(); $order_col_arr[]='project_task_id'; $order_col_arr[]='summary'; $order_col_arr[]='start_date'; $order_col_arr[]='end_date'; $order_col_arr[]='percent_complete'; $order_col_arr[]='priority'; $order_box=html_build_select_box_from_arrays ($order_col_arr,$order_title_arr,'_order',$_order,false); /* Creating View array */ $view_arr=array(); $view_arr[]=_('Summary'); $view_arr[]=_('Detailed'); $order_col_arr=array(); $view_col_arr[]='summary'; $view_col_arr[]='detail'; $view_box=html_build_select_box_from_arrays ($view_col_arr,$view_arr,'_view',$_view,false); /* Show the new pop-up boxes to select assigned to and/or status */ echo '
'; $rows=count($pt_arr); if ($rows < 1) { echo ''._('No Matching Tasks found').'