Let objectManager handle screenshot queue processing
This commit is contained in:
committed by
WineHQ
parent
3c3e3a7ca4
commit
b628b3af0e
@@ -13,6 +13,7 @@ class appData
|
||||
var $iVersionId;
|
||||
var $iSubmitterId;
|
||||
var $sSubmitTime;
|
||||
var $sDescription;
|
||||
|
||||
function appData($iId = null, $oRow = null)
|
||||
{
|
||||
@@ -21,8 +22,8 @@ class appData
|
||||
|
||||
if(!$oRow)
|
||||
{
|
||||
$hResult = query_parameters("SELECT * FROM appData WHERE $iId = '?'", $iId);
|
||||
$oRow = mysql_fetch_object();
|
||||
$hResult = query_parameters("SELECT * FROM appData WHERE id = '?'", $iId);
|
||||
$oRow = mysql_fetch_object($hResult);
|
||||
}
|
||||
|
||||
if($oRow)
|
||||
@@ -32,6 +33,7 @@ class appData
|
||||
$this->iVersionId = $oRow->versionId;
|
||||
$this->sSubmitTime = $oRow->submitTime;
|
||||
$this->iId = $iId;
|
||||
$this->sDescription = $oRow->description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,8 +346,8 @@ class appData
|
||||
$this->iVersionId ? $oVersion->sName : "N/A");
|
||||
|
||||
if(appData::canEdit($oObject->sClass))
|
||||
$aCells[] = "[ <a href=\"".BASE."admin/adminAppDataQueue.php?iId=".
|
||||
"$this->iId\">Process</a> ]";
|
||||
$aCells[] = "[ <a href=\"".$oObject->makeUrl("edit",
|
||||
$this->iId)."\">Process</a> ]";
|
||||
|
||||
echo html_tr($aCells, $sClass);
|
||||
}
|
||||
@@ -356,6 +358,44 @@ class appData
|
||||
"Please inspect the data carefully before accepting or rejecting it.</p>";
|
||||
echo $sHelp;
|
||||
}
|
||||
|
||||
/* Output the part of an appData editor which is the same for all data types */
|
||||
function outputEditorGeneric()
|
||||
{
|
||||
$oVersion = new version($this->iVersionId);
|
||||
if($oVersion->iVersionId)
|
||||
{
|
||||
$this->iAppId = $oVersion->iAppId;
|
||||
$sVersionName = $oVersion->objectMakeLink();
|
||||
}
|
||||
else
|
||||
$sVersionName = "N/A";
|
||||
|
||||
$oApp = new Application($this->iAppId);
|
||||
|
||||
// view application details
|
||||
echo html_frame_start("New Application Data Form",600,"",0);
|
||||
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
||||
|
||||
// app name
|
||||
echo '<tr valign=top><td class=color0><b>App Name</b></td>',"\n";
|
||||
echo "<td>".$oApp->objectMakeLink()."</td></tr>\n";
|
||||
|
||||
// version
|
||||
echo '<tr valign=top><td class=color0><b>App Version</b></td>',"\n";
|
||||
echo "<td>$sVersionName</td></tr>\n";
|
||||
|
||||
//dataDescription
|
||||
echo '<tr valign=top><td class=color0><b>Description</b></td>',"\n";
|
||||
echo '<td><textarea name="sDescription" rows=10 cols=35>'.stripslashes($this->sDescription).'</textarea></td></tr>',"\n";
|
||||
}
|
||||
|
||||
function getDefaultReply()
|
||||
{
|
||||
$sReplyText = "Enter a personalized reason for acceptance or rejection of the".
|
||||
" submitted application data here";
|
||||
return $sReplyText;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -813,6 +813,13 @@ class Application {
|
||||
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
function objectMakeLink()
|
||||
{
|
||||
$sLink = "<a href=\"".BASE."appview.php?iAppId=$this->iAppId\">".
|
||||
$this->sName."</a>";
|
||||
return $sLink;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -150,6 +150,10 @@ class Screenshot {
|
||||
}
|
||||
}
|
||||
|
||||
function reject()
|
||||
{
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Move screenshot out of the queue.
|
||||
@@ -543,6 +547,59 @@ class Screenshot {
|
||||
{
|
||||
return appData::objectDisplayQueueProcessingHelp();
|
||||
}
|
||||
|
||||
function outputEditor()
|
||||
{
|
||||
$oAppData = new appData($this->iScreenshotId);
|
||||
$oAppData->outputEditorGeneric();
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>Submited screenshot</b></td>',"\n";
|
||||
echo '<td>';
|
||||
$imgSRC = '<img width="'.$this->get_thumbnail_width().'" height="'.
|
||||
$this->get_thumbnail_height().'" src="'.BASE.
|
||||
'appimage.php?bQueued=true&iId='.$this->iScreenshotId.'" />';
|
||||
// generate random tag for popup window
|
||||
$randName = User::generate_passwd(5);
|
||||
// set image link based on user pref
|
||||
$img = '<a href="javascript:openWin(\''.BASE.'appimage.php?bQueued=true&iId='.
|
||||
$this->iScreenshotId.'\',\''.$randName.'\','.$this->get_screenshot_width()
|
||||
.','.($this->get_screenshot_height()+4).');">'.$imgSRC.'</a>';
|
||||
if ($_SESSION['current']->isLoggedIn())
|
||||
{
|
||||
if ($_SESSION['current']->getpref("window:screenshot") == "no")
|
||||
{
|
||||
$img = '<a href="'.BASE.'appimage.php?bQueued=true&iId='.
|
||||
$this->iScreenshotId.'">'.$imgSRC.'</a>';
|
||||
}
|
||||
}
|
||||
echo $img;
|
||||
echo '</td></tr>',"\n";
|
||||
echo '<input type="hidden" name="iScreenshotId" value="'.
|
||||
$this->iScreenshotId.'" />';
|
||||
echo html_frame_end();
|
||||
}
|
||||
|
||||
function getOutputEditorValues($aClean)
|
||||
{
|
||||
/* STUB: No update possible, reply text fetched from $aClean */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function update()
|
||||
{
|
||||
/* STUB: No updating possible at the moment */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function objectHideDelete()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function getDefaultReply()
|
||||
{
|
||||
return appData::getDefaultReply();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1132,6 +1132,13 @@ class Version {
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
function objectMakeLink()
|
||||
{
|
||||
$sLink = "<a href=\"".BASE."appview.php?iVersionId=$this->iVersionId\">".
|
||||
$this->sName."</a>";
|
||||
return $sLink;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user