appdb/include appData.php distribution.php mai ...

WineHQ wineowner at wine.codeweavers.com
Tue Mar 13 16:08:39 CDT 2007


ChangeSet ID:	30969
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/03/13 16:08:39

Modified files:
	include        : appData.php distribution.php maintainer.php 
	                 objectManager.php screenshot.php vendor.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Let objectManager label the edit link in objectOutputTableRow() because the edit link text
	depends on the queue state

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

Old revision  New revision  Changes     Path
 1.8           1.9           +3 -2       appdb/include/appData.php
 1.15          1.16          +7 -7       appdb/include/distribution.php
 1.28          1.29          +4 -3       appdb/include/maintainer.php
 1.4           1.5           +4 -3       appdb/include/objectManager.php
 1.58          1.59          +3 -2       appdb/include/screenshot.php
 1.15          1.16          +4 -3       appdb/include/vendor.php

Index: appdb/include/appData.php
diff -u -p appdb/include/appData.php:1.8 appdb/include/appData.php:1.9
--- appdb/include/appData.php:1.8	13 Mar 2007 21: 8:39 -0000
+++ appdb/include/appData.php	13 Mar 2007 21: 8:39 -0000
@@ -330,7 +330,8 @@ class appData
         }
     }
 
-    function objectOutputTableRow($oObject, $sClass)
+    /* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
+    function objectOutputTableRow($oObject, $sClass, $sEditLinkLabel)
     {
         $oVersion = new Version($this->iVersionId);
 
@@ -347,7 +348,7 @@ class appData
 
         if(appData::canEdit($oObject->sClass))
             $aCells[] = "[ <a href=\"".$oObject->makeUrl("edit",
-                        $this->iId)."\">Process</a> ]";
+                        $this->iId)."\">$sEditLinkLabel</a> ]";
 
         echo html_tr($aCells, $sClass);
     }
Index: appdb/include/distribution.php
diff -u -p appdb/include/distribution.php:1.15 appdb/include/distribution.php:1.16
--- appdb/include/distribution.php:1.15	13 Mar 2007 21: 8:39 -0000
+++ appdb/include/distribution.php	13 Mar 2007 21: 8:39 -0000
@@ -438,7 +438,8 @@ class distribution {
         return new distribution($oRow->distributionId, $oRow);
     }
 
-    function objectOutputTableRow($oManager, $sClass)
+    /* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
+    function objectOutputTableRow($oManager, $sClass, $sEditLinkLabel)
     {
         $aCells = array(
              "<a href=\"".$oManager->makeUrl("view", $this->iDistributionId,
@@ -449,13 +450,12 @@ class distribution {
         if($this->canEdit())
         {
             if(!sizeof($this->aTestingIds))
-            {
-                $sDelete = " &nbsp; [<a href='".$oManager->makeUrl("delete",
+                $shDeleteLink = " &nbsp; [<a href='".$oManager->makeUrl("delete",
                     $this->iDistributionId)."'>delete</a>]";
-            }
-            $aCells[3] = array(
-                "[<a href='".$oManager->makeUrl("edit", $this->iDistributionId,
-                "Edit Distribution")."'>edit</a>]$sDelete",
+
+            $aCells[] = array(
+                "[<a href='".$oManager->makeUrl("edit",
+                $this->iDistributionId)."'>$sEditLinkLabel</a>]$shDeleteLink",
                 "align=\"center\"");
         }
 
Index: appdb/include/maintainer.php
diff -u -p appdb/include/maintainer.php:1.28 appdb/include/maintainer.php:1.29
--- appdb/include/maintainer.php:1.28	13 Mar 2007 21: 8:39 -0000
+++ appdb/include/maintainer.php	13 Mar 2007 21: 8:39 -0000
@@ -421,7 +421,8 @@ class maintainer
         echo html_tr($aCells, $sClass);
     }
 
-    function ObjectOutputTableRow($oObject, $sClass)
+    /* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
+    function ObjectOutputTableRow($oObject, $sClass, $sEditLinkLabel)
     {
         $oUser = new User($this->iUserId);
         $oApp = new Application($this->iAppId);
@@ -435,8 +436,8 @@ class maintainer
             "<a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a>");
 
         if(maintainer::canEdit())
-            $aCells[sizeof($aCells)] = "<a href=\"".$oObject->makeUrl("edit",
-            $this->iMaintainerId)."\">answer</a>";
+            $aCells[sizeof($aCells)] = "[ <a href=\"".$oObject->makeUrl("edit",
+            $this->iMaintainerId)."\">$sEditLinkLabel</a> ]";
 
         echo html_tr($aCells,
             $sClass);
Index: appdb/include/objectManager.php
diff -u -p appdb/include/objectManager.php:1.4 appdb/include/objectManager.php:1.5
--- appdb/include/objectManager.php:1.4	13 Mar 2007 21: 8:39 -0000
+++ appdb/include/objectManager.php	13 Mar 2007 21: 8:39 -0000
@@ -95,8 +95,9 @@ class ObjectManager
             $oObject = call_user_func(array($this->sClass,
                                             "objectGetInstanceFromRow"), $oRow);
 
-            $oObject->objectOutputTableRow($this,
-                ($iCount % 2) ? "color0" : "color1");
+            /* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
+            $oObject->objectOutputTableRow($this, ($iCount % 2) ? "color0" : "color1",
+                $this->bIsQueue ? "process" : "edit");
         }
 
         echo "</table>";
@@ -313,7 +314,7 @@ class ObjectManager
 
         $sTitle = urlencode($sTitle);
 
-        return $_SERVER['PHP_SELF']."?bIsQueue=$sIsQueue&sClass=$this->sClass".
+        return BASE."objectManager.php?bIsQueue=$sIsQueue&sClass=$this->sClass".
                "&sTitle=$sTitle$sId$sAction";
     }
 
Index: appdb/include/screenshot.php
diff -u -p appdb/include/screenshot.php:1.58 appdb/include/screenshot.php:1.59
--- appdb/include/screenshot.php:1.58	13 Mar 2007 21: 8:39 -0000
+++ appdb/include/screenshot.php	13 Mar 2007 21: 8:39 -0000
@@ -537,10 +537,11 @@ class Screenshot {
         return new appData($oRow->id, $oRow);
     }
 
-    function objectOutputTableRow($oObject, $sClass)
+    /* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
+    function objectOutputTableRow($oObject, $sClass, $sEditLinkLabel)
     {
         $oAppData = new AppData();
-        $oAppData->objectOutputTableRow($oObject, $sClass);
+        $oAppData->objectOutputTableRow($oObject, $sClass, $sEditLinkLabel);
     }
 
     function objectDisplayQueueProcessingHelp()
Index: appdb/include/vendor.php
diff -u -p appdb/include/vendor.php:1.15 appdb/include/vendor.php:1.16
--- appdb/include/vendor.php:1.15	13 Mar 2007 21: 8:39 -0000
+++ appdb/include/vendor.php	13 Mar 2007 21: 8:39 -0000
@@ -185,7 +185,8 @@ class Vendor {
         return new vendor($oRow->vendorId, $oRow);
     }
 
-    function objectOutputTableRow($oObject, $sClass = "")
+    /* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
+    function objectOutputTableRow($oObject, $sClass = "", $sEditLinkLabel)
     {
         $aCells = array(
             "<a href=\"".$oObject->makeUrl("view", $this->iVendorId,
@@ -196,12 +197,12 @@ class Vendor {
         if($this->canEdit())
         {
             if(!sizeof($this->aApplicationsIds))
-                $sDelete = " &nbsp; [<a href=\"".$oObject->makeUrl("delete",
+                $shDeleteLink = " &nbsp; [<a href=\"".$oObject->makeUrl("delete",
                 $this->iVendorId, "View Vendors")."\">".
                 "delete</a>]";
 
             $aCells[sizeof($aCells)] = "[<a href=\"".$oObject->makeUrl("edit",
-            $this->iVendorId, "Edit Vendor")."\">edit</a>]$sDelete";
+            $this->iVendorId, "Edit Vendor")."\">$sEditLinkLabel</a>]$shDeleteLink";
         }
 
         echo html_tr($aCells, $sClass);



More information about the wine-cvs mailing list