ChangeSet ID: 31343
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/23 22:49:33
Modified files:
include : distribution.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Enable deletion of a distribution's test results along with the distribution, if the user has
admin privileges.
Patch: http://cvs.winehq.org/patch.py?id=31343
Old revision New revision Changes Path
1.42 1.43 +9 -4 appdb/include/distribution.php
Index: appdb/include/distribution.php
diff -u -p appdb/include/distribution.php:1.42 appdb/include/distribution.php:1.43
--- appdb/include/distribution.php:1.42 24 Aug 2007 3:49:33 -0000
+++ appdb/include/distribution.php 24 Aug 2007 3:49:33 -0000
@@ -151,11 +151,16 @@ class distribution {
$this->sQueued != "false")))
return false;
- /* Check for associated test results */
- if(sizeof($this->aTestingIds))
+ // if the distribution has test results only enable an admin to delete
+ // the distribution
+ if(sizeof($this->aTestingIds) && !$_SESSION['current']->hasPriv("admin"))
+ return FALSE;
+
+ // delete any test results this distribution has
+ foreach($this->aTestingIds as $iTestId)
{
- addmsg("This distribution still has associated test results", "red");
- return FALSE;
+ $oTestData = new TestData($iTestId);
+ $oTestData->delete();
}
// now delete the Distribution
ChangeSet ID: 31342
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/23 22:17:25
Modified files:
. : appview.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Create a version instance from $aClean['iVersionId'], if $aClean['iVersionId'] is set. We use
this version instance in several sets of logic. Fixes bug 9275.
Patch: http://cvs.winehq.org/patch.py?id=31342
Old revision New revision Changes Path
1.103 1.104 +5 -0 appdb/appview.php
Index: appdb/appview.php
diff -u -p appdb/appview.php:1.103 appdb/appview.php:1.104
--- appdb/appview.php:1.103 24 Aug 2007 3:17:25 -0000
+++ appdb/appview.php 24 Aug 2007 3:17:25 -0000
@@ -76,6 +76,11 @@ if(empty($aClean['iAppId']) && empty($aC
if (isset($aClean['sSub']))
{
+ // create the version object if iVersionId is set
+ // we use this version object in many of the below cases
+ if(isset($aClean['iVersionId']))
+ $oVersion = new Version($aClean['iVersionId']);
+
if(($aClean['sSub'] == 'delete' ) && ($aClean['iBuglinkId']))
{
if(($_SESSION['current']->hasPriv("admin") ||
ChangeSet ID: 31341
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/23 21:54:07
Modified files:
include : version.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Fix $bSilent parameter for comment::delete() to be 'true', which makes the deletion silent.
Fixes previous commit.
Patch: http://cvs.winehq.org/patch.py?id=31341
Old revision New revision Changes Path
1.147 1.148 +1 -1 appdb/include/version.php
Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.147 appdb/include/version.php:1.148
--- appdb/include/version.php:1.147 24 Aug 2007 2:54: 7 -0000
+++ appdb/include/version.php 24 Aug 2007 2:54: 7 -0000
@@ -259,7 +259,7 @@ class version {
// delete the comment silently, we don't want to send out
// any notifications since the version is being deleted
- $oComment->delete(false);
+ $oComment->delete(true);
}
ChangeSet ID: 31339
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/23 21:10:23
Modified files:
include : objectManager.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Add page selection control at the bottom of pages, without the items per-page selector. Fix
objectMananger::handleMultiPageControls() to not display the items per-page selector if
the $bItemsPerPageSelector input parameter is false.
Patch: http://cvs.winehq.org/patch.py?id=31339
Old revision New revision Changes Path
1.48 1.49 +29 -16 appdb/include/objectManager.php
Index: appdb/include/objectManager.php
diff -u -p appdb/include/objectManager.php:1.48 appdb/include/objectManager.php:1.49
--- appdb/include/objectManager.php:1.48 24 Aug 2007 2:10:23 -0000
+++ appdb/include/objectManager.php 24 Aug 2007 2:10:23 -0000
@@ -95,8 +95,8 @@ class ObjectManager
$oObject = new $this->sClass();
- /* Display selectors for items per page and current page, if applicable. The function
- returns FALSE or an array of arguments to be passed to objectGetEntries() */
+ // Display top of the page selectors for items per page and
+ // current page, if applicable.
$this->handleMultiPageControls($aClean, TRUE);
/* query the class for its entries */
@@ -192,6 +192,11 @@ class ObjectManager
echo "<br /><br /><a href=\"".$this->makeUrl("add", false,
"Add $this->sClass")."\">Add entry</a>\n";
}
+
+ // Display bottom of page selectors current page, if applicable
+ // NOTE: second parameter is false because we don't want the
+ // items per page selector appearing for the second set of page controls
+ $this->handleMultiPageControls($aClean, FALSE);
}
/* display the entry for editing */
@@ -704,24 +709,32 @@ class ObjectManager
$iItemsPerPage = $iDefaultPerPage;
- if ( isset($aClean['iItemsPerPage']) && in_array($aClean['iItemsPerPage'], $aItemsPerPage) )
+ if ( isset($aClean['iItemsPerPage']) &&
+ in_array($aClean['iItemsPerPage'], $aItemsPerPage) )
+ {
$iItemsPerPage = $aClean['iItemsPerPage'];
+ }
- $sControls = "<form action=\"".$this->makeUrl()."\" method=\"get\">";
-
- /* Fill in form data for the objectManager URL */
- $sControls .= $this->makeUrlFormData();
- $sControls .= "<p><b> Items per page</b>";
- $sControls .= "<select name=\"iItemsPerPage\" />";
+ // if $bItemsPerPageSelector is true, display the items
+ // per-page dropdown and update button
+ if($bItemsPerPageSelector)
+ {
+ $sControls = "<form action=\"".$this->makeUrl()."\" method=\"get\">";
+
+ /* Fill in form data for the objectManager URL */
+ $sControls .= $this->makeUrlFormData();
+ $sControls .= "<p><b> Items per page</b>";
+ $sControls .= "<select name=\"iItemsPerPage\" />";
- foreach($aItemsPerPage as $iNum)
- {
- $sSelected = ($iNum == $iItemsPerPage) ? ' selected="selected"' : "";
- $sControls .= "<option$sSelected>$iNum</option>";
+ foreach($aItemsPerPage as $iNum)
+ {
+ $sSelected = ($iNum == $iItemsPerPage) ? ' selected="selected"' : "";
+ $sControls .= "<option$sSelected>$iNum</option>";
+ }
+ $sControls .= "</select>";
+ $sControls .= " <input type=\"submit\" value=\"Update\" />";
+ $sControls .= "</form></p>";
}
- $sControls .= "</select>";
- $sControls .= " <input type=\"submit\" value=\"Update\" />";
- $sControls .= "</form></p>";
$iTotalEntries = $oObject->objectGetEntriesCount($this->bIsQueue, $this->bIsRejected);
$iNumPages = ceil($iTotalEntries / $iItemsPerPage);