server half of bug 285653. Add new problem types, as well as a few changes to make it easier to add/change them in the future. Not part of any build

This commit is contained in:
robert%accettura.com 2005-04-20 21:43:25 +00:00
Родитель 94ba73e1e0
Коммит 3de16d406e
5 изменённых файлов: 10 добавлений и 112 удалений

Просмотреть файл

@ -79,13 +79,7 @@ function strMiddleReduceWordSensitive($string, $max = 50, $rep = '[...]') {
function resolveProblemTypes($q){
global $problemTypes;
reset($problemTypes);
while (list($key, $val) = each($problemTypes)) {
if (isset($val[$q])) {
$result = $val[$q];
}
}
return $result;
return $problemTypes[$q];
}
function navigation($pre_href='?page=', $post_href='', $num_items=0, $items_per_page=25, $active=1, $nearby=5, $threshold=100){

Просмотреть файл

@ -143,15 +143,10 @@ include($config['app_path'].'/includes/message.inc.php');
<tr>
<td class="label"><label for="report_problem_type">Problem Type:</label></td>
<td>
<input type="radio" name="report_problem_type" ID="0_0" VALUE="0_0" <?php if (($_GET['report_problem_type'] == '0_0') || ($_GET['report_problem_type'] == '')) { ?>checked="true"<?php } ?>><label for="0_0">All types</label><br>
<input type="radio" name="report_problem_type" ID="1_1" VALUE="1_1" <?php if ($_GET['report_problem_type'] == '1_1') { ?>checked="true"<?php } ?>><label for="1_1">Program freezes</label><br>
<input type="radio" name="report_problem_type" ID="1_2" VALUE="1_2" <?php if ($_GET['report_problem_type'] == '1_2') { ?>checked="true"<?php } ?>><label for="1_2">Program crashes</label><br>
<input type="radio" name="report_problem_type" ID="2_1" VALUE="2_1" <?php if ($_GET['report_problem_type'] == '2_1') { ?>checked="true"<?php } ?>><label for="2_1">Program slows down</label><br>
<input type="radio" name="report_problem_type" ID="3_1" VALUE="3_1" <?php if ($_GET['report_problem_type'] == '3_1') { ?>checked="true"<?php } ?>><label for="3_1">Page displays improperly</label><br>
<input type="radio" name="report_problem_type" ID="3_2" VALUE="3_2" <?php if ($_GET['report_problem_type'] == '3_2') { ?>checked="true"<?php } ?>><label for="3_2">Page does not display</label><br>
<input type="radio" name="report_problem_type" ID="3_3" VALUE="3_3" <?php if ($_GET['report_problem_type'] == '3_3') { ?>checked="true"<?php } ?>><label for="3_3">Page does not work properly</label><br>
<input type="radio" name="report_problem_type" ID="3_4" VALUE="3_4" <?php if ($_GET['report_problem_type'] == '3_4') { ?>checked="true"<?php } ?>><label for="3_4">Page does not load</label><br>
<input type="radio" name="report_problem_type" ID="3_5" VALUE="3_5" <?php if ($_GET['report_problem_type'] == '3_5') { ?>checked="true"<?php } ?>><label for="3_5">Program blocked/("Netscape not supported")</label><br>
<input type="radio" name="report_problem_type" id="0" value="0" <?php if (($_GET['report_problem_type'] == '0') || ($_GET['report_problem_type'] == '')) { ?>checked="true"<?php } ?>><label for="0">All types</label><br>
<?php foreach($problemTypes as $key => $title){ ?>
<input type="radio" name="report_problem_type" id="<?php print $key; ?>" value="<?php print $key; ?>" <?php if ($_GET['report_problem_type'] == $key) { ?>checked="true"<?php } ?>><label for="<?php print $key; ?>"><?php print $title; ?></label><br>
<?php } ?>
</td>
</tr>
<tr>

Просмотреть файл

@ -145,7 +145,7 @@ else if ($_GET['submit_query']){
($param == 'report_oscpu') ||
($param == 'report_product')){
// there sare our various ways of saying "no value"
if (($val != -1) && ($val != null) && ($val != '0_0')){
if (($val != -1) && ($val != null) && ($val != '0')){
// if there's a wildcard (%,_) we should use 'LIKE', otherwise '='
// XX-> strpos returns 0 if the first char is % or _, so we just pad it with a 'x' to force it to do so... harmless hack
if ((strpos('x'.$val, "%") == false) && (strpos('x'.$val, "_") == false)){

Просмотреть файл

@ -1,91 +0,0 @@
<?php
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Reporter (r.m.o).
*
* The Initial Developer of the Original Code is
* Robert Accettura <robert@accettura.com>.
*
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// Debug
$config['debug'] = false;
// Paths
$config['app_url'] = 'http://reporter.host.tld/app';
$config['app_path'] = '/opt/webtools/reporter';
// Database
$config['db_type'] = 'mysql';
$config['db_server'] = 'localhost';
$config['db_user'] = 'USERNAME';
$config['db_pass'] = 'DB_PASSWORD';
$config['db_database'] = 'DATABASE_NAME';
$config['db_dsn'] = $config['db_type'].'://'.$config['db_user'].':'.$config['db_pass'].'@'.$config['db_server'].'/'.$config['db_database'];
$config['db_options'] = array(
'debug' => 2,
'portability' => DB_PORTABILITY_ALL,
);
$config['gzip'] = false; // should we gzip encode (more cpu, less bandwidth) XX-> Not implemented
$config['min_vers'] = '0.2';
// products to show in the pull down on the query page
$config['products'][0]['id'] = 'Firefox/1.0';
$config['products'][0]['title'] = 'Firefox 1.0';
$config['show'] = 25;
/*****************************/
// Shouldn't need to touch this
/*****************************/
$config['self'] = 'http://' . $_SERVER['SERVER_NAME'] . substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')) . '/';
$boolTypes[-1] = '--';
$boolTypes[0] = 'No';
$boolTypes[1] = 'Yes';
// ProblemTypes
$problemTypes['0_0'] = '--';
$problemTypes['Crash']['1_1'] = 'Freeze';
$problemTypes['Crash']['1_2'] = 'Crashes Mozilla';
$problemTypes['Performance']['2_1'] = 'Slows Down Mozilla';
$problemTypes['Compatibility']['3_1'] = 'Appears Wrong';
$problemTypes['Compatibility']['3_2'] = 'Doesn\'t Appear';
$problemTypes['Compatibility']['3_3'] = 'Doesn\'t Function Properly';
$problemTypes['Compatibility']['3_4'] = 'Doesn\'t Load';
$problemTypes['Compatibility']['3_5'] = 'Mozilla Blocked / ("Netscape Not Supported")';
$problemTypes['Compatibility']['3_6'] = 'Appears Wrong';
?>

Просмотреть файл

@ -106,7 +106,7 @@ function submitReport($rmoVers, $url, $problem_type, $description, $behind_login
if (!$url || !$parsedURL['host']){
return new soap_fault('Client', '', 'url must use a valid URL syntax http://domain.tld/foo', $url);
}
if (!$problem_type || $problem_type == -1 || $problem_type == "0_0") {
if (!$problem_type || $problem_type == -1 || $problem_type == "0") {
}
if ($behind_login != 1 && $behind_login != 0) {
return new soap_fault('Client', '', 'behind_login must be type bool int', $behind_login);
@ -244,9 +244,9 @@ function register($language){
$id = date("ymd").rand(1000,9999);
$query =& $db->Execute("SELECT sysid.sysid_id
........ FROM sysid
WHERE sysid.sysid_id = '$newid'
");
FROM sysid
WHERE sysid.sysid_id = '$newid'
");
$numRows = $query->RecordCount();
if ($numRows == 0) {
// It's unique, stop the loop.