diff --git a/.gitignore b/.gitignore
index b1ff29ed7..e32571d6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,4 +66,5 @@ dist
# hide the AWS and Rsync credentials file
aws-credentials.json
-rsync-credentials.json
\ No newline at end of file
+rsync-credentials.json
+package-lock.json
diff --git a/src/software/js-samples/importUsers.html b/src/software/js-samples/importUsers.html
index 74cbefa42..fe4b73d07 100644
--- a/src/software/js-samples/importUsers.html
+++ b/src/software/js-samples/importUsers.html
@@ -17,15 +17,15 @@
Import users
Creates new users from a comma separated list
-
-
+
+
-
-
This tool is provided as an example and is available on an As-Is basis. You must assume all the risks and costs associated with the use of the sample tool, including, without limitation, any damage to any equipment, software, information or data. In addition, we are not obligated to provide any maintenance, technical or other support for the sample tool. In order to improve our products, we may at any time, and without warning, change the design, presentation, or functionality of the software.
-
+
+
This tool is provided as an example and is available on an As-Is basis. You must assume all the risks and costs associated with the use of the sample tool, including, without limitation, any damage to any equipment, software, information or data. In addition, we are not obligated to provide any maintenance, technical or other support for the sample tool. In order to improve our products, we may at any time, and without warning, change the design, presentation, or functionality of the software.
To make things easier, we've provided you with an excel template. Please follow the input requirements outlined in the Help menu.
Keep in mind that Time Zone is a required input and if a license plate is entered, it must be unique to the database. License state is required only if a license plate is provided. You may enter a state other than those provided.
NFC and Custom NFC keys must be unique to the database; no duplicates can exist.
If you want to import any reporting groups - the user groups cannot include the "CompanyGroupId", otherwise all reporting groups wiil be ignored.
-
Optional. The user two symbols country ISO code (https://www.iso.org/iso-3166-country-codes.html)
-
-
-
-
Phone number
-
+1 5555555555
-
Optional. The user's phone number with space separated country phone code.
-
-
-
-
Phone number extension
-
1234
-
Optional. The user's phone number extension.
-
-
-
-
Designation
-
""
-
Optional. The user's designation
-
-
-
Employee number
-
63-221-44
-
Optional. The user's employee number.
-
-
-
Fuel economy measurement
-
LitersPer100Km
-
Optional. Choose how to display fuel economy. There are four different measurements: liters per 100 kilometers, kilometers per liter, miles per US gallon, or miles per imperial gallon. You may need to refresh your browser for the change to take effect.
-
-
-
Distance measurement system
-
Metric (true)
-
Optional. Choose how to display speeds and distances. This can be Metric or US/Imperial. You may need to refresh your browser to see the change take effect.
-
-
-
Feature preview
-
On or Off (true or false)
-
Optional. Toggle feature preview.
-
-
-
Time zone
-
America/New_York
-
The time zone offset from UTC for your location. All data will be displayed in this time zone.
-
-
-
Authority name
-
National Express
-
Optional. The motor carrier that the driver works for.
-
-
-
Authority address
-
5000 Explorer Drive
-
Optional. The motor carrier's main office address.
-
-
-
Carrier number
-
8Z88
-
Optional. In the United States, this is the motor carrier's USDOT number. In Canada, this is the Canadian Carrier code.
-
-
-
Home terminal
-
Stark Tower
-
Optional. The motor carrier's place of business where the driver ordinarily reports for work. This can include a temporary work site designated by the motor carrier.
-
-
-
Home terminal address
-
200 Park Avenue
-
Optional. The motor carrier's address where the driver ordinarily reports for work.
-
-
-
Driver license number
-
YEET
-
Optional. Driver's license number and License state/province must be set at the same time.
-
-
-
License state/province
-
Ontario (ON)
-
Optional. Selecting North America will show a dropdown menu; selecting Other will display a text box.
-
-
-
Ruleset
-
California Property Intrastate (HosRuleSetCaliforniaProperty)
-
Optional. This is the ruleset the user will follow when using hours of service.
-
-
-
Yard move allowed
-
On or Off (true or false)
-
Optional. Toggling this setting to ON allows the driver to apply the yard move exemption.
-
-
-
Personal conveyance allowed
-
On of Off (true or false)
-
Optional. Toggling this setting to ON allows the driver to apply the personal conveyance exemption.
-
-
-
+
Email
+
john.smith@geotab.com
+
Can be email or user name. Spaces are not allowed.
+
+
+
First name
+
John
+
Spaces are not allowed.
+
+
+
Last name
+
Smith
+
+
+
+
Password
+
+
Minimum of 6 characters.
+
+
+
Groups
+
Drivers|West|Garmin
+
Names of groups separated by the | character.
+
+
+
Reporting Groups
+
Drivers|West|Garmin
+
Names of reporting groups separated by the | character.
+
+
+
Security clearance ID
+
b28A7
+
+ Found in the URL when viewing a security clearance in MyGeotab.
Optional. The user two symbols country ISO code (https://www.iso.org/iso-3166-country-codes.html)
+
+
+
+
Phone number
+
+1 5555555555
+
Optional. The user's phone number with space separated country phone code.
+
+
+
+
Phone number extension
+
1234
+
Optional. The user's phone number extension.
+
+
+
+
Designation
+
""
+
Optional. The user's designation
+
+
+
Employee number
+
63-221-44
+
Optional. The user's employee number.
+
+
+
Fuel economy measurement
+
LitersPer100Km
+
Optional. Choose how to display fuel economy. There are four different measurements: liters per 100 kilometers, kilometers per liter, miles per US gallon, or miles per imperial gallon. You may need to refresh your browser for the change to take effect.
+
+
+
Distance measurement system
+
Metric (true)
+
Optional. Choose how to display speeds and distances. This can be Metric or US/Imperial. You may need to refresh your browser to see the change take effect.
+
+
+
Feature preview
+
On or Off (true or false)
+
Optional. Toggle feature preview.
+
+
+
Time zone
+
America/New_York
+
The time zone offset from UTC for your location. All data will be displayed in this time zone.
+
+
+
Authority name
+
National Express
+
Optional. The motor carrier that the driver works for.
+
+
+
Authority address
+
5000 Explorer Drive
+
Optional. The motor carrier's main office address.
+
+
+
Carrier number
+
8Z88
+
Optional. In the United States, this is the motor carrier's USDOT number. In Canada, this is the Canadian Carrier code.
+
+
+
Home terminal
+
Stark Tower
+
Optional. The motor carrier's place of business where the driver ordinarily reports for work. This can include a temporary work site designated by the motor carrier.
+
+
+
Home terminal address
+
200 Park Avenue
+
Optional. The motor carrier's address where the driver ordinarily reports for work.
+
+
+
Driver license number
+
YEET
+
Optional. Driver's license number and License state/province must be set at the same time.
+
+
+
License state/province
+
Ontario (ON)
+
Optional. Selecting North America will show a dropdown menu; selecting Other will display a text box.
+
+
+
Ruleset
+
California Property Intrastate (HosRuleSetCaliforniaProperty)
+
Optional. This is the ruleset the user will follow when using hours of service.
+
+
+
Yard move allowed
+
On or Off (true or false)
+
Optional. Toggling this setting to ON allows the driver to apply the yard move exemption.
+
+
+
Personal conveyance allowed
+
On of Off (true or false)
+
Optional. Toggling this setting to ON allows the driver to apply the personal conveyance exemption.
+
+
+
@@ -760,139 +770,152 @@
Help
var groupCache = {};
var securityClearanceCache = {};
- var selectedGroups = [];
+ var selectedGroups = [];
var selectedReportGroups = [];
- var passwordResetCheckbox = document.getElementById("import-password-reset");
- var hosRulesetArray = [];
- var moreCalls = [];
+ var passwordResetCheckbox = document.getElementById("import-password-reset");
+ var hosRulesetArray = [];
+ var moreCalls = [];
+ var certificates = {};
- function toggleDocs(event) {
+ function toggleDocs(event) {
- if (event.target && event.target.className == 'clickable-heading') {
+ if (event.target && event.target.className == 'clickable-heading') {
- var next = event.target.nextElementSibling;
+ var next = event.target.nextElementSibling;
- if (next.style.display == "none") {
- next.style.display = "block";
+ if (next.style.display == "none") {
+ next.style.display = "block";
- } else {
- next.style.display = "none";
- }
- }
- }
+ } else {
+ next.style.display = "none";
+ }
+ }
+ }
- function yesnoCheck() {
- if (document.getElementById('idLicenseStateNA').checked) {
- document.getElementById('ifYes').style.display = 'block';
- document.getElementById('ifNo').style.display = 'none';
- }
- else {
- document.getElementById('ifYes').style.display = 'none';
- document.getElementById('ifNo').style.display = 'block';
- }
- }
+ function yesnoCheck() {
+ if (document.getElementById('idLicenseStateNA').checked) {
+ document.getElementById('ifYes').style.display = 'block';
+ document.getElementById('ifNo').style.display = 'none';
+ }
+ else {
+ document.getElementById('ifYes').style.display = 'none';
+ document.getElementById('ifNo').style.display = 'block';
+ }
+ }
- document.addEventListener('click', toggleDocs, true);
+ document.addEventListener('click', toggleDocs, true);
+
+ document.getElementById('import-authType').addEventListener('change', function(event) {
+
+ var select = document.getElementById('import-authType-certificate');
+
+ if (event.target.value === 'SAML'){
+ select.style.display = '';
+ } else {
+ select.style.display = 'none';
+ }
+
+ });
document.addEventListener("DOMContentLoaded", function() {
groupCache = refreshGroupCache(null);
- securityClearanceCache = refreshSecurityClearanceCache(null);
- timeZoneCache = refreshTimeZoneCache(null);
-
-
- document.getElementById("content").addEventListener("keyup", function(event) {
- event.preventDefault();
-
- document.getElementById("importUsers").disabled = (event.target.value === "");
- });
-
- $("#import-groups").on("change", function(event, parameters) {
- if (parameters.selected) {
- selectedGroups.push(parameters.selected);
- } else {
- var index = selectedGroups.indexOf(parameters.deselected);
- if (index > -1) {
- selectedGroups.splice(index, 1);
- }
- }
- });
+ securityClearanceCache = refreshSecurityClearanceCache(null);
+ timeZoneCache = refreshTimeZoneCache(null);
+ getCertificates(null);
+
+ document.getElementById("content").addEventListener("keyup", function(event) {
+ event.preventDefault();
+
+ document.getElementById("importUsers").disabled = (event.target.value === "");
+ });
+
+ $("#import-groups").on("change", function(event, parameters) {
+ if (parameters.selected) {
+ selectedGroups.push(parameters.selected);
+ } else {
+ var index = selectedGroups.indexOf(parameters.deselected);
+ if (index > -1) {
+ selectedGroups.splice(index, 1);
+ }
+ }
+ });
$("#import-reporting-groups").on("change", function(event, parameters) {
- if (parameters.selected) {
- selectedReportGroups.push(parameters.selected);
- } else {
- var index = selectedReportGroups.indexOf(parameters.deselected);
- if (index > -1) {
- selectedReportGroups.splice(index, 1);
- }
- }
- });
-
-
- document.getElementById("addUser").addEventListener("click", function(event) {
- event.preventDefault();
-
- var user = parseUserFromFields();
-
- if (user.userName === "") {
- alert("Email or user name is required");
- return;
- }
- if (user.userName.indexOf(" ") >= 0) {
- alert("Email or user name cannot contain a space");
- return;
- }
- if (user.firstName === "") {
- alert("First name is required");
- return;
- }
- if (user.lastName === "") {
- alert("Last name is required");
- return;
- }
- if (!$(passwordResetCheckbox).is(":checked") && user.password === "") {
- alert("Password is required");
- return;
- }
- if (user.groups.length <= 0) {
- alert("User must belong to at least one group");
- return;
- }
- if (user.securityClearance === "") {
- alert("Security clearance is required");
- return;
- }
- if (isNaN(user.customNfcKey) || user.customNfcKey < 0 || user.customNfcKey > 72057594037927940) {
- alert("Custom NFC Key Serial Number must be between 0 and 72057594037927940");
- return;
- }
- if (user.phoneNumber !== "" && ( !(user.phoneNumber.indexOf(" ") >= 0) || user.phoneNumber.charAt(0) !== "+" )) {
- alert("Invalid PhoneNumber. Phone number should start with '+' and the country phone code, followed by the phone number without formatting separated by a space. Example: +1 5555555555");
- return;
- }
- if ( user.phoneNumberExtension !== "" && (isNaN(user.phoneNumberExtension))) {
- alert("Phone number extensions cannot exceed five characters and must contain only digits.")
- return;
- }
-
- var newContent = document.getElementById("content").value;
-
- if (newContent !== "") {
- newContent += "\n";
- }
- newContent += user.userName + ",";
- newContent += user.firstName + ",";
- newContent += user.lastName + ",";
- newContent += user.password + ",";
- for (var i = 0; i < user.groups.length; i++) {
- if (i < user.groups.length - 1) {
- newContent += user.groups[i] + "|";
- } else {
- newContent += user.groups[i] + ",";
- }
- }
+ if (parameters.selected) {
+ selectedReportGroups.push(parameters.selected);
+ } else {
+ var index = selectedReportGroups.indexOf(parameters.deselected);
+ if (index > -1) {
+ selectedReportGroups.splice(index, 1);
+ }
+ }
+ });
+
+
+ document.getElementById("addUser").addEventListener("click", function(event) {
+ event.preventDefault();
+
+ var user = parseUserFromFields();
+
+ if (user.userName === "") {
+ alert("Email or user name is required");
+ return;
+ }
+ if (user.userName.indexOf(" ") >= 0) {
+ alert("Email or user name cannot contain a space");
+ return;
+ }
+ if (user.firstName === "") {
+ alert("First name is required");
+ return;
+ }
+ if (user.lastName === "") {
+ alert("Last name is required");
+ return;
+ }
+ if (!$(passwordResetCheckbox).is(":checked") && user.password === "") {
+ alert("Password is required");
+ return;
+ }
+ if (user.groups.length <= 0) {
+ alert("User must belong to at least one group");
+ return;
+ }
+ if (user.securityClearance === "") {
+ alert("Security clearance is required");
+ return;
+ }
+ if (isNaN(user.customNfcKey) || user.customNfcKey < 0 || user.customNfcKey > 72057594037927940) {
+ alert("Custom NFC Key Serial Number must be between 0 and 72057594037927940");
+ return;
+ }
+ if (user.phoneNumber !== "" && ( !(user.phoneNumber.indexOf(" ") >= 0) || user.phoneNumber.charAt(0) !== "+" )) {
+ alert("Invalid PhoneNumber. Phone number should start with '+' and the country phone code, followed by the phone number without formatting separated by a space. Example: +1 5555555555");
+ return;
+ }
+ if ( user.phoneNumberExtension !== "" && (isNaN(user.phoneNumberExtension))) {
+ alert("Phone number extensions cannot exceed five characters and must contain only digits.")
+ return;
+ }
+
+ var newContent = document.getElementById("content").value;
+
+ if (newContent !== "") {
+ newContent += "\n";
+ }
+ newContent += user.userName + ",";
+ newContent += user.firstName + ",";
+ newContent += user.lastName + ",";
+ newContent += user.password + ",";
+ for (var i = 0; i < user.groups.length; i++) {
+ if (i < user.groups.length - 1) {
+ newContent += user.groups[i] + "|";
+ } else {
+ newContent += user.groups[i] + ",";
+ }
+ }
// Reporting groups, can be emtpy
if (user.reportGroups.length !== 0){
for (var i = 0; i < user.reportGroups.length; i++) {
@@ -906,18 +929,18 @@
alert("At least one user is required");
} else {
var userRows = content.split("\n");
-
- var users = [];
-
- for (var i = 0; i < userRows.length; i++) {
- if (userRows[i].trim() !== "") {
- users.push(userRows[i].trim());
- }
- }
-
+
+ var users = [];
+
+ for (var i = 0; i < userRows.length; i++) {
+ if (userRows[i].trim() !== "") {
+ users.push(userRows[i].trim());
+ }
+ }
+
var calls = [];
var userListAndRuleset = [];
-
+
for (i = 0; i < users.length; i++) {
var split = users[i].split(",");
-
- if (split.length !== 28) {
+
+ if (split.length !== 30) {
alert("Missing necessary information from user: " + users[i]);
continue;
}
@@ -971,15 +996,15 @@
Help
var groups = parseGroups(split[4]);
var reportGroups = parseReportingGroups(split[5]);
var securityGroups = parseSecurityClearanceName(split[6]);
- var keys = parseKeys(split[7], split[8]);
- var countryCode = split[9].toLowerCase();
- var phoneNumber = split[10];
- var phoneNumberExtension = split[11];
- var designation = split[12];
- var employeeNo = split[13];
- var fuelEconomyUnit = split[14];
- var isMetric = split[15];
- var isLabsEnabled = split[16];
+ var keys = parseKeys(split[7], split[8]);
+ var countryCode = split[9].toLowerCase();
+ var phoneNumber = split[10];
+ var phoneNumberExtension = split[11];
+ var designation = split[12];
+ var employeeNo = split[13];
+ var fuelEconomyUnit = split[14];
+ var isMetric = split[15];
+ var isLabsEnabled = split[16];
var timeZoneId = split[17];
var authorityName = split[18];
var authorityAddress = split[19];
@@ -989,36 +1014,38 @@
Help
var licenseNumber = split[23];
var licenseProvince = split[24];
var hosRuleSet = split[25];
- var isYardMoveEnabled = split[26];
- var isPersonalConveyanceEnabled = split[27];
-
- // when pasting in ',' seperated string make sure values aren't empty
- if (isYardMoveEnabled === '') {
- var isYardMoveEnabled = false;
- }
- if (isPersonalConveyanceEnabled === '') {
- var isPersonalConveyanceEnabled = false;
- }
-
- var newUser = {
- name: userName,
- firstName: firstName,
- lastName: lastName,
- password: password,
- companyGroups: groups,
+ var isYardMoveEnabled = split[26];
+ var isPersonalConveyanceEnabled = split[27];
+ var userAuthenticationType = split[28];
+ var userSelectedCertificate = split[29];
+
+ // when pasting in ',' seperated string make sure values aren't empty
+ if (isYardMoveEnabled === '') {
+ var isYardMoveEnabled = false;
+ }
+ if (isPersonalConveyanceEnabled === '') {
+ var isPersonalConveyanceEnabled = false;
+ }
+
+ var newUser = {
+ name: userName,
+ firstName: firstName,
+ lastName: lastName,
+ password: password,
+ companyGroups: groups,
reportGroups: reportGroups,
- securityGroups: securityGroups,
- userAuthenticationType: "BasicAuthentication",
- activeFrom: new Date().toISOString(),
- activeTo: "2050-01-01T00:00:00.000Z",
- countryCode: countryCode,
- phoneNumber: phoneNumber,
- phoneNumberExtension: phoneNumberExtension,
- designation: designation,
- employeeNo: employeeNo,
- fuelEconomyUnit: fuelEconomyUnit,
- isMetric: isMetric,
- isLabsEnabled: isLabsEnabled,
+ securityGroups: securityGroups,
+ userAuthenticationType: userAuthenticationType,
+ activeFrom: new Date().toISOString(),
+ activeTo: "2050-01-01T00:00:00.000Z",
+ countryCode: countryCode,
+ phoneNumber: phoneNumber,
+ phoneNumberExtension: phoneNumberExtension,
+ designation: designation,
+ employeeNo: employeeNo,
+ fuelEconomyUnit: fuelEconomyUnit,
+ isMetric: isMetric,
+ isLabsEnabled: isLabsEnabled,
timeZoneId: timeZoneId,
authorityName: authorityName,
authorityAddress: authorityAddress,
@@ -1027,139 +1054,148 @@
Help
companyAddress: companyAddress,
licenseNumber: licenseNumber,
licenseProvince: licenseProvince,
- isYardMoveEnabled: isYardMoveEnabled,
- isPersonalConveyanceEnabled: isPersonalConveyanceEnabled
- };
-
- if (keys.length > 0){
- newUser.driverGroups = groups;
- newUser.viewDriversOwnDataOnly = false;
- newUser.keys = keys;
- newUser.isDriver = true;
+ isYardMoveEnabled: isYardMoveEnabled,
+ isPersonalConveyanceEnabled: isPersonalConveyanceEnabled
+ };
+
+ if (newUser.userAuthenticationType === 'SAML') {
+
+ newUser.issuerCertificate = {
+ id: userSelectedCertificate,
+ isRoot: certificates[userSelectedCertificate].isRoot
+ };
+ }
+
+ if (keys.length > 0){
+ newUser.driverGroups = groups;
+ newUser.viewDriversOwnDataOnly = false;
+ newUser.keys = keys;
+ newUser.isDriver = true;
}
if (licenseNumber.length > 0){
newUser.driverGroups = groups;
- newUser.viewDriversOwnDataOnly = false;
+ newUser.viewDriversOwnDataOnly = false;
newUser.isDriver = true;
}
- if ($(passwordResetCheckbox).is(":checked"))
- {
- newUser.changePassword = true;
+ if ($(passwordResetCheckbox).is(":checked"))
+ {
+ newUser.changePassword = true;
}
- hosRulesetArray.push(hosRuleSet);
-
- calls.push([
- "Add", {
- typeName: "User",
- entity: newUser
- }
- ]);
+ hosRulesetArray.push(hosRuleSet);
+
+ calls.push([
+ "Add", {
+ typeName: "User",
+ entity: newUser
+ }
+ ]);
}
-
- api.multiCall(calls, function(results) {
+
+ api.multiCall(calls, function(results) {
var userIds = results;
- pushRulesets(userIds);
+ pushRulesets(userIds);
- api.multiCall(moreCalls, function(results) {moreCalls = [];}, function(error) {console.log(error); moreCalls = [];});
-
- if (results !== undefined && results !== null && results.length > 0) {
- alert("Imported " + results.length + " of " + users.length + " users");
- }
- }, function(error) {
- if (error !== undefined && error !== null) {
- if (error.indexOf("checksum") > 0) {
- alert("There was a problem importing users. Please check that the NFC driver keys are entered correctly.");
- } else if (error.indexOf("Index was outside") > 0) {
- alert("There was a problem importing users. Please check that the Custom NFC driver keys are entered correctly.");
- } else if (error.indexOf("DuplicateUserException") > 0) {
- alert("There was a problem importing users. You have attempted to import a user name which already exists on your database.");
- } else if (error.indexOf("DuplicateException") > 0) {
- alert("There was a problem importing users. You have attmepted to import a driver key which already exists on your database.");
- } else {
- console.error(error);
- alert("There was a problem importing users. Please check that all fields are entered correctly, the groups and security clearances still exist on your account and that the email addresses or user names are not currently in use.");
- }
- }
+ api.multiCall(moreCalls, function(results) {moreCalls = [];}, function(error) {console.log(error); moreCalls = [];});
+
+ if (results !== undefined && results !== null && results.length > 0) {
+ alert("Imported " + results.length + " of " + users.length + " users");
+ }
+ }, function(error) {
+ if (error !== undefined && error !== null) {
+ if (error.indexOf("checksum") > 0) {
+ alert("There was a problem importing users. Please check that the NFC driver keys are entered correctly.");
+ } else if (error.indexOf("Index was outside") > 0) {
+ alert("There was a problem importing users. Please check that the Custom NFC driver keys are entered correctly.");
+ } else if (error.indexOf("DuplicateUserException") > 0) {
+ alert("There was a problem importing users. You have attempted to import a user name which already exists on your database.");
+ } else if (error.indexOf("DuplicateException") > 0) {
+ alert("There was a problem importing users. You have attmepted to import a driver key which already exists on your database.");
+ } else {
+ console.error(error);
+ alert("There was a problem importing users. Please check that all fields are entered correctly, the groups and security clearances still exist on your account and that the email addresses or user names are not currently in use.");
+ }
+ }
});
- var pushRulesets = function (userIds) {
- for (i = 0; i < userIds.length; i++) {
-
- var anotherUser = {
- dateTime: new Date().toISOString(),
- hosRuleSet: {"id": hosRulesetArray[i]},
- user: {"id": userIds[i]}
- };
-
- //if no ruleset is selected, do not push one to user
- if (hosRulesetArray[i] !== "") {
-
- moreCalls.push([
- "Add", {
- typeName: "UserHosRuleSet",
- entity: anotherUser
- }
- ]);
- }
- }
- }
+ var pushRulesets = function (userIds) {
+ for (i = 0; i < userIds.length; i++) {
+
+ var anotherUser = {
+ dateTime: new Date().toISOString(),
+ hosRuleSet: {"id": hosRulesetArray[i]},
+ user: {"id": userIds[i]}
+ };
+
+ //if no ruleset is selected, do not push one to user
+ if (hosRulesetArray[i] !== "") {
+
+ moreCalls.push([
+ "Add", {
+ typeName: "UserHosRuleSet",
+ entity: anotherUser
+ }
+ ]);
+ }
+ }
+ }
+
}
});
});
-
- function parseUserFromFields() {
- var groups = [];
-
- for (var i = 0; i < selectedGroups.length; i++) {
- for (var key in groupCache) {
- if (groupCache[key].id == selectedGroups[i]) {
- groups.push(groupCache[key].name);
- break;
- }
- }
- }
-
+
+ function parseUserFromFields() {
+ var groups = [];
+
+ for (var i = 0; i < selectedGroups.length; i++) {
+ for (var key in groupCache) {
+ if (groupCache[key].id == selectedGroups[i]) {
+ groups.push(groupCache[key].name);
+ break;
+ }
+ }
+ }
+
var reportGroups = [];
for (var i = 0; i < selectedReportGroups.length; i++) {
- for (var key in groupCache) {
- if (groupCache[key].id == selectedReportGroups[i]) {
- reportGroups.push(groupCache[key].name);
- break;
- }
- }
- }
-
- var securityClearanceSelect = document.getElementById("import-securityClearance");
- var securityClearanceId = securityClearanceSelect[securityClearanceSelect.selectedIndex].value;
-
- if (document.getElementById("Lper100km").checked) {
- var fuelEconomySelect = document.getElementById("Lper100km").value;
- } else if (document.getElementById("kmperL").checked) {
- var fuelEconomySelect = document.getElementById("kmperL").value;
- } else if (document.getElementById("mpgUS").checked) {
- var fuelEconomySelect = document.getElementById("mpgUS").value;
- } else if (document.getElementById("mpgImp").checked) {
- var fuelEconomySelect = document.getElementById("mpgImp").value;
- } else {
- var fuelEconomySelect = "";
- }
-
- if (document.getElementById("metricUnit").checked) {
- var isMetric = true;
- }
- else {
- var isMetric = false;
- }
+ for (var key in groupCache) {
+ if (groupCache[key].id == selectedReportGroups[i]) {
+ reportGroups.push(groupCache[key].name);
+ break;
+ }
+ }
+ }
+
+ var securityClearanceSelect = document.getElementById("import-securityClearance");
+ var securityClearanceId = securityClearanceSelect[securityClearanceSelect.selectedIndex].value;
+
+ if (document.getElementById("Lper100km").checked) {
+ var fuelEconomySelect = document.getElementById("Lper100km").value;
+ } else if (document.getElementById("kmperL").checked) {
+ var fuelEconomySelect = document.getElementById("kmperL").value;
+ } else if (document.getElementById("mpgUS").checked) {
+ var fuelEconomySelect = document.getElementById("mpgUS").value;
+ } else if (document.getElementById("mpgImp").checked) {
+ var fuelEconomySelect = document.getElementById("mpgImp").value;
+ } else {
+ var fuelEconomySelect = "";
+ }
+
+ if (document.getElementById("metricUnit").checked) {
+ var isMetric = true;
+ }
+ else {
+ var isMetric = false;
+ }
- if (document.getElementById("idFeaturePreviewOn").checked) {
- var isLabsEnabled = true;
- } else {
- var isLabsEnabled = false;
- }
+ if (document.getElementById("idFeaturePreviewOn").checked) {
+ var isLabsEnabled = true;
+ } else {
+ var isLabsEnabled = false;
+ }
- var timeZoneId = document.getElementById("options_userTimeZoneOffset").value;
+ var timeZoneId = document.getElementById("options_userTimeZoneOffset").value;
if (document.getElementById('idLicenseStateNA').checked) {
var plateState = document.getElementById("options_licenseProvince").value;
@@ -1167,38 +1203,46 @@