From 87997c607711321724790b47d207378defbb84c1 Mon Sep 17 00:00:00 2001 From: "psychoticwolf%carolina.rr.com" Date: Sun, 31 Oct 2004 20:57:26 +0000 Subject: [PATCH] Land New FAQ, Category and Application Managers. Fixes Bug 255309, Bug 255312, and the DevCP part of Bug 256254. Other fixes included, Bug 254925. --- webtools/update/developers/additem.php | 7 +- webtools/update/developers/appmanager.php | 278 +++++++++--------- .../update/developers/categorymanager.php | 157 +++++----- webtools/update/developers/faqmanager.php | 164 +++++++---- 4 files changed, 327 insertions(+), 279 deletions(-) diff --git a/webtools/update/developers/additem.php b/webtools/update/developers/additem.php index b85aa0ec5545..ab43b21d4e07 100755 --- a/webtools/update/developers/additem.php +++ b/webtools/update/developers/additem.php @@ -265,7 +265,7 @@ if ($mode=="update") { $sql = "SELECT `Name`, `Homepage`, `Description` FROM `t_main` WHERE `ID` = '$item_id' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); - $name = $row["Name"]; + if (!$name) { $name=$row["Name"]; } $homepage = $row["Homepage"]; $description = $row["Description"]; @@ -335,7 +335,11 @@ if (!$authors) {$authors="$_SESSION[email]"; } ?> Author(s):*" SIZE=45> Version:*$version\n"; +} else { echo"Version:*\n"; +} echo"OS*" SIZE=70> - - - - - - - - -MozUpdates :: Manage Application Versions - - - + + +Mozilla Update :: Developer Control Panel :: Application Manager +Access Denied\n"; + echo"You do not have access to the Application Manager"; + include"$page_footer"; + echo"\n"; + exit; +} ?> Processing Add Request, please wait...\n"; + + $appname = $_POST["appname"]; + $guid = $_POST["guid"]; + $shortname = $_POST["shortname"]; + $version = $_POST["version"]; + $major = $_POST["Major"]; + $minor = $_POST["Minor"]; + $release = $_POST["Release"]; + $subver = $_POST["SubVer"]; + $public_ver = $_POST["public_ver"]; + + $sql = "INSERT INTO `t_applications` (`AppName`, `GUID`, `shortname`, `Version`, `major`, `minor`, `release`,`SubVer`,`public_ver`) VALUES ('$appname','$guid','$shortname','$version', '$major','$minor','$release','$subver','$public_ver')"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + if ($sql_result) { + echo"The application $appname $version has been successfully added."; + } } ?> - - - - - +

Manage Application List

+     Show Versions for: $appname / "; + } + echo"Add New Application..."; +?> + +

Application Versions for

+
Manage Application List:
- - + +MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); - - $lastname = ""; - while ($row = mysql_fetch_array($sql_result)) { - - // If it's a new AppName, start a new row - if ($lastname != $row["AppName"]) { - - // Close out previous row if necessary - if ($lastname != "") { - echo""; - echo"\n"; - } - - $applications[] = $row["AppName"]; + echo"\n"; echo"\n"; - echo""; - echo""; + echo""; + echo"\n"; - } else { - - // Separate with a comma - - echo", "; - } - - echo""; - echo $row["Version"]; - echo""; - - $lastname = $row["AppName"]; } - echo""; - echo"\n"; - ?>
ReleaseVersionReleasePublic Version?
".++$i." ".$row["AppName"]."  "; + echo" $row[AppName] $row[Version]$row[public_ver]
-
-The application $_POST[AppName] (Version $_POST[Release]$_POST[SubVer]) has been successfully added.
"; - } -?> +

New Version of

-New Application - Name: -Release: +"> +"> -"+", "a"=>"alpha","b"=>"beta","final"=>"final"); +Display Version (e.g. 1.0PR):
- foreach($subvers as $key => $subver) { - $subver = ucwords($subver); - echo"\n"; - } -?> - -GUID: +Major: +Minor: +Release: +SubVer:
-If other, Name: - - - - - +
Should this version be exposed to end-users of the website, or just allowed for extension authors' install.rdf files? In general only release milestones should be exposed.
+Public Version: Yes: No:
+
+ 
- Processing update request, please wait...\n"; + $sql = "UPDATE `t_applications` SET `AppName`='$appname', `major`='$major', `minor`='$minor', `release`='$release', `SubVer`='$subver',`Version`='$version', `public_ver`='$public_ver' WHERE `appid`='$appid'"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + if ($sql_result) { + echo"Your update to $appname $version has been successful.
"; + } - echo"
Your update to $_POST[AppName], has been successful.
"; - - } else if ($_POST["submit"] == "Delete Application") { + } else if ($_POST["submit"] == "Delete Version") { + $appid=$_POST["appid"]; + $appname = $_POST["AppName"]; + $version = $_POST["version"]; + echo"

Processing delete request, please wait...

