This commit is contained in:
2020-05-11 15:53:21 +00:00
parent 7c431f1efe
commit aef7c9dbe2

View File

@@ -270,22 +270,22 @@ namespace AyaNova.PlugIn.V8
#region Misc utils #region Misc utils
//Used to ensure a unique name generated by appending -nnn is within length requirements by splitting and chopping part of text to keep name //Used to ensure a unique name generated by appending -nnn is within length requirements by splitting and chopping part of text to keep name
public static string UniqueNameBuilder(string oldName, long appendValue, int maxLength) public static string UniqueNameBuilder(string oldName, long appendValue, int maxLength)
{ {
//deadman switch //deadman switch
if (appendValue > int.MaxValue) if (appendValue > int.MaxValue)
{ {
throw new System.OverflowException("UniqueNameBuilder: Unique name could not be generated for item \""+oldName+"\" after "+int.MaxValue.ToString()+" attempts"); throw new System.OverflowException("UniqueNameBuilder: Unique name could not be generated for item \""+oldName+"\" after "+int.MaxValue.ToString()+" attempts");
} }
var appendString = "-" + appendValue.ToString(); var appendString = "-" + appendValue.ToString();
string ret = oldName + appendString; string ret = oldName + appendString;
var diff = maxLength - ret.Length; var diff = maxLength - ret.Length;
if (diff < 0) if (diff < 0)
{ {
ret = oldName.Substring(0, Math.Abs(diff)) + appendString; ret = oldName.Substring(0, Math.Abs(diff)) + appendString;
} }
return ret; return ret;
} }
//used to set nonsense values from imported user login and password //used to set nonsense values from imported user login and password
@@ -415,68 +415,87 @@ namespace AyaNova.PlugIn.V8
//***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key //***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key
//because enumlist gets it that way, i.e. "Global" would be the expected key //because enumlist gets it that way, i.e. "Global" would be the expected key
NoType = 0,
Global = 1, NoType = 0,
//Corebiz Global = 1,
Widget = 2,//attachable, wikiable, reviewable //
//Corebiz Widget = 2,//attachable, wikiable, reviewable
User = 3,//attachable, wikiable, reviewable //
ServerState = 4, User = 3,//attachable, wikiable, reviewable
License = 5, ServerState = 4,
LogFile = 6, License = 5,
PickListTemplate = 7, LogFile = 6,
//Corebiz PickListTemplate = 7,
Customer = 8, //
ServerJob = 9, Customer = 8,
//Corebiz ServerJob = 9,
Contract = 10, //
TrialSeeder = 11, Contract = 10,
Metrics = 12, TrialSeeder = 11,
Translation = 13, Metrics = 12,
UserOptions = 14, Translation = 13,
//Corebiz UserOptions = 14,
HeadOffice = 15, //
//Corebiz HeadOffice = 15,
LoanUnit = 16, //
FileAttachment = 17, LoanUnit = 16,
DataListView = 18, FileAttachment = 17,
FormCustom = 19, DataListView = 18,
//Corebiz FormCustom = 19,
Part = 20, //
//Corebiz Part = 20,
PM = 21, //
//Corebiz PM = 21,
PMItem = 22, //
//Corebiz PMItem = 22,
PMTemplate = 23, //
//Corebiz PMTemplate = 23,
PMTemplateItem = 24, //
//Corebiz PMTemplateItem = 24,
Project = 25, //
//Corebiz Project = 25,
PurchaseOrder = 26, //
//Corebiz PurchaseOrder = 26,
Quote = 27, //
//Corebiz Quote = 27,
QuoteItem = 28, //
//Corebiz QuoteItem = 28,
QuoteTemplate = 29, //
//Corebiz QuoteTemplate = 29,
QuoteTemplateItem = 30, //
//Corebiz QuoteTemplateItem = 30,
Unit = 31, //
//Corebiz Unit = 31,
UnitModel = 32, //
//Corebiz UnitModel = 32,
Vendor = 33, //
//Corebiz Vendor = 33,
WorkOrder = 34, //
//Corebiz WorkOrder = 34,
WorkOrderItem = 35, //
//Corebiz WorkOrderItem = 35,
WorkOrderTemplate = 36, //
//Corebiz WorkOrderItemLabor = 36,
WorkOrderTemplateItem = 37 //
WorkOrderItemPart = 37,
//
WorkOrderItemPartRequest = 38,
//
WorkOrderItemScheduledUser = 39,
//
WorkOrderItemExpense = 40,
//
WorkOrderItemTravel = 41,
//
WorkOrderItemTask = 42,
//
WorkOrderItemLoan = 43,
//
WorkOrderItemUnit = 44,
//
WorkOrderTemplate = 45,
//
WorkOrderTemplateItem = 46
//NOTE: New objects added here need to also be added to the following classes: //NOTE: New objects added here need to also be added to the following classes: