Changeset 5059


Ignore:
Timestamp:
09/06/11 11:55:20 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #2263 - Corrigido total usado dentro do filemanager (não estava contabilizando corretamente)

Location:
branches/2.2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/inc/class.uifilemanager.inc.php

    r4915 r5059  
    337337                echo "<script src='" . $GLOBALS['phpgw_info']['flags']['currentapp'] . "/js/handler.js'></script>"; 
    338338                 
    339                 //echo "<script src='" . $GLOBALS['phpgw_info']['flags']['currentapp'] . "/js/NewHandler.js'></script>"; 
    340  
    341  
    342339                // Temas Expresso 
    343340                $theme = "window_" . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . ".css"; 
     
    529526        } 
    530527 
    531         function dir_ls() { 
     528        function dir_ls() 
     529        { 
    532530                // change dir to this->path 
    533531                $this->bo->vfs->cd(array('string' => $this->path, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    534532                $return['permissions'] = $this->get_permissions(); 
    535                 $return['quota']['usedSpace'] = $this->bo->vfs->get_size(array( 
     533                /*$return['quota']['usedSpace'] = $this->bo->vfs->get_size(array( 
    536534                                                'string' => $this->path, 
    537535                                                'relatives' => array(RELATIVE_NONE) 
    538                                   )); 
    539                 $return['files_count'] = $this->bo->vfs->count_files(array( 
    540                                                 'string' => $this->path, 
    541                                   )); 
    542                 $quota = $this->bo->vfs->get_quota(array( 
    543                                                 'string' => $this->path 
    544                                   )); 
     536                                  ));*/ 
     537                 
     538                $return['quota']['usedSpace'] = $this->bo->vfs->get_size_all( $GLOBALS['phpgw_info']['user']['account_id'] ); 
     539                $return['files_count'] = $this->bo->vfs->count_files(array( 'string' => $this->path )); 
     540                 
     541                $quota = $this->bo->vfs->get_quota(array('string' => $this->bo->homedir )); 
     542                 
    545543                reset($this->files_array); 
    546544                $this->readFilesInfo(); 
    547545 
    548                 for ($i = 0; $i != $this->numoffiles; $i++) { 
     546                for ($i = 0; $i != $this->numoffiles; $i++) 
     547                { 
    549548                        $files = $this->files_array[$i]; 
    550549 
     
    554553                        /* small keys to safe bandwidth */ 
    555554                        $tuple['name'] = htmlentities($files['name']); 
    556                         if ($_SESSION['phpgw_info']['user']['preferences']['filemanager']['viewIcons'] == 1) { 
     555                        if ($_SESSION['phpgw_info']['user']['preferences']['filemanager']['viewIcons'] == 1)  
     556                        { 
    557557                                if ($files['mime_type'] == 'image/png' || 
    558558                                                  $files['mime_type'] == 'image/gif' || 
    559                                                   $files['mime_type'] == 'image/jpg') { 
     559                                                  $files['mime_type'] == 'image/jpg') 
     560                                { 
    560561                                        $filename = str_replace('=', '', base64_encode($tuple['name'])); 
    561562                                        $pathname = str_replace('=', '', base64_encode($this->path)); 
     
    567568                        else 
    568569                                $tuple['icon'] = $this->mime_icon($files['mime_type']); 
    569                         $tuple['type'] = $files['type']; 
    570                         $tuple['created'] = $this->vfs_functions->dateString2timeStamp($files['created']); 
    571                         $tuple['modified'] = $this->vfs_functions->dateString2timeStamp($files['modified']); 
    572                         $tuple['size'] = $files['size']; 
    573                         $tuple['mime_type'] = $files['mime_type']; 
    574                         $tuple['pub'] = $files['type']; 
    575                         $tuple['createdby_id'] = $GLOBALS['phpgw']->accounts->id2name($files['createdby_id']); 
     570 
     571                        $tuple['type']                  = $files['type']; 
     572                        $tuple['created']               = $this->vfs_functions->dateString2timeStamp($files['created']); 
     573                        $tuple['modified']              = ( $files['modified'] != "" ) ? $this->vfs_functions->dateString2timeStamp($files['modified']) : ""; 
     574                        $tuple['size']                  = $files['size']; 
     575                        $tuple['mime_type']             = $files['mime_type']; 
     576                        $tuple['pub']                   = $files['type']; 
     577                        $tuple['createdby_id']  = $GLOBALS['phpgw']->accounts->id2name($files['createdby_id']); 
    576578                        $tuple['modifiedby_id'] = $files['modifiedby_id'] ? $GLOBALS['phpgw']->accounts->id2name($files['modifiedby_id']) : ''; 
    577                         $tuple['owner'] = $GLOBALS['phpgw']->accounts->id2name($files['owner_id']); 
    578                         $tuple['comment'] = $files['comment']; 
    579                         $tuple['version'] = $files['version']; 
     579                        $tuple['owner']                 = $GLOBALS['phpgw']->accounts->id2name($files['owner_id']); 
     580                        $tuple['comment']               = $files['comment']; 
     581                        $tuple['version']               = $files['version']; 
     582                         
    580583                        $output[] = $tuple; 
    581584                } 
    582585                $return['files'] = $output; 
    583586                $return['quota']['quotaSize'] = ($quota * 1024 * 1024); 
    584                 //echo serialize(htmlspecialchars_decode(htmlentities($return))); 
    585587                echo serialize($return); 
    586588        } 
     
    10101012                                { 
    10111013                                        $historyFile[] = array( 
    1012                                                                                         "created"       => $journal_entry['created'], 
     1014                                                                                        "created"       => $this->vfs_functions->dateString2timeStamp($journal_entry['created']), 
    10131015                                                                                        "version"       => $journal_entry['version'], 
    10141016                                                                                        "who"           => $GLOBALS['phpgw']->accounts->id2name($journal_entry['owner_id']), 
  • branches/2.2/filemanager/inc/class.vfs_functions.inc.php

    r3924 r5059  
    134134                } 
    135135                 
     136                function convertDateForm($pDate) 
     137                { 
     138                        /** 
     139                         * Recebe a data no formato      : aaaa-mm-dd 
     140                         * Retorna a data no formato : dd/mm/aaaa 
     141                         **/ 
     142                 
     143                        $cDate = date_parse($pDate); 
     144                        $day   = ( strlen($cDate['day']) > 1 ) ? $cDate['day'] : "0".$cDate['day']; 
     145                        $month = ( strlen($cDate['month']) > 1 ) ? $cDate['month'] : "0".$cDate['month']; 
     146                        $year  = $cDate['year']; 
     147                 
     148                        return $day."/".$month."/".$year; 
     149                } 
     150                 
    136151                // String format is YYYY-MM-DD HH:MM 
    137152                function dateString2timeStamp($string) 
    138153                { 
    139                         return mktime($string[11].$string[12], 
    140                                 $string[14].$string[15], 
    141                                 $string[17].$string[18],  
    142                                 $string[5].$string[6],  
    143                                 $string[8].$string[9], 
    144                                 $string[0].$string[1]. 
    145                                 $string[2].$string[3]); 
     154                        /** 
     155                         * Recebe a data no formato      : aaaa-mm-dd 
     156                         * Retorna a data no formato : dd/mm/aaaa 
     157                         **/ 
     158                 
     159                        $cDate = date_parse($string); 
     160                        $day   = ( strlen($cDate['day']) > 1 ) ? $cDate['day'] : "0".$cDate['day']; 
     161                        $month = ( strlen($cDate['month']) > 1 ) ? $cDate['month'] : "0".$cDate['month']; 
     162                        $year  = $cDate['year']; 
     163                 
     164                        return $day."/".$month."/".$year; 
    146165                } 
    147166                 
  • branches/2.2/filemanager/tp/expressowindow/xsl/historyFile.xsl

    r3885 r5059  
    1414        <xsl:template match="file"> 
    1515                 
    16                 <div style="font-size:10pt; margin: 6px;"> 
     16                <div style="font-size:10pt; margin: 10px 6px 10px 6px; border-bottom:1px solid #000;"> 
    1717                        <img src="{$path_filemanager}templates/default/images/button_info.png" style="margin-right: 5px;"/> 
    1818                        <label style="font-size:12px;font-weight:bold;"> <xsl:value-of select="$lang_history" /></label> 
    1919                </div> 
    2020                 
    21                 <div style='margin:6px; width:{($width)-20}px ; height:{($height)-40}px; overflow-y: auto; text-align: left;'> 
     21                <div style='margin:6px; width:{($width)-20}px ; height:{($height)-80}px; overflow-y: auto; text-align: left;'> 
    2222                        <xsl:for-each select="info"> 
    2323                                <div style="margin-bottom:10px;"> 
  • branches/2.2/phpgwapi/inc/class.vfs_shared.inc.php

    r2 r5059  
    419419 
    420420                /*! 
     421                * @function get_size_all 
     422                * @abstract Determine size of location 
     423                * @owner_id string      uid owner 
     424                */ 
     425                 
     426                function get_size_all($owner_id) { return 0; } 
     427                 
     428                /*! 
    421429                 * @function get_size 
    422430                 * @abstract Determine size of location 
  • branches/2.2/phpgwapi/inc/class.vfs_sql.inc.php

    r3743 r5059  
    25122512                        return $size; 
    25132513                } 
     2514                 
     2515                function get_size_all($owner_id) 
     2516                { 
     2517                        $query = $GLOBALS['phpgw']->db->query ("SELECT Sum(size) FROM phpgw_vfs WHERE owner_id = '".$owner_id."'" . 
     2518                                                                                                        $this->extra_sql(array ('query_text' => VFS_SQL_SELECT))); 
     2519                        $GLOBALS['phpgw']->db->next_record (); 
     2520                         
     2521                        $size = $GLOBALS['phpgw']->db->Record[0];                        
     2522                         
     2523                        return $size; 
     2524                }                
    25142525 
    25152526                /*return the total number of files in path*/ 
Note: See TracChangeset for help on using the changeset viewer.