2005-10-17 03:59:24 +00:00
< ? php
/*****************************************/
2006-12-31 19:39:41 +00:00
/* this class represents Test results */
2005-10-17 03:59:24 +00:00
/*****************************************/
2006-07-21 04:21:04 +00:00
require_once ( BASE . " include/distribution.php " );
2006-06-17 06:10:10 +00:00
require_once ( BASE . " include/util.php " );
2006-12-31 19:39:41 +00:00
// Class for handling Test History.
2005-10-17 03:59:24 +00:00
class testData {
var $iTestingId ;
var $iVersionId ;
2007-01-09 04:42:34 +00:00
var $shWhatWorks ;
var $shWhatDoesnt ;
var $shWhatNotTested ;
2005-10-17 03:59:24 +00:00
var $sTestedRelease ;
var $iDistributionId ;
var $sTestedDate ;
var $sInstalls ;
var $sRuns ;
var $sTestedRating ;
var $sComments ;
var $sSubmitTime ;
var $iSubmitterId ;
2007-12-12 20:17:27 +01:00
private $sState ;
2005-10-17 03:59:24 +00:00
// constructor, fetches the data.
2007-03-24 02:04:16 +00:00
function testData ( $iTestingId = null , $oRow = null )
2005-10-17 03:59:24 +00:00
{
// we are working on an existing test
2007-06-10 18:51:33 +00:00
if ( ! $iTestingId && ! $oRow )
return ;
// We fetch the data related to this test.
if ( ! $oRow )
2005-10-17 03:59:24 +00:00
{
2007-06-10 18:51:33 +00:00
$sQuery = " SELECT *
FROM testResults
WHERE testingId = '?' " ;
if ( $hResult = query_parameters ( $sQuery , $iTestingId ))
2007-08-03 23:27:25 +00:00
$oRow = query_fetch_object ( $hResult );
2007-06-10 18:51:33 +00:00
}
2007-03-18 22:15:06 +00:00
2007-06-10 18:51:33 +00:00
if ( $oRow )
{
$this -> iTestingId = $oRow -> testingId ;
$this -> iVersionId = $oRow -> versionId ;
$this -> shWhatWorks = $oRow -> whatWorks ;
$this -> shWhatDoesnt = $oRow -> whatDoesnt ;
$this -> shWhatNotTested = $oRow -> whatNotTested ;
$this -> sTestedDate = $oRow -> testedDate ;
$this -> iDistributionId = $oRow -> distributionId ;
$this -> sTestedRelease = $oRow -> testedRelease ;
$this -> sInstalls = $oRow -> installs ;
$this -> sRuns = $oRow -> runs ;
$this -> sTestedRating = $oRow -> testedRating ;
$this -> sComments = $oRow -> comments ;
$this -> sSubmitTime = $oRow -> submitTime ;
$this -> iSubmitterId = $oRow -> submitterId ;
2007-12-12 20:17:27 +01:00
$this -> sState = $oRow -> state ;
2005-10-17 03:59:24 +00:00
}
}
// Creates a new Test Results.
function create ()
{
2007-11-06 22:12:32 +01:00
$oVersion = new version ( $this -> iVersionId );
2007-12-12 20:56:04 +01:00
if ( $oVersion -> objectGetState () != 'accepted' )
2007-12-12 20:17:27 +01:00
$this -> sState = 'pending' ;
2007-11-06 22:12:32 +01:00
else
2007-12-12 20:17:27 +01:00
$this -> sState = $this -> mustBeQueued () ? 'queued' : 'accepted' ;
2007-11-06 22:12:32 +01:00
2006-06-24 04:20:32 +00:00
$hResult = query_parameters ( " INSERT INTO testResults (versionId, whatWorks, whatDoesnt, " .
" whatNotTested, testedDate, distributionId, testedRelease, " .
2007-07-31 23:48:22 +00:00
" installs, runs, testedRating, comments, " .
2007-12-12 20:17:27 +01:00
" submitTime, submitterId, state) " .
2007-07-31 23:48:22 +00:00
" VALUES('?', '?', '?', '?', '?', '?', '?', " .
" '?', '?', '?', '?', " .
" ?, '?', '?') " ,
2007-04-21 01:02:10 +00:00
$this -> iVersionId , $this -> shWhatWorks ,
$this -> shWhatDoesnt ,
$this -> shWhatNotTested , $this -> sTestedDate ,
$this -> iDistributionId ,
$this -> sTestedRelease , $this -> sInstalls ,
$this -> sRuns ,
2007-04-16 23:10:08 +00:00
$this -> sTestedRating , $this -> sComments ,
2007-07-31 23:48:22 +00:00
" NOW() " ,
2007-04-16 23:10:08 +00:00
$_SESSION [ 'current' ] -> iUserId ,
2007-12-12 20:17:27 +01:00
$this -> sState );
2007-04-21 01:02:10 +00:00
2006-06-24 04:20:32 +00:00
if ( $hResult )
2005-10-17 03:59:24 +00:00
{
2007-08-03 23:27:25 +00:00
$this -> iTestingId = query_appdb_insert_id ();
2005-10-17 03:59:24 +00:00
$this -> testData ( $this -> iTestingId );
$this -> SendNotificationMail ();
2007-12-25 20:01:00 +01:00
2008-01-18 23:03:54 +01:00
if ( $this -> sState == 'accepted' )
2007-12-25 20:01:00 +01:00
$oVersion -> updateRatingInfo ();
2005-10-17 03:59:24 +00:00
return true ;
}
else
2006-06-24 04:20:32 +00:00
{
addmsg ( " Error while creating test results. " , " red " );
2005-10-17 03:59:24 +00:00
return false ;
2006-06-24 04:20:32 +00:00
}
2005-10-17 03:59:24 +00:00
}
// Update Test Results.
function update ( $bSilent = false )
{
2006-12-31 19:39:41 +00:00
// is the current user allowed to update this test result?
2006-01-23 02:10:31 +00:00
$oVersion = new Version ( $this -> iVersionId );
2005-10-17 03:59:24 +00:00
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ) &&
2006-01-23 02:10:31 +00:00
! $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ) &&
2007-12-12 20:17:27 +01:00
! (( $_SESSION [ 'current' ] -> iUserId == $this -> iSubmitterId ) && $this -> sState != 'accepted' ))
2005-10-17 03:59:24 +00:00
{
return ;
}
2007-04-17 23:28:10 +00:00
$oOldTest = new testData ( $this -> iTestingId );
/* Nothing changed */
if ( $this == $oOldTest )
return TRUE ;
2007-04-22 19:38:48 +00:00
/* Provide some feedback as to what was changed . Not all fields are
interesting */
$sWhatChanged = " " ;
if ( $this -> shWhatWorks != $oOldTest -> shWhatWorks )
{
$sWhatChanged .= " What works was changed from \n ' $oOldTest->shWhatWorks ' \n " .
" to \n ' $this->shWhatWorks '. \n " ;
}
if ( $this -> shWhatDoesnt != $oOldTest -> shWhatDoesnt )
{
$sWhatChanged .= " What does not work was changed from \n ' "
. $oOldTest -> shWhatDoesnt . " ' \n to \n ' $this->shWhatDoesnt '. \n " ;
}
if ( $this -> shWhatNotTested != $oOldTest -> shWhatNotTested )
{
$sWhatChanged .= " What was not tested was changed from \n ' " .
$oOldTest -> shWhatNotTested . " ' \n to \n ' $this->shWhatNotTested '. \n " ;
}
if ( $this -> sComments != $oOldTest -> sComments )
{
$sWhatChanged .= " Extra comments was changed from \n ' " .
$oOldTest -> sComments . " ' \n to \n ' $this->sComments '. \n " ;
}
if ( $this -> iDistributionId != $oOldTest -> iDistributionId )
{
$oNewDist = new distribution ( $this -> iDistributionId );
$oOldDist = new distribution ( $oOldTest -> iDistributionId );
$sWhatChanged .= " Distribution was changed from $oOldDist->sName " .
" to $oNewDist->sName . \n " ;
}
if ( $this -> sInstalls != $oOldTest -> sInstalls )
{
$sWhatChanged .= " Installs? was changed from $oOldTest->sInstalls to " .
" $this->sInstalls . \n " ;
}
if ( $this -> sRuns != $oOldTest -> sRuns )
{
$sWhatChanged .= " Runs? was changed from $oOldTest->sRuns to " .
" $this->sRuns . \n " ;
}
2007-12-25 20:01:00 +01:00
$bUpdateRatingInfo = false ;
2007-04-22 19:38:48 +00:00
if ( $this -> sTestedRating != $oOldTest -> sTestedRating )
{
2007-12-25 20:01:00 +01:00
$bUpdateRatingInfo = true ;
2007-04-22 19:38:48 +00:00
$sWhatChanged .= " Rating was changed from $oOldTest->sTestedRating " .
" to $this->sTestedRating . \n " ;
}
if ( $this -> sTestedRelease != $oOldTest -> sTestedRelease )
{
2007-12-25 20:01:00 +01:00
$bUpdateRatingInfo = true ;
2007-04-22 19:38:48 +00:00
$sWhatChanged .= " Tested release was changed from " .
2007-04-23 23:38:30 +00:00
$oOldTest -> sTestedRelease . " to $this->sTestedRelease . \n " ;
2007-04-22 19:38:48 +00:00
}
2007-12-16 15:28:37 +01:00
if ( $this -> iVersionId != $oOldTest -> iVersionId )
{
$sWhatChanged .= 'Moved from ' . version :: fullName ( $oOldTest -> iVersionId ) . ' to ' . version :: fullName ( $this -> iVersionId ) . " \n " ;
$oNewVersion = new version ( $this -> iVersionId );
if ( $oNewVersion -> objectGetState () == 'accepted' && $this -> sState == 'pending' )
$this -> sState = 'queued' ;
2007-12-25 20:01:00 +01:00
2008-03-02 23:19:28 +01:00
$bUpdateRatingInfo = true ;
2007-12-16 15:28:37 +01:00
}
2006-07-04 03:43:06 +00:00
if ( query_parameters ( " UPDATE testResults SET
versionId = '?' ,
whatWorks = '?' ,
whatDoesnt = '?' ,
whatNotTested = '?' ,
testedDate = '?' ,
distributionId = '?' ,
testedRelease = '?' ,
installs = '?' ,
runs = '?' ,
testedRating = '?' ,
2007-12-16 15:28:37 +01:00
comments = '?' ,
state = '?'
2006-07-04 03:43:06 +00:00
WHERE testingId = '?' " ,
$this -> iVersionId ,
2007-01-09 04:42:34 +00:00
$this -> shWhatWorks ,
$this -> shWhatDoesnt ,
$this -> shWhatNotTested ,
2006-07-04 03:43:06 +00:00
$this -> sTestedDate ,
$this -> iDistributionId ,
$this -> sTestedRelease ,
$this -> sInstalls ,
$this -> sRuns ,
$this -> sTestedRating ,
$this -> sComments ,
2007-12-16 15:28:37 +01:00
$this -> sState ,
2006-06-27 19:16:27 +00:00
$this -> iTestingId ))
2005-10-17 03:59:24 +00:00
{
2008-01-27 18:27:24 +01:00
if ( $bUpdateRatingInfo && $this -> sState == 'accepted' )
2008-03-02 23:19:28 +01:00
{
if ( $this -> iVersionId != $oOldTest -> iVersionId )
{
$oNewVersion = new version ( $this -> iVersionId );
$oNewVersion -> updateRatingInfo ();
}
2008-01-27 18:27:24 +01:00
$oVersion -> updateRatingInfo ();
2008-03-02 23:19:28 +01:00
}
2008-01-27 18:27:24 +01:00
2005-10-17 03:59:24 +00:00
if ( ! $bSilent )
2007-04-22 19:38:48 +00:00
$this -> SendNotificationMail ( " edit " , $sWhatChanged );
2005-10-17 03:59:24 +00:00
return true ;
}
else
2006-06-27 19:16:27 +00:00
{
addmsg ( " Error while updating test results " , " red " );
2005-10-17 03:59:24 +00:00
return false ;
2006-06-27 19:16:27 +00:00
}
2005-10-17 03:59:24 +00:00
}
2007-12-12 22:43:22 +01:00
// Purge test results from the database
function purge ()
{
// is the current user allowed to delete this test result?
$oVersion = new Version ( $this -> iVersionId );
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ) &&
! $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ) &&
! (( $_SESSION [ 'current' ] -> iUserId == $this -> iSubmitterId ) && ! ( $this -> sState == 'accepted' )))
{
return false ;
}
// now we delete the data
$sQuery = " DELETE FROM testResults
WHERE testingId = '?'
LIMIT 1 " ;
if ( ! ( $hResult = query_parameters ( $sQuery , $this -> iTestingId )))
return false ;
return true ;
}
2006-12-31 19:39:41 +00:00
// Delete test results.
2007-09-14 23:02:12 -04:00
function delete ()
2005-10-17 03:59:24 +00:00
{
2006-12-31 19:39:41 +00:00
// is the current user allowed to delete this test result?
2006-01-23 02:10:31 +00:00
$oVersion = new Version ( $this -> iVersionId );
2005-10-17 03:59:24 +00:00
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ) &&
2006-01-23 02:10:31 +00:00
! $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ) &&
2007-12-12 20:17:27 +01:00
! (( $_SESSION [ 'current' ] -> iUserId == $this -> iSubmitterId ) && $this -> sState != 'accepted' ))
2005-10-17 03:59:24 +00:00
{
2007-07-31 03:07:39 +00:00
return false ;
2005-10-17 03:59:24 +00:00
}
2007-07-31 03:07:39 +00:00
2007-12-12 22:43:22 +01:00
// now we flag the data as deleted
$sQuery = " UPDATE testResults SET state = 'deleted'
2006-06-27 19:16:27 +00:00
WHERE testingId = '?'
2005-10-17 03:59:24 +00:00
LIMIT 1 " ;
2006-06-27 19:16:27 +00:00
if ( ! ( $hResult = query_parameters ( $sQuery , $this -> iTestingId )))
2005-10-17 03:59:24 +00:00
{
2006-12-31 19:39:41 +00:00
addmsg ( " Error removing the deleted test data! " , " red " );
2007-07-31 03:07:39 +00:00
return false ;
2005-10-17 03:59:24 +00:00
}
2007-12-25 20:01:00 +01:00
if ( $this -> sState == 'accepted' )
$oVersion -> updateRatingInfo ();
2007-07-31 03:07:39 +00:00
return true ;
2005-10-17 03:59:24 +00:00
}
2006-12-31 19:39:41 +00:00
// Move Test Data out of the queue.
2005-10-17 03:59:24 +00:00
function unQueue ()
{
2006-12-31 19:39:41 +00:00
// is the current user allowed to delete this test data?
2006-01-23 02:10:31 +00:00
$oVersion = new Version ( $this -> iVersionId );
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ) &&
! $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ))
2005-10-17 03:59:24 +00:00
{
2007-07-20 22:24:37 +00:00
return false ;
2005-10-17 03:59:24 +00:00
}
2006-12-31 19:39:41 +00:00
// If we are not in the queue, we can't move the test data out of the queue.
2007-12-12 20:17:27 +01:00
if ( $this -> sState == 'accepted' )
2005-10-17 03:59:24 +00:00
return false ;
2007-12-12 20:17:27 +01:00
if ( query_parameters ( " UPDATE testResults SET state = '?' WHERE testingId = '?' " ,
'accepted' , $this -> iTestingId ))
2005-10-17 03:59:24 +00:00
{
2007-12-12 20:17:27 +01:00
$this -> sState = 'accepted' ;
2006-12-31 19:39:41 +00:00
// we send an e-mail to interested people
2007-04-01 16:49:28 +00:00
$this -> mailSubmitter ( " add " );
2005-10-17 03:59:24 +00:00
$this -> SendNotificationMail ();
2007-07-20 22:24:37 +00:00
} else
{
return false ;
2005-10-17 03:59:24 +00:00
}
2007-07-20 22:24:37 +00:00
2007-12-25 20:01:00 +01:00
$oVersion -> updateRatingInfo ();
2007-07-20 22:24:37 +00:00
return true ;
2005-10-17 03:59:24 +00:00
}
function Reject ()
{
2006-12-31 19:39:41 +00:00
// is the current user allowed to delete this test data?
2006-01-23 02:10:31 +00:00
$oVersion = new Version ( $this -> iVersionId );
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ) &&
! $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ))
2005-10-17 03:59:24 +00:00
{
return ;
}
// If we are not in the queue, we can't move the version out of the queue.
2007-12-12 20:17:27 +01:00
if ( $this -> sState != 'queued' )
2005-10-17 03:59:24 +00:00
return false ;
2007-12-12 20:17:27 +01:00
if ( query_parameters ( " UPDATE testResults SET state = '?' WHERE testingId = '?' " ,
'rejected' , $this -> iTestingId ))
2005-10-17 03:59:24 +00:00
{
2007-12-12 20:17:27 +01:00
$this -> sState = 'rejected' ;
2006-12-31 19:39:41 +00:00
// we send an e-mail to interested people
2005-10-17 03:59:24 +00:00
$this -> mailSubmitter ( " reject " );
$this -> SendNotificationMail ( " reject " );
}
}
function ReQueue ()
{
// is the current user allowed to requeue this data
2006-01-23 02:10:31 +00:00
$oVersion = new Version ( $this -> iVersionId );
2005-10-17 03:59:24 +00:00
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ) &&
2006-01-23 02:10:31 +00:00
! $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ) &&
2005-10-17 03:59:24 +00:00
! $_SESSION [ 'current' ] -> iUserId == $this -> iSubmitterId )
{
return ;
}
2007-12-12 20:17:27 +01:00
if ( query_parameters ( " UPDATE testResults SET state = '?' WHERE testingId = '?' " ,
'queued' , $this -> iTestingId ))
2005-10-17 03:59:24 +00:00
{
2007-12-12 20:17:27 +01:00
$this -> sState = 'queued' ;
2006-12-31 19:39:41 +00:00
// we send an e-mail to interested people
2005-10-17 03:59:24 +00:00
$this -> SendNotificationMail ();
}
}
2007-09-14 23:02:12 -04:00
function objectGetMailOptions ( $sAction , $bMailSubmitter , $bParentAction )
{
$oOptions = new mailOptions ();
if ( $sAction == " delete " && $bParentAction )
$oOptions -> bMailOnce = TRUE ;
return $oOptions ;
}
function objectGetMail ( $sAction , $bMailSubmitter , $bParentAction )
{
$oSubmitter = new User ( $this -> iSubmitterId );
$sName = version :: fullName ( $this -> iVersionId );
$sMsg = null ;
$sSubject = null ;
if ( $bMailSubmitter )
{
switch ( $sAction )
{
case " delete " :
$sSubject = " Submitted test data deleted " ;
if ( $bParentAction )
{
$sMsg = " All test data you submitted for ' $sName ' has " .
" been deleted because ' $sName ' was deleted. " ;
} else
{
$sMsg = " The test report you submitted for ' $sName ' has " .
" been deleted. " ;
}
break ;
}
$aMailTo = nulL ;
} else
{
switch ( $sAction )
{
case " delete " :
if ( ! $bParentAction )
{
$sSubject = " Test Results deleted for $sName by " .
$_SESSION [ 'current' ] -> sRealname ;
$sMsg = " " ;
}
break ;
}
$aMailTo = User :: get_notify_email_address_list ( null , $this -> iVersionId );
}
return array ( $sSubject , $sMsg , $aMailTo );
}
2005-10-17 03:59:24 +00:00
function mailSubmitter ( $sAction = " add " )
{
2007-01-04 02:35:01 +00:00
global $aClean ;
2006-06-17 06:10:10 +00:00
2005-10-17 03:59:24 +00:00
if ( $this -> iSubmitterId )
{
$oSubmitter = new User ( $this -> iSubmitterId );
2006-12-27 03:19:43 +00:00
/* Get the full app/version name to display */
2007-03-25 21:04:33 +00:00
$sName = version :: fullName ( $this -> iVersionId );
2006-12-27 03:19:43 +00:00
2007-04-08 23:04:31 +00:00
$oVersion = new version ( $this -> iVersionId );
2005-10-17 03:59:24 +00:00
switch ( $sAction )
{
case " add " :
$sSubject = " Submitted testing data accepted " ;
2007-04-08 23:04:31 +00:00
$sMsg = " The testing data you submitted for ' $sName ' has been " .
2008-01-08 19:36:13 +01:00
" accepted by " . $_SESSION [ 'current' ] -> sRealname . " . \n " ;
2008-02-23 12:06:24 +11:00
$sMsg .= $oVersion -> objectMakeUrl () . " &iTestingId= " . $this -> iTestingId . " \n " ;
2008-01-08 19:36:13 +01:00
$sMsg .= " Administrators response: \n " ;
2006-02-22 02:20:02 +00:00
break ;
2005-10-17 03:59:24 +00:00
case " reject " :
$sSubject = " Submitted testing data rejected " ;
2007-04-08 23:04:31 +00:00
$sMsg = " The testing data you submitted for ' $sName ' has " .
" been rejected by " . $_SESSION [ 'current' ] -> sRealname . " . " ;
2007-04-20 00:02:20 +00:00
$sMsg .= $this -> objectMakeUrl () . " \n " ;
2005-10-17 03:59:24 +00:00
$sMsg .= " Reason given: \n " ;
2006-02-22 02:20:02 +00:00
break ;
2005-10-17 03:59:24 +00:00
}
2006-07-13 18:54:10 +00:00
$sMsg .= $aClean [ 'sReplyText' ] . " \n " ;
2007-04-08 23:04:31 +00:00
$sMsg .= " We appreciate your help in making the Application " .
" Database better for all users. " ;
2006-12-27 03:19:43 +00:00
2005-10-17 03:59:24 +00:00
mail_appdb ( $oSubmitter -> sEmail , $sSubject , $sMsg );
}
}
function SendNotificationMail ( $sAction = " add " , $sMsg = null )
{
2007-01-04 02:35:01 +00:00
global $aClean ;
2006-06-17 06:10:10 +00:00
2005-10-17 03:59:24 +00:00
$oVersion = new Version ( $this -> iVersionId );
$oApp = new Application ( $oVersion -> iAppId );
2008-02-23 12:06:24 +11:00
$sBacklink = $oVersion -> objectMakeUrl () . " &iTestingId= " . $this -> iTestingId . " \n " ;
2006-06-30 16:38:05 +00:00
2005-10-17 03:59:24 +00:00
switch ( $sAction )
{
case " add " :
2007-12-12 20:17:27 +01:00
if ( $this -> sState == 'accepted' )
2005-10-17 03:59:24 +00:00
{
2007-01-09 04:27:55 +00:00
$sSubject = " Test Results added to version " . $oVersion -> sName . " of " . $oApp -> sName . " by " . $_SESSION [ 'current' ] -> sRealname ;
2006-06-30 16:38:05 +00:00
$sMsg .= $sBacklink ;
2005-10-17 03:59:24 +00:00
if ( $this -> iSubmitterId )
{
$oSubmitter = new User ( $this -> iSubmitterId );
2006-12-31 19:39:41 +00:00
$sMsg .= " This Test data has been submitted by " . $oSubmitter -> sRealname . " . " ;
2005-10-17 03:59:24 +00:00
$sMsg .= " \n " ;
2006-02-22 02:20:02 +00:00
}
2006-07-13 18:54:10 +00:00
if ( $aClean [ 'sReplyText' ])
2006-02-22 02:20:02 +00:00
{
2005-10-17 03:59:24 +00:00
$sMsg .= " Appdb admin reply text: \n " ;
2006-07-13 18:54:10 +00:00
$sMsg .= $aClean [ 'sReplyText' ] . " \n " ; // append the reply text, if there is any
2005-10-17 03:59:24 +00:00
}
2006-12-31 19:39:41 +00:00
addmsg ( " The test data was successfully added into the database. " , " green " );
} else // test data queued.
2005-10-17 03:59:24 +00:00
{
2007-01-09 04:27:55 +00:00
$sSubject = " Test Results submitted for version " . $oVersion -> sName . " of " . $oApp -> sName . " by " . $_SESSION [ 'current' ] -> sRealname ;
2006-06-30 16:38:05 +00:00
$sMsg .= $sBacklink ;
2006-12-31 19:39:41 +00:00
$sMsg .= " This test data has been queued. " ;
2005-10-17 03:59:24 +00:00
$sMsg .= " \n " ;
2006-12-31 19:39:41 +00:00
addmsg ( " The test data you submitted will be added to the database after being reviewed. " , " green " );
2005-10-17 03:59:24 +00:00
}
break ;
case " edit " :
2007-01-09 04:27:55 +00:00
$sSubject = " Test Results modified for version " . $oVersion -> sName . " of " . $oApp -> sName . " by " . $_SESSION [ 'current' ] -> sRealname ;
2006-06-30 16:38:05 +00:00
$sMsg .= $sBacklink ;
2006-12-31 19:39:41 +00:00
addmsg ( " test data modified. " , " green " );
2005-10-17 03:59:24 +00:00
break ;
case " reject " :
2007-01-09 04:27:55 +00:00
$sSubject = " Test Results rejected for version " . $oVersion -> sName . " of " . $oApp -> sName . " by " . $_SESSION [ 'current' ] -> sRealname ;
2006-06-30 16:38:05 +00:00
$sMsg .= $sBacklink ;
2005-10-17 03:59:24 +00:00
// if replyText is set we should report the reason the data was rejected
2006-07-13 18:54:10 +00:00
if ( $aClean [ 'sReplyText' ])
2005-10-17 03:59:24 +00:00
{
$sMsg .= " Reason given: \n " ;
2006-07-13 18:54:10 +00:00
$sMsg .= $aClean [ 'sReplyText' ] . " \n " ; // append the reply text, if there is any
2005-10-17 03:59:24 +00:00
}
2006-12-31 19:39:41 +00:00
addmsg ( " test data rejected. " , " green " );
2005-10-17 03:59:24 +00:00
break ;
}
2006-06-29 15:54:29 +00:00
$sEmail = User :: get_notify_email_address_list ( null , $this -> iVersionId );
2005-10-17 03:59:24 +00:00
if ( $sEmail )
mail_appdb ( $sEmail , $sSubject , $sMsg );
}
2006-07-10 15:42:00 +00:00
function ShowTestResult ()
2005-10-17 03:59:24 +00:00
{
2008-02-23 12:06:24 +11:00
echo '<p><b>What works</b><br>' , " \n " ;
2007-04-23 02:33:19 +00:00
echo $this -> shWhatWorks , " \n " ;
2008-02-23 12:06:24 +11:00
echo '<p><br><b>What does not</b><br>' , " \n " ;
2007-04-23 02:33:19 +00:00
echo $this -> shWhatDoesnt , " \n " ;
2008-02-23 12:06:24 +11:00
echo '<p><br><b>What was not tested</b><br>' , " \n " ;
2007-04-23 02:33:19 +00:00
echo $this -> shWhatNotTested , " \n " ;
2008-02-23 12:06:24 +11:00
echo '<p><br><b>Additional Comments</b><br>' , " \n " ;
2007-04-23 02:33:19 +00:00
echo $this -> sComments , " \n " ;
2005-10-17 03:59:24 +00:00
}
2007-09-25 02:43:35 +02:00
function CreateTestTable ()
2005-10-17 03:59:24 +00:00
{
2007-04-23 02:33:19 +00:00
echo '<div class="info_container">' , " \n " ;
echo '<div class="title_class">Test Results</div>' , " \n " ;
echo '<div class="info_contents">' , " \n " ;
2007-07-23 19:56:43 +00:00
// create the table
$oTable = new Table ();
$oTable -> SetClass ( " historyTable " );
$oTable -> SetBorder ( 1 );
$oTable -> SetWidth ( " 100% " );
// setup the table header
$oTableRowHeader = new TableRow ();
$oTableRowHeader -> SetClass ( " historyHeader " );
$oTableRowHeader -> AddTextCell ( " " );
$oTableRowHeader -> AddTextCell ( " Distribution " );
$oTableRowHeader -> AddTextCell ( " Test date " );
$oTableRowHeader -> AddTextCell ( " Wine version " );
$oTableRowHeader -> AddTextCell ( " Installs? " );
$oTableRowHeader -> AddTextCell ( " Runs? " );
$oTableRowHeader -> AddTextCell ( " Rating " );
$oTableRowHeader -> AddTextCell ( " Submitter " );
$oTable -> SetHeader ( $oTableRowHeader );
2007-09-25 02:43:35 +02:00
return $oTable ;
}
/* Creates and returns a table row for a test result table */
function CreateTestTableRow ( $iCurrentId , $sLink )
{
$oVersion = new Version ( $this -> iVersionId );
$oApp = new Application ( $oVersion -> iAppId );
$oSubmitter = new User ( $this -> iSubmitterId );
$oDistribution = new distribution ( $this -> iDistributionId );
$bgcolor = $this -> sTestedRating ;
// initialize the array ech time we loop
$oTableRowClick = null ;
$oTableRow = new TableRow ();
/* if the test we are displaying is this test then */
/* mark it as the current test */
if ( $this -> iTestingId == $iCurrentId )
2005-10-17 03:59:24 +00:00
{
2007-09-25 02:43:35 +02:00
$sTRClass = $bgcolor ;
2006-01-28 22:53:28 +00:00
2007-09-25 02:43:35 +02:00
$oTableCell = new TableCell ( " <b>Current</b> " );
$oTableCell -> SetAlign ( " center " );
} else /* make all non-current rows clickable so clicking on them selects the test as current */
{
$sTRClass = $bgcolor ;
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$oInactiveColor = new color ();
$oInactiveColor -> SetColorByName ( $this -> sTestedRating );
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$oHighlightColor = GetHighlightColorFromInactiveColor ( $oInactiveColor );
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$oTableRowHighlight = new TableRowHighlight ( $oHighlightColor , $oInactiveColor );
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$sUrl = $sLink . $this -> iTestingId ;
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$oTableRowClick = new TableRowClick ( $sUrl );
$oTableRowClick -> SetHighlight ( $oTableRowHighlight );
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
// add the table element indicating that the user can show the row by clicking on it
$oTableCell = new TableCell ( " Show " );
$oTableCell -> SetCellLink ( $sUrl );
$oTableCell -> SetAlign ( " center " );
}
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$oTableRow -> AddCell ( $oTableCell );
$oTableRow -> SetClass ( $sTRClass );
$oTableRow -> AddTextCell ( $oDistribution -> objectMakeLink ());
$oTableRow -> AddTextCell ( date ( " M d Y " , mysqldatetime_to_unixtimestamp ( $this -> sTestedDate )));
2008-02-23 12:06:24 +11:00
$oTableRow -> AddTextCell ( $this -> sTestedRelease . ' ' );
$oTableRow -> AddTextCell ( $this -> sInstalls . ' ' );
$oTableRow -> AddTextCell ( $this -> sRuns . ' ' );
$oTableRow -> AddTextCell ( $this -> sTestedRating . ' ' );
$oTableRow -> AddTextCell ( $oSubmitter -> objectMakeLink () . ' ' );
2007-09-25 02:43:35 +02:00
if ( $this -> iTestingId && $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ))
{
2008-01-27 18:39:16 +01:00
$oObject = new objectManager ( 'testData' );
$oTableRow -> AddTextCell ( '<a href="' . $oObject -> makeUrl ( 'edit' , $this -> iTestingId ,
2008-02-23 12:06:24 +11:00
'Edit Test Results' ) . '&sReturnTo=' . urlencode ( $_SERVER [ 'REQUEST_URI' ]) . '">' .
2008-01-27 18:39:16 +01:00
'Edit</a> ' . " \n " .
'<a href="' . $oObject -> makeUrl ( 'delete' , $this -> iTestingId , 'Delete+Test+Results' ) .
2008-02-23 12:06:24 +11:00
'&sReturnTo=' . urlencode ( $_SERVER [ 'REQUEST_URI' ]) . '">Delete</a></td>' . " \n " );
2007-09-25 02:43:35 +02:00
}
2006-01-28 22:53:28 +00:00
2007-09-25 02:43:35 +02:00
// if this is a clickable row, set the appropriate property
if ( $oTableRowClick )
$oTableRow -> SetRowClick ( $oTableRowClick );
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
return $oTableRow ;
}
2006-01-28 22:53:28 +00:00
2007-09-25 02:43:35 +02:00
// Show the Test results for a application version
function ShowVersionsTestingTable ( $sLink , $iDisplayLimit )
{
global $aClean ;
/* escape input parameters */
$sLink = query_escape_string ( $sLink );
$iDisplayLimit = query_escape_string ( $iDisplayLimit );
$bShowAll = ( $aClean [ 'bShowAll' ] == " true " ) ? true : false ;
$sQuery = " SELECT *
2007-12-20 01:37:48 +01:00
FROM testResults , ? . versions
2007-09-25 02:43:35 +02:00
WHERE versionId = '?'
AND
2007-12-20 01:37:48 +01:00
versions . value = testResults . testedRelease
AND
versions . product_id = '?'
AND
2007-12-12 20:17:27 +01:00
state = '?'
2007-12-20 01:37:48 +01:00
ORDER BY versions . id DESC , testedDate DESC " ;
2007-09-25 02:43:35 +02:00
if ( ! $bShowAll )
$sQuery .= " LIMIT 0, " . $iDisplayLimit ;
2007-07-23 19:56:43 +00:00
2007-12-20 01:37:48 +01:00
$hResult = query_parameters ( $sQuery , BUGZILLA_DB , $this -> iVersionId , BUGZILLA_PRODUCT_ID , 'accepted' );
2007-09-25 02:43:35 +02:00
if ( ! $hResult )
return ;
$rowsUsed = query_num_rows ( $hResult );
if ( $rowsUsed == 0 )
return ;
$oTable = $this -> CreateTestTable ();
2007-07-23 19:56:43 +00:00
2007-09-25 02:43:35 +02:00
$iIndex = 0 ;
while ( $oRow = query_fetch_object ( $hResult ))
{
$oTest = new testData ( $oRow -> testingId );
$oTableRow = $oTest -> CreateTestTableRow ( $this -> iTestingId , $sLink );
2007-07-23 19:56:43 +00:00
// add the row to the table
$oTable -> AddRow ( $oTableRow );
$iIndex ++ ;
2005-10-17 03:59:24 +00:00
}
2007-07-23 19:56:43 +00:00
echo $oTable -> GetString ();
2005-10-17 03:59:24 +00:00
2008-02-23 12:06:24 +11:00
echo '<br>' , " \n " ; // put a space after the test results table and the button
2007-04-23 02:33:19 +00:00
2007-09-24 13:26:49 +02:00
echo '<form method=get action="objectManager.php">' . " \n " ;
2006-01-28 22:53:28 +00:00
2007-09-24 13:26:49 +02:00
if ( $rowsUsed >= $iDisplayLimit && $bShowAll )
2006-01-28 22:53:28 +00:00
{
2007-09-24 13:26:49 +02:00
$sShowButtonText = " Limit to $iDisplayLimit Tests " ;
} else
{
$sShowButtonText = " Show All Tests " ;
2008-02-23 12:06:24 +11:00
echo '<input type="hidden" name="bShowAll" value="true">' ;
2006-01-28 22:53:28 +00:00
}
2007-09-24 13:26:49 +02:00
$oManager = new objectManager ( " version " , null , $this -> iVersionId );
echo $oManager -> makeUrlFormData ();
2008-02-23 12:06:24 +11:00
echo " \t " . '<input class="button" type=submit value="' . $sShowButtonText . '">' . " \n " ;
2007-09-24 13:26:49 +02:00
2007-04-23 02:33:19 +00:00
echo '</form>' . " \n " ;
echo '</div>' , " \n " ; // end of the 'info_contents' div
echo '</div>' , " \n " ; // end of the 'info_container' div
2005-10-17 03:59:24 +00:00
}
2006-01-28 22:53:28 +00:00
2007-12-25 19:26:35 +01:00
/* Convert a given rating string to a numeric scale */
public function ratingToNumber ( $sRating )
{
switch ( $sRating )
{
case GARBAGE_RATING :
return 0 ;
case BRONZE_RATING :
return 1 ;
case SILVER_RATING :
return 2 ;
case GOLD_RATING :
return 3 ;
case PLATINUM_RATING :
return 4 ;
}
}
/* Convert a numeric rating scale to a rating name */
public function numberToRating ( $iNumber )
{
switch ( $iNumber )
{
case 0 :
return GARBAGE_RATING ;
case 1 :
return BRONZE_RATING ;
case 2 :
return SILVER_RATING ;
case 3 :
return GOLD_RATING ;
case 4 :
return PLATINUM_RATING ;
}
}
/* Gets rating info for the selected version : an array with the elements
0 - Rating
2007-12-29 01:31:52 +01:00
1 - Wine version
The $sDate parameter can be used to calculate the rating at a given point in time */
public function getRatingInfoForVersionId ( $iVersionId , $sDate = 'NOW()' )
2007-12-25 19:26:35 +01:00
{
$sQuery = " SELECT testedRating,testedDate,testedRelease,versions.id as versionId
FROM testResults , ? . versions WHERE
versions . value = testResults . testedRelease
AND
versions . product_id = '?'
AND versionId = '?'
AND
state = '?'
AND
2007-12-29 01:31:52 +01:00
TO_DAYS ( testedDate ) > ( TO_DAYS ( ? ) - ? )
2007-12-25 19:26:35 +01:00
ORDER BY versions . id DESC , testedDate DESC " ;
2007-12-29 01:31:52 +01:00
$hResult = query_parameters ( $sQuery , BUGZILLA_DB , BUGZILLA_PRODUCT_ID , $iVersionId , 'accepted' , $sDate , TESTDATA_AGED_THRESHOLD );
2007-12-25 19:26:35 +01:00
$aEntries = array ();
if ( $hResult )
{
$iPrevVersion = 0 ;
$iIndex = - 1 ;
for ( $i = 0 ; $oRow = mysql_fetch_object ( $hResult ); $i ++ )
{
if ( $iPrevRelease != $oRow -> versionId )
{
$iIndex ++ ;
$iPrevRelease = $oRow -> versionId ;
}
if ( ! $aEntries [ $iIndex ])
{
$aEntries [ $iIndex ] = array ();
$aEntries [ $iIndex ][ 0 ] = 0 ;
$aEntries [ $iIndex ][ 1 ] = 0 ;
$aEntries [ $iIndex ][ 2 ] = $oRow -> testedRelease ;
}
$aEntries [ $iIndex ][ 0 ] += testData :: RatingToNumber ( $oRow -> testedRating );
$aEntries [ $iIndex ][ 1 ] ++ ;
}
}
$sRelease = '' ;
if ( sizeof ( $aEntries ))
{
$fRating = 0.0 ;
for ( $i = 0 ; $i < sizeof ( $aEntries ); $i ++ )
{
/* Discard the rating if it ' s the only one for that Wine version
and its score is lower than previous averages */
if (( $aEntries [ $i ][ 1 ] < 2 ) && sizeof ( $aEntries ) > ( $i + 1 ) && ( $aEntries [ $i ][ 0 ] < ( $aEntries [ $i + 1 ][ 0 ] / $aEntries [ $i + 1 ][ 1 ])))
continue ;
$fRating = $aEntries [ $i ][ 0 ] / $aEntries [ $i ][ 1 ];
$sRelease = $aEntries [ $i ][ 2 ];
break ;
}
$sRating = testData :: NumberToRating ( round ( $fRating , 0 ));
}
if ( ! $sRelease )
{
$iNewestId = testData :: getNewestTestIdFromVersionId ( $iVersionId );
$oTestData = new testData ( $iNewestId );
return array ( $oTestData -> sTestedRating , $oTestData -> sTestedRelease );
}
return array ( $sRating , $sRelease );
}
2006-07-10 15:42:00 +00:00
/* retrieve the latest test result for a given version id */
2007-12-12 20:17:27 +01:00
function getNewestTestIdFromVersionId ( $iVersionId , $sState = 'accepted' )
2006-07-10 15:42:00 +00:00
{
2007-12-20 01:37:48 +01:00
$sQuery = " SELECT testingId FROM testResults, ?.versions WHERE
versions . value = testResults . testedRelease
AND
versions . product_id = '?'
AND
2007-03-28 00:09:12 +00:00
versionId = '?'
AND
2007-12-12 20:17:27 +01:00
state = '?'
2007-12-20 01:37:48 +01:00
ORDER BY versions . id DESC , testedDate DESC limit 1 " ;
2007-04-21 01:02:10 +00:00
2007-12-20 01:37:48 +01:00
$hResult = query_parameters ( $sQuery , BUGZILLA_DB , BUGZILLA_PRODUCT_ID , $iVersionId , $sState );
2007-04-21 01:02:10 +00:00
2006-07-10 15:42:00 +00:00
if ( ! $hResult )
return 0 ;
2007-08-03 23:27:25 +00:00
if ( ! $oRow = query_fetch_object ( $hResult ))
2007-06-10 18:51:33 +00:00
return 0 ;
2007-04-19 23:45:15 +00:00
2006-07-10 15:42:00 +00:00
return $oRow -> testingId ;
}
2005-10-17 03:59:24 +00:00
// show the fields for editing
2007-04-16 23:10:08 +00:00
function outputEditor ()
2005-10-17 03:59:24 +00:00
{
2007-04-16 23:10:08 +00:00
global $aClean ;
/* Fill in some values */
if ( ! $this -> iVersionId )
$this -> iVersionId = $aClean [ 'iVersionId' ];
if ( ! $this -> sTestedDate )
$this -> sTestedDate = date ( 'Y-m-d H:i:s' );
2005-10-17 03:59:24 +00:00
HtmlAreaLoaderScript ( array ( " Test1 " , " Test2 " , " Test3 " ));
2007-03-25 21:04:33 +00:00
$sName = version :: fullName ( $this -> iVersionId );
2007-03-25 19:58:34 +00:00
echo html_frame_start ( " Test Form - $sName " , " 90% " , " " , 0 );
2005-10-17 03:59:24 +00:00
echo " <table width='100%' border=0 cellpadding=2 cellspacing=0> \n " ;
// What works
2006-05-04 00:24:18 +00:00
echo '<tr valign=top><td class="color0"><b>What works</b></td>' , " \n " ;
2007-01-09 04:42:34 +00:00
echo '<td class="color0"><p><textarea cols="80" rows="20" id="Test1" name="shWhatWorks">' ;
echo $this -> shWhatWorks . '</textarea></p></td></tr>' , " \n " ;
2005-10-17 03:59:24 +00:00
// What Does not work
2006-05-04 00:24:18 +00:00
echo '<tr valign=top><td class=color1><b>What does not work</b></td>' , " \n " ;
2007-01-09 04:42:34 +00:00
echo '<td class="color0"><p><textarea cols="80" rows="20" id="Test2" name="shWhatDoesnt">' ;
echo $this -> shWhatDoesnt . '</textarea></p></td></tr>' , " \n " ;
2005-10-17 03:59:24 +00:00
// What was not tested
echo '<tr valign=top><td class=color0><b>What was not tested</b></td>' , " \n " ;
2007-01-09 04:42:34 +00:00
echo '<td class="color0"><p><textarea cols="80" rows="20" id="Test3" name="shWhatNotTested">' ;
echo $this -> shWhatNotTested . '</textarea></p></td></tr>' , " \n " ;
2005-10-17 03:59:24 +00:00
// Date Tested
2006-05-04 00:24:18 +00:00
echo '<tr valign=top><td class="color1"><b>Date tested </b></td>' , " \n " ;
2005-10-17 03:59:24 +00:00
echo '<td class="color0"><input type=text name="sTestedDate" value="' . $this -> sTestedDate . '" size="20"></td></tr>' , " \n " ;
echo '<tr valign=top><td class="color1"></td><td class="color0"><p/>YYYY-MM-DD HH:MM:SS</td></tr>' , " \n " ;
2007-09-14 23:43:57 -04:00
2005-10-17 03:59:24 +00:00
// Distribution
2007-09-14 23:43:57 -04:00
$oDistribution = new distribution ( $this -> iDistributionId );
$sDistributionHelp = " " ;
2007-12-12 20:17:27 +01:00
if ( ! $this -> iDistributionId || $oDistribution -> objectGetState () != 'accepted' )
2007-09-14 23:43:57 -04:00
{
if ( ! $this -> iDistributionId )
{
$sDistributionHelp = " If yours is not on the list, " .
" please add it using the form below. " ;
} else
{
$sDistributionHelp = " The user added a new distribution; " ;
" review it in the form below or replace " .
" it with one from the list. " ;
}
2008-02-23 12:06:24 +11:00
$sDistributionHelp .= " <br> \n " ;
2007-09-14 23:43:57 -04:00
}
2007-04-16 23:10:08 +00:00
2007-09-14 23:43:57 -04:00
echo '<tr valign=top><td class="color0"><b>Distribution</b></td class="color0">' , " \n " ;
2007-04-16 23:10:08 +00:00
2005-10-17 03:59:24 +00:00
echo '<td class=color0>' , " \n " ;
2007-09-14 23:43:57 -04:00
echo $sDistributionHelp ;
2006-07-11 17:02:35 +00:00
distribution :: make_distribution_list ( " iDistributionId " , $this -> iDistributionId );
2005-10-17 03:59:24 +00:00
echo '</td></tr>' , " \n " ;
2007-06-11 02:53:57 +00:00
2005-10-17 03:59:24 +00:00
// Version List
2006-05-04 00:24:18 +00:00
echo '<tr><td class=color1><b>Tested release</b></td><td class=color0>' , " \n " ;
2007-07-23 20:45:22 +00:00
echo make_bugzilla_version_list ( " sTestedRelease " , $this -> sTestedRelease );
2007-06-11 02:53:57 +00:00
// Give the user some information about our available versions
echo " <ul> \n " ;
echo " <li>If you are testing with a newer release than listed please " ;
echo " check back tomorrow, sometimes it takes us a day to update the list.</li> \n " ;
echo " <li>If you are testing with an older release than listed please " ;
echo " upgrade and test with a newer release.</li> \n " ;
echo " <li><b>NOTE: 'CVS' was recently removed as a version because we simply can't track " ;
2008-02-23 12:06:24 +11:00
echo " exactly which CVS version was used.<br> If you haven't tested with one of the " ;
2007-06-11 02:53:57 +00:00
echo " listed versions please retest with a recent release and resubmit.</li> \n " ;
echo " </ul> \n " ;
2005-10-17 03:59:24 +00:00
echo '</td></tr>' , " \n " ;
2007-06-11 02:53:57 +00:00
2005-10-17 03:59:24 +00:00
// Installs
echo '<tr><td class=color0><b>Installs?</b></td><td class=color0>' , " \n " ;
2006-07-10 15:39:21 +00:00
testData :: make_Installs_list ( " sInstalls " , $this -> sInstalls );
2005-10-17 03:59:24 +00:00
echo '</td></tr>' , " \n " ;
// Runs
echo '<tr><td class=color1><b>Runs?</b></td><td class=color0>' , " \n " ;
2006-07-10 15:39:21 +00:00
testData :: make_Runs_list ( " sRuns " , $this -> sRuns );
2005-10-17 03:59:24 +00:00
echo '</td></tr>' , " \n " ;
// Rating
echo '<tr><td class="color0"><b>Rating</b></td><td class="color0">' , " \n " ;
2007-09-08 01:48:53 +00:00
echo make_maintainer_rating_list ( " sTestedRating " , $this -> sTestedRating );
2006-07-06 17:27:54 +00:00
echo '<a href="' . BASE . '/help/?sTopic=maintainer_ratings" target="_blank">Rating definitions</a></td></tr>' , " \n " ;
2005-10-17 03:59:24 +00:00
// extra comments
2006-05-04 00:24:18 +00:00
echo '<tr valign=top><td class="color1"><b>Extra comments</b></td>' , " \n " ;
2007-05-02 01:08:22 +00:00
echo '<td class="color0"><textarea name="sComments" rows=10 cols=65>' ;
2005-10-17 03:59:24 +00:00
echo $this -> sComments . '</textarea></td></tr>' , " \n " ;
echo '<input type="hidden" name="iVersionId" value="' . $this -> iVersionId . '" >' ;
echo '<input type="hidden" name="iTestingId" value="' . $this -> iTestingId . '" >' ;
2007-03-24 02:12:05 +00:00
echo '<input type="hidden" name="iTestDataId" value="' . $this -> iTestingId . '" >' ;
2005-10-17 03:59:24 +00:00
2008-01-02 20:26:08 +01:00
// Display confirmation box for changing the Wine version
$oOldTest = new testData ( $this -> iTestingId );
if ( $this -> iTestingId && $oOldTest -> sTestedRelease != $this -> sTestedRelease )
{
if ( getInput ( 'bConfirmTestedVersionChange' , $aClean ) != 'true' )
{
echo '<tr><td class="color1"> </td><td class="color0">' ;
2008-02-23 12:06:24 +11:00
echo 'You have changed the Wine version of the report. Are you sure you want to do this? Please submit a new test report for every Wine version you test; this is useful for tracking Wine’s progress.<br>' ;
echo '<input type="checkbox" name="bConfirmTestedVersionChange" value="true"> ' ;
2008-01-02 20:26:08 +01:00
echo 'Yes, I want to change the Wine version' ;
echo '</td></tr>' ;
} else
{
2008-02-23 12:06:24 +11:00
echo '<input type="hidden" name="bConfirmTestedVersionChange" value="true">' ;
2008-01-02 20:26:08 +01:00
}
}
2005-10-17 03:59:24 +00:00
echo " </table> \n " ;
echo html_frame_end ();
}
2007-01-17 03:18:49 +00:00
/* $aValues can be $aValues or any array with the values from outputEditor() */
2006-07-08 22:06:28 +00:00
function CheckOutputEditorInput ( $aValues , $sDistribution = " " )
{
$errors = " " ;
2007-01-09 04:42:34 +00:00
if ( empty ( $aValues [ 'shWhatWorks' ]))
2005-10-17 03:59:24 +00:00
$errors .= " <li>Please enter what worked.</li> \n " ;
2007-01-09 04:42:34 +00:00
if ( empty ( $aValues [ 'shWhatDoesnt' ]))
2005-10-17 03:59:24 +00:00
$errors .= " <li>Please enter what did not work.</li> \n " ;
2007-01-09 04:42:34 +00:00
if ( empty ( $aValues [ 'shWhatNotTested' ]))
2005-10-17 03:59:24 +00:00
$errors .= " <li>Please enter what was not tested.</li> \n " ;
2006-07-08 22:06:28 +00:00
if ( empty ( $aValues [ 'sTestedDate' ]))
2006-05-04 00:24:18 +00:00
$errors .= " <li>Please enter the date and time when you tested.</li> \n " ;
2005-10-17 03:59:24 +00:00
2006-07-08 22:06:28 +00:00
if ( empty ( $aValues [ 'sTestedRelease' ]))
2005-10-17 03:59:24 +00:00
$errors .= " <li>Please enter the version of Wine that you tested with.</li> \n " ;
2008-01-02 20:26:08 +01:00
// Ask for confirmation if changing the tested Wine versions, becase we want users
// to submit new reports instead of updating existing ones when testing new Wines
$oOldTest = new testData ( $this -> iTestingId );
if ( $this -> iTestingId && $oOldTest -> sTestedRelease != getInput ( 'sTestedRelease' , $aValues ) &&
getInput ( 'bConfirmTestedVersionChange' , $aValues ) != 'true' )
{
$errors .= '<li>Are you sure you want to change the Wine version of the report? Please submit a new ' .
'test report for every Wine version you test; this is useful for tracking Wine’s progress. ' .
'Tick the box above the submit button if you want to proceed</li>' ;
}
2005-10-17 03:59:24 +00:00
// No Distribution entered, and nothing in the list is selected
2006-07-08 22:06:28 +00:00
if ( empty ( $aValues [ 'sDistribution' ]) && ! $aValues [ 'iDistributionId' ])
2006-05-04 00:24:18 +00:00
$errors .= " <li>Please enter a distribution.</li> \n " ;
2005-10-17 03:59:24 +00:00
2006-07-08 22:06:28 +00:00
if ( empty ( $aValues [ 'sInstalls' ]))
2005-10-17 03:59:24 +00:00
$errors .= " <li>Please enter whether this application installs or not.</li> \n " ;
2006-07-08 22:06:28 +00:00
if ( empty ( $aValues [ 'sRuns' ]))
2005-10-17 03:59:24 +00:00
$errors .= " <li>Please enter whether this application runs or not.</li> \n " ;
2006-07-08 22:06:28 +00:00
if ( empty ( $aValues [ 'sTestedRating' ]))
2006-05-04 00:24:18 +00:00
$errors .= " <li>Please enter a rating based on how well this application runs.</li> \n " ;
2006-11-27 02:32:22 +00:00
// Basic checking of rating logic to ensure that the users test results
// are consistent
if (( $aValues [ 'sRuns' ] != " Yes " ) && ( $aValues [ 'sTestedRating' ] != GARBAGE_RATING ))
$errors .= " <li>Applications that do not run should be rated ‘Garbage’.</li> \n " ;
if (( $aValues [ 'sInstalls' ] == " No " ) && ( $aValues [ 'sTestedRating' ] == PLATINUM_RATING ))
$errors .= " <li>An application can only get a Platinum rating if it installs and runs ‘out of the box’.</li> \n " ;
2007-01-07 17:41:51 +00:00
// Basic checking of logic. Runs? can obviously only be 'Not Installable'
// if the application does not install
if (( $aValues [ 'sInstalls' ] != " No " ) && ( $aValues [ 'sRuns' ] == " Not Installable " ))
$errors .= " <li>You can only set Runs? to ‘Not Installable’ if the applicatino’s installer does not work</li> \n " ;
2005-10-17 03:59:24 +00:00
return $errors ;
}
2007-01-17 03:18:49 +00:00
/* retrieves values from $aValues that were output by outputEditor() */
/* $aValues can be $_REQUEST or any array with the values from outputEditor() */
2006-07-08 22:06:28 +00:00
function GetOutputEditorValues ( $aValues )
2005-10-17 03:59:24 +00:00
{
2007-10-22 18:58:15 +02:00
if ( $aValues [ 'iTestingId' ])
$this -> iTestingId = $aValues [ 'iTestingId' ];
if ( $aValues [ 'iVersionId' ])
$this -> iVersionId = $aValues [ 'iVersionId' ];
2007-01-09 04:42:34 +00:00
$this -> shWhatWorks = $aValues [ 'shWhatWorks' ];
$this -> shWhatDoesnt = $aValues [ 'shWhatDoesnt' ];
$this -> shWhatNotTested = $aValues [ 'shWhatNotTested' ];
2006-07-08 22:06:28 +00:00
$this -> sTestedDate = $aValues [ 'sTestedDate' ];
$this -> iDistributionId = $aValues [ 'iDistributionId' ];
$this -> sTestedRelease = $aValues [ 'sTestedRelease' ];
$this -> sInstalls = $aValues [ 'sInstalls' ];
$this -> sRuns = $aValues [ 'sRuns' ];
$this -> sTestedRating = $aValues [ 'sTestedRating' ];
$this -> sComments = $aValues [ 'sComments' ];
2005-10-17 03:59:24 +00:00
}
2006-07-10 15:39:21 +00:00
function make_Installs_list ( $sVarname , $sSelectedValue )
2005-10-17 03:59:24 +00:00
{
2006-07-10 15:39:21 +00:00
echo " <select name=' $sVarname '> \n " ;
echo " <option value= \" \" >Choose ...</option> \n " ;
$aRating = array ( " Yes " , " No " , " N/A " );
$iMax = count ( $aRating );
2005-10-17 03:59:24 +00:00
2006-07-10 15:39:21 +00:00
for ( $i = 0 ; $i < $iMax ; $i ++ )
{
if ( $aRating [ $i ] == $sSelectedValue )
echo " <option value=' " . $aRating [ $i ] . " ' selected> " . $aRating [ $i ] . " \n " ;
else
echo " <option value=' " . $aRating [ $i ] . " '> " . $aRating [ $i ] . " \n " ;
}
echo " </select> \n " ;
}
2005-10-17 03:59:24 +00:00
2006-07-10 15:39:21 +00:00
function make_Runs_list ( $sVarname , $sSelectedValue )
2005-10-17 03:59:24 +00:00
{
2006-07-10 15:39:21 +00:00
echo " <select name=' $sVarname '> \n " ;
echo " <option value= \" \" >Choose ...</option> \n " ;
2007-04-26 00:17:42 +00:00
$aRating = array ( " Yes " , " No " , " Not installable " );
2006-07-10 15:39:21 +00:00
$iMax = count ( $aRating );
for ( $i = 0 ; $i < $iMax ; $i ++ )
{
if ( $aRating [ $i ] == $sSelectedValue )
echo " <option value=' " . $aRating [ $i ] . " ' selected> " . $aRating [ $i ] . " \n " ;
else
echo " <option value=' " . $aRating [ $i ] . " '> " . $aRating [ $i ] . " \n " ;
}
echo " </select> \n " ;
2005-10-17 03:59:24 +00:00
}
2006-12-27 03:26:16 +00:00
/* List test data submitted by a given user. Ignore test results for queued applications/versions */
function listSubmittedBy ( $iUserId , $bQueued = true )
{
2007-12-22 00:11:55 +01:00
$hResult = query_parameters ( " SELECT testResults.versionId, testResults.testedDate, testResults.testedRelease, testResults.testedRating, testResults.submitTime, testResults.testingId, appFamily.appName, appVersion.versionName from testResults, appFamily, appVersion WHERE testResults.versionId = appVersion.versionId AND appVersion.appId = appFamily.appId AND testResults.submitterId = '?' AND testResults.state = '?' ORDER BY testResults.testingId " , $iUserId , $bQueued ? 'queued' : 'accepted' );
2006-12-27 03:26:16 +00:00
2007-08-03 23:27:25 +00:00
if ( ! $hResult || ! query_num_rows ( $hResult ))
2006-12-27 03:26:16 +00:00
return false ;
2007-12-22 00:11:55 +01:00
$oTable = new Table ();
$oTable -> SetWidth ( " 100% " );
$oTable -> SetAlign ( " center " );
// setup the table header
$oTableRow = new TableRow ();
$oTableRow -> AddTextCell ( 'Version' );
$oTableRow -> AddTextCell ( 'Rating' );
$oTableRow -> AddTextCell ( 'Wine version' );
$oTableRow -> AddTextCell ( 'Submission date' );
if ( $bQueued )
$oTableRow -> addTextCell ( 'Action' );
$oTableRow -> SetClass ( 'color4' );
$oTable -> AddRow ( $oTableRow );
2006-12-27 03:26:16 +00:00
2007-08-03 23:27:25 +00:00
for ( $i = 1 ; $oRow = query_fetch_object ( $hResult ); $i ++ )
2007-12-22 00:11:55 +01:00
{
$oTableRow = new TableRow ();
$oTableRow -> AddTextCell ( version :: fullNameLink ( $oRow -> versionId ));
$oTableRow -> AddTextCell ( $oRow -> testedRating );
$oTableRow -> AddTextCell ( $oRow -> testedRelease );
2008-01-02 18:19:13 +01:00
$oTableRow -> AddTextCell ( print_date ( mysqldatetime_to_unixtimestamp ( $oRow -> submitTime )));
2006-12-27 03:26:16 +00:00
2007-12-22 00:11:55 +01:00
if ( $bQueued )
{
$oM = new objectManager ( 'testData_queue' );
$oM -> setReturnTo ( array_key_exists ( 'REQUEST_URI' , $_SERVER ) ? $_SERVER [ 'REQUEST_URI' ] : " " );
$shDeleteLink = '<a href="' . $oM -> makeUrl ( 'delete' , $oRow -> testingId , 'Delete entry' ) . '">delete</a>' ;
$shEditLink = '<a href="' . $oM -> makeUrl ( 'edit' , $oRow -> testingId , 'Edit entry' ) . '">edit</a>' ;
$oTableRow -> addTextCell ( " [ $shEditLink ] [ $shDeleteLink ] " );
}
$oTableRow -> SetClass ( $oRow -> testedRating );
$oTable -> AddRow ( $oTableRow );
}
2006-12-27 03:26:16 +00:00
2007-12-22 00:11:55 +01:00
return $oTable -> GetString ();
2006-12-27 03:26:16 +00:00
}
2007-03-18 22:15:06 +00:00
2007-07-11 02:38:09 +00:00
// return the number of test data entries for a particular version id
function get_testdata_count_for_versionid ( $iVersionId )
{
$sQuery = " SELECT count(*) as cnt
FROM testResults
WHERE versionId = '?'
AND
2007-12-12 20:17:27 +01:00
state = '?' ; " ;
2007-07-11 02:38:09 +00:00
2007-12-12 20:17:27 +01:00
$hResult = query_parameters ( $sQuery , $iVersionId , 'accepted' );
2007-07-11 02:38:09 +00:00
2007-08-03 23:27:25 +00:00
$oRow = query_fetch_object ( $hResult );
2007-07-11 02:38:09 +00:00
return $oRow -> cnt ;
}
2008-01-20 21:31:15 +01:00
function objectGetEntriesCount ( $sState )
2007-03-18 22:15:06 +00:00
{
2007-03-24 02:12:05 +00:00
$oTest = new testData ();
2008-01-20 21:31:15 +01:00
2008-01-20 23:20:45 +01:00
if ( $sState != 'accepted' && ! $oTest -> canEdit ())
2007-03-18 22:15:06 +00:00
{
2008-01-20 21:31:15 +01:00
if ( $sState == 'rejected' )
2007-04-20 00:02:20 +00:00
{
$sQuery = " SELECT COUNT(testingId) AS count FROM
2007-11-06 22:25:30 +01:00
testResults WHERE
2007-04-20 00:02:20 +00:00
testResults . submitterId = '?'
AND
2007-12-12 20:17:27 +01:00
testResults . state = '?' " ;
2007-04-20 00:02:20 +00:00
} else
2007-03-18 22:15:06 +00:00
{
$sQuery = " SELECT COUNT(testingId) AS count FROM
testResults , appVersion , appMaintainers WHERE
testResults . versionId = appVersion . versionId
AND
appMaintainers . userId = '?'
AND
2008-01-20 21:31:15 +01:00
appMaintainers . state = 'accepted'
2007-07-23 20:02:24 +00:00
AND
2007-03-18 22:15:06 +00:00
(
2007-04-21 01:02:10 +00:00
(
appMaintainers . superMaintainer = '1'
AND
appMaintainers . appId = appVersion . appid
)
OR
(
appMaintainers . superMaintainer = '0'
AND
appMaintainers . versionId = appVersion . versionId
)
2007-03-18 22:15:06 +00:00
)
AND
2007-12-12 20:17:27 +01:00
testResults . state = '?' " ;
2007-03-18 22:15:06 +00:00
}
2007-04-20 00:02:20 +00:00
$hResult = query_parameters ( $sQuery , $_SESSION [ 'current' ] -> iUserId ,
2007-12-12 20:17:27 +01:00
$sState );
2007-03-18 22:15:06 +00:00
} else
{
2007-11-06 22:25:30 +01:00
$sQuery = " SELECT COUNT(testingId) as count FROM testResults WHERE
2007-12-12 20:17:27 +01:00
testResults . state = '?' " ;
$hResult = query_parameters ( $sQuery , $sState );
2007-03-18 22:15:06 +00:00
}
if ( ! $hResult )
return FALSE ;
2007-08-03 23:27:25 +00:00
if ( ! $oRow = query_fetch_object ( $hResult ))
2007-03-18 22:15:06 +00:00
return FALSE ;
return $oRow -> count ;
}
2008-01-20 21:31:15 +01:00
function objectGetEntries ( $sState , $iRows = 0 , $iStart = 0 , $sOrderBy = " testingId " )
2007-03-18 22:15:06 +00:00
{
2007-03-24 02:12:05 +00:00
$oTest = new testData ();
2007-06-12 00:02:41 +00:00
$sLimit = " " ;
/* Should we add a limit clause to the query? */
if ( $iRows || $iStart )
{
$sLimit = " LIMIT ?,? " ;
/* Selecting 0 rows makes no sense , so we assume the user wants to select all of them
after an offset given by iStart */
if ( ! $iRows )
2008-01-20 21:31:15 +01:00
$iRows = testData :: objectGetEntriesCount ( $sState );
2007-06-12 00:02:41 +00:00
}
2008-01-20 21:31:15 +01:00
if ( $sState != 'accepted' && ! $oTest -> canEdit ())
2007-03-18 22:15:06 +00:00
{
2008-01-20 21:31:15 +01:00
if ( $sState == 'rejected' )
2007-04-20 00:02:20 +00:00
{
2007-11-06 22:25:30 +01:00
$sQuery = " SELECT testResults.* FROM testResults WHERE
2007-04-20 00:02:20 +00:00
testResults . submitterId = '?'
AND
2007-12-12 20:17:27 +01:00
testResults . state = '?' ORDER BY ? $sLimit " ;
2007-04-20 00:02:20 +00:00
} else
2007-03-18 22:15:06 +00:00
{
$sQuery = " SELECT testResults.* FROM testResults, appVersion,
appMaintainers WHERE
testResults . versionId = appVersion . versionId
AND
appMaintainers . userId = '?'
AND
(
2007-04-21 01:02:10 +00:00
(
appMaintainers . superMaintainer = '1'
AND
appMaintainers . appId = appVersion . appid
)
OR
(
appMaintainers . superMaintainer = '0'
AND
appMaintainers . versionId = appVersion . versionId
)
2007-03-18 22:15:06 +00:00
)
AND
2008-01-20 21:31:15 +01:00
appMaintainers . state = 'accepted'
2007-07-21 23:58:06 +00:00
AND
2007-12-12 20:17:27 +01:00
testResults . state = '?' ORDER BY ? $sLimit " ;
2007-06-12 00:02:41 +00:00
}
if ( $sLimit )
{
$hResult = query_parameters ( $sQuery , $_SESSION [ 'current' ] -> iUserId ,
2007-12-12 20:17:27 +01:00
$sState , $sOrderBy , $iStart , $iRows );
2007-06-12 00:02:41 +00:00
} else
{
$hResult = query_parameters ( $sQuery , $_SESSION [ 'current' ] -> iUserId ,
2007-12-12 20:17:27 +01:00
$sState , $sOrderBy );
2007-03-18 22:15:06 +00:00
}
} else
{
2007-11-06 22:25:30 +01:00
$sQuery = " SELECT testResults.* FROM testResults WHERE
2007-12-12 20:17:27 +01:00
testResults . state = '?' ORDER by ? $sLimit " ;
2007-06-12 00:02:41 +00:00
if ( $sLimit )
2007-12-12 20:17:27 +01:00
$hResult = query_parameters ( $sQuery , $sState , $sOrderBy , $iStart , $iRows );
2007-06-12 00:02:41 +00:00
else
2007-12-12 20:17:27 +01:00
$hResult = query_parameters ( $sQuery , $sState , $sOrderBy );
2007-03-18 22:15:06 +00:00
}
if ( ! $hResult )
return FALSE ;
return $hResult ;
}
function objectGetHeader ()
{
2007-07-31 01:51:40 +00:00
$oTableRow = new TableRow ();
$oTableRow -> AddTextCell ( " Submission Date " );
$oTableRow -> AddTextCell ( " Submitter " );
$oTableRow -> AddTextCell ( " Application " );
$oTableRow -> AddTextCell ( " Version " );
$oTableRow -> AddTextCell ( " Release " );
$oTableRow -> AddTextCell ( " Has maintainer " );
$oTableRow -> AddTextCell ( " Rating " );
return $oTableRow ;
2007-03-18 22:15:06 +00:00
}
2007-06-14 00:50:35 +00:00
function objectGetTableRow ()
2007-03-18 22:15:06 +00:00
{
$oVersion = new version ( $this -> iVersionId );
$oApp = new application ( $oVersion -> iAppId );
$oUser = new user ( $this -> iSubmitterId );
2007-06-07 02:04:15 +00:00
$hMaintainers = maintainer :: getMaintainersForAppIdVersionId ( null , $this -> iVersionId );
2007-08-03 23:27:25 +00:00
$bHasMaintainer = ( query_num_rows ( $hMaintainers ) == 0 ) ? false : true ;
2007-06-07 02:04:15 +00:00
2007-07-23 19:56:43 +00:00
$oTableRow = new TableRow ();
2007-07-31 23:48:22 +00:00
$oTableRow -> AddCell ( new TableCell ( print_date ( mysqldatetime_to_unixtimestamp ( $this -> sSubmitTime ))));
2007-07-23 19:56:43 +00:00
$oTableRow -> AddCell ( new TableCell ( $oUser -> objectMakeLink ()));
$oTableRow -> AddCell ( new TableCell ( $oApp -> objectMakeLink ()));
$oTableRow -> AddCell ( new TableCell ( $oVersion -> objectMakeLink ()));
$oTableRow -> AddCell ( new TableCell ( $this -> sTestedRelease ));
$oTableRow -> AddCell ( new TableCell ( $bHasMaintainer ? " YES " : " no " ));
$oTableRow -> AddCell ( new TableCell ( $this -> sTestedRating ));
2007-07-24 14:45:23 +00:00
$oTableRow -> SetClass ( $this -> sTestedRating );
2007-07-02 00:35:17 +00:00
2007-07-23 19:56:43 +00:00
$oOMTableRow = new OMTableRow ( $oTableRow );
2007-09-18 21:22:43 -04:00
$oOMTableRow -> SetHasDeleteLink ( true );
2007-07-23 19:56:43 +00:00
return $oOMTableRow ;
2007-03-18 22:15:06 +00:00
}
2007-12-12 20:17:27 +01:00
public function objectGetState ()
{
return $this -> sState ;
}
2007-03-18 22:15:06 +00:00
function canEdit ()
{
if ( $_SESSION [ 'current' ] -> hasPriv ( " admin " ))
return TRUE ;
2007-04-16 23:10:08 +00:00
else if ( $this -> iVersionId )
2007-03-24 02:12:05 +00:00
{
2007-04-21 01:02:10 +00:00
if ( $this -> iSubmitterId == $_SESSION [ 'current' ] -> iUserId &&
2007-12-22 00:11:55 +01:00
$this -> sState != 'accepted' )
2007-04-21 01:02:10 +00:00
return TRUE ;
2007-03-24 02:12:05 +00:00
$oVersion = new version ( $this -> iVersionId );
if ( $_SESSION [ 'current' ] -> hasAppVersionModifyPermission ( $oVersion ))
return TRUE ;
else
return FALSE ;
} else
2007-03-18 22:15:06 +00:00
return FALSE ;
}
function objectDisplayQueueProcessingHelp ()
{
echo " <p>This is the list of test results waiting for submission, " .
" rejection or deletion.</p> \n " ;
echo " <p>To view a submission, click on its name. From that page " .
" you can submit it into the AppDB, reject it or delete it.</p> \n " ;
}
2007-03-24 02:04:16 +00:00
2007-09-25 02:43:35 +02:00
function objectShowPreview ()
2007-03-24 02:04:16 +00:00
{
return TRUE ;
}
2007-09-25 02:43:35 +02:00
function display ()
{
$this -> ShowTestResult ();
$this -> iSubmitterId = $_SESSION [ 'current' ] -> iUserId ;
$oTable = $this -> CreateTestTable ();
$oTable -> AddRow ( $this -> CreateTestTableRow ( $this -> iTestingId , " " ));
echo $oTable -> GetString ();
}
2007-03-24 02:04:16 +00:00
function objectMakeUrl ()
{
2007-03-25 03:56:20 +00:00
$oObject = new objectManager ( " testData " , " Edit Test Results " , $this -> iTestingId );
return $oObject -> makeUrl ( " edit " , $this -> iTestingId );
2007-03-24 02:04:16 +00:00
}
function objectMakeLink ()
{
/* STUB */
return TRUE ;
}
2007-03-25 16:10:15 +00:00
2007-12-19 23:01:05 +01:00
public function isOld ()
{
/* If no id is defined that means the test report is not in the database, which means it can't be old */
if ( ! $this -> iTestingId )
return false ;
return (( mktime () - mysqltimestamp_to_unixtimestamp ( $this -> sSubmitTime )) > ( 60 * 60 * 24 * 175 ));
}
2007-12-12 22:43:22 +01:00
function objectGetChildren ( $bIncludeDeleted = false )
2007-09-08 22:29:17 +00:00
{
/* We have none */
return array ();
}
2007-03-25 16:10:15 +00:00
function objectDisplayAddItemHelp ()
{
echo " <p>This is the screen for inputing test information so that others " ;
echo " looking at the database will know \n " ;
2007-06-05 03:35:46 +00:00
echo " what was working on a particular release of Wine.</p> \n " ;
echo " <p><b>Please DO NOT include crash or Wine debug output. \n " ;
echo " Instead report the crash as a bug in the Wine bugzilla at \n " ;
echo " <a href= \" http://bugs.winehq.org \" >http://bugs.winehq.org</a>. \n " ;
echo " We ask that you use bugzilla because developers do not monitor the AppDB \n " ;
echo " for bugs.</b></p> \n " ;
2007-05-26 17:01:11 +00:00
echo " <p>Please be as detailed as you can but do not paste large \n " ;
echo " chunks of output from the terminal. Type out your report \n " ;
echo " clearly and in proper English so that it is easily readable.</p> \n " ;
2007-03-25 16:10:15 +00:00
echo " <p>If you cannot find your distribution in the list of existing " ;
echo " distributions, please add it in the \n " ;
echo " provided field.</p> \n \n " ;
}
2007-04-19 23:45:15 +00:00
function mustBeQueued ()
{
if ( $_SESSION [ 'current' ] -> hasPriv ( " admin " ))
2007-04-22 16:15:12 +00:00
{
2007-04-21 01:02:10 +00:00
return FALSE ;
2007-04-22 16:15:12 +00:00
} else if ( $this -> iVersionId )
{
// if the user can edit the version and the version isn't queued then
// they can also submit test results without them being queued
// this is the case where they maintain the version and the version isn't queued
$oVersion = new version ( $this -> iVersionId );
2007-12-12 20:56:04 +01:00
if ( $oVersion -> canEdit () && $oVersion -> objectGetState () == 'accepted' )
2007-04-22 16:15:12 +00:00
return FALSE ;
else
return TRUE ;
} else
{
return TRUE ;
}
2007-04-19 23:45:15 +00:00
}
2007-04-29 23:00:01 +00:00
function allowAnonymousSubmissions ()
{
return FALSE ;
}
2007-06-12 00:02:41 +00:00
2007-11-05 18:38:06 +01:00
function objectAllowPurgingRejected ()
{
return TRUE ;
}
public function objectGetSubmitTime ()
{
return mysqltimestamp_to_unixtimestamp ( $this -> sSubmitTime );
}
2007-12-19 15:06:35 +01:00
function objectGetItemsPerPage ( $sState = 'accepted' )
2007-06-12 00:02:41 +00:00
{
$aItemsPerPage = array ( 25 , 50 , 100 , 200 );
$iDefaultPerPage = 25 ;
return array ( $aItemsPerPage , $iDefaultPerPage );
}
2007-06-14 00:50:35 +00:00
function objectGetId ()
{
return $this -> iTestingId ;
}
2007-09-14 23:02:12 -04:00
function objectGetSubmitterId ()
{
return $this -> iSubmitterId ;
}
2005-10-17 03:59:24 +00:00
}
?>