[ros-diffs] [dgoette] 405: implement design suggestions from Mariusz Przybylski

dgoette at svn.reactos.org dgoette at svn.reactos.org
Tue May 5 00:33:08 CEST 2009


Author: dgoette
Date: Tue May  5 02:33:07 2009
New Revision: 405

URL: http://svn.reactos.org/svn/reactos?rev=405&view=rev
Log:
implement design suggestions from Mariusz Przybylski

Modified:
    branches/compat/convert1to2.sql
    branches/compat/css/style.css
    branches/compat/js/submit.js
    branches/compat/lib/om/Category.class.php
    branches/compat/lib/om/Entry.class.php
    branches/compat/lib/view/HTML_Submit.class.php

Modified: branches/compat/convert1to2.sql
URL: http://svn.reactos.org/svn/reactos/branches/compat/convert1to2.sql?rev=405&r1=404&r2=405&view=diff
==============================================================================
--- branches/compat/convert1to2.sql [iso-8859-1] (original)
+++ branches/compat/convert1to2.sql [iso-8859-1] Tue May  5 02:33:07 2009
@@ -21,6 +21,7 @@
 CREATE TABLE cdb_categories (
   id BIGINT UNSIGNED NOT NULL ,
   parent BIGINT UNSIGNED NULL COMMENT '->categories(id)',
+  type ENUM('App','DLL','Drv', 'Oth') NOT NULL DEFAULT 'Oth',
   name VARCHAR( 100 ) NOT NULL ,
   description VARCHAR( 255 ) NOT NULL ,
   icon VARCHAR( 100 ) NULL ,
@@ -32,6 +33,7 @@
   SELECT
     cat_id,
     cat_path,
+    'App',
     cat_name,
     cat_description,
     cat_icon,
@@ -182,6 +184,8 @@
   user_id BIGINT UNSIGNED NOT NULL COMMENT '->roscms.users(id)',
   works ENUM( 'full', 'part', 'not' ) NULL,
   checked BOOL NOT NULL DEFAULT FALSE,
+  environment CHAR(4) NOT NULL DEFAULT 'unkn',
+  environment_version VARCHAR(10) NOT NULL DEFAULT '',
   created DATETIME NOT NULL,
   visible BOOL NOT NULL DEFAULT FALSE,
   disabled BOOL NOT NULL DEFAULT TRUE,
@@ -201,6 +205,8 @@
   comp_usrid,
   NULL,
   FALSE,
+  'unkn',
+  '',
   comp_date,
   TRUE,
   FALSE,
@@ -222,6 +228,7 @@
 -- -----------------------------------------------------------------
 CREATE TABLE cdb_entries (
   id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+  type ENUM('App','DLL','Drv', 'Oth') NOT NULL DEFAULT 'Oth',
   name VARCHAR( 100 ) NOT NULL,
   category_id BIGINT NOT NULL,
   description TEXT NOT NULL,
@@ -237,6 +244,7 @@
 INSERT INTO cdb_entries
 SELECT DISTINCT
   NULL,
+  'App',
   grpentr_name,
   g.grpentr_category,
   (SELECT i.old_description FROM cdb_entries_reports i WHERE i.old_groupid=o.old_groupid ORDER BY i.created ASC LIMIT 1) AS old_description,
@@ -268,6 +276,7 @@
   id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
   entry_id BIGINT UNSIGNED NOT NULL COMMENT '->entry',
   version VARCHAR( 20 ) NOT NULL,
+  created DATETIME NOT NULL,
   UNIQUE KEY(entry_id, version)
 ) ENGINE = MYISAM;
 
@@ -275,7 +284,8 @@
 SELECT
   NULL,
   id,
-  old_version
+  old_version,
+  created
 FROM cdb_entries;
 
 UPDATE cdb_entries_reports r
@@ -381,6 +391,7 @@
 INSERT INTO cdb_entries2
 SELECT DISTINCT
   (SELECT id FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1),
+  g.type,
   name,
   (SELECT category_id FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1),
   (SELECT description FROM cdb_entries WHERE name = g.name ORDER BY created DESC LIMIT 1),
@@ -398,6 +409,7 @@
 
 DROP TABLE cdb_entries;
 RENAME TABLE cdb_entries2 TO cdb_entries;
+ALTER TABLE cdb_entries ADD UNIQUE(type, name);
 
 
 

Modified: branches/compat/css/style.css
URL: http://svn.reactos.org/svn/reactos/branches/compat/css/style.css?rev=405&r1=404&r2=405&view=diff
==============================================================================
--- branches/compat/css/style.css [iso-8859-1] (original)
+++ branches/compat/css/style.css [iso-8859-1] Tue May  5 02:33:07 2009
@@ -12,6 +12,69 @@
 
 .rtable THEAD {
   background-color:#5984C3;color:white;}
+
+#submit {
+  background-color: #EEE;
+}
+#submit H1 {
+  border-bottom: 2px solid #369;
+  line-height: 2em;
+  padding-left: 8px;
+
+}
+#submit H1.left {
+  border-right: 1px solid white;
+  border-bottom: 2px solid #D75700;
+  background-color: #FF7800;
+  float: left;
+  padding-right: 8px;
+  clear: left;
+}
+#submit BUTTON {
+  border: none;
+  border-bottom: 2px solid #D75700;
+  background-color: #FF7800;
+  color: white;
+  font-weight: bold;
+  margin: 1em;
+}
+#submit LABEL,
+#submit .label {
+  font-weight: bold;
+  color: #369;
+  line-height: 1.5em;
+}
+#submit LABEL.normal {
+  font-weight: normal;
+  color: black;
+}
+#submit INPUT,
+#submit SELECT,
+#submit TEXTAREA {
+  border: 1px solid #D75700;
+  margin-right: 10px;
+}
+#submit INPUT.normal {
+  margin-right: 0px;
+}
+#submit UL {
+  list-style-type: none;
+  margin-top: 0px;
+}
+#submit .suggestion {
+  position: absolute;
+  background-color: white;
+}
+#submit .suggestion UL {
+  padding-left:3px;
+  border: 1px solid #D75700;
+}
+#submit .suggestion LI A:hover {
+  cursor: pointer;
+}
+
+
+
 
 body {
 	font-family: Verdana;

Modified: branches/compat/js/submit.js
URL: http://svn.reactos.org/svn/reactos/branches/compat/js/submit.js?rev=405&r1=404&r2=405&view=diff
==============================================================================
--- branches/compat/js/submit.js [iso-8859-1] (original)
+++ branches/compat/js/submit.js [iso-8859-1] Tue May  5 02:33:07 2009
@@ -113,7 +113,6 @@
   if (type == 'name') {
     id = 'title';
     hideSuggestions('suggestedNames');
-    disableDetails();
     
     var entries = xmldoc.getElementsByTagName('entry');
     var versions = entries[index].getElementsByTagName('version');
@@ -143,34 +142,3 @@
   document.getElementById(id).value=from.innerHTML;
 }
 
-
-
-function toggleDetails( )
-{
-  if (!document.getElementById('iCheck').checked) {
-    enableDetails()
-  }
-  else {
-    disableDetails()
-  }
-}
-
-
-
-function disableDetails( )
-{
-  document.getElementById('iCheck').checked = true;
-  document.getElementById('cat').disabled = true;
-  document.getElementById('description').disabled = true;
-  document.getElementById('tags').disabled = true;
-}
-
-
-
-function enableDetails( )
-{
-  document.getElementById('iCheck').checked = false;
-  document.getElementById('cat').disabled = false;
-  document.getElementById('description').disabled = false;
-  document.getElementById('tags').disabled = false;
-}

Modified: branches/compat/lib/om/Category.class.php
URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Category.class.php?rev=405&r1=404&r2=405&view=diff
==============================================================================
--- branches/compat/lib/om/Category.class.php [iso-8859-1] (original)
+++ branches/compat/lib/om/Category.class.php [iso-8859-1] Tue May  5 02:33:07 2009
@@ -59,7 +59,7 @@
    */
   private static function getChilds($category_id)
   {
-    $stmt=CDBConnection::getInstance()->prepare("SELECT id, name FROM ".CDBT_CATEGORIES." WHERE parent = :cat_path AND visible IS TRUE ORDER BY name ASC");
+    $stmt=CDBConnection::getInstance()->prepare("SELECT id, name FROM ".CDBT_CATEGORIES." WHERE parent = :cat_path AND visible IS TRUE ORDER BY type ASC, name ASC");
     $stmt->bindParam('cat_path',$category_id,PDO::PARAM_INT);
     $stmt->execute();
     return $stmt->fetchAll(PDO::FETCH_ASSOC);

Modified: branches/compat/lib/om/Entry.class.php
URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/om/Entry.class.php?rev=405&r1=404&r2=405&view=diff
==============================================================================
--- branches/compat/lib/om/Entry.class.php [iso-8859-1] (original)
+++ branches/compat/lib/om/Entry.class.php [iso-8859-1] Tue May  5 02:33:07 2009
@@ -33,37 +33,44 @@
    *
    * @access public
    */
-  public static function add( $title, $version, $category, $description, $tags, $update = false )
-  {
-    // search for existing entry
-    $entry_id = self::getId($title, $version);
+  public static function add( $type, $name, $version, $category, $description )
+  {
+    // search for existing entry
+    $entry = self::get($type, $name);
 
     // insert new entry
-    if ($entry_id === false) {
+    if ($entry === false) {
 
       // check category type
       if (!ctype_digit((string)$category) || $category == 0) {
-        echo 'Error: Unknown Categorie';
+        echo 'Error: Invalid category';
+        return false;
+      }
+      
+      // check type
+      if ($type != 'app' && $type != 'dll' && $type != 'drv' && $type != 'oth') {
+        echo 'Error: Invalid type';
         return false;
       }
 
       // insert
-      $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_ENTRIES." (name, version, category_id, description, created, modified, visible) VALUES (:name, :version, :category, :description, NOW(), NOW(), TRUE)");
-      $stmt->bindParam('name',$title,PDO::PARAM_STR);
-      $stmt->bindParam('version',$version,PDO::PARAM_STR);
+      $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_ENTRIES." (type, name, category_id, description, created, modified, visible) VALUES (:type, :name, :category, :description, NOW(), NOW(), TRUE)");
+      $stmt->bindParam('type',$type,PDO::PARAM_STR);
+      $stmt->bindParam('name',$name,PDO::PARAM_STR);
       $stmt->bindParam('category',$category,PDO::PARAM_INT);
       $stmt->bindParam('description',$description,PDO::PARAM_STR);
       if(!$stmt->execute()) {
         return false;
       }
 
-      $entry_id = self::getId($title, $version);
+      $entry = self::get($type, $name);
     }
 
     // update entry
-    elseif ($update) {
-      $stmt=CDBConnection::getInstance()->prepare("UPDATE ".CDBT_ENTRIES." SET category=:category, description=:description, modified=NOW() WHERE id=:entry_id");
-      $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_STR);
+    elseif ($category != $entry['category_id'] || $description != $entry['description']) {
+    
+      $stmt=CDBConnection::getInstance()->prepare("UPDATE ".CDBT_ENTRIES." SET category_id=:category, description=:description, modified=NOW() WHERE id=:entry_id");
+      $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT);
       $stmt->bindParam('category',$category,PDO::PARAM_INT);
       $stmt->bindParam('description',$description,PDO::PARAM_STR);
       if(!$stmt->execute()) {
@@ -71,31 +78,45 @@
       }
     }
 
-    return $entry_id;
-  } // end of member function add
-
-
-
-  /**
-   * @FILLME
-   *
-   * @access public
-   */
-  public static function addReport( $entry_id, $revision, $status = false )
+    // insert version
+    $ver = self::getVersionId($entry['id'], $version);
+    if ($ver === false) {
+      $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_VERSIONS." (entry_id, version, created) VALUES (:entry_id, :version, NOW())");
+      $stmt->bindParam('entry_id',$entry['id'],PDO::PARAM_INT);
+      $stmt->bindParam('version',$version,PDO::PARAM_STR);
+      if(!$stmt->execute()) {
+        return false;
+      }
+    }
+
+    return array('entry'=>$entry['id'],'version'=>self::getVersionId($entry['id'],$version));
+  } // end of member function add
+
+
+
+  /**
+   * @FILLME
+   *
+   * @access public
+   */
+  public static function addReport( $entry_id, $version_id, $revision, $env, $env_version, $status = 'not' )
   {
     global $RSDB_intern_user_id;
 
     // check if entry exists
-    if ($entry_id === false) {
+    if ($entry_id === false || $version_id === false) {
       echo 'Error: Unknown entry';
       return false;
     }
 
     // insert
-    $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_REPORTS." (entry_id, user_id, revision, works, created, visible, disabled) VALUES (:entry_id, :user_id, :revision, :status, NOW(), TRUE, FALSE)");
+    $stmt=CDBConnection::getInstance()->prepare("INSERT INTO ".CDBT_REPORTS." (entry_id, version_id, user_id, revision, environment, environment_version, works, created, visible, disabled) VALUES (:entry_id, :version_id, :user_id, :revision, :env, :env_ver, :status, NOW(), TRUE, FALSE)");
     $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_INT);
