Skip to content

Commit f75fea6

Browse files
committed
Removed some more custom fields code
1 parent 84d3b0e commit f75fea6

File tree

5 files changed

+7
-135
lines changed

5 files changed

+7
-135
lines changed

src/BugTracker.Web/btnet/bug.cs

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -692,21 +692,6 @@ from bugs
692692
and pu_user = @this_usid
693693
where bg_id = @id");
694694

695-
if (ds_custom_cols.Tables[0].Rows.Count == 0)
696-
{
697-
sql = sql.AddParameterWithValue("@custom_cols_placeholder", "");
698-
}
699-
else
700-
{
701-
string custom_cols_sql = "";
702-
703-
foreach (DataRow drcc in ds_custom_cols.Tables[0].Rows)
704-
{
705-
custom_cols_sql += ",[" + drcc["name"] + "]";
706-
707-
}
708-
sql = sql.AddParameterWithValue("custom_cols_placeholder", custom_cols_sql);
709-
}
710695

711696
sql = sql.AddParameterWithValue("id", Convert.ToString(bugid));
712697
sql = sql.AddParameterWithValue("this_usid", Convert.ToString(security.user.usid));
@@ -835,9 +820,6 @@ public static NewIds insert_bug(
835820
int statusid,
836821
int assigned_to_userid,
837822
int udfid,
838-
string project_custom_dropdown_value1,
839-
string project_custom_dropdown_value2,
840-
string project_custom_dropdown_value3,
841823
string comment_formated,
842824
string comment_search,
843825
string from,
@@ -877,8 +859,7 @@ public static NewIds insert_bug(
877859
bg_project_custom_dropdown_value3)
878860
values (@short_desc, @tags, @reported_user, @reported_user, getdate(), getdate(),
879861
@project, @org,
880-
@category, @priority, @status, @assigned_user, @udf,
881-
@pcd1, @pcd2, @pcd3)");
862+
@category, @priority, @status, @assigned_user, @udf)");
882863

883864
sql = sql.AddParameterWithValue("@short_desc", short_desc);
884865
sql = sql.AddParameterWithValue("@tags", tags);
@@ -890,9 +871,6 @@ public static NewIds insert_bug(
890871
sql = sql.AddParameterWithValue("@status", Convert.ToString(statusid));
891872
sql = sql.AddParameterWithValue("@assigned_user", Convert.ToString(assigned_to_userid));
892873
sql = sql.AddParameterWithValue("@udf", Convert.ToString(udfid));
893-
sql = sql.AddParameterWithValue("@pcd1", project_custom_dropdown_value1);
894-
sql = sql.AddParameterWithValue("@pcd2", project_custom_dropdown_value2);
895-
sql = sql.AddParameterWithValue("@pcd3", project_custom_dropdown_value3);
896874
//TODO: Add custom columns
897875

898876

@@ -968,25 +946,25 @@ insert into bug_posts
968946
bg_last_updated_user = @us
969947
where bg_id = @id");
970948

971-
sql = sql.AddParameterWithValue("@from", from.Replace("'", "''"));
949+
sql = sql.AddParameterWithValue("@from", from);
972950
sql = sql.AddParameterWithValue("@type", "received"); // received email
973951
}
974952
else
975953
{
976-
sql = sql.AddParameterWithValue("@from'", "null");
954+
sql = sql.AddParameterWithValue("@from", "null");
977955
sql = sql.AddParameterWithValue("@type", "comment"); // bug comment
978956
}
979957

980958
sql = sql.AddParameterWithValue("@id", Convert.ToString(bugid));
981959
sql = sql.AddParameterWithValue("@us", Convert.ToString(this_usid));
982-
sql = sql.AddParameterWithValue("@comment_formatted", comment_formated.Replace("'", "''"));
983-
sql = sql.AddParameterWithValue("@comment_search", comment_search.Replace("'", "''"));
960+
sql = sql.AddParameterWithValue("@comment_formatted", comment_formated);
961+
sql = sql.AddParameterWithValue("@comment_search", comment_search);
984962
sql = sql.AddParameterWithValue("@content_type", content_type);
985963
if (cc == null)
986964
{
987965
cc = "";
988966
}
989-
sql = sql.AddParameterWithValue("@cc", cc.Replace("'", "''"));
967+
sql = sql.AddParameterWithValue("@cc", cc);
990968
sql = sql.AddParameterWithValue("@internal", btnet.Util.bool_to_string(internal_only));
991969

992970

