Browse Source

Added event manager to PRS desktop

Kenric Nugteren 5 months ago
parent
commit
a5ac6d8654

+ 1 - 0
prs.desktop/Forms/DeliveryBuilder.xaml.cs

@@ -15,6 +15,7 @@ using InABox.WPF;
 using Motorola.Snapi;
 using Motorola.Snapi;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.EventArguments;
 using Motorola.Snapi.EventArguments;
+using EventType = Motorola.Snapi.Constants.Enums.EventType;
 
 
 namespace PRSDesktop
 namespace PRSDesktop
 {
 {

+ 7 - 0
prs.desktop/MainWindow.xaml

@@ -161,6 +161,13 @@
                             Size="Middle"
                             Size="Middle"
                             HorizontalAlignment="Stretch"
                             HorizontalAlignment="Stretch"
                             Foreground="{Binding Path=(themes:ThemeManager.BackstageForegroundBrush)}" />
                             Foreground="{Binding Path=(themes:ThemeManager.BackstageForegroundBrush)}" />
+                        <fluent:Button
+                            x:Name="EventList"
+                            Header="Events"
+                            Click="EventList_Click"
+                            Size="Middle"
+                            HorizontalAlignment="Stretch"
+                            Foreground="{Binding Path=(themes:ThemeManager.BackstageForegroundBrush)}" />
 
 
                         <fluent:SeparatorTabItem x:Name="BackstageSeparator5" Height="20" />
                         <fluent:SeparatorTabItem x:Name="BackstageSeparator5" Height="20" />
 
 

+ 21 - 455
prs.desktop/MainWindow.xaml.cs

@@ -776,7 +776,8 @@ public partial class MainWindow : IPanelHostControl
         SystemLogsButton.Visibility = Visibility.Visible;
         SystemLogsButton.Visibility = Visibility.Visible;
 
 
         SetFrameworkItemVisibility(DocumentTypeList, ClientFactory.IsSupported<DocumentType>() && Security.IsAllowed<CanViewDocumentTypes>());
         SetFrameworkItemVisibility(DocumentTypeList, ClientFactory.IsSupported<DocumentType>() && Security.IsAllowed<CanViewDocumentTypes>());
-        SetVisibleIfAny(BackstageSeparator2, DocumentTypeList);
+        SetFrameworkItemVisibility(EventList, Security.IsAllowed<CanManageEvents>());
+        SetVisibleIfAny(BackstageSeparator2, DocumentTypeList, EventList);
 
 
         //SetModuleVisibility<>(VideoRecordingButton, Security.IsAllowed<CanRecordScreen>());
         //SetModuleVisibility<>(VideoRecordingButton, Security.IsAllowed<CanRecordScreen>());
 
 
@@ -2165,6 +2166,19 @@ public partial class MainWindow : IPanelHostControl
         menu.IsOpen = true;
         menu.IsOpen = true;
     }
     }
 
 
+    private void Issues_Click(object sender, RoutedEventArgs e)
+    {
+        try
+        {
+            IssuesWindow.Execute();
+            CheckSupportTicketStatus();
+        }
+        catch(Exception err)
+        {
+            MessageWindow.ShowError("Could not load issues.", err);
+        }
+    }
+
     private void StartForm<TEntityForm, TEntity, TEntityLink>(DigitalForm form)
     private void StartForm<TEntityForm, TEntity, TEntityLink>(DigitalForm form)
         where TEntityForm : EntityForm<TEntity, TEntityLink, TEntityForm>, new()
         where TEntityForm : EntityForm<TEntity, TEntityLink, TEntityForm>, new()
         where TEntity : Entity, new()
         where TEntity : Entity, new()
@@ -2490,382 +2504,6 @@ public partial class MainWindow : IPanelHostControl
         PanelHost.IncrementTrackingModuleKey();
         PanelHost.IncrementTrackingModuleKey();
     }
     }
 
 
