include('user_inc.htm'); $columnMap = array("s_location" => 1, "s_interfaceType" => 21); if ($_SERVER[REQUEST_METHOD] == "POST") { $sortCriteria->sortColumn = $columnMap[$_POST['orderOn']]; $sortCriteria->ascending =(($_POST['orderBy']=="ASC")?(1):(0)); $sortCriteria->filterPattern = $_POST['filterPattern']; $libraryGUID = $_POST['libraryGUID']; $mediaTypeCode = (int)$_POST['mediaTypeCode']; } else { $sortCriteria->sortColumn = $columnMap['s_location']; $sortCriteria->ascending = 1; $sortCriteria->filterPattern = "*"; $libraryGUID = $_GET['libraryGUID']; $mediaTypeCode = (int)$_GET['mediaTypeCode']; } // error_log(print_r($sortCriteria, true)); $drives = get_all_drives_by_library($user, $libraryGUID, $sortCriteria, (int)0,(int)MEDIA_TYPE_ANY); $cpdrives = get_command_path_drives($user, $libraryGUID); // error_log( "cpdrives = ". print_r($cpdrives, true) ); // error_log( "drives = ". print_r($drives, true) ); /*######################################################## # This is a temporary soloution to set which drives are # the control path drives. See convertDriveDetails in # the php extension library.cpp for the CMI call that # will eventully set this setting. But right now # controlPath is always fales. We are setting it to the # correct value in this code. #########################################################*/ error_log("Setting controlpath drives..............................................."); $i = 0; foreach ($drives as $drive) { foreach ($cpdrives as $cpdrive) { error_log("---------------------- $cpdrive == $drive->guid"); if( $cpdrive == $drive->guid ) { error_log("Drive $drive->guid is a control path drive!!!!!!!!!!!!!!!!!!!!!!!!!!" ); //NOTE: $drive is a copy of what's in $drives you must change the original not the copy $drives[$i]->controlPath = true; break; } else { error_log("Drive $drive->guid is NOT a control path drive......" ); //NOTE: $drive is a copy of what's in $drives you must change the original not the copy $drives[$i]->controlPath = false; } } $i++; } $l = print_r($drives, TRUE); // error_log( "drives = ". $l); $l = print_r($cpdrives, TRUE); // error_log( "cpdrives = " .$l); $numRows = count($drives); $numPages = ceil($numRows / ITEMS_PER_PAGE); $lowPageList = 1; $highPageList = min($numRows, ITEMS_PER_PAGE); // get the device Maps for Later check for mapped drives $devices = get_device_maps($user); error_log("\n\n\n* * * * * * * devices for Host($aHostId) = ". print_r($devices,true) ); ?>