This commit is contained in:
2022-05-10 16:28:24 +02:00
parent 6e8383d48d
commit 2dd19e6c3e
7 changed files with 142 additions and 36 deletions

View File

@@ -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