From 2dd19e6c3e20b1fdcea21cec58cb93c3bd5f9926 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Tue, 10 May 2022 16:28:24 +0200 Subject: [PATCH] MS --- GUIs.ZooFlow/App.config | 2 +- GUIs.ZooFlow/ClassInit.vb | 3 +- GUIs.ZooFlow/My Project/Settings.Designer.vb | 4 +- GUIs.ZooFlow/My Project/Settings.settings | 2 +- GUIs.ZooFlow/frmFlowForm.Designer.vb | 96 ++++++++++++++------ GUIs.ZooFlow/frmFlowForm.resx | 5 +- GUIs.ZooFlow/frmFlowForm.vb | 68 +++++++++++++- 7 files changed, 143 insertions(+), 37 deletions(-) diff --git a/GUIs.ZooFlow/App.config b/GUIs.ZooFlow/App.config index 3b275055..c913810d 100644 --- a/GUIs.ZooFlow/App.config +++ b/GUIs.ZooFlow/App.config @@ -23,7 +23,7 @@ True - PROD + DEV diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index 147e5d1a..6a5ad970 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -192,7 +192,8 @@ Public Class ClassInit Case MODULE_ZOOFLOW HandleModuleInfo(MyApplication, oType, oRow) - + Case MODULE_PROCESS_MANAGER + HandleModuleInfo(MyApplication, oType, oRow) End Select Next diff --git a/GUIs.ZooFlow/My Project/Settings.Designer.vb b/GUIs.ZooFlow/My Project/Settings.Designer.vb index b3eed08f..b39b31fb 100644 --- a/GUIs.ZooFlow/My Project/Settings.Designer.vb +++ b/GUIs.ZooFlow/My Project/Settings.Designer.vb @@ -14,7 +14,7 @@ Option Explicit On _ Partial Friend NotInheritable Class Settings Inherits Global.System.Configuration.ApplicationSettingsBase @@ -98,7 +98,7 @@ Partial Friend NotInheritable Class Settings _ + Global.System.Configuration.DefaultSettingValueAttribute("DEV")> _ Public ReadOnly Property UserConfig_Prefix() As String Get Return CType(Me("UserConfig_Prefix"),String) diff --git a/GUIs.ZooFlow/My Project/Settings.settings b/GUIs.ZooFlow/My Project/Settings.settings index bbfafb6f..05598171 100644 --- a/GUIs.ZooFlow/My Project/Settings.settings +++ b/GUIs.ZooFlow/My Project/Settings.settings @@ -25,7 +25,7 @@ - PROD + DEV \ No newline at end of file diff --git a/GUIs.ZooFlow/frmFlowForm.Designer.vb b/GUIs.ZooFlow/frmFlowForm.Designer.vb index 094cda1a..15eaae55 100644 --- a/GUIs.ZooFlow/frmFlowForm.Designer.vb +++ b/GUIs.ZooFlow/frmFlowForm.Designer.vb @@ -39,8 +39,8 @@ Partial Class frmFlowForm Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() Me.ZooFlowBeendenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) - Me.PictureBoxPM = New DevExpress.XtraEditors.SvgImageBox() Me.PictureBoxSearch = New DevExpress.XtraEditors.SvgImageBox() + Me.PictureBoxPM = New DevExpress.XtraEditors.SvgImageBox() Me.TimerCheckFolderWatchTable = New System.Windows.Forms.Timer(Me.components) Me.pnlQuicksearch1 = New System.Windows.Forms.Panel() Me.txtQuicksearch1 = New DevExpress.XtraEditors.TextEdit() @@ -74,10 +74,13 @@ Partial Class frmFlowForm Me.colSecondary = New DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn() Me.LabelControl1 = New DevExpress.XtraEditors.LabelControl() Me.AdornerUIManager1 = New DevExpress.Utils.VisualEffects.AdornerUIManager(Me.components) - Me.TaskBadge = New DevExpress.Utils.VisualEffects.Badge() + Me.PMTaskBadgeInd = New DevExpress.Utils.VisualEffects.Badge() + Me.PMTaskBadgeGroup = New DevExpress.Utils.VisualEffects.Badge() + Me.PMTaskBadgeIndividual = New DevExpress.Utils.VisualEffects.Badge() + Me.TimerDisplay = New System.Windows.Forms.Timer(Me.components) Me.ContextMenuSystray.SuspendLayout() - CType(Me.PictureBoxPM, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBoxSearch, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBoxPM, System.ComponentModel.ISupportInitialize).BeginInit() Me.pnlQuicksearch1.SuspendLayout() CType(Me.txtQuicksearch1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureEditQuicksearch1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() @@ -155,20 +158,6 @@ Partial Class frmFlowForm Me.ZooFlowBeendenToolStripMenuItem.Size = New System.Drawing.Size(169, 22) Me.ZooFlowBeendenToolStripMenuItem.Text = "ZooFlow beenden" ' - 'PictureBoxPM - ' - Me.PictureBoxPM.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.PictureBoxPM.Cursor = System.Windows.Forms.Cursors.Hand - Me.PictureBoxPM.ItemHitTestType = DevExpress.XtraEditors.ItemHitTestType.BoundingBox - Me.PictureBoxPM.Location = New System.Drawing.Point(21, 6) - Me.PictureBoxPM.Name = "PictureBoxPM" - Me.PictureBoxPM.Size = New System.Drawing.Size(158, 50) - Me.PictureBoxPM.SizeMode = DevExpress.XtraEditors.SvgImageSizeMode.Zoom - Me.PictureBoxPM.SvgImage = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.FLOW_Sidebar_Task_inaktiv1 - Me.PictureBoxPM.TabIndex = 14 - Me.PictureBoxPM.Text = "SvgImageBox1" - Me.ToolTip1.SetToolTip(Me.PictureBoxPM, "ProcessManager - Workflow") - ' 'PictureBoxSearch ' Me.PictureBoxSearch.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ @@ -184,6 +173,20 @@ Partial Class frmFlowForm Me.PictureBoxSearch.Text = "X" Me.ToolTip1.SetToolTip(Me.PictureBoxSearch, "FlowSearch öffnen") ' + 'PictureBoxPM + ' + Me.PictureBoxPM.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.PictureBoxPM.Cursor = System.Windows.Forms.Cursors.Hand + Me.PictureBoxPM.ItemHitTestType = DevExpress.XtraEditors.ItemHitTestType.BoundingBox + Me.PictureBoxPM.Location = New System.Drawing.Point(21, 6) + Me.PictureBoxPM.Name = "PictureBoxPM" + Me.PictureBoxPM.Size = New System.Drawing.Size(158, 50) + Me.PictureBoxPM.SizeMode = DevExpress.XtraEditors.SvgImageSizeMode.Zoom + Me.PictureBoxPM.SvgImage = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.FLOW_Sidebar_Task_inaktiv1 + Me.PictureBoxPM.TabIndex = 14 + Me.PictureBoxPM.Text = "SvgImageBox1" + Me.PictureBoxPM.Visible = False + ' 'TimerCheckFolderWatchTable ' Me.TimerCheckFolderWatchTable.Interval = 2000 @@ -494,19 +497,49 @@ Partial Class frmFlowForm ' 'AdornerUIManager1 ' - Me.AdornerUIManager1.Elements.Add(Me.TaskBadge) + Me.AdornerUIManager1.Elements.Add(Me.PMTaskBadgeInd) + Me.AdornerUIManager1.Elements.Add(Me.PMTaskBadgeGroup) + Me.AdornerUIManager1.Elements.Add(Me.PMTaskBadgeIndividual) Me.AdornerUIManager1.Owner = Me ' - 'TaskBadge - ' - Me.TaskBadge.Appearance.BackColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer)) - Me.TaskBadge.Appearance.Options.UseBackColor = True - Me.TaskBadge.Properties.Location = System.Drawing.ContentAlignment.BottomRight - Me.TaskBadge.Properties.Offset = New System.Drawing.Point(0, 0) - Me.TaskBadge.Properties.PaintStyle = DevExpress.Utils.VisualEffects.BadgePaintStyle.[Default] - Me.TaskBadge.Properties.Text = "0" - Me.TaskBadge.TargetElement = Me.PictureBoxPM - Me.TaskBadge.TargetElementRegion = DevExpress.Utils.VisualEffects.TargetElementRegion.Control + 'PMTaskBadgeInd + ' + Me.PMTaskBadgeInd.Appearance.BackColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer)) + Me.PMTaskBadgeInd.Appearance.Options.UseBackColor = True + Me.PMTaskBadgeInd.Properties.Location = System.Drawing.ContentAlignment.TopRight + Me.PMTaskBadgeInd.Properties.Offset = New System.Drawing.Point(0, 0) + Me.PMTaskBadgeInd.Properties.PaintStyle = DevExpress.Utils.VisualEffects.BadgePaintStyle.[Default] + Me.PMTaskBadgeInd.Properties.Text = "0" + Me.PMTaskBadgeInd.TargetElement = Me.PictureBoxPM + Me.PMTaskBadgeInd.TargetElementRegion = DevExpress.Utils.VisualEffects.TargetElementRegion.Control + Me.PMTaskBadgeInd.Visible = False + ' + 'PMTaskBadgeGroup + ' + Me.PMTaskBadgeGroup.Appearance.BackColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer)) + Me.PMTaskBadgeGroup.Appearance.Options.UseBackColor = True + Me.PMTaskBadgeGroup.Properties.Location = System.Drawing.ContentAlignment.BottomRight + Me.PMTaskBadgeGroup.Properties.Text = "0" + Me.PMTaskBadgeGroup.TargetElement = Me.PictureBoxPM + Me.PMTaskBadgeGroup.TargetElementRegion = DevExpress.Utils.VisualEffects.TargetElementRegion.Control + Me.PMTaskBadgeGroup.Visible = False + ' + 'PMTaskBadgeIndividual + ' + Me.PMTaskBadgeIndividual.Appearance.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(214, Byte), Integer), CType(CType(49, Byte), Integer)) + Me.PMTaskBadgeIndividual.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.PMTaskBadgeIndividual.Appearance.ForeColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer)) + Me.PMTaskBadgeIndividual.Appearance.Options.UseBackColor = True + Me.PMTaskBadgeIndividual.Appearance.Options.UseFont = True + Me.PMTaskBadgeIndividual.Appearance.Options.UseForeColor = True + Me.PMTaskBadgeIndividual.Properties.Location = System.Drawing.ContentAlignment.TopLeft + Me.PMTaskBadgeIndividual.Properties.PaintStyle = DevExpress.Utils.VisualEffects.BadgePaintStyle.Information + Me.PMTaskBadgeIndividual.Properties.Text = "0" + Me.PMTaskBadgeIndividual.TargetElement = Me.PictureBoxPM + ' + 'TimerDisplay + ' + Me.TimerDisplay.Interval = 60000 ' 'frmFlowForm ' @@ -532,8 +565,8 @@ Partial Class frmFlowForm Me.Text = "ZooFlow" Me.TransparencyKey = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(214, Byte), Integer), CType(CType(49, Byte), Integer)) Me.ContextMenuSystray.ResumeLayout(False) - CType(Me.PictureBoxPM, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBoxSearch, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBoxPM, System.ComponentModel.ISupportInitialize).EndInit() Me.pnlQuicksearch1.ResumeLayout(False) CType(Me.txtQuicksearch1.Properties, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureEditQuicksearch1.Properties, System.ComponentModel.ISupportInitialize).EndInit() @@ -582,7 +615,7 @@ Partial Class frmFlowForm Friend WithEvents Panel2 As Panel Friend WithEvents btnGlobixConfig As DevExpress.XtraBars.BarButtonItem Friend WithEvents AdornerUIManager1 As DevExpress.Utils.VisualEffects.AdornerUIManager - Friend WithEvents TaskBadge As DevExpress.Utils.VisualEffects.Badge + Friend WithEvents PMTaskBadgeInd As DevExpress.Utils.VisualEffects.Badge Friend WithEvents PictureEditQuicksearch1 As PictureEdit Friend WithEvents PictureEdit2 As PictureEdit Friend WithEvents Panel3 As Panel @@ -595,4 +628,7 @@ Partial Class frmFlowForm Friend WithEvents colPrimary As DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn Friend WithEvents GridBand1 As DevExpress.XtraGrid.Views.BandedGrid.GridBand Friend WithEvents LabelControl1 As LabelControl + Friend WithEvents PMTaskBadgeGroup As DevExpress.Utils.VisualEffects.Badge + Friend WithEvents TimerDisplay As Timer + Friend WithEvents PMTaskBadgeIndividual As DevExpress.Utils.VisualEffects.Badge End Class diff --git a/GUIs.ZooFlow/frmFlowForm.resx b/GUIs.ZooFlow/frmFlowForm.resx index ffbd0fcb..431850b9 100644 --- a/GUIs.ZooFlow/frmFlowForm.resx +++ b/GUIs.ZooFlow/frmFlowForm.resx @@ -2039,6 +2039,9 @@ - 17, 56 + 906, 17 + + + 1069, 17 \ No newline at end of file diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index f1ec74da..0d7655f9 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -333,7 +333,9 @@ Public Class frmFlowForm ' TODO: This needs an update of the function FNZF_GET_MODULE_INFO If My.Application.ModulesActive.Contains(MODULE_PROCESS_MANAGER) Then - + TimerDisplay.Enabled = True + PictureBoxPM.Visible = True + DISPLAY_TASKS() End If If IsNothing(My.Tables.DTIDB_CATALOG_USER) Then @@ -1192,14 +1194,33 @@ Public Class frmFlowForm Private Sub PictureBoxPM_Click(sender As Object, e As EventArgs) Handles PictureBoxPM.Click Try Dim oProcessManagerPath = Modules.GetProductProgramPath(DigitalData.Modules.Base.ECM.Product.ProcessManager) + If PM_Running() = True Then + NotifyIcon.ShowBalloonTip(30000, NI_TITLE, "TaskFlow already running", 1) + Exit Sub + End If + If oProcessManagerPath IsNot Nothing AndAlso IO.File.Exists(oProcessManagerPath) Then Process.Start(oProcessManagerPath) + Else + NotifyIcon.ShowBalloonTip(30000, NI_TITLE, "Path to TaskFlow not properly configured", 3) + End If Catch ex As Exception ShowErrorMessage(ex) End Try End Sub + Private Function PM_Running() As Boolean + Dim p() As Process + p = Process.GetProcessesByName("DD_ProcessManager") + If p.Count > 0 Then + ' Process is running + Return True + Else + ' Process is not running + Return False + End If + End Function Private Sub PictureBoxPM_MouseEnter(sender As Object, e As EventArgs) Handles PictureBoxPM.MouseEnter PictureBoxPM.SvgImage = My.Resources.FLOW_Sidebar_Task_aktiv1 End Sub @@ -1249,5 +1270,50 @@ Public Class frmFlowForm End Try End If End Sub + + Private Sub TimerDisplay_Tick(sender As Object, e As EventArgs) Handles TimerDisplay.Tick + DISPLAY_TASKS() + End Sub + Sub DISPLAY_TASKS() + Try + Dim oSQL = $"SELECT * FROM TBZF_USER_DISPLAY_JOBS WHERE USR_ID = {My.Application.User.UserId}" + Dim oDT As DataTable = My.Database.GetDatatable("TBZF_USER_DISPLAY_JOBS", oSQL, EDMI.API.Constants.DatabaseType.ECM, $"USR_ID = {My.Application.User.UserId}") + If Not IsNothing(oDT) Then + If oDT.Rows.Count > 0 Then + Dim oTooLTip = "TaskFlow " + PMTaskBadgeGroup.Visible = False + PMTaskBadgeInd.Visible = False + PMTaskBadgeIndividual.Visible = False + For Each oRow As DataRow In oDT.Rows + If oRow.Item("JOB_TITLE") = "PM_INDIVIDUAL_JOB" Then + PMTaskBadgeInd.Properties.Text = oRow.Item("DESCR") + PMTaskBadgeIndividual.Properties.Text = oRow.Item("DESCR") + PMTaskBadgeInd.Visible = True + PMTaskBadgeIndividual.Visible = True + oTooLTip += $"({PMTaskBadgeInd.Properties.Text} Individual" + ElseIf oRow.Item("JOB_TITLE") = "PM_GROUP_JOB" Then + PMTaskBadgeGroup.Properties.Text = oRow.Item("DESCR") + oTooLTip += $"- and {PMTaskBadgeGroup.Properties.Text} Group-" + PMTaskBadgeGroup.Visible = True + End If + Next + oTooLTip += $"Tasks)" + PictureBoxPM.ToolTip = oTooLTip + Else + PMTaskBadgeGroup.Visible = False + PMTaskBadgeInd.Visible = False + PMTaskBadgeIndividual.Visible = False + End If + Else + PMTaskBadgeGroup.Visible = False + PMTaskBadgeInd.Visible = False + PMTaskBadgeIndividual.Visible = False + End If + + + Catch ex As Exception + + End Try + End Sub End Class