Allow maintainers/administrators to reject an application submission instead of just deleting it
This commit is contained in:
@@ -168,7 +168,7 @@ if ($_REQUEST['sub'])
|
||||
echo '<td><input type=text name="versionName" value="'.$oVersion->sName.'" size="20"></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>Description</b></td>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="versionDescription">'.$oVersion->sDescription.'</textarea></p></td></tr>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="versionDescription">'.stripslashes($oVersion->sDescription).'</textarea></p></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class="color0"><b>email Text</b></td>',"\n";
|
||||
echo '<td><textarea name="replyText" rows="10" cols="35"></textarea></td></tr>',"\n";
|
||||
@@ -177,7 +177,8 @@ if ($_REQUEST['sub'])
|
||||
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
|
||||
echo '<input type="hidden" name="versionId" value="'.$oVersion->iVersionId.'" />';
|
||||
echo '<input type="submit" value=" Submit Version Into Database " class="button"> ',"\n";
|
||||
echo '<input name="sub" type=submit value="Delete" class="button"></td></tr>',"\n";
|
||||
echo '<input name="sub" type=submit value="Delete" class="button">',"\n";
|
||||
echo '<input name="sub" type=submit value="Reject" class="button"></td></tr>',"\n";
|
||||
echo '</table></form>',"\n";
|
||||
} else // application
|
||||
{
|
||||
@@ -273,7 +274,7 @@ if ($_REQUEST['sub'])
|
||||
|
||||
// application desc
|
||||
echo '<tr valign=top><td class=color0><b>Application Description</b></td>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="applicationDescription">'.$oApp->sDescription.'</textarea></p></td></tr>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" name="applicationDescription">'.stripslashes($oApp->sDescription).'</textarea></p></td></tr>',"\n";
|
||||
|
||||
// version name
|
||||
echo '<tr valign=top><td class="color0"><b>Version name</b></td>',"\n";
|
||||
@@ -281,7 +282,7 @@ if ($_REQUEST['sub'])
|
||||
|
||||
// version description
|
||||
echo '<tr valign=top><td class=color0><b>Version Description</b></td>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor2" name="versionDescription">'.$oVersion->sDescription.'</textarea></p></td></tr>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="versionDescription">'.stripslashes($oVersion->sDescription).'</textarea></p></td></tr>',"\n";
|
||||
|
||||
|
||||
echo '<tr valign=top><td class="color0"><b>email Text</b></td>',"\n";
|
||||
@@ -291,6 +292,7 @@ if ($_REQUEST['sub'])
|
||||
echo '<input type="hidden" name="appId" value="'.$oApp->iAppId.'" />';
|
||||
echo '<input type=submit value=" Submit App Into Database " class=button> ',"\n";
|
||||
echo '<input name="sub" type="submit" value="Delete" class="button" />',"\n";
|
||||
echo '<input name="sub" type="submit" value="Reject" class="button" />',"\n";
|
||||
echo '</td></tr>',"\n";
|
||||
echo '</table></form>',"\n";
|
||||
}
|
||||
@@ -363,6 +365,34 @@ if ($_REQUEST['sub'])
|
||||
|
||||
redirect(apidb_fullurl("admin/adminAppQueue.php"));
|
||||
}
|
||||
else if ($_REQUEST['sub'] == 'Reject')
|
||||
{
|
||||
if (is_numeric($_REQUEST['appId']) && !is_numeric($_REQUEST['versionId'])) // application
|
||||
{
|
||||
// get the queued versions that refers to the application entry we just removed
|
||||
// and delete them as we implicitly added a version entry when adding a new application
|
||||
$sQuery = "SELECT versionId FROM appVersion WHERE appVersion.appId = '".$_REQUEST['appId']."' AND appVersion.queued = 'true';";
|
||||
$hResult = query_appdb($sQuery);
|
||||
if($hResult)
|
||||
{
|
||||
while($oRow = mysql_fetch_object($hResult))
|
||||
{
|
||||
$oVersion = new Version($oRow->versionId);
|
||||
$oVersion->reject(true);
|
||||
}
|
||||
}
|
||||
|
||||
// delete the application entry
|
||||
$oApp = new Application($_REQUEST['appId']);
|
||||
$oApp->reject();
|
||||
} else if(is_numeric($_REQUEST['versionId'])) // version
|
||||
{
|
||||
$oVersion = new Version($_REQUEST['versionId']);
|
||||
$oVersion->reject();
|
||||
}
|
||||
|
||||
redirect(apidb_fullurl("admin/adminAppQueue.php"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//error no sub!
|
||||
|
||||
Reference in New Issue
Block a user