Compare commits

..

1 Commits

Author SHA1 Message Date
6e3d16390b C2025-023-New-EP-Format-File 2025-05-26 22:19:19 -04:00
6 changed files with 30 additions and 80 deletions

Binary file not shown.

View File

@@ -23810,60 +23810,6 @@ GO
IF (@@Error = 0) PRINT 'Running vesp_UpdateUserSettings Succeeded' IF (@@Error = 0) PRINT 'Running vesp_UpdateUserSettings Succeeded'
ELSE PRINT 'Running vesp_UpdateUserSettings Failed to Execute' ELSE PRINT 'Running vesp_UpdateUserSettings Failed to Execute'
GO GO
-- =============================================
-- Author: Matthew Schill
-- Create date: 5/19/2025
-- Description: Allow option to not prompt user with MS Word messages
-- when generating Summaries
-- =============================================
--- MSWordSummaryPrompt = ahouls user be prompted with message?
-- default = yes (true)
IF NOT EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Users'
AND COLUMN_NAME = 'MSWordSummaryPrompt')
ALTER TABLE Users ADD MSWordSummaryPrompt bit NOT NULL DEFAULT(1);
go
-- Display the status
IF (@@Error = 0) PRINT 'Altered table [Users] Succeeded for MSWordSummaryPrompt'
ELSE PRINT 'Altered table [Users] Error on Alter for MSWordSummaryPrompt'
go
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_UpdateUserSettingMSWordSummaryPrompt]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [vesp_UpdateUserSettingMSWordSummaryPrompt];
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Matthew Schill
-- Create date: 5/19/2025
-- Description: Allow option to not prompt user with MS Word messages
-- when generating Summaries
-- =============================================
CREATE PROCEDURE [dbo].[vesp_UpdateUserSettingMSWordSummaryPrompt]
(
@UID varchar(100),
@Prompt bit = null
)
WITH EXECUTE AS OWNER
AS
UPDATE Users SET
MSWordSummaryPrompt = ISNULL(@Prompt, MSWordSummaryPrompt)
WHERE UserID =@UID
RETURN
GO
IF (@@Error = 0) PRINT 'Running vesp_UpdateUserSettingMSWordSummaryPrompt Succeeded'
ELSE PRINT 'Running vesp_UpdateUserSettingMSWordSummaryPrompt Failed to Execute'
GO
--- begin changes for: --- begin changes for:
---C2025-023 - Electronic Procedures - Modifications to PROMS ---C2025-023 - Electronic Procedures - Modifications to PROMS
--- The following IsEPAnnotationType column was added for EP Annotations. --- The following IsEPAnnotationType column was added for EP Annotations.
@@ -24116,8 +24062,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255) DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255) DECLARE @RevDescription varchar(255)
set @RevDate = '5/19/2025 8:44 AM' set @RevDate = '4/8/2025 11:24'
set @RevDescription = 'C2025-013 Add ability to disable message that opening Summaries in MS Word' set @RevDescription = 'Added support for EP Viewer Editing'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription

View File

@@ -2117,14 +2117,11 @@ namespace VEPROMS.CSLA.Library
public EPFields GetValidEPFields(int AnnTypeID) public EPFields GetValidEPFields(int AnnTypeID)
{ {
EPFields filtered = new EPFields(); EPFields filtered = new EPFields();
EPFields unfiltered = ActiveFormat.PlantFormat.EPFormatFiles.First(x => x.AnnotationTypeID == AnnTypeID).FieldList;
if (ActiveFormat.PlantFormat.EPFormatFiles.Count == 0) return filtered;
if ((int)MyContent.Type < 20000) return filtered;
EPFields unfiltered = ActiveFormat.PlantFormat.EPFormatFiles.Find(x => x.AnnotationTypeID == AnnTypeID)?.FieldList;
if (unfiltered == null) return filtered;
//Build list of step type and step type of it's parents //Build list of step type and step type of it's parents
List<string> steptypelist = new List<string>(); List<string> steptypelist = new List<string>();
if ((int)MyContent.Type < 20000) return filtered;
int stepType = ((int)MyContent.Type) % 10000; int stepType = ((int)MyContent.Type) % 10000;
StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList; StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList;
if (stepType > sdlist.MaxIndex) if (stepType > sdlist.MaxIndex)
@@ -2155,13 +2152,6 @@ namespace VEPROMS.CSLA.Library
return filtered; return filtered;
} }
// C2025-023 - Electronic Procedures - Modifications to PROMS
//return true if any EP Format files attached to the item's
public bool HasEPformat(int AnnTypeID)
{
return GetValidEPFields(AnnTypeID).Count > 0;
}
// determine if the the current step should automatically be placed on the Continuous Action Summary // determine if the the current step should automatically be placed on the Continuous Action Summary
// Note, this logic only checks the format setting of the step. We will check the value of the Tag's Check Box later on. // Note, this logic only checks the format setting of the step. We will check the value of the Tag's Check Box later on.
public bool IncludeOnContActSum public bool IncludeOnContActSum

