[csw-devel] SF.net SVN: opencsw:[298] web/wordpresscsw/wp-content/themes/opencsw
wbonnet at users.sourceforge.net
wbonnet at users.sourceforge.net
Sat Feb 19 19:40:53 CET 2011
Revision: 298
http://opencsw.svn.sourceforge.net/opencsw/?rev=298&view=rev
Author: wbonnet
Date: 2011-02-19 18:40:53 +0000 (Sat, 19 Feb 2011)
Log Message:
-----------
Add last activity to maintainer page
Modified Paths:
--------------
web/wordpresscsw/wp-content/themes/opencsw/maintainer.php
web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php
Modified: web/wordpresscsw/wp-content/themes/opencsw/maintainer.php
===================================================================
--- web/wordpresscsw/wp-content/themes/opencsw/maintainer.php 2011-02-19 15:59:19 UTC (rev 297)
+++ web/wordpresscsw/wp-content/themes/opencsw/maintainer.php 2011-02-19 18:40:53 UTC (rev 298)
@@ -8,13 +8,16 @@
<?php
// Create the DAO object
$maintDAO = new maintainersDAO();
+ $qaDAO = new qaDAO();
// Connect to database
$maintDAO->connect();
+ $qaDAO->connect();
// Retrieve the information from the database
$maintainerLogin = $wp_query->get('maintainerName');
$arrayInfo = $maintDAO->getMaintainerInformation($maintainerLogin);
+ $lastActivityInfo = $qaDAO->getMaintainerLastUnstableSubmitDate($maintainerLogin);
$maintainerFullName = $arrayInfo[1] ;
$maintainerStatus = $arrayInfo[2] ;
@@ -50,6 +53,9 @@
print "<tr>\n" ;
print "<th>Bug tracking</th><td><a href=/buglist/maintainer.cgi?maintainer='" . $maintainerLogin . "'>List of open/relevant bugs for " . $maintainerFullName . "</a>\n" ;
print "</tr>\n" ;
+ print "<tr>\n" ;
+ print "<th>Last activity date</th><td><a href=/package/" . $lastActivityInfo[0]["software"] . ">" . $lastActivityInfo[0]["software"] . "</a> has been added to unstable on " . $lastActivityInfo[0]["date"] . "</td>\n" ;
+ print "</tr>\n" ;
print "</tbody>";
print "</table>";
Modified: web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php
===================================================================
--- web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php 2011-02-19 15:59:19 UTC (rev 297)
+++ web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php 2011-02-19 18:40:53 UTC (rev 298)
@@ -463,5 +463,35 @@
// Return the array to the caller
return $output; // Return the array to the caller
}
+
+ // -----------------------------------------------------------------------------------------------------------------------
+ //
+ // Get the last submission date of a maintainer. This is the date he last submitted to unstable
+ //
+ // -----------------------------------------------------------------------------------------------------------------------
+ function getMaintainerLastUnstableSubmitDate($maintName) {
+
+ // Define the query used to retrieve the packages from the database
+ $sqlQuery = "select p.software , h.HIST_VERSION_DATE from UWATCH_VERSION_HISTORY as h , UWATCH_PKG_VERSION as v , packages as p where p.maintlogin = '" . $maintName . "' and p.software = v.PKG_CATALOGNAME and v.ID_PKG = h.ID_PKG and h.HIST_VERSION_TYPE = 'unstable' order by h.HIST_VERSION_DATE desc limit 1 ; ";
+
+ // Execute the query to retrieve the row to update
+ $this->execQuery($sqlQuery);
+
+ // Return value
+ $output = array(); // Array used to store the output
+ $idxCount = 0; // Index on the current line in the array
+
+ // Check if there is a result
+ while ($row = mysql_fetch_row($this->result)) {
+ $output[$idxCount] = array( // Copy the current row into the array of results
+ "software" => $row[0], // Copy the field into the array of results
+ "date" => $row[1] // Copy the field into the array of results
+ );
+ $idxCount++; // Increase the index
+ }
+
+ // Return the array to the caller
+ return $output; // Return the array to the caller
+ }
}
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list