appdb/ ./vendorview.php include/vendor.php

WineHQ wineowner at wine.codeweavers.com
Tue Jan 30 20:24:54 CST 2007


ChangeSet ID:	30920
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/01/30 20:24:54

Modified files:
	.              : vendorview.php 
	include        : vendor.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Add and use vendor::objectOutputHeader() and vendor::objectGetEntries()

Patch: http://cvs.winehq.org/patch.py?id=30920

Old revision  New revision  Changes     Path
 1.25          1.26          +3 -11      appdb/vendorview.php
 1.11          1.12          +28 -0      appdb/include/vendor.php

Index: appdb/vendorview.php
diff -u -p appdb/vendorview.php:1.25 appdb/vendorview.php:1.26
--- appdb/vendorview.php:1.25	31 Jan 2007  2:24:54 -0000
+++ appdb/vendorview.php	31 Jan 2007  2:24:54 -0000
@@ -45,21 +45,13 @@ else
     apidb_header("View Vendors");
 
     //get available vendors
-    $hResult = query_parameters("SELECT vendorId FROM vendor ORDER BY vendorName, vendorId;");
+    $hResult = vendor::objectGetEntries(false);
 
     // show vendorlist
     echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
 
-    echo '<tr class="color4">',"\n";
-    echo '<td>Vendor name</td>',"\n";
-    echo '<td>Vendor\'s Web Page</td>',"\n";
-    echo '<td align="right">linked Apps</td>',"\n";
-    if ($_SESSION['current']->hasPriv("admin"))
-    {
-        echo '<td align="center">Action</td>',"\n";
-    }
-    echo '</tr>',"\n";
-        
+    vendor::objectOutputHeader("color4");
+
     $c = 1;
     while($oRow = mysql_fetch_object($hResult))
     {
Index: appdb/include/vendor.php
diff -u -p appdb/include/vendor.php:1.11 appdb/include/vendor.php:1.12
--- appdb/include/vendor.php:1.11	31 Jan 2007  2:24:54 -0000
+++ appdb/include/vendor.php	31 Jan 2007  2:24:54 -0000
@@ -140,6 +140,34 @@ class Vendor {
         echo "</table>\n";
     }
 
+    function objectGetEntries($bQueued)
+    {
+        /* Vendor queueing is not implemented yet */
+        if($bQueued)
+            return NULL;
+
+        $hResult = query_parameters("SELECT * FROM vendor
+                   ORDER BY vendorName");
+
+        if(!$hResult)
+            return FALSE;
+
+        return $hResult;
+    }
+
+    function objectOutputHeader($sClass = "")
+    {
+        $sCells = array(
+            "Name",
+            "Website",
+            array("Linked apps", "align=\"right\""));
+
+        if(vendor::canEdit())
+            $sCells[sizeof($sCells)] = "Action";
+
+        echo html_tr($sCells, $sClass);
+    }
+
     function canEdit()
     {
         if($_SESSION['current']->hasPriv("admin"))



More information about the wine-cvs mailing list