\n"; $sql = "DELETE FROM `t_applications` WHERE `appid`='$_POST[appid]'"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - - echo"
You've successfully deleted the application '$_POST[AppName]'.
"; + if ($sql_result) { + echo"You've successfully deleted the application '$appname $version'
"; + include"$page_footer"; + echo"\n\n"; + exit; + } } if (!$appid) { $appid = $_POST["appid"]; } @@ -167,38 +158,61 @@ if (!$appid) { $appid = $_POST["appid"]; } $row = mysql_fetch_array($sql_result); ?> -
+

Edit Application:

-
+
\n"; - echo"Major: "; - echo"Minor: "; - echo"Release: "; - echo"
\n"; + echo"Display Version:
\n"; + echo"Major: "; + echo"Minor: "; + echo"Release: "; + echo"SubVer:
\n"; - $subvers = array(""=>"", "+"=>"+", "a"=>"alpha", "b"=>"beta", "final"=>"final"); - - foreach($subvers as $key => $subver) { - $subver = ucwords($subver); - echo"\n"; - } - echo"
\n"; - - echo"GUID:
\n"; - - echo"\n"; ?> +
Should this version be exposed to end-users of the website, or just allowed for extension authors' install.rdf files? In general only release milestones should be exposed.
+ No: \n"; + } else if ($public_ver=="NO") { + echo"Yes: No: \n"; + } - - - + + echo"\n"; +?> +

+ + +?');">
+

«« Return to Application Manager
+ + +

Add New Application

+
+Application Name:
+GUID of App:
+Shortname:
+
+Display Version (e.g. 1.0PR):
+ +Major: +Minor: +Release: +SubVer: +
+ +
+  +
diff --git a/webtools/update/developers/categorymanager.php b/webtools/update/developers/categorymanager.php index b38a6f471a8b..53dccb0eebbf 100755 --- a/webtools/update/developers/categorymanager.php +++ b/webtools/update/developers/categorymanager.php @@ -1,65 +1,75 @@ - - - - - - - -Mozilla Update :: Category Manager - - - + + +Mozilla Update :: Developer Control Panel :: Category Manager +Access Denied\n"; + echo"You do not have access to the Category Manager"; + include"$page_footer"; + echo"\n"; + exit; +} ?> - MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); } ?> - -
Manage Category List:  Show: Manage Category List +     Show Categories for Application: $appname"; + if ($num_results>$i) { echo" / "; } + } + +?> + +"Extensions", "T"=>"Themes","P"=>"Plugins"); + $sql1 = "SELECT `CatType`, `CatApp` FROM `t_categories` WHERE `CatApp`='$application' GROUP BY `CatType` ORDER BY `CatType`"; + $sql_result1 = mysql_query($sql1, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); + while ($row = mysql_fetch_array($sql_result1)) { $type = ucwords($row["CatType"]); - echo""; -if ($types[$type]) {$type = $types[$type]; } - echo"$type"; - echo" / \n"; - } - echo"All\n"; -?> + $application = strtolower($row["CatApp"]); + $typename=$typenames["$type"]; +?> - + -$i\n"; echo"\n"; echo"\n"; - echo"\n"; echo"\n"; } -?> -

Name DescriptionType
$catname$catdesc$cattype
-
-MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - echo"
The category $_POST[catname] has been Successfully Added...
"; } ?> +
+

New Category for

+
-New Category - -Name: -Description:
+ +Name:
+Description:
Type: -If other, Type: +If other, Type:
@@ -117,68 +119,53 @@ If other, Type: $categoryid = $_GET["categoryid"]; //Post Functions if ($_POST["submit"] == "Update") { - $sql = "UPDATE `t_categories` SET `CatName`='$_POST[catname]', `CatDesc`='$_POST[catdesc]', `CatType`='$_POST[cattype]' WHERE `CategoryID`='$_POST[categoryid]'"; - $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); + echo"

Processing Update, please wait...

\n"; + $categoryid = $_POST["categoryid"]; + $catname = $_POST["catname"]; + $catdesc = $_POST["catdesc"]; + $cattype = $_POST["cattype"]; + $sql = "UPDATE `t_categories` SET `CatName`='$catname', `CatDesc`='$catdesc', `CatType`='$cattype' WHERE `CategoryID`='$categoryid'"; + $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - echo"
Your update to $_POST[catname], has been submitted successfully...
"; + echo"Your update to $catname, has been submitted successfully...
"; } else if ($_POST["submit"] == "Delete Category") { - $sql = "DELETE FROM `t_categories` WHERE `CategoryID`='$_POST[categoryid]'"; + echo"

Processing Delete Request, please wait...

\n"; + $categoryid = $_POST["categoryid"]; + $sql = "DELETE FROM `t_categories` WHERE `CategoryID`='$categoryid'"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - echo"
You've successfully deleted the category '$_POST[catname]'...
"; + echo"You've successfully deleted the category '$catname'...
"; } if (!$categoryid) { $categoryid = $_POST["categoryid"]; } // Show Edit Form $sql = "SELECT * FROM `t_categories` WHERE `CategoryID` = '$categoryid' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - $row = mysql_fetch_array($sql_result); $categoryid = $row["CategoryID"]; + $catapp = ucwords($row["CatApp"]); $catname = $row["CatName"]; $catdesc = $row["CatDesc"]; $cattype = $row["CatType"]; ?>
-

