private void Display_AddTask() { ValidateCanCreateTask(); GetAddTaskToolBar(); Collection cConts = new Collection(); string retString = string.Empty; pnlAddTask.Visible = true; StringBuilder sbAddTask = new StringBuilder(); objTask = AppUI.EkTaskRef; jsId.Text = Convert.ToString(ContentId); if (ContentId > 0) { objTask.LanguageID = objTask.ContentLanguage; cConts = cContObj.GetContentByIDv2_0(ContentId); if (cConts.Count == 0) { retString = MsgHelper.GetMessage("error: content does not exist") + " " + ContentId; } else { content_title = cConts["ContentTitle"].ToString(); objTask.ContentID = ContentId; objTask.ContentTitle = content_title; } } if (retString != string.Empty) { Response.Redirect("reterror.aspx?info=" + retString, false); } sbAddTask.Append("<tr>"); sbAddTask.Append(" <td class=\"label\" title=\"Assigned to\"> " + MsgHelper.GetMessage("lbl Assigned to") + "</td>"); sbAddTask.Append(" <td class=\"value\">"); if (IsBrowserNS4()) { sbAddTask.Append("<input type=\"text\" title=\"Enter Name here\" name=\"nsfourname\" size=\"15\" value=\"\" id=\"assigned_to\"/>"); if (Convert.ToBoolean(canI["CanIRedirectTask"])) { sbAddTask.Append("<a title=\"Select user email report\" class=\"button buttonInline greenHover minHeight buttonCheckAll\" href=\"#\" onclick=\"ShowUsers();\">" + MsgHelper.GetMessage("select user email report") + "</a>"); } } else { sbAddTask.Append("<div id=\"user\" style=\"display: none;\"></div>"); if (Convert.ToBoolean(canI["CanIRedirectTask"])) { sbAddTask.Append("<a title=\"Select user or group\" href=\"#\" class=\"button buttonInline greenHover minHeight buttonCheckAll\" onclick=\"ShowUsers();\">" + MsgHelper.GetMessage("select user email report") + "</a>"); } sbAddTask.Append("<div id=\"nouser\" style=\"display: block;\"></div>"); } sbAddTask.Append(" </td>"); sbAddTask.Append("</tr>"); if (Convert.ToBoolean(AppUI.EnableMultilingual)) { sbAddTask.Append("<tr>"); sbAddTask.Append(" <td class=\"label\" title=\"Language\">" + MsgHelper.GetMessage("res_lngsel_lbl") + "</td>"); sbAddTask.Append(" <td class=\"value\">"); sbAddTask.Append(" <select name=\"language\" id=\"language\""); if (ContentId > 0) { sbAddTask.Append(" disabled=\"true\" "); } sbAddTask.Append("> "); for (int i = 0; i < colActiveLanguages.Count; i++) { Hashtable coll = (Hashtable)colActiveLanguages[i]; sbAddTask.Append(" <option value=\"" + coll["ID"] + "\""); if (objTask.LanguageID == Convert.ToInt32(coll["ID"])) { sbAddTask.Append(" selected "); } sbAddTask.Append(">" + coll["Name"]); sbAddTask.Append(" </option>"); } sbAddTask.Append(" </select>"); sbAddTask.Append(" </td>"); sbAddTask.Append("</tr>"); } if (ContentId > 0) { sbAddTask.Append("<tr>"); sbAddTask.Append(" <td class=\"label\" title=\"Content\">" + MsgHelper.GetMessage("content content label") + "</td>"); sbAddTask.Append(" <td class=\"value\">" + ContentId + " " + content_title + "</td>"); sbAddTask.Append("</tr>"); } else { sbAddTask.Append("<tr>"); sbAddTask.Append(" <td class=\"label\" title=\"Content\">" + MsgHelper.GetMessage("content content label") + "</td>"); sbAddTask.Append(" <td class=\"value\">"); if (IsBrowserNS4()) { sbAddTask.Append(" <input type=\"text\" title=\"Enter Content Text here\" name=\"nsfourname\" size=\"15\" value=\"Change\" id=\"contentidspan\"/><a title=\"Select All\" class=\"button buttonInline greenHover minHeight minHeight buttonCheckAll\" href=\"#\" onclick=\"LoadChildPage();return true;\">Select</a>"); } else { sbAddTask.Append(" <div id=\"Div2\" style=\"display: none;\"></div><div id=\"contentidspan\" style=\"display: inline-block;\"><a title=\"Select All\" class=\"button buttonInline greenHover minHeight buttonCheckAll\" href=\"#\" onclick=\"LoadChildPage();return true;\">" + MsgHelper.GetMessage("generic select") + "</a></div><a title=\"Change\" class=\"button buttonInline greenHover minHeight buttonEdit\" href=\"#\" id=\"a_change\" name=\"a_change\" style=\"visibility: hidden;\" onclick=\"LoadChildPage();return true;\">Change</a> <a title=\"Clear\" href=\"#\" class=\"button buttonInline redHover minHeight\" id=\"a_none\" name=\"a_none\" style=\"visibility: hidden;\" onclick=\"UnSelectContent();return true;\">Clear</a>"); } sbAddTask.Append(" </td>"); sbAddTask.Append("</tr>"); } sbAddTask.Append("<tr>"); sbAddTask.Append(" <td class=\"label\">" + MsgHelper.GetMessage("lbl priority") + "</td>"); sbAddTask.Append(" <td class=\"value\">"); sbAddTask.Append(" <select name=\"priority\" ID=\"priority\">"); sbAddTask.Append(" <option value=\"1\""); if (Convert.ToInt32(objTask.Priority) == 1) { sbAddTask.Append(" selected "); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl low") + "</option>"); sbAddTask.Append(" <option value=\"2\""); if (Convert.ToInt32(objTask.Priority) == 2) { sbAddTask.Append(" selected "); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl normal") + "</option>"); sbAddTask.Append(" <option value=\"3\""); if (Convert.ToInt32(objTask.Priority) == 3) { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl high") + "</option>"); sbAddTask.Append(" </select>"); sbAddTask.Append(" </td>"); sbAddTask.Append("</tr>"); sbAddTask.Append(DisplayTaskType(action)); sbAddTask.Append("<tr>"); sbAddTask.Append(" <td class=\"label\">" + MsgHelper.GetMessage("lbl state") + ":</td>"); sbAddTask.Append(" <td class=\"value\">"); if (objTask.ContentID != -1) { sbAddTask.Append("<select name=\"state\" disabled id=\"state\">"); } else { sbAddTask.Append("<select name=\"state\" id=\"state\">"); } sbAddTask.Append(" <option title=\"Not started\" value=\"1\" "); if (objTask.State == "NotStarted") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl not started") + "</option>"); sbAddTask.Append("<option title=\"Active\" value=\"2\""); if (objTask.State == "Active") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl active") + "</option>"); sbAddTask.Append("<option title=\"Awaiting Data\" value=\"3\""); if (objTask.State == "AwaitingData") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbAddTask.Append("<option title=\"On Hold\" value=\"4\""); if (objTask.State == "OnHold") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl on hold") + "</option>"); sbAddTask.Append("<option title=\"Pending\" value=\"5\""); if (objTask.State == "Pending") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl pending") + "</option>"); sbAddTask.Append("<option title=\"Reopened\" value=\"6\""); if (objTask.State == "Reopened") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl reopened") + "</option>"); sbAddTask.Append("<option title=\"Completed\" value=\"7\""); if (objTask.State == "Completed") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl completed") + "</option>"); sbAddTask.Append("<option title=\"Archived\" value=\"8\""); if (objTask.State == "Archived") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl archived") + "</option>"); sbAddTask.Append("<option title=\"Deleted\" value=\"9\""); if (objTask.State == "Deleted") { sbAddTask.Append(" selected"); } sbAddTask.Append(">" + MsgHelper.GetMessage("lbl deleted") + "</option>"); sbAddTask.Append(" </select>"); sbAddTask.Append(" </td>"); sbAddTask.Append("</tr>"); ltrAddTask.Text = sbAddTask.ToString(); usrObj = AppUI.EkUserRef; cUserInfo = usrObj.GetUserByIDv2_0(currentUserID, false); StringBuilder sbScript = new StringBuilder(); if (Convert.ToBoolean(canI["CanIRedirectTask"])) { sbScript.Append("selectUser('1', '" + currentUserID + "', '" + cUserInfo["UserName"] + "',1);"); } else { sbScript.Append("selectUser('1', '" + currentUserID + "', '" + cUserInfo["UserName"] + "',0);"); } Ektron.Cms.API.JS.RegisterJSBlock(this, sbScript.ToString(), "EktronTasksSelectUserJS"); }
protected void Page_Load(System.Object sender, System.EventArgs e) { ApplicationAPI AppUI = new ApplicationAPI(); EkContent cContObj = new EkContent(AppUI.RequestInformationRef); taskObj = new EkTask(AppUI.RequestInformationRef); long cid; string[] tasksArray; int lCounter; string RefType; long CurrentUserID; string AppPath; string AppImgPath; string SitePath; string AppeWebPath; long CommentKeyId = 0; long CommentId = 0; string Action; object ActionType; object IsMac; object platform; bool Flag; object retVal; object CommentText; object NS4; object OrderBy; object iMaxContLength; object localeFileString; object var1; object var2; string taskIDs; object height; object width; int EnableMultilingual; int ContentLanguage; Ektron.Cms.Common.EkMessageHelper MsgHelper; System.Text.StringBuilder sbScript = new System.Text.StringBuilder(); MsgHelper = AppUI.EkMsgRef; AppPath = AppUI.AppPath; AppImgPath = AppUI.AppImgPath; SitePath = AppUI.SitePath; AppeWebPath = AppUI.AppeWebPath; AppPath = AppUI.AppPath; AppName = AppUI.AppName; EnableMultilingual = AppUI.EnableMultilingual; ContentLanguage = 1033; //set default value if (!Utilities.ValidateUserLogin()) { return; } if (Convert.ToBoolean(AppUI.RequestInformationRef.IsMembershipUser)) { Response.Redirect("reterror.aspx?info=" + MsgHelper.GetMessage("msg login cms user"), false); return; } 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")); } } platform = Request.ServerVariables["HTTP_USER_AGENT"]; if (platform.ToString().IndexOf("Windows") + 1 > 0) { IsMac = 0; } else { IsMac = 1; } RefType = "T"; Flag = false; iMaxContLength = 65000; localeFileString = "0000"; var1 = Request.ServerVariables["SERVER_NAME"]; if (!string.IsNullOrEmpty(Request.QueryString["commentkey_id"])) { CommentKeyId = Convert.ToInt64(Request.QueryString["commentkey_id"]); } Action = Request.QueryString["action"]; ActionType = Request.QueryString["ty"]; OrderBy = Request.QueryString["orderby"]; cid = Convert.ToInt64(Request.QueryString["id"]); if (!string.IsNullOrEmpty(Request.QueryString["Comment_Id"])) { CommentId = Convert.ToInt64(Request.QueryString["Comment_Id"]); } if (!string.IsNullOrEmpty((Request.QueryString["height"]))) { height = Convert.ToDouble(Request.QueryString["height"]); } if (!string.IsNullOrEmpty((Request.QueryString["width"]))) { width = Convert.ToDouble(Request.QueryString["width"]); } lCounter = 0; CurrentUserID = AppUI.UserId; ltrComments.Text = MsgHelper.GetMessage("lbl task comment") + ":"; if (Request.QueryString["action"] != null && Request.QueryString["action"].ToString().ToLower() == "declinecontentaction") ltrComments.Text = MsgHelper.GetMessage("reason to decline"); cContObj = AppUI.EkContentRef; if (Request.ServerVariables["http_user_agent"].ToString().IndexOf("Mozilla") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("4.7") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("GECKO") < 0) { NS4 = true; } else { NS4 = false; } var2 = cContObj.GetEditorVariablev2_0(0, "tasks"); ctlEditor.Validate(); if (Action == "Add" && ctlEditor.IsValid) { CommentText = this.ctlEditor.Content; if (cid != 0) { //Get all tasks associated with the content and add same comment taskObj = AppUI.EkTaskRef; object strStates; strStates = EkEnumeration.TaskState.NotStarted.ToString() + "," + EkEnumeration.TaskState.Active.ToString() + "," + EkEnumeration.TaskState.AwaitingData.ToString() + "," + EkEnumeration.TaskState.OnHold.ToString() + "," + EkEnumeration.TaskState.Pending.ToString() + "," + EkEnumeration.TaskState.Reopened.ToString(); taskIDs = taskObj.GetTaskIDs(cid, strStates, -1, (int)EkEnumeration.CMSTaskItemType.TasksByStateAndContentID); if (taskIDs != "") { tasksArray = Strings.Split(taskIDs.ToString(), ",", -1, 0); while (lCounter <= (tasksArray.Length - 1)) { retVal = cContObj.AddComment(Convert.ToInt64(CommentKeyId), Convert.ToInt64(CommentId), Convert.ToInt64(tasksArray.GetValue(lCounter)), RefType, CurrentUserID, Strings.Replace(CommentText.ToString(), "\'", "\'\'", 1, -1, 0)); lCounter++; } } } Flag = true; } if (true == Flag) { sbScript.Append("<script language=\"JavaScript\" type=\"text/javascript\">" + "\r\n"); sbScript.Append("<!--"); sbScript.Append("if (IsBrowserIE())"); sbScript.Append("{"); sbScript.Append(" parent.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + \"&id=\" + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );"); sbScript.Append("}"); sbScript.Append("else"); sbScript.Append("{"); sbScript.Append(" top.opener.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + " + ID == " + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );"); sbScript.Append(" close();"); sbScript.Append("}"); sbScript.Append("//-->"); sbScript.Append("</script>" + "\r\n"); ClosePanel.Text = sbScript.ToString(); } if ((Request.QueryString["action"]) == "Add") { actionName.Value = Request.QueryString["actionName"]; } else { actionName.Value = Request.QueryString["action"]; } this.ctlEditor.AllowFonts = true; ctlEditor.ErrorMessage = MsgHelper.GetMessage("content size exceeded"); ctlEditor.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(System.Convert.ToInt32(iMaxContLength)); }
private void Process_UpdateStatePurge() { int State = Convert.ToInt32(Request.Form["state"]); string PurgeTasks = Request.Form["purge"]; string actionType = Request.Form["actiontype"]; string user = Request.Form["selectusergroup"]; string taskids = Request.Form["taskids"]; if ((!string.IsNullOrEmpty(taskids))) { taskids = Strings.Left(taskids, Strings.Len(taskids) - 1); } else { taskids = ""; } objTask = AppUI.EkTaskRef; if ((PurgeTasks == "1")) { ret = objTask.DeleteTasks(taskids, 9); if ((!string.IsNullOrEmpty(actErrorString))) { Response.Redirect("reterror.aspx?info=" + (actErrorString)); } Response.Redirect("tasks.aspx?action=ViewTasks&orderby=" + Request.Form["orderby"] + "&ty=" + Request.Form["actiontype"]); } else if ((actionType == "to" | actionType == "by")) { int userType = Convert.ToInt32(Strings.Right(user, 1)); long iuser = Convert.ToInt64(Strings.Left(user, Strings.Len(user) - 2)); ret = objTask.SetUserForTasks(taskids, userType, iuser, 0); if ((!string.IsNullOrEmpty(actErrorString))) { Response.Redirect("reterror.aspx?info=" + actErrorString); } Response.Redirect("tasks.aspx?action=ViewTasks&orderby=" + Request.Form["orderby"] + "&ty=" + Request.Form["actiontype"]); } else if ((actionType == "touser")) { string userType = Strings.Right(user, 1); user = Strings.Left(user, Strings.Len(user) - 2); Response.Redirect("tasks.aspx?action=ViewTasks&orderby=" + Request.Form["orderby"] + "&ty=" + Request.Form["actiontype"] + "&user="******"&usertype=" + userType); } else { ret = objTask.SetStateForTasks(taskids, State); if ((!string.IsNullOrEmpty(actErrorString))) { Response.Redirect("reterror.aspx?info=" + actErrorString); } Response.Redirect("tasks.aspx?action=ViewTasks&orderby=" + Request.Form["orderby"] + "&ty=" + Request.Form["actiontype"]); } }
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); } }
private void Process_DeleteTask() { ValidateCanDeleteTask(); string taskid = Request.QueryString["tid"]; string actionTy = Request.Form["ty"]; objTask = AppUI.EkTaskRef; if ((actionTy == "deleted")) { ret = objTask.DeleteTasks(taskid, 9); } else { ret = objTask.DeleteTasks(taskid, 0); } if (!string.IsNullOrEmpty(Request.QueryString["forumid"])) { long forumId = EkFunctions.ReadDbLong(Request.QueryString["forumId"]); if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { long topicId = EkFunctions.ReadDbLong(Request.QueryString["contentid"]); callBackPage = "content.aspx?id=" + forumId + "&action=ViewContentByCategory&LangType=" + AppUI.ContentLanguage + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + Request.QueryString["contentid"]; ObjectFactory.GetForum().UpdateStatisticsForTopic(topicId); } } else if (!string.IsNullOrEmpty(Request.QueryString["blogid"])) { 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; } } else if (!string.IsNullOrEmpty(Request.QueryString["fromViewContent"])) { if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { callBackPage = "content.aspx?id=" + Request.QueryString["folderid"] + "&action=View&LangType=" + AppUI.ContentLanguage + "&contentid=" + Request.QueryString["contentid"]; } else { callBackPage = getCallBackupPage("tasks.aspx?action=ViewTasks&ty=" + Request.QueryString["ty"]); } } else { callBackPage = getCallBackupPage("tasks.aspx?action=ViewTasks&ty=" + Request.QueryString["ty"]); } if (Strings.Len(actErrorString) > 0) { Response.Redirect("reterror.aspx?info=" + actErrorString); } else { Response.Redirect(callBackPage); } }
private void Process_EditTask() { ValidateCanEditTask(); objTask = AppUI.EkTaskRef; objTask.TaskTitle = Request.Form["task_title"]; if (Request.Form["priority"] != "") { objTask.Priority = (EkEnumeration.TaskPriority)Convert.ToInt32(Request.Form["priority"]); } if (Request.Form["status"] != "") { objTask.Status = Convert.ToInt32(Request.Form["status"]); } objTask.StartDate = Request.Form["hdnstartdate"]; objTask.DueDate = Request.Form["hdnduedate"]; objTask.Description = ctlEditor.Content; objTask.TaskID = Convert.ToInt64(Request.Form["task_id"]); if (!string.IsNullOrEmpty(Request.Form["assigned_to_user_id"])) { objTask.AssignedToUserID = Convert.ToInt64(Request.Form["assigned_to_user_id"]); } if (!string.IsNullOrEmpty(Request.Form["assigned_to_usergroup_id"])) { objTask.AssignToUserGroupID = Convert.ToInt64(Request.Form["assigned_to_usergroup_id"]); } if (!string.IsNullOrEmpty(Request.Form["assigned_by_user_id"])) { objTask.AssignedByUserID = Request.Form["assigned_by_user_id"]; } if (!string.IsNullOrEmpty(Request.Form["content_id"])) { objTask.ContentID = Convert.ToInt64(Request.Form["content_id"]); } else { objTask.ContentID = -1; } if (Request.Form["state"] != null) { objTask.State = Request.Form["state"]; } languageID = Convert.ToInt32(Request.Form["current_language"]); objTask.ContentLanguage = languageID; if (EnableMultilingual == 1) { languageID = Convert.ToInt32(Request.Form["language"]); } else { languageID = ContentLanguage; } objTask.LanguageID = languageID; if ((Request.Form["task_type"] != "") && (System.Convert.ToInt64(Request.Form["task_type"]) > 0)) { objTask.TaskTypeID = Convert.ToInt64(Request.Form["task_type"]); } else if ((Request.Form["task_type_"] != "") && (System.Convert.ToInt64(Request.Form["task_type_"]) > 0)) //for blogcomments { objTask.TaskTypeID = Convert.ToInt64(Request.Form["task_type_"]); } ret = objTask.UpdateTask(); if (ret) { Response.Redirect("reterror.aspx?info=" + actErrorString); } else { callBackPage = BuildCallBackParms("&"); if (!string.IsNullOrEmpty(Request.QueryString["close"])) { Response.Redirect("close.aspx"); } else if (!string.IsNullOrEmpty(Request.Form["blogid"])) { if (!string.IsNullOrEmpty(Request.Form["content_id"])) { callBackPage = "content.aspx?id=" + Request.Form["blogid"] + "&action=ViewContentByCategory&LangType=" + AppUI.ContentLanguage + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + Request.Form["content_id"]; } else { callBackPage = "content.aspx?id=" + Request.Form["blogid"] + "&action=ViewContentByCategory&LangType=" + AppUI.ContentLanguage + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments; } Response.Redirect(callBackPage, false); } else if (Convert.ToInt64(Request.Form["assigned_by_user_id"]) != currentUserID) { Response.Redirect("tasks.aspx?action=ViewTasks&orderby=" + Request.Form["orderby"] + "&ty=to" + callBackPage); } else { Response.Redirect("tasks.aspx?action=ViewTask&tid=" + Request.Form["task_id"] + callBackPage); } } }
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); } }
private void Process_DeleteAllTasks() { ValidateCanDeleteTask(); string taskids = string.Empty; string actionTy = Request.Form["ty"]; string[] arrArray = Request.Form["taskids"].Split(','); for (int i = 0; i < arrArray.Length; i++) { if (Request.Form["id_" + arrArray[i]] == "on") { taskids = taskids + arrArray[i] + ","; } } if ((!string.IsNullOrEmpty(taskids))) { taskids = Strings.Left(taskids, Strings.Len(taskids) - 1); } else { taskids = ""; } objTask = AppUI.EkTaskRef; if ((actionTy == "deleted")) { ret = objTask.DeleteTasks(taskids, 9); } else { ret = objTask.DeleteTasks(taskids, 0); } if ((!string.IsNullOrEmpty(actErrorString))) { Response.Redirect("reterror.aspx?info=" + (actErrorString)); } Response.Redirect("tasks.aspx?action=ViewTasks&orderby=" + Request.Form["orderby"] + "&ty=" + Request.Form["ty"]); }
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") + ": </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(); }
private void Process_AddTask() { ValidateCanCreateTask(); objTask = AppUI.EkTaskRef; objTask.TaskTitle = Request.Form["task_title"]; if (Request.Form["priority"] != "") { objTask.Priority = (EkEnumeration.TaskPriority)Convert.ToInt32(Request.Form["priority"]); } if (Request.Form["status"] != "") { objTask.Status = Convert.ToInt32(Request.Form["status"]); } objTask.StartDate = Request.Form["hdnstartdate"]; objTask.DueDate = Request.Form["hdnduedate"]; objTask.Description = ctlEditor.Content.Replace("'", "'"); if (!string.IsNullOrEmpty(Request.Form["assigned_to_user_id"])) { objTask.AssignedToUserID = Convert.ToInt64(Request.Form["assigned_to_user_id"]); } else if (!string.IsNullOrEmpty(Request.Form["assigned_to_usergroup_id"])) { objTask.AssignToUserGroupID = Convert.ToInt64(Request.Form["assigned_to_usergroup_id"]); } else { objTask.AssignedToUserID = currentUserID; } objTask.AssignedByUserID = currentUserID.ToString(); if (!string.IsNullOrEmpty(Request.Form["content_id"])) { objTask.ContentID = Convert.ToInt64(Request.Form["content_id"]); } if (!string.IsNullOrEmpty(Request.Form["state"])) { objTask.State = Request.Form["state"].ToString(); } else { objTask.State = "1"; } objTask.ContentLanguage = ContentLanguage; if (EnableMultilingual == 1) { languageID = Convert.ToInt32(Request.Form["language"]); } else { languageID = ContentLanguage; } objTask.LanguageID = languageID; if ((Request.Form["task_type"] != "") && (System.Convert.ToInt64(Request.Form["task_type"]) > 0)) { objTask.TaskTypeID = Convert.ToInt64(Request.Form["task_type"]); } ret = objTask.AddTask(); if (Request.QueryString["callbackpage"] == "content.aspx") { callBackPage = Request.QueryString["callbackpage"] + "?action=view&id=" + ContentId + "&langtype=" + Request.QueryString["langtype"]; } else if (Request.QueryString["callbackpage"] == "exit.htm") { callBackPage = "exit.htm"; } else { callBackPage = "tasks.aspx?action=ViewTasks&orderby=" + OrderBy + "&ty=" + EkFunctions.HtmlEncode(Request.Form["ty"]); } if (ret) { Response.Redirect("reterror.aspx?info=" + actErrorString); } else { Response.Redirect(callBackPage); } }
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 + ") <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 + ") <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; } }
private void Display_ViewContentTask() { pnlViewContentTask.Visible = true; objTask = AppUI.EkTaskRef; TaskItemType = 1; TaskID = ContentId; if (TaskID <= 0) { Response.Redirect("reterror.aspx?info="); } if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { languageID = Convert.ToInt32(Request.QueryString["LangType"]); } objTask.LanguageID = languageID; PageRequestData prdata = new PageRequestData(); objTask.GetTasks(TaskID, -1, -1, TaskItemType, OrderBy, languageID, ref prdata, ""); callBackPage = BuildCallBackParms("&"); if (actiontype == "both") { sTitleBar =this.MsgHelper.GetMessage("lbl View All Tasks for content")+" (" + TaskID + ")"; } StringBuilder sb = new StringBuilder(); for (int i = 1; i < cTasks.Count + 1; i++) { objTask = cTasks.get_Item(i); sb.Append("<tr>"); sb.Append(" <td><a href=\"tasks.aspx?action=ViewTask&tid=" + objTask.TaskID + "&fromViewContent=1&ty=" + actiontype + "&LangType=" + objTask.ContentLanguage + callBackPage + "\">" + objTask.TaskTitle + "</a></td>"); sb.Append("<td title=\"" + objTask.TaskID + "\">" + objTask.TaskID + "</td>"); switch (objTask.State) { case "1": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl not started") + "</td>"); break; case "2": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl active") + "</td>"); break; case "3": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl awaiting data") + "</td>"); break; case "4": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl on hold") + "</td>"); break; case "5": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl pending") + "</td>"); break; case "6": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl reopened") + "</td>"); break; case "7": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl completed") + "</td>"); break; case "8": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl archived") + "</td>"); break; case "9": sb.Append("<td>" + this.MsgHelper.GetMessage("lbl deleted") + "</td>"); break; } switch (objTask.Priority) { case EkEnumeration.TaskPriority.Low: sb.Append("<td>" + this.MsgHelper.GetMessage("lbl low") + "</td>"); break; case EkEnumeration.TaskPriority.Normal: sb.Append("<td>" + this.MsgHelper.GetMessage("lbl normal") + "</td>"); break; case EkEnumeration.TaskPriority.High: sb.Append("<td>" + this.MsgHelper.GetMessage("lbl high") + "</td>"); break; } if ((!string.IsNullOrEmpty(objTask.DueDate))) { if ((Convert.ToDateTime(objTask.DueDate) < DateTime.Today)) { sb.Append("<td class=\"important\">" + AppUI.GetInternationalDateOnly(objTask.DueDate) + "</td>"); } else { sb.Append("<td>" + AppUI.GetInternationalDateOnly(objTask.DueDate) + "</td>"); } } else { sb.Append("<td>[" + this.MsgHelper.GetMessage("dd not specified") + "]</td>"); } if ((actiontype == "by") | (actiontype == "all") | (actiontype == "both")) { if (objTask.AssignToUserGroupID == 0) { sb.Append("<td>All Authors of (" + objTask.ContentID + ")</td>"); } else if (objTask.AssignedToUser != "") { sb.Append("<td>"); sb.Append("<img src=\"" + AppPath + "images/UI/Icons/user.png\" alt=\"\" align=\"absbottom\"/>"); sb.Append(m_refEmail.MakeUserTaskEmailLink(objTask, false)); sb.Append("</td>"); } else if(objTask.AssignedToUserGroup != "") { sb.Append("<td>"); sb.Append("<img src=\"" + AppPath + "images/UI/Icons/users.png\" alt=\"\" align=\"absbottom\"/>"); sb.Append(m_refEmail.MakeUserGroupTaskEmailLink(objTask)); sb.Append("</td>"); } } if ((actiontype == "to") | (actiontype == "all") | (actiontype == "both")) { sb.Append("<td title\"" + m_refEmail.MakeByUserTaskEmailLink(objTask, false) + "\">"); sb.Append(m_refEmail.MakeByUserTaskEmailLink(objTask, false)); sb.Append("</td>"); } if (objTask.LastComment == "") { sb.Append("<td> [" + this.MsgHelper.GetMessage("dd not specified") + "] </td>"); } else { sb.Append("<td nowrap=\"nowrap\"><div class=\"comment-block\">" + objTask.LastComment + "</div></td>"); } sb.Append("<td>" + AppUI.GetInternationalDateOnly(objTask.DateCreated) + "</td>"); sb.Append("</tr>"); } ltrViewContentTaskBody.Text = sb.ToString(); }
private void Display_EditTask() { ValidateCanEditTask(); pnlEditTask.Visible = true; if (!string.IsNullOrEmpty(Request.QueryString["tid"])) { TaskID = Convert.ToInt64(Request.QueryString["tid"]); } callBackPage = BuildCallBackParms("&"); cTask = objTask.GetTaskByID(TaskID); ctlEditor.Content = cTask.Description; if (cTask.TaskTypeID == (long)EkEnumeration.TaskType.BlogPostComment) { IsMac = 1; ltrEditTaskScript.Text = "<script type=\"text/javascript\">" + Constants.vbCrLf + "var postcomment = true;" + Constants.vbCrLf + "</script>"; } else { ltrEditTaskScript.Text = "<script type=\"text/javascript\">" + Constants.vbCrLf + "var postcomment = false;" + Constants.vbCrLf + "</script>"; } StringBuilder sbTemp = new StringBuilder(); StringBuilder sbAdvanced = new StringBuilder(); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append("<td class=\"label\">Title:</td>" + Environment.NewLine); sbTemp.Append(" <td><input type=\"Text\" name=\"task_title\" maxlength=\"200\" value=\"" + (cTask.TaskTitle) + "\" onkeypress=\"return CheckKeyValue(event,'34');\" ID=\"task_title\"></td>"); sbTemp.Append("</tr>" + Environment.NewLine); switch (cTask.TaskTypeID) { case (long)EkEnumeration.TaskType.BlogPostComment: ltrNotBlogTopic.Text = sbTemp.ToString(); break; case (long)EkEnumeration.TaskType.TopicReply: sbAdvanced.Append("<input type=\"hidden\" name=\"task_title\" id=\"task_title\" value=\"" + (Ektron.Cms.Common.EkFunctions.HtmlEncode(cTask.TaskTitle)) + "\"/>"); break; default: ltrNotBlogTopic.Text = sbTemp.ToString(); break; } sbTemp = new StringBuilder(); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Task ID:</td>" + Environment.NewLine); sbTemp.Append(" <td>" + cTask.TaskID.ToString() + "</td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Assigned To:</td>" + Environment.NewLine); sbTemp.Append(" <td align=\"left\">" + Environment.NewLine); if (IsBrowserNS4()) { sbTemp.Append("<input type=\"text\" name=\"nsfourname\" size=\"15\" value=\""); if ((cTask.AssignToUserGroupID == 0)) { sbTemp.Append("All Authors"); } else if ((!string.IsNullOrEmpty(cTask.AssignedToUser))) { sbTemp.Append(GetAssignedToUserFullName(cTask) + " (" + cTask.AssignedToUser + ")".Replace("'", "`")); } else if ((!string.IsNullOrEmpty(cTask.AssignedToUserGroup))) { sbTemp.Append(cTask.AssignedToUserGroup.Replace("'", "`")); } sbTemp.Append("\" ID=\"user\" />"); if (Convert.ToBoolean(canI["CanIRedirectTask"])) { sbTemp.Append("<a class=\"button buttonInline greenHover minHeight buttonCheckAll\" href=\"#\" onclick=\"ShowUsers();\">" + MsgHelper.GetMessage("select user email report") + "</a>" + Environment.NewLine); } } else { sbTemp.Append("<div id=\"user\" style=\"display: block;\">"); if ((cTask.AssignToUserGroupID == 0)) { sbTemp.Append("All Authors"); } else if ((!string.IsNullOrEmpty(cTask.AssignedToUser))) { sbTemp.Append("<img src=\"" + AppPath + "images/UI/Icons/user.png\" border=\"0\" align=\"absbottom\">" + GetAssignedToUserFullName(cTask) + " (" + cTask.AssignedToUser + ")".Replace("'", "`")); } else if ((!string.IsNullOrEmpty(cTask.AssignedToUserGroup))) { sbTemp.Append("<img src=\"" + AppPath + "images/UI/Icons/users.png\" border=\"0\" align=\"absbottom\">" + cTask.AssignedToUserGroup.Replace("'", "`")); } if (Convert.ToBoolean(canI["CanIRedirectTask"])) { sbTemp.Append("<a class=\"button buttonInline greenHover minHeight buttonCheckAll\" href=\"#\" onclick=\"ShowUsers();\">" + MsgHelper.GetMessage("select user email report") + " </a>"); } sbTemp.Append(" </div>"); sbTemp.Append("<div id=\"nouser\" style=\"display: none;\"></div>" + Environment.NewLine); } sbTemp.Append(" </td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); sbTemp.Append("<tr> " + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Assigned By:</td>" + Environment.NewLine); sbTemp.Append(" <td align=\"left\">" + Environment.NewLine); if ((cTask.TaskTypeID == (long)EkEnumeration.TaskType.BlogPostComment | cTask.TaskTypeID == (long)EkEnumeration.TaskType.TopicReply) & (cTask.AssignedByUserID == Ektron.Cms.Common.EkConstants.BuiltIn.ToString())) { sbTemp.Append(" " + Environment.NewLine); } else { sbTemp.Append(" " + GetAssignedByUserFullName(cTask) + " (" + cTask.AssignedByUser + ")".Replace("'", "`") + Environment.NewLine); } sbTemp.Append(" </td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); if (Convert.ToBoolean(AppUI.EnableMultilingual)) { sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Language:</td>" + Environment.NewLine); sbTemp.Append(" <td>" + Environment.NewLine); sbTemp.Append(" <select name=\"language\" ID=\"language\" "); if (cTask.ContentID != -1) { sbTemp.Append("disabled=\"true\" "); } sbTemp.Append(">"); sbTemp.Append(">"); if (cTask.LanguageID == 0) { sbTemp.Append(" <option value=\"0\" "); sbTemp.Append(" selected "); sbTemp.Append(">App Default</option>"); } for (int i = 0; i < colActiveLanguages.Count; i++) { Hashtable activeLanguage = (Hashtable)colActiveLanguages[i]; sbTemp.Append(" <option value=\"" + (activeLanguage["ID"]) + "\" "); if (cTask.LanguageID == Convert.ToInt64(activeLanguage["ID"])) { sbTemp.Append(" selected "); } sbTemp.Append(">" + activeLanguage["Name"] + "</option>"); } sbTemp.Append(" </select>" + Environment.NewLine); sbTemp.Append(" </td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); } if (cTask.TaskTypeID == (long)EkEnumeration.TaskType.BlogPostComment | cTask.TaskTypeID == (long)EkEnumeration.TaskType.TopicReply) { sbAdvanced.Append(sbTemp.ToString()); } else { ltrNotBlogTopic2.Text = sbTemp.ToString(); } sbTemp = new StringBuilder(); if ((cTask.ContentID != -1)) { sbTemp.Append("<div id=\"div3\" style=\"display: none;\"></div><span id=\"contentidspan\" style=\"display: inline-block; background-color: #fff; margin-right: .5em; border: solid 1px #DEDEDE; padding-right: .5em; padding-left: .5em;\">(" + cTask.ContentID + ") " + cTask.ContentTitle + "</span>"); if (!(cTask.TaskTypeID == (long)EkEnumeration.TaskType.BlogPostComment | cTask.TaskTypeID == (long)EkEnumeration.TaskType.TopicReply)) { sbTemp.Append("<a class=\"button buttonInline greenHover minHeight buttonEdit\" href=\"#\" id=\"a_change\" name=\"a_change\" style=\"visibility: visible;\" onclick=\"LoadChildPage();return true;\">Change</a>" + " <a href=\"#\" class=\"button buttonInline redHover minHeight buttonNone\" id=\"a_none\" name=\"a_none\" style=\"visibility: visible;\" onclick=\"UnSelectContent();return true;\">Clear</a>"); } } else { if (IsBrowserNS4()) { sbTemp.Append("<input type=\"text\" title=\"Enter Content Text here\" name=\"nsfourname\" size=\"15\" value=\"Change\" id=\"contentidspan\" /><a class=\"button buttonInline greenHover minHeight buttonCheckAll\" href=\"#\" onclick=\"LoadChildPage();return true;\">" + MsgHelper.GetMessage("generic select") + "</a>"); } else { sbTemp.Append("<div id=\"div3\" style=\"display: none;\"></div>"); sbTemp.Append("<div id=\"contentidspan\" style=\"display: inline-block;\">"); sbTemp.Append(" <a title=\"Select All\" class=\"button buttonInline greenHover minHeight buttonCheckAll\" href=\"#\" onclick=\"LoadChildPage();return true;\">Select</a>"); sbTemp.Append("</div>"); sbTemp.Append("<a title=\"Change\" class=\"button buttonInline greenHover minHeight buttonEdit\" href=\"#\" id=\"a_change\" name=\"a_change\" style=\"visibility: hidden;\" onclick=\"LoadChildPage();return true;\">Change</a> <a title=\"Clear\" class=\"button buttonInline redHover minHeight buttonNone\" href=\"#\" id=\"a_none\" name=\"a_none\" style=\"visibility: hidden;\" onclick=\"UnSelectContent();return true;\">Clear</a>"); } } ltrEditTaskBody1.Text = sbTemp.ToString(); sbTemp = new StringBuilder(); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Priority:</td>" + Environment.NewLine); sbTemp.Append(" <td>" + Environment.NewLine); sbTemp.Append(" <select name=\"priority\" ID=\"priority\">" + Environment.NewLine); sbTemp.Append(" <option value=\"1\""); if ((cTask.Priority == EkEnumeration.TaskPriority.Low)) { sbTemp.Append(" selected"); } sbTemp.Append(">Low</option>" + Environment.NewLine); sbTemp.Append(" <option value=\"2\""); if ((cTask.Priority == EkEnumeration.TaskPriority.Normal)) { sbTemp.Append(" selected"); } sbTemp.Append(">Normal</option>" + Environment.NewLine); sbTemp.Append(" <option value=\"3\""); if ((cTask.Priority == EkEnumeration.TaskPriority.High)) { sbTemp.Append(" selected"); } sbTemp.Append(">High</option>" + Environment.NewLine); sbTemp.Append(" </select>" + Environment.NewLine); sbTemp.Append(" </td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); sbTemp.Append(DisplayTaskType(action)); if ((Convert.ToInt64(cTask.TaskTypeID) == Convert.ToInt64(EkEnumeration.TaskType.BlogPostComment)) | (Convert.ToInt64(cTask.TaskTypeID) == Convert.ToInt64(EkEnumeration.TaskType.TopicReply))) { sbAdvanced.Append(sbTemp.ToString()); } else { ltrNotBlogTopic3.Text = sbTemp.ToString(); } sbTemp = new StringBuilder(); HttpCookie cookie = Ektron.Cms.CommonApi.GetEcmCookie(); if (cTask.TaskTypeID == (long)EkEnumeration.TaskType.TopicReply | cTask.TaskTypeID == (long)EkEnumeration.TaskType.BlogPostComment) { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option value=\"5\" "); if (cTask.State == "5") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl pending") + "</option>"); sbTemp.Append("<option value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl approved") + "</option>"); sbTemp.Append("</select>"); } else if (m_refContentApi.IsAdmin() | cTask.ContentID == -1) { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Not Started\" value=\"1\" "); if (cTask.State == "1") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl not started") + "</option>"); sbTemp.Append("<option title=\"Active\" value=\"2\" "); if (cTask.State == "2") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl active") + "</option>"); sbTemp.Append("<option title=\"Awaiting Data\" value=\"3\" "); if (cTask.State == "3") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbTemp.Append("<option title=\"On Hold\" value=\"4\" "); if (cTask.State == "4") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl on hold") + "</option>"); sbTemp.Append("<option title=\"Pending\" value=\"5\" "); if (cTask.State == "5") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl pending") + "</option>"); sbTemp.Append("<option title=\"ReOpened\" value=\"6\" "); if (cTask.State == "6") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl reopened") + "</option>"); sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); sbTemp.Append("<option title=\"Archived\" value=\"8\" "); if (cTask.State == "8") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl archived") + "</option>"); sbTemp.Append("<option title=\"Deleted\" value=\"9\" "); if (cTask.State == "9") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl deleted") + "</option>"); sbTemp.Append("</select>"); } else if (cTask.State == "1") { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Not Started\" value=\"1\" "); if (cTask.State == "1") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl not started") + "</option>"); sbTemp.Append("<option title=\"Awaiting Data\" value=\"3\" "); if (cTask.State == "3") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbTemp.Append("<option title=\"On Hold\" value=\"4\" "); if (cTask.State == "4") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl on hold") + "</option>"); if (cTask.AssignedToUserID == Convert.ToInt64(cookie["user_id"]) || groupManager.IsUserInGroup(Convert.ToInt64(cookie["user_id"]), cTask.AssignToUserGroupID)) { sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); } sbTemp.Append("</select>"); } else if (cTask.State == "2") { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Active\" value=\"2\" "); if (cTask.State == "2") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl active") + "</option>"); sbTemp.Append("<option title=\"Awaiting Data\" value=\"3\" "); if (cTask.State == "3") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbTemp.Append("<option title=\"On Hold\" value=\"4\" "); if (cTask.State == "4") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl on hold") + "</option>"); if (cTask.AssignedToUserID == Convert.ToInt64(cookie["user_id"])) { sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); } sbTemp.Append("</select>"); } else if (cTask.State == "3" | cTask.State == "4") { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Awaiting Data\" value=\"3\" "); if (cTask.State == "3") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbTemp.Append("<option title=\"On Hold\" value=\"4\" "); if (cTask.State == "4") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl on hold") + "</option>"); if (cTask.AssignedToUserID == Convert.ToInt64(cookie["user_id"])) { sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); } sbTemp.Append("</select>"); } else if (cTask.State == "6") { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"ReOpened\" value=\"6\" "); if (cTask.State == "6") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl reopened") + "</option>"); sbTemp.Append("<option title=\"Awaiting Data\" value=\"3\" "); if (cTask.State == "3") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbTemp.Append("<option title=\"On Hold\" value=\"4\" "); if (cTask.State == "4") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl on hold") + "</option>"); if (cTask.AssignedToUserID == Convert.ToInt64(cookie["user_id"])) { sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); } sbTemp.Append("</select>"); } else if (cTask.State == "7" & cTask.AssignedToUserID == Convert.ToInt64(cookie["user_id"])) { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); sbTemp.Append("<option title=\"Archived\" value=\"8\" "); if (cTask.State == "8") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl archived") + "</option>"); sbTemp.Append("</select>"); } else if (cTask.State == "7" & cTask.AssignedToUserID == -1) { if(IsUserInGroup(cTask.AssignToUserGroupID)) { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); sbTemp.Append("<option title=\"Archived\" value=\"8\" "); if (cTask.State == "8") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl archived") + "</option>"); sbTemp.Append("</select>"); } } else if (cTask.State == "7") { sbTemp.Append("<select name=\"state\" id=\"state\" disabled>"); sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); sbTemp.Append("</select>"); } else if (cTask.State == "7") { sbTemp.Append("<select name=\"state\" id=\"state\" disabled>"); sbTemp.Append("<option title=\"Archived\" value=\"8\" "); if (cTask.State == "8") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl archived") + "</option>"); sbTemp.Append("</select>"); } else if ((cTask.State == "1") | (cTask.State == "5") | (cTask.State == "6") | (cTask.State == "9")) { sbTemp.Append("<select name=\"state\" id=\"state\">"); sbTemp.Append("<option title=\"Not Started\" value=\"1\" "); if (cTask.State == "1") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl not started") + "</option>"); sbTemp.Append("<option title=\"Active\" value=\"2\" "); if (cTask.State == "2") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl active") + "</option>"); sbTemp.Append("<option title=\"Awaiting Data\" value=\"3\" "); if (cTask.State == "3") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl awaiting data") + "</option>"); sbTemp.Append("<option title=\"On Hold\" value=\"4\" "); if (cTask.State == "4") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl on hold") + "</option>"); sbTemp.Append("<option title=\"Pending\" value=\"5\" "); if (cTask.State == "5") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl pending") + "</option>"); sbTemp.Append("<option title=\"ReOpened\" value=\"6\" "); if (cTask.State == "6") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl reopened") + "</option>"); sbTemp.Append("<option title=\"Completed\" value=\"7\" "); if (cTask.State == "7") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl completed") + "</option>"); sbTemp.Append("<option title=\"Archived\" value=\"8\" "); if (cTask.State == "8") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl archived") + "</option>"); sbTemp.Append("<option title=\"Deleted\" value=\"9\" "); if (cTask.State == "9") { sbTemp.Append("selected"); } sbTemp.Append(">" + this.MsgHelper.GetMessage("lbl deleted") + "</option>"); sbTemp.Append("</select>"); } ltrEditTaskSelect.Text = sbTemp.ToString(); sbTemp = new StringBuilder(); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Start Date:</td>" + Environment.NewLine); sbTemp.Append(" <td>" + DisplayDateSelector("taskinfo", "start_date", "start_date", true, cTask.StartDate) + "</td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append(" <td class=\"label\">Due Date:</td>" + Environment.NewLine); sbTemp.Append(" <td>" + DisplayDateSelector("taskinfo", "due_date", "due_date", true, cTask.DueDate) + "</td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); if ((Convert.ToInt64(cTask.TaskTypeID) == Convert.ToInt32(EkEnumeration.TaskType.BlogPostComment)) | (Convert.ToInt64(cTask.TaskTypeID) == Convert.ToInt32(EkEnumeration.TaskType.TopicReply))) { sbAdvanced.Append(sbTemp.ToString()); } else { ltrNotBlogTopic4.Text = sbTemp.ToString(); } sbTemp = new StringBuilder(); sbTemp.Append("<tr>" + Environment.NewLine); sbTemp.Append("\t<td class=\"label\">Created By:</td>" + Environment.NewLine); sbTemp.Append("\t<td align=\"left\">" + Environment.NewLine); if ((Convert.ToInt64(cTask.TaskTypeID) == Convert.ToInt32(EkEnumeration.TaskType.BlogPostComment)) | (Convert.ToInt64(cTask.TaskTypeID) == Convert.ToInt32(EkEnumeration.TaskType.TopicReply)) & (cTask.AssignedByUserID == Ektron.Cms.Common.EkConstants.BuiltIn.ToString())) { sbTemp.Append(Ektron.Cms.Common.EkFunctions.HtmlEncode(cTask.CommentDisplayName) + " " + EkFunctions.HtmlEncode("(" + cTask.CommentEmail + ")")); } else { sbTemp.Append(cTask.CreatedByUser); } sbTemp.Append("\t</td>" + Environment.NewLine); sbTemp.Append("</tr>" + Environment.NewLine); ltrNotBlogTopic5.Text = sbTemp.ToString(); ltrMetaData.Text = sbAdvanced.ToString(); }
private void Display_DeleteAllTasks() { ValidateCanDeleteTask(); pnlDeleteAllTasks.Visible = true; string taskIDs = string.Empty; objTask = AppUI.EkTaskRef; if ((actiontype == "all")) { TaskItemType = 12; } else if ((actiontype == "both")) { TaskItemType = 9; } else if ((actiontype == "to")) { TaskItemType = 3; } else if ((actiontype == "by")) { TaskItemType = 7; } PageRequestData pgdata = new PageRequestData(); cTasks = objTask.GetTasks(-1, currentUserID, -1, TaskItemType, OrderBy, -1, ref pgdata, ""); HttpCookie cookie = Ektron.Cms.CommonApi.GetEcmCookie(); if ((actiontype == "all")) { sTitleBar = "Delete All Tasks In The System"; } else if ((actiontype == "to")) { sTitleBar = "Delete Tasks Assigned To " + cookie["userfullname"]; } else if ((actiontype == "by")) { sTitleBar = "Delete Tasks Assigned By " + cookie["userfullname"]; } else if ((actiontype == "both")) { sTitleBar = "Delete Tasks Assigned By and To " + cookie["userfullname"]; } StringBuilder sb = new StringBuilder(); for (int i = 1; i < cTasks.Count + 1; i++) { EkTask cTask = cTasks.get_Item(i); taskIDs = taskIDs + cTask.TaskID + ","; sb.Append("<tr id=\"task_" + cTask.TaskID + "_" + i + "_"); if (cTask.TaskTypeID <= 0) { sb.Append("NotS\">"); } else { sb.Append(cTask.TaskTypeID + "\">"); } sb.Append(" <script type=\"text/javascript\">"); sb.Append(" AddShownTaskID('task_" + cTask.TaskID + "_" + i + "_"); if (cTask.TaskTypeID <= 0) { sb.Append("NotS');"); } else { sb.Append(cTask.TaskTypeID + "');"); } sb.Append("</script>"); sb.Append(" <td nowrap=\"nowrap\" width=\"1\">"); sb.Append(" <input title=\"Task ID\" type=\"checkbox\" onclick=\"checkAllFalse();\" name=\"id_" + cTask.TaskID +"\" id=\"_" + cTask.TaskID + "_" + i + "_"); if (cTask.TaskTypeID <= 0) { sb.Append("NotS\"/>"); } else { sb.Append(cTask.TaskTypeID + "\"/>"); } sb.Append(" </td>"); sb.Append("<td><a href=\"tasks.aspx?action=ViewTask&tid=" + cTask.TaskID + "\" title=\"" + cTask.TaskTitle + "\">" + cTask.TaskTitle + "</a></td>"); sb.Append("<td title=\"" + cTask.TaskID + "\">" + cTask.TaskID + "</td>"); if ((actiontype == "by") | (actiontype == "all") | (actiontype == "both")) { if (cTask.AssignToUserGroupID == 0) { sb.Append("<td>All Authors</td>"); } else if (cTask.AssignedToUser != "") { sb.Append("<td>"); sb.Append("<img src=\"" + AppPath + "images/UI/Icons/user.png\" alt=\"\" align=\"absbottom\"/>"); sb.Append(m_refEmail.MakeUserTaskEmailLink(cTask, false)); sb.Append("</td>"); } else if (cTask.AssignedToUserGroup != "") { sb.Append("<td>"); sb.Append("<img src=\"" + AppPath + "images/UI/Icons/users.png\" alt=\"\" align=\"absbottom\"/>"); sb.Append(m_refEmail.MakeUserGroupTaskEmailLink(cTask)); sb.Append("</td>"); } } if ((actiontype == "to") | (actiontype == "all") | (actiontype == "both")) { sb.Append("<td>"); sb.Append(m_refEmail.MakeByUserTaskEmailLink(cTask, false)); sb.Append("</td>"); } if ((!string.IsNullOrEmpty(cTask.DueDate))) { if ((Convert.ToDateTime(cTask.DueDate) < DateTime.Today)) { sb.Append("<td class=\"important\">" + AppUI.GetInternationalDateOnly(cTask.DueDate) + "</td>"); } else { sb.Append("<td>" + AppUI.GetInternationalDateOnly(cTask.DueDate) + "</td>"); } } else { sb.Append("<td>[" + this.MsgHelper.GetMessage("dd not specified") + "]</td>"); } switch (cTask.State) { case "1": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl not started")+"</td>"); break; case "2": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl active")+"</td>"); break; case "3": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl awaiting data")+"</td>"); break; case "4": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl on hold")+"</td>"); break; case "5": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl pending")+"</td>"); break; case "6": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl reopened")+"</td>"); break; case "7": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl completed")+"</td>"); break; case "8": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl archived")+"</td>"); break; case "9": sb.Append("<td>"+this.MsgHelper.GetMessage("lbl deleted")+"</td>"); break; } switch (cTask.Priority) { case EkEnumeration.TaskPriority.Low: sb.Append("<td>" + this.MsgHelper.GetMessage("lbl low") + "</td>"); break; case EkEnumeration.TaskPriority.Normal: sb.Append("<td>" + this.MsgHelper.GetMessage("lbl normal") + "</td>"); break; case EkEnumeration.TaskPriority.High: sb.Append("<td>" + this.MsgHelper.GetMessage("lbl high") + "</td>"); break; } sb.Append("</tr>"); } if (taskIDs != string.Empty) { taskIDs = taskIDs.Remove(taskIDs.Length - 1, 1); } ltrDeleteAllTasks.Text = sb.ToString(); ltrTaskIds.Text = "<input type=\"hidden\" name=\"taskids\" value=\"" + taskIDs + "\" id=\"taskids\"/>"; }
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(); }