- priority: 5 --> 2
- assigned_to: nobody --> ctrager
Difference to 2.1.4
We need the possibility to have 2 "Layouts" but the
same database.
One for requests one for bugs.
It was neccessary to avoid bugs in the kind of "High
Priority : Change Color of Button to red" or similar "bugs"
The users aren't allowed to change the type of the entry.
Only Admins can do that.
If you don't need this behavoir just skip the patch to
edit_bug.aspx.
I have tried to make only minor changes to the source
to fit our needs, so we can easily update to future
versions of this great product !
Thanks to Corey Trager for this helpful tool !
I am waiting for Visual Studio Project version
http://sourceforge.net/projects/vsbugtrackernet/.
Currently there are 1144 entries with 41 and 7 projects
in our bug database.
Requirements : For each project you must define :
Enable Custom Dropdown 3
Custom Dropdown Label 3 : Type
Custom Dropdown Values :
Request|Bug
Filter must be set as 3. Custom Field in
Database bugs / table bugs / field
bg_project_custom_dropdown_value3
Add to web.config the key Type
with your custom/forced type
File: bugs.aspx
--- 10 lines added after 73://Matthias Roth DWS
7.11.2005 Start
//Select/Filter forced the additional Type field
//Filter the resultset
//http://myserver/bug will select all bug
//http://myserver/request will select all request
//new web.config setting Type will select additional all
custom types
bug_sql = Util.alter_sql_per_project_type(
bug_sql,"
(dbo.bugs.bg_project_custom_dropdown_value3
= '"+Request.Path.Split('/')[1]+"' or
dbo.bugs.bg_project_custom_dropdown_value3
= '"+Util.get_setting("Type","NOTHING") +"') ");
// Response.Write (bug_sql);
//Matthias Roth 7.11.2005 End
File: edit_bug.aspx
--- 1 line changed at 1304: pcd3 = "";
--- to: pcd3 = Util.get_setting
("Type","Bug");
//pcd3 = "";
--- 1 line changed at 1322: Request
["pcd3"],
--- to: pcd3,
--- 2 lines changed at 2106:
Response.Write ("<select");
--- to:
if (i == 3)
{
if
(security.this_is_admin)
{
Response.Write
("<select");
}
else
{
Response.Write
("<select DISABLED");
}
}
else
{
Response.Write
("<select");
}
--- 2 lines changed at 2113:
string selected_value = "";
--- to: string selected_value =
Util.get_setting("Type","Bug");
//string selected_value = "";
--- 1 line changed at
2117: selected_value =
Request["pcd" + Convert.ToString(i)];
--- to: if (i == 3)
{
if
(security.this_is_admin)
{
selected_value =
Request["pcd" + Convert.ToString(i)];
}
else
{
selected_value =
Util.get_setting("Type","Bug");
}
}
else
{
selected_value =
Request["pcd" + Convert.ToString(i)];
}
--- 1 line changed at
2124:
selected_value = (string) dr
["bg_project_custom_dropdown_value" +
Convert.ToString(i)];
--- to: if (i == 3)
{
if
(security.this_is_admin)
{
selected_value =
(string) dr["bg_project_custom_dropdown_value" +
Convert.ToString(i)];
}
else
{
selected_value =
Util.get_setting("Type","Bug");
--- 4 lines added after 2126: else
{
selected_value =
(string) dr["bg_project_custom_dropdown_value" +
Convert.ToString(i)];
}
--- 7 lines added after
2127: }
else
{
selected_value =
Util.get_setting("Type","Bug");
}
}
File: util.cs
--- 33 lines added after 808:
//////////////////////////////////////////////////////////////////
/////
public static string alter_sql_per_project_type
(string sql, string wherecond)
{
string bug_sql = sql;
int pos = sql.ToUpper().IndexOf
("WHERE");
if (pos != -1)
{
bug_sql = bug_sql.Substring
(0,pos+5) +
wherecond +
"AND " +
bug_sql.Substring(pos+5);
}
else
{
pos = sql.ToUpper().IndexOf
("ORDER");
if (pos != -1)
{
bug_sql = bug_sql.Substring
(0,pos) +
"WHERE" +
wherecond +
bug_sql.Substring
(pos);
}
else
{
bug_sql += " WHERE " +
wherecond;
}
}
return bug_sql;
}
File: search.aspx
--- 9 lines added after 226://Matthias Roth DWS
7.11.2005 Start
//Select/Filter forced the additional Type field
//Filter the resultset
//http://myserver/bugs will select all bug
//http://myserver/request will select all request
//new web.config setting Type will select additional all
custom types
sql = Util.alter_sql_per_project_type( sql,"
(dbo.bugs.bg_project_custom_dropdown_value3
= '"+Request.Path.Split('/')[1]+"' or
dbo.bugs.bg_project_custom_dropdown_value3
= '"+Util.get_setting("Type","NOTHING") +"') ");
// Response.Write (sql);
//Matthias Roth 7.11.2005 End
File: web.config
--- 1 line changed at 350: -->
--- to:
<add key="Type" value="Request"/>