application.addClientInfo('organisation X')
application.getClientCountForInfo('organisation X')
/**
* Returns current logged-in user data-set
*
* @return {JSDataSet} dsLoggedInUsers
*
* @private
*
* @properties={typeid:24,uuid:"0A6C79A9-BF61-434C-A9F7-3FF02B340066"}
*/
function getCurrentUserList() {
var
/*** @type {Array} */
arrClients = plugins.UserManager.getClients(),
/*** @type {JSDataSet} */
dsLoggedInUsers = databaseManager.createEmptyDataSet(),
sUserFullName = "",
sUserBranch = "";
dsLoggedInUsers.addColumn('client_id');
dsLoggedInUsers.addColumn('application_type');
dsLoggedInUsers.addColumn('host_address');
dsLoggedInUsers.addColumn('host_identifier');
dsLoggedInUsers.addColumn('host_name');
dsLoggedInUsers.addColumn('user_name');
dsLoggedInUsers.addColumn('user_fullName');
dsLoggedInUsers.addColumn('user_branch');
dsLoggedInUsers.addColumn('user_uid');
dsLoggedInUsers.addColumn('login_time');
dsLoggedInUsers.addColumn('idle_time');
dsLoggedInUsers.addColumn('last_update_time');
var
dLogin,
dIdle,
dLastUpdate,
sDatePattern = scopes.person.currentDateFormat_dd_mm_yyyy,
sTimePattern = "HH:mm";
for (var i = 0; i < arrClients.length; i++) {
scopes.utils.anyKey = arrClients[i].userName;
if (utils.hasRecords(_to_persons$initials_anykey)) {
if (utils.hasRecords(_to_persons$initials_anykey.persons_to_org_units))
sUserBranch = _to_persons$initials_anykey.persons_to_org_units.org_name ;
sUserFullName = _to_persons$initials_anykey.clcs_ps_full_name ;
} else {
sUserBranch = "Unknown";
sUserFullName = "Unknown";
}
dLogin = utils.dateFormat(arrClients[i].login, sDatePattern) + " " + utils.dateFormat(arrClients[i].login, sTimePattern);
dIdle = utils.dateFormat(arrClients[i].idle, sDatePattern) + " " + utils.dateFormat(arrClients[i].idle, sTimePattern);
dLastUpdate = utils.dateFormat(arrClients[i].lastUpdate, sDatePattern) + " " + utils.dateFormat(arrClients[i].lastUpdate, sTimePattern);
dsLoggedInUsers.addRow([arrClients[i].clientId,
arrClients[i].applicationType,
arrClients[i].hostAddress,
arrClients[i].hostIdentifier,
arrClients[i].hostName,
arrClients[i].userName,
sUserFullName,
sUserBranch,
arrClients[i].userUid,
dLogin,
dIdle,
dLastUpdate]);
}
return dsLoggedInUsers;
}
Users browsing this forum: No registered users and 0 guests