protected override void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; eUser = m_refContentApi.EkUserRef; CheckAccess(); ADCheck(); if (AdValid == true) { SetLabels(this.m_sPageAction); if ((string)(this.m_sPageAction) == "edit") { if (Page.IsPostBack) { ProcessDomains(); } else { //m_refSiteApi = New SiteAPI //setting_data = m_refSiteApi.GetSiteVariables() DefinedDomains = eUser.GetDomainsAdvanced(); EditDomains(); } } else { DefinedDomains = eUser.GetDomainsAdvanced(); ShowDomains(); } } else { SetLabels("error"); } }
private void Page_Load(System.Object sender, System.EventArgs e) { //Put user code to initialize the page here //string var1 = ""; string var2 = ""; if (!string.IsNullOrEmpty(Request.QueryString["fromModal"])) { fromModal = Convert.ToBoolean(Request.QueryString["fromModal"]); commerceAdmin = m_refSiteApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin); cancelJavascript = "if ('function' == typeof parent.EktronUiDialogClose) { parent.EktronUiDialogClose('email'); } else { parent.ektb_remove(); }"; } RegisterResources(); m_refMsg = m_refSiteApi.EkMsgRef; if (!Utilities.ValidateUserLogin()) { return; } if (m_refSiteApi.RequestInformationRef.IsMembershipUser > 0) { Response.Redirect((string)("reterror.aspx?info=" + m_refSiteApi.EkMsgRef.GetMessage("msg login cms user")), true); return; } ContentLanguage = m_refSiteApi.ContentLanguage; if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || ContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES) { ContentLanguage = m_refSiteApi.DefaultContentLanguage; } language_data = m_refSiteApi.GetLanguageById(ContentLanguage); BrowserCode = language_data.BrowserCode; strTargUserEmail = ""; strUserFName = ""; strUserLName = ""; globalWarningMsg = ""; iMaxContLength = 65000; localeFileString = "0000"; m_refUser = m_refSiteApi.EkUserRef; m_refContent = m_refSiteApi.EkContentRef; UserId = Convert.ToInt64(Request.QueryString["userid"]); GroupId = Convert.ToInt64(Request.QueryString["groupid"]); UserArray = Request.QueryString["userarray"]; GroupArray = Request.QueryString["grouparray"]; MsgNotes = Request.QueryString["notes"]; ContentId = Convert.ToInt64(Request.QueryString["contentid"]); emailclangid = Request.QueryString["emailclangid"]; target = Request.Form["target"]; source = Request.Form["source"]; subject = Request.Form["subject"]; sMessage = this.message.Content; AppeWebPath = m_refSiteApi.ApplicationPath + m_refSiteApi.AppeWebPath; var2 = m_refContent.GetEditorVariablev2_0(0, "email"); EmailData.Text += m_refMail.EmailJS(); DisplayControl(); }
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_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); } }
protected bool IsUserInGroup(long GroupID) { bool retval = false; usrObj = AppUI.EkUserRef; cGroups = usrObj.GetGroupsUserIsInv2_0(currentUserID, EkEnumeration.GroupOrderBy.GroupName); if (cGroups != null) { for (int i = 1; i <= cGroups.Count; i++) { Collection coll = (Collection)cGroups[i]; if (Convert.ToInt64(coll["UserGroupID"]) != -1 & Convert.ToInt64(coll["UserGroupID"]) != 0) { if (Convert.ToInt64(coll["UserGroupID"]) == GroupID) { retval = true; break; } } } } return retval; }
protected long GetUserIdByGroupId(long GroupID) { long retval = 0; usrObj = AppUI.EkUserRef; cGroups = usrObj.GetUsersByGroupv2_0(GroupID, ""); if (cGroups != null) { for (int i = 1; i <= cGroups.Count; i++) { Collection coll = (Collection)cGroups[i]; if (!string.IsNullOrEmpty(coll["UserID"].ToString()) && Convert.ToInt64(coll["UserID"]) > 0) { if (Convert.ToInt64(coll["UserID"]) == currentUserID) { retval = Convert.ToInt64(coll["UserID"]); break; } } } } usrObj = null; cGroups = null; return retval; }