appdb/ ./appsubmit.php include/sidebar_login.p ...
WineHQ
wineowner at wine.codeweavers.com
Sat Apr 21 13:00:46 CDT 2007
ChangeSet ID: 31071
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner at winehq.org 2007/04/21 13:00:46
Modified files:
. : appsubmit.php
include : sidebar_login.php version.php
Log message:
Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Use objectManager to display a user's rejected versions
Patch: http://cvs.winehq.org/patch.py?id=31071
Old revision New revision Changes Path
1.66 1.67 +0 -26 appdb/appsubmit.php
1.25 1.26 +13 -4 appdb/include/sidebar_login.php
1.116 1.117 +27 -44 appdb/include/version.php
Index: appdb/appsubmit.php
diff -u -p appdb/appsubmit.php:1.66 appdb/appsubmit.php:1.67
--- appdb/appsubmit.php:1.66 21 Apr 2007 18: 0:46 -0000
+++ appdb/appsubmit.php 21 Apr 2007 18: 0:46 -0000
@@ -449,32 +449,6 @@ else // if ($aClean['sSub']) is not defi
Application::showList($hResult);
}
- // get queued versions (only versions where application are not queued already)
- $hResult = $_SESSION['current']->getAppRejectQueueQuery(false); // query for the app version
-
- if(!$hResult || !mysql_num_rows($hResult))
- {
- //no apps in queue
- echo html_frame_start("Version Queue","90%");
- echo '<p><b>The Resubmit Version Queue is empty.</b></p>',"\n";
- echo html_frame_end(" ");
- }
- else
- {
- //help
- echo "<div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td>\n\n";
- echo "<p>This is the list of versions waiting for re-submission or deletion.</p>\n";
- echo "<p>To view a submission, click on its name. From that page you can delete or edit and re-submit it into \n";
- echo "the AppDB .<br>\n";
- echo "<p>Note that versions linked to application that have not been approved yet are not displayed in this list.</p>\n";
- echo "the AppDB.<br>\n";
- echo "</td></tr></table></div>\n\n";
-
- //show Version list
- Version::showList($hResult);
-
-
- }
apidb_footer();
}
Index: appdb/include/sidebar_login.php
diff -u -p appdb/include/sidebar_login.php:1.25 appdb/include/sidebar_login.php:1.26
--- appdb/include/sidebar_login.php:1.25 21 Apr 2007 18: 0:46 -0000
+++ appdb/include/sidebar_login.php 21 Apr 2007 18: 0:46 -0000
@@ -39,12 +39,21 @@ function global_sidebar_login() {
}
}
- /* Display the user's rejected applications/versions */
- $iAppsRejected = application::objectGetEntriesCount(true, true) +
- version::objectGetEntriesCount(true, true);
+ /* Display the user's rejected applications */
+ $iAppsRejected = application::objectGetEntriesCount(true, true);
if($iAppsRejected && !$_SESSION['current']->hasPriv("admin"))
{
- $g->add("Review Rejected Apps ($iAppsRejected)", BASE."appsubmit.php", "center");
+ $g->add("Review Rejected Apps ($iAppsRejected)", BASE."appsubmit.php",
+ "center");
+ }
+
+ /* Display the user's rejected versions */
+ $iVersionsRejected = version::objectGetEntriesCount(true, true);
+ if($iVersionsRejected && !$_SESSION['current']->hasPriv("admin"))
+ {
+ $g->add("Review Rejected Versiosn ($iVersionsRejected)",
+ BASE."objectManager.php?sClass=version_queue&bIsRejected=true".
+ "&bIsQueue=true&sTitle=Rejected+Versions", "center");
}
/* Display the user's rejected test results */
Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.116 appdb/include/version.php:1.117
--- appdb/include/version.php:1.116 21 Apr 2007 18: 0:46 -0000
+++ appdb/include/version.php 21 Apr 2007 18: 0:46 -0000
@@ -960,47 +960,6 @@ class Version {
return $sLink;
}
- function showList($hResult)
- {
- //show applist
- echo html_frame_start("","90%","",0);
- echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">
- <tr class=color4>
- <td>Submission Date</td>
- <td>Submitter</td>
- <td>Vendor</td>
- <td>Application</td>
- <td>Version</td>
- <td align=\"center\">Action</td>
- </tr>";
-
- $c = 1;
- while($oRow = mysql_fetch_object($hResult))
- {
- $oVersion = new Version($oRow->versionId);
- $oApp = new Application($oVersion->iAppId);
- $oSubmitter = new User($oVersion->iSubmitterId);
- $oVendor = new Vendor($oApp->iVendorId);
- $sVendor = $oVendor->sName;
- if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
- echo "<tr class=\"$bgcolor\">\n";
- echo " <td>".print_date(mysqltimestamp_to_unixtimestamp($oVersion->sSubmitTime))."</td>\n";
- echo " <td>\n";
- echo $oSubmitter->sEmail ? "<a href=\"mailto:".$oSubmitter->sEmail."\">":"";
- echo $oSubmitter->sRealname;
- echo $oSubmitter->sEmail ? "</a>":"";
- echo " </td>\n";
- echo " <td>".$sVendor."</td>\n";
- echo " <td>".$oApp->sName."</td>\n";
- echo " <td>".$oVersion->sName."</td>\n";
- echo " <td align=\"center\">[<a href=".$_SERVER['PHP_SELF']."?sAppType=version&sSub=view&iVersionId=".$oVersion->iVersionId.">process</a>]</td>\n";
- echo "</tr>\n\n";
- $c++;
- }
- echo "</table>\n\n";
- echo html_frame_end(" ");
- }
-
// display the versions
function display_approved($aVersionsIds)
{
@@ -1221,13 +1180,37 @@ class Version {
{
if($_SESSION['current']->hasPriv("admin"))
return TRUE;
- else if($this->iVersionId &&
- maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
- return TRUE;
+
+ else if($this->iVersionId)
+ {
+ if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
+ return TRUE;
+
+ if($this->iSubmitterId == $_SESSION['current']->iUserId)
+ return TRUE;
+
+ return FALSE;
+ }
else
return FALSE;
}
+ function mustBeQueued()
+ {
+ if($_SESSION['current']->hasPriv("admin"))
+ return FALSE;
+
+ else if($this->iVersionId)
+ {
+ if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
+ return FALSE;
+
+ return TRUE;
+ }
+ else
+ return TRUE;
+ }
+
function objectGetHeader()
{
$aCells = array(
More information about the wine-cvs
mailing list