Exemple #1
0
 protected void SelectAllCategory()
 {
     objTaskType = AppUI.EkTaskTypeRef;
     colAllCategory = objTaskType.SelectAllCategory();
     if (colAllCategory == null)
     {
         CheckErrorString("Task Type: SelectAllCategory");
     }
 }
Exemple #2
0
 protected void Page_Init(System.Object sender, System.EventArgs e)
 {
     EnableMultilingual = AppUI.EnableMultilingual;
     cContObj = new EkContent(m_refContentApi.RequestInformationRef);
     objTask = new EkTask(m_refContentApi.RequestInformationRef);
     MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef);
     objTaskType = new Ektron.Cms.Content.EkTaskType(m_refContentApi.RequestInformationRef);
     usrObj = new Ektron.Cms.User.EkUser(m_refContentApi.RequestInformationRef);
     GenerateJS();
     ltrStyleHelper.Text = m_refStyle.GetClientScript();
     ltrEmailScript.Text = m_EmailHelper.EmailJS();
     FillLiterals();
     ctlEditor = (Ektron.ContentDesignerWithValidator)LoadControl("controls/Editor/ContentDesignerWithValidator.ascx");
     ctlEditor.ID = "description";
     ctlEditor.AllowScripts = true;
     ctlEditor.Height = new Unit(450, UnitType.Pixel);
     ctlEditor.Width = new Unit(100, UnitType.Percentage);
     ctlEditor.ToolsFile = m_refContentApi.ApplicationPath + "ContentDesigner/configurations/InterfaceTask.xml";
     ctlEditor.AllowFonts = true;
     ctlEditor.ShowHtmlMode = false;
     ctlEditor.Stylesheet = m_refContentApi.ApplicationPath + "csslib/ewebeditprostyles.css";
     RegularExpressionValidator ctlValidator = new RegularExpressionValidator();
     Ektron.Cms.Common.EkMessageHelper m_refMsg = m_refSiteApi.EkMsgRef;
     ctlValidator.ID = "RegExpValidator";
     ctlValidator.ControlToValidate = "description";
     ctlValidator.ErrorMessage = m_refMsg.GetMessage("content size exceeded");
     ctlValidator.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(int.Parse(iMaxContLength));
     Action = EkFunctions.HtmlEncode(Request.QueryString["action"]);
     if ("AddTask" == Action)
     {
         AddTaskValidatorHolder.Controls.Add(ctlValidator);
         AddTaskEditorHolder.Controls.Add(ctlEditor);
     }
     else if ("EditTask" == Action)
     {
         EditTaskValidatorHolder.Controls.Add(ctlValidator);
         EditTaskEditorHolder.Controls.Add(ctlEditor);
     }
     if (Request.QueryString["page"] != null)
     {
         CurrentPage = EkFunctions.ReadIntegerValue(Request.QueryString["page"], 1);
     }
 }
Exemple #3
0
 private void NewTaskTypeObj()
 {
     objTaskType = null;
     objTaskType = AppUI.EkTaskTypeRef;
 }
Exemple #4
0
 private void Process_DeleteTaskType()
 {
     ValidateCanDeleteTask();
     string[] aTaskTypeID = null;
     aTaskTypeID = Request.Form["tasktype_ids"].ToString().Split(',');
     objTaskType = AppUI.EkTaskTypeRef;
     for (int i = 0; i < aTaskTypeID.Length; i++)
     {
         objTaskType.DeleteTaskType(Convert.ToInt64(aTaskTypeID[i].ToString()));
     }
     Response.Redirect("tasks.aspx?action=ViewTaskType");
 }
