fleet-contractor/Site/js/modulelang.js
2023-04-28 12:22:26 +08:00

118 lines
5.1 KiB
JavaScript

function setAppModulesLang(data, include) {
for (var i = 0; i < data.length; i++) {
var m = data[i];
if (m.ModuleType === 1)
continue;
setMoudulesLang(m);
if (include && m.SubItems)
setSubItemsLang(m.SubItems);
}
}
function setMoudulesLang(m) {
if (!m.ID)
m.ID = m.Id;
if (parseInt(m.ID) === 100) {
m.CurrentName = GetTextByKey("P_MODULE_MAPVIEW", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 150) {
m.CurrentName = GetTextByKey("P_MODULE_JOBSITES", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 200) {
m.CurrentName = GetTextByKey("P_MODULE_ASSETHEALTH", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 250) {
m.CurrentName = GetTextByKey("P_MODULE_FILTERQ", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 300) {
m.CurrentName = GetTextByKey("P_MODULE_CREDENTIALS", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 350) {
m.CurrentName = GetTextByKey("P_MODULE_SECURITYSETTING", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 400) {
m.CurrentName = GetTextByKey("P_MODULE_MANAGEASSETS", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 450) {
m.CurrentName = GetTextByKey("P_MODULE_FICMANAGEMENT", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 500) {
m.CurrentName = GetTextByKey("P_MODULE_M3", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 550) {
m.CurrentName = GetTextByKey("P_MODULE_OVERUNDERTRUCKINGALERTS", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 600) {
m.CurrentName = GetTextByKey("P_MODULE_OTRCONFIG", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 650) {
m.CurrentName = GetTextByKey("P_MODULE_INSPECTION", m.Name);
m.CurrentDesc = m.CurrentName;
}
else if (parseInt(m.ID) === 700) {
m.CurrentName = GetTextByKey("P_MODULE_TEAMINTELLIGENCE", m.Name);
m.CurrentDesc = m.CurrentName;
}
}
function setSubItemsLang(subitems) {
for (var i = 0; i < subitems.length; i++) {
var sub = subitems[i];
if (sub.ID === "nav_credential")
sub.CurrentTitle = GetTextByKey("P_CREDENTIALS", sub.Title);
else if (sub.ID === "nav_jdlink")
sub.CurrentTitle = GetTextByKey("P_JDLINK", sub.Title);
else if (sub.ID === "nav_jdnotification")
sub.CurrentTitle = GetTextByKey("P_JOHNDEERENOTIFICATIONS", sub.Title);
else if (sub.ID === "nav_apicredential")
sub.CurrentTitle = GetTextByKey("P_APICREDENTIALS", sub.Title);
else if (sub.ID === "nav_users")
sub.CurrentTitle = GetTextByKey("P_USERS", sub.Title);
else if (sub.ID === "nav_user_group")
sub.CurrentTitle = GetTextByKey("P_USERSGROUP", sub.Title);
else if (sub.ID === "nav_dts")
sub.CurrentTitle = GetTextByKey("P_DATATABLEPERMISSION", sub.Title);
else if (sub.ID === "nav_filters")
sub.CurrentTitle = GetTextByKey("P_DASHBOARDFILTERS", sub.Title);
else if (sub.ID === "nav_curfew")
sub.CurrentTitle = GetTextByKey("P_CURFEWCONFIGURATION", sub.Title);
else if (sub.ID === "nav_curfewmt")
sub.CurrentTitle = GetTextByKey("P_CURFEWMOVEMENTTOLERANCE", sub.Title);
else if (sub.ID === "nav_alertsmanagement")
sub.CurrentTitle = GetTextByKey("P_ALERTSMANAGEMENTNEW", sub.Title);
else if (sub.ID === "nav_workorder")
sub.CurrentTitle = GetTextByKey("P_WORKORDERNEW", sub.Title);
else if (sub.ID === "nav_workorderhis")
sub.CurrentTitle = GetTextByKey("P_WORKORDERHISTORY", sub.Title);
else if (sub.ID === "nav_maintenanceschedule")
sub.CurrentTitle = GetTextByKey("P_PM_MAINTENANCESCHEDULES", sub.Title);
else if (sub.ID === "nav_record")
sub.CurrentTitle = GetTextByKey("P_MAINTENANCERECORDLEGACY", sub.Title);
else if (sub.ID === "nav_fuelrecord")
sub.CurrentTitle = GetTextByKey("P_FUELRECORDS", sub.Title);
else if (sub.ID === "nav_manageharshdriving")
sub.CurrentTitle = GetTextByKey("P_MANAGEHARSHDRIVING", sub.Title);
else if (sub.ID === "nav_managmachines")
sub.CurrentTitle = GetTextByKey("P_MANAGEASSETS", sub.Title);
else if (sub.ID === "nav_managrentals")
sub.CurrentTitle = GetTextByKey("P_MANAGERENTALS", sub.Title);
else if (sub.ID === "nav_machinegroups")
sub.CurrentTitle = GetTextByKey("P_ASSETGROUPS", sub.Title);
else if (sub.ID === "nav_managegpsdevices")
sub.CurrentTitle = GetTextByKey("P_MANAGEDEVICES", sub.Title);
else if (sub.ID === "nav_managmodels")
sub.CurrentTitle = GetTextByKey("P_MANAGEMODELS", sub.Title);
}
}