+    $stmt->bindParam('version_id',$version_id,PDO::PARAM_INT);
     $stmt->bindParam('user_id',$RSDB_intern_user_id,PDO::PARAM_INT);
     $stmt->bindParam('revision',$revision,PDO::PARAM_INT);
+    $stmt->bindParam('env',$env,PDO::PARAM_STR);
+    $stmt->bindParam('env_ver',$env_version,PDO::PARAM_STR);
     $stmt->bindParam('status',$status,PDO::PARAM_STR);
     return $stmt->execute();
   } // end of member function addReport
@@ -133,11 +154,46 @@
    *
    * @access public
    */
-  public static function getId( $title, $version )
-  {
-    // search for existing entry
-    $stmt=CDBConnection::getInstance()->prepare("SELECT id FROM ".CDBT_ENTRIES." WHERE name LIKE :name AND version LIKE :version LIMIT 1");
-    $stmt->bindParam('name',$title,PDO::PARAM_STR);
+  public static function get( $type, $name )
+  {
+    // search for existing entry
+    $stmt=CDBConnection::getInstance()->prepare("SELECT id, type, name, description, category_id FROM ".CDBT_ENTRIES." WHERE name LIKE :name AND type = :type LIMIT 1");
+    $stmt->bindParam('name',$name,PDO::PARAM_STR);
+    $stmt->bindParam('type',$type,PDO::PARAM_STR);
+    $stmt->execute();
+    return $stmt->fetchOnce(PDO::FETCH_ASSOC);
+  } // end of member function add
+
+
+
+  /**
+   * @FILLME
+   *
+   * @access public
+   */
+  public static function getEntryId( $type, $name )
+  {
+    // search for existing entry
+    $entry = self::get($type, $name);
+    if ($entry !== false) {
+      return $entry['id'];
+    }
+    return false;
+  } // end of member function add
+
+
+
+  /**
+   * @FILLME
+   *
+   * @access public
+   */
+  public static function getVersionId( $entry_id, $version)
+  {
+    // search for existing entry
+    // search for existing entry
+    $stmt=CDBConnection::getInstance()->prepare("SELECT id FROM ".CDBT_VERSIONS." WHERE entry_id = :entry_id AND version = :version ORDER BY created DESC LIMIT 1");
+    $stmt->bindParam('entry_id',$entry_id,PDO::PARAM_INT);
     $stmt->bindParam('version',$version,PDO::PARAM_STR);
     $stmt->execute();
     return $stmt->fetchColumn();

Modified: branches/compat/lib/view/HTML_Submit.class.php
URL: http://svn.reactos.org/svn/reactos/branches/compat/lib/view/HTML_Submit.class.php?rev=405&r1=404&r2=405&view=diff
==============================================================================
--- branches/compat/lib/view/HTML_Submit.class.php [iso-8859-1] (original)
+++ branches/compat/lib/view/HTML_Submit.class.php [iso-8859-1] Tue May  5 02:33:07 2009
@@ -32,13 +32,25 @@
 
   protected function build( )
   {
-    $this->header();
-    $this->navigation();
-    if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'yes') {
-      $this->submit();
-    }
-    $this->body();
-    $this->footer();
+    if (isset($_POST['next']) && $_POST['next'] == 'entry') {
+      $entry_id = Entry::getEntryId($_POST['type'], $_POST['title']);
+      $version_id = Entry::getVersionId($entry_id, $_POST['version']);
+      header('location: ?page=item&ver='.$version_id);
+      exit;
+    }
+    elseif (isset($_POST['next']) && $_POST['next'] == 'bug') {
+      echo 'Imagine a bugzilla here';
+      exit;
+    }
+    else {
+      $this->header();
+      $this->navigation();
+      if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'yes') {
+        $this->submit();
+      }
+      $this->body();
+      $this->footer();
+    }
   }
 
 
