This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/include/testData_queue.php

208 lines
5.5 KiB
PHP
Raw Normal View History

2007-04-16 23:10:08 +00:00
<?php
class testData_queue
{
var $oTestData;
var $oDistribution;
function testData_queue($iTestId = null, $oRow = null)
2007-04-16 23:10:08 +00:00
{
$this->oTestData = new testData($iTestId, $oRow);
2007-04-16 23:10:08 +00:00
$this->oDistribution = new distribution($this->oTestData->iDistributionId);
}
function create()
{
if(!$this->oTestData->iDistributionId)
{
$this->oDistribution->create();
$this->oTestData->iDistributionId = $this->oDistribution->iDistributionId;
}
2007-04-19 23:19:24 +00:00
return $this->oTestData->create();
}
function delete()
{
$bSuccess = $this->oTestData->delete();
/* We delete the distribution if it has not been approved and is not associated
with any other testData. Otherwise we would have to have a distribution
queue for admins to clean up unused, queued entries */
$this->oDistribution = new distribution($this->oDistribution->iDistributionId);
if(!sizeof($this->oDistribution->aTestingIds) &&
$this->oDistribution->canEdit())
$this->oDistribution->delete();
return $bSuccess;
2007-04-19 23:19:24 +00:00
}
function reQueue()
{
$this->oTestData->reQueue();
if($this->oDistribution->sQueued == "rejected")
$this->oDistribution->reQueue();
}
2007-04-19 23:19:24 +00:00
function unQueue()
{
$this->oTestData->unQueue();
/* Avoid a misguiding message about the distribution being unqueued */
if($this->oDistribution->sQueued != "false")
$this->oDistribution->unQueue();
2007-04-16 23:10:08 +00:00
}
function reject()
{
$this->oTestData->reject();
}
2007-04-16 23:10:08 +00:00
function update()
{
$this->oTestData->update();
/* If the distribution was already un-queued the form for editing it would
not have been displayed and getOutputEditorValues() wouldn't have
retrieved a valid sName for the distribution. If sName isn't valid
we shouldn't update the distribution */
if($this->oDistribution->sName)
$this->oDistribution->update();
2007-04-16 23:10:08 +00:00
}
function outputEditor()
{
$this->oTestData->outputEditor();
/* If we are processing queued test results with a queued distribution,
we display some additional help here */
if($this->oDistribution->iDistributionId &&
$this->oDistribution->sQueued != "false" && $this->canEdit())
2007-04-19 23:19:24 +00:00
{
echo "The user submitted a new distribution, which will be un-queued ".
"together with the test data unless you select an existing one ".
"from the list above.";
2007-04-19 23:19:24 +00:00
}
/* If the testData is already associated with a distribution and the
distribution is un-queued, there is no need to display the
distribution form here */
if(!$this->oTestData->iDistributionId or
$this->oDistribution->sQueued != "false")
{
echo html_frame_start("New Distribution", "90%");
2007-04-16 23:10:08 +00:00
$this->oDistribution->outputEditor();
echo html_frame_end();
}
2007-04-16 23:10:08 +00:00
}
function getOutputEditorValues($aClean)
{
$this->oTestData->getOutputEditorValues($aClean);
$this->oDistribution->getOutputEditorValues($aClean);
}
function checkOutputEditorInput($aClean)
{
return $this->oTestData->checkOutputEditorInput($aClean);
}
function canEdit()
{
return $this->oTestData->canEdit();
}
function mustBeQueued()
{
return $this->oTestData->mustBeQueued();
}
2007-04-16 23:10:08 +00:00
function objectDisplayAddItemHelp()
{
$this->oTestData->objectDisplayAddItemHelp();
}
2007-04-19 23:19:24 +00:00
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "testingId")
2007-04-19 23:19:24 +00:00
{
return $this->oTestData->objectGetEntries($bQueued, $bRejected, $iRows, $iStart, $sOrderBy);
}
function objectGetEntriesCount($bQueued, $bRejected)
{
return testData::objectGetEntriesCount($bQueued, $bRejected);
2007-04-19 23:19:24 +00:00
}
function objectGetHeader()
{
return $this->oTestData->objectGetHeader();
}
function objectGetTableRow()
2007-04-19 23:19:24 +00:00
{
return $this->oTestData->objectGetTableRow();
2007-04-19 23:19:24 +00:00
}
function objectDisplayQueueProcessingHelp()
{
$oTest = new testData();
$oTest->objectDisplayQueueProcessingHelp();
2007-04-19 23:19:24 +00:00
}
2007-09-25 02:43:35 +02:00
function objectShowPreview()
{
return $this->oTestData->objectShowPreview();
}
2007-04-19 23:19:24 +00:00
function display()
{
return $this->oTestData->display();
2007-04-19 23:19:24 +00:00
}
function objectMakeUrl()
{
return $this->oTestData->objectMakeUrl();
2007-04-19 23:19:24 +00:00
}
function objectMakeLink()
{
return $this->oTestData->objectMakeLink();
2007-04-19 23:19:24 +00:00
}
function allowAnonymousSubmissions()
{
return testData::allowAnonymousSubmissions();
}
function objectGetItemsPerPage($bQueued = false)
{
return testData::objectGetItemsPerPage($bQueued);
}
function objectGetId()
{
return $this->oTestData->objectGetId();
}
function objectGetSubmitterId()
{
return $this->oTestData->objectGetSubmitterId();
}
function objectGetChildren()
{
return $this->oTestData->objectGetChildren();
}
function objectGetMailOptions($sAction, $bMailSubmitter, $bParentAction)
{
return $this->oTestData->objectGetMailOptions($sAction, $bMailSubmitter, $bParentAction);
}
function objectGetMail($sAction, $bMailSubmitter, $bParentAction)
{
return $this->oTestData->objectGetMail($sAction, $bMailSubmitter, $bParentAction);
}
2007-04-16 23:10:08 +00:00
}
?>