v1.2.3.2
This commit is contained in:
@@ -346,6 +346,8 @@ a:focus
|
||||
.ui-dialog.ui-widget.ui-widget-content.ui-corner-all
|
||||
{
|
||||
border-radius: 6px;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.ui-dialog.ui-widget .ui-widget-header
|
||||
@@ -375,11 +377,14 @@ a:focus
|
||||
|
||||
.ui-dialog .ui-dialog-buttonpane
|
||||
{
|
||||
padding: 4px 8px;
|
||||
border-color: #d4af37;
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-buttonpane button
|
||||
{
|
||||
min-width:80px;
|
||||
margin:4px 8px 4px 0;
|
||||
color: #fff;
|
||||
background-color: #d4af37;
|
||||
border-color: #d4af37;
|
||||
|
||||
@@ -5,68 +5,84 @@
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let $pnl = sax.$pnl, $dlg = sax.$dlg, $frm = sax.$frm;
|
||||
let ah = sax.adminHome = {};
|
||||
let $pnl = ah.$pnl = {}, $dlg = ah.$dlg = {}, $frm = ah.$frm = {};
|
||||
sax.itemIdPrefix = 'Itm_';
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshAwaitActivate = function (delay)
|
||||
ah.refreshApplicationStats = function (delay)
|
||||
{
|
||||
clearTimeout(ah.toStats);
|
||||
if (sax.awaitingLogin) return;
|
||||
if (!sax.awaitingRefreshResponse)
|
||||
if (!ah.awaitingStatsResponse)
|
||||
{
|
||||
var $items = $('.sax-panel-item-list', $pnl.awaitAct).fadeOut(200).empty();
|
||||
var $msgs = $('.sax-panel-messages', $pnl.awaitAct).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||
var $items = $('.sax-panel-item-list', $pnl.appStats).fadeOut(200).empty();
|
||||
var $msgs = $('.sax-panel-messages', $pnl.appStats).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||
}
|
||||
sax.ajax.awaitAct = sax.ajax.awaitAct || { url: sax.url.base + 'Home/Ajax/GetItemsAwaitingActivation', formId: 'frmNavigate', callbackFn: sax.handleAwaitActivateResponse, noWaitIcon: true };
|
||||
sax.ajax.awaitAct = sax.ajax.awaitAct || { url: sax.url.base + 'Home/Ajax/GetApplicationStats', formId: 'frmNavigate', callbackFn: ah.handleStatsResponse, noWaitIcon: true };
|
||||
sax.doAjaxRequest(sax.ajax.awaitAct, delay || 50);
|
||||
sax.awaitingRefreshResponse = true;
|
||||
ah.awaitingStatsResponse = true;
|
||||
}
|
||||
sax.handleAwaitActivateResponse = function (response)
|
||||
ah.handleStatsResponse = function (response)
|
||||
{
|
||||
//sax.debug('handleAwaitActivateResponse', response);
|
||||
delete sax.awaitingRefreshResponse;
|
||||
var $msgs = $('.sax-panel-messages', $pnl.awaitAct).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnl.awaitAct).hide().empty();
|
||||
var $tmpl = $('.sax-panel-item-template .sax-panel-item.AwaitActivateItem', $pnl.awaitAct);
|
||||
delete ah.awaitingStatsResponse;
|
||||
var $msgs = $('.sax-panel-messages', $pnl.appStats).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnl.appStats).hide().empty();
|
||||
ah.toStats = setTimeout(ah.refreshApplicationStats, 60000);
|
||||
if (!response.success) return;
|
||||
// Items.
|
||||
var items = response.items;
|
||||
if (!items.length)
|
||||
return $msgs.append($('<div class="sax-message">' + sax.msg.noItemsAwaitAct + '</div>')).fadeIn(500);
|
||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||
$items.append(sax.populateAwaitActivateItem($tmpl.clone(), items[itemIdx]));
|
||||
//return $msgs.append($('<div class="sax-message">' + sax.msg.noItemsAwaitAct + '</div>')).fadeIn(500);
|
||||
// Users.
|
||||
let user = response.stats.user;
|
||||
let $user = sax.getAppStatItemTemplate();
|
||||
$('.sax-header .sax-caption', $user).text(user.caption||'Users');
|
||||
ah.populateAppStat($user, user.awaiting.label, user.awaiting.value, user.awaitingLink)
|
||||
for (let item of user.onlineStats)
|
||||
ah.populateAppStat($user, item.label, item.value, user.onlineLink)
|
||||
$items.append($user);
|
||||
// Organisations.
|
||||
let org = response.stats.organisation;
|
||||
let $org = sax.getAppStatItemTemplate();
|
||||
$('.sax-header .sax-caption', $org).text(org.caption||'Organisations');
|
||||
ah.populateAppStat($org, org.awaiting.label, org.awaiting.value, org.awaitingLink)
|
||||
$items.append($org);
|
||||
$items.slideDown(750);
|
||||
}
|
||||
sax.populateAwaitActivateItem = function ($item, item)
|
||||
ah.populateAppStat = function ($item, label, value, link)
|
||||
{
|
||||
if (!item) return;
|
||||
if (item.viewLink)$('.sax-action.sax-view', $item).on('click', function () { sax.goToPage(item.viewLink); });
|
||||
$('.AwaitActivateItemType', $item).text(item.itemTypeDescPlural);
|
||||
$('.AwaitActivateItemCount', $item).text(item.itemCount);
|
||||
let $stat = sax.getAppStatStatTemplate();
|
||||
$stat.on('click', function () { win.location = link; });
|
||||
$('.sax-label', $stat).text(label + ':');
|
||||
$('.sax-value', $stat).text(value);
|
||||
$('table.sax-item-stats', $item).append($stat);
|
||||
return $item;
|
||||
}
|
||||
sax.getAwaitActivateItemTemplate = function ()
|
||||
sax.getAppStatItemTemplate = function ()
|
||||
{
|
||||
return $('.sax-panel-item-template .sax-panel-item.AwaitActivateItem', $pnl.results).clone();
|
||||
return $('.sax-panel-item-template .sax-panel-item.sax-item-stats', $pnl.appStats).clone();
|
||||
}
|
||||
sax.getAppStatStatTemplate = function ()
|
||||
{
|
||||
return $('.sax-panel-item-template .sax-item-stat', $pnl.appStats).clone();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshDbSchema = function (delay)
|
||||
{
|
||||
if (sax.awaitingLogin) return;
|
||||
if (!sax.awaitingRefreshResponse)
|
||||
if (!ah.awaitingSchemaResponse)
|
||||
{
|
||||
var $items = $('.sax-panel-item-list', $pnl.dbSchema).fadeOut(200).empty();
|
||||
var $msgs = $('.sax-panel-messages', $pnl.dbSchema).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||
}
|
||||
sax.ajax.dbSchema = sax.ajax.dbSchema || { url: sax.url.base + 'System/Ajax/ValidateDatabaseSchema', formId: 'frmNavigate', callbackFn: sax.handleDbSchemaResponse, noWaitIcon: true };
|
||||
sax.doAjaxRequest(sax.ajax.dbSchema, delay || 50);
|
||||
sax.awaitingRefreshResponse = true;
|
||||
ah.awaitingSchemaResponse = true;
|
||||
}
|
||||
sax.handleDbSchemaResponse = function (response)
|
||||
{
|
||||
//sax.debug('handleDbSchemaResponse', response);
|
||||
delete sax.awaitingRefreshResponse;
|
||||
delete ah.awaitingSchemaResponse;
|
||||
var $msgs = $('.sax-panel-messages', $pnl.dbSchema).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnl.dbSchema).hide().empty();
|
||||
var $tmpl = $('.sax-panel-item-template .sax-panel-item.DbSchemaItem', $pnl.dbSchema);
|
||||
@@ -95,11 +111,11 @@
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
$pnl.awaitAct = $('.sax-panel-results.AwaitActivate');
|
||||
$pnl.appStats = $('.sax-panel-results.ApplicationStats');
|
||||
$pnl.dbSchema = $('.sax-panel-results.DbSchema');
|
||||
|
||||
setTimeout(sax.refreshAwaitActivate, 250);
|
||||
setTimeout(sax.refreshDbSchema, 250);
|
||||
ah.toStats = setTimeout(ah.refreshApplicationStats, 400);
|
||||
ah.toSchema = setTimeout(sax.refreshDbSchema, 600);
|
||||
});
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
@@ -359,18 +359,18 @@
|
||||
// Session.
|
||||
sax.configureKeepLoggedIn = function (single)
|
||||
{
|
||||
sax.debug('KeepLoggedIn Configuring');
|
||||
//sax.debug('KeepLoggedIn Configuring');
|
||||
let kli = sax.kli;
|
||||
if (!kli.timeout) kli.timeout = setTimeout(function () { sax.doKeepLoggedIn(single); }, Math.max(30000, kli.interval || 300000));
|
||||
}
|
||||
sax.doKeepLoggedIn = function (single)
|
||||
{
|
||||
sax.debug('KeepLoggedIn Calling');
|
||||
//sax.debug('KeepLoggedIn Calling');
|
||||
let kli = sax.kli;
|
||||
delete kli.timeout;
|
||||
var onKeepLoggedIn = function (response)
|
||||
{
|
||||
sax.debug('KeepLoggedIn Responded', response);
|
||||
//sax.debug('KeepLoggedIn Responded', response);
|
||||
kli.lastAt = sax.getTime();
|
||||
if (!single) sax.configureKeepLoggedIn();
|
||||
}
|
||||
@@ -378,13 +378,13 @@
|
||||
}
|
||||
sax.configureSessionRefresh = function ()
|
||||
{
|
||||
sax.debug('SessionRefresh Configuring');
|
||||
//sax.debug('SessionRefresh Configuring');
|
||||
$(document).on('mousedown mousemove touchstart scroll keydown', sax.triggeRefreshSession);
|
||||
}
|
||||
sax.triggeRefreshSession = function ()
|
||||
{
|
||||
if (sax.kli.timeout) return;
|
||||
sax.debug('SessionRefresh Triggering');
|
||||
//sax.debug('SessionRefresh Triggering');
|
||||
sax.configureKeepLoggedIn(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
op.getItemTemplate = function ()
|
||||
{
|
||||
return $('.sax-panel-item-template .sax-panel-item.Organisation', $pnl.results);
|
||||
return $('.sax-panel-item-template .sax-panel-item.Organisation', $pnl.results).clone();
|
||||
}
|
||||
op.getDropdownItemTemplate = function ()
|
||||
{
|
||||
@@ -36,7 +36,6 @@
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
||||
var $tmpl = op.getItemTemplate();
|
||||
sax.refreshPaging(response, '#frmOrganisationFilter', sax.refreshResults);
|
||||
if (!response.success) return;
|
||||
// Reference data - Statuses.
|
||||
@@ -48,12 +47,7 @@
|
||||
if (!items.length)
|
||||
return $msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||
{
|
||||
let item = items[itemIdx];
|
||||
let $item = $tmpl.clone();
|
||||
op.populateItem($item, item);
|
||||
$items.append($item);
|
||||
}
|
||||
$items.append(op.populateItem(op.getItemTemplate(), items[itemIdx]));
|
||||
$items.fadeIn(50);
|
||||
}
|
||||
op.populateItem = function ($item, item)
|
||||
@@ -65,17 +59,17 @@
|
||||
$('.OrganisationCategory', $item).text(item.categoryDesc);
|
||||
$('.OrganisationSport', $item).text(item.sportName);
|
||||
$('.OrganisationRegion', $item).text(item.regionName);
|
||||
$('.OrganisationMemberCount', $item).on('click', function () { sax.onClickMemberCount(item.id); }).find('.MemberCount').text(item.memberCount);
|
||||
$('.OrganisationMemberCount', $item).on('click', function () { op.onClickMemberCount(item.id); }).find('.MemberCount').text(item.memberCount);
|
||||
$('.StatusDesc', $item).text(item.statusDesc).addClass('sax-status-' + item.statusCode.toLowerCase());
|
||||
$('.sax-caption .sax-action').toggleClass('sax-action', !item.deleted);
|
||||
if (!item.deleted)
|
||||
{
|
||||
let $mnu = $('ul.sax-dropdown-menu', $item);
|
||||
$mnu.append(op.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.edit).end().on('click', function () { sax.updateItem(item.id) }));
|
||||
$mnu.append(op.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.edit).end().on('click', function () { op.updateItem(item, $item) }));
|
||||
if (item.awaiting)
|
||||
$mnu.append(op.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.activate).end().on('click', function () { sax.activateItem(item.id) }));
|
||||
$('.sax-header .sax-action.sax-item-update', $item).off('click').on('click', function () { sax.updateItem(item.id) });
|
||||
$item.off('dblclick').on('dblclick', function () { sax.updateItem(item.id) });
|
||||
$mnu.append(op.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.activate).end().on('click', function () { op.activateItem(item) }));
|
||||
$('.sax-header .sax-action.sax-item-update', $item).off('click').on('click', function () { op.updateItem(item, $item) });
|
||||
$item.off('dblclick').on('dblclick', function () { op.updateItem(item, $item) });
|
||||
}
|
||||
$('.sax-burger', $item).toggle(!!$('.sax-burger .sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
$('.sax-panel-messages', $pnl.results).hide().empty();
|
||||
@@ -118,22 +112,26 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.selectSport = function ()
|
||||
op.selectOrgSport = function ()
|
||||
{
|
||||
if (!op.data.sports)
|
||||
op.populateSports(sax.showSelectSport);
|
||||
else sax.showSelectSport();
|
||||
op.populateSports(op.showSelectOrgSport);
|
||||
else op.showSelectOrgSport();
|
||||
}
|
||||
sax.showSelectSport = function ()
|
||||
op.showSelectOrgSport = function ()
|
||||
{
|
||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: op.data.sports, fnCallback: sax.onSportSelected });
|
||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: op.data.sports, fnCallback: op.onOrgSportSelected });
|
||||
}
|
||||
sax.onSportSelected = function (spt)
|
||||
op.onOrgSportSelected = function (spt)
|
||||
{
|
||||
let frm = $frm.org;
|
||||
$('.OrganisationSportId', frm).val(spt.id);
|
||||
$('.OrganisationSportCaption', frm).val(spt.name);
|
||||
sax.clearControlError($('.OrganisationSportCaption', frm));
|
||||
sax.clearControlError($('.OrganisationSportId', frm));
|
||||
}
|
||||
op.clearOrgSport = function ()
|
||||
{
|
||||
$('.OrganisationSportId,.OrganisationSportCaption', $frm.org).val('');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -173,17 +171,17 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.selectRegion = function ()
|
||||
op.selectOrgRegion = function ()
|
||||
{
|
||||
if (!op.data.regions)
|
||||
op.populateRegions(sax.showSelectRegion);
|
||||
else sax.showSelectRegion();
|
||||
op.populateRegions(op.showSelectOrgRegion);
|
||||
else op.showSelectOrgRegion();
|
||||
}
|
||||
sax.showSelectRegion = function ()
|
||||
op.showSelectOrgRegion = function ()
|
||||
{
|
||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectRegion, items: op.data.regions, fnCallback: sax.onRegionSelected });
|
||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectRegion, items: op.data.regions, fnCallback: op.onOrgRegionSelected });
|
||||
}
|
||||
sax.onRegionSelected = function (rgn)
|
||||
op.onOrgRegionSelected = function (rgn)
|
||||
{
|
||||
//sax.debug('onRegionSelected', rgn);
|
||||
let frm = $frm.org;
|
||||
@@ -193,30 +191,34 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.createItem = function ()
|
||||
op.createItem = function ()
|
||||
{
|
||||
op.clearItem();
|
||||
$dlg.organisation.dialog('option', 'title', sax.dlg.title.createOrganisation);
|
||||
sax.openDialog($dlg.organisation, 600, 480);
|
||||
}
|
||||
op.clearItem = function ()
|
||||
{
|
||||
let frm = $frm.org;
|
||||
$('.OrganisationId,.OrganisationSportId,.OrganisationRegionIdCountry,input[type="text"],textarea,select', frm).val('');
|
||||
$('.OrganisationStatus', frm).val(sax.data.defaultStatusCode);
|
||||
sax.clearControlErrors();
|
||||
$dlg.organisation.dialog('option', 'title', sax.dlg.title.createOrganisation);
|
||||
sax.openDialog($dlg.organisation, 600, 480);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.updateItem = function (id)
|
||||
op.updateItem = function (item, $item)
|
||||
{
|
||||
$('.OrganisationId', $frm.orgId).val(id);
|
||||
op.ajax.updateItem = op.ajax.updateItem || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: sax.onUpdateItem };
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
op.ajax.updateItem = op.ajax.updateItem || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: op.onUpdateItem };
|
||||
sax.doAjaxRequest(op.ajax.updateItem, 50);
|
||||
}
|
||||
sax.onUpdateItem = function (response)
|
||||
op.onUpdateItem = function (response)
|
||||
{
|
||||
//sax.debug('onUpdateItem', response);
|
||||
let frm = $frm.org;
|
||||
$('.OrganisationId,input[type="text"],textarea,select', frm).val('');
|
||||
op.clearItem();
|
||||
if (!response.success) return;
|
||||
let item = response.organisation;
|
||||
let frm = $frm.org;
|
||||
$('.OrganisationId', frm).val(item.id);
|
||||
$('.OrganisationName', frm).val(item.name);
|
||||
$('.OrganisationType', frm).val(item.typeCode);
|
||||
@@ -232,20 +234,20 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.storeItem = function ()
|
||||
op.storeItem = function ()
|
||||
{
|
||||
op.ajax.storeItem = op.ajax.storeItem || { url: sax.url.base + 'Organisation/Ajax/StoreItem', formId: 'frmOrganisation', callbackFn: sax.onStoreItem };
|
||||
op.ajax.storeItem = op.ajax.storeItem || { url: sax.url.base + 'Organisation/Ajax/StoreItem', formId: 'frmOrganisation', callbackFn: op.onStoreItem };
|
||||
sax.doAjaxRequest(op.ajax.storeItem, 50);
|
||||
}
|
||||
sax.onStoreItem = function (response)
|
||||
op.onStoreItem = function (response)
|
||||
{
|
||||
//sax.debug('onStoreItem', response);
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
if (!response.success) return;
|
||||
$dlg.organisation.dialog('close');
|
||||
sax.refreshItem(response.organisation);
|
||||
op.refreshItem(response.organisation);
|
||||
}
|
||||
sax.refreshItem = function (item)
|
||||
op.refreshItem = function (item)
|
||||
{
|
||||
var $item = $('#' + sax.itemIdPrefix + item.id);
|
||||
if (!$item.length)
|
||||
@@ -257,16 +259,16 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.activateItem = function (id)
|
||||
op.activateItem = function (item)
|
||||
{
|
||||
//sax.debug('activateItem(' + id + ')')
|
||||
$('.OrganisationId', $frm.orgId).val(id);
|
||||
op.ajax.getActivationInfo = op.ajax.getActivationInfo || { url: sax.url.base + 'Organisation/Ajax/GetActivationInfo', formId: 'frmOrganisationId', callbackFn: sax.showActivationInfo };
|
||||
//sax.debug('activateItem(' + item.id + ')')
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
op.ajax.getActivationInfo = op.ajax.getActivationInfo || { url: sax.url.base + 'Organisation/Ajax/GetActivationInfo', formId: 'frmOrganisationId', callbackFn: op.showActivationInfo };
|
||||
sax.doAjaxRequest(op.ajax.getActivationInfo, 50);
|
||||
}
|
||||
sax.showActivationInfo = function (response)
|
||||
op.showActivationInfo = function (response)
|
||||
{
|
||||
sax.debug('showActivationInfo', response);
|
||||
//sax.debug('showActivationInfo', response);
|
||||
if (!response.success || !response.organisation) return;
|
||||
let item = response.organisation;
|
||||
let frm = $('#frmOrganisationActivation');
|
||||
@@ -282,36 +284,38 @@
|
||||
popItemValue('.OrganisationAddress', item.addressSummary);
|
||||
let $orgMbrs = $('.OrganisationMembers', $dlg.activate).empty();
|
||||
let $mbrTmpl = $('.sax-panel-item-template tr.sax-item.Member');
|
||||
sax.debug(response.members, $orgMbrs, $mbrTmpl);
|
||||
for (let idx = 0; idx < response.members.length; idx++)
|
||||
let members = response.members;
|
||||
//sax.debug(members, $orgMbrs, $mbrTmpl);
|
||||
for (let idx = 0; idx < members.length; idx++)
|
||||
{
|
||||
let item = response.members[idx];
|
||||
let item = members[idx];
|
||||
let $item = $mbrTmpl.clone();
|
||||
$('.MemberId', $item).val(item.id);
|
||||
$('.MemberActivate', $item).prop('name', 'MemberActivate_' + item.id)
|
||||
$('.MemberEmail', $item).text(item.emailAddress);
|
||||
$('.MemberName', $item).text(item.displayName);
|
||||
$orgMbrs.append($item);
|
||||
sax.debug($item);
|
||||
//sax.debug($item);
|
||||
}
|
||||
$('.MembersAwaitingActivation', $dlg.activate).toggle(!!members.length);
|
||||
sax.openDialog($dlg.activate, 480, 420);
|
||||
}
|
||||
sax.activateOrganisation = function ()
|
||||
op.activateOrganisation = function ()
|
||||
{
|
||||
let frm = $('#frmOrganisationActivation');
|
||||
op.ajax.activateOrganisation = op.ajax.activateOrganisation || { url: sax.url.base + 'Organisation/Ajax/Activate', formId: frm.prop('id'), callbackFn: sax.handleAtivateResponse };
|
||||
op.ajax.activateOrganisation = op.ajax.activateOrganisation || { url: sax.url.base + 'Organisation/Ajax/Activate', formId: frm.prop('id'), callbackFn: op.handleAtivateResponse };
|
||||
sax.doAjaxRequest(op.ajax.activateOrganisation, 50);
|
||||
}
|
||||
sax.handleAtivateResponse = function (response)
|
||||
op.handleAtivateResponse = function (response)
|
||||
{
|
||||
sax.debug('handleAtivateResponse', response);
|
||||
//sax.debug('handleAtivateResponse', response);
|
||||
if (!response.success) return;
|
||||
$dlg.activate.dialog('close');
|
||||
sax.refreshItem(response.organisation);
|
||||
op.refreshItem(response.organisation);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.onClickMemberCount = function (id)
|
||||
op.onClickMemberCount = function (id)
|
||||
{
|
||||
if (!(id * 1)) return;
|
||||
sax.doPleaseWait();
|
||||
@@ -327,7 +331,7 @@
|
||||
$pnl.filter = $('.sax-panel-filter', $pnl.orgs);
|
||||
$pnl.results = $('.sax-panel-results', $pnl.orgs);
|
||||
|
||||
$('.sax-action.sax-item-create', $pnl.filter).on('click', function () { sax.createItem(); });
|
||||
$('.sax-action.sax-item-create', $pnl.filter).on('click', function () { op.createItem(); });
|
||||
$('.sax-action.sax-results-refresh', $pnl.filter).on('click', function () { sax.refreshResults(); });
|
||||
|
||||
$frm.filter = $('#frmOrganisationFilter');
|
||||
@@ -337,16 +341,17 @@
|
||||
$frm.filter.on('dblclick', '.FilterOrganisationRegionCaption', op.selectFilterRegion).on('click', '.FilterRegionSelect', op.selectFilterRegion).on('click', '.FilterRegionClear', op.clearFilterRegion);
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
$frm.org = $('#frmOrganisation');
|
||||
$('.sax-input, .sax-textarea', $frm.org).on('input', function () { sax.clearControlError(this); });
|
||||
$('.sax-select', $frm.org).on('change', function () { sax.clearControlError(this); });
|
||||
$frm.org.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||
$frm.org.on('dblclick', '.OrganisationSportCaption', op.selectOrgSport).on('click', '#pbSelectSport', op.selectOrgSport).on('click', '.OrganisationSportClear', op.clearOrgSport);
|
||||
$frm.org.on('dblclick', '.OrganisationRegionCaptionCountry', op.selectOrgRegion).on('click', '#pbSelectRegion', op.selectOrgRegion);
|
||||
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sax.storeItem(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { op.storeItem(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
||||
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sax.activateOrganisation(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { op.activateOrganisation(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
||||
|
||||
|
||||
@@ -264,14 +264,14 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.createItem = function ()
|
||||
{
|
||||
sax.clearUserData();
|
||||
sax.clearItemData();
|
||||
$dlg.user.dialog('option', 'title', sax.dlg.title.createUser);
|
||||
sax.openDialog($dlg.user, 600, 480);
|
||||
}
|
||||
sax.clearUserData = function ()
|
||||
sax.clearItemData = function ()
|
||||
{
|
||||
let frm = $frm.user;
|
||||
$('.UserAccountId,.UserRegionIdCountry,.UserRegionIdProvince,.UserRoleCodes,input[type="text"],textarea,select', frm).val('');
|
||||
$('.UserId,.UserRegionIdCountry,.UserRegionIdProvince,.UserRoleCodes,input[type="text"],textarea,select', frm).val('');
|
||||
$('.UserStatus', frm).val(sax.data.defaultStatusCode);
|
||||
sax.clearControlErrors();
|
||||
sax.userAccount = { userRoleCodes: [] };
|
||||
@@ -280,7 +280,7 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.updateItem = function (item)
|
||||
{
|
||||
$('.UserAccountId', $frm.userId).val(item.id);
|
||||
$('.UserId', $frm.userId).val(item.id);
|
||||
sax.ajax.updateItem = sax.ajax.updateItem || { url: sax.url.base + 'User/Ajax/GetItem', formId: 'frmUserId', callbackFn: sax.onUpdateItem };
|
||||
sax.doAjaxRequest(sax.ajax.updateItem, 50);
|
||||
}
|
||||
@@ -288,10 +288,10 @@
|
||||
{
|
||||
//sax.debug('onUpdateItem', response);
|
||||
if (!response.success) return;
|
||||
sax.clearUserData();
|
||||
sax.clearItemData();
|
||||
let item = sax.userAccount = response.user;
|
||||
let frm = $frm.user;
|
||||
$('.UserAccountId', frm).val(item.id);
|
||||
$('.UserId', frm).val(item.id);
|
||||
$('.UserEmailAddress', frm).val(item.emailAddress);
|
||||
$('.UserTitle', frm).val(item.title);
|
||||
$('.UserFirstName', frm).val(item.firstName);
|
||||
@@ -333,9 +333,9 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.userEmails = function (item)
|
||||
{
|
||||
sax.debug('userEmails', item);
|
||||
//sax.debug('userEmails', item);
|
||||
let frm = $frm.emailsl
|
||||
$('.UserAccountId', frm).val(item.id);
|
||||
$('.UserId', frm).val(item.id);
|
||||
$('.UserEmailAddress', frm).val(item.emailAddress);
|
||||
$('.UserDisplayName', frm).val(item.displayName);
|
||||
$('.RequestPasswordAdminOption', frm).toggle(item.systemAdmin);
|
||||
|
||||
@@ -198,20 +198,24 @@
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.createItem = function ()
|
||||
{
|
||||
sax.clearItemData();
|
||||
$dlg.user.dialog('option', 'title', sax.dlg.title.createUser);
|
||||
sax.openDialog($dlg.user, 600, 480);
|
||||
}
|
||||
sax.clearItemData = function ()
|
||||
{
|
||||
let frm = $frm.user;
|
||||
$('.UserAccountId,.UserRoleCodes,input[type="text"],textarea,select', frm).val('');
|
||||
$('.UserId,.UserRoleCodes,input[type="text"],textarea,select', frm).val('');
|
||||
$('.UserStatus', frm).val(sax.data.defaultStatusCode);
|
||||
sax.clearControlErrors();
|
||||
sax.userAccount = { userRoleCodes: [] };
|
||||
$dlg.user.dialog('option', 'title', sax.dlg.title.createUser);
|
||||
sax.openDialog($dlg.user, 600, 480);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.updateItem = function (item)
|
||||
{
|
||||
$('.UserAccountId', $frm.userId).val(item.id);
|
||||
$('.UserId', $frm.userId).val(item.id);
|
||||
sax.ajax.updateItem = sax.ajax.updateItem || { url: sax.url.base + 'User/Ajax/GetItem', formId: 'frmUserId', callbackFn: sax.onUpdateItem };
|
||||
sax.doAjaxRequest(sax.ajax.updateItem, 50);
|
||||
}
|
||||
@@ -219,11 +223,10 @@
|
||||
{
|
||||
//sax.debug('onUpdateItem', response);
|
||||
let frm = $frm.user;
|
||||
$('.UserAccountId,input[type="text"],textarea,select', frm).val('');
|
||||
sax.clearControlErrors();
|
||||
sax.clearItemData();
|
||||
if (!response.success) return;
|
||||
let item = sax.userAccount = response.user;
|
||||
$('.UserAccountId', frm).val(item.id);
|
||||
$('.UserId', frm).val(item.id);
|
||||
$('.UserEmailAddress', frm).val(item.emailAddress);
|
||||
$('.UserTitle', frm).val(item.title);
|
||||
$('.UserFirstName', frm).val(item.firstName);
|
||||
@@ -263,7 +266,7 @@
|
||||
{
|
||||
sax.debug('userEmails', item);
|
||||
let frm = $frm.emailsl
|
||||
$('.UserAccountId', frm).val(item.id);
|
||||
$('.UserId', frm).val(item.id);
|
||||
$('.UserEmailAddress', frm).val(item.emailAddress);
|
||||
$('.UserDisplayName', frm).val(item.displayName);
|
||||
$('.RequestPasswordAdminOption', frm).toggle(item.systemAdmin);
|
||||
|
||||
Reference in New Issue
Block a user