-    #region Recording
-
-    //private IntPtr myHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
-    //{
-
-    //    switch (msg)
-    //    {
-    //        case 0x100:
-    //            if (_subject != null)
-    //            {
-    //                _recorder.Stop();
-    //                pausestarted = DateTime.Now;
-    //                _subject.OnNext(new WampEvent() { Arguments = new[] { "EDIT" } });
-    //            }
-    //            break;
-
-    //        default:
-    //            messages.TryGetValue(msg, out int value);
-    //            messages[msg] = value + 1;
-    //            break;                  
-    //    }
-    //    return IntPtr.Zero;
-    //}
-
-    // private void RecordScreenButton_Click(object sender, RoutedEventArgs e)
-    // {
-    //     ToggleRecording();
-    // }
-    //
-    // private bool ToggleRecording()
-    // {
-    //     if (!Security.IsAllowed<CanRecordScreen>())
-    //         return true;
-    //
-    //     if (_recorder is null)
-    //     {
-    //         var windowInteropHelper = new WindowInteropHelper(this);
-    //         var screen = Screen.FromHandle(windowInteropHelper.Handle);
-    //         _screenleft = screen.WorkingArea.Left;
-    //         _screentop = screen.WorkingArea.Top;
-    //         _screenwidth = screen.WorkingArea.Width;
-    //         _screenheight = screen.WorkingArea.Height;
-    //
-    //         //VIDEO_WIDTH = _screenwidth;
-    //         //VIDEO_HEIGHT = _screenheight;
-    //
-    //         //SetupJPEGEncoder();
-    //
-    //         messages.Clear();
-    //         _bitmaps.Clear();
-    //
-    //         ConnectToRecordNotes();
-    //
-    //         StartAudio();
-    //
-    //         _recorder = new DispatcherTimer();
-    //         _recorder.Tick += (timer, args) => { TakeScreenShot(); };
-    //         _recorder.Interval = TimeSpan.FromMilliseconds(1000 / FRAMES_PER_SECOND);
-    //         _recorder.Start();
-    //
-    //
-    //         VideoRecordingStatus.Source = PRSDesktop.Resources.videorecording.AsBitmapImage();
-    //         RecordingNotesStatus.Source = PRSDesktop.Resources.speechbubble.AsGrayScale().AsBitmapImage();
-    //         RecordingNotesButton.Visibility = Visibility.Visible;
-    //         AudioRecordingStatus.Source = PRSDesktop.Resources.audiorecording.AsGrayScale().AsBitmapImage();
-    //         AudioRecordingButton.Visibility = Visibility.Visible;
-    //     }
-    //     else
-    //     {
-    //         using (new WaitCursor())
-    //         {
-    //             StopRecording();
-    //
-    //             _recorder.Stop();
-    //             _recorder = null;
-    //
-    //             DisconnectRecorderNotes();
-    //
-    //             VideoRecordingStatus.Source = PRSDesktop.Resources.videorecording.AsGrayScale().AsBitmapImage();
-    //             RecordingNotesStatus.Source = PRSDesktop.Resources.speechbubble.AsGrayScale().AsBitmapImage();
-    //             RecordingNotesButton.Visibility = Visibility.Hidden;
-    //             AudioRecordingStatus.Source = PRSDesktop.Resources.audiorecording.AsGrayScale().AsBitmapImage();
-    //             AudioRecordingButton.Visibility = Visibility.Hidden;
-    //
-    //             var filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos),
-    //                 string.Format("PRS Screen Recording {0:yyyy-MM-dd hh-mm-ss-ff}.avi", DateTime.Now));
-    //             ProcessScreenShots(filename);
-    //         }
-    //     }
-    //
-    //     return true;
-    // }
-    //
-    // private void StopRecording()
-    // {
-    //     try
-    //     {
-    //         _audio?.StopRecording();
-    //         AudioRecordingStatus.Source = PRSDesktop.Resources.audiorecording.AsGrayScale().AsBitmapImage();
-    //     }
-    //     catch (Exception e)
-    //     {
-    //         Logger.Send(LogType.Error, "", string.Format("Unable to stop Audio Recording: {0}\n{1}", e.Message, e.StackTrace));
-    //     }
-    // }
-    //
-    // private void StartAudio()
-    // {
-    //     _audioMuted = true;
-    //     _audioStream = new MemoryStream();
-    //     _audio = new WaveIn
-    //     {
-    //         DeviceNumber = 0,
-    //         WaveFormat = new WaveFormat(44100, 16, 2)
-    //     };
-    //     _audio.DataAvailable += (o, e) =>
-    //     {
-    //         var buf = _audioMuted ? new byte[e.BytesRecorded] : e.Buffer;
-    //         _audioStream.Write(buf, 0, e.BytesRecorded);
-    //     };
-    //
-    //     try
-    //     {
-    //         _audio.StartRecording();
-    //         AudioRecordingStatus.Source = PRSDesktop.Resources.audiorecording.AsBitmapImage();
-    //     }
-    //     catch (Exception e)
-    //     {
-    //         Logger.Send(LogType.Error, "", string.Format("Unable to start Audio Recording: {0}\n{1}", e.Message, e.StackTrace));
-    //         AudioRecordingStatus.Source = PRSDesktop.Resources.audiorecording.AsGrayScale().AsBitmapImage();
-    //     }
-    // }
-    //
-    // private bool ToggleRecordingAudio()
-    // {
-    //     if (!Security.IsAllowed<CanRecordScreen>())
-    //         return true;
-    //     if (_recorder != null)
-    //     {
-    //         _audioMuted = !_audioMuted;
-    //         AudioRecordingStatus.Source = _audioMuted
-    //             ? PRSDesktop.Resources.audiorecording.AsGrayScale().AsBitmapImage()
-    //             : PRSDesktop.Resources.audiorecording.AsBitmapImage();
-    //     }
-    //
-    //     return true;
-    // }
-    //
-    // private void DisconnectRecorderNotes()
-    // {
-    //     if (_client != null)
-    //     {
-    //         _client.WriteAsync("QUIT");
-    //         _client.StopAsync();
-    //         _client = null;
-    //     }
-    // }
-    //
-    // private void ConnectToRecordNotes()
-    // {
-    //     var filename = Debugger.IsAttached
-    //         ? "c:\\development\\comal\\prsrecordingnotes\\bin\\debug\\prsrecordingnotes.exe"
-    //         : Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "recordingnotes", "prsrecordingnotes.exe");
-    //     Logger.Send(LogType.Information, "", "Recording Notes: " + filename);
-    //     _recordingnotes = Process.Start(filename);
-    //
-    //     //PipeSecurity sec = new System.IO.Pipes.PipeSecurity();
-    //     //sec.SetAccessRule(new PipeAccessRule("Everyone", PipeAccessRights.ReadWrite, AccessControlType.Allow));
-    //     _client = new PipeServer<string>("PRSScreenRecorder", formatter:new BinaryFormatter()); //, sec);
-    //     _client.ClientConnected += (o, args) => args.Connection.WriteAsync("Connected to PRSScreenRecorder");
-    //     _client.MessageReceived += (o, args) =>
-    //     {
-    //         if (string.Equals(args.Message, "RESUME"))
-    //             Dispatcher.Invoke(() =>
-    //             {
-    //                 _audio?.StartRecording();
-    //                 totalpauses += DateTime.Now - pausestarted;
-    //                 _recorder?.Start();
-    //                 Activate();
-    //                 Focus();
-    //             });
-    //     };
-    //     _client.StartAsync();
-    // }
-    //
-    // private bool ShowRecordingNotes()
-    // {
-    //     if (_recorder != null)
-    //     {
-    //         _audio?.StopRecording();
-    //         _recorder.Stop();
-    //         pausestarted = DateTime.Now;
-    //         _client?.WriteAsync("EDIT");
-    //         //_subject.OnNext(new WampEvent() { Arguments = new[] { "EDIT" } });
-    //     }
-    //
-    //     return true;
-    // }
-
-    // private void TakeScreenShot()
-    // {
-    //     using (var bmp = new ScreenCapture().CaptureScreen(_screenleft, _screentop, _screenwidth, _screenheight))
-    //     {
-    //         var cursor = PointToScreen(Mouse.GetPosition(this));
-    //         using (var g = Graphics.FromImage(bmp))
-    //         {
-    //             var brush = new SolidBrush(System.Drawing.Color.FromArgb(128, 255, 255, 0));
-    //             g.FillEllipse(brush, new RectangleF((float)cursor.X - 25F, (float)cursor.Y - 25F, 50F, 50F));
-    //             var pen = new Pen(System.Drawing.Color.Black, 0.75F);
-    //             g.DrawLine(pen, (float)cursor.X - 10F, (float)cursor.Y, (float)cursor.X + 10F, (float)cursor.Y);
-    //             g.DrawLine(pen, (float)cursor.X, (float)cursor.Y - 10F, (float)cursor.X, (float)cursor.Y + 10F);
-    //         }
-    //
-    //         var key = DateTime.Now - totalpauses;
-    //
-    //
-    //         using (var reduced = ReduceBitmap(bmp, VIDEO_WIDTH, VIDEO_HEIGHT))
-    //         {
-    //             var ms = new MemoryStream();
-    //             reduced.Save(ms, ImageFormat.Png);
-    //             ms.Position = 0;
-    //             _bitmaps[key] = ms;
-    //         }
-    //     }
-    // }
-    //
-    // public Bitmap ReduceBitmap(Bitmap original, int reducedWidth, int reducedHeight)
-    // {
-    //     var reduced = new Bitmap(reducedWidth, reducedHeight);
-    //     using (var dc = Graphics.FromImage(reduced))
-    //     {
-    //         // Figure out the ratio
-    //         var ratioX = (double)reducedWidth / original.Width;
-    //         var ratioY = (double)reducedHeight / original.Height;
-    //         // use whichever multiplier is smaller
-    //         var ratio = ratioX < ratioY ? ratioX : ratioY;
-    //
-    //         // now we can get the new height and width
-    //         var newHeight = Convert.ToInt32(original.Height * ratio);
-    //         var newWidth = Convert.ToInt32(original.Width * ratio);
-    //
-    //         // Now calculate the X,Y position of the upper-left corner 
-    //         // (one of these will always be zero)
-    //         var posX = Convert.ToInt32((reducedWidth - original.Width * ratio) / 2);
-    //         var posY = Convert.ToInt32((reducedHeight - original.Height * ratio) / 2);
-    //
-    //         dc.InterpolationMode = InterpolationMode.HighQualityBicubic;
-    //
-    //         dc.Clear(System.Drawing.Color.Black); // white padding
-    //         //dc.DrawImage(original, posX, posY, newWidth, newHeight);
-    //         dc.DrawImage(original, new Rectangle(posX, posY, newWidth, newHeight), new Rectangle(0, 0, original.Width, original.Height),
-    //             GraphicsUnit.Pixel);
-    //     }
-    //
-    //     return reduced;
-    // }
-    //
-    // public static byte[] BitmapToByteArray(Bitmap bitmap, int width, int height)
-    // {
-    //     // and buffer of appropriate size for storing its bits
-    //     var buffer = new byte[width * height * 4];
-    //
-    //     var pixelFormat = PixelFormat.Format32bppRgb;
-    //
-    //     // Now copy bits from bitmap to buffer
-    //     var bits = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, pixelFormat);
-    //
-    //     //Marshal.Copy(bits.Scan0, buffer, 0, buffer.Length);
-    //
-    //     Marshal.Copy(bits.Scan0, buffer, 0, buffer.Length);
-    //
-    //     bitmap.UnlockBits(bits);
-    //
-    //     return buffer;
-    // }
-    //
-    // private void ProcessScreenShots(string filename)
-    // {
-    //     if (!_bitmaps.Any() || _audioStream is null)
-    //         return;
-    //
-    //     Progress.Show("Saving Video");
-    //     var framRate = 10;
-    //
-    //     using (var writer = new AviWriter(filename))
-    //     {
-    //         writer.FramesPerSecond = framRate;
-    //         writer.EmitIndex1 = true;
-    //
-    //         _audioStream.Position = 0;
-    //         var audio = writer.AddAudioStream(2);
-    //         //audio.WriteBlock(_audioStream.GetBuffer(), 0, (int)_audioStream.Length);
-    //         //File.WriteAllBytes(Path.ChangeExtension(filename, "wav"), _audioStream.GetBuffer());
-    //         var audioByteRate = audio.BitsPerSample / 8 * audio.ChannelCount * audio.SamplesPerSecond;
-    //         var audioBlockSize = (int)(audioByteRate / writer.FramesPerSecond);
-    //         var audioBuffer = new byte[audioBlockSize];
-    //         _audioStream.Position = 0;
-    //
-    //         var encoder = new MJpegWpfVideoEncoder(VIDEO_WIDTH, VIDEO_HEIGHT, 50);
-    //         var stream = writer.AddEncodingVideoStream(encoder, true, VIDEO_WIDTH, VIDEO_HEIGHT);
-    //
-    //         //var encoder = new SharpAvi.Codecs.UncompressedVideoEncoder(VIDEO_WIDTH, VIDEO_HEIGHT);
-    //         //var stream = writer.AddEncodingVideoStream(encoder,true,VIDEO_WIDTH, VIDEO_HEIGHT);
-    //         //stream.Codec = CodecIds.Uncompressed;
-    //         //stream.BitsPerPixel = BitsPerPixel.Bpp16;
-    //
-    //         IEnumerable<DateTime> keys = _bitmaps.Keys.OrderBy(x => x);
-    //         var start = keys.First();
-    //         var end = keys.Last();
-    //         for (var cur = start; cur <= end; cur = cur + TimeSpan.FromMilliseconds(100))
-    //         {
-    //             Progress.SetMessage(string.Format("Processing ({0:F2} complete)",
-    //                 (cur - start).TotalSeconds * 100.0F / (end - start).TotalSeconds));
-    //             var key = keys.LastOrDefault(x => x <= cur);
-    //             if (_bitmaps.ContainsKey(key))
-    //             {
-    //                 var frame = (Image.FromStream(_bitmaps[key]) as Bitmap)!;
-    //                 //frame.RotateFlip(RotateFlipType.RotateNoneFlipY);
-    //                 var buf = BitmapToByteArray(frame, stream.Width, stream.Height);
-    //                 stream.WriteFrame(true, buf, 0, buf.Length);
-    //
-    //                 if (_audioStream.Position < _audioStream.Length)
-    //                 {
-    //                     var bytes = _audioStream.Read(audioBuffer, 0, audioBlockSize);
-    //                     audio.WriteBlock(audioBuffer, 0, bytes);
-    //                 }
-    //             }
-    //         }
-    //
-    //         writer.Close();
-    //
-    //         //foreach (var key in _bitmaps.Keys)
-    //         //    File.Delete(_bitmaps[key]);
-    //     }
-    //
-    //     Progress.SetMessage("Transcoding");
-    //
-    //     //var inputFile = new MediaFile { Filename = filename };
-    //     //var outputFile = new MediaFile { Filename = Path.ChangeExtension(filename, "mp4") };
-    //
-    //     //using (var engine = new Engine())
-    //     //{
-    //     //    //engine.ConvertProgressEvent += ConvertProgressEvent;
-    //     //    engine.Convert(inputFile, outputFile);
-    //     //}
-    //
-    //     Progress.Close();
-    //
-    //     var dirName = Path.GetDirectoryName(filename);
-    //     if (dirName is not null)
-    //     {
-    //         var startInfo = new ProcessStartInfo(dirName);
-    //         startInfo.Verb = "open";
-    //         startInfo.UseShellExecute = true;
-    //         Process.Start(startInfo);
-    //         //MessageBox.Show("Recording Saved");
-    //     }
-    // }
-    //
-    // private void VideoRecordingButton_Click(object sender, RoutedEventArgs e)
-    // {
-    //     ToggleRecording();
-    // }
-    //
-    // private void AudioRecordingButton_Click(object sender, RoutedEventArgs e)
-    // {
-    //     ToggleRecordingAudio();
-    // }
-    //
-    // private void RecordingNotesButton_Click(object sender, RoutedEventArgs e)
-    // {
-    //     ShowRecordingNotes();
-    // }
-
-    #endregion
-
     public static void ActivateWindow(Window window)
     public static void ActivateWindow(Window window)
     {
     {
         var hwnd = new WindowInteropHelper(window).EnsureHandle();
         var hwnd = new WindowInteropHelper(window).EnsureHandle();
@@ -2906,65 +2544,6 @@ public partial class MainWindow : IPanelHostControl
     [DllImport("user32.dll")]
     [DllImport("user32.dll")]
     private static extern IntPtr GetActiveWindow();
     private static extern IntPtr GetActiveWindow();
 
 
-    // #region Check For Updates
-    //
-    // private string GetUpdateLocation()
-    // {
-    //     if (App.DatabaseSettings.DatabaseType == DatabaseType.Networked)
-    //     {
-    //         if(ClientFactory.ClientType == typeof(RestClient<>))
-    //         {
-    //             string url = "";
-    //             //var domain = App.DatabaseSettings.URL.Split(new[] { "://" }, StringSplitOptions.RemoveEmptyEntries).Last();
-    //             //var port = App.DatabaseSettings.Port;
-    //             var domain = ClientFactory.Parameters?.FirstOrDefault()?.ToString() ?? "";
-    //             domain = domain.Split(new[] { "://" }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? "";
-    //             if (!String.IsNullOrWhiteSpace(domain))
-    //             {
-    //                 
-    //                 try
-    //                 {
-    //                     var client = new HttpClient { BaseAddress = new Uri($"https://{domain}") };
-    //                     client.GetAsync("operations").Wait();
-    //                     url = $"https://{domain}";
-    //                 }
-    //                 catch (Exception)
-    //                 {
-    //                     url = $"http://{domain}";
-    //                 }
-    //             }
-    //             return url;
-    //         }
-    //         else
-    //         {
-    //             return "";
-    //         }
-    //     }
-    //     else
-    //         return Path.Combine(CoreUtils.GetCommonAppData("PRSServer"), "update");
-    // }
-    //
-    // private string GetLatestVersion(string location)
-    // {
-    //     return Client.Version();
-    // }
-    // private string GetReleaseNotes(string location)
-    // {
-    //     return Client.ReleaseNotes();
-    // }
-    // private byte[]? GetInstaller(string location)
-    // {
-    //     return Client.Installer();
-    // }
-    //
-    // private void CheckForUpdates()
-    // {
-    //     Update.CheckForUpdates(
-    //         GetUpdateLocation, GetLatestVersion, GetReleaseNotes, GetInstaller, null, App.AutoUpdateSettings.Elevated, "PRSDesktopSetup.exe");
-    // }
-    //
-    // #endregion
-
     #region Modules + Reports
     #region Modules + Reports
 
 
     public void ClearActions()
     public void ClearActions()
@@ -3348,6 +2927,12 @@ public partial class MainWindow : IPanelHostControl
         list.ShowDialog();
         list.ShowDialog();
     }
     }
 
 