@@ -54,18 +66,36 @@
 
     // try to insert a new entry
     if (isset($_POST['title']) && $_POST['title'] != '' && isset($_POST['tags']) && isset($_POST['cat']) && isset($_POST['description']) && isset($_POST['version']) && $_POST['version'] != '') {
-      $entry_id = Entry::add($_POST['title'], $_POST['version'], $_POST['cat'], $_POST['description'], $_POST['tags'], (isset($_POST['iCheck']) && $_POST['iCheck'] == 'yes'));
-    }
-
-    // search entry
-    else {
-      $entry_id = Entry::getId($_POST['title'], $_POST['version']);
+      $ids = Entry::add($_POST['type'], $_POST['title'], $_POST['version'], $_POST['cat'], $_POST['description'], $_POST['tags']);
+
+      // got no error
+      if ($ids !== false) {
+        $entry_id = $ids['entry'];
+        $version_id = $ids['version'];
+      }
     }
     
+    if (!isset($entry_id)) {
+      $entry_id = Entry::getEntryId($_POST['type'], $_POST['title']);
+      if ($entry_id !== false) {
+        $version_id = Entry::getVersionId($entry_id, $_POST['version']);
+      }
+    }
+
     // insert new report/comment
-    if ($entry_id !== false) {
-      if (isset($_POST['status']) && ($_POST['status'] == 'works' || $_POST['status'] == 'part' ||$_POST['status'] == 'not'))
-      Entry::addReport($entry_id, $revision, $_POST['status']);
+    if ($entry_id !== false && $version_id !== false) {
+      if (isset($_POST['status']) && ($_POST['status'] == 'full' || $_POST['status'] == 'part' ||$_POST['status'] == 'not')) {
+        if ($_POST['env'] == 'RH') {
+          $env = 'RH';
+          $env_ver = '';
+        }
+        else {
+          $env = $_POST['vm'];
+          $env_ver = $_POST['vmver'];
+        }
+
+        Entry::addReport($entry_id, $version_id, $revision, $env, $env_ver, $_POST['status']);
+      }
 
       // insert new comment
       if (isset($_POST['comment']) && $_POST['comment'] != '') {
@@ -81,71 +111,73 @@
     $used_again = (isset($_POST['next']) && $_POST['next']=='again');
   
     echo '
-      <form action="?page=submit&amp;submit=yes" method="post">
-        <fieldset>
-          <legend>App Details</legend>
-          <ul style="list-style-type: none;">
-            <li style="float: left;">
-              <label for="title">Application Name:</label><br />
-              <input type="text" name="title" id="title" onkeyup="suggestName(this.value);" />
-              <div id="suggestedNames" style="display:none;border: 1px solid red;"></div>
-            </li>
-
-            <li style="float: right;">
+      <form id="submit" action="?page=submit&amp;submit=yes" method="post" style="width: 700px;">
+        <div>
+          <h1 class="left">Step 1</h1><h1>&nbsp;Tested software</h1>
+          <ul>
+            <li style="float: left;">
+              <label for="type">Type:</label><br />
+              <select name="type" id="type">
+                <option value="app" selected="selected">Application</option>
+                <option value="dll">DLL-Library</option>
+                <option value="drv">Driver</option>
+                <option value="oth">Other</option>
+              </select>
+            </li>
+
+            <li style="float: left;">
+              <label for="title">Name:</label><br />
+              <input type="text" name="title" id="title" onkeyup="'."suggestName(this.value);".'" />
+              <div class="suggestion" id="suggestedNames" style="display:none;"></div>
+            </li>
+
+            <li style="float: left;">
               <label for="version">Version:</label><br />
-              <input type="text" name="version" id="version" />
-              <div id="suggestedVersions" style="display:none;border: 1px solid red;"></div>
+              <input type="text" name="version" id="version" style="width: 50%;" />
+              <div class="suggestion" id="suggestedVersions" style="display:none;"></div>
+            </li>
+
+            <li style="clear: both;float: left;">
+              <label for="cat">Category:</label><br />
+              <select name="cat" id="cat" style="width: 200px;">
+                <option value="0">&nbsp</option>
+                '.Category::showTreeAsOption().'
+              </select>
+            </li>
+            <li style="float:left;">
+              <label for="description">Short Description:</label><br />
+              <input type="text" name="description" id="description" />
             </li>
 
             <li style="clear: both;">
-              <fieldset>
-                <legend>
-                  <input type="checkbox" name="iCheck" id="iCheck" value="yes" onclick="toggleDetails();" />
-                  <label for="iCheck">I don\'t want to modify the additional information</label>
-                </legend>
-                <ul style="list-style-type: none;">
-                  <li>
-                    <label for="cat">Category:</label><br />
-                    <select name="cat" id="cat">
-                      <option value="0">&nbsp</option>
-                      '.Category::showTreeAsOption().'
-                    </select>
-                  </li>
-                  <li>
-                    <label for="description">Short Description:</label><br />
-                    <input type="text" name="description" id="description" />
-                  </li>
-
-                  <li>
-                    <label for="tags">Tags: (e.g. vendor)</label><br />
-                    <input type="text" name="tags" id="tags" /> (seperate them by <em>,</em>)
-                  </li>
-                </ul>
+              <label for="tags">Tags: (e.g. vendor)</label><br />
+              <input type="text" name="tags" id="tags" /> (seperate them by <em>,</em>)
             </li>
 
           </ul>
-        </fieldset>
-  
-        <fieldset>
-          <legend>Test</legend>
-          <ul style="list-style-type: none;">
+          <br style="clear: both;"/>
+        </div>
+  
+        <div>
+          <h1 class="left">Step 2</h1><h1>&nbsp;Test summary</h1>
+          <ul style="float:left;margin-right: 20px;">
             <li>
-              Status:<br />
-              <input type="radio" name="status" id="noworks" value="not" />
-              <label for="noworks" style="color: red;">Doesn\'t Work</label>
+              <span class="label">Outcome:</span><br />
+              <input type="radio" class="normal" name="status" id="works" value="full" onchange="'."javascript:document.getElementById('bugreport').style.display=(this.checked ? 'none' : 'block' );".'" />
+              <label for="works" style="color: #00CC00;">Running Stable</label>
               
-              <input type="radio" name="status" id="partworks" value="part" />
-              <label for="partworks" style="color: orange;">Works partly</label>
+              <input type="radio" class="normal" name="status" id="partworks" value="part" onchange="'."javascript:document.getElementById('bugreport').style.display=(this.checked ? 'none' : 'block' );".'" />
+              <label for="partworks" style="color: #FF7800;">Minor Problems</label>
               
-              <input type="radio" name="status" id="works" value="works" />
-              <label for="works" style="color: green;">Works</label>
-              <br />
-              <br />
-            </li>
-            <li>
+              <input type="radio" class="normal" name="status" id="noworks" value="not" onchange="'."javascript:document.getElementById('bugreport').style.display=(this.checked ? 'block' : 'none' );".'" />
+              <label for="noworks" style="color: #FF3300;">Crash</label>
+              <br />
+              <br />
+            </li>
+            <li style="float: left;">
               <label for="ver">Tested Version</label><br />
               <select name="ver" id="ver" onchange="'."javascript:document.getElementById('directRev').style.display=(this.value=='R' ? 'block' : 'none' );".'">
-                <option value="R"'.(($used_again && $_POST['ver'] == 'R') ? ' selected="selected"' : '').'>Use Revision</option>';
+                <option value="R"'.(($used_again && $_POST['ver'] == 'R') ? ' selected="selected"' : '').'>Trunk</option>';
 
     $stmt=CDBConnection::getInstance()->prepare("SELECT revision, name FROM ".CDBT_VERTAGS." WHERE VISIBLE IS TRUE ORDER BY revision DESC");
     $stmt->execute();
@@ -159,47 +191,92 @@
               </select>
             </li>
 
-            <li id="directRev">
-              <label for="rev">Tested Revision (only trunk revisions are allowed, please don\'t enter revisions of tags or branches)</label><br />
+            <li id="directRev" style="float:left;">
+              <label for="rev">Revision:</label><br />
               <input type="text" name="rev" id="rev"'.(($used_again && $_POST['ver'] == 'R') ? ' value="'.htmlspecialchars($_POST['revision']).'"' : '').' />
             </li>
-          </ul>';
-    
+          </ul>
+          <div style="float: left;margin-right: 10px;">
+            <span class="label">Environment:</span><br />
+            <input type="radio" class="normal" name="env" id="envvm" value="VM" checked="checked" onchange="'."javascript:document.getElementById('vmlist').style.display=(this.checked ? 'block' : 'none' );".'" />
+            <label class="normal" for="envvm">Virtual Machine</label><br />
+
+            <input type="radio" class="normal" name="env" id="envrh" value="RH" onchange="'."javascript:document.getElementById('vmlist').style.display=(this.checked ? 'none' : 'block' );".'" />
+            <label class="normal" for="envrh">Real Hardware</label>
+          </div>
+          <div id="vmlist" style="list-style-type: none;float: left;">
+            <label for="vm">Virtual Machine:</label><br />
+            <select id="vm" name="vm">
+              <option>&nbsp;</option>
+              <option value="Bo">Bochs</option>
+              <option value="qe">Qemu</option>
+              <option value="vb">VirtualBox</option>
+              <option value="vp">VirtualPC</option>
+              <option value="vw">VMWare</option>
+              <option value="ot">Other</option>
+            </select>
+            <br />
+            <label for="vmver">VM Version:</label><br />
+            <input type="text" name="vmver" id="vmver" />
+          </div>
+          <br style="clear: both;"/>
+        </div>
+  
+        <div>
+          <h1 class="left">Step 3</h1><h1>&nbsp;Test details</h1>
+          <ul>
+            <li>
+              <label for="comment">Comment</label><br />
+              <textarea rows="5" cols="70" name="comment" id="comment"></textarea>
+            </li>
+            <li>
+              <span class="label">next action:</span><br />
+              <input type="radio" class="normal" name="next" id="again" value="again" '.($used_again ? 'checked="checked"' : '').' />
+              <label for="again" class="normal">Insert another entry/report</label>
+              <br />
+              <input type="radio" class="normal" name="next" id="more" value="more"  />
+              <label for="more" class="normal">Add more information to that entry.</label>
+              <br />
+              <div id="bugreport">
+                <input type="radio" class="normal" name="next" id="bug" value="bug"  />
+                <label for="bug" class="normal">Fill a bug report</label>
+                <br />
+              </div>
+              <input type="radio" class="normal" name="next" id="entry" value="entry" '.(!$used_again ? 'checked="checked"' : '').' />
+              <label for="entry" class="normal">Jump to inserted entry/report</label>
+            </li>
+          </ul>
+        </div>
+        <div>
+          <button type="submit">Submit report</button>
+        </div>
+        <hr style="color: #777;" />
+      </form>
+      <script type="text/javascript">
+      //<!--'."
+        document.getElementById('bugreport').style.display='none';
+      //".'-->
+      </script>';
+
+    // hide revision field
     if (!$used_again || $_POST['ver'] != 'R') {
       echo '
           <script type="text/javascript">
-          //<!--
-            document.getElementById("directRev").style.display="none";
-          //-->
+          //<!--'."
+            document.getElementById('directRev').style.display='none';
+          //".'-->
           </script>';
     }
-    echo '
-        </fieldset>
-  
-        <fieldset>
-          <legend>Additional</legend>
-          <ul style="list-style-type: none;">
-            <li>
-              <label for="comment">Comment</label><br />
-              <textarea rows="6" cols="80" name="comment" id="comment"></textarea>
-            </li>
-            <li>
-              next action:<br />
-              <input type="radio" name="next" id="again" value="again" '.($used_again ? 'checked="checked"' : '').' />
-              <label for="again">Insert another entry/report</label>
-              <br />
-              <input type="radio" name="next" id="more" value="more"  />
-              <label for="more">Add more information to that entry.</label>
-              <br />
-              <input type="radio" name="next" id="entry" value="entry" '.(!$used_again ? 'checked="checked"' : '').' />
-              <label for="entry">Jump to inserted entry/report</label>
-            </li>
-          </ul>
-        </fieldset>
-        <div>
-          <button type="submit">Submit new Compatibility Report</button>
-        </div>
-      </form>';
+
+    // hide VM
+    if ($used_again && $_POST['env'] == 'RH') {
+      echo '
+          <script type="text/javascript">
+          //<!--'."
+            document.getElementById('vmlist').style.display='none';
+          //".'-->
+          </script>';
+    }
   } // end of member function body
 
 



More information about the Ros-diffs mailing list