Exemple #5
0
    protected string DisplayTaskType(string strTaskAction)
    {
        if (TaskID > 0)
            objTask = objTask.GetTaskByID(TaskID);
        StringBuilder sbDisplayTaskType = new StringBuilder();
        objTaskType = null;
        Collection coll;
        if (objTask != null & objTask.TaskTypeID > 0)
        {
            objTaskType = AppUI.EkTaskTypeRef;
            coll = objTaskType.GetCategoryByTaskTypeID(objTask.TaskTypeID);
            if (CollectionNotEmpty(coll))
            {
                if (Convert.ToInt32(coll["active"]) > 1)
                {
                    strTaskAction = "ViewTask";
                }
            }
        }
        sbDisplayTaskType.Append("<tr>");
        sbDisplayTaskType.Append(" <td class=\"label\">" + MsgHelper.GetMessage("lbl task category") + ":&nbsp;</td>");
        sbDisplayTaskType.Append(" <td class=\"value\">");
        sbDisplayTaskType.Append("  <table width=\"100%\">");
        sbDisplayTaskType.Append("     <td>");

        switch (strTaskAction)
        {
            case "AddTask":
            case "EditTask":
                switch (objTask.TaskTypeID)
                {
                    case (long)EkEnumeration.TaskType.BlogPostComment:
                        sbDisplayTaskType.Append("<select name=\"task_category\" ID=\"task_category\" disabled=\"true\"><option>Blog</option></select>");
                        break;
                    case (long)EkEnumeration.TaskType.TopicReply:
                        sbDisplayTaskType.Append("<select name=\"task_category\" ID=\"task_category\" disabled=\"true\"><option>" + MsgHelper.GetMessage("lbl reply") + "</option></select>");
                        break;
                    default:
                        sbDisplayTaskType.Append("<select name=\"task_category\" ID=\"task_category\" onchange=\"DisplayTaskTypeDropDown('" + strTaskAction + "Form" + "');\">");
                        sbDisplayTaskType.Append("</select>");
                        sbDisplayTaskType.Append("<script type=\"text/javascript\">DisplayTaskCategoryDropDown('" + strTaskAction + "Form" + "');</" + "script>");
                        break;
                }
                break;
            case "ViewTask":
                if (!(objTask.TaskTypeID == ((long)EkEnumeration.TaskType.BlogPostComment | (long)EkEnumeration.TaskType.TopicReply)))
                {
                    if ((objTask != null) & objTask.TaskTypeID > 0)
                    {
                        objTaskType = AppUI.EkTaskTypeRef;
                        coll = objTaskType.GetCategoryByTaskTypeID(objTask.TaskTypeID);
                        if (CollectionNotEmpty(coll))
                        {
                            sbDisplayTaskType.Append("<input type=\"hidden\" name=\"task_category\" value=\"" + coll["task_type_id"] + "\">");
                            sbDisplayTaskType.Append(coll["task_type_title"]);
                        }
                        else
                        {
                            CheckErrorString("Task Type: GetCategoryByTaskTypeID");
                        }
                    }
                    else
                    {
                        sbDisplayTaskType.Append("[" + MsgHelper.GetMessage("dd not specified") + "]");
                    }
                }
                else
                {
                    sbDisplayTaskType.Append("Blog");
                }
                break;
        }

        if ("EditTask" == strTaskAction)
        {
            if ((objTask != null) & objTask.TaskTypeID > 0)
            {
                objTaskType = AppUI.EkTaskTypeRef;
                coll = objTaskType.GetCategoryByTaskTypeID(objTask.TaskTypeID);
                if (CollectionNotEmpty(coll))
                {
                    sbDisplayTaskType.Append("<script type=\"text/javascript\">SelectTaskCategoryDropDown('" + strTaskAction + "Form" + "', " + coll["task_type_id"] + ") ;</" + "script>");
                }
                else
                {
                    CheckErrorString("Task Type: GetCategoryByTaskTypeID");
                }
            }
        }

        sbDisplayTaskType.Append(MsgHelper.GetMessage("lbl task type") + ":");

        switch (strTaskAction)
        {
            case "AddTask":
            case "EditTask":
                switch (Convert.ToInt64(objTask.TaskTypeID))
                {
                    case (long)EkEnumeration.TaskType.BlogPostComment:
                        sbDisplayTaskType.Append("<select name=\"task_type\" ID=\"task_type\" disabled=\"true\"><option selected value=\"" + EkEnumeration.TaskType.BlogPostComment + "\">Blog Post Comment</option>\t");
                        sbDisplayTaskType.Append("</select><input type=\"hidden\" name=\"task_type_\" ID=\"task_type_\" value=\"" + EkEnumeration.TaskType.BlogPostComment + "\"/>");
                        break;
                    case (long)EkEnumeration.TaskType.TopicReply:
                        sbDisplayTaskType.Append("<select name=\"task_type\" ID=\"task_type\" disabled=\"true\"><option selected value=\"" + EkEnumeration.TaskType.TopicReply + "\">" + MsgHelper.GetMessage("lbl topicreply") + "</option>\t");
                        sbDisplayTaskType.Append("</select><input type=\"hidden\" name=\"task_type_\" ID=\"task_type_\" value=\"" + EkEnumeration.TaskType.TopicReply + "\"/>");
                        break;
                    default:
                        sbDisplayTaskType.Append("<select name=\"task_type\" ID=\"task_type\">\t");
                        sbDisplayTaskType.Append("</select>\t");
                        sbDisplayTaskType.Append("<script type=\"text/javascript\">DisplayTaskTypeDropDown('" + strTaskAction + "Form" + "');</" + "script>");
                        break;
                }
                break;
            case "ViewTask":
                if ((objTask != null) & objTask.TaskTypeID > 0)
                {
                    objTaskType = AppUI.EkTaskTypeRef;
                    coll = objTaskType.GetTaskTypeByID(objTask.TaskTypeID);
                    if (CollectionNotEmpty(coll))
                    {
                        sbDisplayTaskType.Append("<input type=\"hidden\" name=\"task_type\" value=\"" + coll["task_type_id"] + "\">");
                        sbDisplayTaskType.Append(coll["task_type_title"]);
                    }
                    else
                    {
                        CheckErrorString("Task Type: GetTaskTypeByID");
                    }
                }
                else
                {
                    sbDisplayTaskType.Append("[" + MsgHelper.GetMessage("dd not specified") + "]");
                }
                break;
        }

        if ("EditTask" == strTaskAction)
        {
            if ((objTask != null) & objTask.TaskTypeID > 0)
            {
                sbDisplayTaskType.Append("<script type=\"text/javascript\">SelectTaskTypeDropDown('" + strTaskAction + "Form" + "', " + objTask.TaskTypeID + ") ;</" + "script>");
            }
        }

        switch (strTaskAction)
        {
            case "AddTask":
            case "EditTask":
                if (!(Convert.ToInt64(objTask.TaskTypeID) == ((long)EkEnumeration.TaskType.BlogPostComment | (long)EkEnumeration.TaskType.TopicReply)))
                {
                    sbDisplayTaskType.Append(MakeTaskTypeLink(strTaskAction));
                }
                break;
        }

        sbDisplayTaskType.Append("</td>");
        sbDisplayTaskType.Append("</table>");
        sbDisplayTaskType.Append("</td>");
        sbDisplayTaskType.Append("</tr>");
        return sbDisplayTaskType.ToString();
    }