This commit is contained in:
@@ -89,7 +89,15 @@ namespace AyaNova.PlugIn.V8
|
||||
var scheme = u.Scheme;
|
||||
var host = u.Host;
|
||||
var port = u.Port;
|
||||
|
||||
edServerUrl.Text = scheme + "://" + host + ":" + port + "/" + util.API_BASE_ROUTE;
|
||||
|
||||
//client url for notification default links, help links etc
|
||||
if ((scheme == "https" && port == 443) || (scheme == "http" && port == 80))
|
||||
util.GuessClientUrl = scheme + "://" + host + "/";
|
||||
else
|
||||
util.GuessClientUrl = scheme + "://" + host + ":" + port + "/";
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -1729,9 +1729,11 @@ namespace AyaNova.PlugIn.V8
|
||||
{
|
||||
if (!progress.KeepGoing) return;
|
||||
progress.Op("Start Global settings export");
|
||||
progress.SubOp("Global 'Biz' settings");
|
||||
|
||||
|
||||
//GlobalBizSettings
|
||||
{
|
||||
progress.Append("Exporting Global business settings");
|
||||
var a = await util.GetAsync("global-biz-setting");
|
||||
dynamic d = a.ObjectResponse["data"];
|
||||
d.allowScheduleConflicts = true;//was not exposed in v7 so setting to same functionality people are used to for v8
|
||||
@@ -1752,8 +1754,48 @@ namespace AyaNova.PlugIn.V8
|
||||
d.customerAllowNotifyWOCreated = false;
|
||||
d.customerAllowNotifyWOCompleted = false;
|
||||
await util.PutAsync("global-biz-setting", d);
|
||||
|
||||
progress.Append("ACTION REQUIRED: Confirm 'Administration -> Global settings'");
|
||||
}
|
||||
//GlobalOpsBackupSettingsController
|
||||
{
|
||||
progress.Append("Setting default backup settings");
|
||||
var a = await util.GetAsync("global-ops-backup-setting");
|
||||
DateTime utcNow = DateTime.UtcNow;
|
||||
dynamic d = a.ObjectResponse["data"];
|
||||
d.backupTime = new DateTime(utcNow.Year, utcNow.Month, utcNow.Day, 23, 50, 0, DateTimeKind.Local).ToUniversalTime();
|
||||
d.backupSetsToKeep = 3;
|
||||
d.active = false;
|
||||
await util.PutAsync("global-ops-backup-setting", d);
|
||||
progress.Append("ACTION REQUIRED: Confirm 'Server operations -> Backup' settings and set to Active");
|
||||
}
|
||||
|
||||
//GlobalOpsNotificationSettingsController
|
||||
{
|
||||
progress.Append("Exporting Global SMTP Notification settings");
|
||||
var a = await util.GetAsync("global-ops-notification-setting");
|
||||
dynamic d = a.ObjectResponse["data"];
|
||||
|
||||
d.smtpDeliveryActive = false;//start inactive
|
||||
if (AyaBizUtils.GlobalSettings.NotifySMTPHost.Contains(":"))
|
||||
{
|
||||
//per v7 rules the port number is specified on the host if necessary
|
||||
d.smtpServerAddress = AyaBizUtils.GlobalSettings.NotifySMTPHost.Split(':')[0];
|
||||
d.smtpServerPort = AyaBizUtils.GlobalSettings.NotifySMTPPort;
|
||||
}
|
||||
else
|
||||
{
|
||||
d.smtpServerAddress = AyaBizUtils.GlobalSettings.NotifySMTPHost;
|
||||
d.smtpServerPort = 587;//default IETF port 2021
|
||||
}
|
||||
|
||||
d.smtpAccount = AyaBizUtils.GlobalSettings.NotifySMTPAccount;
|
||||
d.notifyFromAddress = AyaBizUtils.GlobalSettings.NotifySMTPFrom;
|
||||
d.ayanovaServerURL = util.GuessClientUrl.TrimEnd('/');
|
||||
d.connectionSecurity = 3;//default is SSLTLS, 1 would be StartTls but we're assuming a modern mail server here
|
||||
await util.PutAsync("global-ops-notification-setting", d);
|
||||
if (AyaBizUtils.GlobalSettings.UseNotification)
|
||||
progress.Append("ACTION REQUIRED: Confirm 'Server Operations -> Notification settings' and set SMTP notification to Active");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ namespace AyaNova.PlugIn.V8
|
||||
public static HttpClient client = null;
|
||||
//url once known to be good
|
||||
internal static string ApiBaseUrl { get; set; }
|
||||
//auth processes url for api and this is the best guess as to the client url to use for notification / help links etc
|
||||
internal static string GuessClientUrl { get; set; }
|
||||
|
||||
internal static string JWT { get; set; }
|
||||
|
||||
public static Guid WBIIntegrationID { get { return new Guid("{6946040C-1B50-4eab-BE08-A0E93DB7449F}"); } }
|
||||
|
||||
Reference in New Issue
Block a user