$cols = participant__get_possible_participant_columns($list); } elseif ($list == 'result_table_search_unconfirmed') { $header = lang('columns_in_search_results_table_for_unconfirmed_profiles'); $cols = participant__get_possible_participant_columns($list); } elseif ($list == 'experiment_assigned_list') { $header = lang('columns_in_list_of_assigned_participants'); $cols = participant__get_possible_participant_columns($list); } elseif ($list == 'session_participants_list') { $header = lang('columns_in_session_participants_list'); $cols = participant__get_possible_participant_columns($list); } elseif ($list == 'session_participants_list_pdf') { $header = lang('columns_in_pdf_session_participants_list'); $cols = participant__get_possible_participant_columns($list); } elseif ($list == 'email_participant_guesses_list') { $header = lang('email_module_participant_guesses_list'); $cols = participant__get_possible_participant_columns($list); } if (!isset($cols)) { redirect('admin/options_participant_profile.php'); } } if ($proceed) { if (isset($_REQUEST['save_order']) && $_REQUEST['save_order']) { if (isset($_REQUEST['item_order']) && is_array($_REQUEST['item_order']) && count($_REQUEST['item_order']) > 0) { if (isset($_REQUEST['sortby']) && $_REQUEST['sortby']) { $details = array(trim($_REQUEST['sortby']) => array('default_sortby' => 1)); } else { $details = array(); } $done = options__save_item_order($list, $_REQUEST['item_order'], $details); message(lang('changes_saved'));
function participant__get_result_table_columns($list) { // $list can be: result_table_search_active, result_table_search_all, // result_table_assign, result_table_search_duplicates, session_list,session_list_pdf global $preloaded_result_table_columns; if (isset($preloaded_result_table_columns[$list]) && is_array($preloaded_result_table_columns[$list])) { return $preloaded_result_table_columns[$list]; } else { $allcols = participant__get_possible_participant_columns($list); $pars = array(':item_type' => $list); $query = "SELECT *\n FROM " . table('objects') . "\n WHERE item_type= :item_type\n ORDER BY order_number"; $result = or_query($query, $pars); $saved_cols = array(); while ($line = pdo_fetch_assoc($result)) { $saved_cols[$line['item_name']] = $line; } $listcols = options__ordered_lists_get_current($allcols, $saved_cols); foreach ($listcols as $k => $arr) { if (!isset($arr['on_list']) || !$arr['on_list']) { unset($listcols[$k]); } } $preloaded_result_table_columns[$list] = $listcols; return $listcols; } }