v1.2.10
This commit is contained in:
@@ -35,16 +35,11 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
private Dictionary<String, SaxAppConfig> appConfigs = new Dictionary<string, SaxAppConfig>();
|
||||
private Dictionary<String, SaxEmailConfig> emailConfigs = new Dictionary<string, SaxEmailConfig>();
|
||||
// Session contexts.
|
||||
private class SessionContextData
|
||||
private class SessionContextData_Admin : SessionContextData_Web
|
||||
{
|
||||
public SessionContextData(SaxSessionContext_Web sessionContext)
|
||||
{
|
||||
SessionContext = sessionContext;
|
||||
}
|
||||
public SaxSessionContext_Web SessionContext { get; }
|
||||
public ISacsDatabase CoreDatabase { get; set; }
|
||||
public SessionContextData_Admin(SaxSessionContext_Web sessionContext) : base(sessionContext) { }
|
||||
}
|
||||
private readonly Dictionary<int, SessionContextData> sessionContexts = new Dictionary<int, SessionContextData>();
|
||||
private readonly Dictionary<int, SessionContextData_Admin> sessionContexts = new Dictionary<int, SessionContextData_Admin>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -70,9 +65,9 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
// Properties.
|
||||
public static SaxApplication_Admin AppInstance { get; private set; }
|
||||
public List<String> Messages { get; } = new List<String>();
|
||||
public override ISacsDatabase GetCoreDatabase(SaxSessionContext sessionContext)
|
||||
public override ISacsDatabase GetDatabase(SaxSessionContext sessionContext, Sax.Database databaseType)
|
||||
{
|
||||
return sessionContexts.GetValue(sessionContext.Index, null)?.CoreDatabase;
|
||||
return sessionContexts.GetValue(sessionContext.Index, null)?.Databases.GetValue(databaseType, null);
|
||||
}
|
||||
public override String SessionCookieName { get { return Sax.Config.Admin.Session.Cookie.Name; } }
|
||||
// Configuration.
|
||||
@@ -131,26 +126,15 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
SaLogger.LogFolder = LoggingRootFolder;
|
||||
LogApplicationStart(fn);
|
||||
|
||||
//Messages.Add($"Database location: {AppConfig.CoreDatabase.Location}");
|
||||
//Messages.Add($"LoggingRootFolder: {SaLogger.LogFolder}");
|
||||
|
||||
// Configure database connection.
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.location = AppConfig.CoreDatabase.Location;
|
||||
config.user = AppConfig.CoreDatabase.User;
|
||||
config.pword = AppConfig.CoreDatabase.Password;
|
||||
SacsDatabase coreDatabase = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
if (coreDatabase.HasErrorState())
|
||||
SaLogger.Warn(fn + " Database initialisation error: " + coreDatabase.ErrorStateMessage);
|
||||
|
||||
//Messages.Add($"Database location: {AppConfig.CoreDatabase.Location}");
|
||||
//Messages.Add($"LoggingRootFolder: {SaLogger.LogFolder}");
|
||||
//Messages.Add($"OdbcDrivers: {OdbcUtil.GetOdbcDriverNames().Concat(", ")}");
|
||||
//Messages.Add($"DbConnection: {coreDatabase.ConnectionString}");
|
||||
|
||||
// Session context - only one context available/necessary (for now).
|
||||
SessionContextData sessionContextData = new SessionContextData(new SaxSessionContext_Web(100, Sax.Application.Admin));
|
||||
sessionContextData.CoreDatabase = coreDatabase;
|
||||
SessionContextData_Admin sessionContextData = new SessionContextData_Admin(new SaxSessionContext_Web(100, Sax.Application.Admin));
|
||||
ConfigureDatabaseConnection(sessionContextData, Sax.Database.Core);
|
||||
ConfigureDatabaseConnection(sessionContextData, Sax.Database.Support);
|
||||
sessionContexts.Add(sessionContextData.SessionContext.Index, sessionContextData);
|
||||
SessionContext = sessionContextData.SessionContext;
|
||||
}
|
||||
@@ -161,22 +145,46 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
|
||||
// Occasional startup processing.
|
||||
if (generateDatabaseDefinitions)
|
||||
GenerateDatabaseDefinition(SessionContext);
|
||||
GenerateDatabaseDefinitions(SessionContext);
|
||||
if (populateRegions)
|
||||
populateRegionsFromDataFile(SessionContext);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void GenerateDatabaseDefinition(SaxSessionContext sessionContext)
|
||||
private void ConfigureDatabaseConnection(SessionContextData_Admin sessionContextData, Sax.Database databaseInstance)
|
||||
{
|
||||
String fn = GetType().Name + ".ConfigureDatabaseConnection";
|
||||
|
||||
// Configure database connection.
|
||||
SaxAppConfig.DatabaseConfig databaseConfig = AppConfig.Databases.Databases.GetValue(databaseInstance, new SaxAppConfig.DatabaseConfig());
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.location = databaseConfig.Location;
|
||||
config.user = databaseConfig.User;
|
||||
config.pword = databaseConfig.Password;
|
||||
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
if (database.HasErrorState())
|
||||
SaLogger.Warn(fn + " " + databaseInstance.ToString() + " Database initialisation error: " + database.ErrorStateMessage);
|
||||
sessionContextData.Databases.Add(databaseInstance, database);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void GenerateDatabaseDefinitions(SaxSessionContext sessionContext)
|
||||
{
|
||||
// Generate database definitions.
|
||||
if (!generateDatabaseDefinitions || !SaxSystem.DebugMode || SessionContext == null) return;
|
||||
if (!StringUtil.EmptyOnNull(EnvironmentName).EqualsCI("Development")) return;
|
||||
ISacsDatabase coreDatabase = GetCoreDatabase(sessionContext);
|
||||
if (coreDatabase == null || StringUtil.IsEmpty(coreDatabase.ConnectionString)) return;
|
||||
|
||||
// Generate database definitions.
|
||||
SaxDbDfnGenerator.Generate(SaxDbDfnGenerator.DatabaseInstance.Core, coreDatabase.ConnectionString);
|
||||
//SaUpdateLogDbDfnGenerator.Generate(database.ConnectionString);
|
||||
// Core database.
|
||||
ISacsDatabase coreDatabase = GetDatabase(sessionContext, Sax.Database.Core);
|
||||
if (coreDatabase != null && !StringUtil.IsEmpty(coreDatabase.ConnectionString))
|
||||
{
|
||||
SaxDbDfnGenerator.Generate(Sax.Database.Core, coreDatabase.ConnectionString);
|
||||
//SaUpdateLogDbDfnGenerator.Generate(database.ConnectionString);
|
||||
}
|
||||
|
||||
// Support database.
|
||||
ISacsDatabase supportDatabase = GetDatabase(sessionContext, Sax.Database.Support);
|
||||
if (supportDatabase != null && !StringUtil.IsEmpty(supportDatabase.ConnectionString))
|
||||
SaxDbDfnGenerator.Generate(Sax.Database.Support, supportDatabase.ConnectionString);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
responseData.Stats.Organisation.Caption = Localiser["caption.organisations"];
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Query to count items awaiting activation.
|
||||
Dictionary<String, int> tableRowCounts = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Database table row counts.
|
||||
Dictionary<String, int> tableRowCounts = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||
@@ -147,7 +147,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Retrieve XML database schema definition.
|
||||
var assembly = typeof(SaxSystem_Dbas).GetTypeInfo().Assembly;
|
||||
@@ -345,7 +345,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return Json(responseData.SetMessage(messageTitle, "Table name must be supplied."));
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Table definition.
|
||||
DbDfnTable tableDfn = db.GetTableDfn(model.DatabaseTable.Name, true);
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
if (ContactData.Methods.Count != ContactMethods.ToInt())
|
||||
{
|
||||
SaLogger.Warn(fn + " Inconsistent Contact Methods received. Expected: " + ContactMethods + ". Received: " + ContactData.Methods.Count);
|
||||
responseData.SetMessage("caption.contact.method", "System error");
|
||||
responseData.SetMessage(Localiser["caption.contact.method"], "System error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -690,12 +690,12 @@
|
||||
<data name="sport.caption.sports" xml:space="preserve">
|
||||
<value>Sports</value>
|
||||
</data>
|
||||
<data name="system.caption.core.database.schema" xml:space="preserve">
|
||||
<value>Core Database Schema</value>
|
||||
</data>
|
||||
<data name="system.caption.database" xml:space="preserve">
|
||||
<value>System - Database</value>
|
||||
</data>
|
||||
<data name="system.caption.database.schema" xml:space="preserve">
|
||||
<value>Database Schema</value>
|
||||
</data>
|
||||
<data name="system.caption.logs" xml:space="preserve">
|
||||
<value>System - Logs</value>
|
||||
</data>
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:50421",
|
||||
"sslPort": 44351
|
||||
}
|
||||
},
|
||||
{
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"workingDirectory": "/",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
@@ -19,11 +12,19 @@
|
||||
"SaxoniteCoreWebAdmin": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
|
||||
}
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||
}
|
||||
},
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:50421",
|
||||
"sslPort": 44351
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/ContactMethods")) return;
|
||||
|
||||
<script src="~/js/sax-cnt-mth.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/ContactMethods")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-cnt-mth.js");
|
||||
}
|
||||
|
||||
<div id="dlgContactMethod" class="sax-dialog sax-form" title="@Localiser["caption.contact.method"]">
|
||||
<div class="spacer4"></div>
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-res-pag.js");
|
||||
}
|
||||
|
||||
<script src="~/js/sax-res-pag.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.resultsPaging = sax.resultsPaging || { fn: {}, msg: {}, contexts: [] };
|
||||
sax.resultsPaging.msg.pageInfo = '@Localiser.GetJavascriptText("label.page.info","{0}","{1}")';
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SelectCode")) return;
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SelectCode")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-sel-cod.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-selectCode.css?@Model.HrefVersion" />
|
||||
<script src="~/js/sax-sel-cod.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
<div id="dlgSelectCode" class="sax-dialog sax-form">
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SelectItem")) return;
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SelectItem")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-sel-itm.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-selectItem.css?@Model.HrefVersion" />
|
||||
|
||||
@@ -46,6 +50,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="~/js/sax-sel-itm.js?@Model.HrefVersion"></script>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SelectOrganisation")) return;
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SelectOrganisation")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-sel-org.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-selectOrganisation.css?@Model.HrefVersion" />
|
||||
<script src="~/js/sax-sel-org.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.selectOrganisation = sax.selectOrganisation || { data: {}, fn: {}, $dlg: {} };
|
||||
sax.selectOrganisation.dlgTitleSelectOrganisation = '@Localiser.GetJavascriptText("organisation.caption.select.organisation")';
|
||||
</script>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="sax-panel-info sax-panel-results DbSchema">
|
||||
|
||||
<div class="sax-header">
|
||||
<div class="sax-caption">@Localiser["system.caption.database.schema"]</div>
|
||||
<div class="sax-caption">@Localiser["system.caption.core.database.schema"]</div>
|
||||
</div>
|
||||
<div class="sax-content">
|
||||
<div class="sax-panel-messages"></div>
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Organisations - Organisation Address dialog panel */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Organisation/Panel-Organisation-Address")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-org-add.js");
|
||||
}
|
||||
|
||||
<script src="~/js/sax-org-add.js?@Model.HrefVersion"></script>
|
||||
|
||||
<div id="dlgOrganisationAddress" class="sax-dialog" title="@Localiser["caption.organisation.address"]">
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Organisations - Organisation images dialog panel */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Organisation/Panel-Organisation-Images")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-org-img.js");
|
||||
}
|
||||
|
||||
<style>
|
||||
@@ -33,7 +37,6 @@
|
||||
border-color: darkgreen;
|
||||
}
|
||||
</style>
|
||||
<script src="~/js/sax-org-img.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.msg.uploadImageSingle = '@Localiser.GetJavascriptText("msg.upload.image.single")';
|
||||
sax.msg.uploadFileSizeMax = '@Localiser.GetJavascriptText("msg.upload.file.size.max","{0}")';
|
||||
|
||||
@@ -8,10 +8,17 @@
|
||||
"Root": "https://localhost:44364/"
|
||||
}
|
||||
},
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Core_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
},
|
||||
"Support": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Support_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Dev",
|
||||
@@ -29,10 +36,12 @@
|
||||
"Saxonite-Test": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "QC",
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Core_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Dev",
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
"Root": "https://sportierre.com/"
|
||||
}
|
||||
},
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:.\\SQLExpress2012.Saxonite_Core_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:.\\SQLExpress2012.Saxonite_Core_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
}
|
||||
},
|
||||
"Security": {
|
||||
"Password": {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
sax.editContactMethod = cm.fn.edit = function (cfg)
|
||||
{
|
||||
cm.fn.init();
|
||||
cm.data.cfg = cfg || {};
|
||||
cm.$mth.empty();
|
||||
for (let mth of cfg.methods || [])
|
||||
@@ -52,16 +51,15 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
cm.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($dlg.conMth) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.conMth = $('#dlgContactMethod').dialog(opt);
|
||||
cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth);
|
||||
cm.$val = $('.sax-input.ContactValue', $dlg.conMth);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
ah.toSchema = setTimeout(sax.refreshDbSchema, 600);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -12,7 +12,6 @@
|
||||
//--------------------------------------------------------------
|
||||
oa.updateItemAddress = function (item, $item)
|
||||
{
|
||||
oa.init();
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
oa.ajax.updateItemAddr = oa.ajax.updateItemAddr || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: oa.onUpdateItemAddress };
|
||||
sax.doAjaxRequest(oa.ajax.updateItemAddr, 50);
|
||||
@@ -88,9 +87,8 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oa.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($frm.orgId) return;
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
|
||||
// Organisation Address dialog.
|
||||
@@ -103,7 +101,7 @@
|
||||
$frm.orgAddr = $('#frmOrganisationAddress');
|
||||
$frm.orgAddr.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||
$frm.orgAddr.on('dblclick', '.AddressRegionNameCountry', oa.selectOrgAddrRegionCountry).on('click', '.AddressRegionCountrySelect', oa.selectOrgAddrRegionCountry);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
//--------------------------------------------------------------
|
||||
oi.updateItemImages = function (item, $item)
|
||||
{
|
||||
oi.init();
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
oi.ajax.getOrgImages = oi.ajax.getOrgImages || { url: sax.url.base + 'Organisation/Ajax/GetImages', formId: 'frmOrganisationId', callbackFn: oi.onUpdateItemImages };
|
||||
sax.doAjaxRequest(oi.ajax.getOrgImages, 50);
|
||||
@@ -109,9 +108,8 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oi.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($frm.orgId) return;
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
|
||||
// Organisation Images dialog and form.
|
||||
@@ -135,7 +133,7 @@
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { oi.uploadOrgLogoImage(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.selectOrgLogoImage = $('#dlgSelectOrgLogoImage').dialog(opt);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
//--------------------------------------------------------------
|
||||
rp.fn.init = function (context)
|
||||
{
|
||||
// Initialise context.
|
||||
if (context.$rp) return;
|
||||
//sax.debug('resultsPaging.init Initialising Paging.', context);
|
||||
context.$rp = $('.sax-results-paging', $(context.sel));
|
||||
@@ -78,6 +79,12 @@
|
||||
$('.sax-paging-last', context.$rp).off('click').on('click', function () { rp.fn.lastPage(context); });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -23,7 +23,6 @@
|
||||
sc.fn.openSelectCode = function (cfg)
|
||||
{
|
||||
//sax.debug('openSelectCode', cfg);
|
||||
sc.fn.init();
|
||||
sc.cfg = cfg;
|
||||
sc.selectedCodes = cfg.selectedCodes || [];
|
||||
sc.fn.displayCodes(cfg.codes);
|
||||
@@ -107,17 +106,17 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sc.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!sc.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sc.fn.storeSelectCode(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { sc.fn.cleanUp(); $(this).dialog('close'); };
|
||||
sc.$dlg = $('#dlgSelectCode').dialog(opt);
|
||||
$('.sax-button.Select', sc.$dlg).on('click', function () { sc.fn.onClickSelect(); });
|
||||
$('.sax-button.Remove', sc.$dlg).on('click', function () { sc.fn.onClickRemove(); });
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
si.fn.selectItem = function (cfg)
|
||||
{
|
||||
si.fn.init();
|
||||
si.cfg = cfg;
|
||||
si.itemId = cfg.itemId;
|
||||
si.fn.showSelectItem();
|
||||
@@ -108,17 +107,17 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
si.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!si.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function (evt, ui) { si.fn.onDlgSize(); };
|
||||
opt.resize = function (evt, ui) { si.fn.onDlgSize(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { si.fn.storeSelectItem(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { si.fn.cleanUp(); $(this).dialog('close'); };
|
||||
si.$dlg = $('#dlgSelectItem').dialog(opt);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -5,7 +5,8 @@
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let so = sax.selectOrganisation = sax.selectOrganisation || { data: {}, fn: {}, $dlg: {}, itemIdPrefix: 'Org_' };
|
||||
let so = sax.selectOrganisation = sax.selectOrganisation || { data: {}, fn: {}, $dlg: {} };
|
||||
so.itemIdPrefix = 'Org_';
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
@@ -18,7 +19,6 @@
|
||||
so.fn.openDialog = function (cfg)
|
||||
{
|
||||
//sax.debug('openDialog', cfg);
|
||||
so.fn.init();
|
||||
so.cfg = cfg;
|
||||
sax.openDialog(so.$dlg.dialog('option', { title: cfg.caption || so.dlgTitleSelectOrganisation || 'Select Organisation' }), so.cfg.width || 480, so.cfg.height || 600);
|
||||
}
|
||||
@@ -78,9 +78,8 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!so.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function () { so.fn.refreshOrganisations(200); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { so.fn.confirmSelection(); };
|
||||
@@ -90,8 +89,9 @@
|
||||
$('.sax-input.FilterOrganisation', so.$dlg).on('input', function () { sax.selectOrganisation.fn.refreshOrganisations(250); });
|
||||
$('.PagingPageNo', so.$dlg).val(1);
|
||||
$('.PagingPageLength', so.$dlg).val(16);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -205,12 +205,10 @@
|
||||
let $frmUsr = $frm.user;
|
||||
$('.UserRegionIdCountry', $frmUsr).val(rgn.id);
|
||||
$('.UserRegionCaptionCountry', $frmUsr).val(rgn.name);
|
||||
sax.refreshResults();
|
||||
}
|
||||
sax.clearRegionCountry = function ()
|
||||
{
|
||||
$('.UserRegionIdCountry,.UserRegionCaptionCountry', $frm.user).val('');
|
||||
sax.refreshResults();
|
||||
}
|
||||
// Province region.
|
||||
sax.selectRegionProvince = function ()
|
||||
@@ -227,12 +225,10 @@
|
||||
let $frmUsr = $frm.user;
|
||||
$('.UserRegionIdProvince', $frmUsr).val(rgn.id);
|
||||
$('.UserRegionCaptionProvince', $frmUsr).val(rgn.name);
|
||||
sax.refreshResults();
|
||||
}
|
||||
sax.clearRegionProvince = function ()
|
||||
{
|
||||
$('.UserRegionIdProvince,.UserRegionCaptionProvince', $frm.user).val('');
|
||||
sax.refreshResults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user