2005-10-17 03:59:24 +00:00
|
|
|
<?php
|
|
|
|
|
/*************************************/
|
|
|
|
|
/* code to View and resubmit Apps */
|
|
|
|
|
/*************************************/
|
|
|
|
|
|
2006-07-07 18:14:53 +00:00
|
|
|
require("path.php");
|
2005-10-17 03:59:24 +00:00
|
|
|
require(BASE."include/incl.php");
|
2006-07-07 18:14:53 +00:00
|
|
|
require_once(BASE."include/tableve.php");
|
|
|
|
|
require_once(BASE."include/application.php");
|
|
|
|
|
require_once(BASE."include/version.php");
|
2006-07-12 00:29:35 +00:00
|
|
|
require_once(BASE."include/testData.php");
|
2005-10-17 03:59:24 +00:00
|
|
|
require_once(BASE."include/distributions.php");
|
|
|
|
|
|
2006-06-17 06:10:10 +00:00
|
|
|
$aClean = array();
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
|
2006-06-17 06:10:10 +00:00
|
|
|
$aClean['iTestingId'] = makeSafe($_REQUEST['iTestingId']);
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if ($aClean['sSub'])
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
2006-06-17 06:10:10 +00:00
|
|
|
$oTest = new testData($aClean['iTestingId']);
|
2006-01-23 02:10:31 +00:00
|
|
|
$oVersion = new Version($oTest->iVersionId);
|
|
|
|
|
if(!($_SESSION['current']->hasAppVersionModifyPermission($oVersion)))
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Insufficient privileges.");
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if(($aClean['sSub'] == 'Submit') || ($aClean['sSub'] == 'Save') ||
|
|
|
|
|
($aClean['sSub'] == 'Reject') || ($aClean['sSub'] == 'Delete'))
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
2006-06-17 06:10:10 +00:00
|
|
|
if(is_numeric($aClean['iTestingId']))
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
2006-06-17 06:10:10 +00:00
|
|
|
$oTest = new testData($aClean['iTestingId']);
|
2006-07-08 22:06:28 +00:00
|
|
|
$oTest->GetOutputEditorValues($_REQUEST);
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sSub'] == 'Submit') // submit the testing results
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
|
|
|
|
$oTest->update(true);
|
|
|
|
|
$oTest->unQueue();
|
2006-07-06 17:27:54 +00:00
|
|
|
} else if($aClean['sSub'] == 'Save') // save the testing results
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
|
|
|
|
$oTest->update();
|
2006-07-06 17:27:54 +00:00
|
|
|
} else if($aClean['sSub'] == 'Reject') // reject testing results
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
|
|
|
|
$oTest->update(true);
|
|
|
|
|
$oTest->Reject();
|
2006-07-06 17:27:54 +00:00
|
|
|
} else if($aClean['sSub'] == 'Delete') // delete testing results
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
|
|
|
|
$oTest->delete();
|
|
|
|
|
}
|
|
|
|
|
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit($_SERVER['PHP_SELF']);
|
2005-10-17 03:59:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-06-17 06:10:10 +00:00
|
|
|
if(is_numeric($aClean['iTestingId']))
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
2006-06-17 06:10:10 +00:00
|
|
|
$oTest = new testData($aClean['iTestingId']);
|
2005-10-17 03:59:24 +00:00
|
|
|
}
|
2005-10-30 22:29:14 +00:00
|
|
|
$oVersion = new Version($oTest->iVersionId);
|
|
|
|
|
$oApp = new application($oVersion->iAppId);
|
|
|
|
|
$sVersionInfo = $oApp->sName." ".$oVersion->sName;
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if ($aClean['sSub'] == 'view')
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
|
|
|
|
switch($oTest->sQueued)
|
|
|
|
|
{
|
|
|
|
|
case "true":
|
2005-10-30 22:29:14 +00:00
|
|
|
apidb_header("Edit new testing results for ".$sVersionInfo);
|
|
|
|
|
break;
|
2005-10-17 03:59:24 +00:00
|
|
|
case "rejected":
|
2005-10-30 22:29:14 +00:00
|
|
|
apidb_header("Edit rejected testing results for ".$sVersionInfo);
|
2005-10-17 03:59:24 +00:00
|
|
|
break;
|
2005-10-30 22:29:14 +00:00
|
|
|
case "false":
|
|
|
|
|
apidb_header("Edit testing results for ".$sVersionInfo);
|
2005-10-17 03:59:24 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2006-07-11 03:39:18 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<form name="sQform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
// View Testing Details
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
2005-10-30 22:29:14 +00:00
|
|
|
|
|
|
|
|
//help
|
|
|
|
|
echo "<div align=center><table width='100%' border=0 cellpadding=3 cellspacing=0><tr><td>\n\n";
|
|
|
|
|
switch($oTest->sQueued)
|
|
|
|
|
{
|
|
|
|
|
case "false":
|
|
|
|
|
echo "<p>This Testing result has already been verified and accepted int the database. \n";
|
|
|
|
|
echo "You can edit the entry and the save it back to the database by clicking on save. \n";
|
|
|
|
|
break;
|
|
|
|
|
case "true":
|
|
|
|
|
echo "<p>This Testing result has not yet been and accepted into the database. \n";
|
|
|
|
|
echo "You can edit the entry and ether submit it into the database by clicking on Submit or you can reject it \n";
|
|
|
|
|
echo "for further editing by the submitter by clicking on Reject. \n";
|
|
|
|
|
break;
|
|
|
|
|
case "rejected":
|
|
|
|
|
echo "<p>This Testing result has been rejected and is awaiting further information from the submitter. \n";
|
|
|
|
|
echo "You can edit the entry and ether submit it into the database by clicking on Submit or you can save it \n";
|
|
|
|
|
echo "for further editing by the submitter by clicking on Save. \n";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
echo "<p>Click delete to remove it entirly from the database. An email will automatically be sent to the\n";
|
|
|
|
|
echo "submitter to let them know the item was deleted.</p>\n\n";
|
|
|
|
|
echo "</td></tr></table></div>\n\n";
|
|
|
|
|
|
2006-07-11 03:39:18 +00:00
|
|
|
echo html_back_link(1, $_SERVER['PHP_SELF']);
|
|
|
|
|
|
2005-10-17 03:59:24 +00:00
|
|
|
$oTest->OutputEditor();
|
2006-02-22 02:17:54 +00:00
|
|
|
echo html_frame_start("Reply text", "90%", "", 0);
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
|
|
|
|
echo '<tr valign=top><td class="color0"><b>email Text</b></td>',"\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<td><textarea name="sReplyText" style="width: 100%" cols="80" rows="10"></textarea></td></tr>',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
|
|
|
|
|
|
|
|
|
|
// Submit Buttons
|
|
|
|
|
switch($oTest->sQueued)
|
|
|
|
|
{
|
|
|
|
|
case "false":
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<input name="sSub" type="submit" value="Save" class="button" > ',"\n";
|
|
|
|
|
echo '<input name="sSub" type="submit" value="Delete" class="button" >',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
break;
|
|
|
|
|
case "true":
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<input name="sSub" type="submit" value="Submit" class="button" > ',"\n";
|
|
|
|
|
echo '<input name="sSub" type="submit" value="Reject" class="button" > ',"\n";
|
|
|
|
|
echo '<input name="sSub" type="submit" value="Delete" class="button" >',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
break;
|
|
|
|
|
case "rejected":
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<input name="sSub" type="submit" value="Submit" class="button" > ',"\n";
|
|
|
|
|
echo '<input name="sSub" type="submit" value="Save" class="button" > ',"\n";
|
|
|
|
|
echo '<input name="sSub" type="submit" value="Delete" class="button" >',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
echo '</td></tr>',"\n";
|
2006-02-22 02:17:54 +00:00
|
|
|
echo '</table>',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
echo '</form>',"\n";
|
2006-02-22 02:17:54 +00:00
|
|
|
echo html_frame_end();
|
|
|
|
|
|
2006-07-11 03:39:18 +00:00
|
|
|
echo html_back_link(1, $_SERVER['PHP_SELF']);
|
2005-10-17 03:59:24 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// error no sub!
|
|
|
|
|
addmsg("Internal Routine Not Found!!", "red");
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit($_SERVER['PHP_SELF']);
|
2005-10-17 03:59:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
2006-07-06 17:27:54 +00:00
|
|
|
else // if ($aClean['sSub']) is not defined, display the Testing results queue page
|
2005-10-17 03:59:24 +00:00
|
|
|
{
|
|
|
|
|
$oTest = new TestData();
|
|
|
|
|
apidb_header("Testing Results");
|
|
|
|
|
|
|
|
|
|
// Get queued testing results.
|
|
|
|
|
|
|
|
|
|
$hResult = $oTest->getTestingQueue("true");
|
|
|
|
|
if(!$hResult)
|
|
|
|
|
{
|
|
|
|
|
//no apps in queue
|
|
|
|
|
echo html_frame_start("Submitted Testing Results","90%");
|
2006-01-28 23:00:35 +00:00
|
|
|
echo '<p><b>The Submitted Testing Results Queue is empty.</b></p>',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
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 test results waiting for submition, rejection or deletion.</p>\n";
|
|
|
|
|
echo "<p>To view a submission, click on its name. From that page you can Submit it into \n";
|
|
|
|
|
echo "the AppDB reject it or delete it.<br>\n";
|
|
|
|
|
echo "</td></tr></table></div>\n\n";
|
|
|
|
|
|
|
|
|
|
$oTest->ShowListofTests($hResult,"Submitted Testing Results");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get rejected testing results.
|
|
|
|
|
$hResult = $oTest->getTestingQueue("rejected");
|
|
|
|
|
if(!$hResult || !mysql_num_rows($hResult))
|
|
|
|
|
{
|
|
|
|
|
//no rejected test results in queue
|
|
|
|
|
echo html_frame_start("Rejected Testing Results","90%");
|
2006-01-28 23:00:35 +00:00
|
|
|
echo '<p><b>The Rejected Testing Results Queue is empty.</b></p>',"\n";
|
2005-10-17 03:59:24 +00:00
|
|
|
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 test results that have been rejected for some reason.</p>\n";
|
|
|
|
|
echo "<p>To view a submission, click on its name. From that page you can Submit it into \n";
|
|
|
|
|
echo "the AppDB, edit and save it or delete it.<br>\n";
|
|
|
|
|
echo "</td></tr></table></div>\n\n";
|
|
|
|
|
|
|
|
|
|
$oTest->ShowListofTests($hResult,"Rejected Testing Results");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
apidb_footer();
|
|
|
|
|
?>
|