2009/10/09 05:42:01 +0100 claunia: Systems get enumerated. Selection does not arrives object, so qsysId is always 0.
This commit is contained in:
@@ -36,6 +36,7 @@ class version {
|
|||||||
var $sTestedRating;
|
var $sTestedRating;
|
||||||
var $sSubmitTime;
|
var $sSubmitTime;
|
||||||
var $iSubmitterId;
|
var $iSubmitterId;
|
||||||
|
var $iqsysId;
|
||||||
private $sState;
|
private $sState;
|
||||||
var $sLicense;
|
var $sLicense;
|
||||||
var $aTestResults; /* Array of test result objects. Especially useful when
|
var $aTestResults; /* Array of test result objects. Especially useful when
|
||||||
@@ -83,6 +84,7 @@ class version {
|
|||||||
$this->sState = $oRow->state;
|
$this->sState = $oRow->state;
|
||||||
$this->sLicense = $oRow->license;
|
$this->sLicense = $oRow->license;
|
||||||
$this->iObsoleteBy = $oRow->obsoleteBy;
|
$this->iObsoleteBy = $oRow->obsoleteBy;
|
||||||
|
$this->iqsysId = $oRow->qsysId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,12 +106,12 @@ class version {
|
|||||||
$hResult = query_parameters("INSERT INTO appVersion
|
$hResult = query_parameters("INSERT INTO appVersion
|
||||||
(versionName, description, ratingRelease,
|
(versionName, description, ratingRelease,
|
||||||
rating, appId, submitTime, submitterId,
|
rating, appId, submitTime, submitterId,
|
||||||
state, license)
|
state, license, qsysId)
|
||||||
VALUES ('?', '?', '?', '?', '?', ?, '?', '?', '?')",
|
VALUES ('?', '?', '?', '?', '?', ?, '?', '?', '?', '?')",
|
||||||
$this->sName, $this->sDescription, $this->sTestedRelease,
|
$this->sName, $this->sDescription, $this->sTestedRelease,
|
||||||
$this->sTestedRating, $this->iAppId, "NOW()",
|
$this->sTestedRating, $this->iAppId, "NOW()",
|
||||||
$_SESSION['current']->iUserId, $this->sState,
|
$_SESSION['current']->iUserId, $this->sState,
|
||||||
$this->sLicense);
|
$this->sLicense, $this->iqsysId);
|
||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
@@ -249,6 +251,16 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->iqsysId && ($this->iqsysId!=$oVersion->iqsysId))
|
||||||
|
{
|
||||||
|
if(!query_parameters("UPDATE appVersion SET qsysId = '?' WHERE versionId = '?'",
|
||||||
|
$this->iqsysId, $this->iVersionId))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
$sWhatChanged .= "System was changed from $oVersion->iqsysId to ".
|
||||||
|
"$this->iqsysId.\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
if($this->objectGetState() != $oVersion->objectGetState())
|
if($this->objectGetState() != $oVersion->objectGetState())
|
||||||
query_parameters("UPDATE appVersion SET state = '?' WHERE versionId = '?'", $this->objectGetState(), $this->objectGetId());
|
query_parameters("UPDATE appVersion SET state = '?' WHERE versionId = '?'", $this->objectGetState(), $this->objectGetId());
|
||||||
|
|
||||||
@@ -574,13 +586,13 @@ class version {
|
|||||||
{
|
{
|
||||||
$sMsg = html_frame_start("Mark as obsolete", "90%", "", 0);
|
$sMsg = html_frame_start("Mark as obsolete", "90%", "", 0);
|
||||||
|
|
||||||
$sMsg .= "Some applications need to be updated from time to time in order to ";
|
/*$sMsg .= "Some applications need to be updated from time to time in order to ";
|
||||||
$sMsg .= "be of any use. An example is online multi-player games, where you need ";
|
$sMsg .= "be of any use. An example is online multi-player games, where you need ";
|
||||||
$sMsg .= "to be running a version compatible with the server. ";
|
$sMsg .= "to be running a version compatible with the server. ";
|
||||||
$sMsg .= "If this is such an application, and this version is no longer usable, ";
|
$sMsg .= "If this is such an application, and this version is no longer usable, ";
|
||||||
$sMsg .= "you can mark it as obsolete and move its current votes to a usable ";
|
$sMsg .= "you can mark it as obsolete and move its current votes to a usable ";
|
||||||
$sMsg .= "version instead.<br><br>";
|
$sMsg .= "version instead.<br><br>";
|
||||||
|
*/
|
||||||
$sMsg .= $sContent;
|
$sMsg .= $sContent;
|
||||||
|
|
||||||
$sMsg .= html_frame_end();
|
$sMsg .= html_frame_end();
|
||||||
@@ -657,6 +669,17 @@ class version {
|
|||||||
|
|
||||||
$oTableRow->AddTextCell($this->makeLicenseList());
|
$oTableRow->AddTextCell($this->makeLicenseList());
|
||||||
|
|
||||||
|
$oTable->AddRow($oTableRow);
|
||||||
|
|
||||||
|
// QEMU system
|
||||||
|
$oTableRow = new TableRow();
|
||||||
|
$oTableCell = new TableCell("System");
|
||||||
|
$oTableCell->SetBold(true);
|
||||||
|
$oTableCell->SetClass("color0");
|
||||||
|
$oTableRow->AddCell($oTableCell);
|
||||||
|
|
||||||
|
$oTableRow->AddTextCell($this->makeSystemsList());
|
||||||
|
|
||||||
$oTable->AddRow($oTableRow);
|
$oTable->AddRow($oTableRow);
|
||||||
|
|
||||||
// version description
|
// version description
|
||||||
@@ -738,6 +761,7 @@ class version {
|
|||||||
$this->sName = $aValues['sVersionName'];
|
$this->sName = $aValues['sVersionName'];
|
||||||
$this->sDescription = $aValues['shVersionDescription'];
|
$this->sDescription = $aValues['shVersionDescription'];
|
||||||
$this->sLicense = $aValues['sLicense'];
|
$this->sLicense = $aValues['sLicense'];
|
||||||
|
$this->iqsysId = $avalue['iqsysId'];
|
||||||
$this->iMaintainerRequest = $aValues['iMaintainerRequest'];
|
$this->iMaintainerRequest = $aValues['iMaintainerRequest'];
|
||||||
|
|
||||||
if($aValues['bObsolete'] == "true")
|
if($aValues['bObsolete'] == "true")
|
||||||
@@ -903,7 +927,7 @@ class version {
|
|||||||
|
|
||||||
// rating Area
|
// rating Area
|
||||||
echo "<tr class=\"$sRatingColor\" valign=\"top\"><td><b>Rating</b></td><td>".$sRating."</td></tr>\n";
|
echo "<tr class=\"$sRatingColor\" valign=\"top\"><td><b>Rating</b></td><td>".$sRating."</td></tr>\n";
|
||||||
echo "<tr class=\"$sRatingColor\" valign=\"top\"><td><b>Wine Version</b></td><td>".$sRelease."</td></tr>\n";
|
echo "<tr class=\"$sRatingColor\" valign=\"top\"><td><b>QEMU Version</b></td><td>".$sRelease."</td></tr>\n";
|
||||||
|
|
||||||
// Download URLs
|
// Download URLs
|
||||||
if($sDownloadurls = downloadurl::display($this->iVersionId))
|
if($sDownloadurls = downloadurl::display($this->iVersionId))
|
||||||
@@ -1252,7 +1276,7 @@ class version {
|
|||||||
$oTableCell->SetWidth("80");
|
$oTableCell->SetWidth("80");
|
||||||
$oTableRow->AddCell($oTableCell);
|
$oTableRow->AddCell($oTableCell);
|
||||||
|
|
||||||
$oTableCell = new TableCell("Wine version");
|
$oTableCell = new TableCell("QEMU version");
|
||||||
$oTableCell->SetWidth("80");
|
$oTableCell->SetWidth("80");
|
||||||
$oTableRow->AddCell($oTableCell);
|
$oTableRow->AddCell($oTableCell);
|
||||||
|
|
||||||
@@ -1437,6 +1461,37 @@ class version {
|
|||||||
return $sReturn;
|
return $sReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns a string containing the html for a selection list
|
||||||
|
public function makeSystemsList($iqsysId = NULL)
|
||||||
|
{
|
||||||
|
if(!$iqsysId)
|
||||||
|
$iqsysId = $this->iqsysId;
|
||||||
|
|
||||||
|
$sReturn = "<select name=\"iqsysId\">\n";
|
||||||
|
$sReturn .= "<option value=\"\">Choose . . .</option>\n";
|
||||||
|
$aSystems = qemuSystem::getOrderedList();
|
||||||
|
$iMax = count($aSystems);
|
||||||
|
|
||||||
|
for($i = 0; $i < $iMax; $i++)
|
||||||
|
{
|
||||||
|
if($aSystems[$i]->iSysId == $iqsysId)
|
||||||
|
$sSelected = " selected=\"selected\"";
|
||||||
|
else
|
||||||
|
$sSelected = "";
|
||||||
|
if($aSystems[$i]->iParentId !=0)
|
||||||
|
$sSpaces = " ";
|
||||||
|
else
|
||||||
|
$sSpaces = "";
|
||||||
|
|
||||||
|
$sReturn .= "<option value=\"".$aSystems[$i]->iSysId."\"$sSelected>$sSpaces".
|
||||||
|
$aSystems[$i]->sDescription."</option>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sReturn .= "</select>\n";
|
||||||
|
|
||||||
|
return $sReturn;
|
||||||
|
}
|
||||||
|
|
||||||
/* In order to prevent MySQL injections. Returns matched license */
|
/* In order to prevent MySQL injections. Returns matched license */
|
||||||
public static function checkLicense($sLicense)
|
public static function checkLicense($sLicense)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user