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 if (!is_array($bugsys->datastore['product
']))
47 $message->error(_('There are no products set up
.'));
50 foreach ($bugsys->datastore['product
'] AS $product)
52 if ($product['parentid
'])
54 $components["$product[componentmother]"]["$product[productid]"] = $product;
58 $products["$product[productid]"] = $product;
62 foreach ($bugsys->datastore['version
'] AS $version)
64 $versions["$version[productid]"]["$version[versionid]"] = $version;
68 if (is_array($versions['0']))
70 foreach ($versions['0'] AS $version)
72 $left = $version['version
'];
74 eval('$globalversions .= "' . $template->fetch('explain_row') . '";');
78 foreach ($products AS $product)
80 $left = $product['title
'];
81 $right = $product['description
'];
82 $trextra = ' style
="background-color: ' . $stylevar['alt_color'] . '"';
83 eval('$productlist .= "' . $template->fetch('explain_row') . '";');
85 if (is_array($components["$product[productid]"]))
87 foreach ($components["$product[productid]"] AS $component)
89 $left = ' 
; &rsaquo
;  
; ' . $component['title
'];
90 $right = $component['description
'];
92 eval('$productlist .= "' . $template->fetch('explain_row') . '";');
97 eval('$template->flush("' . $template->fetch('explain_product') . '");');
100 // ###################################################################
102 if ($_REQUEST['do'] == 'automations
')
104 $fields_fetch = $bugsys->db->query("
105 SELECT bugfield.*, permission.mask
106 FROM " . TABLE_PREFIX . "bugfield AS bugfield
107 LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
108 ON (bugfield.fieldid = permission.fieldid)
109 WHERE (permission.mask = 2 OR permission.mask = 1)
110 AND permission.usergroupid = {$bugsys->userinfo['usergroupid']}"
112 while ($field = $bugsys->db->fetch_array($fields_fetch))
114 $fields["$field[fieldid]"] = $field;
117 if (is_array($bugsys->datastore['automation
']))
119 foreach ($bugsys->datastore['automation
'] AS $automation)
121 $automation['fieldchanges
'] = unserialize($automation['fieldchanges
']);
123 $left = $automation['name
'];
124 $right = $automation['description
'];
125 $trextra = ' class="listinghead"';
127 eval('$automations .= "' . $template->fetch('explain_row') . '";');
129 if ($automation['comment
'])
131 $left = _('Add Comment
');
132 $right = $automation['comment
'];
133 $trextra = ' style
="background-color: ' . $stylevar['alt_color'] . '"';
135 eval('$automations .= "' . $template->fetch('explain_row') . '";');
140 if (is_array($automation['fieldchanges
']['builtin
']))
142 foreach ($automation['fieldchanges
']['builtin
'] AS $name => $value)
145 $right = $bugsys->datastore["$left"]["$value"]["$left"];
146 eval('$automations .= "' . $template->fetch('explain_row') . '";');
150 if (is_array($automation['fieldchanges
']['custom
']))
152 foreach ($automation['fieldchanges
']['custom
'] AS $id => $value)
159 $left = $fields["$id"]['name
'] . ' ' . sprintf(_('(Custom
#%1$d, type: %2$s)'), $id, $fields["$id"]['type']);
161 eval('$automations .= "' . $template->fetch('explain_row') . '";');
167 eval('$template->flush("' . $template->fetch('explain_automation') . '");');
170 /*=====================================================================*\
171 || ###################################################################
174 || ###################################################################
175 \*=====================================================================*/