C2015-028 Add Editorial Mode to PROMS Step Editor
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user