queued items: fix editing applications' vendors & versions

This commit is contained in:
Alexander Nicolaysen Sørnes
2008-10-02 00:30:34 +02:00
committed by Chris Morgan
parent 4a9c24d596
commit 6eccc11979
2 changed files with 15 additions and 5 deletions

View File

@@ -580,9 +580,17 @@ class Application {
"using the form below.";
} else
{
$sVendorHelp .= "The user added a new one; review ".
"it in the vendor form below or ".
"replace it with an existing one.";
if($this->iSubmitterId != $_SESSION['current']->iUserId)
{
$sVendorHelp .= "The user added a new one; review ".
"it in the vendor form below or ".
"replace it with an existing one.";
} else
{
$sVendorHelp .= 'You added a new one; it can be edited '.
'using the form below, or replaced with '.
'one from this list.';
}
}
}
// vendor name

View File

@@ -23,11 +23,13 @@ class application_queue
{
/* Normal users do not get a aVersionsIds property, so we have to fetch
the versionId manually. Normal users only have access to rejected
applications */
applications, unless they submitted them */
if($_SESSION['current']->hasPriv("admin"))
{
$iVersionId = $this->oApp->aVersionsIds[0];
} else if($this->oApp->objectGetState() == 'rejected')
} else if($this->oApp->objectGetState() == 'rejected' ||
($this->oApp->objectGetState() == 'queued' &&
$this->oApp->objectGetSubmitterId() == $_SESSION['current']->iUserId))
{
$sQuery = "SELECT versionId FROM appVersion WHERE appId = '?' LIMIT 1";
$hResult = query_parameters($sQuery, $this->oApp->iAppId);