From: <ro...@us...> - 2006-08-07 15:45:34
|
Revision: 277 Author: rouquin Date: 2006-08-07 08:45:20 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=277&view=rev Log Message: ----------- I gave TCDB developers rights to view and edit deleted things. Modified Paths: -------------- Website/App_Code/Assignments.cs Website/App_Code/Right.cs Website/App_Code/Users.cs Website/App_Themes/Python/python.css Website/Includes/ActionItems.ascx Website/Includes/ActionItems.ascx.cs Website/Includes/AdministrationTree.ascx.cs Website/Includes/Assignments.ascx Website/Includes/Assignments.ascx.cs Website/Includes/AssignmentsTree.ascx.cs Website/Includes/Rights.ascx Website/Includes/Rights.ascx.cs Website/Includes/RoleAdmin.ascx.cs Website/Includes/Roles.ascx Website/Includes/Roles.ascx.cs Modified: Website/App_Code/Assignments.cs =================================================================== --- Website/App_Code/Assignments.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/App_Code/Assignments.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -19,21 +19,22 @@ { private static ILog m_logg = LogManager.GetLogger("TCDB.Assignments.AssignmentDB"); - public static List<Assignment> GetAssignmentList(string aType, int finished, int assignedID, string highPriority, Nullable<int> creatorID) + public static List<Assignment> GetAssignmentList(string aType, int finished, int assignedID, string highPriority, Nullable<int> creatorID, Nullable<bool> active) { tcdbDataSetTableAdapters.db_assignmentsTableAdapter ta = new tcdbDataSetTableAdapters.db_assignmentsTableAdapter(); tcdbDataSet.db_assignmentsDataTable aTable; if (finished == Constants.ASSIGNMENT_FINISHEDANDUNFINISHED) - aTable = ta.GetData(aType, null, assignedID, null, true); + aTable = ta.GetData(aType, null, assignedID, null, active); else - aTable = ta.GetData(aType, finished, assignedID, null, true); + aTable = ta.GetData(aType, finished, assignedID, null, active); List<Assignment> assignmentList = new List<Assignment>(); foreach (tcdbDataSet.db_assignmentsRow row in aTable) { Assignment assignment = new Assignment(); + assignment.DELETED = !row.active; assignment.NAME = row.aName; assignment.DATEASSIGNED = row.dateAssigned; try @@ -52,7 +53,7 @@ string type = row.aType; if (type == Constants.CODE_AI) { - assignment.ACTIONITEM = ActionItemDB.GetActionItem(row.childID); + assignment.ACTIONITEM = ActionItemDB.GetActionItem(row.childID, active); assignment.WOTOTALTEST = 0; assignment.WOPASSRATE = 0; assignment.WOPASS = 0; @@ -94,7 +95,7 @@ try { m_logg.Debug("Getting Action Item information for id [" + id.ToString() + "]"); - ActionItem ai = ActionItemDB.GetActionItem(id); + ActionItem ai = ActionItemDB.GetActionItem(id, null); return SendNewActionItemMail(ai); } catch { @@ -126,7 +127,7 @@ { try { - ActionItem ai = ActionItemDB.GetActionItem(id); + ActionItem ai = ActionItemDB.GetActionItem(id, null); return SendUpdatedActionItemMail(ai, updatingUser); } catch { return false; } @@ -170,7 +171,7 @@ { try { - ActionItem ai = ActionItemDB.GetActionItem(id); + ActionItem ai = ActionItemDB.GetActionItem(id, null); return SendCompletedActionItemMail(ai, updatingUser); } catch { return false; } @@ -212,24 +213,22 @@ return result; } - public static ActionItem GetActionItem(int id) + public static ActionItem GetActionItem(int id, Nullable<bool> active) { - tcdbDataSet ds = new tcdbDataSet(); tcdbDataSetTableAdapters.db_actionItemsTableAdapter ta = new tcdbDataSetTableAdapters.db_actionItemsTableAdapter(); - ta.GetData(id, true); - ta.Fill(ds.db_actionItems, id, true); - + tcdbDataSet.db_actionItemsDataTable aiTable = ta.GetData(id, active); ActionItem ai = new ActionItem(); - DataTableReader dr = ds.db_actionItems.CreateDataReader(); - if (dr.HasRows && dr.Read()) + if (aiTable.Count > 0) { - ai.ID = Help.DB_IntParse(dr["actionItemID"], 0); - ai.NAME = Help.DB_StringParse(dr["name"], ""); - ai.DESCRIPTION = Help.DB_StringParse(dr["description"], ""); - ai.CREATOR = new User(Help.DB_IntParse(dr["creatorID"], Constants.ANONYMOUSUSERID)); - ai.ASSIGNED = new User(Help.DB_IntParse(dr["assignedID"], Constants.ANONYMOUSUSERID)); - ai.PERCENTCOMPLETE = Help.DB_IntParse(dr["percentComplete"], 0); + tcdbDataSet.db_actionItemsRow row = aiTable[0]; + + ai.ID = row.actionItemID; + ai.NAME = row.name; + ai.DESCRIPTION = row.description; + ai.CREATOR = new User(row.creatorID); + ai.ASSIGNED = new User(row.assignedID); + ai.PERCENTCOMPLETE = row.percentComplete; } return ai; @@ -308,6 +307,7 @@ private int p_woPass; private int p_woFail; private int p_woError; + private bool p_deleted; public Assignment() { @@ -327,6 +327,7 @@ p_woPass = 0; p_woFail = 0; p_woError = 0; + p_deleted = false; } public int ID @@ -428,6 +429,18 @@ } } + public bool DELETED + { + get + { + return p_deleted; + } + set + { + p_deleted = value; + } + } + public int WOTOTALTEST { get { return p_woTotalTest; } Modified: Website/App_Code/Right.cs =================================================================== --- Website/App_Code/Right.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/App_Code/Right.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -33,7 +33,7 @@ public static Right GetRightInfo(string name) { tcdbDataSetTableAdapters.db_rightsTableAdapter rightsAdapter = new tcdbDataSetTableAdapters.db_rightsTableAdapter(); - tcdbDataSet.db_rightsDataTable rightsTable = rightsAdapter.GetData(null, name, true); + tcdbDataSet.db_rightsDataTable rightsTable = rightsAdapter.GetData(null, name, null); if (rightsTable.Count > 0) { @@ -48,7 +48,7 @@ public static Right GetRightInfo(int id) { tcdbDataSetTableAdapters.db_rightsTableAdapter rightsAdapter = new tcdbDataSetTableAdapters.db_rightsTableAdapter(); - tcdbDataSet.db_rightsDataTable rightsTable = rightsAdapter.GetData(id, null, true); + tcdbDataSet.db_rightsDataTable rightsTable = rightsAdapter.GetData(id, null, null); if (rightsTable.Count > 0) { @@ -70,7 +70,7 @@ public static Role GetRoleInfo(string name) { tcdbDataSetTableAdapters.db_roleTableAdapter roleAdapter = new tcdbDataSetTableAdapters.db_roleTableAdapter(); - tcdbDataSet.db_roleDataTable roleTable = roleAdapter.GetData(null,name,true); + tcdbDataSet.db_roleDataTable roleTable = roleAdapter.GetData(null,name,null); if (roleTable.Count > 0) { @@ -92,7 +92,7 @@ public static Role GetRoleInfo(int id) { tcdbDataSetTableAdapters.db_roleTableAdapter roleAdapter = new tcdbDataSetTableAdapters.db_roleTableAdapter(); - tcdbDataSet.db_roleDataTable roleTable = roleAdapter.GetData(id,null,true); + tcdbDataSet.db_roleDataTable roleTable = roleAdapter.GetData(id,null,null); if (roleTable.Count > 0) { @@ -104,10 +104,10 @@ return new Role(); } - public static List<Right> TCDB_GetRightList() + public static List<Right> TCDB_GetRightList(Nullable<bool> active) { tcdbDataSetTableAdapters.db_rightsTableAdapter rightsAdapter = new tcdbDataSetTableAdapters.db_rightsTableAdapter(); - tcdbDataSet.db_rightsDataTable rightsTable = rightsAdapter.GetData(null, null, true); + tcdbDataSet.db_rightsDataTable rightsTable = rightsAdapter.GetData(null, null, active); List<Right> rightsList = new List<Right>(); foreach (tcdbDataSet.db_rightsRow row in rightsTable) @@ -116,10 +116,10 @@ return rightsList; } - public static List<String> TCDB_GetUserRights(int productID, int userID) + public static List<String> TCDB_GetUserRights(int productID, int userID, Nullable<bool> active) { tcdbDataSetTableAdapters.db_userRightsTableAdapter userRightsAdapter = new tcdbDataSetTableAdapters.db_userRightsTableAdapter(); - tcdbDataSet.db_userRightsDataTable userRightsTable = userRightsAdapter.GetData(userID,productID,null,null,true); + tcdbDataSet.db_userRightsDataTable userRightsTable = userRightsAdapter.GetData(userID,productID,null,null,active); List<String> rightsList = new List<String>(); foreach (tcdbDataSet.db_userRightsRow row in userRightsTable) @@ -128,10 +128,10 @@ return rightsList; } - public static Right TCDB_GetUserRight(int productID, int userID, String rightsName) + public static Right TCDB_GetUserRight(int productID, int userID, String rightsName, Nullable<bool> active) { tcdbDataSetTableAdapters.db_userRightsTableAdapter userRightsAdapter = new tcdbDataSetTableAdapters.db_userRightsTableAdapter(); - tcdbDataSet.db_userRightsDataTable userRightsTable = userRightsAdapter.GetData(userID, productID, null, rightsName, true); + tcdbDataSet.db_userRightsDataTable userRightsTable = userRightsAdapter.GetData(userID, productID, null, rightsName, active); if (userRightsTable.Count > 0) { @@ -143,10 +143,10 @@ return null; } - public static List<String> TCDB_GetUserRoles(int productID, int userID) + public static List<String> TCDB_GetUserRoles(int productID, int userID, Nullable<bool> active) { tcdbDataSetTableAdapters.db_roleUserProductTableAdapter userRoleAdapter = new tcdbDataSetTableAdapters.db_roleUserProductTableAdapter(); - tcdbDataSet.db_roleUserProductDataTable userRoleTable = userRoleAdapter.GetData(userID, productID, true); + tcdbDataSet.db_roleUserProductDataTable userRoleTable = userRoleAdapter.GetData(userID, productID, active); List<String> roleList = new List<String>(); foreach (tcdbDataSet.db_roleUserProductRow row in userRoleTable) @@ -154,10 +154,10 @@ return roleList; } - public static Role TCDB_GetUserRoles(int productID, int userID, String roleName) + public static Role TCDB_GetUserRoles(int productID, int userID, String roleName, Nullable<bool> active) { tcdbDataSetTableAdapters.db_roleUserProductTableAdapter userRoleAdapter = new tcdbDataSetTableAdapters.db_roleUserProductTableAdapter(); - tcdbDataSet.db_roleUserProductDataTable userRoleTable = userRoleAdapter.GetData(userID, productID, true); + tcdbDataSet.db_roleUserProductDataTable userRoleTable = userRoleAdapter.GetData(userID, productID, active); foreach (tcdbDataSet.db_roleUserProductRow row in userRoleTable) if (row.roleName == roleName) Modified: Website/App_Code/Users.cs =================================================================== --- Website/App_Code/Users.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/App_Code/Users.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -340,12 +340,12 @@ // Problem: I think that it was caused because creating an anon user calls this, // which in turn creates an anon user. // Solution: Only calling this if we're not dealing with the anon user. - if (user.ID != Constants.ANONYMOUSUSERID) - { + //if (user.ID != Constants.ANONYMOUSUSERID) + //{ // Anything that we have to Get based on userID should happen // in this block so that we avoid an infinate loop //p_assignments = user.GetAssignments(false, Constants.ASSIGNMENT_FINISHEDANDUNFINISHED); - } + //} p_assignments = null; p_rights = new Dictionary<int, List<String>>(); p_roles = new Dictionary<int, List<String>>(); @@ -459,7 +459,7 @@ // Specified product if (!p_rights.ContainsKey(productID)) - p_rights[productID] = RightDB.TCDB_GetUserRights(productID,p_id); + p_rights[productID] = RightDB.TCDB_GetUserRights(productID,p_id, true); if (p_rights[productID].Contains(right)) return true; @@ -467,7 +467,7 @@ if (productID != Constants.PRODUCT_SITEID) { if (!p_rights.ContainsKey(Constants.PRODUCT_SITEID)) - p_rights[Constants.PRODUCT_SITEID] = RightDB.TCDB_GetUserRights(Constants.PRODUCT_SITEID, p_id); + p_rights[Constants.PRODUCT_SITEID] = RightDB.TCDB_GetUserRights(Constants.PRODUCT_SITEID, p_id, true); if (p_rights[Constants.PRODUCT_SITEID].Contains(right)) return true; } @@ -490,7 +490,7 @@ // Specified product if (!p_rights.ContainsKey(productID)) - p_rights[productID] = RightDB.TCDB_GetUserRights(productID, p_id); + p_rights[productID] = RightDB.TCDB_GetUserRights(productID, p_id, true); if (user.HasRights(productID) && p_rights[productID].Contains(right)) return true; @@ -498,7 +498,7 @@ if (productID != Constants.PRODUCT_SITEID) { if (!p_rights.ContainsKey(Constants.PRODUCT_SITEID)) - p_rights[Constants.PRODUCT_SITEID] = RightDB.TCDB_GetUserRights(Constants.PRODUCT_SITEID, p_id); + p_rights[Constants.PRODUCT_SITEID] = RightDB.TCDB_GetUserRights(Constants.PRODUCT_SITEID, p_id, true); if (user.HasRights(Constants.PRODUCT_SITEID) && p_rights[Constants.PRODUCT_SITEID].Contains(right)) return true; } @@ -507,7 +507,7 @@ } public static bool HasRight(int userID, string right, int productID) { - return (RightDB.TCDB_GetUserRight(productID, userID, right) != null); + return (RightDB.TCDB_GetUserRight(productID, userID, right, true) != null); } public bool HasRights(int productID) { @@ -524,7 +524,7 @@ } if (!p_rights.ContainsKey(productID)) - p_rights[productID] = RightDB.TCDB_GetUserRights(productID, p_id); + p_rights[productID] = RightDB.TCDB_GetUserRights(productID, p_id, true); if (p_rights[productID].Count > 0) return true; @@ -533,7 +533,7 @@ } public static bool HasRights(int userID, int productID) { - return (RightDB.TCDB_GetUserRights(productID, userID).Count > 0); + return (RightDB.TCDB_GetUserRights(productID, userID, true).Count > 0); } public void AddRole(String role, int productID) @@ -566,7 +566,7 @@ // Specified product if (!p_roles.ContainsKey(productID)) - p_roles[productID] = RightDB.TCDB_GetUserRoles(productID, p_id); + p_roles[productID] = RightDB.TCDB_GetUserRoles(productID, p_id, true); if (p_roles[productID].Contains(role)) return true; @@ -574,7 +574,7 @@ if (productID != Constants.PRODUCT_SITEID) { if (!p_roles.ContainsKey(Constants.PRODUCT_SITEID)) - p_roles[Constants.PRODUCT_SITEID] = RightDB.TCDB_GetUserRoles(Constants.PRODUCT_SITEID, p_id); + p_roles[Constants.PRODUCT_SITEID] = RightDB.TCDB_GetUserRoles(Constants.PRODUCT_SITEID, p_id, true); if (p_roles[Constants.PRODUCT_SITEID].Contains(role)) return true; } @@ -583,7 +583,7 @@ } public static bool HasRole(int userID, string role, int productID) { - return (RightDB.TCDB_GetUserRoles(productID, userID, role) != null); + return (RightDB.TCDB_GetUserRoles(productID, userID, role, true) != null); } public bool HasRoles(int productID) { @@ -600,7 +600,7 @@ } if (!p_roles.ContainsKey(productID)) - p_roles[productID] = RightDB.TCDB_GetUserRoles(productID, p_id); + p_roles[productID] = RightDB.TCDB_GetUserRoles(productID, p_id, true); if (p_roles[productID].Count > 0) return true; @@ -609,15 +609,15 @@ } public static bool HasRoles(int userID, int productID) { - return (RightDB.TCDB_GetUserRoles(productID, userID).Count > 0); + return (RightDB.TCDB_GetUserRoles(productID, userID, true).Count > 0); } - public List<Assignment> GetAssignments(bool reload, int statusFilter) + public List<Assignment> GetAssignments(bool reload, int statusFilter, Nullable<bool> active) { // TODO: This list needs to be able to reflect filters! if (p_assignments == null || reload) { - p_assignments = AssignmentDB.GetAssignmentList(null, statusFilter, ID, null, null); + p_assignments = AssignmentDB.GetAssignmentList(null, statusFilter, ID, null, null, active); } return p_assignments; Modified: Website/App_Themes/Python/python.css =================================================================== --- Website/App_Themes/Python/python.css 2006-08-07 14:01:13 UTC (rev 276) +++ Website/App_Themes/Python/python.css 2006-08-07 15:45:20 UTC (rev 277) @@ -92,6 +92,14 @@ color: Gray; } +.deleted +{ + color: black; + font-style: italic; + text-decoration: line-through; + font-family: 'Arial Narrow'; +} + .item .checkbox INPUT { margin: 0; Modified: Website/Includes/ActionItems.ascx =================================================================== --- Website/Includes/ActionItems.ascx 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/ActionItems.ascx 2006-08-07 15:45:20 UTC (rev 277) @@ -47,7 +47,9 @@ <asp:ListItem>75</asp:ListItem> <asp:ListItem>100</asp:ListItem> </asp:RadioButtonList></div> - </div> + <asp:Label ID="deletedLbl" runat="server" Text="Deleted: "></asp:Label><strong></strong><asp:CheckBox + ID="activeBox" runat="server" AutoPostBack="True" Checked='<%# Eval("active") %>' + OnCheckedChanged="activeBox_CheckedChanged" OnInit="activeBox_Init" /></div> <div class="end"> </div> </div> @@ -317,10 +319,10 @@ </div> <asp:ObjectDataSource ID="ActionItemDataSource" runat="server" SelectMethod="GetData" TypeName="tcdbDataSetTableAdapters.db_actionItemsTableAdapter" InsertMethod="Insert" - UpdateMethod="Update" DeleteMethod="Delete"> + UpdateMethod="Update" DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}"> <SelectParameters> <asp:SessionParameter Name="actionItemID" SessionField="item_id" Type="Int32" /> - <asp:Parameter DefaultValue="true" Name="active" Type="Boolean" /> + <asp:SessionParameter DefaultValue="" Name="active" SessionField="active" Type="Boolean" /> </SelectParameters> <InsertParameters> <asp:Parameter Name="name" Type="String" /> Modified: Website/Includes/ActionItems.ascx.cs =================================================================== --- Website/Includes/ActionItems.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/ActionItems.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -42,7 +42,7 @@ } else { - ai = ActionItemDB.GetActionItem(Convert.ToInt32(item_id)); + ai = ActionItemDB.GetActionItem(Convert.ToInt32(item_id),active); if (ai != null && (!m_user.HasRight("view_other_ai", productID) && @@ -277,6 +277,7 @@ DropDownList status = (DropDownList)ActionItemsView.FindControl("statusList"); RadioButtonList percent = (RadioButtonList)ActionItemsView.FindControl("percentList"); CalendarPopup dateDue = (CalendarPopup)ActionItemsView.FindControl("dateDue"); + CheckBox activeBox = (CheckBox)ActionItemsView.FindControl("activeBox"); createdBy.Text = m_user.FULLNAME; createdBy.ToolTip = m_user.ID.ToString(); @@ -287,9 +288,15 @@ percent.SelectedIndex = 0; status.Enabled = false; percent.Enabled = false; + activeBox.Enabled = false; } else if (data != null) + { + CheckBox activeBox = (CheckBox)ActionItemsView.FindControl("activeBox"); + Page.Title = "TCDB: " + data["name"].ToString(); + activeBox.Checked = !activeBox.Checked; + } else Response.Redirect("Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); } @@ -399,7 +406,7 @@ protected void assignedTo_Init(object sender, EventArgs e) { DropDownList assignedTo = (DropDownList)sender; - if (ai == null) ai = ActionItemDB.GetActionItem(Convert.ToInt32(item_id)); + if (ai == null) ai = ActionItemDB.GetActionItem(Convert.ToInt32(item_id),active); if (!(ActionItemsView.CurrentMode == FormViewMode.Insert && m_user.HasRight("create_other_ai", Constants.PRODUCT_ANYID)) && !(ActionItemsView.CurrentMode == FormViewMode.Edit && m_user.HasRight("reassign_other_ai", ai.CREATOR, Constants.PRODUCT_ANYID))) @@ -439,4 +446,25 @@ } } + protected void activeBox_Init(object sender, EventArgs e) + { + CheckBox activeBox = (CheckBox)sender; + Label deletedLbl = (Label)ActionItemsView.FindControl("deletedLbl"); + + if (!m_user.HasRight("dev_access")) + { + activeBox.Visible = false; + deletedLbl.Visible = false; + } + } + protected void activeBox_CheckedChanged(object sender, EventArgs e) + { + CheckBox activeBox = (CheckBox)sender; + int deleted = (activeBox.Checked) ? 0:1; + + tcdbDataSetTableAdapters.db_actionItemsTableAdapter aiAdapter = new tcdbDataSetTableAdapters.db_actionItemsTableAdapter(); + aiAdapter.Delete(Convert.ToInt32(item_id), deleted); + + Response.Redirect(Request.RawUrl); + } } Modified: Website/Includes/AdministrationTree.ascx.cs =================================================================== --- Website/Includes/AdministrationTree.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/AdministrationTree.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -50,7 +50,7 @@ { ArrayList nodes = (ArrayList)Session["AdminNodes"]; tcdbDataSetTableAdapters.db_productsTableAdapter productAdapter = new tcdbDataSetTableAdapters.db_productsTableAdapter(); - tcdbDataSet.db_productsDataTable productTable = productAdapter.GetData(true, null); + tcdbDataSet.db_productsDataTable productTable = productAdapter.GetData(active, null); if (productTable.Count > 0) { @@ -70,6 +70,8 @@ // Set additional properties for the node. newNode.SelectAction = TreeNodeSelectAction.Expand; newNode.NavigateUrl = "~/Product.aspx?" + Constants.CODE_PRODUCT + "=" + newNode.Value; + if (!row.active) + newNode.Text = "<font class='deleted'>" + newNode.Text + "</font>"; // Add the new node to the ChildNodes collection of the parent node. parent.ChildNodes.Add(newNode); @@ -439,7 +441,7 @@ protected void BuildAllRolesList(TreeNode parent) { tcdbDataSetTableAdapters.db_roleTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_roleTableAdapter(); - tcdbDataSet.db_roleDataTable rTable = rAdapter.GetData(null, null, true); + tcdbDataSet.db_roleDataTable rTable = rAdapter.GetData(null, null, active); foreach (tcdbDataSet.db_roleRow row in rTable) { @@ -447,6 +449,8 @@ child.Text = row.roleName; child.Value = row.roleID.ToString(); child.NavigateUrl = "~/Role.aspx?" + Constants.CODE_ROLE + "=" + child.Value; + if (!row.active) + child.Text = "<font class='deleted'>" + child.Text + "</font>"; parent.ChildNodes.Add(child); } @@ -454,7 +458,7 @@ protected void BuildAllRightsList(TreeNode parent) { tcdbDataSetTableAdapters.db_rightsTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_rightsTableAdapter(); - tcdbDataSet.db_rightsDataTable rTable = rAdapter.GetData(null, null, true); + tcdbDataSet.db_rightsDataTable rTable = rAdapter.GetData(null, null, active); foreach (tcdbDataSet.db_rightsRow row in rTable) { @@ -462,6 +466,8 @@ child.Text = row.rightsName; child.Value = row.rightsID.ToString(); child.NavigateUrl = "~/Right.aspx?" + Constants.CODE_RIGHT + "=" + child.Value; + if (!row.active) + child.Text = "<font class='deleted'>" + child.Text + "</font>"; parent.ChildNodes.Add(child); } Modified: Website/Includes/Assignments.ascx =================================================================== --- Website/Includes/Assignments.ascx 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/Assignments.ascx 2006-08-07 15:45:20 UTC (rev 277) @@ -10,7 +10,7 @@ <asp:Parameter Name="finished" Type="Int32" /> <asp:SessionParameter Name="assignedID" SessionField="uid" Type="Int32" /> <asp:Parameter Name="highPriority" Type="Boolean" /> - <asp:Parameter DefaultValue="true" Name="active" Type="Boolean" /> + <asp:SessionParameter DefaultValue="" Name="active" SessionField="active" Type="Boolean" /> </SelectParameters> </asp:ObjectDataSource> <div id="Assignments"> Modified: Website/Includes/Assignments.ascx.cs =================================================================== --- Website/Includes/Assignments.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/Assignments.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -119,10 +119,10 @@ gRow.Cells[1].ToolTip = name; if (type == Constants.CODE_AI) { - ActionItem ai = ActionItemDB.GetActionItem(cid); + ActionItem ai = ActionItemDB.GetActionItem(cid,active); // action item exists - if (ai != null && + if (ai.ID != 0 && // It's not mine, the assignee doesn't belong to this product group, or I don't have rights to see other users' Action Items !(ai.ASSIGNED.ID != m_user.ID && m_user.HasRight("view_other_ai",ai.ASSIGNED,productID)) && @@ -146,7 +146,7 @@ WorkOrder wo = WorkOrderDB.TCDB_GetWorkOrder(cid); // work order exists - if (wo != null && + if (wo.ID != 0 && // It's not mine, the assignee doesn't belong to this product group, or I don't have rights to see other users' work orders !(wo.ASSIGNED.ID != m_user.ID && m_user.HasRight("view_other_wo", wo.ASSIGNED, productID)) && @@ -253,6 +253,10 @@ if ((dateFinished < from) || (dateFinished > to)) return false; } + if (Convert.ToBoolean(data["active"]) == false) + { + gRow.Cells[1].Font.Strikeout = true; + } return true; } Modified: Website/Includes/AssignmentsTree.ascx.cs =================================================================== --- Website/Includes/AssignmentsTree.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/AssignmentsTree.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -157,7 +157,7 @@ { ArrayList nodes = (ArrayList)Session["AssignmentNodes"]; tcdbDataSetTableAdapters.db_productsTableAdapter pAdapter = new tcdbDataSetTableAdapters.db_productsTableAdapter(); - tcdbDataSet.db_productsDataTable pTable = pAdapter.GetData(true, null); + tcdbDataSet.db_productsDataTable pTable = pAdapter.GetData(active, null); foreach (tcdbDataSet.db_productsRow row in pTable) { @@ -169,6 +169,9 @@ child.Value = row.productID.ToString(); child.PopulateOnDemand = true; child.SelectAction = TreeNodeSelectAction.Select; + if (!row.active) + child.Text = "<font class='deleted'>" + child.Text + "</font>"; + parent.ChildNodes.Add(child); if (nodes.Contains(child.ValuePath)) child.Expand(); @@ -224,7 +227,7 @@ foreach (tcdbDataSet.db_usersRow row in uTable) { - if (AssignmentDB.GetAssignmentList(null, status, row.userID, null, m_user.ID).Count == 0) + if (AssignmentDB.GetAssignmentList(null, status, row.userID, null, m_user.ID,active).Count == 0) continue; // User name @@ -260,7 +263,7 @@ continue; else lastID = row.userID; - if (AssignmentDB.GetAssignmentList(null, status, row.userID, null, null).Count == 0) + if (AssignmentDB.GetAssignmentList(null, status, row.userID, null, null,active).Count == 0) continue; // Create the new child node. @@ -298,7 +301,7 @@ // Set status and get assignment list if (statusComplete.Checked) status = Constants.ASSIGNMENT_FINISHEDANDUNFINISHED; - List<Assignment> assignmentList = UserDB.GetUserInfo(Convert.ToInt32(parent.Value)).GetAssignments(false, status); + List<Assignment> assignmentList = UserDB.GetUserInfo(Convert.ToInt32(parent.Value)).GetAssignments(false, status,active); m_logg.Debug("There are currently [" + assignmentList.Count.ToString() + "] assignments"); if (assignmentList.Count > 0) @@ -340,6 +343,10 @@ } else continue; } + if (a.DELETED) + { + child.Text = "<font class='deleted'>" + child.Text + "</font>"; + } // Add the new child node to the ChildNodes collection of the parent node. parent.ChildNodes.Add(child); Modified: Website/Includes/Rights.ascx =================================================================== --- Website/Includes/Rights.ascx 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/Rights.ascx 2006-08-07 15:45:20 UTC (rev 277) @@ -7,7 +7,9 @@ <div align="left"> <h2> User Rights</h2> - </div> + </div><div align="right"> + <asp:Label ID="activeLbl" runat="server" Text="Active"></asp:Label> + <asp:CheckBox ID="activeBox" runat="server" AutoPostBack="True" Checked='<%# Eval("active") %>' OnCheckedChanged="activeBox_CheckedChanged" OnInit="activeBox_Init" /></div> </HeaderTemplate> <ItemTemplate> <div class="xsnazzy"> Modified: Website/Includes/Rights.ascx.cs =================================================================== --- Website/Includes/Rights.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/Rights.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -165,4 +165,23 @@ descriptionLbl.Visible = true; } } + + protected void activeBox_Init(object sender, EventArgs e) + { + CheckBox activeBox = (CheckBox)sender; + Label activeLbl = (Label)FormView1.FindControl("activeLbl"); + + if (!m_user.HasRight("dev_access")) + { + activeBox.Visible = false; + activeLbl.Visible = false; + } + } + protected void activeBox_CheckedChanged(object sender, EventArgs e) + { + CheckBox activeBox = (CheckBox)sender; + + tcdbDataSetTableAdapters.db_rightsTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_rightsTableAdapter(); + rAdapter.Update(right.ID, right.NAME, right.DESCRIPTION, activeBox.Checked); + } } \ No newline at end of file Modified: Website/Includes/RoleAdmin.ascx.cs =================================================================== --- Website/Includes/RoleAdmin.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/RoleAdmin.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -67,7 +67,13 @@ tcdbDataSet.db_roleDataTable rTable = rAdapter.GetData(null, null, active); foreach (tcdbDataSet.db_roleRow row in rTable) - roleList.Items.Add(new ListItem(row.roleName, row.roleID.ToString())); + { + ListItem item = new ListItem(row.roleName, row.roleID.ToString()); + if (!row.active) + item.Attributes.CssStyle.Add("text-decoration", "line-through"); + + roleList.Items.Add(item); + } } protected void rightsList_Init(object sender, EventArgs e) { @@ -86,7 +92,13 @@ tcdbDataSet.db_rightsDataTable rTable = rAdapter.GetData(null, null, active); foreach (tcdbDataSet.db_rightsRow row in rTable) - rightsList.Items.Add(new ListItem(row.rightsName, row.rightsID.ToString())); + { + ListItem item = new ListItem(row.rightsName, row.rightsID.ToString()); + if (!row.active) + item.Attributes.CssStyle.Add("text-decoration", "line-through"); + + rightsList.Items.Add(item); + } } protected void addRoleBtn_Load(object sender, EventArgs e) Modified: Website/Includes/Roles.ascx =================================================================== --- Website/Includes/Roles.ascx 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/Roles.ascx 2006-08-07 15:45:20 UTC (rev 277) @@ -7,7 +7,9 @@ <div align="left"> <h2> User Role</h2> - </div> + </div><div align="right"> + <asp:Label ID="activeLbl" runat="server" Text="Active"></asp:Label> + <asp:CheckBox ID="activeBox" runat="server" AutoPostBack="True" Checked='<%# Eval("active") %>' OnCheckedChanged="activeBox_CheckedChanged" OnInit="activeBox_Init" /></div> </HeaderTemplate> <ItemTemplate> <div class="xsnazzy"> Modified: Website/Includes/Roles.ascx.cs =================================================================== --- Website/Includes/Roles.ascx.cs 2006-08-07 14:01:13 UTC (rev 276) +++ Website/Includes/Roles.ascx.cs 2006-08-07 15:45:20 UTC (rev 277) @@ -158,6 +158,8 @@ protected void deleteCmd(object sender, CommandEventArgs e) { tcdbDataSetTableAdapters.db_roleTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_roleTableAdapter(); + if (role == null) role = RightDB.GetRoleInfo(roleID); + rAdapter.Update(roleID, role.NAME, role.DESCRIPTION, false); Session.Remove("tableName"); Response.Redirect("~/Administration.aspx"); @@ -431,4 +433,22 @@ descriptionLbl.Visible = true; } } + protected void activeBox_Init(object sender, EventArgs e) + { + CheckBox activeBox = (CheckBox) sender; + Label activeLbl = (Label) FormView1.FindControl("activeLbl"); + + if (!m_user.HasRight("dev_access")) + { + activeBox.Visible = false; + activeLbl.Visible = false; + } + } + protected void activeBox_CheckedChanged(object sender, EventArgs e) + { + CheckBox activeBox = (CheckBox)sender; + + tcdbDataSetTableAdapters.db_roleTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_roleTableAdapter(); + rAdapter.Update(role.ID, role.NAME, role.DESCRIPTION, activeBox.Checked); + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |