. */ include("./include/include.php"); include("./include/ListView.php"); if( isset($_GET['print']) AND isset($_SESSION['custview_column'][0]) ) { admin_header(true); }else { admin_header(); } if( !in_array("application_viewdetail", $_SESSION['sess_functions']) ) { echoln("You are not authorized to see this page."); }else { // Read available column, either from cache, or generate now if( isset($_SESSION['custview_options']) && is_array($_SESSION['custview_options']) ) { $options = $_SESSION['custview_options']; }else { $options = array(); for( $i=0; $i<2; $i++ ) { if( $i==0 ) $dir = dirname($_SERVER["SCRIPT_FILENAME"])."/include/PersonsFields/*.php"; else $dir = dirname($_SERVER["SCRIPT_FILENAME"])."/include/ApplFields/*.php"; if( is_dir(dirname($dir)) ) { foreach( glob($dir) as $file ) { if( is_file($file) ) { if( substr(basename($file, ".php"), 3)!="Separator" ) { include_once($file); $field = substr(basename($file, ".php"), 3); $classname = ( $i==0 ? "Persons" : "Appl" ) . $field; $classref = new $classname(0); if( $classref->get_access(false)!=Appl::ACCESS_NO ) { $options[ $field ] = $classref->get_print_name(); } } } } } } $_SESSION['custview_options'] = $options; // store for later use, speed things up a bit... } // Process input if( $_SERVER['REQUEST_METHOD']=="POST" ) { for( $c=0; $c<$setup['CustViewCols']; $c++ ) { if( isset($_POST['column_'.$c]) && (($_POST['column_'.$c]=="" && $c>0) || array_key_exists($_POST['column_'.$c], $options)) ) $_SESSION['custview_column'][$c] = $_POST['column_'.$c]; } } if( !isset($_GET['print']) ) { // Show column selection form echoln("
Note: columns that do not show in the overview are either not available yet for display, or you don't have access to them.
"); } // Show custom list if( isset($_SESSION['custview_column'][0]) ) { if( !isset($_GET['print']) ) echoln("0 ? $_SERVER["QUERY_STRING"]."&" : "" ) . "print\" target=\"_blank\">Printable list
"); $list = new ListView("Custom overview", $_SESSION['custview_column'][0], !isset($_GET['print']), "", true, (isset($_GET['print']) ? "print" : ""), 0, isset($_GET['print'])); for( $c=0; $c<$setup['CustViewCols']; $c++ ) { if( $_SESSION['custview_column'][$c]!="" ) { if( !$list->addField($_SESSION['custview_column'][$c]) ) { echoln("Cannot display '".$_SESSION['custview_column'][$c]."'. Either the column is not available for custom overview, or you don't have access to this field.
"); } } } $list->display(); } } if( isset($_GET['print']) AND isset($_SESSION['custview_column'][0]) ) { admin_footer(true); }else { admin_footer(); } ?>