Edit Category:

+

Edit Category :


\n"; - echo"Description:
\n"; - echo"Type: \n"; - echo"
\n"; + echo"Name:
\n"; + echo"Description:
\n"; + echo"Type:
\n"; + echo"\n"; ?> - -
+ for ?');"> +
«« Return to Category Manager
MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); - -// echo"
The category $_POST[catname] has been Successfully Added...
"; -//} -?> - -//

Add New Category:

-//
-//Name:
-//Description:
-//Type:
-// -// -//
-?> - diff --git a/webtools/update/developers/faqmanager.php b/webtools/update/developers/faqmanager.php index 2fd634306fa2..fabbbd6b6f69 100755 --- a/webtools/update/developers/faqmanager.php +++ b/webtools/update/developers/faqmanager.php @@ -1,40 +1,34 @@ - - - - - - - - -MozUpdates :: Manage Application Versions - - - + + +Mozilla Update :: Developer Control Panel :: FAQ Manager +Access Denied\n"; + echo"You do not have access to the FAQ Manager"; + include"$page_footer"; + echo"\n"; + exit; +} ?> - - - - - +

Manage FAQs:

+
Manage FAQs:
@@ -70,66 +64,92 @@ if (!$function) { } ?>
-
+

New FAQ Entry

-New FAQ Entry - Title: - + + Title: +
Processing your update, please wait...\n"; + $title = $_POST["title"]; + $index = $_POST["index"]; + $alias = $_POST["alias"]; + $text = $_POST["text"]; + $active = $_POST["active"]; + $id = $_POST["id"]; + $sql = "UPDATE `t_faq` SET `title`='$title', `index`='$index', `alias`='$alias', `text`='$text', `active`='$active' WHERE `id`='$id'"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - - - echo"
Your update to $_POST[title], has been successful.
"; + if ($sql_result) { + echo"Your update to '$title', has been successful.
"; + } } else if ($_POST["submit"] == "Delete Entry") { - $sql = "DELETE FROM `t_faq` WHERE `id`='$_POST[id]'"; + echo"

Processing, please wait...

\n"; + $id = $_POST["id"]; + $title = $_POST["title"]; + $sql = "DELETE FROM `t_faq` WHERE `id`='$id'"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - - echo"
You've successfully deleted the application '$_POST[AppName]'.
"; + if ($sql_result) { + echo"You've successfully deleted the FAQ Entry '$title'."; + include"$page_footer"; + echo"\n\n"; + exit; + } } -if (!$id) { $id = $_POST["id"]; } // Show Edit Form $sql = "SELECT * FROM `t_faq` WHERE `id` = '$id' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); ?> -

Edit FAQ Entry:

\n"; - echo"Title:
\n"; - echo"Index:   "; - echo"Alias:
"; - echo"Entry Text:
"; + echo"Title: "; + echo"Alias:
\n"; + +//List of Entry Index for User Convienience + echo"Existing Index Reference:
\n"; + + echo"Index:
\n"; + echo"
\n"; + + echo"Entry Text:

"; $active = $row["active"]; +echo"Show Entry on FAQ Page: "; if ($active=="YES") { - echo"Yes: / No: "; + echo"Yes: No: "; } else if ($active=="NO") { - echo"Yes: / No: "; + echo"Yes: No: "; } else { - echo"Yes: / No: "; + echo"Yes: No: "; } ?> -
- - - +

+ + +?');" />
+

«« Return to FAQ Manager -
Adding Entry, please wait...\n"; + $title = $_POST["title"]; + $index = $_POST["index"]; + $alias = $_POST["alias"]; + $text = $_POST["text"]; + $active = $_POST["active"]; + $id = $_POST["id"]; + $sql = "INSERT INTO `t_faq` (`title`,`index`,`alias`, `text`, `active`) VALUES ('$title','$index','$alias', '$text', '$active')"; $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."
", E_USER_NOTICE); - - - echo"
The entry $_POST[title] has been successfully added.
"; + if ($sql_result) { + echo"The entry '$title' has been successfully added.
\n"; + } } ?> -
-

Add FAQ Entry:

+

Add FAQ Entry:


\n"; - echo"Index:   "; - echo"Alias:
"; - echo"Entry Text:
"; +$title = $_POST["title"]; + + echo"Title:  \n"; + echo"Alias:
"; + +//List of Entry Index for User Convienience + echo"
Existing Index Reference:
\n"; + echo"Index: (used for FAQ page sort order)

\n"; + + echo"Entry Text:

"; + echo"Show Entry on FAQ Page: "; echo"Yes: / No: "; ?> -
+

+

«« Return to FAQ Manager