From: <m_h...@us...> - 2006-08-14 17:09:51
|
Revision: 314 Author: m_hildebrand Date: 2006-08-14 10:09:39 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=314&view=rev Log Message: ----------- I don't remember... sorry. Modified Paths: -------------- Website/App_Code/Common.cs Website/App_Code/SiteMaster.cs Website/App_Code/SiteUserControl.cs Website/Includes/ActionItems.ascx Website/Includes/ActionItems.ascx.cs Website/Includes/AdministrationTree.ascx Website/Includes/AdministrationTree.ascx.cs Website/Includes/Footer.ascx.cs Website/TCDB.master Removed Paths: ------------- Website/WorkOrder.aspx Modified: Website/App_Code/Common.cs =================================================================== --- Website/App_Code/Common.cs 2006-08-14 16:33:49 UTC (rev 313) +++ Website/App_Code/Common.cs 2006-08-14 17:09:39 UTC (rev 314) @@ -1409,11 +1409,12 @@ public const string CODE_RIGHT = "rt"; public const string CODE_ROLE = "r"; public const string CODE_MODE = "m"; - public const string CODE_CREATED = "created"; + public const string CODE_CREATED = "c"; public const string CODE_TYPE = "t"; public const string CODE_VALUE = "va"; public const string CODE_ROOT = "r"; - public const string CODE_NEW = "new"; + public const string CODE_NEW = "n"; + public const string CODE_ERROR = "e"; // TODO: figure this one out //public const bool ASSIGNMENT_PRIORITY_ALL = null; Modified: Website/App_Code/SiteMaster.cs =================================================================== --- Website/App_Code/SiteMaster.cs 2006-08-14 16:33:49 UTC (rev 313) +++ Website/App_Code/SiteMaster.cs 2006-08-14 17:09:39 UTC (rev 314) @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Collections; using System.Configuration; using System.Web; using System.Web.Security; @@ -19,7 +20,6 @@ public class SiteMaster : System.Web.UI.MasterPage { protected User m_user = null; - protected DateTime m_startTime = new DateTime(); protected HttpRequest m_request = null; protected static Logger m_logg = new Logger("TCDB.SiteMaster"); @@ -30,7 +30,7 @@ m_logg.Debug("[" + Request.UserHostName + " (" + Request.UserHostAddress + ")] " + "Processing authenticated user startup"); m_request = LoadRequest(); m_user = LoadSessionUser(); - m_startTime = LoadStartTime(); + StartTime(); } } @@ -47,17 +47,35 @@ return Request; } - public DateTime LoadStartTime() + public DateTime StartTime() { + IEnumerator keys = Session.Contents.Keys.GetEnumerator(); + String key_string = ""; + while (keys.MoveNext()) + { + key_string = key_string + "\t[" + keys.Current.ToString() + "]\t=\t[" + Session[keys.Current.ToString()] + "]\n"; + } + m_logg.Debug("Beginning page load for [" + Request.RawUrl + "] with {\n" + key_string + "}"); + + m_logg.Debug("Loading the request start time"); - if (m_startTime != new DateTime()) + Nullable<DateTime> start = null; + try { + start = (DateTime)Session["startTime"]; + } + catch { } + + if (start != null) + { m_logg.Debug("Returning an existing time"); - return m_startTime; + return (DateTime)start; } - m_logg.Debug("Returning the current time"); - return DateTime.Now; + m_logg.Debug("No existing start time, starting time now"); + Session["startTime"] = DateTime.Now; + + return (DateTime)Session["startTime"]; } public User LoadSessionUser() Modified: Website/App_Code/SiteUserControl.cs =================================================================== --- Website/App_Code/SiteUserControl.cs 2006-08-14 16:33:49 UTC (rev 313) +++ Website/App_Code/SiteUserControl.cs 2006-08-14 17:09:39 UTC (rev 314) @@ -19,7 +19,6 @@ { protected static Nullable<bool> active = true; protected static User m_user = null; - protected static DateTime m_startTime = DateTime.Now; protected static HttpRequest m_request = null; private static Logger m_logg = new Logger("TCDB.SiteUserControl"); @@ -45,7 +44,7 @@ try { m_logg.Debug("Loading request start time"); - m_startTime = ((SiteMaster)(this.Page.Master)).LoadStartTime(); + ((SiteMaster)(this.Page.Master)).StartTime(); } catch (Exception ex) { Modified: Website/Includes/ActionItems.ascx =================================================================== --- Website/Includes/ActionItems.ascx 2006-08-14 16:33:49 UTC (rev 313) +++ Website/Includes/ActionItems.ascx 2006-08-14 17:09:39 UTC (rev 314) @@ -10,7 +10,7 @@ <asp:FormView ID="ActionItemsView" runat="server" DataSourceID="ActionItemDataSource" DataKeyNames="actionItemID" CellPadding="4" ForeColor="#333333" OnDataBound="ActionItemsView_DataBound" OnItemCommand="ActionItemsView_ItemCommand" Width="100%" OnItemInserted="ActionItemsView_ItemInserted" - OnItemUpdated="ActionItemsView_ItemUpdated"> + OnItemUpdated="ActionItemsView_ItemUpdated" > <HeaderTemplate> <asp:ObjectDataSource ID="StatusDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="tcdbDataSetTableAdapters.db_statusTableAdapter"> @@ -33,14 +33,14 @@ Status:</label><asp:DropDownList ID="statusList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="statusChanged" DataSourceID="StatusDataSource" DataTextField="statusName" DataValueField="statusID" AppendDataBoundItems="True" SelectedValue='<%# Bind("statusID") %>' - OnInit="statusList_Init"> + OnLoad="statusList_Load"> </asp:DropDownList> </div> <div class="buttons"> <label> % Complete:</label><asp:RadioButtonList ID="percentList" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="percentChanged" SelectedValue='<%# Bind("percentComplete") %>' - CssClass="buttons" OnInit="percentList_Init"> + CssClass="buttons" OnLoad="percentList_Load"> <asp:ListItem>0</asp:ListItem> <asp:ListItem>25</asp:ListItem> <asp:ListItem>50</asp:ListItem> @@ -49,7 +49,7 @@ </asp:RadioButtonList></div> <asp:Label ID="deletedLbl" runat="server" Text="Deleted: "></asp:Label><strong></strong><asp:CheckBox ID="activeBox" runat="server" AutoPostBack="True" OnCheckedChanged="activeBox_CheckedChanged" - OnInit="activeBox_Init" /></div> + OnLoad="activeBox_Load" /></div> <div class="end"> </div> </div> @@ -104,11 +104,11 @@ <div class="left"> <div class="bottom"> <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" - Text="New" OnInit="NewButton_Init" /><asp:Label ID="newLbl" runat="server"> | </asp:Label><asp:LinkButton + Text="New" OnLoad="NewButton_Load" /><asp:Label ID="newLbl" runat="server"> | </asp:Label><asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" - OnInit="EditButton_Init" /><asp:Label ID="deleteLbl" runat="server"> | </asp:Label><asp:LinkButton + OnLoad="EditButton_Load" /><asp:Label ID="deleteLbl" runat="server"> | </asp:Label><asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="deleteItem" - Text="Delete" OnCommand="deleteItem" OnInit="DeleteButton_Init" /> + Text="Delete" OnCommand="deleteItem" OnLoad="DeleteButton_Load" /> </div> </div> <div class="right"> @@ -183,7 +183,7 @@ ShowGoToToday="True" NullableLabelText="Select a date" ControlDisplay="LabelImage" ImageUrl="../App_Themes/Python/Images/calendar.gif" Nullable="True" OnDateChanged="dateFinished_DateChanged" SelectedDate="" UpperBoundDate="12/31/9999 23:59:59" VisibleDate="" AutoPostBack="True" - OnInit="dateFinished_Init"> + OnLoad="dateFinished_Load"> </ew:CalendarPopup> </div> </div> @@ -324,7 +324,7 @@ UpdateMethod="Update" DeleteMethod="Delete"> <SelectParameters> <asp:SessionParameter Name="actionItemID" SessionField="AssignmentTab_item_id" Type="Int32" /> - <asp:SessionParameter DefaultValue="" Name="active" SessionField="AssignmentTab_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-14 16:33:49 UTC (rev 313) +++ Website/Includes/ActionItems.ascx.cs 2006-08-14 17:09:39 UTC (rev 314) @@ -22,7 +22,11 @@ private static Logger m_logg = new Logger("TCDB.ActionItems"); private const string PREFIX = "AssignmentTab_"; private ActionItem ai; +<<<<<<< .mine + private String item_id = null; +======= private int item_id = 0; +>>>>>>> .theirs private int productID = 0; private String mode = ""; private bool current = false; @@ -38,50 +42,82 @@ { current = true; } - // Load session data +<<<<<<< .mine + try { - item_id = Convert.ToInt32(Session[PREFIX + Constants.CODE_AI]); + mode = Session[PREFIX + Constants.CODE_MODE].ToString(); } catch { } + + if (mode == Constants.CODE_NEW && (m_user.HasRight(Constants.RIGHTS_AI_CREATE_MY) || m_user.HasRight(Constants.RIGHTS_AI_CREATE_OTHER))) + { + ActionItemsView.ChangeMode(FormViewMode.Insert); + return; + } + + + if (productID == 0) + productID = Constants.PRODUCT_SITEID; + +======= + + + + + + + + + + + + + + + + + +>>>>>>> .theirs + // Load session data try { - mode = Session[PREFIX + Constants.CODE_MODE].ToString(); + item_id = Convert.ToInt32(Session[PREFIX + Constants.CODE_AI]); } catch { } + try { productID = Convert.ToInt32(Session[PREFIX + Constants.CODE_PRODUCT]); } catch { productID = Constants.PRODUCT_SITEID; } - + m_logg.Debug("Loading page ActionItems"); if (item_id == 0) { - m_logg.Debug("Unable to locate action item ID in query string"); - if (mode != "new") - { - m_logg.Debug("Mode not set, redirecting to Assignments page"); - Response.Redirect("Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); - } + m_logg.Debug("Unable to locate action item ID"); + + m_logg.Debug("Mode not set, redirecting to Assignments page"); + Session.Remove(PREFIX + "Name"); + Response.Redirect("~/Assignments.aspx"); } - else + + try { - try - { - ai = ActionItemDB.GetActionItem(Convert.ToInt32(item_id), active); - } - catch { } + ai = ActionItemDB.GetActionItem(Convert.ToInt32(item_id), active); + } + catch { } - if (ai != null && - (!m_user.HasRight(Constants.RIGHTS_AI_VIEW_OTHER, productID) && - !(ai.ASSIGNED.ID == m_user.ID && m_user.HasRight(Constants.RIGHTS_AI_VIEW_MY, productID)) && - !(ai.CREATOR.ID == m_user.ID && m_user.HasRight(Constants.RIGHTS_AI_VIEW_CREATED, productID)))) - { - - Response.Redirect("~/Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); - } + if (ai != null && + (!m_user.HasRight(Constants.RIGHTS_AI_VIEW_OTHER, productID) && + !(ai.ASSIGNED.ID == m_user.ID && m_user.HasRight(Constants.RIGHTS_AI_VIEW_MY, productID)) && + !(ai.CREATOR.ID == m_user.ID && m_user.HasRight(Constants.RIGHTS_AI_VIEW_CREATED, productID)))) + { + m_logg.Debug("User doesn't have permissions for the requested operation, returning to assignments page"); + Session[Constants.CODE_ERROR] = "Permission denied."; + Session.Remove(PREFIX + "Name"); + Response.Redirect("~/Assignments.aspx"); } if (item_id == 0) @@ -90,9 +126,6 @@ Session[PREFIX + "item_id"] = item_id; Session[PREFIX + "productID"] = productID; Session[PREFIX + "tableName"] = "tcdb_actionItem"; - - if (mode == "new" && (m_user.HasRight(Constants.RIGHTS_AI_CREATE_MY) || m_user.HasRight(Constants.RIGHTS_AI_CREATE_OTHER))) - ActionItemsView.ChangeMode(FormViewMode.Insert); } protected void updateStatus() @@ -349,19 +382,32 @@ } } else - Response.Redirect("Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); + { + Session.Remove(PREFIX + "Name"); + Response.Redirect("~/Assignments.aspx"); + } } protected void ActionItemsView_ItemCommand(object sender, FormViewCommandEventArgs e) { if (e.CommandName == "Cancel" && ActionItemsView.CurrentMode == FormViewMode.Insert) - Response.Redirect("Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); + { + Session.Remove(PREFIX + "Name"); + Response.Redirect("~/Assignments.aspx"); + } } protected void deleteItem(object sender, CommandEventArgs e) { tcdbDataSetTableAdapters.db_actionItemsTableAdapter aiAdapter = new tcdbDataSetTableAdapters.db_actionItemsTableAdapter(); aiAdapter.Delete(item_id, 0); - Response.Redirect("Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); + Session[Constants.CODE_ERROR] = "Action Item Deleted"; + Session.Remove(PREFIX + "Name"); + Response.Redirect("~/Assignments.aspx"); } + + protected void ActionItemsView_ItemInsert(object sender, FormViewInsertEventArgs e) + { + int i = 1; + } protected void ActionItemsView_ItemInserted(object sender, FormViewInsertedEventArgs e) { if (e.Exception == null) @@ -381,13 +427,17 @@ //set the content' m_logg.Debug("Preparing to send mail notification"); ActionItemDB.SendNewActionItemMail(id); - - Response.Redirect("ActionItem.aspx?" + Constants.CODE_AI + "=" + id); + Session.Remove(PREFIX + Constants.CODE_MODE); + Session[PREFIX + Constants.CODE_AI] = id; + Response.Redirect("~/Assignments.aspx"); } else { m_logg.Info("ERROR: Action Item Creation failed"); - Response.Redirect("Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); + Session[Constants.CODE_ERROR] = "ERROR: Action Item Creation Failed"; + Session.Remove(PREFIX + Constants.CODE_MODE); + Session.Remove(PREFIX + "Name"); + Response.Redirect("~/Assignments.aspx"); } } } @@ -395,10 +445,20 @@ { if (e.Exception != null) { - updateStatus(); + updateStatus(); +<<<<<<< .mine + Session[Constants.CODE_ERROR] = "Action Item Updated"; + Session.Remove(PREFIX + Constants.CODE_MODE); + Session[PREFIX + Constants.CODE_AI] = item_id.ToString(); + Response.Redirect("~/Assignments.aspx"); +======= Response.Redirect("ActionItem.aspx?" + Constants.CODE_AI + "=" + item_id); - } + + + +>>>>>>> .theirs } + } protected void statusList_Init(object sender, EventArgs e) { Modified: Website/Includes/AdministrationTree.ascx =================================================================== --- Website/Includes/AdministrationTree.ascx 2006-08-14 16:33:49 UTC (rev 313) +++ Website/Includes/AdministrationTree.ascx 2006-08-14 17:09:39 UTC (rev 314) @@ -4,7 +4,7 @@ OnCheckedChanged="showHidden_CheckedChanged" OnLoad="showHidden_Load" OnInit="showHidden_Init" /> <asp:TreeView ID="AdminTree" runat="server" SelectedNodeStyle-CssClass="selectednode" OnTreeNodePopulate="AdminTree_TreeNodePopulate" OnTreeNodeCollapsed="AdminTree_TreeNodeCollapsed" - OnTreeNodeExpanded="AdminTree_TreeNodeExpanded" OnInit="AdminTree_Init" OnSelectedNodeChanged="AdminTree_SelectedNodeChanged" + OnTreeNodeExpanded="AdminTree_TreeNodeExpanded" OnLoad="AdminTree_Load" OnSelectedNodeChanged="AdminTree_SelectedNodeChanged" ExpandDepth="1"> <Nodes> <asp:TreeNode Text="Administration" Value="Admin" PopulateOnDemand="True" SelectAction="Expand" /> Modified: Website/Includes/AdministrationTree.ascx.cs =================================================================== --- Website/Includes/AdministrationTree.ascx.cs 2006-08-14 16:33:49 UTC (rev 313) +++ Website/Includes/AdministrationTree.ascx.cs 2006-08-14 17:09:39 UTC (rev 314) @@ -26,7 +26,7 @@ Response.Redirect("~/Assignments.aspx?" + Constants.CODE_USER + "=" + m_user.ID); } - protected void AdminTree_Init(object sender, EventArgs args) + protected void AdminTree_Load(object sender, EventArgs args) { m_logg.Debug("Initializing admin tree"); if (Session[PREFIX + "Nodes"] == null) Modified: Website/Includes/Footer.ascx.cs =================================================================== --- Website/Includes/Footer.ascx.cs 2006-08-14 16:33:49 UTC (rev 313) +++ Website/Includes/Footer.ascx.cs 2006-08-14 17:09:39 UTC (rev 314) @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using System.Collections; using TCDB.Code; @@ -22,18 +23,31 @@ protected string PageLoad() { string result; - TimeSpan loadtime = DateTime.Now - m_startTime; + try + { + TimeSpan loadtime = DateTime.Now - (DateTime)Session["startTime"]; + Session.Remove("startTime"); - if (loadtime.Milliseconds < 99) - { - result = loadtime.Milliseconds + " milliseconds"; + if (loadtime.Milliseconds < 99) + { + result = loadtime.Milliseconds + " milliseconds"; + } + else + { + result = loadtime.TotalSeconds.ToString("F") + " seconds"; + } + IEnumerator keys = Session.Contents.Keys.GetEnumerator(); + String key_string = ""; + while (keys.MoveNext()) + { + key_string = key_string + "\t[" + keys.Current.ToString() + "]\t=\t[" + Session[keys.Current.ToString()] + "]\n"; + } + m_logg.Debug("Page load took [" + result + "] for [" + Request.RawUrl + "] with {\n" + key_string + "}"); } - else + catch { - result = loadtime.TotalSeconds.ToString("F") + " seconds"; + result = ""; } - - m_logg.Debug("Page load took [" + result + "]"); return result; } Modified: Website/TCDB.master =================================================================== --- Website/TCDB.master 2006-08-14 16:33:49 UTC (rev 313) +++ Website/TCDB.master 2006-08-14 17:09:39 UTC (rev 314) @@ -55,7 +55,8 @@ try { - string error = ConfigDB.GetConfigString(m_user.ID, "error"); + string error = (string)Session[Constants.CODE_ERROR]; + Session.Remove(Constants.CODE_ERROR); if (error.Length > 0) { errorLabel.Text = error; Deleted: Website/WorkOrder.aspx =================================================================== --- Website/WorkOrder.aspx 2006-08-14 16:33:49 UTC (rev 313) +++ Website/WorkOrder.aspx 2006-08-14 17:09:39 UTC (rev 314) @@ -1,8 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/TCDB.master" AutoEventWireup="true" Title="TCDB: Work Order" %> - -<asp:Content ID="TreeContent" ContentPlaceHolderID="TreeContentPlaceHolder" Runat="Server"> -</asp:Content> -<asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server"> -</asp:Content> -<asp:Content ID="NotesContent" ContentPlaceHolderID="NotesContentPlaceHolder" Runat="Server"> -</asp:Content> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |