User: sits    
  Date: 06/08/20 00:11:23

  Modified:    .        CHANGELOG
               lib      Codestriker.pm
               lib/Codestriker/Action ListProjects.pm
               lib/Codestriker/Model Project.pm
               template/en/default listprojects.html.tmpl
                        listtopics.html.tmpl
  Log:
  * The project list screen now displays for each project, the total
    number of open topics, and the total number of topics.  Clicking on
    the count will go to the topic list screen with the relevant topics
    displayed.
  
  
  
  Index: CHANGELOG
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
  retrieving revision 1.195
  retrieving revision 1.196
  diff -u -r1.195 -r1.196
  --- CHANGELOG 11 Aug 2006 01:46:05 -0000      1.195
  +++ CHANGELOG 20 Aug 2006 07:11:21 -0000      1.196
  @@ -1,6 +1,13 @@
   *** When upgrading, don't forget to: "cd bin ; ./install.pl" ***
   *** Also, it is _highly_ advisable to backup your data before upgrading ***
   
  +Version 1.9.3
  +
  +* The project list screen now displays for each project, the total
  +  number of open topics, and the total number of topics.  Clicking on
  +  the count will go to the topic list screen with the relevant topics
  +  displayed.
  +
   Version 1.9.2
   
   * Codestriker now works with UTF-8 text, to support unicode character
  
  
  
  
  
  Index: Codestriker.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- Codestriker.pm    10 Aug 2006 11:29:04 -0000      1.97
  +++ Codestriker.pm    20 Aug 2006 07:11:21 -0000      1.98
  @@ -31,7 +31,7 @@
              );
   
   # Version of Codestriker.
  -$Codestriker::VERSION = "1.9.2";
  +$Codestriker::VERSION = "1.9.3";
   
   # Default title to display on each Codestriker screen.
   $Codestriker::title = "Codestriker $Codestriker::VERSION";
  
  
  
  
  
  Index: ListProjects.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Action/ListProjects.pm,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ListProjects.pm   1 Mar 2005 10:12:49 -0000       1.10
  +++ ListProjects.pm   20 Aug 2006 07:11:22 -0000      1.11
  @@ -43,6 +43,16 @@
       # Go through all of the projects, and construct an edit_project URL.
       foreach my $project (@projects) {
        $project->{edit_url} = $url_builder->edit_project_url($project->{id});
  +     $project->{num_open_topics} =
  +         Codestriker::Model::Project->num_open_topics($project->{id});
  +     $project->{open_topic_list_url} =
  +         $url_builder->list_topics_url('', '', '', '', '', '', '', '', '',
  +                                       '', [0], [$project->{id}], '');
  +     $project->{num_topics} =
  +         Codestriker::Model::Project->num_topics($project->{id});
  +     $project->{topic_list_url} =
  +         $url_builder->list_topics_url('', '', '', '', '', '', '', '', '',
  +                                       '', undef, [$project->{id}], '');
       }
       $vars->{'projects'} = [EMAIL PROTECTED];
   
  
  
  
  
  
  Index: Project.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Project.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Project.pm        22 May 2006 23:19:05 -0000      1.5
  +++ Project.pm        20 Aug 2006 07:11:22 -0000      1.6
  @@ -10,6 +10,7 @@
   package Codestriker::Model::Project;
   
   use strict;
  +use Carp;
   use Encode qw(decode_utf8);
   
   use Codestriker::DB::DBI;
  @@ -260,4 +261,45 @@
       }
   }
   
  +# Determine the number of open topics in the specified project.
  +sub num_open_topics {
  +    my ($type, $id) = @_;
  +
  +    my $dbh = Codestriker::DB::DBI->get_connection();
  +    my $count;
  +    eval {
  +     $count = $dbh->selectrow_array('SELECT COUNT(topic.id) ' .
  +                                    'FROM topic ' .
  +                                    'WHERE topic.projectid = ? ' .
  +                                    'AND topic.state = 0', {}, $id);
  +    };
  +    Codestriker::DB::DBI->release_connection($dbh, 1);
  +    if ($@) {
  +     carp "Problem retrieving count of open topics in project: $@";
  +    }
  +
  +    return $count;
  +}
  +
  +# Determine the number of topics in the specified project.
  +sub num_topics {
  +    my ($type, $id) = @_;
  +
  +    my $dbh = Codestriker::DB::DBI->get_connection();
  +    my $count;
  +    eval {
  +     $count = $dbh->selectrow_array('SELECT COUNT(topic.id) ' .
  +                                    'FROM topic ' .
  +                                    'WHERE topic.projectid = ? ', {}, $id);
  +    };
  +    Codestriker::DB::DBI->release_connection($dbh, 1);
  +
  +    if ($@) {
  +     carp "Problem retrieving count of topics in project: $@";
  +    }
  +
  +    return $count;
  +}
  +
  +
   1;
  
  
  
  
  
  Index: listprojects.html.tmpl
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/template/en/default/listprojects.html.tmpl,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- listprojects.html.tmpl    10 Aug 2006 11:29:05 -0000      1.22
  +++ listprojects.html.tmpl    20 Aug 2006 07:11:23 -0000      1.23
  @@ -19,6 +19,8 @@
     <th>Name</th>
     <th>Description</th>
     <th>State</th>
  +  <th># Open Topics</th>
  +  <th># Topics</th>
   </tr>
   
   [% FOREACH project = projects %]
  @@ -30,11 +32,13 @@
   </TD>
   <TD>[% project.description | html_entity %]</TD>
   <TD>[% project.state | html_entity %]</TD>
  +<TD align="right"><a href="[% project.open_topic_list_url %]">[% 
project.num_open_topics %]</a></TD>
  +<TD align="right"><a href="[% project.topic_list_url %]">[% 
project.num_topics %]</a></TD>
   </TR>
   [% END %]
   
   <tr class="tlh">
  -  <td colspan="3">&nbsp;</td>
  +  <td colspan="5">&nbsp;</td>
   </tr>
   </TABLE>
   
  
  
  
  
  
  Index: listtopics.html.tmpl
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/template/en/default/listtopics.html.tmpl,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- listtopics.html.tmpl      10 Aug 2006 11:29:05 -0000      1.38
  +++ listtopics.html.tmpl      20 Aug 2006 07:11:23 -0000      1.39
  @@ -77,7 +77,8 @@
   
   [% SET obsoleted_state_present = 0 %]
   <table>
  -<tr>
  +<tr><td>[% topics.size %] topics found.</td></tr>
  +<tr><td>&nbsp;</td></tr>
   <td>
   Change state: &nbsp;
     <select name="topic_state">
  
  
  

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to