appdb/ include/distribution.php include/incl.p ...

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


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

Modified files:
	include        : distribution.php incl.php testData.php 
Removed files:
	.              : distributionView.php 

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

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

Old revision  New revision  Changes     Path
 1.25          Removed       +0 -0       appdb/distributionView.php
 1.14          1.15          +20 -5      appdb/include/distribution.php
 1.41          1.42          +1 -0       appdb/include/incl.php
 1.21          1.22          +1 -2       appdb/include/testData.php

Index: appdb/distributionView.php
diff -u -p appdb/distributionView.php:1.25 /dev/null
--- appdb/distributionView.php	13 Mar 2007 21: 3: 8 -0000
+++ /dev/null	13 Mar 2007 21: 3: 8 -0000
@@ -1,67 +0,0 @@
-<?php
-/*************************************/
-/* code to view distributions        */
-/*************************************/
-
-/*
- * application environment
- */ 
-require("path.php");
-require(BASE."include/incl.php");
-require_once(BASE."include/distribution.php");
-require_once(BASE."include/testData.php");
-
-if ($aClean['sSub'])
-{
-    if(!$_SESSION['current']->hasPriv("admin"))
-        util_show_error_page_and_exit("Insufficient privileges.");
-
-    if($aClean['sSub'] == 'delete')
-    {
-        $oDistribution = new distribution($aClean['iDistributionId']);
-        $oDistribution->delete();
-        util_redirect_and_exit($_SERVER['PHP_SELF']);
-    }
-} 
-$oDistribution = new distribution($aClean['iDistributionId']);
-
-/* Display distribution list if no id given */
-if(!$oDistribution->iDistributionId) 
-{
-    apidb_header("View Distributions");
-
-    //get available Distributions
-    $hResult = distribution::ObjectGetEntries(false);
-
-    // show Distribution list
-    echo html_frame_start("","90%","",0);
-    echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
-
-    distribution::ObjectOutputHeader("color4");
-
-    for($c = 1; $oRow = mysql_fetch_object($hResult); $c++)
-    {
-        $oDistribution = distribution::ObjectGetInstanceFromRow($oRow);
-
-        $oDistribution->objectOutputTableRow(($c % 2) ? "color0" : "color1");
-    }
-    echo "</table>\n\n";
-    echo html_frame_end("&nbsp;");
-    if ($_SESSION['current']->hasPriv("admin"))
-        echo "[<a href='".BASE."admin/editDistribution.php'>Add New Distribution</a>]";
-    apidb_footer();
-} 
-else
-{
-    //display page
-    apidb_header("View Distribution");
-    echo html_frame_start("Distribution Information",500);
-
-    $oDistribution->display();
-
-    echo html_frame_end();
-    echo html_back_link(1);
-    apidb_footer();
-}
-
-?>
Index: appdb/include/distribution.php
diff -u -p appdb/include/distribution.php:1.14 appdb/include/distribution.php:1.15
--- appdb/include/distribution.php:1.14	13 Mar 2007 21: 3: 8 -0000
+++ appdb/include/distribution.php	13 Mar 2007 21: 3: 8 -0000
@@ -286,8 +286,9 @@ class distribution {
             case "add":
                 if($this->sQueued == "false")
                 {
-                    $sSubject = "Distribution ".$this->sName." added by ".$_SESSION['current']->sRealname;
-                    $sMsg  = APPDB_ROOT."distributionView.php?iDistributionId=".$this->iDistributionId."\n";
+                    $sSubject = "Distribution ".$this->sName." added by ".
+                            $_SESSION['current']->sRealname;
+                    $sMsg  = $this->objectMakeUrl."\n";
                     if($this->iSubmitterId)
                     {
                         $oSubmitter = new User($this->iSubmitterId);
@@ -307,7 +308,7 @@ class distribution {
             break;
             case "edit":
                 $sSubject =  "Distribution ".$this->sName." has been modified by ".$_SESSION['current']->sRealname;
-                $sMsg  = APPDB_ROOT."distributionView.php?iDistributionId=".$this->iDistributionId."\n";
+                $sMsg  = $this->objectMakeUrl()."\n";
                 addmsg("Distribution modified.", "green");
             break;
             case "delete":
@@ -323,8 +324,9 @@ class distribution {
                 addmsg("Distribution deleted.", "green");
             break;
             case "reject":
-                $sSubject = "Distribution '".$this->sName." has been rejected by ".$_SESSION['current']->sRealname;
-                $sMsg  = APPDB_ROOT."distributionView.php?iDistributionId=".$this->iDistributionId."\n";
+                $sSubject = "Distribution '".$this->sName." has been rejected by ".
+                        $_SESSION['current']->sRealname;
+                $sMsg  = $this->objectMakeUrl()."\n";
 
                  // if sReplyText is set we should report the reason the data was rejected 
                 if($aClean['sReplyText'])
@@ -549,6 +551,19 @@ class distribution {
             echo '</table>',"\n";
         }
     }
+
+    /* Make a URL for viewing the specified distribution */
+    function objectMakeUrl()
+    {
+        $oObject = new objectManager("distribution", "View Distribution");
+        return $oObject->makeUrl("view", $this->iDistributionId);
+    }
+
+    /* Make an HTML link for viewing the specified distirbution */
+    function objectMakeLink()
+    {
+        return "<a href=\"".$this->objectMakeUrl()."\">$this->sName</a>";
+    }
 }
 
 ?>
Index: appdb/include/incl.php
diff -u -p appdb/include/incl.php:1.41 appdb/include/incl.php:1.42
--- appdb/include/incl.php:1.41	13 Mar 2007 21: 3: 8 -0000
+++ appdb/include/incl.php	13 Mar 2007 21: 3: 8 -0000
@@ -13,6 +13,7 @@ require(BASE."include/menu.php");
 require(BASE."include/html.php");
 require(BASE."include/error_log.php");
 require(BASE."include/query.php");
+require_once(BASE."include/objectManager.php");
 
 /* if magic quotes are enabled make sure the user disables them */
 /* otherwise they will see all kinds of odd effects that are difficult */
Index: appdb/include/testData.php
diff -u -p appdb/include/testData.php:1.21 appdb/include/testData.php:1.22
--- appdb/include/testData.php:1.21	13 Mar 2007 21: 3: 8 -0000
+++ appdb/include/testData.php	13 Mar 2007 21: 3: 8 -0000
@@ -446,8 +446,7 @@ class testData{
             }
 
             echo '    <td>',"\n";
-            echo '<a href="'.BASE.'distributionView.php?iDistributionId='.$oTest->iDistributionId.'">',"\n";
-            echo $oDistribution->sName.'</a>',"\n";
+            echo $oDistribution->objectMakeLink()."\n";
             echo '    </td>',"\n";
             echo '    <td>'.date("M d Y", mysqldatetime_to_unixtimestamp($oTest->sTestedDate)).'</td>',"\n";
             echo '    <td>'.$oTest->sTestedRelease.'&nbsp</td>',"\n";



More information about the wine-cvs mailing list