2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 $fetchtemplates = array(
28 define('SVN', '$Id$');
30 $focus['showreport'] = 'focus';
32 require_once('./global.php');
34 // ###################################################################
36 if (empty($_REQUEST['do']))
38 $_REQUEST['do'] = 'products';
41 // ###################################################################
43 if ($_REQUEST['do'] == 'products')
45 foreach ($bugsys->datastore
['product'] AS $product)
47 if ($product['componentmother'])
49 $components["$product[componentmother]"]["$product[productid]"] = $product;
53 $products["$product[productid]"] = $product;
57 foreach ($bugsys->datastore
['version'] AS $version)
59 $versions["$version[productid]"]["$version[versionid]"] = $version;
63 if (is_array($versions['0']))
65 foreach ($versions['0'] AS $version)
67 $left = $version['version'];
69 eval('$globalversions .= "' . $template->fetch('explain_row') . '";');
73 foreach ($products AS $product)
75 $left = $product['title'];
76 $right = $product['description'];
77 $trextra = ' style="background-color: ' . $stylevar['alt_color'] . '"';
78 eval('$productlist .= "' . $template->fetch('explain_row') . '";');
80 foreach ($components["$product[productid]"] AS $component)
82 $left = ' › ' . $component['title'];
83 $right = $component['description'];
85 eval('$productlist .= "' . $template->fetch('explain_row') . '";');
89 eval('$template->flush("' . $template->fetch('explain_product') . '");');
92 // ###################################################################
94 if ($_REQUEST['do'] == 'automations')
96 $fields_fetch = $bugsys->db
->query("
97 SELECT bugfield.*, permission.mask
98 FROM " . TABLE_PREFIX
. "bugfield AS bugfield
99 LEFT JOIN " . TABLE_PREFIX
. "bugfieldpermission AS permission
100 ON (bugfield.fieldid = permission.fieldid)
101 WHERE (permission.mask = 2 OR permission.mask = 1)
102 AND permission.usergroupid = {$bugsys->userinfo['usergroupid']}"
104 while ($field = $bugsys->db
->fetch_array($fields_fetch))
106 $fields["$field[fieldid]"] = $field;
109 if (is_array($bugsys->datastore
['automation']))
111 foreach ($bugsys->datastore
['automation'] AS $automation)
113 $automation['fieldchanges'] = unserialize($automation['fieldchanges']);
115 $left = $automation['name'];
116 $right = $automation['description'];
117 $trextra = ' class="listinghead"';
119 eval('$automations .= "' . $template->fetch('explain_row') . '";');
121 if ($automation['comment'])
123 $left = _('Add Comment');
124 $right = $automation['comment'];
125 $trextra = ' style="background-color: ' . $stylevar['alt_color'] . '"';
127 eval('$automations .= "' . $template->fetch('explain_row') . '";');
132 if (is_array($automation['fieldchanges']['builtin']))
134 foreach ($automation['fieldchanges']['builtin'] AS $name => $value)
137 $right = $bugsys->datastore
["$left"]["$value"]["$left"];
138 eval('$automations .= "' . $template->fetch('explain_row') . '";');
142 if (is_array($automation['fieldchanges']['custom']))
144 foreach ($automation['fieldchanges']['custom'] AS $id => $value)
151 $left = $fields["$id"]['name'] . ' ' . sprintf(_('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']);
153 eval('$automations .= "' . $template->fetch('explain_row') . '";');
159 eval('$template->flush("' . $template->fetch('explain_automation') . '");');
162 /*=====================================================================*\
163 || ###################################################################
166 || ###################################################################
167 \*=====================================================================*/