Revision: 326
          http://opencsw.svn.sourceforge.net/opencsw/?rev=326&view=rev
Author:   wbonnet
Date:     2011-02-23 23:34:07 +0000 (Wed, 23 Feb 2011)

Log Message:
-----------
Add pending packages in GAR

Modified Paths:
--------------
    web/wordpresscsw/wp-content/themes/opencsw/qa.php
    web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php

Added Paths:
-----------
    web/wordpresscsw/wp-content/themes/opencsw/qa-gar-pending.php

Added: web/wordpresscsw/wp-content/themes/opencsw/qa-gar-pending.php
===================================================================
--- web/wordpresscsw/wp-content/themes/opencsw/qa-gar-pending.php               
                (rev 0)
+++ web/wordpresscsw/wp-content/themes/opencsw/qa-gar-pending.php       
2011-02-23 23:34:07 UTC (rev 326)
@@ -0,0 +1,133 @@
+<?php
+/*
+Template Name: Maintainer detail
+*/
+?>
+
+<?php get_header(); ?>
+<?php 
+    // Create the DAO object
+    $maintDAO = new maintainersDAO();
+    $qaDAO    = new qaDAO();
+
+    // Connect to database
+    $maintDAO->connect();
+    $qaDAO->connect();
+
+    print "<div id=\"container\">";
+    print "<div id=\"content\">";
+    print "<div class=\"post hentry\">";
+    print "<h2>Overview of packages in GAR</h2>";
+    print     "<div class=\"entry\">";
+    print     "<span>The following list contains all the packages available 
from GAR which have not yet been release to unstable catalog.<span>" ;
+
+    // Retrieve the statistics from the database
+    $arrayPkg = $qaDAO->getListOfGarPendingPackages();
+
+    // Disconnect from the database
+    $template      = "/wp-content/themes/opencsw";
+
+    print "<h3>Packages ( " . count($arrayPkg) . " )</h3>";
+    print "<span>The list of packages uses several icons. Here are the 
meanings of each icon that may be displayed below :</span>";
+    print "<br>";
+    print "<ul>";
+    print "<img src=\"$template/img/uwatch-missing.png\" title=\"Package is 
not in GAR.\" alt=\"-\"/> Package is not in GAR";
+    print "<br>";
+    print "<img src=\"$template/img/uwatch-deactivated.png\" title=\"uWatch is 
not activated. Information about upstream version not available\" alt=\"-\"/> 
uWatch is not activated. Information about upstream version not available";
+    print "<br>";
+    print "<img src=\"$template/img/uwatch-error.png\" title=\"uWatch reported 
an error while checking upstream site\" alt=\"X\"/> uWatch reported an error 
while checking upstream site";
+    print "<br>";
+    print "</ul>";
+    print "<table border=\"0\">";
+    print "<tbody  class=\"package-list\">";
+    print "<tr>";
+    print "<th rowspan=\"2\">Software name</th><th colspan=\"2\" 
class=\"package-list-cell\">Version</th><th rowspan=\"2\" 
class=\"package-list-cell\">Lutefisk</th><th rowspan=\"2\" 
class=\"package-list-cell\">uBuild</th><th rowspan=\"2\" 
class=\"package-list-cell\">CheckPkg</th>";
+    print "</tr>";
+    print "<tr>";
+    print "<th class=\"package-list-cell\">GAR</th><th>Upstream</th>";
+    print "</tr>";
+
+    // Initialize global counter
+    $upgradablePackages = 0;
+    $packageToRelease   = 0;
+
+    for( $i = 0 ; $i < count($arrayPkg) ; $i++) {
+        $package          = $arrayPkg[$i] ;                                    
             // Get the current row
+        $versionInfoArray = 
$qaDAO->getPackageVersionInformation($package["software"]);     // Retrieve 
version information from uwatch db
+        $versionInfo      = $versionInfoArray[0];
+        print "<tr>\n" ;
+        print "<td><a title='" . $package["software"] . "' href='/qa/package/" 
;
+        print $package["software"] . "'>" . $package["software"] . "</a></td>";
+
+        // Replace empty version by a -
+        $garVersion      = empty($versionInfo["garVersion"])      ? "-" : 
$versionInfo["garVersion"];
+        $upstreamVersion = empty($versionInfo["upstreamVersion"]) ? "-" : 
$versionInfo["upstreamVersion"];
+
+        if ( ( $garVersion <> $unstableVersion )  && ( ! 
empty($versionInfo["garVersion"]) ) ) {
+            $packageToRelease++;   
+        }
+
+        // Test if the package exists in gar
+        if ( $versionInfo["garPath"] == "") {
+            print "<td class=\"package-list-cell\" colspan=\"2\"><img 
src=\"$template/img/uwatch-missing.png\" title=\"Package " . 
$package["software"] . " is not in GAR.\" alt=\"-\"/></td>\n" ;     
+        } else {
+            // Test if uwatch is deactived
+            if ( $versionInfo["uwatchActivated"] != 1) {
+                // Yes thus display GAR info and deactivated icon
+                print "<td class=\"package-list-cell\">" . $garVersion . 
"</td>\n" ;               // GAR
+                print "<td class=\"package-list-cell\"><img 
src=\"$template/img/uwatch-deactivated.png\" title=\"uWatch is not activated. 
Information about upstream version not available\" alt=\"-\"/></td>\n" ;     
+            } else {
+                // Uwatch is actived, check if there is an error
+                if ( $versionInfo["lastUpstreamCheckStatus"] != 1) {
+                    // Yes thus display GAR info and deactivated icon
+                    print "<td class=\"package-list-cell\">" . $garVersion . 
"</td>\n" ;               // GAR
+                    print "<td class=\"package-list-cell\"><img 
src=\"$template/img/uwatch-error.png\" title=\"uWatch reported an error while 
checking upstream site\" alt=\"X\"/></td>\n" ;     
+                } else {
+                    // Display gar version information
+                    if ( ( $garVersion == $upstreamVersion ) && ( ! 
empty($versionInfo["garVersion"]) ) ) {
+                        print "<td colspan=\"2\" class=\"package-list-cell\">" 
. $upstreamVersion . "</td>\n" ;          // Same for GAR and upstream
+                    } else {
+                        print "<td class=\"package-list-cell\">" . $garVersion 
. "</td>\n" ;               // GAR
+                        print "<td class=\"package-list-cell\"><a title='" . 
$upstreamVersion . " upstream site' href='" . $package["vendorurl"] ;
+                        print "'>" . $upstreamVersion . "</a></td>\n" ;        
  // Upstream
+                        if ( ! empty($versionInfo["garVersion"]) ) {
+                            $upgradablePackages++;
+                        }
+                    }
+                }
+            }
+        }
+        print "<td class=\"package-list-cell\">-</td>\n" ;          // Lutefisk
+        print "<td class=\"package-list-cell\">-</td>\n" ;          // bBuild
+        print "<td class=\"package-list-cell\">-</td>\n" ;          // Checkpkg
+        print "</tr>\n" ;
+    }
+
+    // Display total bugs
+    print "<tr>\n" ;
+    print "<td>Total</td>";
+    // Display the counters in the page
+    print "<td class=\"package-list-cell\">" . $totalCritical . "</td>\n" ;    
   // Critical
+    print "<td class=\"package-list-cell\">" . $totalMajor . "</td>\n" ;       
   // Major
+    print "<td class=\"package-list-cell\">" . $totalMinor . "</td>\n" ;       
   // Minor
+    print "<td class=\"package-list-cell\">" . $totalTweak . "</td>\n" ;       
   // Tweak
+
+    // Display catalog version information
+    print "<td class=\"package-list-cell\" colspan=\"3\">To release : 
$packageToRelease</td>\n" ;            // Stable
+    print "<td class=\"package-list-cell\" colspan=\"2\">Upgradable : 
$upgradablePackages</td>\n" ;            // Stable
+    print "<td class=\"package-list-cell\" colspan=\"3\"></td>\n" ;            
// Stable
+    print "</tr>\n" ;
+
+    // Close table
+    print "</tbody>";
+    print "</table>";
+    print "<br>";
+    print "<br>";
+    print "</div>";
+    print "</div>";
+    print "</div><!-- #content -->";
+    print "</div><!-- #container -->";
+?>
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>

Modified: web/wordpresscsw/wp-content/themes/opencsw/qa.php
===================================================================
--- web/wordpresscsw/wp-content/themes/opencsw/qa.php   2011-02-23 23:11:00 UTC 
(rev 325)
+++ web/wordpresscsw/wp-content/themes/opencsw/qa.php   2011-02-23 23:34:07 UTC 
(rev 326)
@@ -66,6 +66,12 @@
                         <a title='Packages missing from GAR repository' 
href='/qa/packages/gar/missing'>Packages missing from GAR repository</a>
                     </li>
                 </ul>
+                <span>The following link displays the complete list of 
packages pending in the GAR repository. These packages have not yet been 
published to unstable catalog.</span>
+                <ul>
+                    <li>
+                        <a title='Packages pending in the GAR repository' 
href='/qa/packages/gar/pending'>Packages pending in the GAR repository</a>
+                    </li>
+                </ul>
                 <span>The following links displays the complete list of 
packages with uWatch issues. The build descriptions of these packages should be 
fixed to solves errors reported.</span>
                 <ul>
                     <li>

Modified: web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php
===================================================================
--- web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php        2011-02-23 
23:11:00 UTC (rev 325)
+++ web/wordpresscsw/wp-content/themes/opencsw/qaDAO.php        2011-02-23 
23:34:07 UTC (rev 326)
@@ -493,5 +493,36 @@
         // Return the array to the caller
         return $output;                                      // Return the 
array to the caller
     }
+
+    // 
-----------------------------------------------------------------------------------------------------------------------
+    //
+    // Get information about a maintainer
+    //
+    // 
-----------------------------------------------------------------------------------------------------------------------
+    function getListOfGarPendingPackages() {
+
+        // Define the query used to retrieve the packages from the database
+        $sqlQuery  = "select PKG_CATALOGNAME, PKG_GAR_VERSION from 
UWATCH_PKG_VERSION where PKG_GAR_PATH is not null and PKG_UNSTABLE_VERSION is 
null and PKG_TESTING_VERSION is null and PKG_STABLE_VERSION is null order by 
PKG_CATALOGNAME" ;
+    
+        // 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
+                "stream_version"        => $row[1]
+            );
+            $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.
_______________________________________________
devel mailing list
devel@lists.opencsw.org
https://lists.opencsw.org/mailman/listinfo/devel

Reply via email to