User: sits    
  Date: 07/08/17 21:14:37

  Modified:    lib/Codestriker/Model MetricStats.pm Metrics.pm
  Log:
  CHANGELOG
  
  
  
  Index: MetricStats.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Model/MetricStats.pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MetricStats.pm    21 Jun 2006 06:00:52 -0000      1.12
  +++ MetricStats.pm    18 Aug 2007 04:14:37 -0000      1.13
  @@ -39,7 +39,7 @@
   
       # Get the list of authors.
       my $author_list = $dbh->selectall_arrayref(
  -         'SELECT author,MAX(modified_ts),COUNT(id)
  +         'SELECT LOWER(author),MAX(modified_ts),COUNT(id)
             FROM topic 
             WHERE modified_ts >= ?
             GROUP BY author
  @@ -67,15 +67,15 @@
       # Get the list of participants from all these topics. You need to 
       # submit at least one comment to be counted.
       my $participant_list = $dbh->selectall_arrayref(
  -         'SELECT commentdata.author, 
  +         'SELECT LOWER(commentdata.author), 
                    MAX(topic.modified_ts), 
                    COUNT(DISTINCT topic.id)
             FROM commentdata, commentstate, topic 
             WHERE topic.modified_ts >= ? AND 
                   topic.id = commentstate.topicid AND 
  -                topic.author <> commentdata.author AND
  +                LOWER(topic.author) <> LOWER(commentdata.author) AND
                   commentdata.commentstateid = commentstate.id
  -          GROUP BY commentdata.author
  +          GROUP BY LOWER(commentdata.author)
             ORDER BY 2 desc',{}, $date);
        
       foreach my $row (@$participant_list) {
  @@ -126,7 +126,7 @@
       my $select_topic = $dbh->prepare_cached('SELECT creation_ts ' .
                                            'FROM topicviewhistory ' .
                                            'WHERE creation_ts > ? AND ' .
  -                                         'email = ? ' .
  +                                         'LOWER(email) = LOWER(?) ' .
                                            'ORDER BY creation_ts');
   
       $select_topic->execute($date,$user);
  @@ -250,7 +250,7 @@
   
       my @basic_topic_info = $dbh->selectrow_array('
            SELECT topic.id, 
  -                topic.author, 
  +                LOWER(topic.author), 
                   topic.title, 
                   topic.state, 
                   topic.creation_ts, 
  @@ -452,9 +452,9 @@
   
       # Get total.
       my @total = _get_monthly_metrics(12,
  -     'select \'Total Topics\', count(topic.id) 
  -     from topic
  -     where topic.creation_ts >  ? and
  +     'SELECT \'Total Topics\', COUNT(topic.id) 
  +     FROM topic
  +     WHERE topic.creation_ts >  ? AND
              topic.creation_ts <= ?');
   
       push @metrics, @total;
  
  
  
  
  
  Index: Metrics.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Metrics.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Metrics.pm        7 Mar 2007 01:12:32 -0000       1.13
  +++ Metrics.pm        18 Aug 2007 04:14:37 -0000      1.14
  @@ -179,7 +179,7 @@
   
       my $actual_user_list_ref = 
            $dbh->selectall_arrayref(
  -             'SELECT DISTINCT email FROM topicviewhistory ' .
  +             'SELECT DISTINCT LOWER(email) FROM topicviewhistory ' .
                'WHERE topicid = ?',{}, $self->{topicid});
   
       my @actual_user_list = ();
  @@ -206,25 +206,25 @@
   
   
       my @metric_user_list = @{ $dbh->selectall_arrayref('
  -         SELECT distinct email 
  -         from participant where topicid = ?',{}, $self->{topicid})};
  +         SELECT distinct LOWER(email) 
  +         from participant WHERE topicid = ?',{}, $self->{topicid})};
   
       push @metric_user_list, @{ $dbh->selectall_arrayref('
  -         SELECT author from topic where id = ?',{}, $self->{topicid})};
  +         SELECT LOWER(author) FROM topic WHERE id = ?',{}, 
$self->{topicid})};
   
       push @metric_user_list, @{ $dbh->selectall_arrayref('
  -         SELECT distinct email from topicusermetric 
  -         where topicid = ?',{}, $self->{topicid})};
  +         SELECT DISTINCT LOWER(email) FROM topicusermetric 
  +         WHERE topicid = ?',{}, $self->{topicid})};
       
       push @metric_user_list, @{ $dbh->selectall_arrayref(
  -         'SELECT distinct author from commentdata, commentstate ' .
  -         'where commentstate.topicid = ? and 
  +         'SELECT DISTINCT LOWER(author) FROM commentdata, commentstate ' .
  +         'WHERE commentstate.topicid = ? AND
                   commentstate.id = commentdata.commentstateid ',
                   {}, $self->{topicid})};
   
       push @metric_user_list, @{ $dbh->selectall_arrayref(
  -         'SELECT distinct email from topicviewhistory ' .
  -         'where topicid = ? and email is not null',{}, $self->{topicid})};
  +         'SELECT DISTINCT LOWER(email) FROM topicviewhistory ' .
  +         'WHERE topicid = ? AND email IS NOT NULL',{}, $self->{topicid})};
   
       # remove the duplicates.
   
  @@ -336,7 +336,7 @@
            my $select_user_metrics = 
                $dbh->prepare_cached('SELECT metric_name, value ' .
                                     'FROM topicusermetric ' .
  -                                  'WHERE topicid = ? and email = ? ' .
  +                                  'WHERE topicid = ? AND LOWER(email) = 
LOWER(?) ' .
                                     'ORDER BY metric_name');
   
            $select_user_metrics->execute($self->{topicid}, $username);
  @@ -709,7 +709,7 @@
       my $select_topic = $dbh->prepare_cached('SELECT creation_ts ' .
                                            'FROM topicviewhistory ' .
                                            'WHERE topicid = ? AND ' .
  -                                         'email = ? ' .
  +                                         'LOWER(email) = LOWER(?) ' .
                                            'ORDER BY creation_ts');
   
       $select_topic->execute($self->{topicid}, $username);
  @@ -807,9 +807,9 @@
                                                'topichistory.version, ' .
                                                'topichistory.repository, ' .
                                                'project.name, ' .
  -                                             'topichistory.reviewers, ' .
  -                                             'topichistory.cc, ' .
  -                                             'topichistory.modified_by_user 
' .
  +                                             'LOWER(topichistory.reviewers), 
' .
  +                                             'LOWER(topichistory.cc), ' .
  +                                             
'LOWER(topichistory.modified_by_user) ' .
                                                'FROM topichistory, project ' .
                                                'WHERE topichistory.topicid = ? 
AND ' .
                                                'topichistory.projectid = 
project.id ' .
  @@ -926,7 +926,7 @@
                                                    email, 
                                                    metric_name, 
                                                    value) ' .
  -                          'VALUES (?, ?, ?, ? )');
  +                          'VALUES (?, LOWER(?), ?, ? )');
   
       foreach my $user (keys %{$self->{usermetrics}}) {
        my @metrics = $self->get_user_metrics($user);
  
  
  

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to