View File

@@ -155,7 +155,7 @@ namespace Volian.Controls.Library
this.btnEPAnnotation.Margin = new System.Windows.Forms.Padding(2); this.btnEPAnnotation.Margin = new System.Windows.Forms.Padding(2);
this.btnEPAnnotation.Name = "btnEPAnnotation"; this.btnEPAnnotation.Name = "btnEPAnnotation";
this.btnEPAnnotation.Size = new System.Drawing.Size(53, 20); this.btnEPAnnotation.Size = new System.Drawing.Size(53, 20);
this.superTooltip1.SetSuperTooltip(this.btnEPAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Open Annotation", "", "This will open Electronic Procedure Details for this Annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.btnEPAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Remove Annotation", "", "This will remove the currently selected annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnEPAnnotation.TabIndex = 5; this.btnEPAnnotation.TabIndex = 5;
this.btnEPAnnotation.Text = "Open"; this.btnEPAnnotation.Text = "Open";
this.btnEPAnnotation.Visible = false; this.btnEPAnnotation.Visible = false;

View File

@@ -340,7 +340,7 @@ namespace Volian.Controls.Library
if ((_Annotations != null) && (dgAnnotations.Rows.Count > 0)) if ((_Annotations != null) && (dgAnnotations.Rows.Count > 0))
{ {
CurrentAnnotation = _Annotations[dgAnnotations.CurrentRow.Index]; CurrentAnnotation = _Annotations[dgAnnotations.CurrentRow.Index];
if (CurrentAnnotation.MyAnnotationType.IsEPAnnotationType && CurrentItem.HasEPformat(CurrentAnnotation.MyAnnotationType.TypeID)) if (CurrentAnnotation.MyAnnotationType.IsEPAnnotationType)
btnEPAnnotation.Visible = true; btnEPAnnotation.Visible = true;
} }
else else

View File

@@ -20,7 +20,7 @@ namespace Volian.Controls.Library
private AnnotationConfig MyConfig; private AnnotationConfig MyConfig;
private StepTabRibbon _MyStepTabRibbon; private StepTabRibbon _MyStepTabRibbon;
private Dictionary<string, TextBox> _DicTB; private Dictionary<string, StepRTB> _DicStepRtb;
private Dictionary<string, CheckBox> _DicCheckBox; private Dictionary<string, CheckBox> _DicCheckBox;
private Dictionary<string, ComboBox> _DicComboBox; private Dictionary<string, ComboBox> _DicComboBox;
private Dictionary<string, ComboBox> _DicSingleRO; private Dictionary<string, ComboBox> _DicSingleRO;
@@ -32,7 +32,7 @@ namespace Volian.Controls.Library
public frmEPAnnotationDetails(AnnotationInfo currAnn) public frmEPAnnotationDetails(AnnotationInfo currAnn)
{ {
InitializeComponent(); InitializeComponent();
_DicTB = new Dictionary<string, TextBox>(); _DicStepRtb = new Dictionary<string, StepRTB>();
_DicCheckBox = new Dictionary<string, CheckBox>(); _DicCheckBox = new Dictionary<string, CheckBox>();
_DicComboBox = new Dictionary<string, ComboBox>(); _DicComboBox = new Dictionary<string, ComboBox>();
_DicSingleRO = new Dictionary<string, ComboBox>(); _DicSingleRO = new Dictionary<string, ComboBox>();
@@ -72,20 +72,28 @@ namespace Volian.Controls.Library
if (EP.type.ToLower() == "text") if (EP.type.ToLower() == "text")
{ {
TextBox tb = new TextBox(); StepRTB tb = new StepRTB();
tb.Font = tb.Font = new Font("Arial", 8); tb.Font = tb.FormatFont = new Font("Arial", 8);
tb.FieldToEdit = E_FieldToEdit.PSI; //use same right click menu as PSI
tb.BorderStyle = BorderStyle.FixedSingle; tb.BorderStyle = BorderStyle.FixedSingle;
//aligning to both left and right stretches the textbox to the width of the form //aligning to both left and right stretches the textbox to the width of the form
tb.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; tb.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
string val = MyConfig.GetValue("EP", EP.name).Replace("\\u8209?", "-").Replace(@"\u9586?", @"\"); tb.Enter += new System.EventHandler(this.FieldStepRTB_Enter);
tb.Text = val;
string val = MyConfig.GetValue("EP", EP.name).Replace("\\u8209?", "-");
DisplayText dt = new DisplayText(val, new VE_Font("Arial", 10, E_Style.None, 12), false);
StringBuilder sb = new StringBuilder();
sb.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 Arial;}");
sb.Append(@"{\f1\fnil\fcharset0 Arial;}}{\colortbl ;\red255\green0\blue0;}"); //C2017-036 changed to just Arial because Microsoft removed Arial Unicode MS with Word16
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(this.Font.SizeInPoints * 2) + " " + dt.StartText + @"}");
tb.Rtf = sb.ToString();
tb.Visible = true; tb.Visible = true;
tb.Height = EP.numlines * tb.Font.Height + 1 + tb.Margin.Vertical; tb.Height = EP.numlines * tb.Font.Height + 1 + tb.Margin.Vertical;
tb.MinimumSize = new Size(0, EP.numlines * tb.Font.Height + 1 + tb.Margin.Vertical); tb.MinimumSize = new Size(0, EP.numlines * tb.Font.Height + 1 + tb.Margin.Vertical);
if (EP.numlines > 1) if (EP.numlines > 1)
{ {
tb.Multiline = true; tb.Multiline = true;
tb.ScrollBars = ScrollBars.Both; tb.ScrollBars = RichTextBoxScrollBars.Both;
panelEP.RowStyles.Insert(panelEP.RowCount - 1, new RowStyle(SizeType.Absolute, 50)); panelEP.RowStyles.Insert(panelEP.RowCount - 1, new RowStyle(SizeType.Absolute, 50));
} }
else else
@@ -93,7 +101,7 @@ namespace Volian.Controls.Library
panelEP.RowStyles.Insert(panelEP.RowCount - 1, new RowStyle(SizeType.AutoSize)); panelEP.RowStyles.Insert(panelEP.RowCount - 1, new RowStyle(SizeType.AutoSize));
} }
_DicTB.Add(EP.name, tb); _DicStepRtb.Add(EP.name, tb);
panelEP.Controls.Add(tb, 1, panelEP.RowCount - 1); panelEP.Controls.Add(tb, 1, panelEP.RowCount - 1);
} }
else else
@@ -218,8 +226,9 @@ namespace Volian.Controls.Library
{ {
if (EP.type.ToLower() == "text") if (EP.type.ToLower() == "text")
{ {
TextBox cur = _DicTB[EP.name]; StepRTB cur = _DicStepRtb[EP.name];
string newval = cur.Text; string rtf = cur.Rtf;
string newval = DisplayText.StaticStripRtfCommands(rtf, false);
string oldval = MyConfig.GetValue("EP", EP.name); string oldval = MyConfig.GetValue("EP", EP.name);
if (oldval != newval) if (oldval != newval)
{ {
@@ -309,6 +318,11 @@ namespace Volian.Controls.Library
//remove events so no memory loss //remove events so no memory loss
private void frmEPAnnotationDetails_FormClosing(object sender, FormClosingEventArgs e) private void frmEPAnnotationDetails_FormClosing(object sender, FormClosingEventArgs e)
{ {
foreach (StepRTB tb in _DicStepRtb.Values)
{
tb.Enter -= FieldStepRTB_Enter;
}
foreach (ListBoxMulti lb in _DicMultiRO.Values) foreach (ListBoxMulti lb in _DicMultiRO.Values)
{ {
lb.Dispose(); lb.Dispose();