コード例 #1
0
ファイル: tasks.aspx.cs プロジェクト: jaytem/minGit
    private void Display_ViewTask()
    {
        pnlViewTask.Visible = true;
        if (!string.IsNullOrEmpty(Request.QueryString["ty"]))
        {
            fromType = Request.QueryString["ty"];
        }
        if (!string.IsNullOrEmpty(Request.QueryString["tid"]))
        {
            TaskID = Convert.ToInt64(Request.QueryString["tid"]);
        }
        if (!string.IsNullOrEmpty(Request.QueryString["fromViewContent"]))
        {
            fromViewContent = Request.QueryString["fromViewContent"];
        }
        objTask = AppUI.EkTaskRef;
        objTask = objTask.GetTaskByID(TaskID);
        callBackPage = BuildCallBackParms("&");
        StringBuilder sbToolBar = new StringBuilder();

        string backpage = "";
        if (Request.QueryString["callbackpage"] != null && Request.QueryString["callbackpage"].ToString().ToLower() == "tasks.aspx")
        {
            backpage = "tasks.aspx?action=ViewTasks&orderby=" + OrderBy + "&ty=" + EkFunctions.HtmlEncode(Request.QueryString["ty"]);
        }
        else
        {
            backpage = "javascript:history.back();";
        }

        sbToolBar.Append(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", backpage, MsgHelper.GetMessage("alt back button"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));

        bool primaryCssApplied = false;

        if (fromViewContent == "" & fromType != "created" & (fromType != "touser") | (objTask.TaskTypeID == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.TaskType.BlogPostComment)))
        {
            sbToolBar.Append(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/contentEdit.png", "tasks.aspx?action=EditTask&tid=" + TaskID + callBackPage, "Edit Task", MsgHelper.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }
        if (Convert.ToBoolean(canI["CanIDeleteTask"]) & fromViewContent != null & fromType != "created" & fromType != "touser")
        {
            string frmContentPage = (!string.IsNullOrEmpty(Request.QueryString["fromViewContent"]) ? "&fromViewContent=1" : "");
            string frmContentId = (!string.IsNullOrEmpty(Request.QueryString["contentid"]) ? "&contentid=" + Request.QueryString["contentid"].ToString() : "");
            string frmFolderId = (!string.IsNullOrEmpty(Request.QueryString["folderid"]) ? "&folderid=" + Request.QueryString["folderid"].ToString() : "");
            sbToolBar.Append(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/delete.png", "tasks.aspx?action=DeleteTask" + closeOnFinish + "&tid=" + TaskID + "&ty=" + actiontype + callBackPage + frmContentPage + frmContentId + frmFolderId, "Delete Task", MsgHelper.GetMessage("btn delete"), "onclick=\"return ConfirmDelete();\"", StyleHelper.DeleteButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        sbToolBar.Append(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/commentAdd.png", "javascript:openComment('');", "Add Comment", MsgHelper.GetMessage("btn comment add"), "", StyleHelper.AddCommentButtonCssClass, !primaryCssApplied));

        primaryCssApplied = true;

        if (fromType != "created" & fromType != "touser")
        {
            sbToolBar.Append(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/history.png", "#", MsgHelper.GetMessage("alt history button text"), MsgHelper.GetMessage("lbl generic history"), "onclick=\"openTaskHistory('taskhistory.aspx?action=ID&tid=" + objTask.TaskID + "&title=" + objTask.TaskTitle.Replace("'", "'").Replace("'", "'") + "');return false;\"", StyleHelper.HistoryButtonCssClass));
        }
        sbToolBar.Append(StyleHelper.ActionBarDivider);
        sbToolBar.Append("<td>" + m_refStyle.GetHelpButton(action, "") + "</td>");
        ltrViewTaskToolBar.Text = sbToolBar.ToString();
        StringBuilder sbAssignedTo = new StringBuilder();
        if (objTask.AssignToUserGroupID == 0)
        {
            sbAssignedTo.Append("All Authors");
        }
        else if (objTask.AssignedToUser != string.Empty)
        {
            sbAssignedTo.Append("<img src=\"" + AppPath + "images/UI/Icons/user.png\" alt=\"\" align=\"absbottom\"/>");
            sbAssignedTo.Append(m_refEmail.MakeUserTaskEmailLink(objTask, true));
        }
        else if (objTask.AssignedToUserGroup != string.Empty)
        {
            sbAssignedTo.Append("<img src=\"" + AppPath + "images/UI/Icons/users.png\" alt=\"\" align=\"absbottom\"/>");
            sbAssignedTo.Append(m_refEmail.MakeUserGroupTaskEmailLink(objTask));
        }
        ltrAssignedTo.Text = sbAssignedTo.ToString();

        StringBuilder sbLinks = new StringBuilder();
        if (objTask.ContentID > -1)
        {
            sbLinks.Append("<tr>");
            sbLinks.Append("<td class=\"label\" title=\"Content\">" + MsgHelper.GetMessage("content text") + ":</td>");
            if (objTask.ContentType == EkEnumeration.CMSContentType.Forms | objTask.ContentType == EkEnumeration.CMSContentType.Archive_Forms)
            {
                sbLinks.Append("<td>");
                sbLinks.Append("(" + objTask.ContentID + ")&nbsp;<a href=\"cmsform.aspx?action=ViewForm&form_id=" + objTask.ContentID + "&LangType=" + objTask.LanguageID + "\" title=\"" + MsgHelper.GetMessage("generic View") + " " + objTask.ContentTitle.Replace("'", "`") + "\">" + objTask.ContentTitle + "</a>");
                sbLinks.Append("</td>");
            }
            else
            {
                sbLinks.Append("<td>");
                sbLinks.Append("(" + objTask.ContentID + ")&nbsp;<a href=\"content.aspx?action=View&id=" + objTask.ContentID + "&LangType=" + objTask.LanguageID + "\" title=\"" + MsgHelper.GetMessage("generic View") + " " + objTask.ContentTitle.Replace("'", "`") + "\">" + objTask.ContentTitle + "</a>");
                sbLinks.Append("</td>");
            }

            sbLinks.Append("</tr>");
            ltrViewTaskLinks.Text = sbLinks.ToString();
        }
        switch (objTask.Priority)
        {
            case EkEnumeration.TaskPriority.High:
                ltrViewTaskPriority.Text = "<td>"+this.MsgHelper.GetMessage("lbl high")+"</td>";
                break;
            case EkEnumeration.TaskPriority.Low:
                ltrViewTaskPriority.Text = "<td>" + this.MsgHelper.GetMessage("lbl low") + "</td>";
                break;
            case EkEnumeration.TaskPriority.Normal:
                ltrViewTaskPriority.Text = "<td>" + this.MsgHelper.GetMessage("lbl normal") + "</td>";
                break;
            default:
                ltrViewTaskPriority.Text = "<td>" + this.MsgHelper.GetMessage("dd not specified") + "</td>";
                break;
        }
        switch (objTask.State)
        {
            case "1":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl not started");
                break;
            case "2":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl active");
                break;
            case "3":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl awaiting data");
                break;
            case "4":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl on hold");
                break;
            case "5":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl pending");
                break;
            case "6":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl reopened");
                break;
            case "7":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl completed");
                break;
            case "8":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl archived");
                break;
            case "9":
                ltrViewTaskState.Text = this.MsgHelper.GetMessage("lbl deleted");
                break;

        }
        if (objTask.Description != string.Empty)
        {
            ltrViewTaskDescription.Text = objTask.Description;
        }
        else
        {
            ltrViewTaskDescription.Text = "[" + this.MsgHelper.GetMessage("dd not specified") + "]";
        }

        switch (OrderBy)
        {
            case "date_created asc":
                ltrViewTaskComments.Text = "<td><a href=\"javascript: DoSort('date_created desc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by DateTime") + "\">" + MsgHelper.GetMessage("lbl date/time") + "</a></td><td width=\"20%\"><a href=\"javascript: DoSort('last_name asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by LastName") + "\">" + MsgHelper.GetMessage("lbl added by") + "</a></td><td width=\"65%\" style=\"color: #2e6e9e;\">" + MsgHelper.GetMessage("comments label") + "</td>";
                break;
            case "date_created desc":
                ltrViewTaskComments.Text = "<td><a href=\"javascript: DoSort('date_created asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by DateTime") + "\">" + MsgHelper.GetMessage("lbl date/time") + "</a></td><td width=\"20%\"><a href=\"javascript: DoSort('last_name asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by LastName") + "\">" + MsgHelper.GetMessage("lbl added by") + "</a></td><td width=\"65%\" style=\"color: #2e6e9e;\">" + MsgHelper.GetMessage("comments label") + "</td>";
                break;
            case "last_name ascc":
                ltrViewTaskComments.Text = "<td><a href=\"javascript: DoSort('date_created asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by DateTime") + "\">" + MsgHelper.GetMessage("lbl date/time") + "</a></td><td width=\"20%\"><a href=\"javascript: DoSort('last_name desc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by LastName") + "\">" + MsgHelper.GetMessage("lbl added by") + "</a></td><td width=\"65%\" style=\"color: #2e6e9e;\">" + MsgHelper.GetMessage("comments label") + "</td>";
                break;
            case "last_name desc":
                ltrViewTaskComments.Text = "<td><a href=\"javascript: DoSort('date_created asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by DateTime") + "\">" + MsgHelper.GetMessage("lbl date/time") + "</a></td><td width=\"20%\"><a href=\"javascript: DoSort('last_name asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by LastName") + "\">" + MsgHelper.GetMessage("lbl added by") + "</a></td><td width=\"65%\" style=\"color: #2e6e9e;\">" + MsgHelper.GetMessage("comments label") + "</td>";
                break;
            default:
                ltrViewTaskComments.Text = "<td><a href=\"javascript: DoSort('date_created asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by DateTime") + "\">" + MsgHelper.GetMessage("lbl date/time") + "</a></td><td width=\"20%\"><a href=\"javascript: DoSort('last_name asc');\" title=\"" + MsgHelper.GetMessage("lbl Sort by LastName") + "\">" + MsgHelper.GetMessage("lbl added by") + "</a></td><td width=\"65%\" style=\"color: #2e6e9e;\">" + MsgHelper.GetMessage("comments label") + "</td>";
                break;
        }
    }
