Ejemplo n.º 1
0
    protected void tab_DataBound(object sender, EventArgs e)
    {
        PXButton button = (PXButton)this.tab.FindControl("btnChangePassword");

        if (button != null)
        {
            PXSmartPanel panel = (PXSmartPanel)this.tab.FindControl("pnlChangePassword");
            PXTextEdit   edit  = (PXTextEdit)panel.FindControl("edNewPassword");
            if (edit != null)
            {
                button.Enabled = edit.Enabled;
                button.Hidden  = edit.Hidden;
            }
        }

        int index;

        if (int.TryParse(Request["tab"], out index) && index < this.tab.Items.Count)
        {
            this.tab.SelectedIndex = index;
        }

        var outlookLinkControl = (HyperLink)tab.Items["EmailSettings"].TemplateContainer.FindControl("form2").FindControl("OutlookAddin");

        outlookLinkControl.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.Web.Controls.Messages.OutlookAddin);
    }
Ejemplo n.º 2
0
    private void AddFileControls(PXSmartPanel smartPanel = null)
    {
        if (smartPanel == null)
        {
            smartPanel = (PXSmartPanel)form.FindControl("edAttachmentsPanel");
        }

        var graph       = (OUSearchMaint)ds.DataGraph;
        var attachments = graph.APBillAttachments.Select()
                          .AsEnumerable()
                          .Select(a => (OUAPBillAttachment)a)
                          .ToArray();

        for (var i = 0; i < attachments.Length; i++)
        {
            var id             = string.Format("edCheckboxFile{0}", i);
            var itemIdCaptured = attachments[i].ItemId;
            var idCaptured     = attachments[i].Id;

            if (smartPanel.FindControl(id) != null)
            {
                continue;
            }

            var fieldName = string.Format("File{0}", i);

            if (!graph.Filter.Cache.Fields.Contains(fieldName))
            {
                graph.Filter.Cache.Fields.Add(fieldName);

                graph.FieldSelecting.AddHandler(_primaryViewName, fieldName, (s, e) =>
                {
                    graph.OUAPBillAttachmentSelectFileFieldSelecting(s, e, itemIdCaptured, idCaptured);
                });

                graph.FieldUpdating.AddHandler(_primaryViewName, fieldName, (s, e) =>
                {
                    graph.OUAPBillAttachmentSelectFileFieldUpdating(s, e, itemIdCaptured, idCaptured);
                });
            }

            var checkboxFile = new PXCheckBox
            {
                ID            = id,
                CommitChanges = true,
                DataField     = fieldName,
            };

            checkboxFile.ClientEvents.ValueChanged = "onFileSelect";
            checkboxFile.ApplyStyleSheetSkin(this);
            smartPanel.Controls.Add(checkboxFile);

            var formDataProvider = form.DataProviders[_primaryViewName];
            formDataProvider.DataControls[id] = checkboxFile;
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PXSmartPanel panel = (PXSmartPanel)dlgUploadFile.FindControl(dlgUploadFile.PanelID);

        if (panel != null)
        {
            panel.Key = "UploadVersionPanel";
        }
        Control grid = this.tab.FindControl("gridAvailableVersions");

        if (!this.Page.IsCallback)
        {
            this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "gridID", "var gridRevisionsID=\"" + grid.ClientID + "\";", true);
            this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "pnlNewRevID", "var pnlNewRevID=\"" + panel.ClientID + "\";", true);
        }
    }
Ejemplo n.º 4
0
    protected void tab_DataBound(object sender, EventArgs e)
    {
        PXButton button = (PXButton)this.tab.FindControl("btnChangePassword");

        if (button != null)
        {
            PXSmartPanel panel = (PXSmartPanel)this.tab.FindControl("pnlChangePassword");
            PXTextEdit   edit  = (PXTextEdit)panel.FindControl("edNewPassword");
            if (edit != null)
            {
                button.Enabled = edit.Enabled;
                button.Hidden  = edit.Hidden;
            }
        }

        int index;

        if (int.TryParse(Request["tab"], out index) && index < this.tab.Items.Count)
        {
            this.tab.SelectedIndex = index;
        }
    }
