Przeglądaj źródła

PRS DESKTOP - job requi dashboard and job requi grid restrict viewing unapproved requis, added include/exclude archived/deleted buttons

Nick-PRSDigital@bitbucket.org 2 lat temu
rodzic
commit
da642b3eba

+ 1 - 6
prs.desktop/Dashboards/Job Requisition Items Review Dashboard/JobRequisitionReviewDashboard.xaml.cs

@@ -148,7 +148,7 @@ namespace PRSDesktop
             AddButton("Include Archived", null, ViewArchived);
             AddButton("Include Cancelled", null, ViewCancelled);
 
-            ActionColumns.Add(new DynamicActionColumn(ViewStockImage, null) { ToolTip = ShowStockToolTip });
+            ActionColumns.Add(new DynamicActionColumn(PRSDesktop.Resources.rack.AsBitmapImage(), null) { ToolTip = ShowStockToolTip });
 
             ColumnsTag = "JobRequisitionReview";
 
@@ -223,11 +223,6 @@ namespace PRSDesktop
             return true;
         }
 
-        private BitmapImage? ViewStockImage(CoreRow? arg)
-        {
-            return PRSDesktop.Resources.warehouse.AsBitmapImage();
-        }
-
         protected override void GenerateColumns(DynamicGridColumns columns)
         {
             columns.Add<JobRequisitionItem, DateTime>(x => x.Created, 80, "Date", "", Alignment.MiddleLeft);

+ 1 - 1
prs.desktop/Dashboards/Job Requisition Items Review Dashboard/StockHoldingToolTipGrid.cs

@@ -21,7 +21,7 @@ namespace PRSDesktop
             var columns = new DynamicGridColumns();
             columns.Add<StockHolding, string>(x => x.Location.Description, 110, "Location", "", Alignment.MiddleLeft);
             columns.Add<StockHolding, string>(x => x.Job.JobNumber, 50, "Job", "", Alignment.MiddleLeft);
-            columns.Add<StockHolding, string>(x => x.Style.Description, 150, "Style", "", Alignment.MiddleLeft);
+            columns.Add<StockHolding, string>(x => x.Style.Description, 250, "Style", "", Alignment.MiddleLeft);
             columns.Add<StockHolding, double>(x => x.Units, 50, "Units", "", Alignment.MiddleLeft);
             columns.Add<StockHolding, string>(x => x.Dimensions.UnitSize, 60, "Size", "", Alignment.MiddleLeft);
             return columns;

+ 9 - 5
prs.desktop/Panels/Jobs/JobRequisitionGrid.cs

@@ -16,10 +16,10 @@ namespace PRSDesktop
 {
     internal class JobRequisitionGrid : DynamicDataGrid<JobRequisition>, IJobControl
     {
-        
+
         private readonly Button _approve;
         private readonly Button _createtask;
-        
+
         public JobRequisitionGrid()
         {
             Options.AddRange(
@@ -29,13 +29,13 @@ namespace PRSDesktop
             HiddenColumns.Add(x => x.ID);
             HiddenColumns.Add(x => x.Job.ID);
             HiddenColumns.Add(x => x.Approved);
-            
+
             if (Security.IsAllowed<CanApproveJobRequisitions>())
                 _approve = AddButton("Approve", null, ApproveClick);
 
             _createtask = AddButton("Create Task", null, CreateTask);
         }
-        
+
         private bool ApproveClick(Button button, CoreRow[] rows)
         {
             if (rows == null || !rows.Any())
@@ -99,7 +99,7 @@ namespace PRSDesktop
             }
             Progress.Close();
             var page = new KanbanGrid();
-            page.OnAfterSave += (form, items) => 
+            page.OnAfterSave += (form, items) =>
             {
                 KanbanAfterSave(form, items);
             };
@@ -134,7 +134,11 @@ namespace PRSDesktop
         protected override void Reload(Filters<JobRequisition> criteria, Columns<JobRequisition> columns, ref SortOrder<JobRequisition> sort,
             Action<CoreTable, Exception> action)
         {
+            if (!Security.IsAllowed<CanApproveJobRequisitions>())
+                criteria.Add(new Filter<JobRequisition>(x => x.Approved).IsNotEqualTo(DateTime.MinValue));
+
             criteria.Add(new Filter<JobRequisition>(x => x.Job.ID).IsEqualTo(JobID));
+
             base.Reload(criteria, columns, ref sort, action);
         }