r740: Product explainer is in place
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Jan 2006 21:11:43 +0000 (21:11 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Jan 2006 21:11:43 +0000 (21:11 +0000)
explain.php [new file with mode: 0644]
templates/explain_product.tpl [new file with mode: 0644]
templates/explain_row.tpl [new file with mode: 0644]

diff --git a/explain.php b/explain.php
new file mode 100644 (file)
index 0000000..8ef882a
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # Bugdar [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+$fetchtemplates = array(
+       'explain_product'
+);
+
+define('SVN', '$Id$');
+
+$focus['showreport'] = 'focus';
+
+require_once('./global.php');
+
+// ###################################################################
+
+if (empty($_REQUEST['do']))
+{
+       $_REQUEST['do'] = 'products';
+}
+
+// ###################################################################
+
+if ($_REQUEST['do'] == 'products')
+{
+       foreach ($bugsys->datastore['product'] AS $product)
+       {
+               if ($product['componentmother'])
+               {
+                       $components["$product[componentmother]"]["$product[productid]"] = $product;
+               }
+               else
+               {
+                       $products["$product[productid]"] = $product;
+               }
+       }
+       
+       foreach ($bugsys->datastore['version'] AS $version)
+       {
+               $versions["$version[productid]"]["$version[versionid]"] = $version;
+       }
+       
+       // global versions
+       foreach ($versions['0'] AS $version)
+       {
+               $left = $version['version'];
+               $right = null;
+               eval('$globalversions .= "' . $template->fetch('explain_row') . '";');
+       }
+       
+       foreach ($products AS $product)
+       {
+               $left = $product['title'];
+               $right = $product['description'];
+               $trextra = ' style="background-color: ' . $stylevar['alt_colour'] . '"';
+               eval('$productlist .= "' . $template->fetch('explain_row') . '";');
+               
+               foreach ($components["$product[productid]"] AS $component)
+               {
+                       $left = '&nbsp; &rsaquo; &nbsp; ' . $component['title'];
+                       $right = $component['description'];
+                       $trextra = '';
+                       eval('$productlist .= "' . $template->fetch('explain_row') . '";');
+               }
+       }
+       
+       eval('$template->flush("' . $template->fetch('explain_product') . '");');
+}
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/templates/explain_product.tpl b/templates/explain_product.tpl
new file mode 100644 (file)
index 0000000..4d6fddc
--- /dev/null
@@ -0,0 +1,35 @@
+$doctype
+<html lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
+<head>
+$headinclude
+       <title>{$bugsys->options['trackertitle']} - {@"Products"}</title>
+</head>
+
+<body>
+
+$header
+
+<h2>{@"Explication of Products"}</h2>
+
+<if condition="$globalversions">
+       <table border="$stylevar[border]" cellspacing="$stylevar[spacing]" cellpadding="$stylevar[padding]px" width="$stylevar[normal_width]">
+       <tr class="listinghead">
+               <td colspan="2">{@"Global Versions"}</td>
+       </tr>
+       <tr style="background-color: $stylevar[alt_colour]">
+               <td colspan="2">{@"These versions are avaliable for every product, component, and version."}</td>
+       </tr>
+       $globalversions
+       </table>
+</if>
+
+<br />
+
+<table border="$stylevar[border]" cellspacing="$stylevar[spacing]" cellpadding="$stylevar[padding]px" width="$stylevar[normal_width]">
+<tr class="listinghead">
+       <td colspan="2">{@"Products"} (components are in white)</td>
+</tr>
+$productlist
+</table>
+
+$footer
\ No newline at end of file
diff --git a/templates/explain_row.tpl b/templates/explain_row.tpl
new file mode 100644 (file)
index 0000000..4eb5af7
--- /dev/null
@@ -0,0 +1,4 @@
+<tr$trextra>
+       <td width="50%">$left</td>
+       <td>$right</td>
+</tr>