Implement Maintainer ratings.
This commit is contained in:
committed by
Jeremy Newman
parent
4dec5cf83e
commit
c7beb30195
@@ -29,10 +29,17 @@ if(isset($_REQUEST['submit1']))
|
|||||||
$old_keywords = $ob->keywords;
|
$old_keywords = $ob->keywords;
|
||||||
$old_description = $ob->description;
|
$old_description = $ob->description;
|
||||||
$old_webPage = $ob->webPage;
|
$old_webPage = $ob->webPage;
|
||||||
|
$old_rating = $ob->maintainer_rating;
|
||||||
|
$old_release = $ob->maintainer_release;
|
||||||
|
|
||||||
|
$versionName = addslashes($_REQUEST['versionName']);
|
||||||
|
$keywords = $_REQUEST['keywords'];
|
||||||
|
$description = addslashes($_REQUEST['description']);
|
||||||
|
$webPage = addslashes($_REQUEST['webPage']);
|
||||||
|
$maintainer_rating = $_REQUEST['maintainer_rating'];
|
||||||
|
$maintainer_release = $_REQUEST['maintainer_release'];
|
||||||
|
|
||||||
|
|
||||||
$versionName = addslashes($_REQUEST['versionName']);
|
|
||||||
$description = addslashes($_REQUEST['description']);
|
|
||||||
$webPage = addslashes($_REQUEST['webPage']);
|
|
||||||
$VersionChanged = false;
|
$VersionChanged = false;
|
||||||
if ($old_versionName <> $versionName)
|
if ($old_versionName <> $versionName)
|
||||||
{
|
{
|
||||||
@@ -40,7 +47,7 @@ if(isset($_REQUEST['submit1']))
|
|||||||
$WhatChanged .= " New Value: ".stripslashes($versionName)."\n";
|
$WhatChanged .= " New Value: ".stripslashes($versionName)."\n";
|
||||||
$VersionChanged = true;
|
$VersionChanged = true;
|
||||||
}
|
}
|
||||||
if ($old_keywords <> $_REQUEST['keywords'])
|
if ($old_keywords <> $keywords)
|
||||||
{
|
{
|
||||||
$WhatChanged .= " Key Words: Old Value: ".stripslashes($old_keywords)."\n";
|
$WhatChanged .= " Key Words: Old Value: ".stripslashes($old_keywords)."\n";
|
||||||
$WhatChanged .= " New Value: ".stripslashes($keywords)."\n";
|
$WhatChanged .= " New Value: ".stripslashes($keywords)."\n";
|
||||||
@@ -64,13 +71,29 @@ if(isset($_REQUEST['submit1']))
|
|||||||
$WhatChanged .= "-----------------------:\n";
|
$WhatChanged .= "-----------------------:\n";
|
||||||
$VersionChanged = true;
|
$VersionChanged = true;
|
||||||
}
|
}
|
||||||
|
if ($old_rating <> $maintainer_rating)
|
||||||
|
{
|
||||||
|
$WhatChanged .= " Release: Old Value: ".stripslashes($old_rating)."\n";
|
||||||
|
$WhatChanged .= " New Value: ".stripslashes($maintainer_rating)."\n";
|
||||||
|
$VersionChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old_release <> $maintainer_release)
|
||||||
|
{
|
||||||
|
$WhatChanged .= " Release: Old Value: ".stripslashes($old_release)."\n";
|
||||||
|
$WhatChanged .= " New Value: ".stripslashes($maintainer_release)."\n";
|
||||||
|
$VersionChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
//did anything change?
|
//did anything change?
|
||||||
if ($VersionChanged)
|
if ($VersionChanged)
|
||||||
{
|
{
|
||||||
$query = "UPDATE appVersion SET versionName = '".$versionName."', ".
|
$query = "UPDATE appVersion SET versionName = '".$versionName."', ".
|
||||||
"keywords = '".$_REQUEST['keywords']."', ".
|
"keywords = '".$_REQUEST['keywords']."', ".
|
||||||
"description = '".$description."', ".
|
"description = '".$description."', ".
|
||||||
"webPage = '".$webPage."'".
|
"webPage = '".$webPage."',".
|
||||||
|
"maintainer_rating = '".$maintainer_rating."',".
|
||||||
|
"maintainer_release = '".$maintainer_release."'".
|
||||||
" WHERE appId = ".$_REQUEST['appId']." and versionId = ".$_REQUEST['versionId'];
|
" WHERE appId = ".$_REQUEST['appId']." and versionId = ".$_REQUEST['versionId'];
|
||||||
if (mysql_query($query))
|
if (mysql_query($query))
|
||||||
{
|
{
|
||||||
@@ -116,12 +139,12 @@ if(isset($_REQUEST['submit1']))
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$query = "SELECT versionName, keywords, ".
|
$query = "SELECT versionName, keywords, ".
|
||||||
"description, webPage from appVersion WHERE ".
|
"description, webPage, maintainer_rating, maintainer_release from appVersion WHERE ".
|
||||||
"appId = '".$_REQUEST['appId']."' and versionId = '".$_REQUEST['versionId']."'";
|
"appId = '".$_REQUEST['appId']."' and versionId = '".$_REQUEST['versionId']."'";
|
||||||
if(debugging()) { echo "<p align=center><b>query:</b> $query </p>"; }
|
if(debugging()) { echo "<p align=center><b>query:</b> $query </p>"; }
|
||||||
|
|
||||||
$result = mysql_query($query);
|
$result = mysql_query($query);
|
||||||
list($versionName, $keywords, $description, $webPage) = mysql_fetch_row($result);
|
list($versionName, $keywords, $description, $webPage, $maintainer_rating, $maintainer_release) = mysql_fetch_row($result);
|
||||||
|
|
||||||
apidb_header("Edit Application Version");
|
apidb_header("Edit Application Version");
|
||||||
|
|
||||||
@@ -138,6 +161,12 @@ if(isset($_REQUEST['submit1']))
|
|||||||
echo '<tr><td class=color4>Description</td><td class=color0>', "\n";
|
echo '<tr><td class=color4>Description</td><td class=color0>', "\n";
|
||||||
echo '<textarea cols=$80 rows=$30 name="description">'.stripslashes($description).'</textarea></td></tr>',"\n";
|
echo '<textarea cols=$80 rows=$30 name="description">'.stripslashes($description).'</textarea></td></tr>',"\n";
|
||||||
echo '<tr><td class=color1>Web Page</td><td class=color0><input size=80% type="text" name="webPage" value="'.$webPage.'" /></td></tr>',"\n";
|
echo '<tr><td class=color1>Web Page</td><td class=color0><input size=80% type="text" name="webPage" value="'.$webPage.'" /></td></tr>',"\n";
|
||||||
|
echo '<tr><td class=color4>Rating</td><td class=color0>',"\n";
|
||||||
|
make_maintainer_rating_list("maintainer_rating", $maintainer_rating);
|
||||||
|
echo '</td></tr>',"\n";
|
||||||
|
echo '<tr><td class=color1>Release</td><td class=color0>',"\n";
|
||||||
|
make_bugzilla_version_list("maintainer_release", $maintainer_release);
|
||||||
|
echo '</td></tr>',"\n";
|
||||||
|
|
||||||
echo '<tr><td colspan=2 align=center class=color3><input type="submit" name=submit1 value="Update Database" /></td></tr>',"\n";
|
echo '<tr><td colspan=2 align=center class=color3><input type="submit" name=submit1 value="Update Database" /></td></tr>',"\n";
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ function make_bugzilla_version_list($varname, $cvalue)
|
|||||||
echo "<option value=0>Choose ...</option>\n";
|
echo "<option value=0>Choose ...</option>\n";
|
||||||
while(list($value) = mysql_fetch_row($result))
|
while(list($value) = mysql_fetch_row($result))
|
||||||
{
|
{
|
||||||
if($id == $cvalue)
|
if($value == $cvalue)
|
||||||
echo "<option value=$value selected>$value\n";
|
echo "<option value=$value selected>$value\n";
|
||||||
else
|
else
|
||||||
echo "<option value=$value>$value\n";
|
echo "<option value=$value>$value\n";
|
||||||
@@ -229,6 +229,24 @@ function make_bugzilla_version_list($varname, $cvalue)
|
|||||||
closebugzilladb();
|
closebugzilladb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function make_maintainer_rating_list($varname, $cvalue)
|
||||||
|
{
|
||||||
|
|
||||||
|
echo "<select name='$varname'>\n";
|
||||||
|
echo "<option value=0>Choose ...</option>\n";
|
||||||
|
$aRating = array("Gold", "Silver", "Bronze", "Garbage");
|
||||||
|
$iMax = count($aRating);
|
||||||
|
|
||||||
|
for($i=0; $i < $iMax; $i++)
|
||||||
|
{
|
||||||
|
if($aRating[$i] == $cvalue)
|
||||||
|
echo "<option value=$aRating[$i] selected>$aRating[$i]\n";
|
||||||
|
else
|
||||||
|
echo "<option value=$aRating[$i]>$aRating[$i]\n";
|
||||||
|
}
|
||||||
|
echo "</select>\n";
|
||||||
|
}
|
||||||
|
|
||||||
/* get the number of applications in the appQueue table */
|
/* get the number of applications in the appQueue table */
|
||||||
function getQueuedAppCount()
|
function getQueuedAppCount()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,14 +52,16 @@ create table appFamily (
|
|||||||
* a version of an application
|
* a version of an application
|
||||||
*/
|
*/
|
||||||
create table appVersion (
|
create table appVersion (
|
||||||
versionId int not null auto_increment,
|
versionId int not null auto_increment,
|
||||||
appId int not null,
|
appId int not null,
|
||||||
versionName varchar(100) not null,
|
versionName varchar(100) not null,
|
||||||
keywords text,
|
keywords text,
|
||||||
description text,
|
description text,
|
||||||
webPage varchar(100),
|
webPage varchar(100),
|
||||||
rating_windows float default 0.0,
|
rating_windows float default 0.0,
|
||||||
rating_fake float default 0.0,
|
rating_fake float default 0.0,
|
||||||
|
maintainer_rating text,
|
||||||
|
maintainer_release text,
|
||||||
key(versionId)
|
key(versionId)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -181,7 +183,7 @@ create table appData (
|
|||||||
id int not null auto_increment,
|
id int not null auto_increment,
|
||||||
appId int not null,
|
appId int not null,
|
||||||
versionId int default 0,
|
versionId int default 0,
|
||||||
type enum('image', 'url'),
|
type enum('image', 'url', 'bug'),
|
||||||
description text,
|
description text,
|
||||||
url varchar(255),
|
url varchar(255),
|
||||||
key(id),
|
key(id),
|
||||||
|
|||||||
Reference in New Issue
Block a user