src/BugTracker.Web/edit_bug.aspx

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -738,27 +738,7 @@ Distributed under the terms of the GNU General Public License
738738
739739
get_comment_text_from_control();
740740
741-
// Project specific
742-
string pcd1 = Request["pcd1"];
743-
string pcd2 = Request["pcd2"];
744-
string pcd3 = Request["pcd3"];
745-
746-
if (pcd1 == null)
747-
{
748-
pcd1 = "";
749-
}
750-
if (pcd2 == null)
751-
{
752-
pcd2 = "";
753-
}
754-
if (pcd3 == null)
755-
{
756-
pcd3 = "";
757-
}
758-
759-
pcd1 = pcd1.Replace("'", "''");
760-
pcd2 = pcd2.Replace("'", "''");
761-
pcd3 = pcd3.Replace("'", "''");
741+
762742
763743
btnet.Bug.NewIds new_ids = btnet.Bug.insert_bug(
764744
short_desc.Value,
@@ -771,9 +751,6 @@ Distributed under the terms of the GNU General Public License
771751
Convert.ToInt32(status.SelectedItem.Value),
772752
Convert.ToInt32(assigned_to.SelectedItem.Value),
773753
Convert.ToInt32(udf.SelectedItem.Value),
774-
pcd1,
775-
pcd2,
776-
pcd3,
777754
comment_formated,
778755
comment_search,
779756
null, // from
@@ -863,8 +840,6 @@ Distributed under the terms of the GNU General Public License
863840
bg_last_updated_user = @lu,
864841
bg_last_updated_date = @now,
865842
bg_user_defined_attribute = @udf
866-
@pcd_placeholder
867-
@custom_cols_placeholder
868843
where bg_id = @id
869844
end
870845
select @now");
@@ -882,82 +857,6 @@ Distributed under the terms of the GNU General Public License
882857
sql = sql.AddParameterWithValue("udf", udf.SelectedItem.Value);
883858
sql = sql.AddParameterWithValue("snapshot_datetime", snapshot_timestamp.Value);
884859
885-
if (permission_level == Security.PERMISSION_READONLY
886-
|| permission_level == Security.PERMISSION_REPORTER)
887-
{
888-
sql = sql.AddParameterWithValue("@pcd_placeholder", "");
889-
}
890-
else
891-
{
892-
sql = sql.AddParameterWithValue("@pcd_placeholder", @",
893-
bg_project_custom_dropdown_value1 = @pcd1,
894-
bg_project_custom_dropdown_value2 = @pcd2,
895-
bg_project_custom_dropdown_value3 = @pcd3
896-
");
897-
898-
string pcd1 = Request["pcd1"];
899-
string pcd2 = Request["pcd2"];
900-
string pcd3 = Request["pcd3"];
901-
902-
if (pcd1 == null)
903-
{
904-
pcd1 = "";
905-
}
906-
if (pcd2 == null)
907-
{
908-
pcd2 = "";
909-
}
910-
if (pcd3 == null)
911-
{
912-
pcd3 = "";
913-
}
914-
915-
sql = sql.AddParameterWithValue("pcd1", pcd1);
916-
sql = sql.AddParameterWithValue("pcd2", pcd2);
917-
sql = sql.AddParameterWithValue("pcd3", pcd3);
918-
}
919-
920-
if (ds_custom_cols.Tables[0].Rows.Count == 0 || permission_level != Security.PERMISSION_ALL)
921-
{
922-
sql = sql.AddParameterWithValue("@custom_cols_placeholder", "");
923-
}
924-
else
925-
{
926-
string custom_cols_sql = "";
927-
928-
foreach (DataRow drcc in ds_custom_cols.Tables[0].Rows)
929-
{
930-
931-
string column_name = (string)drcc["name"];
932-
933-
// if we've made customizations that cause the field to not come back to us,
934-
// don't replace something with null
935-
string o = Request[column_name];
936-
if (o == null)
937-
{
938-
continue;
939-
}
940-
941-
// skip if no permission to update
942-
if (security.user.dict_custom_field_permission_level[column_name] != Security.PERMISSION_ALL)
943-
{
944-
continue;
945-
}
946-
947-
custom_cols_sql += ",[" + column_name + "]";
948-
custom_cols_sql += " = ";
949-
950-
string datatype = (string)drcc["datatype"];
951-
952-
string custom_col_val = btnet.Util.request_to_string_for_sql(
953-
Request[column_name],
954-
datatype);
955-
956-
custom_cols_sql += custom_col_val;
957-
}
958-
sql = sql.AddParameterWithValue("custom_cols_placeholder", custom_cols_sql);
959-
}
960-
961860
DateTime last_update_date = (DateTime)btnet.DbUtil.execute_scalar(sql);
962861
963862
btnet.WhatsNew.add_news(id, short_desc.Value, "updated", security);

src/BugTracker.Web/insert_bug.aspx.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ from bugs
209209
statusid,
210210
assignedid,
211211
udfid,
212-
"", "", "", // project specific dropdown values
213212
comment,
214213
comment,
215214
from_addr,

src/BugTracker.Web/mbug.aspx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,6 @@ Distributed under the terms of the GNU General Public License
454454
Convert.ToInt32(status.SelectedItem.Value),
455455
Convert.ToInt32(assigned_to.SelectedItem.Value),
456456
0, // Convert.ToInt32(udf.SelectedItem.Value),
457-
"",
458-
"",
459-
"",
460457
comment_text,
461458
comment_text,
462459
null, // from

src/BugTracker.Web/tropo_recording.aspx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ int create_new_bug(Security security)
134134
statusid,
135135
assignedid,
136136
udfid,
137-
"", "", "", // project specific dropdown values
138137
"", // comment
139138
"", // comment
140139
"", // from_addr,

0 commit comments

Comments
 (0)