appdb/ include/application.php include/vendor. ...

WineHQ wineowner at wine.codeweavers.com
Tue Mar 13 15:59:46 CDT 2007


ChangeSet ID:	30966
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/03/13 15:59:45

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

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Remove references to vendorview.php and remove now unused vendorview.php

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

Old revision  New revision  Changes     Path
 1.27          Removed       +0 -0       appdb/vendorview.php
 1.91          1.92          +12 -3      appdb/include/application.php
 1.14          1.15          +13 -0      appdb/include/vendor.php

Index: appdb/vendorview.php
diff -u -p appdb/vendorview.php:1.27 /dev/null
--- appdb/vendorview.php	13 Mar 2007 20:59:45 -0000
+++ /dev/null	13 Mar 2007 20:59:45 -0000
@@ -1,68 +0,0 @@
-<?php
-/*************************************/
-/* code to view vendors & their apps */
-/*************************************/
-
-/*
- * application environment
- */ 
-require("path.php");
-require(BASE."include/incl.php");
-require_once(BASE."include/application.php");
-require_once(BASE."include/vendor.php");
-
-$oVendor = new Vendor($aClean['iVendorId']);
-
-if ($aClean['sSub'])
-{
-    if(!$_SESSION['current']->hasPriv("admin"))
-        util_show_error_page_and_exit("Insufficient privileges.");
-
-    if($aClean['sSub'] == 'delete')
-    {
-        $oVendor->delete();
-        util_redirect_and_exit($_SERVER['PHP_SELF']);
-   }
-
-} 
-
-
-if($oVendor->iVendorId)
-{
-    //display page
-    apidb_header("View Vendor");
-    echo html_frame_start("Vendor Information",500);
-
-    $oVendor->display();
-
-    echo html_frame_end();
-    echo html_back_link(1);
-    apidb_footer();
-
-}
-else
-{
-    apidb_header("View Vendors");
-
-    //get available vendors
-    $hResult = vendor::objectGetEntries(false);
-
-    // show vendorlist
-    echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
-
-    vendor::objectOutputHeader("color4");
-
-    for($c = 0; $oRow = mysql_fetch_object($hResult); $c++)
-    {
-        $oVendor = vendor::objectGetInstanceFromRow($oRow);
-        $oVendor->objectOutputTableRow(($c % 2) ? "color0" : "color1");
-    }
-
-    echo '<tr><td>',"\n";
-    echo html_back_link(1);
-    echo '</td></tr></table>',"\n";
-    apidb_footer();
-
-}
-
-?>
Index: appdb/include/application.php
diff -u -p appdb/include/application.php:1.91 appdb/include/application.php:1.92
--- appdb/include/application.php:1.91	13 Mar 2007 20:59:45 -0000
+++ appdb/include/application.php	13 Mar 2007 20:59:45 -0000
@@ -635,7 +635,7 @@ class Application {
         echo '      <table width="250" border="0" cellpadding="3" cellspacing="1">',"\n";
         echo "        <tr class=color0 valign=top><td width=\"100\"><b>Name</b></td><td width='100%'> ".$this->sName." </td>\n";
         echo "        <tr class=\"color1\"><td><b>Vendor</b></td><td> ".
-            "        <a href='vendorview.php?iVendorId=$oVendor->iVendorId'> ".$oVendor->sName." </a> &nbsp;\n";
+            $oVendor->objectMakeLink()."&nbsp;\n";
         echo "        </td></tr>\n";
     
         // main URL
@@ -788,7 +788,13 @@ class Application {
     /* List applications submitted by a given user */
     function listSubmittedBy($iUserId, $bQueued = true)
     {
-        $hResult = query_parameters("SELECT appId, appName, appFamily.vendorId, description, submitTime, vendorName FROM appFamily, vendor WHERE appFamily.vendorId = vendor.vendorId AND submitterId = '?' AND queued = '?' ORDER BY appId", $iUserId, $bQueued ? "true" : "false");
+        $hResult = query_parameters("SELECT appId, appName, vendorId, description,
+               submitTime FROM appFamily
+                WHERE
+                submitterId = '?'
+                AND
+                queued = '?'
+                    ORDER BY appId", $iUserId, $bQueued ? "true" : "false");
 
         if(!$hResult || !mysql_num_rows($hResult))
             return false;
@@ -802,12 +808,15 @@ class Application {
             "color4");
 
         for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
+        {
+            $oVendor = new vendor($oRow->vendorId);
             $sResult .= html_tr(array(
                 "<a href=\"".BASE."appview.php?iAppId=$oRow->appId\">$oRow->appName</a>",
                 $oRow->description,
-                "<a href=\"".BASE."vendorview.php?iVendorId=$oRow->vendorId\">$oRow->vendorName</a>",
+                $oVendor->objectMakeLink(),
                 print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))),
                 ($i % 2) ? "color0" : "color1");
+        }
 
         $sResult .= html_table_end();
 
Index: appdb/include/vendor.php
diff -u -p appdb/include/vendor.php:1.14 appdb/include/vendor.php:1.15
--- appdb/include/vendor.php:1.14	13 Mar 2007 20:59:45 -0000
+++ appdb/include/vendor.php	13 Mar 2007 20:59:45 -0000
@@ -248,6 +248,19 @@ class Vendor {
             echo '</ol>',"\n";
         }
     }
+
+    /* Make a URL for viewing the specified vendor */
+    function objectMakeUrl()
+    {
+        $oManager = new objectManager("vendor", "View Vendor");
+        return $oManager->makeUrl("view", $this->iVendorId);
+    }
+
+    /* Make a HTML link for viewing the specified vendor */
+    function objectMakeLink()
+    {
+        return "<a href=\"".$this->objectMakeUrl()."\">$this->sName</a>";
+    }
 }
 
 /* Get the total number of Vendors in the database */



More information about the wine-cvs mailing list