Ejemplo n.º 5
0
    private Control GenerateFilesLinkPanel()
    {
        PXSmartPanel result = new PXSmartPanel();

        result.ID                   = "filesLinkPanel";
        result.Key                  = "FilesLink";
        result.AllowResize          = false;
        result.AutoCallBack.Enabled = true;
        result.AutoCallBack.Command = "Refresh";
        result.AutoCallBack.Target  = "form";
        result.Style[HtmlTextWriterStyle.Position] = "absolute";
        result.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(250).ToString();
        result.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(250).ToString();
        result.Width  = Unit.Pixel(400);
        result.Height = Unit.Pixel(150);

        PXFormView form = new PXFormView();

        form.ID            = "form";
        form.Caption       = "WebDAV Links for the list of files";
        form.AllowCollapse = false;
        form.DataSourceID  = "ds";
        form.DataMember    = "FilesLink";
        form.Style[HtmlTextWriterStyle.Position] = "absolute";
        form.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(9).ToString();
        form.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(9).ToString();
        form.Width  = Unit.Pixel(363);
        form.Height = Unit.Pixel(100);

        PXLabel extLabel = new PXLabel("External Link");

        extLabel.ID = "lblExt";
        extLabel.Style[HtmlTextWriterStyle.Position] = "absolute";
        extLabel.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(9).ToString();
        extLabel.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(9).ToString();
        extLabel.ApplyStyleSheetSkin(Page);
        form.TemplateContainer.Controls.Add(extLabel);
        PXTextEdit extEdit = new PXTextEdit();

        extEdit.ID        = "edExt";
        extEdit.LabelID   = "lblExt";
        extEdit.DataField = "InternalPath";
        extEdit.ReadOnly  = true;
        extEdit.Style[HtmlTextWriterStyle.Position] = "absolute";
        extEdit.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(81).ToString();
        extEdit.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(9).ToString();
        extEdit.Width = Unit.Pixel(250);
        extEdit.ApplyStyleSheetSkin(Page);
        form.TemplateContainer.Controls.Add(extEdit);

        PXLabel pubLabel = new PXLabel("Public Link");

        pubLabel.ID = "lblPub";
        pubLabel.Style[HtmlTextWriterStyle.Position] = "absolute";
        pubLabel.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(9).ToString();
        pubLabel.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(36).ToString();
        pubLabel.ApplyStyleSheetSkin(Page);
        form.TemplateContainer.Controls.Add(pubLabel);
        PXTextEdit pubEdit = new PXTextEdit();

        pubEdit.ID        = "edPub";
        pubEdit.LabelID   = "lblPub";
        pubEdit.DataField = "ExternalPath";
        pubEdit.ReadOnly  = true;
        pubEdit.Style[HtmlTextWriterStyle.Position] = "absolute";
        pubEdit.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(81).ToString();
        pubEdit.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(36).ToString();
        pubEdit.Width = Unit.Pixel(250);
        pubEdit.ApplyStyleSheetSkin(Page);
        form.TemplateContainer.Controls.Add(pubEdit);

        PXButton closeButton = new PXButton();

        closeButton.Text         = "Close";
        closeButton.DialogResult = WebDialogResult.Cancel;
        closeButton.Style[HtmlTextWriterStyle.Position] = "absolute";
        closeButton.Style[HtmlTextWriterStyle.Left]     = Unit.Pixel(247).ToString();
        closeButton.Style[HtmlTextWriterStyle.Top]      = Unit.Pixel(63).ToString();
        closeButton.Width = Unit.Pixel(90);
        closeButton.ApplyStyleSheetSkin(Page);
        form.TemplateContainer.Controls.Add(closeButton);

        form.ApplyStyleSheetSkin(Page);

        result.Controls.Add(form);
        return(result);
    }
