From cbc2adf712a64feb9f0845c0d35e0e519eaed3d8 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 28 Jul 2020 19:37:41 +0000 Subject: [PATCH] =?UTF-8?q?B2020-095=20Don=E2=80=99t=20display=20the=20dia?= =?UTF-8?q?log=20asking=20if=20ROs=20should=20be=20converted=20to=20text,?= =?UTF-8?q?=20when=20an=20Approved=20procedure=20export=20file=20is=20impo?= =?UTF-8?q?rted.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VEPROMS User Interface/dlgExportImport.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index 84ba42d5..675acdb7 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -374,9 +374,9 @@ namespace VEPROMS string msg1 = (_DidConvertTransitionsToText && _DidConvertROsToText) ? "Transitions and Referenced Objects" : (_DidConvertTransitionsToText) ? "Transitions" : "Referenced Objects"; msg += string.Format("\n\n{0} converted to text.\n\nThe locations can be found by doing a Global Search for the \"Link Converted To Text\" annotation type", msg1); } - else if (!_DidProcessTransitions && !_DidProcessROs) // B2017-076 Approved import file does not have ROs nor Transitions + else if (_ImportingApprovedExportFile) // B2020-095 An approved version of a procedure was imported, all ROs and Transitions are unlinked. { - msg += "\n\nAll Transition and Referenced Object values are text.\n\nThere either were none or you had imported an Approved procedure."; + msg += "\n\nYou had imported an Approved Version of a procedure.\n\nAll Transition and Referenced Object values are text."; // B2017-076 Approved import file does not have ROs nor Transition } // B2016-225 added more information to the finish import message to tell the user when ROs or Transitions are converted to text. MessageBox.Show(msg, "Import", MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -476,8 +476,20 @@ namespace VEPROMS return false; } } + // B2020-095 exported files generated from approval has "APPROVED_REV_" in the file name + // if found, then sent the ImportingApprovedExportFile flag to true. + private bool _ImportingApprovedExportFile = false; + private bool ImportingApprovedExport(string fnAndPath) + { + bool rtnval = false; + int idx = fnAndPath.LastIndexOf("//") + 1; + string tmp = fnAndPath.Substring(idx); + rtnval = tmp.ToUpper().Contains("APPROVED_REV_"); + return rtnval; + } private bool ImportProcedure(ref bool isImported, ref bool canceledPressed) { + _ImportingApprovedExportFile = ImportingApprovedExport(txtImport.Text); //B2020-095 see if import file was generated from Approved (versions) menu XmlDocument xd = new XmlDocument(); xd.Load(txtImport.Text); pbImportProcedure.Maximum = 1; @@ -499,7 +511,7 @@ namespace VEPROMS MyRODb = RODb.GetJustRoDb(MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID); // if the current RO Path and the import file RO Path are not the same // then ask if we should import using the current workingdraft RO Path, convert the ROs to text, or cancel the import - if (MyRODb.FolderPath != rofolderpath) + if (MyRODb.FolderPath != rofolderpath && !_ImportingApprovedExportFile) //B2020-095 don't display dialog if importing approved procedure export file { dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs(); dlg.ImportedROFolder = rofolderpath; @@ -3862,6 +3874,7 @@ namespace VEPROMS // part of bug fix B2017-060 added the isGrid parameter private void AddROUsages(Content content, XmlNode xn, bool isGrid) { + if (_ImportingApprovedExportFile) return; //B2020-095 the links are already removed from the import file _DidProcessROs = false; if (_ConvertROsToTextDuringImport) ConvertImportProcedureROsToText(content, xn);