+    private void EventList_Click(object sender, RoutedEventArgs e)
+    {
+        var list = new MasterList(typeof(Event));
+        list.ShowDialog();
+    }
+
     private void EditDetailsButton_OnClick(object sender, RoutedEventArgs e)
     private void EditDetailsButton_OnClick(object sender, RoutedEventArgs e)
     {
     {
         var employee = new Client<Employee>().Query(
         var employee = new Client<Employee>().Query(
@@ -3413,24 +2998,5 @@ public partial class MainWindow : IPanelHostControl
         Close();
         Close();
     }
     }
 
 
-
-
-
     #endregion
     #endregion
-
-    private void Issues_Click(object sender, RoutedEventArgs e)
-    {
-        try
-        {
-            IssuesWindow.Execute();
-            CheckSupportTicketStatus();
-        }
-        catch(Exception err)
-        {
-            MessageWindow.ShowError("Could not load issues.", err);
-        }
-    }
-
-
-
 }
 }

+ 1 - 0
prs.desktop/Panels/Factory/FactoryPanel.xaml.cs

@@ -27,6 +27,7 @@ using Color = System.Drawing.Color;
 using Image = System.Windows.Controls.Image;
 using Image = System.Windows.Controls.Image;
 using InABox.Wpf;
 using InABox.Wpf;
 using System.ComponentModel;
 using System.ComponentModel;
