r49: Added search screen, need to do results. Checkin for code storage only.
[bugdar.git] / search.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Renapsus [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 $fetchtemplates = array(
14 'search',
15 'search_results',
16 'search_results_bit'
17 );
18
19 require_once('./global.php');
20
21 if (!can_perform('cansearch'))
22 {
23 echo 'no permission';
24 exit;
25 }
26
27 define('MODE', intval($_POST['mode']));
28 define('MODE_ANY', iff(MODE == 1, 1, 0));
29 define('MODE_ALL', iff(MODE == 2, 1, 0));
30 define('MODE_RAW', iff(MODE == 3, 1, 0));
31
32 // ###################################################################
33
34 if (empty($_REQUEST['do']))
35 {
36 $_REQUEST['do'] = 'search';
37 }
38
39 // ###################################################################
40
41 if ($_REQUEST['do'] == 'results')
42 {
43 //print_r($_POST);
44 }
45
46 // ###################################################################
47
48 if ($_REQUEST['do'] == 'search')
49 {
50 $pcv_select = construct_pcv_select('radio', '--');
51
52 $blankselect = '<option value="0">- Choose -</option>';
53
54 $select['severity'] = $blankselect;
55 foreach ($bugsys->datastore['severity'] AS $severity)
56 {
57 $value = $severity['severityid'];
58 $label = $severity['severity'];
59 eval('$select[severity] .= "' . $tpl->fetch('selectoption') . '";');
60 }
61
62 $select['priority'] = $blankselect;
63 foreach ($bugsys->datastore['priority'] AS $priority)
64 {
65 $value = $priority['priorityid'];
66 $label = $priority['priority'];
67 eval('$select[priority] .= "' . $tpl->fetch('selectoption') . '";');
68 }
69
70 $select['status'] = $blankselect;
71 foreach ($bugsys->datastore['status'] AS $status)
72 {
73 $value = $status['statusid'];
74 $label = $status['status'];
75 eval('$select[status] .= "' . $tpl->fetch('selectoption') . '";');
76 }
77
78 $select['resolution'] = $blankselect;
79 foreach ($bugsys->datastore['resolution'] AS $resolution)
80 {
81 $value = $resolution['resolutionid'];
82 $label = $resolution['resolution'];
83 eval('$select[resolution] .= "' . $tpl->fetch('selectoption') . '";');
84 }
85
86 $select['dev'] = $blankselect;
87 foreach ($bugsys->datastore['assignto'] AS $dev)
88 {
89 $value = $dev['userid'];
90 $label = construct_user_display($dev, false);
91 eval('$select[dev] .= "' . $tpl->fetch('selectoption') . '";');
92 }
93
94 eval('$tpl->flush("' . $tpl->fetch('search') . '");');
95 }
96
97 /*=====================================================================*\
98 || ###################################################################
99 || # $HeadURL$
100 || # $Id$
101 || ###################################################################
102 \*=====================================================================*/
103 ?>