コード例 #2
0
ファイル: tasks.aspx.cs プロジェクト: jaytem/minGit
 private void Process_ApproveTask()
 {
     objTask = AppUI.EkTaskRef;
     long taskid = Convert.ToInt64(Request.QueryString["tid"]);
     objTask = objTask.GetTaskByID(taskid);
     objTask.State = Convert.ToString(Ektron.Cms.Common.EkEnumeration.TaskState.Completed);
     ret = objTask.UpdateTask();
     if (Request.QueryString["close"] == "true")
     {
         callBackPage = "close.aspx";
     }
     else if (!string.IsNullOrEmpty(Request.QueryString["contentid"]))
     {
         callBackPage = "content.aspx?id=" + Request.QueryString["blogid"] + "&action=ViewContentByCategory&LangType=" + AppUI.ContentLanguage + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + Request.QueryString["contentid"];
     }
     else
     {
         callBackPage = "content.aspx?id=" + Request.QueryString["blogid"] + "&action=ViewContentByCategory&LangType=" + AppUI.ContentLanguage + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments;
     }
     if ((ret))
     {
         Response.Redirect("reterror.aspx?info=" + actErrorString);
     }
     else
     {
         Response.Redirect(callBackPage);
     }
 }
コード例 #3
0
ファイル: taskhistory.aspx.cs プロジェクト: jaytem/minGit
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        MsgHelper = new EkMessageHelper(appUI.RequestInformationRef);
        if (appUI.RequestInformationRef.IsMembershipUser == 1 || appUI.RequestInformationRef.UserId == 0)
        {
            Response.Redirect(appUI.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(MsgHelper.GetMessage("msg login cms user")), false);
            return;
        }
        taskObj = new EkTask(appUI.RequestInformationRef);
        taskHistoryObj = new EkTaskHistory(appUI.RequestInformationRef);
        CurrentUserID = appUI.UserId;
        EnableMultilingual = appUI.EnableMultilingual;
        AppPath = appUI.AppPath;
        AppImgPath = appUI.AppImgPath;
        SitePath = appUI.SitePath;
        AppeWebPath = appUI.AppeWebPath;
        AppName = appUI.AppName;
        if(!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            appUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        }
        else
        {
            if(!string.IsNullOrEmpty(appUI.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = Convert.ToInt32(appUI.GetCookieValue("LastValidLanguageID"));
            }
        }
        appUI.ContentLanguage = ContentLanguage;
        if (!string.IsNullOrEmpty(Request.QueryString["tid"]))
        {
            TaskID = Convert.ToInt64(Request.QueryString["tid"]);
        }
        if(!string.IsNullOrEmpty(Request.QueryString["starttime"]))
        {
            StartTime = Request.QueryString["starttime"].ToString();
        }
        if(!string.IsNullOrEmpty(Request.QueryString["endtime"]))
        {
            EndTime = Request.QueryString["endtime"].ToString();
        }
        if(!string.IsNullOrEmpty(Request.QueryString["action"]))
        {
            action = Request.QueryString["action"].ToString();
        }
        if (!string.IsNullOrEmpty(Request.QueryString["title"]))
        {
            TaskTitle = Request.QueryString["title"].ToString();
        }
        else
        {
            TaskTitle = taskObj.GetTaskByID(TaskID).TaskTitle;
        }
        if(!string.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            OrderBy = Request.QueryString["orderby"].ToString();
        }
        taskHistoryObj = appUI.EkTaskhistoryRef;

        if (action == "ID")
        {
            taskHistoryCollection = (Ektron.Cms.Content.EkTaskHistoryCol)taskHistoryObj.GetTaskHistoryForTaskID(TaskID, OrderBy);
            ltrTitleBar.Text = "View Task History for " + TaskTitle;
        }
        else
        {
            taskHistoryCollection = (Ektron.Cms.Content.EkTaskHistoryCol)taskHistoryObj.GetTaskHistoryForTime(StartTime, EndTime, OrderBy);
            ltrTitleBar.Text = "View Task History for " + TaskTitle + " from Start time " + StartTime + " to End time " + EndTime;
        }
        if (taskHistoryCollection != null && taskHistoryCollection.Count > 0)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 1; i < taskHistoryCollection.Count; i++)
            {
                sb.Append("<tr>");
                sb.Append("<td>" + appUI.GetInternationalDateOnly(taskHistoryCollection.get_Item(i).ChangeDate) + "</td>");
                sb.Append("<td>" + taskHistoryCollection.get_Item(i).InitiatorName + "</td>");
                sb.Append("<td>" + taskHistoryCollection.get_Item(i).Activity + "</td>");
                sb.Append("<td>" + taskHistoryCollection.get_Item(i).Instruction + "</td>");
                sb.Append("</tr>");
            }
            ltrTasks.Text = sb.ToString();
        }

        this.Page.Title = AppName + " TaskHistory";

        RegisterResources();
    }