Show
Ignore:
Timestamp:
02/19/08 03:16:04 (22 months ago)
Author:
takayama
Message:

Fixed BugId:67669
* Fixed a performance issue.

  • Changed to dialog based author selection instead of combo box.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-30/lib/MT/CMS/Entry.pm

    r1369 r1378  
    19361936    my ( $date_format, $datetime_format ); 
    19371937 
    1938     ## Load list of users for display in filter pulldown (and selection 
    1939     ## pulldown on power edit page). 
    1940     my ( @a_data, %authors ); 
    19411938    if ($is_power_edit) { 
    1942  
    1943         # FIXME: Scaling issue for lots of authors on one blog 
    1944         my $auth_iter = MT::Author->load_iter( 
    1945             { type => MT::Author::AUTHOR() }, 
    1946             { 
    1947                 'join' => MT::Permission->join_on( 
    1948                     'author_id', { blog_id => $blog_id } 
    1949                 ), 
    1950                 limit => 51, 
    1951             } 
    1952         ); 
    1953         while ( my $author = $auth_iter->() ) { 
    1954             $authors{ $author->id } = $author->name; 
    1955             push @a_data, 
    1956               { 
    1957                 author_id   => $author->id, 
    1958                 author_name => encode_js( $author->name ) 
    1959               }; 
    1960         } 
    1961         @a_data = sort { $a->{author_name} cmp $b->{author_name} } @a_data; 
    1962         my $i = 0; 
    1963         for my $row (@a_data) { 
    1964             $row->{author_index} = $i++; 
    1965         } 
    1966         $param->{author_loop} = \@a_data; 
    19671939        $date_format          = "%Y.%m.%d"; 
    19681940        $datetime_format      = "%Y-%m-%d %H:%M:%S"; 
     
    19731945    } 
    19741946 
    1975     my ( @cat_list, @auth_list ); 
     1947    my @cat_list; 
    19761948    if ($is_power_edit) { 
    19771949        @cat_list = 
    19781950          sort { $cats{$a}->{category_index} <=> $cats{$b}->{category_index} } 
    19791951          keys %cats; 
    1980         @auth_list = sort { $authors{$a} cmp $authors{$b} } keys %authors; 
    19811952    } 
    19821953 
     
    20802051            $row->{row_category_loop} = \@this_c_data; 
    20812052 
    2082             my @this_a_data; 
    2083             my $this_author_id = $obj->author_id; 
    2084             for my $a_id (@auth_list) { 
    2085                 push @this_a_data, 
    2086                   { 
    2087                     author_name => $authors{$a_id}, 
    2088                     author_id   => $a_id 
    2089                   }; 
    2090                 $this_a_data[-1]{author_is_selected} = $this_author_id 
    2091                   && $this_author_id == $a_id ? 1 : 0; 
    2092             } 
    2093             unless ( $obj->author ) { 
    2094                 push @this_a_data, 
    2095                   { 
    2096                     author_name => $app->translate( 
    2097                         '(user deleted - ID:[_1])', 
    2098                         $obj->author_id 
    2099                     ), 
    2100                     author_id          => $obj->author_id, 
    2101                     author_is_selected => 1, 
    2102                   }; 
    2103             } 
    2104             $row->{row_author_loop} = \@this_a_data; 
     2053            if ( $obj->author ) { 
     2054                $row->{row_author_name} = $obj->author->name; 
     2055                $row->{row_author_id}   = $obj->author->id; 
     2056            } else { 
     2057                $row->{row_author_name} = $app->translate( 
     2058                    '(user deleted - ID:[_1])', 
     2059                    $obj->author_id 
     2060                ); 
     2061                $row->{row_author_id} = $obj->author_id, 
     2062             } 
    21052063        } 
    21062064        if ( my $blog = $blogs{ $obj->blog_id } ||=