Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
9130604fa6 |
@@ -394,6 +394,33 @@ namespace VEPROMS.CSLA.Library
|
||||
OnPropertyChanged("Step_ChangeID");
|
||||
}
|
||||
}
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// was last change made in editorial mode and thus change bars should be disabled?
|
||||
// will contain userid of user that made last change if it was in Editorial Mode
|
||||
// if there was not a previous change that would have caused change bars
|
||||
// will be blank/empty by default
|
||||
// will get overwritten every time a change is made
|
||||
public string Step_ChangeIDEditorialMode
|
||||
{
|
||||
get
|
||||
{
|
||||
string s = _Xp["Step", "ChangeIDEMode"];
|
||||
|
||||
if (s == string.Empty) return null;
|
||||
return s;
|
||||
}
|
||||
set
|
||||
{
|
||||
string s = _Xp["Step", "ChangeIDEMode"];
|
||||
|
||||
if (value != null && value.ToString() == s) return;
|
||||
if (value == null && s != null) _Xp["Step", "ChangeIDEMode"] = null;
|
||||
else _Xp["Step", "ChangeIDEMode"] = value.ToString();
|
||||
OnPropertyChanged("Step_ChangeIDEMode");
|
||||
}
|
||||
}
|
||||
|
||||
public string Step_Responsibility
|
||||
{
|
||||
get
|
||||
|
@@ -3933,9 +3933,7 @@ namespace VEPROMS.CSLA.Library
|
||||
get
|
||||
{
|
||||
bool chg = HasChanges;
|
||||
StepInfo si = this as StepInfo;
|
||||
if (si == null) return false;
|
||||
StepConfig sc = si.MyConfig as StepConfig;
|
||||
StepConfig sc = this.MyConfig as StepConfig;
|
||||
if (sc == null) return false;
|
||||
// if there is no override & return whether there was a change to the text.
|
||||
if (chg && ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds &&
|
||||
@@ -3943,6 +3941,21 @@ namespace VEPROMS.CSLA.Library
|
||||
return false; // No Change ID - No Change Bar
|
||||
if ((sc.Step_SpellCheckerChangedText ?? "") == "NoChangeBar")
|
||||
return false; // Spell Checker, in editorial mode (format flag EditoralSpellCheck) , made the change and there was no change bar prior to that change B2015-024
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// last change was in editorial mode, so ignore it
|
||||
if (!string.IsNullOrEmpty(sc.Step_ChangeIDEditorialMode))
|
||||
return false;
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// Add Check for enhanced docs
|
||||
// If enhanced docs, need to check the step_config for the master
|
||||
if (sc.MyEnhancedDocuments != null && sc.MyEnhancedDocuments.Count == 1 && sc.MyEnhancedDocuments[0].Type == 0)
|
||||
{
|
||||
ItemInfo ii = ItemInfo.Get(sc.MyEnhancedDocuments[0].ItemID, true);
|
||||
if (ii == null) return false; // when deleting a source step, this was causing a crash (null ii)
|
||||
return ii.HasChangeBar;
|
||||
}
|
||||
|
||||
|
||||
if (sc.Step_CBOverride == null)
|
||||
return chg;
|
||||
return (sc.Step_CBOverride == "On");
|
||||
@@ -3953,9 +3966,7 @@ namespace VEPROMS.CSLA.Library
|
||||
get
|
||||
{
|
||||
if (this.IsAccPages || this.IsProcedure || this.IsSection) return false;
|
||||
StepInfo si = this as StepInfo;
|
||||
if (si == null) return false;
|
||||
StepConfig sc = si.MyConfig as StepConfig;
|
||||
StepConfig sc = this.MyConfig as StepConfig;
|
||||
if (sc == null) return false;
|
||||
// go back to source & see what date it has:
|
||||
if (sc.MyEnhancedDocuments != null && sc.MyEnhancedDocuments.Count == 1 && sc.MyEnhancedDocuments[0].Type == 0)
|
||||
|
@@ -606,12 +606,20 @@ namespace VEPROMS.CSLA.Library
|
||||
_ItemInfoExtension.Refresh(this);
|
||||
OnChange();// raise an event
|
||||
}
|
||||
public static ItemInfo Get(int itemID)
|
||||
public static ItemInfo Get(int itemID, bool forcerefresh = false)
|
||||
{
|
||||
//if (!CanGetObject())
|
||||
// throw new System.Security.SecurityException("User not authorized to view a Item");
|
||||
|
||||
try
|
||||
{
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// fixes caching issue
|
||||
// item.myconfig was cached not containing the bypass changebar info
|
||||
// so this forces a refresh of the cache
|
||||
if (forcerefresh)
|
||||
{
|
||||
_CacheByPrimaryKey.Remove(itemID.ToString());
|
||||
}
|
||||
|
||||
ItemInfo tmp = GetCachedByPrimaryKey(itemID);
|
||||
if (tmp == null)
|
||||
{
|
||||
|
@@ -11,6 +11,7 @@ using DevComponents.DotNetBar;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using Volian.Base.Library;
|
||||
using Microsoft.Win32;
|
||||
using System.Linq;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -261,24 +262,45 @@ namespace Volian.Controls.Library
|
||||
get { return _ChgId; }
|
||||
set { _ChgId = value; }
|
||||
}
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
public bool EditorialChange
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ChgId == null) return true;
|
||||
if (_ChgId == "") return true;
|
||||
if (_ChgId.ToUpper() == "EC") return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Events
|
||||
/// <summary>
|
||||
/// This event is raised when a the "Tab" of a DisplayItem is clicked with a mouse.
|
||||
/// So far this has just been used for demo purposes. It could be used to select a
|
||||
/// step and it's children for the purpose of copying.
|
||||
/// </summary>
|
||||
public event StepPanelEvent ItemClick;
|
||||
if (_ChgId.ToUpper() == "EC") { return true;}
|
||||
|
||||
return IsInEditorialMode;
|
||||
}
|
||||
}
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// property to hold if button in ribbon is toggled on or off
|
||||
public bool IsInEditorialMode { get; set; } = false;
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// This is used when button in the ribbon is toggled on/off
|
||||
// It iterates through all previously opened tabs
|
||||
// and updates the "Editorial Mode" button
|
||||
// and background color to match those of the current tab
|
||||
public void SetEdititorialModeForAllTabs(bool mode)
|
||||
{
|
||||
foreach (DisplayTabItem tabItem in _MyDisplayTabItems.Values.Where(tabItem => tabItem.MyStepTabPanel != null))
|
||||
{
|
||||
tabItem.MyStepTabPanel.MyStepTabRibbon.SetEditorialMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Events
|
||||
/// <summary>
|
||||
/// This event is raised when a the "Tab" of a DisplayItem is clicked with a mouse.
|
||||
/// So far this has just been used for demo purposes. It could be used to select a
|
||||
/// step and it's children for the purpose of copying.
|
||||
/// </summary>
|
||||
public event StepPanelEvent ItemClick;
|
||||
/// <summary>
|
||||
/// Checks to see if the ItemClick event is handled and launches it
|
||||
/// </summary>
|
||||
|
@@ -799,27 +799,41 @@ namespace Volian.Controls.Library
|
||||
// if the plant has the change id option, the change id was entered when the program started.
|
||||
// this should be saved for every piece of edited data. Note that the set of config
|
||||
// item Step_MultipleChangeID has the save built in to it.
|
||||
if (sc == null) sc = new StepConfig();
|
||||
if (MyStepRTB.MyItemInfo.IsStep &&
|
||||
MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||
&& !this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
|
||||
{
|
||||
//StepConfig sc = MyStepRTB.MyItemInfo.MyConfig as StepConfig;
|
||||
if (sc == null) sc = new StepConfig();
|
||||
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
|
||||
//if (MyStepRTB.MyItemInfo.MyConfig == null) itm.MyContent.Config = sc.ToString();
|
||||
}
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the ChangeIds are set in the Format file
|
||||
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode && !existingChangeBar)
|
||||
{
|
||||
sc.Step_ChangeIDEditorialMode = Volian.Base.Library.VlnSettings.UserID;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.Step_ChangeIDEditorialMode = null;
|
||||
}
|
||||
// B2020-017: If making an editorial change, clear the Change id. Having the change id on
|
||||
// was adding/printing a change bar.
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the ChangeIds are set in the Format file
|
||||
if (MyStepRTB.MyItemInfo.IsStep &&
|
||||
MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||
&& this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange
|
||||
&& hasChangeBar == false)
|
||||
(MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||
|| MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode
|
||||
)
|
||||
&& MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange
|
||||
&& !hasChangeBar)
|
||||
{
|
||||
if (sc == null) sc = new StepConfig();
|
||||
sc.Step_ChangeID = null;
|
||||
}
|
||||
// B2015-024 Have Spell Checker text changes be an editorial change (not assign a change bar but keep existing change bar)
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck)
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the Rditorial SprllCheck flag is set in the Format file
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck || this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode)
|
||||
{
|
||||
if (StepRTB.DidEditorialSpellCheck)
|
||||
{
|
||||
|
@@ -650,8 +650,13 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
public Color ActiveColor
|
||||
{
|
||||
get { return _ActiveColor; }
|
||||
set { _ActiveColor = value; }
|
||||
get {
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, use LightGreen background
|
||||
_ActiveColor = MyStepTabPanel != null && MyStepTabPanel.MyDisplayTabControl.IsInEditorialMode ? Color.LightGreen : Color.SkyBlue;
|
||||
return _ActiveColor;
|
||||
}
|
||||
set { _ActiveColor = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or Sets the Annotation backcolor for StepRTBs in the Panel
|
||||
|
@@ -3760,7 +3760,12 @@ namespace Volian.Controls.Library
|
||||
public bool SpellCheckNext()
|
||||
{
|
||||
int nBad = C1SpellChecker2.CheckControl(this, false, MySpellCheckDlg);
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck)
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// if in Editorial Mode, treat it the same as if the EditorialSpellCheck flag is set in the Format file
|
||||
bool editorialmode = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.IsInEditorialMode;
|
||||
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck || editorialmode)
|
||||
DidEditorialSpellCheck = MySpellCheckDlg.DidCorrectSpelling; // B2015-024 spell checker in editoral mode
|
||||
return (nBad >= 0); // nBad = -1 means user pressed Cancel button
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
private void SetupStepTabRibbon()
|
||||
{
|
||||
_MyStepTabRibbon = new StepTabRibbon();
|
||||
_MyStepTabRibbon = new StepTabRibbon(_MyDisplayTabControl.IsInEditorialMode);
|
||||
_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
|
||||
_MyStepTabRibbon.Name = "displayTabRibbon1";
|
||||
|
@@ -995,7 +995,7 @@ namespace Volian.Controls.Library
|
||||
// SetButtonAndMenuEnabling(true);
|
||||
//}
|
||||
#region Constructor
|
||||
public StepTabRibbon()
|
||||
public StepTabRibbon(bool? IsInEditorialMode = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.btnInsSupInfo.Tag = string.Format("{0} {1}", (int)E_FromTypes.SupInfos, 1040); // Make type of rno (40) & special case 1000
|
||||
@@ -1021,8 +1021,16 @@ namespace Volian.Controls.Library
|
||||
// hide the import from Word file if not running in Debug mode
|
||||
if (!VlnSettings.DebugMode)
|
||||
rbnImpWrd.Visible = false;
|
||||
}
|
||||
void _RibbonControl_SizeChanged(object sender, EventArgs e)
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
// default Editorial Mode to what is set in the DisplayTabControl
|
||||
SetEditorialMode(IsInEditorialMode != null && (bool) IsInEditorialMode);
|
||||
|
||||
}
|
||||
|
||||
public void SetEditorialMode(bool mode) => btnEditorialMode.Checked = btnCMEditorialMode.Checked = mode;
|
||||
|
||||
void _RibbonControl_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Size = _RibbonControl.Size;
|
||||
}
|
||||
@@ -3125,7 +3133,7 @@ namespace Volian.Controls.Library
|
||||
btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo;
|
||||
btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo;
|
||||
}
|
||||
private void btnGoTo_Click(object sender, EventArgs e)
|
||||
private void btnGoTo_Click(object sender, EventArgs e)
|
||||
{
|
||||
// if on a transition, go to the selected transition 'to'. If on
|
||||
// a referenced object, bring up ReferencedObject Editor (for now, just put up a message box.
|
||||
@@ -3211,7 +3219,29 @@ namespace Volian.Controls.Library
|
||||
System.Diagnostics.Process.Start(roapp, args);
|
||||
}
|
||||
}
|
||||
private void btnChgTyp_Click(object sender, EventArgs e)
|
||||
|
||||
// C2015-028 Add Editorial Mode to PROMS Step Editor
|
||||
private void btnEditorialMode_Click(object sender, EventArgs e)
|
||||
{
|
||||
//toggle button is selected
|
||||
SetEditorialMode(!btnEditorialMode.Checked);
|
||||
|
||||
//set the overall flag in the displaytabcontrol
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
tmp.MyDisplayTabControl.IsInEditorialMode = btnEditorialMode.Checked;
|
||||
|
||||
//refresh the current item so the background color changes (LightGreen=Editorial Mode, SkyBlue=Normal Selected)
|
||||
if (MyEditItem != null)
|
||||
{
|
||||
_MyEditItem.RefreshContent();
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
//set other preciously opened tabs to match the state of Editorial Mode in the current tab
|
||||
tmp.MyDisplayTabControl.SetEdititorialModeForAllTabs(btnEditorialMode.Checked);
|
||||
}
|
||||
|
||||
private void btnChgTyp_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Change Step Type");
|
||||
MyEditItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
@@ -3279,7 +3309,8 @@ namespace Volian.Controls.Library
|
||||
rtabInsert.Visible = false;
|
||||
rtabAdmin.Visible = false;
|
||||
rtabReview.Select();
|
||||
btnCMEditMode1.Enabled = btnEditMode.Enabled = false; // don't allow reviewer toggle out of view mode
|
||||
btnCMEditMode1.Enabled = btnEditMode.Enabled = btnCMEditorialMode.Enabled = false; // don't allow reviewer toggle out of view mode
|
||||
btnCMEditorialMode.Visible = false;
|
||||
}
|
||||
}
|
||||
public void SetupROEditorMode()
|
||||
|
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
Binary file not shown.
Reference in New Issue
Block a user