private void Delete() { using (HyperCatalog.Business.Culture cul = HyperCatalog.Business.Culture.GetByKey(txtCultureCode.Text)) { if (cul != null) { if (cul.Delete(HyperCatalog.Shared.SessionState.User.Id)) { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "clientScript", "<script>back();</script>"); } else { lbError.CssClass = "hc_error"; lbError.Text = HyperCatalog.Business.Culture.LastError; lbError.Visible = true; } } else { lbError.CssClass = "hc_error"; lbError.Text = "Error: Culture not found"; lbError.Visible = true; } } }
protected void Page_Load(object sender, System.EventArgs e) { try { if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } containerId = Convert.ToInt32(Request["d"]); culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); itemId = item.Id; chunk = ChunkWindow.GetChunk(itemId, containerId, culture.Code); container = SessionState.QDEContainer; if (!Page.IsPostBack) { lbResult.Text = HyperCatalog.Business.Chunk.LastError; UpdateDataView(); } } catch (Exception ex) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>alert('" + UITools.CleanJSString(ex.ToString()) + "');top.window.close();</script>"); } }
protected void Page_Load(object sender, System.EventArgs e) { #region Check Capabilities if (SessionState.User.IsReadOnly) { uwToolbar.Items.FromKeyButton("Save").Enabled = false; uwToolbar.Items.FromKeyButton("Delete").Enabled = false; } if (!SessionState.User.HasCapability(CapabilitiesEnum.EXTEND_CONTENT_MODEL)) { UITools.HideToolBarButton(uwToolbar, "Save"); UITools.HideToolBarSeparator(uwToolbar, "SaveSep"); UITools.HideToolBarButton(uwToolbar, "Delete"); UITools.HideToolBarSeparator(uwToolbar, "DeleteSep"); } #endregion if (Request["c"] != null) { cultureCode = Request["c"].ToString(); masterCulture = HyperCatalog.Shared.SessionState.MasterCulture.Code; using (cul = HyperCatalog.Business.Culture.GetByKey(cultureCode)) { if (!Page.IsPostBack) { UpdateDataEdit(); } } } }
public static HyperCatalog.Business.Culture UpdateCultureCodeFromRequest(string requestField) { if (System.Web.HttpContext.Current.Request[requestField] != null) { if (SessionState.Culture != null) { if (SessionState.Culture.Code != System.Web.HttpContext.Current.Request[requestField].ToString()) { HyperCatalog.Business.Culture cul = HyperCatalog.Business.Culture.GetByKey(System.Web.HttpContext.Current.Request[requestField].ToString()); if (cul != null) { SessionState.Culture = cul; } } } else { HyperCatalog.Business.Culture cul = HyperCatalog.Business.Culture.GetByKey(System.Web.HttpContext.Current.Request[requestField].ToString()); if (cul != null) { SessionState.Culture = cul; } } } return(SessionState.Culture); }
protected void Page_Load(object sender, System.EventArgs e) { try { containerId = Convert.ToInt32(Request["d"]); if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); itemId = item.Id; chunk = ChunkWindow.GetChunk(itemId, containerId, culture.Code); container = SessionState.QDEContainer; uwToolbar.Enabled = Request["ui"] != null; /*#ACQ10.0 Starts * Commented to bring out ILB for all catalogue irespective of mandatory status * if (!isMandatory || culture.Type == CultureType.Regionale) * { * UITools.HideToolBarButton(uwToolbar, "ilb"); * } * #ACQ10.0 Ends */ } catch { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>alert('Chunk not found!');window.close()</script>"); } //Modified this line for QCs# 839 and 1028 ChunkButtonBar.Chunk = chunk; //Modified this line for QCs# 839 and 1028 ChunkButtonBar.User = SessionState.User; ChunkButtonBar.Item = item; ChunkButtonBar.Container = container; ChunkButtonBar.Culture = culture; if (!Page.IsPostBack) { //Added these lines for QCs# 839 and 1028 ChunkComment1.Chunk = chunk; ChunkModifier1.Chunk = chunk; //Added these lines for QCs# 839 and 1028 lbResult.Text = string.Empty; UpdateDataView(); } }
private void Save() { if (cultureCode == "-1") { HyperCatalog.Business.Culture c = HyperCatalog.Business.Culture.GetByKey(txtCultureCode.Text.Trim()); if (c == null) { // Create new culture cul = new HyperCatalog.Business.Culture(txtCultureCode.Text.Trim(), txtCultureName.Text.Trim(), dlFallBackCode.SelectedValue.Trim(), (CultureType)Enum.Parse(typeof(CultureType), dlCultureTypeId.SelectedValue), 0, 0, ddlLanguages.SelectedValue, ddlRegionsCountries.SelectedValue); } else { lbError.CssClass = "hc_error"; lbError.Text = "This culture code [" + txtCultureCode.Text.Trim() + "] already exist !"; lbError.Visible = true; return; } } else { // update culture cul = HyperCatalog.Business.Culture.GetByKey(cultureCode); cul.Code = txtCultureCode.Text; cul.Name = txtCultureName.Text; cul.FallbackCode = dlFallBackCode.SelectedValue.Trim(); } if (cul != null) { if (cul.Save()) { // create/update cul.Dispose(); lbError.Text = "Data saved!"; lbError.CssClass = "hc_success"; lbError.Visible = true; } else { lbError.CssClass = "hc_error"; lbError.Text = HyperCatalog.Business.Culture.LastError; lbError.Visible = true; } } else { lbError.CssClass = "hc_error"; lbError.Text = "Error: Culture not found"; lbError.Visible = true; } }
protected void Page_Load(object sender, System.EventArgs e) { // Init variables _Item = null; _InputformId = -1; try { // retrieve item and input form (if inputform is -1 then it is content tab) _Item = QDEUtils.GetItemIdFromRequest(); if (Request["f"] != null) { _InputformId = Convert.ToInt32(Request["f"]); } QDEUtils.UpdateCultureCodeFromRequest(); } catch {} // Update fallback if (SessionState.Culture.Type == CultureType.Regionale) { _FallBackCulture = SessionState.Culture.Fallback; } if (SessionState.Culture.Type == CultureType.Locale) { _FallBackCulture = SessionState.Culture.Fallback; _FallBackCulture2 = _FallBackCulture.Fallback; } // Update grid if (_Item != null) { if (SessionState.User.HasItemInScope(_Item.Id)) // item is in user's scope { if (!Page.IsPostBack) { UpdateDataView(); } } else { UITools.DenyAccess(DenyMode.Popup); } } else { UITools.DenyAccess(DenyMode.Popup); } }
void UpdateDataEdit(string selCultureCode) { panelGrid.Visible = false; webTab.EnableViewState = false; webTab.Tabs.GetTab(0).ContentPane.TargetUrl = "./localizations/localization_Properties.aspx?c=" + selCultureCode; if (selCultureCode == "-1") { lbTitle.Text = "Culture: New"; } else { HyperCatalog.Business.Culture culture = HyperCatalog.Business.Culture.GetByKey(selCultureCode); lbTitle.Text = "Culture: " + culture.Name.ToString(); } webTab.Visible = true; webTab.SelectedTabIndex = 0; }
protected void Page_Load(object sender, System.EventArgs e) { // Placer ici le code utilisateur pour initialiser la page if (Request["d"] != null) { containerId = Convert.ToInt32(Request["d"]); culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); container = SessionState.QDEContainer; itemId = item.Id; if (!Page.IsPostBack) { ShowChunk(); } } }
protected void Page_Load(object sender, System.EventArgs e) { try { if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } containerId = Convert.ToInt32(Request["d"]); culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); itemId = item.Id; chunk = ChunkWindow.GetChunk(itemId, containerId, culture.Code); container = SessionState.QDEContainer; uwToolbar.Enabled = Request["ui"] != null; /* * #ACQ10.0 Starts * Commented to bring out ILB for all catalogue irespective of mandatory status * if (!isMandatory || culture.Type == CultureType.Regionale) * { * UITools.HideToolBarButton(uwToolbar, "ilb"); * uwToolbar.Visible = false; * } #ACQ10.0 Ends */ rdNo.Attributes.Add("onClick", "dc()"); rdYes.Attributes.Add("onClick", "dc()"); } catch { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>window.close()</script>"); } Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "blanktext", "<script>ILBText = '" + HyperCatalog.Business.Chunk.BlankText + "';</script>"); if (!Page.IsPostBack) { lbResult.Text = string.Empty; UpdateDataView(); } }
protected void Page_Load(object sender, System.EventArgs e) { UITools.ShowSearchBar(this); /********** Start: Updated for QC defect #749 ****************/ // Below line is commented for for QC defect #749 //UITools.FindUserFirstCulture(CultureType.Locale) bool found = SessionState.Culture != null && SessionState.Culture.Type == CultureType.Locale; ItemStatus status = ItemStatus.Unknown; bool isEligible = false; // Getting the Relavant Culture for current User and Item. if (!found) { using (Database dbObj = Utils.GetMainDB()) { DatabaseQuery dbQuery = dbObj.CreateSPQuery("_User_GetItemRelavantCultures", new SqlParameter("@UserId", SessionState.User.Id), new SqlParameter("@ItemId", SessionState.User.LastVisitedItem)); dbQuery.AddOutputParameters(new SqlParameter("@CultureCode", SqlDbType.VarChar, 10)); dbQuery.AddOutputParameters(new SqlParameter("@CultureName", SqlDbType.VarChar, 80)); dbQuery.AddOutputParameters(new SqlParameter("@FallbackCode", SqlDbType.VarChar, 10)); dbQuery.AddOutputParameters(new SqlParameter("@CultureTypeId", SqlDbType.TinyInt)); dbQuery.AddOutputParameters(new SqlParameter("@Sort", SqlDbType.SmallInt)); dbQuery.AddOutputParameters(new SqlParameter("@CultureId", SqlDbType.Int)); dbQuery.AddOutputParameters(new SqlParameter("@LanguageCode", SqlDbType.VarChar, 3)); dbQuery.AddOutputParameters(new SqlParameter("@CountryCode", SqlDbType.VarChar, 3)); dbQuery.AddOutputParameters(new SqlParameter("@Status", SqlDbType.Char, 1)); dbQuery.Run(); if (dbObj.LastError != null && dbObj.LastError.Length == 0) { HyperCatalog.Business.Culture objCul = new HyperCatalog.Business.Culture( Convert.ToString(dbQuery.GetParameterValue("@CultureCode")).Trim(), Convert.ToString(dbQuery.GetParameterValue("@CultureName")).Trim(), Convert.ToString(dbQuery.GetParameterValue("@FallbackCode")).Trim(), HyperCatalog.Business.Culture.GetCultureTypeFromInteger(Convert.ToInt32(dbQuery.GetParameterValue("@CultureTypeId"))), Convert.ToInt32(dbQuery.GetParameterValue("@Sort")), Convert.ToInt32(dbQuery.GetParameterValue("CultureId")), Convert.ToString(dbQuery.GetParameterValue("@LanguageCode")).Trim(), Convert.ToString(dbQuery.GetParameterValue("@CountryCode")).Trim()); status = Item.GetStatusFromString(Convert.ToString(dbQuery.GetParameterValue("@Status")).Trim().ToUpper()); found = true; SessionState.Culture = objCul; if (objCul.Code == null || objCul.Code.Length == 0) { isEligible = false; } else { isEligible = true; } dbObj.CloseConnection(); } else { dbObj.CloseConnection(); throw new DataException("SQLDataAccessLayer: ItemEligibleInCountry-> " + dbObj.LastError); } } } else { if (Item.GetByKey(SessionState.User.LastVisitedItem).GetWorkflowStatus(SessionState.Culture.Code) == ItemWorkflowStatus.Initialized.ToString() || Item.GetByKey(SessionState.User.LastVisitedItem).GetWorkflowStatus(SessionState.Culture.Code) == ItemWorkflowStatus.AcquisitionCompleted.ToString() || Item.GetByKey(SessionState.User.LastVisitedItem).GetWorkflowStatus(SessionState.Culture.Code) == ItemWorkflowStatus.Unknown.ToString()) { isEligible = false; } else { isEligible = Item.IsEligible(SessionState.User.LastVisitedItem, SessionState.Culture.CountryCode, ref status); } } if (!found) { // User has not locales in its scope UITools.DenyAccess(DenyMode.Standard); } else { //ItemStatus status = ItemStatus.Unknown; //bool isEligible = Item.IsEligible(SessionState.User.LastVisitedItem, SessionState.Culture.CountryCode, ref status); /********** End: Updated for QC defect #749 ****************/ //Response.Write("Current IS " + SessionState.User.LastVisitedItem.ToString()); //Response.Write(" - ELIGIBLE = " + isEligible.ToString() + "<br/>"); if (isEligible) { if (status == ItemStatus.Obsolete && !SessionState.User.ViewObsoletes) { SessionState.User.ViewObsoletes = true; } SessionState.User.QuickSave(); } else { // Find the first eligible Item for the user. // 08/12/2009 QC 2692 - Modified by Sateesh -- The workflow Status 'R'/'C' only should be visible in locales SessionState.User.LastVisitedItem = SessionState.User.GetFirstCountryItem(SessionState.Culture.CountryCode, SessionState.Culture.Code); //Response.Write("CHANGED TO " + SessionState.User.LastVisitedItem.ToString()); Item.IsEligible(SessionState.User.LastVisitedItem, SessionState.Culture.CountryCode, ref status); if (status == ItemStatus.Obsolete && !SessionState.User.ViewObsoletes) { SessionState.User.ViewObsoletes = true; } SessionState.User.QuickSave(); } qdeFrame.Attributes["src"] = Page.ResolveUrl("~/UI/Acquire/QDE/QDE_Main.aspx?g=2"); } }
private void UpdateDataView() { if (SessionState.tmFilterExpression != null) { DDL_Countries.SelectedValue = SessionState.tmFilterExpression; } MaxRows = Convert.ToInt32(SessionState.CacheParams["MaxSearchQueryDisplayedRows"].Value); string search = txtFilter.Text; using (Database dbObj = Utils.GetMainDB()) { using (HyperCatalog.Business.Culture c = HyperCatalog.Business.Culture.GetByKey(DDL_Countries.SelectedValue)) { using (DataSet ds = dbObj.RunSPReturnDataSet("_Item_GetNPI", new SqlParameter("@UserId", SessionState.User.Id.ToString()), new SqlParameter("@CountryCode", c.CountryCode), new SqlParameter("@DayCountNPI", SessionState.CacheParams["DayCountNPI"].Value), new SqlParameter("@MaxRows", MaxRows), new SqlParameter("@Filter", txtFilter.Text), new SqlParameter("@Company", SessionState.CompanyName))) { dbObj.CloseConnection(); if (dbObj.LastError != string.Empty) { lbMessage.Text = "[ERROR] _Item_GetNPI -> " + dbObj.LastError; lbMessage.CssClass = "hc_error"; lbMessage.Visible = true; } else { using (HyperCatalog.Business.Culture selCul = HyperCatalog.Business.Culture.GetByKey(DDL_Countries.SelectedValue)) { curCultureType = selCul.Type; } #region Results if (ds.Tables[0].Rows.Count > 0) { dg.DataSource = ds; lbMessage.Visible = false; Utils.InitGridSort(ref dg); dg.DataBind(); dg.Visible = true; dg.Columns.FromKey("ModifyDate").Format = SessionState.User.FormatDate; dg.Columns.FromKey("Class").Header.Caption = SessionState.ItemLevels[1].Name; if (ds.Tables.Count > 1 && ds.Tables[1].Rows.Count == 1) { int count = Convert.ToInt32(ds.Tables[1].Rows[0]["ProductCount"]); lbMessage.CssClass = "hc_success"; if (count <= MaxRows) { lbMessage.Text = "Product count: " + count.ToString() + "<br />"; } else { lbMessage.Text = "Product count: " + count.ToString() + " (" + MaxRows.ToString() + " products are displayed)<br />Your report is returning too many rows (max = " + MaxRows.ToString() + ")<br />"; } lbMessage.Visible = true; } } #endregion #region No result else { lbMessage.CssClass = "hc_success"; lbMessage.Text = "No new product found"; lbMessage.Visible = true; dg.Visible = false; } #endregion } } } } }
protected void Page_Load(object sender, System.EventArgs e) { System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); ci.DateTimeFormat.ShortDatePattern = SessionState.User.FormatDate; ci.DateTimeFormat.LongDatePattern = SessionState.User.FormatDate; wdMasterPublishing.CalendarLayout.Culture = ci; wdMasterPublishing.MinDate = DateTime.UtcNow; warningMessage = "<font color='red' size='2'><b>Error:</b> Regional MATF is not possible.</font><br><br>" + "This item has project with BOR date in future. Hence this item cannot be region validated. <br>" + "Requesting user to try again after BOR date has reached."; if (SessionState.User.IsReadOnly) { uwToolbar.Items.FromKeyButton("Save").Enabled = false; } // Hide or show button switch capabilities if (!SessionState.User.HasCapability(CapabilitiesEnum.EDIT_DELETE_FINAL_CHUNKS_MARKET_SEGMENT)) { UITools.HideToolBarButton(uwToolbar, "Save"); UITools.HideToolBarSeparator(uwToolbar, "SaveSep"); } // Retrieve current user and current culture user = SessionState.User; culture = SessionState.Culture; try { // Get parameters if (Request["i"] != null) { item = HyperCatalog.Business.Item.GetByKey(Convert.ToInt64(Request["i"])); } else if (QDEUtils.GetItemIdFromRequest() != null) { item = QDEUtils.GetItemIdFromRequest(); } if (Request["l"] != null) { culture = QDEUtils.UpdateCultureCodeFromRequest("l"); } if (Request["f"] != null) { inputFormId = Convert.ToInt32(Request["f"]); } //Added by Prabhu for CR 5160 & ACQ 8.12 (PCF1: Auto TR Redesign)-- 21/May/09 if (Request["isATRButton"] != null) { isAutoTRButton = Convert.ToBoolean(Request["isATRButton"]); } if (inputFormId > 0) { containerMATFList = Request["c"].ToString(); if (culture.Type == CultureType.Regionale && isAutoTRButton) { lblChkBoxAlert.Visible = true; lblChkBoxAlert.Text = "<font color='red'><b>Note:</b> Move status to will be performed on locally authored content only.</font>"; } } // Check // - user is valid // - culture is valid // - item is valid // - user has the current culture in its scope // - user has the item in its scope if (user != null && culture != null && item != null && user.HasCultureInScope(culture.Code) && user.HasItemInScope(item.Id)) { if (!Page.IsPostBack) { DateTime today = DateTime.UtcNow; item.RegionCode = culture.Code; // check if this item or its inherited item has BOR date in future. if (item.Milestones != null && culture.Type == CultureType.Regionale && inputFormId < 0) { if (!item.Milestones.Inherited) { if ((item.Milestones.BeginningOfRegionalization != null && item.Milestones.BeginningOfRegionalization.Value > today)) { panelMATF.Visible = false; lblWarningMessage.Visible = true; lblWarningMessage.Text = warningMessage; } else { UpdateDataView(); } } else { item.Milestones.InheritedItem.RegionCode = culture.Code; if ((item.Milestones.InheritedItem.Milestones.BeginningOfRegionalization != null && item.Milestones.InheritedItem.Milestones.BeginningOfRegionalization.Value > today)) { panelMATF.Visible = false; lblWarningMessage.Visible = true; lblWarningMessage.Text = warningMessage; } else { UpdateDataView(); } } } else { UpdateDataView(); } } } else { UITools.DenyAccess(DenyMode.Popup); return; } } catch (Exception excep) { //Response.Write(excep.ToString()); UITools.DenyAccess(DenyMode.Popup); } }
private void UpdateResult() { lbMessage.Visible = false; using (Database dbObj = Utils.GetMainDB()) { /**** For PL selection ****/ string selPls = GetSelPLs(); dbObj.TimeOut = TIME_OUT; using (DataSet ds = dbObj.RunSPReturnDataSet("dbo._Report_ContentAddUpd", new SqlParameter("@Frequency", DDL_Days.SelectedValue.ToString()), new SqlParameter("@CultureCode", DDL_Cultures.SelectedValue.ToString()), new SqlParameter("@ItemId", -1), new SqlParameter("@Filter", DDL_Filter.SelectedValue.ToString()), new SqlParameter("@UserId", SessionState.User.Id.ToString()), /**** For PL selection ****/ new SqlParameter("@PLCODE", selPls + ""))) { dbObj.CloseConnection(); if (dbObj.LastError != string.Empty) { lbMessage.Text = "[ERROR] _Report_ContentAddUpd -> " + dbObj.LastError; lbMessage.Visible = true; } else { #region Results int nbCount = ds.Tables[0].Rows.Count; if (nbCount > 0) { int max = Convert.ToInt32(SessionState.CacheParams["MaxContentModifiedNewDisplayedRows"].Value); if (nbCount > max) { Label1.Text = "Count: " + nbCount + " (maximum displayed: " + max + ")"; for (int i = nbCount - 1; i > max; i--) { ds.Tables[0].Rows.RemoveAt(i); } } else { Label1.Text = "Count: " + nbCount; } dgResults.DataSource = ds.Tables[0]; Utils.InitGridSort(ref dgResults); dgResults.DataBind(); wPanelPL.Expanded = false; Session["SelPls"] = GetSelPLs(); dgResults.Columns.FromKey("ClassName").Header.Caption = SessionState.ItemLevels[1].Name; dgResults.Columns.FromKey("ModifyDate").Format = SessionState.User.FormatDate; using (HyperCatalog.Business.Culture c = HyperCatalog.Business.Culture.GetByKey(DDL_Cultures.SelectedValue)) { if (c.Type != CultureType.Locale) { dgResults.Columns.FromKey("WorkflowStatus").ServerOnly = true; } else { dgResults.Columns.FromKey("WorkflowStatus").ServerOnly = false; } } lbMessage.Visible = false; dgResults.Visible = true; uwToolbar.Visible = true; Label1.Visible = true; } #endregion #region No result else { lbMessage.Text = "No result found"; lbMessage.Visible = true; dgResults.Visible = false; uwToolbar.Visible = false; Label1.Visible = false; } #endregion } } } }
protected void Page_Load(object sender, System.EventArgs e) { try { containerId = Convert.ToInt32(Request["d"]); if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); itemId = item.Id; chunk = ChunkWindow.GetChunk(itemId, containerId, culture.Code); container = SessionState.QDEContainer; uwToolbar.Enabled = Request["ui"] != null; //code added on 17th November 2011 for Chunk Edit Validation for XSS Vulnerability Fix - start if (SessionState.CacheParams.Exists("XSS_RestrictedHTMLTags")) { keyword = SessionState.CacheParams["XSS_RestrictedHTMLTags"].Value.ToString(); } //code added on 17th November 2011 for Chunk Edit Validation for XSS Vulnerability Fix - end #region Spell Checker string masterLanguage = string.Empty; masterLanguage = HyperCatalog.Shared.SessionState.MasterCulture.LanguageCode; if (culture.LanguageCode != masterLanguage) { UITools.HideToolBarSeparator(uwToolbar, "spellsep"); UITools.HideToolBarButton(uwToolbar, "spell"); } Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "VarsForSpellChecker", "<script>var itemId=" + itemId.ToString() + ";var containerId=" + containerId + ";</script>"); #endregion /*#ACQ10.0 Starts * // Commented to bring out ILB for all catalogue irespective of mandatory status * // Only allow ILB for mandatory chunks and only at sku level for push down * if (!isMandatory || culture.Type == CultureType.Regionale) * { * UITools.HideToolBarSeparator(uwToolbar, "ilbSep"); * UITools.HideToolBarButton(uwToolbar, "ilb"); * } * #ACQ10.0 Ends */ } catch { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>alert('Chunk not found!');window.close()</script>"); } ChunkComment1.Chunk = ChunkModifier1.Chunk = ChunkButtonBar.Chunk = chunk; ChunkButtonBar.Container = container; ChunkButtonBar.User = SessionState.User; ChunkButtonBar.Culture = culture; ChunkButtonBar.Item = item; if (!Page.IsPostBack) { lbResult.Text = string.Empty; WebSpellChecker1.WebSpellCheckerDialogPage += "?i=" + itemId.ToString() + "&c=" + containerId.ToString(); UpdateDataView(); } #region Spell Checker WebSpellChecker1.SpellOptions.AllowCaseInsensitiveSuggestions = true; WebSpellChecker1.SpellOptions.AllowMixedCase = false; WebSpellChecker1.SpellOptions.AllowWordsWithDigits = true; WebSpellChecker1.SpellOptions.AllowXML = true; WebSpellChecker1.SpellOptions.CheckHyphenatedText = true; WebSpellChecker1.SpellOptions.IncludeUserDictionaryInSuggestions = true; WebSpellChecker1.SpellOptions.PerformanceOptions.AllowCapitalizedWords = true; WebSpellChecker1.SpellOptions.PerformanceOptions.CheckCompoundWords = false; WebSpellChecker1.SpellOptions.PerformanceOptions.ConsiderationRange = -1; WebSpellChecker1.SpellOptions.PerformanceOptions.SplitWordThreshold = 3; WebSpellChecker1.SpellOptions.PerformanceOptions.SuggestSplitWords = true; WebSpellChecker1.SpellOptions.SeparateHyphenWords = false; #endregion }
protected void Page_Load(object sender, System.EventArgs e) { // Get current culture culture = SessionState.Culture; user = SessionState.User; try { // Get parameters item = QDEUtils.GetItemIdFromRequest(); culture = QDEUtils.UpdateCultureCodeFromRequest(); if (Request["f"] != null) { inputformId = Convert.ToInt32(Request["f"]); } } catch { UITools.DenyAccess(DenyMode.Popup); return; } // Check // - user is valid // - culture is valid // - item is valid // - user has the current culture in its scope // - user has the item in its scope if (user != null && culture != null && item != null && user.HasCultureInScope(culture.Code) && user.HasItemInScope(item.Id)) { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "initVars", "var cultureCode='" + culture.Code + "';", true); if (!Page.IsPostBack) { lbError.Visible = false; dg.Visible = false; lbResult.Visible = false; // Update title (current item name) if (item != null) { lbTitle.Text = item.FullName; if (lbTitle.Text.Length > 50) { lbTitle.Text = lbTitle.Text.Substring(0, 49) + "..."; } if (inputformId > -1) { pnlChildren.Visible = false; UITools.HideToolBarSeparator(uwToolbar, "AnalyzeSep"); UITools.HideToolBarButton(uwToolbar, "Analyze"); Analyze(); // analyse the content for this input form // Retrieve input form name string inputFormName = HyperCatalog.Business.InputForm.GetByKey(Convert.ToInt32(inputformId)).Name; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "InitFormName", "<script>inputFormName='" + inputFormName + "';</script>"); } else { pnlChildren.Visible = true; UITools.ShowToolBarSeparator(uwToolbar, "AnalyzeSep"); UITools.ShowToolBarButton(uwToolbar, "Analyze"); } } else { UITools.DenyAccess(DenyMode.Popup); } } } else { UITools.DenyAccess(DenyMode.Popup); } }
protected void Page_Load(object sender, System.EventArgs e) { try { containerId = Convert.ToInt32(Request["d"]); if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); itemId = item.Id; chunk = ChunkWindow.GetChunk(itemId, containerId, culture.Code); uwToolbar.Enabled = Request["ui"] != null; if (Request["ifid"] != null) { ifContainer = InputFormContainer.GetByKey(Convert.ToInt32(Request["ifid"])); } /*#ACQ10.0 Starts --Commented * Commented to bring out ILB for all catalogue irespective of mandatory status * if (!isMandatory || culture.Type == CultureType.Regionale) * { * UITools.HideToolBarButton(uwToolbar, "ilb"); * } */ UITools.HideToolBarButton(uwToolbar, "ilb"); //#ACQ10.0 Ends Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "blanktext", "<script>ILBText = '" + HyperCatalog.Business.Chunk.BlankText + "';</script>"); //Modified this line for QCs# 839 and 1028 ChunkButtonBar.Chunk = chunk; //Modified this line for QCs# 839 and 1028 ChunkButtonBar.Container = SessionState.QDEContainer; ChunkButtonBar.User = SessionState.User; ChunkButtonBar.Culture = culture; ChunkButtonBar.Item = item; if (!Page.IsPostBack) { //Added these lines for QCs# 839 and 1028 ChunkComment1.Chunk = chunk; ChunkModifier1.Chunk = chunk; //Added these lines for QCs# 839 and 1028 lbResult.Text = string.Empty; UpdateDataView(); } else { if (Request["__EVENTTARGET"] != null) // Check if user is trying to sort a group { if (Request["__EVENTTARGET"].ToString() == "rowup" || Request["__EVENTTARGET"].ToString() == "rowdown") { SortRow(Request["__EVENTTARGET"].ToString() == "rowup", Convert.ToInt32(Request["__EVENTARGUMENT"])); } } } } catch (Exception ex) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>alert('" + UITools.CleanJSString(ex.ToString()) + "');top.window.close();</script>"); } }
protected void Page_Load(object sender, System.EventArgs e) { // Placer ici le code utilisateur pour initialiser la page try { PanelChunk.Visible = ContainerInfoPanel.Visible = false; string key = System.Web.HttpUtility.HtmlEncode(Request["key"].ToString()).Replace(" ", "+"); key = SqlTools.DecryptString(key); //Response.Write(key); string[] parameters = key.Split(','); switch (parameters[0]) { case "d": ContainerInfoPanel.ContainerId = Convert.ToInt32(parameters[1]); ContainerInfoPanel.Visible = true; PanelChunk.Visible = PanelChunkDetail.Visible = false; break; case "i": Page.Response.Redirect("TR_Properties.aspx?tr=" + parameters[1]); break; case "c": Item item = Item.GetByKey(Convert.ToInt64(parameters[1])); Chunk chunk = Chunk.GetByKey(Convert.ToInt64(parameters[1]), Convert.ToInt32(parameters[2]), HyperCatalog.Shared.SessionState.MasterCulture.Code); HyperCatalog.Business.Culture culture = HyperCatalog.Business.Culture.GetByKey(parameters[3].ToString()); if (Request["tab"] == null) { PanelChunk.Visible = true; PanelChunkDetail.Visible = false; webTab.Tabs.GetTab(0).ContentPane.TargetUrl = "Preview.aspx?key=" + key + "&tab=1"; webTab.Tabs.GetTab(1).ContentPane.TargetUrl = "../../Acquire/qde/QDE_FormContent.aspx?i=" + item.Id + "&f=IF_-1&c=" + culture.Code; if (item != null) { webTab.Tabs[0].Text = chunk.ContainerName; uwToolbarTitle.Items.FromKeyLabel("ItemName").Text = item.Name; } if (culture != null) { uwToolbarTitle.Items.FromKeyLabel("Culture").Image = "/hc_v4/img/flags/" + culture.CountryCode + ".gif"; uwToolbarTitle.Items.FromKeyLabel("Culture").Text = culture.Name + " "; } } else { PanelChunkDetail.Visible = true; if (chunk != null) { txtValue.Text = chunk.Text; if (chunk.Text == HyperCatalog.Business.Chunk.BlankValue) { txtValue.Text = HyperCatalog.Business.Chunk.BlankText; } imgStatus.ImageUrl = "/hc_v4/img/S" + HyperCatalog.Business.Chunk.GetStatusFromEnum(chunk.Status) + ".gif"; lbStatus.Text = "[" + chunk.Status.ToString() + "]"; ChunkComment1.Chunk = ChunkModifier1.Chunk = chunk; PanelChunkDetail.Visible = true; ChunkComment1.Visible = chunk.Comment != string.Empty; } else { Business.Debug.Trace("ASP", key, Business.DebugSeverity.Medium); UITools.JsCloseWin("Chunk not found (possible reason is deletion)"); } } break; default: UITools.JsCloseWin("Incorrect query!"); break; } } catch (Exception ex) { Business.Debug.Trace("ASP", ex.Message, Business.DebugSeverity.High); UITools.JsCloseWin("Unauthorized access - " + ex.ToString()); } }
protected void Page_Load(object sender, System.EventArgs e) { try { containerId = Convert.ToInt32(Request["d"]); if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } culture = QDEUtils.UpdateCultureCodeFromRequest(); item = QDEUtils.GetItemIdFromRequest(); // Fix for QC#7852 - Assigned the correct item Id to the itemID variable before retrieving the Chunk.. itemId = item.Id; chunk = ChunkWindow.GetChunk(itemId, containerId, culture.Code); container = SessionState.QDEContainer; uwToolbar.Enabled = Request["ui"] != null; System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US"); ci.DateTimeFormat.ShortDatePattern = SessionState.User.FormatDate; ci.DateTimeFormat.LongDatePattern = SessionState.User.FormatDate; dateValue.CalendarLayout.Culture = ci; System.Threading.Thread.CurrentThread.CurrentCulture = ci; //ACQ10.0 Starts //if (!isMandatory || culture.Type == CultureType.Regionale) //{ // UITools.HideToolBarButton(uwToolbar, "ilb"); //} //ACQ10.0 Ends } catch { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>window.close()</script>"); } Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "blanktext", "<script>ILBText = '" + HyperCatalog.Business.Chunk.BlankText + "';</script>"); //Modified this line for QCs# 839 and 1028 ChunkButtonBar.Chunk = chunk; //Modified this line for QCs# 839 and 1028 ChunkButtonBar.Container = container; ChunkButtonBar.Item = item; ChunkButtonBar.User = SessionState.User; ChunkButtonBar.Culture = culture; //#ACQ10.0 Starts if (chunk != null) { if (chunk.Text == HyperCatalog.Business.Chunk.BlankValue) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "VarBlankChunk", "<script>var isBlankChunk = true;</script>"); //dateValue.Enabled = false; dateValue.Value = HyperCatalog.Business.Chunk.BlankText; } } //#ACQ10.0 Ends if (!Page.IsPostBack) { //Added these line for QCs# 839 and 1028 ChunkComment1.Chunk = chunk; ChunkModifier1.Chunk = chunk; //Added this line for QCs# 839 and 1028 lbResult.Text = string.Empty; UpdateDataView(); } }