Ejemplo n.º 6
0
        private void AppendPanels(ITitleModuleController controller)
        {
            controller.Page.ClientScript.RegisterClientScriptInclude(controller.Page.GetType(), "Console", VirtualPathUtility.ToAbsolute("~/Scripts/console.js"));

            PXSmartPanel panel = new PXSmartPanel
            {
                ID             = _panelID,
                Width          = Unit.Pixel(750),
                Height         = Unit.Pixel(350),
                Caption        = "Acumatica Console",
                CaptionVisible = true,
                AutoRepaint    = true,
                BlockPage      = false,
                LoadOnDemand   = true, //Needed otherwise ClientEvents.AfterShow won't run on 2nd open of the panel
                AutoReload     = true,
                Position       = PanelPosition.Manual,
                Overflow       = OverflowType.Hidden
            };


            panel.ClientEvents.BeforeLoad = "BeforeLoadConsolePanel";
            panel.ClientEvents.BeforeLoad = "AfterLoadConsolePanel";
            panel.ClientEvents.BeforeShow = "BeforeShowConsolePanel";
            panel.ClientEvents.AfterShow  = "AfterShowConsolePanel";
            panel.ClientEvents.BeforeHide = "BeforeHideConsolePanel";
            panel.ClientEvents.AfterHide  = "AfterHideConsolePanel";

            panel.ApplyStyleSheetSkin(controller.Page);

            var ds       = PXPage.GetDefaultDataSource(controller.Page);
            var viewName = ds.DataGraph.PrimaryView;

            var form = new PXFormView()
            {
                ID           = "frmAcuShell",
                SkinID       = "Transparent",
                DataSourceID = ds.ID,
                DataMember   = "ConsoleView",
                AutoRepaint  = true
            };

            form.ApplyStyleSheetSkin(controller.Page);
            form.AutoSize.Enabled = true;

            var cc            = form.TemplateContainer.Controls;
            var consoleOutput = new PXHtmlView {
                ID = "pnlConsoleOutput", DataField = nameof(AcuShell.ConsoleFields.Output), Height = Unit.Percentage(100), Width = Unit.Percentage(100), SkinID = "Label"
            };

            consoleOutput.AutoSize.Enabled   = true; //TODO: Fix resizing of the console output... doesn't work right now
            consoleOutput.AutoSize.MinHeight = 500;
            consoleOutput.AutoSize.Container = DockContainer.Parent;
            cc.Add(consoleOutput);
            cc.Add(new PXTextEdit {
                ID = "pnlConsoleInput", DataField = nameof(AcuShell.ConsoleFields.Input)
            });
            cc.Add(new PXTextEdit {
                ID = "pnlGraphType", DataField = nameof(AcuShell.ConsoleFields.GraphType)
            });

            ((IParserAccessor)panel).AddParsedSubObject(form);

            var editor = new System.Web.UI.WebControls.Panel {
                ID = "pnlConsoleEditor", Height = Unit.Pixel(150), Width = Unit.Percentage(100)
            };

            ((IParserAccessor)panel).AddParsedSubObject(editor);

            controller.AppendControl(panel);
        }
Ejemplo n.º 7
0
	/// <summary>
	/// Create SmartPanel to render navigation tree.
	/// </summary>
	private PXSmartPanel CreateNavigationPanel(SiteMapNode node, bool active, object index)
	{
		string panelID = "sp" + index.ToString();
		bool favorites = (node == null);
		string trId = favorites ? _favTreeID : ("tree" + index.ToString());

		PXSmartPanel panel = new PXSmartPanel();
		panel.ID = panelID;
		panel.Key = favorites ? _favorites : node.Key;
		panel.LoadOnDemand = !active;
		panel.AllowResize = panel.AllowMove = false;
		panel.RenderVisible = active;
		panel.AutoSize.Enabled = true;
		panel.Position = PanelPosition.Original;

		if ((this.IsCallback && !this.IsReloadMenuPanel) || active)
		{
			SiteMapDataSource ds = new SiteMapDataSource();
			ds.ID = "ds" + index.ToString();
			ds.ShowStartingNode = false;
			panel.Controls.Add(ds);

			PXSiteMapNode pxNode = node as PXSiteMapNode;
			Control content = null;
			PXWikiProvider wp = PXSiteMap.WikiProvider;
			
			if (favorites)
			{
				ds.Provider = PXSiteMap.FavoritesProvider;
				ds.StartingNodeUrl = System.Web.SiteMap.RootNode.Url;
				content = CreateTree(ds, trId);
			}
			else if (wp.FindSiteMapNodeFromKey(pxNode.NodeID) != null)
			{
				if (wp.GetWikiID(pxNode.Title) != Guid.Empty || wp.GetWikiIDFromUrl(pxNode.Url) != Guid.Empty)
					content = CreateWikiTree(pxNode, trId);
				if (PXSiteMap.IsPortal) 
					this.moduleLink.Visible = true;
			}
			else
			{
				INavigateUIData dataItem = node as INavigateUIData;
				if (string.IsNullOrEmpty(dataItem.NavigateUrl))
				{
					PXSiteMap.Provider.SetCurrentNode(PXSiteMap.Provider.FindSiteMapNodeFromKey(node.Key));
					ds.StartFromCurrentNode = true;
				}
				else ds.StartingNodeUrl = dataItem.NavigateUrl;
				content = CreateTree(ds, trId);
			}
			if (content != null) panel.Controls.Add(content);
		}
		return panel;
	}
