From: <ro...@us...> - 2006-08-02 17:55:12
|
Revision: 261 Author: rouquin Date: 2006-08-02 10:55:03 -0700 (Wed, 02 Aug 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=261&view=rev Log Message: ----------- Fixed the disappearing description bug - for roles and ActionItems. Modified Paths: -------------- Website/App_Code/Right.cs 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/Roles.ascx Website/Includes/Roles.ascx.cs Modified: Website/App_Code/Right.cs =================================================================== --- Website/App_Code/Right.cs 2006-08-02 01:37:18 UTC (rev 260) +++ Website/App_Code/Right.cs 2006-08-02 17:55:03 UTC (rev 261) @@ -53,8 +53,15 @@ if (rightsTable.Count > 0) { tcdbDataSet.db_rightsRow row = rightsTable[0]; + String description = ""; - return new Right(row.rightsID, row.rightsName, row.rightsDescription); + try + { + description = row.rightsDescription; + } + catch { } + + return new Right(row.rightsID, row.rightsName, description); } else return new Right(); @@ -68,8 +75,15 @@ if (roleTable.Count > 0) { tcdbDataSet.db_roleRow row = roleTable[0]; + String description = ""; - return new Role(row.roleID, row.roleName, row.roleDescription); + try + { + description = row.roleDescription; + } + catch { } + + return new Role(row.roleID, row.roleName, description); } else return new Role(); Modified: Website/Includes/ActionItems.ascx =================================================================== --- Website/Includes/ActionItems.ascx 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/ActionItems.ascx 2006-08-02 17:55:03 UTC (rev 261) @@ -182,7 +182,7 @@ <div class="cm"> <label> Description:</label><br /> - <FTB:FreeTextBox ID="FreeTextBox1" runat="server" SupportFolder="~" Text='<%# Bind("description") %>' + <FTB:FreeTextBox ID="descriptionBox" runat="server" SupportFolder="~" Text='<%# Bind("description") %>' Height="300" Width="100%" /> <div class="hr"> </div> @@ -266,7 +266,7 @@ <div class="cm"> <label> Description:</label><br /> - <FTB:FreeTextBox ID="FreeTextBox1" runat="server" SupportFolder="~" Text='<%# Bind("description") %>' + <FTB:FreeTextBox ID="descriptionBox" runat="server" SupportFolder="~" Text='<%# Bind("description") %>' Height="300" Width="100%" /> <div class="hr"> </div> Modified: Website/Includes/ActionItems.ascx.cs =================================================================== --- Website/Includes/ActionItems.ascx.cs 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/ActionItems.ascx.cs 2006-08-02 17:55:03 UTC (rev 261) @@ -118,6 +118,14 @@ if (ActionItemsView.CurrentMode == FormViewMode.ReadOnly) updateStatus(); } + + // Check for bad state + if (ActionItemsView.CurrentMode == FormViewMode.Edit) + { + FreeTextBoxControls.FreeTextBox ftb = (FreeTextBoxControls.FreeTextBox)ActionItemsView.FindControl("descriptionBox"); + if (ftb.Text == "") + ActionItemsView.DataBind(); + } } protected void percentChanged(object sender, EventArgs e) @@ -169,6 +177,14 @@ if (ActionItemsView.CurrentMode == FormViewMode.ReadOnly) updateStatus(); } + + // Check for bad state + if (ActionItemsView.CurrentMode == FormViewMode.Edit) + { + FreeTextBoxControls.FreeTextBox ftb = (FreeTextBoxControls.FreeTextBox)ActionItemsView.FindControl("descriptionBox"); + if (ftb.Text == "") + ActionItemsView.DataBind(); + } } protected void statusChanged(object sender, EventArgs e) @@ -220,6 +236,14 @@ if (ActionItemsView.CurrentMode == FormViewMode.ReadOnly) updateStatus(); } + + // Check for bad state + if (ActionItemsView.CurrentMode == FormViewMode.Edit) + { + FreeTextBoxControls.FreeTextBox ftb = (FreeTextBoxControls.FreeTextBox)ActionItemsView.FindControl("descriptionBox"); + if (ftb.Text == "") + ActionItemsView.DataBind(); + } } protected void ActionItemsView_DataBound(object sender, EventArgs e) Modified: Website/Includes/AdministrationTree.ascx.cs =================================================================== --- Website/Includes/AdministrationTree.ascx.cs 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/AdministrationTree.ascx.cs 2006-08-02 17:55:03 UTC (rev 261) @@ -767,7 +767,7 @@ BuildProductList(e.Node); break; case 1: - if (e.Node.Text.Contains(TCDB.Products.ProductDB.GetProduct(Constants.PRODUCT_SITEID).ToString())) + if (e.Node.Value == Constants.PRODUCT_SITEID.ToString()) BuildAdminList(e.Node); else BuildCategoryList(e.Node); Modified: Website/Includes/Assignments.ascx =================================================================== --- Website/Includes/Assignments.ascx 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/Assignments.ascx 2006-08-02 17:55:03 UTC (rev 261) @@ -22,7 +22,8 @@ </div> <div class="right"> <div class="buttons"> - <asp:LinkButton ID="newActionItem" runat="server" PostBackUrl="~/ActionItem.aspx?mode=new" OnInit="newActionItem_Init">New Action Item</asp:LinkButton> + <asp:LinkButton ID="newActionItem" runat="server" PostBackUrl="~/ActionItem.aspx?mode=new" + OnInit="newActionItem_Init">New Action Item</asp:LinkButton> <!-- <asp:LinkButton ID="newWorkOrder" runat="server" PostBackUrl="~/WorkOrder.aspx?mode=new">New Work Order</asp:LinkButton> --> </div> @@ -44,13 +45,20 @@ <asp:Label runat="server" ID="NoAssignments" Text="*" Visible="false" CssClass="errorMessage"></asp:Label> <asp:GridView ID="AssignmentsGridView" runat="server" GridLines="None" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="AssignmentDataSource" OnRowDataBound="AssignmentsGridView_RowDataBound" - EnableTheming="true" SkinID="assignments" RowStyle-CssClass="hover" HeaderStyle-CssClass="header" OnDataBinding="AssignmentsGridView_DataBinding" OnDataBound="AssignmentsGridView_DataBound"> + EnableTheming="True" SkinID="assignments" RowStyle-CssClass="hover" HeaderStyle-CssClass="header" + OnDataBinding="AssignmentsGridView_DataBinding" OnDataBound="AssignmentsGridView_DataBound" OnSorted="AssignmentsGridView_Sorted"> <Columns> - <asp:ImageField DataImageUrlField="highPriority" ShowHeader="False" HeaderText="(!)" - SortExpression="highPriority" /> - <asp:HyperLinkField DataNavigateUrlFields="childID" DataNavigateUrlFormatString="default.aspx?id={0}" - DataTextField="aName" HeaderText="Assignment" SortExpression="aName" DataTextFormatString="{0}" - ItemStyle-CssClass="colAssignment" /> + <asp:TemplateField HeaderText="(!)" SortExpression="highPriority"> + <ItemTemplate> + <asp:Literal runat="server" Text="<div class='priority_high_small'></div>" Visible='<%# (Convert.ToBoolean(Eval("highPriority")) == true) %>' /> + </ItemTemplate> + </asp:TemplateField> + <asp:TemplateField HeaderText="Assignment" SortExpression="aName"> + <ItemTemplate> + <asp:Literal ID="url" runat="server" + Text='<%# getURL(Convert.ToInt32(Eval("childID")),Convert.ToString(Eval("aType")),Convert.ToString(Eval("aName"))) %>' /> + </ItemTemplate> + </asp:TemplateField> <asp:BoundField DataField="assigned" HeaderText="Assignee" SortExpression="assigned" /> <asp:BoundField DataField="creator" HeaderText="Creator" ReadOnly="True" SortExpression="creator" /> <asp:BoundField DataField="dateAssigned" DataFormatString="{0:M-dd-yyyy}" HeaderText="Assigned" @@ -66,6 +74,8 @@ <asp:BoundField DataField="WOFail" HeaderText="# Fail" ReadOnly="True" SortExpression="WOFail" /> <asp:BoundField DataField="WOError" HeaderText="# Error" ReadOnly="True" SortExpression="WOError" /> </Columns> + <RowStyle CssClass="hover" /> + <HeaderStyle CssClass="header" /> </asp:GridView> </div> <b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"> @@ -165,7 +175,7 @@ To:</label><div class="calendar"> <ew:CalendarPopup ID="toDate" runat="server" PopupLocation="Bottom" ShowGoToToday="True" ControlDisplay="LabelImage" SkinID="calendar" SelectedDate="1/1/3000 12:00:00 AM" - AutoPostBack="true" OnDateChanged="update" OnInit="toDate_Init" > + AutoPostBack="true" OnDateChanged="update" OnInit="toDate_Init"> </ew:CalendarPopup> </div> </div> Modified: Website/Includes/Assignments.ascx.cs =================================================================== --- Website/Includes/Assignments.ascx.cs 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/Assignments.ascx.cs 2006-08-02 17:55:03 UTC (rev 261) @@ -91,7 +91,9 @@ } } Session.Add("uid", uid); - m_logg.Debug("Databinding the AssignmentsGridView"); + m_logg.Debug("Databinding the AssignmentsGridView"); + if (Session["refresh"] != null) + AssignmentsGridView.DataBind(); } private bool filter(GridViewRow gRow) @@ -104,15 +106,16 @@ DataRowView data = (DataRowView)gRow.DataItem; if (data == null) return false; - + // Set priority image bool priority = Convert.ToBoolean(data["highPriority"].ToString()); + /* if (priority) gRow.Cells[0].Text = "<div class=\"priority_high_small\"></div>"; else gRow.Cells[0].Text = "<div class=\"priority_normal_small\"></div>"; - + */ // Set Hyperlink URL int cid = Convert.ToInt32(data["childID"]); String type = data["aType"].ToString(); @@ -134,7 +137,7 @@ !(ai.CREATOR.ID == m_user.ID && m_user.HasRight("view_created_ai",productID)))) return false; - gRow.Cells[1].Text = "<a href=\"ActionItem.aspx?"+Constants.CODE_PRODUCT+"="+productID+"&" + Constants.CODE_AI + "=" + cid + "\">" + displayName + "</a>"; + //gRow.Cells[1].Text = "<a href=\"ActionItem.aspx?"+Constants.CODE_PRODUCT+"="+productID+"&" + Constants.CODE_AI + "=" + cid + "\">" + displayName + "</a>"; if (!cboShowActionItems.Checked) return false; } @@ -148,7 +151,7 @@ !(wo.CREATOR.ID == m_user.ID && m_user.HasRight("view_created_wo",productID)))) return false; - gRow.Cells[1].Text = "<a href=\"WorkOrder.aspx?" + Constants.CODE_PRODUCT + "=" + productID + "&" + Constants.CODE_WO + "=" + cid + "\">" + name + "</a>"; + //gRow.Cells[1].Text = "<a href=\"WorkOrder.aspx?" + Constants.CODE_PRODUCT + "=" + productID + "&" + Constants.CODE_WO + "=" + cid + "\">" + name + "</a>"; if (!cboShowWorkOrders.Checked) return false; } @@ -557,4 +560,22 @@ if (!m_user.HasRight("create_my_ai", Constants.PRODUCT_ANYID) && !m_user.HasRight("create_other_ai", Constants.PRODUCT_ANYID)) newAI.Visible = false; } + protected String getURL(int cid, String type, String displayName) + { + if (type == Constants.CODE_AI) + return "<a href=\"ActionItem.aspx?" + Constants.CODE_PRODUCT + "=" + productID + "&" + Constants.CODE_AI + "=" + cid + "\">" + displayName + "</a>"; + else if (type == Constants.CODE_WO) + return "<a href=\"WorkOrder.aspx?" + Constants.CODE_PRODUCT + "=" + productID + "&" + Constants.CODE_WO + "=" + cid + "\">" + displayName + "</a>"; + else + { + m_logg.Error("Bad Assignment type. Can't display URL"); + return ""; + } + + } + protected void AssignmentsGridView_Sorted(object sender, EventArgs e) + { + foreach (GridViewRow row in AssignmentsGridView.Rows) + filter(row); + } } Modified: Website/Includes/AssignmentsTree.ascx.cs =================================================================== --- Website/Includes/AssignmentsTree.ascx.cs 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/AssignmentsTree.ascx.cs 2006-08-02 17:55:03 UTC (rev 261) @@ -101,29 +101,29 @@ TreeNode node = AssignmentTree.SelectedNode; node.Selected = false; - /*if (AssignmentTree.ShowExpandCollapse == false) + if (AssignmentTree.ShowExpandCollapse == false) { if (node.Expanded == true) node.Collapse(); else node.Expand(); - } + }/* else {*/ - switch (node.Depth) - { - case 0: - Response.Redirect("~/Assignments.aspx"); - break; - case 1: - Response.Redirect("~/Assignments.aspx?" + Constants.CODE_PRODUCT + "=" + node.Value); - break; - case 2: - Response.Redirect("~/Assignments.aspx?" + Constants.CODE_PRODUCT + "=" + node.Parent.Value + "&" + Constants.CODE_USER + "=" + node.Value); - break; - default: - break; - } + switch (node.Depth) + { + case 0: + Response.Redirect("~/Assignments.aspx"); + break; + case 1: + Response.Redirect("~/Assignments.aspx?" + Constants.CODE_PRODUCT + "=" + node.Value); + break; + case 2: + Response.Redirect("~/Assignments.aspx?" + Constants.CODE_PRODUCT + "=" + node.Parent.Value + "&" + Constants.CODE_USER + "=" + node.Value); + break; + default: + break; + } // } } protected void AssignmentTree_TreeNodePopulate(object sender, TreeNodeEventArgs e) @@ -213,6 +213,7 @@ TreeNode child = new TreeNode(); child.Text = u.FULLNAME; child.Value = u.ID.ToString(); + child.ImageUrl = "~/App_Themes/Images/user_add_48.png"; child.PopulateOnDemand = true; child.SelectAction = TreeNodeSelectAction.Select; parent.ChildNodes.Add(child); @@ -222,8 +223,8 @@ AssignmentTree_TreeNodePopulate(AssignmentTree,new TreeNodeEventArgs(child)); } - // if there are no assignments - if (parent.ChildNodes.Count == 0) + // if there are no users or only the current user + if (parent.ChildNodes.Count == 0 || (parent.ChildNodes.Count == 1 && parent.ChildNodes[0].Value == m_user.ID.ToString())) parent.Parent.ChildNodes.Remove(parent); } private void BuildAssignmentList(TreeNode parent) @@ -277,6 +278,8 @@ // Add the new child node to the ChildNodes collection of the parent node. parent.ChildNodes.Add(child); } + + // if there are no assignments if (parent.ChildNodes.Count == 0) parent.Parent.ChildNodes.Remove(parent); } @@ -287,6 +290,7 @@ { ArrayList nodes = (ArrayList)Session["AssignmentNodes"]; + AssignmentTree.Visible = true; foreach (TreeNode node in AssignmentTree.Nodes) { if (nodes.Contains(node.ValuePath)) Modified: Website/Includes/Roles.ascx =================================================================== --- Website/Includes/Roles.ascx 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/Roles.ascx 2006-08-02 17:55:03 UTC (rev 261) @@ -88,8 +88,8 @@ <tr> <td align="left" colspan="6" valign="top"> <strong>Description:</strong><br /> - <FTB:FreeTextBox ID="FreeTextBox1" runat="server" SupportFolder="~/aspnet_client/FreeTextBox/" - Width="100%" Text='<%# Bind("roleDescription") %>' Height="200px" EnableHtmlMode="true"> + <FTB:FreeTextBox ID="descriptionBox" runat="server" SupportFolder="~/aspnet_client/FreeTextBox/" + Width="100%" Text='<%# Bind("roleDescription") %>' Height="200px" EnableHtmlMode="true" DisableIEBackButton="False"> </FTB:FreeTextBox> </td> </tr> @@ -111,7 +111,7 @@ Width="150px"></asp:ListBox></td> <td colspan="2" align="left" valign="top" width="34%"> <strong>Rights:<br /> - <asp:LinkButton ID="newRight" runat="server" CommandName="newRight" OnCommand="newRight">New Right</asp:LinkButton><br /> + <asp:LinkButton ID="newRight" runat="server" CommandName="newRight" OnCommand="newRight" OnInit="newRight_Init">New Right</asp:LinkButton><br /> </strong> <asp:ListBox ID="rightsList" runat="server" DataSourceID="RightsDataSource" DataTextField="rightsName" DataValueField="rightsID" SelectionMode="Multiple" Height="150px" OnDataBound="rightsList_DataBound" Width="150px"></asp:ListBox> @@ -155,7 +155,7 @@ <tr> <td align="left" colspan="6" valign="top"> <strong>Description:</strong><br /> - <FTB:FreeTextBox ID="FreeTextBox1" runat="server" SupportFolder="~/aspnet_client/FreeTextBox/" + <FTB:FreeTextBox ID="descriptionBox" runat="server" SupportFolder="~/aspnet_client/FreeTextBox/" Width="100%" Text='<%# Bind("roleDescription") %>' Height="200px" EnableHtmlMode="true"> </FTB:FreeTextBox> </td> Modified: Website/Includes/Roles.ascx.cs =================================================================== --- Website/Includes/Roles.ascx.cs 2006-08-02 01:37:18 UTC (rev 260) +++ Website/Includes/Roles.ascx.cs 2006-08-02 17:55:03 UTC (rev 261) @@ -53,6 +53,8 @@ DropDownList productList = (DropDownList)FormView1.FindControl("productList"); ListBox userList = (ListBox) FormView1.FindControl("userList"); Dictionary<String, ArrayList> ProductUsers = (Dictionary<String, ArrayList>)Session["ProductUsers"]; + if (ProductUsers == null) + return; tcdbDataSetTableAdapters.db_roleUserProductTableAdapter rupAdapter = new tcdbDataSetTableAdapters.db_roleUserProductTableAdapter(); // Update ProductUsers @@ -201,6 +203,14 @@ { ListBox userList = (ListBox)FormView1.FindControl("userList"); DropDownList productList = (DropDownList) sender; + + // Check for bad state + if (FormView1.CurrentMode == FormViewMode.Edit) + { + FreeTextBoxControls.FreeTextBox ftb = (FreeTextBoxControls.FreeTextBox)FormView1.FindControl("descriptionBox"); + if (ftb.Text == "") + FormView1.DataBind(); + } // Get Product Users if (Session["ProductUsers"] == null) @@ -304,4 +314,11 @@ } } } + protected void newRight_Init(object sender, EventArgs e) + { + LinkButton btn = (LinkButton) sender; + + if (!m_user.HasRight("dev_access")) + btn.Visible = false; + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |