[AppDB] link bugs patch 4 of 6

Tony Lambregts tony.lambregts at gmail.com
Sat Jul 9 23:09:25 CDT 2005


This is the fourth of the patches that gives better integration of
bugzilla with the AppDB. They are submitted in the order that they
should be applied. If you want to test them out you should download the
tarball for bugzilla from ftp://ftp.winehq.org/pub/wine/ (Thanks Jeremy...)

Change Log: Modify the version object to include an array of bugs.

Files changed: include/version.php



-------------- next part --------------
Index: include/version.php
===================================================================
RCS file: /home/wine/appdb/include/version.php,v
retrieving revision 1.25
diff -u -r1.25 version.php
--- include/version.php	30 Jun 2005 01:59:32 -0000	1.25
+++ include/version.php	10 Jul 2005 03:50:26 -0000
@@ -7,6 +7,7 @@
 require_once(BASE."include/comment.php");
 require_once(BASE."include/url.php");
 require_once(BASE."include/screenshot.php");
+require_once(BASE."include/bugs.php");
 
 /**
  * Version class for handling versions.
@@ -25,6 +26,7 @@
     var $aCommentsIds;        // an array that contains the commentId of every comment linked to this version
     var $aScreenshotsIds;     // an array that contains the screenshotId of every screenshot linked to this version
     var $aUrlsIds;            // an array that contains the screenshotId of every url linked to this version
+    var $aBuglinkIds;         // an array that contains the buglinkId of every bug linked to this version
 
     /**    
      * constructor, fetches the data.
@@ -109,6 +111,22 @@
                         $this->aScreenshotsIds[] = $oRow->id;
                     else
                         $this->aUrlsIds[] = $oRow->id;
+                }
+            }
+
+            /*
+             * We fetch Bug linkIds. 
+             */
+            $this->aBuglinkIds = array();
+            $sQuery = "SELECT *
+                       FROM buglinks
+                       WHERE versionId = ".$iVersionId."
+                       ORDER BY bug_id";
+            if($hResult = query_appdb($sQuery))
+            {
+                while($oRow = mysql_fetch_object($hResult))
+                {
+                    $this->aBuglinkIds[] = $oRow->linkId;
                 }
             }
         }


More information about the wine-patches mailing list