]>
src.bluestatic.org Git - bugdar.git/blob - newreport.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # [#]app[#] [#]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 \*=====================================================================*/
13 require_once('./global.php');
15 if (!($bugsys->userinfo
['permissions'] & CANSUBMITBUGS
))
21 // ###################################################################
23 if (empty($_REQUEST['do']))
25 $_REQUEST['do'] = 'add';
28 // ###################################################################
30 if ($_POST['do'] == 'insert')
45 // check permissions on various input values
46 if (!$bugsys->userinfo
['permissions'] & CANCHANGESTATUS
)
48 unset($vars['priority'], $vars['status'], $vars['resolution']);
50 if (!$bugsys->userinfo
['permissions'] & CANASSIGN
)
52 unset($vars['assignedto']);
56 // assigned person is not a dev or a valid user
57 if (!$bugsys->datastore
['assignto']["$vars[assignedto]"]['userid'])
59 unset($vars['assignedto']);
63 if (!$vars['product'] OR !$vars['component'] OR !$vars['version'])
65 echo 'there was a problem selecting the product, component, or version';
68 if (!$vars['summary'])
70 echo 'please enter a bug title';
73 if (!$vars['comment'])
75 echo 'please enter a bug description';
80 // ###################################################################
82 if ($_REQUEST['do'] == 'add')
90 // the user can hit the back button without reposting data...
91 if (!$vars['product'] OR !$vars['component'] OR !$vars['version'])
100 echo '<form name="newbug" action="newreport.php" method="' . $method . '">';
104 if (!$vars['product'])
106 echo '<strong>Product:</strong> <select name="product">';
107 $products = $DB_sql->query("SELECT * FROM " . TABLE_PREFIX
. "product WHERE !componentmother ORDER BY displayorder ASC");
108 while ($product = $DB_sql->fetch_array($products))
110 echo "<option value=\"$product[productid]\">$product[title]</option>";
114 else if (!$vars['component'])
116 echo '<strong>Component:</strong> <select name="component"><option value="-1">No Component</option>';
117 $components = $DB_sql->query("SELECT * FROM " . TABLE_PREFIX
. "product WHERE componentmother IN ($vars[product]) ORDER BY displayorder ASC");
118 while ($component = $DB_sql->fetch_array($components))
120 echo "<option value=\"$component[productid]\">$component[title]</option>";
123 echo '<input type="hidden" name="product" value="' . $vars['product'] . '" />';
125 else if (!$vars['version'])
127 echo '<strong>Version:</strong> <select name="version">';
128 $versions = $DB_sql->query("
129 SELECT version.*, product.componentmother, product.title AS productname
130 FROM " . TABLE_PREFIX
. "version AS version
131 LEFT JOIN " . TABLE_PREFIX
. "product ON (product.productid = version.productid)
132 WHERE version.productid IN (0, $vars[product]" . iff($vars['component'] != -1, ", $vars[component]", '') . ")
133 ORDER BY version.productid, version.displayorder ASC"
136 while ($version = $DB_sql->fetch_array($versions))
138 $versionlist["$version[productid]"][] = $version;
139 $lookup["$version[productid]"] = array('componentmother' => $version['componentmother'], 'productname' => $version['productname']);
142 foreach ($versionlist AS $productid => $versions)
148 echo '<optgroup label="Global Versions">';
151 else if ($lookup["$productid"]['componentmother'])
153 echo '<optgroup label="' . $lookup["$productid"]['productname
'] . '">';
157 echo '<optgroup label="' . $lookup["$productid"]['productname
'] . '">';
160 foreach ($versions AS $version)
162 echo '<option value="' . $version['versionid
'] . '">' . $prepend . $version['version'] . '</option>';
169 echo '<input type="hidden
" name="product
" value="' . $vars['product
'] . '" />';
170 echo '<input type="hidden
" name="component
" value="' . $vars['component
'] . '" />';
175 echo '<div><strong>Summary/Title:</strong> <input type="text
" name="summary
" size="25" /></div>';
177 echo '<div><strong>Severity:</strong> <select name="severity
">';
178 foreach ($bugsys->datastore['severity'] AS $severity)
180 echo '<option value="' . $severity['severityid
'] . '">' . $severity['severity'] . '</option>';
182 echo '</select></div>';
184 if ($bugsys->userinfo['permissions'] & CANCHANGESTATUS)
186 echo '<div><strong>Priority:</strong> <select name="priority
">';
187 foreach ($bugsys->datastore['priority'] AS $priority)
189 echo '<option value="' . $priority['priorityid
'] . '">' . $priority['priority'] . '</option>';
191 echo '</select></div>';
193 echo '<div><strong>Status:</strong> <select name="status
">';
194 foreach ($bugsys->datastore['status'] AS $status)
196 echo '<option value="' . $status['statusid
'] . '">' . $status['status'] . '</option>';
198 echo '</select></div>';
200 echo '<div><strong>Resolution:</strong> <select name="resolution
">';
201 foreach ($bugsys->datastore['resolution'] AS $resolution)
203 echo '<option value="' . $resolution['resolutionid
'] . '">' . $resolution['resolution'] . '</option>';
205 echo '</select></div>';
208 if ($bugsys->userinfo['permissions'] & CANASSIGN)
210 echo '<div><strong>Assigned to:</strong> <select name="assignedto
"><option value="0">No Assignment</option>';
211 foreach ($bugsys->datastore['assignto'] AS $dev)
213 fetch_user_display_name($dev);
214 echo '<option value="' . $dev['userid
'] . '">' . $dev['displayname'] . iff($dev['showemail'], ' <' . $dev['email'] . '>', '') . '</option>';
216 echo '</select></div>';
219 echo '<div><strong>Detailed description:</strong><div><textarea name="comment
" rows="15" cols="75"></textarea></div></div>';
222 echo '<div><input type="hidden
" name="do" value="' . $do . '" /><input type="submit
" name="submit
" value=" Proceed
" /></div>';
227 /*=====================================================================*\
228 || ###################################################################
231 || ###################################################################
232 \*=====================================================================*/