/// <summary> /// delete IFContainer /// </summary> private void Delete() { InputFormContainer ifc = InputFormContainer.GetByKey(InputFormContainerId); if (!ifc.Delete(HyperCatalog.Shared.SessionState.User.Id)) { lbError.CssClass = "hc_error"; lbError.Text = InputFormContainer.LastError; lbError.Visible = true; } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reloadParent", "<script>ReloadParent('');top.close();</script>"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_CARTOGRAPHY)) { try { if (Request["c"] != null) { InputFormContainerId = Convert.ToInt64(Request["c"]); } if (Request["f"] != null) { InputFormId = Convert.ToInt32(Request["f"]); } InputFormContainer ifc = InputFormContainer.GetByKey(InputFormContainerId); Infragistics.WebUI.UltraWebTab.Tab tabProperties = webTab.Tabs.FromKeyTab("Properties"), tabPossibleValues = webTab.Tabs.FromKeyTab("PossibleValues"); if (InputFormContainerId == -1) { uwToolbar.Items.FromKeyLabel("Action").Text = "Adding container"; webTab.Tabs[1].Visible = false; } else { uwToolbar.Items.FromKeyLabel("Action").Text = "Updating [" + ifc.ContainerName + "]"; webTab.Tabs[1].Visible = ifc.Type != InputFormContainerType.Normal; } tabProperties.ContentPane.TargetUrl = tabProperties.TargetUrl + "?c=" + InputFormContainerId.ToString() + "&f=" + InputFormId; tabPossibleValues.ContentPane.TargetUrl = tabPossibleValues.TargetUrl + "?c=" + InputFormContainerId.ToString() + "&f=" + InputFormId; Page.DataBind(); webTab.Visible = true; } catch { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>window.close();</script>"); } } else { UITools.DenyAccess(DenyMode.Popup); } }
/// <summary> /// Display data /// </summary> private void UpdateDataView() { lbError.Visible = false; InputFormContainer ifc = InputFormContainer.GetByKey(InputFormContainerId); // list of input form container type DDL_InputType.Items.Clear(); foreach (string t in Enum.GetNames(typeof(InputFormContainerType))) { DDL_InputType.Items.Add(t); } if (ifc != null) // modify input form container { hlCreator.Visible = true; lbOrganization.Visible = true; lbCreatedOn.Visible = true; lbOpening.Visible = true; lbClosing.Visible = true; DDL_InputType.SelectedValue = ifc.Type.ToString(); DDL_InputType.Enabled = (ifc.ParentInputForm != null?ifc.ParentInputForm.Items.Count == 0:false); cbContainers.Value = ifc.Container.Tag; txtContainer.Text = ifc.Container.Tag; cbContainers.Visible = false; txtContainer.Visible = true; txtComment.Text = ifc.Comment; chkMandatory.Checked = ifc.Mandatory; cbRegionalizable.Checked = ifc.Regionalizable; if (ifc.Modifier != null) // IFContainer already modified { hlCreator.Text = ifc.Modifier.FullName; hlCreator.NavigateUrl = "mailto:" + UITools.GetDisplayEmail(ifc.Modifier.Email) + Server.HtmlEncode("?subject=InputFormContainers[#" + ifc.InputFormId + " - " + ifc.ContainerTag + "]"); lbOrganization.Text = ifc.Modifier.OrgName; lbCreatedOn.Text = "Updated on " + SessionState.User.FormatUtcDate(ifc.ModifyDate.Value, true, SessionState.User.FormatDate + ' ' + SessionState.User.FormatTime); } else // IFContainer only created { hlCreator.Text = ifc.Creator.FullName; hlCreator.NavigateUrl = "mailto:" + UITools.GetDisplayEmail(ifc.Creator.Email) + Server.HtmlEncode("?subject=InputFormContainers[#" + ifc.InputFormId + " - " + ifc.ContainerTag + "]"); lbOrganization.Text = ifc.Creator.OrgName; lbCreatedOn.Text = "Created on " + SessionState.User.FormatUtcDate(ifc.CreateDate.Value, true, SessionState.User.FormatDate + ' ' + SessionState.User.FormatTime); } if (SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_CARTOGRAPHY)) { UITools.ShowToolBarButton(uwToolbar, "Delete"); UITools.ShowToolBarSeparator(uwToolbar, "DeleteSep"); } } else // attach a container { hlCreator.Visible = false; lbOrganization.Visible = false; lbCreatedOn.Visible = false; lbOpening.Visible = false; lbClosing.Visible = false; DDL_InputType.Enabled = true; cbContainers.Visible = true; txtContainer.Visible = false; txtContainer.Text = string.Empty; UITools.HideToolBarButton(uwToolbar, "Delete"); UITools.HideToolBarSeparator(uwToolbar, "DeleteSep"); } }
/// <summary> /// Save IFContainer data /// </summary> private void Save() { if (cbContainers.Value == null) { cbContainers.Value = txtContainer.Text; } refContainer = HyperCatalog.Business.Container.GetByTag(cbContainers.Value); if (refContainer != null) { bool canSave = false; InputFormContainer ifc = InputFormContainer.GetByKey(InputFormContainerId); if (ifc == null) // attach new container { CheckDependency(); // check container dependencies ifc = new InputFormContainer(InputFormContainerId, refContainer.Id, InputFormId, string.Empty, 0, refContainer.Tag, refContainer.Name, refContainer.Regionalizable, txtComment.Text, chkMandatory.Checked, (InputFormContainerType)Enum.Parse(typeof(InputFormContainerType), DDL_InputType.SelectedValue, false), SessionState.User.Id, DateTime.UtcNow, -1, null); canSave = true; } else // modify comment, mandatory or sort { ifc.ModifierId = SessionState.User.Id; ifc.ModifyDate = DateTime.UtcNow; ifc.Mandatory = chkMandatory.Checked; ifc.Comment = txtComment.Text.Trim(); ifc.Type = (InputFormContainerType)Enum.Parse(typeof(InputFormContainerType), DDL_InputType.SelectedValue, false); canSave = true; } // save in database if (canSave) { if (!ifc.Save()) { // Error lbError.CssClass = "hc_error"; lbError.Text = InputFormContainer.LastError; lbError.Visible = true; } else { lbError.CssClass = "hc_success"; lbError.Text = "Data saved!"; lbError.Visible = true; InputFormContainerId = ifc.Id; if (((InputFormContainerType)Enum.Parse(typeof(InputFormContainerType), DDL_InputType.SelectedValue, false) == InputFormContainerType.SingleChoiceList) || ((InputFormContainerType)Enum.Parse(typeof(InputFormContainerType), DDL_InputType.SelectedValue, false) == InputFormContainerType.MultiChoiceList)) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reloadWindow", "<script>ReloadParent();DisplayTab(" + ifc.Id + ", " + ifc.InputFormId + ", 1);</script>"); // display new tab } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reloadWindow", "<script>ReloadParent();DisplayTab(" + ifc.Id + ", " + ifc.InputFormId + ", 0);</script>"); // reload tab } } } } else { lbError.CssClass = "hc_error"; lbError.Text = "Error: the container [" + cbContainers.Value + "] doesn't exist."; lbError.Visible = true; } }
protected void Page_Load(object sender, System.EventArgs e) { string cultureCode = string.Empty; int containerId = -1; long itemId = -1; bool isMandatory = false; int inputformId = -1; string extraParam = string.Empty; bool isRegion = false; try { #region try itemId = QDEUtils.GetQueryItemIdFromRequest(); containerId = Convert.ToInt32(Request["d"]); if (Request["m"] != null) { isMandatory = Convert.ToBoolean(Request["m"]); } using (Culture curCulture = QDEUtils.UpdateCultureCodeFromRequest()) { cultureCode = curCulture.Code; if (Request["ifcid"] != null && Request["ifcid"].ToString() != "-1") { using (InputFormContainer ifc = InputFormContainer.GetByKey(Convert.ToInt32(Request["ifcid"]))) { if (ifc != null) { inputformId = ifc.InputFormId; } } } bool simpleView = SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_SIMPLIFIED_CHUNK_WINDOW).Value; Tab tabChunk = webTab.Tabs.FromKeyTab("Chunk"), tabMaster = webTab.Tabs.FromKeyTab("Master"), tabContainer = webTab.Tabs.FromKeyTab("Container"), tabHistory = webTab.Tabs.FromKeyTab("History"), tabRegionalization = webTab.Tabs.FromKeyTab("Regionalization"), tabTranslation = webTab.Tabs.FromKeyTab("Translation"), tabPossibleValues = webTab.Tabs.FromKeyTab("PossibleValues"), tabInheritance = webTab.Tabs.FromKeyTab("Inheritance"), tabImage = webTab.Tabs.FromKeyTab("Image"); if (curCulture.CountryCode != string.Empty) { uwToolbar.Items.FromKeyLabel("Culture").Image = "/hc_v4/img/flags/" + curCulture.CountryCode + ".gif"; } GetChunk(itemId, containerId, cultureCode); uwToolbar.Items.FromKeyLabel("Culture").Text = curCulture.Name; container = SessionState.QDEContainer; if (container == null) { throw new Exception("An error occurred when retrieving data. Container is null[id = " + containerId.ToString() + "]"); } // ************************************************************************* // Only show master tab if culture code is not master // ************************************************************************* if ((curCulture.Type != CultureType.Master)) { tabMaster.ContentPane.TargetUrl = tabMaster.ContentPane.TargetUrl + "?d=" + containerId.ToString() + "&i=" + itemId.ToString() + "&c=" + curCulture.Code; using (Chunk masterChunk = Chunk.GetByKey(itemId, containerId, curCulture.FallbackCode)) { tabMaster.Visible = masterChunk != null; if (masterChunk != null && !masterChunk.Text.Equals(HyperCatalog.Business.Chunk.BlankValue)) { extraParam = "&hf=1"; // Has Fallback = 1. This will be used in the Chunk button bar to accelerate the code. } } } // Change Tab height according to hidden field (to avoid recompiling) webTab.Height = Unit.Pixel(Convert.ToInt16(chunkHeight.Value)); // ************************************************************************* // Determine what we are currently doing: New or Update // ************************************************************************* // SHOW/HIdE Possible values tab using (Item item = QDEUtils.GetItemIdFromRequest()) { if (!simpleView && container != null && curCulture.Type == CultureType.Master) { // Get count of possible values from parent //int possibleValueCount = container.PossibleValuesCount(cultureCode, item.ParentId, inputformId); tabPossibleValues.Visible = true; //(phil - performances)tabPossibleValues.Text = tabPossibleValues.Text + " (" + possibleValueCount + ")"; tabPossibleValues.ContentPane.TargetUrl = tabPossibleValues.ContentPane.TargetUrl + "?d=" + container.Id.ToString() + "&i=" + itemId.ToString() + "&c=" + cultureCode + "&f=" + inputformId.ToString(); } // SHOW Inheritance tab if (item != null && item.Level.Id <= ItemLevel.GetSkuLevel().Id) { tabInheritance.Visible = (!simpleView && (container.InheritanceMethodId > 0)); tabInheritance.ContentPane.TargetUrl = tabInheritance.ContentPane.TargetUrl + "?i=" + itemId.ToString() + "&d=" + container.Id.ToString() + "&c=" + cultureCode; } } if (SessionState.QDEChunk != null) { uwToolbar.Items.FromKeyLabel("Action").Text = container.Group.Path + container.Group.Name + "/" + container.Tag; tabHistory.Visible = SessionState.QDEChunk.HistoryCount > 0 && !simpleView; tabHistory.Text = tabHistory.Text + " (" + SessionState.QDEChunk.HistoryCount.ToString() + ")"; tabHistory.ContentPane.TargetUrl = tabHistory.ContentPane.TargetUrl + "?d=" + container.Id.ToString() + "&i=" + SessionState.QDEChunk.ItemId.ToString() + "&c=" + cultureCode; uwToolbar.Items.FromKeyLabel("Action").ToolTip = container.Group.Path + container.Group.Name + "/" + container.Tag + " [" + container.Name + "]"; } else // Create { uwToolbar.Items.FromKeyLabel("Action").Text = container.Group.Path + container.Group.Name + "/" + container.Tag; tabHistory.Visible = false; } if (!simpleView) { // SHOW/HIDE Regionalization Tab int nbRegionalization = HyperCatalog.Business.Chunk.GetRegionalizationsCount(itemId, container.Id, cultureCode); tabRegionalization.Visible = nbRegionalization > 0; tabRegionalization.ContentPane.TargetUrl = tabRegionalization.ContentPane.TargetUrl + "?d=" + containerId.ToString() + "&i=" + itemId.ToString() + "&c=" + cultureCode; tabRegionalization.Text = tabRegionalization.Text + " (" + nbRegionalization + ")"; // SHOW/HIDE Translation Tab int nbTranslation = HyperCatalog.Business.Chunk.GetTranslationsCount(itemId, container.Id, cultureCode); tabTranslation.Visible = nbTranslation > 0; tabTranslation.ContentPane.TargetUrl = tabTranslation.ContentPane.TargetUrl + "?d=" + containerId.ToString() + "&i=" + itemId.ToString() + "&c=" + cultureCode; tabTranslation.Text = tabTranslation.Text + " (" + nbTranslation + ")"; } ///////////////////////////////////////////////////////////// //Determine which kind of interface we should show ///////////////////////////////////////////////////////////// string masterCultureCode = HyperCatalog.Shared.SessionState.MasterCulture.Code; //get code for regions and master culture HyperCatalog.Business.CultureList allCultures = HyperCatalog.Business.Culture.GetAll("CultureTypeId IN (0,1)"); foreach (HyperCatalog.Business.Culture culcode in allCultures) { if (curCulture.Code == culcode.Code) { isRegion = true; } } switch (Convert.ToChar(container.DataType.Code)) { case 'D': tabChunk.ContentPane.TargetUrl = "Chunk_Date.aspx"; break; case 'L':// List is not supported tabChunk.ContentPane.TargetUrl = "Chunk_Text.aspx"; break; case 'N': tabChunk.ContentPane.TargetUrl = "Chunk_Number.aspx"; break; case 'B': tabChunk.ContentPane.TargetUrl = "Chunk_Boolean.aspx"; break; // A MODIFIER ICI POUR PHOTOS case 'U': goto case 'S'; case 'P': goto case 'S'; case 'R': case 'S': goto case 'T'; case 'T': tabChunk.ContentPane.TargetUrl = "Chunk_Text.aspx"; break; } // IF containe type is Photo, override dataTyping //2007/01/19 - modif greg - old : if (container.ContainerTypeCode == 'P' || container.ContainerTypeCode == 'L') if (container.ContainerTypeCode == 'P' || container.DataTypeCode == 'P') { tabChunk.ContentPane.TargetUrl = "Chunk_Resource.aspx"; if (SessionState.QDEChunk != null && SessionState.QDEChunk.Text != HyperCatalog.Business.Chunk.BlankValue) { // SHOW Image preview tab /************ Ref QC#871 (Making Image preview tab visible) ********************/ tabImage.Visible = true; tabImage.ContentPane.TargetUrl = tabImage.ContentPane.TargetUrl + "?d=" + container.Id.ToString() + "&i=" + SessionState.QDEChunk.ItemId.ToString() + "&c=" + cultureCode; } } if (container.InputMask != string.Empty && masterCultureCode == curCulture.Code) { tabChunk.ContentPane.TargetUrl = "Chunk_InputMask.aspx"; } //if (container.LookupId >= 0 && masterCultureCode == curCulture.Code) if (container.LookupId >= 0 && isRegion) // Prabhu Fix for HPeZilla Bug 69251 - LUT not showing up in regions for editing { tabChunk.ContentPane.TargetUrl = "Chunk_Lookup.aspx"; if (Request["ifcid"] != null && Request["ifcid"].ToString() != "-1") { using (InputFormContainer inputFormContainer = InputFormContainer.GetByKey(Convert.ToInt32(Request["ifcid"]))) { if (inputFormContainer != null) { extraParam += "&t=" + InputFormContainer.GetTypeFromEnum(inputFormContainer.Type); } } } } /* Alternate for CR 5096(Removal of rejections) * if (SessionState.QDEChunk != null && SessionState.QDEChunk.Status == ChunkStatus.Rejected) * { * tabChunk.ContentPane.TargetUrl = "Chunk_Rejected.aspx"; * tabMaster.Visible = tabHistory.Visible = tabRegionalization.Visible = tabTranslation.Visible = * tabPossibleValues.Visible = tabInheritance.Visible = tabImage.Visible = false; * } */ tabChunk.ContentPane.TargetUrl = tabChunk.ContentPane.TargetUrl + "?d=" + container.Id.ToString() + "&c=" + cultureCode + "&i=" + itemId.ToString() + "&m=" + isMandatory.ToString() + extraParam; // If chunk is coming from List in Input Form, force type to list if (Request["ifcid"] != null && Request["ifcid"].ToString() != "-1") { InputFormContainer inputFormContainer = InputFormContainer.GetByKey(Convert.ToInt32(Request["ifcid"])); if (inputFormContainer != null) { //if (inputFormContainer.Type != InputFormContainerType.Normal && masterCultureCode == curCulture.Code) if (inputFormContainer.Type != InputFormContainerType.Normal && isRegion)// Prabhu Fix for HPeZilla Bug 69251 - LUT not showing up in regions for editing { tabChunk.ContentPane.TargetUrl = "Chunk_Lookup.aspx?d=" + container.Id.ToString() + "&c=" + cultureCode + "&i=" + itemId.ToString() + "&m=" + isMandatory.ToString() + "&t=" + InputFormContainer.GetTypeFromEnum(inputFormContainer.Type) + "&ifid=" + Request["ifcid"].ToString() + extraParam; } } } if (tabTranslation.Visible) { tabChunk.ContentPane.TargetUrl = tabChunk.ContentPane.TargetUrl + "&ht=1"; // HasTranslations } if (SessionState.CurrentItemIsUserItem) { tabChunk.ContentPane.TargetUrl = tabChunk.ContentPane.TargetUrl + "&ui=1"; // HasItemInScope } tabContainer.ContentPane.TargetUrl = tabContainer.ContentPane.TargetUrl + "?d=" + container.Id.ToString(); tabContainer.Visible = !simpleView; Page.DataBind(); } #endregion } catch (Exception ex) { Response.Write(ex.ToString()); Response.End(); } }
protected void Page_Load(object sender, System.EventArgs e) { //#ACQ8.20 Starts try { if ("1".Equals(Convert.ToString(ApplicationSettings.Parameters["TermsIsTranslatableDefault"].Value))) { IsTranslateDefaultOption = true; } else { IsTranslateDefaultOption = false; } } catch (Exception ex) { } //#ACQ8.20 Ends Page.Form.Attributes["autocomplete"] = "off"; #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 if (SessionState.User.IsReadOnly) { uwToolbar.Items.FromKeyButton("Save").Enabled = false; uwToolbar.Items.FromKeyButton("Delete").Enabled = false; } if (!SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_CARTOGRAPHY)) { UITools.HideToolBarSeparator(uwToolbar, "SaveSep"); UITools.HideToolBarButton(uwToolbar, "Save"); UITools.HideToolBarSeparator(uwToolbar, "DeleteSep"); UITools.HideToolBarButton(uwToolbar, "Delete"); } try { if (Request["c"] != null) { InputFormContainerId = Convert.ToInt64(Request["c"]); } ifcObj = InputFormContainer.GetByKey(InputFormContainerId); if (Request["f"] != null) { InputFormId = Convert.ToInt32(Request["f"]); } if (!Page.IsPostBack) { UpdateDataEdit(); WebSpellChecker1.WebSpellCheckerDialogPage += "?i=0&c=" + ifcObj.ContainerId.ToString(); } dgValues.DisplayLayout.ClientSideEvents.ColumnHeaderClickHandler = "dgValues_ColumnHeaderClickHandler"; } catch { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>parent.close();</script>"); } }
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>"); } }