r1328: - Add jQuery to the entire system
[bugdar.git] / productselect.php
1 <?php
2 /*=====================================================================*
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
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.
10 || #
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
14 || # more details.
15 || #
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 \*=====================================================================*/
21
22 define('SVN', '$Id$');
23
24 require_once('./global.php');
25
26 // ###################################################################
27
28 if ($_REQUEST['do'] == 'pcvselect')
29 {
30
31 }
32
33 // ###################################################################
34
35 if ($_REQUEST['do'] == 'pcvajax')
36 {
37 $bugsys->input_clean('product', TYPE_UINT);
38 $bugsys->input_clean('component', TYPE_UINT);
39 $bugsys->input_clean('version', TYPE_UINT);
40
41 $bits = '';
42
43 if ($bugsys->in['piece'] == 'product')
44 {
45 if ($bugsys->in['product'] == 0)
46 {
47 $value = 0;
48 $label = _('-- None --');
49 $selected = (!$bugsys->in['component']);
50 eval('$bits .= "' . $template->fetch('selectoption') . '";');
51 }
52
53 foreach ($bugsys->datastore['product'] AS $value => $prod)
54 {
55 if ($prod['componentmother'] == 0)
56 {
57 $label = $prod['title'];
58 $selected = ($value == $bugsys->in['product']);
59 eval('$bits .= "' . $template->fetch('selectoption') . '";');
60 }
61 }
62 }
63 else if ($bugsys->in['piece'] == 'component' AND $bugsys->in['product'] != 0)
64 {
65 $value = 0;
66 $label = _('-- None --');
67 $selected = (!$bugsys->in['component']);
68 eval('$bits .= "' . $template->fetch('selectoption') . '";');
69
70 foreach ($bugsys->datastore['product'] AS $value => $prod)
71 {
72 if ($prod['componentmother'] == $bugsys->in['product'])
73 {
74 $label = $prod['title'];
75 $selected = ($value == $bugsys->in['component']);
76 eval('$bits .= "' . $template->fetch('selectoption') . '";');
77 }
78 }
79 }
80 else if ($bugsys->in['piece'] == 'version' AND $bugsys->in['product'] != 0)
81 {
82 foreach ($bugsys->datastore['version'] AS $value => $vers)
83 {
84 if ($vers['productid'] == $bugsys->in['product'] OR $vers['productid'] == $bugsys->in['component'] OR intval($vers['productid']) == 0)
85 {
86 $label = $vers['version'];
87 $selected = ($value == $bugsys->in['version']);
88 eval('$bits .= "' . $template->fetch('selectoption') . '";');
89 }
90 }
91 }
92
93 echo $bits;
94 }
95
96 /*=====================================================================*
97 || ###################################################################
98 || # $HeadURL$
99 || # $Id$
100 || ###################################################################
101 \*=====================================================================*/
102 ?>