public static string CreateComments(TrackerEntry entry)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<center>Comments<br>----------------------------------------------------------------------------</center>");

            List <CommentEntry> entries = entry.Comments;

            if (entries == null)
            {
                entries = new List <CommentEntry>();
            }

            for (int i = 0; i < entries.Count; i++)
            {
                CommentEntry c = entries[i];
                if (c != null)
                {
                    sb.AppendFormat("Comment by: {0} - {1} {2}<br><br>{3}<center><br>----------------------------------------------------------------------------<br></center>",
                                    c.Submitter, c.Created.ToShortDateString(), c.Created.ToShortTimeString(), c.Comment);
                }
            }

            return(sb.ToString());
        }
Beispiel #2
0
        private static void OnCommand_RemoveIssue(CommandEventArgs e)
        {
            Mobile m = e.Mobile;

            if (m == null)
            {
                return;
            }

            if (!TrackerSystem.Enabled && m.AccessLevel == AccessLevel.Player)
            {
                m.SendMessage("The tracker is currently offline.");
                return;
            }

            if (e.Length == 1)
            {
                int id = e.GetInt32(0);

                TrackerEntry entry = TrackerPersistance.FindIssue(id);
                if (entry != null)
                {
                    entry.Delete();
                    e.Mobile.SendMessage("The tracker entry has been removed.");
                }
                else
                {
                    e.Mobile.SendMessage("There was no tracker entry by that id.");
                }
            }
            else
            {
                e.Mobile.SendMessage("Usage: [RemoveIssue <IssueID>");
            }
        }
        public ViewTrackerEntryGump(Mobile from, TrackerEntry entry, int page)
            : base(50, 50)
        {
            TrackerSystem.CloseGumps(from);

            m_Page  = page;
            m_Entry = entry;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddBackground(0, 0, 600, 600, 9200);

            int x = 10;
            int y = 10;

            // add html area
            AddHtml(x, y, 285, 75, String.Format("<BASEFONT COLOR={0}>Created By: {1}<BR>Added On: {2}<BR>Last Updated: {3}</BASEFONT>", HeaderColor, entry.Submitter, entry.CreationTime.ToShortDateString(), entry.LastUpdatedTime.ToShortDateString()), false, false);
            AddHtml(x + 195, y, 285, 75, String.Format("<BASEFONT COLOR={0}>Assigned To: {1}<BR>Status: {2}<BR>Priority: {3}</BASEFONT>", HeaderColor, entry.AssignedTo.Name, entry.Status.ToString(), entry.Priority.ToString()), false, false);

            y += 70;

            AddHtml(x, y, 580, 200, entry.Message, true, true);               // Message

            y += 205;

            AddHtml(x, y, 580, 275, CreateComments(entry), true, true);                 // Comments

            y += 285;
            x += 5;
            AddLabel(x, y, Hue, @"Add Comment");
            x += 85;
            AddButton(x, y, 4029, 4030, 1, GumpButtonType.Reply, 0);

            if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                x += 60;
                AddLabel(x, y, Hue, @"Assign");
                x += 40;
                AddButton(x, y, 4026, 4027, 2, GumpButtonType.Reply, 0);

                x += 35;
                AddLabel(x, y, Hue, @"Status");
                x += 45;
                AddButton(x, y, 4026, 4027, 3, GumpButtonType.Reply, 0);

                x += 35;
                AddLabel(x, y, Hue, @"Priority");
                x += 50;
                AddButton(x, y, 4026, 4027, 4, GumpButtonType.Reply, 0);
            }

            AddLabel(490, y, Hue, @"Main Menu");
            AddButton(555, y, 4011, 4012, 1000, GumpButtonType.Reply, 0);
        }
Beispiel #4
0
        public CommentEntry(TrackerEntry issue, string submitter, string comment)
        {
            m_Issue = issue;

            m_Submitter = submitter;
            m_Created   = DateTime.UtcNow;
            m_Comment   = comment;
            m_CommentID = TrackerPersistance.NewComment;

            TrackerPersistance.AddComment(this);
        }
Beispiel #5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version >= 0)
            {
                int count = reader.ReadInt();

                m_AllIssues = new Dictionary <int, TrackerEntry>(count);
                for (int i = 0; i < count; i++)
                {
                    TrackerEntry entry = new TrackerEntry(reader);
                    m_AllIssues[entry.IssueID] = entry;
                }
            }
        }
Beispiel #6
0
        public CommentEntry(TrackerEntry issue, GenericReader reader)
        {
            m_Issue = issue;

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_CommentID = reader.ReadInt();
                m_Submitter = reader.ReadString();
                m_Created   = reader.ReadDateTime();
                m_Comment   = reader.ReadString();
                break;
            }
            }

            TrackerPersistance.AddComment(this);
        }
Beispiel #7
0
        public AddCommentGump(Mobile from, TrackerEntry entry, int page)
            : base(30, 20)
        {
            TrackerSystem.CloseGumps(from);

            m_Page  = page;
            m_Entry = entry;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);
            AddBackground(6, 22, 423, 171, 9200);
            AddAlphaRegion(17, 48, 399, 114);
            AddTextEntry(21, 52, 394, 108, 254, 0, "");
            AddButton(383, 166, 4014, 4015, 1, GumpButtonType.Reply, 0);
            AddLabel(18, 26, 254, "Please fill out the box below.");
        }
Beispiel #8
0
 public static void AddIssue(TrackerEntry entry)
 {
     m_Instance.m_AllIssues[entry.IssueID] = entry;
 }
 public SetPriorityGump(Mobile from, TrackerEntry entry, int page, int mainpage)
     : base(from, page)
 {
     m_Entry    = entry;
     m_MainPage = mainpage;
 }
Beispiel #10
0
 public AssignGump(Mobile from, TrackerEntry entry, int page, int mainpage)
     : base(from, page)
 {
     m_Entry    = entry;
     m_MainPage = mainpage;
 }