Commit e31d0eb94b06f2a7de91c5b95b2ec8afb5e4e543

Authored by michael
1 parent 103c3f6c

updated sql keyword case


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1225 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DocumentBrowser.inc
@@ -71,7 +71,7 @@ class DocumentBrowser { @@ -71,7 +71,7 @@ class DocumentBrowser {
71 71
72 // now find all the child folders relative to this one 72 // now find all the child folders relative to this one
73 // FIXME: in the same unit? 73 // FIXME: in the same unit?
74 - $folderQuery = "SELECT id from $default->owl_folders_table WHERE parent_id=" . $folderID . " ORDER BY name ASC"; 74 + $folderQuery = "SELECT id FROM $default->owl_folders_table WHERE parent_id=" . $folderID . " ORDER BY name ASC";
75 $default->log->debug("DocumentBrowser::browseByFolder child folder query=$folderQuery"); 75 $default->log->debug("DocumentBrowser::browseByFolder child folder query=$folderQuery");
76 if ($sql->query($folderQuery)) { 76 if ($sql->query($folderQuery)) {
77 while ($sql->next_record()) { 77 while ($sql->next_record()) {
@@ -128,7 +128,7 @@ class DocumentBrowser { @@ -128,7 +128,7 @@ class DocumentBrowser {
128 $results["categories"][] = "Categories"; 128 $results["categories"][] = "Categories";
129 129
130 // get a list of category values 130 // get a list of category values
131 - $query = "select distinct value from $default->owl_document_fields_table where document_field_id=$categoryFieldID ORDER BY value ASC"; 131 + $query = "SELECT DISTINCT value FROM $default->owl_document_fields_table WHERE document_field_id=$categoryFieldID ORDER BY value ASC";
132 $default->log->debug("DocumentBrowser::browseByCategory category listing query=$query"); 132 $default->log->debug("DocumentBrowser::browseByCategory category listing query=$query");
133 $sql->query($query); 133 $sql->query($query);
134 // loop through resultset, build array and return 134 // loop through resultset, build array and return
@@ -144,8 +144,8 @@ class DocumentBrowser { @@ -144,8 +144,8 @@ class DocumentBrowser {
144 // we have a category to use, so find all the documents 144 // we have a category to use, so find all the documents
145 // with this category value 145 // with this category value
146 146
147 - $query = "select document_id from $default->owl_document_fields_table where document_field_id = $categoryFieldID " .  
148 - "and value='$category' ORDER BY value ASC"; 147 + $query = "SELECT document_id FROM $default->owl_document_fields_table WHERE document_field_id = $categoryFieldID " .
  148 + "AND value='$category' ORDER BY value ASC";
149 $default->log->debug("DocumentBrowser::browseByCategory documents in category query=$query"); 149 $default->log->debug("DocumentBrowser::browseByCategory documents in category query=$query");
150 $sql->query($query); 150 $sql->query($query);
151 // loop through resultset and add to array 151 // loop through resultset and add to array
@@ -180,7 +180,7 @@ class DocumentBrowser { @@ -180,7 +180,7 @@ class DocumentBrowser {
180 $results["documentTypes"][] = array("name" => "Document Types"); 180 $results["documentTypes"][] = array("name" => "Document Types");
181 181
182 // return a list of document types 182 // return a list of document types
183 - $query = "select * from $default->owl_document_types_table"; 183 + $query = "SELECT * FRMO $default->owl_document_types_table";
184 $sql->query($query); 184 $sql->query($query);
185 while ($sql->next_record()) { 185 while ($sql->next_record()) {
186 $results["documentTypes"][] = array ("id" => $sql->f("id"), "name" => $sql->f("name")); 186 $results["documentTypes"][] = array ("id" => $sql->f("id"), "name" => $sql->f("name"));
@@ -261,13 +261,6 @@ class DocumentBrowser { @@ -261,13 +261,6 @@ class DocumentBrowser {
261 $folderID = $folderSql->f("id"); 261 $folderID = $folderSql->f("id");
262 262
263 // set folder attributes 263 // set folder attributes
264 - /*  
265 - $folders[$folderName] = array("id" => $folderID,  
266 - "description" => $folderSql->f("description"),  
267 - "parent_id" => $folderSql->f("parent_id"),  
268 - "creator_id" => $folderSql->f("creator_id"),  
269 - "unit_id" => $folderSql->f("unit_id"),  
270 - "is_public" => $folderSql->f("is_public"));*/  
271 $folders[$folderName] = & new Folder($folderName, $folderSql->f("description"), $folderSql->f("parent_id"), 264 $folders[$folderName] = & new Folder($folderName, $folderSql->f("description"), $folderSql->f("parent_id"),
272 $folderSql->f("creator_id"), $folderSql->f("unit_id"), 265 $folderSql->f("creator_id"), $folderSql->f("unit_id"),
273 $folderSql->f("is_public")); 266 $folderSql->f("is_public"));
@@ -298,24 +291,11 @@ class DocumentBrowser { @@ -298,24 +291,11 @@ class DocumentBrowser {
298 $default->log->debug("DocumentBrowser::lookupDocumentDetails documentIDStr=$documentIDStr; documentIDs=" . arrayToString($documentIDs)); 291 $default->log->debug("DocumentBrowser::lookupDocumentDetails documentIDStr=$documentIDStr; documentIDs=" . arrayToString($documentIDs));
299 292
300 // create query to retrieve the details of the specified documents 293 // create query to retrieve the details of the specified documents
301 - $documentQuery = "select * from $default->owl_documents_table where id in ($documentIDStr)"; 294 + $documentQuery = "SELECT * FROM $default->owl_documents_table WHERE id in ($documentIDStr)";
302 if ($sql->query($documentQuery)) { 295 if ($sql->query($documentQuery)) {
303 // TODO: check return status of query and die appropriately 296 // TODO: check return status of query and die appropriately
304 while ($sql->next_record()) { 297 while ($sql->next_record()) {
305 // set attributes 298 // set attributes
306 - /*$documents[$sql->f("name")] = array("id" => $sql->f("id"),  
307 - "document_type_id" => $sql->f("id"),  
308 - "name" => $sql->f("name"),  
309 - "filename" => $sql->f("filename"),  
310 - "size" => $sql->f("size"),  
311 - "creator_id" => $sql->f("creator_id"),  
312 - "modified" => $sql->f("modified"),  
313 - "description" => $sql->f("description"),  
314 - "mime_id" => $sql->f("mime_id"),  
315 - "folder_id" => $sql->f("folder_id"),  
316 - "major_version" => $sql->f("major_version"),  
317 - "minor_version" => $sql->f("minor_version"),  
318 - "is_checked_out" => $sql->f("is_checked_out"));*/  
319 $documents[$sql->f("name")] &= Document::get($sql->f("id")); 299 $documents[$sql->f("name")] &= Document::get($sql->f("id"));
320 } 300 }
321 } else { 301 } else {