Changeset 3885


Ignore:
Timestamp:
03/21/11 17:46:35 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1657 - Correcao de layout para exibicao do historico do arquivo

Location:
branches/2.2/filemanager
Files:
1 added
3 edited

Legend:

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

    r3879 r3885  
    930930        } 
    931931 
    932         function history() { 
    933                 if ($this->file) { // FIXME this-file is never defined 
     932        function history()  
     933        { 
     934                if ( $this->file) 
     935                {  
     936                        // FIXME this-file is never defined 
    934937                        $journal_array = $this->bo->vfs->get_journal(array( 
    935938                                                        'string' => $this->file, //FIXME 
    936939                                                        'relatives' => array(RELATIVE_ALL) 
    937                                           )); 
    938  
    939                         if (is_array($journal_array)) { 
    940                                 $this->html_table_begin(); 
    941                                 $this->html_table_row_begin(); 
    942                                 $this->html_table_col_begin(); 
    943                                 echo lang('Date'); 
    944                                 $this->html_table_col_end(); 
    945                                 $this->html_table_col_begin(); 
    946                                 echo lang('Version'); 
    947                                 $this->html_table_col_end(); 
    948                                 $this->html_table_col_begin(); 
    949                                 echo lang('Who'); 
    950                                 $this->html_table_col_end(); 
    951                                 $this->html_table_col_begin(); 
    952                                 echo lang('Operation'); 
    953                                 $this->html_table_col_end(); 
    954                                 $this->html_table_row_end(); 
    955  
    956                                 while (list($num, $journal_entry) = each($journal_array)) { 
    957                                         $this->html_table_row_begin(); 
    958                                         $this->html_table_col_begin(); 
    959                                         $this->bo->html_text($journal_entry['created'] . '   '); 
    960                                         $this->html_table_col_end(); 
    961                                         $this->html_table_col_begin(); 
    962                                         $this->bo->html_text($journal_entry['version'] . '   '); 
    963                                         $this->html_table_col_end(); 
    964                                         $this->html_table_col_begin(); 
    965                                         $this->bo->html_text($GLOBALS['phpgw']->accounts->id2name($journal_entry['owner_id']) . '   '); 
    966                                         $this->html_table_col_end(); 
    967                                         $this->html_table_col_begin(); 
    968                                         $this->bo->html_text($journal_entry['comment']); 
    969                                         $this->html_table_col_end(); 
     940                 
     941                         )); 
     942 
     943                        if ( is_array($journal_array) )  
     944                        { 
     945                                $historyFile = array(); 
     946 
     947                                while ( list($num, $journal_entry) = each($journal_array) )  
     948                                { 
     949                                        $historyFile[] = array( 
     950                                                                                        "created"       => $journal_entry['created'], 
     951                                                                                        "version"       => $journal_entry['version'], 
     952                                                                                        "who"           => $GLOBALS['phpgw']->accounts->id2name($journal_entry['owner_id']), 
     953                                                                                        "operation"     =>      $journal_entry['comment'] 
     954                                        ); 
    970955                                } 
    971  
    972                                 $this->html_table_end(); 
     956                                 
     957                        echo serialize( $historyFile ); 
    973958                                $GLOBALS['phpgw']->common->phpgw_footer(); 
    974959                                $GLOBALS['phpgw']->common->phpgw_exit(); 
    975                         } else { 
     960                        }  
     961                        else 
     962                        { 
    976963                                echo lang('No version history for this file/directory'); 
    977964                        } 
  • branches/2.2/filemanager/js/draw_api.js

    r3879 r3885  
    1515} 
    1616 
    17 function loadHistory(filename){ 
    18         cExecute_('./index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window); 
     17function loadHistory(filename) 
     18{ 
     19        var handlerLoadHistory = function(data) 
     20        { 
     21                loadXtools(); 
     22 
     23                var response =  unserialize(data); 
     24                var _xml                = Xtools.xml('file'); 
     25                var _historyFile        = _xml.documentElement;  
     26 
     27                for( var i = 0; i < response.length; i++ ) 
     28                { 
     29                        var _info = _historyFile.appendChild(  _xml.createElement("info") ); 
     30                         
     31                        var     _created = _xml.createElement('created');  
     32                                _created.appendChild( _xml.createTextNode(response[i]['created']) ); 
     33                                _info.appendChild( _created ); 
     34                         
     35                        var     _version = _xml.createElement('version'); 
     36                                _version.appendChild( _xml.createTextNode(response[i]['version']) ); 
     37                                _info.appendChild(_version); 
     38                         
     39                        var     _who = _xml.createElement('who'); 
     40                                _who.appendChild( _xml.createTextNode(response[i]['who']) ); 
     41                                _info.appendChild( _who ); 
     42                         
     43                        var _operation  = _xml.createElement('operation'); 
     44                                _operation.appendChild( _xml.createTextNode( response[i]['operation']) ); 
     45                                _info.appendChild( _operation ); 
     46                } 
     47 
     48                var pArgs =  
     49                { 
     50                        'lang_created'  : get_lang("Created"), 
     51                        'lang_operation'        : get_lang("Operation"), 
     52                        'lang_version'  : get_lang("Version"), 
     53                        'lang_who'              : get_lang("Who"), 
     54                        'lang_history'  : get_lang("File history"), 
     55                        'height'                                : 300, 
     56                        'path_filemanager'      : path_filemanager, 
     57                        'width'                         : 450                    
     58                }; 
     59                 
     60                var code = Xtools.parse( _historyFile, "historyFile.xsl", pArgs ); 
     61                 
     62                draw_window( code , 450, 300 ); 
     63        }; 
     64         
     65        cExecute_('./index.php?menuaction=filemanager.uifilemanager.history&file=' 
     66                                + base64_encode(filename)+"&path="+base64_encode(currentPath), handlerLoadHistory ); 
    1967} 
    2068 
  • branches/2.2/filemanager/setup/phpgw_pt-br.lang

    r3879 r3885  
    9191files   filemanager     pt-br   Arquivos 
    9292File(s) filemanager     pt-br   Arquivo(s) 
     93File history    filemanager     pt-br   Histórico do arquivo 
    9394files in this directory filemanager     pt-br   Arquivos nesse diretório 
    9495folder  filemanager     pt-br   Pasta 
Note: See TracChangeset for help on using the changeset viewer.