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

243 lines
6.5 KiB
PHP
Raw Permalink 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();
}
2007-12-12 22:43:22 +01:00
function purge()
{
$bSuccess = $this->oTestData->purge();
/* 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->purge();
return $bSuccess;
}
2007-04-19 23:19:24 +00:00
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();
2007-12-12 19:07:38 +01:00
$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->objectGetState() != 'accepted')
$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->objectGetState() != 'accepted' && $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->objectGetState() != 'accepted')
{
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);
}
2008-01-23 14:18:43 +01:00
function objectGetState()
{
return $this->oTestData->objectGetState();
}
2007-04-16 23:10:08 +00:00
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
public static function objectGetDefaultSort()
2007-04-19 23:19:24 +00:00
{
return testData::objectGetDefaultSort();
}
function objectGetEntries($sState, $iRows = 0, $iStart = 0, $sOrderBy = "testingId", $bAscending = true)
{
return $this->oTestData->objectGetEntries($sState, $iRows, $iStart, $sOrderBy, $bAscending);
}
function objectGetEntriesCount($sState)
{
return testData::objectGetEntriesCount($sState);
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 objectAllowPurgingRejected()
{
return $this->oTestData->objectAllowPurgingRejected();
}
public function objectGetSubmitTime()
{
return $this->oTestData->objectGetSubmitTime();
}
function objectGetItemsPerPage($sState = 'accepted')
{
return testData::objectGetItemsPerPage($sState);
}
function objectGetId()
{
return $this->oTestData->objectGetId();
}
function objectGetSubmitterId()
{
return $this->oTestData->objectGetSubmitterId();
}
2007-12-12 22:43:22 +01:00
function objectGetChildren($bIncludeDeleted = false)
{
2007-12-12 22:43:22 +01:00
return $this->oTestData->objectGetChildren($bIncludeDeleted);
}
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
}
?>