+using EventType = Motorola.Snapi.Constants.Enums.EventType;
 
 
 namespace PRSDesktop
 namespace PRSDesktop
 {
 {

+ 8 - 0
prs.desktop/Panels/Notifications/NotificationPanel.xaml.cs

@@ -276,6 +276,14 @@ public partial class NotificationPanel : UserControl, IPanel<Notification>
     public void CreateToolbarButtons(IPanelHost host)
     public void CreateToolbarButtons(IPanelHost host)
     {
     {
         // host.CreatePanelAction(new PanelAction() { Caption = "Send Notification", Image = PRSDesktop.Resources.email, OnExecute = SendNotificationClick });
         // host.CreatePanelAction(new PanelAction() { Caption = "Send Notification", Image = PRSDesktop.Resources.email, OnExecute = SendNotificationClick });
+
+        host.CreateSetupAction(
+            Security.IsAllowed<CanManageEvents>() ? "Events" : "Event Subscriptions",
+            Security.IsAllowed<CanManageEvents>() ? PRSDesktop.Resources.edit : PRSDesktop.Resources.email, action =>
+        {
+            var list = new MasterList(typeof(Event));
+            list.ShowDialog();
+        });
     }
     }
 
 
     public void Setup()
     public void Setup()

+ 1 - 0
prs.desktop/Panels/Requisitions/RequisitionPanel.xaml.cs

@@ -15,6 +15,7 @@ using InABox.Wpf;
 using Motorola.Snapi;
 using Motorola.Snapi;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.EventArguments;
 using Motorola.Snapi.EventArguments;
+using EventType = Motorola.Snapi.Constants.Enums.EventType;
 
 
 //using RestSharp;
 //using RestSharp;
 
 

+ 1 - 0
prs.desktop/Panels/Shipments/ShippingPanel.xaml.cs

@@ -15,6 +15,7 @@ using MailKit.Net.Imap;
 using Motorola.Snapi;
 using Motorola.Snapi;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.EventArguments;
 using Motorola.Snapi.EventArguments;
+using EventType = Motorola.Snapi.Constants.Enums.EventType;
 
 
 namespace PRSDesktop
 namespace PRSDesktop
 {
 {

+ 6 - 18
prs.desktop/Setups/QuoteSetupActions.cs

@@ -15,19 +15,11 @@ public static class QuoteSetupActions
 {
 {
     public static void Standard(IPanelHost host)
     public static void Standard(IPanelHost host)
     {
     {
-        if (Security.CanView<Kit>())
-            host.CreateSetupAction("Product Kits", PRSDesktop.Resources.kit, (action) =>
-                {
-                    
-                });
-        
-
-        
-                                                    host.CreateSetupActionIf<CanModifyQuoteStatuses>("Status Codes", PRSDesktop.Resources.quotestatus, (action) =>
-                                                    {
-                                                        var list = new MasterList(typeof(QuoteStatus));
-                                                        list.ShowDialog();
-                                                    });
+        host.CreateSetupActionIf<CanModifyQuoteStatuses>("Status Codes", PRSDesktop.Resources.quotestatus, (action) =>
+        {
+            var list = new MasterList(typeof(QuoteStatus));
+            list.ShowDialog();
+        });
         host.CreateSetupActionIfCanView<QuoteDesignSection>("Design Sections", PRSDesktop.Resources.design, (action) =>
         host.CreateSetupActionIfCanView<QuoteDesignSection>("Design Sections", PRSDesktop.Resources.design, (action) =>
         {
         {
             var list = new MasterList(typeof(QuoteDesignSection));
             var list = new MasterList(typeof(QuoteDesignSection));
@@ -61,12 +53,8 @@ public static class QuoteSetupActions
             var list = new MasterList(typeof(CostSheetSection));
             var list = new MasterList(typeof(CostSheetSection));
             list.ShowDialog();
             list.ShowDialog();
         });
         });
-        
 
 
-            
-
-
-                                                    host.CreateSetupSeparator();
+        host.CreateSetupSeparator();
 
 
         host.CreateSetupActionIfCanView<QuoteDiagramSymbol>("Symbols", PRSDesktop.Resources.pencil, (action) =>
         host.CreateSetupActionIfCanView<QuoteDiagramSymbol>("Symbols", PRSDesktop.Resources.pencil, (action) =>
         {
         {