Commit a0f52b4457bf2d1ea78e115bf218edd37b9ea9bc
1 parent
d260e321
Fixed Bug [KTE-44] [PT:2113572] - When clicking on the column heading for file s…
…ize in the Explorer middle pane the documents are not ordered according to file size.
Showing
2 changed files
with
10 additions
and
2 deletions
webservice/clienttools/serviceHelper.php
| ... | ... | @@ -70,6 +70,12 @@ class serviceHelper{ |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | return sprintf(($sys['prefix'][$i]=='B'?'%01d %s':$retstring), $size, $sys['prefix'][$i]); |
| 73 | - } | |
| 73 | + } | |
| 74 | + | |
| 75 | + function size_kb($size = NULL){ | |
| 76 | + $size=$size/1024; | |
| 77 | + $size=sprintf("%0.2f",$size).' KB'; | |
| 78 | + return $size; | |
| 79 | + } | |
| 74 | 80 | } |
| 75 | 81 | ?> |
| 76 | 82 | \ No newline at end of file | ... | ... |
webservice/clienttools/services/0.9/kt.php
| ... | ... | @@ -151,6 +151,7 @@ class kt extends client_service { |
| 151 | 151 | $methodToIncludeItem = '_processItemInclusion_' . $type; |
| 152 | 152 | |
| 153 | 153 | foreach ( $listing as $item ) { |
| 154 | + $item['filesize_bytes']=($item['filesize']+0); | |
| 154 | 155 | $this->logInfo('Listing Detail:',$item); |
| 155 | 156 | $this->addDebug('Listing Detail:',$item); |
| 156 | 157 | /* Trying to fix folder sizes */ |
| ... | ... | @@ -159,6 +160,7 @@ class kt extends client_service { |
| 159 | 160 | if($item['item_type']=='D')$item ['filesize'] =serviceHelper::size_readable ( 0 ); |
| 160 | 161 | } else { |
| 161 | 162 | $item ['filesize'] = serviceHelper::size_readable ( $item ['filesize'] ); |
| 163 | +// $item ['filesize'] = serviceHelper::size_kb ( $item ['filesize'] ); //To Fix Column Sort Issue | |
| 162 | 164 | } |
| 163 | 165 | |
| 164 | 166 | $filename = $item ['filename']; |
| ... | ... | @@ -271,7 +273,7 @@ class kt extends client_service { |
| 271 | 273 | $item ['filesize'] = - 1; |
| 272 | 274 | } |
| 273 | 275 | |
| 274 | - return array ('text' => htmlspecialchars ( $item ['title'] ), 'originaltext' => $item ['title'], 'id' => $item ['id'], 'filename' => $item ['filename'], 'cls' => $class, 'owner' => $item ['created_by'], 'document_type' => $item ['document_type'], 'item_type' => $item ['item_type'], 'permissions' => $item ['permissions'], 'created_date' => $item ['created_date'], 'content_id' => $item ['content_id'], 'filesize' => $item ['filesize'], 'modified' => $item ['modified_date'], 'checked_out_by' => $item ['checked_out_by'], 'version' => $item ['version'], 'is_immutable' => $item ['is_immutable'] ); | |
| 276 | + return array ('text' => htmlspecialchars ( $item ['title'] ), 'originaltext' => $item ['title'], 'id' => $item ['id'], 'filename' => $item ['filename'], 'cls' => $class, 'owner' => $item ['created_by'], 'document_type' => $item ['document_type'], 'item_type' => $item ['item_type'], 'permissions' => $item ['permissions'], 'created_date' => $item ['created_date'], 'content_id' => $item ['content_id'], 'filesize' => $item ['filesize'], 'filesize_bytes' => $item ['filesize_bytes'], 'modified' => $item ['modified_date'], 'checked_out_by' => $item ['checked_out_by'], 'version' => $item ['version'], 'is_immutable' => $item ['is_immutable'] ); | |
| 275 | 277 | } |
| 276 | 278 | |
| 277 | 279 | public function get_metadata($params) { | ... | ... |