Ejemplo n.º 1
0
		private static void RegisterEditorImageManagerAction(BaseSystemPage page)
		{
			Type t = page.GetType();
			string scriptName = "_kh_ImageManagerAction";
            using (System.IO.StringWriter sw = new System.IO.StringWriter())
            {
                //sw.WriteLine("var RadEditorClientObject = null;");
                sw.WriteLine("RadEditorCommandList[\"Image Manager\"] = function(commandName, editor, oTool) ");
                sw.WriteLine("{");
                sw.WriteLine("	var props='center:yes; help:no; resizable:yes; dialogHeight:500px; dialogWidth:540px;'; ");
                sw.WriteLine("	var retVal=window.showModalDialog('ImageSelector.aspx?system={0}', '', props); ", page.ITATSystem.ID);
                //NOTE: retVal is expected to be an object with properties named 'id' and 'name'			
                sw.WriteLine("	if (retVal) ");
                sw.WriteLine("	{");
                sw.WriteLine("		editor.PasteHtml('<img src=\"ShowImage.ashx?id=' + retVal.id + '\"/>');");
                sw.WriteLine("	}");
                sw.WriteLine("}");

                if (!page.ClientScript.IsStartupScriptRegistered(t, scriptName))
                    page.ClientScript.RegisterStartupScript(t, scriptName, sw.ToString(), true);
            }
		}
Ejemplo n.º 2
0
		public static void InitializeToolBarItems(BaseSystemPage page, Telerik.WebControls.RadEditorUtils.ToolbarDropDown tdd)
		{
			tdd.Items.Clear();
			tdd.DropDownHeight = Unit.Parse("240px");
			tdd.DropDownWidth = Unit.Parse("180px");
			tdd.ShowText = false;
			RegisterEditorInsertTermAction(page);
			RegisterEditorImageManagerAction(page);
		}
Ejemplo n.º 3
0
		public static void AddTermsToolBarItems(BaseSystemPage page, Telerik.WebControls.RadEditorUtils.ToolbarDropDown tdd, List<Term> terms)
		{
            //Filter out PlaceHolderAttachments and PlaceHolderComments.

            terms = BasicTerms.FindTermsOfTypeExcluding(terms, TermType.PlaceHolderComments | TermType.PlaceHolderAttachments);

            List<string> sortedTerms = new List<string>();

            //TODO*: In the case of terms with embedded 'pipe' symbols, if the embedded text is not of a 'fixed' nature (MSOTerm, External), then 
            //the handling of term name changes may be broken with respect to TermID's.
			foreach (Term term in terms)
			{
				switch (term.TermType)
				{
					case TermType.None:
						break;
					case TermType.MSO:
						MSOTerm msoTerm = term as MSOTerm;
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.MSOName));
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.Address1Name));
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.Address2Name));
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.CityName));
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.StateName));
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.ZipName));
						sortedTerms.Add(string.Format("{0} | {1}", msoTerm.Name, msoTerm.PhoneName));
						break;
					case TermType.Renewal:
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_EffectiveDate));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_InitialTermDuration));
						if (((RenewalTerm)term).IsTypeNone)
						{
                            sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_ExpirationDate));
						}
						else
						{
                            sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_RenewalDate));
                            sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_RenewalTermDuration));
						}
						break;
					case TermType.Facility:
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_FacilityName));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_SAPID));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_FacilityType));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_Address));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_City));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_County));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_State));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_StateCode));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_Zip));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_Phone));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_Fax));
                        sortedTerms.Add(term.Name + string.Format(" | {0}", XMLNames._TPS_LegalEntityName));
						break;
					case TermType.External:
					   foreach (ExternalInterfaceSearchableField searchableField  in ((Business.ExternalTerm)term).InterfaceConfig.SearchableFields)
                           sortedTerms.Add(string.Format("{0} | {1}", term.Name, searchableField.Name));
					   break;
					case TermType.ComplexList:
					case TermType.Text:
					case TermType.Date:
					case TermType.PickList:
					case TermType.Link:
                       sortedTerms.Add(term.Name);
						break;
                    default:
                        throw new Exception(string.Format("Term type '{0}' not handled", term.TermType.ToString()));
				}
			}

            sortedTerms.Sort();

            foreach (string term in sortedTerms)
            {
                AddTermsToolBarItem(tdd, term);
            }
      
		}
Ejemplo n.º 4
0
		public static void AddSpecialToolBarItems(BaseSystemPage page, Telerik.WebControls.RadEditorUtils.ToolbarDropDown tdd)
		{
            AddTermsToolBarItem(tdd, "* " + page.ITATSystem.ManagedItemName + XMLNames._SpecialTermName_Number);
            AddTermsToolBarItem(tdd, "* " + XMLNames._SpecialTermName_Status);
            AddTermsToolBarItem(tdd, "* " + XMLNames._SpecialTermName_WorkflowState);
		}