Ejemplo n.º 8
0
	private Control GenerateFilesLinkPanel()
	{
		PXSmartPanel result = new PXSmartPanel();
		result.ID = "filesLinkPanel";
		result.Key = "FilesLink";
		result.AllowResize = false;
		result.AutoCallBack.Enabled = true;
		result.AutoCallBack.Command = "Refresh";
		result.AutoCallBack.Target = "form";
		result.Style[HtmlTextWriterStyle.Position] = "absolute";
		result.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(250).ToString();
		result.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(250).ToString();
		result.Width = Unit.Pixel(400);
		result.Height = Unit.Pixel(150);

		PXFormView form = new PXFormView();
		form.ID = "form";
		form.Caption = "WebDAV Links for the list of files";
		form.AllowCollapse = false;
		form.DataSourceID = "ds";
		form.DataMember = "FilesLink";
		form.Style[HtmlTextWriterStyle.Position] = "absolute";
		form.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString();
		form.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString();
		form.Width = Unit.Pixel(363);
		form.Height = Unit.Pixel(100);

		PXLabel extLabel = new PXLabel("External Link");
		extLabel.ID = "lblExt";
		extLabel.Style[HtmlTextWriterStyle.Position] = "absolute";
		extLabel.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString();
		extLabel.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString();
		extLabel.ApplyStyleSheetSkin(Page);
		form.TemplateContainer.Controls.Add(extLabel);
		PXTextEdit extEdit = new PXTextEdit();
		extEdit.ID = "edExt";
		extEdit.LabelID = "lblExt";
		extEdit.DataField = "InternalPath";
		extEdit.ReadOnly = true;
		extEdit.Style[HtmlTextWriterStyle.Position] = "absolute";
		extEdit.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(81).ToString();
		extEdit.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString();
		extEdit.Width = Unit.Pixel(250);
		extEdit.ApplyStyleSheetSkin(Page);
		form.TemplateContainer.Controls.Add(extEdit);

		PXLabel pubLabel = new PXLabel("Public Link");
		pubLabel.ID = "lblPub";
		pubLabel.Style[HtmlTextWriterStyle.Position] = "absolute";
		pubLabel.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString();
		pubLabel.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(36).ToString();
		pubLabel.ApplyStyleSheetSkin(Page);
		form.TemplateContainer.Controls.Add(pubLabel);
		PXTextEdit pubEdit = new PXTextEdit();
		pubEdit.ID = "edPub";
		pubEdit.LabelID = "lblPub";
		pubEdit.DataField = "ExternalPath";
		pubEdit.ReadOnly = true;
		pubEdit.Style[HtmlTextWriterStyle.Position] = "absolute";
		pubEdit.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(81).ToString();
		pubEdit.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(36).ToString();
		pubEdit.Width = Unit.Pixel(250);
		pubEdit.ApplyStyleSheetSkin(Page);
		form.TemplateContainer.Controls.Add(pubEdit);

		PXButton closeButton = new PXButton();
		closeButton.Text = "Close";
		closeButton.DialogResult = WebDialogResult.Cancel;
		closeButton.Style[HtmlTextWriterStyle.Position] = "absolute";
		closeButton.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(247).ToString();
		closeButton.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(63).ToString();
		closeButton.Width = Unit.Pixel(90);
		closeButton.ApplyStyleSheetSkin(Page);
		form.TemplateContainer.Controls.Add(closeButton);

		form.ApplyStyleSheetSkin(Page);

		result.Controls.Add(form);
		return result;
	}