|
@@ -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);
|
|
|
}
|
|
|
|