expand; if(!isset($order)) $order = "name"; if(!isset($sortname)) $sortname = "ASC"; // Daphne change if(!isset($sortver)) $sortver = "ASC, minor_revision ASC"; if(!isset($sortcheckedout)) $sortcheckedout = "ASC"; // end daphne change if(!isset($sortfilename)) $sortfilename = "DESC"; if(!isset($sortsize)) $sortsize = "DESC"; if(!isset($sortposted)) $sortposted = "DESC"; if(!isset($sortmod)) $sortmod = "DESC"; if(!isset($sort)) $sort = "asc"; // Begin 496814 Column Sorts are not persistant switch ($order) { case "name": $sortorder = 'sortname'; $sort=$sortname; break; case "major_revision": $sortorder = 'sortver'; $sort=$sortver; break; case "filename" : $sortorder = 'sortfilename'; $sort=$sortfilename; break; case "size" : $sortorder = 'sortsize'; $sort=$sortsize; break; case "creatorid" : $sortorder = 'sortposted'; $sort=$sortposted; break; case "smodified" : $sortorder = 'sortmod'; $sort=$sortmod; break; case "checked_out": $sortorder = 'sortcheckedout'; $sort = $sortcheckedout; break; default: $sort="ASC"; break; } // END 496814 Column Sorts are not persistant if(check_auth($parent, "folder_view", $userid) != "1") { printError($lang_nofolderaccess,""); exit; } print("
| "); } print uid_to_name($userid); print (""); ?> $lang_logout");?> |
");
print("
");
print("
");
if($expand==1) {
print(" |
| " . gen_navbar($parent) . " |
| $lang_actions | "); // Daphne change - column for files checked out if ($default->owl_version_control == 1) { show_link("checked_out","sortcheckedout", $sortcheckedout, $order,$sess,$expand,$parent,$lang_held,$default->owl_root_url); } // end Daphne change } else { print("\t\t\t
|   |   |   |   | "); // begin Daphne change // extra colunm width for "version" column which folders don't need if ($default->owl_version_control == 1) { print("  | "); } // end Daphne change print("");
if(check_auth($sql->f("id"), "folder_delete", $userid) == 1)
print("\tf("name"),ENT_QUOTES)."?\");'> ");
if(check_auth($sql->f("id"), "folder_modify", $userid) == 1) {
print(" ");
print(" | ");
if ($default->owl_version_control == 1)
print ("  | "); print(""); // begin Daphne change // extra column width for "held" column which folders don't need if ($default->owl_version_control == 1) { if ($PrintLines == 0) print (" | "); else print (" | "); } // end Daphne change print(""); } } if ($default->owl_LookAtHD != "false") { $DBFolders[$DBFolderCount+1] = "[END]"; //end DBfolder array $RefreshPage = CompareDBnHD('folder', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFolders, $parent, $default->owl_folders_table); } //********************** // BEGIN Print Files //********************** $sql = new Owl_DB; //$sql->query("SELECT * from $default->owl_files_table where parent = '$parent' order by $order $sort"); if ($default->owl_version_control == 1) { //$sql->query("drop table tmp"); $sql->query("create temporary table tmp (name char(80) not null, parent int(4) not null, val double(4,2) not null)"); // POSTGRES? $sql->query("create temporary table tmp (name varchar(80) not null, parent int4 not null, val float not null);"); //$sql->query("lock tables files read"); $sql->query("insert into tmp select name, parent, max(major_revision+(minor_revision/10)) from files group by name,parent"); $sql->query("select files.* from files,tmp where files.name=tmp.name and major_revision+(minor_revision/10)=tmp.val AND tmp.parent=files.parent AND tmp.parent = '$parent' order by $order $sort"); } else { $sql->query("select * from $default->owl_files_table where parent = '$parent' order by $order $sort" ); } //Looping out files from DB! $DBFileCount = 0; while($sql->next_record()) { if($default->restrict_view == 1) { if(!check_auth($sql->f("id"), "file_download", $userid)) continue; } $CountLines++; $PrintLines = $CountLines % 2; if ($PrintLines == 0) print("\t\t\t\t | |||||||
| ");
$iconfiles = array("html","htm","gif","jpg","bmp","zip","tar","doc","mdb","xls","ppt","pdf","gz","mp3","tgz");
$choped = split("\.", $sql->f("filename"));
$pos = count($choped);
// BEGIN BUG FIX: #433548 Problem with uppercase fileextensions
$ext = strtolower($choped[$pos-1]);
// END BUG FIX: #433548 Problem with uppercase fileextensions
if ($sql->f("url") == "1")
print(" | ");
else
print($sql->f("name")."");
// Begin Daphne Change
// print version numbers if version control used
if ($default->owl_version_control == 1){
if($fileid == $sql->f("id"))
print("".$sql->f("major_revision").".".$sql->f("minor_revision")." | "); else print("".$sql->f("major_revision").".".$sql->f("minor_revision")." | "); } // end Daphne Change if ($sql->f("url") == "1") if($fileid == $sql->f("id")) print("".$sql->f("name")." | ".gen_filesize($sql->f("size"))." | "); else print("".$sql->f("name")." | ".gen_filesize($sql->f("size"))." | "); else if($fileid == $sql->f("id")) print("".$sql->f("filename")." | ".gen_filesize($sql->f("size"))." | "); else print("".$sql->f("filename")." | ".gen_filesize($sql->f("size"))." | "); $DBFileCount++; //count number of filez in db 2 use with array $DBFiles[$DBFileCount] = $sql->f("filename"); //create list if files in //print("".fid_to_creator($sql->f("id"))." | ".$sql->f("modified")." | "); else print("\t\t\t\t".fid_to_creator($sql->f("id"))." | ".$sql->f("modified")." | "); print("\t\t\t\t"); printFileIcons($sql->f("id"),$sql->f("filename"),$sql->f("checked_out"),$sql->f("url"),$default->owl_version_control,$ext); } // begin Daphne change // printing who has a document checked out if ($default->owl_version_control == 1) { if (($holder = uid_to_name($sql->f("checked_out"))) == "Owl") { print("\t | - | $holder | "); } } // end Daphne Change } if ($default->owl_version_control == 1) { //$sql->query("unlock tables"); $sql->query("drop table tmp"); } $DBFiles[$DBFileCount+1] = "[END]"; //end DBfile array print("