|
@@ -170,7 +170,7 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
AddButton("Groups", null, EditGroupsClick);
|
|
|
|
|
|
- CopyForm = AddButton("Copy Form", InABox.Wpf.Resources.copy.AsBitmapImage(), CopyForm_Click);
|
|
|
+ CopyForm = AddButton("Duplicate", InABox.Wpf.Resources.copy.AsBitmapImage(), CopyForm_Click);
|
|
|
CopyForm.IsEnabled = false;
|
|
|
if (!Security.CanEdit<DigitalForm>())
|
|
|
{
|
|
@@ -184,7 +184,7 @@ namespace InABox.DynamicGrid
|
|
|
{
|
|
|
base.DoReconfigure(options);
|
|
|
|
|
|
- options.AddRange(DynamicGridOption.ImportData, DynamicGridOption.ExportData, DynamicGridOption.FilterRows);
|
|
|
+ options.AddRange(DynamicGridOption.ImportData, DynamicGridOption.ExportData, DynamicGridOption.FilterRows, DynamicGridOption.SelectColumns);
|
|
|
}
|
|
|
|
|
|
protected override void SelectItems(CoreRow[]? rows)
|
|
@@ -240,7 +240,16 @@ namespace InABox.DynamicGrid
|
|
|
.Add(x => x.Sequence)),
|
|
|
new KeyedQueryDef<ReportTemplate>(
|
|
|
new Filter<ReportTemplate>(x => x.Section).IsEqualTo(form.ID.ToString()),
|
|
|
- null),
|
|
|
+ new Columns<ReportTemplate>(x=>x.Section)
|
|
|
+ .Add(x=>x.Name)
|
|
|
+ .Add(x=>x.Script)
|
|
|
+ .Add(x=>x.Visible)
|
|
|
+ .Add(x=>x.AllRecords)
|
|
|
+ .Add(x=>x.DataModel)
|
|
|
+ .Add(x=>x.PrinterName)
|
|
|
+ .Add(x=>x.SelectedRecords)
|
|
|
+ .Add(x=>x.RDL)
|
|
|
+ .Add(x=>x.Section)),
|
|
|
new KeyedQueryDef<DigitalFormDocument>(
|
|
|
new Filter<DigitalFormDocument>(x => x.EntityLink.ID).IsEqualTo(form.ID),
|
|
|
new Columns<DigitalFormDocument>(x => x.Type)
|
|
@@ -377,18 +386,20 @@ namespace InABox.DynamicGrid
|
|
|
foreach (var variable in GetVariables(sender))
|
|
|
{
|
|
|
foreach (var col in variable.GetVariableColumns())
|
|
|
- {
|
|
|
- variables.Add($"Form_Data.{col.ColumnName}");
|
|
|
- }
|
|
|
+ variables.Add($"Data.{col.ColumnName}");
|
|
|
}
|
|
|
|
|
|
var appliesTo = items?.Select(x => x.AppliesTo).Distinct().SingleOrDefault();
|
|
|
- if (!appliesTo.IsNullOrWhiteSpace() && DFUtils.GetFormInstanceType(appliesTo) is Type formType)
|
|
|
+ if (!appliesTo.IsNullOrWhiteSpace() && DFUtils.GetFormInstanceType(appliesTo) is Type instanceType)
|
|
|
{
|
|
|
- foreach(var property in DatabaseSchema.Properties(formType))
|
|
|
- {
|
|
|
- variables.Add(property.Name);
|
|
|
- }
|
|
|
+ foreach(var property in DatabaseSchema.Properties(instanceType).Where(x => !x.Name.StartsWith("Parent")))
|
|
|
+ variables.Add($"Form.{property.Name}");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!appliesTo.IsNullOrWhiteSpace() && DFUtils.GetFormEntityType(appliesTo) is Type entityType)
|
|
|
+ {
|
|
|
+ foreach(var property in DatabaseSchema.Properties(entityType))
|
|
|
+ variables.Add($"{entityType.EntityName().Split('.').Last()}.{property.Name}");
|
|
|
}
|
|
|
|
|
|
variables.Sort();
|