This commit is contained in:
2022-12-11 15:08:41 +00:00
parent 5f2a181baa
commit ea5e27a5b3
137 changed files with 1178 additions and 751 deletions
@@ -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();
}
//--------------------------------------------------------------