diff --git a/IronIntelContractorBusiness/ExportExcel/ConvertFormat.cs b/IronIntelContractorBusiness/ExportExcel/ConvertFormat.cs index 11b068e..6a681ab 100644 --- a/IronIntelContractorBusiness/ExportExcel/ConvertFormat.cs +++ b/IronIntelContractorBusiness/ExportExcel/ConvertFormat.cs @@ -97,7 +97,7 @@ namespace IronIntel.Contractor } else if (DataType == CellDataType.Date) { - ft = "MM-dd-yyyy"; + ft = "M-d-yyyy"; } else if (DataType == CellDataType.Bool) { diff --git a/IronIntelContractorBusiness/ExportExcel/ImportFromExcel.cs b/IronIntelContractorBusiness/ExportExcel/ImportFromExcel.cs index 7987aaf..c0a98b8 100644 --- a/IronIntelContractorBusiness/ExportExcel/ImportFromExcel.cs +++ b/IronIntelContractorBusiness/ExportExcel/ImportFromExcel.cs @@ -228,7 +228,7 @@ namespace IronIntel.Contractor.ExportExcel CellFormat cf = (CellFormat)stylepart.Stylesheet.CellFormats.ElementAt((int)cell.StyleIndex.Value); if (cf.NumberFormatId >= 14 && cf.NumberFormatId <= 22)//Date { - value = DateTime.FromOADate(d).ToString("MM/dd/yyyy"); + value = DateTime.FromOADate(d).ToString("M/d/yyyy"); } } } diff --git a/IronIntelContractorBusiness/ExportExcelManager.cs b/IronIntelContractorBusiness/ExportExcelManager.cs index 02ad734..e679118 100644 --- a/IronIntelContractorBusiness/ExportExcelManager.cs +++ b/IronIntelContractorBusiness/ExportExcelManager.cs @@ -260,10 +260,10 @@ namespace IronIntel.Contractor dr[0] = asset.DisplayName; dr[1] = asset.VIN; dr[2] = r.UserName; - dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); + dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); dr[4] = r.Odometer; dr[5] = r.UOM; - dr[6] = r.OdometerLocalTime.ToString("M/d/yyyy h:m tt"); + dr[6] = r.OdometerLocalTime.ToString("M/d/yyyy h:mm tt"); dr[7] = r.Notes; dt.Rows.Add(dr); } @@ -314,9 +314,9 @@ namespace IronIntel.Contractor dr[0] = asset.DisplayName; dr[1] = asset.VIN; dr[2] = r.UserName; - dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); + dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); dr[4] = r.EngineHours; - dr[5] = r.EngineHoursLocalTime.ToString("M/d/yyyy h:m tt"); + dr[5] = r.EngineHoursLocalTime.ToString("M/d/yyyy h:mm tt"); dr[6] = r.Notes; dt.Rows.Add(dr); } diff --git a/IronIntelContractorBusiness/Machines/EngineHoursInfo.cs b/IronIntelContractorBusiness/Machines/EngineHoursInfo.cs index f3248ba..18e259a 100644 --- a/IronIntelContractorBusiness/Machines/EngineHoursInfo.cs +++ b/IronIntelContractorBusiness/Machines/EngineHoursInfo.cs @@ -83,7 +83,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTime.ToString("M/d/yyyy h:m tt"); + return AsofTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AsofTimeLocal { get; set; } @@ -91,7 +91,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTimeLocal.ToString("M/d/yyyy h:m tt"); + return AsofTimeLocal.ToString("M/d/yyyy h:mm tt"); } } } @@ -109,7 +109,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTime.ToString("M/d/yyyy h:m tt"); + return AsofTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AsofTimeLocal { get; set; } @@ -117,7 +117,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTimeLocal.ToString("M/d/yyyy h:m tt"); + return AsofTimeLocal.ToString("M/d/yyyy h:mm tt"); } } } @@ -133,7 +133,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTime.ToString("M/d/yyyy h:m tt"); + return AsofTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AsofTimeLocal { get; set; } @@ -141,7 +141,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTimeLocal.ToString("M/d/yyyy h:m tt"); + return AsofTimeLocal.ToString("M/d/yyyy h:mm tt"); } } } @@ -153,13 +153,13 @@ namespace IronIntel.Contractor.Machines public string DisplayName { get; set; }//Asset Name public string VIN { get; set; } public DateTime AdjustmentTime { get; set; } - public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:m tt"); } } + public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime EngineHoursTime { get; set; } - public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:m tt"); } } + public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AdjustmentLocalTime { get; set; } - public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); } } + public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime EngineHoursLocalTime { get; set; } - public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:m tt"); } } + public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:mm tt"); } } private double _EngineHours; public double EngineHours diff --git a/IronIntelContractorBusiness/Machines/MachineItem.cs b/IronIntelContractorBusiness/Machines/MachineItem.cs index 49fbb2f..6a0633e 100644 --- a/IronIntelContractorBusiness/Machines/MachineItem.cs +++ b/IronIntelContractorBusiness/Machines/MachineItem.cs @@ -167,15 +167,15 @@ namespace IronIntel.Contractor.Machines public string AddedOnStr { - get { return AddedLocalTime == null ? "" : AddedLocalTime.Value.ToString("MM/dd/yyyy"); } + get { return AddedLocalTime == null ? "" : AddedLocalTime.Value.ToString("M/d/yyyy"); } } public string EngineHoursDateTimeStr { - get { return EngineHoursLocalTime == null ? "" : EngineHoursLocalTime.Value.ToString("MM/dd/yyyy"); } + get { return EngineHoursLocalTime == null ? "" : EngineHoursLocalTime.Value.ToString("M/d/yyyy"); } } public string OdometerDateTimeStr { - get { return OdometerLocalTime == null ? "" : OdometerLocalTime.Value.ToString("MM/dd/yyyy"); } + get { return OdometerLocalTime == null ? "" : OdometerLocalTime.Value.ToString("M/d/yyyy"); } } } @@ -316,10 +316,10 @@ namespace IronIntel.Contractor.Machines public bool Utilization { get; set; } public string SalesOrderNumber { get; set; } public string AddDateStr { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToShortDateString(); } } - public string AddDateStr1 { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToString("yyyy-MM-dd"); } } + public string AddDateStr1 { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToString("M/D/yyyy"); } } public string InvoiceDateStr { get { return InvoiceDate == null ? "" : InvoiceDate.Value.ToShortDateString(); } } public string ServiceStartDateStr { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToShortDateString(); } } - public string ServiceStartDateStr1 { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToString("yyyy-MM-dd"); } } + public string ServiceStartDateStr1 { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToString("M/D/yyyy"); } } } public class PairedAssetItem @@ -339,7 +339,7 @@ namespace IronIntel.Contractor.Machines public class CommentItem : Foresight.Fleet.Services.CommentInfo { - public string SubmitDateStr { get { return SubmitLocalDate == DateTime.MinValue ? "" : SubmitLocalDate.ToString("M/d/yyyy h:m tt"); } } + public string SubmitDateStr { get { return SubmitLocalDate == DateTime.MinValue ? "" : SubmitLocalDate.ToString("M/d/yyyy h:mm tt"); } } public void FormatFollowUp() { @@ -357,7 +357,7 @@ namespace IronIntel.Contractor.Machines } public class InstallNotesItemC : Foresight.Fleet.Services.Device.InstallNotesItem { - public string InstallTimeLocalStr { get { return InstallTimeLocal == DateTime.MinValue ? "" : InstallTimeLocal.ToString("M/d/yyyy h:m:s tt"); } } + public string InstallTimeLocalStr { get { return InstallTimeLocal == DateTime.MinValue ? "" : InstallTimeLocal.ToString("M/d/yyyy h:mm:ss tt"); } } } public class MachineGroup diff --git a/IronIntelContractorBusiness/Machines/MachineManagement.cs b/IronIntelContractorBusiness/Machines/MachineManagement.cs index c94e632..2325819 100644 --- a/IronIntelContractorBusiness/Machines/MachineManagement.cs +++ b/IronIntelContractorBusiness/Machines/MachineManagement.cs @@ -277,73 +277,6 @@ namespace IronIntel.Contractor.Machines } } - public static MachineItem[] GetMachines(string sessionid, string useriid, string searchtxt, string companyid = null) - { - string SQL = "select " + string.Format(MachineFields, "") + " from MACHINES order by MACHINENAME"; - - FIDbAccess db = null; - if (string.IsNullOrEmpty(companyid)) - { - companyid = SystemParams.CompanyID; - db = SystemParams.GetDbInstance(); - } - else - { - string connetionstring = SystemParams.GetDbStringByCompany(companyid); - db = new FISqlConnection(connetionstring); - } - - DataTable tb = db.GetDataTableBySQL(SQL); - if (tb.Rows.Count == 0) - { - return new MachineItem[0]; - } - long[] availableAssetsids = null; - IronIntel.Contractor.Users.UserInfo user = null; - if (!string.IsNullOrWhiteSpace(useriid)) - { - user = Users.UserManagement.GetUserByIID(useriid); - if (user.UserType < Users.UserTypes.Admin) - availableAssetsids = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid).GetAvailableAssetsForUsers(companyid, useriid); - } - - RefreshBaseData(); - AssetMake[] makes = GetMachineMakes(); - AssetModel[] models = GetMachineModels(); - AssetType[] types = GetMachineTypes(); - - List<MachineItem> ls = new List<MachineItem>(); - if (tb.Rows.Count > 0) - { - foreach (DataRow dr in tb.Rows) - { - long mid = FIDbAccess.GetFieldInt64(dr["MACHINEID"], 0); - if (!string.IsNullOrWhiteSpace(useriid) && user.UserType < Users.UserTypes.Admin && !availableAssetsids.Contains(mid)) - continue; - - MachineItem mi = ConvertToMachineItem(dr, makes, models, types); - if (!string.IsNullOrWhiteSpace(searchtxt)) - { - if (Helper.Contains(mi.VIN, searchtxt) - || Helper.Contains(mi.MachineID.ToString(), searchtxt) - || Helper.Contains(mi.Name, searchtxt) - || Helper.Contains(mi.Name2, searchtxt) - || Helper.Contains(mi.Make, searchtxt) - || Helper.Contains(mi.MachineType, searchtxt) - || Helper.Contains(mi.Model, searchtxt)) - { - ls.Add(mi); - } - } - else - { - ls.Add(mi); - } - } - } - return ls.ToArray(); - } - public static MachineItem[] GetSelectMachinesByRental(string sessionid, string useriid, string searchtxt, string companyid = null) { diff --git a/IronIntelContractorBusiness/Machines/OdometerInfo.cs b/IronIntelContractorBusiness/Machines/OdometerInfo.cs index 76aba9f..293ed1f 100644 --- a/IronIntelContractorBusiness/Machines/OdometerInfo.cs +++ b/IronIntelContractorBusiness/Machines/OdometerInfo.cs @@ -96,7 +96,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTime.ToString("M/d/yyyy h:m tt"); + return AsofTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AsofTimeLocal { get; set; } @@ -104,7 +104,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTimeLocal.ToString("M/d/yyyy h:m tt"); + return AsofTimeLocal.ToString("M/d/yyyy h:mm tt"); } } } @@ -124,7 +124,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTime.ToString("M/d/yyyy h:m tt"); + return AsofTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AsofTimeLocal { get; set; } @@ -132,7 +132,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTimeLocal.ToString("M/d/yyyy h:m tt"); + return AsofTimeLocal.ToString("M/d/yyyy h:mm tt"); } } } @@ -150,7 +150,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTime.ToString("M/d/yyyy h:m tt"); + return AsofTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AsofTimeLocal { get; set; } @@ -158,7 +158,7 @@ namespace IronIntel.Contractor.Machines { get { - return AsofTimeLocal.ToString("M/d/yyyy h:m tt"); + return AsofTimeLocal.ToString("M/d/yyyy h:mm tt"); } } } @@ -180,13 +180,13 @@ namespace IronIntel.Contractor.Machines public string DisplayName { get; set; }//Asset Name public string VIN { get; set; } public DateTime AdjustmentTime { get; set; } - public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:m tt"); } } + public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime OdometerTime { get; set; } - public string OdometerTimeText { get { return OdometerTime.ToString("M/d/yyyy h:m tt"); } } + public string OdometerTimeText { get { return OdometerTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime AdjustmentLocalTime { get; set; } - public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); } } + public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } } public DateTime OdometerLocalTime { get; set; } - public string OdometerLocalTimeText { get { return OdometerLocalTime.ToString("M/d/yyyy h:m tt"); } } + public string OdometerLocalTimeText { get { return OdometerLocalTime.ToString("M/d/yyyy h:mm tt"); } } private double _Odometer; public double Odometer diff --git a/IronIntelContractorBusiness/Maintenance/FuelRecordInfo.cs b/IronIntelContractorBusiness/Maintenance/FuelRecordInfo.cs index 7d4d656..a06112a 100644 --- a/IronIntelContractorBusiness/Maintenance/FuelRecordInfo.cs +++ b/IronIntelContractorBusiness/Maintenance/FuelRecordInfo.cs @@ -26,9 +26,9 @@ namespace IronIntel.Contractor.Maintenance public string DriverName { get; set; } public string TicketNumber { get; set; } public DateTime TransactionDate { get; set; } - public string TransactionDateStr { get { return TransactionDate == DateTime.MinValue ? "" : TransactionDate.ToString("M/d/yyyy h:m tt"); } } + public string TransactionDateStr { get { return TransactionDate == DateTime.MinValue ? "" : TransactionDate.ToString("M/d/yyyy h:mm tt"); } } public DateTime TransactionLocalDate { get; set; } - public string TransactionLocalDateStr { get { return TransactionLocalDate == DateTime.MinValue ? "" : TransactionLocalDate.ToString("M/d/yyyy h:m tt"); } } + public string TransactionLocalDateStr { get { return TransactionLocalDate == DateTime.MinValue ? "" : TransactionLocalDate.ToString("M/d/yyyy h:mm tt"); } } public string AssetModel { get; set; } public string AssetMake { get; set; } public string AssetType { get; set; } @@ -52,14 +52,14 @@ namespace IronIntel.Contractor.Maintenance public string LasetUpdatedBy { get; set; } public string LasetUpdatedByName { get; set; } public DateTime AddedOn { get; set; } - public string AddedOnStr { get { return AddedOn == DateTime.MinValue ? "" : AddedOn.ToString("M/d/yyyy h:m:s tt"); } } + public string AddedOnStr { get { return AddedOn == DateTime.MinValue ? "" : AddedOn.ToString("M/d/yyyy h:mm:ss tt"); } } public DateTime LastUpdatedOn { get; set; } - public string LastUpdatedOnStr { get { return LastUpdatedOn == DateTime.MinValue ? "" : LastUpdatedOn.ToString("M/d/yyyy h:m:s tt"); } } + public string LastUpdatedOnStr { get { return LastUpdatedOn == DateTime.MinValue ? "" : LastUpdatedOn.ToString("M/d/yyyy h:mm:ss tt"); } } public DateTime AddedOn_Local { get; set; } - public string AddedOn_LocalStr { get { return AddedOn_Local == DateTime.MinValue ? "" : AddedOn_Local.ToString("M/d/yyyy h:m:s tt"); } } + public string AddedOn_LocalStr { get { return AddedOn_Local == DateTime.MinValue ? "" : AddedOn_Local.ToString("M/d/yyyy h:mm:ss tt"); } } public DateTime LastUpdatedOn_Local { get; set; } - public string LastUpdatedOn_LocalStr { get { return LastUpdatedOn_Local == DateTime.MinValue ? "" : LastUpdatedOn_Local.ToString("M/d/yyyy h:m:s tt"); } } + public string LastUpdatedOn_LocalStr { get { return LastUpdatedOn_Local == DateTime.MinValue ? "" : LastUpdatedOn_Local.ToString("M/d/yyyy h:mm:ss tt"); } } } } diff --git a/IronIntelContractorBusiness/Maintenance/MaintenanceInfo.cs b/IronIntelContractorBusiness/Maintenance/MaintenanceInfo.cs index c51fbff..1040a85 100644 --- a/IronIntelContractorBusiness/Maintenance/MaintenanceInfo.cs +++ b/IronIntelContractorBusiness/Maintenance/MaintenanceInfo.cs @@ -110,7 +110,7 @@ namespace IronIntel.Contractor.Maintenance { if (AlertTime != DateTime.MinValue) { - return AlertTime.ToString("M/d/yyyy h:m:s tt"); + return AlertTime.ToString("M/d/yyyy h:mm:ss tt"); } return ""; } @@ -249,7 +249,7 @@ namespace IronIntel.Contractor.Maintenance if (StartDate == null) return ""; else - return StartDate.Value.ToString("MM/dd/yyyy"); + return StartDate.Value.ToString("M/d/yyyy"); } } public string LastAlertTimeString @@ -259,7 +259,7 @@ namespace IronIntel.Contractor.Maintenance if (LastAlertTime == null) return ""; else - return LastAlertTime.Value.ToString("MM/dd/yyyy"); + return LastAlertTime.Value.ToString("M/d/yyyy"); } } } diff --git a/IronIntelContractorBusiness/Maintenance/MaintenanceManagement.cs b/IronIntelContractorBusiness/Maintenance/MaintenanceManagement.cs index 07cfefe..bf33278 100644 --- a/IronIntelContractorBusiness/Maintenance/MaintenanceManagement.cs +++ b/IronIntelContractorBusiness/Maintenance/MaintenanceManagement.cs @@ -434,7 +434,7 @@ namespace IronIntel.Contractor.Maintenance alert.AlertTitle = FIDbAccess.GetFieldString(dr["ALERTTITLE"], string.Empty); DateTime at = FIDbAccess.GetFieldDateTime(dr["ALERTTIME_UTC"], DateTime.MinValue); if (at != DateTime.MinValue) - alert.AlertTime = at.ToString("M/d/yyyy h:m:s tt"); + alert.AlertTime = at.ToString("M/d/yyyy h:mm:ss tt"); alerts.Add(alert); } return alerts.ToArray(); diff --git a/IronIntelContractorBusiness/Maintenance/WorkOrderInfo.cs b/IronIntelContractorBusiness/Maintenance/WorkOrderInfo.cs index 44ac0fb..49a0bff 100644 --- a/IronIntelContractorBusiness/Maintenance/WorkOrderInfo.cs +++ b/IronIntelContractorBusiness/Maintenance/WorkOrderInfo.cs @@ -129,14 +129,14 @@ namespace IronIntel.Contractor.Maintenance ls.Add(p.CustomerNumber); else { - p.CustomerNumber = Foresight.Standard.PhoneNumber.PreparePhonenumber(p.CustomerNumber); - ls.Add(p.CustomerNumber); + p.CustomerNumber = Foresight.Standard.PhoneNumber.FormatPhoneNumber(p.CustomerNumber); + ls.Add(Foresight.Standard.PhoneNumber.PreparePhonenumber(p.CustomerNumber)); } } } return ls.ToArray(); } } - public string TimeStr { get { return Time == DateTime.MinValue ? "" : Time.ToString("M/d/yyyy h:m tt"); } } + public string TimeStr { get { return Time == DateTime.MinValue ? "" : Time.ToString("M/d/yyyy h:mm tt"); } } } } diff --git a/IronIntelContractorBusiness/MapView/AssetMapViewManagement.cs b/IronIntelContractorBusiness/MapView/AssetMapViewManagement.cs index 5c81bfb..4cf20d3 100644 --- a/IronIntelContractorBusiness/MapView/AssetMapViewManagement.cs +++ b/IronIntelContractorBusiness/MapView/AssetMapViewManagement.cs @@ -32,16 +32,15 @@ namespace IronIntel.Contractor.MapView qp.FilterString = filtertext; qp.OnRoad = onroad; qp.IncludeNoLocation = IncludeNoLocation; - qp.IncludeAssetGroups = true; - qp.IncludeJobSites = true; if (param != null) { qp.ViewId = param.ViewID; qp.AlertViewQueryParam = param; } + qp.Attachment = attachment; var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid); - AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp, attachment); + AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp); List<AssetMapViewPinItemClient> result = new List<AssetMapViewPinItemClient>(); foreach (var a in assets) { @@ -122,6 +121,94 @@ namespace IronIntel.Contractor.MapView return results.ToArray(); } + /// <summary> + /// 根据Contractorid获取机器基础信息列表 + /// </summary> + /// <returns></returns> + public static MapViewAssetItem[] GetAssetBasicInfos(string sessionid, string companyid, string useriid) + { + if (string.IsNullOrEmpty(companyid)) + companyid = SystemParams.CompanyID; + + var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid); + MapViewAssetItem[] assets = client.GetAvailableAssetItems(companyid, useriid); + return assets.OrderBy(a => a.Id).ToArray(); + } + + /// <summary> + /// 获取Dealer站点下多个Contractor机器几次信息列表 + /// </summary> + /// <returns></returns> + public static MapViewAssetItem[] GetDealerAssetBasicInfos(string sessionid, string companyids, string useriid) + { + string[] cids = null; + if (!string.IsNullOrEmpty(companyids)) + cids = companyids.Split(','); + + var contractors = SystemParams.GetContractors(); + if (cids == null || cids.Length == 0) + cids = contractors.Select(c => c.ID).ToArray(); + + if (cids == null || cids.Length == 0) + return new MapViewAssetItem[0]; + + int requestCount = 0; + Exception lasterror = null; + List<MapViewAssetItem> results = new List<MapViewAssetItem>(); + foreach (var cid in cids) + { + requestCount++; + Thread th = new Thread((object state) => + { + try + { + var assets = GetAssetBasicInfos(sessionid, cid, useriid); + lock (results) + { + results.AddRange(assets); + } + } + catch (Exception ex) + { + lasterror = ex; + } + requestCount--; + }); + + th.Start(); + } + + while (true) + { + Thread.Sleep(10); + if (requestCount == 0) + { + break; + } + } + if (lasterror != null) + { + throw lasterror; + } + + return results.OrderBy(a => a.Id).ToArray(); + } + + /// <summary> + /// 根据机器ID获取机器基础信息列表 + /// </summary> + /// <returns></returns> + public static MapViewAssetItem[] GetAssetItemsByAssets(string sessionid, string companyid, string useriid, long[] assetids) + { + if (string.IsNullOrEmpty(companyid)) + companyid = SystemParams.CompanyID; + + var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid); + MapViewAssetItem[] assets = client.GetAssetItemsByAssets(companyid, useriid, assetids); + return assets.OrderBy(a => a.Id).ToArray(); + } + + public static AssetDetailViewItem GetAssetDetailItem(string sessionid, string companyid, long machineid, string datasource = null) { var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid); diff --git a/IronIntelContractorBusiness/Properties/AssemblyInfo.cs b/IronIntelContractorBusiness/Properties/AssemblyInfo.cs index 084f405..95775a5 100644 --- a/IronIntelContractorBusiness/Properties/AssemblyInfo.cs +++ b/IronIntelContractorBusiness/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("23.4.26")] +[assembly: AssemblyFileVersion("23.5.11")] diff --git a/IronIntelContractorSiteLib/Customer/CustomerRecordBasePage.cs b/IronIntelContractorSiteLib/Customer/CustomerRecordBasePage.cs index 544055b..7c24aa1 100644 --- a/IronIntelContractorSiteLib/Customer/CustomerRecordBasePage.cs +++ b/IronIntelContractorSiteLib/Customer/CustomerRecordBasePage.cs @@ -583,7 +583,7 @@ namespace IronIntel.Contractor.Site.Customer class CommentItem : CommentInfo { - public string SubmitLocalDateStr { get { return SubmitLocalDate == null ? "" : SubmitLocalDate.ToString("M/d/yyyy h:m:s tt"); } } + public string SubmitLocalDateStr { get { return SubmitLocalDate == null ? "" : SubmitLocalDate.ToString("M/d/yyyy h:mm:ss tt"); } } } diff --git a/IronIntelContractorSiteLib/FilterQBasePage.cs b/IronIntelContractorSiteLib/FilterQBasePage.cs index 0a228c2..9cff752 100644 --- a/IronIntelContractorSiteLib/FilterQBasePage.cs +++ b/IronIntelContractorSiteLib/FilterQBasePage.cs @@ -50,8 +50,8 @@ namespace IronIntel.Contractor.Site CumulativeHours = c.CumulativeHours, MachineTaskHourCheck = c.MachineTaskHourCheck, DiffToService = c.DiffToService, - EstDueDate = c.ESTServiceNeededBy.ToString("MM/dd/yyyy"), - EstShipDate = c.ESTShopDate.ToString("MM/dd/yyyy"), + EstDueDate = c.ESTServiceNeededBy.ToString("M/d/yyyy"), + EstShipDate = c.ESTShopDate.ToString("M/d/yyyy"), TaskComplete = c.TaskComplete, UPSTrackingNumber = c.UPSTrackingNumber, @@ -107,7 +107,7 @@ namespace IronIntel.Contractor.Site // 组织 shipdates var shipdates = datas.Distinct(new ShipDateEqualityComparer()) - .Select(m => m.ESTShopDate.ToString("MM/dd/yyyy")) + .Select(m => m.ESTShopDate.ToString("M/d/yyyy")) .OrderBy(d => d); var shipgroup = new FilterQGroupByShipDate { @@ -117,7 +117,7 @@ namespace IronIntel.Contractor.Site IEnumerable<MachineTasksNotificationInfo> dts = datas; if (query.ShipDates != null && query.ShipDates.Length > 0) { - dts = datas.Where(m => query.ShipDates.Contains(m.ESTShopDate.ToString("MM/dd/yyyy"))); + dts = datas.Where(m => query.ShipDates.Contains(m.ESTShopDate.ToString("M/d/yyyy"))); } else { diff --git a/IronIntelContractorSiteLib/InspectionBasePage.cs b/IronIntelContractorSiteLib/InspectionBasePage.cs index 35f2177..cc4dbb8 100644 --- a/IronIntelContractorSiteLib/InspectionBasePage.cs +++ b/IronIntelContractorSiteLib/InspectionBasePage.cs @@ -258,7 +258,7 @@ namespace IronIntel.Contractor.Site var sesstion = GetCurrentLoginSession(); if (sesstion != null) { - string clientdata = Request.Params["ClientData"]; + string clientdata = HttpUtility.HtmlDecode(Request.Params["ClientData"]); string[] ps = JsonConvert.DeserializeObject<string[]>(clientdata); bool teamintelligence = Helper.IsTrue(ps[0]); DateTime startdate = Helper.DBMinDateTime; @@ -894,7 +894,7 @@ namespace IronIntel.Contractor.Site var user = GetCurrentUser(); if (user != null) { - string clientdata = Request.Params["ClientData"]; + string clientdata = HttpUtility.HtmlDecode(Request.Params["ClientData"]); string[] ps = JsonConvert.DeserializeObject<string[]>(clientdata); bool teamintelligence = Helper.IsTrue(ps[0]); int state = 0; @@ -2355,9 +2355,18 @@ namespace IronIntel.Contractor.Site if (Request.Files.Count > 0) { - var logoFile = Request.Files[0]; - var logo = ConvertFile2bytes(logoFile); - layout.LOGO = FI.FIC.ResManager.MakeThumbnail(logo, 0, 180, "H"); + for (int i = 0; i < Request.Files.Count; i++) + { + var logoFile = Request.Files[i]; + var logo = ConvertFile2bytes(logoFile); + string key = Request.Files.AllKeys[i]; + if (string.Compare("iconFile", key, true) == 0) + layout.LOGO = FI.FIC.ResManager.MakeThumbnail(logo, 0, 180, "H"); + else if (string.Compare("iconCenterFile", key, true) == 0) + layout.CenterLOGO = FI.FIC.ResManager.MakeThumbnail(logo, 0, 180, "H"); + else if (string.Compare("iconRightFile", key, true) == 0) + layout.RightLOGO = FI.FIC.ResManager.MakeThumbnail(logo, 0, 180, "H"); + } } if (teamintelligence) diff --git a/IronIntelContractorSiteLib/IronIntelContractorSiteLib.csproj b/IronIntelContractorSiteLib/IronIntelContractorSiteLib.csproj index 2240ac2..cae3a95 100644 --- a/IronIntelContractorSiteLib/IronIntelContractorSiteLib.csproj +++ b/IronIntelContractorSiteLib/IronIntelContractorSiteLib.csproj @@ -37,6 +37,21 @@ <AssemblyOriginatorKeyFile>LHBIS.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <ItemGroup> + <Reference Include="FICBLC"> + <HintPath>..\Reflib\FIC\FICBLC.dll</HintPath> + </Reference> + <Reference Include="FICIntf, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Reflib\FIC\FICIntf.dll</HintPath> + </Reference> + <Reference Include="FICIntfAdv, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Reflib\FIC\FICIntfAdv.dll</HintPath> + </Reference> + <Reference Include="FICModels, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Reflib\FIC\FICModels.dll</HintPath> + </Reference> <Reference Include="FICore"> <HintPath>..\Reflib\FICore.dll</HintPath> </Reference> @@ -179,22 +194,6 @@ <None Include="LHBIS.snk" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\..\..\FI\FICG5\Core\Service\FICBLC\FICBLC.csproj"> - <Project>{39e2a8c6-f58f-4839-b7c1-82d44153fc3a}</Project> - <Name>FICBLC</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\..\FI\FICG5\Core\Service\FICIntf\FICIntfAdv\FICIntfAdv.csproj"> - <Project>{3ffa4093-4325-4fbb-a874-f288bfdcf7ba}</Project> - <Name>FICIntfAdv</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\..\FI\FICG5\Core\Service\FICIntf\FICIntf\FICIntf.csproj"> - <Project>{4963deb2-f0e3-44a3-b5e1-e13e191a8de8}</Project> - <Name>FICIntf</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\..\FI\FICG5\Core\Service\FICModels\FICModels.csproj"> - <Project>{f47ebf77-eed3-44e2-9983-ef556372a648}</Project> - <Name>FICModels</Name> - </ProjectReference> <ProjectReference Include="..\..\..\..\ForesightServices\Service\DataModel\FleetClientBase\FleetClientBase.csproj"> <Project>{b0110465-8537-4fe7-bee6-b10faa0ba92d}</Project> <Name>FleetClientBase</Name> diff --git a/IronIntelContractorSiteLib/MachineDeviceBasePage.cs b/IronIntelContractorSiteLib/MachineDeviceBasePage.cs index 6bc3cdd..20bcffe 100644 --- a/IronIntelContractorSiteLib/MachineDeviceBasePage.cs +++ b/IronIntelContractorSiteLib/MachineDeviceBasePage.cs @@ -98,9 +98,6 @@ namespace IronIntel.Contractor.Site case "GETJOBSITEASSETLIST": result = GetJobsiteAssetList(); break; - case "GETMACHINESBYGROUP": - result = GetMachinesByGroup(); - break; case "GETASSETSBYGROUP": result = GetAssetsByGroup(); break; @@ -149,9 +146,6 @@ namespace IronIntel.Contractor.Site case "DELETERENTAL": result = DeleteRental(); break; - case "GETSELECTMACHINESBYCOMPANY": - result = GetSelectMachinesByCompany(); - break; case "SEARCHRENTALCHANGEHISTORY": result = SearchRentalChangeHistory(); break; @@ -676,37 +670,6 @@ namespace IronIntel.Contractor.Site } } - private object GetSelectMachinesByCompany() - { - try - { - var session = GetCurrentLoginSession(); - if (session != null) - { - var companyid = HttpUtility.HtmlDecode(Request.Params["ClientData"]); - - FISqlConnection db = null; - if (SystemParams.IsDealer) - { - string connetionstring = SystemParams.GetDbStringByCompany(companyid); - db = new FISqlConnection(connetionstring); - } - MachineItem[] machines = MachineManagement.GetMachines(session.User.UID, "", companyid); - if (machines == null) - return new MachineItem[0]; - - return machines.Where(m => m.Hide == false).OrderBy(m => m.DisplayName).ToArray(); - } - else - return new MachineItem[0]; - } - catch (Exception ex) - { - return ex.Message; - } - } - - private object GetSelectMachinesByRental() { try @@ -1504,34 +1467,6 @@ namespace IronIntel.Contractor.Site } } - private object GetMachinesByGroup() - { - try - { - var session = GetCurrentLoginSession(); - if (GetCurrentLoginSession() != null) - { - var clientdata = Request.Form["ClientData"]; - var groupid = HttpUtility.HtmlDecode(clientdata); - - var allMachines = MachineManagement.GetMachines(session.SessionID, "", ""); - var machines = MachineManagement.GetMachineByGroup(groupid); - MachineGroupInfoItem mgi = new MachineGroupInfoItem(); - mgi.AllMachines = allMachines.Where(m => m.Hide == false).OrderBy((m) => m.VIN).ToArray(); - mgi.Machines = machines.OrderBy((m) => m.VIN).ToArray(); - - return mgi; - } - else - return ""; - } - catch (Exception ex) - { - AddLog("ERROR", "MachineDeviceBasePage.GetMachinesByGroup", ex.Message, ex.ToString()); - return ex.Message; - } - } - private object GetAssetsByGroup() { try @@ -3152,7 +3087,7 @@ namespace IronIntel.Contractor.Site DeviceProvider deviceprovider = CreateClient<DeviceProvider>(deviceitem.ContractorID); var existeddevice = deviceprovider.GetDevicesBySN(deviceitem.ContractorID, device.Source, device.SerialNumber); - if (existeddevice != null) + if (existeddevice != null && existeddevice.Id > 0) { device.Id = existeddevice.Id; device.AlternativeSerialNumber = existeddevice.AlternativeSerialNumber; @@ -4026,7 +3961,7 @@ namespace IronIntel.Contractor.Site public class AssetSummaryItem : AssetSummaryInfo { public string TimeZoneAbbreviation { get; set; } - public string OdometerAsofTimeLocalStr { get { return (Odometer == null || Odometer.AsofTimeLocal == null || Odometer.AsofTimeLocal == DateTime.MinValue) ? "" : Odometer.AsofTimeLocal.ToString("M/d/yyyy hh:mm:ss tt"); } } + public string OdometerAsofTimeLocalStr { get { return (Odometer == null || Odometer.AsofTimeLocal == null || Odometer.AsofTimeLocal == DateTime.MinValue) ? "" : Odometer.AsofTimeLocal.ToString("M/d/yyyy h:mm:ss tt"); } } public bool IsOdometerRed { get @@ -4039,7 +3974,7 @@ namespace IronIntel.Contractor.Site return result; } } - public string EngineHoursAsofTimeLocalStr { get { return (EngineHours == null || EngineHours.AsofTimeLocal == null || EngineHours.AsofTimeLocal == DateTime.MinValue) ? "" : EngineHours.AsofTimeLocal.ToString("M/d/yyyy hh:mm:ss tt"); } } + public string EngineHoursAsofTimeLocalStr { get { return (EngineHours == null || EngineHours.AsofTimeLocal == null || EngineHours.AsofTimeLocal == DateTime.MinValue) ? "" : EngineHours.AsofTimeLocal.ToString("M/d/yyyy h:mm:ss tt"); } } public bool IsEngineHoursRed { get @@ -4053,7 +3988,7 @@ namespace IronIntel.Contractor.Site } } - public string LocationAsofTimeLocalStr { get { return (Location == null || Location.AsofTimeLocal == null || Location.AsofTimeLocal == DateTime.MinValue) ? "" : Location.AsofTimeLocal.ToString("M/d/yyyy hh:mm:ss tt"); } } + public string LocationAsofTimeLocalStr { get { return (Location == null || Location.AsofTimeLocal == null || Location.AsofTimeLocal == DateTime.MinValue) ? "" : Location.AsofTimeLocal.ToString("M/d/yyyy h:mm:ss tt"); } } public bool IsLocationRed { get @@ -4087,7 +4022,7 @@ namespace IronIntel.Contractor.Site public class AssetAlertItem : AssetAlertsInfo { public string AlertLocalDateStr { get { return (AlertLocalTime == null || AlertLocalTime == null || AlertLocalTime == DateTime.MinValue) ? "" : AlertLocalTime.ToString("M/d/yyyy"); } } - public string AlertLocalTimeStr { get { return (AlertLocalTime == null || AlertLocalTime == null || AlertLocalTime == DateTime.MinValue) ? "" : AlertLocalTime.ToString("hh:mm:ss tt"); } } + public string AlertLocalTimeStr { get { return (AlertLocalTime == null || AlertLocalTime == null || AlertLocalTime == DateTime.MinValue) ? "" : AlertLocalTime.ToString("h:mm:ss tt"); } } } public class AssetPMPlanItem : AssetPMPlanInfo diff --git a/IronIntelContractorSiteLib/Maintenance/AlertsBasePage.cs b/IronIntelContractorSiteLib/Maintenance/AlertsBasePage.cs index 283a295..2aa256d 100644 --- a/IronIntelContractorSiteLib/Maintenance/AlertsBasePage.cs +++ b/IronIntelContractorSiteLib/Maintenance/AlertsBasePage.cs @@ -130,6 +130,7 @@ namespace IronIntel.Contractor.Site.Maintenance if (!alertparam.AlertStatus.Contains("Completed") && alertparam.AlertStatus.Contains("Uncompleted")) completed = 0; } + alertparam.SearchText = HttpUtility.HtmlDecode(alertparam.SearchText); AssetAlertGridViewItem[] assetalerts = null; if (alertparam.AssetID > 0) @@ -190,6 +191,7 @@ namespace IronIntel.Contractor.Site.Maintenance if (!alertparam.AlertStatus.Contains("Completed") && alertparam.AlertStatus.Contains("Uncompleted")) completed = 0; } + alertparam.SearchText = HttpUtility.HtmlDecode(alertparam.SearchText); AssetAlertGridViewItem[] assetalerts = null; if (alertparam.AssetID > 0) @@ -371,6 +373,7 @@ namespace IronIntel.Contractor.Site.Maintenance if (!DateTime.TryParse(alertparam.EndDate, out endDate)) endDate = DateTime.MaxValue; + alertparam.SearchText = HttpUtility.HtmlDecode(alertparam.SearchText); alertparam.AlertStatus = new string[0]; AcknowledgedAlertItem[] ackalerts = CreateClient<AlertProvider>().GetAcknowledgedAlerts(SystemParams.CompanyID, beginDate, endDate, alertparam.AlertTypes, alertparam.AssetGroups, alertparam.SearchText); if (ackalerts == null || ackalerts.Length == 0) @@ -495,10 +498,18 @@ namespace IronIntel.Contractor.Site.Maintenance if (items == null) return new AlertItems(); - return items; + return new + { + WorkOrderID = workorderid, + Data = items + }; } else - return new AlertItems(); + return new + { + WorkOrderID = -1, + Data = new AlertItems() + }; } catch (Exception ex) { @@ -576,10 +587,18 @@ namespace IronIntel.Contractor.Site.Maintenance items.AllExpectedCost += recalerts.Sum(m => m.ExpectedCost); } } - return items; + return new + { + MachineID = machineid, + Data = items + }; } else - return new AlertInfo[0]; + return new + { + MachineID = -1, + Data = new AlertInfo[0] + }; } catch (Exception ex) { diff --git a/IronIntelContractorSiteLib/Maintenance/PreventativeMaintenanceBasePage.cs b/IronIntelContractorSiteLib/Maintenance/PreventativeMaintenanceBasePage.cs index faa0aea..6dae60b 100644 --- a/IronIntelContractorSiteLib/Maintenance/PreventativeMaintenanceBasePage.cs +++ b/IronIntelContractorSiteLib/Maintenance/PreventativeMaintenanceBasePage.cs @@ -498,7 +498,7 @@ namespace IronIntel.Contractor.Site.Maintenance if (StartDate == null) return ""; else - return StartDate.Value.ToString("MM/dd/yyyy"); + return StartDate.Value.ToString("M/d/yyyy"); } } } diff --git a/IronIntelContractorSiteLib/Maintenance/WorkOrderBasePage.cs b/IronIntelContractorSiteLib/Maintenance/WorkOrderBasePage.cs index e5ca908..09bf3ea 100644 --- a/IronIntelContractorSiteLib/Maintenance/WorkOrderBasePage.cs +++ b/IronIntelContractorSiteLib/Maintenance/WorkOrderBasePage.cs @@ -1,4 +1,5 @@ using FI.FIC; +using FI.FIC.Contracts.DataObjects.BLObject; using Foresight.Fleet.Services; using Foresight.Fleet.Services.Asset; using Foresight.Fleet.Services.AssetHealth; @@ -16,10 +17,12 @@ using IronIntel.Contractor.Users; using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics.Contracts; using System.Linq; using System.Net.Mail; using System.Runtime.InteropServices; +using System.Security.Cryptography; using System.Text; using System.Web; @@ -50,8 +53,8 @@ namespace IronIntel.Contractor.Site.Maintenance case "RESTOREDELETEWORKORDER": result = RestoreDeleteWorkOrder(); break; - case "GETCONTACTS": - result = GetContacts(); + case "GETASSETCONTACTS": + result = GetAssetContacts(); break; case "GETMACHINES": result = GetMachines(); @@ -308,6 +311,9 @@ namespace IronIntel.Contractor.Site.Maintenance case "UPDATEWORKORDERATTACHMENTCAPTION": result = UpdateWorkOrderAttachmentCaption(); break; + case "RECORDDOWNLOADLOG": + result = RecordDownloadLog(); + break; case "GETWOSERVICETIMESETTING": result = GetWOServiceTimeSetting(); break; @@ -383,6 +389,15 @@ namespace IronIntel.Contractor.Site.Maintenance case "GETSURVEYPREVIEWURL": result = GetSurveyPreviewUrl(); break; + case "GETWORKORDERWIDGETS": + result = GetWorkOrderWidgets(); + break; + case "SAVEWORKORDERWIDGETS": + result = SaveWorkOrderWidgets(); + break; + case "SAVEWORKORDERWIDGETLAYOUT": + result = SaveWorkOrderWidgetLayout(); + break; } } @@ -1163,7 +1178,7 @@ namespace IronIntel.Contractor.Site.Maintenance } } - private UserInfo[] GetContacts() + private UserInfo[] GetAssetContacts() { var session = GetCurrentLoginSession(); UserInfo[] users = null; @@ -1627,7 +1642,11 @@ namespace IronIntel.Contractor.Site.Maintenance WorkOrderSegmentInfo[] segments = CreateClient<WorkOrderProvider>().GetSegments(SystemParams.CompanyID, woid); if (segments == null || segments.Length == 0) - return new SegmentInfo[0]; + return new + { + WorkOrderID = woid, + Data = new SegmentInfo[0] + }; List<SegmentInfo> list = new List<SegmentInfo>(); foreach (WorkOrderSegmentInfo se in segments) @@ -1637,10 +1656,18 @@ namespace IronIntel.Contractor.Site.Maintenance si.SegmentID = se.Id; list.Add(si); } - return list.ToArray(); + return new + { + WorkOrderID = woid, + Data = list.ToArray() + }; } else - return new SegmentInfo[0]; + return new + { + WorkOrderID = -1, + Data = new SegmentInfo[0] + }; } catch (Exception ex) @@ -1778,7 +1805,11 @@ namespace IronIntel.Contractor.Site.Maintenance list.Add(item); } attas.InspectionAttachments = list.OrderBy(m => m.AddedOnLocal).ToArray(); - return attas; + return new + { + WorkOrderID = woid, + Data = attas + }; } else return null; @@ -1869,6 +1900,30 @@ namespace IronIntel.Contractor.Site.Maintenance } } + private object RecordDownloadLog() + { + try + { + var session = GetCurrentLoginSession(); + if (session != null) + { + var clientdata = HttpUtility.HtmlDecode(Request.Form["ClientData"]); + string[] ps = JsonConvert.DeserializeObject<string[]>(clientdata); + string url = ps[0]; + + FICHostEnvironment.WriteExportAuditTrail(session.User.UID, "Download", "", "Download", url, "", null); + + return "OK"; + } + else + return "Failed"; + } + catch (Exception ex) + { + return ex.Message; + } + } + private object UpdateWorkOrderAttachmentCaption() { try @@ -2628,6 +2683,12 @@ namespace IronIntel.Contractor.Site.Maintenance var user = GetCurrentUser(); if (user != null) { + bool license = SystemParams.HasLicense("CustomerRecord"); + bool crpermission = CheckRight(SystemParams.CompanyID, Foresight.Fleet.Services.User.Feature.CUSTOMER_RECORD); + bool AllowCustomer = license && crpermission; + bool AllowCommunicate = license && CheckRight(SystemParams.CompanyID, Foresight.Fleet.Services.User.Feature.COMMUNICATEWITHCUSTOMER); + if (!AllowCommunicate) return ""; + string clientdata = HttpUtility.HtmlDecode(Request.Params["ClientData"]); string[] ps = JsonConvert.DeserializeObject<string[]>(clientdata); long woid = Convert.ToInt64(ps[0]); @@ -2682,7 +2743,11 @@ namespace IronIntel.Contractor.Site.Maintenance var client = CreateClient<WorkOrderProvider>(); AssetInspectItem[] insplectitems = client.GetWOInspectItems(SystemParams.CompanyID, woid); if (insplectitems == null || insplectitems.Length == 0) - return new AssetInspectInfo[0]; + return new + { + WorkOrderID = woid, + Data = new AssetInspectItem[0] + }; List<AssetInspectInfo> list = new List<AssetInspectInfo>(); foreach (AssetInspectItem item in insplectitems) @@ -2699,11 +2764,18 @@ namespace IronIntel.Contractor.Site.Maintenance list[0].WorkOrders = wos; } - return list.ToArray(); - + return new + { + WorkOrderID = woid, + Data = list.ToArray() + }; } else - return new AssetInspectItem[0]; + return new + { + WorkOrderID = -1, + Data = new AssetInspectItem[0] + }; } catch (Exception ex) { @@ -2849,7 +2921,11 @@ namespace IronIntel.Contractor.Site.Maintenance var client = CreateClient<WorkOrderProvider>(); WorkOrderEstimateInfo[] estimates = client.GetWorkOrderEstimates(SystemParams.CompanyID, woid); if (estimates == null || estimates.Length == 0) - return new WorkOrderEstimateItem[0]; + return new + { + WorkOrderID = woid, + Data = new WorkOrderEstimateItem[0] + }; List<WorkOrderEstimateItem> list = new List<WorkOrderEstimateItem>(); foreach (WorkOrderEstimateInfo es in estimates) @@ -2872,11 +2948,18 @@ namespace IronIntel.Contractor.Site.Maintenance list.Add(item); } - return list.ToArray(); + return new + { + WorkOrderID = woid, + Data = list.ToArray() + }; } else - return new WorkOrderEstimateItem(); - + return new + { + WorkOrderID = -1, + Data = new WorkOrderEstimateItem[0] + }; } catch (Exception ex) { @@ -3367,7 +3450,7 @@ namespace IronIntel.Contractor.Site.Maintenance woendDate = DateTime.MaxValue; var client = CreateClient<WorkOrderSurveyProvider>(); - WorkOrderSurveyItem[] items = client.GetWorkOrderSurveyItems(SystemParams.CompanyID, status, beginDate, endDate == DateTime.MaxValue ? (DateTime?)null : endDate, ps[3], locations, advisors, tempid, wobeginDate, woendDate == DateTime.MaxValue ? (DateTime?)null : woendDate); + WorkOrderSurveyItem[] items = client.GetWorkOrderSurveyItems(SystemParams.CompanyID, status, beginDate, endDate == DateTime.MaxValue ? (DateTime?)null : endDate, HttpUtility.HtmlDecode(ps[3]), locations, advisors, tempid, wobeginDate, woendDate == DateTime.MaxValue ? (DateTime?)null : woendDate); if (items == null || items.Length == 0) return new WorkOrderSurveyInfo[0]; @@ -3651,7 +3734,11 @@ namespace IronIntel.Contractor.Site.Maintenance var client = CreateClient<WorkOrderProvider>(); WorkOrderInvoiceInfo[] invoices = client.GetWorkOrderInvoices(SystemParams.CompanyID, woid); if (invoices == null || invoices.Length == 0) - return new WorkOrderInvoiceInfoItem[0]; + return new + { + WorkOrderID = woid, + Data = new WorkOrderInvoiceInfoItem[0] + }; List<WorkOrderInvoiceInfoItem> list = new List<WorkOrderInvoiceInfoItem>(); foreach (WorkOrderInvoiceInfo es in invoices) @@ -3709,11 +3796,18 @@ namespace IronIntel.Contractor.Site.Maintenance list.Add(item); } - return list.ToArray(); + return new + { + WorkOrderID = woid, + Data = list.ToArray() + }; } else - return new WorkOrderInvoiceInfoItem(); - + return new + { + WorkOrderID = -1, + Data = new WorkOrderInvoiceInfoItem[0] + }; } catch (Exception ex) { @@ -4398,7 +4492,101 @@ namespace IronIntel.Contractor.Site.Maintenance } } - #endregion + #endregion + + #region Widgets + + private object GetWorkOrderWidgets() + { + try + { + var session = GetCurrentLoginSession(); + if (session != null) + { + var client = CreateClient<Foresight.Fleet.Services.User.UserProfileProvider>(); + Foresight.Fleet.Services.User.UserWidgetInfo[] items = client.GetWidgets(SystemParams.CompanyID, session.User.UID, "WorkOrder"); + if (items == null || items.Length == 0) + return new Foresight.Fleet.Services.User.UserWidgetInfo[0]; + + bool license = SystemParams.HasLicense("CustomerRecord"); + bool crpermission = CheckRight(SystemParams.CompanyID, Foresight.Fleet.Services.User.Feature.CUSTOMER_RECORD); + bool AllowCustomer = license && crpermission; + bool AllowCommunicate = license && CheckRight(SystemParams.CompanyID, Foresight.Fleet.Services.User.Feature.COMMUNICATEWITHCUSTOMER); + if (!AllowCustomer) + { + items = items.Where(i => !i.WidgetId.Equals("Estimates", StringComparison.OrdinalIgnoreCase) + && !i.WidgetId.Equals("Invoices", StringComparison.OrdinalIgnoreCase)).ToArray(); + } + if (!AllowCommunicate) + { + items = items.Where(i => !i.WidgetId.Equals("CustomerCommunication", StringComparison.OrdinalIgnoreCase)).ToArray(); + } + + license = SystemParams.HasLicense("Inspection"); + bool AllowInspection = license && CheckRight(SystemParams.CompanyID, Foresight.Fleet.Services.User.Feature.INSPECTION_REPORTS); + if (!AllowInspection) + { + items = items.Where(i => !i.WidgetId.Equals("Inspections", StringComparison.OrdinalIgnoreCase)).ToArray(); + } + + return items; + } + else + return new Foresight.Fleet.Services.User.UserWidgetInfo[0]; + } + catch (Exception ex) + { + AddLog("ERROR", "WorkOrderBasePage.GetWorkOrderWidgets", ex.Message, ex.ToString()); + return ex.Message; + } + } + + private object SaveWorkOrderWidgets() + { + try + { + var session = GetCurrentLoginSession(); + if (session != null) + { + var clientdata = HttpUtility.HtmlDecode(Request.Form["ClientData"]); + + var widgets = JsonConvert.DeserializeObject<Foresight.Fleet.Services.User.UserWidgetInfo[]>(clientdata); + CreateClient<Foresight.Fleet.Services.User.UserProfileProvider>().SaveWidgets(SystemParams.CompanyID, widgets); + return "OK"; + } + else + return "Failed"; + } + catch (Exception ex) + { + return ex.Message; + } + } + + private object SaveWorkOrderWidgetLayout() + { + try + { + var session = GetCurrentLoginSession(); + if (session != null) + { + var clientdata = HttpUtility.HtmlDecode(Request.Form["ClientData"]); + + var widget = JsonConvert.DeserializeObject<Foresight.Fleet.Services.User.UserWidgetInfo>(clientdata); + widget.UserIID = session.User.UID; + widget.Category = "WorkOrder"; + CreateClient<Foresight.Fleet.Services.User.UserProfileProvider>().SaveWidgetLayout(SystemParams.CompanyID, widget); + return "OK"; + } + else + return "Failed"; + } + catch (Exception ex) + { + return ex.Message; + } + } + #endregion } diff --git a/IronIntelContractorSiteLib/MapView/MapViewHandler.cs b/IronIntelContractorSiteLib/MapView/MapViewHandler.cs index d32e932..5fc1b1a 100644 --- a/IronIntelContractorSiteLib/MapView/MapViewHandler.cs +++ b/IronIntelContractorSiteLib/MapView/MapViewHandler.cs @@ -37,6 +37,12 @@ namespace IronIntel.Contractor.Site.MapView case "GetAssets": result = GetAssets(); break; + case "GetAssetBasicInfos": + result = GetAssetBasicInfos(); + break; + case "GetAssetBasicInfoByAssets": + result = GetAssetBasicInfoByAssets(); + break; case "GetAssetGroups": result = GetAssetGroups(); break; @@ -125,6 +131,7 @@ namespace IronIntel.Contractor.Site.MapView throw ex; } string json = JsonConvert.SerializeObject(result, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + Context.Response.ContentType = "application/json"; Context.Response.Write(json); Context.Response.End(); } @@ -181,6 +188,47 @@ namespace IronIntel.Contractor.Site.MapView //return assets; } + private MapViewAssetItem[] GetAssetBasicInfos() + {//获取用户有权的机器的基础信息,缓存在前端 + MapViewAssetItem[] assets = null; + if (LoginSession != null) + { + var clientdata = Context.Request.Params["ClientData"]; + + clientdata = HttpUtility.HtmlDecode(clientdata); + string[] ps = JsonConvert.DeserializeObject<string[]>(clientdata); + + if (!SystemParams.IsDealer) + assets = AssetMapViewManagement.GetAssetBasicInfos(LoginSession.SessionID, ps[0], LoginSession.User.UID); + else + assets = AssetMapViewManagement.GetDealerAssetBasicInfos(LoginSession.SessionID, ps[0], LoginSession.User.UID); + } + else + assets = new MapViewAssetItem[0]; + + return assets; + } + + private MapViewAssetItem[] GetAssetBasicInfoByAssets() + {//获取用户有权的机器的基础信息,缓存在前端 + MapViewAssetItem[] assets = null; + if (LoginSession != null) + { + var clientdata = Context.Request.Params["ClientData"]; + + clientdata = HttpUtility.HtmlDecode(clientdata); + string[] ps = JsonConvert.DeserializeObject<string[]>(clientdata); + long[] assetids = JsonConvert.DeserializeObject<long[]>(ps[1]); + + if (assetids.Length > 0) + assets = AssetMapViewManagement.GetAssetItemsByAssets(LoginSession.SessionID, ps[0], LoginSession.User.UID, assetids); + } + else + assets = new MapViewAssetItem[0]; + + return assets; + } + private AssetGroupViewItem[] GetAssetGroups() { AssetGroupViewItem[] groups = null; diff --git a/IronIntelContractorSiteLib/Properties/AssemblyInfo.cs b/IronIntelContractorSiteLib/Properties/AssemblyInfo.cs index 24d2d0f..cb540a7 100644 --- a/IronIntelContractorSiteLib/Properties/AssemblyInfo.cs +++ b/IronIntelContractorSiteLib/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("23.4.26")] +[assembly: AssemblyFileVersion("23.5.11")] diff --git a/IronIntelContractorSiteLib/Security/UserToContractorPage.cs b/IronIntelContractorSiteLib/Security/UserToContractorPage.cs index bfb84b0..4131dfd 100644 --- a/IronIntelContractorSiteLib/Security/UserToContractorPage.cs +++ b/IronIntelContractorSiteLib/Security/UserToContractorPage.cs @@ -91,7 +91,7 @@ namespace IronIntel.Contractor.Site.Security contractors[i] = HttpUtility.UrlDecode(contractors[i]); } UserManagement.AddUserToContractor(iid, contractors); - Response.Write(JsonConvert.SerializeObject("Save contractors info successfully.")); + Response.Write("Save contractors info successfully."); Response.End(); } } diff --git a/IronIntelContractorSiteLib/SingleAssetViewBasePage.cs b/IronIntelContractorSiteLib/SingleAssetViewBasePage.cs index 6202928..cb2b54b 100644 --- a/IronIntelContractorSiteLib/SingleAssetViewBasePage.cs +++ b/IronIntelContractorSiteLib/SingleAssetViewBasePage.cs @@ -418,7 +418,7 @@ namespace IronIntel.Contractor.Site var session = GetCurrentLoginSession(); if (session != null) { - return SystemParams.ConvertToUserTimeFromUtc(session.User, DateTime.UtcNow).ToString("M/d/yyyy h:m:s tt"); + return SystemParams.ConvertToUserTimeFromUtc(session.User, DateTime.UtcNow).ToString("M/d/yyyy h:mm:ss tt"); } return ""; } diff --git a/IronIntelContractorSiteLib/SystemSettings/SystemSettingsBasePage.cs b/IronIntelContractorSiteLib/SystemSettings/SystemSettingsBasePage.cs index 6d6555f..fb3d5ec 100644 --- a/IronIntelContractorSiteLib/SystemSettings/SystemSettingsBasePage.cs +++ b/IronIntelContractorSiteLib/SystemSettings/SystemSettingsBasePage.cs @@ -559,10 +559,14 @@ namespace IronIntel.Contractor.Site.SystemSettings var client = CreateClient<Foresight.Fleet.Services.User.UserFilterProvider>(); string useriid = session.User.UID; - bool accessallassets = false; - Foresight.Fleet.Services.User.UserAdditionalAttribute attrs = CreateClient<Foresight.Fleet.Services.User.UserQueryClient>(SystemParams.CompanyID).GetUserAdditionalAttribute(useriid); - if (attrs != null) - accessallassets = attrs.AccessAllAssets; + + bool accessallassets = session.User.UserType >= Foresight.Fleet.Services.User.UserTypes.Admin; + if (!accessallassets) + { + Foresight.Fleet.Services.User.UserAdditionalAttribute attrs = CreateClient<Foresight.Fleet.Services.User.UserQueryClient>(SystemParams.CompanyID).GetUserAdditionalAttribute(useriid); + if (attrs != null) + accessallassets = attrs.AccessAllAssets; + } UserFilterTemplateItem filter = new UserFilterTemplateItem(); diff --git a/IronIntelContractorSiteLib/UserManageBasePage.cs b/IronIntelContractorSiteLib/UserManageBasePage.cs index 6e4bdd3..d63e535 100644 --- a/IronIntelContractorSiteLib/UserManageBasePage.cs +++ b/IronIntelContractorSiteLib/UserManageBasePage.cs @@ -2210,14 +2210,18 @@ namespace IronIntel.Contractor.Site int filterid = Convert.ToInt32(filteridstr); string useriid = HttpUtility.HtmlDecode(clientdata[1]); - if (GetCurrentLoginSession() != null) + var session = GetCurrentLoginSession(); + if (session != null) { var client = CreateClient<Foresight.Fleet.Services.User.UserFilterProvider>(); - bool accessallassets = false; - Foresight.Fleet.Services.User.UserAdditionalAttribute attrs = CreateClient<Foresight.Fleet.Services.User.UserQueryClient>(SystemParams.CompanyID).GetUserAdditionalAttribute(useriid); - if (attrs != null) - accessallassets = attrs.AccessAllAssets; + bool accessallassets = session.User.UserType >= Foresight.Fleet.Services.User.UserTypes.Admin; + if (!accessallassets) + { + Foresight.Fleet.Services.User.UserAdditionalAttribute attrs = CreateClient<Foresight.Fleet.Services.User.UserQueryClient>(SystemParams.CompanyID).GetUserAdditionalAttribute(useriid); + if (attrs != null) + accessallassets = attrs.AccessAllAssets; + } UserFilterTemplateItem filter = new UserFilterTemplateItem(); diff --git a/Reflib/FIC/FICBLC.dll b/Reflib/FIC/FICBLC.dll index 65a6a57..bdd17c2 100644 Binary files a/Reflib/FIC/FICBLC.dll and b/Reflib/FIC/FICBLC.dll differ diff --git a/Reflib/FIC/FICEmailSubscribe.dll b/Reflib/FIC/FICEmailSubscribe.dll index 58ed5fd..dea216a 100644 Binary files a/Reflib/FIC/FICEmailSubscribe.dll and b/Reflib/FIC/FICEmailSubscribe.dll differ diff --git a/Reflib/FIC/FICExport.dll b/Reflib/FIC/FICExport.dll index 717d4a9..0f95dbf 100644 Binary files a/Reflib/FIC/FICExport.dll and b/Reflib/FIC/FICExport.dll differ diff --git a/Reflib/FIC/FICIntf.dll b/Reflib/FIC/FICIntf.dll index 51c1643..a0b5deb 100644 Binary files a/Reflib/FIC/FICIntf.dll and b/Reflib/FIC/FICIntf.dll differ diff --git a/Reflib/FIC/FICIntfAdv.dll b/Reflib/FIC/FICIntfAdv.dll index a341669..1be4eba 100644 Binary files a/Reflib/FIC/FICIntfAdv.dll and b/Reflib/FIC/FICIntfAdv.dll differ diff --git a/Reflib/FIC/FICModels.dll b/Reflib/FIC/FICModels.dll index 74c9294..ac583a7 100644 Binary files a/Reflib/FIC/FICModels.dll and b/Reflib/FIC/FICModels.dll differ diff --git a/Reflib/FIC/FRPTExtIntf.dll b/Reflib/FIC/FRPTExtIntf.dll index e9d0c01..cd9835f 100644 Binary files a/Reflib/FIC/FRPTExtIntf.dll and b/Reflib/FIC/FRPTExtIntf.dll differ diff --git a/Reflib/FleetClientBase.dll b/Reflib/FleetClientBase.dll index a79fca3..c85a926 100644 Binary files a/Reflib/FleetClientBase.dll and b/Reflib/FleetClientBase.dll differ diff --git a/Reflib/FleetServiceClient.dll b/Reflib/FleetServiceClient.dll index 6a362e9..3ab9bcf 100644 Binary files a/Reflib/FleetServiceClient.dll and b/Reflib/FleetServiceClient.dll differ diff --git a/Site/AssetView/AssetMapView.aspx.cs b/Site/AssetView/AssetMapView.aspx.cs index 49331f2..0995e68 100644 --- a/Site/AssetView/AssetMapView.aspx.cs +++ b/Site/AssetView/AssetMapView.aspx.cs @@ -161,7 +161,7 @@ public partial class AssetMapView : ContractorBasePage if (SystemParams.IsDealer) { AssetBasicInfo m = null; - var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(); + var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(session.SessionID); if (string.IsNullOrEmpty(machineid)) { m = client.FromAdminAssetBasicInfoByVin(vin); @@ -190,11 +190,14 @@ public partial class AssetMapView : ContractorBasePage private string GetCompanyID(string machineid, string vin) { + var session = GetCurrentLoginSession(); + if (session == null) + return null; string companyid = ""; if (SystemParams.IsDealer) { AssetBasicInfo m = null; - var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(); + var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(session.SessionID); if (string.IsNullOrEmpty(machineid)) { m = client.FromAdminAssetBasicInfoByVin(vin); diff --git a/Site/AssetView/AssetTimeline.aspx b/Site/AssetView/AssetTimeline.aspx index 945bab5..670de49 100644 --- a/Site/AssetView/AssetTimeline.aspx +++ b/Site/AssetView/AssetTimeline.aspx @@ -1,47 +1,54 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/AssetView/AssetViewBase.master" AutoEventWireup="true" CodeFile="AssetTimeline.aspx.cs" Inherits="AssetView_AssetTimeline" %> -<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> +<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> <link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" /> <script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script> <style type="text/css"> .table-container { margin: 4px 10px 0 26px; } + .table-timeline { width: 100%; border-spacing: 0; table-layout: fixed; } - .table-timeline th { - width: 4.17%; - border-right: 1px solid white; - background: #444; - color: white; - font-weight: normal; - font-size: 13px; - height: 26px; - } - .table-timeline th, - .table-timeline td { - padding: 0; - } + + .table-timeline th { + width: 4.17%; + border-right: 1px solid white; + background: #444; + color: white; + font-weight: normal; + font-size: 13px; + height: 26px; + } + + .table-timeline th, + .table-timeline td { + padding: 0; + } + #td-timeline { height: 30px; position: relative; } - #td-timeline div { - height: 26px; - position: absolute; - background: #64965a; - top: 2px; - border-radius: 6px; - } - #td-timeline div.no-start { - border-radius: 0 6px 6px 0; - } - #td-timeline div.no-end { - border-radius: 6px 0 0 6px; - } + + #td-timeline div { + height: 26px; + position: absolute; + background: #64965a; + top: 2px; + border-radius: 6px; + } + + #td-timeline div.no-start { + border-radius: 0 6px 6px 0; + } + + #td-timeline div.no-end { + border-radius: 6px 0 0 6px; + } </style> <script type="text/javascript"> _network.root = '<%=Page.ResolveUrl("~/")%>'; @@ -143,7 +150,7 @@ } function OnRefresh(dt) { - if (dict.id != null) { + if (dict && dict.id != null) { getAssetTimeline(dict.id, dt); } } @@ -159,15 +166,19 @@ } </script> </asp:Content> -<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> +<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div class="table-container"> <div style="width: 100px; float: left"> <table class="table-timeline"> <thead> - <tr><th data-lgid="P_MV_TYPE">Type</th></tr> + <tr> + <th data-lgid="P_MV_TYPE">Type</th> + </tr> </thead> <tbody> - <tr><td style="height: 30px" data-lgid="P_MV_ONOFFEVENTS">On/Off Events</td></tr> + <tr> + <td style="height: 30px" data-lgid="P_MV_ONOFFEVENTS">On/Off Events</td> + </tr> </tbody> </table> </div> @@ -175,12 +186,30 @@ <table class="table-timeline"> <thead> <tr id="tr-header"> - <th>0:00</th><th>1:00</th><th>2:00</th><th>3:00</th> - <th>4:00</th><th>5:00</th><th>6:00</th><th>7:00</th> - <th>8:00</th><th>9:00</th><th>10:00</th><th>11:00</th> - <th>12:00</th><th>13:00</th><th>14:00</th><th>15:00</th> - <th>16:00</th><th>17:00</th><th>18:00</th><th>19:00</th> - <th>20:00</th><th>21:00</th><th>22:00</th><th>23:00</th> + <th>0:00</th> + <th>1:00</th> + <th>2:00</th> + <th>3:00</th> + <th>4:00</th> + <th>5:00</th> + <th>6:00</th> + <th>7:00</th> + <th>8:00</th> + <th>9:00</th> + <th>10:00</th> + <th>11:00</th> + <th>12:00</th> + <th>13:00</th> + <th>14:00</th> + <th>15:00</th> + <th>16:00</th> + <th>17:00</th> + <th>18:00</th> + <th>19:00</th> + <th>20:00</th> + <th>21:00</th> + <th>22:00</th> + <th>23:00</th> </tr> </thead> <tbody> diff --git a/Site/AssetView/AssetViewBase.master b/Site/AssetView/AssetViewBase.master index eeb409b..49f1de8 100644 --- a/Site/AssetView/AssetViewBase.master +++ b/Site/AssetView/AssetViewBase.master @@ -86,16 +86,6 @@ $(document.body).click(window.parent.ondocumentclick); } - function resizeContent() { - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); - } - - $(window).resize(function () { - resizeContent(); - }); - //window.onresize = resizeContent; - resizeContent(); - window.ondocumentclick = function (e) { $(document.body).click(); }; diff --git a/Site/AssetView/SingleAssetView.aspx b/Site/AssetView/SingleAssetView.aspx index 7b3d03d..c009bfc 100644 --- a/Site/AssetView/SingleAssetView.aspx +++ b/Site/AssetView/SingleAssetView.aspx @@ -473,7 +473,7 @@ setTimeout(function () { timelineLoaded = true; OnRefresh(); - }); + },100); }); $('#div_timeline').show(); } diff --git a/Site/AssetView/js/assetpm.js b/Site/AssetView/js/assetpm.js index 4931872..7330e4d 100644 --- a/Site/AssetView/js/assetpm.js +++ b/Site/AssetView/js/assetpm.js @@ -61,7 +61,7 @@ function InitPMGridData() { reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'PmScheduleName', caption: GetTextByKey("P_MV_SCHEDULENAME", "Schedule Name"), valueIndex: 'PmScheduleName', css: { 'width': 200, 'text-align': 'left' } }, { name: 'StartValue', caption: GetTextByKey("P_MV_INITIALSERVICEVALUE", "Initial Service Value"), valueIndex: 'StartValue', css: { 'width': 120, 'text-align': 'right' } }, { name: 'LastAlertTimeString', caption: GetTextByKey("P_MV_LASTSERVICEDATE", "Last Service Date"), valueIndex: 'LastAlertTimeString', css: { 'width': 120, 'text-align': 'left' } }, @@ -454,7 +454,7 @@ function createTBMContent(contentctrl, pmschedule) { item.PmScheduleID = pmschedule.PmScheduleID; //item.PMType = pmschedule.PmScheduleType; if (radio1.prop("checked")) { - item.StartDate = nowdate; + item.StartDate = currentdate; } else { item.StartDate = txtLastServiceDate.val(); diff --git a/Site/Contact/ManageContact.aspx b/Site/Contact/ManageContact.aspx index 4c87ba1..207b14e 100644 --- a/Site/Contact/ManageContact.aspx +++ b/Site/Contact/ManageContact.aspx @@ -204,7 +204,7 @@ $('#dialog_textaddress').val(''); $('#dialog_contact .dialog-title span.title').text('Add Contact'); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_contact') .attr('act', 'add') .css({ @@ -233,7 +233,7 @@ $('#dialog_textaddress').val(contact.TextAddress); $('#dialog_contact .dialog-title span.title').text('Edit Contact'); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_contact') .attr('act', 'edit') .css({ @@ -445,7 +445,7 @@ var title = "Asset Assignment";// + " " + jobsite.Name + " " + "Radius_UOM: " + jobsite.Radius_UOM $('#dialog_managemahchine .dialog-title span.title').html(title); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_managemahchine') .css({ 'height': 500, @@ -766,7 +766,7 @@ var title = "Jobsite Assignment"; $('#dialog_managejobsite .dialog-title span.title').html(title); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_managejobsite') .css({ 'height': 500, @@ -1076,15 +1076,15 @@ $('#dialog_contact').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_managemahchine').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_managejobsite').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#sel_machine_type').change(getMatchAvailableMachines); diff --git a/Site/Credentials/Credentials.master b/Site/Credentials/Credentials.master index 32ed967..aab00fd 100644 --- a/Site/Credentials/Credentials.master +++ b/Site/Credentials/Credentials.master @@ -66,7 +66,6 @@ function resizeContent() { if ($('.content_main').length > 0) $('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4); - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); } $(window).resize(function () { diff --git a/Site/Credentials/ManageAPICredential.aspx b/Site/Credentials/ManageAPICredential.aspx index 7a78822..7c7bfad 100644 --- a/Site/Credentials/ManageAPICredential.aspx +++ b/Site/Credentials/ManageAPICredential.aspx @@ -88,7 +88,7 @@ $('#dialog_apitokensecret').val(''); $('#dialog_enabled').attr('checked', false); $('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_APICRE_ADDMANUFACTURE", 'Add Credential')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_credential') .attr('act', 'add') .css({ @@ -166,7 +166,7 @@ $('#dialog_enabled').attr("checked", cre.IsEnabled); $('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_APICRE_EDITMANUFACTURE", 'Edit Credential')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_credential') .attr('act', 'edit') .css({ @@ -381,7 +381,7 @@ setInput(dic); }) $('#dialog_credential').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); OnRefresh(); $(window).resize(function () { diff --git a/Site/Credentials/ManageCredential.aspx b/Site/Credentials/ManageCredential.aspx index 8dac834..480e547 100644 --- a/Site/Credentials/ManageCredential.aspx +++ b/Site/Credentials/ManageCredential.aspx @@ -83,7 +83,7 @@ $('#dialog_orgid').val(''); $('#dialog_notes').val(''); $('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_CRE_ADDMANUFACTURE", 'Add Credential')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_credential') .attr('act', 'add') .css({ @@ -111,7 +111,7 @@ $('#dialog_orgid').val(cre.OrgnizationID); $('#dialog_notes').val(cre.Notes); $('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_CRE_EDITMANUFACTURE", 'Edit Credential')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_credential') .attr('act', 'edit') .css({ @@ -277,7 +277,7 @@ InitGridData(); $('#dialog_credential').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); OnRefresh(); $(window).resize(function () { diff --git a/Site/Credentials/ManageJDLink.aspx b/Site/Credentials/ManageJDLink.aspx index 790b068..707a14b 100644 --- a/Site/Credentials/ManageJDLink.aspx +++ b/Site/Credentials/ManageJDLink.aspx @@ -355,7 +355,7 @@ function OnAddNotification() { $('#dialog_displayname').val(''); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_credential') .attr('act', 'add') .css({ @@ -613,7 +613,7 @@ OnRefreshNotification(); $('#dialog_credential').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_myorganization').dialog(function () { diff --git a/Site/Credentials/ManageJDNotifications.aspx b/Site/Credentials/ManageJDNotifications.aspx index c95d84a..9d57815 100644 --- a/Site/Credentials/ManageJDNotifications.aspx +++ b/Site/Credentials/ManageJDNotifications.aspx @@ -70,7 +70,7 @@ $('#dialog_Verifierd').val(''); $('#dialog_displayname').val(''); $('#dialog_password').val(''); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_credential') .attr('act', 'add') .css({ @@ -232,7 +232,7 @@ InitGridData(); $('#dialog_credential').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); OnRefresh(); $(window).resize(function () { diff --git a/Site/FITracker.aspx b/Site/FITracker.aspx index 8d4e881..a3ff3d2 100644 --- a/Site/FITracker.aspx +++ b/Site/FITracker.aspx @@ -306,14 +306,14 @@ function OnEditAccuracy() { if (deviceid == undefined || deviceid <= 0) return; - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_accuracy') .attr('act', 'add') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_accuracy').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_accuracy').width()) / 2 }) - .showDialog(); + .showDialogfixed(); $('#dialog_accuracyvalue').val($("#txtAccuracy").val()).select(); } @@ -340,7 +340,6 @@ else { $("#txtAccuracy").val(accuracy); deviceinfovm.device.AcceptableAccuracy = accuracy; - $('#mask_bg').hide(); $('#dialog_accuracy').hideDialog(); } }, function (err) { @@ -496,7 +495,7 @@ } function sendLocation() { - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_map') .attr('act', 'add') .css({ @@ -516,7 +515,7 @@ msg += "Location"; postMessage(msg, 2); $('#dialog_map').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); } else { showAlert(GetTextByKey("P_M3_PLEASESELECTALOCATIONTOSENDTO", 'Please select a location to send to.'), GetTextByKey("P_M3_SENDLOCATION", 'Send Location')); @@ -734,11 +733,11 @@ }); $('#dialog_map').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_accuracy').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); loadMap(); @@ -889,7 +888,7 @@ <tr> <td class="label" style="width: 100px;" data-lgid="P_M3_NOTE_COLON">Note:</td> <td> - <textarea id="dialog_accuracynote" class="inputbox" maxlength="1000" tabindex="51" style="width: 240px; height: 100px; max-width: unset;"></textarea> + <textarea id="dialog_accuracynote" maxlength="1000" tabindex="51" style="width: 240px; height: 100px; max-width: unset;"></textarea> </td> </tr> </table> diff --git a/Site/Inspection/FuelReport.aspx b/Site/Inspection/FuelReport.aspx index 84dddcb..9cd305f 100644 --- a/Site/Inspection/FuelReport.aspx +++ b/Site/Inspection/FuelReport.aspx @@ -214,12 +214,12 @@ function showRightPopup(state) { if (state) { $('#content').css('overflow', 'hidden'); - $("#mask_bg").show(); + showmaskbg(true); $("#right_popup").css("left", $("#set_left").width()).show(); } else { $('#content').css('overflow', ''); - $("#mask_bg").hide(); + showmaskbg(false); $("#right_popup").hide(); } } @@ -355,7 +355,7 @@ { name: 'UID', caption: GetTextByKey("P_IPT_CONTACTNAME", "Contact Name"), valueIndex: 'UID', css: { 'width': 320, 'text-align': 'left' } }, //{ name: 'ContactType', caption: GetTextByKey("P_IPT_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactType', css: { 'width': 148, 'text-align': 'left' } }, //{ name: 'Text', caption: GetTextByKey("P_MV_TEXT", "Text"), valueIndex: 'Text', type: 3, css: { 'width': 45, 'text-align': 'center' } }, - { name: 'Selected', caption: GetTextByKey("P_IPT_EMAIL", "Email"), valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } } + { name: 'Selected', caption: GetTextByKey("P_IPT_EMAIL", "Email"), valueIndex: 'Selected', type: 3, css: { 'width': 60, 'text-align': 'center' } } ]; var columns = []; // head @@ -428,7 +428,7 @@ GetFuelReport(); $('#dialog_sendemail').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#sendlocation_search').bind('input propertychange', function () { @@ -510,6 +510,7 @@ emails.push(m); } } + emails = emails.sort(function (a, b) { return (b.Selected ? 1 : 0) - (a.Selected ? 1 : 0) }) showEmailList(emails); } } @@ -526,9 +527,8 @@ $('#sendlocation_otheremailaddress').val(''); $('#sendlocation_desc').val(''); - $('#mask_bg').show(); $('#dialog_sendemail .dialog-title span.title').text(GetTextByKey("P_IPT_SENDEMAIL", 'Send Email')); - //$('#mask_bg').show(); + showmaskbg(true); $('#dialog_sendemail') .attr('act', 'edit') .css({ @@ -546,7 +546,7 @@ function onSendEmail() { if (grid_dtemail.source.length == 0) { $('#dialog_sendemail').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); return; } @@ -570,7 +570,7 @@ if (emailaddress.length == 0) { $('#dialog_sendemail').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); return; } @@ -582,7 +582,7 @@ else { //showAlert(GetTextByKey("P_IPT_MESSAGESENT", 'Message sent.'), GetTextByKey("P_IPT_SENDEMAIL", 'Send Email')); $('#dialog_sendemail').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); } }, function (err) { diff --git a/Site/Inspection/Inspection.aspx b/Site/Inspection/Inspection.aspx index b8bac7e..f5b6ba9 100644 --- a/Site/Inspection/Inspection.aspx +++ b/Site/Inspection/Inspection.aspx @@ -96,11 +96,11 @@ function showRightPopup(state) { if (state) { - $("#mask_bg").show(); + showmaskbg(true); $("#right_popup").css("left", $("#set_left").width()).show(); } else { - $("#mask_bg").hide(); + showmaskbg(false); $("#right_popup").hide(); } } @@ -122,6 +122,34 @@ iframe.contentWindow.print(); } + function openPrintFrame(rid) { + if (navigator.userAgent.indexOf('Firefox') >= 0 || + navigator.userAgent.indexOf('Opera') >= 0) { + setTimeout(function () { + window.open("Inspection.aspx?rt=f&t=2&id=" + rid + "&team=" + (teamintelligence ? 1 : 0), '_blank'); + }); + } + else { + var frame = $("<iframe style='display:none;'></iframe>"); + $(document.body).after(frame); + frame.attr('src', "Inspection.aspx?rt=f&t=2&id=" + rid); + frame.on('load', function () { + setTimeout(function () { + frame[0].contentWindow.print(); + }); + setTimeout(function () { + frame.remove(); + }, 60000); + }); + } + } + + function openDownloadFrame(rid) { + setTimeout(function () { + window.open("Inspection.aspx?rt=f&t=1&id=" + rid + "&team=" + (teamintelligence ? 1 : 0), '_blank'); + }); + } + function createSubMenus(items) { var maintenancesubmenu = $("#inspectsubmenu").empty(); var ulsubmenus = $('<ul class="lefttitlemenu_ul" style="line-height:32px;"></ul>'); @@ -145,8 +173,8 @@ return; } var items = [{ ID: 'templates/0', Title: GetTextByKey("P_DRAFT", "Draft") }, - { ID: 'templates/1', Title: GetTextByKey("P_PUBLISHED", "Published") }, - { ID: 'layouts/0', Title: GetTextByKey("P_LAYOUTS", "Layouts") }]; + { ID: 'templates/1', Title: GetTextByKey("P_PUBLISHED", "Published") }, + { ID: 'layouts/0', Title: GetTextByKey("P_LAYOUTS", "Layouts") }]; createSubMenus(items); var left = $(this).offset().left; @@ -172,7 +200,7 @@ return; } var items = [{ ID: 'exportpackages', Title: GetTextByKey("P_IPT_EXPORTPACKAGES", "Export Packages") }, - { ID: 'importpackages', Title: GetTextByKey("P_IPT_IMPORTPACKAGES", "Import Packages") }]; + { ID: 'importpackages', Title: GetTextByKey("P_IPT_IMPORTPACKAGES", "Import Packages") }]; createSubMenus(items); var left = $(this).offset().left; @@ -190,6 +218,25 @@ }); return false; }); + + $('#nav_temparrow').click(function () { + var flag = !$('#nav_temparrow').prop('isexpanded'); + var left_flag = !$('#set_left').prop('isexpanded'); + $('#nav_temparrow').stop() + .prop('isexpanded', flag); + if (flag) + $('#set_left').find(".tempdesign").show(); + else + $('#set_left').find(".tempdesign").hide(); + + if (left_flag) + $('#span_tempdesign').hide(); + + $('#nav_temparrow div').attr('class', 'icn') + .addClass(flag ? 'expand' : 'collapse'); + }); + + $('#nav_temparrow').click(); }); </script> </asp:Content> @@ -199,9 +246,44 @@ <li id="nav_arrow"> <div class="icn collapse"></div> </li> + <%if (ShowReport) + {%> + <li class="nav_item" data-module="inspections" data-title-lgid="P_INSPECTIONS"><a href="#inspections"> + <div> + <em class="fa icon-menu icon-report"></em> + </div> + <span data-lgid="P_INSPECTIONS">Inspections</span></a> + </li> + <%} %> + + <%if (ShowFuelLog) + {%> + <li class="nav_item" data-module="fuellog" data-title-lgid="P_IPT_FUELLOG"><a href="#fuellog"> + <div> + <em class="fa icon-menu icon-fuellog"></em> + </div> + <span data-lgid="P_IPT_FUELLOG">Fuel Log</span></a> + </li> + <%} %> + + <%if (ShowReport || ShowFuelLog) + {%> + <li style="height: 10px;"> + <hr style="background-color: #d8d8d8; border: none; height: 1px;" /> + </li> + <%} %> + + <%if (ShowGlobalSections || ShowTemplate) + {%> + <li id="nav_temparrow"> + <div class="icn expand"></div> + <span id="span_tempdesign" class="subitem" data-lgid="P_XXX" style="margin-left: 15px; font-weight: bold;">Template Design</span> + </li> + <%} %> + <%if (ShowGlobalSections) {%> - <li class="nav_item" data-module="globalsections" data-title-lgid="P_GLOBALSECTIONS"><a href="#globalsections"> + <li class="nav_item tempdesign" data-module="globalsections" data-title-lgid="P_GLOBALSECTIONS"><a href="#globalsections" style="padding-left: 10px;"> <div> <em class="fa icon-menu icon-sections"></em> </div> @@ -210,23 +292,23 @@ <%} %> <%if (ShowTemplate) {%> - <li class="nav_item" data-title-lgid="P_TEMPLATES"><a id="atemplates"> + <li id="litem" class="nav_item tempdesign" data-title-lgid="P_TEMPLATES"><a id="atemplates" style="padding-left: 10px;"> <div> <em class="fa icon-menu icon-templates"></em> </div> <span data-lgid="P_TEMPLATES">Templates</span></a> </li> - <li class="nav_item subitem" data-module="templates/0" data-title-lgid="P_DRAFT" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/0"> + <li class="nav_item subitem tempdesign" data-module="templates/0" data-title-lgid="P_DRAFT" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/0"> <div style="width: 64px;"> </div> <span style="color: #666;" data-lgid="P_DRAFT">Draft</span></a> </li> - <li class="nav_item subitem" data-module="templates/1" data-title-lgid="P_PUBLISHED" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/1"> + <li class="nav_item subitem tempdesign" data-module="templates/1" data-title-lgid="P_PUBLISHED" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/1"> <div style="width: 64px;"> </div> <span style="color: #666;" data-lgid="P_PUBLISHED">Published</span></a> </li> - <li class="nav_item subitem" data-module="layouts/0" data-title-lgid="P_LAYOUTS" style="height: 32px; line-height: 32px; display: none;"><a href="#layouts/0"> + <li class="nav_item subitem tempdesign" data-module="layouts/0" data-title-lgid="P_LAYOUTS" style="height: 32px; line-height: 32px; display: none;"><a href="#layouts/0"> <div style="width: 64px;"> </div> <span style="color: #666;" data-lgid="P_LAYOUTS">Layouts</span></a> @@ -256,32 +338,6 @@ </li> <%} %> <%} %> - - <%if (ShowReport || ShowFuelLog) - {%> - <li style="height: 10px;"> - <hr style="background-color: #d8d8d8; border: none; height: 1px;" /> - </li> - <%} %> - - <%if (ShowReport) - {%> - <li class="nav_item" data-module="inspections" data-title-lgid="P_INSPECTIONS"><a href="#inspections"> - <div> - <em class="fa icon-menu icon-report"></em> - </div> - <span data-lgid="P_INSPECTIONS">Inspections</span></a> - </li> - <%} %> - <%if (ShowFuelLog) - {%> - <li class="nav_item" data-module="fuellog" data-title-lgid="P_IPT_FUELLOG"><a href="#fuellog"> - <div> - <em class="fa icon-menu icon-fuellog"></em> - </div> - <span data-lgid="P_IPT_FUELLOG">Fuel Log</span></a> - </li> - <%} %> </ul> <div class="hostmask maskbg" style="display: none;"></div> </div> @@ -297,7 +353,9 @@ <div class="trigle white" style="left: -12px; right: auto;"></div> </div> - <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> + <div id="mask_bg" style="display: none;"> + <div class="loading c-spin"></div> + </div> <div id="right_popup" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;"> </div> <div id="right_popup1" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;"></div> diff --git a/Site/Inspection/Report.aspx b/Site/Inspection/Report.aspx index 3abfa1f..a27c42f 100644 --- a/Site/Inspection/Report.aspx +++ b/Site/Inspection/Report.aspx @@ -60,7 +60,7 @@ .page { /*background-color: #d3d3d3;*/ /*height: 52px;*/ - line-height: 52px; + line-height: 25px; margin-top: 8px; padding-left: 10px; padding-right: 10px; @@ -72,7 +72,7 @@ .section { /*background-color: #eaeaea;*/ /*height: 40px;*/ - line-height: 40px; + line-height: 20px; padding-left: 30px; padding-right: 10px; font-size: 20px; @@ -81,8 +81,8 @@ } .question { - min-height: 30px; - line-height: 30px; + min-height: 24px; + line-height: 24px; padding-left: 70px; padding-right: 10px; font-size: 14px; @@ -92,12 +92,21 @@ } .answer { - min-height: 30px; - line-height: 30px; + min-height: 24px; + line-height: 24px; padding-left: 90px; padding-right: 10px; } + .table_content { + padding-left: 3px; + padding-right: 3px; + } + + .pagedoublespace { + line-height: 50px; + } + .media { width: 120px; height: 120px; @@ -176,6 +185,33 @@ display: block; } } + + .question_line { + border-collapse: collapse; + border-top: 1px solid #dbdbdb; + border-bottom: 1px solid #dbdbdb; + } + + .question_table_grid { + border-collapse: collapse; + } + + .question_table_grid td { + border: 1px solid #dbdbdb; + } + + .question_div_grid { + border: 1px solid #dbdbdb; + } + + .mediacaption { + text-align: center; + clear: both; + height: 25px; + width: 120px; + overflow: hidden; + text-overflow: ellipsis; + } </style> <script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script> @@ -196,12 +232,12 @@ function showRightPopup(state) { if (state) { $('#content').css('overflow', 'hidden'); - $("#mask_bg").show(); + showmaskbg(true); $("#right_popup").css("left", $("#set_left").width()).show(); } else { $('#content').css('overflow', ''); - $("#mask_bg").hide(); + showmaskbg(false); $("#right_popup").hide(); } } @@ -249,7 +285,19 @@ <span id="spPrint" id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span> </div> <div id="divreport" style="width: 1100px; margin: 0 auto;"> - <img id="reportlayoutlogo" style="width: 100px; margin-top: 5px; display: none;" /> + <div v-if="report.ReportLayout!=null"> + <table class="maintable" style="width: 100%;"> + <tr class="assettr"> + <td style="width: 33%; text-align: left;"> + <img id="reportlayoutlogo" style="width: 100px; margin-top: 5px; display: none;" /></td> + <td style="width: 33%; text-align: center;"> + <img id="reportlayoutcenterlogo" style="width: 100px; margin-top: 5px; display: none;" /></td> + <td style="width: 33%; text-align: right;"> + <img id="reportlayoutrightlogo" style="width: 100px; margin-top: 5px; display: none;" /> + </td> + </tr> + </table> + </div> <h1 style="text-align: center;" v-show="report.Template.DisplayInspectionTitle">{{report.Template.Name}}</h1> <div style="text-align: center; margin-bottom: 10px;"><span v-show="report.Template.DisplayCommitTime">{{report.CommitTimeLocalStr}}</span><span v-show="report.Template.DisplayCommitBy"> by {{report.CommitedByUserName}}</span></div> <table class="maintable"> @@ -362,7 +410,9 @@ </tr> </table> </div> - <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> + <div id="mask_bg" style="display: none;"> + <div class="loading c-spin"></div> + </div> <div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;"> </div> <iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe> diff --git a/Site/Inspection/ReportForWorkOrder.aspx b/Site/Inspection/ReportForWorkOrder.aspx index f1d4df6..b0ac4c3 100644 --- a/Site/Inspection/ReportForWorkOrder.aspx +++ b/Site/Inspection/ReportForWorkOrder.aspx @@ -196,12 +196,12 @@ function showRightPopup(state) { if (state) { $('#content').css('overflow', 'hidden'); - $("#mask_bg").show(); + showmaskbg(true); $("#right_popup").css("left", $("#set_left").width()).show(); } else { $('#content').css('overflow', ''); - $("#mask_bg").hide(); + showmaskbg(false); $("#right_popup").hide(); } } diff --git a/Site/Inspection/TeamIntelligence.aspx b/Site/Inspection/TeamIntelligence.aspx index 642b0c6..3f6123f 100644 --- a/Site/Inspection/TeamIntelligence.aspx +++ b/Site/Inspection/TeamIntelligence.aspx @@ -79,7 +79,7 @@ var ShowTemplate =<%=ShowTemplate ?"true":"false"%>; var ShowReport =<%=ShowReport ?"true":"false"%>; var ReportReadonly =<%=ReportReadonly ?"true":"false"%>; - var IsCustomerRecord = false; + var IsCustomerRecord = false; function inspectionrequest(method, param, callback, error) { _network.request("Inspection/Inspection.aspx", -1, method, param, callback, error || function (e) { @@ -89,11 +89,11 @@ function showRightPopup(state) { if (state) { - $("#mask_bg").show(); + showmaskbg(true); $("#right_popup").css("left", $("#set_left").width()).show(); } else { - $("#mask_bg").hide(); + showmaskbg(false); $("#right_popup").hide(); } } @@ -115,6 +115,34 @@ iframe.contentWindow.print(); } + function openPrintFrame(rid) { + if (navigator.userAgent.indexOf('Firefox') >= 0 || + navigator.userAgent.indexOf('Opera') >= 0) { + setTimeout(function () { + window.open("Inspection.aspx?rt=f&t=2&id=" + rid + "&team=" + (teamintelligence ? 1 : 0), '_blank'); + }); + } + else { + var frame = $("<iframe style='display:none;'></iframe>"); + $(document.body).after(frame); + frame.attr('src', "Inspection.aspx?rt=f&t=2&id=" + rid); + frame.on('load', function () { + setTimeout(function () { + frame[0].contentWindow.print(); + }); + setTimeout(function () { + frame.remove(); + }, 60000); + }); + } + } + + function openDownloadFrame(rid) { + setTimeout(function () { + window.open("Inspection.aspx?rt=f&t=1&id=" + rid + "&team=" + (teamintelligence ? 1 : 0), '_blank'); + }); + } + function createSubMenus(items) { var maintenancesubmenu = $("#inspectsubmenu").empty(); var ulsubmenus = $('<ul class="lefttitlemenu_ul" style="line-height:32px;"></ul>'); @@ -183,6 +211,26 @@ }); return false; }); + + $('#nav_temparrow').click(function () { + var flag = !$('#nav_temparrow').prop('isexpanded'); + var left_flag = !$('#set_left').prop('isexpanded'); + $('#nav_temparrow').stop() + .prop('isexpanded', flag); + if (flag) + $('#set_left').find(".tempdesign").show(); + else + $('#set_left').find(".tempdesign").hide(); + + if (left_flag) + $('#span_tempdesign').hide(); + + $('#nav_temparrow div').attr('class', 'icn') + .addClass(flag ? 'expand' : 'collapse'); + }); + + $('#nav_temparrow').click(); + }); </script> </asp:Content> @@ -192,9 +240,35 @@ <li id="nav_arrow"> <div class="icn collapse"></div> </li> + + <%if (ShowReport) + {%> + <li class="nav_item" data-module="inspections" data-title-lgid="P_INSPECTIONS"><a href="#inspections"> + <div> + <em class="fa icon-menu icon-report"></em> + </div> + <span data-lgid="P_INSPECTIONS">Inspections</span></a> + </li> + <%} %> + + <%if (ShowReport) + {%> + <li style="height: 10px;"> + <hr style="background-color: #d8d8d8; border: none; height: 1px;" /> + </li> + <%} %> + + <%if (IsSupperAdmin || ShowTemplate) + {%> + <li id="nav_temparrow"> + <div class="icn expand"></div> + <span id="span_tempdesign" class="subitem" data-lgid="P_XXX" style="margin-left: 15px; font-weight: bold;">Template Design</span> + </li> + <%} %> + <%if (IsSupperAdmin) {%> - <li class="nav_item" data-module="globalsections" data-title-lgid="P_GLOBALSECTIONS"><a href="#globalsections"> + <li class="nav_item tempdesign" data-module="globalsections" data-title-lgid="P_GLOBALSECTIONS"><a href="#globalsections" style="padding-left: 10px;"> <div> <em class="fa icon-menu icon-sections"></em> </div> @@ -203,23 +277,23 @@ <%} %> <%if (ShowTemplate) {%> - <li class="nav_item" data-title-lgid="P_TEMPLATES"><a id="atemplates"> + <li class="nav_item tempdesign" data-title-lgid="P_TEMPLATES"><a id="atemplates" style="padding-left: 10px;"> <div> <em class="fa icon-menu icon-templates"></em> </div> <span data-lgid="P_TEMPLATES">Templates</span></a> </li> - <li class="nav_item subitem" data-module="templates/0" data-title-lgid="P_DRAFT" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/0"> + <li class="nav_item subitem tempdesign" data-module="templates/0" data-title-lgid="P_DRAFT" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/0"> <div style="width: 64px;"> </div> <span style="color: #666;" data-lgid="P_DRAFT">Draft</span></a> </li> - <li class="nav_item subitem" data-module="templates/1" data-title-lgid="Published" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/1"> + <li class="nav_item subitem tempdesign" data-module="templates/1" data-title-lgid="Published" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/1"> <div style="width: 64px;"> </div> <span style="color: #666;" data-lgid="P_PUBLISHED">Published</span></a> </li> - <li class="nav_item subitem" data-module="layouts/1" data-title-lgid="P_LAYOUTS" style="height: 32px; line-height: 32px; display: none;"><a href="#layouts/1"> + <li class="nav_item subitem tempdesign" data-module="layouts/1" data-title-lgid="P_LAYOUTS" style="height: 32px; line-height: 32px; display: none;"><a href="#layouts/1"> <div style="width: 64px;"> </div> <span style="color: #666;" data-lgid="P_LAYOUTS">Layouts</span></a> @@ -249,16 +323,6 @@ </li> <%} %> <%} %> - - <%if (ShowReport) - {%> - <li class="nav_item" data-module="inspections" data-title-lgid="P_INSPECTIONS"><a href="#inspections"> - <div> - <em class="fa icon-menu icon-report"></em> - </div> - <span data-lgid="P_INSPECTIONS">Inspections</span></a> - </li> - <%} %> </ul> <div class="hostmask maskbg" style="display: none;"></div> </div> diff --git a/Site/Inspection/css/sections.css b/Site/Inspection/css/sections.css index 67776c5..b9b866f 100644 --- a/Site/Inspection/css/sections.css +++ b/Site/Inspection/css/sections.css @@ -14,11 +14,13 @@ .section-holder { background: #e9e9e9; font-size: 16px; - margin-bottom:2px; -} -.section-holder:hover { - background-color: #d9d9d9; + margin-bottom: 2px; } + + .section-holder:hover { + background-color: #d9d9d9; + } + .section-input { padding: 2px 6px; min-height: 20px; @@ -27,30 +29,36 @@ border: 1px solid #e9e9e9; border-radius: 4px; } -.section-input:hover{ - border: 1px solid #666; -} -.section-input:disabled{ - background: rgba(255,255,255,0); - border-color: rgba(255,255,255,0); -} + + .section-input:hover { + border: 1px solid #666; + } + + .section-input:disabled { + background: rgba(255,255,255,0); + border-color: rgba(255,255,255,0); + } .question-holder .question-icon, .section-holder .section-icon { flex-shrink: 0; } -.question-holder .question-icon em { - /*cursor: row-resize;*/ - /*margin-left: 6px;*/ - color: #666; -} + + .question-holder .question-icon em { + /*cursor: row-resize;*/ + /*margin-left: 6px;*/ + color: #666; + } + .holder-even { background: #f9f9f9; } + .question-holder:hover { background-color: #d9d9d9; } + .question-input { padding: 2px 6px; min-height: 20px; @@ -58,17 +66,21 @@ border: 1px solid #fff; border-radius: 4px; } -.question-input:hover { - border: 1px solid #666; -} -.question-input:disabled { - background: rgba(255,255,255,0); - border-color: rgba(255,255,255,0); -} + + .question-input:hover { + border: 1px solid #666; + } + + .question-input:disabled { + background: rgba(255,255,255,0); + border-color: rgba(255,255,255,0); + } + .question-holder .question-notes { flex-grow: 1; line-height: 24px; } + .question-holder .question-name span:hover, .question-holder .template-name span:hover, .question-holder .question-display span:hover, @@ -77,6 +89,7 @@ text-decoration: underline; cursor: pointer; } + .question-holder .question-cell, .section-holder .section-cell { display: inline-block; @@ -84,23 +97,29 @@ text-overflow: ellipsis; overflow: hidden; } -.question-holder .question-cell.fa, -.section-holder .section-cell .fa { - line-height: 40px; -} -.question-holder .question-cell.value-true::before { - content: '\f00c'; -} -.section-holder .section-cell .add { - cursor: pointer; -} -.section-holder .section-cell .add::before { - content: '\f0fe'; -} + + .question-holder .question-cell.fa, + .section-holder .section-cell .fa { + line-height: 40px; + } + + .question-holder .question-cell.value-true::before { + content: '\f00c'; + } + + .section-holder .section-cell .add { + cursor: pointer; + } + + .section-holder .section-cell .add::before { + content: '\f0fe'; + } + .rowdrag { font-size: 14px; - cursor:move; + cursor: move; } + .form-control { /*display: block; width: 100%;*/ @@ -137,6 +156,7 @@ flex-direction: row; padding: 4px 0; } + .editor-top > span { flex: 1 1 auto; } @@ -146,14 +166,14 @@ margin-left: 4px; } - .editor-toolbar a[data-edit], - .svg-button { - display: inline-block; - width: 22px; - height: 22px; - cursor: pointer; - user-select: none; - } +.editor-toolbar a[data-edit], +.svg-button { + display: inline-block; + width: 22px; + height: 22px; + cursor: pointer; + user-select: none; +} .editor-toolbar a[data-edit] > svg, .svg-button > svg { @@ -206,4 +226,26 @@ .img-icon-filename { max-width: 100px; margin-left: 6px; -} \ No newline at end of file +} + +.img-icon-centerfilename { + max-width: 100px; + margin-left: 6px; +} + +.img-icon-rightfilename { + max-width: 100px; + margin-left: 6px; +} + + +.select-layout-name { + margin-left: 20px; +} + +.select-layout { + border: 1px solid #a9a9a9; + margin-left: 4px; + width: 100px; + height: 18px; +} diff --git a/Site/Inspection/js/common.js b/Site/Inspection/js/common.js index 92b29b2..975544e 100644 --- a/Site/Inspection/js/common.js +++ b/Site/Inspection/js/common.js @@ -81,7 +81,6 @@ define(function () { }; $.fn.showDialog = function (selfmask) { - //$('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); if (this.attr("init") !== "1") { this.attr("init", "1"); var _this = this; @@ -92,7 +91,6 @@ define(function () { this.before(mask); } $(window).resize(function () { - //_this.height(_this.parent().outerHeight(false) - 64).width(_this.parent().outerWidth(false) - left - 2); if (_this.mask) _this.mask.height($(document).outerHeight(false) - 64).width($(document).outerWidth(false)); }); diff --git a/Site/Inspection/js/main.js b/Site/Inspection/js/main.js index 6eca4f4..bbed0a7 100644 --- a/Site/Inspection/js/main.js +++ b/Site/Inspection/js/main.js @@ -5,7 +5,7 @@ require.config({ //spectrum: "../../js/spectrum" }, waitSeconds: 0, - urlArgs: "v=437" //+ Math.random() + urlArgs: "v=455" //+ Math.random() }) requirejs(['modules/pageloader'], function (loader) { @@ -25,8 +25,9 @@ requirejs(['modules/pageloader'], function (loader) { .animate({ 'width': flag ? 250 : 50 }, ANIMATION_DURATION) //.find('li a').css('display', flag ? 'none' : '') ; - if (flag) + if (flag) { $('#set_left').find(".subitem").show(); + } else $('#set_left').find(".subitem").hide(); diff --git a/Site/Inspection/js/modules/fuellog.js b/Site/Inspection/js/modules/fuellog.js index 0cc61a9..b029b3d 100644 --- a/Site/Inspection/js/modules/fuellog.js +++ b/Site/Inspection/js/modules/fuellog.js @@ -188,16 +188,15 @@ define([], function () { }; var p = [false, htmlencode(JSON.stringify(item))]; inspectionrequest('UpdateFuelReportHeaderFooter', JSON.stringify(p), function (r) { + loading.hide(); if (r == 'OK') { showAlert(GetTextByKey("P_MV_SAVSUCCESSFULLY", 'Saved successfully.'), alerttitle, null, function () { - loading.fadeOut(100); if (exit) { showRightPopup(false); } }); } else { showAlert(GetTextByKey("P_IPT_FUELRPT_SAVEERROR", 'Failed to save fuel report page settings.'), alerttitle, null, function () { - loading.fadeOut(100); }); } }, 1000); diff --git a/Site/Inspection/js/modules/globalsections.js b/Site/Inspection/js/modules/globalsections.js index dc109fe..5968d00 100644 --- a/Site/Inspection/js/modules/globalsections.js +++ b/Site/Inspection/js/modules/globalsections.js @@ -46,12 +46,12 @@ define(['modules/sections/section', 'modules/sections/addsection'], function (Se dataheader.append('<div style="width:60px; flex-shrink: 0"></div>'); dataheader.append('<div class="question-cell" style="width: 200px">' + GetTextByKey("P_IPT_NAME", "Name") + '</div>'); dataheader.append('<div class="question-cell" style="width: 310px">' + GetTextByKey("P_IPT_DISPLAYTEXT", "Display Text") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 420px">' + GetTextByKey("P_IPT_TYPE", "Type") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 400px">' + GetTextByKey("P_IPT_TYPE", "Type") + '</div>'); dataheader.append('<div class="question-cell" style="width: 80px; text-align: center">' + GetTextByKey("P_IPT_REQUIRED", "Required") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 100px; text-align: center">' + GetTextByKey("P_IPT_CANCOMMENT", "Can Comment") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 100px; text-align: center">' + GetTextByKey("P_IPT_ISIMPORTANT", "Is Important") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 140px">' + GetTextByKey("P_IPT_CUSTOMERVISIBLE", "Customer Visible") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 140px">' + GetTextByKey("P_IPT_SEVERITYLEVEL", "Severity Level") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 65px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_XXX", "Include Comment") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 70px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_ISIMPORTANT", "Is Important") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 70px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_CUSTOMERVISIBLE", "Customer Visible") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 80px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_SEVERITYLEVEL", "Severity Level") + '</div>'); dataheader.append('<div style="flex-grow: 1" style="width: 160px">' + GetTextByKey("P_IPT_NOTES", "Notes") + '</div>'); if (sectiontype === 0) dataheader.append('<div class="question-cell" style="width: 120px;">' + GetTextByKey("P_IPT_CREATEDBY", "Created By") + '</div>'); diff --git a/Site/Inspection/js/modules/importpackages.js b/Site/Inspection/js/modules/importpackages.js index 448255c..d65b108 100644 --- a/Site/Inspection/js/modules/importpackages.js +++ b/Site/Inspection/js/modules/importpackages.js @@ -27,7 +27,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'TemplateName', caption: GetTextByKey("P_TEMPLATE", "Template"), valueIndex: 'Name', css: { 'width': 320, 'text-align': 'left' } }, { name: 'AssetName', caption: GetTextByKey("P_IPT_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 400, 'text-align': 'left' } } ]; @@ -84,7 +84,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'SectionName', caption: GetTextByKey("P_IPT_SECTION", "Section"), valueIndex: 'ItemName', css: { 'width': 320, 'text-align': 'left' } }, { name: 'AssetName', caption: GetTextByKey("P_IPT_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 400, 'text-align': 'left' } } ]; @@ -247,10 +247,12 @@ this.content = content; var funcs = $('<div class="function_title"></div>'); var btn = $('<span class="sbutton iconsave">' + GetTextByKey('P_IPT_IMPORT', 'Import') + '</span>').click(function () { - showConfirm(GetTextByKey("P_IPT_DOYOUWANTTOOVERWRITETHEITEMSWHICHHAVEANEWERVERSION", 'Do you want to overwrite the items which have a higher version?'), GetTextByKey("P_IPT_IMPORTPACKAGE", 'Import Package'), function () { + showConfirmYesNoCancel(GetTextByKey("P_IPT_DOYOUWANTTOOVERWRITETHEITEMSWHICHHAVEANEWERVERSION", 'Do you want to overwrite the items which have a higher version?'), GetTextByKey("P_IPT_IMPORTPACKAGE", 'Import Package'), function () { onImport(_this, 1); }, function () { onImport(_this, 0); + }, function () { + return; }); }); funcs.append(btn); diff --git a/Site/Inspection/js/modules/inspections.js b/Site/Inspection/js/modules/inspections.js index fe6baec..b3c1343 100644 --- a/Site/Inspection/js/modules/inspections.js +++ b/Site/Inspection/js/modules/inspections.js @@ -85,6 +85,33 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function } }); func.append(iconResetPivots); + + var iconprints = $('<span class="sbutton iconprint">' + GetTextByKey("P_IPT_XXXXXX", "Print") + '</span>').click(function () { + for (var i = 0; i < grid_dt.source.length; i++) { + var inspect = grid_dt.source[i].Values; + if (inspect.Selected) { + if (navigator.userAgent.indexOf('Firefox') >= 0 || + navigator.userAgent.indexOf('Opera') >= 0) { + window.open("Inspection.aspx?rt=f&t=2&id=" + inspect.Id + "&team=" + (teamintelligence ? 1 : 0), '_blank'); + } + else + openPrintFrame(inspect.Id); + } + } + }); + func.append(iconprints); + + var icondownloads = $('<span class="sbutton icondownload">' + GetTextByKey("P_IPT_XXXXXX", "Download") + '</span>').click(function () { + for (var i = 0; i < grid_dt.source.length; i++) { + var inspect = grid_dt.source[i].Values; + if (inspect.Selected) { + openDownloadFrame(inspect.Id); + } + } + }); + func.append(icondownloads); + + header.append(func) return header; @@ -121,7 +148,18 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function { name: 'Print', caption: "", css: { 'width': 30, 'text-align': 'center' } }, { name: 'ViewChangeHistory', caption: "", css: { 'width': 30, 'text-align': 'center' } } ]; - var columns = []; + var columns = [ + { + // checkbox + name: 'check', + key: 'Selected', + width: 45, + align: 'center', + sortable: false, + allcheck: true, + type: 3 + } + ]; // head for (var hd in list_columns) { var col = {}; @@ -246,7 +284,7 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function if (item.Id === "") return htmldecode(item.WorkOrderNumber); - var div = $('<div class="dropdown" style="width: 200px;"></div>'); + var div = $('<div class="dropdown" style="width: 185px;"></div>'); div.dropdown(item.WorkOrders || [{ Id: -1, WorkOrderNumber: "Not Assigned" }], { search: false, textKey: 'WorkOrderNumber', diff --git a/Site/Inspection/js/modules/layouts.js b/Site/Inspection/js/modules/layouts.js index d453ab8..32dc371 100644 --- a/Site/Inspection/js/modules/layouts.js +++ b/Site/Inspection/js/modules/layouts.js @@ -273,7 +273,7 @@ $('<option value="[Model]">Model</option>'), $('<option value="[VIN]">VIN/SN</option>'), $('<option value="[Work_Order_Number]">Work Order Number</option>'), - $('<option value="[Work_Order_Type]">Work Order Type</option>'), + $('<option value="[Work_Order_Type]">Work Order Type</option>'), $('<option value="[Parts_Order_Number]">Parts Order Number</option>'), $('<option value="[Year]">Year</option>') ); @@ -318,9 +318,12 @@ } function editLayout(info) { - $('#right_popup').load('js/modules/layouts/addlayout.html?v=2', function () { + $('#right_popup').load('js/modules/layouts/addlayout.html?v=5', function () { var modified = false; var deleteIcon = false; + var deleteCenterIcon = false; + var deleteRightIcon = false; + initColorCtrl(); var content = $(this).applyFleetLanguageText(true); content.find('.button-exit').on('click', function () { if (modified) { @@ -342,7 +345,7 @@ } }); content.find('.button-icon-upload').on('click', function () { - content.find('.icon-file file').remove(); + content.find('.icon-file input[type="file"]').remove(); $('<input type="file" accept="image/png,image/jpeg" />') .hide().appendTo(content.find('.icon-file')) .on('change', function () { @@ -365,7 +368,78 @@ content.find('.button-icon-delete').on('click', function () { deleteIcon = true; content.find('.img-icon-filename').remove(); + content.find('.icon-file input[type="file"]').remove(); }); + + content.find('.button-icon-centerupload').on('click', function () { + content.find('.icon-centerfile input[type="file"]').remove(); + $('<input type="file" accept="image/png,image/jpeg" />') + .hide().appendTo(content.find('.icon-centerfile')) + .on('change', function () { + if (!/image\/\w+/.test(this.files[0].type)) { + showAlert(GetTextByKey("P_LAYOUT_UPLOADICONTIPS", 'The file type for the logo is invalid. The file must be JPG or PNG.'), GetTextByKey('P_LAYOUT_SAVEINSPECTLAYOUT', 'Save Inspection Layout')); + $(this).remove(); + return; + } + var file = this.files[0]; + var reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = function (e) { + setTimeout(function () { + content.find('.img-icon-centerfilename').remove(); + $('<img class="img-icon-centerfilename" />').attr('src', e.target.result).insertAfter(content.find('.icon-centerfile-title')); + }); + }; + }).click(); + }); + content.find('.button-icon-centerdelete').on('click', function () { + deleteCenterIcon = true; + content.find('.img-icon-centerfilename').remove(); + content.find('.icon-centerfile input[type="file"]').remove(); + }); + + content.find('.button-icon-rightupload').on('click', function () { + content.find('.icon-rightfile input[type="file"]').remove(); + $('<input type="file" accept="image/png,image/jpeg" />') + .hide().appendTo(content.find('.icon-rightfile')) + .on('change', function () { + if (!/image\/\w+/.test(this.files[0].type)) { + showAlert(GetTextByKey("P_LAYOUT_UPLOADICONTIPS", 'The file type for the logo is invalid. The file must be JPG or PNG.'), GetTextByKey('P_LAYOUT_SAVEINSPECTLAYOUT', 'Save Inspection Layout')); + $(this).remove(); + return; + } + var file = this.files[0]; + var reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = function (e) { + setTimeout(function () { + content.find('.img-icon-rightfilename').remove(); + $('<img class="img-icon-rightfilename" />').attr('src', e.target.result).insertAfter(content.find('.icon-rightfile-title')); + }); + }; + }).click(); + }); + content.find('.button-icon-rightdelete').on('click', function () { + deleteRightIcon = true; + content.find('.img-icon-rightfilename').remove(); + content.find('.icon-rightfile input[type="file"]').remove(); + }); + + content.find('#layout-style').on('change', function () { + var style = $('#layout-style').val(); + if (parseInt(style) === 2) { + $('#layout-picturesdisplay').val(1); + $('#layout-picturesdisplay').prop('disabled', true); + } + else { + $('#layout-picturesdisplay').prop('disabled', false); + } + }); + content.find('#layout-highlightcolor-input').keyup(null, function () { + $("#layout-highlightcolor-selector").spectrum("set", $('#layout-highlightcolor-input').val()); + }) + + var save = function (exit) { return function () { var title = GetTextByKey('P_LAYOUT_SAVEINSPECTLAYOUT', 'Save Inspection Layout'); @@ -379,20 +453,26 @@ ); return; } - var layout = { Id: info && info.Id, Target: layouts.isteam ? 1 : 0, Name: name, - IncludeLOGO: content.find('#layout-include-logo').prop('checked'), Notes: content.find('.text-layout-notes').val(), PageHeaderLeft: content.find('.layout-headers-left .editor-content').val(), PageHeaderCenter: content.find('.layout-headers-middle .editor-content').val(), PageHeaderRight: content.find('.layout-headers-right .editor-content').val(), PageFooterLeft: content.find('.layout-footers-left .editor-content').val(), PageFooterCenter: content.find('.layout-footers-middle .editor-content').val(), - PageFooterRight: content.find('.layout-footers-right .editor-content').val() + PageFooterRight: content.find('.layout-footers-right .editor-content').val(), + Style: content.find('#layout-style').val(), + Spacing: content.find('#layout-spacing').val(), + PicturesDisplay: content.find('#layout-picturesdisplay').val(), + CaptionImages: content.find('#layout-captionimages').prop('checked'), + Divider: content.find('#layout-divider').val(), + HighlightColor: content.find('#layout-highlightcolor-input').val() }; + if (layout.Style === "") + layout.Style = -1; var data = new FormData(); var files = content.find('.icon-file input[type="file"]').prop('files'); if (files && files[0]) { @@ -401,6 +481,23 @@ var logo = content.find('.img-icon-filename').prop('src'); layout.LOGO = logo.substr(logo.indexOf(';base64,') + 8); } + + var centerfiles = content.find('.icon-centerfile input[type="file"]').prop('files'); + if (centerfiles && centerfiles[0]) { + data.append('iconCenterFile', centerfiles && centerfiles[0]); + } else if (!deleteCenterIcon) { + var logo = content.find('.img-icon-centerfilename').prop('src'); + layout.CenterLOGO = logo.substr(logo.indexOf(';base64,') + 8); + } + + var rightfiles = content.find('.icon-rightfile input[type="file"]').prop('files'); + if (rightfiles && rightfiles[0]) { + data.append('iconRightFile', rightfiles && rightfiles[0]); + } else if (!deleteRightIcon) { + var logo = content.find('.img-icon-rightfilename').prop('src'); + layout.RightLOGO = logo.substr(logo.indexOf(';base64,') + 8); + } + data.append('MethodName', 'SaveInspectLayout'); data.append('ClientData', encodeURIComponent(JSON.stringify(layout))); $.ajax({ @@ -459,10 +556,15 @@ var onchange = function () { modified = true }; if (info != null) { content.find('.text-layout-name').val(info.Name); - content.find('#layout-include-logo').prop('checked', info.IncludeLOGO); if (info.LOGO != null) { content.find('.img-icon-filename').attr('src', 'data:image/png;base64,' + info.LOGO); } + if (info.CenterLOGO != null) { + content.find('.img-icon-centerfilename').attr('src', 'data:image/png;base64,' + info.CenterLOGO); + } + if (info.RightLOGO != null) { + content.find('.img-icon-rightfilename').attr('src', 'data:image/png;base64,' + info.RightLOGO); + } content.find('.text-layout-notes').val(info.Notes); content.find('.layout-headers-left .editor-content').val(info.PageHeaderLeft); content.find('.layout-headers-middle .editor-content').val(info.PageHeaderCenter); @@ -470,9 +572,17 @@ content.find('.layout-footers-left .editor-content').val(info.PageFooterLeft); content.find('.layout-footers-middle .editor-content').val(info.PageFooterCenter); content.find('.layout-footers-right .editor-content').val(info.PageFooterRight); + + content.find('#layout-style').val(info.Style); + content.find('#layout-spacing').val(info.Spacing); + content.find('#layout-picturesdisplay').val(info.PicturesDisplay); + content.find('#layout-captionimages').prop('checked', info.CaptionImages); + content.find('#layout-divider').val(info.Divider); + content.find('#layout-highlightcolor-input').val(info.HighlightColor); + content.find('#layout-highlightcolor-selector').spectrum("set", info.HighlightColor); } content.find('.text-layout-name').on('change', onchange); - content.find('#layout-include-logo').on('change', onchange); + //content.find('#layout-style').on('change', onchange); content.find('.text-layout-notes').on('change', onchange); content.find('.layout-headers-left .editor-content').on('change', onchange); content.find('.layout-headers-middle .editor-content').on('change', onchange); @@ -480,6 +590,12 @@ content.find('.layout-footers-left .editor-content').on('change', onchange); content.find('.layout-footers-middle .editor-content').on('change', onchange); content.find('.layout-footers-right .editor-content').on('change', onchange); + content.find('#layout-style').on('change', onchange); + content.find('#layout-spacing').on('change', onchange); + content.find('#layout-picturesdisplay').on('change', onchange); + content.find('#layout-captionimages').on('change', onchange); + content.find('#layout-divider').on('change', onchange); + content.find('#layout-highlightcolor-input').on('change', onchange); content.find('.text-layout-name').focus(); }); @@ -509,5 +625,59 @@ } }); + function initColorCtrl() { + $('#layout-highlightcolor-selector').spectrum({ + allowEmpty: true, + color: "#FFF", + showInput: true, + containerClassName: "full-spectrum", + showInitial: true, + showPalette: true, + showSelectionPalette: true, + showAlpha: true, + maxPaletteSize: 10, + preferredFormat: "hex", + localStorageKey: "spectrum.demo", + chooseText: GetTextByKey("P_IPT_OK", "OK"), + cancelText: GetTextByKey("P_IPT_CANCEL", "Cancel"), + clearText: GetTextByKey("P_SPECTRUM_CLEARCOLORSELECTION", "Clear Color Selection"), + noColorSelectedText: GetTextByKey("P_SPECTRUM_NOCOLORSELECTED", "No Color Selected"), + move: function (color) { + if (color) + $('#layout-highlightcolor-input').val(color.toHexString().toUpperCase()); // #ff0000 + }, + show: function () { + + }, + beforeShow: function () { + + }, + hide: function (color) { + if (color) { + $('#layout-highlightcolor-input').val(color.toHexString().toUpperCase()); // #ff0000 + } + }, + + palette: [ + ["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/ + "rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)"], + ["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)", + "rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"], + ["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)", + "rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)", + "rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)", + "rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)", + "rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)", + "rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)", + "rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)", + "rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)", + /*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)", + "rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/ + "rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)", + "rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"] + ] + }); + } + return layouts; }); \ No newline at end of file diff --git a/Site/Inspection/js/modules/layouts/addlayout.html b/Site/Inspection/js/modules/layouts/addlayout.html index a86e6f0..814443b 100644 --- a/Site/Inspection/js/modules/layouts/addlayout.html +++ b/Site/Inspection/js/modules/layouts/addlayout.html @@ -8,30 +8,74 @@ <span class="sbutton iconexit button-exit" data-lgid="P_IPT_SAVE2">Exit Without Saving</span> </div> <div class="page_title" data-lgid="P_LAYOUT_GENERAL">General</div> - <div style="display: flex"> - <div class="settings-line"> - <span> - <span data-lgid="P_LAYOUT_NAMECOLON">Layout Name:</span> - <b style="color: red">*</b> - <input type="text" class="text-layout-name" maxlength="200" /> - </span> - <span> - <label for="layout-include-logo" data-lgid="P_LAYOUT_INCLUDELOGO">Include Logo:</label> - <input type="checkbox" id="layout-include-logo" /> - </span> + <div class="settings-line"> + <span> + <span data-lgid="P_LAYOUT_NAMECOLON">Layout Name:</span> + <b style="color: red">*</b> + <input type="text" class="text-layout-name" maxlength="200" /> + + <label data-lgid="P_LAYOUT_XXX" class="select-layout-name">Style:</label> + <select id="layout-style" class="select-layout"> + <option value="0">Standard</option> + <option value="1">Compressed</option> + <option value="2">Split</option> + </select> + </span> + <span> <span class="icon-file"> - <span class="icon-file-title" data-lgid="P_LAYOUT_ICONFILENAME">Logo file:</span> + <span class="icon-file-title" data-lgid="P_LAYOUT_XX">Left Logo file:</span> <img class="img-icon-filename" /> <span class="svg-button button-icon-upload"><svg><use href="#symbol-upload"></use></svg></span> <span class="svg-button button-icon-delete"><svg><use href="#symbol-close"></use></svg></span> </span> - </div> - <div class="settings-line" style="flex: 1 1 auto"> - <span style="display: flex"> - <span data-lgid="P_LAYOUT_NOTESCOLON" style="vertical-align:top; white-space:nowrap">Notes:</span> - <textarea class="text-layout-notes" style="height:100px; width:100%; box-sizing:border-box; margin-left:8px"></textarea> + <span class="icon-centerfile" style="margin-left:30px;"> + <span class="icon-centerfile-title" data-lgid="P_LAYOUT_XXX">Center Logo file:</span> + <img class="img-icon-centerfilename" /> + <span class="svg-button button-icon-centerupload"><svg><use href="#symbol-upload"></use></svg></span> + <span class="svg-button button-icon-centerdelete"><svg><use href="#symbol-close"></use></svg></span> </span> - </div> + <span class="icon-rightfile" style="margin-left:30px;"> + <span class="icon-rightfile-title" data-lgid="P_LAYOUT_XXX">Right Logo file:</span> + <img class="img-icon-rightfilename" /> + <span class="svg-button button-icon-rightupload"><svg><use href="#symbol-upload"></use></svg></span> + <span class="svg-button button-icon-rightdelete"><svg><use href="#symbol-close"></use></svg></span> + </span> + </span> + + <span style="display: flex"> + <span data-lgid="P_LAYOUT_NOTESCOLON" style="vertical-align:top; white-space:nowrap">Notes:</span> + <textarea class="text-layout-notes" style="height:100px; width:100%; box-sizing:border-box; margin-left:8px"></textarea> + </span> + </div> + <div class="page_title" data-lgid="P_LAYOUT_XXX">Options</div> + <div class="settings-line"> + <span> + <span data-lgid="P_LAYOUT_XXX">Spacing:</span> + <select id="layout-spacing" class="select-layout"> + <option value="0" data-lgid="P_XXX">Single Space</option> + <option value="1" data-lgid="P_XXX">Double Space</option> + </select> + + <span data-lgid="P_LAYOUT_XXX" class="select-layout-name">Pictures:</span> + <select id="layout-picturesdisplay" class="select-layout" style="width:140px;"> + <option value="0" data-lgid="P_XXX">Displayed As Taken</option> + <option value="1" data-lgid="P_XXX">Displayed At Bottom</option> + </select> + + <span data-lgid="P_LAYOUT_XXX" class="select-layout-name">Caption Images:</span> + <input type="checkbox" id="layout-captionimages" /> + + <span data-lgid="P_LAYOUT_XXX" class="select-layout-name">Divider:</span> + <select id="layout-divider" class="select-layout" style="width:80px;"> + <option value="0" data-lgid="P_XXX">None</option> + <option value="1" data-lgid="P_XXX">Line</option> + <option value="2" data-lgid="P_XXX">Grid</option> + </select> + + <span data-lgid="P_LAYOUT_XXX" class="select-layout-name">VIP Questions/Section Highlight Color:</span> + <input id="layout-highlightcolor-input" style="width:60px;" maxlength="7" /> + <input id="layout-highlightcolor-selector" /> + </span> </div> <div class="page_title" data-lgid="P_IPT_FUELRPT_HEADER">Page Headers</div> diff --git a/Site/Inspection/js/modules/sections/addquestion.js b/Site/Inspection/js/modules/sections/addquestion.js index d81547e..ca06f3d 100644 --- a/Site/Inspection/js/modules/sections/addquestion.js +++ b/Site/Inspection/js/modules/sections/addquestion.js @@ -83,7 +83,7 @@ define(['common'], function (Common) { tb.append(tr); tr.append('<td class="label">' + GetTextByKey("P_IPT_NAME_COLON", "Name:") + '<span class="redasterisk">*</span></td>'); namecontrol = $('<input type="text" maxlength="100"/>'); - var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(namecontrol, _this.question); }); @@ -93,7 +93,7 @@ define(['common'], function (Common) { tb.append(tr); tr.append('<td class="label">' + GetTextByKey("P_IPT_DISPLAYTEXT_COLON", "Display Text:") + '<span class="redasterisk">*</span></td>'); displaytextcontrol = $('<input type="text" maxlength="1000" />'); - addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(displaytextcontrol, _this.question); }); @@ -141,7 +141,7 @@ define(['common'], function (Common) { tr = $('<tr></tr>'); tb.append(tr); tr.append('<td class="label">Notes:</td>'); - notescontrol = $('<textarea id="dialog_notes" class="inputbox" maxlength="1000" style="width: 400px; margin-top: 6px;"></textarea>'); + notescontrol = $('<textarea id="dialog_notes" maxlength="1000" style="width: 400px; margin-top: 6px;"></textarea>'); tr.append($('<td></td>').append(notescontrol)); return div_main; @@ -187,7 +187,7 @@ define(['common'], function (Common) { tb.append(tr); var optext = $('<input type="text" style="width:240px;margin-left:5px;"/>'); this.dialog_text = optext; - var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(optext, _this.question); }); diff --git a/Site/Inspection/js/modules/sections/addsection.js b/Site/Inspection/js/modules/sections/addsection.js index 79fe5a0..fc89252 100644 --- a/Site/Inspection/js/modules/sections/addsection.js +++ b/Site/Inspection/js/modules/sections/addsection.js @@ -82,7 +82,7 @@ define(['common'], function (Common) { tb.append(tr); tr.append('<td class="label" style="vertical-align:middle;">' + GetTextByKey("P_IPT_DISPLAYTEXT_COLON", "Display Text:") + '<span class="redasterisk">*</span></td>'); displaytextcontrol = $('<input type="text" maxlength="200" autocomplete="off"/>'); - addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(displaytextcontrol, _this.section); }); @@ -91,7 +91,7 @@ define(['common'], function (Common) { tr = $('<tr></tr>'); tb.append(tr); tr.append('<td class="label">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>'); - notescontrol = $('<textarea id="dialog_notes" class="inputbox" maxlength="500" autocomplete="off" style="width: 400px; margin-top: 6px;"></textarea>'); + notescontrol = $('<textarea id="dialog_notes" maxlength="500" autocomplete="off" style="width: 400px; margin-top: 6px;"></textarea>'); tr.append($('<td></td>').append(notescontrol)); return div_main; diff --git a/Site/Inspection/js/modules/sections/option.js b/Site/Inspection/js/modules/sections/option.js index 18eed23..a8a85f6 100644 --- a/Site/Inspection/js/modules/sections/option.js +++ b/Site/Inspection/js/modules/sections/option.js @@ -48,7 +48,7 @@ tb.append(tr); var optext = $('<input type="text" class="form-control" style="width:226px;margin-left:5px;"/>'); this.dialog_text = optext; - var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(optext); }); diff --git a/Site/Inspection/js/modules/sections/question.js b/Site/Inspection/js/modules/sections/question.js index e0c1a68..e9656e7 100644 --- a/Site/Inspection/js/modules/sections/question.js +++ b/Site/Inspection/js/modules/sections/question.js @@ -64,7 +64,7 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo if (this.index % 2 == 1) qholder.addClass('holder-even'); - var drag = $('<div class="question-icon" style="width:30px;"><em class="spanbtn iconmove rowdrag"></em></div>'); + var drag = $('<div class="question-icon" style="width:30px;" title="' + GetTextByKey("P_IPT_XXX", "Move Question") + '"><em class="spanbtn iconmove rowdrag"></em></div>'); qholder.append(drag); if (!_this.section.IsLink && sectiontype == 1) { drag.attr('draggable', true); @@ -108,14 +108,14 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo qholder.append('<div class="question-icon" style="width:30px;"><em class="fa"></em></div>'); _this.txtName = $('<input type="text" class="question-input" maxlength="100" autocomplete="off" style="width:146px;" />'); - var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(_this.txtName, _this.question); }); qholder.append($('<div class="question-cell question-name" style="width: 190px;padding-left:10px;"></div>').append(this.txtName).append(addiText)); _this.txtDisplayText = $('<input type="text" class="question-input" maxlength="200" autocomplete="off" style="width:236px;" />'); - addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(_this.txtDisplayText, _this.question); }); @@ -137,16 +137,16 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo qholder.append($('<div class="question-cell question-required" style="width: 80px; text-align: center"></div>').append(this.chkIsRequired)); _this.chkCanComment = $('<input type="checkbox" />'); - qholder.append($('<div class="question-cell question-comment" style="width: 100px; text-align: center"></div>').append(this.chkCanComment)); + qholder.append($('<div class="question-cell question-comment" style="width: 65px; text-align: center"></div>').append(this.chkCanComment)); _this.chkIsImportant = $('<input type="checkbox" />'); - qholder.append($('<div class="question-cell question-important" style="width: 100px; text-align: center"></div>').append(this.chkIsImportant)); + qholder.append($('<div class="question-cell question-important" style="width: 70px; text-align: center"></div>').append(this.chkIsImportant)); _this.chkCustomerVisible = $('<input type="checkbox" />'); - qholder.append($('<div class="question-cell question-important" style="width: 140px; text-align: center"></div>').append(this.chkCustomerVisible)); + qholder.append($('<div class="question-cell question-important" style="width: 70px; text-align: center"></div>').append(this.chkCustomerVisible)); - _this.selSeverityLevel = createSeverityLevel().addClass('question-input').css('width', 130); - qholder.append($('<div class="question-cell question-security" style="width: 140px"></div>').append(this.selSeverityLevel)); + _this.selSeverityLevel = createSeverityLevel().addClass('question-input').css('width', 70); + qholder.append($('<div class="question-cell question-security" style="width: 80px"></div>').append(this.selSeverityLevel)); _this.txtNotes = $('<textarea class="question-input" maxlength="500" autocomplete="off" style="width:95%;margin-top:5px;"></textarea>'); qholder.append($('<div class="question-cell question-notes" style="width: 160px;white-space:normal;"></div>').append(this.txtNotes)); @@ -214,7 +214,7 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo td = $('<td></td>'); tr.append(td); - _this.btnoption = $('<span class="spanbtn iconangleleft" style="font-size:18px;"></span>'); + _this.btnoption = $('<span class="spanbtn iconangleleft" style="font-size:18px;" title="' + GetTextByKey("P_IPT_XXX","Display Options") + '"></span>'); td.append(_this.btnoption); _this.btnoption.click(function () { var icon = $(this); diff --git a/Site/Inspection/js/modules/sections/section.js b/Site/Inspection/js/modules/sections/section.js index 3cf6945..0c8fadb 100644 --- a/Site/Inspection/js/modules/sections/section.js +++ b/Site/Inspection/js/modules/sections/section.js @@ -38,7 +38,7 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec } if (sectiontype == 1) { - var drag = $('<div class="question-icon" style="width:30px;"><em class="spanbtn iconmove rowdrag"></em></div>'); + var drag = $('<div class="question-icon" style="width:30px;" title="' + GetTextByKey("P_IPT_XXX","Move Section") + '"><em class="spanbtn iconmove rowdrag"></em></div>'); holder.append(drag); if (sectiontype == 1) { drag.attr('draggable', true); @@ -106,7 +106,7 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec this.txtName.change(function () { _this.onsave(); }); - var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(_this.txtName, _this.section); }); @@ -116,7 +116,7 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec this.txtDisplayText.change(function () { _this.onsave(); }); - addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(_this.txtDisplayText, _this.section); }); diff --git a/Site/Inspection/js/modules/templates/addtemplate.js b/Site/Inspection/js/modules/templates/addtemplate.js index 5aa9b60..821f4b5 100644 --- a/Site/Inspection/js/modules/templates/addtemplate.js +++ b/Site/Inspection/js/modules/templates/addtemplate.js @@ -174,7 +174,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat tr = $('<tr class="templatetr"></tr>'); tb.append(tr); tr.append('<td class="label" style="width:160px;">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>'); - notescontrol = $('<textarea id="dialog_notes" class="inputbox form-control" maxlength="500" autocomplete="off" style="width: 540px; margin-top: 6px;height:80px;"></textarea>'); + notescontrol = $('<textarea id="dialog_notes" class="form-control" maxlength="500" autocomplete="off" style="width: 540px; margin-top: 6px;height:80px;"></textarea>'); tr.append($('<td></td>').append(notescontrol)); //Email @@ -240,7 +240,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat { name: 'UserName', caption: GetTextByKey("P_IPT_CONTACTNAME", "Contact Name"), valueIndex: 'UserName', css: { 'width': 180, 'text-align': 'left' } }, { name: 'ContactType', caption: GetTextByKey("P_IPT_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactType', css: { 'width': 180, 'text-align': 'left' } }, //{ name: 'Text', caption: "Text", valueIndex: 'Text', type: 3, css: { 'width': 45, 'text-align': 'center' } }, - { name: 'Selected', caption: GetTextByKey("P_IPT_EMAIL", "Email"), valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } } + { name: 'Selected', caption: GetTextByKey("P_IPT_EMAIL", "Email"), valueIndex: 'Selected', type: 3, css: { 'width': 60, 'text-align': 'center' } } ]; var columns = []; // head diff --git a/Site/Inspection/js/modules/templates/linksection.js b/Site/Inspection/js/modules/templates/linksection.js index 8782a74..50d28f7 100644 --- a/Site/Inspection/js/modules/templates/linksection.js +++ b/Site/Inspection/js/modules/templates/linksection.js @@ -28,7 +28,7 @@ define(['common'], function (Common) { // checkbox name: 'check', key: 'Selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, diff --git a/Site/Inspection/js/modules/templates/page.js b/Site/Inspection/js/modules/templates/page.js index 76bf677..f28ae3a 100644 --- a/Site/Inspection/js/modules/templates/page.js +++ b/Site/Inspection/js/modules/templates/page.js @@ -28,7 +28,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo tb.append(tr); tr.append('<td class="label" style="width:154px;">' + GetTextByKey("P_IPT_NAME_COLON", "Name:") + '<span class="redasterisk">*</span></td>'); _this.namecontrol = $('<input type="text" class="form-control" maxlength="100" autocomplete="off"/>'); - var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(_this.namecontrol); }); @@ -40,14 +40,14 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo tb.append(tr); tr.append('<td class="label" style="width:154px;">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>'); - _this.notescontrol = $('<textarea id="dialog_notes" class="inputbox form-control" maxlength="500" autocomplete="off" style="width: 540px; margin-top:6px;height:55px;"></textarea>'); + _this.notescontrol = $('<textarea id="dialog_notes" class="form-control" maxlength="500" autocomplete="off" style="width: 540px; margin-top:6px;height:55px;"></textarea>'); tr.append($('<td rowspan="2"></td>').append(_this.notescontrol)); tr = $('<tr></tr>'); tb.append(tr); tr.append('<td class="label" style="width:154px;">' + GetTextByKey("P_IPT_DISPLAYTEXT_COLON", "Display Text:") + '<span class="redasterisk">*</span></td>'); _this.displaytextcontrol = $('<input type="text" class="form-control" maxlength="200" autocomplete="off"/>'); - addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_ADDITIONALTEXTS", "Additional Texts") + '"/>'); + addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>'); addiText.click(function () { Common.createMultiTextDialog(_this.displaytextcontrol); }); @@ -65,7 +65,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo var header = $('<div></div>'); //header.append($('<div class="page_title"></div>').text(gs.title)); var func = $('<div class="function_title"></div>'); - var iconAdd = $('<span class="sbutton iconadd">' + GetTextByKey("P_IPT_ADD", "Add") + '</span>').click(function () { + var iconAdd = $('<span class="sbutton iconadd">' + GetTextByKey("P_IPT_ADDSECTION", "Add Section") + '</span>').click(function () { //var s = new AddSection(); //s.onsave = function (section) { // _this.page.Sections.push(section); @@ -95,10 +95,10 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo dataheader.append('<div class="question-cell" style="width: 310px">' + GetTextByKey("P_IPT_DISPLAYTEXT", "Display Text") + '</div>'); dataheader.append('<div class="question-cell" style="width: 400px">' + GetTextByKey("P_IPT_TYPE", "Type") + '</div>'); dataheader.append('<div class="question-cell" style="width: 80px; text-align: center">' + GetTextByKey("P_IPT_REQUIRED", "Required") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 100px; text-align: center">' + GetTextByKey("P_IPT_CANCOMMENT", "Can Comment") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 100px; text-align: center">' + GetTextByKey("P_IPT_ISIMPORTANT", "Is Important") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 140px">' + GetTextByKey("P_IPT_CUSTOMERVISIBLE", "Customer Visible") + '</div>'); - dataheader.append('<div class="question-cell" style="width: 140px">' + GetTextByKey("P_IPT_SEVERITYLEVEL", "Severity Level") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 65px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_XXX", "Include Comment") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 70px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_ISIMPORTANT", "Is Important") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 70px; text-align: center;white-space:normal;line-height:20px;"">' + GetTextByKey("P_IPT_CUSTOMERVISIBLE", "Customer Visible") + '</div>'); + dataheader.append('<div class="question-cell" style="width: 80px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_SEVERITYLEVEL", "Severity Level") + '</div>'); dataheader.append('<div style="flex-grow: 1" style="width: 160px">' + GetTextByKey("P_IPT_ST_NOTES", "Notes") + '</div>'); dataheader.append('<div class="question-cell" style="width: 90px;padding-right:20px;"></div>'); content.append(dataheader); diff --git a/Site/Inspection/js/modules/templates/templatepicture.js b/Site/Inspection/js/modules/templates/templatepicture.js index edae2a4..0279263 100644 --- a/Site/Inspection/js/modules/templates/templatepicture.js +++ b/Site/Inspection/js/modules/templates/templatepicture.js @@ -28,7 +28,7 @@ define(['common'], function (Common) { // checkbox name: 'check', key: 'Selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, diff --git a/Site/Inspection/js/report.js b/Site/Inspection/js/report.js index 904d657..1975ea6 100644 --- a/Site/Inspection/js/report.js +++ b/Site/Inspection/js/report.js @@ -1,6 +1,14 @@ var vm; var reportdata; +var reportlayout; +var layoutStyle = 0; +var layoutDivider = 0; +var layoutSpacing = 0; +var layoutPicturesDisplay = 0; +var layoutCaptionImages = false; +var layoutHighlightColor = ""; +var mediasdata = []; $(function () { $("#host_header").find(".button").remove(); $("#spanUserName").remove(); @@ -62,11 +70,25 @@ function GetInspectionReport() { } else { reportdata = data; + reportlayout = data.ReportLayout; + if (reportlayout) { + layoutStyle = parseInt(reportlayout.Style); + layoutDivider = parseInt(reportlayout.Divider); + layoutSpacing = parseInt(reportlayout.Spacing); + layoutPicturesDisplay = parseInt(reportlayout.PicturesDisplay); + layoutCaptionImages = reportlayout.CaptionImages; + layoutHighlightColor = reportlayout.HighlightColor; + if (layoutStyle == 2) + layoutPicturesDisplay = 1; + }; vm.reload(data); showReportLayout(data.ReportLayout); showIdentifiedQuestions(data.IdentifiedQuestions); showPages(data); showSignature(data); + if (layoutPicturesDisplay == 1 && mediasdata && mediasdata.length > 0) { + showMedias(); + } } showmaskbg(false); @@ -77,6 +99,8 @@ function GetInspectionReport() { function showReportLayout(layout) { $('#reportlayoutlogo').hide(); + $('#reportlayoutcenterlogo').hide(); + $('#reportlayoutrightlogo').hide(); $('.td_pageheaderleft').html(''); $('.td_pageheadercenter').html(''); $('.td_pageheaderright').html(''); @@ -92,13 +116,29 @@ function showReportLayout(layout) { $('.td_pagefooterright').html(layout.PageFooterRight); $('#reportlayoutlogo').show(); - if (layout.IncludeLOGO && layout.LOGO && layout.LOGO.length > 0) { + $('#reportlayoutcenterlogo').show(); + $('#reportlayoutrightlogo').show(); + if (layout.LOGO && layout.LOGO.length > 0) { var jpeg = layout.LOGO; if (typeof (layout.LOGO) !== "string") { jpeg = arrayBufferToBase64(layout.LOGO); } $('#reportlayoutlogo').attr('src', 'data:image/png;base64,' + jpeg); } + if (layout.CenterLOGO && layout.CenterLOGO.length > 0) { + var jpeg = layout.CenterLOGO; + if (typeof (layout.CenterLOGO) !== "string") { + jpeg = arrayBufferToBase64(layout.CenterLOGO); + } + $('#reportlayoutcenterlogo').attr('src', 'data:image/png;base64,' + jpeg); + } + if (layout.RightLOGO && layout.RightLOGO.length > 0) { + var jpeg = layout.RightLOGO; + if (typeof (layout.RightLOGO) !== "string") { + jpeg = arrayBufferToBase64(layout.RightLOGO); + } + $('#reportlayoutrightlogo').attr('src', 'data:image/png;base64,' + jpeg); + } } } @@ -118,19 +158,7 @@ function showIdentifiedQuestions(questions) { var content = $('<div></div>'); content.append($('<div class="catelog">IDENTIFIED ISSUES</div>')); if (questions && questions.length > 0) { - for (var i = 0; i < questions.length; i++) { - var q = questions[i]; - var div_question = $('<div class="question"></div>'); - content.append(div_question); - div_question.append($('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText)) - if (q.StaticPictures && q.StaticPictures.length > 0) { - var div_pic = $('<div style=""></div>'); - div_pic = createPictures(q.StaticPictures, div_pic); - div_question.append(div_pic) - } - - createAnswerContent(content, q); - } + createQuestionContent1(content, questions); } else content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions'))); @@ -138,7 +166,11 @@ function showIdentifiedQuestions(questions) { $('#divquestions').append(content); } + function showSeverityLevel(level) { + if (layoutStyle == 1 || layoutStyle == 2) + return ""; + var levertext = GetTextByKey("P_IPT_SEVERITYLEVEL_COLON", "Severity Level: "); if (level === 0) levertext = ""; @@ -166,32 +198,185 @@ function showPages(report) { function showSignature(report) { if (report && report.SignatureUrl && report.SignatureUrl != "") { - $('#divsign').append($('<div style="border-bottom:1px solid #dbdbdb;"></div>')); - $('#divsign').append($('<div class="catelog" style="margin-top:20px;">' + GetTextByKey("P_IPT_SIGNATURE", "Signature") + '</div>')); + var divsign = $('#divsign'); + divsign.append($('<div class="catelog" style="margin-top:20px;">' + GetTextByKey("P_IPT_SIGNATURE", "Signature") + '</div>')); + var div_pic = $('<div></div>'); + divsign.append(div_pic); var pic = $('<img style="height:320px; margin-left:70px;margin-right:10px;margin-bottom:10px;"></img>').attr('src', report.SignatureUrl); - $('#divsign').append(pic); + + div_pic.append(pic); + if (layoutDivider == 1)//Line + div_pic.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_pic.addClass('question_div_grid'); + + if (layoutSpacing == 1)//Double Space + div_pic.css('line-height', '30px'); } } +function showMedias() { + var content = $('<div></div>'); + content.append($('<div class="catelog">Required Images</div>')); + if (layoutStyle == 1) {//Compressed + var div_question = $('<table style="width:100%;" class="question_table"></table>'); + content.append(div_question); + var tr_question = ""; + for (var i = 0; i < mediasdata.length; i++) { + var m = mediasdata[i]; + if (i % 3 == 0) { + tr_question = $('<tr style="width:100%;"></tr>'); + div_question.append(tr_question); + } + + var td_pic = $('<td style="width:33%;"></td>'); + tr_question.append(td_pic); + var piccontent = createMedias(m); + td_pic.append(piccontent); + } + + var m_count = mediasdata.length % 3; + if (m_count != 0) { + for (var i = 0; i < 3 - m_count; i++) { + tr_question.append($('<td style="width:33%;"></td>')); + } + } + + if (layoutDivider == 1)//Line + div_question.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_question.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + div_question.css('line-height', '30px'); + } + else if (layoutStyle == 2) {//Split + var div_question = $('<table style="width:100%;" class="question_table"></table>'); + content.append(div_question); + var tr_question = ""; + for (var i = 0; i < mediasdata.length; i++) { + var m = mediasdata[i]; + if (i % 4 == 0) { + tr_question = $('<tr style="width:100%;"></tr>'); + div_question.append(tr_question); + } + + var td_pic = $('<td style="width:25%;"></td>'); + tr_question.append(td_pic); + var piccontent = createMedias(m); + td_pic.append(piccontent); + } + + var m_count = mediasdata.length % 4; + if (m_count != 0) { + for (var i = 0; i < 4 - m_count; i++) { + tr_question.append($('<td style="width:25%;"></td>')); + } + } + + if (layoutDivider == 1)//Line + div_question.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_question.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + div_question.css('line-height', '30px'); + } + else { + var div_question = $('<table style="width:100%;" class="question_table"></table>'); + content.append(div_question); + for (var i = 0; i < mediasdata.length; i++) { + var m = mediasdata[i]; + var tr_question = $('<tr style="width:100%;"></tr>'); + div_question.append(tr_question); + + var td_pic = $('<td style="width:100%;"></td>'); + tr_question.append(td_pic); + var piccontent = createMedias(m); + td_pic.append(piccontent); + } + + if (layoutDivider == 1)//Line + div_question.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_question.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + div_question.css('line-height', '30px'); + } + + $('#divpages').append(content); +} + +function createMedias(m) { + var piccontent = $('<div style="float:left;"></div>'); + if (['.mp4', '.mov'].indexOf(m.FileType.toLowerCase()) >= 0) { + var v = $('<div class="media"><span class="video"></span></div>'); + v.click(m.Url, function (e) { + window.open(e.data, "_blank") + }); + piccontent.append(v); + if (layoutCaptionImages) { + var div_caption = $('<div class="mediacaption"></div>').attr('title', m.FileName); + piccontent.append(div_caption); + var span_caption = $('<span></span>').text(m.FileName); + div_caption.append(span_caption); + } + } + else { + var pic = $('<img class="media"></img>').attr('src', m.ThumbnailUrl); + pic.click(m.Url, function (e) { + window.open(e.data, "_blank") + }); + piccontent.append(pic); + if (layoutCaptionImages) { + var div_caption = $('<div class="mediacaption"></div>').attr('title', m.FileName);; + piccontent.append(div_caption); + var span_caption = $('<span></span>').text(m.FileName); + div_caption.append(span_caption); + } + } + return piccontent; +} + function createPage(page) { var content = $('<div style="padding:0px;"></div>'); - var divpage = $('<div class="page"></div>'); - content.append(divpage); + if (layoutStyle == 1 || layoutStyle == 2) { + var tabpage = $('<table class="question_table"style="width:100%;background-color:#a9a9a9" ></table>'); + content.append(tabpage); + var trpage = $('<tr style="width:100%;text-align:center;" ></tr>'); + tabpage.append(trpage); + var tdpage = $('<td style="width:100%;" ></td>'); + trpage.append(tdpage); + tdpage.append($('<span></span>').text(page.DisplayText)); - var btnpage = $('<em class="spanbtn iconangledown" style="font-size:22px;width:24px;"></em>'); - btnpage.click(function () { - var icon = $(this); - if (icon.hasClass('iconangleright')) { - icon.removeClass('iconangleright').addClass('iconangledown'); - icon.parent().next().show(); - } - else { - icon.removeClass('iconangledown').addClass('iconangleright'); - icon.parent().next().hide(); - } - }); - divpage.append(btnpage); - divpage.append($('<span></span>').text(page.DisplayText)); + if (layoutDivider == 1)//Line + tabpage.addClass('question_line'); + else if (layoutDivider == 2)//Grid + tabpage.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + tabpage.css('line-height', '30px'); + } + else { + var divpage = $('<div class="page"></div>'); + content.append(divpage); + + var btnpage = $('<em class="spanbtn iconangledown" style="font-size:22px;width:24px;"></em>'); + btnpage.click(function () { + var icon = $(this); + if (icon.hasClass('iconangleright')) { + icon.removeClass('iconangleright').addClass('iconangledown'); + icon.parent().next().show(); + } + else { + icon.removeClass('iconangledown').addClass('iconangleright'); + icon.parent().next().hide(); + } + }); + divpage.append(btnpage); + divpage.append($('<span></span>').text(page.DisplayText)); + } var sectioncontent = createSectionContent(page); content.append(sectioncontent); @@ -201,78 +386,225 @@ function createPage(page) { function createSectionContent(page) { var content = $('<div style="margin-bottom:30px;"></div>'); - if (page.Sections && page.Sections.length > 0) { - for (var i = 0; i < page.Sections.length; i++) { - var s = page.Sections[i]; - var divsection = $('<div class="section"></div>'); - content.append(divsection); + if (layoutStyle == 1 || layoutStyle == 2) { + if (page.Sections && page.Sections.length > 0) { + for (var i = 0; i < page.Sections.length; i++) { + var s = page.Sections[i]; - var btnsection = $('<em class="spanbtn iconangledown" style="font-size:18px;display:inline-block;"></em>'); - btnsection.click(function () { - var icon = $(this); - if (icon.hasClass('iconangleright')) { - icon.removeClass('iconangleright').addClass('iconangledown'); - icon.parent().next().show(); - } - else { - icon.removeClass('iconangledown').addClass('iconangleright'); - icon.parent().next().hide(); - } - }); - divsection.append(btnsection); - var ispic = false; - if (s.StaticPictures && s.StaticPictures.length > 0) { - ispic = true; - var div_pic = $('<span></span>'); - createPictures(s.StaticPictures, div_pic); - divsection.append(div_pic); - divsection.append('<br/>'); + var tabsection = $('<table class="question_table"style="width:100%;background-color:#cbcbcb;" ></table>'); + content.append(tabsection); + var trsection = $('<tr style="width:100%;text-align:center;" ></tr>'); + tabsection.append(trsection); + var tdsection = $('<td style="width:100%;" ></td>'); + trsection.append(tdsection); + tdsection.append($('<span></span>').text(s.DisplayText)); + + if (layoutDivider == 1)//Line + tabsection.addClass('question_line'); + else if (layoutDivider == 2)//Grid + tabsection.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + tabsection.css('line-height', '30px'); + + var qc = createQuestionContent(s); + content.append(qc); } - var span_title = $('<span></span>').text(s.DisplayText); - if (ispic) - span_title.css('margin-left', 24); - divsection.append(span_title); - - var qc = createQuestionContent(s, i); - content.append(qc); } } - else - content.append($('<div class="question"></div>').text('No Sections')); + else { + if (page.Sections && page.Sections.length > 0) { + for (var i = 0; i < page.Sections.length; i++) { + var s = page.Sections[i]; + var divsection = $('<div class="section"></div>'); + content.append(divsection); + + var btnsection = $('<em class="spanbtn iconangledown" style="font-size:18px;display:inline-block;"></em>'); + btnsection.click(function () { + var icon = $(this); + if (icon.hasClass('iconangleright')) { + icon.removeClass('iconangleright').addClass('iconangledown'); + icon.parent().next().show(); + } + else { + icon.removeClass('iconangledown').addClass('iconangleright'); + icon.parent().next().hide(); + } + }); + divsection.append(btnsection); + var ispic = false; + if (s.StaticPictures && s.StaticPictures.length > 0) { + ispic = true; + var div_pic = $('<span></span>'); + createPictures(s.StaticPictures, div_pic); + divsection.append(div_pic); + divsection.append('<br/>'); + } + var span_title = $('<span></span>').text(s.DisplayText); + if (ispic) + span_title.css('margin-left', 24); + divsection.append(span_title); + + var qc = createQuestionContent(s); + + content.append(qc); + } + } + else + content.append($('<div class="question"></div>').text('No Sections')); + } return content; } function createQuestionContent(section) { var content = $('<div style="margin-bottom:30px;"></div>'); if (section.Questions && section.Questions.length > 0) { - for (var i = 0; i < section.Questions.length; i++) { - var q = section.Questions[i]; - var div_question = $('<div class="question"></div>'); - content.append(div_question); - - var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText); - div_question.append(div_title); - if (q.StaticPictures && q.StaticPictures.length > 0) { - var div_pic = $('<div style=""></div>'); - div_pic = createPictures(q.StaticPictures, div_pic); - div_question.append(div_pic) - } - - createAnswerContent(content, q); - - if (i != section.Questions.length - 1) - content.append($('<div style="border-bottom:1px solid #dbdbdb;"></div>')); - } + createQuestionContent1(content, section.Questions); } else content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions'))); return content; } +function createQuestionContent1(content, questions) { + if (questions && questions.length > 0) { + if (layoutStyle == 1) {//Compressed + var div_question = $('<table style="width:100%;" class="question_table"></table>'); + content.append(div_question); + for (var i = 0; i < questions.length; i++) { + var q = questions[i]; + var tr_question = $('<tr style="width:100%;"></tr>'); + div_question.append(tr_question); + tr_question.append($('<td style="width:33%;"></td>').text(q.DisplayText)); + var td_answer = $('<td style="width:33%;"></td>'); + tr_question.append(td_answer); + createAnswerContent(td_answer, q); + var td_comment = $('<td style="width:33%;"></td>'); + tr_question.append(td_comment); + var comment = td_answer.data('comment'); + if (comment && comment != "") { + td_comment.append($('<div class="answer"></div>').html(replaceHtmlText(comment))); + } + + if (q.IsImportant && layoutHighlightColor) + tr_question.css('background-color', layoutHighlightColor); + } + + if (layoutDivider == 1)//Line + div_question.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_question.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + div_question.css('line-height', '30px'); + } + else if (layoutStyle == 2) {//Split + var div_question = $('<table style="width:100%;" class="question_table"></table>'); + content.append(div_question); + var tr_question = ""; + for (var i = 0; i < questions.length; i++) { + var q = questions[i]; + if (i % 2 == 0) { + tr_question = $('<tr style="width:100%;"></tr>'); + div_question.append(tr_question); + } + var td_question = $('<td style="width:25%;"></td>').text(q.DisplayText); + tr_question.append(td_question); + var td_answer = $('<td style="width:25%;"></td>'); + tr_question.append(td_answer); + createAnswerContent(td_answer, q); + if (q.IsImportant && layoutHighlightColor) { + td_question.css('background-color', layoutHighlightColor); + td_answer.css('background-color', layoutHighlightColor); + } + } + if (questions.length % 2 != 0) { + tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>')); + } + if (layoutDivider == 1)//Line + div_question.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_question.addClass('question_table_grid'); + + if (layoutSpacing == 1)//Double Space + div_question.css('line-height', '30px'); + + } + else { + for (var i = 0; i < questions.length; i++) { + var q = questions[i]; + var div_question = $('<div class="question"></div>'); + content.append(div_question); + + var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText); + div_question.append(div_title); + if (q.StaticPictures && q.StaticPictures.length > 0) { + var div_pic = $('<div style=""></div>'); + div_pic = createPictures(q.StaticPictures, div_pic); + div_question.append(div_pic) + } + + createAnswerContent(content, q); + + if (layoutDivider == 1)//Line + div_question.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_question.addClass('question_div_grid'); + + if (layoutSpacing == 1)//Double Space + div_question.css('line-height', '30px'); + + if (q.IsImportant && layoutHighlightColor) + div_question.css('background-color', layoutHighlightColor); + } + } + + content.find('.answer').each(function () { + var div_answer = $(this); + if (layoutStyle == 1 || layoutStyle == 2) { + div_answer.addClass('table_content'); + } + else { + var isimportant = div_answer.data('isimportant'); + if (isimportant && layoutHighlightColor) + div_answer.css('background-color', layoutHighlightColor); + + if (layoutDivider == 1)//Line + div_answer.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_answer.addClass('question_div_grid'); + + if (layoutSpacing == 1)//Double Space + div_answer.css('line-height', '30px'); + } + }); + content.find('.div_media').each(function () { + var div_media = $(this); + if (layoutStyle == 1 || layoutStyle == 2) { + div_media.css('padding-left', '3px'); + } + else { + var isimportant = div_media.data('isimportant'); + if (isimportant && layoutHighlightColor) + div_media.css('background-color', layoutHighlightColor); + + if (layoutDivider == 1)//Line + div_media.addClass('question_line'); + else if (layoutDivider == 2)//Grid + div_media.addClass('question_div_grid'); + + if (layoutSpacing == 1)//Double Space + div_media.css('line-height', '30px'); + } + }); + } + return content; +} + function createPictures(pictures, p) { for (var i = 0; i < pictures.length; i++) { var pic = pictures[i]; - var img = $('<img style="width:40px;height:40px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name); + var img = $('<img style="height:30px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name); img.click(pic.Url, function (e) { window.open(e.data, "_blank") }); @@ -288,6 +620,7 @@ function createAnswerContent(p, q) { for (var i = 0; i < reportdata.Answers.length; i++) { var a = reportdata.Answers[i]; if (a.QuestionId.toLowerCase() == q.Id.toLowerCase()) { + p.data('comment', a.Comment); if ([5, 8, 9, 10, 14, 15, 19].indexOf(q.QuestionType) < 0 || (q.QuestionType == 15 && q.SubType != 15)) {//except YesOrNo/DropDown/MultipleChoice/Picture/FuelRecords var result = a.Result; @@ -302,7 +635,7 @@ function createAnswerContent(p, q) { || (q.QuestionType == 15 && q.SubType == 10))//FuelRecords Quantity result += " " + convertUnits(a.Units); - var div_answer = $('<div class="answer"></div>'); + var div_answer = $('<div class="answer"></div>').data('isimportant', q.IsImportant); if (q.QuestionType == 1 || (q.QuestionType == 15 && q.SubType == 14)) p.append(div_answer.html(replaceHtmlText(result))).append("<div style='clear:both;'></div>"); @@ -318,7 +651,7 @@ function createAnswerContent(p, q) { } else if (q.QuestionType == 5) {//YesOrNo if (a.SelectedItems && a.SelectedItems.length > 0) { - var item = $('<div class="answer" ></div>'); + var item = $('<div class="answer" ></div>').data('isimportant', q.IsImportant); var div_bg = $('<div class="circle"></div>'); var label = $('<label style="margin-left:5px;"></lable>').text(a.SelectedItems[0].Text); item.append(div_bg); @@ -338,7 +671,7 @@ function createAnswerContent(p, q) { if (q.MultipleSelect) { if (a.SelectedItems && a.SelectedItems.length > 0) { for (var j = 0; j < a.SelectedItems.length; j++) { - var item = $('<div class="answer"></div>'); + var item = $('<div class="answer"></div>').data('isimportant', q.IsImportant); var div_bg = $('<div class="circle"></div>'); var label = $('<label style="margin-left:5px;"></lable>').text("" + (j + 1) + ". " + a.SelectedItems[j].Text); item.append(div_bg); @@ -355,7 +688,7 @@ function createAnswerContent(p, q) { } else { if (a.SelectedItems && a.SelectedItems.length > 0) { - var item = $('<div class="answer" ></div>'); + var item = $('<div class="answer"></div>').data('isimportant', q.IsImportant); var div_bg = $('<div class="circle"></div>'); var label = $('<label style="margin-left:5px;"></lable>').text(a.SelectedItems[0].Text); item.append(div_bg); @@ -373,7 +706,7 @@ function createAnswerContent(p, q) { else if (q.QuestionType == 14) {//Email (Drop Down) if (a.SelectedItems && a.SelectedItems.length > 0) { for (var j = 0; j < a.SelectedItems.length; j++) { - var item = $('<div class="answer"></div>'); + var item = $('<div class="answer"></div>').data('isimportant', q.IsImportant); var label = $('<label style="margin-left:5px;"></lable>').text("" + (j + 1) + ". " + a.SelectedItems[j].Text + "<" + a.SelectedItems[j].Value + ">"); item.append(label); item.append(label_level); @@ -383,33 +716,27 @@ function createAnswerContent(p, q) { } else if (q.QuestionType == 10 || (q.QuestionType == 15 && q.SubType == 15)) {//Picture - var pics = $('<div style="min-height:80px;overflow:auto;padding-left:90px;"></div>'); - p.append(pics); + if (layoutPicturesDisplay != 1) {//Displayed At Bottom + var pics = $('<div class="div_media" style="min-height:80px;overflow:auto;padding-left:90px;"></div>').data('isimportant', q.IsImportant); + p.append(pics); + } //pics.append(label_level); if (reportdata.Medias && reportdata.Medias.length > 0) { for (var j = 0; j < reportdata.Medias.length; j++) { var m = reportdata.Medias[j]; if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) { - if (['.mp4', '.mov'].indexOf(m.FileType.toLowerCase()) >= 0) { - var v = $('<div class="media"><span class="video"></span></div>'); - v.click(m.Url, function (e) { - window.open(e.data, "_blank") - }); - pics.append(v); - } - else { - var pic = $('<img class="media"></img>').attr('src', m.ThumbnailUrl); - pic.click(m.Url, function (e) { - window.open(e.data, "_blank") - }); - pics.append(pic); + if (layoutPicturesDisplay == 1)//Displayed At Bottom + mediasdata.push(m); + else {//Displayed As Taken + var media = createMedias(m); + pics.append(media); } } } } } else if (q.QuestionType == 19) {//Asset Status - var divanswer = $('<div class="answer" ></div>'); + var divanswer = $('<div class="answer" ></div>').data('isimportant', q.IsImportant); if (a.SelectedItems && a.SelectedItems.length > 0) { var div_bg = $('<div class="circle"></div>'); var label = $('<label style="margin-left:5px;"></lable>').text(a.SelectedItems[0].Text); @@ -422,36 +749,29 @@ function createAnswerContent(p, q) { } divanswer.append(label_level); - - var pics = $('<div style="min-height:80px;overflow:auto;padding-left:90px;"></div>'); - p.append(pics); + if (layoutPicturesDisplay != 1) {//Displayed At Bottom + var pics = $('<div class="div_media" style="min-height:80px;overflow:auto;padding-left:90px;"></div>').data('isimportant', q.IsImportant); + p.append(pics); + } if (reportdata.Medias && reportdata.Medias.length > 0) { for (var j = 0; j < reportdata.Medias.length; j++) { var m = reportdata.Medias[j]; if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) { - if (['.mp4', '.mov'].indexOf(m.FileType.toLowerCase()) >= 0) { - var v = $('<div class="media"><span class="video"></span></div>'); - v.click(m.Url, function (e) { - window.open(e.data, "_blank") - }); - pics.append(v); - } - else { - var pic = $('<img class="media"></img>').attr('src', m.ThumbnailUrl); - pic.click(m.Url, function (e) { - window.open(e.data, "_blank") - }); - pics.append(pic); + if (layoutPicturesDisplay == 1)//Displayed At Bottom + mediasdata.push(m); + else {//Displayed As Taken + var media = createMedias(m); + pics.append(media); } } } } if (a.Result && a.Result != "") { - p.append($('<div class="answer" style="color:#808080"></div>').html(replaceHtmlText(a.Result))); + p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result))); } } - if (a.Comment && a.Comment != "") { - p.append($('<div class="answer" style="color:#808080"></div>').html(replaceHtmlText(a.Comment))); + if (layoutStyle != 1 && layoutStyle != 2 && a.Comment && a.Comment != "") { + p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment))); } return; } diff --git a/Site/IronIntelMasterPage.master b/Site/IronIntelMasterPage.master index 2e8fc91..9825ea8 100644 --- a/Site/IronIntelMasterPage.master +++ b/Site/IronIntelMasterPage.master @@ -570,7 +570,7 @@ $('#mask_bg').hide(); }); $('#dialog_dashboards').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_chartnotes').dialog(function () { $('#mask_bgcn').hide(); @@ -1160,7 +1160,7 @@ </div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_MV_CANCEL" class="dialog-close" tabindex="12" /> + <input type="button" value="Cancel" data-lgid="P_MV_CANCEL" class="dialog-close" tabindex="12" style="height:unset;" /> <input type="button" value="OK" data-lgid="P_CP_OK" onclick="openDashboard();" tabindex="11" /> <div class="clear"></div> </div> diff --git a/Site/JobSite/AddJobSite.aspx b/Site/JobSite/AddJobSite.aspx index cb659a4..4065949 100644 --- a/Site/JobSite/AddJobSite.aspx +++ b/Site/JobSite/AddJobSite.aspx @@ -580,10 +580,13 @@ if (!sel || sel == "") exists = true; + showloading(true); + var selector = $('#dialog_region'); var selCurrent = selector.val(); selector.empty(); _network.jobsitequery('GetRegions', '', function (data) { + showloading(false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_AM_ERROR", 'Error')); return; @@ -606,6 +609,8 @@ selector.val(sel); else if (selCurrent) selector.val(selCurrent); + }, function () { + showloading(false); }); } @@ -1730,6 +1735,7 @@ var dialogAssets = new $assetselector('dialog_machines'); dialogAssets.jobsiteId = jobsiteid; + dialogAssets.allowotherfilter = false; dialogAssets.onDialogClosed = function () { $('#dialogmask').hide(); $('#dialog_machines').remove(); @@ -1761,7 +1767,7 @@ function OnMachineDeleteSingle(item) { $("#dialogmask").show(); var alerttitle = GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"); - showConfirm(GetTextByKey("P_JS_DELETEASSIGNEDASSET", 'Are you sure you want to delete the assigned asset:{0}?').replace('{0}', item.Name), alerttitle, function () { + showConfirm1(GetTextByKey("P_JS_DELETEASSIGNEDASSET", 'Are you sure you want to delete the assigned asset:{0}?').replace('{0}', item.Name), alerttitle, function () { var params = [ '', jobsiteid, JSON.stringify([item.AssetId]) @@ -1794,7 +1800,9 @@ function OnSiteChanging(item, input) { var input_chk = $(input).closest('td').find('input'); - var checked = $(input_chk).prop('checked'); + var checked = !$(input_chk).prop('checked'); + if (navigator.userAgent.toUpperCase().indexOf("FIREFOX") >= 0) + checked = !checked; var text = GetTextByKey("P_JS_ONSITETIPS", "You have manually assigned a jobsite. This action will disable geofence alerts and jobsite auto-assignment. Do you want to proceed? "); if (!checked) text = GetTextByKey("P_JS_ONSITETIPS1", "Are you sure you want to change the on-site of the asset:{0}?").replace('{0}', item.Name); @@ -1830,7 +1838,7 @@ return; } - $('#mask_bg').show(); + showmaskbg(true); $('#machine-name').text(jobsiteitem.Name); _selectedMachines = jobsiteitem.Machines == null ? [] : jobsiteitem.Machines; _showSelectedMachines = jobsiteitem.Machines == null ? [] : jobsiteitem.Machines; @@ -1843,7 +1851,7 @@ .css({ 'top': (document.documentElement.clientHeight - $('#dialog_managemahchine').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_managemahchine').width()) / 2 - }).showDialog(); + }).showDialogfixed(); grid_dtsm.setData([]); $('#selectedmachinelist input[type="checkbox"]').prop('checked', false); diff --git a/Site/JobSite/AddRequirements.aspx b/Site/JobSite/AddRequirements.aspx index 1cd1a0f..009d7e1 100644 --- a/Site/JobSite/AddRequirements.aspx +++ b/Site/JobSite/AddRequirements.aspx @@ -327,24 +327,24 @@ }; function showRequirementConfirm(msg, title, fprint, femai, fsave, fclose) { - $("#mask_bg").show(); + showmaskbg(true); _dialog.showRequirementConfirm(msg, title, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof fprint === 'function') { fprint(e); } }, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof femai === 'function') { femai(e); } }, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof fsave === 'function') { fsave(e); } }, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof fclose === 'function') { fclose(e); } @@ -686,12 +686,12 @@ }) $('#dialog_sendmail').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); OnExit(); }); $('#dialog_assignment').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#sendmail_othertextaddress').focus(function (e) { diff --git a/Site/JobSite/AddScheduler.aspx b/Site/JobSite/AddScheduler.aspx index cdf965b..cf78737 100644 --- a/Site/JobSite/AddScheduler.aspx +++ b/Site/JobSite/AddScheduler.aspx @@ -249,7 +249,7 @@ var alljobsites; var addrequirement = true; var _sendType = 0; - var currentdate = "<%=CurrentDate %>"; + var currentdate = "<%=CurrentDate %>"; jobsitequery = function (method, param, callback, error, nolog) { @@ -269,19 +269,19 @@ }; function showAssetConfirm(msg, title, fcancel, fedit, fclose) { - $("#mask_bg").show(); + showmaskbg(true); _dialog.showAssetConfirm(msg, title, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof fedit === 'function') { fedit(e); } }, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof fcancel === 'function') { fcancel(e); } }, function (e) { - $("#mask_bg").hide(); + showmaskbg(false); if (typeof fclose === 'function') { fclose(e); } @@ -568,7 +568,7 @@ </td> </tr> <tr> - <td class="label" data-lgid="P_JS_POINTOFCONTACT">Point Of Contact</td> + <td class="label" data-lgid="P_JS_POINTOFCONTACT_COLON">Point Of Contact</td> <td> <input type="text" id="dialog_pointofcontact" maxlength="100" tabindex="1" autocomplete="off" /> </td> diff --git a/Site/JobSite/DispatchRequests.aspx b/Site/JobSite/DispatchRequests.aspx index 08e52f6..a7683ed 100644 --- a/Site/JobSite/DispatchRequests.aspx +++ b/Site/JobSite/DispatchRequests.aspx @@ -272,7 +272,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - //{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + //{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'BeginDate', caption: GetTextByKey("P_JS_MOVEDATE", "Move Date"), valueIndex: 'BeginDate', css: { 'width': 100, 'text-align': 'left' } }, //{ name: 'BeginDate', caption: GetTextByKey("P_JS_BEGINDATE", "Begin Date"), valueIndex: 'BeginDate', css: { 'width': 100, 'text-align': 'left' } }, //{ name: 'EndDate', caption: GetTextByKey("P_JS_ENDDATE", "End Date"), valueIndex: 'EndDate', css: { 'width': 100, 'text-align': 'left' } }, @@ -294,7 +294,7 @@ // checkbox name: 'check', key: 'Selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, diff --git a/Site/JobSite/JobSiteManage.aspx b/Site/JobSite/JobSiteManage.aspx index bbc7fc9..efffbc1 100644 --- a/Site/JobSite/JobSiteManage.aspx +++ b/Site/JobSite/JobSiteManage.aspx @@ -453,6 +453,7 @@ var dialogAssets = new $assetselector('dialog_machines'); dialogAssets.jobsiteId = jobsiteid; + dialogAssets.allowotherfilter = false; dialogAssets.onDialogClosed = function () { $("#dialogmask").hide(); $('#dialog_machines').remove(); @@ -531,7 +532,9 @@ function OnSiteChanging(item, input) { var input_chk = $(input).closest('td').find('input'); - var checked = $(input_chk).prop('checked'); + var checked = !$(input_chk).prop('checked'); + if (navigator.userAgent.toUpperCase().indexOf("FIREFOX") >= 0) + checked = !checked; var text = GetTextByKey("P_JS_ONSITETIPS", "You have manually assigned a jobsite. This action will disable geofence alerts and jobsite auto-assignment. Do you want to proceed? "); if (!checked) text = GetTextByKey("P_JS_ONSITETIPS1", "Are you sure you want to change the on-site of the asset:{0}?").replace('{0}', item.Name); diff --git a/Site/JobSite/JobSiteMasterPage.master b/Site/JobSite/JobSiteMasterPage.master index 1f37030..c9e1896 100644 --- a/Site/JobSite/JobSiteMasterPage.master +++ b/Site/JobSite/JobSiteMasterPage.master @@ -86,7 +86,6 @@ function resizeContent() { if ($('.content_main').length > 0) $('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4); - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); } $(window).resize(function () { diff --git a/Site/JobSite/JobsiteAutoCreateConfig.aspx b/Site/JobSite/JobsiteAutoCreateConfig.aspx index 496b834..4e3c753 100644 --- a/Site/JobSite/JobsiteAutoCreateConfig.aspx +++ b/Site/JobSite/JobsiteAutoCreateConfig.aspx @@ -86,7 +86,7 @@ } grid_dtassets.setData(grid_dtassets.innerSource.concat(items)); doSave(0, itemids); - $('#mask_bg').hide(); + showmaskbg(false); }; $('#dialog_assettype').prop('iframe', true).dialog(function () { @@ -148,7 +148,7 @@ // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -225,7 +225,6 @@ return s.Values.AssetId; }); dialogAUAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } function OnMachineDelete() { @@ -270,7 +269,7 @@ // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -322,7 +321,7 @@ // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -420,7 +419,7 @@ function OnAssetTypeAdd() { $('#txt_assettype_key').val(''); $('#dialog_assettype .dialog-title span.title').text(GetTextByKey("P_JS_SELECTASSETTYPES", 'Select Asset Types')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_assettype') .attr('act', 'edit') .css({ @@ -446,7 +445,6 @@ doSave(1, itemids); $('#dialog_assettype').hideDialog(); - //$('#mask_bg').hide(); } function OnAssetTypeDelete() { diff --git a/Site/JobSite/JobsiteLimitManagement.aspx b/Site/JobSite/JobsiteLimitManagement.aspx index 39699aa..0436db2 100644 --- a/Site/JobSite/JobsiteLimitManagement.aspx +++ b/Site/JobSite/JobsiteLimitManagement.aspx @@ -73,18 +73,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } @@ -244,7 +232,7 @@ } function ShowDialog(type) { - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_jobsitelimit') .attr('act', type) .showDialogRight1(450); @@ -488,7 +476,7 @@ }); $('#dialog_subscribecontacts').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#btnsubscribefilter').click(getMatchAvailableContacts); $('#chk_showallassignedcontacts').click(getMatchSelectedContacts); @@ -523,12 +511,12 @@ var title = GetTextByKey("P_M3_SUBSCRIBECONTACTS", "Subscribe Contacts"); $('#dialog_subscribecontacts .dialog-title span.title').html(title); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_subscribecontacts') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_subscribecontacts').height()) / 5, 'left': (document.documentElement.clientWidth - $('#dialog_subscribecontacts').width()) / 2 - }).showDialog(); + }).showDialogfixed(); GetSelectedContacts(); } @@ -841,9 +829,6 @@ </div> <div class="dialog" id="dialog_subscribecontacts" style="display: none;"> - <div id="subscribedialogmask" class="maskbg" style="display: none; z-index: 1;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="dialog-title"><span class="title" data-lgid="P_M3_SUBSCRIBECONTACTS">Subscribe Contacts</span><em class="dialog-close"></em></div> <div class="machine_filter"> @@ -886,6 +871,9 @@ <input type="button" onclick="OnSaveSubscribeContacts();" value="OK" data-lgid="P_M3_OK" tabindex="46" /> <div class="clear"></div> </div> + <div id="subscribedialogmask" class="maskbg" style="display: none; "> + <div class="loading_icon icon c-spin"></div> + </div> </div> </div> </asp:Content> diff --git a/Site/JobSite/js/dispatchassign.js b/Site/JobSite/js/dispatchassign.js index 93ff088..fc87e1e 100644 --- a/Site/JobSite/js/dispatchassign.js +++ b/Site/JobSite/js/dispatchassign.js @@ -41,7 +41,6 @@ function openAssignDispatch(seltype,) { editableSelectAssignAsset.val(''); showmaskbg(true); $('#dialog_assignment .dialog-title span.title').text(GetTextByKey('P_JS_DISPATCHASSIGNMENT', 'Dispatch Assignment')); - //$('#mask_bg').show(); $('#dialog_assignment') .attr('act', 'edit') .css({ diff --git a/Site/JobSite/js/email.js b/Site/JobSite/js/email.js index b8ed006..af42a57 100644 --- a/Site/JobSite/js/email.js +++ b/Site/JobSite/js/email.js @@ -34,7 +34,7 @@ function InitEmailGridData() { { name: 'DisplayName', caption: GetTextByKey("P_MV_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 148, 'text-align': 'left' } }, { name: 'ContactTypeName', caption: GetTextByKey("P_MV_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 148, 'text-align': 'left' } }, //{ name: 'Text', caption: GetTextByKey("P_MV_TEXT", "Text"), valueIndex: 'Text', type: 3, css: { 'width': 45, 'text-align': 'center' } }, - { name: 'Email', caption: GetTextByKey("P_MV_EMAIL", "Email"), valueIndex: 'Email', type: 3, css: { 'width': 45, 'text-align': 'center' } } + { name: 'Email', caption: GetTextByKey("P_MV_EMAIL", "Email"), valueIndex: 'Email', type: 3, css: { 'width': 60, 'text-align': 'center' } } ]; var columns = []; // head @@ -189,7 +189,7 @@ function onSendEmails() { if (emailaddress.length == 0 && textaddress.length == 0) { $('#dialog_sendmail').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); return; } var item = { @@ -204,7 +204,7 @@ function onSendEmails() { jobsitequery('SendEmails', htmlencode(JSON.stringify(item)), function (data) { if (_sendType == 0) { $('#dialog_sendmail').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); OnExit(data); } else { @@ -214,7 +214,7 @@ function onSendEmails() { showAlert(GetTextByKey("P_WO_MESSAGESENT", 'Message sent'), alerttitle); $('#dialog_sendmail').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); } if (aftersend) diff --git a/Site/JobSite/js/jobsiterequirement.js b/Site/JobSite/js/jobsiterequirement.js index 2aadfdd..02a7f3a 100644 --- a/Site/JobSite/js/jobsiterequirement.js +++ b/Site/JobSite/js/jobsiterequirement.js @@ -416,7 +416,7 @@ function InitAssetGridData() { reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, allcheck: true, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, allcheck: true, css: { 'width': 45, 'text-align': 'center' } }, { name: 'MakeName', caption: GetTextByKey("P_PM_MAKE", "Make"), valueIndex: 'MakeName', css: { 'width': 100, 'text-align': 'left' } }, { name: 'ModelName', caption: GetTextByKey("P_PM_MODEL", "Model"), valueIndex: 'ModelName', css: { 'width': 100, 'text-align': 'left' } }, { name: 'AssetName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 150, 'text-align': 'left' } }, @@ -598,7 +598,7 @@ function InitAllAssetGridData() { reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'MakeName', caption: GetTextByKey("P_PM_MAKE", "Make"), valueIndex: 'MakeName', css: { 'width': 100, 'text-align': 'left' } }, { name: 'ModelName', caption: GetTextByKey("P_PM_MODEL", "Model"), valueIndex: 'ModelName', css: { 'width': 100, 'text-align': 'left' } }, { name: 'AssetName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 150, 'text-align': 'left' } }, @@ -874,7 +874,7 @@ function OnSetMachine() { currentRequirement.Assets = assets; currentRequirement.ScheduledQuantity = assets.length; $('#dialog_managemahchine').hide(); - $("#mask_bg").hide(); + showmaskbg(false); } function checkQuantity() { diff --git a/Site/JobSite/js/scheduler.js b/Site/JobSite/js/scheduler.js index c445f09..260f555 100644 --- a/Site/JobSite/js/scheduler.js +++ b/Site/JobSite/js/scheduler.js @@ -490,7 +490,7 @@ function checkSchedulerItems(alerttitle) { function onUpdateScheduler() { if (jobsiteschedulerCtrl.vue.source.length == 0) { $('#dialog_managescheduler').hide(); - $('#mask_bg').hide(); + showmaskbg(false); OnRefresh(); return; } diff --git a/Site/Languages/en-au/textres.xml b/Site/Languages/en-au/textres.xml index 1c62dbd..cf10e63 100644 --- a/Site/Languages/en-au/textres.xml +++ b/Site/Languages/en-au/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="en-us" ver="2021-03-18 11:06"> +<root lgid="en-us" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>Clear Local Storage</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>Are you sure to clear the local storage?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>Please check whether the user ID already exists in another FI product.</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -455,6 +455,8 @@ <FI_FRS_BCL097>YTD Static</FI_FRS_BCL097> <FI_FRS_BCL098>R12 Static</FI_FRS_BCL098> <FI_FRS_BCL099>Set Value</FI_FRS_BCL099> + <FI_FRS_BCL100>Set Department And Location Region Percentages </FI_FRS_BCL100> + <FI_FRS_BCL101>The department/region allocation percentage is not set.</FI_FRS_BCL101> <FI_FRS_BGT001>The Budget Name or Ledger ID already exists.</FI_FRS_BGT001> <FI_FRS_BGT002>This Budget Version already exists.</FI_FRS_BGT002> <FI_FRS_BGT003>This data source is in use and cannot be deleted.</FI_FRS_BGT003> @@ -674,6 +676,8 @@ <FI_FRS_C0054>Connector Settings</FI_FRS_C0054> <FI_FRS_C0055>Connection</FI_FRS_C0055> <FI_FRS_C0056>Use Excel Connector</FI_FRS_C0056> + <FI_FRS_C0057>Export Budget Package</FI_FRS_C0057> + <FI_FRS_C0058>Import Budget Package</FI_FRS_C0058> <FI_FRS_CC001>Manage Constants</FI_FRS_CC001> <FI_FRS_CC002>Name</FI_FRS_CC002> <FI_FRS_CC003>Description</FI_FRS_CC003> @@ -803,6 +807,10 @@ <FI_FRS_IMPKG024>Lock password:</FI_FRS_IMPKG024> <FI_FRS_IMPKG025>Confirm lock password:</FI_FRS_IMPKG025> <FI_FRS_IMPKG026>Passwords do not match.</FI_FRS_IMPKG026> + <FI_FRS_IMPKG027>Available Budgets</FI_FRS_IMPKG027> + <FI_FRS_IMPKG028>Please select budgets to export.</FI_FRS_IMPKG028> + <FI_FRS_IMPKG029>Replace the budget.</FI_FRS_IMPKG029> + <FI_FRS_IMPKG030>Options for locking budgets</FI_FRS_IMPKG030> <FI_FRS_LD001>Default Row Level Definitions</FI_FRS_LD001> <FI_FRS_LD002>Level Description</FI_FRS_LD002> <FI_FRS_LD003>Level</FI_FRS_LD003> @@ -918,6 +926,7 @@ <FI_FRS_MPG035>New Budget</FI_FRS_MPG035> <FI_FRS_MPG036>Dashboard</FI_FRS_MPG036> <FI_FRS_MPG037>FI Common</FI_FRS_MPG037> + <FI_FRS_MPG038>Enter Region Data</FI_FRS_MPG038> <FI_FRS_PG0001>Login failed. Please retry.</FI_FRS_PG0001> <FI_FRS_PG0002>Please Login</FI_FRS_PG0002> <FI_FRS_PG0003>User ID:</FI_FRS_PG0003> @@ -1300,6 +1309,7 @@ <FI_HOST_EXT_A011>Import Application File</FI_HOST_EXT_A011> <FI_HOST_MANAGEMENT_USER_A002>Save Permissions</FI_HOST_MANAGEMENT_USER_A002> <FI_HOST_MANAGEMENT_USER_A005>Define Style</FI_HOST_MANAGEMENT_USER_A005> + <FI_HOST_MANAGEMENT_USER_A006>Email Verification</FI_HOST_MANAGEMENT_USER_A006> <FI_HOST_MANAGEMENT_USER_A008>Saved permissions successfully.</FI_HOST_MANAGEMENT_USER_A008> <FI_HOST_MANAGEMENT_USER_A009>Failed to save the user operation.</FI_HOST_MANAGEMENT_USER_A009> <FI_HOST_MANAGEMENT_USER_A043>User Management</FI_HOST_MANAGEMENT_USER_A043> @@ -1312,6 +1322,7 @@ <FI_HOST_MANAGEMENT_USER_A113>One or more user(s) will be deleted from FRS, Do you want to continue?</FI_HOST_MANAGEMENT_USER_A113> <FI_HOST_MANAGEMENT_USER_A114>Maintenance of Application Plug In</FI_HOST_MANAGEMENT_USER_A114> <FI_HOST_MANAGEMENT_USER_A115>Use of Application Plug In</FI_HOST_MANAGEMENT_USER_A115> + <FI_HOST_MANAGEMENT_USER_A116>Copy User</FI_HOST_MANAGEMENT_USER_A116> <FICTIP>Foresight Intelligence Center: Full Version</FICTIP> <FULL_SCREEN>Full Screen</FULL_SCREEN> <G5_FORGOTPWD>Forgot your password? Click <a href="{0}">here</a> to send a reminder email.</G5_FORGOTPWD> @@ -1543,7 +1554,7 @@ <LHBIS_EXCEPTION_E0X6502701B>An error occurred while searching for users in the system.</LHBIS_EXCEPTION_E0X6502701B> <LHBIS_EXCEPTION_E0X6502701C>Failed to get the authenticated user list.</LHBIS_EXCEPTION_E0X6502701C> <LHBIS_EXCEPTION_E0X6502701D>Failed to get the users list.</LHBIS_EXCEPTION_E0X6502701D> - <LHBIS_EXCEPTION_E0X6502701E>The user ID has been used by another user.</LHBIS_EXCEPTION_E0X6502701E> + <LHBIS_EXCEPTION_E0X6502701E>The user ID or email address has been used by another user.</LHBIS_EXCEPTION_E0X6502701E> <LHBIS_EXCEPTION_E0X6502701F>Failed to add the user.</LHBIS_EXCEPTION_E0X6502701F> <LHBIS_EXCEPTION_E0X65027020>Failed to save the user.</LHBIS_EXCEPTION_E0X65027020> <LHBIS_EXCEPTION_E0X65027021>Failed to delete the user.</LHBIS_EXCEPTION_E0X65027021> @@ -2077,6 +2088,8 @@ <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A012>The Refresh Time(s)'s value must be between 30 and 100,000 seconds.</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A012> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A013>Display Create Time</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A013> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A001>Chart Notes:</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A001> + <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A002>Internal Chart Notes:</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A002> + <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A003>Internal Chart Notes</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A003> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A001>Type</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A001> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A002>Group</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A002> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A003>Level</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A003> @@ -2457,6 +2470,10 @@ <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A118>My Database Detail</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A118> <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A119>Tables</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A119> <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A120>Views</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A120> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A121>Data Table Cache</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A121> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A122>Data replication</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A122> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A123>SQL Queries</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A123> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A124>Schedules</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A124> <LHBIS_FIC_CLIENT_MODULES_A001>User Management</LHBIS_FIC_CLIENT_MODULES_A001> <LHBIS_FIC_CLIENT_MODULES_A002>Add User</LHBIS_FIC_CLIENT_MODULES_A002> <LHBIS_FIC_CLIENT_MODULES_A003>Import User</LHBIS_FIC_CLIENT_MODULES_A003> @@ -3012,6 +3029,17 @@ <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A140>Please input the excel file name.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A140> <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A141>Execution Timeout Expired. Would you like to retry it?</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A141> <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A142>File extension required.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A142> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A143>Please enter a Cache Data Table Name.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A143> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A144>Index Name</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A144> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A145>Fields</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A145> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A146>Use Local Cache:</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A146> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A147>Cache Data Table Name:</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A147> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A148>Indexes</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A148> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A149>Index names cannot be duplicate.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A149> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A150>Data Table Cache</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A150> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A151>The Cache Data Table name {0} already exists.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A151> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A152>Cache Name</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A152> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A153>Please name the filter.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A153> <LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A001>Add</LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A001> <LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A002>Delete</LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A002> <LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A003>Refresh</LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A003> @@ -3253,6 +3281,8 @@ <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A016>Saturday</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A016> <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A017>Sunday</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A017> <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A018>End of Month</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A018> + <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A019>Annually</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A019> + <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A020>Month</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A020> <LHBIS_FIC_CLIENT_MODULES_JOBDETAILMODULE_A001>Job Detail</LHBIS_FIC_CLIENT_MODULES_JOBDETAILMODULE_A001> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A001>Job List</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A001> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A002>Add</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A002> @@ -3266,6 +3296,9 @@ <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A010>Execute failed.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A010> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A011>Save</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A011> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A012>Jobs executed successfully.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A012> + <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A013>Execute</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A013> + <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A014>Are you sure want to execute the sql queries?</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A014> + <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A015>Sql Query executed successfully.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A015> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A001>An error occurred while getting the Job Schedule list.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A001> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A002>An error occurred while getting the Job Schedule information.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A002> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A003>An error occurred while modifying the Job Schedule information.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A003> @@ -3282,6 +3315,24 @@ <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A007>The daily frequency's "ending time" value is invalid. This can be left empty.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A007> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A008>The Job Name cannot be empty.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A008> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A009>Monthly Everyday Count is out of range. (1-31)</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A009> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A001><!DOCTYPE html><html><head><meta content=""text/html; charset=UTF-8"" http-equiv=""content-type""> +<style type=""text/css"">p{{font-family:Calibri,Tahoma,Verdana;color:black;}}</style></head> +<body><table><tr><td><p>An account has been established for you by {0}. Your password is <b>{1}</b></p> +<p>This password is a temporary password, please log on <a href='{2}'>Here</a>&nbsp;to change your password. If you have any questions, please contact us.</p> +<p>Regards,<br /> +{0}</p></td></tr></table></body></html></LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A001> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A002><!DOCTYPE html><html><head><meta content=""text/html; charset=UTF-8"" http-equiv=""content-type""> +<style type=""text/css"">p{{font-family:Calibri,Tahoma,Verdana;color:black;}}</style></head> +<body><table><tr><td><p>An account has been established for you by {0}. Your ID is <b>{1}</b></p> +<p>Another email with your temporary password will be sent under separate email. If you have any questions, please contact us.</p> +<p>Regards,<br /> +{0}</p></td></tr></table></body></html></LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A002> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A003>New Alert:</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A003> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A004>Alert Name: </LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A004> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A005>Create Time: </LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A005> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A006>Alert Content:</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A006> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A007>{0} User ID</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A007> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A008>{0} Password</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A008> <LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A001>Navigation Definitions</LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A001> <LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A002>Navigation Name</LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A002> <LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A003>Single window mode</LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A003> @@ -3345,6 +3396,9 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A016>Schedule</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A016> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>Note: Labels of values where the percentage is less than 1 may not be shown.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>Attachments</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>Resend</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>The execute starting time must be early than the ending time.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>Resend Email Subscription</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>Group:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>Level:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A003>Email:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A003> @@ -3367,6 +3421,8 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A020>The text message address is invalid.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A021>Do you still want to save?</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A021> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A022>The email is blank.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A022> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A023>This user does not have Data Table Access Rights to view this chart. Would you like to continue?</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A023> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A024>Only send if Chart has data</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A024> <LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A001>Workspace Name</LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A002>Description</LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A002> <LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A003>Group Name</LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A003> @@ -3663,6 +3719,7 @@ <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A073>Tonne</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A073> <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A074>Pound</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A074> <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A075>Ton (U.S.)</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A075> + <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A076>Always prompt</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A076> <LHBIS_FIC_CLIENT_MODULES_TASKLOG_A001>Task schedule logs</LHBIS_FIC_CLIENT_MODULES_TASKLOG_A001> <LHBIS_FIC_CLIENT_MODULES_TASKLOG_A002>Delete</LHBIS_FIC_CLIENT_MODULES_TASKLOG_A002> <LHBIS_FIC_CLIENT_MODULES_TASKLOG_A003>Delete All</LHBIS_FIC_CLIENT_MODULES_TASKLOG_A003> @@ -3816,6 +3873,9 @@ <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A072>Linked To Azure</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A072> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A073>Are you sure you want to Clear this?</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A073> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A074>Link To Local User</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A074> + <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A075>Language</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A075> + <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A076>Email Verification</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A076> + <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A077>Azure user</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A077> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B007>User ID</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B007> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B008>User Name</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B008> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B009>User Level</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B009> @@ -4097,6 +4157,7 @@ <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A094>Overwrite Top Records</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A094> <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A095>Chart Color Scheme Name</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A095> <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A096>Chart Color Scheme</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A096> + <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A097>SQL Query</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A097> <LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A001>Please enter the Publisher.</LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A001> <LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A002>Please enter the Name.</LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A002> <LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A003>Please enter the Password.</LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A003> @@ -4673,6 +4734,9 @@ <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A410>Pound</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A410> <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A411>Ton (U.S.)</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A411> <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A412>Pivot Enabled</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A412> + <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A413>Count Distinct</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A413> + <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A414>Chart Title:</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A414> + <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A415>Filter And DataSources</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A415> <LHBIS_FIC_CLIENT_WSP_A001>Each of the parameters, @cy and @cm, can only be used once in a chart.</LHBIS_FIC_CLIENT_WSP_A001> <LHBIS_FIC_DATAMODEL_COMMON_A001>Language resource 1</LHBIS_FIC_DATAMODEL_COMMON_A001> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A001>Please install Silverlight 5.0</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A001> @@ -4737,6 +4801,12 @@ <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A16>The SilverLight Isolated Storage space is not large enough.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A16> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A17>You are currently logged in on another computer. If you log in here, the other session will be disconnected. Would you like to proceed?</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A17> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A18>Forgot Password</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A18> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A19>Two-Factor Authentication:</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A19> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A20>An Email with a verification code has been sent to: {0}. Please enter the code to continue.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A20> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A22>An incorrect verification code has been entered. Please try again.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A22> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A23>Below is the one-time code for logging into your account.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A23> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A24>Your one-time code: {0}</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A24> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A25>Valid for : 10 min</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A25> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_B001>Language:</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_B001> <LHBIS_FIC_SILVERLIGHT_WSP_ERROR_A001>Get the list of data table errors.</LHBIS_FIC_SILVERLIGHT_WSP_ERROR_A001> <LHBIS_FIC_SILVERLIGHT_WSP_INOTIFYCHANGED_A001>At least one chart has been changed in the current board.</LHBIS_FIC_SILVERLIGHT_WSP_INOTIFYCHANGED_A001> @@ -4774,6 +4844,7 @@ <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A027>Language</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A027> <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A028>Copy Cell</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A028> <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A029>Copy Row</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A029> + <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A030>Refresh Board Cached Data</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A030> <LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A001>Logout</LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A001> <LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A002>Add Board</LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A002> <LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A003>Board</LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A003> diff --git a/Site/Languages/en-us/textres.xml b/Site/Languages/en-us/textres.xml index 3d46982..cf10e63 100644 --- a/Site/Languages/en-us/textres.xml +++ b/Site/Languages/en-us/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="en-us" ver="2022-10-21 09:56"> +<root lgid="en-us" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>Clear Local Storage</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>Are you sure to clear the local storage?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>Please check whether the user ID already exists in another FI product.</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -3397,6 +3397,7 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>Note: Labels of values where the percentage is less than 1 may not be shown.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>Attachments</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>Resend</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>The execute starting time must be early than the ending time.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>Resend Email Subscription</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>Group:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>Level:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> diff --git a/Site/Languages/es.json b/Site/Languages/es.json new file mode 100644 index 0000000..8ca8af6 --- /dev/null +++ b/Site/Languages/es.json @@ -0,0 +1 @@ +{"Ver":2303291343,"LanguageId":"en","Values":{"P_MAIN_FEATURES":"Features","P_MAIN_DASHBOARDS":"Dashboards","P_MAIN_POWEREDBY":"Powered By","P_MAIN_VERSION_COLON":"Version: ","P_MAIN_FICVERSION_COLON":"FIC Version: ","P_MAIN_GOTOHOMEPAGE":"Go to Homepage","P_MAIN_SYSTEMSETTINGS":"System Settings","P_MAIN_SETTINGS":"Settings","P_MAIN_FULLMENU":"Full Menu","P_MAIN_HOME":"Home","P_MAIN_FAVORITE":"Favorite","P_MAIN_ADDFAVORITE":"Add Favorite","P_MAIN_REPORTSDASHBOARDS":"Reports & Dashboards","P_MAIN_CHARTSANDNOTES":"Charts & Notes","P_MAIN_CHARTSONLY":"Charts Only","P_MAIN_NOTESONLY":"Notes Only","P_MAIN_CHARTNOTES":"Chart Notes","P_MAIN_CHANGEPASSWORD":"Change Password","P_MAIN_WELCOME":"Welcome, ","P_MAIN_LOGOUT":"Logout","P_MAIN_CLOSE":"Close","P_MAIN_REMOVE":"Remove","P_MAIN_MARKASREAD":"Mark as read","P_MAIN_MESSAGES":"Messages","P_MAIN_DELETEMESSAGES":"Delete Messages","P_MAIN_DOYOUWANTTODELETETHEMESSAGE":"Do you want to delete the message?","P_MAIN_DOYOUWANTTODELETESELECTEDMESSAGES":"Do you want to delete selected message(s)?","P_MAIN_SELECTALL":"Select All","P_MAIN_UPLOADAVATAR":"Upload avatar","P_MAIN_FAILEDTOUPLOADAVATAR":"Failed to upload avatar.","P_SELECTASSETS":"Select Assets","P_SELECTASSETS_VIN":"VIN","P_SELECTASSETS_NAME":"Name","P_SELECTASSETS_CURRENTSTATE":"Current State","P_SELECTASSETS_SUGGESTED":"SUGGESTED","P_SELECTASSETS_UNASSIGNED":"UNASSIGNED","P_SELECTASSETS_DISTANCEFROMSITE":"Distance From Site","P_SELECTASSETS_UNITS":"Units","P_SELECTASSETS_MAKE":"Make","P_SELECTASSETS_MODEL":"Model","P_SELECTASSETS_TYPE":"Type","P_SELECTASSETS_SEARCH":"Search","P_SELECTASSETS_SHOWHIDDEN":"Show Hidden","P_SELECTASSETS_OK":"OK","P_SELECTASSETS_CANCEL":"Cancel","P_SELECTASSETS_FAILEDGETLIST":"Failed to get the machine list:","P_SELECTASSETS_FAILEDGETLIST1":"Failed to get the machine list.","P_SELECTASSETS_SELECTASSET":"Please select an Asset.","P_UTILITY_YES":"Yes","P_UTILITY_NO":"No","P_UTILITY_OK":"OK","P_UTILITY_CANCEL":"Cancel","P_UTILITY_ADDNEWRENTALINSTANCE":"Add New Rental Instance","P_UTILITY_EDITSELECTEDRENTAL":"Edit Selected Rental","P_UTILITY_EXPORTTOEXCEL":"Export to Excel","P_MAP_IMAGERY":"Imagery","P_MAP_STREETS":"Streets","P_MAP_TOPOGRAPHIC":"Topographic","P_SELECT_ALL":"All","P_GRID_ALL":"(All)","P_GRID_OK":"OK","P_GRID_CANCEL":"Cancel","P_GRID_RESET":"Reset","P_GRID_COLUMN":"Column","P_GRID_CAPTION":"Caption","P_GRID_SELECTCOLUMNS":"Select Columns","P_GRID_PLEASESELECTATLEASTONECOLUMN":"Please select at least one column.","P_GRID_SAVECURRENTLAYOUTASSITEDEFAULT":"Save Current Layout as Company Default","P_GRID_REVERTTOSITEDEFAULTLAYOUT":"Revert to Company Default Layout","P_GRID_WOULDYOULIKETO_COLON":"Would you like to:","P_GRID_SITEDEFAULTLAYOUT":"Company Default Layout","P_SPECTRUM_CLEARCOLORSELECTION":"Clear Color Selection","P_SPECTRUM_NOCOLORSELECTED":"No Color Selected","P_DASHBOARDS_NAME":"Name","P_DASHBOARDS_TYPE":"Type","P_DASHBOARDS_CHARTTYPE":"Chart Type","P_DASHBOARDS_NOTES":"Notes","P_DASHBOARDS_SELECTWSPORCHART":"Please select a Workspace or Chart.","P_APPMODULES":"AppModules","P_MODULE_GETAPPMODULES":"Get AppModules","P_MODULE_MAPVIEW":"Map View","P_MODULE_JOBSITES":"Jobsites","P_MODULE_ASSETHEALTH":"Asset Health","P_MODULE_FILTERQ":"FilterQ","P_MODULE_CREDENTIALS":"Credentials","P_MODULE_SECURITYSETTING":"Security Setting","P_MODULE_MANAGEASSETS":"Manage Assets","P_MODULE_FICMANAGEMENT":"FIC Management","P_MODULE_M3":"M3","P_MODULE_OVERUNDERTRUCKINGALERTS":"Over/Under Trucking Alerts","P_MODULE_OTRCONFIG":"OTR Config","P_MODULE_INSPECTIONTEMPLATES":"Inspection Templates","P_MODULE_INSPECTION":"Inspection","P_MODULE_TEAMINTELLIGENCE":"Team Intelligence","P_FEATURE_MAPVIEW":"Map View","P_FEATURE_JOBSITES":"Jobsites","P_FEATURE_AUTOCREATIONCONFIG":"Auto-Creation Config","P_FEATURE_JOBSITEREQUIREMENTS":"Jobsite Requirements","P_FEATURE_DISPATCHREQUESTS":"Dispatch Requests","P_FEATURE_SCHEDULER":"Scheduler","P_FEATURE_ALERTSMANAGEMENT":"Alerts Management","P_FEATURE_WORKORDER":"Work Order","P_FEATURE_PREVENTATIVEMAINTENANCEPLAN":"Preventative Maintenance Plan","P_FEATURE_FILTERQ":"FilterQ","P_FEATURE_FUELRECORDS":"Fuel Records","P_FEATURE_CREDENTIALS":"Credentials","P_FEATURE_JDLINK":"JD Link","P_FEATURE_JOHNDEERENOTIFICATIONS":"JohnDeere Notifications","P_FEATURE_USERS":"Users","P_FEATURE_CURFEWCONFIGURATION":"Curfew Configuration","P_FEATURE_MANAGEASSETS":"Manage Assets","P_FEATURE_ASSETPAIRING":"Asset Pairing","P_FEATURE_ASSETATTRIBUTEADJUSTMENTS":"Asset Attribute Adjustments","P_FEATURE_ASSETGROUPS":"Asset Groups","P_FEATURE_FICMANAGEMENT":"FIC Management","P_FEATURE_M3":"M3","P_FEATURE_OVERUNDERTRUCKINGALERTS":"Over/Under Trucking Alerts","P_FEATURE_MANAGEHARSHDRIVING":"Manage Harsh Driving","P_FEATURE_MANAGETEMPLATES":"Manage Templates","P_FEATURE_INSPECTIONREPORTS":"Inspection Reports","P_FEATURE_WORKORDERCONFIGURATION":"Work Order Configuration","P_FEATURE_COMMUNICATEWITHCUSTOMER":"Communicate with Customer","P_FEATURE_CUSTOMERRECORD":"Customer Record","P_FEATURE_REOPENWORKORDERS":"Reopen Work Orders","P_FEATURE_WORKORDERSURVEYS":"Work Order Surveys","P_FEATURE_REASSIGNWORKORDERS":"(Re)Assign Work Orders","P_FEATURE_WORKORDERGENERATOR":"Work Order Generator","P_JOBSITES":"Jobsites","P_JOBSITE":"Jobsite","P_JS_PAGEERROR":"An unknown error occurred. Please refresh page.","P_JS_ADD":"Add","P_JS_EDIT":"Edit","P_JS_DELETE":"Delete","P_JS_REFRESH":"Refresh","P_JS_CLOSE":"Close","P_MR_LAYOUT":"Layout","P_JS_GENERAL":"General","P_JS_CONTACTINFORMATION":"Contact Information","P_JS_ACTIVEDATES":"Active Dates","P_JS_NAME":"Name","P_JS_NAME_COLON":"Name:","P_JS_NAMECUSTOM_COLON":"Name (Custom):","P_JS_SN_COLON":"SN:","P_JS_CODE":"Code","P_JS_CODE_COLON":"Code:","P_JS_TYPE":"Type","P_JS_ACTIVESITESONLY":"Active Sites Only","P_JS_TYPE_COLON":"Type:","P_JS_REGION":"Region","P_JS_REGION_COLON":"Region:","P_JS_NUMBER":"Number","P_JS_NUMBER_COLON":"Number:","P_JS_FOREMAN":"Foreman","P_JS_FOREMAN_COLON":"Foreman:","P_JS_MANAGER":"Manager","P_JS_MANAGER_COLON":"Manager:","P_JS_PHONE":"Phone","P_JS_PHONE_COLON":"Phone:","P_JS_EMAIL":"Email","P_JS_EMAIL_COLON":"Email:","P_JS_GROUP":"Group","P_JS_GROUP_COLON":"Group:","P_JS_DELIVERYADDRESS1":"Delivery Address 1","P_JS_DELIVERYADDRESS1_COLON":"Delivery Address 1:","P_JS_DELIVERYADDRESS2":"Delivery Address 2","P_JS_DELIVERYADDRESS2_COLON":"Delivery Address 2:","P_JS_CITY":"City","P_JS_CITY_COLON":"City:","P_JS_STATE":"State","P_JS_STATE_COLON":"State:","P_JS_ZIP":"Zip","P_JS_ZIP_COLON":"Zip:","P_JS_COUNTY":"County","P_JS_COUNTY_COLON":"County:","P_JS_NOTES":"Notes","P_JS_NOTES_COLON":"Notes:","P_JS_TYPES":"Types","P_JS_FUEL":"Fuel","P_JS_LOADING":"Loading","P_JS_DUMPING":"Dumping","P_JS_PAVING":"Paving","P_JS_PARKING":"Parking","P_JS_BINDINGASSET_COLON":"Binding to the Asset:","P_JS_LONGITUDE":"Longitude","P_JS_LONGITUDE_COLON":"Longitude:","P_JS_LATITUDE":"Latitude","P_JS_LATITUDE_COLON":"Latitude:","P_JS_COLOR":"Color","P_JS_COLOR_COLON":"Color:","P_JS_RADIUS":"Radius","P_JS_RADIUS_COLON":"Radius:","P_JS_RADIUSUOM":"Radius UOM","P_JS_RADIUSUOM_COLON":"Radius UOM:","P_JS_MILE":"Mile","P_JS_KILOMETER":"Kilometer","P_JS_STATDATE":"Start Date","P_JS_STATDATE_COLON":"Start Date:","P_JS_MANAGEASSETS":"Manage Assets","P_JS_ONSITE":"On Site","P_JS_ASSETNAME":"Asset Name","P_JS_MAKE":"Make","P_JS_MAKE_COLON":"Make:","P_JS_MODEL":"Model","P_JS_MODEL_COLON":"Model:","P_JS_ASSETASSIGNMENT":"Asset Assignment","P_JS_OK":"OK","P_JS_CANCEL":"Cancel","P_JS_DELETEASSIGNEDASSET":"Are you sure you want to delete the assigned asset:{0}?","P_JS_ONSITECHANGE":"On Site Change","P_JS_ONSITETIPS":"You have manually assigned a jobsite. This action will disable geofence alerts and jobsite auto-assignment. Do you want to proceed? ","P_JS_ONSITETIPS1":"Are you sure you want to change the on-site of the asset:{0}?","P_JS_FAILEDTODELETE":"Failed to delete this {0}.","P_JS_SAVEJSASSETS":"Save Jobsite Assets","P_JS_SAVE":"Save","P_JS_SAVE1":"Save and Exit","P_JS_SAVE2":"Exit Without Saving","P_JS_JOBSITEINFORMATION":"Jobsite Information","P_JS_DISPLAYASSETS":"Display Assets","P_JS_DISPLAYIMAGESICONS":"Display Images and Icons","P_JS_IMPORTSHAPEFILE":"Import Shape File","P_JS_DRAWJOBSITE":"Draw Jobsite","P_JS_CLEARDRAWN":"Clear Drawn","P_JS_EDITJOBSITE":"Edit Jobsite","P_JS_ADDJOBSITE":"Add Jobsite","P_JS_SAVEJOBSITEFIRST":"Please save jobsite first.","P_JS_JOBSITENAMEEMPTY":"Jobsite name cannot be empty.","P_JS_LATITUDEISINVALID":"Latitude is invalid.","P_JS_LATITUDEISINVALID1":"Latitude must be less than 90 and greater than -90.","P_JS_LONGITUDEISINVALID":"Longitude is invalid.","P_JS_LONGITUDEISINVALID1":"Longitude must be less than 180 and greater than -180.","P_JS_COLOREMPTY":"Color cannot be empty.","P_JS_PLEASEDRAWPOLYGON":"Please draw a polygon.","P_JS_VALIDRADIUSORDRAWPOLYGON":"Please input a valid radius or draw a polygon.","P_JS_ENTERSTARTDATE":"Please enter a Start Date.","P_JS_STARTDATEFORMATERROR":"Start Date format error.","P_JS_ENDDATEFORMATERROR":"End Date format error.","P_JS_ENDDATEFORMATERROR1":"End Date must be later than Start Date.","P_JS_FAILEDTOSAVE":"Failed to save jobsite.","P_JS_WARNING":"Warning","P_JS_WARNINGTIPS":"Warning: Interaction with jobsites bound to Assets (Mobile Jobsites) is limited to Assets utilizing Foresight Devices or FI Tracker.","P_JS_IMPORTSHAPEFILETIPS":"No polygon found in the uploaded file.","P_JS_USERHAVEANYDATAAVAILABLEONTHEMAP":"This user(s) will no longer have any data available on the map:","P_JS_REMOVEHOBSITETIPS":"If you proceed and remove this jobsite all historical data attached to this jobsite will be removed.","P_JS_WOULDYOULIKETOCONTINUE":"Would you like to continue?","P_JS_DELETEJOBSITE":"Delete Jobsite","P_JS_FAILEDTODELETETHISJOBSITE":"Failed to delete this jobsite.","P_JS_FAILEDTOSAVETHISJOBSITE":"Failed to save jobsite assets.","P_JS_SAVSUCCESSFULLY":"Saved successfully.","P_JS_EMAILISNOTAVALIDEMAILADDRESS":"The email address is invalid.","P_JS_IMPORT":"Import","P_JS_ASSETSCHEDULINGANDDISPATCHING":"Asset Scheduling and Dispatching","P_JS_CONFIGURATION":"Configuration","P_JS_RESETLAYOUT":"Reset Layout","P_JS_AREYOUSUREYOUWANTTORESETTHELAYOUT":"Are you sure you want to reset the layout?","P_JS_JOBSITESIMPORTEDSUCCESSFULLY":" jobsite(s) imported successfully.","P_JS_IMPORTJOBSITESFIELDMAPPING":"Import Jobsites Field Mapping","P_JS_JOBSITEREQUIREMENTS":"Jobsite Requirements","P_JS_UNSCHEDULEDREQUIREMENTSONLY":"Unscheduled Requirements Only","P_JS_LATESTSTARTDATE_COLON":"Latest Start Date:","P_JS_BEGINDATE":"Begin Date","P_JS_BEGINDATE_COLON":"Begin Date:","P_JS_ENDDATE":"End Date","P_JS_ENDDATE_COLON":"End Date:","P_JS_ASSETTYPE":"Asset Type","P_JS_ASSETTYPE_COLON":"Asset Type:","P_JS_QUANTITY":"Quantity","P_JS_QUANTITY_COLON":"Quantity:","P_JS_NUMBEROFDAYS":"Number of Days","P_JS_NUMBEROFDAYS_COLON":"Number of Days:","P_JS_POINTOFCONTACT":"Point Of Contact","P_JS_POINTOFCONTACT_COLON":"Point Of Contact:","P_JS_CONTACT_COLON":"Contact:","P_JS_ASSIGNEDTO":"Assigned To","P_JS_ASSIGNEDTO_COLON":"Assigned To:","P_JS_CREATOR":"Creator","P_JS_CREATOR_COLON":"Creator:","P_JS_FULFILLEDBY":"Fulfilled By","P_JS_JOBSITE_COLON":"Jobsite:","P_JS_JOBSITES_COLON":"Jobsites:","P_JS_CURRJOBSITE":"Current Jobsite","P_JS_DISTANCEFROMJOBSITE":"Distance from Jobsite","P_JS_ASSETGROUP":"Asset Group","P_JS_ENGINEHOURS":"Engine Hours","P_JS_ACQUISITIONTYPE":"Acquisition Type","P_JS_MOVEDATE":"Move Date","P_JS_MOVEDATE_COLON":"Move Date:","P_JS_FROMJOBSITE":"From Jobsite","P_JS_FROMJOBSITE_COLON":"From Jobsite:","P_JS_TOJOBSITE":"To Jobsite","P_JS_TOJOBSITE_COLON":"To Jobsite:","P_JS_MARKCOMPLETE":"Mark Complete","P_JS_COMPLETEDATE":"Complete Date","P_JS_DELETEREQUIREMENT":"Delete Requirement","P_JS_DELETETHEREQUIREMENT":"Would you like to delete the requirement?","P_JS_FAILEDTODELETETHISREQUIREMENT":"Failed to delete this requirement.","P_JS_DELETEDISPATCH":"Delete Dispatch","P_JS_DELETETHEDISPATCH":"Would you like to delete the dispatch?","P_JS_FAILEDTODELETETHISDISPATCH":"Failed to delete this dispatch.","P_JS_DISPATCHREQUESTS":"Dispatch Requests","P_JS_SCHEDULED":"Scheduled","P_JS_SCHEDULER":"Scheduler","P_JS_SAVEDEFAULT":"Save Default","P_JS_BINDINGTOASSET":"Binding to Asset","P_JS_FULFILLREQUEST":"Fulfill Request","P_JS_COMPLETEREMAININGREQUIREMENTS":"Complete Remaining Requirements","P_JS_SAVEWITHCURRENTSELECTIONS":"Save with Current Selections","P_JS_PRINTDISPATCHINSTRUCTIONS":"Print Dispatch Instructions","P_JS_EMAILDISPATCHINSTRUCTIONS":"Email Dispatch Instructions","P_JS_CONTINUE":"Continue","P_JS_SENDDISPATCHREQUEST":"Send Dispatch Request","P_JS_MANAGESCHEDULER":"Manage Scheduler","P_JS_ADDSCHEDULER":"Add Scheduler","P_JS_SCHEDULERINFORMATION":"Scheduler Information","P_JS_DELETESCHEDULER":"Delete Scheduler","P_JS_WOULDYOULIKETODELETETHESCHEDULERS":"Would you like to delete the scheduler(s)?","P_JS_FAILEDTOSAVESCHEDULER":"Failed to save scheduler.","P_JS_PLEASESELECTDISPATCH":"Please select Dispatch.","P_JS_PLEASESELECTJOBSITE":"Please select Jobsite.","P_JS_DOYOUWANTTOMARKCOMPLETE":"Do you want to mark complete?","P_JS_DOYOUWANTTOUNMARKCOMPLETION":"Do you want to unmark completion?","P_JS_REQUIREMENTSTIP1":"{0} of {1} requirements have been scheduled for {2}:","P_JS_REQUIREMENTSTIP2":"{0} requirement remains: ","P_JS_PLEASEENTERTHEBEGINDATE":"Please enter the Begin Date.","P_JS_PLEASEENTERTHEENDDATE":"Please enter the End Date.","P_JS_BEGINDATEFORMATERROR":"Begin Date format error.","P_JS_PLEASESELECTASSETTYPE":"Please select Asset Type.","P_JS_PLEASEENTERTHEPOINTOFCONTACT":"Please enter the Point Of Contact.","P_JS_BEGINDATESHOULDBENOEARLIERTHANTODAYSDATE":"Begin Date should be not earlier than today’s date. Please select another date.","P_JS_BEGINDATEPAST":"The begin date for this requirement is in the past, do you want to continue?","P_JS_ENDDATEMUSTBELATERTHANBEGINDATE1":"End Date must be later than Begin Date. Please select another date range.","P_JS_ENDDATEMUSTBELATERTHANBEGINDATE":"End Date must be later than Begin Date.","P_JS_QUANTITYISINVALID":"Quantity is invalid.","P_JS_REQUIREMENTIFORASSETSPLEASEREMOVEEXCESSASSETS":"{0} requirement is for {1} asset(s), please remove excess asset(s).","P_JS_REQUIREMENTIFORASSETSPLEASEREMOVEEXCESSASSETS1":"Requirement is for {0} asset(s), please remove excess asset(s).","P_JS_SCHEDULEDREQUIREMENTSTAKEPLACEWITHINTHENEXTDAYSWOULDYOULIKETO":"{0} scheduled requirements take place within the next 7 days. Would you like to:","P_JS_SELECTASSETTYPES":"Select Asset Types","P_JS_ASSETTYPES":"Asset Type(s)","P_JS_AUTOCREATEJOBSITETIPS":"Auto-Create Jobsites Based Upon the Behavior of the Following Assets and Asset Types","P_JS_ADDEDASSETSSUCCESSFULLY":"Added asset(s) successfully.","P_JS_ADDEDASSETTYPESSUCCESSFULLY":"Added asset type(s) successfully.","P_JS_DELETEDASSETSSUCCESSFULLY":"Deleted asset(s) successfully.","P_JS_DELETEDASSETTYPESSUCCESSFULLY":"Deleted asset type(s) successfully.","P_JS_AREYOUSUREYOUWANTTODELETETHESESELECTEDASSETS":"Are you sure you want to delete these selected asset(s)?","P_JS_AREYOUSUREYOUWANTTODELETETHESESELECTEDASSETTYPES":"Are you sure you want to delete these selected asset type(s)?","P_JS_FORASSET_COLON":"For Asset:","P_JS_DISPATCHASSIGNMENT":"Dispatch Assignment","P_JS_SKIP":"Skip","P_JS_SELECTASSETFORDISPATCH":"Select Asset for Dispatch","P_JS_REQUIREMENTCHANGEHISTORY":"Requirement Change History","P_JS_DISPATCHCHANGEHISTORY":"Dispatch Change History","P_JS_VIEWDELETEDRECORDS":"View Deleted Records","P_JS_DELETEDBY":"Deleted By","P_JS_DELETEDON":"Deleted On","P_JS_DELETIONNOTES":"Deletion Notes","P_JS_UNSCHEDULED":"Unscheduled","P_JS_DELETEDJOBSITEREQUIREMENTS":"Deleted Jobsite Requirements","P_JS_DELETEDBEGINDATE_COLON":"Deleted Begin Date:","P_JS_DELETEDENDDATE_COLON":"Deleted End Date:","P_JS_SAVEJOBSITEANDREGIONSELECTIONASDEFAULT":"Save Jobsite And Region Selection As Default","P_JS_PROJECTEDENDDATE":"Projected End Date","P_JS_PROJECTEDENDDATE_COLON":"Projected End Date:","P_JS_PROJECTEDENDDATEFORMATERROR":"Projected End Date format error.","P_JS_PROJECTEDENDDATEFORMATERROR1":"Projected End Date must be later than Start Date.","P_JS_USEADDRESS":"Use Address","P_JS_ADDRESS":"Address","P_MANAGEASSETS":"Manage Assets","P_MA_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MA_CONTRACTOR":"Contractor","P_MA_CONTRACTOR_COLON":"Contractor:","P_MA_SHOWHIDDEN":"Show Hidden","P_MA_SHOWATTACHMENTS":"Show Attachments","P_MA_YES":"Yes","P_MA_NO":"No","P_MA_ADD":"Add","P_MA_EDIT":"Edit","P_MA_DELETE":"Delete","P_MA_REFRESH":"Refresh","P_MA_SEARCH":"Search","P_MA_DETAIL":"Detail","P_MA_QUERY":"Query","P_MA_ERROR":"Error","P_MA_PREVIOUS":"Previous","P_MA_NEXT":"Next","P_MA_VIN":"VIN/SN","P_MA_ASSETNAME":"Asset Name","P_MA_ASSETNAME_COLON":"Asset Name:","P_MA_ASSETNAME2":"Asset Name(Custom)","P_MA_ASSETNAME2_COLON":"Asset Name(Custom):","P_MA_PAIREDDEVICESN":"Paired Device SN","P_MA_DEVICESN_COLON":"Paired Device SN:","P_MA_YEAR":"Year","P_MA_YEAR_COLON":"Year:","P_MA_MAKE":"Make","P_MA_MAKENAME":"Make Name","P_MA_MAKE_COLON":"Make:","P_MA_MODEL":"Model","P_MA_MODELNAME":"Model Name","P_MA_TOTALCOLON":"Total:","P_MA_TOTALRUNTIMECOLON":"Total Runtime:","P_MA_MODEL_COLON":"Model:","P_MA_ADDNEWMODEL":"Add new model","P_MA_ADDNEWMAKE":"Add new make","P_MA_TYPE":"Asset Type","P_MA_TYPE_COLON":"Type:","P_MA_ENGINEHOURS":"Engine Hours","P_MA_ENGINEHOURS_COLON":"Engine Hours:","P_MA_ENGINEHOURSDATE":"Engine Hours Date","P_MA_ENGINEHOURSDATE_COLON":"Engine Hours Date:","P_MA_ENGINEHOURSTIME_COLON":"Engine Hours Time:","P_MA_HIDEHIDDEN":"Hide/Hidden","P_MA_ONROAD":"On-Road","P_MA_ATTACHMENT":"Attachment","P_MA_ATTACHMENTFILE":"Attachment File","P_MA_HIDE":"Hide","P_MA_TELEMATICSENABLED":"Telematics Enabled","P_MA_UPLOADASSETICON":"Upload Asset Icon","P_MA_DELETEASSETICON":"Delete Asset Icon","P_MA_SHOWASSETDETAIL":"Show Asset Detail","P_MA_SELECTANASSET":"Please select an Asset.","P_MA_UPLOADASSETICONTIPS":"The file type for the asset icon is invalid. The file must be JPG or PNG.","P_MA_ICONFILE":"Icon File","P_MA_DELETEICON":"Delete icon","P_MA_ADDASSET":"Add Asset","P_MA_EDITASSET":"Edit Asset","P_MA_SAVE":"Save","P_MA_SAVE1":"Save and Exit","P_MA_SAVE2":"Exit Without Saving","P_MA_VINSN":"VIN/SN","P_MA_VINSN_COLON":"VIN/SN:","P_MA_EQCLASS":"Eq.Class","P_MA_EQCLASS_COLON":"Eq.Class:","P_MA_DESCRIPTION":"Description","P_MA_DESCRIPTION_COLON":"Description:","P_MA_NOTES":"Notes","P_MA_NOTES_COLON":"Notes:","P_MA_ODOMETER":"Odometer","P_MA_ODOMETER_COLON":"Odometer:","P_MA_ODOMETERUOM":"Odometer UOM","P_MA_ODOMETERUOM_COLON":"Odometer UOM:","P_MA_MILE":"Mile","P_MA_KILOMETER":"Kilometer","P_MA_TIMEZON_COLON":"Time Zone:","P_MA_ODOMETERDATE_COLON":"Odometer Date:","P_MA_ODOMETERTIME":"Odometer Time","P_MA_ODOMETERTIME_COLON":"Odometer Time:","P_MA_URINTERVAL":"\r\n\t\t\t\tUndercarriage Replacement\r\n\t\t\t\tInterval (Hours)\r\n\t\t\t","P_MA_URINTERVAL_COLON":"\r\n\t\t\t\tUndercarriage Replacement\r\n\t\t\t\tInterval (Hours):\r\n\t\t\t","P_MA_ACQUISITIONTYPE":"Acquisition Type","P_MA_ACQUISITIONTYPE_COLON":"Acquisition Type:","P_MA_RENTAL":"Rental","P_MA_RENTALCHANGEHISTORY":"Rental Change History","P_MA_PRO":"RPO","P_MA_RERENT":"Rerent","P_MA_LEASED":"Leased","P_MA_OWNEDPURCHASE":"Owned - Purchase","P_MA_OWNEDLEASE":"Owned - Lease","P_MA_COSTCENTER":"Cost Center","P_MA_COSTCENTER_COLON":"Cost Center:","P_MA_ICONFILENAME":"Icon File Name","P_MA_ICONFILENAME_COLON":"Icon File Name:","P_MA_ADDEDON":"Added On","P_MA_ADDEDON_COLON":"Added On:","P_MA_ADDEDBY":"Added By","P_MA_ADDEDBY_COLON":"Added By:","P_MA_USETHISASSET":"Use this Asset","P_MA_JOBSITECONTACTASSIGNMENT":"Jobsite/Contact Assignment","P_MA_ONSITE":"On Site","P_MA_JOBSITENAME":"Jobsite Name","P_MA_ASSIGNMENT":"Assignment","P_MA_ASSIGNED":"Assigned","P_MA_CONTACTNAME":"Contact Name","P_MA_CONTACTTYPE":"Contact Type","P_MA_PM":"PM","P_MA_SCHEDULENAME":"Schedule Name","P_MA_INITIALSERVICEVALUE":"Initial Service Value","P_MA_LASTSERVICEDATE":"Last Service Date","P_MA_LASTSERVICEPERFORMED":"Last Service Performed","P_MA_REMOVEASSETFROMSCHEDULE":"Do you want to remove this asset from the schedule?","P_MA_REMOVEASSETFROMSCHEDULE_TIPS":"Select OK below will result in the deletion of existing unassigned PM alerts for this asset.If you do not want those alerts deleted, select CANCEL and assign appropriate alerts to a maintenance record or work order in asset health prior to deletion/removal.","P_MA_CALCULATEBASEDUPONLASTSERVICE":"Calculate based upon last service. The last service date was {0}.","P_MA_PMFISTALERT":"The first alert will be {0} before the asset reading {1} for {2}.","P_MA_ASSETGROUPS":"Asset Groups","P_MA_GROUPNAME":"Group Name","P_MA_RENTALCONNECT":"Rental Connect","P_MA_OUTSIDEINTERNAL":"Outside/Internal","P_MA_OUTSIDEINTERNAL_COLON":"Outside/Internal:","P_MA_OUTSIDE":"Outside","P_MA_INSIDE":"Inside","P_MA_RENTALVENDOR":"Rental Vendor","P_MA_RENTALVENDOR_COLON":"Rental Vendor:","P_MA_RENTALRATE":"Rental Rate","P_MA_RENTALRATE_COLON":"Rental Rate:","P_MA_TERM":"Term","P_MA_HOURLY":"Hourly","P_MA_DAILY":"Daily","P_MA_WEEKLY":"Weekly","P_MA_MONTHLY":"Monthly","P_MA_ANNUALLY":"Annually","P_MA_DAYSBILLINGCYCLE_COLON":"Number of Days in Billing Cycle:","P_MA_RENTALDATEON":"Rental Date On","P_MA_RENTALDATEON_COLON":"Rental Date On:","P_MA_PROJECTRETURNDATE":"Proj.Return Date","P_MA_PROJECTRETURNDATE_COLON":"Proj.Return Date:","P_MA_RETURNDATE":"Return Date","P_MA_RETURNDATE_COLON":"Return Date:","P_MA_RETURNTERM_COLON":"Rental Term:","P_MA_PONUMBER":"P.O.#","P_MA_PONUMBER_COLON":"P.O.#:","P_MA_RENTALTERMUNIT_COLON":"Rental Term Unit:","P_MA_RTBILLINGDATE":"Rental Term Billing Date","P_MA_RTBILLINGDATE_COLON":"Rental Term Billing Date:","P_MA_COMMENTS":"Comments","P_MA_COMMENTS_COLON":"Comments:","P_MA_PROJECTEDRETURN":"Projected Return","P_MA_TERMUNIT":"Term Unit","P_MA_OK":"OK","P_MA_CANCEL":"Cancel","P_MA_FAILED":"Failed","P_MA_MANAGERENTALHISTORY":"Manage Rental History","P_MA_PROJDATEBELATERRETURNDATE":"Proj. Return Date must be later than Rental Date.","P_MA_RETURNDATEBELATERRENTALDATE":"Return Date must be later than Rental Date.","P_MA_SAVERENTAL":"Save Rental","P_MA_WOULDSAVECHANGES":"Would you like to edit the rental instance that was updated, add a new rental instance, or cancel?","P_MA_RENTALDATESENTEREDOVERLAPWITHANOTHERENTRY":"Rental dates entered overlap with another entry. Please adjust the dates.","P_MA_ADDITIONALDOCUMENTATION":"Additional Documentation","P_MA_BROWSE":"Browse","P_MA_UPLOAD":"Upload","P_MA_FILENAME":"File Name","P_MA_UPLOADEDBY":"Uploaded By","P_MA_VISIBLEONWORKORDER":"Visible On Work Order?","P_MA_VISIBLEONMAP":"Visible On Map?","P_MA_VISIBLEONMOBILE":"Visible On Mobile?","P_MA_VIEW":"View","P_MA_FILETIPS":"Should the file(s) be available to all work orders for this asset?","P_MA_TELEMATICADJUSTMENTS":"Telematic Adjustments","P_MA_ADJUSTODOMETER":"Adjust Odometer","P_MA_IDLEHOURS":"Idle Hours","P_MA_FUELUSED":"Fuel Used","P_MA_ADDODOMETER":"Add Odometer","P_MA_ADDOENGINEHOURS":"Add Engine Hours","P_MA_ADDASSETTOSCHEDULE":"Add Asset To Schedule","P_MA_ADDMAKE":"Add Make","P_MA_ADDMODEL":"Add Model","P_MA_DOYOUWANTTOADDTHEENGINEHOURS":"Do you want to add the engine hours?","P_MA_POSSIBLEDUPLICATES_COLON":"Possible Duplicates:","P_MA_ISPRIMARY":"Is Primary","P_MA_DATASOURCE":"Data Source","P_MA_ADJUST":"Adjust","P_MA_ADJUSTED":"Adjusted","P_MA_UOM":"UOM","P_MA_UNITS":"Units","P_MA_RECEIVEDDATE":"Received Date","P_MA_DEVICEAIRID":"Device Air ID","P_MA_DEVICESN":"Device SN","P_MA_EVENTDATEUTC":"Event Date(UTC)","P_MA_EVENTDATE":"Event Date","P_MA_VBUSRAW":"VBUS(Raw)","P_MA_PEDIGREERAW":"Pedigree(Raw)","P_MA_PEDIGREEADJUSTED":"Pedigree(Adjusted)","P_MA_RAWRAW":"Raw(Raw)","P_MA_VBUSCALC":"VBUS(Calc)","P_MA_GPSRAW":"GPS(Raw)","P_MA_GPSCALC":"GPS(Calc)","P_MA_UNIT":"Unit","P_MA_CHECKENGINEHOURSMINNIMUMTIME":"The adjustment cannot be completed as provided. The engine hours reading date provided cannot be prior to initial telematic data available for the asset.","P_MA_CHECKENGINEHOURSMINNIMUMTIME1":"The adjustment cannot be completed as provided. The engine hours reading date provided must be prior to or equal to the latest telematic data available for the asset.","P_MA_CHECKODOMETERMINNIMUMTIME":"The adjustment cannot be completed as provided. The odometer reading date provided must be prior to or equal to the latest telematic data available for the asset.","P_MA_CHECKODOMETERMINNIMUMTIME1":"The adjustment cannot be completed as provided. The odometer reading date provided cannot be prior to initial telematic data available for the asset.","P_MA_ADJUSTENGINEHOURS":"Adjust Engine Hours","P_MA_RAW":"Raw","P_MA_CALCULATED":"Calculated","P_MA_ADDENGINEHOURS":"Add Engine Hours","P_MA_LOCATION":"Location","P_MA_ADJUSTLOCATION":"Adjust Location","P_MA_LONGITUDE":"Longitude","P_MA_LATITUDE":"Latitude","P_MA_AMOUNT":"Amount","P_MA_ADJUSTTHEXX":"Do you want to adjust the {0}?","P_MA_SETASPRIMARY":"Set As Primary","P_MA_VIEWADJUSTHIS":"View Adjustment History","P_MA_SAVEASSET":"Save Asset","P_MA_SAVSUCCESSFULLY":"Saved successfully.","P_MA_DELETEPROMPT":"Do you want to delete the {0}?","P_MA_DELETETHEICON":"Do you want to delete this icon?","P_MA_FAILEDTO":"Failed to {0}.","P_MA_FORMATERROR":"{0} format error.","P_MA_MUSTBEGREATERTHAN0":"{0} must be greater than 0.","P_MA_SUCCESSFULLY":"{0} Successfully.","P_MA_SELECTA":"Please select a {0}.","P_MA_NOTBEEMPTY":"{0} cannot be empty.","P_MA_ASSETCURRENTPRIMARYODOMETERDATASOURCE":"Note that the current primary odometer data source for this asset is ","P_MA_ASSETCURRENTPRIMARYENGINEHOURDATASOURCE":"Note that the current primary engine hour data source for this asset is ","P_MA_EMPTY":"empty","P_MA_SUBMIT":"Submit","P_MA_PREVIEW":"Preview","P_MA_IGNOREANDCREATEASSET":"Ignore and Create Asset","P_MA_ONSITETIPS":"You have manually assigned a jobsite. This action will disable geofence alerts and jobsite auto-assignment. Do you want to proceed? ","P_MA_VINCANNOTBEEMPTY":"VIN cannot be empty.","P_MA_PLEASESELECTAMAKE":"Please select a Make.","P_MA_PLEASESELECTAMODEL":"Please select a Model.","P_MA_DATEFORMATERROR":"Date format error.","P_MA_ENGINEHOURSFORMATERROR":"Engine Hours format error.","P_MA_ODOMETERFORMATERROR":"Odometer format error.","P_MA_FUELUSEDFORMATERROR":"Fuelused format error.","P_MA_ODOMETERMUSTBEGREATERTHAN0":"ODOMeter must be greater than 0.","P_MA_FUELUSEDCANNOTBEEMPTY":"Fuelused cannot be empty.","P_MA_FUELUSEDDATACANNOTBEEMPTY":"Fuelused data cannot be empty.","P_MA_UNDERCARRIAGEREPLACEMENTINTERVALFORMATERROR":"Undercarriage Replacement Interval format error.","P_MA_ADJUSTFUELUSED":"Adjust Fuelused","P_MA_ADJUSTFUELUSEDSUCCESSFULLY":"Adjust Fuelused Successfully.","P_MA_FAILEDTOADJUSTFUELUSED":"Failed to adjust Fuelused.","P_MA_DOYOUWANTTOADJUSTTHEFUELUSED":"Do you want to adjust the fuelused?","P_MA_ADJUSTIDLEHOUR":"Adjust Idlehour","P_MA_IDLEHOURFORMAERROR":"Idlehour format error.","P_MA_ADJUSTIDLEHOURSUCCESSFULLY":"Adjust Idlehour Successfully.","P_MA_FAILEDTOADJUSTIDLEHOUR":"Failed to adjust Idlehour.","P_MA_LOCATIONFORMAERROR":"Location format error.","P_MA_LOCATIONCANNOTBEEMPTY":"Location cannot be empty.","P_MA_ADJUSTLOCATIONSUCCESSFULLY":"Adjust Location Successfully.","P_MA_FAILEDTOADJUSTLOCATION":"Failed to adjust Location.","P_MA_ODOMETRCANNOTBEEMPTY":"Odometer cannot be empty.","P_MA_ODOMETRDATACANNOTBEEMPTY":"Odometer data cannot be empty.","P_MA_DOYOUWANTTOADJUSTTHEODOMETER":"Do you want to adjust the odometer?","P_MA_DOYOUWANTTOADDTHEODOMETER":"Do you want to add the odometer?","P_MA_ADJUSTODOMETERSUCCESSFULLY":"Adjust Odometer Successfully.","P_MA_FAILEDTOADJUSTDOMETER":"Failed to adjust Odometer.","P_MA_FAILEDTOADJUSTDOMETERSETASPRIMARY":"Failed to set as primary.","P_MA_MAKENAMEEMPTY":"Make name cannot be empty.","P_MA_FAILEDTOSAVEMAKE":"Failed to save Make.","P_MA_MODELNAMECANNOTBEEMPTY":"Model name cannot be empty.","P_MA_FAILEDTOSAVEMODEL":"Failed to save Model.","P_MA_REMOVEASSET":"Remove Asset","P_MA_WHENWOULDYOULIKETHEFIRSTALERT":"When would you like the first alert?","P_MA_NOAVAILABLEINTERVALS":"No available intervals.","P_MA_ONEORMORESERVICESWASMISSEDALERTMEFOR":"One or more services was missed. Alert me for ","P_MA_NOW":" now.","P_MA_FOR":" for ","P_MA_CALCULATEBASEDUPONLASTSERVICETHE":"Calculate based upon last service. The ","P_MA_CALCULATEBASEDUPONLASTSERVICETHELASTSERVICEDATAWAS":"Calculate based upon last service. The last service date was ","P_MA_SERVICEWASPERFORMEDAT":" service was performed at ","P_MA_TRIGGERANALERTASIFSERVICEISDUETODAY":"Trigger an alert as if service is due today. ","P_MA_THEFIRSTALERTWILLBE":"The first alert will be ","P_MA_BEFORETHEASSETREADING":" before the asset reading ","P_MA_ATTACHMENTSTIPS":"Attachment size is 0kb, uploading failed.","P_MA_ATTACHMENTSTIPS1":"Attachment is too large. Maximum file size is 50 MB.","P_MA_DELETEATTACHMENT":"Delete Attachment","P_MA_DELETEATTACHMENTTIPS":"Are you sure you want to delete the attachment?","P_MA_FAILEDDELETEATTACHMENT":"Failed to delete this attachment.","P_MA_EDITRENTAL":"Edit Rental","P_MA_ADDRENTAL":"Add Rental","P_MA_RENTALRATEFORMATERROR":"Rental Rate format error.","P_MA_RENTALTERMMUSTBEANINTEGEREQUALTOORGREATERTHAN0":"Rental Term must be an integer equal to or greater than 0.","P_MA_RENTALDATECANNOTBEEMPTY":"Rental Date cannot be empty.","P_MA_THENUMBEROFDAYSINBILLINGCYCLEMUSTBEANINTEGEREQUALTOORGREATERTHAN0":"The Number of Days in Billing Cycle must be an integer equal to or greater than 0.","P_MA_PROJRETURNDATEMUSTBELATERTHANRENTALDATE":"Proj. Return Date must be later than Rental Date.","P_MA_RETURNDATEMUSTBELATERTHANRENTALDATE":"Return Date must be later than Rental Date.","P_MA_FAILEDTOSAVERENTAL":"Failed to save Rental.","P_MA_ODOMETERADJUSTMENTHISTORY":"Odometer Adjustment History","P_MA_STARTDATE_COLON":"Start Date:","P_MA_ENDDATE_COLON":"End Date:","P_MA_EXPORTTOEXCEL":"Export to Excel","P_MA_USERNAME":"User Name","P_MA_ADJUSTMENTTIME":"Adjustment Time","P_MA_ODOMETERENTERED":"Odometer Entered","P_MA_ENGINEHOURSADJUSTMENTHISTORY":"Engine Hours Adjustment History","P_MA_ENGINEHOURNTERED":"Engine Hours Entered","P_MA_ENGINEHOURSTIME":"Engine Hours Time","P_MA_ONSITETITLE":"The On Site box should only be checked if the asset has a permanent assignment not based on location. Geofence and Jobsite Add/Remove will not be triggered if checked.","P_MA_NAME":"Name","P_MA_NAME_COLON":"Name:","P_MA_URL_COLON":"Url:","P_MA_URL":"Url","P_MA_FILE":"File","P_MA_NAMECANNOTBEEMPTY":"Name cannot be empty.","P_MA_URLCANNOTBEEMPTY":"Url cannot be empty.","P_MA_FILECANNOTBEEMPTY":"File cannot be empty.","P_MA_DELETEDOCUMENTATION":"Delete Documentation","P_MA_DOCUMENTTIPS":"Document size is 0kb, uploading failed.","P_MA_DOCUMENTTIPS1":"Document is too large. Maximum file size is 50 MB.","P_MA_DELETEDOCUMENTTTIPS":"Are you sure you want to delete the document?","P_MA_FAILEDDELETEDOCUMENT":"Failed to delete this document.","P_MA_ATTACHMENTINFO":"Attachment Info","P_MA_ASSETTYPETOATTACHTO_COLON":"Asset Type to Attach To:","P_MA_STYLE_COLON":"Style:","P_MA_CAPACITYCYD":"Capacity (CYD)","P_MA_CAPACITYCYD_COLON":"Capacity (CYD):","P_MA_CAPACITYWEIGHT_COLON":"Capacity (Weight):","P_MA_CAPACITYWEIGHT":"Capacity (Weight)","P_MA_DIMENSION1INCM":"Dimension #1 (in/cm)","P_MA_DIMENSION1INCM_COLON":"Dimension #1 (in/cm):","P_MA_WIDTH":"Width","P_MA_WIDTH_COLON":"Width:","P_MA_OLDNUMBER":"Old Number","P_MA_OLDNUMBER_COLON":"Old Number:","P_MA_FITINFO":"Fit Info","P_MA_ATTACHTOMAKE_COLON":"Attach to Make:","P_MA_ATTACHTOMODEL_COLON":"Attach to Model:","P_MA_ATTACHTOANASSET_COLON":"Attached to an Asset:","P_MA_ATTACHEDTOT_COLON":"Attached to:","P_MA_SELECTASSET":"Select Asset","P_MA_UNATTACH":"Unattach","P_MA_ISNOTFORMATTEDCORRECTLY":" is not formatted correctly.","P_MA_MERGEASSET":"Merge Asset","P_MA_BOTH":"Both","P_MA_ODOMETERDATA":"Odometer Data","P_MA_ENGINEHOURSDATA":"Engine Hours Data","P_MA_LOCATIONDATA":"Location Data","P_MA_IDLEHOURSDATA":"Idle Hours Data","P_MA_FUELUSEDDATA":"Fuel Used Data","P_MA_FUELREMAINING":"Fuel Remaining","P_MA_ATTRIBUTEDATA":"Attribute Data","P_MA_BATTERYDATA":"Battery Data","P_MA_FPREVENTATIVEMAINTENANCEPLANS":"Preventative Maintenance Plans","P_MA_JOBSITEATA":"Jobsite Data","P_MA_MERGESUCCESSFULLY":"Merge successfully.","P_MA_MERGEASSETTIPS":"Merge asset {0} to asset {1}, please select the data to be retained:","P_MA_SELECTANASSETTOMERGE":"Please select two assets to merge.","P_MA_MERGEASSETHISTORY":"Asset Merge Hisroty","P_MA_FROMASSETNAME":"From Asset Name","P_MA_FROMASSETVIN":"From Asset VIN","P_MA_TOSSETNAME":"To Asset Name","P_MA_TOASSETVIN":"To Asset VIN","P_MA_MERGEDATE":"Merge Date","P_MA_MERGEBY":"Merge By","P_MA_COMPLETED":"Completed","P_MA_COMPLETEDDATE":"Completed Date","P_MA_ASSETFROM_COLON":"Asset from:","P_MA_ASSETTO_COLON":"Asset to:","P_MA_MACHINESIMPORTEDSUCCESSFULLY":" Asset(s) imported successfully.","P_MA_MACHINESIMPORTEDIGNORE":"Empty Make/Model exists in data.Do you want to continue importing?","P_MA_IMPORT":"Import","P_MA_IMPORTMACHINESFIELDMAPPING":"Import Assets Field Mapping","P_MANAGERENTALS":"Manage Rentals","P_MANAGERENTALS_TITLE":"View/Edit Rental Occurences. To add new assets use Manage Assets","P_MR_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MR_QUERY":"Query","P_MR_ERROR":"Error","P_MR_CONTRACTOR":"Contractor","P_MR_CONTRACTOR_COLON":"Contractor:","P_MR_ASSET_COLON":"Asset:","P_MR_RENTALDATEFROM_COLON":"Rental Date From:","P_MR_TO_COLON":"To:","P_MR_YES":"Yes","P_MR_NO":"No","P_MR_ADD":"Add","P_MR_EDIT":"Edit","P_MR_DELETE":"Delete","P_MR_REFRESH":"Refresh","P_MR_SAVE":"Save","P_MR_SAVE1":"Save and Exit","P_MR_SAVE2":"Exit Without Saving","P_MR_EXPORTTOEXCEL":"Export to Excel","P_MR_SEARCH":"Search","P_MR_PRINT":"Print","P_MR_EDITRENTAL":"Edit Rental","P_MR_ADDRENTAL":"Add Rental","P_MR_VINSN":"VIN/SN","P_MR_ASSETNAME":"Asset Name","P_MR_ACQUISITIONTYPE":"Acquisition Type","P_MR_OUTSIDEINTERNAL":"Outside/Internal","P_MR_OUTSIDEINTERNAL_COLON":"Outside/Internal:","P_MR_OUTSIDE":"Outside","P_MR_INSIDE":"Inside","P_MR_RENTALVENDOR":"Rental Vendor","P_MR_RENTALVENDOR_COLON":"Rental Vendor:","P_MR_RENTALRATE":"Rental Rate","P_MR_RENTALRATE_COLON":"Rental Rate:","P_MR_RENTALTERM":"Rental Term","P_MR_RETURNTERM_COLON":"Rental Term:","P_MR_TERM":"Term","P_MR_TERMUNIT":"Term Unit","P_MR_RENTALTERMUNIT":"Rental Term Unit","P_MR_RENTALTERMUNIT_COLON":"Rental Term Unit:","P_MR_HOURLY":"Hourly","P_MR_DAILY":"Daily","P_MR_WEEKLY":"Weekly","P_MR_MONTHLY":"Monthly","P_MR_ANNUALLY":"Annually","P_MR_RENTALDATEON":"Rental Date On","P_MR_RENTALDATEON_COLON":"Rental Date On:","P_MR_RTBILLINGDATE":"Rental Term Billing Date","P_MR_RTBILLINGDATE_COLON":"Rental Term Billing Date:","P_MR_DAYSBILLINGCYCLE":"Number of Days in Billing Cycle","P_MR_DAYSBILLINGCYCLE_COLON":"Number of Days in Billing Cycle:","P_MR_PROJECTRETURN":"Project Return","P_MR_PROJECTRETURNDATE":"Project Return Date","P_MR_PROJRETURNDATE":"Proj.Return Date","P_MR_PROJECTRETURNDATE_COLON":"Proj.Return Date:","P_MR_PROJECTEDRETURN":"Projected Return","P_MR_RETURNDATE":"Return Date","P_MR_RETURNDATE_COLON":"Return Date:","P_MR_PURCHASEORDERN":"Purchase Order #","P_MR_PONUMBER":"P.O.#","P_MR_PONUMBER_COLON":"P.O.#:","P_MR_COMMENTS":"Comments","P_MR_COMMENTS_COLON":"Comments:","P_MR_VIEWCHANGEHIS":"View Change History","P_MR_ASSETHIDDEN":"That asset has been hidden or is no longer available.","P_MR_DOYOUWANTTODELETETHERENTALOCCURENCE":"Do you want to delete the rental occurence?","P_MR_DELETERENTALFAILED":"Failed to delete this rental occurence.","P_MR_DELETERENTAL":"Delete Rental","P_MR_ASSETINFORMATION":"Asset Information","P_MR_ASSET":"Asset","P_MR_VIN":"VIN","P_MR_VIN_COLON":"VIN:","P_MR_ASSETTYPE":"Type","P_MR_ASSETTYPE_COLON":"Type:","P_MR_MAKE":"Make","P_MR_MAKE_COLON":"Make:","P_MR_MODEL":"Model","P_MR_MODEL_COLON":"Model:","P_MR_RENTALINFORMATION":"Rental Information","P_MR_RENTALHISTORY":"Rental History","P_MR_SELECTA":"Please select a {0}.","P_MR_NOTBEEMPTY":"{0} cannot be empty.","P_MR_FORMATERROR":"{0} format error.","P_MR_SELECTAINTEGER":"{0} must be an integer equal to or greater than 0.","P_MR_PLEASESELECTARENTAL":"Please select a Rental.","P_MR_ASSETNOTEMPTY":"Asset cannot be empty.","P_MR_RENTALRATEFORMATERROR":"Rental Rate format error.","P_MR_RENTALTERMMUSTBEANINTEGEREQUALTOORGREATERTHAN0":"Rental Term must be an integer equal to or greater than 0.","P_MR_RENTALDATECANNOTBEEMPTY":"Rental Date cannot be empty.","P_MR_THENUMBEROFDAYSINBILLINGCYCLEMUSTBEANINTEGEREQUALTOORGREATERTHAN0":"The Number of Days in Billing Cycle must be an integer equal to or greater than 0.","P_MR_PROJRETURNDATEMUSTBELATERTHANRENTALDATE":"Proj. Return Date must be later than Rental Date.","P_MR_RETURNDATEBELATERRENTALDATE":"Return Date must be later than Rental Date.","P_MR_SAVERENTAL":"Save Rental","P_MR_RENTALDATESENTEREDOVERLAPWITHANOTHERENTRY":"Rental dates entered overlap with another entry. Please adjust the dates.","P_MR_SAVSUCCESSFULLY":"Saved successfully.","P_MR_FAILEDTOSAVERENTAL":"Failed to save Rental.","P_MR_RENTALCHANGEHISTORY":"Rental Change History","P_MR_RENTALID":"Rental ID","P_MR_USERNAME":"User Name","P_MR_LASTUPDATEDATE":"Last Update Date","P_MR_INSUREDVALUE":"Insured Value","P_MR_INSUREDVALUE_COLON":"Insured Value:","P_MR_INSUREDVALUEFORMATERROR":"Insured Value format error.","P_ASSETGROUPS":"Asset Groups","P_AG_PAGEERROR":"An unknown error occurred. Please refresh page.","P_AG_QUERY":"Query","P_AG_ERROR":"Error","P_AG_SEARCH":"Search","P_AG_YES":"Yes","P_AG_NO":"No","P_AG_ADD":"Add","P_AG_EDIT":"Edit","P_AG_DELETE":"Delete","P_AG_REFRESH":"Refresh","P_AG_SAVE":"Save","P_AG_SAVE1":"Save and Exit","P_AG_SAVE2":"Exit Without Saving","P_AG_GROUPNAME":"Group Name","P_AG_GROUPNAME_COLON":"Group Name:","P_AG_DESCRIPTION":"Description","P_AG_DESCRIPTION_COLON":"Description:","P_AG_CODE":"Code","P_AG_CODE_COLON":"Code:","P_AG_EDITASSETGROUP":"Edit Asset Group","P_AG_ADDASSETGROUP":"Add Asset Group","P_AG_GROUPASSETS":"Group Assets","P_AG_VIN":"VIN","P_AG_NAME":"Name","P_AG_TYPE":"Type","P_AG_EDITMACHINEGROUP":"Edit Machine Group","P_AG_PLEASESELECTAMACHINEGROUP":"Please select a Machine Group.","P_AG_DELETEASSETGROUP":"Delete Asset Group","P_AG_NOTDELETEASSETGROUP":"Asset Group can not be deleted because it is in use.","P_AG_DELETEASSETGROUPFAILED":"Failed to delete this Asset Group.","P_AG_NAMEALREADYEXISTS":"Group Name already exists.","P_AG_SAVASSETGROUP":"Save Asset Group","P_AG_SAVSUCCESSFULLY":"Saved successfully.","P_AG_FAILEDLOADASSETS":"Failed to load Asset(s).","P_AG_FAILEDTOSAVEASSETGROUP":"Failed to save Asset Group.","P_AG_DOYOUWANTTODELETETHEASSETGROUP":"Do you want to delete the Asset Group?","P_AG_GROUPNAMECANNOTBEEMPTY":"Group Name cannot be empty.","P_AG_REMOVETHISASSET":"Are you sure you want to remove this asset:{0}?","P_AG_REMOVESELECTEDASSETS":"Are you sure you want to remove these selected assets?","P_AG_EDITGROUPASSETS":"Edit Group Assets","P_MANAGEDEVICES":"Manage Devices","P_MD_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MD_QUERY":"Query","P_MD_ERROR":"Error","P_MD_CONTRACTOR_COLON":"Contractor:","P_MD_SEARCH":"Search","P_MD_YES":"Yes","P_MD_NO":"No","P_MD_ADD":"Add","P_MD_EDIT":"Edit","P_MD_REFRESH":"Refresh","P_MD_OK":"OK","P_MD_CANCEL":"Cancel","P_MD_SAVE":"Save","P_MD_SAVE1":"Save and Exit","P_MD_SAVE2":"Exit Without Saving","P_MD_SN":"Air ID or SN","P_MD_ESN":"ESN","P_MD_DEVICEESN_COLON":"Device ESN:","P_MD_DEVICETYPE":"Device Type","P_MD_DEVICETYPE_COLON":"Device Type:","P_MD_SOURCE":"Source","P_MD_SOURCE_COLON":"Source:","P_MD_SN_COLON":"SN:","P_MD_DEVICEAIRID_COLON":"Device Air Id:","P_MD_STATUS":"Status","P_MD_STATUS_COLON":"Status:","P_MD_ACTIVE":"Active","P_MD_INACTIVE":"Inactive","P_MD_ADDDATE":"Add Date","P_MD_FIINSTALL":"FI Install","P_MD_FIINSTALLATION_COLON":"FI Installation:","P_MD_TAMPERALERTS_COLON":"Tamper Alerts:","P_MD_UTILIZATION_COLON":"Utilization:","P_MD_INSTALLER":"Installer","P_MD_INSTALLER_COLON":"Installer:","P_MD_NOTES":"Notes","P_MD_NOTES_COLON":"Notes:","P_MD_SERVICESTATDATE":"Service Start Date","P_MD_SERVICESTATDATE_COLON":"Service Start Date:","P_MD_ASSETVINSN":"Asset VIN/SN","P_MD_VIN_COLON":"VIN:","P_MD_ASSETNAME":"Asset Name","P_MD_YEAR":"Year","P_MD_MAKE":"Make","P_MD_MAKE_COLON":"Make:","P_MD_MODEL":"Model","P_MD_MODEL_COLON":"Model:","P_MD_TYPE":"Asset Type","P_MD_TYPE_COLON":"Type:","P_MD_ENGINEHOURS":"Engine Hours","P_MD_ENGINEHOURSDATE":"Engine Hours Date","P_MD_INVOICEDATE":"Invoice Date","P_MD_INVOICEDATE_COLON":"Invoice Date:","P_MD_INVOICENUMBER":"Invoice #","P_MD_INVOICENUMBER_COLON":"Invoice #:","P_MD_SUMMARY":"Summary","P_MD_ASSETASSIGNMENT_COLON":"Asset Assignment:","P_MD_UNASSIGNED":"Unassigned","P_MD_ASSETASSIGNMENT":"Select Asset","P_MD_UNPAIRTHISDEVICE":"Unpair This Device","P_MD_SUBMIT":"Submit","P_MD_SAVEDEVICE":"Save Device","P_MD_SNCANNOTBEEMPTY":"SN cannot be empty.","P_MD_INVOICEDATEFORMATERROR":"Invoice Date format error.","P_MD_SERVICESTARTDATEFORMATERROR":"Service Start Date format error.","P_MD_SAVSUCCESSFULLY":"Saved successfully.","P_MD_FAILEDSAVEDEVICE":"Failed to save device.","P_MD_INPUTCOMMENT":"Please input the comment.","P_MD_CHANGECONTRACTOR":"Change Contractor","P_MD_EDITDEVICE":"Edit Device","P_MD_ADDDEVICE":"Add Device","P_MD_CONFIGURATIONCHANGETIPS":"This configuration change may take up to 24 hours to take affect.","P_MD_INSTALLATIONNOTES":"Installation Notes","P_MD_ADDINSTALLATIONNOTES":"Add Installation Notes","P_MD_PLEASEINPUTTHEINSTALLATIONNOTES":"Please input the installation notes.","P_MD_DEVICESIMPORTEDSUCCESSFULLY":" Device(s) imported successfully.","P_MD_IMPORTDEVICEFIELDMAPPING":"Import Device Field Mapping","P_MANAGEMODELS":"Manage Models","P_MM_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MM_QUERY":"Query","P_MM_ERROR":"Error","P_MM_SEARCH":"Search","P_MM_ADD":"Add","P_MM_EDIT":"Edit","P_MM_DELETE":"Delete","P_MM_MODEL":"Model","P_MM_MODEL_COLON":"Model:","P_MM_TYPE":"Type","P_MM_TYPE_COLON":"Type:","P_MM_ADDMAKE":"Add Make","P_MM_ADDMODEL":"Add Model","P_MM_MAKE":"Make","P_MM_MAKE_COLON":"Make:","P_MM_OK":"OK","P_MM_CANCEL":"Cancel","P_MM_MAKENAMEEMPTY":"Make name cannot be empty.","P_MM_MODELNAMEEMPTY":"Model name cannot be empty.","P_MM_SAVEMAKE":"Save Make","P_MM_DELETEMAKE":"Delete Make","P_MM_FAILEDTODELETE":"Failed to delete this {0}.","P_MM_DELETEMODEL":"Delete Model","P_MM_FAILEDSAVEMAKE":"Failed to save Model.","P_MM_SAVEMODEL":"Save Model","P_MM_EDITMAKE":"Edit Make","P_MM_EDITMODEL":"Edit Model","P_MM_FAILEDTODELETETHISMAKE":"Failed to delete this Make.","P_MM_FAILEDTODELETETHISMODEL":"Failed to delete this Model.","P_MM_AREYOUSUREYOUWANTTODELETETHISMAKE":"Are you sure you want to delete this Make?","P_MM_DOYOUWANTTODELETETHEMODEL":"Do you want to delete the Model?","P_SHAREASSETS":"Share Assets","P_SA_SHAREASSETS":"Share Assets","P_ALERTSMANAGEMENT":"Alerts Management","P_ALERTSMANAGEMENTNEW":"Alerts Management","P_AM_PAGEERROR":"An unknown error occurred. Please refresh page.","P_AM_QUERY":"Query","P_AM_ERROR":"Error","P_AM_OK":"OK","P_AM_CANCEL":"Cancel","P_AM_ALERT":"Alert","P_AM_ALERTS":"Alerts","P_AM_BEGINDATE":"Begin Date","P_AM_BEGINDATE_COLON":"Begin Date:","P_AM_ENDDATE":"End Date","P_AM_ENDDATE_COLON":"End Date:","P_AM_ALERTTYPE":"Alert Type","P_AM_ALERTTYPE_COLON":"Alert Type:","P_AM_ASSETGROUP":"Asset Group","P_AM_ASSETGROUP_COLON":"Asset Group:","P_AM_ALERSTATUS":"Alert Status","P_AM_ALERSTATUS_COLON":"Alert Status:","P_AM_JOBSITES_COLON":"Jobsites:","P_AM_ADD":"Add","P_AM_EDIT":"Edit","P_AM_DELETE":"Delete","P_AM_REFRESH":"Refresh","P_AM_SEARCH":"Search","P_AM_ALERTVIEW":"Alert View","P_AM_ASSETVIEW":"Asset View","P_AM_ACKNOWLEDGEDALERTS":"Acknowledged Alerts","P_AM_ACKNOWLEDGEALERTS":"Acknowledge Alert(s)","P_AM_CREATEWORKORDER":"Create Work Order","P_AM_EXPANDALL":"Expand All","P_AM_COLLAPSEALL":"Collapse All","P_AM_WORKORDERID":"Work Order ID","P_AM_WORKORDERSTATUS":"Work Order Status","P_AM_ASSETNAME":"Asset Name","P_AM_MAKE":"Make","P_AM_MODEL":"Model","P_AM_VIN":"VIN/SN","P_AM_CURRENTHOURS":"Current Hours","P_AM_ENGINEHOURS":"Engine Hours","P_AM_HOURS":"Hours","P_AM_DESCRIPTION":"Description","P_AM_ALERTCOUNT":"Alert Count","P_AM_ALERTDATETIME":"Alert DateTime","P_AM_LATESTALERTDATETIME":"Latest Alert DateTime","P_AM_OPENWORKORDERS":"Open Work Orders","P_AM_DTCALERTS":"DTC Alerts","P_AM_PMALERTS":"PM Alerts","P_AM_INSPECTALERTS":"Inspect Alerts","P_AM_SERVICEDESCRIPTION":"Service Description","P_AM_ACKNOWLEDGEDBY":"Acknowledged By","P_AM_ACKNOWLEDGEDDATETIME":"Acknowledged DateTime","P_AM_ACKNOWLEDGEDCOMMENT":"Acknowledged Comment","P_AM_SELECTANALERT":"Please select an Alert.","P_AM_ACKNOWLEDGMENTCOMMENTREQUIRED":"Acknowledgment Comment is required.","P_AM_COMMENT_COLON":"Comment:","P_AM_ASSIGNWORKORDER":"Assign Work Order","P_AM_INCLUDEUNCOMPLETED":"Display triggered/incomplete PM and red/yellow inspect alerts despite date selection","P_AM_AUTOACKNOWLEDGE":"Auto-Acknowledge","P_AM_AUTOACKNOWLEDGE1":"Auto Acknowledge","P_AM_USERNAME":"User Name","P_AM_UPDATEDATE":"Update Date","P_AM_AUTOACKNOWLEDGETHEFOLLOWINGALERTTYPES_COLON":"Auto-Acknowledge the following Alert Types:","P_AM_VIEWCHANGEHIS":"View Change History","P_AM_AUTOACKNOWLEDGECHANGEHISTORY":"Auto-Acknowledge Change History","P_AM_EXPORT":"Export","P_AM_ALERTAUTOMATION":"Alert Automation","P_AM_STATUSASSIGNMENT":"Status Assignment","P_AM_STATUSASSIGNMENT_COLON":"Status Assignment:","P_AM_INCLUDEALLALERTS":"Include All Alerts","P_AM_INCLUDEALLALERTS_COLON":"Include All Alerts:","P_AM_EMAILWORKORDER":"Email Work Order","P_AM_EMAILWORKORDER_COLON":"Email Work Order:","P_AM_WORKORDERGENERATOR":" Work Order Generator","P_AM_ADDWORKORDERGENERATOR":"Add Work Order Generator","P_AM_EDITWORKORDERGENERATOR":"Edit Work Order Generator","P_AM_DELETEWORKORDERGENERATOR":"Delete Work Order Generator","P_AM_FAILEDTOSAVEWORKORDERGENERATOR":"Failed to save work order generator.","P_AM_FAILEDTODELETEWORKORDERGENERATOR":"Failed to delete work order generator.","P_AM_DOYOUWANTTODELETETHISWORKORDERGENERATOR":"Do you want to delete this work order generator?","P_WORKORDER":"Work Order","P_WORKORDERNEW":"Work Order","P_WORKORDERHISTORY":"Work Order History","P_WO_PAGEERROR":"An unknown error occurred. Please refresh page.","P_WO_QUERY":"Query","P_WO_ERROR":"Error","P_WO_ASSETGROUP":"Asset Group","P_WO_ASSETGROUP_COLON":"Asset Group:","P_WO_ADD":"Add","P_WO_EDIT":"Edit","P_WO_DELETE":"Delete","P_WO_REFRESH":"Refresh","P_WO_SEARCH":"Search","P_WO_OK":"OK","P_WO_CANCEL":"Cancel","P_WO_EXIT":"Exit","P_WO_VIEWMAINTENANCERECORDS":"View Maintenance Records","P_WO_WORKORDERNUMBER":"Work Order Number","P_WO_WORKORDERNUMBER_COLON":"Work Order Number:","P_WO_WORKORDERTYPE":"Work Order Type","P_WO_WORKORDERTYPE_COLON":"Work Order Type:","P_WO_ASSIGNEDTO":"Assigned To","P_WO_ASSIGNEDTO_COLON":"Assigned To:","P_WO_PARTSEXPECTEDDATE":"Parts Expected Date","P_WO_PARTSEXPECTEDDATE_COLON":"Parts Expected Date:","P_WO_LASTLABORDATE":"Last Labor Date","P_WO_LASTLABORDATE_COLON":"Last Labor Date:","P_WO_STATUS":"Status","P_WO_STATUS_COLON":"Status:","P_WO_ASSIGNED":"Assigned","P_WO_UNASSIGNED":"Unassigned","P_WO_INPROGRESS":"In Progress","P_WO_ASSET":"Asset","P_WO_ASSET_COLON":"Asset:","P_WO_INVOICENUMBER_COLON":"Invoice Number:","P_WO_DESCRIPTION":"Description","P_WO_DESCRIPTION_COLON":"Description:","P_WO_DUEDATE":"Due Date","P_WO_DUEDATE_COLON":"Due Date:","P_WO_COMPLETEDDATE":"Completed Date","P_WO_COMPLETEDDATE_COLON":"Completed Date:","P_WO_PRINT":"Print","P_WO_DOWNLOAD":"Download","P_WO_ASSETALERT":"Asset Alert","P_WO_MANAGEALERTS":"Manage Alerts","P_WO_AVAILABLEALERTS":"Available Alerts","P_WO_SELECTEDALERTS":"Selected Alerts","P_WO_ALERTID":"Alert ID","P_WO_COMPLETED":"Completed","P_WO_COMPLETED_COLON":"Completed:","P_WO_SERVICEDESCRIPTION":"Service Description","P_WO_SEGMENTS":"Segments","P_WO_SAVE":"Save","P_WO_SAVE1":"Save and Exit","P_WO_SAVE2":"Exit Without Saving","P_WO_OPENDATE_COLON":"Open Date:","P_WO_ASSETINFORMATION":"Asset Information","P_WO_OPENWORKORDERNUMBERS":"Open Work Order Numbers:","P_WO_VIN":"VIN","P_WO_VIN_COLON":"VIN:","P_WO_MAKE":"Make","P_WO_MAKE_COLON":"Make:","P_WO_MODEL":"Model","P_WO_MODEL_COLON":"Model:","P_WO_TYPE":"Type","P_WO_ASSETTYPE_COLON":"Type:","P_WO_ASSETTYPE1_COLON":"Asset Type:","P_WO_WORKORDERINFORMATION":"Work Order Information","P_WO_WORKORDERINFORMATION_COLON":"Work Order Information:","P_WO_MAINTENANCEEXPENSE":"Maintenance Expense","P_WO_REPAIREXPENSE":"Repair Expense","P_WO_CAPITALIZEDEXPENSE":"Capitalized Expense","P_WO_METERTYPE":"Meter Type","P_WO_METERTYPE_COLON":"Meter Type:","P_WO_HOURMETER":"Hour Meter","P_WO_HOURMETER_COLON":"Hour Meter:","P_WO_ODOMETER":"Odometer","P_WO_ODOMETER_COLON":"Odometer:","P_WO_BOTH":"Both","P_WO_MILE":"Mile","P_WO_KILOMETER":"Kilometer","P_WO_WORKORDERTOTALCOST":"Work Order Total Cost ($)","P_WO_WORKORDERTOTALCOST_COLON":"Work Order Total Cost ($):","P_WO_OTHERCOST":"Other Cost ($)","P_WO_OTHERCOST_COLON":"Other Cost ($):","P_WO_PARTSCOST":"Parts Cost ($)","P_WO_PARTSCOST_COLON":"Parts Cost ($):","P_WO_TRAVELTIMECOST":"Travel Time Cost ($)","P_WO_TRAVELTIMECOST_COLON":"Travel Time Cost ($):","P_WO_LABORCOST":"Labor Cost ($)","P_WO_LABORCOST_COLON":"Labor Cost ($):","P_WO_HOURLYRATE":"Hourly Rate","P_WO_HOURLYRATE_COLON":"Hourly Rate:","P_WO_TIMETOCOMPLATEHOURS":"Time To Complete(Hrs)","P_WO_TIMETOCOMPLATEHOURS_COLON":"Time To Complete(Hrs):","P_WO_INTERNALID":"Internal ID","P_WO_INTERNALID_COLON":"Internal ID:","P_WO_NOTES":"Notes","P_WO_NOTES_COLON":"Notes:","P_WO_ATTACHMENTS":"Attachments","P_WO_ATTACHMENTS_COLON":"Attachments:","P_WO_ADDFILE":"Add File","P_WO_ATTACHMENTFILE":"Attachment File","P_WO_ATTACHMENTSTIPS":"Attachment size is 0kb, uploading failed.","P_WO_ATTACHMENTSTIPS1":"Attachment is too large. Maximum file size is 50 MB.","P_WO_DELETEATTACHMENT":"Delete Attachment","P_WO_DELETEATTACHMENTTIPS":"Are you sure you want to delete the attachment?","P_WO_FAILEDDELETEATTACHMENT":"Failed to delete this attachment.","P_WO_EMAILDETAILS":"Email Details","P_WO_SENDWORKORDER":"Send Work Order","P_WO_CONTACTNAME":"Contact Name","P_WO_CONTACTTYPE":"Contact Type","P_WO_EMAIL":"Email","P_WO_ALERTTYPE":"Alert Type","P_WO_SENDTHISTO":"Who do you want to send this to? Select from existing relationships or manual entry.","P_WO_EMAILADDRESSESTIPS":"Separate multiple manually entered email addresses with a semi-colon (;).","P_WO_OTHEREMAILADDRESS":"Other Email Address","P_WO_ASSETNOTEMPTY":"Asset cannot be empty.","P_WO_SENDEMAIL":"Send Email","P_WO_OTHERADDRESSINVALID":"The other email address {0} is invalid.","P_WO_MESSAGESENT":"Message sent.","P_WO_FAILEDSENDWORKORDER":"Failed to send work order.","P_WO_ADDALERTS":"Add Alerts","P_WO_SELECTPLANFORALERT":"Select Plan for Alert","P_WO_REMOVEALERTS":"Remove Alerts","P_WO_PRINTWORKORDER":"Print Work Order","P_WO_SAVEWORKORDERFIRST":"Please save work order first.","P_WO_PLEASESELECTANASSET":"Please select an Asset.","P_WO_PLEASESELECTANALERT":"Please select an Alert.","P_WO_PLEASESELECTAPLAN":"Please select a plan.","P_WO_HOURS":"Hours","P_WO_HOURS_COLON":"Hours:","P_WO_COUNT":"Count","P_WO_LATESTDATETIME":"Latest DateTime","P_WO_DTCALERTS":"DTC Alerts","P_WO_PMALERTS":"PM Alerts","P_WO_ADDPMALERTS":"Add PM Alerts (Alerts not yet triggered)","P_WO_INSPECTALERTS":"Inspect Alerts","P_WO_OILALERTS":"Oil Alerts","P_WO_ALERT":"Alert","P_WO_ALERTS":"Alerts","P_WO_SEGMENT":"Segment","P_WO_ADDSEGMENT":"Add Segment","P_WO_EDITSEGMENT":"Edit Segment","P_WO_USER":"User","P_WO_USER_COLON":"User:","P_WO_JOBSITE":"Jobsite","P_WO_JOBSITE_COLON":"Jobsite:","P_WO_COST":"Cost","P_WO_COST_COLON":"Cost:","P_WO_COMPONENT":"Component","P_WO_COMPONENT_COLON":"Component:","P_WO_FAILEDDELETESEGMENT":"Failed to delete this segment.","P_WO_DELETESEGMENT":"Delete Segment","P_WO_DESCRIPTIONREQUIRED":"Description is required.","P_WO_HOURSMUSTBEGREATERTHAN0":"Hours must be greater than 0.","P_WO_COSTMUSTBEGREATERTHAN0":"Cost must be greater than 0.","P_WO_WORKORDERCOSTSFORMATERROR":"Work Order Costs format error.","P_WO_HOURSFORMATERROR":"Hours format error.","P_WO_OTHERCOSTFORMATERROR":"Other Cost format error.","P_WO_COSTFORMATERROR":"Cost format error.","P_WO_PARTSCOSTFORMATERROR":"Parts Cost format error.","P_WO_TRAVELTIMECOSTFORMATERROR":"Travel Time Cost format error.","P_WO_TIMETOCOMPLETEFORMATERROR":"Time To Complete format error.","P_WO_DUEDATEFORMATERROR":"Due Date format error.","P_WO_COMPLETEDDATEFORMATERROR":"Completed Date format error.","P_WO_COMPLETEDDATECANNOTBEEMPTY":"Completed Date cannot be empty.","P_WO_DESCRIPTIONCANNOTBEEMPTY":"Description cannot be empty.","P_WO_HOURMETERCANNOTBEEMPTY":"Hour Meter cannot be empty.","P_WO_ODOMETERCANNOTBEEMPTY":"Odometer cannot be empty.","P_WO_HOURMETERFORMATERROR":"Hour Meter format error.","P_WO_ODOMETERFORMATERROR":"Odometer format error.","P_WO_SAVSUCCESSFULLY":"Saved successfully.","P_WO_FAILEDTOSAVESEGMENT":"Failed to save segment.","P_WO_DELETEWORKORDER":"Delete Work Order","P_WO_DOYOUWANTTODELETETHEWORKORDER":"Do you want to delete the work order?","P_WO_DOYOUWANTTODELETETHESEGMENT":"Do you want to delete the segment?","P_WO_WORKORDERCANNOTBEDELETEDBECAUSEITISINUSE":"Work order can not be deleted because it is in use.","P_WO_FAILEDTODELETETHISWORKORDER":"Failed to delete this work order.","P_WO_PLEASESELECTAWORKORDER":"Please select a work order.","P_WO_FAILEDTOLOADALERTS":"Failed to load alerts.","P_WO_FAILEDTOSAVEALERTS":"Failed to save alerts.","P_WO_FAILEDTOSAVEWORKORDER":"Failed to save Work Order.","P_WO_SAVEALERTS":"Save alerts","P_WO_EDITWORKORDER":"Edit Work Order","P_WO_ADDWORKORDER":"Add Work Order","P_WO_DETAILFORWORKORDERARELISTEDBELOW":"Details for work order <{0}> are listed below:","P_WO_ASSETNAME":"Asset Name","P_WO_ASSETNAME_COLON":"Asset Name:","P_WO_ASSETNAMECUSTOM":"Asset Name (Custom)","P_WO_ASSETNAMECUSTOM_COLON":"Asset Name (Custom):","P_WO_ASSETTYPE":"Asset Type","P_WO_CURRENTODOMETER":"Current Odometer","P_WO_CURRENTODOMETER_COLON":"Current Odometer:","P_WO_CURRENTHOURS":"Current Hours","P_WO_CURRENTHOURS_COLON":"Current Hours:","P_WO_CURRJOBSITE":"Current Jobsite","P_WO_CURRJOBSITE_COLON":"Current Jobsite:","P_WO_CURRLOCATION":"Current Location","P_WO_CURRLOCATION_COLON":"Current Location:","P_WO_FAILEDTOGENERATEALERT":"Failed to generate alert.","P_WO_FAILEDTOGENERATEALERT1":"Unable to generate alert because there already exists an unmaintained alert.","P_WO_FAILEDTOGENERATEALERT2":"Unable to generate alert until Hour Meter is higher than ","P_WO_FAILEDTOGENERATEALERT3":"Unable to generate alert until {0} later {1}","P_WO_FAILEDTOGENERATEALERT4":"Unable to generate alert until odometer is higher than ","P_WO_DETAILSFORWORKORDER":"Details for work order ","P_WO_VIEWOREDITTHISWORKORDERLINK":"are listed below. To view or edit this work order (including the entry of hours for scheduled maintenance), you can connect to Fleet Intelligence™ via this","P_WO_LINK":"Link","P_WO_MESSAGEFROM_COLON":"Message from:","P_WO_SELECTCUSTOMER":"Select Customer","P_WO_SHOWALLCUSTOMER":"Show All Customer","P_WO_CONTACTINFORMATION":"Contact Information","P_WO_INTERNALCOMMENTS":"Internal Comments","P_WO_CUSTOMERCOMMUNICATION":"Customer Communication","P_WO_SUMMARY":"Summary","P_WO_CUSTOMER":"Customer","P_WO_CUSTOMER_COLON":"Customer:","P_WO_CONTACTNAME_COLON":"Contact Name:","P_WO_CONTACTPREFERENCES_COLON":"Contact Preferences:","P_WO_TEXT":"Text","P_WO_PHONE":"Phone","P_WO_EMAILADDRESS_COLON":"Email Address:","P_WO_MOBILE_COLON":"Mobile:","P_WO_NEXTFOLLOWUPDATE":"Next Follow Up Date","P_WO_NEXTFOLLOWUPDATE_COLON":"Next Follow Up Date:","P_WO_NEXTFOLLOWUPDATEFORMATERROR":"Next Follow Up Date format error.","P_WO_PLEASESELECTACUSTOMER":"Please select a customer.","P_WO_DELETESTATUSHASBEENUSEDBYWORKORDER":"The current status has been used by work order.","P_WO_STATUSNAMEALREADYEXISTS":"Status name already exists.","P_WO_STATUSSETTING":"Status Setting","P_WO_WORKORDERCONFIGURATION":"Work Order Configuration","P_WO_SMSFOOTNOTES":"SMS Footnotes","P_WO_NAME":"Name","P_WO_NAME_COLON":"Name:","P_WO_COLOR":"Color","P_WO_COLOR_COLON":"Color:","P_WO_WORKORDERSTATUS":"Work Order Status","P_WO_ADDSTATUS":"Add Status","P_WO_EDITSTATUS":"Edit Status","P_WO_DELETESTATUS":"Delete Status","P_WO_NAMENOTBEEMPTY":"Name cannot be empty.","P_WO_COLOREMPTY":"Color cannot be empty.","P_WO_FAILEDTOSAVESTATUS":"Failed to save status.","P_WO_DOYOUWANTTODELETETHISSTATUS":"Do you want to delete this status?","P_WO_FAILEDTODELETETHISSTATUS":"Failed to delete this status.","P_WO_CREATEDDATE":"Created Date","P_WO_CREATIONDATE":"Creation Date","P_WO_CUSTOMERCODE":"Customer Code","P_WO_ADDCONTACTRECORD":"Add Contact Record","P_WO_EDITCONTACTRECORD":"Edit Contact Record","P_WO_WORKORDERONLY":"Work Order Only","P_WO_CONTACTNAMEANDMOBILEUNIQUECOMBINATION":"Contact name and contact mobile must be a unique combination.","P_WO_CONTACTS":"Contacts","P_WO_PLEASEINPUTTHEPHONENUMBER":"Please input the phone number.","P_WO_PLEASEINPUTTHEPHONENUMBEROREMAL":"Please input the phone number or email.","P_WO_PHONENUMBERISINVALID":"Phone number is invalid.","P_WO_PLEASEINPUTTHEMESSAGE":"Please input the message.","P_WO_DISABLEAUTOUPDATES":"Disable Auto Updates","P_WO_ADVISOR":"Advisor","P_WO_ADVISOR_COLON":"Advisor:","P_WO_DEPARTMENT":"Department","P_WO_DEPARTMENT_COLON":"Department:","P_WO_LOCATION":"Location","P_WO_LOCATION_COLON":"Location:","P_WO_LASTCOMMUNICATIONTEXT":"Last Communication Text","P_WO_LASTCOMMUNICATIONDATE":"Last Communication Date","P_WO_LASTCOMMUNICATIONBY":"Last Communication By","P_WO_DISPLAYCOMPLETEDWORKORDERS":"Display Completed Work Orders","P_WO_SAVELOCATIONANDDEPARTMENTSEARCH":"Save Location, Department, Advisor and Order type Search","P_WO_SAVEDEFAULT":"Save Default","P_WO_AVAILABLETOTECHNICANS":"Available to Technicians","P_WO_AVAILABLETOTECHNICANS_COLON":"Available to Technicians:","P_WO_AUTOUPDATECUSTOMER":"Auto Update Customer","P_WO_AUTOUPDATECUSTOMER_COLON":"Auto Update Customer:","P_WO_MESSAGE":"Message","P_WO_MESSAGE_COLON":"Message:","P_WO_STATUSCODE":"Status Code","P_WO_STATUSCODE_COLON":"Status Code:","P_WO_FOLLOWUPMESSAGE":"Follow Up Message","P_WO_FOLLOWUPMESSAGE_COLON":"Follow Up Message:","P_WO_WAITINGPERIOD":"Waiting Period","P_WO_ISREPEATING":"Repeating?","P_WO_ONETIME":"One Time","P_WO_REPEATING":"Repeating","P_WO_INTERNALCOMMUNICATIONADDED":"Internal communication added","P_WO_SENDINTERNALCOMMENTS":"Send Internal Comments","P_WO_INSPECTIONATTACHMENTS":"Inspection Attachments","P_WO_WORKORDERATTACHMENTS":"Work Order Attachments","P_WO_INSPECTIONS":"Inspections","P_WO_NOINSPECTION":"No Inspection","P_WO_SAVEWORKORDER":"Save Work Order","P_WO_AARIABLES_COLON":"Aariables:","P_WO_AVAILABLETOCUSTOMER":"Available to Customer","P_WO_VISIBLETOCUSTOMER":"Visible To Customer","P_WO_PHONENUMBER":"Phone Number","P_WO_EDITNOTES":"Edit Notes","P_WO_EDITDESCRIPTION":"Edit Description","P_WO_STATUSCHANGE":"Status Change","P_WO_SEND":"Send","P_WO_SENDANDSAVE":"Send And Save","P_WO_SENDUPDATETOCUSTOMER":"Send Update To Customer","P_WO_THEMOBILENUMBERISINVALID":"The mobile number {0} is invalid.","P_WO_ASSETATTACHMENTS":"Asset Attachments","P_WO_INSPECTIONREQUIRED_COLON":"Inspection Required:","P_WO_INSPECTIONCOMPLETED_COLON":"Inspection Completed:","P_WO_INSPECTIONREQUIREDTIP":"The work order cannot be updated Until an inspection is completed.","P_WO_COMPLETEDDATETIPS":"Completed Date has been entered. Plese choose a Completed Status.","P_WO_ALTERNATESTATUS":"Alternate Status","P_WO_ALTERNATESTATUS_COLON":"Alternate Status:","P_WO_SITEDEFAULTLAYOUT":"Company Default Layout","P_WO_DEFAULTONOPEN":"Default on Open","P_WO_DEFAULTONOPEN_COLON":"Default on Open:","P_WO_PARTSEXPECTEDDATEFORMATERROR":"Parts Expected Date format error.","P_WO_LASTLABORDATEFORMATERROR":"Last Labor Date format error.","P_WO_INCLUDESTATUSLINK":"Include Status Link","P_WO_SENTTO_COLON":"Sent To :","P_WO_SENT":"Sent","P_WO_ESTIMATES":"Estimates","P_WO_ADDESTIMATE":"Add Estimate","P_WO_EDITESTIMATE":"Edit Estimate","P_WO_REVOKE":"Revoke","P_WO_REVOKEESTIMATE":"Revoke Estimate","P_WO_PUBLISH":"Publish","P_WO_PUBLISHESTIMATE":"Publish Estimate","P_WO_DRAFT":"Draft","P_WO_AWAITINGCUSTOMERAPPROVAL":"Awaiting Customer Approval","P_WO_CANCELLEDBYDEALER":"Cancelled by Dealer","P_WO_CUSTOMERREJECTED":"Customer Rejected","P_WO_CUSTOMERAPPROVED":"Customer Approved","P_WO_NONE":"None","P_WO_ESTIMATENUMBER":"Estimate #","P_WO_ESTIMATENUMBER_COLON":"Estimate #:","P_WO_ESTIMATESTATUS":"Estimate Status","P_WO_ESTIMATESTATUS_COLON":"Estimate Status:","P_WO_ESTIMATETOTALCOST_COLON":"Estimate Total Cost ($):","P_WO_ESTIMATETOTALCOST":"Estimate Total Cost ($)","P_WO_CUSTOMERISSUES":"Customer Issues","P_WO_CUSTOMERISSUES_COLON":"Customer Issues:","P_WO_TECHNICIANNOTES_COLON":"Technician Notes:","P_WO_TECHNICIANNOTES":"Technician Notes","P_WO_CUSTOMERRESPONSENAME_COLON":"Customer Response Name:","P_WO_CUSTOMERRESPONSETIME_COLON":"Customer Response Time:","P_WO_REJECTEDBY_COLON":"Rejected By:","P_WO_REJECTEDBY":"Rejected By","P_WO_APPROVEDBY_COLON":"Approved By:","P_WO_APPROVEDBY":"Approved By","P_WO_REJECTEDTIME_COLON":"Rejected Time:","P_WO_REJECTEDTIME":"Rejected Time","P_WO_REASONFORREJECTION_COLON":"Reason for Rejection:","P_WO_REASONFORREJECTION":"Reason for Rejection: ","P_WO_APPROVEDTIME_COLON":"Approved Time:","P_WO_APPROVEDTIME":"Approved Time","P_WO_CUSTOMERNOTES_COLON":"Customer Notes:","P_WO_CUSTOMERNOTES":"Customer Notes","P_WO_DELETEESTIMATE":"Delete Estimate","P_WO_DOYOUWANTTODELETETHEESTIMATE":"Do you want to delete the estimate?","P_WO_FAILEDTODELETETHISESTIMATE":"Failed to delete this estimate.","P_WO_DOYOUWANTTOREVOKETHEESTIMATE":"Do you want to revoke the estimate?","P_WO_FAILEDTOREVOKETHISESTIMATE":"Failed to revoke this estimate.","P_WO_FAILEDTORSAVEESTIMATE":"Failed to save estimate.","P_WO_FAILEDTOPUBLISHTHISESTIMATE":"Failed to publish this estimate.","P_WO_WORKORDERMESSAGETITLE":"Message from {0} regarding Work Order {1}","P_WO_WORKORDERMESSAGE_SINCERELY1":"Please feel free to respond to the message by replying to this email.","P_WO_WORKORDERMESSAGE_SINCERELY":"Sincerely,","P_WO_WORKORDERMESSAGE_CLICK":"For Status Information, click ","P_WO_WORKORDERMESSAGE_HERE":"here.","P_WO_SIGNATURE_COLON":"Signature:","P_WO_CAPTION_COLON":"Caption:","P_WO_THECURRENTREGIONHASBEENUSEDBYJOBSITE":"The current region has been used by jobsite.","P_WO_SENDWORKORDERSURVEYS":"Send Work Order Surveys","P_WO_TEMPLATES_COLON":"Templates:","P_WO_CONTACTS_COLON":"Contacts:","P_WO_ADDATTACHMENT":"Add Attachment","P_WO_PUBLISHEDESTIMATES":"Published Estimates","P_WO_APPROVEDESTIMATES":"Approved Estimates","P_WO_REJECTEDESTIMATES":"Rejected Estimates","P_WO_PENDINGESTIMATES":"Pending Estimates","P_WO_WORKORDERASSIGNMENT":"Work Order Assignment","P_WO_YOUAREREASSIGNINGTHISWORKORDER":"You are reassigning this work order.","P_WO_AREYOUSURETHATYOUWANTTOPROCEED":"Are you sure that you want to proceed ?","P_WO_YOUAREREASSIGNINGTHISWORKORDERTOACLOSEDWORKORDER":"You are reassigning this Work Order to a CLOSED Work Order.","P_WO_COMMUNICATIONACKNOWLEDGED":"Communication Acknowledged","P_WO_INVOICES":"Invoices","P_WO_INVOICENUMBER_PDF":"Invoice #","P_WO_INVOICENUMBER":"Invoice #:","P_WO_INVOICESTATUS_COLON":"Invoice Status","P_WO_INVOICESTATUS":"Invoice Status:","P_WO_PAYMENTTIME":"Payment Time:","P_WO_PAYMENTTIME_COLON":"Payment Time","P_WO_CARDNUMBER":"Card Number:","P_WO_CARDNUMBER_COLON":"Card Number","P_WO_CUSTOMERNAME":"Customer Name:","P_WO_CUSTOMERNAME_COLON":"Customer Name","P_WO_EXPIRATION":"Expiration:","P_WO_EXPIRATION_COLON":"Expiration","P_WO_CUSTOMEREMAIL":"Customer Email:","P_WO_CUSTOMEREMAIL_COLON":"Customer Email","P_WO_CARDTYPE":"Card Type:","P_WO_CARDTYPE_COLON":"Card Type","P_WO_COUNTRY":"Country","P_WO_COUNTRY_COLON":"Country:","P_WO_ISSUER":"Issuer:","P_WO_ISSUER_COLON":"Issuer","P_WO_INVOICETOTALCOST":"Invoice Total Cost ($):","P_WO_INVOICETOTALCOST_COLON":"Invoice Total Cost ($)","P_WO_TAXES":"Taxes ($)","P_WO_TAXES_COLON":"Taxes ($):","P_WO_CONFIRM_REVOKE_INVOICE":"Do you want to revoke the invoice?","P_WO_REVOKE_INVOICE":"Revoke Invoice","P_WO_FAILED_REVOKE_INVOICE":"Failed to revoke this invoice.","P_WO_CONFIRM_DELETE_INVOICE":"Do you want to delete the invoice?","P_WO_DELETE_INVOICE":"Delete Invoice","P_WO_FAILED_DELETE_INVOICE":"Failed to delete this invoice.","P_WO_ADDINVOICE":"Add Invoice","P_WO_EDITINVOICE":"Edit Invoice","P_WO_FAILED_SAVE_INVOICE":"Failed to save invoice.","P_WO_AWATING_PAYMENT":"Awaiting Payment","P_WO_CUSTOMER_PAID":"Customer Paid","P_WO_PAYMENT_FAILURE":"Payment Failure","P_WO_REVOKED":"Revoked","P_WO_CUSTOMERVISIBLE":"Customer Visible","P_WO_FAILED_PUBLISH_INVOICE":"Failed to publish this invoice.","P_WO_PUBLISH_INVOICE":"Publish Invoice","P_WO_OTHERCOST_INVALID":"Other cost is not a valid number.","P_WO_PARTSCOST_INVALID":"Parts cost is not a valid number.","P_WO_TRAVELTIMECOST_INVALID":"Travel time cost is not a valid number.","P_WO_LABORCOST_INVALID":"Labor cost is not a valid number.","P_WO_TIMETOCOMPLETE_INVALID":"Time to complete is not a valid number.","P_WO_TOTALCOST_INVALID":"Total cost is not a valid number.","P_WO_TAXES_INVALID":"Taxes is not a valid number.","P_WO_TOTALCOST_MUST_POSITIVE":"Total cost must be a positive number.","P_WO_SMSAUTOSENDSCHEDULE":"SMS Auto-Send Schedule","P_WO_SAVESMSAUTOSENDSCHEDULEFAILED":"Failed to save SMS Auto-Send schedule.","P_WO_SETSCHEDULEFORAUTOMATICSMS":"Set Schedule for Automatic SMS Communications","P_WO_AUTOSENDCOMMUNICATIONENABLED":"Auto-send Communication Enabled","P_WO_HIS_UPDATEDTOAFROMB":"Updated to {0} from {1}","P_WO_HIS_UPDATEDTOA":"Updated to {0}","P_WO_HIS_WORKORDERCREATED":"Work Order Created","P_WO_HIS_WORKORDERCLOSED":"Work Order Closed","P_WO_HIS_WORKORDERREOPENED":"Work Order Re_Opened","P_WO_HIS_PUBLISHEDTOCUSTOMER":"Published To Customer","P_WO_HIS_DRAFTCREATED":"Draft Created","P_WO_HIS_WORKORDERDELETED":"Work Order Deleted","P_WO_HIS_DELETED":"Deleted","P_WO_HIS_REVOKED":"Revoked","P_WO_HIS_CUSTOMERREJECTED":"Customer Rejected","P_WO_HIS_CUSTOMERAPPROVED":"Customer Approved","P_WO_HIS_REQUIREDBOXCHECKED":"Required Box Checked ","P_WO_HIS_REQUIREDBOXUNCHECKED":"Required Box Unchecked ","P_WO_HIS_NOWVISIBLETOCUSTOMER":"now Visible to Customer","P_WO_HIS_NOWNOTVISIBLETOCUSTOMER":"now NOT Visible to Customer","P_WO_HIS_COMPLETED":"Completed","P_WO_HIS_CUSTOMERCREATEDAPAYMENTLINK":"Customer created a payment link","P_WO_HIS_CUSTOMERPAID":"Customer Paid","P_WO_HIS_PAYMENTFAILURE":"Payment Failure","P_WO_HIS_SEGMENTCREATED":"Segment Created","P_WO_HIS_SEGMENTMODIFIED":"Segment Modified","P_WO_HIS_SEGMENTDELETED":"Segment Deleted","P_WO_HIS_COMPLETEDBOXCHECKED":"Completed Box Checked","P_WO_HIS_COMPLETEDBOXUNCHECKED":"Completed Box Unchecked","P_WO_HIS_ADDED":"Added","P_WO_HIS_REMOVED":"Removed","P_WO_HIS_DESCRIPTIONUPDATED":"Description Updated","P_WO_HIS_SEGMENTDESCRIPTIONUPDATED":"Segment Description Updated","P_WO_HIS_BILLABLEBOXCHECKED":"Billable Box Checked","P_WO_HIS_BILLABLEBOXCUNHECKED":"Billable Box Unchecked","P_WO_HIS_WASUPLOADED":"was uploaded","P_WO_HIS_WASDELETED":"was deleted","P_WO_WORKORDERREPORT":"Report","P_WO_WORKORDERREPORT_CONFIM":"Should only customer facing items be included?","P_WO_CALCULATINGTOTALS":"Calculating Totals","P_WO_INFORMATIONREGARDING":"Information Regarding Work Order {0}","P_WO_CUSTOMERMESSAGESENTBY":"Customer Message Sent by {0}","P_WO_INTERNALMESSAGESENTBY":"Internal Message Sent by {0}","P_WO_INTERNALMESSAGEPOSTBY":"Internal Message Posted by {0}","P_WO_CUSTOMERMESSAGERECEIVEDFROM":"Customer Message Received From {0}","P_WO_COMPANYNAME_COLON":"Company Name:","P_WO_COLON":"WO:","P_WO_DONOTREPLYTOTHISEMAILTOREPLY":"DO NOT REPLY to this email. To reply:","P_WO_DONOTREPLYTOTHISTEXTOREPLY":"DO NOT REPLY to this text. To reply:","P_WO_AUTOMATEDMESSAGE":"Automated Message","P_WO_ESTIMATEDECLINEDBY":"Estimate Declined by {0}","P_WO_ESTIMATEACCEPTEDBY":"Estimate Accepted by {0}","P_WO_NOTE_COLON":"Note:","P_PREVENTATIVEMAINTENANCEPLAN":"Preventative Maintenance Plan","P_PM_PAGEERROR":"An unknown error occurred. Please refresh page.","P_PM_QUERY":"Query","P_PM_ABSOLUTEHOURSMAINTENANCE":"Absolute Hours Maintenance","P_PM_MANAGEABSOLUTEHOURSMAINTENANCEASSETS":"Manage Absolute Hours Maintenance Assets","P_PM_RELATIVEETIMEMAINTENANCE":"Relative Time Maintenance","P_PM_TIMEBASEDMAINTENANCE":"Time Based Maintenance","P_PM_HOURS":"Hours","P_PM_MILE":"Mile","P_PM_KILOMETER":"Kilometer","P_PM_ADD":"Add","P_PM_EDIT":"Edit","P_PM_DELETE":"Delete","P_PM_REMOVE":"Remove","P_PM_SAVE":"Save","P_PM_SAVE1":"Save and Exit","P_PM_SAVE2":"Exit Without Saving","P_PM_REFRESH":"Refresh","P_PM_OK":"OK","P_PM_CANCEL":"Cancel","P_PM_SETASSETS":"Set Assets","P_PM_MANAGESCHEDULE":"Manage schedule","P_PM_MANAGEASSETS":"Manage assets","P_PM_ADDABSOLUTEHOURSINTERVAL":"Add Absolute Hours Interval","P_PM_SERVICENAME":"Service Name","P_PM_SERVICENAME_COLON":"Service Name:","P_PM_INTERVAL":"Interval","P_PM_INTERVAL_COLON":"Interval:","P_PM_NOTIFICATIONPERIOD":"Notification Period","P_PM_NOTIFICATIONPERIOD_COLON":"Notification Period:","P_PM_RECURRING":"Recurring","P_PM_RECURRING_COLON":"Recurring:","P_PM_SERVICEDESCRIPTION":"Service Description","P_PM_SERVICEDESCRIPTION_COLON":"Service Description:","P_PM_EXPECTEDCOST":"Expected Cost","P_PM_EXPECTEDCOST_COLON":"Expected Cost:","P_PM_PRIORITY":"Priority","P_PM_PRIORITY_COLON":"Priority:","P_PM_UPDATEINTERVAL":"Update Interval","P_PM_SN":"SN","P_PM_NAME":"Name","P_PM_NAME_COLON":"Name:","P_PM_ODOMETERUOM_COLON":"Odometer UOM:","P_PM_DESCRIPTION_COLON":"Description:","P_PM_MAKE":"Make","P_PM_MODEL":"Model","P_PM_CURRENTHOURS":"Current Hours","P_PM_STARTINGHOURS":"Starting Hours","P_PM_CURRENTODOMETER":"Current Odometer","P_PM_STARTODOMETER":"Start Odometer","P_PM_PLANSTARTDATE":"Plan Start Date","P_PM_STARTINTERVAL":"Start Interval","P_PM_ASSETASSIGNMENT":"Asset Assignment","P_PM_INTERVALS_COLON":"Intervals:","P_PM_ADDINTERVAL":"Add Interval","P_PM_ASSETSTYPE_COLON":"Assets Type:","P_PM_FILTER":"Filter","P_PM_SERVICENAMENOTBEEMPTY":"Service Name cannot be empty.","P_PM_INTERVALMUSTBEANUMBER":"Interval must be a number.","P_PM_EXPECTEDCOSTFORMATERROR":"Expected Cost format error.","P_PM_NOTIFICATIONPERIODMUSTBEANUMBER":"Notification Period must be a number.","P_PM_PRIORITYUSTBEANUMBER":"Priority must be a number.","P_PM_NOTIFICATIONPERIODMUSTLESSOREQUALINTERVAL":"Notification period must be less than or equal to the Interval.","P_PM_PRIORITYNOTLESS0":"Priority cannot be less than 0.","P_PM_DELETETHISINTERVAL":"Do you want to delete this interval?","P_PM_DELETETHISSCHEDULE":"Do you want to delete this schedule?","P_PM_NORESULTS":"No results.","P_PM_SAVEASSETLISTSUCCESSFUL":"Save asset list successful.","P_PM_FAILEDTOSAVEASSETLIST":"Failed to save asset list.","P_PM_DOYOUWANTTOREMOVEHESELECTEDASSETSFROMTHISSCHEDULE":"Do you want to remove the selected assets from this schedule?","P_PM_DELETEUNASSIGNEDPMALERTSFORTHEFOLLOWINGASSETSTIPS":"Select OK below will result in the deletion of existing unassigned PM alerts for the following assets: ","P_PM_DELTEALERTSYESORNOTIPS":"If you do not want those alerts deleted, select CANCEL and assign appropriate alerts to a maintenance record or work order in asset health prior to deletion/removal.","P_PM_REMOVEASSETS":"Remove Assets","P_PM_ASSETSREMOVEDSUCCESSFULLY":"Assets removed successfully.","P_PM_FAILEDTOREMOVEASSETS":"Failed to remove assets.","P_PM_MANAGETIMEBASEDMAINTENANCESCHEDULE":"Manage Time Based Maintenance Schedule","P_PM_EDITTIMEBASEDMAINTENANCESCHEDULE":"Edit Time Based Maintenance Schedule","P_PM_MANAGEHOURSMAINTENANCESCHEDULE":"Manage Hours Maintenance Schedule","P_PM_EDITHOURSMAINTENANCESCHEDULE":"Edit Hours Maintenance Schedule","P_PM_MANAGEABSOLUTEDISTANCEMAINTENANCESCHEDULE":"Manage Absolute Distance Maintenance Schedule","P_PM_EDITABSOLUTEDISTANCEMAINTENANCESCHEDULE":"Edit Absolute Distance Maintenance Schedule","P_PM_MANAGERELATIVEDISTANCEMAINTENANCESCHEDULE":"Manage Relative Distance Maintenance Schedule","P_PM_EDITRELATIVEDISTANCEMAINTENANCESCHEDULE":"Edit Relative Distance Maintenance Schedule","P_PM_MANAGEABSOLUTEHOURSMAINTENANCESCHEDULE":"Manage Absolute Hours Maintenance Schedule","P_PM_EDITABSOLUTEHOURSMAINTENANCESCHEDULE":"Edit Absolute Hours Maintenance Schedule","P_PM_MANAGETIMEBASEDMAINTENANCEASSETS":"Manage Time Based Maintenance Assets","P_PM_RELATIVEEHOURSMAINTENANCE":"Relative Hours Maintenance","P_PM_HOURSMAINTENANCE":"Hours Maintenance","P_PM_MANAGEHOURSMAINTENANCEASSETS":"Manage Hours Maintenance Assets","P_PM_ABSOLUTEDISTANCEMAINTENANCE":"Absolute Distance Maintenance","P_PM_MANAGEABSOLUTEDISTANCEMAINTENANCEASSETS":"Manage Absolute Distance Maintenance Assets","P_PM_RELATIVEDISTANCEMAINTENANCE":"Relative Distance Maintenance","P_PM_MANAGERELATIVEDISTANCEMAINTENANCEASSETS":"Manage Relative Distance Maintenance Assets","P_PM_SCHEDULEDETAIL":"Schedule Detail","P_PM_FAILEDTOLOADDATA":"Failed to load data: ","P_PM_FAILEDTOSAVESCHEDULE":"Failed to save schedule: ","P_PM_SCHEDULENAMECANNOTBEEMPTY":"Schedule Name cannot be empty.","P_PM_SAVSUCCESSFULLY":"Saved successfully.","P_PM_SCHEDULEASSETS":"Schedule Assets","P_PM_ADDTIMEBASEDNTERVAL":"Add TimeBased Interval","P_PM_ADDHOURSTERVAL":"Add Hours Interval","P_PM_ADDABSOLUTEDISTANCEINTERVAL":"Add Absolute Distance Interval","P_PM_ADDDISTANCEINTERVAL":"Add Distance Interval","P_PM_MAINTENANCESCHEDULES":"Maintenance Schedules","P_PM_MANAGEMAINTENANCESCHEDULE":"Manage Maintenance Schedule","P_PM_ASSET_COLON":"Asset:","P_PM_PLAN_COLON":"Plan:","P_PM_PLANTYPE_COLON":"Plan Type:","P_PM_COPYSCHEDULE":"Copy Schedule","P_MAINTENANCERECORDS":"Maintenance Records","P_MAINTENANCERECORDSMANAGEMENT":"Maintenance Records Management","P_MAINTENANCERECORDLEGACY":"Maintenance Record","P_MRM_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MRM_QUERY":"Query","P_MRM_ADD":"Add","P_MRM_EDIT":"Edit","P_MRM_DELETE":"Delete","P_MRM_REFRESH":"Refresh","P_MRM_SEARCH":"Search","P_MRM_OK":"OK","P_MRM_CANCEL":"Cancel","P_MRM_SAVE":"Save","P_MRM_SAVE1":"Save and Exit","P_MRM_SAVE2":"Exit Without Saving","P_MRM_EXIT":"Exit","P_MRM_ASSETID":"Asset ID","P_MRM_ASSETID1":"AssetID","P_MRM_ASSETID1_COLON":"AssetID:","P_MRM_SN":"SN","P_MRM_SN_COLON":"SN:","P_MRM_NAME":"Name","P_MRM_MAINTENANCEDATE":"Maintenance Date","P_MRM_MAINTENANCEDATE_COLON":"Maintenance Date:","P_MRM_MAINTENANCETYPE":"Maintenance Type","P_MRM_MAINTENANCETYPE_COLON":"Maintenance Type:","P_MRM_HOURS":"Hours","P_MRM_DISTANCE":"Distance","P_MRM_UNDERCARRIAGE":"Undercarriage","P_MRM_TIMEOFFROAD":"Time/Off-Road","P_MRM_TIMEOVERROAD":"Time/Over-Road","P_MRM_MAINTENANCEHOURS":"Maintenance Hours","P_MRM_MAINTENANCEHOURS_COLON":"Maintenance Hours:","P_MRM_MAINTENANCEDISTANCE":"Maintenance Distance","P_MRM_MAINTENANCEDISTANCE_COLON":"Maintenance Distance:","P_MRM_DISTANCEUOM":"Distance UOM","P_MRM_MILE":"Mile","P_MRM_KILOMETER":"Kilometer","P_MRM_COST":"Cost","P_MRM_COST_COLON":"Cost:","P_MRM_INVOICENUMBER":"Invoice Number","P_MRM_INVOICENUMBER_COLON":"Invoice Number:","P_MRM_COMPLETEDBY":"Completed By","P_MRM_COMPLETEDBY_COLON":"Completed By:","P_MRM_DESCRIPTION":"Description","P_MRM_DESCRIPTION_COLON":"Description:","P_MRM_ATTACHMENTS_COLON":"Attachments:","P_MRM_ADDFILE":"Add File...","P_MRM_MAKE":"Make","P_MRM_MAKE_COLON":"Make:","P_MRM_MODEL":"Model","P_MRM_MODEL_COLON":"Model:","P_MRM_ASSETTYPE":"Type","P_MRM_ASSETTYPE_COLON":"Type:","P_MRM_TYPE_COLON":"Type:","P_MRM_ALERTID":"Alert ID","P_MRM_ALERTTITLE":"Alert Title","P_MRM_ALERTTYPE":"Alert Type","P_MRM_ALERTTIME":"Alert Time","P_MRM_ATTACHMENT":"Attachment","P_MRM_SYSTEMINFORMATION":"System Information","P_MRM_DELETETHERECORD":"Would you like to delete the record?","P_MRM_ERROR":"Error","P_MRM_MAINTENANCEINFORMATION":"Maintenance Information","P_MRM_PMALERT_COLON":"PM Alert:","P_MRM_ITEMSMUSTREQUIRED":"The items with * are required.","P_MRM_DATEFORMATERROR":"Date format error.","P_MRM_MAINTENANCEDATENOTBEINTHEFUTURE":"Maintenance Date cannot be in the future.","P_MRM_MAINTENANCEHOURSVALUEMUSTBEGREATERTHAN0":"Maintenance Hours value must be greater than 0.","P_MRM_MAINTENANCEDISTANCEVALUEMUSTBEGREATERTHAN0":"Maintenance Distance value must be greater than 0.","P_MRM_COSTVALUEMUSTBEGREATERTHAN0":"Cost Value must be greater than 0.","P_MRM_SAVSUCCESSFULLY":"Saved successfully.","P_MRM_FAILEDTOSAVETHEUSERISNOTLOGGED":"Failed to save,The user is not logged.","P_MRM_SAVEMAINTENANCERECORD":"Save Maintenance Record","P_MRM_FAILEDTOSAVEMAINTENANCERECORD":"Failed to save Maintenance Record.","P_MRM_ATTACHMENTS":"Attachment File","P_MRM_ATTACHMENTSTIPS":"Attachment size is 0kb, uploading failed.","P_MRM_ATTACHMENTSTIPS1":"Attachment is too large. Maximum file size is 50 MB.","P_MRM_DELETEATTACHMENT":"Delete Attachment","P_MRM_DELETEATTACHMENTTIPS":"Are you sure you want to delete the attachment?","P_MRM_FAILEDDELETEATTACHMENT":"Failed to delete this attachment.","P_MRM_ADDMAINTENANCERECORD":"Add Maintenance Record","P_MRM_SEARCHASSET":"Search Asset","P_MRM_ASSETNAME":"Asset Name","P_MRM_ASSETNAME_COLON":"Asset Name:","P_MRM_ENGINEHOURS_COLON":"Engine Hours:","P_MRM_ASSETINFORMATION":"Asset Information","P_MRM_DATE":"Date","P_MRM_SAVEWORKORDERFIRST":"Please select an Asset.","P_MRM_DELETEDSUCCESSFULLY":"Deleted Successfully.","P_MRM_FAILEDTODELETERECORD":"Failed to delete record.","P_FUELRECORDS":"Fuel Records","P_FR_PAGEERROR":"An unknown error occurred. Please refresh page.","P_FR_QUERY":"Query","P_FR_ERROR":"Error","P_FR_ADD":"Add","P_FR_EDIT":"Edit","P_FR_DELETE":"Delete","P_FR_REFRESH":"Refresh","P_FR_SEARCH":"Search","P_FR_OK":"OK","P_FR_CANCEL":"Cancel","P_FR_SAVE":"Save","P_FR_SAVE1":"Save and Exit","P_FR_SAVE2":"Exit Without Saving","P_FR_SAVE3":"Save and Add New","P_FR_CLOSE":"Close","P_FR_ADDNEW":"Add New","P_FR_ASSETTYPE":"Type","P_FR_ASSETTYPE_COLON":"Type:","P_FR_BEGINDATE":"Begin Date","P_FR_BEGINDATE_COLON":"Begin Date:","P_FR_ENDDATE":"End Date","P_FR_ENDDATE_COLON":"End Date:","P_FR_SUMMARY":"Summary","P_FR_NOTES":"Notes","P_FR_NOTES_COLON":"Notes:","P_FR_ASSETINFORMATION":"Asset Information","P_FR_ASSETNAME":"Asset Name","P_FR_MAKE":"Make","P_FR_MAKE_COLON":"Make:","P_FR_MODEL":"Model","P_FR_MODEL_COLON":"Model:","P_FR_SNVIN":"VIN/SN","P_FR_VIN":"VIN","P_FR_VIN_COLON":"VIN:","P_FR_FUELRECORDINFORMATION":"Fuel Record Information","P_FR_DATASOURCE":"Data Source","P_FR_DATASOURCE_COLON":"Data Source:","P_FR_TRANSACTIONDATE":"Transaction Date","P_FR_TRANSACTIONDATE_COLON":"Transaction Date:","P_FR_TRANSACTIONTIME":"Transaction Time","P_FR_TRANSACTIONTIME_COLON":"Transaction Time:","P_FR_TICKETRECEIPTNUMBER_COLON":"Ticket/Receipt Number:","P_FR_TICKETNUMBER":"Ticket Number","P_FR_DRIVERNAME":"Driver Name","P_FR_DRIVERNAME_COLON":"Driver Name:","P_FR_DISTRIBUTEDBY":"Distributed By","P_FR_DISTRIBUTEDBY_COLON":"Distributed By:","P_FR_FUELINGSTATION":"Fueling Station","P_FR_FUELINGSTATION_COLON":"Fueling Station:","P_FR_FUELINGASSET":"Fueling Asset","P_FR_RETAILERNAME":"Retailer Name","P_FR_RETAILERNAME_COLON":"Retailer Name:","P_FR_ASSET":"Asset","P_FR_ASSET_COLON":"Asset:","P_FR_SELCT":"Select","P_FR_RETAILERADDRESS":"Retailer Address","P_FR_RETAILERADDRESS_COLON":"Retailer Address:","P_FR_ADDRESS":"Address","P_FR_CITY":"City","P_FR_CITY_COLON":"City:","P_FR_STATE":"State","P_FR_STATE_COLON":"State:","P_FR_ZIP":"Zip","P_FR_ZIP_COLON":"Zip:","P_FR_ODOMETER":"Odometer","P_FR_ODOMETER_COLON":"Odometer:","P_FR_ODOMETERUOM":"Odometer UOM","P_FR_ODOMETERUOM_COLON":"Odometer UOM:","P_FR_MILE":"Mile","P_FR_KILOMETER":"Kilometer","P_FR_FUELTYPE":"Fuel Type","P_FR_FUELTYPE_COLON":"Fuel Type:","P_FR_BRANDNAME":"Brand Name","P_FR_BRANDNAME_COLON":"Brand Name:","P_FR_UNITOFMEASURE":"Unit of Measure","P_FR_UNITOFMEASURE_COLON":"Unit of Measure:","P_FR_GALLON":"Gallon","P_FR_LITRE":"Litre","P_FR_QUANTITY":"Quantity","P_FR_QUANTITY_COLON":"Quantity:","P_FR_UOM":"UOM","P_FR_UOMCOST":"Unit Cost","P_FR_UOMCOST_COLON":"Unit Cost:","P_FR_TOTALCOST":"Total Cost","P_FR_TOTALCOST_COLON":"Total Cost:","P_FR_ADDEDNAME":"Added Name","P_FR_ADDEDON":"Added On","P_FR_LASTUPDATEDNAME":"Last Updated Name","P_FR_LASTUPDATEDON":"Last Updated On","P_FR_ADDFUELRECORD":"Add Fuel Record","P_FR_EDITFUELRECORD":"Edit Fuel Record","P_FR_PLEASESELECTAFUELRECORD":"Please select a fuel record.","P_FR_ASSETNOTEMPTY":"Asset cannot be empty.","P_FR_TRANSACTIONDATEISEQUIRED":"Transaction Date is required.","P_FR_RETAILERNAMEISEQUIRED":"Retailer name is required.","P_FR_ASSETISEQUIRED":"Asset is required.","P_FR_RETAILERCITYISEQUIRED":"Retailer City is required.","P_FR_RETAILERSTATEISEQUIRED":"Retailer State is required.","P_FR_FUELTYPEISEQUIRED":"Fuel Type is required.","P_FR_UNITOFMEASUREISEQUIRED":"Unit of Measure is required.","P_FR_QUANTITYISEQUIRED":"Quantity is required.","P_FR_UNITCOSTISEQUIRED":"Unit Cost is required.","P_FR_ODOMETERFORMATERROR":"Odometer format error.","P_FR_QUANTITYFORMATERROR":"Quantity format error.","P_FR_UNITCOSTFORMATERROR":"Unit Cost format error.","P_FR_SAVEFUELRECORD":"Save Fuel Record","P_FR_SAVSUCCESSFULLY":"Saved successfully.","P_FR_FAILEDTOSAVEFUELRECORD":"Failed to save fuel record.","P_FR_DELETEFUELRECORD":"Delete Fuel Record","P_FR_DOYOUDELETETHEFULERECORD":"Do you want to delete the fuel record?","P_FR_FAILEDTODELETETHISFUELRECORD":"Failed to delete this fuel record.","P_FR_ATTACHMENTS_COLON":"Attachments:","P_FR_ADDFILE":"Add File...","P_FR_ATTACHMENTS":"Attachment File","P_FR_ATTACHMENTSTIPS":"Attachment size is 0kb, uploading failed.","P_FR_ATTACHMENTSTIPS1":"Attachment is too large. Maximum file size is 50 MB.","P_FR_DELETEATTACHMENT":"Delete Attachment","P_FR_DELETEATTACHMENTTIPS":"Are you sure you want to delete the attachment?","P_FR_FAILEDDELETEATTACHMENT":"Failed to delete this attachment.","P_FR_PLEASEINPUTTHECOMMENT":"Please input the comment.","P_FR_SUBMIT":"Submit","P_FR_VIEWCHANGEHIS":"View Change History","P_FR_FUELRECORDCHANGEHISTORY":"Fuel Record Change History","P_CREDENTIALS":"Credentials","P_CRE_PAGEERROR":"An unknown error occurred. Please refresh page.","P_CRE_ADD":"Add","P_CRE_EDIT":"Edit","P_CRE_DELETE":"Delete","P_CRE_REFRESH":"Refresh","P_CRE_SEARCH":"Search","P_CRE_OK":"OK","P_CRE_CANCEL":"Cancel","P_CRE_ADDMANUFACTURE":"Add Credential","P_CRE_EDITMANUFACTURE":"Edit Credential","P_CRE_SAVEMANUFACTURE":"Save Credential","P_CRE_MANUFACTURE":"Manufacture","P_CRE_MANUFACTURE_COLON":"Manufacture:","P_CRE_CAT":"CAT","P_CRE_JOHNDEERE":"JOHN DEERE","P_CRE_KOMATSU":"KOMATSU","P_CRE_LINKBELT":"Link-Belt","P_CRE_URLKEY":"Url Key","P_CRE_URLKEY_COLON":"Url Key:","P_CRE_USERNAME":"User Name","P_CRE_USERNAME_COLON":"User Name:","P_CRE_PASSWORD_COLON":"Password:","P_CRE_ENABLED":"Enabled","P_CRE_ENABLED_COLON":"Enabled:","P_CRE_NOTES":"Notes","P_CRE_NOTES_COLON":"Notes:","P_CRE_USERNAMENOTBEEMPTY":"User Name cannot be empty.","P_CRE_PASSWORDNOTBEEMPTY":"Password cannot be empty.","P_CRE_FAILEDTOSAVECREDENTIAL":"Failed to save credential.","P_CRE_DELETETHECREDENTIALTIPS":"Do you want to delete the credential?","P_CRE_DELETECREDENTIAL":"Delete Credential","P_CRE_FAILEDDELETECREDENTIAL":"Failed to delete this credential.","P_JDLINK":"JD Link","P_JOHNDEERE":"JohnDeere","P_JDL_PAGEERROR":"An unknown error occurred. Please refresh page.","P_JDL_ADD":"Add","P_JDL_EDIT":"Edit","P_JDL_DELETE":"Delete","P_JDL_REFRESH":"Refresh","P_JDL_SEARCH":"Search","P_JDL_OK":"OK","P_JDL_CANCEL":"Cancel","P_JDL_DELETETHECREDENTIALTIPS":"Do you want to delete the credential?","P_JDL_DELETECREDENTIAL":"Delete Credential","P_JDL_DELETEJDLINK":"Delete JD Link","P_JDL_DELETESUBSCRIPTION":"Delete Subscription","P_JDL_CREATEJDLINK":"Create JD Link","P_JDL_DOYOUWANTTODELETETHEJDLINK":"Do you want to delete the JD link?","P_JDL_DOYOUWANTTODELETETHESUBSCRIPTION":"Do you want to delete the subscription?","P_JDL_FAILEDTOCREATETHISJDLINK":"Failed to create this JD link.","P_JDL_FAILEDDELETECREDENTIAL":"Failed to delete this credential.","P_JDL_REQUESTCREDENTIAL":"Request Credential","P_JDL_USERNAME":"User Name","P_JDL_ACCOUNTNAME":"Account Name","P_JDL_REQUESTTIME":"Request Time","P_JDL_USERNAME_COLON":"User Name:","P_JDL_VERIFIER":"Verifier","P_JDL_VERIFIER_COLON":"Verifier:","P_JDL_AUTHORIZE":"Authorize","P_JDL_CONSUMERKEY":"Consumer Key","P_JDL_EXPIRATIONDATE":"Expiration Date","P_JDL_SUBSCRIPTIONNDATE":"Subscription Date","P_JDL_NOTIFICATIONSUBSCRIPTION":"Notification Subscription","P_JDL_AUTHORIZETHROUGHJOHNDEERE":"Authorize through John Deere","P_JDL_THEUSERNAMEMUSTBEENTERED":"The user name must be entered.","P_JDL_THEUSERNAMEALREADYEXISTS":"User name already exists.","P_JDL_THEJDLINKKEYNOTEXISTS":"The JDLink Key does not exist,Please contact the administrator.","P_JDL_REQUESTFORVERIFIERFAILED":"Request for Verifier failed.","P_JDL_FAILEDTOAUTHORIZETHROUGHJD":"Failed to authorize through John Deere this credential.","P_JDL_PLEASEINPUTVERIFIER":"Please input Verifier.","P_JDL_FAILEDTOAUTHORIZETHISCREDENTIAL":"Failed to authorize this credential.","P_JDL_MYJOHNDEERE":"MyJohnDeere","P_JDL_DELETEMYJOHNDEERE":"Delete MyJohnDeere","P_JDL_CREATEMYJOHNDEERE":"Create MyJohnDeere","P_JDL_DOYOUWANTTODELETETHEMYJOHNDEERE":"Do you want to delete the MyJohnDeere?","P_JDL_FAILEDTOCREATETHISMYJOHNDEERE":"Failed to create this MyJohnDeere.","P_JOHNDEERENOTIFICATIONS":"JohnDeere Notifications","P_JDN_PAGEERROR":"An unknown error occurred. Please refresh page.","P_JDN_ADD":"Add","P_JDN_EDIT":"Edit","P_JDN_DELETE":"Delete","P_JDN_REFRESH":"Refresh","P_JDN_SEARCH":"Search","P_JDN_OK":"OK","P_JDN_CANCEL":"Cancel","P_JDN_DELETETHECREDENTIALTIPS":"Do you want to delete the credential?","P_JDN_DELETECREDENTIAL":"Delete Credential","P_JDN_FAILEDDELETECREDENTIAL":"Failed to delete this credential.","P_JDN_REQUESTCREDENTIAL":"Request Credential","P_JDN_CREATE":"Create","P_JDN_CREATEANEWSUBSCRIPTION":"Create a new subscription","P_JDN_FAILEDTOCREATETHISSUBSCRIPTION":"Failed to create this subscription.","P_JDN_USERNAME":"User Name","P_JDN_DISPLAYAME":"Display Name","P_JDN_DISPLAYAME_COLON":"Display Name:","P_JDN_VERIFIER":"Verifier","P_JDN_VERIFIER_COLON":"Verifier:","P_JDN_EXPIRATIONDATE":"Expiration Date","P_JDN_AUTHORIZE":"Authorize","P_JDN_AUTHORIZETHROUGHJOHNDEERE":"Authorize through John Deere","P_JDN_REQUESTFORVERIFIERFAILED":"Request for Verifier failed.","P_JDN_FAILEDTOAUTHORIZETHROUGHJD":"Failed to authorize through John Deere this credential.","P_JDN_PLEASEINPUTVERIFIER":"Please input Verifier.","P_JDN_FAILEDTOAUTHORIZETHISCREDENTIAL":"Failed to authorize this credential.","P_APICREDENTIALS":"API Credentials","P_APICRE_PAGEERROR":"An unknown error occurred. Please refresh page.","P_APICRE_ADD":"Add","P_APICRE_EDIT":"Edit","P_APICRE_DELETE":"Delete","P_APICRE_REFRESH":"Refresh","P_APICRE_SEARCH":"Search","P_APICRE_OK":"OK","P_APICRE_CANCEL":"Cancel","P_APICRE_ADDMANUFACTURE":"Add Credential","P_APICRE_EDITMANUFACTURE":"Edit Credential","P_APICRE_SAVEMANUFACTURE":"Save Credential","P_APICRE_MANUFACTURE":"Manufacture","P_APICRE_MANUFACTURE_COLON":"Manufacture:","P_APICRE_APITYPE_COLON":"API Type:","P_APICRE_CAT":"CAT","P_APICRE_JOHNDEERE":"JOHN DEERE","P_APICRE_KOMATSU":"KOMATSU","P_APICRE_LINKBELT":"Link-Belt","P_APICRE_URLKEY":"Url Key","P_APICRE_URLKEY_COLON":"Url Key:","P_APICRE_APINAME":"API Name","P_APICRE_APINAME_COLON":"API Name:","P_APICRE_APIKEY":"API Key","P_APICRE_APIKEY_COLON":"API Key:","P_APICRE_APISECRET_COLON":"API Secret:","P_APICRE_APITOKEN_COLON":"API Token:","P_APICRE_APITOKENSECRET_COLON":"API Token Secret:","P_APICRE_USERNAME":"User Name","P_APICRE_USERNAME_COLON":"User Name:","P_APICRE_PASSWORD_COLON":"Password:","P_APICRE_ENABLED":"Enabled","P_APICRE_ENABLED_COLON":"Enabled:","P_APICRE_APINAMENOTBEEMPTY":"API Name cannot be empty.","P_APICRE_USERNAMENOTBEEMPTY":"User Name cannot be empty.","P_APICRE_PASSWORDNOTBEEMPTY":"Password cannot be empty.","P_APICRE_FAILEDTOSAVECREDENTIAL":"Failed to save credential.","P_APICRE_DELETETHECREDENTIALTIPS":"Do you want to delete the credential?","P_APICRE_DELETECREDENTIAL":"Delete Credential","P_APICRE_FAILEDDELETECREDENTIAL":"Failed to delete this credential.","P_USERS":"Users","P_USER":"User","P_USERSETUP":"User Setup","P_USERMANAGEMENT":"User Management","P_UM_PAGEERROR":"An unknown error occurred. Please refresh page.","P_UM_QUERY":"Query","P_UM_ERROR":"Error","P_UM_ADD":"Add","P_UM_EDIT":"Edit","P_UM_COPYUSER":"Copy User","P_UM_COPYUSER_COLON":"Copy User:","P_UM_DELETE":"Delete","P_UM_REFRESH":"Refresh","P_UM_OK":"OK","P_UM_CANCEL":"Cancel","P_UM_CLOSE":"Close","P_UM_FILTER":"Filter","P_UM_SAVE":"Save","P_UM_SAVE1":"Save and Exit","P_UM_SAVE2":"Exit Without Saving","P_UM_USERID":"User ID","P_UM_USERID_COLON":"User ID:","P_UM_USERIDOREMAIL":"User ID/Email","P_UM_USERIDOREMAIL_COLON":"User ID/Email:","P_UM_USERNAME":"User Name","P_UM_USERNAME_COLON":"User Name:","P_UM_PASSWORD_COLON":"Password:","P_UM_USERTYPE":"User Type","P_UM_USERTYPE_COLON":"User Type:","P_UM_COMMON":"Common","P_UM_ADMIN":"Admin","P_UM_ACTIVE":"Active","P_UM_ACTIVE_COLON":"Active:","P_UM_ISUSER":"Is User","P_UM_ISUSER_COLON":"Is User:","P_UM_WEBBROWSERACCESS_COLON":"Web Browser Access:","P_UM_INSPECTACCESS":"Inspect Access","P_UM_MOBILEAPPACCESS":"Mobile App Access","P_UM_TEXTADDRESS":"Text Address","P_UM_TEXTADDRESS_COLON":"Text Address:","P_UM_MOBILE":"Mobile","P_UM_MOBILE_COLON":"Mobile:","P_UM_BUSINESSPHONE":"Business Phone","P_UM_BUSINESSPHONE_COLON":"Business Phone:","P_UM_CONTACTTYPE":"Contact Type","P_UM_CONTACTTYPE_COLON":"Contact Type:","P_UM_FOREMAN":"Foreman","P_UM_DRIVER":"Driver","P_UM_INVENTORYMANAGER":"Inventory Manager","P_UM_RENTALMANAGER":"Rental Manager","P_UM_SERVICEMANAGER":"Service Manager","P_UM_FLEETMANAGER":"Fleet Manager","P_UM_TECHNICIAN":"Technician","P_UM_ADVISOR":"Advisor","P_UM_OTHER":"Other","P_UM_HOURLYRATE_COLON":"Hourly Rate ($):","P_UM_EMPLOYEEIDORFOB":"Employee ID or FOB","P_UM_EMPLOYEEIDORFOB_COLON":"Employee ID or FOB:","P_UM_MANAGER":"Manager","P_UM_MANAGER_COLON":"Manager:","P_UM_OPTOUTOFEMAIL":"Opt out Of Email?","P_UM_OPTOUTOFEMAIL_COLON":"Opt out Of Email:","P_UM_OPTOUTOFFICOMMUNICATIONS":"Opt Out of FI Communications?","P_UM_OPTOUTOFFICOMMUNICATIONS_COLON":"Opt Out of FI Communications:","P_UM_OPTOUTOFEMAILTITLE":"Selecting this option will result in the user Not receiving outage notifications, release notes, etc from Foresight Intelligence. It does not limit messages generated within the application","P_UM_INSPECTEMAIL_COLON":"Inspect Email:","P_UM_TEAMINTELLIGENCEUSER_COLON":"Team Intelligence User:","P_UM_LANDINGPAGE_COLON":"Landing Page:","P_UM_LANGUAGES_COLON":"Languages:","P_UM_NOTES":"Notes","P_UM_NOTES_COLON":"Notes:","P_UM_GROUPNAME":"Group Name","P_UM_DESCRIPTION":"Description","P_UM_USERINFORMATION":"User Information","P_UM_USERSGROUP":"User's Group","P_UM_SUBSCRIBEMESSAGE":"Subscribe Message","P_UM_SECURITY":"Security","P_UM_EMAILSUBSCRIBING":"Email Subscribing","P_UM_ASSETSASSIGNMENT":"Assets Assignment","P_UM_ASSETASSIGNMENT":"Asset Assignment","P_UM_AVAILABLEASSETS":"Available Assets","P_UM_ASSIGNEDASSETS":"Assigned Assets","P_UM_TYPE_COLON":"Type:","P_UM_SN":"SN","P_UM_MAKE":"Make","P_UM_MODEL":"Model","P_UM_ASSETSTYPE":"Type","P_UM_EDITUSER":"Edit user","P_UM_ADDUSER":"Add user","P_UM_AVAILABLEGROUPS":"Available Groups","P_UM_GROUPSTHEUSERBELONGSTO":"Groups The User Belongs To","P_UM_ASSETGROUPSASSIGNMENT":"Asset Groups Assignment","P_UM_MANAGEASSETGROUPS":"Manage Asset Groups","P_UM_SELECTASSETGROUPS":"Select Asset Groups","P_UM_SELECTJOBSITES":"Select Jobsites","P_UM_AVAILABLEASSETGROUPS":"Available Asset Groups","P_UM_ASSIGNEDASSETGROUPS":"Assigned Asset Groups","P_UM_JOBSITESASSIGNMENT":"Jobsites Assignment","P_UM_JOBSITEASSIGNMENT":"Jobsite Assignment","P_UM_AVAILABLEJOBSITES":"Available Jobsites","P_UM_ASSIGNEDJOBSITES":"Assigned Jobsites","P_UM_RESETPASSWORD":"Reset Password","P_UM_RANDOMPASSWORD":"Random password","P_UM_CONFIRMPASSWORD_COLON":"Confirm Password:","P_UM_SAVEASSET":"Save Asset","P_UM_DELETEUSER":"Delete user","P_UM_DOYOUWANTTODELETE":"Do you want to delete {0}?","P_UM_PLEASESELECTUSER":"Please select user.","P_UM_DELETEASSIGNEDASSET":"Are you sure you want to delete the assigned asset: {0}?","P_UM_DELETESELECTEDASSET":"Are you sure you want to delete these selected assets?","P_UM_DELETESELECTEDASSETGROUP":"Are you sure you want to delete these selected asset groups?","P_UM_DELETESELECTEDJOBSITE":"Are you sure you want to delete these selected jobsite?","P_UM_FAILEDTOSAVEASSET":"Failed to save asset.","P_UM_MANAGEASSETS":"Manage Assets","P_UM_FAILEDTOLOADASSETGROUPS":"Failed to load asset groups.","P_UM_SAVEUSERASSETGROUPS":"Save user asset groups","P_UM_FAILEDTOSAVEASSETGROUPS":"Failed to save asset groups.","P_UM_FAILEDTOSAVEJOBSITEASSIGNMENT":"Failed to save jobsite assignment.","P_UM_PASSWORDTIPS":"The password must have at least 8 characters.","P_UM_PASSWORDTIPS1":"The password must contain both uppercase and lowercase characters and at lease one number.","P_UM_PASSWORDTIPS2":"The two passwords are different. Please reenter.","P_UM_RESETUSERPASSWORDSUCCESSFULLY":"Reset user password successfully.","P_UM_FAILEDTORESETUSERPASSWORD":"Failed to reset user password.","P_UM_USERPASSWORDTOOLTIPS":"The password must have at least 8 characters and must contain both uppercase and lowercase characters and numbers.","P_UM_USERIDCANNOTBEEMPTY":"User ID cannot be empty.","P_UM_USERIDOREMAILCANNOTBEEMPTY":"User ID/Email cannot be empty.","P_UM_USERIDISNOTAVALIDEMAILADDRESS":"User ID is not a valid email address.","P_UM_USERIDOREMAILISNOTAVALIDEMAILADDRESS":"User ID/Email is not a valid email address.","P_UM_USERNAMECANNOTBEEMPTY":"User name cannot be empty.","P_UM_TEXTADDRESSISNOTAVALID":"Text Address is not a valid.","P_UM_HOURLYRATEFORMATERROR":"Hourly Rate format error.","P_UM_HOURLYRATEMUSTMORETHAN0":"Hourly Rate must more than 0.","P_UM_FAILEDTOSAVEUSER":"Failed to save user.","P_UM_FAILEDTOLOADGROUPS":"Failed to load groups","P_UM_SAVSUCCESSFULLY":"Saved successfully.","P_UM_ENABLED":"Enabled","P_UM_CHART_COLON":"Chart:","P_UM_SUBJECT_COLON":"Subject:","P_UM_NONE":"None","P_UM_READONLY":"Read Only","P_UM_FULLCONTROL":"Full Control","P_UM_REQUESTONLY":"Request Only","P_UM_MOBILEAPPBARCODESCANNER":"Mobile App: Barcode Scanner","P_UM_ASSETASS":"Asset(s)","P_UM_ASSETGROUPS":"Asset Group(s)","P_UM_JOBSITES":"Jobsite(s)","P_UM_TEXTADDRESSTOOLTIP":"\r\n\t\t\t\tAlltel Wireless: @mms.alltel.net\r\n\t\t\t\tAT&Wireless: @mms.att.net\r\n\t\t\t\tAT&Mobility (formerly Cingular): @mobile.mycingular.com\r\n\t\t\t\tBoost Mobile: @mms.mycricket.com\r\n\t\t\t\tMetro PCS: @mymetropcs.com\r\n\t\t\t\tSprint (PCS): @pm.sprint.com\r\n\t\t\t\tSprint (Nextel): @messaging.nextel.com\r\n\t\t\t\tStraight Talk: @mypixmessages.com\r\n\t\t\t\tT-Mobile: @tmomail.net\r\n\t\t\t\tU.S. Cellular: @mms.uscc.net\r\n\t\t\t\tVerizon: @vzwpix.com\r\n\t\t\t\tVirgin Mobile: @vmpix.com\r\n\r\n\t\t\t\tFor example, for cellphone number: 480-123-4567 on Verizon,\r\n\t\t\t\tthe text address would be: 4801234567@vzwpix.com\r\n\t\t\t","P_UM_SELECTASSETTYPES":"Select AssetTypes","P_UM_ASSETTYPES":"Asset Type(s)","P_UM_ASSIGNEDWORKORDERS":"Assigned Work Orders","P_UM_ASSIGNEDWORKORDERS_COLON":"Assigned Work Orders:","P_UM_ASSETTYPEASSIGNMENT":"Asset Type Assignment","P_UM_AVAILABLEASSETTYPES":"Available Asset Types","P_UM_ASSIGNEDASSETTYPES":"Assigned Asset Types","P_UM_FAILEDTOSAVEASSETTYPEASSIGNMENT":"Failed to save assettype assignment.","P_UM_AREYOUSUREYOUWANTTODELETETHESESELECTEDASSETTYPE":"Are you sure you want to delete these selected assettype?","P_UM_DEPARTMENT":"Department","P_UM_DEPARTMENT_COLON":"Department:","P_UM_LOCATION":"Location","P_UM_LOCATION_COLON":"Location:","P_UM_IMPORTUSESFIELDMAPPING":"Import Users Field Mapping","P_UM_USERSIMPORTEDSUCCESSFULLY":" user(s) imported successfully.","P_UM_IMPORT":"Import","P_USERSGROUPS":"User Groups","P_USERSGROUP":"User Group","P_DATATABLEPERMISSION":"DataTable Permission","P_DASHBOARDFILTERS":"Dashboard Filters","P_UG_PAGEERROR":"An unknown error occurred. Please refresh page.","P_UG_QUERY":"Query","P_UG_ERROR":"Error","P_UG_ADD":"Add","P_UG_EDIT":"Edit","P_UG_DELETE":"Delete","P_UG_REFRESH":"Refresh","P_UG_OK":"OK","P_UG_CANCEL":"Cancel","P_UG_CLOSE":"Close","P_UG_FILTER":"Filter","P_UG_SAVE":"Save","P_UG_SAVE1":"Save and Exit","P_UG_SAVE2":"Exit Without Saving","P_UG_ADDUSERGROUP":"Add User Group","P_UG_GROUPINFORMATION":"Group Information","P_UG_SECURITY":"Security","P_UG_USERGROUPPROPERTIES":"User Group Properties","P_UG_USERGROUPNAME":"User Group Name","P_UG_USERGROUPNAME_COLON":"User Group Name:","P_UG_DESCRIPTION":"Description","P_UG_DESCRIPTION_COLON":"Description:","P_UG_GROUPMEMBERS":"Group Members","P_UG_AVAILABLEUSERS":"Available Users","P_UG_ASSIGNEDGROUPMEMBERS":"Assigned Group Members","P_UG_EDITGROUP":"Edit Group","P_UG_ADDGROUP":"Add Group","P_UG_USERID":"User ID","P_UG_USERNAME":"User Name","P_UG_DELETEGROUP":"Delete group","P_UG_DOYOUWANTTODELETE":"Do you want to delete {0}?","P_UG_LOADUSERS":"Load users","P_UG_FAILEDTOLOADUSERS":"Failed to load users.","P_UG_SAVEGROUP":"Save group","P_UG_GROUPNAMECANNOTBEEMPTYORWHITESPACE":"Group Name cannot be empty or whitespace.","P_UG_GROUPNAMEISTOOLONG":"Group Name is too long (> 100 characters).","P_UG_NOTESISTOOLONG":"Notes is too long (> 200 characters).","P_UG_FAILEDTOSAVEGROUP":"Failed to save group.","P_UG_FAILEDTODELETETHISGROUP":"Failed to delete this group.","P_UG_USERSINTHISUSERGROUP":"There are one or more users in this user group,so it cannot be deleted.","P_CURFEWCONFIGURATION":"Curfew Configuration","P_CM_PAGEERROR":"An unknown error occurred. Please refresh page.","P_CM_QUERY":"Query","P_CM_ERROR":"Error","P_CM_ADD":"Add","P_CM_EDIT":"Edit","P_CM_DELETE":"Delete","P_CM_REFRESH":"Refresh","P_CM_OK":"OK","P_CM_CANCEL":"Cancel","P_CM_CLOSE":"Close","P_CM_FILTER":"Filter","P_CM_SAVE":"Save","P_CM_SAVE1":"Save and Exit","P_CM_SAVE2":"Exit Without Saving","P_CM_CONTRACTOR_COLON":"Contractor:","P_CM_CURFEWINFORMATION":"Curfew Information","P_CM_SEARCH":"Search","P_CM_TITLE":"Title","P_CM_TITLE_COLON":"Title:","P_CM_DAYS":"Day(s)","P_CM_DAYS_COLON":"Day(s):","P_CM_PERIOD":"Period","P_CM_SUNDAY":"Sunday","P_CM_MONDAY":"Monday","P_CM_TUESDAY":"Tuesday","P_CM_WEDNESDAY":"Wednesday","P_CM_THURSDAY":"Thursday","P_CM_FRIDAY":"Friday","P_CM_SATURDAY":"Saturday","P_CM_ADDPERIOD":"Add Period","P_CM_ADDCURFEWCONFIGURATION":"Add Curfew Configuration","P_CM_EDITCURFEWCONFIGURATION":"Edit Curfew Configuration","P_CM_SAVECURFEWCONFIGURATION":"Save Curfew Configuration","P_CM_DELETEPERIOD":"Delete Period","P_CM_PERIODCANNOTBEEMPTY":"Period cannot be empty.","P_CM_TITLECANNOTBEEMPTY":"Title cannot be empty.","P_CM_PLEASESELECTATLEASTONEDAY":"Please select at least one day.","P_CM_ASSETASSIGNMENT":"Asset Assignment","P_CM_TYPE_COLON":"Type:","P_CM_JOBSITEASSIGNMENT":"Jobsite Assignment","P_CM_AVAILABLEJOBSITES":"Available Jobsites","P_CM_ASSIGNEDJOBSITES":"Assigned Jobsites","P_CM_SHOWALLASSIGNEDCONTACTSTITLE":"When checked, all associated or linked items will display regardless of filter.","P_CM_SCHEDULEASSETS":"Schedule Assets","P_CM_SAVEASSET":"Save Asset","P_CM_FAILEDTOSAVEASSET":"Failed to save asset.","P_CM_FAILEDTOLOADDATA":"Failed to load data:","P_CM_DELETECURFEWCONFIGURATION":"Delete curfew configuration","P_CM_DOYOUWANTTODELETETHECURFEW":"Do you want to delete the curfew?","P_CM_FAILEDTODELETETHISCURFEW":"Failed to delete this curfew.","P_CM_FAILEDTOSAVEJOBSITEASSIGNMENT":"Failed to save jobsite assignment.","P_CM_SAVSUCCESSFULLY":"Saved successfully.","P_CM_FAILEDTOSAVECURFEWCONFIGURATION":"Failed to save curfew configuration.","P_CM_THECURFEWTITLEMUSTBEUNIQUE":"The curfew title must be unique.","P_CM_ENDTIMEMUSTBELATERTHANSTARTTIME":"End Time must be later than Start Time.","P_CM_SN":"SN","P_CM_NAME":"Name","P_CM_MAKE":"Make","P_CM_MODEL":"Model","P_CM_ASSETSTYPE":"Type","P_CM_DELETEASSIGNEDASSET":"Are you sure you want to delete the assigned asset:{0}?","P_CM_DELETESELECTEDASSET":"Are you sure you want to delete these selected assets?","P_CM_STARTTIME":"Start Time","P_CM_STARTTIME_COLON":"Start Time:","P_CM_ENDTIME":"End Time","P_CM_ENDTIME_COLON":"End Time:","P_CURFEWMOVEMENTTOLERANCE":"Curfew Movement Tolerance","P_CMT_SAVE":"Save","P_CMT_REFRESH":"Refresh","P_CMT_DEFAULTTOILERANCE":"Default Tolerance:","P_CMT_SCHEDULEASSETS":"Schedule Assets","P_CMT_FAILEDTOLOADDATA":"Failed to load data:","P_CMT_ERROR":"Error","P_CMT_JOBSITES":"Jobsites","P_CMT_TOLERANCE":"Tolerance","P_CMT_SAVESAVECURFEWMOVEMENTTOLERANCE":"Save Curfew Movement Tolerance","P_CMT_DEFAULTTOLERANCEFORMATERROR":"Default Tolerance format error.","P_CMT_JOBSITETOLERANCEFORMATERROR":"Jobsite Tolerance format error.","P_CMT_SAVSUCCESSFULLY":"Saved successfully.","P_CMT_FAILEDTOSAVECURFEWMOVEMENTTOLERANCE":"Failed to save curfew movement tolerance.","P_USERTOCONTRACTOR":"User To Contractor","P_UTC_PAGEERROR":"An unknown error occurred. Please refresh page.","P_UTC_QUERY":"Query","P_UTC_ERROR":"Error","P_UTC_ADD":"Add","P_UTC_EDIT":"Edit","P_UTC_DELETE":"Delete","P_UTC_REFRESH":"Refresh","P_UTC_OK":"OK","P_UTC_CANCEL":"Cancel","P_UTC_CLOSE":"Close","P_UTC_FILTER":"Filter","P_UTC_SAVE":"Save","P_UTC_SAVE1":"Save and Exit","P_UTC_SAVE2":"Exit Without Saving","P_UTC_PERMISSIONMANAGEMENT":"Permission Management","P_UTC_SEARCH":"Search","P_UTC_USERS":"Users","P_UTC_USERGROUPS":"User Groups","P_UTC_ID":"ID","P_UTC_NAME":"Name","P_UTC_SAVEPERMISSION":"Save Permission","P_UTC_SOMESETTINGSHAVECHANGED":"Some settings have changed.Would you like to save the changes?","P_UTC_SAVEUSERTOCONTRACTOR":"Save user to contractor","P_UTC_PLEASESELECTAUSERORGROUP":"Please select a user or group.","P_UTC_DOYOUWANTTOSAVEPERMISSIONSFORTHIS":"Do you want to save Permissions for this?","P_M3":"M3","P_M3_PAGEERROR":"An unknown error occurred. Please refresh page.","P_M3_QUERY":"Query","P_M3_ERROR":"Error","P_M3_ADD":"Add","P_M3_EDIT":"Edit","P_M3_DELETE":"Delete","P_M3_REFRESH":"Refresh","P_M3_OK":"OK","P_M3_CANCEL":"Cancel","P_M3_CLOSE":"Close","P_M3_FILTER":"Filter","P_M3_SAVE":"Save","P_M3_SAVE1":"Save and Exit","P_M3_SAVE2":"Exit Without Saving","P_M3_DEVICES":"Devices","P_M3_DEVICEID_COLON":"Device ID:","P_M3_DEVICENAME_COLON":"Device Name:","P_M3_DEVICETYPE_COLON":"Device Type:","P_M3_ACCURACY":"Accuracy","P_M3_ACCURACY_COLON":"Accuracy:","P_M3_ASSETNAME_COLON":"Asset Name:","P_M3_MAKE_COLON":"Make:","P_M3_MODEL_COLON":"Model:","P_M3_TYPE_COLON":"Type:","P_M3_SENDLOCATION":"Send Location","P_M3_SENDJOBSITE":"Send Jobsite","P_M3_SEND":"Send","P_M3_LATITUDE_COLON":"Latitude:","P_M3_LONGITUDE_COLON":"Longitude:","P_M3_EDITACCURACY":"Edit Accuracy","P_M3_NOTE_COLON":"Note:","P_M3_ACCURACYFORMATERROR":"Accuracy format error.","P_M3_ACCURACYCANNOTBELESSTHAN0":"Accuracy cannot be less than 0.","P_M3_SENDMESSAGE":"Send Message","P_M3_FAILEDTOSENDMESSAGE":"Failed to send message.","P_M3_MESSAGECANNOTBEEMPTY":"Message cannot be empty.","P_M3_PLEASESELECTALOCATIONTOSENDTO":"Please select a location to send to.","P_OVERUNDERTRUCKINGALERTS":"Over/Under Trucking Alerts","P_OVERUNDERTRUCKINGALERTSCONFIGURATION":"Over/Under Trucking Alerts Configuration","P_M3_CONTRACTOR_COLON":"Contractor:","P_M3_SEARCH":"Search","P_M3_SCHEDULEASSETS":"Schedule Assets","P_M3_FAILEDTOLOADDATA":"Failed to load data: {0}","P_M3_DELETEJOBSITELIMITCONFIGURATION":"Delete jobsite limit configuration","P_M3_DOYOUWANTTODELETETHEJOBSITELIMIT":"Do you want to delete the Jobsite limit?","P_M3_FAILEDTODELETETHISJOBSITELIMIT":"Failed to delete this jobsite limit.","P_M3_SUBSCRIBECONTACTS":"Subscribe Contacts","P_M3_AVAILABLECONTACTS":"Available Contacts","P_M3_ASSIGNEDCONTACTS":"Assigned Contacts","P_M3_SHOWALLASSIGNED":"Show All Assigned","P_M3_SHOWALLASSIGNEDCONTACTSTITLE":"When checked, all associated or linked items will display regardless of filter.","P_M3_FAILEDTOSAVESUBSCRIBECONTACTS":"Failed to save subscribe contacts.","P_M3_CONTACTNAME":"Contact Name","P_M3_CONTACTTYPE":"Contact Type","P_M3_ID":"ID","P_M3_JOBSITENAME":"Jobsite Name","P_M3_JOBSITE_COLON":"Jobsite:","P_M3_ACTIVE":"Active","P_M3_ACTIVE_COLON":"Active:","P_M3_STARTTIME":"Start Time","P_M3_STARTTIME_COLON":"Start Time:","P_M3_ENDTIME":"End Time","P_M3_ENDTIME_COLON":"End Time:","P_M3_ACCEPTABLEMINIMUMTRUCKS":"Acceptable Minimum Trucks","P_M3_ACCEPTABLEMINIMUMTRUCKS_COLON":"Acceptable Minimum Trucks:","P_M3_ACCEPTABLEMAXIMUMTRUCKS":"Acceptable Maximum Trucks","P_M3_ACCEPTABLEMAXIMUMTRUCKS_COLON":"Acceptable Maximum Trucks:","P_M3_ACCEPTABLEASSETTYPES":"Acceptable Asset Types","P_M3_ACCEPTABLEASSETTYPES_COLON":"Acceptable Asset Types:","P_M3_NOTES":"Notes","P_M3_NOTES_COLON":"Notes:","P_M3_JOBSITELIMITINFORMATION":"Jobsite Limit Information","P_M3_EDITJOBSITELIMITCONFIGURATION":"Edit Jobsite Limit Configuration","P_M3_ADDJOBSITELIMITCONFIGURATION":"Add Jobsite Limit Configuration","P_M3_ENDTIMEMUSTBELATERTHANSTARTTIME":"End Time must be later than Start Time.","P_M3_ACCEPTABLEMINIMUMTRUCKSFORMATERROR":"Acceptable minimum trucks format error.","P_M3_ACCEPTABLEMAXIMUMTRUCKSFORMATERROR":"Acceptable maximum trucks format error.","P_M3_ACCEPTABLEMAXIMUMTRUCKSCANNOTBELESSTHANACCEPTABLEMINIMUMTRUCKS":"Acceptable Maximum Trucks cannot be less than Acceptable Minimum Trucks.","P_M3_ACCEPTABLEASSETTYPESCANNOTBEEMPTY":"Acceptable Asset Types cannot be empty.","P_M3_SAVSUCCESSFULLY":"Saved successfully.","P_M3_FAILEDTOSAVEJOBSITELIMITCONFIGURATION":"Failed to save jobsite limit configuration.","P_MANAGEHARSHDRIVING":"Manage Harsh Driving","P_MHD_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MHD_SEARCH":"Search","P_MHD_QUERY":"Query","P_MHD_ERROR":"Error","P_MHD_ADD":"Add","P_MHD_EDIT":"Edit","P_MHD_DELETE":"Delete","P_MHD_REFRESH":"Refresh","P_MHD_OK":"OK","P_MHD_CANCEL":"Cancel","P_MHD_CLOSE":"Close","P_MHD_FILTER":"Filter","P_MHD_SAVE":"Save","P_MHD_SAVE1":"Save and Exit","P_MHD_SAVE2":"Exit Without Saving","P_MHD_STATDATE_COLON":"Start Date:","P_MHD_ENDDATE_COLON":"End Date:","P_MHD_SCHEDULEASSETS":"Schedule Assets","P_MHD_FAILEDTOLOADDATA":"Failed to load data: {0}","P_MHD_DELETEJOBSITELIMITCONFIGURATION":"Delete jobsite limit configuration","P_MHD_DOYOUWANTTODELETETHEJOBSITELIMIT":"Do you want to delete the Jobsite limit?","P_MHD_FAILEDTODELETETHISJOBSITELIMIT":"Failed to delete this jobsite limit.","P_MHD_SUBSCRIBECONTACTS":"Subscribe Contacts","P_MHD_AVAILABLECONTACTS":"Available Contacts","P_MHD_ASSIGNEDCONTACTS":"Assigned Contacts","P_MHD_SHOWALLASSIGNED":"Show All Assigned","P_MHD_SHOWALLASSIGNEDCONTACTSTITLE":"When checked, all associated or linked items will display regardless of filter.","P_MHD_FAILEDTOSAVESUBSCRIBECONTACTS":"Failed to save subscribe contacts.","P_MHD_CONTACTNAME":"Contact Name","P_MHD_CONTACTTYPE":"Contact Type","P_MHD_ID":"ID","P_MHD_JOBSITENAME":"Jobsite Name","P_MHD_JOBSITE_COLON":"Jobsite:","P_MHD_ACTIVE":"Active","P_MHD_ACTIVE_COLON":"Active:","P_MHD_STARTTIME":"Start Time","P_MHD_STARTTIME_COLON":"Start Time:","P_MHD_ENDTIME":"End Time","P_MHD_ENDTIME_COLON":"End Time:","P_MHD_EXCLUDED":"Excluded","P_MHD_ASSETNAME":"Asset Name","P_MHD_MAKE":"Make","P_MHD_MODEL":"Model","P_MHD_EVENTTYPE":"Event Type","P_MHD_EVENTTIME":"Event Time","P_MHD_STREET":"Street","P_MHD_CITY":"City","P_MHD_STATE":"State","P_MHD_POSTALCODE":"Postal Code","P_MHD_STARTINGSPEED":"Starting Speed","P_MHD_SPEEDUNITS":"Speed Units","P_MHD_DURATION":"Duration","P_MHD_DURATIONUNITS":"Duration Units","P_MHD_MAGNITUDE":"Magnitude","P_MHD_MAGNITUDEUNITS":"Magnitude Units","P_MHD_NOTES_COLON":"Notes:","P_MHD_EXCLUDE":"Exclude","P_MHD_INCLUDE":"Include","P_MHD_FAILEDTOEXCLUDEDHARSHDRIVING":"Failed to excluded harsh driving.","P_MHD_HARSHDRIVING":" Harsh Driving","P_INSPECTION":"Inspection","P_TEAMINTELLIGENCE":"Team Intelligence","P_INSPECTIONS":"Inspections","P_GLOBALSECTIONS":"Global Sections","P_ADDGLOBALSECTION":"Add Global Section","P_TEMPLATES":"Templates","P_TEMPLATE":"Template","P_DRAFT":"Draft","P_PUBLISHED":"Published","P_IPT_PAGEERROR":"An unknown error occurred. Please refresh page.","P_IPT_SEARCH":"Search","P_IPT_QUERY":"Query","P_IPT_ERROR":"Error","P_IPT_ADD":"Add","P_IPT_EDIT":"Edit","P_IPT_DELETE":"Delete","P_IPT_REFRESH":"Refresh","P_IPT_OK":"OK","P_IPT_CANCEL":"Cancel","P_IPT_SEND":"Send","P_IPT_YES":"Yes","P_IPT_NO":"No","P_IPT_CLOSE":"Close","P_IPT_FILTER":"Filter","P_IPT_SAVE":"Save","P_IPT_SAVE1":"Save and Exit","P_IPT_SAVE2":"Exit Without Saving","P_IPT_SAVEANDPUBLISH":"Save and Publish","P_IPT_FRENCH":"French","P_IPT_SPANISH":"Spanish","P_IPT_SELECTSECTION":"Select Section","P_IPT_NAME":"Name","P_IPT_NAME_COLON":"Name:","P_IPT_ADDITIONALTEXTS":"Additional Texts","P_IPT_DISPLAYTEXT":"Display Text","P_IPT_DISPLAYTEXT_COLON":"Display Text:","P_IPT_TYPE":"Type","P_IPT_TYPE_COLON":"Type:","P_IPT_REQUIRED":"Required","P_IPT_CANCOMMENT":"Can Comment","P_IPT_ISIMPORTANT":"Is Important","P_IPT_SEVERITYLEVEL":"Severity Level","P_IPT_SEVERITYLEVEL_COLON":"Severity Level: ","P_IPT_BACKGROUNDCOLOR":"Background Color","P_IPT_NOTES":"Notes","P_IPT_NOTES_COLON":"Notes:","P_IPT_CREATEDBY":"Created By","P_IPT_SECTION":"Section","P_IPT_ADDSECTION":"Add Section","P_IPT_EDITSECTION":"Edit Section","P_IPT_COPYSECTION":"Copy Section","P_IPT_DELETESECTION":"Delete Section","P_IPT_SAVESECTION":"Save Section","P_IPT_AREYOUSUREYOUWANTTODELETETHISSECTION":"Are you sure you want to delete this section?","P_IPT_QUESTION":"Question","P_IPT_ADDQUESTION":"Add Question","P_IPT_EDITQUESTION":"Edit Question","P_IPT_COPYQUESTION":"Copy Question","P_IPT_DELETEQUESTION":"Delete Question","P_IPT_SAVEQUESTION":"Save Question","P_IPT_AREYOUSUREYOUWANTTODELETETHISQUESTION":"Are you sure you want to delete this question?","P_IPT_SAVSUCCESSFULLY":"Saved successfully.","P_IPT_FAILEDTOSAVESECTION":"Failed to save Section.","P_IPT_FAILEDTOSAVEQUESTION":"Failed to save question.","P_IPT_FAILEDTODELETEQUESTION":"Failed to delete question.","P_IPT_FAILEDTODELETESECTION":"Failed to delete section.","P_IPT_FAILEDTODELETETEMPLATE":"Failed to delete template.","P_IPT_FAILEDTOPUBLISHTEMPLATE":"Failed to publish template.","P_IPT_NAMENOTBEEMPTY":"Name cannot be empty.","P_IPT_QUESTIONNAMENOTBEEMPTY":"Question Name cannot be empty.","P_IPT_SETIONNAMENOTBEEMPTY":"Setion Name cannot be empty.","P_IPT_TEMPLATENAMENOTBEEMPTY":"Template Name cannot be empty.","P_IPT_PAGENAMENOTBEEMPTY":"Page Name cannot be empty.","P_IPT_DISPLAYTEXTNOTBEEMPTY":"Display Text cannot be empty.","P_IPT_QUESTIONDISPLAYTEXTNOTBEEMPTY":"Question Display Text cannot be empty.","P_IPT_SECTIONDISPLAYTEXTNOTBEEMPTY":"Section Display Text cannot be empty.","P_IPT_TEXTTPCOMPARENOTBEEMPTY":"Text to compare cannot be empty.","P_IPT_MULTIPLESELECT_COLON":"Multiple Select:","P_IPT_ADDITEM":"Add Item","P_IPT_OPTIONS":"Options","P_IPT_LOOKUPSOURCE_COLON":"Lookup Source:","P_IPT_TEXTTOCOMPARE":"Text to compare","P_IPT_OPTIONNAMECANNOTBEEMPTY":"Option name cannot be empty.","P_IPT_THEREMUSTBEATLEASTONECHOICE":"There must be at least one choice.","P_IPT_THESEQUESTIONSCREATEFUELRECORDSINASSETHEALTH":"These questions create Fuel Records in Asset Health","P_IPT_PICTURES":"Pictures","P_IPT_SELECTPICTURE":"Select Picture","P_IPT_QT_SINGLELINETEXT":"Single Line Text","P_IPT_QT_MULTIPLELINETEXT":"Multiple Line Text","P_IPT_QT_EMAILMANUAL":"Email (Manual)","P_IPT_QT_EMAILDROPDOWN":"Email (Drop Down)","P_IPT_QT_NUMBER":"Number","P_IPT_QT_INTEGER":"Integer","P_IPT_QT_YESORNO":"Yes Or No","P_IPT_QT_DATE":"Date","P_IPT_QT_DATEANDTIME":"Date And Time","P_IPT_QT_DROPDOWN":"Drop Down","P_IPT_QT_LIST":"List","P_IPT_QT_PICTURE":"Picture","P_IPT_QT_ODOMETER":"Odometer","P_IPT_QT_ENGINEHOURS":"Engine Hours","P_IPT_QT_FUELREMAINING":"Fuel Remaining","P_IPT_QT_FUELRECORDS":"Fuel Records","P_IPT_QT_BARCODE":"Bar Code","P_IPT_QT_BARCODEVALIDATE":"Bar Code Validate","P_IPT_QT_FUELUSED":"Fuel Used","P_IPT_ST_TRANSACTIONDATE":"Transaction Date","P_IPT_ST_TICKETRECEIPTNUMBER":"Ticket/Receipt Number","P_IPT_ST_DRIVERNAME":"Driver Name","P_IPT_ST_RETAILERNAME":"Retailer Name","P_IPT_ST_RETAILERADDRESS":"Retailer Address","P_IPT_ST_CITY":"City","P_IPT_ST_STATE":"State","P_IPT_ST_ZIP":"Zip","P_IPT_ST_ODOMETER":"Odometer","P_IPT_ST_FUELTYPE":"Fuel Type","P_IPT_ST_DISTRIBUTEDBY":"Distributed By","P_IPT_ST_QUANTITY":"Quantity","P_IPT_ST_UOMCOST":"Unit Cost","P_IPT_ST_TOTALCOST":"Total Cost","P_IPT_ST_BRANDNAME":"Brand Name","P_IPT_ST_NOTES":"Notes","P_IPT_ST_PICTURE":"Picture","P_IPT_SL_NONE":"None","P_IPT_SL_LOW":"Low","P_IPT_SL_MEDIUM":"Medium","P_IPT_SL_HIGH":"High","P_IPT_LS_MANUALINPUT":"Manual Input","P_IPT_LS_JOBSITES":"Jobsites","P_IPT_LS_ASSETS":"Assets","P_IPT_LS_ASSETNAMECUSTOM":"Asset Name Custom","P_IPT_LS_EMPLOYEES":"Employees","P_IPT_SUMMARY":"Summary","P_IPT_LOCATIONENABLED_COLON":"Location Enabled:","P_IPT_SIGNATUREREQUIRED_COLON":"Signature Required:","P_IPT_FILTER_COLON":"Filter:","P_IPT_PICTURE":"Picture","P_IPT_PICTURE_COLON":"Picture:","P_IPT_EDITABLE_COLON":"Editable:","P_IPT_FILTERTOOLTIPS":"Multiple filters can be applied that act as independent assignments","P_IPT_EMAIL":"Email","P_IPT_SENDTHISTO":"Who do you want to send this to? Select from existing relationships or manual entry.","P_IPT_EMAILADDRESSESTIPS":"Separate multiple manually entered email addresses with a semi-colon (;).","P_IPT_OTHEREMAILADDRESS":"Other Email Address","P_IPT_CONTACTNAME":"Contact Name","P_IPT_CONTACTTYPE":"Contact Type","P_IPT_PAGES":"Pages","P_IPT_PAGE":"Page","P_IPT_REMOVEPAGE":"Remove Page","P_IPT_DELETEPAGE":"Delete Page","P_IPT_COPYPAGE":"Copy Page","P_IPT_UNNAMED":"Unnamed","P_IPT_AREYOUSUREYOUWANTTOREMOVETHISPAGE":"Are you sure you want to remove this page?","P_IPT_EDITTEMPLATE":"Edit Template","P_IPT_ADDTEMPLATE":"Add Template","P_IPT_SAVETEMPLATE":"Save Template","P_IPT_PUBLISHTEMPLATE":"Publish Template","P_IPT_DELETETEMPLATE":"Delete Template","P_IPT_SAVEAS":"Save As","P_IPT_ONLYONEQUESTIONCANBEINCLUDEDINTHETEMPLATE":"Only one {0} question can be included in the template.","P_IPT_FAILEDTOSAVETEMPLATE":"Failed to save Template.","P_IPT_FAILEDTOSAVEAS":"Failed to save as.","P_IPT_VINSN":"VIN/SN","P_IPT_VINSN_COLON":"VIN/SN:","P_IPT_MAKE_COLON":"Make:","P_IPT_MODEL_COLON":"Model:","P_IPT_ASSETTYPE_COLON":"Asset Type:","P_IPT_EDITFILTER":"Edit Filter","P_IPT_ADDFILTER":"Add Filter","P_IPT_COPY":"Copy","P_IPT_ADDASLINK":"Add as Link","P_IPT_FAILEDTOGETTHESECTIONS":"Failed to get the sections: ","P_IPT_FAILEDTOGETTHESECTIONS1":"Failed to get the sections.","P_IPT_AREYOUSUREYOUWANTTODELETETHISTEMPLATE":"Are you sure you want to delete this template?","P_IPT_AREYOUSUREYOUWANTTOPUBLISHTHISTEMPLATE":"Are you sure you want to publish this template?","P_IPT_TEMPLATENAME_COLON":"Template Name:","P_IPT_BEGINDATE_COLON":"Begin Date:","P_IPT_ENDDATE_COLON":"End Date:","P_IPT_ASSETNAME":"Asset Name","P_IPT_VIN":"VIN","P_IPT_MAKE":"Make","P_IPT_MODEL":"Model","P_IPT_ASSETTYPE":"Asset Type","P_IPT_STATUS":"Status","P_IPT_COMMITTIME":"Commit Time","P_IPT_COMMITUSER":"Commit User","P_IPT_LASTUPDATEDTIME":"Last Updated Time","P_IPT_LASTUPDATEDUSER":"Last Updated User","P_IPT_DETAIL":"Detail","P_IPT_DOWNLOAD":"Download","P_IPT_DOWNLOADPDF":"Download PDF","P_IPT_PRINT":"Print","P_IPT_EDITINSPECTION":"Edit Inspection","P_IPT_SUPPLIEDINPUTISNOTAVALIDTIME":"Supplied input is not a valid time.","P_IPT_SUPPLIEDINPUTISNOTAVALIDNUMBER":"Supplied input is not a valid number.","P_IPT_VALIDEMAILADDRESSFORMATREQUIRED":"Valid email address format required.","P_IPT_SUPPLIEDINPUTISNOTAVALIDPERCENTVALUE":"Supplied input is not a valid percent value.","P_IPT_THEQUESTIONISREQUIRED":"The question is required.","P_IPT_QUESTIONRESULTISINVALID":"Question result is invalid.","P_IPT_PAGEERROR1":"An unknown error occurred.","P_IPT_FAILEDTOUPDATEINSPECTION":"Failed to update inspection.","P_IPT_UPDATEINSPECTIONSUCCESSFULLY":"Update inspection successfully.","P_IPT_REFRESHPAGE":" Please refresh page.","P_IPT_ASSETNAME2_COLON":"Asset Name(Custom):","P_IPT_LOADEDASSETLIST":"loaded asset list:","P_IPT_FAILEDTODOWNLOADASSETLIST":"failed to download asset list.","P_IPT_NOQUESTIONS":"No Questions","P_IPT_INSPECTIONDETAIL":"INSPECTION DETAIL","P_IPT_SIGNATURE":"Signature","P_IPT_ADDPICTURE":"Add Picture","P_IPT_ADDTEMPLATEPICTURE":"Add Template Picture","P_IPT_NOPICTURE":"No Picture","P_IPT_ADDREFERENCE":"Add Reference","P_IPT_DELETEFILE":"Delete File","P_IPT_DELETEFILECONFIRM":"Are you sure you want to delete this file?","P_IPT_FILETIPS":"File size is 0kb, uploading failed.","P_IPT_FILETIPS1":"File is too large. Maximum size is 2MB.","P_IPT_FUELLOG":"Fuel Log","P_IPT_FUELLOGSHIPPINGPAPER":"Fuel Log * Shipping Paper","P_IPT_EMERGENCYCONTACTS_COLON":"Emergency Contacts:","P_IPT_HAZARDCLASS_COLON":"Hazard Class:","P_IPT_PACKINGGROUP_COLON":"Packing Group:","P_IPT_STEVENBURCH":"Steven Burch","P_IPT_IDNUMBER_COLON":"ID#:","P_IPT_COMBUSTIBLELIQUID":"Combustible Liquid","P_IPT_EMPLOYEENUMBER_COLON":"Employee #:","P_IPT_DATE_COLON":"Date:","P_IPT_CHECKEDIN":"Checked In","P_IPT_CHECKEDOUT":"Checked Out","P_IPT_EMPLOYEENAME_COLON":"Employee Name:","P_IPT_ASSETNAME_COLON":"Asset Name:","P_IPT_FUELTRUCKNUMBER_COLON":"Fuel Truck#:","P_IPT_EQUIPMENT":"Equipment #","P_IPT_HOURMETERODOMETER":"Hour Meter/Odometer","P_IPT_MASTERMETER":"Master Meter","P_IPT_GALLONSPUMPED":"Gallons Pumped","P_IPT_GALLONSONTRUCK":"Gallons on Truck","P_IPT_CERTJOB":"CERT JOB #","P_IPT_LOCATION":"Location","P_IPT_EQUIPMENTCONDITION":"Equipment Condition","P_IPT_FUELTRUCK_COLON":"Fuel Truck #:","P_IPT_IWITNESSEDANACCIDENTINJURYTODAY_COLON":"I witnessed an accident/injury today:","P_IPT_BULKPUMPMTRBEGINNING_COLON":"Bulk Pump Mtr Beginning:","P_IPT_IWASINVOLVEDINANACCIDENTTODAY_COLON":"I was involved in an accident today:","P_IPT_BULKPUMPMTRENDING_COLON":"Bulk Pump Mtr Ending:","P_IPT_IFYESTIPS":"If YES, your supervisor must be notified and an accident report filled out.","P_IPT_GALLONSDISPENSED_COLON":"Gallons Dispensed:","P_IPT_INCHESLEFTONTRUCK_COLON":"Inches Left on Truck:","P_IPT_FUELRPT_SETTING":"Fuel Report Page Settings","P_IPT_FUELRPT_HEADER":"Page Headers","P_IPT_FUELRPT_FOOTER":"Page Footers","P_IPT_FUELRPT_LEFT":"Left:","P_IPT_FUELRPT_MIDDLE":"Middle:","P_IPT_FUELRPT_RIGHT":"Right:","P_IPT_FUELRPT_SAVEERROR":"Failed to save fuel report page settings.","P_IPT_SENDEMAIL":"Send Email","P_IPT_OTHEREMAILADDRESSISINVALID":"The other email address {0} is invalid.","P_IPT_MESSAGESENT":"Message sent.","P_IPT_FAILEDTOSENDEMAIL":"Failed to send email.","P_IPT_PACKAGES":"Packages","P_IPT_EXPORTPACKAGES":"Export Packages","P_IPT_IMPORTPACKAGE":"Import Package","P_IPT_IMPORTPACKAGES":"Import Packages","P_IPT_CREATE":"Create","P_IPT_LOCKED_COLON":"Locked:","P_IPT_PACKAGENAME":"Package Name","P_IPT_CREATOR":"Creator","P_IPT_DATETIMECREATED":"Date/Time Created","P_IPT_DOWNLOADPACKAGE":"Download Package","P_IPT_DELETEPACKAGE":"Delete Package","P_IPT_AREYOUSUREYOUWANTTODELETETHISPACKAGE":"Are you sure you want to delete this package?","P_IPT_FAILEDTODELETEPACKAGE":"Failed to delete package.","P_IPT_PLEASESELECTTHEPACKAGEFILE":"Please select the package file.","P_IPT_PLEASEUNPACKTHEPACKAGE":"Please unpack the package.","P_IPT_PLEASESELECTATLEASTONETEMPLATEORGLOBALSECTIONTOIMPORT":"Please select at least one template or global section to import.","P_IPT_PACKAGEHASBEENIMPORTEDSUCCESSFULLY":"Package has been imported successfully.","P_IPT_PASSWORDISREQUIRED":"Password is required.","P_IPT_DOYOUWANTTOOVERWRITETHEITEMSWHICHHAVEANEWERVERSION":"Do you want to overwrite the items which have a higher version?","P_IPT_IMPORTPACKAGEFILE_COLON":"Import Package File:","P_IPT_BROWSE":"Browse...","P_IPT_UNPACK":"Unpack","P_IPT_IMPORT":"Import","P_IPT_CREATEPACKAGE":"Create Package","P_IPT_PACKAGENAMEISREQUIRED":"Package name is required.","P_IPT_PACKAGEHASBEENCREATEDSUCCESSFULLY":"Package has been created successfully.","P_IPT_THEPASSWORDSYOUENTEREDDONOTMATCHCHECKYOURTYPINGANDTRYAGAIN":"The passwords you entered do not match. Check your typing and try again.","P_IPT_PLEASESELECTATLEASTONETEMPLATEORGLOBALSECTIONTOEXPORT":"Please select at least one template or global section to export.","P_IPT_FAILEDTOCREATEPACKAGE":"Failed to create package.","P_IPT_CUSTOMERVISIBLE":"Customer Visible","P_IPT_WORKORDER":"Work Order","P_IPT_WORKORDER_COLON":"Work Order:","P_IPT_FORWORKORDER_COLON":"For Work Order:","P_IPT_CUSTOMERVISIBLE_COLON":"Customer Visible:","P_IPT_ALREADYLINKED":"{0} has already been linked to current template.","P_IPT_USERNAME":"User Name","P_IPT_DATETIME":"Date Time","P_IPT_INSPECTIONCHANGEHISTORY":"Inspection Change History","P_IPT_VIEWCHANGEHIS":"View Change History","P_CHANGEPASSWORD":"Change Password","P_CP_USERID":"User ID","P_CP_OLDPASSWORD":"Old Password","P_CP_NEWPASSWORD":"New Password","P_CP_CONFIRMNEWPASSWORD":"Confirm New Password","P_CP_THEOLDPASSWORDISWRONG":"The old password is wrong.","P_CP_PASSWORDSTRENGTH":"Password strength","P_CP_OK":"OK","P_CP_CLOSE":"Close","P_CP_PLEASEENTERTHEPASSWORD":"Please enter the password.","P_CP_THEHEADANDTAILOFTHEPASSWORDCANNOTBESPACES":"The head and tail of the password cannot be spaces.","P_CP_THEPASSWORDSYOUENTEREDDONOTMATCHCHECKYOURTYPINGANDTRYAGAIN":"The passwords you entered do not match. Check your typing and try again.","P_CP_PASSWORDTIPS":"The password must have at least 8 characters.","P_CP_PASSWORDTIPS1":"The password must contain both uppercase and lowercase characters and at lease one number.","P_CP_PASSWORDTIPS2":"The two passwords are different. Please reenter.","P_CP_PASSWORDSUCCESSFULLYCHANGED":"Password successfully changed.","P_CP_UNKNOWNERROROCCURS":"Unknown error occurs.","P_CP_WEAK":"weak","P_CP_MEDIUM":"medium","P_CP_STRONG":"strong","P_MAPVIEW":"Map View","P_MV_PAGEERROR":"An unknown error occurred. Please refresh page.","P_MV_QUERY":"Query","P_MV_ERROR":"Error","P_MV_YES":"Yes","P_MV_NO":"No","P_MV_ADD":"Add","P_MV_EDIT":"Edit","P_MV_DELETE":"Delete","P_MV_REFRESH":"Refresh","P_MV_SEARCH":"Search","P_MV_SAVE":"Save","P_MV_OK":"OK","P_MV_CANCEL":"Cancel","P_MA_CONTRACTORS_COLON":"Contractors:","P_MV_ONROAD":"Onroad","P_MV_OFFROAD":"Offroad","P_MV_LOADDEFAULT":"Load Default","P_MV_LOADDEFAULTSEARCH":"Load Default Search","P_MV_SAVEDSEARCHES":"Saved Searches","P_MV_SAVESEARCH":"Save Search","P_MV_SEARCHNAME":"Search Name","P_MV_DEFAULT":"Default","P_MV_APPLY":"Apply","P_MV_LOAD":"Load","P_MV_LOADING":"Loading","P_MV_QUICKLOADSKIPTOEND":"Quick Load/Skip to End","P_MV_TRIPREPORT":"Trip Report","P_MV_QUICKLOAD":"Quick Load","P_MV_PLAYING":"Playing","P_MV_SAVEASDEFAULT":"Save as default","P_MV_SAVESEARCHASDEFAULT":"Save Search as Default","P_MV_SHOWALL":"Show All","P_MV_ATTACHMENTSONLY":"Attachments Only","P_MV_NOATTACHMENTS":"No Attachments","P_MV_ASSETS":"Assets","P_MV_ASSET_COLON":"Asset:","P_MV_JOBSITES":"Jobsites","P_MV_ASSETGROUPS":"Asset Groups","P_MV_ASSETGROUPS_COLON":"Asset Group(s):","P_MV_GROUPS_COLON":"Group(s):","P_MV_SHAPES":"Shapes","P_MV_DETAIL":"Detail","P_MV_SN_COLON":"SN:","P_MV_ENGINEHOURS_COLON":"Engine Hours:","P_MV_HOURS_COLON":"Hours:","P_MV_ODOMETER_COLON":"Odometer:","P_MV_MAKE":"Make","P_MV_MAKE_COLON":"Make:","P_MV_MODEL":"Model","P_MV_MODEL_COLON":"Model:","P_MV_ASSETTYPE":"Asset Type","P_MA_ASSETTYPE_COLON":"Asset Type:","P_MV_TYPE":"Type","P_MV_TYPE_COLON":"Type:","P_MA_SELECTALL":"Select All","P_MA_LOCATIONHISTORY":"Location History","P_MA_SELECTALLASSETS":"Select All Assets","P_MA_JOBFENCEON":"Job Fence On","P_MV_IMPORTSHAPEFILE":"Import Shape File","P_MV_TURNOFFDEALERLOCATIONS":"Turn Off Dealer Locations","P_MV_TURNONDEALERLOCATIONS":"Turn On Dealer Locations","P_MV_TURNONTRAFFIC":"Turn On Traffic","P_MV_TURNOFFTRAFFIC":"Turn Off Traffic","P_MV_TURNONWEATHER":"Turn On Weather","P_MV_TURNOFFWEATHER":"Turn Off Weather","P_MV_TURNONAUTORECENTERMAP":"Turn On Auto-Recenter Map","P_MV_TURNOFFAUTORECENTERMAP":"Turn Off Auto-Recenter Map","P_MV_MAPALERTLAYER":"Map Alert Layer","P_MV_SETPARAMETERS":"Set Parameter(s)","P_MV_LEGEND":"Legend","P_MV_NOASSETSELECTED":"No asset selected.","P_MV_TIMEPERIOD_COLON":"Time Period:","P_MV_TODAY":"Today","P_MV_PRIORDAY":"Prior Day","P_MV_LAST24HOURS":"Last 24 Hours","P_MV_LAST7DAYS":"Last 7 Days","P_MV_CUSTOM":"Custom","P_MV_FROM_COLON":"From:","P_MV_TO_COLON":"To:","P_MV_TO_EXCLUDE00LOCATIONS":"Exclude 0,0 Locations","P_MV_PLAYBACK":"Playback","P_MV_SENDLOCATION":"Send Location","P_MV_SENDJOBSITE":"Send Jobsite","P_MV_SENDTHISTO":"Who do you want to send this to? Select from existing relationships or manual entry.","P_MV_EMAILORTEXTADDRESSESTIPS":"Separate multiple manually entered email or text addresses with a semi-colon (;).","P_MV_OTHEREMAILADDRESS":"Other Email Address","P_MV_OTHERTEXTADDRESS":"Other Text Address","P_MV_CONTACTNAME":"Contact Name","P_MV_CONTACTTYPE":"Contact Type","P_MV_TEXT":"Text","P_MV_EMAIL":"Email","P_MV_DESCRIPTION":"Description","P_MV_DESCRIPTION_COLON":"Description:","P_MV_NAME_COLON":"Name:","P_MV_NAMECUSTOM_COLON":"Name (Custom):","P_MV_NOTES_COLON":"Notes:","P_MV_CODE_COLON":"Code:","P_MV_NUMBER_COLON":"Number:","P_MV_FOREMAN_COLON":"Foreman:","P_MV_ENDDATE_COLON":"End Date:","P_MV_VIDEOREQUEST":"Video Request","P_MV_REQUESTVIDEO":"Request Video","P_MV_CUSTOMTIME_COLON":"Custom Time:","P_MV_DATE_COLON":"Date:","P_MV_TIME_COLON":"Time:","P_MV_VIDEOCLIPLENGTH_COLON":"Video Clip Length:","P_MV_30SECONDS":"30 Seconds","P_MV_120SECONDS":"120 Seconds","P_MV_SUBMIT":"Submit","P_MV_EXCLUDEASSETSWITHNOREPORTEDLOCATION":"Exclude assets with no reported location (0,0)","P_MV_REFRESHASSETDATA":"Refresh asset data","P_MV_UNABLETOOBTAINASSETDATAATTEMPTINGTORECONNECT":"Unable to obtain asset data. Attempting to reconnect...","P_MV_UNABLETOOBTAINJOBSITEDATAATTEMPTINGTORECONNECT":"Unable to obtain jobsite data. Attempting to reconnect...","P_MV_YOUHAVENOSAVEDSEARCHES":"You have no saved searches.","P_MV_YOUHAVENODEFAULTSERACH":"You have no default search. Would you like to view your saved searches?","P_MV_OTHEREMAILADDRESSISINVALID":"The other email address {0} is invalid.","P_MV_OTHERTEXTADDRESSISINVALID":"The other text address {0} is invalid.","P_MV_MESSAGESENT":"Message sent.","P_MV_FAILEDTOSENDJOBSITE":"Failed to send jobsite.","P_MV_FAILEDTOSENDLOCATION":"Failed to send location.","P_MV_LASTREFRESHED":"Last Refreshed: ","P_MV_REFRESHMACHINEDATA":"Refresh machine data","P_MV_REFRESHJOBSITEDATA":"Refresh jobsite data","P_MV_WEATHER":"Weather","P_MV_DIRECTIONS":"Directions","P_MV_DIRECTIONS_COLON":"Directions:","P_MV_LOCATIONUPDATED_COLON":"Location Updated:","P_MV_ENGINEHOURSUPDATED_COLON":"Engine Hours Updated:","P_MV_CURRENTSPEED_COLON":"Current Speed:","P_MV_POSTEDSPEED_COLON":"Posted Speed:","P_MV_STREET_COLON":"Street:","P_MV_LASTINSPECTION_COLON":"Last Inspection:","P_MV_ALERTLAST14DAYS":"Alerts Last 14 Days","P_MV_DATE":"Date","P_MV_TIME":"Time:","P_MV_DATETIME":"Date Time","P_MV_LEVEL":"Level","P_MV_READING":"Reading","P_MV_RESULT":"Result","P_MV_PIVOTS":"Pivots","P_MV_CRITERIA":"Criteria","P_MV_ALERT":"Alert","P_MV_LATITUDE_COLON":"Latitude:","P_MV_LONGITUDE_COLON":"Longitude:","P_MV_HARDACCELERATION":"Hard Acceleration","P_MV_HARDBRAKE":"Hard Brake","P_MV_HARDBTURN":"Hard Turn","P_MV_SPEEDINGLOWSEVERITY":"Speeding: Low Severity","P_MV_SPEEDINGHIGHSEVERITY":"Speeding: High Severity","P_MV_FROMDATETIMEMUSTBEPRIORTOTODATETIME":"From Date/Time must be prior to To Date/Time.","P_MV_REQUESTVIDEOFAILED":"Request video failed.","P_MV_REQUESTVIDEOSUCCESSFULLY":"A video has been successfully requested for this Asset at the timestamp indicated. The requested video will be emailed to you once it is available. If the Asset or Camera are currently offline, the requested video will be sent as soon as it is available.","P_MV_DELETESEARCH":"Delete Search","P_MV_SEARCHDELETEWANTTOCONTINUE":"Search {0} will be permanently deleted. Do you want to continue?","P_MV_SEARCHDOESNOTEXIST":"Search {0} does not exist.","P_MV_SEARCHALREADYEXIST":"Search {0} already exists. Would you like to replace?","P_MV_FAILEDTODELETETHISSEARCH":"Failed to delete this search.","P_MV_FAILEDTOSAVETHISSEARCH":"Failed to save this search.","P_MV_SEARCHNAMEISREQUIRED":"Search Name is required.","P_MV_SAVSUCCESSFULLY":"Saved successfully.","P_MV_DELETESHAPEFILE":"Delete Shape File","P_MV_DOYOUWANTTODELETETHESHAPEFILE":"Do you want to delete the shape file?","P_MV_FAILEDTODELETETHISSHAPLEFILE":"Failed to delete this shaple file.","P_MV_SHAPENAMECANNOTBEEMPTY":"Shape name cannot be empty.","P_MV_CLEAR":"Clear","P_MV_ONOFFEVENTS":"On/Off Events","P_MV_ASSETNAME_COLON":"Asset Name:","P_MV_VINSN_COLON":"VIN/SN:","P_MV_YEAR_COLON":"Year:","P_MV_ADDREADING":"Add Reading","P_MV_LASTUPDATEDATDATE":"Last updated at date:","P_MV_IDLEHOURSFORLAST14CALENDARDAYS":"Idle hours for last 14 calendar days.","P_MV_LDLEHOURS":"ldle Hours:","P_MV_ACQUISITIONTYPE_COLON":"Acquisition Type:","P_MV_COSTCENTER_COLON":"Cost Center:","P_MV_REVENTATIVEMAINTENANCEPLAN_COLON":"PM Plan: ","P_MV_ADDPLAN":"Add Plan","P_MV_EDITPLAN":"Edit Plan","P_MV_RENTALINFORMATION":"Rental Information","P_MV_STARTDATE_COLON":"Start Date:","P_MV_RENTALRATE_COLON":"Rental Rate:","P_MV_PROJECTRETURNDATE_COLON":"Proj Return Date:","P_MV_TERMUNIT_COLON":"Term/Unit:","P_MV_RENTALSTATUS_COLON":"Rental Status:","P_MV_EDITASSET":"Edit Asset","P_MV_WORKORDERS":"Work Orders","P_MV_MAINTENANCERECORD":"Maintenance Record","P_MV_LASTKNOWNLOCATION_COLON":"Last Known Location:","P_MV_CURRENTJOBSITE_COLON":"Current Jobsite:","P_MV_JOBSITE_COLON":"Jobsite:","P_MV_LATESTFOREMAN_COLON":"Latest Foreman:","P_MV_CURRENTOPERATOR_COLON":"Current Operator:","P_MV_DATEADDED_COLON":"Date Added:","P_MV_TIMELINE":"Timeline","P_GRID_TITLE":"Utilization by Hour","P_MV_ADDODOMETER":"Add Odometer","P_MV_ODOMETERUOM_COLON":"Odometer UOM:","P_MV_MILE":"Mile","P_MV_KILOMETER":"Kilometer","P_MV_TIMEZON_COLON":"Time Zone:","P_MV_ODOMETERDATE_COLON":"Odometer Date:","P_MV_ODOMETERTIME_COLON":"Odometer Time:","P_MV_ADDOENGINEHOURS":"Add Engine Hours","P_MV_ENGINEHOURSDATE_COLON":"Engine Hours Date:","P_MV_ENGINEHOURSTIME_COLON":"Engine Hours Time:","P_MV_ADDASSETTOSCHEDULE":"Add Asset To Schedule","P_MV_ODOMETERATTIMEOFREADING":"Odometer at time of reading","P_MV_ENGINEHOURSATTIMEOFREADING":"Engine Hours at time of reading","P_MV_TIMEZONEOFASSETREADING":"Time zone of asset reading","P_MV_DATEOFREADING":"Date of reading","P_MV_TIMEOFREADINGMILITARY":"Time of reading (military)","P_MV_NOPLANASSIGNED":"No Plan Assigned.","P_MV_ADDENGINEHOURS":"Add Engine Hours","P_MV_ADJUSTENGINEHOURS":"Adjust Engine Hours","P_MV_ENGINEHOURSFORMATERROR":"Engine Hours format error.","P_MV_ENGINEHOURSMUSTBEGREATERTHAN0":"Engine Hours must be greater than 0.","P_MV_ENGINEHOURSCANNOTBEEMPTY":"Engine Hours cannot be empty.","P_MV_ENGINEHOURSDATECANNOTBEEMPTY":"Engine Hours Date cannot be empty.","P_MV_UPDATEENGINEHOURS":"Do you want to update the engine hours to reflect: {0} hours at {1} {2}?","P_MV_UPDATEENGINEHOURS1":"If you proceed, engine hours will be updated to reflect: {0} hours at {1} {2}. Note that this asset is telematic enabled and the primary data source is {3} Would you like to proceed?","P_MV_ENGINEHOURSUPDATESUCCESSFUL":"Engine Hours Update Successful.","P_MV_ODOMETERUPDATESUCCESSFUL":"Odometer Update Successful.","P_MV_FAILEDTOADDENGINEHOURS":"Failed to add Engine Hours.","P_MV_FAILEDTOADDODOMETER":"Failed to add Odometer.","P_MV_FAILEDTOADJUSTENGINEHOURS":"Failed to adjust Engine Hours.","P_MV_FAILEDTOADJUSTODOMETER":"Failed to adjust Odometer.","P_MV_CHECKENGINEHOURSMINNIMUMTIME":"The adjustment cannot be completed as provided. The engine hours reading date provided cannot be prior to initial telematic data available for the asset.","P_MV_CHECKENGINEHOURSMINNIMUMTIME1":"The adjustment cannot be completed as provided. The engine hours reading date provided must be prior to or equal to the latest telematic data available for the asset.","P_MV_CHECKODOMETERMINNIMUMTIME":"The adjustment cannot be completed as provided. The odometer reading date provided must be prior to or equal to the latest telematic data available for the asset.","P_MV_ADJUSTODOMETER":"Adjust Odometer","P_MV_ODOMETERFORMATERROR":"Odometer format error.","P_MV_ODOMETERMUSTBEGREATERTHAN0":"ODOMeter must be greater than 0.","P_MV_ODOMETRCANNOTBEEMPTY":"Odometer cannot be empty.","P_MV_ODOMETRDATACANNOTBEEMPTY":"Odometer data cannot be empty.","P_MV_UPDATETHEODOMETER":"Do you want to update the odometer to reflect: {0} {1} at {2} {3}?","P_MV_UPDATETHEODOMETER1":"If you proceed, odometer will be updated to reflect: {0} {1} at {2}{3}. Note that this asset is telematic enabled and the primary data source is {4} Would you like to proceed?","P_MV_SCHEDULENAME":"Schedule Name","P_MV_INITIALSERVICEVALUE":"Initial Service Value","P_MV_LASTSERVICEDATE":"Last Service Date","P_MV_LASTSERVICEPERFORMED":"Last Service Performed","P_MV_REMOVEASSETFROMSCHEDULE":"Do you want to remove this asset from the schedule?","P_MV_REMOVEASSETFROMSCHEDULE_TIPS":"Select OK below will result in the deletion of existing unassigned PM alerts for this asset. If you do not want those alerts deleted, select CANCEL and assign appropriate alerts to a maintenance record or work order in asset health prior to deletion/removal.","P_MV_REMOVEASSET":"Remove Asset","P_MV_WHENWOULDYOULIKETHEFIRSTALERT":"When would you like the first alert?","P_MV_NOAVAILABLEINTERVALS":"No available intervals.","P_MV_ONEORMORESERVICESWASMISSEDALERTMEFOR":"One or more services was missed. Alert me for ","P_MV_NOW":" now.","P_MV_FOR":" for ","P_MV_CALCULATEBASEDUPONLASTSERVICETHE":"Calculate based upon last service. The ","P_MV_CALCULATEBASEDUPONLASTSERVICETHELASTSERVICEDATAWAS":"Calculate based upon last service. The last service date was ","P_MV_SERVICEWASPERFORMEDAT":" service was performed at ","P_MV_TRIGGERANALERTASIFSERVICEISDUETODAY":"Trigger an alert as if service is due today.","P_MV_THEFIRSTALERTWILLBE":"The first alert will be ","P_MV_BEFORETHEASSETREADING":" before the asset reading ","P_MV_TRIP":"Trip","P_MV_JOBSITES_COLON":"Jobsite(s):","P_MV_NEXTSERVICE_COLON":"Next Service: ","P_MV_LASTCOMPLETED_COLON":"Last Completed:","P_MV_LOCATION_COLON":"Location:","P_MV_FUELLEVEL_COLON":"Fuel Level:","P_MV_OVERDUE_COLON":"Overdue:","P_MV_ASOF":"as of ","P_MV_SCHEDULEDMAINTENANCE":"Scheduled Maintenance","P_MV_LOCATIONASSIGNMENTINFORMATION":"Location Assignment Information","P_MV_ASSETSTATUS":"Asset Status","P_MV_UTILIZATION":"Utilization","P_MV_TOTALHOURS_COLON":"Total Hours:","P_MV_WORKINGHOURS_COLON":"Working Hours:","P_MV_FUEL":"Fuel","P_MV_NOJOBSITEASSIGNED":"No Jobsite Assigned","P_MV_NOASSETGROUPASSIGNED":"No Asset Group Assigned","P_MV_TEXTADDRESSHELPTIP":"\r\n\t\t\t\tText addresses should be entered as number@carrier text suffix.\r\n\t\t\t\tThe major carriers are listed below.\r\n\t\t\t\tAlltel Wireless: @mms.alltel.net\r\n\t\t\t\tAT&T Wireless: @mms.att.net\r\n\t\t\t\tAT&T Mobility (formerly Cingular): @mobile.mycingular.com\r\n\t\t\t\tBoost Mobile: @mms.mycricket.com\r\n\t\t\t\tMetro PCS: @mymetropcs.com\r\n\t\t\t\tSprint (PCS): @pm.sprint.com\r\n\t\t\t\tSprint (Nextel): @messaging.nextel.com\r\n\t\t\t\tStraight Talk: @mypixmessages.com\r\n\t\t\t\tT-Mobile: @tmomail.net\r\n\t\t\t\tU.S. Cellular: @mms.uscc.net\r\n\t\t\t\tVerizon: @vzwpix.com\r\n\t\t\t\tVirgin Mobile: @vmpix.com\r\n\r\n\t\t\t\tFor example, for cellphone number: 480-123-4567 on Verizon,\r\n\t\t\t\tthe text address would be: 4801234567@vzwpix.com\r\n\r\n\t\t\t\tTo send to a second recipient, separate the values with a ;. For\r\n\t\t\t\texample: 4801234567@vzwpix.com;4808901234@tmomail.net\r\n\t\t\t","P_MV_LATLONG_COLON":"Lat/Long:","P_MV_DELIVERYADDRESS_COLON":"Delivery Address:","P_MV_ROUTE_DIRECTION":"Route Navigation","P_MV_ROUTE_STARTLOCATION":"Starting location or asset","P_MV_ROUTE_ENDLOCATION":"Ending location or asset","P_MV_ROUTE_LOCATION":"Location or asset","P_MV_ROUTE_ADDSTOP":"+ Add Locations","P_MV_ROUTE_GETDIRECTIONS":"Get Directions","P_MV_ROUTE_OPTIMIZEROUTE":"Optimize Route","P_MV_ROUTE_FASTESTROUTE":"Fastest Route","P_MV_ROUTE_SHORTESTROUTE":"Shortest Route","P_MV_ROUTE_RETURN_INITIAL":"Return to Initial Location","P_MV_TURNON_ROUTENAVIGATION":"Turn On Route Navigation","P_MV_TURNOFF_ROUTENAVIGATION":"Turn Off Route Navigation","P_MV_CURRENTLOCATION":"Current Location","P_MV_OPENINGOOGLEMAP":"Open in the Google Map","P_MV_SENDROUTE":"Send Route","P_MV_FAILEDSENDROUTE":"Failed to send route.","P_MV_CLICKOPENGOOGLE":"Click here to open Google Map with these stops.","P_MV_SECONDS":"seconds","P_MV_MINUTES":"minutes","P_MV_HOURS":"hours","P_MV_METER":"m","P_MV_KM":"km","P_MV_MI":"mi","P_MV_FEET":"ft","P_MV_LOCATIONOFASSET_COLON":"Location of Asset:","P_MV_VIEWDIRECTIONS":"View Directions","P_MV_CLICKTHELINKBELOWTOVIEWDIRECTIONSTOTHISASSET":"Click the link below to view directions to this asset:","P_MV_TOGGLE_TIMELINES":"Click to toggle the timeline panel display.","P_SYSTEMSETTINGS":"System Settings","P_SET_PAGEERROR":"An unknown error occurred. Please refresh page.","P_SET_QUERY":"Query","P_SET_ERROR":"Error","P_SET_YES":"Yes","P_SET_NO":"No","P_SET_ADD":"Add","P_SET_EDIT":"Edit","P_SET_DELETE":"Delete","P_SET_REFRESH":"Refresh","P_SET_SEARCH":"Search","P_SET_SAVE":"Save","P_SET_OK":"OK","P_SET_CANCEL":"Cancel","P_SET_USEROPTIONS":"User Options","P_SET_STYLE_COLON":"Style:","P_SET_LANGUAGES_COLON":"Languages:","P_SET_SAVEUSEROPTIONS":"Save User Options","P_SET_SAVSUCCESSFULLY":"Saved successfully.","P_SET_MANAGELOCATIONS":"Manage Locations","P_SET_ADDLOCATIONS":"Add Location","P_SET_EDITLOCATIONS":"Edit Location","P_SET_DELETELOCATIONS":"Delete Location","P_SET_SAVELOCATIONS":"Save Location","P_SET_LOCATIONSNAME":"Location Name","P_SET_LOCATIONSNAME_COLON":"Location Name:","P_SET_LATITUDE":"Latitude","P_SET_LATITUDE_COLON":"Latitude:","P_SET_LONGITUDE":"Longitude","P_SET_LONGITUDE_COLON":"Longitude:","P_SET_ADDRESS":"Address","P_SET_ADDRESS1":"Address 1","P_SET_ADDRESS1_COLON":"Address 1:","P_SET_ADDRESS2":"Address 2","P_SET_ADDRESS2_COLON":"Address 2:","P_SET_CITY":"City","P_SET_CITY_COLON":"City:","P_SET_STATE":"State","P_SET_STATE_COLON":"State:","P_SET_ZIP":"Zip","P_SET_ZIP_COLON":"Zip:","P_SET_LOGO":"Logo","P_SET_LOGO_COLON":"Logo:","P_SET_BROWSE":"Browse...","P_SET_NOTES":"Notes","P_SET_NOTES_COLON":"Notes:","P_SET_PLEASESELECTLOCATION":"Please select Location.","P_SET_DOYOUWANTTODELETETHELOCATION":"Do you want to delete the location?","P_SET_FAILEDTODELETETHISLOCATION":"Failed to delete this Location.","P_SET_LOCATIONNAMECANNOTBEEMPTY":"Location name cannot be empty.","P_SET_LOCATIONNAMEISTOOLONG":"Location name is too long (> 100 characters).","P_SET_LONGITUDEISINVALID":"Longitude is invalid. ","P_SET_LONGITUDEISINVALID1":"Longitude must be less than 180 and greater than -180.","P_SET_LATITUDEISINVALID":"Latitude is invalid.","P_SET_LATITUDEISINVALID1":"Latitude must be less than 90 and greater than -90.","P_SET_NOTESISTOOLONG":"Notes is too long (> 2000 characters).","P_SET_LOCATIONLOGOISINVALID":"The file type for the location logo is invalid. The file must be JPG or PNG.","P_SET_STYLESETTING":"Style Setting","P_SET_STYLENAME":"Style Name","P_SET_STYLENAME_COLON":"Style Name :","P_SET_ISDEFAULT":"Is Default","P_SET_ISDEFAULT_COLON":"Is Default :","P_SET_CHARTTITLECOLOR_COLON":"Chart Title Color :","P_SET_CHARTBORDERCOLOR_COLON":"Chart Border Color :","P_SET_MENUBACKGROUNDCOLOR_COLON":"Menu Background Color :","P_SET_TITLEBARCOLOR_COLON":"Title Bar Color :","P_SET_SYSTEMMESSAGE":"System Message","P_SET_SAVESTYLE":"Save Style","P_SET_STYLENAMECANTBEEMPTY":"Style name can't be empty.","P_SET_CHARTTITLEBGCOLORFORMATISINVALID":"Chart Title Background Color format is invalid. Please enter a valid color code.","P_SET_CHARTBORDERCOLORFORMATISINVALID":"Chart Border Color format is invalid. Please enter a valid code.","P_SET_MENUBGCOLORFORMATISINVALID":"Menu Background Color format is invalid. Please enter a valid code.","P_SET_TITLEBARCOLORFORMATISINVALID":"Title Bar Color format is invalid. Please enter a valid code.","P_SET_DOYOUWANTTODELETETHISSTYLE":"Do you want to delete this style?","P_SET_SYSTEMOPTIONS":"System Options","P_SET_TIMEZON_COLON":"Time Zone:","P_SET_ACCURACYFILTER_COLON":"Accuracy Filter:","P_SET_ACCURACYFILTERTIPS":"FI Tracker – ignore location when accuracy greater than…","P_SET_UNITOFODOMETER_COLON":"Unit Of Odometer:","P_SET_MILE":"Mile","P_SET_KILOMETER":"Kilometer","P_SET_REQUIRECOMMENTWHENACKNOWLEDGINGALERTS_COLON":"Require comment when acknowledging alerts:","P_SET_SAVESYSTEMOPTIONS":"Save System Options","P_SET_ACCURACYFILTERFORMATERROR":"Accuracy Filter format error.","P_SET_ACCURACYFILTERMUSTBBEGREATERTHAN0":"Accuracy Filter must be greater than 0.","P_SET_AREAUNITS_COLON":"Unit Of Area:","P_SET_SQUAREMETER":"Square Meter","P_SET_SQUAREKILOMETRE":"Square Kilometre","P_SET_HECTARE":"Hectare","P_SET_ACRE":"Acre","P_SET_SQUAREMILE":"Square Mile","P_SET_VOLUMEUNITS_COLON":"Unit Of Volume:","P_SET_LITRE":"Litre","P_SET_GALLONUS":"Gallon(U.S.)","P_SET_GALLONENGLISH":"Gallon (U.K.)","P_SET_WEIGHTUNITS_COLON":"Unit Of Weight:","P_SET_KILOGRAM":"Kilogram","P_SET_TONNE":"Tonne","P_SET_POUND":"Pound","P_SET_SHORTTON":"Ton (U.S.)","P_SET_MANAGEDEPARTMENTS":"Manage Departments","P_SET_ADDDEPARTMENT":"Add Department","P_SET_EDITDEPARTMENT":"Edit Department","P_SET_DELETEDEPARTMENT":"Delete Department","P_SET_DEPARTMENTNAME":"Department Name","P_SET_DEPARTMENTNAME_COLON":"Department Name:","P_SET_CODE":"Code","P_SET_CODE_COLON":"Code:","P_SET_CODECANNOTBEEMPTY":"Code cannot be empty.","P_SET_DEPARTMENTNAMECANNOTBEEMPTY":"Department name cannot be empty.","P_SET_PLEASESELECTDEPARTMENT":"Please select Department.","P_SET_DOYOUWANTTODELETETHEDEPARTMENT":"Do you want to delete the department?","P_SET_FAILEDTODELETETHISDEPARTMENT":"Failed to delete this Department.","P_SET_SELECTLOCATION":"Select Location","P_SET_MANAGEREGIONS":"Manage Regions","P_SET_ADDREGION":"Add Region","P_SET_EDITREGION":"Edit Region","P_SET_DELETEREGION":"Delete Region","P_SET_REGIONNAME":"Region Name","P_SET_REGIONNAME_COLON":"Region Name:","P_SET_STARTDATE":"Start Date","P_SET_STARTDATE_COLON":"Start Date:","P_SET_PROJECTEDENDDATE":"Projected End Date","P_SET_PROJECTEDENDDATE_COLON":"Projected End Date:","P_SET_ACTIVE":"Active","P_SET_ENDDATE":"End Date","P_SET_ENDDATE_COLON":"End Date:","P_SET_PLEASESELECTREGION":"Please select Region.","P_SET_REGIONNAMECANNOTBEEMPTY":"Region name cannot be empty.","P_SET_DOYOUWANTTODELETETHEREGION":"Do you want to delete the region?","P_SET_FAILEDTODELETETHISREGION":"Failed to delete this Region.","P_SET_STARTDATEFORMATERROR":"Start Date format error.","P_SET_ENDDATEFORMATERROR":"End Date format error.","P_SET_PROJECTEDENDDATEFORMATERROR":"Projected End Date format error.","P_SET_ENDDATEFORMATERROR1":"End Date must be later than Start Date.","P_SET_PROJECTEDENDDATEFORMATERROR1":"Projected End Date must be later than Start Date.","P_SET_CONNECTOR":"Connector","P_SET_SERVER_COLON":"Server:","P_SET_TOKEN_COLON":"Token:","P_SET_MULTIFACTOR_COLON":"Multi-Factor Authentication Org. Preference:","P_MYFAVORITES":"My Favorites","P_FAV_EDITFAVORITES":"Edit Favorites","P_FAV_GETFAVORITES":"Get Favorites","P_FAV_SETFAVORITES":"Set Favorites","P_FAV_FAVORITE":"Favorite","P_FAV_DELETE":"Delete","P_FAV_CANCEL":"Cancel","P_FAV_SAVE":"Save","P_FAV_UP":"Up","P_FAV_DOWN":"Down","P_FAV_DELETEFAVORITE":"Delete Favorite","P_FAV_DELETEFAVORITECONTINUE":"Favorite {0} will be deleted. Do you want to continue?","P_SERVER_UNKNOWNERROR":"An unknown error has occurred on the server.","P_SERVER_UNKNOWNERROR1":"An unknown error has occurred on the server, please try again.","P_TEMPLATE_DELETEQUESTIONTIPS":"The current Question cannot be deleted because it is referenced by another Question","P_TEMPLATE_DELETESECTIONTIPS":"The current Section cannot be deleted because it is referenced by another Section","P_TEMPLATE_DELETESECTIONTIPS1":"The current section cannot be deleted because its question is referenced elsewhere","P_TEMPLATE_DELETEPUBLISHEDTEMPLATETIPS":"The published template cannot be deleted.","P_ASSETCLASS_DELETEMAKETIPS":"The make can not be deleted because it is in use.","P_ASSETCLASS_THEMAKENAMEMUSTBEUNIQUE":"The Make name must be unique.","P_ASSETCLASS_THEMODELNOTDELETE":"The model can not be deleted because it is in use.","P_ASSETCLASS_THEMODELNAMEMUSTBEUNIQUE":"The Model name must be unique.","P_ASSETDOCUMENT_UNKNOWNERRORUPLOADING":"An unknown error occurred while uploading the file","P_ASSETDOCUMENT_UNKNOWNERRORLOADING":"An unknown error occurred while loading the file","P_RENTAL_RENTALDATESTIPS":"Rental dates entered overlap with another entry. Please adjust the dates.","P_ASSET_VINMUSTBEUNIQUE":"The VIN must be unique with the same make and model.","P_DEVICE_SERIALNUMBERALREADYEXISTS":"The serial number {0} already exists.","P_PACKAGE_CREATINGPACKAGEERROR":"Error occurred while creating package.","P_JOBSITE_TIMETIPS":"End Time must be later than Start Time.","P_JOBSITE_ACCEPTABLETRUCKSTIPS":"Acceptable Maximum Trucks cannot be less than Acceptable Minimum Trucks.","P_JOBSITE_NAMEEXISTS":"Jobsite name already exists.","P_LOGIN_INVALIDUSERNAMEORPASSWORD":"Invalid username or password.","P_LOGIN_USERACCOUNTISNOTCURRENTLYACTIVE":"User account is not currently active.","P_LOGIN_THEUSERWASLOCKED":"The user was locked.","P_LOGIN_INVALIDAUTHENTICATETOKEN":"Invalid authenticate token.","P_LOGIN_EMAILMUSTBEUNIQUE":"Email must be unique. This email address is already in use.","P_LOGIN_INVALIDLOGINSESSION":"Invalid login session","P_LOGIN_PASSWORDHASEXPIRED":"Password has expired.","P_LOGIN_INVALIDAPPLICATIONNAME":"Invalid application name.","P_LOGIN_THEREISNOTVALIDLICENSE":"There is not valid license.","P_LOGIN_THENUMBEROFUSERSALREADYEXCEEDTHEMAXIMUM":"The number of users already exceed the maximum","P_LOGIN_PASSWORDISTEMPORARY":"Password is temporary.","P_LOGIN_UNKNOWNERROROCCURRED":"Unknown error occurred.","P_LOGIN_THEUSERDOESNOTHAVEPERMISSION":"The user does not have permission","P_CUSTOMERRECORD":"Customer Record","P_CR_CODE":"Code","P_CR_CODE_COLON":"Code:","P_CR_COMPANYNAME":"Company Name","P_CR_COMPANYNAME_COLON":"Company Name:","P_CR_SALESPERSONCODE":"Salesperson Code","P_CR_SALESPERSONCODE_COLON":"Salesperson Code:","P_CR_SALESPERSONNAME":"Salesperson Name","P_CR_SALESPERSONNAME_COLON":"Salesperson Name:","P_CR_COMPANYCODE_COLON":"Company Code:","P_CR_ADDRESS":"Address","P_CR_ADDRESS_COLON":"Address:","P_CR_CONTACTNAME":"Contact Name","P_CR_CONTACTNAME_COLON":"Contact Name:","P_CR_CONTACTEMAIL":"Contact Email","P_CR_CONTACTEMAIL_COLON":"Contact Email:","P_CR_CONTACTMOBILE":"Contact Mobile","P_CR_CONTACTPREFERENCES":"Contact Preferences","P_CR_CONTACTPREFERENCES_COLON":"Contact Preferences:","P_CR_NOTES":"Notes","P_CR_NOTES_COLON":"Notes:","P_CR_OPTOUT":"Opt Out","P_CR_EDITCUSTOMER":"Edit Customer","P_CR_ADDCUSTOMER":"Add Customer","P_CR_CUSTOMERINFORMATION":"Customer Information","P_CR_CONTACTINFORMATION":"Contact Information","P_CR_EMAILADDRESS_COLON":"Email Address:","P_CR_COMMENTS":"Comments","P_CR_TEXT":"Text","P_CR_EMAIL":"Email","P_CR_PHONE":"Phone","P_CR_PLEASESELECTCUSTOMERRECORD":"Please select customer record.","P_CR_DELETECUSTOMERRECORD":"Delete Customer Record","P_CR_DOYOUWANTTODELETETHISCUSTOMERRECORD":"Do you want to delete this customer record?","P_CR_FAILEDTODELETETHISCUSTOMERRECORD":"Failed to delete this customer record.","P_CR_EMAILISNOTAVALIDEMAILADDRESS":"The email address is invalid.","P_CR_COMPANYNAMECANNOTBEEMPTY":"Company Name cannot be empty.","P_CR_FAILEDTOSAVECUSTOMER":"Failed to save customer.","P_CR_ADDCONTACT":"Add Contact","P_CR_EDITCONTACT":"Edit Contact","P_CR_DELETECONTACT":"Delete Contact","P_CR_PLEASESAVETHECUSTOMERFIRST":"Please save the customer first.","P_CR_CONTACTNAMECANNOTBEEMPTY":"Contact Name cannot be empty.","P_CR_FAILEDTOSAVECONTACT":"Failed to save contact.","P_CR_DOYOUWANTTODELETETHISCONTACT":"Do you want to delete this contact?","P_CR_FAILEDTODELETETHISCONTACT":"Failed to delete this contact.","P_CR_EMAILANDMOBILEPHONECANNOTBOTHBEEMPTY":"Email and Mobile Phone cannot both be empty.","P_CR_ACTIVE":"Active","P_CR_ACTIVE_COLON":"Active:","P_CR_SELECTSALESPERSON":"Select Salesperson","P_CR_DELETESALESPERSON":"Delete Salesperson","P_CUSTOMERSATISFACTIONSURVEYS":"Customer Satisfaction Surveys","P_WORKORDERSURVEYTEMPLATES":"Work Order Survey Templates","P_WORKORDERSURVEYS":"Work Order Surveys","P_WORKORDERSURVEY":"Work Order Survey","P_WOS_SURVEYMANAGEMENTRESULT":"Survey Management/Result","P_WOS_TEMPLATES":"Templates","P_WOS_TEMPLATES_REPORT":"Report","P_WOS_TEMPLATES_REPORT_COUNT":"There are {0} surveys in total.","P_WOS_PAGEERROR":"An unknown error occurred. Please refresh page.","P_WOS_QUERY":"Query","P_WOS_ERROR":"Error","P_WOS_ADD":"Add","P_WOS_EDIT":"Edit","P_WOS_DELETE":"Delete","P_WOS_REFRESH":"Refresh","P_WOS_OK":"OK","P_WOS_CANCEL":"Cancel","P_WOS_CLOSE":"Close","P_WOS_FILTER":"Filter","P_WOS_SAVE":"Save","P_WOS_SAVE1":"Save and Exit","P_WOS_SAVE2":"Exit Without Saving","P_WOS_NAME":"Name","P_WOS_NAME_COLON":"Name:","P_WOS_NOTES":"Notes","P_WOS_NOTES_COLON":"Notes:","P_WOS_TITLE":"Title","P_WOS_TITLETIPS":"Title Tips","P_WOS_TYPES":"Types","P_WOS_REQUIRED":"Required","P_WOS_SAVSUCCESSFULLY":"Saved successfully.","P_WOS_ADDSURVEYTEMPLATE":"Add Survey Template","P_WOS_EDITSURVEYTEMPLATE":"Edit Survey Template","P_WOS_TEMPLATENAMECANNOTBEEMPTY":"Template Name cannot be empty.","P_WOS_FAILEDTOSAVESURVEYTEMPLATE":"Failed to save survey template.","P_WOS_QUESTIONINFORMATION":"Question Information","P_WOS_SINGLELINETEXT":"Single Line Text","P_WOS_MULTIPLELINETEXT":"Multiple Line Text","P_WOS_CHOOSE":"Choose","P_WOS_YESORNO":"Yes Or No","P_WOS_SCORE":"Score","P_WOS_SCORE_COLON":"Score:","P_WOS_VALUE":"Value:","P_WOS_DISPLAYTEXT_COLON":"Display Text:","P_WOS_QUESTION":"Question","P_WOS_QUESTIONNAMENOTBEEMPTY":"Question Name cannot be empty.","P_WOS_QUESTIONTITLENOTBEEMPTY":"Question Title cannot be empty.","P_WOS_VALUENOTBEEMPTY":"Value cannot be empty.","P_WOS_DISPLAYNAMENOTBEEMPTY":"Display Name cannot be empty.","P_WOS_SCOREISNOTAVALIDINTEGER":"Score is not a valid integer.","P_WOS_PLEASESELECTSURVEYTEMPLATE":"Please select survey template.","P_WOS_DELETESURVEYTEMPLATE":"Delete Survey Template","P_WOS_DOYOUWANTTODELETETHISSURVEYTEMPLATE":"Do you want to delete this survey template?","P_WOS_FAILEDTODELETETHISSURVEYTEMPLATE":"Failed to delete this survey template.","P_WOS_WOSURVEYMESSAGE":"{0} would like your feedback. Please take a few minutes to complete a brief survey about your Recent visit to our service department.","P_WOS_WAITINGCUSTOMERREPLY":"Waiting Customer Reply","P_WOS_REPLIED":"Replied","P_WOS_SURVEYNAME":"Survey Name","P_WOS_SENTDATE":"Sent Date","P_WOS_SENTTIME":"Sent Time","P_WOS_REPLYDATE":"Reply Date","P_WOS_REPLYTIME":"Reply Time","P_WOS_REPLYTIME_COLON":"Reply Time:","P_WOS_CUSTOMERNAME":"Customer Name","P_WOS_CONTACTNAME":"Contact Name","P_WOS_CONTACTNUMBER":"Contact Number","P_WOS_NONE":"(None)","P_WOS_SURVEYSTATUS":"Survey Status:","P_WOS_WORKORDERNUMBER_COLON":"Work Order Number:","P_WOS_ASSET_COLON":"Asset:","P_WOS_CONTACT_COLON":"Contact:","P_WOS_PLEASESELECTSURVEY":"Please select survey.","P_WOS_ALL":"All","P_WOS_WAITINGPERIODFORMATERROR":"Waiting Period format error.","P_LAYOUTS":"Layouts","P_LAYOUT_COLON":"Layout:","P_LAYOUT_DELETETIPS":"Are you sure you want to delete the layout?","P_LAYOUT_FAILEDDELETE":"Failed to delete this layout.","P_LAYOUT_GENERAL":"General","P_LAYOUT_NAME":"Layout Name","P_LAYOUT_NAMECOLON":"Layout Name:","P_LAYOUT_NAMEISEQUIRED":"Layout name is required.","P_LAYOUT_INCLUDELOGO":"Include Logo:","P_LAYOUT_ICONFILENAME":"Logo file:","P_LAYOUT_UPLOADICONTIPS":"The file type for the logo is invalid. The file must be JPG or PNG.","P_LAYOUT_VARIABLE":"Variable:","P_LAYOUT_NOTES":"Notes","P_LAYOUT_NOTESCOLON":"Notes:","P_LAYOUT_CONFIRMSAVE":"The inspection layout has been modified, are you sure you want to discard the modifications and exit?","P_LAYOUT_EDITINSPECTLAYOUT":"Edit Inspection Layout","P_LAYOUT_SAVEINSPECTLAYOUT":"Save Inspection Layout"}} \ No newline at end of file diff --git a/Site/Languages/fr-fr/textres.xml b/Site/Languages/fr-fr/textres.xml index 82637cc..0694d9e 100644 --- a/Site/Languages/fr-fr/textres.xml +++ b/Site/Languages/fr-fr/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="fr-fr" ver="2022-10-21 09:56"> +<root lgid="fr-fr" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>Effacer le stockage local</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>Etes-vous sûr d'effacer le stockage local?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>Veuillez s'il vous plaît vérifier si l'identifiant d'utilisateur existe déjà dans un autre produit FI.</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -3397,6 +3397,7 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>Remarque: Les étiquettes de valeurs où le pourcentage est inférieur à 1 peuvent ne pas être affichées.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>Pièces jointes</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>Rediffusion</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>L’heure de début d’exécution doit être antérieure à l’heure de fin.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>Revendre les abonnements par courriel</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>Groupe:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>Niveau:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> diff --git a/Site/Languages/zh-chs/textres.xml b/Site/Languages/zh-chs/textres.xml index 58076a1..79e2b35 100644 --- a/Site/Languages/zh-chs/textres.xml +++ b/Site/Languages/zh-chs/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="zh-chs" ver="2022-10-21 09:56"> +<root lgid="zh-chs" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>清除本地存储</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>您确定要清除本地存储吗?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>请检查该用户是否已经存在于FI其它系统中。</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -3398,6 +3398,7 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>注意:百分比小于1的值的标签将不会显示。</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>附件</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>重发</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>执行开始时间必须早于结束时间。</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>重发邮件订阅</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>分类:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>级别:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> diff --git a/Site/MachineDeviceManagement/AddDevice.aspx b/Site/MachineDeviceManagement/AddDevice.aspx index 3d6261b..8eb254e 100644 --- a/Site/MachineDeviceManagement/AddDevice.aspx +++ b/Site/MachineDeviceManagement/AddDevice.aspx @@ -302,7 +302,6 @@ function devicerequest(method, param, callback, error) { _network.request("MachineDeviceManagement/ManageMachines.aspx", -1, method, param, callback, error || function (e) { console.log(e); - showmaskbg(false, true); showAlert('An unknown error occurred. Please refresh page.', 'Query'); }); } @@ -622,9 +621,9 @@ function getDeviceComments() { var cid = $('#sel_contractor').val(); - $('#mask_bg').show(); + showloading(true); devicerequest("GetDeviceComments", JSON.stringify([cid, deviceid]), function (data) { - $('#mask_bg').hide(); + showloading(false); if (typeof (data) === "string") { return; } @@ -637,7 +636,7 @@ } } }, function (err) { - $('#mask_bg').hide(); + showloading(false); }); } @@ -663,9 +662,9 @@ var cid = $('#sel_contractor').val(); var param = JSON.stringify([cid, deviceid, comment]); param = htmlencode(param); - $('#mask_bg').show(); + showloading(true); devicerequest("AddDeviceComment", param, function (data) { - $('#mask_bg').hide(); + showloading(false); if (data !== "") { showAlert(data, GetTextByKey("P_MD_ERROR", 'Error')); return; @@ -673,7 +672,7 @@ $('#dialog_comments').val(""); getDeviceComments(); }, function (err) { - $('#mask_bg').hide(); + showloading(false); }); } @@ -683,9 +682,9 @@ function getDeviceInstallationNotes() { var cid = $('#sel_contractor').val(); - $('#mask_bg').show(); + showloading(true); devicerequest("GetDeviceInstallationNotes", JSON.stringify([cid, deviceid]), function (data) { - $('#mask_bg').hide(); + showloading(false); if (typeof (data) === "string") { return; } @@ -698,7 +697,7 @@ } } }, function (err) { - $('#mask_bg').hide(); + showloading(false); }); } @@ -739,7 +738,7 @@ var cid = $('#sel_contractor').val(); var param = JSON.stringify([cid, deviceid, inotes]); - $('#mask_bg').show(); + showloading(true); var formData = new FormData(); if (inImages && inImages.length > 0) { @@ -762,14 +761,14 @@ showAlert(data, alerttitle); return; } - $('#mask_bg').hide(); + showloading(false); $('#dialog_installationnotes').val(""); inImages = []; $("#divINImages").empty(); getDeviceInstallationNotes(); }, error: function (err) { - $('#mask_bg').hide(); + showloading(false); } }); } diff --git a/Site/MachineDeviceManagement/AddMachine.aspx b/Site/MachineDeviceManagement/AddMachine.aspx index 142d1a1..7901ef9 100644 --- a/Site/MachineDeviceManagement/AddMachine.aspx +++ b/Site/MachineDeviceManagement/AddMachine.aspx @@ -444,6 +444,17 @@ var rentalChanged = false;//编辑机器时是否有修改,只用于Attributes和Rental var jobsiteinputChanged = false;//编辑机器时是否有修改,只用于JobSite + function showConfirm1(msg, title, fok, fcancel) { + _dialog.showConfirm(msg, title, function (e) { + if (typeof fok === 'function') { + fok(e); + } + }, function () { + if (fcancel) + fcancel(); + }); + } + function devicerequest(method, param, callback, error) { _network.request("MachineDeviceManagement/ManageMachines.aspx", -1, method, param, callback, error || function (e) { showmaskbg(false, true); @@ -1554,7 +1565,7 @@ if (!IsSupperAdmin) { $('#dialog_preloaded').hide(); $('#dialog_preloaded_text').hide(); - + } window.onresize = resizeContent; @@ -1615,6 +1626,34 @@ $("#dialogmask").hide(); } + function showsubloading(id, flag, noanimation) { + var mask = $("#" + id); + mask.children().show(); + if (noanimation) { + mask.css('display', flag ? '' : 'none'); + } else { + if (flag) { + mask.fadeIn(100); + } else { + mask.fadeOut(100); + } + } + } + + function showsubmask(id, flag, noanimation) { + var mask = $("#" + id); + mask.children().hide(); + if (noanimation) { + mask.css('display', flag ? '' : 'none'); + } else { + if (flag) { + mask.fadeIn(100); + } else { + mask.fadeOut(100); + } + } + } + function OnNext() { OnSave(0, 0, gotoNext); } @@ -1642,9 +1681,6 @@ </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div id="div_content" style="min-width: 1024px;"> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 500;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="function_title"> <span class="sbutton iconsave" onclick="OnSave(0,0);" data-lgid="P_MA_SAVE">Save</span> <span class="sbutton iconsave" onclick="OnSave(1,0);" data-lgid="P_MA_SAVE1">Save and Exit</span> @@ -1723,7 +1759,7 @@ <tr> <td class="label" data-lgid="P_MA_DESCRIPTION_COLON">Description:</td> <td> - <textarea id="dialog_description" class="inputbox" style="height: 60px;" maxlength="1000" tabindex="15"></textarea> + <textarea id="dialog_description" style="height: 60px;" maxlength="1000" tabindex="15"></textarea> </td> </tr> <tr> @@ -1983,7 +2019,7 @@ <tr> <td class="label" data-lgid="P_MA_COMMENTS_COLON">Comments:</td> <td colspan="3"> - <textarea id="dialog_comments" class="inputbox" maxlength="1000" tabindex="68" style="width: 454px; margin-top: 2px;"></textarea> + <textarea id="dialog_comments" maxlength="1000" tabindex="68" style="width: 454px; margin-top: 2px;"></textarea> </td> </tr> <tr> @@ -2158,13 +2194,16 @@ </div> </div> </div> + + <div id="dialogmask" class="maskbg" style="display: none;"> + <div class="loading_icon icon c-spin"></div> + </div> </div> <div id="mask_bg" style="display: none;"> <div class="loading c-spin"></div> </div> <div class="dialog" id="dialog_adjustodometer" style="display: none; width: 960px;"> - <div id="adjustodomask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADJUSTODOMETER">Adjust Odometer</span><em class="dialog-close"></em></div> <div class="dialog-content adjust-content"> <table style="line-height: 25px; width: 100%;"> @@ -2210,7 +2249,7 @@ </tr> <tr> <td class="label" colspan="2"> - <div id="odometermostrecent" style="height: 90px; width:920px;"></div> + <div id="odometermostrecent" style="height: 90px; width: 920px;"></div> </td> </tr> <tr> @@ -2218,7 +2257,7 @@ </tr> <tr> <td class="label" colspan="2"> - <div id="odometerhislist" style="height: 300px; width:920px;"></div> + <div id="odometerhislist" style="height: 300px; width: 920px;"></div> </td> </tr> </table> @@ -2229,10 +2268,10 @@ <input type="button" onclick="OnPreviewOdometer();" value="Preview" data-lgid="P_MA_PREVIEW" tabindex="108" /> <div class="clear"></div> </div> + <div id="adjustodomask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> <div class="dialog" id="dialog_adjustenginehours" style="display: none; width: 940px;"> - <div id="adjustenginehoursmask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADJUSTENGINEHOURS">Adjust EngineHours</span><em class="dialog-close"></em></div> <div class="dialog-content adjust-content"> <table style="line-height: 25px; width: 100%;"> @@ -2270,7 +2309,7 @@ </tr> <tr> <td class="label" colspan="2"> - <div id="enginehoursmostrecent" style="height: 90px;width:920px;"></div> + <div id="enginehoursmostrecent" style="height: 90px; width: 920px;"></div> </td> </tr> <tr> @@ -2278,7 +2317,7 @@ </tr> <tr> <td class="label" colspan="2"> - <div id="enginehourshislist" style="height: 300px;width:920px;"></div> + <div id="enginehourshislist" style="height: 300px; width: 920px;"></div> </td> </tr> </table> @@ -2289,6 +2328,7 @@ <input type="button" onclick="OnPreviewEngineHours();" value="Preview" data-lgid="P_MA_PREVIEW" tabindex="127" /> <div class="clear"></div> </div> + <div id="adjustenginehoursmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> @@ -2312,7 +2352,6 @@ <div class="dialog" id="dialog_addodometer" style="display: none; width: 600px;"> - <div id="addodomask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADDODOMETER">Add Odometer</span><em class="dialog-close"></em></div> <div class="dialog-content adjust-content"> <table style="line-height: 25px; width: 100%;"> @@ -2360,11 +2399,11 @@ <input type="button" onclick="OnAddOdometer();" value="Submit" data-lgid="P_MA_SUBMIT" tabindex="158" /> <div class="clear"></div> </div> + <div id="addodomask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> <div class="dialog" id="dialog_addenginehours" style="display: none; width: 600px;"> - <div id="addenginehoursmask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADDOENGINEHOURS">Add Engine Hours</span><em class="dialog-close"></em></div> <div class="dialog-content adjust-content"> <table style="line-height: 28px; width: 100%;"> @@ -2404,6 +2443,7 @@ <input type="button" onclick="OnAddEngineHours();" value="Submit" data-lgid="P_MA_SUBMIT" tabindex="177" /> <div class="clear"></div> </div> + <div id="addenginehoursmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> @@ -2419,7 +2459,6 @@ </div> <div class="dialog" id="dialog_addmake" style="display: none; width: 360px;"> - <div id="addmakemask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADDMAKE">Add Make</span><em class="dialog-close"></em></div> <div class="dialog-content assetcontent"> <table> @@ -2435,10 +2474,10 @@ <input type="button" onclick="OnSaveMake();" value="OK" data-lgid="P_MA_OK" tabindex="301" /> <div class="clear"></div> </div> + <div id="addmakemask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> <div class="dialog" id="dialog_addmodel" style="display: none; width: 360px;"> - <div id="addmodelmask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADDMODEL">Add Model</span><em class="dialog-close"></em></div> <div class="dialog-content assetcontent"> <table> @@ -2467,10 +2506,10 @@ <input type="button" onclick="OnSaveModel();" value="OK" data-lgid="P_MA_OK" tabindex="404" /> <div class="clear"></div> </div> + <div id="addmodelmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> <div class="dialog" id="dialog_assetduplicates" style="display: none; min-width: 540px;"> - <div id="assetdupmask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"> <span class="title" style="float: left;" data-lgid="P_MA_POSSIBLEDUPLICATES_COLON">Possible Duplicates: <span id="spnumberinfo"></span></span> <div class="function_title" id="divDupFun" style="float: left; margin-left: 230px; display: none; line-height: 28px;"> @@ -2658,10 +2697,10 @@ <input type="button" value="Ignore and Create Asset" data-lgid="P_MA_IGNOREANDCREATEASSET" onclick="OnIgnoreDuplicate();" style="width: 150px;" tabindex="500" /> <div class="clear"></div> </div> + <div id="assetdupmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> <div class="dialog" id="dialog_mergeasset" style="display: none; min-width: 540px;"> - <div id="mergeassetmask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"> <span class="title" style="float: left;" data-lgid="P_MA_XXX">Merge Asset</span> <em class="dialog-close"></em> @@ -2857,11 +2896,11 @@ <input type="button" value="Cancel" data-lgid="P_MA_CANCEL" class="dialog-close" tabindex="501" /> <div class="clear"></div> </div> + <div id="mergeassetmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> <div class="dialog" id="dialog_adddocument" style="display: none; width: 500px;"> - <div id="adddocumentmask" class="maskbg" style="display: none; z-index: 1;"></div> <div class="dialog-title"><span class="title" data-lgid="P_MA_ADDITIONALDOCUMENTATION">Additional Documentation</span><em class="dialog-close"></em></div> <div class="dialog-content adjust-content"> <table style="line-height: 30px; width: 100%;"> @@ -2923,5 +2962,6 @@ <input type="button" onclick="OnSaveDocument();" value="Save" data-lgid="P_MA_SAVE" tabindex="400" /> <div class="clear"></div> </div> + <div id="adddocumentmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div> </div> </asp:Content> diff --git a/Site/MachineDeviceManagement/AddMachineGroup.aspx b/Site/MachineDeviceManagement/AddMachineGroup.aspx index 1550fdb..f902701 100644 --- a/Site/MachineDeviceManagement/AddMachineGroup.aspx +++ b/Site/MachineDeviceManagement/AddMachineGroup.aspx @@ -493,7 +493,6 @@ return s.Values.ID; }); dialogAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } var grid_dtsm; @@ -514,7 +513,7 @@ // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -619,9 +618,6 @@ <div class="loading c-spin"></div> </div> <div id="div_content"> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 500;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="function_title"> <span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_AG_SAVE">Save</span> <span class="sbutton iconsave" onclick="OnSave(1);" data-lgid="P_AG_SAVE1">Save and Exit</span> @@ -635,19 +631,19 @@ <tr> <td class="label" data-lgid="P_AG_GROUPNAME_COLON">Group Name:</td> <td> - <input type="text" id="dialog_groupname" class="inputbox" maxlength="200" tabindex="1" style="width: 300px;" /> + <input type="text" id="dialog_groupname" maxlength="200" tabindex="1" style="width: 300px;" /> </td> </tr> <tr> <td class="label" style="width: 50px; text-align: right;" data-lgid="P_AG_CODE_COLON">Code:</td> <td> - <input type="text" id="dialog_groupcode" class="inputbox" maxlength="50" tabindex="1" style="width: 300px;" /> + <input type="text" id="dialog_groupcode" maxlength="50" tabindex="1" style="width: 300px;" /> </td> </tr> <tr> <td class="label" data-lgid="P_AG_DESCRIPTION_COLON">Description:</td> <td> - <textarea id="dialog_description" class="inputbox" maxlength="1000" tabindex="2" style="width: 300px"></textarea></td> + <textarea id="dialog_description" maxlength="1000" tabindex="2" style="width: 300px"></textarea></td> </tr> </table> <div class="dialog-subheader"> diff --git a/Site/MachineDeviceManagement/AddRental.aspx b/Site/MachineDeviceManagement/AddRental.aspx index d073871..b0334ee 100644 --- a/Site/MachineDeviceManagement/AddRental.aspx +++ b/Site/MachineDeviceManagement/AddRental.aspx @@ -538,7 +538,7 @@ <tr> <td class="label" data-lgid="P_MR_COMMENTS_COLON">Comments:</td> <td> - <textarea id="dialog_comments" class="inputbox" maxlength="1000" tabindex="14" style="width: 540px; height: 120px;"></textarea> + <textarea id="dialog_comments" maxlength="1000" tabindex="14" style="width: 540px; height: 120px;"></textarea> <span id="span_a" style="margin-left: 50px;"><a href="#" onclick="OnViewChangeHistory();" data-lgid="P_MR_VIEWCHANGEHIS">View Change History</a></span> </td> </tr> diff --git a/Site/MachineDeviceManagement/DeviceManagementBase.master b/Site/MachineDeviceManagement/DeviceManagementBase.master index 4f6d709..cbdf77d 100644 --- a/Site/MachineDeviceManagement/DeviceManagementBase.master +++ b/Site/MachineDeviceManagement/DeviceManagementBase.master @@ -96,8 +96,6 @@ $('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4); if ($('#machinesDiv').length > 0) $('#machinesDiv').css('min-height', $(window).height() - $('#machinesDiv').offset().top - 4); - - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); } $(window).resize(function () { diff --git a/Site/MachineDeviceManagement/MachineGroups.aspx b/Site/MachineDeviceManagement/MachineGroups.aspx index 0af8ad3..35ee1cd 100644 --- a/Site/MachineDeviceManagement/MachineGroups.aspx +++ b/Site/MachineDeviceManagement/MachineGroups.aspx @@ -32,11 +32,6 @@ left: 150px; } - .inputbox { - width: 564px; - padding: 1px; - } - #dialog_description { padding: 2px; height: 60px; @@ -345,17 +340,17 @@ <tr> <td class="label">Group Name:</td> <td> - <input type="text" id="dialog_groupname" class="inputbox" maxlength="200" tabindex="1" style="width: 300px;" /> + <input type="text" id="dialog_groupname" maxlength="200" tabindex="1" style="width: 300px;" /> </td> <td class="label" style="width: 50px; text-align: right;">Code:</td> <td> - <input type="text" id="dialog_groupcode" class="inputbox" maxlength="50" tabindex="1" style="width: 200px;" /> + <input type="text" id="dialog_groupcode" maxlength="50" tabindex="1" style="width: 200px;" /> </td> </tr> <tr> <td class="label">Description:</td> <td colspan="3"> - <textarea id="dialog_description" class="inputbox" maxlength="1000" tabindex="2"></textarea></td> + <textarea id="dialog_description" maxlength="1000" tabindex="2"></textarea></td> </tr> </table> <div class="dialog-subheader">Group Assets</div> diff --git a/Site/MachineDeviceManagement/ManageGPSDevices.aspx b/Site/MachineDeviceManagement/ManageGPSDevices.aspx index c42f52a..4e68f46 100644 --- a/Site/MachineDeviceManagement/ManageGPSDevices.aspx +++ b/Site/MachineDeviceManagement/ManageGPSDevices.aspx @@ -178,11 +178,11 @@ if (j === "Status") r[j] = { DisplayValue: r["Status"] === 1 ? "Active" : "Inactive", Value: r[j] }; else if (j === "AddDate") - r[j] = { DisplayValue: r["AddDateStr"], Value: r["AddDateStr1"] }; + r[j] = { DisplayValue: r["AddDateStr"], Value: r[j] }; else if (j === "InvoiceDate") r[j] = { DisplayValue: r["InvoiceDateStr"], Value: r[j] }; else if (j === "ServiceStartDate") - r[j] = { DisplayValue: r["ServiceStartDateStr"], Value: r["ServiceStartDateStr1"] }; + r[j] = { DisplayValue: r["ServiceStartDateStr"], Value: r[j] }; else if (j === "EngineHoursDate") r[j] = { DisplayValue: r["EngineHoursDateStr"], Value: r[j] }; else if (j === "EngineHours") @@ -548,7 +548,7 @@ type: 3, key: 'checked', allcheck: true, - width: 30, + width: 45, align: 'center' }); } diff --git a/Site/MachineDeviceManagement/ManageMachines.aspx b/Site/MachineDeviceManagement/ManageMachines.aspx index 354bc55..667f967 100644 --- a/Site/MachineDeviceManagement/ManageMachines.aspx +++ b/Site/MachineDeviceManagement/ManageMachines.aspx @@ -487,7 +487,7 @@ //grid_dt.lang.ok = "Apply"; //grid_dt.lang.reset; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 40, 'text-align': 'center' }, type: 3 }, + { name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 45, 'text-align': 'center' }, type: 3 }, { name: 'VIN', caption: GetTextByKey("P_MA_VINSN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } }, { name: 'Name', caption: GetTextByKey("P_MA_ASSETNAME", "Asset Name"), valueIndex: 'Name', css: { 'width': 180, 'text-align': 'left' } }, { name: 'Name2', caption: GetTextByKey("P_MA_ASSETNAME2", "Asset Name(Custom)"), valueIndex: 'Name2', css: { 'width': 180, 'text-align': 'left' } }, @@ -897,7 +897,7 @@ type: 3, key: 'checked', allcheck: true, - width: 30, + width: 45, align: 'center' }); } diff --git a/Site/MachineDeviceManagement/ManageRentals.aspx b/Site/MachineDeviceManagement/ManageRentals.aspx index 5f4ce2c..5bc7e3a 100644 --- a/Site/MachineDeviceManagement/ManageRentals.aspx +++ b/Site/MachineDeviceManagement/ManageRentals.aspx @@ -62,7 +62,6 @@ <link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" /> <script src="<%=GetFileUrlWithVersion("../Maintenance/js/inputdatactr.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script> - <script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script> <script type="text/javascript"> var IsDealer = <%=IsDealer ?"true":"false"%>; var IsAdmin =<%=IsAdmin ?"true":"false"%>; @@ -70,10 +69,6 @@ var MachineID = "<%=MachineID %>"; var machines; - var editableSelectMachine; - var listeditableSelectMachine; - - function devicerequest(method, param, callback, error) { _network.request("MachineDeviceManagement/ManageRentals.aspx", -1, method, param, callback, error || function (e) { @@ -106,8 +101,7 @@ else $("#btnAdd").hide(); - GetMachines(); - + OnRefresh(); }); } @@ -133,7 +127,7 @@ } else $("#btnAdd").hide(); - GetMachines(); + OnRefresh(); }); } @@ -207,29 +201,6 @@ }); } - function GetMachines() { - contractorid = htmlencode($.trim($('#sel_contractor').val())); - - devicerequest("GetSelectMachinesByCompany", contractorid, function (data) { - if (data && data.length > 0) { - machines = data; - editableSelectMachine.datasource = machines; - editableSelectMachine.valuepath = "MachineID" - editableSelectMachine.displaypath = "DisplayName"; - - listeditableSelectMachine.datasource = machines; - listeditableSelectMachine.valuepath = "MachineID" - listeditableSelectMachine.displaypath = "DisplayName"; - //if (MachineID !== "")//暂时不过滤机器 - // listeditableSelectMachine.val(MachineID); - } - - OnRefresh(); - - }, function (err) { - }); - } - function OnRefresh() { showloading(true); @@ -239,10 +210,6 @@ var startdate = htmlencode($('#startdatetxt').val()); var enddate = htmlencode($('#enddatetxt').val()); - var machine = listeditableSelectMachine.selecteditem(); - if (machine != null) - MachineID = machine.MachineID; - devicerequest("SearchRentals", contractorid + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + startdate + String.fromCharCode(170) + enddate + String.fromCharCode(170) + "", function (data) { @@ -411,8 +378,7 @@ var from = htmlencode($('#startdatetxt').val()); var to = htmlencode($('#enddatetxt').val()); - mid = listeditableSelectMachine.val(); - if (mid === undefined) mid = ""; + var mid = ""; var sortPath = $("#tbRentals").data("sortPath"); if (sortPath === undefined) sortPath = ""; @@ -429,8 +395,7 @@ var from = htmlencode($('#startdatetxt').val()); var to = htmlencode($('#enddatetxt').val()); - mid = listeditableSelectMachine.val(); - if (mid === undefined) mid = ""; + var mid = ""; var sortPath = $("#tbRentals").data("sortPath"); if (sortPath === undefined) sortPath = ""; @@ -444,10 +409,6 @@ setPageTitle(GetTextByKey("P_MANAGERENTALS", "Manage Rentals"), true); InitGridData(); - editableSelectMachine = new $editableselect($("#dialog_machine")); - editableSelectMachine.tabIndex(1); - listeditableSelectMachine = new $editableselect($("#sel_machine")); - if (IsDealer == true) { $('#span_contractor').css('display', ''); $('#span_contractor').parent().css('display', ''); @@ -458,13 +419,12 @@ } } else - GetMachines(); + OnRefresh(); $("#sel_contractor").change(function () { - GetMachines(); + OnRefresh(); }); - $('#searchinputtxt').keydown(searchEnter); $('#startdatetxt').datetimepicker({ @@ -531,18 +491,6 @@ } } - function OnViewHistory() { - var cid = ""; - cid = htmlencode($.trim($('#sel_contractor').val())); - var machineID = ""; - var machine = listeditableSelectMachine.selecteditem(); - if (machine != null) - machineID = machine.MachineID; - else - machineID = ""; - window.open("RentalChangeHistory.aspx?cid=" + cid + "&mid=" + machineID + ""); - } - function OnViewChangeHistory(rental) { if (!rental) { return; @@ -550,11 +498,6 @@ var cid = ""; cid = htmlencode($.trim($('#sel_contractor').val())); var machineID = ""; - var machine = listeditableSelectMachine.selecteditem(); - if (machine != null) - machineID = machine.MachineID; - else - machineID = ""; window.open("RentalChangeHistory.aspx?cid=" + cid + "&mid=" + machineID + "&rid=" + rental.RentalID + ""); } @@ -597,7 +540,6 @@ <span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_MR_REFRESH">Refresh</span> <span class="sbutton iconprint" onclick="OnPrint();" style="display: none;" data-lgid="P_MR_PRINT">Print</span> <span id="spExport" class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span> - <%--<input id="btnhistory" type="button" onclick="OnViewHistory();" value="View Change History" style="width: 150px;" />--%> </div> </td> </tr> diff --git a/Site/MachineDeviceManagement/RentalChangeHistory.aspx b/Site/MachineDeviceManagement/RentalChangeHistory.aspx index eb24b4b..a2e9d54 100644 --- a/Site/MachineDeviceManagement/RentalChangeHistory.aspx +++ b/Site/MachineDeviceManagement/RentalChangeHistory.aspx @@ -80,90 +80,14 @@ }); } - //admin用户 获取所有contractor - function getContractors() { - devicerequest('GetContractors', '', function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_MR_ERROR", 'Error')); - return; - } - if (data && data.length > 0) { - var sel_search = $('#sel_contractor').empty(); - for (var i = 0; i < data.length; i++) { - var kv = data[i]; - var op_search = $('<option></option>').val(kv.Key).text(kv.Value); - if (kv.Key == contractorid) - op_search.prop('selected', true); - sel_search.append(op_search); - } - if (contractorid !== "") - sel_search.val(contractorid); - } - - GetMachines(); - - }); - } - - //普通用户 获取可操作的contractor - function GetContractorsByUser() { - devicerequest('GetContractorsByUser', '', function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_MR_ERROR", 'Error')); - return; - } - if (data && data.length > 0) { - var sel_search = $('#sel_contractor').empty(); - for (var i = 0; i < data.length; i++) { - var kv = data[i]; - var op_search = $('<option></option>').val(kv.Key).text(kv.Value); - sel_search.append(op_search); - } - - if (contractorid !== "") - sel_search.val(contractorid); - } - GetMachines(); - }); - } - - function GetMachines() { - contractorid = htmlencode($.trim($('#sel_contractor').val())); - - devicerequest("GetSelectMachinesByCompany", contractorid, function (data) { - if (data && data.length > 0) { - machines = data; - listeditableSelectMachine.datasource = machines; - listeditableSelectMachine.valuepath = "MachineID" - listeditableSelectMachine.displaypath = "DisplayName"; - //if (MachineID !== "")//暂时不过滤机器 - //listeditableSelectMachine.val(MachineID); - } - - OnRefresh(); - - }, function (err) { - }); - } - function OnRefresh() { showloading(true); - var cid = htmlencode($.trim($('#sel_contractor').val())); - if (cid && cid != '') - contractorid = cid; var searchtxt = ""; searchtxt = htmlencode($.trim($('#searchinputtxt').val())); var startdate = htmlencode($('#startdatetxt').val()); var enddate = htmlencode($('#enddatetxt').val()); - var machine = listeditableSelectMachine.selecteditem(); - if (machine != null) - MachineID = machine.MachineID; - else - MachineID = ""; - - devicerequest("SearchRentalChangeHistory", contractorid + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + startdate + String.fromCharCode(170) + enddate + String.fromCharCode(170) + MachineID + String.fromCharCode(170) + RentalID, function (data) { @@ -181,16 +105,11 @@ } function OnExport() { - var cid = htmlencode($.trim($('#sel_contractor').val())); - if (cid && cid != '') - contractorid = cid; var searchtxt = ""; searchtxt = htmlencode($.trim($('#searchinputtxt').val())); var from = htmlencode($('#startdatetxt').val()); var to = htmlencode($('#enddatetxt').val()); - - mid = listeditableSelectMachine.val(); - if (mid === undefined) mid = ""; + var mid = ""; var sortPath = grid_dt.sortKey; if (sortPath === undefined) sortPath = ""; @@ -200,16 +119,11 @@ } function OnPrint() { - var cid = htmlencode($.trim($('#sel_contractor').val())); - if (cid && cid != '') - contractorid = cid; var searchtxt = ""; searchtxt = htmlencode($.trim($('#searchinputtxt').val())); var from = htmlencode($('#startdatetxt').val()); var to = htmlencode($('#enddatetxt').val()); - - mid = listeditableSelectMachine.val(); - if (mid === undefined) mid = ""; + var mid = ""; var sortPath = grid_dt.sortKey; if (sortPath === undefined) sortPath = ""; @@ -298,22 +212,6 @@ $('#tr_search').css('display', 'none'); } - //if (IsDealer == true) { - // $('#span_contractor').css('display', ''); - // $('#span_contractor').parent().css('display', ''); - // if (IsAdmin) - // getContractors(); - // else { - // GetContractorsByUser(); - // } - //} - //else - // GetMachines(); - - //$("#sel_contractor").change(function () { - // GetMachines(); - //}); - OnRefresh(); $('#searchinputtxt').keydown(searchEnter); diff --git a/Site/MachineDeviceManagement/ShareMachines.aspx b/Site/MachineDeviceManagement/ShareMachines.aspx index 159f406..eabb1b9 100644 --- a/Site/MachineDeviceManagement/ShareMachines.aspx +++ b/Site/MachineDeviceManagement/ShareMachines.aspx @@ -371,7 +371,7 @@ //grid_dt.lang.ok = "Apply"; //grid_dt.lang.reset; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 30, 'text-align': 'center' }, type: 3 }, + { name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 45, 'text-align': 'center' }, type: 3 }, { name: 'VIN', caption: GetTextByKey("P_MA_VINSN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } }, { name: 'Name', caption: GetTextByKey("P_MA_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 180, 'text-align': 'left' } }, { name: 'Name2', caption: GetTextByKey("P_MA_ASSETNAME2", "Asset Name(Custom)"), valueIndex: 'AssetCustomerName', css: { 'width': 180, 'text-align': 'left' } }, @@ -659,7 +659,7 @@ { key: 'Selected', type: 3, - width: 30, + width: 45, align: 'center', allcheck: true, enabled: '__selectable' @@ -799,7 +799,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Sharable', caption: "", valueIndex: 'Sharable', css: { 'width': 30, 'text-align': 'center' }, type: 3 }, + { name: 'Sharable', caption: "", valueIndex: 'Sharable', css: { 'width': 45, 'text-align': 'center' }, type: 3 }, { name: 'CustomerId', caption: GetTextByKey("P_XXXXXX", "ID"), valueIndex: 'CustomerId', css: { 'width': 120, 'text-align': 'left' } }, { name: 'CustomerName', caption: GetTextByKey("P_XXXXXX", "Name"), valueIndex: 'CustomerName', css: { 'width': 200, 'text-align': 'left' } }, ]; @@ -1123,7 +1123,7 @@ <div id="customerlist" style="height: 400px; width: 400px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="saveShareWithCustomers();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div style="clear: both;"></div> </div> diff --git a/Site/MachineDeviceManagement/js/adj_enginehours.js b/Site/MachineDeviceManagement/js/adj_enginehours.js index ffa291f..7f3f821 100644 --- a/Site/MachineDeviceManagement/js/adj_enginehours.js +++ b/Site/MachineDeviceManagement/js/adj_enginehours.js @@ -229,18 +229,18 @@ function InitEnginehoursHisGridData() { } function getEnineHours() { - showLoading(); + showsubloading("adjustenginehoursmask", true); grid_enginehoursdt.setData([]); devicerequest("GetAssetCurrentEngineHours", contractorid + String.fromCharCode(170) + machineid, function (data) { - hideLoading(); + showsubloading("adjustenginehoursmask", false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_MA_ERROR", 'Error')); return; } ShowEngineHours(data); }, function (err) { - hideLoading(); + showsubloading("adjustenginehoursmask", false); }); } @@ -248,7 +248,7 @@ function getEnineHours() { function getEngineHoursHis() { grid_enginehoursmostrecentdt.setData([]); grid_enginehourshisdt.setData([]); - showLoading(); + showsubloading("adjustenginehoursmask", true); var methodname = "GetCalampEngineHoursHistory"; if (isPedigreeEH) methodname = "GetPedigreeEngineHoursHistory"; @@ -256,7 +256,7 @@ function getEngineHoursHis() { methodname = "GetOEMDD2EngineHoursHistory"; devicerequest(methodname, contractorid + String.fromCharCode(170) + machineid, function (data) { - hideLoading(); + showsubloading("adjustenginehoursmask", false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_MA_ERROR", 'Error')); return; @@ -264,7 +264,7 @@ function getEngineHoursHis() { //ShowEngineHoursHis(data); ShowMostRecentEngineHours(data); }, function (err) { - hideLoading(); + showsubloading("adjustenginehoursmask", false); }); } @@ -282,27 +282,23 @@ function getEngineHoursHisPreview() { if (item.EngineHours !== "") { if (isNaN(item.EngineHours)) { showAlert(GetTextByKey("P_MA_FORMATERROR", '{0} format error.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); return; } else { if (item.EngineHours <= 0) { showAlert(GetTextByKey("P_MA_MUSTBEGREATERTHAN0", '{0} must be greater than 0.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); return; } } } else { showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); return; } if (item.EngineHoursDate === "") { showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); return; } var offset = $('#dialogadjust_enginehourstimezone').find("option:selected").attr("offset"); @@ -319,7 +315,7 @@ function getEngineHoursHisPreview() { function GetCalampEngineHoursHistoryPreview(item) { grid_enginehourshisdt.setData([]); - showLoading(); + showsubloading("adjustenginehoursmask", true); var param = JSON.stringify(item); param = htmlencode(param); @@ -329,7 +325,7 @@ function GetCalampEngineHoursHistoryPreview(item) { if (isOEMDD2EH) methodname = "GetOEMDD2EngineHoursHistoryPreview"; devicerequest(methodname, param, function (data) { - hideLoading(); + showsubloading("adjustenginehoursmask", false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_MA_ERROR", 'Error')); return; @@ -337,7 +333,7 @@ function GetCalampEngineHoursHistoryPreview(item) { ShowEngineHoursHis(data); ShowMostRecentEngineHoursPreview(data); }, function (err) { - hideLoading(); + showsubloading("adjustenginehoursmask", false); }); } @@ -461,11 +457,11 @@ function openAdjustEngineHours() { function OnAdjustEngineHours() { - $('#adjustenginehoursmask').show(); + showsubmask("adjustenginehoursmask", true); var alerttitle = GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours'); var enginehourstxt = GetTextByKey("P_MA_ENGINEHOURS", "Engine Hours"); - showConfirm('Do you want to adjust the engine hours?', alerttitle, function () { - $('#adjustodomask').hide(); + showConfirm1('Do you want to adjust the engine hours?', alerttitle, function () { + showsubmask("adjustenginehoursmask", false); var item = { 'CustomerID': contractorid, 'AssetID': machineid, @@ -478,26 +474,26 @@ function OnAdjustEngineHours() { if (item.EngineHours !== "") { if (isNaN(item.EngineHours)) { showAlert(GetTextByKey("P_MA_FORMATERROR", '{0} format error.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); + showsubmask("adjustenginehoursmask", false); return; } else { if (item.EngineHours <= 0) { showAlert(GetTextByKey("P_MA_MUSTBEGREATERTHAN0", '{0} must be greater than 0.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); + showsubmask("adjustenginehoursmask", false); return; } } } else { showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); + showsubmask("adjustenginehoursmask", false); return; } if (item.EngineHoursDate === "") { showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle); - $('#adjustenginehoursmask').hide(); + showsubmask("adjustenginehoursmask", false); return; } var offset = $('#dialogadjust_enginehourstimezone').find("option:selected").attr("offset"); @@ -510,7 +506,7 @@ function OnAdjustEngineHours() { CheckEngineHourMinimumTime(item, "submit"); }, function () { - $('#adjustenginehoursmask').hide(); + showsubmask("adjustenginehoursmask", false); }); } @@ -518,12 +514,13 @@ function CheckEngineHourMinimumTime(item, type) { var param = JSON.stringify(item); param = htmlencode(param); devicerequest("CheckEngineHourMinimumTime", param, function (data) { + showsubmask("adjustenginehoursmask", false); if (data > 0) { if (data == 1) showAlert(GetTextByKey("P_MA_CHECKENGINEHOURSMINNIMUMTIME", "The adjustment cannot be completed as provided. The engine hours reading date provided cannot be prior to initial telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours')); else showAlert(GetTextByKey("P_MA_CHECKENGINEHOURSMINNIMUMTIME1", "The adjustment cannot be completed as provided. The engine hours reading date provided must be prior to or equal to the latest telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours')); - $('#adjustenginehoursmask').hide(); + return; } else { if (type === "submit") @@ -532,18 +529,20 @@ function CheckEngineHourMinimumTime(item, type) { GetCalampEngineHoursHistoryPreview(item); } }, function (err) { + showsubmask("adjustenginehoursmask", false); }); } function SaveAdjustEngineHours(item) { - showloading(true); + showsubloading("adjustenginehoursmask", true); var param = JSON.stringify(item); param = htmlencode(param); + showsubloading("adjustenginehoursmask", true); var alerttitle = GetTextByKey("P_MA_ADJUSTENGINEHOURS", GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours')); devicerequest("SaveAdjustEngineHours", param, function (data) { - showloading(false); + showsubloading("adjustenginehoursmask", false); if (data !== 'OK') { showAlert(data, alerttitle); } else { @@ -553,12 +552,11 @@ function SaveAdjustEngineHours(item) { } $('#dialog_adjustenginehours').hideDialog(); - $('#adjustenginehoursmask').hide(); + showmaskbg(false); }, function (err) { console.log(err); - showloading(false); showAlert(GetTextByKey("P_MA_FAILEDTO", "Failed to {0}.").replace('{0}', alerttitle), alerttitle); - $('#adjustenginehoursmask').hide(); + showsubloading("adjustenginehoursmask", false); }); } @@ -598,11 +596,10 @@ function openAddEnginHours() { function OnAddEngineHours() { - $('#addenginehoursmask').show(); + showsubmask("addenginehoursmask", true); var alerttitle = GetTextByKey("P_MA_ADDENGINEHOURS", 'Add Engine Hours'); var enginehourstxt = GetTextByKey("P_MA_ENGINEHOURS", "Engine Hours"); - showConfirm(GetTextByKey("P_MA_DOYOUWANTTOADDTHEENGINEHOURS", 'Do you want to add the engine hours?'), alerttitle, function () { - $('#adjustodomask').hide(); + showConfirm1(GetTextByKey("P_MA_DOYOUWANTTOADDTHEENGINEHOURS", 'Do you want to add the engine hours?'), alerttitle, function () { var item = { 'CustomerID': contractorid, 'AssetID': machineid, @@ -614,26 +611,26 @@ function OnAddEngineHours() { if (item.EngineHours !== "") { if (isNaN(item.EngineHours)) { showAlert(GetTextByKey("P_MA_FORMATERROR", '{0} format error.').replace('{0}', enginehourstxt), alerttitle); - $('#addenginehoursmask').hide(); + showsubmask("addenginehoursmask", false); return; } else { if (item.EngineHours <= 0) { showAlert(GetTextByKey("P_MA_MUSTBEGREATERTHAN0", '{0} must be greater than 0.').replace('{0}', enginehourstxt), alerttitle); - $('#addenginehoursmask').hide(); + showsubmask("addenginehoursmask", false); return; } } } else { showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle); - $('#addenginehoursmask').hide(); + showsubmask("addenginehoursmask", false); return; } if (item.EngineHoursDate === "") { showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle); - $('#addenginehoursmask').hide(); + showsubmask("addenginehoursmask", false); return; } var offset = $('#dialogadd_enginehourstimezone').find("option:selected").attr("offset"); @@ -644,12 +641,12 @@ function OnAddEngineHours() { item.EngineHoursDate = item.EngineHoursDate.replace("-", "/") + " " + hour + ":" + minute + ":" + "00"; - showloading(true); var param = JSON.stringify(item); param = htmlencode(param); + showsubloading("addenginehoursmask", true); devicerequest("AddManuallyInputEngineHours", param, function (data) { - showloading(false); + showsubloading("addenginehoursmask", false); if (data !== 'OK') { if (data === "Failed") data = GetTextByKey("P_MA_FAILED", "Failed"); @@ -661,16 +658,16 @@ function OnAddEngineHours() { } $('#dialog_addenginehours').hideDialog(); - $('#addenginehoursmask').hide(); + showmaskbg(false); }, function (err) { console.log(err); - showloading(false); + showsubloading("addenginehoursmask", false); showAlert(GetTextByKey("P_MA_FAILEDTO", "Failed to {0}.").replace('{0}', GetTextByKey("P_MA_ADDENGINEHOURS", "Add Engine Hours")), alerttitle); - $('#addenginehoursmask').hide(); + }); }, function () { - $('#addenginehoursmask').hide(); + showsubmask("addenginehoursmask", false); }); } diff --git a/Site/MachineDeviceManagement/js/adj_odometer.js b/Site/MachineDeviceManagement/js/adj_odometer.js index 330b712..24dfac1 100644 --- a/Site/MachineDeviceManagement/js/adj_odometer.js +++ b/Site/MachineDeviceManagement/js/adj_odometer.js @@ -219,23 +219,23 @@ function InitOdometerHisGridData() { function getOdometers() { grid_odometerdt.setData([]); - showLoading(); + showsubloading("adjustodomask", true); devicerequest("GetAssetCurrentOdometer", contractorid + String.fromCharCode(170) + machineid, function (data) { - hideLoading(); + showsubloading("adjustodomask", false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_MA_ERROR", 'Error')); return; } ShowOdometers(data); }, function (err) { - hideLoading(); + showsubloading("adjustodomask", false); }); } function getOdometerHis() { grid_odometermostrecentdt.setData([]); grid_odometerhisdt.setData([]); - showLoading(); + showsubloading("adjustodomask", true); var methodname = ""; if (isCalampOdo) @@ -246,7 +246,7 @@ function getOdometerHis() { methodname = "GetSmartWitnessOdometerHistory"; devicerequest(methodname, contractorid + String.fromCharCode(170) + machineid, function (data) { - hideLoading(); + showsubloading("adjustodomask", false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_MA_ERROR", 'Error')); return; @@ -254,7 +254,7 @@ function getOdometerHis() { //ShowOdometerHis(data); ShowMostRecentOdometer(data); }, function (err) { - hideLoading(); + showsubloading("adjustodomask", false); }); } @@ -271,27 +271,23 @@ function getOdometerHisPreview() { if (item.Odometer !== "") { if (isNaN(item.Odometer)) { showAlert(GetTextByKey("P_MA_ODOMETERFORMATERROR", 'Odometer format error.'), alerttitle); - $('#adjustodomask').hide(); return; } else { if (item.Odometer <= 0) { showAlert(GetTextByKey("P_MA_ODOMETERMUSTBEGREATERTHAN0", 'ODOMeter must be greater than 0.'), alerttitle); - $('#adjustodomask').hide(); return; } } } else { showAlert(GetTextByKey("P_MA_ODOMETRCANNOTBEEMPTY", "Odometer cannot be empty."), alerttitle); - $('#adjustodomask').hide(); return; } if (item.OdometerDate === "") { showAlert(GetTextByKey("P_MA_ODOMETRDATACANNOTBEEMPTY", "Odometer date cannot be empty."), alerttitle); - $('#adjustodomask').hide(); hideLoading(); return; } @@ -309,7 +305,7 @@ function getOdometerHisPreview() { function GetOdometerHistoryPreview(item) { grid_odometerhisdt.setData([]); - showLoading(); + showsubloading("adjustodomask", true); var param = JSON.stringify(item); param = htmlencode(param); if (isCalampOdo) @@ -320,7 +316,7 @@ function GetOdometerHistoryPreview(item) { methodname = "GetSmartWitnessOdometerHistoryPreview"; devicerequest(methodname, param, function (data) { - hideLoading(); + showsubloading("adjustodomask", false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_MA_ERROR", 'Error')); return; @@ -328,7 +324,7 @@ function GetOdometerHistoryPreview(item) { ShowOdometerHis(data); ShowMostRecentOdometerPreview(data); }, function (err) { - hideLoading(); + showsubloading("adjustodomask", false); }); } @@ -446,9 +442,9 @@ function openAdjustOdometer() { } function OnAdjustOdometer() { - $('#adjustodomask').show(); + showsubmask("adjustodomask", true); var alerttitle = GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer"); - showConfirm(GetTextByKey("P_MA_DOYOUWANTTOADJUSTTHEODOMETER", 'Do you want to adjust the odometer?'), alerttitle, function () { + showConfirm1(GetTextByKey("P_MA_DOYOUWANTTOADJUSTTHEODOMETER", 'Do you want to adjust the odometer?'), alerttitle, function () { var item = { 'CustomerID': contractorid, 'AssetID': machineid, @@ -462,26 +458,26 @@ function OnAdjustOdometer() { if (item.Odometer !== "") { if (isNaN(item.Odometer)) { showAlert(GetTextByKey("P_MA_ODOMETERFORMATERROR", 'Odometer format error.'), alerttitle); - $('#adjustodomask').hide(); + showsubmask("adjustodomask", false); return; } else { if (item.Odometer <= 0) { showAlert(GetTextByKey("P_MA_ODOMETERMUSTBEGREATERTHAN0", 'ODOMeter must be greater than 0.'), alerttitle); - $('#adjustodomask').hide(); + showsubmask("adjustodomask", false); return; } } } else { showAlert(GetTextByKey("P_MA_ODOMETRCANNOTBEEMPTY", "Odometer cannot be empty."), alerttitle); - $('#adjustodomask').hide(); + showsubmask("adjustodomask", false); return; } if (item.OdometerDate === "") { showAlert(GetTextByKey("P_MA_ODOMETRDATACANNOTBEEMPTY", "Odometer date cannot be empty."), alerttitle); - $('#adjustodomask').hide(); + showsubmask("adjustodomask", false); return; } var offset = $('#dialogadjust_odometertimezone').find("option:selected").attr("offset"); @@ -495,9 +491,8 @@ function OnAdjustOdometer() { CheckOdometerMinnimumTime(item, "submit"); }, function () { - $('#adjustodomask').hide(); + showsubmask("adjustodomask", false); }); - } @@ -505,12 +500,13 @@ function CheckOdometerMinnimumTime(item, type) { var param = JSON.stringify(item); param = htmlencode(param); devicerequest("CheckOdometerMinnimumTime", param, function (data) { + showsubmask("adjustodomask", false); if (data > 0) { if (data == 1) showAlert(GetTextByKey("P_MA_CHECKODOMETERMINNIMUMTIME1", "The adjustment cannot be completed as provided. The odometer reading date provided cannot be prior to initial telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer")); else showAlert(GetTextByKey("P_MA_CHECKODOMETERMINNIMUMTIME", "The adjustment cannot be completed as provided. The odometer reading date provided must be prior to or equal to the latest telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer")); - $('#adjustodomask').hide(); + return; } else { if (type === "submit") @@ -519,16 +515,17 @@ function CheckOdometerMinnimumTime(item, type) { GetOdometerHistoryPreview(item); } }, function (err) { + showsubmask("adjustodomask", false); }); } function SaveAdjustOdometer(item) { - showloading(true); + showsubloading("adjustodomask", true); var param = JSON.stringify(item); param = htmlencode(param); devicerequest("SaveAdjustOdometer", param, function (data) { - showloading(false); + showsubloading("adjustodomask", false); if (data !== 'OK') { showAlert(data, GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer")); } else { @@ -538,11 +535,10 @@ function SaveAdjustOdometer(item) { } $('#dialog_adjustodometer').hideDialog(); - $('#adjustodomask').hide(); + showmaskbg(false); }, function (err) { - showloading(false); showAlert(GetTextByKey("P_MA_FAILEDTOADJUSTDOMETER", 'Failed to adjust Odometer.'), GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer")); - $('#adjustodomask').hide(); + showsubloading("adjustodomask", false); }); } @@ -571,7 +567,6 @@ function openAddOdometer() { $('#dialog_addodometer .dialog-title span.title').text(GetTextByKey("P_MA_ADDODOMETER", 'Add Odometer')); showmaskbg(true); $('#dialog_addodometer') - .attr('act', 'add') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_addodometer').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_addodometer').width()) / 2 @@ -581,9 +576,9 @@ function openAddOdometer() { } function OnAddOdometer() { - $('#addodomask').show(); + showsubmask("addodomask", true); var alerttile = GetTextByKey("P_MA_ADDODOMETER", 'Add Odometer'); - showConfirm(GetTextByKey("P_MA_DOYOUWANTTOADDTHEODOMETER", 'Do you want to add the odometer?'), alerttile, function () { + showConfirm1(GetTextByKey("P_MA_DOYOUWANTTOADDTHEODOMETER", 'Do you want to add the odometer?'), alerttile, function () { var item = { 'CustomerID': contractorid, 'AssetID': machineid, @@ -596,26 +591,26 @@ function OnAddOdometer() { if (item.Odometer !== "") { if (isNaN(item.Odometer)) { showAlert(GetTextByKey("P_MA_ODOMETERFORMATERROR", 'Odometer format error.'), alerttile); - $('#addodomask').hide(); + showsubmask("addodomask", false); return; } else { if (item.Odometer <= 0) { showAlert(GetTextByKey("P_MA_ODOMETERMUSTBEGREATERTHAN0", 'ODOMeter must be greater than 0.'), alerttile); - $('#addodomask').hide(); + showsubmask("addodomask", false); return; } } } else { showAlert(GetTextByKey("P_MA_ODOMETRCANNOTBEEMPTY", "Odometer cannot be empty."), alerttile); - $('#addodomask').hide(); + showsubmask("addodomask", false); return; } if (item.OdometerDate === "") { showAlert(GetTextByKey("P_MA_ODOMETRDATACANNOTBEEMPTY", "Odometer date cannot be empty."), alerttile); - $('#addodomask').hide(); + showsubmask("addodomask", false); return; } var offset = $('#dialogadd_odometertimezone').find("option:selected").attr("offset"); @@ -625,11 +620,12 @@ function OnAddOdometer() { var minute = $('#dialogadd_timeminute').val(); item.OdometerDate = item.OdometerDate.replace("-", "/") + " " + hour + ":" + minute + ":" + "00"; - showloading(true); + var param = JSON.stringify(item); param = htmlencode(param); + showsubloading("addodomask", true); devicerequest("AddManuallyInputOdometer", param, function (data) { - showloading(false); + showsubloading("addodomask", false); if (data !== 'OK') { showAlert(data, alerttile); } else { @@ -639,15 +635,13 @@ function OnAddOdometer() { } $('#dialog_addodometer').hideDialog(); - $('#addodomask').hide(); + showmaskbg(false); }, function (err) { - showloading(false); showAlert('Failed to add Odometer.', alerttile); - $('#addodomask').hide(); + showsubloading("addodomask", false); }); - }, function () { - $('#addodomask').hide(); + showsubloading("addodomask", false); }); } diff --git a/Site/MachineDeviceManagement/js/assetother.js b/Site/MachineDeviceManagement/js/assetother.js index e271435..13408a5 100644 --- a/Site/MachineDeviceManagement/js/assetother.js +++ b/Site/MachineDeviceManagement/js/assetother.js @@ -167,7 +167,8 @@ function InitJobSiteGridData() { col.events = { onchange: function () { inputChanged = true; - jobsiteinputChanged = true; + if (this.OnSite) + jobsiteinputChanged = true; } }; col.tooltip = GetTextByKey("P_MA_ONSITETITLE", "The On Site box should only be checked if the asset has a permanent assignment not based on location. Geofence and Jobsite Add/Remove will not be triggered if checked."); @@ -265,7 +266,7 @@ function InitAssetGroupGridData() { reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'GroupName', caption: GetTextByKey("P_MA_GROUPNAME", "Group Name"), valueIndex: 'GroupName', css: { 'width': 300, 'text-align': 'left' } } ]; var columns = []; diff --git a/Site/MachineDeviceManagement/js/assetpm.js b/Site/MachineDeviceManagement/js/assetpm.js index 9a1e955..79b3fac 100644 --- a/Site/MachineDeviceManagement/js/assetpm.js +++ b/Site/MachineDeviceManagement/js/assetpm.js @@ -36,7 +36,7 @@ function InitPMGridData() { reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'PmScheduleName', caption: GetTextByKey("P_MA_SCHEDULENAME", "Schedule Name"), valueIndex: 'PmScheduleName', css: { 'width': 200, 'text-align': 'left' } }, { name: 'StartValue', caption: GetTextByKey("P_MA_INITIALSERVICEVALUE", "Initial Service Value"), valueIndex: 'StartValue', css: { 'width': 120, 'text-align': 'right' } }, { name: 'LastAlertTimeString', caption: GetTextByKey("P_MA_LASTSERVICEDATE", "Last Service Date"), valueIndex: 'LastAlertTimeString', css: { 'width': 120, 'text-align': 'left' } }, @@ -429,7 +429,7 @@ function createTBMContent(contentctrl, pmschedule) { item.PmScheduleID = pmschedule.PmScheduleID; //item.PMType = pmschedule.PmScheduleType; if (radio1.prop("checked")) { - item.StartDate = nowdate; + item.StartDate = currentdate; } else { item.StartDate = txtLastServiceDate.val(); diff --git a/Site/MachineDeviceManagement/js/mergeasset.js b/Site/MachineDeviceManagement/js/mergeasset.js index 3f41523..7afe3a1 100644 --- a/Site/MachineDeviceManagement/js/mergeasset.js +++ b/Site/MachineDeviceManagement/js/mergeasset.js @@ -223,7 +223,6 @@ function OnMergeAsset() { dialogSelectMergeAssets.exceptShareAsset = true; dialogSelectMergeAssets.exceptSource = [machineid]; dialogSelectMergeAssets.showSelector(3, true);//与attachmentInfo中的showSelector冲突,需设置force - $('#mask_bg').css('height', '100%'); } var mergeassetid; diff --git a/Site/Maintenance/AddCustomerRecord.aspx b/Site/Maintenance/AddCustomerRecord.aspx index 33ea3fb..189767a 100644 --- a/Site/Maintenance/AddCustomerRecord.aspx +++ b/Site/Maintenance/AddCustomerRecord.aspx @@ -478,7 +478,7 @@ $('#dialog_canopenwo').prop('checked', false); $('#dialog_contact .dialog-title span.title').text(alerttitle); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_contact') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_contact').height()) / 3, @@ -504,7 +504,7 @@ $('#dialog_canopenwo').prop('checked', contact.CanOpenWO); $('#dialog_contact .dialog-title span.title').text(GetTextByKey("P_CR_EDITCONTACT", 'Edit Contact')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_contact') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_contact').height()) / 3, @@ -803,7 +803,7 @@ searchFollower(true); $('#addfollowerpopupdialog .dialog-title span.title').text(alerttitle); - $('#mask_bg').show(); + showmaskbg(true); $('#addfollowerpopupdialog') .css({ 'top': (document.documentElement.clientHeight - $('#addfollowerpopupdialog').height()) / 3, @@ -901,11 +901,7 @@ </script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> - <div id="mask_bg" style="display: none; z-index: 500"><div class="loading c-spin"></div></div> <div> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 500;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="function_title"> <%if (!CRReadOnly) {%> @@ -1048,8 +1044,13 @@ </div> </div> </div> + + <div id="dialogmask" class="maskbg" style="display: none;"> + <div class="loading_icon icon c-spin"></div> + </div> </div> - + + <div id="mask_bg" style="display: none; "><div class="loading c-spin"></div></div> <div class="dialog" id="dialog_contact" style="display: none;"> <div class="dialog-title"><span class="title" data-lgid="P_CR_ADDCONTACT">Add Contact</span><em class="dialog-close"></em></div> <div class="dialog-content"> @@ -1114,7 +1115,7 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="onSaveContact();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div style="clear: both;"></div> </div> @@ -1132,7 +1133,7 @@ <div id="salespersonlist" style="width: 650px; height: 400px; margin: 10px 0 4px"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="onSetSalesperson();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div style="clear: both;"></div> </div> diff --git a/Site/Maintenance/AddFuelRecord.aspx b/Site/Maintenance/AddFuelRecord.aspx index 3072f7d..4e40b38 100644 --- a/Site/Maintenance/AddFuelRecord.aspx +++ b/Site/Maintenance/AddFuelRecord.aspx @@ -86,26 +86,6 @@ color: gray; } - #mask_over_bg { - top: 32px; - left: 0; - right: 0; - bottom: 0; - position: fixed; - background: #000; - opacity: 0.2; - } - - #att_mask_bg { - top: 0; - left: 0; - right: 0; - bottom: 0; - position: fixed; - background: #000; - opacity: 0.2; - } - #divcontent { margin: 8px; } @@ -293,7 +273,7 @@ getAttachments(); $('.function_title>.sbutton-ui').removeClass('disabled'); - $('#mask_over_bg').hide(); + showloading(false); } var IsInteger = /^[0-9]+$/; @@ -504,7 +484,7 @@ fuelid = fl.FuelID; fuel = fl; setEnable(fl.IsComesFromAPI); - $('#mask_over_bg').show(); + showloading(true); GetMachines(OnEdit); } else { @@ -585,9 +565,9 @@ //*************************Start Notes********************************// function getFuelRecordComments() { - $('#mask_over_bg').show(); + showloading(true); fuelrequest("GetFuelRecordComments", fuelid, function (data) { - $('#mask_over_bg').hide(); + showloading(false); if (typeof (data) === "string") { return; } @@ -601,7 +581,7 @@ } $("#divcomments")[0].scrollTop = $("#divcomments")[0].scrollHeight; }, function (err) { - $('#mask_over_bg').hide(); + showloading(false); }); } @@ -626,9 +606,9 @@ var param = JSON.stringify([fuelid, comment]); param = htmlencode(param); - $('#mask_over_bg').show(); + showloading(true); fuelrequest("AddFuelRecordComment", param, function (data) { - $('#mask_over_bg').hide(); + showloading(false); if (data !== "") { showAlert(data, GetTextByKey("P_FR_ERROR", 'Error')); return; @@ -636,7 +616,7 @@ $('#dialog_comments').val(""); getFuelRecordComments(); }, function (err) { - $('#mask_over_bg').hide(); + showloading(false); }); } @@ -755,10 +735,6 @@ </script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> - <div id="mask_bg" style="display: none;"> - <%--<div class="loading c-spin"></div> - --%> - </div> <div> <div class="function_title"> <span class="sbutton iconsave sbutton-ui" onclick="OnSave(0,this);" data-lgid="P_FR_SAVE">Save</span> @@ -1000,13 +976,9 @@ </div> </div> </div> - <%--<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>--%> </div> </div> - <div id="mask_over_bg" style="display: none;"> - <div class="loading c-spin"></div> - </div> - <div id="att_mask_bg" style="display: none;"> + <div id="mask_bg" style="display: none;"> <div class="loading c-spin"></div> </div> </asp:Content> diff --git a/Site/Maintenance/AddSurveyTemplate.aspx b/Site/Maintenance/AddSurveyTemplate.aspx index 71a9dad..41bd4ce 100644 --- a/Site/Maintenance/AddSurveyTemplate.aspx +++ b/Site/Maintenance/AddSurveyTemplate.aspx @@ -129,11 +129,11 @@ } function getSurveyTemplateInfo(copy) { - showLoading(); + showloading(true); $('#questionlist').empty(); wosurveyCtrl = undefined; worequest("GetSurveyTemplateInfo", surveyid, function (data) { - hideLoading(); + showloading(false); if (typeof (data) === "string") { showAlert(data, GetTextByKey("P_WOS_ERROR", 'Error')); return; @@ -157,7 +157,7 @@ } }, function (err) { - hideLoading(); + showloading(false); }); } @@ -255,14 +255,6 @@ } } - function showLoading() { - $("#dialogmask").show(); - } - - function hideLoading() { - $("#dialogmask").hide(); - } - $(function () { init(); @@ -277,11 +269,7 @@ </script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> - <div id="mask_bg" style="display: none; z-index: 500"><div class="loading c-spin"></div></div> <div> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 500;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="function_title"> <span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_UM_SAVE">Save</span> <span class="sbutton iconsave" onclick="OnSave(1);" data-lgid="P_UM_SAVE1">Save and Exit</span> @@ -326,4 +314,5 @@ </div> </div> </div> + <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> </asp:Content> diff --git a/Site/Maintenance/AddWorkOrder.aspx b/Site/Maintenance/AddWorkOrder.aspx index a9cc78f..9b5025e 100644 --- a/Site/Maintenance/AddWorkOrder.aspx +++ b/Site/Maintenance/AddWorkOrder.aspx @@ -19,676 +19,6 @@ line-height: 22px; } - .edit-content table { - border-collapse: collapse; - width: 100%; - } - - .edit-content table td.label { - width: 200px; - text-align: right; - padding-right: 10px; - line-height: 24px; - height: 24px; - vertical-align: middle; - } - - .edit-content table td.cont { - width: 250px; - } - - .edit-content table td input[type="text"], .edit-content table td textarea { - border: 1px solid #a9a9a9; - width: 240px; - height: 28px; - text-indent: 3px; - box-sizing: border-box; - border-radius: 2px; - } - - .edit-content table td input[type="checkbox"] { - border: none; - } - - .edit-content table td textarea { - height: 100px; - resize: none; - /*max-width: 200px;*/ - } - - #tab_estimates table td.label, - #tab_invoices table td.label { - width: 167px; - text-align: right; - padding-right: 10px; - line-height: 24px; - height: 24px; - vertical-align: middle; - } - - - #tab_estimates table td input[type="text"], #tab_estimates table td textarea, - #tab_invoices table td input[type="text"], #tab_invoices table td textarea { - border: 1px solid #a9a9a9; - width: 150px; - height: 28px; - text-indent: 3px; - box-sizing: border-box; - border-radius: 2px; - } - - .subtitle { - margin: 20px 40px 5px 0px; - font-size: 16px; - color: gray; - } - - .subtitle span { - margin-left: 10px; - } - - .subtitle hr { - background-color: #d8d8d8; - border: none; - height: 1px; - } - - #host_main { - overflow: hidden; - } - - #tab_segments table td.label { - width: 130px; - vertical-align: top; - } - - #tab_segments table td input, - #tab_segments table td textarea { - border: 1px solid #a9a9a9; - width: 320px; - height: 28px; - text-indent: 3px; - box-sizing: border-box; - border-radius: 2px; - } - - #tab_segments table td select { - width: 324px; - } - - #tab_segments table td input[type="checkbox"] { - border: none; - width: unset; - height: unset; - } - - #tab_segments table td textarea { - height: 100px; - resize: none; - /*max-width: 200px;*/ - } - - .segments_table { - margin-top: 10px; - line-height: 25px; - } - - #popupdialog table td.label { - width: 130px; - vertical-align: top; - } - - #popupdialog table td input, - #popupdialog table td textarea { - border: 1px solid #a9a9a9; - width: 320px; - height: 24px; - text-indent: 3px; - box-sizing: border-box; - border-radius: 2px; - } - - #popupdialog table td select { - width: 322px; - } - - #popupdialog table td input[type="checkbox"] { - border: none; - width: 14px; - height: 14px; - } - - #popupdialog table td textarea { - height: 100px; - resize: none; - /*max-width: 200px;*/ - } - - .popus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .popus-close:before { - content: '\e600'; - } - - .estpopus-close, - .invoice-popup-close, - .publish-invoice-popup-close, - .woinvoiceattpopus-close, - .woinvoicemarkpaidpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .estpopus-close:before, - .invoice-popup-close::before, - .publish-invoice-popup-close::before, - .woinvoiceattpopus-close::before, - .woinvoicemarkpaidpopus-close::before { - content: '\e600'; - } - - .pubestpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .pubestpopus-close:before { - content: '\e600'; - } - - .compstatuspopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .compstatuspopus-close:before { - content: '\e600'; - } - - .woattpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .woattpopus-close:before { - content: '\e600'; - } - - .woestattpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .woestattpopus-close:before { - content: '\e600'; - } - - .alertpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .alertpopus-close:before { - content: '\e600'; - } - - .emailpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .emailpopus-close:before { - content: '\e600'; - } - - .icemailpopus-close { - float: right; - margin-right: 6px; - cursor: pointer; - } - - .icemailpopus-close:before { - content: '\e600'; - } - - .workorder_table { - table-layout: fixed; - line-height: 30px; - } - - .msgdiv { - border: solid 1px lightgray; - margin-top: 5px; - padding-left: 5px; - padding-right: 10px; - padding-top: 3px; - padding-bottom: 3px; - line-height: 24px; - white-space: normal; - word-break: break-word; - overflow: hidden; - } - - .msgtime { - text-align: right; - } - - .txtdiv { - padding-bottom: 10px; - } - - .txttime { - padding-left: 10px; - padding-right: 10px; - margin-bottom: 2px; - } - - .txtself { - white-space: pre-wrap; - max-width: 240px; - border-radius: 5px; - padding-top: 8px; - padding-bottom: 8px; - padding-right: 20px; - padding-left: 20px; - display: inline-block; - margin-right: 10px; - background-color: #9eea6a; - text-align: left; - word-break: break-word; - } - - .txtother { - white-space: pre-wrap; - max-width: 240px; - border-radius: 5px; - padding-top: 8px; - padding-bottom: 8px; - padding-right: 20px; - padding-left: 20px; - display: inline-block; - margin-left: 10px; - background-color: white; - word-break: break-word; - } - - #mask_over_bg { - top: 24px; - left: 0; - right: 0; - bottom: 0; - position: absolute; - background: #000; - opacity: 0.2; - } - - .dialog-content table td.label { - width: 120px; - vertical-align: middle; - } - - .dialog-content table td input[type="text"], .dialog-content table td textarea { - width: 320px; - height: 24px; - box-sizing: border-box; - border-radius: 2px; - } - - .divattp { - width: 300px; - margin-right: 10px; - float: left; - position: relative; - } - - .divatt { - width: 300px; - height: 300px; - margin-top: 5px; - margin-bottom: 5px; - margin-right: 10px; - cursor: pointer; - border: 1px solid #b0b0b0; - border-radius: 2px; - box-shadow: rgba(0, 0, 0, 0.4); - text-align: center; - float: left; - position: relative; - } - - .picture { - max-height: 100%; - max-width: 100%; - margin: auto; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - } - - - .download { - line-height: 300px; - font-size: 200px; - margin: 0 auto; - font-family: 'Fontawesome'; - color: silver; - } - - .download::before { - content: '\f15c'; - } - - .wolist_download { - font-size: 60px; - margin: 0 auto; - font-family: 'Fontawesome'; - color: silver; - } - - .wolist_download::before { - content: '\f15c'; - } - - - .file-word::before { - content: '\f1c2'; - } - - .file-excel::before { - content: '\f1c3'; - } - - .file-ppt::before { - content: '\f1c4'; - } - - .file-pdf::before { - content: '\f1c1'; - } - - .file-video::before { - content: '\f1c8'; - } - - .file-zip::before { - content: '\f1c6'; - } - - .file-msg::before { - content: '\f0e0'; - } - - - .delete { - position: absolute; - vertical-align: top; - font-size: 20px; - font-family: 'Fontawesome'; - color: rgb(123,28,33); - right: 8px; - } - - .delete::before { - content: '\f00d'; - } - - .attadownload { - position: absolute; - vertical-align: top; - font-size: 16px; - font-family: 'Fontawesome'; - color: rgb(123,28,33); - right: 5px; - bottom: 5px; - } - - .attadownload::before { - content: '\f019'; - } - - .attaprint { - position: absolute; - vertical-align: top; - font-size: 16px; - font-family: 'Fontawesome'; - color: rgb(123,28,33); - right: 30px; - bottom: 5px; - } - - .attaprint::before { - content: '\f02f'; - } - - .attaedit { - font-size: 14px; - font-family: 'Fontawesome'; - color: rgb(123,28,33); - padding: 3px; - } - - .attaedit::before { - content: '\f044'; - } - - .attasave { - font-size: 18px; - font-family: 'Fontawesome'; - color: rgb(123,28,33); - margin-left: 3px; - } - - .attasave::before { - content: '\f00c'; - } - - - .dialog .dialog-func input { - width: unset; - } - - .noinspection { - color: #444; - height: 30px; - line-height: 30px; - margin-top: 8px; - padding-left: 10px; - padding-right: 10px; - font-size: 20px; - font-style: italic; - } - - #dialog_estimate table td.label, - #dialog_invoice table td.label { - width: 130px; - } - - #dialog_estimate table td input[type="text"], - #dialog_invoice table td input[type="text"] { - width: 150px; - } - - #dialog_estimate table td textarea, - #dialog_invoice table td textarea { - width: 450px; - height: 80px; - margin-top: 6px; - } - - .dropdown { - width: 240px; - } - - .dropdown .dropdown-wrapper { - border-color: #a9a9a9; - } - - .dropdown .dropdown-wrapper > .dropdown-header { - min-height: 26px; - } - - .dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text { - line-height: 26px; - } - - .subtitle .dropdown .dropdown-wrapper > .dropdown-header { - min-height: 24px; - } - - .subtitle .dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text { - line-height: 22px; - height: 22px; - min-height: 22px; - } - - .maintenance { - table-layout: fixed; - border-bottom: none; - width: auto; - min-width: 100%; - } - - #pm_tbody { - } - - #pm_tbody .tr_noresults { - font-style: italic; - } - - #pm_tbody .tr_noresults:hover { - background: none; - } - - .maintenance tr { - border-bottom: 1px solid #e6e6e6; - } - - .main_table .td_intervals { - padding: 0 0 0 60px; - } - - .main_table .tr_intervals { - border-bottom: none; - } - - .main_table .tr_intervals:hover { - background: none; - } - - .icon { - float: left; - font-style: normal; - width: 20px; - font-size: 11px; - height: 16px; - line-height: 16px; - } - - .expand:before { - content: '\e608'; - } - - .collapse:before { - content: '\e607'; - } - - .dialog_table { - width: 100%; - } - - .dialog_table tr { - height: 40px; - } - - .item_name { - width: unset; - font-size: 16px; - } - - .wolist_picture { - width: 60px; - height: 60px; - margin: 0 auto; - } - - .wolist_icon { - font-size: 14px; - font-family: 'Fontawesome'; - color: rgb(123,28,33); - margin-left: 20px; - } - - .wolist_delete::before { - content: '\f00d'; - } - - .wolist_attadownload::before { - content: '\f019'; - } - - .wolist_attaprint::before { - content: '\f02f'; - } - - .divattp input { - width: 60px; - border: 1px solid #fff; - } - - .divattp input.focused, - .divattp input:hover { - border-color: #666; - } - - .divattp input:disabled, - .divattp input:disabled:hover, - .divattp td input:disabled { - background: #ddd; - color: #ddd; - border-color: #ddd; - } - - .inp_name { - height: 24px; - } - - .loading_icon { - font-family: CalciteWebCoreIcons; - cursor: default; - left: 50%; - top: 48%; - } - - .lable_attuploadname { - color: white; - max-height: 800px; - text-align: center; - line-height: 40px; - font-size: 16px; - position: absolute; - left: 50%; - top: 50%; - margin: -50px 0 0 -35px; - } - - /*override*/ - .ui-tooltip-content { - white-space: nowrap !important; - /*min-width: 160px;*/ - } </style> <link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" /> @@ -699,16 +29,13 @@ <script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script> <script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script> <script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script> - <script src="<%=GetFileUrlWithVersion("js/workorderattachments.js")%>" type="text/javascript"></script> - <script src="<%=GetFileUrlWithVersion("js/workordersegment.js")%>" type="text/javascript"></script> - <script src="<%=GetFileUrlWithVersion("js/workorderalert.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("js/workordersendemail.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("js/wocommunication.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script> + <script src="<%=GetFileUrlWithVersion("js/workordertabitems.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("js/addworkorder.js")%>" type="text/javascript"></script> <script type="text/javascript"> var contacts; - var alertdata = []; var workorderid = "<%=WorkOrderID %>"; var machineid = "<%=MachineID %>"; @@ -730,10 +57,6 @@ var meterType = "<%=MeterType%>"; var nowDate = new DateFormatter().formatDate(new Date("<%=NowDate%>"), 'm/d/Y'); var currentdate = "<%=NowDate %>"; - var userdata = []; - var jobsitedata = []; - var components = []; - var segmenttypes = []; var _attachments = []; @@ -785,58 +108,6 @@ }); } - _dialog.showInvoiceConfirm = function (msg, title, fedit, fcancel, fclose, iniframe, shownote) { - if (!fclose) - fclose = fcancel; - _dialog.showButtonDialog(msg, title, 'question', fclose, [{ - value: GetTextByKey("P_WO_XXX", 'Mark as Customer Visible'), - func: fcancel - }, { - value: GetTextByKey("P_WO_XXX", 'Continue Without Making Visible'), - func: fedit - }], iniframe, shownote); - }; - - function showInvoiceConfirm(msg, title, fcancel, fedit, fclose) { - if ($("#dialog_invoice").is(":visible")) { - $("#dialog_invoice .maskbg").show(); - $("#dialog_publish_invoice .maskbg").show(); - } - else - showmaskbg(true); - _dialog.showInvoiceConfirm(msg, title, function (e) { - if ($("#dialog_invoice").is(":visible")) { - $("#dialog_invoice .maskbg").hide(); - $("#dialog_publish_invoice .maskbg").hide(); - } - else - showmaskbg(false); - if (typeof fedit === 'function') { - fedit(e); - } - }, function (e) { - if ($("#dialog_invoice").is(":visible")) { - $("#dialog_invoice .maskbg").hide(); - $("#dialog_publish_invoice .maskbg").hide(); - } - else - showmaskbg(false); - if (typeof fcancel === 'function') { - fcancel(e); - } - }, function (e) { - if ($("#dialog_invoice").is(":visible")) { - $("#dialog_invoice .maskbg").hide(); - $("#dialog_publish_invoice .maskbg").hide(); - } - else - showmaskbg(false); - if (typeof fclose === 'function') { - fclose(e); - } - }); - } - function OnAdd() { if (machineid === "") $("#btnSelectAsset").show(); @@ -886,11 +157,11 @@ if (di) { $('#btnaddcustomer').hide(); - $('#traddcontact').hide(); + //$('#traddcontact').hide(); } else { $('#btnaddcustomer').show(); - $('#traddcontact').show(); + //$('#traddcontact').show(); } $('#dialog_custcontactname').attr('disabled', di); @@ -925,6 +196,7 @@ } showloading(true); + getWorkOrderContacts(workorderid); getWorkOrderFollowers(workorderid); worequest("GetWorkOrderInfo", workorderid, function (data) { showloading(false); @@ -941,15 +213,17 @@ $('.iconsave').show(); workorderdata = wo; - customercontacts = wo.Contacts || []; - showCustomerContacts(customercontacts); - //editableSelectMachine.val(wo.AssetID); meterType = wo.MeterType; $('#dialog_metertype').dropdownVal(meterType); setMeterType(); machineid = wo.AssetID; machine = { Id: wo.AssetID, VIN: wo.VIN, DisplayName: wo.AssetName }; + woalertobj && woalertobj.changeasset(machineid); + woinspectionobj && woinspectionobj.changeasset(machineid); + wosegmentobj.setwodata(workorderdata); + woestimateobj.setwodata(workorderdata); + woinvoiceobj.setwodata(workorderdata); setMachineInfo(wo); getAssetDetailInfo(machineid); @@ -957,7 +231,6 @@ if (!IsAdmin && wo.Completed && !AllowReopenWorkorders) { SetWorkOrderDisabled(true); isshowmachine = true; - //editableSelectMachine.setEnable(false); $("#btnSelectAsset").hide(); } else @@ -1030,6 +303,10 @@ customerid = wo.CustomerId; $('#dialog_custcustomername').text(wo.CustomerName); $('#dialog_custcustomercode').text(wo.CustomerCode); + if (customerid && customerid != "") + $(".custcode").show(); + else + $(".custcode").hide(); $('#dialog_othercost').val(wo.OtherCost == 0 ? "" : wo.OtherCost); $('#dialog_partscost').val(wo.PartsCost == 0 ? "" : wo.PartsCost); @@ -1056,7 +333,7 @@ $('#dialog_department').dropdownVal("" + wo.DepartmentId); if (AllowCustomer) { - $('#dialog_estimatestatus').text(getEstimateStatus(wo.EstimateStatus)); + $('#dialog_estimatestatus').text(woestimateobj.getEstimateStatus(wo.EstimateStatus)); } getLaborCost(false); @@ -1068,8 +345,6 @@ if (AllowCommunicate) getCommunications(true); - //editableSelectMachine.val(wo.AssetID); - if (WOReadOnly || (!IsAdmin && wo.Completed && !AllowReopenWorkorders)) { $('.iconsave').css("display", 'none'); $('#td_attachment input').attr('disabled', true); @@ -1144,12 +419,12 @@ } } - function GetContacts() { + function GetAssetContacts() { if (!machineid) return; var loc = $('#dialog_location').dropdownVal(); var dep = $('#dialog_department').dropdownVal(); - worequest("GetContacts", JSON.stringify([machineid, loc, dep]), function (data) { + worequest("GetAssetContacts", JSON.stringify([machineid, loc, dep]), function (data) { if (data && data.length > 0) { contacts = data; showContacts(); @@ -1852,9 +1127,10 @@ function saveWorkOrder(item, alerttitle, exit, callback, phoneemail) { var param = JSON.stringify(item); param = htmlencode(param); + var tempalertids = woalertobj && woalertobj.getalertids(); showloading(true); - worequest("SaveWorkOrder", param + String.fromCharCode(170) + JSON.stringify(alertids), function (data) { + worequest("SaveWorkOrder", param + String.fromCharCode(170) + JSON.stringify(tempalertids), function (data) { showloading(false); if (typeof (data) === "string") { showAlert(data, alerttitle); @@ -1872,7 +1148,7 @@ $('#divwonumber').show(); if (isadd) { - getAlerts(); + woalertobj && woalertobj.changewo(workorderid, machineid); //GetInvoiceNumber(); } @@ -1937,9 +1213,9 @@ pmemails.push({ 'Key': pm, 'Value': pm }); } else { - if (wo && wo.Contacts) { - for (var j = 0; j < wo.Contacts.length; j++) { - var c = wo.Contacts[j]; + if (customercontacts) { + for (var j = 0; j < customercontacts.length; j++) { + var c = customercontacts[j]; if (c.OptOut || c.OptOut_BC) continue; var mp = $.trim(c.MobilePhone); var email = $.trim(c.Email); @@ -2048,6 +1324,7 @@ customerid = null; $('#dialog_custcustomername').text(''); $('#dialog_custcustomercode').text(''); + $('.custcode').hide(); showCustomerContacts([]); $('#dialog_othercost').val(''); @@ -2097,7 +1374,7 @@ $("#li_invoices").show(); //getWorkOrderStatuses(); OnEdit(); - getAlerts(); + woalertobj && woalertobj.changewo(workorderid, machineid); } else { $('#spanopenworkorders').show(); @@ -2234,7 +1511,7 @@ valueKey: 'ID', textKey: 'Name' }).on('select', function () { - GetContacts(); + GetAssetContacts(); }); $('#dialog_department').dropdown([ @@ -2243,14 +1520,14 @@ valueKey: 'Id', textKey: 'Name' }).on('select', function () { - GetContacts(); + GetAssetContacts(); }); $("#dialog_advisor") .dropdown([{ value: '', DisplayName: ' ' }], { textKey: 'DisplayName' }) .on('expand', function () { if (!contacts) - GetContacts(); + GetAssetContacts(); }); @@ -2261,7 +1538,7 @@ }) .on('expand', function () { if (!contacts) - GetContacts(); + GetAssetContacts(); }); $('#dialog_wotype').dropdown([], { @@ -2312,30 +1589,6 @@ textKey: 'Value' }); - $('#dialog_segmentuser').dropdown([], { - search: true, - valueKey: 'IID', - textKey: 'DisplayName', - parent: '.dialog-content' - }); - $('#dialog_segmentjobsite').dropdown([], { - search: true, - valueKey: 'ID', - textKey: 'Name', - parent: '.dialog-content' - }); - $('#dialog_segmenttype').dropdown([], { - input: true, - maxlength: 50, - textKey: 'value', - parent: '.dialog-content' - }); - $('#dialog_segmentcomponent').dropdown([], { - input: true, - maxlength: 40, - textKey: 'value', - parent: '.dialog-content' - }); // end dropdown getWorkorderParams(); @@ -2360,7 +1613,7 @@ $("#li_estimates").show(); $("#li_invoices").show(); OnEdit(); - getAlerts(); + woalertobj && woalertobj.changewo(workorderid, machineid); } else { $(".comm").hide(); @@ -2369,7 +1622,7 @@ $("#li_invoices").hide(); OnAdd(); if (machineid !== "") - getAssetAlerts(); + woalertobj && woalertobj.getAssetAlerts(machineid); } if (machineid !== "") { GetOpenWorkOrderID(machineid); @@ -2511,32 +1764,24 @@ else { t.removeClass("iconchevronright").addClass("iconchevrondown"); $("#" + tid).show(); - if (tid == "tbcustomer") { - grid_dtcontact && grid_dtcontact.resize(); - } - else if (tid == "tbfollower") { - grid_dtfollower && grid_dtfollower.resize(); - } } saveWorkOrderCollapsed(); } - var dialogAssets; + var woalertobj = null; + var woattachmentobj = null; + var wosegmentobj = null; + var woestimateobj = null; + var woinvoiceobj = null; + var woinspectionobj = null; $(function () { - createAttachment($('#tab_attachments')); - createSegment($('#tab_segments')); - createAlert($('#tab_alerts')); - createEstimate($('#tab_estimates')) - createInvoice($('#tab_invoices')) - - InitDTCAlertGridData(); - InitPMAAlertGridData(); - InitInspectAlertGridData(); - InitOilAlertGridData(); - - InitNoneAssignedAlertGridData(); - InitAllPMSchedulesGridData(); + woalertobj = new $woalert({ parent: $('#tab_alerts'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid, machineid: machineid, alertids: alertids }); + woattachmentobj = new $woattachment({ parent: $('#tab_attachments'), showloading: function (flag) { showloading(flag) }, canExport: canExport, workorderid: workorderid, machineid: machineid }); + wosegmentobj = new $wosegment({ parent: $('#tab_segments'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid }); + woestimateobj = new $woestimate({ parent: $('#tab_estimates'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid }); + woinvoiceobj = new $woinvoice({ parent: $('#tab_invoices'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid }); + woinspectionobj = new $woinspection({ parent: $('#tab_inspections'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid, machineid: machineid }); InitGridCustomers(); @@ -2570,10 +1815,9 @@ } GetOpenWorkOrderID(machineid); - alertids = []; - getAssetAlerts(machineid); + woalertobj && woalertobj.getAssetAlerts(machineid); getAssetDetailInfo(machineid); - GetContacts(); + GetAssetContacts(); } showmaskbg(false); }; @@ -2697,11 +1941,18 @@ showWorkOrderFollowers(followers); } }, - onInitFollower: function () { + onInitFollower: function (selfollowers) { if (isloadfollower && allfollowers?.length > 0) { for (let f of allfollowers) { f.Email = false; f.Text = false; + if (selfollowers) { + var tf = selfollowers.find(function (c) { return c.UserIID.toLowerCase() === f.IID.toLowerCase() }); + if (tf) { + f.Email = tf.SendEmail; + f.Text = tf.SendText; + } + } } return Promise.resolve(allfollowers); } @@ -2711,11 +1962,23 @@ isloadfollower = true; allfollowers = data; } + for (let f of allfollowers) { + f.Email = false; + f.Text = false; + if (selfollowers) { + var tf = selfollowers.find(function (c) { return c.UserIID.toLowerCase() === f.IID.toLowerCase() }); + if (tf) { + f.Email = tf.SendEmail; + f.Text = tf.SendText; + } + } + } resolve(data); }); }); }, onAddFollower: function (list) { + followers = []; for (let f of list) { let iid = f.IID.toLowerCase(); let o = followers?.find(function (a) { return a.UserIID.toLowerCase() === iid }); @@ -2738,11 +2001,25 @@ ui.showAlert(GetTextByKey("P_WO_ERROR", 'Error'), data, 'error') reject(); } else { - showWorkOrderFollowers(followers); resolve(followers); } }); }); + }, + onOpenSelectCRContacts: function () { + return new Promise(function (resolve) { + if (!customerid || customerid === "") { + setTimeout(function () { resolve([]) }, 0); + return; + } + getCustomerContacts(customerid, function (data) { + resolve(data); + }); + }); + }, + onSelectCRContacts: function (list) { + showCustomerContacts(list); + SaveWorkorderContact(); } }); @@ -2759,121 +2036,6 @@ $('#div_container').tab(); - $('.popus-close').click(function (e) { - hidePopup(); - }).keydown(resettab); - function resettab(e) { - if (e.keyCode == 9) { - var input = $('#popupdialog').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - - $('.estpopus-close').click(function (e) { - hideEstimatePopup(); - }).keydown(resetesttab); - function resetesttab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_estimate').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.invoice-popup-close').click(function (e) { - hideInvoicePopup(); - }).keydown(resetinvoicetab); - function resetinvoicetab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_invoice').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.pubestpopus-close').click(function (e) { - hidePublishEstimatePopup(); - }).keydown(resetpubesttab); - function resetpubesttab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_publishestimate').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.publish-invoice-popup-close').click(function (e) { - hidePublishInvoicePopup(); - }).keydown(resetpubinvoicetab); - function resetpubinvoicetab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_publish_invoice').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.compstatuspopus-close').click(function (e) { - hideCompletedStatusPopup(); - }).keydown(resetcompstatustab); - function resetcompstatustab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_completedstatus').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.woestattpopus-close').click(function (e) { - hideWOEstAttachmentPopup(); - }).keydown(resetwoestatttab); - function resetwoestatttab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_woestattachment').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.woinvoiceattpopus-close').click(function (e) { - hideWOInvoiceAttachmentPopup(); - }).keydown(resetwoinvoiceatttab); - - function resetwoinvoiceatttab(e) { - if (e.keyCode == 9) { - var input = $('#dialog_woinvoice_attachment').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - - $('.woinvoicemarkpaidpopus-close').click(function (e) { - hideWOInvoiceMakePaidPopup(); - }).keydown(); - - $('.alertpopus-close').click(function (e) { - hideAlertPopup(); - }).keydown(resettabs); - $('.nottrgalertpopus-close').click(function (e) { - hideAllPMSchedulePopup(); - }).keydown(resettabs); - function resettabs(e) { - if (e.keyCode == 9) { - var input = $('#alertpopupdialog').find("input:not(:disabled),select:not(:disabled)").eq(0); - input.focus(); - return false; - } - } - $('.emailpopus-close').click(function (e) { - hideSendEmailPopup(); - }).keydown(); - - $('.icemailpopus-close').click(function (e) { - hideSendICEmailPopup(); - }).keydown(); - $('#dialog_nextfollowupdate').datetimepicker({ timepicker: false, format: 'm/d/Y', @@ -2930,43 +2092,6 @@ inp.parent().data('val', [date]); } }); - $('#dialog_segmentcompleteddate').datetimepicker({ - timepicker: false, - format: 'm/d/Y', - enterLikeTab: false, - scrollInput: false, - onSelectDate: function (v, inp) { - var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00'); - inp.parent().data('val', [date]); - } - }); - //$('#dialog_completeddate').change(function () { - // var date = $('#dialog_completeddate').val(); - // if (date.length > 0 && checkDate(date)) { - // $('#dialog_status').dropdownVal('100'); - // $('.span_required').show(); - // } - //}); - - $('#span_viewatttype').click(function (ev) { - if ($('.panel_holder.attviewtypemenus').is(':visible')) { - return; - } - hidePanels(); - var left = $(this).offset().left; - var top = $(this).offset().top; - $('.panel_holder.attviewtypemenus').css({ - 'opacity': 0, - 'left': left + $(this).width() - $('.panel_holder.attviewtypemenus').width() / 2, - 'right': 'auto', - 'top': top + 20 - }).show().animate({ 'opacity': 1 }, 100); - $('.panel_holder.attviewtypemenus .trigledown').css({ - 'left': left + $(this).width() - $('.panel_holder.attviewtypemenus').offset().left - 20, - 'right': 'auto', - }); - return false; - }); $('.span_vieuploadmsg').click(function (ev) { if ($('.panel_holder.attuoloadmsgmenus').is(':visible')) { @@ -3000,75 +2125,47 @@ }); $("#txt_customer_key").keypress(onCustomerKeyPress); - $('#dialog_est_chksendtextmsg').change(function () { - var checked = $('#dialog_est_chksendtextmsg').prop('checked'); - $('#dialog_est_phonenum').prop('disabled', !checked); - $('#dialog_est_chkIncludeStatusLink').prop('disabled', !checked); - $('#dialog_est_textmsg').prop('disabled', !checked); - }); - - $('#dialog_invoice_chksendtextmsg').change(function () { - var checked = $('#dialog_invoice_chksendtextmsg').prop('checked'); - $('#dialog_invoice_phonenum').prop('disabled', !checked); - $('#dialog_invoice_chkIncludeStatusLink').prop('disabled', !checked); - $('#dialog_invoice_textmsg').prop('disabled', !checked); - }); - function resizeContent() { $('#divcontent').css('height', $(window).height() - $('#divcontent').offset().top - 4); //$('#div_atts').css('height', $(window).height() - $('#divcontent').offset().top - 4); - $('#divinspections').css('height', $(window).height() - $('#divinspections').offset().top - 4); $('.content_main').css('min-height', 0); - - $("#dtcalertslist").css("height", $('#divdtcalerts').height() - $("#divdtcalerts").offset().top - 4); - grid_dtcalertdt && grid_dtcalertdt.resize(); - $("#pmaalertslist").css("height", $('#divpmaalerts').height() - $("#divpmaalerts").offset().top - 4); - grid_pmaalertdt && grid_pmaalertdt.resize(); - $("#inspectalertslist").css("height", $('#divinspectalerts').height() - $("#divinspectalerts").offset().top - 4); - grid_inspectalertdt && grid_inspectalertdt.resize(); - $("#oilalertslist").css("height", $('#divoilalerts').height() - $("#divoilalerts").offset().top - 4); - grid_oilalertdt && grid_oilalertdt.resize(); - $("#noneassignedalertlist").css("height", $('#alertpopupdialog').height() - $("#alertpopupdialog").offset().top - 4); - grid_noneassignedalertdt && grid_noneassignedalertdt.resize(); - $("#allpmschedulelist").css("height", $('#allpmschedulepopupdialog').height() - $("#allpmschedulepopupdialog").offset().top - 4); - grid_pmschedulesdt && grid_pmschedulesdt.resize(); } $("#li_segments").click(function () { if (!$("#li_segments").data("dataload")) { if (workorderid && workorderid !== '') - GetSegmentDataSource(getSegments); + wosegmentobj.changewo(workorderid); else - GetSegmentDataSource(); + wosegmentobj.loadsource(); + $("#li_segments").data("dataload", true); } }); $("#li_attachments").click(function () { if (!$("#li_attachments").data("dataload")) { - viewtype = getCookie("woattachmentviewtype"); - getWorkOrderAttachments(); + woattachmentobj && woattachmentobj.changewo(workorderid, machineid); $("#li_attachments").data("dataload", true); } }); $("#li_inspections").click(function () { if (!$("#li_inspections").data("dataload")) { - getWOInspectItems(); + woinspectionobj && woinspectionobj.changewo(workorderid, machineid); $("#li_inspections").data("dataload", true); } }); $("#li_estimates").click(function () { if (!$("#li_estimates").data("dataload")) { - getEstimates(); + woestimateobj && woestimateobj.changewo(workorderid); $("#li_estimates").data("dataload", true); } }); $("#li_invoices").click(function () { if (!$("#li_invoices").data("dataload")) { - getInvoices(); + woinvoiceobj && woinvoiceobj.changewo(workorderid); $("#li_invoices").data("dataload", true); } }); @@ -3093,8 +2190,6 @@ if (!canExport) { $('#btnExportReport').hide(); $('#btnPrint').hide(); - $('#spPrint').hide(); - $('#spDownload').hide(); } $('#dialog_chksendtextmsg').change(function () { @@ -3116,18 +2211,6 @@ document.execCommand('insertText', false, field); } - function insertestfield() { - var field = $("#dialog_est_variables").find("option:selected").text(); - $("#dialog_est_textmsg").focus(); - document.execCommand('insertText', false, field); - } - - function insertinvoicefield() { - var field = $("#dialog_invoice_variables").find("option:selected").text(); - $("#dialog_invoice_textmsg").focus(); - document.execCommand('insertText', false, field); - } - function onmsgreceived(data) { console.log(JSON.stringify(data)); if (data.Message != workorderid) @@ -3164,23 +2247,15 @@ } function clearWorkOrderOther() { - $('#div_aatts').empty(); - $('#div_woatts').empty(); - $('#div_iatts').empty(); - $('#woattslist_tbody').empty(); - $('#woassetattslist_tbody').empty(); - $('#woiptattslist_tbody').empty(); //attachment上传提示信息 $('.lable_attuploadname').empty(); $('.span_vieuploadmsg').hide(); $('.span_attupload').hide(); $('#attupload_ul').empty(); - $('#divinspections').empty(); - $('#tab_segments .segments_table').remove(); - $('#tab_estimates .estimates_div').remove(); - $('#tab_estimates .estimates_table').remove(); - $('#tab_invoices .estimates_div').remove(); - $('#tab_invoices .estimates_table').remove(); + } + + function reshowalertgrid() { + woalertobj && woalertobj.reshowalertgrid(); } </script> </asp:Content> @@ -3193,7 +2268,7 @@ <div id="div_container"> <ul id="ul_container" class="tab_header"> <li id="li_workorder" data-href="tab_workorder" class="selected" data-lgid="P_WORKORDER">Work Order</li> - <li data-href="tab_alerts" onclick="reshowgrid();" data-lgid="P_WO_ALERTS">Alerts</li> + <li data-href="tab_alerts" onclick="reshowalertgrid();" data-lgid="P_WO_ALERTS">Alerts</li> <li id="li_segments" data-href="tab_segments" data-lgid="P_WO_SEGMENTS">Segments</li> <li id="li_attachments" data-href="tab_attachments" data-lgid="P_WO_ATTACHMENTS">Attachments</li> <%if (AllowInspection) @@ -3290,48 +2365,12 @@ <td class="label" data-lgid="P_CR_COMPANYNAME_COLON" style="white-space: nowrap;">Company Name:</td> <td> <span id="dialog_custcustomername"></span> + <span class="label custcode" data-lgid="P_CR_COMPANYCODE_COLON" style="white-space: nowrap; margin-left: 50px; display: none;">Company Code:</span> + <span id="dialog_custcustomercode" class="custcode" style="display: none;"></span> <%if (!CRReadOnly) {%> <span class="sbutton iconsearch" id="btnaddcustomer" onclick="onSelectCustomer()" data-title-lgid="P_WO_CONTACTINFORMATION" title="Select Customer"></span> <%}%> - <div style="float: right;"> - <span class="label" data-lgid="P_CR_COMPANYCODE_COLON" style="white-space: nowrap;">Company Code:</span> - <span id="dialog_custcustomercode"></span> - </div> - </td> - </tr> - <tr id="traddcontact"> - <td colspan="2" style="padding-left: 135px;"> - <%if (!CRReadOnly) - {%> - <span class="sbutton iconadd" onclick="onAddContact()" data-lgid="P_CR_ADDCONTACT">Add Contact</span> - <%}%> - </td> - </tr> - <tr> - <td colspan="2" style="padding-left: 135px;"> - <div id="cusomercontactlist" style="height: 190px; width: 792px;"></div> - </td> - </tr> - </table> - - <div class="subtitle contactinfo" style="display: none;"> - <span class="sbutton iconchevronright" id="spanfollower" target="tbfollower" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_XXXXXX">Following</span> - <hr /> - </div> - <table class="workorder_table" style="display: none;" id="tbfollower"> - <tr id="traddfollower"> - <td colspan="2" style="padding-left: 135px;"> - <%if (!CRReadOnly) - {%> - <span class="sbutton iconadd" onclick="onAddFollower()" data-lgid="P_CR_ADDCONTACT">Add Contact</span> - <%}%> - </td> - </tr> - <tr> - <td colspan="2" style="padding-left: 135px;"> - <div id="followerlist" style="height: 190px; width: 784px;"></div> </td> </tr> </table> @@ -3352,7 +2391,7 @@ <td class="label" style="vertical-align: top;"> <span data-lgid="P_WO_DESCRIPTION_COLON">Description:</span><span class="redasterisk">*</span></td> <td colspan="3"> - <textarea id="dialog_description" class="inputbox" maxlength="1000" tabindex="2" style="width: 703px; height: 80px;"></textarea></td> + <textarea id="dialog_description" maxlength="1000" tabindex="2" style="width: 703px; height: 80px;"></textarea></td> </tr> <tr> <td class="label" data-lgid="P_WO_INSPECTIONREQUIRED_COLON">Inspection Required:</td> @@ -3384,10 +2423,10 @@ <span data-lgid="P_WO_COMPLETEDDATE_COLON">Completed Date:</span><span class="span_required redasterisk" style="display: none;">*</span> </td> <td> - <input type="text" id="dialog_completeddate" class="inputbox" maxlength="200" tabindex="2" autocomplete="off" /></td> + <input type="text" id="dialog_completeddate" maxlength="200" tabindex="2" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_DUEDATE_COLON">Due Date:</td> <td> - <input type="text" id="dialog_duedate" tabindex="2" class="inputbox" maxlength="200" autocomplete="off" /></td> + <input type="text" id="dialog_duedate" tabindex="2" maxlength="200" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_METERTYPE_COLON">Meter Type:</td> @@ -3403,17 +2442,17 @@ <td class="label"> <span data-lgid="P_WO_HOURMETER_COLON">Hour Meter:</span><span class="span_required redasterisk" style="display: none;">*</span></td> <td> - <input type="text" id="dialog_hourmeter" class="inputbox" maxlength="12" tabindex="3" autocomplete="off" /></td> + <input type="text" id="dialog_hourmeter" maxlength="12" tabindex="3" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_XXXXXX_COLON">Parts Order Number:</td> <td> - <input type="text" id="dialog_partsordernumber" tabindex="2" class="inputbox" maxlength="50" autocomplete="off" /> + <input type="text" id="dialog_partsordernumber" tabindex="2" maxlength="50" autocomplete="off" /> </td> </tr> <tr id="tr_odometer"> <td class="label"> <span data-lgid="P_WO_ODOMETER_COLON">Odometer:</span><span class="span_required redasterisk" style="display: none;">*</span></td> <td> - <input type="text" id="dialog_odometer" disabled="disabled" class="inputbox" maxlength="12" tabindex="3" style="width: 147px;" autocomplete="off" /> + <input type="text" id="dialog_odometer" disabled="disabled" maxlength="12" tabindex="3" style="width: 147px;" autocomplete="off" /> <div id="dig_odometeruom" style="width: 90px; display: inline-block" tabindex="3" class="dropdown"></div> </td> <td class="label" data-lgid="P_WO_XXXXXX_COLON">Parts Status:</td> @@ -3438,17 +2477,17 @@ </td> <td class="label" data-lgid="P_WO_PARTSEXPECTEDDATE_COLON">Parts Expected Date:</td> <td class="cont"> - <input type="text" id="dialog_partsexpecteddate" tabindex="2" class="inputbox" maxlength="200" autocomplete="off" /></td> + <input type="text" id="dialog_partsexpecteddate" tabindex="2" maxlength="200" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_ADVISOR_COLON">Advisor:</td> <td> - <%--<input type="text" id="dialog_advisor" class="inputbox" maxlength="50" tabindex="2" autocomplete="off" />--%> + <%--<input type="text" id="dialog_advisor" maxlength="50" tabindex="2" autocomplete="off" />--%> <div id="dialog_advisor" tabindex="2" class="dropdown"></div> </td> <td class="label" data-lgid="P_WO_NEXTFOLLOWUPDATE_COLON">Next Follow Up Date:</td> <td class="cont"> - <input type="text" id="dialog_nextfollowupdate" tabindex="2" class="inputbox" maxlength="200" autocomplete="off" /></td> + <input type="text" id="dialog_nextfollowupdate" tabindex="2" maxlength="200" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_XXX">Salesperson:</td> @@ -3459,15 +2498,15 @@ <tr> <td class="label"><span class="alternatestatus" style="display: none;" data-lgid="P_WO_ALTERNATESTATUS_COLON">Alternate Status:</span></td> <td> - <input type="text" id="dialog_alternatestatus" style="display: none;" class="inputbox alternatestatus" maxlength="30" tabindex="2" autocomplete="off" /></td> + <input type="text" id="dialog_alternatestatus" style="display: none;" class="alternatestatus" maxlength="30" tabindex="2" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_LASTLABORDATE_COLON">Last Labor Date:</td> <td class="cont"> - <input type="text" id="dialog_lastlabordate" tabindex="2" class="inputbox" maxlength="200" autocomplete="off" /></td> + <input type="text" id="dialog_lastlabordate" tabindex="2" maxlength="200" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_NOTES_COLON" style="vertical-align: top;">Notes:</td> <td colspan="3"> - <textarea id="dialog_notes" class="inputbox" maxlength="500" tabindex="3" style="width: 703px; height: 80px;"></textarea></td> + <textarea id="dialog_notes" maxlength="500" tabindex="3" style="width: 703px; height: 80px;"></textarea></td> </tr> </table> @@ -3480,39 +2519,39 @@ <tr> <td class="label" data-lgid="P_PM_EXPECTEDCOST_COLON">Expected Cost:</td> <td class="cont"> - <input type="text" id="dialog_expectedcost" disabled="disabled" class="inputbox" maxlength="12" tabindex="3" autocomplete="off" /></td> + <input type="text" id="dialog_expectedcost" disabled="disabled" maxlength="12" tabindex="3" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_WORKORDERTOTALCOST_COLON">Work Order Total Cost ($):</td> <td class="cont"> - <input type="text" id="dialog_workordercosts" class="inputbox" maxlength="12" tabindex="3" disabled="disabled" autocomplete="off" /></td> + <input type="text" id="dialog_workordercosts" maxlength="12" tabindex="3" disabled="disabled" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_OTHERCOST_COLON">Other Cost ($):</td> <td> - <input type="text" id="dialog_othercost" class="inputbox" maxlength="12" tabindex="3" onblur="getTotalCost();" autocomplete="off" /></td> + <input type="text" id="dialog_othercost" maxlength="12" tabindex="3" onblur="getTotalCost();" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_PARTSCOST_COLON">Parts Cost ($):</td> <td> - <input type="text" id="dialog_partscost" class="inputbox" maxlength="12" tabindex="3" onblur="getTotalCost();" autocomplete="off" /></td> + <input type="text" id="dialog_partscost" maxlength="12" tabindex="3" onblur="getTotalCost();" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_TRAVELTIMECOST_COLON">Travel Time Cost ($):</td> <td> - <input type="text" id="dialog_traveltimecost" class="inputbox" maxlength="12" tabindex="3" onblur="getTotalCost();" autocomplete="off" /></td> + <input type="text" id="dialog_traveltimecost" maxlength="12" tabindex="3" onblur="getTotalCost();" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_LABORCOST_COLON">Labor Cost ($):</td> <td> - <input type="text" id="dialog_laborcost" class="inputbox" maxlength="12" tabindex="3" disabled="disabled" onblur="getTotalCost();" autocomplete="off" /></td> + <input type="text" id="dialog_laborcost" maxlength="12" tabindex="3" disabled="disabled" onblur="getTotalCost();" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_HOURLYRATE_COLON">Hourly Rate:</td> <td> - <input type="text" id="dialog_hourlyrate" class="inputbox" maxlength="12" tabindex="3" disabled="disabled" autocomplete="off" /></td> + <input type="text" id="dialog_hourlyrate" maxlength="12" tabindex="3" disabled="disabled" autocomplete="off" /></td> <td class="label" data-lgid="P_WO_TIMETOCOMPLATEHOURS_COLON">Time To Complete(Hrs):</td> <td> - <input type="text" id="dialog_timetocomplete" class="inputbox" maxlength="12" tabindex="3" onblur="getLaborCost(false,true);" autocomplete="off" /></td> + <input type="text" id="dialog_timetocomplete" maxlength="12" tabindex="3" onblur="getLaborCost(false,true);" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_INVOICENUMBER_COLON">Invoice Number:</td> <td> - <input type="text" id="dialog_invoicenumber" class="inputbox" maxlength="50" tabindex="3" autocomplete="off" /> + <input type="text" id="dialog_invoicenumber" maxlength="50" tabindex="3" autocomplete="off" /> <%--<select id="dialog_invoicenumber" tabindex="3" style="height: 22px; width: 244px;"></select>--%> </td> <%if (AllowCustomer) @@ -3525,7 +2564,7 @@ <tr> <td class="label" data-lgid="P_WO_INTERNALID_COLON">Internal ID:</td> <td> - <input type="text" id="dialog_internalid" class="inputbox" maxlength="50" tabindex="2" autocomplete="off" /></td> + <input type="text" id="dialog_internalid" maxlength="50" tabindex="2" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_WO_XXXXXX_COLON">Billable:</td> @@ -3547,322 +2586,30 @@ </div> <div id="tab_alerts" data-page="tab_alerts"> - <%-- <div class="function_title"> - <span class="sbutton iconadd" id="span_addalerts" onclick="OnAddAlerts();" data-lgid="P_WO_ADDALERTS">Add Alerts</span> - <span class="sbutton icondelete" id="span_removealerts" onclick="OnRemoveAlerts();" data-lgid="P_WO_REMOVEALERTS">Remove Alerts</span> - </div> - <div class="clear"></div> - <div id="divdtcalerts" style="height: 260px; display: none;"> - <div class="subtitle"> - <span data-lgid="P_WO_DTCALERTS">DTC Alerts</span> - </div> - <div id="dtcalertslist" style="border-bottom:1px solid #aaa;"> - </div> - </div> - - <div id="divpmaalerts" style="height: 260px;"> - <div class="subtitle"> - <span data-lgid="P_WO_PMALERTS">PM Alerts</span> - <span class="sbutton iconadd" id="btnaddpmalerts" style="color: black;" onclick="OnAddAllPMSchedules();" data-lgid="P_WO_ADDPMALERTS">Add PM Alerts (Alerts not yet triggered)</span> - </div> - <div id="pmaalertslist" style="border-bottom:1px solid #aaa;"> - </div> - </div> - - <div id="divinspectalerts" style="height: 260px; display: none;"> - <div class="subtitle"> - <span data-lgid="P_WO_INSPECTALERTS">Inspect Alerts</span> - </div> - <div id="inspectalertslist" style="border-bottom:1px solid #aaa;"> - </div> - </div> - <div id="divoilalerts" style="height: 260px; display: none;"> - <div class="subtitle"> - <span data-lgid="P_WO_OILALERTS">Oil Alerts</span> - </div> - <div id="oilalertslist" style="border-bottom:1px solid #aaa;"> - </div> - </div>--%> </div> <div id="tab_segments" data-page="tab_segments"> - <%-- <div class="function_title"> - <span class="sbutton iconadd" onclick="OnAddSegment();" data-lgid="P_WO_ADDSEGMENT">Add Segment</span> - </div>--%> </div> <div id="tab_attachments" data-page="tab_attachments"> - <%--<div class="function_title"> - <span class="sbutton iconadd" onclick="UpLoadWorkOrderAttachment();" data-lgid="P_WO_ADDFILE">Add File</span> - <span id="spPrint" class="sbutton iconprint" onclick="openPAndDGDialog(0);" data-lgid="P_WO_PRINT">Print</span> - <span id="spDownload" class="sbutton icondownload" onclick="openPAndDGDialog(1);" data-lgid="P_WO_DOWNLOAD">Download</span> - <span class="sbutton iconviewatt" id="span_viewatttype" data-lgid="P_WO_XXX">View</span> - </div> - <div class="panel_holder attviewtypemenus"> - <div id="attviewtypemenu_panel" class="panel" style="min-width: 150px; background-color: white;"> - <ul class="lefttitlemenu_ul"> - <li onclick="onViewAttachment(0);" style="line-height: 32px;"> - <a style="padding-left: 0;"> - <span class="spanbtn iconlarge" style="padding: 6px; width: auto; font-size: 14px;"></span> - <span style="padding-left: 6px;" data-lgid="P_WO_XXX">Large</span></a></li> - <li onclick="onViewAttachment(1);" style="line-height: 32px;"> - <a style="padding-left: 0;"> - <span class="spanbtn iconlist" style="padding: 6px; width: auto; font-size: 14px;"></span> - <span style="padding-left: 6px;" data-lgid="P_WO_XXX">List</span></a></li> - </ul> - <div class="trigledown"></div> - <div class="trigledown white"></div> - </div> - </div> - <div id="dialogattdragmask" class="maskbg" style="display: none; z-index: 501;"></div> - <div id="div_attlarge"> - <table id="tb_woattlarge" class="main_table maintenance" ondrop="dropWOAttachment(event)" ondragover="dragOverWOAttachment(event)" onpaste="cutWOAttachment(event)"> - <tr style="line-height: 35px;"> - <td class="subtitle"> - <span class="sbutton iconchevrondown woattafoldicon" target="woaatts_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_WORKORDERATTACHMENTS">Work Order Attachments</span> - </td> - </tr> - <tr id="woaatts_tr" class="tr_intervals woattafoldtr"> - <td> - <div id="div_woatts" style="min-height: 80px; overflow: auto; padding-left: 20px;"></div> - </td> - </tr> - </table> - <table class="main_table maintenance"> - <tr style="line-height: 35px;"> - <td class="subtitle"> - <span class="sbutton iconchevrondown woattafoldicon" target="woassetatts_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_ASSETATTACHMENTS">Asset Attachments</span> - </td> - </tr> - <tr id="woassetatts_tr" class="tr_intervals woattafoldtr"> - <td> - <div id="div_aatts" style="min-height: 80px; overflow: auto; padding-left: 20px;"> - </div> - </td> - </tr> - </table> - - <table class="main_table maintenance"> - <tr style="line-height: 35px;"> - <td class="subtitle"> - <span class="sbutton iconchevrondown woattafoldicon" target="woiptatts_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_INSPECTIONATTACHMENTS">Inspection Attachments</span> - </td> - </tr> - <tr id="woiptatts_tr" class="tr_intervals woattafoldtr"> - <td> - <div id="div_iatts" style="min-height: 80px; overflow: auto; padding-left: 20px;"> - </div> - </td> - </tr> - </table> - </div> - <div id="div_attlist" style="display: none;"> - <table class="main_table maintenance" ondrop="dropWOAttachment(event)" ondragover="dragOverWOAttachment(event)" onpaste="cutWOAttachment(event)"> - <tr style="line-height: 35px;"> - <td class="subtitle"> - <span class="sbutton iconchevrondown woattafoldicon" target="woattslist_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_WORKORDERATTACHMENTS">Work Order Attachments</span> - <lable class="lable_attuploadname" style="margin-left: 200px;"></lable> - </td> - </tr> - <tr id="woattslist_tr" class="tr_intervals woattafoldtr"> - <td> - <table class="table_intervals"> - <thead> - <tr> - <th style="width: 30px;"></th> - <th style="width: 60px;"></th> - <th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th> - <th style="width: 130px;" data-lgid="P_WO_AVAILABLETOCUSTOMER"></th> - <th class="td_funcs"></th> - </tr> - </thead> - <tbody id="woattslist_tbody"> - </tbody> - </table> - </td> - </tr> - </table> - - <table class="main_table maintenance"> - <tr style="line-height: 35px;"> - <td class="subtitle"> - <span class="sbutton iconchevrondown woattafoldicon" target="woassetattslist_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_ASSETATTACHMENTS">Asset Attachments</span> - </td> - </tr> - <tr id="woassetattslist_tr" class="tr_intervals woattafoldtr"> - <td> - <table class="table_intervals"> - <thead> - <tr> - <th style="width: 30px;"></th> - <th style="width: 60px;"></th> - <th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th> - <th style="width: 130px;"></th> - <th class="td_funcs"></th> - </tr> - </thead> - <tbody id="woassetattslist_tbody"> - </tbody> - </table> - </td> - </tr> - </table> - - <table class="main_table maintenance"> - <tr style="line-height: 35px;"> - <td class="subtitle"> - <span class="sbutton iconchevrondown woattafoldicon" target="woiptattslist_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span> - <span data-lgid="P_WO_INSPECTIONATTACHMENTS">Inspection Attachments</span> - </td> - </tr> - <tr id="woiptattslist_tr" class="tr_intervals woattafoldtr"> - <td> - <table class="table_intervals"> - <thead> - <tr> - <th style="width: 30px;"></th> - <th style="width: 60px;"></th> - <th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th> - <th style="width: 130px;"></th> - <th class="td_funcs"></th> - </tr> - </thead> - <tbody id="woiptattslist_tbody"> - </tbody> - </table> - </td> - </tr> - </table> - </div> - - <div class="panel_holder attuoloadmsgmenus"> - <div id="attuplodmsg_panel" class="panel" style="min-width: 150px; background-color: white; max-width: 480px; max-height: 400px;"> - <ul class="lefttitlemenu_ul" id="attupload_ul"> - </ul> - <div class="trigledown"></div> - <div class="trigledown white"></div> - </div> - </div>--%> </div> <div id="tab_inspections" data-page="tab_inspections"> - <div id="divinspections" style="overflow: auto; min-width: 1610px; height: 668px;"> - </div> </div> <div id="tab_estimates" class="edit-content" data-page="tab_estimates"> - <%--<div class="function_title"> - <span class="sbutton iconadd" onclick="OnAddEstimate();" data-lgid="P_WO_ADDESTIMATE">Add Estimate</span> - </div>--%> </div> <div id="tab_invoices" class="edit-content" data-page="tab_invoices"> - <%-- <div class="function_title"> - <span class="sbutton iconadd" onclick="OnAddInvoice();" data-lgid="P_WO_ADDINVOICE">Add Invoice</span> - </div>--%> </div> </div> <div id="mask_bg" style="display: none;"> <div class="loading c-spin"></div> </div> - <div id="popupmask" class="maskbg" style="display: none;"></div> - <div id="popupdialog" class="dialog" style="display: none;"> - <div class="dialog-title"><span class="title" id="popupTitle" data-lgid="P_WO_ADDSEGMENT">Add Segment</span><em class="popus-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 28px;"> - <tr> - <td class="label" data-lgid="P_WO_USER_COLON">User:</td> - <td> - <div id="dialog_segmentuser" tabindex="101" style="width: 320px" class="dropdown"></div> - </td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_HOURS_COLON">Hours:</td> - <td> - <input type="text" id="dialog_segmenthour" tabindex="102" class="inputbox" maxlength="200" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_JOBSITE_COLON">Jobsite:</td> - <td> - <div id="dialog_segmentjobsite" tabindex="103" style="width: 320px" class="dropdown"></div> - </td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_COST_COLON">Cost:</td> - <td> - <input type="text" id="dialog_segmentcost" tabindex="104" class="inputbox" maxlength="200" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_XXXXXX_COLON">Segment Type:</td> - <td> - <div id="dialog_segmenttype" tabindex="104" style="width: 320px" class="dropdown"></div> - </td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_COMPONENT_COLON">Component:</td> - <td> - <div id="dialog_segmentcomponent" tabindex="104" style="width: 320px" class="dropdown"></div> - </td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_XXXXXX_COLON">Billable:</td> - <td> - <input type="checkbox" id="dialog_segmentbillable" tabindex="105" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_COMPLETED_COLON">Completed:</td> - <td> - <input type="checkbox" id="dialog_segmentcompleted" tabindex="105" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_COMPLETEDDATE_COLON">Completed Date:</td> - <td> - <input type="text" id="dialog_segmentcompleteddate" tabindex="106" class="inputbox" maxlength="200" autocomplete="off" /></td> - </tr> - <tr> - <td class="label"><span data-lgid="P_WO_DESCRIPTION_COLON">Description:</span><span class="redasterisk">*</span></td> - <td> - <input type="text" id="dialog_segmentdesc" tabindex="107" class="inputbox" maxlength="200" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_NOTES_COLON">Notes:</td> - <td> - <textarea id="dialog_segmentnotes" class="inputbox" maxlength="1000" tabindex="108" style="width: 540px; height: 120px;"></textarea></td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="popus-close" tabindex="110" style="margin-right: 30px;" /> - <input type="button" id="btn_savesegment" onclick="SaveSegment('');" value="OK" data-lgid="P_WO_OK" tabindex="109" /> - <div class="clear"></div> - </div> - </div> - - <div id="alertpopupmask" class="maskbg" style="display: none;"></div> - <div id="alertpopupdialog" class="dialog" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_ADDALERTS">Add Alerts</span><em class="alertpopus-close"></em></div> - <div class="dialog-content"> - <div id="noneassignedalertlist" style="width: 820px; height: 120px;"> - </div> - </div> - - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="alertpopus-close" tabindex="53" style="margin-right: 30px;" /> - <input type="button" onclick="OnSaveAlerts();" value="OK" data-lgid="P_WO_OK" tabindex="52" /> - <div class="clear"></div> - </div> - </div> - - <div id="sendemailpopupmask" class="maskbg" style="display: none;"></div> <div class="dialog" id="sendemailpopupdialog" style="display: none; width: 480px;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_SENDWORKORDER">Send Work Order</span><em class="emailpopus-close"></em></div> + <div class="dialog-title"><span class="title" data-lgid="P_WO_SENDWORKORDER">Send Work Order</span><em class="dialog-close"></em></div> <div class="dialog-content" style="height: 430px;"> <table> <tr> @@ -3899,16 +2646,14 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="emailpopus-close" tabindex="153" /> + <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="153" /> <input type="button" onclick="onSendWorkOrder();" value="OK" data-lgid="P_WO_OK" tabindex="152" /> <div class="clear"></div> </div> </div> - - <div id="sendicemailpopupmask" class="maskbg" style="display: none;"></div> <div class="dialog" id="sendicemailpopupdialog" style="display: none; width: 485px;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_SENDINTERNALCOMMENTS">Send Internal Comments</span><em class="icemailpopus-close"></em></div> + <div class="dialog-title"><span class="title" data-lgid="P_WO_SENDINTERNALCOMMENTS">Send Internal Comments</span><em class="dialog-close"></em></div> <div class="dialog-content"> <table style="line-height: 25px;"> <tr> @@ -3938,105 +2683,12 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="icemailpopus-close" tabindex="153" /> + <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="153" /> <input type="button" onclick="onSendInternalComments();" value="OK" data-lgid="P_WO_OK" tabindex="152" /> <div class="clear"></div> </div> </div> - - <div id="addfollowerpopupmask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="addfollowerpopupdialog" style="display: none; width: 560px;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_XXXXXX">Add Followers</span><em class="dialog-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 25px;"> - <tr> - <td data-lgid="P_WO_XXXXXX">Who do you want to receive customer notifications?</td> - </tr> - <tr> - <td colspan="2"> - <input type="text" id="selfollower_search" style="width: 445px; margin-left: 10px;" placeholder="Search" /></td> - </tr> - <tr> - <td> - <div id="allfollowerlist" style="height: 240px; width: 520px; margin-left: 10px; margin-right: 10px;"></div> - </td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="153" /> - <input type="button" onclick="onSelectFollowers();" value="OK" data-lgid="P_WO_OK" tabindex="152" /> - <div class="clear"></div> - </div> - </div> - - <div id="allpmschedulepopupmask" class="maskbg" style="display: none;"></div> - <div id="allpmschedulepopupdialog" class="dialog" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_SELECTPLANFORALERT">Select Plan for Alert</span><em class="nottrgalertpopus-close"></em></div> - <div class="dialog-content"> - <div id="allpmpmalertslist" style="width: 420px; height: 200px;"> - </div> - </div> - - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="nottrgalertpopus-close" tabindex="53" style="margin-right: 30px;" /> - <input type="button" onclick="GenerateManualPMAlerts();" value="OK" data-lgid="P_WO_OK" tabindex="52" /> - <div class="clear"></div> - </div> - </div> - - <div class="dialog" id="dialog_customercontact" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_CR_ADDCONTACT">Add Contact</span><em class="dialog-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 30px; table-layout: fixed; width: 480px;"> - <tr> - <td class="label"><span data-lgid="P_CR_CONTACTNAME_COLON">Contact Name:</span><span class="redasterisk">*</span></td> - <td> - <input type="text" id="dialog_contactname" tabindex="1" maxlength="200" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_CR_CONTACTPREFERENCES_COLON">Contact Preferences:</td> - <td> - <div id="dialog_contactpreference" tabindex="1" class="dropdown" style="width: 320px"></div> - </td> - </tr> - <tr> - <td class="label" data-lgid="P_CR_EMAILADDRESS_COLON">Email Address:</td> - <td> - <input type="text" id="dialog_emailaddress" tabindex="1" maxlength="100" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_UM_MOBILE_COLON">Mobile:</td> - <td> - <input type="text" id="dialog_mobile" tabindex="1" maxlength="50" autocomplete="off" /></td> - </tr> - <tr style="display: none;"> - <td class="label" data-lgid="P_UM_ADDRESS_COLON">Address:</td> - <td> - <input type="text" id="dialog_address" tabindex="1" maxlength="500" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_CR_XXXXXX">Opt Out:</td> - <td> - <input type="checkbox" id="dialog_optout" tabindex="1" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_CR_NOTES_COLON">Notes:</td> - <td> - <textarea id="dialog_contactnotes" tabindex="1" style="width: 320px; height: 100px; margin-top: 6px;" maxlength="2000"></textarea></td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> - <input type="button" onclick="onSaveContact(0);" value="Work Order Only" data-lgid="P_WO_WORKORDERONLY" tabindex="17" /> - <input type="button" id="btn_contactrecord" onclick="onSaveContact(1);" style="display: none;" value="Add Contact Record" data-lgid="P_WO_ADDCONTACTRECORD" tabindex="17" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" id="contatcmask" style="display: none;"></div> - </div> - <div class="dialog" id="dialog_customer" style="display: none;"> <div class="dialog-title"><span class="title" data-lgid="P_WO_SELECTCUSTOMER">Select Customer</span><em class="dialog-close"></em></div> <div class="dialog-content"> @@ -4054,7 +2706,7 @@ <div id="customerlist" style="height: 400px; width: 750px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetSelectCustomer();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div style="clear: both;"></div> </div> @@ -4066,421 +2718,8 @@ <div class="maskbg" style="display: none;"></div> </div> - <div id="popupestimatemask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_estimate" style="display: none;" ondrop="dropAddEstimateAttachment(event)" ondragover="dragOverAddEstimateAttachment(event)" onpaste="cutAddEstimateAttachment(event)"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_ADDESTIMATE">Add Estimate</span><em class="estpopus-close"></em></div> - <div class="dialog-content"> - <table> - <tr> - <td class="label" data-lgid="P_WO_ESTIMATENUMBER_COLON">Estimate #:</td> - <td> - <input type="text" id="dialog_est_number" tabindex="1" class="inputbox" maxlength="50" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_ESTIMATESTATUS_COLON">Estimate Status:</td> - <td> - <span id="dialog_est_status"></span></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_ESTIMATETOTALCOST_COLON">Estimate Total Cost ($):</td> - <td class="cont"> - <input type="text" id="dialog_est_totalcosts" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /> - <span class='sbutton iconequel' style="padding: 3px 1px 3px 6px; font-size: 12px;" onclick="getEstimateTotalCost('');" data-title-lgid="P_WO_CALCULATINGTOTALS"></span> - </td> - <td class="label" data-lgid="P_WO_OTHERCOST_COLON">Other Cost ($):</td> - <td> - <input type="text" id="dialog_est_othercost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_PARTSCOST_COLON">Parts Cost ($):</td> - <td style="display: inline-flex;"> - <input type="text" id="dialog_est_partscost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_TRAVELTIMECOST_COLON">Travel Time Cost ($):</td> - <td> - <input type="text" id="dialog_est_traveltimecost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_LABORCOST_COLON">Labor Cost ($):</td> - <td> - <input type="text" id="dialog_est_laborcost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_TIMETOCOMPLATEHOURS_COLON">Time To Complete(Hrs):</td> - <td> - <input type="text" id="dialog_est_timetocomplete" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_TAXES_COLON">Taxes ($):</td> - <td> - <input type="text" id="dialog_est_taxes" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_XXX">PO Required:</td> - <td> - <input type="checkbox" id="dialog_est_porequired" style="width: auto;" tabindex="1" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_CUSTOMERISSUES_COLON" style="vertical-align: top;">Customer Issues:</td> - <td colspan="3"> - <textarea id="dialog_est_custissues" tabindex="1" maxlength="2000"></textarea></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_TECHNICIANNOTES_COLON" style="vertical-align: top;">Technician Notes:</td> - <td colspan="3"> - <textarea id="dialog_est_technotes" tabindex="1" maxlength="500"></textarea></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top;">Attachments:</td> - <td colspan="3"> - <span class="sbutton iconadd" onclick="openWOEstAttachmentDialog('');" data-lgid="P_WO_ADDFILE">Add File</span> - <%--<input id="dialog_est_uploadattfile" type="button" value="Add File..." data-lgid="P_FR_ADDFILE" onclick="openWOEstAttachmentDialog('')" tabindex="1" style="background-color: #0099FF; color: #FFFFFF; height: 20px; width: 200px;" />--%> - </td> - </tr> - <tr> - <td class="label"></td> - <td colspan="3"> - <table id="tab_est_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 450px; display: none;"> - <tr> - <td> - <div class="content_main" style="max-height: 80px; overflow: auto;"> - <table id="tab_est_atts" style="table-layout: fixed;"></table> - </div> - </td> - </tr> - </table> - </td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="estpopus-close" tabindex="1" style="height: 26px;" /> - <input type="button" onclick="openPublishDialog(-1);" value="Publish" data-lgid="P_WO_PUBLISH" tabindex="11" /> - <input type="button" id="btn_estimatesave" onclick="onSaveWorkOrderEstimate('');" value="Save As Draft" data-lgid="P_WO_XXX" tabindex="11" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - <div id="popupinvoicemask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_invoice" style="display: none;" ondrop="dropAddInvoiceAttachment(event)" ondragover="dragOverAddInvoiceAttachment(event)" onpaste="cutAddInvoiceAttachment(event)"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_ADDINVOICE">Add Invoice</span><em class="invoice-popup-close"></em></div> - <div class="dialog-content"> - <table> - <tr> - <td class="label" data-lgid="P_WO_INVOICENUMBER">Invoice #:</td> - <td> - <input type="text" id="dialog_invoice_number" tabindex="1" class="inputbox" maxlength="50" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_OTHERCOST_COLON">Other Cost ($):</td> - <td> - <input type="text" id="dialog_invoice_othercost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_INVOICETOTALCOST">Invoice Total Cost ($):</td> - <td class="cont"> - <input type="text" id="dialog_invoice_totalcosts" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_TRAVELTIMECOST_COLON">Travel Time Cost ($):</td> - <td> - <input type="text" id="dialog_invoice_traveltimecost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_PARTSCOST_COLON">Parts Cost ($):</td> - <td> - <input type="text" id="dialog_invoice_partscost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_TAXES_COLON">Taxes ($):</td> - <td> - <input type="text" id="dialog_invoice_taxes" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_LABORCOST_COLON">Labor Cost ($):</td> - <td> - <input type="text" id="dialog_invoice_laborcost" class="inputbox" maxlength="12" tabindex="1" autocomplete="off" /></td> - <td class="label" data-lgid="P_WO_INVOICESTATUS">Invoice Status:</td> - <td> - <select id="dialog_invoice_status" style="width: 150px; height: 24px;"> - <option value="0">Draft</option> - <option value="1">Awaiting Payment</option> - <option value="6">Paid</option> - <option value="10">Revoked</option> - </select></td> - </tr> - <tr id="tr_payment"> - <td class="label" data-lgid="P_WO_XXXXXX">Payment By:</td> - <td> - <select id="dialog_invoice_paymentby" style="width: 150px; height: 24px;"> - <option value="Credit Card">Credit Card</option> - <option value="Check">Check</option> - <option value="Cash">Cash</option> - </select></td> - <td class="label" data-lgid="P_WO_XXXXXX_COLON">Check #:</td> - <td> - <input type="text" id="dialog_invoice_checknumber" class="inputbox" maxlength="200" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td></td> - <td></td> - <td class="label" data-lgid="P_WO_XXXXXX_COLON">Customer Visible:</td> - <td> - <input type="checkbox" id="dialog_invoice_customervisible" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WOS_NOTES_COLON" style="vertical-align: top;">Notes:</td> - <td colspan="3"> - <textarea id="dialog_invoice_notes" tabindex="1" maxlength="2000"></textarea></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top;">Attachments:</td> - <td colspan="3"> - <span class="sbutton iconadd" onclick="openWOInvoiceAttachmentDialog('');" data-lgid="P_WO_ADDFILE">Add File</span> - </td> - </tr> - <tr> - <td class="label"></td> - <td colspan="3"> - <table id="tab_invoice_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 450px; display: none;"> - <tr> - <td> - <div class="content_main" style="max-height: 80px; overflow: auto;"> - <table id="tab_invoice_atts" style="table-layout: fixed;"></table> - </div> - </td> - </tr> - </table> - </td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="invoice-popup-close" tabindex="1" style="height: 26px;" /> - <input type="button" id="btn_invoice_save" onclick="onAddWorkOrderInvoice();" value="Save" data-lgid="P_WO_SAVE" tabindex="11" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - <div id="popupepublishstimatemask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_publishestimate" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_PUBLISHESTIMATE">Publish Estimate</span><em class="pubestpopus-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"> - <tr> - <td style="text-align: right;"> - <input id="dialog_est_chksendtextmsg" type="checkbox" checked="checked" style="width: unset;" /></td> - <td style="text-align: left;"> - <label for="dialog_est_chksendtextmsg" data-lgid="P_WO_SENDUPDATETOCUSTOMER" style="user-select: none;">Send Update To Customer</label></td> - </tr> - <tr> - <td> - <div style="font-size: 20px; margin-right: 5px; float: right;"><em class="spanbtn iconmobile" style="font-weight: 900; font-size: 14px; cursor: default; padding-left: 0; padding-right: 3px; padding-top: 0;"></em></div> - </td> - <td> - <input type="text" id="dialog_est_phonenum" tabindex="1" autocomplete="off" maxlength="100" style="width: 320px;" /> - </td> - </tr> - <tr> - <td style="text-align: right;"> - <input id="dialog_est_chkIncludeStatusLink" type="checkbox" checked="checked" style="width: unset;" /></td> - <td style="text-align: left;"> - <label for="dialog_est_chkIncludeStatusLink" data-lgid="P_WO_INCLUDESTATUSLINK" style="user-select: none;">Include Status Link</label></td> - </tr> - <tr> - <td class="label" style="width: unset;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td> - <td> - <select id="dialog_est_variables" style="width: 156px;"> - <option value="0">[Site_Name]</option> - <option value="1">[Location]</option> - <option value="13">[Asset]</option> - <option value="4">[VIN]</option> - <option value="2">[Make]</option> - <option value="3">[Model]</option> - <option value="5">[Id_Phone]</option> - <option value="6">[Advisor]</option> - <option value="7">[Company_Name]</option> - <option value="8">[Contact_Name]</option> - <option value="9">[Contact_First_Name]</option> - <option value="10">[Status_Link]</option> - <option value="11">[Technician_Name]</option> - <option value="12">[Work_Order_Number]</option> - <option value="13">[Parts_Order_Number]</option> - </select> - <input type="button" id="dialog_est_insertfield" onclick="insertestfield();" data-lgid="P_WO_ADD" style="width: 35px; height: auto; margin-left: 5px;" tabindex="1" /> - <br /> - <textarea id="dialog_est_textmsg" tabindex="1" style="width: 320px; height: 120px; margin-top: 6px;" maxlength="2000"></textarea></td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="pubestpopus-close" tabindex="1" style="height: 26px;" /> - <input type="button" onclick="onPublishEstimate();" value="Publish" data-lgid="P_WO_PUBLISH" tabindex="1" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - <div id="popup_publish_invoice_mask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_publish_invoice" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_PUBLISH_INVOICE">Publish Invoice</span><em class="publish-invoice-popup-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"> - <tr> - <td style="text-align: right;"> - <input id="dialog_invoice_chksendtextmsg" type="checkbox" checked="checked" style="width: unset;" /></td> - <td style="text-align: left;"> - <label for="dialog_invoice_chksendtextmsg" data-lgid="P_WO_SENDUPDATETOCUSTOMER" style="user-select: none;">Send Update To Customer</label></td> - </tr> - <tr> - <td> - <div style="font-size: 20px; margin-right: 5px; float: right;"><em class="spanbtn iconmobile" style="font-weight: 900; font-size: 14px; cursor: default; padding-left: 0; padding-right: 3px; padding-top: 0;"></em></div> - </td> - <td> - <input type="text" id="dialog_invoice_phonenum" tabindex="1" autocomplete="off" maxlength="100" style="width: 320px;" /> - </td> - </tr> - <tr> - <td style="text-align: right;"> - <input id="dialog_invoice_chkIncludeStatusLink" type="checkbox" checked="checked" style="width: unset;" /></td> - <td style="text-align: left;"> - <label for="dialog_invoice_chkIncludeStatusLink" data-lgid="P_WO_INCLUDESTATUSLINK" style="user-select: none;">Include Status Link</label></td> - </tr> - <tr> - <td class="label" style="width: unset;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td> - <td> - <select id="dialog_invoice_variables" style="width: 156px;"> - <option value="0">[Site_Name]</option> - <option value="1">[Location]</option> - <option value="13">[Asset]</option> - <option value="4">[VIN]</option> - <option value="2">[Make]</option> - <option value="3">[Model]</option> - <option value="5">[Id_Phone]</option> - <option value="6">[Advisor]</option> - <option value="7">[Company_Name]</option> - <option value="8">[Contact_Name]</option> - <option value="9">[Contact_First_Name]</option> - <option value="10">[Status_Link]</option> - <option value="11">[Technician_Name]</option> - <option value="12">[Work_Order_Number]</option> - <option value="13">[Parts_Order_Number]</option> - </select> - <input type="button" id="dialog_invoice_insertfield" onclick="insertinvoicefield();" data-lgid="P_WO_ADD" style="width: 35px; height: auto; margin-left: 5px;" tabindex="1" /> - <br /> - <textarea id="dialog_invoice_textmsg" tabindex="1" style="width: 320px; height: 120px; margin-top: 6px;" maxlength="2000"></textarea></td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="publish-invoice-popup-close" tabindex="1" style="height: 26px;" /> - <input type="button" onclick="onPublishInvoice();" value="Publish" data-lgid="P_WO_PUBLISH" tabindex="1" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - <div id="popupewoestattachmentmask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_woestattachment" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_ADDATTACHMENT">Add Attachment</span><em class="woestattpopus-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"> - <tr> - <td class="label" style="width: unset;"><span data-lgid="P_WO_CAPTION_COLON">Caption:</span></td> - <td> - <input type="text" id="dialog_estatt_notes" class="inputbox" maxlength="200" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top; width: unset;">Attachments:</td> - <td> - <input id="dialog_woestatt_uploadattfile" type="button" value="Add File..." data-lgid="P_FR_ADDFILE" onclick="UpLoadEstimateAttachment()" tabindex="1" style="background-color: #0099FF; color: #FFFFFF; height: 20px; width: 200px;" /></td> - </tr> - <tr> - <td></td> - <td> - <table id="tab_woest_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 320px; display: none;"> - <tr> - <td> - <div class="content_main" style="max-height: 80px; overflow: auto;"> - <table id="tab_woest_atts" style="table-layout: fixed;"></table> - </div> - </td> - </tr> - </table> - </td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="woestattpopus-close" tabindex="1" style="height: 26px;" /> - <input type="button" id="btn_woestattasave" onclick="onSaveWOEstAttachment();" value="Save" data-lgid="P_WO_SAVE" tabindex="1" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - - <div id="popup_woinvoice_attachment_mask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_woinvoice_attachment" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_ADDATTACHMENT">Add Attachment</span><em class="woinvoiceattpopus-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"> - <tr> - <td class="label" style="width: unset;"><span data-lgid="P_WO_CAPTION_COLON">Caption:</span></td> - <td> - <input type="text" id="dialog_invoice_att_notes" class="inputbox" maxlength="200" tabindex="1" autocomplete="off" /></td> - </tr> - <tr> - <td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top; width: unset;">Attachments:</td> - <td> - <input id="dialog_woinvoiceatt_uploadattfile" type="button" value="Add File..." data-lgid="P_FR_ADDFILE" onclick="UpLoadInvoiceAttachment()" tabindex="1" style="background-color: #0099FF; color: #FFFFFF; height: 20px; width: 200px;" /></td> - </tr> - <tr> - <td></td> - <td> - <table id="tab_woinvoice_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 320px; display: none;"> - <tr> - <td> - <div class="content_main" style="max-height: 80px; overflow: auto;"> - <table id="tab_woinvoice_atts" style="table-layout: fixed;"></table> - </div> - </td> - </tr> - </table> - </td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="woinvoiceattpopus-close" tabindex="1" style="height: 26px;" /> - <input type="button" id="btn_woinvoice_att_save" onclick="onSaveWOInvoiceAttachment();" value="Save" data-lgid="P_WO_SAVE" tabindex="1" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - <div id="popup_woinvoice_markpaid_mask" class="maskbg" style="display: none;"></div> - <div class="dialog" id="dialog_woinvoice_markpaid" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_XXX">Mark as Paid</span><em class="woinvoicemarkpaidpopus-close"></em></div> - <div class="dialog-content"> - <table style="line-height: 40px; margin-left: 10px; margin-right: 10px;"> - <tr> - <td class="label"><span data-lgid="P_WO_XXXXXX">Payment By:</span></td> - <td> - <select id="dialog_invoice_markpaid_paymentby" style="width: 320px; height: 24px;"> - <option value="Credit Card">Credit Card</option> - <option value="Check">Check</option> - <option value="Cash">Cash</option> - </select> - </td> - </tr> - <tr> - <td class="label"><span data-lgid="P_WO_XXX">Check #:</span></td> - <td> - <input type="text" id="dialog_invoice_markpaid_number" class="inputbox" maxlength="200" tabindex="1" autocomplete="off" /></td> - </tr> - </table> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="woinvoicemarkpaidpopus-close" tabindex="1" style="height: 26px;" /> - <input type="button" id="btn_woinvoice_maikpaid_save" onclick="OnMarkAsPaid();" value="OK" data-lgid="P_WO_OK" tabindex="1" /> - <div style="clear: both;"></div> - </div> - <div class="maskbg" style="display: none;"></div> - </div> - - <div id="popupecompletedstatusmask" class="maskbg" style="display: none;"></div> <div class="dialog" id="dialog_completedstatus" style="display: none;"> - <div class="dialog-title"><span class="title" id="sptitle_completedstatus" data-lgid="P_WO_ADDWORKORDER">Add Work Order</span><em class="compstatuspopus-close"></em></div> + <div class="dialog-title"><span class="title" id="sptitle_completedstatus" data-lgid="P_WO_ADDWORKORDER">Add Work Order</span><em class="dialog-close"></em></div> <div class="dialog-content"> <table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"> <tr> @@ -4496,32 +2735,19 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="compstatuspopus-close" tabindex="1" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="1" style="height: unset;" /> <input type="button" onclick="onSaveCompletedStatus();" value="OK" data-lgid="P_WO_OK" tabindex="1" /> <div style="clear: both;"></div> </div> <div class="maskbg" style="display: none;"></div> </div> - <div class="dialog" id="dialog_panddattachments" style="display: none;"> - <div class="dialog-title"><span class="title" data-lgid="P_WO_ATTACHMENTS">Attachments</span><em class="dialog-close"></em></div> - <div class="dialog-content"> - <div id="dialog_wopanddattachmentlist" style="height: 320px;"></div> - </div> - <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="1" style="height: 26px;" /> - <input type="button" id="btnPrintWOAttachments" onclick="printWOAttachments();" value="Print" data-lgid="P_WO_PRINT" tabindex="1" /> - <input type="button" id="btnDownloadWOAttachments" onclick="downloadWOAttachments();" value="Download" data-lgid="P_WO_DOWNLOAD" tabindex="1" /> - <div style="clear: both;"></div> - </div> - </div> - <div class="dialog" id="dialog_statuschange" style="display: none;"> <div class="dialog-title"><span class="title" data-lgid="P_WO_STATUSCHANGE">Status Change</span><em class="dialog-close"></em></div> <div class="dialog-content"> <table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"> <tr> - <td style="text-align: right;"> + <td style="text-align: right; width:120px;"> <input id="dialog_chksendtextmsg" type="checkbox" style="width: unset;" /></td> <td style="text-align: left;"> <label for="dialog_chksendtextmsg" data-lgid="P_WO_SENDUPDATETOCUSTOMER" style="user-select: none;">Send Update To Customer</label></td> @@ -4541,7 +2767,7 @@ <label for="dialog_chkIncludeStatusLink" data-lgid="P_WO_INCLUDESTATUSLINK" style="user-select: none;">Include Status Link</label></td> </tr> <tr> - <td class="label"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td> + <td class="label" style="width:120px;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td> <td> <select id="dialog_variables" style="width: 156px;"> <option value="0">[Site_Name]</option> @@ -4574,9 +2800,9 @@ <div class="maskbg" style="display: none;"></div> </div> - <div id="dialogattmask" class="maskbg" style="display: none; z-index: 500;"> + <div id="dialogattmask" class="maskbg" style="display: none;"> <%-- 放到最后--%> - <div class="loading_icon c-spin"></div> + <div class="loading c-spin"></div> <lable class="lable_attuploadname"></lable> </div> </asp:Content> diff --git a/Site/Maintenance/AlertAutomationManagement.aspx b/Site/Maintenance/AlertAutomationManagement.aspx index 2824d60..af8378e 100644 --- a/Site/Maintenance/AlertAutomationManagement.aspx +++ b/Site/Maintenance/AlertAutomationManagement.aspx @@ -164,7 +164,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'Value', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'Value', css: { 'width': 300, 'text-align': 'left' } } ]; var columns = []; @@ -470,7 +470,7 @@ $('#dialog_desc').val(""); $('#dialog_wogenerator .dialog-title span.title').text(alerttitle); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_wogenerator') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_wogenerator').height()) / 3, @@ -505,7 +505,7 @@ } $('#dialog_wogenerator .dialog-title span.title').text(GetTextByKey("P_AM_EDITWORKORDERGENERATOR", 'Edit Work Order Generator')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_wogenerator') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_wogenerator').height()) / 3, @@ -776,7 +776,7 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="onSaveWorkOrderGenerator();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div style="clear: both;"></div> </div> diff --git a/Site/Maintenance/AlertsManagement.aspx b/Site/Maintenance/AlertsManagement.aspx index 915fd67..aab19cf 100644 --- a/Site/Maintenance/AlertsManagement.aspx +++ b/Site/Maintenance/AlertsManagement.aspx @@ -123,6 +123,11 @@ content: '\f56e'; } + .exit:before { + font-family: CalciteWebCoreIcons, FontAwesome; + content: '\f08b'; + } + #div_autoacknowledgelist input[type="checkbox"] { width: unset; } @@ -829,7 +834,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'WorkOrderID', caption: GetTextByKey("P_AM_WORKORDERID", "Work Order ID"), valueIndex: 'WorkOrderID', css: { 'width': 120, 'text-align': 'left' } }, { name: 'WorkOrderStatus', caption: GetTextByKey("P_AM_WORKORDERSTATUS", "Work Order Status"), valueIndex: 'WorkOrderStatus', allowFilter: true, css: { 'width': 140, 'text-align': 'left' } }, { name: 'MachineName', caption: GetTextByKey("P_AM_ASSETNAME", "Asset Name"), valueIndex: 'MachineName', css: { 'width': 180, 'text-align': 'left' } }, @@ -1225,7 +1230,11 @@ <div id="recordcontent" style="padding: 0px; margin: 0px;"> <div class="page_title"> <span data-lgid="P_ALERTSMANAGEMENT">Alerts Management</span> - <span id="spExport" class="export" style="float: right; font-size: 14px; margin-right: 10px; cursor: pointer;" onclick="OnExport();"> + + <span class="exit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>;float: right; font-size: 14px; margin-right: 10px; cursor: pointer;"> + <label data-lgid="P_WO_EXIT" style="padding-left: 2px;">Exit</label> + </span> + <span id="spExport" class="export" style="float: right; font-size: 14px;margin-right: 10px; cursor: pointer;" onclick="OnExport();"> <label data-lgid="P_AM_EXPORT" style="padding-left: 2px;">Export</label> </span> <span class="autoacknowledge" style="<%=InDialog?"display:none;": ""%>; float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="openOpenAutoAcknowled();"> @@ -1278,7 +1287,6 @@ <span class="sbutton iconadd" id="btnassignworkorder" onclick="AssignedWorkOrder();" data-lgid="P_AM_CREATEWORKORDER">Create Work Order</span> <span class="sbutton iconrefresh" onclick="GetAlerts();" data-lgid="P_AM_REFRESH">Refresh</span> <span class="sbutton iconexpand" id="btnExpandAll" onclick="ExpandAll(this);" data-lgid="P_AM_EXPANDALL">Expand All</span> - <span class="sbutton iconexit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>" data-lgid="P_WO_EXIT">Exit</span> </div> <div class="clear"></div> <div id="alertviewlist" style="min-width: 1280px;"></div> @@ -1328,7 +1336,7 @@ <tr> <td class="label" data-lgid="P_AM_COMMENT_COLON">Comment:</td> <td> - <textarea id="dialog_acknowledgmentcomment" class="inputbox" maxlength="1000" tabindex="1" style="width: 400px; height: 120px;"></textarea> + <textarea id="dialog_acknowledgmentcomment" maxlength="1000" tabindex="1" style="width: 400px; height: 120px;"></textarea> </td> </tr> </table> diff --git a/Site/Maintenance/AutoAcknowledChangeHistory.aspx b/Site/Maintenance/AutoAcknowledChangeHistory.aspx index 4529cd4..e4dcd09 100644 --- a/Site/Maintenance/AutoAcknowledChangeHistory.aspx +++ b/Site/Maintenance/AutoAcknowledChangeHistory.aspx @@ -144,6 +144,9 @@ } $(function () { + if (!canExport) { + $('#spExport').hide(); + } InitGridData(); OnRefresh(); @@ -162,7 +165,7 @@ </div> <div class="function_title"> <span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_AM_REFRESH">Refresh</span> - <span class="sbutton iconexport" onclick="OnExport();" data-lgid="P_AM_EXPORT">Export to Excel</span> + <span id="spExport" class="sbutton iconexport" onclick="OnExport();" data-lgid="P_AM_EXPORT">Export to Excel</span> </div> <div class="clear"></div> <div id="autoacknowledgelist"></div> diff --git a/Site/Maintenance/CustomerRecordManagement.aspx b/Site/Maintenance/CustomerRecordManagement.aspx index 963591f..0842653 100644 --- a/Site/Maintenance/CustomerRecordManagement.aspx +++ b/Site/Maintenance/CustomerRecordManagement.aspx @@ -71,18 +71,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } diff --git a/Site/Maintenance/FuelRecordManagement.aspx b/Site/Maintenance/FuelRecordManagement.aspx index 754945a..e3a4dbd 100644 --- a/Site/Maintenance/FuelRecordManagement.aspx +++ b/Site/Maintenance/FuelRecordManagement.aspx @@ -47,6 +47,11 @@ text-decoration: none; color: #2140fb; } + + .exit:before { + font-family: CalciteWebCoreIcons, FontAwesome; + content: '\f08b'; + } </style> <script src="../js/jquery.datetimepicker.full.js"></script> <script src="<%=GetFileUrlWithVersion("js/inputdatactr.js")%>" type="text/javascript"></script> @@ -67,7 +72,7 @@ showmaskbg(false, true); showAlert(GetTextByKey('P_FR_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_FR_QUERY', 'Query')); }); - } + } function enterKeydown(e) { if (e.keyCode == 13) { @@ -359,7 +364,12 @@ </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div id="recordcontent" style="padding: 0px; margin: 0px;"> - <div class="page_title" data-lgid="P_FUELRECORDS">Fuel Records</div> + <div class="page_title"> + <span data-lgid="P_FUELRECORDS">Fuel Records</span> + <span class="exit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>; float: right; font-size: 14px; margin-right: 10px; cursor: pointer;"> + <label data-lgid="P_WO_EXIT" style="padding-left: 2px;">Exit</label> + </span> + </div> <div class="search_bar"> <input type="password" autocomplete="new-password" style="display: none" /> <span data-lgid="P_FR_BEGINDATE_COLON">Begin Date: </span> @@ -377,7 +387,6 @@ <span class="sbutton iconedit" onclick="OnEdit();" style="<%=InDialog?"display:none;": ""%>;" data-lgid="P_FR_EDIT">Edit</span> <span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_FR_REFRESH">Refresh</span> <span id="spExport" class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span> - <span class="sbutton iconexit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>;" data-lgid="P_WO_EXIT">Exit</span> </div> <div class="clear"></div> <div id="recordlist"></div> diff --git a/Site/Maintenance/MachineMaintenanceInfo.aspx b/Site/Maintenance/MachineMaintenanceInfo.aspx index ff8d2fa..050a98b 100644 --- a/Site/Maintenance/MachineMaintenanceInfo.aspx +++ b/Site/Maintenance/MachineMaintenanceInfo.aspx @@ -435,7 +435,6 @@ GetRecordesbymachineID(); } } - $('#mask_bg').css('height', $(document).height()) }, error: function (msg) { showAlert(msg.statusText, GetTextByKey("P_MRM_ERROR", 'Error')); diff --git a/Site/Maintenance/MaintenanceBase.master b/Site/Maintenance/MaintenanceBase.master index 814878b..505e86d 100644 --- a/Site/Maintenance/MaintenanceBase.master +++ b/Site/Maintenance/MaintenanceBase.master @@ -93,8 +93,6 @@ $('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4); if ($('#listDiv').length > 0) $('#listDiv').css('min-height', $(window).height() - $('#listDiv').offset().top - 4); - - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); } $(window).resize(function () { diff --git a/Site/Maintenance/MaintenanceSchedulesManagement.aspx b/Site/Maintenance/MaintenanceSchedulesManagement.aspx index 672f371..3078d3a 100644 --- a/Site/Maintenance/MaintenanceSchedulesManagement.aspx +++ b/Site/Maintenance/MaintenanceSchedulesManagement.aspx @@ -355,24 +355,24 @@ </div> <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> </div> - <div class="dialog" id="dialog_interval" style="display: none; z-index: 500;"> + <div class="dialog" id="dialog_interval" style="display: none; "> <div class="dialog-title"><span class="title" data-lgid="P_PM_ADDABSOLUTEHOURSINTERVAL">Add Absolute Hours Interval</span><em class="dialog-close"></em></div> <div class="dialog-content"> <table class="dialog_table"> <tr> <td class="label" data-lgid="P_PM_SERVICENAME_COLON">Service Name:</td> <td> - <input type="text" class="inputbox intervalinput" id="dig_name" tabindex="1" maxlength="50" /></td> + <input type="text" class="intervalinput" id="dig_name" tabindex="1" maxlength="50" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_INTERVAL_COLON">Interval:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput" id="dig_interval" tabindex="2" maxlength="10" /></td> + <input type="text" class="intervalinput" id="dig_interval" tabindex="2" maxlength="10" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_NOTIFICATIONPERIOD_COLON">Notification Period:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput" id="dig_period" tabindex="3" maxlength="10" /></td> + <input type="text" class="intervalinput" id="dig_period" tabindex="3" maxlength="10" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_RECURRING_COLON">Recurring:</td> @@ -387,12 +387,12 @@ <tr> <td class="label" data-lgid="P_PM_EXPECTEDCOST_COLON">Expected Cost:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput inp_expectedcost" id="dig_expectedcost" tabindex="5" maxlength="12" /></td> + <input type="text" class="intervalinput inp_expectedcost" id="dig_expectedcost" tabindex="5" maxlength="12" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_PRIORITY_COLON">Priority:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput inp_priority" id="dig_priority" tabindex="6" maxlength="5" /></td> + <input type="text" class="intervalinput inp_priority" id="dig_priority" tabindex="6" maxlength="5" /></td> </tr> </table> </div> diff --git a/Site/Maintenance/ScheduleDetail.aspx b/Site/Maintenance/ScheduleDetail.aspx index e414ca4..18a7620 100644 --- a/Site/Maintenance/ScheduleDetail.aspx +++ b/Site/Maintenance/ScheduleDetail.aspx @@ -407,24 +407,24 @@ </div> <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> </div> - <div class="dialog" id="dialog_interval" style="display: none; z-index: 500;"> + <div class="dialog" id="dialog_interval" style="display: none;"> <div class="dialog-title"><span class="title" data-lgid="P_PM_ADDINTERVAL">Add Interval</span><em class="dialog-close"></em></div> <div class="dialog-content"> <table class="dialog_table"> <tr> <td class="label" data-lgid="P_PM_SERVICENAME_COLON">Service Name:</td> <td> - <input type="text" class="inputbox intervalinput" id="dig_name" tabindex="1" maxlength="50" autocomplete="off" /></td> + <input type="text" class="intervalinput" id="dig_name" tabindex="1" maxlength="50" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_INTERVAL_COLON">Interval:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput" id="dig_interval" tabindex="2" maxlength="10" autocomplete="off" /></td> + <input type="text" class="intervalinput" id="dig_interval" tabindex="2" maxlength="10" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_NOTIFICATIONPERIOD_COLON">Notification Period:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput" id="dig_period" tabindex="3" maxlength="10" autocomplete="off" /></td> + <input type="text" class="intervalinput" id="dig_period" tabindex="3" maxlength="10" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_RECURRING_COLON">Recurring:</td> @@ -439,12 +439,12 @@ <tr> <td class="label" data-lgid="P_PM_EXPECTEDCOST_COLON">Expected Cost:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput inp_expectedcost" id="dig_expectedcost" tabindex="5" maxlength="12" autocomplete="off" /></td> + <input type="text" class="intervalinput inp_expectedcost" id="dig_expectedcost" tabindex="5" maxlength="12" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_PM_PRIORITY_COLON">Priority:<b class="red">*</b></td> <td> - <input type="text" class="inputbox intervalinput inp_priority" id="dig_priority" tabindex="7" maxlength="5" autocomplete="off" /></td> + <input type="text" class="intervalinput inp_priority" id="dig_priority" tabindex="7" maxlength="5" autocomplete="off" /></td> </tr> </table> </div> diff --git a/Site/Maintenance/SurveyAutomationManagement.aspx b/Site/Maintenance/SurveyAutomationManagement.aspx index 656552c..c15047b 100644 --- a/Site/Maintenance/SurveyAutomationManagement.aspx +++ b/Site/Maintenance/SurveyAutomationManagement.aspx @@ -496,7 +496,7 @@ </div> </div> - <div id="mask_bg" style="display: none; z-index: 500"> + <div id="mask_bg" style="display: none;"> <div class="loading c-spin"></div> </div> </asp:Content> diff --git a/Site/Maintenance/SurveyDetail.aspx b/Site/Maintenance/SurveyDetail.aspx index 6360a82..8407646 100644 --- a/Site/Maintenance/SurveyDetail.aspx +++ b/Site/Maintenance/SurveyDetail.aspx @@ -186,14 +186,6 @@ GetWorkOrderSurveyResult(); } - function showLoading() { - $("#dialogmask").show(); - } - - function hideLoading() { - $("#dialogmask").hide(); - } - $(function () { vm = new Vue({ el: '#divresult', @@ -224,11 +216,7 @@ </script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> - <div id="mask_bg" style="display: none; z-index: 500"><div class="loading c-spin"></div></div> <div> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 500;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="function_title"> <span class="sbutton icondelete" onclick="OnExit(0);" style="margin-left: 756px; font-size: 16px;"></span> </div> @@ -256,4 +244,5 @@ </div> </div> </div> + <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> </asp:Content> diff --git a/Site/Maintenance/SurveyManagement.aspx b/Site/Maintenance/SurveyManagement.aspx index 3e188b1..6960016 100644 --- a/Site/Maintenance/SurveyManagement.aspx +++ b/Site/Maintenance/SurveyManagement.aspx @@ -71,18 +71,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } @@ -250,7 +238,7 @@ reset: GetTextByKey("P_GRID_RESET", "Reset") }; var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, { name: 'WorkOrderNumber', caption: GetTextByKey("P_WO_WORKORDERNUMBER", "Work Order Number"), valueIndex: 'WorkOrderNumber', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } }, { name: 'SurveyName', caption: GetTextByKey("P_WOS_SURVEYNAME", "Survey Name"), valueIndex: 'SurveyName', css: { 'width': 150, 'text-align': 'left' } }, { name: 'Status', caption: GetTextByKey("P_WO_STATUS", "Status"), valueIndex: 'Status', allowFilter: true, css: { 'width': 160, 'text-align': 'left' } }, diff --git a/Site/Maintenance/SurveyTemplateManagement.aspx b/Site/Maintenance/SurveyTemplateManagement.aspx index d2d5da8..f60b6e0 100644 --- a/Site/Maintenance/SurveyTemplateManagement.aspx +++ b/Site/Maintenance/SurveyTemplateManagement.aspx @@ -71,18 +71,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } diff --git a/Site/Maintenance/SurveyTemplatePrint.aspx b/Site/Maintenance/SurveyTemplatePrint.aspx index 292e178..63f132b 100644 --- a/Site/Maintenance/SurveyTemplatePrint.aspx +++ b/Site/Maintenance/SurveyTemplatePrint.aspx @@ -71,18 +71,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } diff --git a/Site/Maintenance/SurveyTemplateReport.aspx b/Site/Maintenance/SurveyTemplateReport.aspx index d4f57dd..142204e 100644 --- a/Site/Maintenance/SurveyTemplateReport.aspx +++ b/Site/Maintenance/SurveyTemplateReport.aspx @@ -71,18 +71,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } @@ -725,7 +713,7 @@ } $(document.body).css('overflow', 'hidden'); getContacts(); - + showmaskbg(true); $('#sendemailpopupmask').css('height', $('#dialog_workorder').height()); $('#sendemailpopupmask').css('min-width', $('#divcontent').width()); $('#sendemailpopupmask').show(); @@ -737,6 +725,7 @@ } function hideSendEmailPopup() { + showmaskbg(false); $('#sendemailpopupmask').hide(); $('#sendemailpopupdialog').hide(); $(document.body).css('overflow', ''); diff --git a/Site/Maintenance/WorkOrderHistory.aspx b/Site/Maintenance/WorkOrderHistory.aspx index 276e0bb..03b4ecd 100644 --- a/Site/Maintenance/WorkOrderHistory.aspx +++ b/Site/Maintenance/WorkOrderHistory.aspx @@ -72,18 +72,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } diff --git a/Site/Maintenance/WorkOrderMaintenance.aspx b/Site/Maintenance/WorkOrderMaintenance.aspx index e3a8e2a..7b8b8f3 100644 --- a/Site/Maintenance/WorkOrderMaintenance.aspx +++ b/Site/Maintenance/WorkOrderMaintenance.aspx @@ -1,6 +1,7 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="WorkOrderMaintenance.aspx.cs" Inherits="Maintenance_WorkOrderMaintenance" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> + <link href="<%=GetFileUrlWithVersion("css/maintenance.css")%>" rel="stylesheet" /> <style type="text/css"> ::-ms-clear, ::-ms-reveal { display: none; @@ -31,31 +32,6 @@ height: 60px; } - .dialog-content table td.label { - width: unset; - text-align: right; - padding-right: 10px; - line-height: 24px; - height: 24px; - vertical-align: middle; - } - - .dialog-content table td input, - .dialog-content table td textarea { - width: 300px; - border: 1px solid #a9a9a9; - height: 18px; - padding: 1px; - } - - .dialog-content table td select { - width: 403px; - } - - .dialog-content table td input[type="checkbox"] { - border: none; - } - #dialogdatatb td { padding-top: 30px; } @@ -130,6 +106,66 @@ overflow: unset; text-overflow: unset; } + + .ui-popup-mask .ui-popup-container .ui-popup-body .class-content { + overflow: auto; + height: 100%; + } + + .ui-popup-mask .ui-popup-container .ui-popup-body .class-content > .comm { + border: none; + height: 100%; + margin-left: 0; + width: initial; + } + + .ui-popup-mask .ui-popup-container .ui-popup-body .class-content > .comm .title-bar { + display: none; + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label { + flex: 0 0 auto; + margin: 0 4px; + box-sizing: border-box; + cursor: pointer; + width: 30px; + height: 30px; + background-color: #fff; + border-radius: 15px; + display: flex; + align-items: center; + justify-content: center; + transition: background-color .2s + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label > svg { + fill: #333; + width: 14px; + height: 14px; + transition: opacity .2s + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label:hover { + background-color: rgba(255, 255, 255, .6) + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label:hover > svg { + opacity: .6 + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label.disabled { + cursor: default; + opacity: .6 + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label.disabled:hover { + background-color: #fff + } + + .ui-popup-mask .ui-popup-container .ui-popup-header > label.disabled:hover > svg { + opacity: 1; + opacity: initial + } </style> <link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" /> @@ -146,6 +182,9 @@ <script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("../js/gridlayout.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("js/manageworkorder.js")%>" type="text/javascript"></script> + <script src="<%=GetFileUrlWithVersion("js/workordersendemail.js")%>" type="text/javascript"></script> + <script src="<%=GetFileUrlWithVersion("js/workordertabitems.js")%>" type="text/javascript"></script> + <script src="<%=GetFileUrlWithVersion("js/workorderwidgets.js")%>" type="text/javascript"></script> <script type="text/javascript"> var workOrders = []; var workOrderStatus = []; @@ -157,17 +196,42 @@ var assetid = "<%=AssetID %>"; var gridLayoutID = "WorkOrder"; var IsCustomerRecordAllow = <%=IsCustomerRecordAllow ?"true":"false"%>; - var HasCustomerRecord = <%=HasCustomerRecord ?"true":"false"%>; var IsAdmin =<%=IsAdmin ?"true":"false"%>; var IsAdvisor =<%=IsAdvisor ?"true":"false"%>; var AllowReopenWorkorders = <%=AllowReopenWorkorders ?"true":"false"%>; var AllowWorkOrderSurveys = <%=AllowWorkOrderSurveys ?"true":"false"%>; var AllowCommunicate =<%=AllowCommunicate ?"true":"false"%>; + var AllowInspection =<%=AllowInspection ?"true":"false"%>; + var AllowCustomer =<%=AllowCustomer ?"true":"false"%>; var WOReadOnly = <%=WOReadOnly ?"true":"false"%>; + var CRReadOnly =<%=CRReadOnly ?"true":"false"%>; var COMMReadOnly = <%=COMMReadOnly ?"true":"false"%>; + var AllowReassignWorkorders = <%=AllowReassignWorkorders ?"true":"false"%>; + var AllowDeleteAtta = <%=AllowDeleteAtta ?"true":"false"%>; + var WorkorderParams = {}; + + var wowidgetobj = null; + var widgetdata = []; + if (AllowCommunicate) { + widgetdata.push({ Values: { Category: 'WorkOrder', WidgetId: 'CustomerCommunication', WidgetName: GetTextByKey('P_WO_CUSTOMERCOMMUNICATION', 'Customer Communication'), Visible: false } }); + } + widgetdata.push({ Values: { Category: 'WorkOrder', WidgetId: 'InternalComments', WidgetName: GetTextByKey('P_WO_INTERNALCOMMENTS', 'Internal Comments'), Visible: false } }, + { Values: { Category: 'WorkOrder', WidgetId: 'Alerts', WidgetName: GetTextByKey('P_WO_ALERTS', 'Alerts'), Visible: false } }, + { Values: { Category: 'WorkOrder', WidgetId: 'Segments', WidgetName: GetTextByKey('P_WO_SEGMENTS', 'Segments'), Visible: false } }, + { Values: { Category: 'WorkOrder', WidgetId: 'Attachments', WidgetName: GetTextByKey('P_WO_ATTACHMENTS', 'Attachments'), Visible: false } }); + if (AllowInspection) { + widgetdata.push({ Values: { Category: 'WorkOrder', WidgetId: 'Inspections', WidgetName: GetTextByKey('P_WO_INSPECTIONS', 'Inspections'), Visible: false } }); + } + if (AllowCustomer) { + widgetdata.push( + { Values: { Category: 'WorkOrder', WidgetId: 'Estimates', WidgetName: GetTextByKey('P_WO_ESTIMATES', 'Estimates'), Visible: false } }, + { Values: { Category: 'WorkOrder', WidgetId: 'Invoices', WidgetName: GetTextByKey('P_WO_INVOICES', 'Invoices'), Visible: false } }); + } + var MSGWebSocketURL = "<%=MSGWebSocketURL%>"; var nowDate = new DateFormatter().formatDate(new Date("<%=NowDate %>"), 'm/d/Y'); var currentdate = "<%=NowDate %>"; + const ui = window['lib-ui']; function worequest(method, param, callback, error) { _network.request("Maintenance/WorkOrderMaintenance.aspx", -1, method, param, callback, error || function (e) { @@ -176,6 +240,13 @@ }); } + function crrequest(method, param, callback, error) { + _network.request("Maintenance/AddCustomerRecord.aspx", -1, method, param, callback, error || function (e) { + showmaskbg(false, true); + showAlert(GetTextByKey('P_UM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_UM_QUERY', 'Query')); + }); + } + function alertrequest(method, param, callback, error) { _network.request("Maintenance/AlertsManagement.aspx", -1, method, param, callback, error || function (e) { showmaskbg(false, true); @@ -195,6 +266,17 @@ }); } + function getWorkorderParams() { + worequest("GetWorkorderParams", null, function (data) { + if (!data || typeof (data) === "string") { + return; + } + WorkorderParams = data; + + }, function (err) { + }); + } + function OnDelete() { var index = grid_dt.selectedIndex; if (index < 0) { @@ -893,12 +975,14 @@ var filters = JSON.stringify(p); filters = htmlencode(filters); - setCookie("WorkOrderFilters_" + CID, filters); + setCookie("WorkOrderFilters_" + CID, "1");//filters太长在cookie中会丢失,此处只存标识,filters存在localStorage中 + window.localStorage["WorkOrderFilters_" + CID] = filters; } function getTempFilters() { var p = getCookie("WorkOrderFilters_" + CID); if (!p) return false; + p = window.localStorage["WorkOrderFilters_" + CID]; try { var data = JSON.parse(htmldecode(decodeURIComponent(p))); @@ -925,12 +1009,15 @@ //*********************************End Detault**************************************************// + var dialogWidgets; $(function () { setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true); $('.iconlayout').on('click', function (ev) { CreateLayoutMenus(ev.target, gridLayoutID, grid_dt); return false; }); + + //manageWorkorderCtrl = new $manageWorkorderCtrl(); //manageWorkorderCtrl.Init($("#workorderlist")); InitGridData(); @@ -938,8 +1025,21 @@ InitGridAvailableMachines(); InitGridSelectedMachines(); + dialogWidgets = new $wowidgetselector('dialog_widgets'); + dialogWidgets.onDialogClosed = function () { + showmaskbg(false); + }; + dialogWidgets.onOK = function (source) { + wowidgetobj && wowidgetobj.reloadWidgets(); + }; + + $("#spWdigets").click(function () { + showmaskbg(true); + dialogWidgets.showSelector(); + }); showmaskbg(true); + getWorkorderParams(); //GetContacts(); //GetStatus(); //GetAssetGroups(); @@ -1241,6 +1341,25 @@ } } + var loadingCount = 0; + function showLoading() { + loadingCount++; + if (window.parent && typeof window.parent.onmaskbg == 'function') { + window.parent.onmaskbg(true, true); + } + $("#dialogattmask").show(); + } + + function hideLoading() { + loadingCount--; + if (loadingCount === 0) { + $("#dialogattmask").hide(); + if (window.parent && typeof window.parent.onmaskbg == 'function') { + window.parent.onmaskbg(false, true); + } + } + } + var _websocket; function openmsgwebsocket() { _websocket = new $websocket(MSGWebSocketURL); @@ -1255,6 +1374,8 @@ else if (data.Code == "502")//delete removeWorkOrderItem(data.Message); + wowidgetobj?.onmsgreceived(data); + if ($("#dialog_workorder").is(":visible")) { var fn = document.getElementById("iframeworkorder").contentWindow["onmsgreceived"]; if (fn) @@ -1266,12 +1387,15 @@ </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> - <div id="recordcontent" style="padding: 0px; margin: 0px; min-width: 1600px;"> + <div id="recordcontent" style="padding: 0px; margin: 0px; min-width: 1650px;"> <div class="page_title"> <span data-lgid="P_WORKORDER">Work Order</span> + <span class="sbutton iconexit" style="<%=InDialog?"": "display:none;"%>; float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="OnExit();"> + <label data-lgid="P_WO_EXIT">Exit</label> + </span> <%if (AllowWorkOrderConfiguration) {%> - <span class="sbutton iconcog" style="float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="openWOStatus();"> + <span class="sbutton iconcog" style="float: right; font-size: 14px; cursor: pointer;" onclick="openWOStatus();"> <label data-lgid="P_WO_WORKORDERCONFIGURATION">Work Order Configuration</label></span> <%}%> <div style="clear: both;"></div> </div> @@ -1300,20 +1424,24 @@ <option value="1" data-lgid="P_WO_XXXXXX">Completed Work Orders Only</option> <option value="-1" data-lgid="P_WO_XXXXXX">Active & Completed Work Orders</option> </select> + <span class="sbutton iconsave" onclick="onSaveDefault();" style="margin-left: 8px; padding-right: 0;" data-title-lgid="P_WO_SAVELOCATIONANDDEPARTMENTSEARCH" title="Save Location, Department, Advisor and Order type Search"></span> </div> <div class="function_title"> <span class="sbutton iconadd" onclick="OnAdd();" data-lgid="P_WO_ADD">Add</span> <span class="sbutton iconedit" onclick="OnEdit();" data-lgid="P_WO_EDIT">Edit</span> <span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_WO_REFRESH">Refresh</span> <span id="spExport" class="sbutton iconexport" onclick="OnExport();" data-lgid="P_UTILITY_EXPORTTOEXCEL">Export to Excel</span> - <span class="sbutton iconexit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>" data-lgid="P_WO_EXIT">Exit</span> <span class="sbutton iconlayout iconmenu" data-lgid="P_MR_LAYOUT">Layout</span> <span class="sbutton iconfilter" onclick="OnResetPivots();" data-lgid="P_JS_XXX">Reset Pivots</span> + <span id="spWdigets" class="sbutton iconwidget" data-lgid="P_JS_XXX">Widgets</span> </div> <div class="clear"></div> <div id="workorderlist"></div> + <div id="workorderdetail"></div> + </div> + <div id="mask_bg" style="display: none;"> + <div class="loading c-spin"></div> </div> - <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> <div class="dialog" id="dialog_alerts" style="display: none;"> <div class="dialog-title"><span class="title" data-lgid="P_WO_MANAGEALERTS">Manage Alerts</span><em class="dialog-close"></em></div> @@ -1488,6 +1616,43 @@ </div> </div> + <div class="dialog" id="sendicemailpopupdialog" style="display: none; width: 485px;"> + <div class="dialog-title"><span class="title" data-lgid="P_WO_SENDINTERNALCOMMENTS">Send Internal Comments</span><em class="dialog-close"></em></div> + <div class="dialog-content"> + <table style="line-height: 25px;"> + <tr> + <td data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td> + </tr> + <tr> + <td colspan="2"> + <input type="text" id="sendinternalcomments_search" style="width: 445px; margin-left: 10px;" placeholder="Search" /></td> + </tr> + <tr> + <td> + <div id="iccontactlist" style="height: 240px; width: 440px; margin-left: 10px; margin-right: 10px;"></div> + </td> + </tr> + <tr> + <td data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td> + </tr> + <tr> + <td><span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span> + <input type="text" id="sendic_otheremailaddress" style="width: 332px;" autocomplete="off" /></td> + </tr> + <tr> + <td><span data-lgid="P_WO_PHONENUMBER">Phone Number</span> + <input type="text" id="sendic_phonenumber" style="width: 353px; margin-left: 7px;" autocomplete="off" /> + </td> + </tr> + </table> + </div> + <div class="dialog-func"> + <input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="153" /> + <input type="button" onclick="onSendInternalComments();" value="OK" data-lgid="P_WO_OK" tabindex="152" /> + <div class="clear"></div> + </div> + </div> + <div class="dialog" id="dialog_workorder" style="display: none; height: 100%; border-bottom: 0; border-top: 0;"> <%--<div class="dialog-title"><span class="title">Add Work Order</span></div>--%> <iframe id="iframeworkorder" style="width: 100%; height: 100%; display: block; border: none;"></iframe> @@ -1505,5 +1670,10 @@ <div class="maskbg" style="display: none;"></div> </div> + <div id="dialogattmask" class="maskbg" style="display: none;"> + <%-- 放到最后 Widget中上传WorkOrder附件是使用--%> + <div class="loading c-spin"></div> + <lable class="lable_attuploadname"></lable> + </div> </asp:Content> diff --git a/Site/Maintenance/WorkOrderMaintenance.aspx.cs b/Site/Maintenance/WorkOrderMaintenance.aspx.cs index 30073c9..924384b 100644 --- a/Site/Maintenance/WorkOrderMaintenance.aspx.cs +++ b/Site/Maintenance/WorkOrderMaintenance.aspx.cs @@ -14,14 +14,18 @@ public partial class Maintenance_WorkOrderMaintenance : WorkOrderBasePage public bool InDialog = false; public bool AllowWorkOrderConfiguration = false; public bool IsCustomerRecordAllow = false; - public bool HasCustomerRecord = false; + public bool AllowCustomer = false; public bool AllowReopenWorkorders = false; public bool AllowWorkOrderSurveys = false; protected string MSGWebSocketURL = ""; public string NowDate = ""; public bool WOReadOnly = false; + public bool CRReadOnly = false; public bool COMMReadOnly = false; public bool AllowCommunicate = false; + public bool AllowInspection = false; + public bool AllowReassignWorkorders = false; + public bool AllowDeleteAtta = false; protected string CID = ""; protected void Page_Load(object sender, EventArgs e) { @@ -50,13 +54,19 @@ public partial class Maintenance_WorkOrderMaintenance : WorkOrderBasePage IsCustomerRecordAllow = SystemParams.HasLicense("CustomerRecord"); bool crpermission = CheckRight(SystemParams.CompanyID, Feature.CUSTOMER_RECORD); - HasCustomerRecord = IsCustomerRecordAllow && crpermission; + AllowCustomer = IsCustomerRecordAllow && crpermission; AllowReopenWorkorders = !WOReadOnly && CheckRight(SystemParams.CompanyID, Feature.REOPENWORKORDERS); AllowWorkOrderSurveys = !WOReadOnly && CheckRight(SystemParams.CompanyID, Feature.WORKORDERSURVEYS); + CRReadOnly = WOReadOnly || CheckReadonly(SystemParams.CompanyID, Feature.CUSTOMER_RECORD); COMMReadOnly = WOReadOnly || CheckReadonly(SystemParams.CompanyID, Feature.COMMUNICATEWITHCUSTOMER); AllowCommunicate = CheckRight(SystemParams.CompanyID, Feature.COMMUNICATEWITHCUSTOMER); + license = SystemParams.HasLicense("Inspection"); + AllowInspection = license && CheckRight(SystemParams.CompanyID, Feature.INSPECTION_REPORTS); + AllowReassignWorkorders = !WOReadOnly && CheckRight(SystemParams.CompanyID, Feature.REASSIGN_WORKORDERS); + AllowDeleteAtta = !WOReadOnly && CheckRight(SystemParams.CompanyID, Feature.WORKORDERDELETEATTACHMENT); + AllowCommunicate = IsCustomerRecordAllow && AllowCommunicate; AssetID = Request.Params["mid"] ?? ""; diff --git a/Site/Maintenance/WorkOrderStatusManagement.aspx b/Site/Maintenance/WorkOrderStatusManagement.aspx index 9491d70..6e8afec 100644 --- a/Site/Maintenance/WorkOrderStatusManagement.aspx +++ b/Site/Maintenance/WorkOrderStatusManagement.aspx @@ -386,7 +386,7 @@ $('#dialog_fuvariables').val(''); $('#dialog_status .dialog-title span.title').text(alerttitle); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_status') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_status').height()) / 3, @@ -426,7 +426,7 @@ $('#dialog_fuvariables').val(''); $('#dialog_status .dialog-title span.title').text(GetTextByKey("P_WO_EDITSTATUS", 'Edit Status')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_status') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_status').height()) / 3, @@ -893,9 +893,6 @@ </script> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> - <div id="mask_bg" style="display: none; z-index: 500"> - <div class="loading c-spin"></div> - </div> <div id="div_container"> <ul id="ul_container" class="tab_header"> <li data-href="tab_statussetting" onclick="reshowgrid();" class="selected" data-lgid="P_WO_STATUSSETTING">Status Setting</li> @@ -1086,6 +1083,9 @@ </div> </div> </div> + <div id="mask_bg" style="display: none;"> + <div class="loading c-spin"></div> + </div> <div class="dialog" id="dialog_status" style="display: none;"> <div class="dialog-title"><span class="title" data-lgid="P_WO_ADDSTATUS">Add Status</span><em class="dialog-close"></em></div> @@ -1191,7 +1191,7 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="onSaveStatus();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div style="clear: both;"></div> </div> diff --git a/Site/Maintenance/css/maintenance.css b/Site/Maintenance/css/maintenance.css index 915b8f0..fa6d190 100644 --- a/Site/Maintenance/css/maintenance.css +++ b/Site/Maintenance/css/maintenance.css @@ -2,71 +2,92 @@ cursor: default !important; color: #ccc; } -a.disabled:hover { - text-decoration: none; -} + + a.disabled:hover { + text-decoration: none; + } + .table_intervals { width: 100%; color: #666; border-collapse: collapse; - table-layout:fixed; -} -.table_intervals thead tr { - background: #f9f9f9; - /*font-weight: bold;*/ -} -.table_intervals thead tr:hover { background: #f9f9f9; } -.table_intervals td input { - width: 60px; - border: 1px solid #fff; -} -.table_intervals td input.focused, -.table_intervals td input:hover { - border-color: #666; -} -.table_intervals td input:disabled, -.table_intervals td input:disabled:hover, -.table_intervals tr:hover td input:disabled { - background: #ddd; - color: #ddd; - border-color: #ddd; -} -.table_intervals .editing { display: none; } -.table_intervals .editing input { - width: auto; - cursor: pointer; - background: rgb(249, 189, 117); - margin-left: 6px; - border: none; - padding: 5px 14px; -} -.table_intervals .editing input:hover { background: #d7690E; } - - -.table_intervals td textarea { - border: 1px solid #fff; + table-layout: fixed; } -.table_intervals td textarea.focused, -.table_intervals td textarea:hover { - border-color: #666; -} -.table_intervals td textarea:disabled, -.table_intervals td textarea:disabled:hover, -.table_intervals tr:textarea td input:disabled { - background: #ddd; - color: #ddd; - border-color: #ddd; -} -.table_intervals .editing textarea { - width: auto; - cursor: pointer; - background: rgb(249, 189, 117); - margin-left: 6px; - border: none; - padding: 5px 14px; -} -.table_intervals .editing textarea:hover { background: #d7690E; } + .table_intervals thead tr { + background: #f9f9f9; + /*font-weight: bold;*/ + } + + .table_intervals thead tr:hover { + background: #f9f9f9; + } + + .table_intervals td input { + width: 60px; + border: 1px solid #fff; + } + + .table_intervals td input.focused, + .table_intervals td input:hover { + border-color: #666; + } + + .table_intervals td input:disabled, + .table_intervals td input:disabled:hover, + .table_intervals tr:hover td input:disabled { + background: #ddd; + color: #ddd; + border-color: #ddd; + } + + .table_intervals .editing { + display: none; + } + + .table_intervals .editing input { + width: auto; + cursor: pointer; + background: rgb(249, 189, 117); + margin-left: 6px; + border: none; + padding: 5px 14px; + } + + .table_intervals .editing input:hover { + background: #d7690E; + } + + + .table_intervals td textarea { + border: 1px solid #fff; + } + + .table_intervals td textarea.focused, + .table_intervals td textarea:hover { + border-color: #666; + } + + .table_intervals td textarea:disabled, + .table_intervals td textarea:disabled:hover, + .table_intervals tr:textarea td input:disabled { + background: #ddd; + color: #ddd; + border-color: #ddd; + } + + .table_intervals .editing textarea { + width: auto; + cursor: pointer; + background: rgb(249, 189, 117); + margin-left: 6px; + border: none; + padding: 5px 14px; + } + + .table_intervals .editing textarea:hover { + background: #d7690E; + } @@ -75,39 +96,526 @@ a.disabled:hover { padding: 0; font-weight: normal; } -.maintenance .td_funcs:last-child { - padding-right: 8px; -} -.maintenance .td_funcs a { - white-space: nowrap; - float: left; - cursor: pointer; - margin-left: 20px; -} -.maintenance .td_funcs a:first-child { - margin-left: 2px; -} + + .maintenance .td_funcs:last-child { + padding-right: 8px; + } + + .maintenance .td_funcs a { + white-space: nowrap; + float: left; + cursor: pointer; + margin-left: 20px; + } + + .maintenance .td_funcs a:first-child { + margin-left: 2px; + } + .maintenance .item_name { margin-left: 24px; width: 340px; } + .maintenance .item_type { width: 100px; } + .maintenance .item_desc { max-width: 320px; } + .maintenance .item_desc, .maintenance .item_type, .maintenance .item_name { overflow: hidden; text-overflow: ellipsis; } + .servicedescription { - height:120px; - width:250px; -} -.intervalinput { - width:250px; + height: 120px; + width: 250px; } +.intervalinput { + width: 250px; +} + + +.edit-content table { + border-collapse: collapse; + width: 100%; +} + + .edit-content table td.label { + width: 200px; + text-align: right; + padding-right: 10px; + line-height: 24px; + height: 24px; + vertical-align: middle; + } + + .edit-content table td.cont { + width: 250px; + } + + .edit-content table td input[type="text"], .edit-content table td textarea { + border: 1px solid #a9a9a9; + width: 240px; + height: 28px; + text-indent: 3px; + box-sizing: border-box; + border-radius: 2px; + } + + .edit-content table td input[type="checkbox"] { + border: none; + } + + .edit-content table td textarea { + height: 100px; + resize: none; + /*max-width: 200px;*/ + } + +.tab_estimates table td.label, +.tab_invoices table td.label { + width: 167px; + text-align: right; + padding-right: 10px; + line-height: 24px; + height: 24px; + vertical-align: middle; +} + + +.tab_estimates table td input[type="text"], .tab_estimates table td textarea, +.tab_invoices table td input[type="text"], .tab_invoices table td textarea { + border: 1px solid #a9a9a9; + width: 150px; + height: 28px; + text-indent: 3px; + box-sizing: border-box; + border-radius: 2px; +} + +.estimates_div, +.estimates_table { + min-width: 1300px; +} + +.subtitle { + margin: 20px 40px 5px 0px; + font-size: 16px; + color: gray; +} + + .subtitle span { + margin-left: 10px; + } + + .subtitle hr { + background-color: #d8d8d8; + border: none; + height: 1px; + } + +#host_main { + overflow: hidden; +} + +.tab_segments { + position: relative; +} + + .tab_segments table td.label { + width: 130px; + vertical-align: top; + text-align: right; + } + + .tab_segments table td input, + .tab_segments table td textarea { + border: 1px solid #a9a9a9; + width: 320px; + height: 28px; + text-indent: 3px; + box-sizing: border-box; + border-radius: 2px; + } + + .tab_segments table td select { + width: 324px; + } + + .tab_segments table td input[type="checkbox"] { + border: none; + width: unset; + height: unset; + } + + .tab_segments table td textarea { + height: 100px; + resize: none; + /*max-width: 200px;*/ + } + +.segments_table { + margin-top: 10px; + line-height: 25px; + min-width: 1050px; +} + +.workorder_table { + table-layout: fixed; + line-height: 30px; +} + +.dialog-content table td.label { + width: 120px; + vertical-align: middle; +} + +.dialog-content table td input[type="text"], .dialog-content table td textarea { + width: 320px; + height: 24px; + box-sizing: border-box; + border-radius: 2px; +} + +.dialog-content table { + border-collapse: collapse; + width: 100%; +} + + .dialog-content table td.label { + width: 170px; + text-align: right; + padding-right: 10px; + line-height: 28px; + height: 24px; + vertical-align: top; + } + +.divattp { + width: 300px; + margin-right: 10px; + float: left; + position: relative; +} + +.divatt { + width: 300px; + height: 300px; + margin-top: 5px; + margin-bottom: 5px; + margin-right: 10px; + cursor: pointer; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: rgba(0, 0, 0, 0.4); + text-align: center; + float: left; + position: relative; +} + +.picture { + max-height: 100%; + max-width: 100%; + margin: auto; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + + +.download { + line-height: 300px; + font-size: 200px; + margin: 0 auto; + font-family: 'Fontawesome'; + color: silver; +} + + .download::before { + content: '\f15c'; + } + +.wolist_download { + font-size: 60px; + margin: 0 auto; + font-family: 'Fontawesome'; + color: silver; +} + + .wolist_download::before { + content: '\f15c'; + } + + +.file-word::before { + content: '\f1c2'; +} + +.file-excel::before { + content: '\f1c3'; +} + +.file-ppt::before { + content: '\f1c4'; +} + +.file-pdf::before { + content: '\f1c1'; +} + +.file-video::before { + content: '\f1c8'; +} + +.file-zip::before { + content: '\f1c6'; +} + +.file-msg::before { + content: '\f0e0'; +} + + +.delete { + position: absolute; + vertical-align: top; + font-size: 20px; + font-family: 'Fontawesome'; + color: rgb(123,28,33); + right: 8px; +} + + .delete::before { + content: '\f00d'; + } + +.attadownload { + position: absolute; + vertical-align: top; + font-size: 16px; + font-family: 'Fontawesome'; + color: rgb(123,28,33); + right: 5px; + bottom: 5px; +} + + .attadownload::before { + content: '\f019'; + } + +.attaprint { + position: absolute; + vertical-align: top; + font-size: 16px; + font-family: 'Fontawesome'; + color: rgb(123,28,33); + right: 30px; + bottom: 5px; +} + + .attaprint::before { + content: '\f02f'; + } + +.attaedit { + font-size: 14px; + font-family: 'Fontawesome'; + color: rgb(123,28,33); + padding: 3px; +} + + .attaedit::before { + content: '\f044'; + } + +.attasave { + font-size: 18px; + font-family: 'Fontawesome'; + color: rgb(123,28,33); + margin-left: 3px; +} + + .attasave::before { + content: '\f00c'; + } + + +.dialog .dialog-func input { + width: unset; +} + +.noinspection { + color: #444; + height: 30px; + line-height: 30px; + margin-top: 8px; + padding-left: 10px; + padding-right: 10px; + font-size: 20px; + font-style: italic; +} + +.dropdown { + width: 240px; +} + + .dropdown .dropdown-wrapper { + border-color: #a9a9a9; + } + + .dropdown .dropdown-wrapper > .dropdown-header { + min-height: 26px; + } + + .dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text { + line-height: 26px; + } + +.subtitle .dropdown .dropdown-wrapper > .dropdown-header { + min-height: 24px; +} + + .subtitle .dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text { + line-height: 22px; + height: 22px; + min-height: 22px; + } + +.maintenance { + table-layout: fixed; + border-bottom: none; + width: auto; + min-width: 100%; +} + + .maintenance tr { + border-bottom: 1px solid #e6e6e6; + } + +.main_table .td_intervals { + padding: 0 0 0 60px; +} + +.main_table .tr_intervals { + border-bottom: none; +} + + .main_table .tr_intervals:hover { + background: none; + } + +.icon { + float: left; + font-style: normal; + width: 20px; + font-size: 11px; + height: 16px; + line-height: 16px; +} + +.expand:before { + content: '\e608'; +} + +.collapse:before { + content: '\e607'; +} + +.dialog_table { + width: 100%; +} + + .dialog_table tr { + height: 40px; + } + +.item_name { + width: unset; + font-size: 16px; +} + +.wolist_picture { + width: 60px; + height: 60px; + margin: 0 auto; +} + +.wolist_icon { + font-size: 14px; + font-family: 'Fontawesome'; + color: rgb(123,28,33); + margin-left: 20px; + cursor: pointer; +} + +.wolist_delete::before { + content: '\f00d'; +} + +.wolist_attadownload::before { + content: '\f019'; +} + +.wolist_attaprint::before { + content: '\f02f'; +} + +.divattp input { + width: 60px; + border: 1px solid #fff; +} + + .divattp input.focused, + .divattp input:hover { + border-color: #666; + } + + .divattp input:disabled, + .divattp input:disabled:hover, + .divattp td input:disabled { + background: #ddd; + color: #ddd; + border-color: #ddd; + } + +.inp_name { + height: 24px; +} + +.loading_icon { + font-family: CalciteWebCoreIcons; + cursor: default; + left: 50%; + top: 48%; +} + +.lable_attuploadname { + color: white; + max-height: 800px; + text-align: center; + line-height: 40px; + font-size: 16px; + position: absolute; + left: 50%; + top: 50%; + margin: -50px 0 0 -35px; +} + +/*override*/ +.ui-tooltip-content { + white-space: nowrap !important; + /*min-width: 160px;*/ +} + +#mask_bg, #dialogattmask, .dialog { + z-index: 1000; +} diff --git a/Site/Maintenance/js/addcustomerrecord.js b/Site/Maintenance/js/addcustomerrecord.js index 990d0be..34cfb17 100644 --- a/Site/Maintenance/js/addcustomerrecord.js +++ b/Site/Maintenance/js/addcustomerrecord.js @@ -28,7 +28,7 @@ $(function () { grid_dtassets.setData(grid_dtassets.innerSource.concat(items)); if (ids.length > 0) assignAssets(ids); - $('#mask_bg').hide(); + showmaskbg(false); }; }); @@ -63,7 +63,7 @@ function InitGridSelectedMachines() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -152,7 +152,6 @@ function OnAssetAdd() { return s.Values.ID; }); dialogAUAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } function OnMachineDelete() { @@ -264,7 +263,7 @@ function onOpenSalesperson() { $('#sp_searchinputtxt').val(''); GetSalespersons(); $('#dialog_salesperson .dialog-title span.title').text(alerttitle); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_salesperson') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_salesperson').height()) / 3, diff --git a/Site/Maintenance/js/addworkorder.js b/Site/Maintenance/js/addworkorder.js index 1238c4a..9d4d28b 100644 --- a/Site/Maintenance/js/addworkorder.js +++ b/Site/Maintenance/js/addworkorder.js @@ -1,29 +1,14 @@ $(function () { - InitGridData(); - InitWorkOrderFollowerGridData(); - InitAllFollowerGridData(); getWorkOrderCollapsed(); - $('#dialog_customercontact').dialog(function () { - showmaskbg(false); - }); - - $('#dialog_estimate').dialog(function () { - showmaskbg(false); - }); - - $('#dialog_invoice').dialog(function () { - showmaskbg(false); - }); - - $('#dialog_panddattachments').dialog(function () { - showmaskbg(false); - }); - $('#addfollowerpopupdialog').dialog(function () { showmaskbg(false); }); + $('#dialog_completedstatus').dialog(function () { + showmaskbg(false); + }); + $('#selfollower_search').bind('input propertychange', function () { searchFollower(false); }); @@ -31,10 +16,55 @@ $('#selfollower_search').keydown(function () { searchFollower(false); }); - }); +function getWorkOrderCollapsed() { + worequest("GetWorkOrderCollapsed", '', function (data) { + if (typeof (data) === "string") { + return; + } + if (data) { + for (var i = 0; i < data.length; i++) { + var item = data[i]; + if (item.Value == "1" && $("#span" + item.Key).is(":visible")) { + $("#span" + item.Key).removeClass("iconchevronright").addClass("iconchevrondown"); + $("#tb" + item.Key).show(); + //if ("customer" == item.Key) + // grid_dtcontact && grid_dtcontact.resize(); + //else if ("follower" == item.Key) + // grid_dtfollower && grid_dtfollower.resize(); + } + else { + $("#span" + item.Key).removeClass("iconchevrondown").addClass("iconchevronright"); + $("#tb" + item.Key).hide(); + } + + if (!AllowCustomer && item.Key === "customer") { + $("#tb" + item.Key).hide(); + } + } + } + }, function (err) { + }); +} + +function saveWorkOrderCollapsed() { + var items = []; + items.push({ 'Key': 'asset', 'Value': $("#spanasset").hasClass('iconchevrondown') ? "1" : "0" }); + items.push({ 'Key': 'customer', 'Value': $("#spancustomer").hasClass('iconchevrondown') ? "1" : "0" }); + items.push({ 'Key': 'follower', 'Value': $("#spanfollower").hasClass('iconchevrondown') ? "1" : "0" }); + items.push({ 'Key': 'summary', 'Value': $("#spansummary").hasClass('iconchevrondown') ? "1" : "0" }); + items.push({ 'Key': 'cost', 'Value': $("#spancost").hasClass('iconchevrondown') ? "1" : "0" }); + + var param = JSON.stringify(items); + param = htmlencode(param); + worequest("SetWorkOrderCollapsed", param, function (data) { + }, function (err) { + }); +} + + /*************************Customer********************************/ var customerid; var grid_dtcustomer; @@ -74,12 +104,6 @@ function InitGridCustomers() { OnSetSelectCustomer(); } }; - - //grid_dtcustomer.selectedrowchanged = function (rowindex) { - // var rowdata = grid_dtcustomer.source[rowindex]; - // if (rowdata) { - // } - //} } function showCustomerList(data) { @@ -99,7 +123,7 @@ function onSelectCustomer() { $('#txt_customer_key').attr('disabled', true); $('#chkshowallcust').attr('checked', false); $('#dialog_customer .dialog-title span.title').text(GetTextByKey("P_WO_SELECTCUSTOMER", 'Select Customer')); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_customer') .attr('act', 'edit') .css({ @@ -192,6 +216,7 @@ function setCustomerData(cust) { $('#dialog_salesperson').dropdownVal(cust.SalespersonIID); $('#dialog_custcustomername').text(cust.Name); $('#dialog_custcustomercode').text(cust.Code); + $(".custcode").show(); if (typeof customer !== 'undefined') { customer.companyName = cust.Name; customer.companyCode = cust.Code; @@ -224,334 +249,79 @@ function CloseCustomerDialog(type) { //*************************Contact********************************// -var contact; -var grid_dtcontact; -function InitGridData() { - grid_dtcontact = new GridView('#cusomercontactlist'); - grid_dtcontact.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Name', caption: GetTextByKey("P_CR_CONTACTNAME", "Contact Name"), valueIndex: 'Name', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'ContactEmail', caption: GetTextByKey("P_CR_CONTACTEMAIL", "Contact Email"), valueIndex: 'Email', css: { 'width': 130, 'text-align': 'left' } }, - { name: 'ContactMobilePhone', caption: GetTextByKey("P_CR_CONTACTMOBILE", "Contact Mobile"), valueIndex: 'MobilePhoneDisplayText', css: { 'width': 120, 'text-align': 'left' } }, - { name: 'ContactPreferenceStr', caption: GetTextByKey("P_CR_CONTACTPREFERENCES", "Contact Preferences"), valueIndex: 'ContactPreferenceStr', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'OptOut', caption: GetTextByKey("P_CR_OPTOUT", "Opt Out"), valueIndex: 'OptOut', type: 3, css: { 'width': 60, 'text-align': 'center' } }, - { name: 'Notes', caption: GetTextByKey("P_CR_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } }, - { name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - col.allowFilter = list_columns[hd].allowFilter; - if (list_columns[hd].type) { - col.type = list_columns[hd].type; - } - if (CRReadOnly && (col.name === "Edit" || col.name === "Delete")) { - continue; - } - if (col.name === "Edit") { - col.isurl = true; - col.text = "\uf044"; - col.sortable = false; - col.events = { - onclick: function () { - onEditContact(); - } - }; - col.styleFilter = function (e) { - if (!IsAdmin && workorderdata && workorderdata.Completed) { - return { - display: 'none' - }; - } - } - col.classFilter = function (e) { - return "icon-col"; - } - col.attrs = { 'title': GetTextByKey("P_UM_EDIT", 'Edit') }; - } - else if (col.name === "Delete") { - col.isurl = true; - col.text = "\uf00d"; - col.sortable = false; - col.events = { - onclick: function () { - onDeleteContact(this); - } - }; - col.styleFilter = function (e) { - if (!IsAdmin && workorderdata && workorderdata.Completed) { - return { - display: 'none' - }; - } - } - col.classFilter = function (e) { - return "icon-col"; - }; - col.attrs = { 'title': GetTextByKey("P_UM_DELETE", 'Delete') }; - } - else if (col.name === "OptOut") { - col.enabled = !CRReadOnly; - col.events = { - onchange: function () { - if (typeof customer !== 'undefined') { - customer.contacts = customercontacts; - } - SaveWorkorderContact(); - } - }; - - } - columns.push(col); - } - grid_dtcontact.canMultiSelect = false; - grid_dtcontact.columns = columns; - grid_dtcontact.init(); - if (!CRReadOnly) - grid_dtcontact.rowdblclick = onEditContact; -} - -function getCustomerContacts(custid) { - worequest('GetCustomerContacts', custid, function (data) { +function getWorkOrderContacts(woid) { + worequest('GetWorkOrderContacts', woid, function (data) { if (typeof (data) === "string") { showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); - showcontatcmask(false); + showmaskbg(false); return; } - - if (customercontacts) { - for (var i = 0; i < customercontacts.length; i++) { - customercontacts[i].Id = -1; - customercontacts[i].SaveToCustomer = 0; - } - } - - for (var i = 0; i < data.length; i++) { - var r = data[i]; - var item = { - 'Id': r.Id, - 'Name': r.Name, - 'ContactPreference': r.ContactPreference, - 'ContactPreferenceStr': r.ContactPreferenceStr, - 'Email': r.Email, - 'MobilePhone': r.MobilePhone, - //'Address': r.Address, - 'Notes': r.Notes, - 'OptOut': r.OptOut, - 'OptOut_BC': r.OptOut - }; - var contactexists = false; - for (var j = 0; j < grid_dtcontact.source.length; j++) { - var ct = grid_dtcontact.source[j].Values; - if (ct.Name === item.Name && ct.MobilePhone === item.MobilePhone) { - contactexists = true; - break; - } - } - if (contactexists) { - if (customercontacts) { - for (var j = 0; j < customercontacts.length; j++) { - var ct = customercontacts[j]; - if (ct.Name === item.Name && ct.MobilePhone === item.MobilePhone) { - ct.Id = item.Id; - break; - } - } - } - } - else - customercontacts.push(item); - - } - - SaveWorkorderContact(); + customercontacts = data || []; showCustomerContacts(customercontacts); }, function (err) { }); } -function showCustomerContacts(data) { - customer?.setData('contacts', data); - var rows = []; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - var fr = { Values: r }; - rows.push(fr); - } - - grid_dtcontact.setData(rows); - setPhoneNumber(); - setPhoneNumber_statuschange(); -} - -function onAddContact() { - contact = null; - for (var i = 0; i < grid_dtcontact.source.length; i++) { - grid_dtcontact.source[i].Values.IsCurrent = false; - } - - $('#btn_contactrecord').val(GetTextByKey('P_WO_ADDCONTACTRECORD', 'Add Contact Record')); - if (AllowCustomer && customerid && customerid != -1) - $('#btn_contactrecord').show(); - else - $('#btn_contactrecord').hide(); - - $('#dialog_contactname').val(""); - $('#dialog_contactpreference').dropdownVal('0'); - $('#dialog_emailaddress').val(""); - $('#dialog_mobile').val(""); - //$('#dialog_address').val(""); - $('#dialog_optout').prop('checked', false); - $('#dialog_contactnotes').val(""); - - $('#dialog_customercontact .dialog-title span.title').text(GetTextByKey("P_CR_ADDCONTACT", 'Add Contact')); - $('#mask_bg').show(); - $('#dialog_customercontact') - .css({ - 'top': (document.documentElement.clientHeight - $('#dialog_customercontact').height()) / 3, - 'left': (document.documentElement.clientWidth - $('#dialog_customercontact').width()) / 2 - }).showDialogfixed(); -} - -function onEditContact() { - var index = grid_dtcontact.selectedIndex; - if (index < 0) return; - - $('#btn_contactrecord').val(GetTextByKey('P_WO_EDITCONTACTRECORD', 'Edit Contact Record')); - if (AllowCustomer && customerid && customerid != -1) - $('#btn_contactrecord').show(); - else - $('#btn_contactrecord').hide(); - - for (var i = 0; i < grid_dtcontact.source.length; i++) { - if (index == i) { - grid_dtcontact.source[index].Values.IsCurrent = true; - contact = grid_dtcontact.source[index].Values; - } else - grid_dtcontact.source[i].Values.IsCurrent = false; - } - - $('#dialog_contactname').val(contact.Name); - $('#dialog_contactpreference').dropdownVal(contact.ContactPreference); - $('#dialog_emailaddress').val(contact.Email); - $('#dialog_mobile').val(contact.MobilePhone); - //$('#dialog_address').val(contact.Address); - $('#dialog_optout').prop('checked', contact.OptOut); - $('#dialog_contactnotes').val(contact.Notes); - - $('#dialog_customercontact .dialog-title span.title').text(GetTextByKey("P_CR_EDITCONTACT", 'Edit Contact')); - $('#mask_bg').show(); - $('#dialog_customercontact') - .css({ - 'top': (document.documentElement.clientHeight - $('#dialog_customercontact').height()) / 3, - 'left': (document.documentElement.clientWidth - $('#dialog_customercontact').width()) / 2 - }).showDialogfixed(); -} - -function onSaveContact(type) {//0.work order only;1.contact record - var item = { - 'Name': $.trim($('#dialog_contactname').val()), - 'ContactPreference': $.trim($('#dialog_contactpreference').dropdownVal()), - 'ContactPreferenceStr': $('#dialog_contactpreference').data('dropdown').selected.text, - 'Email': $.trim($('#dialog_emailaddress').val()), - 'MobilePhone': $.trim($('#dialog_mobile').val()), - //'Address': $('#dialog_address').val(), - 'OptOut': $('#dialog_optout').prop('checked'), - 'Notes': $.trim($('#dialog_contactnotes').val()), - 'SaveToCustomer': type - }; - - var alerttitle; - if (contact) { - alerttitle = GetTextByKey("P_CR_EDITCONTACT", "Edit Contact"); - } else { - alerttitle = GetTextByKey("P_CR_ADDCONTACT", "Add Contact"); - } - - if (!item.Name || item.Name.length == 0) { - showAlert(GetTextByKey("P_CR_CONTACTNAMECANNOTBEEMPTY", 'Contact Name cannot be empty.'), alerttitle, undefined, function () { $('#dialog_contactname').focus(); }); - return; - } - if ((!item.Email || item.Email.length == 0) && (!item.MobilePhone || item.MobilePhone.length == 0)) { - showAlert(GetTextByKey("P_CR_EMAILANDMOBILEPHONECANNOTBOTHBEEMPTY", 'Email and Mobile Phone cannot both be empty. '), alerttitle); - return; - } - if (item.Email !== "" && !isEmail(item.Email)) { - showAlert(GetTextByKey("P_CR_EMAILISNOTAVALIDEMAILADDRESS", 'The email address is invalid.'), alerttitle); - return; - } - - var contactexists = false; - for (var i = 0; i < grid_dtcontact.source.length; i++) { - var ct = grid_dtcontact.source[i].Values; - if (!ct.IsCurrent && ct.Name === item.Name && ct.MobilePhone === item.MobilePhone) { - contactexists = true; - break; - } - } - if (contactexists) { - showAlert(GetTextByKey("P_WO_CONTACTNAMEANDMOBILEUNIQUECOMBINATION", 'Contact name and contact mobile must be a unique combination.'), alerttitle); - return; - } - - if (contact) { - contact.Name = $.trim($('#dialog_contactname').val()); - contact.ContactPreference = $.trim($('#dialog_contactpreference').dropdownVal()); - contact.Email = $.trim($('#dialog_emailaddress').val()); - contact.MobilePhone = $.trim($('#dialog_mobile').val()); - //contact.Address = $('#dialog_address').val(); - contact.OptOut = $('#dialog_optout').prop('checked'); - contact.Notes = $.trim($('#dialog_contactnotes').val()); - contact.SaveToCustomer = type; - - if (parseInt(contact.ContactPreference) == 0) - contact.ContactPreferenceStr = GetTextByKey("P_CR_TEXT", "Text"); - else if (parseInt(contact.ContactPreference) == 1) - contact.ContactPreferenceStr = GetTextByKey("P_CR_EMAIL", "Email"); - else if (parseInt(contact.ContactPreference) == 2) - contact.ContactPreferenceStr = GetTextByKey("P_CR_PHONE", "Phone"); - } - else { - item.Id = -1; - customercontacts.push(item); - } - - showmaskbg(false); - $('#dialog_customercontact').hideDialog(); - - SaveWorkorderContact(null, function (data) { - if (typeof data === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); +var contact; +function getCustomerContacts(custid, next) { + worequest('GetCustomerContacts', custid, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); + if (next) + next([]);//next 在Communication选Contacts时传入 + else + showcontatcmask(false); return; } - showCustomerContacts(customercontacts = data); + if (next) { + next(data);//next 在Communication选Contacts时传入 + return; + } + + showCustomerContacts(data); + SaveWorkorderContact(); + }, function (err) { }); - //showCustomerContacts(customercontacts); } -function onDeleteContact(c) { - if (!c) { - return; +function showCustomerContacts(data) { + if (customercontacts) { + var temp = []; + for (var i = 0; i < customercontacts.length; i++) {//移除上一个Customer的Contacts + if (customercontacts[i].Id > 0) continue; + temp.push(customercontacts[i]); + } + customercontacts = temp; } - showConfirm(GetTextByKey("P_CR_DOYOUWANTTODELETETHISCONTACT", 'Do you want to delete this contact?'), GetTextByKey("P_CR_DELETECONTACT", 'Delete Contact'), function () { - var index = customercontacts.indexOf(c); - customercontacts.splice(index, 1); - SaveWorkorderContact(); - showCustomerContacts(customercontacts); - }); + + for (var i = 0; i < data.length; i++) { + var r = data[i]; + var item = { ...r }; + var contactexists = false; + if (customercontacts) { + for (var j = 0; j < customercontacts.length; j++) { + var ct = customercontacts[j]; + if (ct.Name === item.Name && ct.MobilePhone === item.MobilePhone) { + ct.Id = item.Id; + contactexists = true; + break; + } + } + } + + if (!contactexists) + customercontacts.push(item); + } + + if (customer) { + customer.setData('contacts', customercontacts); + customer.contacts = customercontacts; + } + + woestimateobj?.updatecontact(customercontacts); + woinvoiceobj?.updatecontact(customercontacts); + + setPhoneNumber_statuschange(); } function SaveWorkorderContact(data, next) { @@ -582,108 +352,13 @@ function SaveWorkorderContact(data, next) { //*************************Follwer********************************// -var grid_dtfollower; -function InitWorkOrderFollowerGridData() { - grid_dtfollower = new GridView('#followerlist'); - grid_dtfollower.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Name', caption: GetTextByKey("P_CR_CONTACTNAME", "Contact Name"), valueIndex: 'Name', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'ContactEmail', caption: GetTextByKey("P_CR_CONTACTEMAIL", "Contact Email"), valueIndex: 'Email', css: { 'width': 130, 'text-align': 'left' } }, - { name: 'ContactMobilePhone', caption: GetTextByKey("P_CR_CONTACTMOBILE", "Contact Mobile"), valueIndex: 'MobilePhoneDisplayText', css: { 'width': 120, 'text-align': 'left' } }, - { name: 'ContactPreferenceStr', caption: GetTextByKey("P_CR_CONTACTPREFERENCES", "Contact Preferences"), valueIndex: 'ContactPreferenceStr', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - col.allowFilter = list_columns[hd].allowFilter; - if (list_columns[hd].type) { - col.type = list_columns[hd].type; - } - if (CRReadOnly && (col.name === "Edit" || col.name === "Delete")) { - continue; - } - if (col.name == "ContactPreferenceStr") { - col.filter = function (item) { - var text = ""; - if (item.SendEmail) - text = "Email"; - if (item.SendText) { - if (text == "") - text = "Text"; - else - text += ", Text"; - } - return text; - } - } - else if (col.name === "Delete") { - col.isurl = true; - col.text = "\uf00d"; - col.sortable = false; - col.events = { - onclick: function () { - onDeleteFollower(this); - } - }; - col.styleFilter = function (e) { - if (!IsAdmin && workorderdata && workorderdata.Completed) { - return { - display: 'none' - }; - } - } - col.classFilter = function (e) { - return "icon-col"; - }; - col.attrs = { 'title': GetTextByKey("P_UM_DELETE", 'Delete') }; - } - - columns.push(col); - } - grid_dtfollower.canMultiSelect = false; - grid_dtfollower.columns = columns; - grid_dtfollower.init(); -} -function getWorkOrderContacts(woid) { - worequest('GetWorkOrderContacts', woid, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); - showmaskbg(false); - return; - } - customercontacts = data || []; - showCustomerContacts(customercontacts); - }, function (err) { - }); -} function showWorkOrderFollowers(data) { if (typeof customer !== 'undefined') { customer.followers = data; } - - var rows = []; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - var fr = { Values: r }; - rows.push(fr); - } - - grid_dtfollower.setData(rows); } + function getWorkOrderFollowers(woid) { worequest('GetWorkOrderFollowers', woid, function (data) { if (typeof (data) === "string") { @@ -717,27 +392,18 @@ function getCustomerFollowers(custid) { item.SendText = fl.SendText; var followerexists = false; - for (var j = 0; j < grid_dtfollower.source.length; j++) { - var ct = grid_dtfollower.source[j].Values; - if (ct.UserIID === item.UserIID) { - followerexists = true; - break; - } - } - if (followerexists) { - if (followers) { - for (var j = 0; j < followers.length; j++) { - var ct = followers[j]; - if (ct.UserIID === item.UserIID) { - ct.Id = item.Id; - break; - } + if (followers) { + for (var j = 0; j < followers.length; j++) { + var ct = followers[j]; + if (ct.UserIID === item.UserIID) { + followerexists = true; + break; } } } - else - followers.push(item); + if (!followerexists) + followers.push(item); } SaveWorkOrderFollower(); @@ -749,72 +415,6 @@ function getCustomerFollowers(custid) { var isloadfollower = false; var allfollowers = []; -function onAddFollower() { - $('#selfollower_search').val('').attr('placeholder', GetTextByKey('P_IPT_SEARCH', 'Search')); - - if (!isloadfollower) - getAllFollowers(); - else - searchFollower(true); - - $('#addfollowerpopupdialog .dialog-title span.title').text(GetTextByKey("P_CR_XXXXXX", 'Add Followers')); - $('#mask_bg').show(); - $('#addfollowerpopupdialog') - .css({ - 'top': (document.documentElement.clientHeight - $('#addfollowerpopupdialog').height()) / 3, - 'left': (document.documentElement.clientWidth - $('#addfollowerpopupdialog').width()) / 2 - }).showDialogfixed(); - - setTimeout(function () { - grid_allfollower && grid_allfollower.resize(); - }); -} - -var grid_allfollower; -function InitAllFollowerGridData() { - grid_allfollower = new GridView('#allfollowerlist'); - grid_allfollower.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'DisplayName', caption: GetTextByKey("P_WO_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 240, 'text-align': 'left' } }, - { name: 'ContactTypeName', caption: GetTextByKey("P_WO_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 120, 'text-align': 'left' } }, - { name: 'Text', caption: "Text", valueIndex: 'Text', type: 3, css: { 'width': 60, 'text-align': 'center' } }, - { name: 'Email', caption: GetTextByKey("P_WO_EMAIL", "Email"), valueIndex: 'Email', type: 3, css: { 'width': 70, 'text-align': 'center' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - if (list_columns[hd].type) { - col.type = list_columns[hd].type; - } - columns.push(col); - if (col.name === "Text") { - col.enabled = function (item) { - return item.Mobile != null && $.trim(item.Mobile).length > 0; - }; - } - if (col.name === "Email") { - col.enabled = function (item) { - return item.ID !== ''; - }; - } - } - grid_allfollower.canMultiSelect = false; - grid_allfollower.columns = columns; - grid_allfollower.init(); -} - function getAllFollowers(next) { worequest('GetAllFollowers', '', function (data) { if (typeof next === 'function') { @@ -837,89 +437,6 @@ function showAllFollower(data) { if (typeof customer !== 'undefined') { customer.setData('allfollowers', data); } - var rows = []; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - for (var j in r) { - var a = r[j]; - } - if (!r.Text) - r.Text = false; - if (!r.Email) - r.Email = false; - var fr = { Values: r }; - rows.push(fr); - } - - grid_allfollower.setData(rows); -} - -function searchFollower(newopen) {//newopen新打开 - var filter = $('#selfollower_search').val().trim().toLowerCase(); - if (isloadfollower && allfollowers) { - var emails = []; - for (var i = 0; i < allfollowers.length; i++) { - var m = allfollowers[i]; - if (newopen) { - m.Text = false; - m.Email = false; - emails.push(m); - } - else { - if (!m.Text && !m.Email) { - if (m.ID.toLowerCase().indexOf(filter) >= 0 || m.DisplayName.toLowerCase().indexOf(filter) >= 0) - emails.push(m); - } - else - emails.push(m); - } - } - showAllFollower(emails); - } -} - -function onSelectFollowers() { - for (var i = 0; i < grid_allfollower.source.length; i++) { - var ct = grid_allfollower.source[i].Values; - if (ct.Email || ct.Text) { - var f = {}; - f.Id = -1; - f.UserIID = ct.IID; - f.Name = ct.DisplayName; - f.Email = ct.ID; - f.MobilePhone = ct.Mobile; - f.SendEmail = ct.Email; - f.SendText = ct.Text; - - if (followers && followers.length > 0) { - for (var j = 0; j < followers.length; j++) { - if (followers[j].UserIID.toLowerCase() == f.UserIID.toLowerCase()) { - f.Id = followers[j].Id; - followers.splice(j, 1); - break; - } - } - } - - followers.push(f); - } - } - SaveWorkOrderFollower(); - showWorkOrderFollowers(followers); - showmaskbg(false); - $('#addfollowerpopupdialog').hideDialog(); -} - -function onDeleteFollower(c) { - if (!c) { - return; - } - showConfirm(GetTextByKey("P_CR_XXXXXX", 'Do you want to delete this follower?'), GetTextByKey("P_CR_XXXXXX", 'Delete Follower'), function () { - var index = followers.indexOf(c); - followers.splice(index, 1); - SaveWorkOrderFollower(); - showWorkOrderFollowers(followers); - }); } function SaveWorkOrderFollower(next) { @@ -943,2406 +460,6 @@ function SaveWorkOrderFollower(next) { } /*************************End Follwer********************************/ - - -/*************************Inspections********************************/ - -var assetworkorders; -function getWOInspectItems() { - assetworkorders = []; - if (!workorderid || workorderid == "") return; - worequest("GetWOInspectItems", JSON.stringify([workorderid, machineid]), function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - if (data && data.length > 0) { - assetworkorders = data[0].WorkOrders; - ShowWOInspects(data); - } - else { - var div = $('#divinspections'); - div.empty(); - div.append($('<div class="noinspection"></div>').text(GetTextByKey("P_WO_NOINSPECTION", 'No Inspection'))); - } - - - }, function (err) { - }); -} - -function ShowWOInspects(inspects) { - var div = $('#divinspections'); - div.empty(); - - for (var i = 0; i < inspects.length; i++) { - var ipt = inspects[i]; - var targetid = "tbinspect_" + i; - var div_title = $('<div class="subtitle" style="position:relative;"></div>'); - var spimg = $('<span class="sbutton iconchevronright" target="' + targetid + '" style="margin-left: 0; padding-right: 5px;"></span>').data('iptid', ipt.Id).click(function () { - var t = $(this); - var tid = t.attr("target"); - if (t.hasClass("iconchevrondown")) { - t.removeClass("iconchevrondown").addClass("iconchevronright"); - $("#" + tid).hide(); - } - else { - t.removeClass("iconchevronright").addClass("iconchevrondown"); - $("#" + tid).show(); - var iptid = t.data("iptid"); - var iframe = $("#iframe_" + iptid); - if (iframe.data("load") == 0) { - iframe.attr('src', '../Inspection/ReportForWorkOrder.aspx?rid=' + iptid); - iframe.data("load", 1); - } - } - }); - var span = $('<span></span>').text(ipt.TemplateName); - div_title.append(spimg).append(span); - span = $('<span style="margin-left:80px;"></span>').text(ipt.CommitTimeLocalStr + ' by ' + ipt.CommitedByUserName); - div_title.append(span); - var ext_chk = $('<input type="checkbox" style="margin-left:80px;"/>').prop('checked', ipt.VisibleToCustomer).click(ipt, function (e) { - updateInspectVisibleToCustomer(e.data.Id, $(this).prop('checked')); - }); - div_title.append(ext_chk); - span = $('<span style="margin-left:5px;"></span>').text(GetTextByKey('P_WO_VISIBLETOCUSTOMER', 'Visible To Customer')); - if (WOReadOnly) - ext_chk.prop('disabled', true); - div_title.append(span); - if (AllowReassignWorkorders) { - span = $('<span style="margin-left:80px;"></span>').text(GetTextByKey('P_WO_WORKORDERASSIGNMENT', 'Work Order Assignment')); - div_title.append(span); - - var div_editableselect = $('<div style="margin-left:8px;width: 200px;display:inline-block;" class="dropdown"></div>'); - div_editableselect - .attr({ - 'inspection-id': ipt.Id, - 'old-wo-id': ipt.WorkOrderId - }) - .dropdown(assetworkorders || [], { - input: true, - valueKey: 'Id', - textKey: 'WorkOrderNumber', - selected: ipt.WorkOrderNumber - }).on('select', function (_e, wo) { - console.log(1) - var et = $(_e.target); - if (wo) { - var msg1 = GetTextByKey('P_WO_AREYOUSURETHATYOUWANTTOPROCEED', 'Are you sure that you want to proceed ?'); - var msg = GetTextByKey('P_WO_YOUAREREASSIGNINGTHISWORKORDER', 'You are reassigning this work order. ') + "<br/>" + msg1; - if (wo.Completed) - msg = GetTextByKey('P_WO_YOUAREREASSIGNINGTHISWORKORDERTOACLOSEDWORKORDER', 'You are reassigning this Work Order to a CLOSED Work Order.') + "<br/>" + msg1; - showConfirm(msg, GetTextByKey("P_WO_WORKORDERASSIGNMENT", 'Work Order Assignment'), function () { - updateInspectionWorkOrder(et.attr('inspection-id'), wo.Id); - }, function () { - et.dropdownVal(et.attr('old-wo-id')); - }); - } - }); - div_title.append(div_editableselect); - } - div_title.append('<hr />'); - div.append(div_title); - - var tab = $('<table style="display: none;width:100%;height:100%;" id="' + targetid + '"></table>'); - tr = $("<tr></tr>"); - td = $('<td></td>'); - var iframe = $('<iframe style="width: 100%; height: 100%; display: block; border: none;"></iframe>').attr("id", "iframe_" + ipt.Id).data("load", 0); - td.append(iframe); - tr.append(td); - tab.append(tr); - div.append(tab); - } -} - -function updateInspectionWorkOrder(id, woid) { - var p = JSON.stringify([id, woid, workorderid]); - worequest("UpdateInspectionWorkOrder", htmlencode(p), function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_WORKORDERASSIGNMENT", 'Work Order Assignment')); - return; - } - getWOInspectItems(); - getAlerts(); - getWorkOrderAttachments(); - }, function (err) { - }); -} - -function updateInspectVisibleToCustomer(id, chk) { - var item = [id, chk]; - var param = JSON.stringify(item); - param = htmlencode(param); - - worequest('UpdateInspectionVisibleToCustomer', param, function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); - } - }, function (err) { - }); -} - -/*************************End Inspections********************************/ - - -function getWorkOrderCollapsed() { - worequest("GetWorkOrderCollapsed", '', function (data) { - if (typeof (data) === "string") { - return; - } - if (data) { - for (var i = 0; i < data.length; i++) { - var item = data[i]; - if (item.Value == "1" && $("#span" + item.Key).is(":visible")) { - $("#span" + item.Key).removeClass("iconchevronright").addClass("iconchevrondown"); - $("#tb" + item.Key).show(); - if ("customer" == item.Key) - grid_dtcontact && grid_dtcontact.resize(); - else if ("follower" == item.Key) - grid_dtfollower && grid_dtfollower.resize(); - } - else { - $("#span" + item.Key).removeClass("iconchevrondown").addClass("iconchevronright"); - $("#tb" + item.Key).hide(); - } - - if (!AllowCustomer && item.Key === "customer") { - $("#tb" + item.Key).hide(); - } - } - } - }, function (err) { - }); -} - -function saveWorkOrderCollapsed() { - var items = []; - items.push({ 'Key': 'asset', 'Value': $("#spanasset").hasClass('iconchevrondown') ? "1" : "0" }); - items.push({ 'Key': 'customer', 'Value': $("#spancustomer").hasClass('iconchevrondown') ? "1" : "0" }); - items.push({ 'Key': 'follower', 'Value': $("#spanfollower").hasClass('iconchevrondown') ? "1" : "0" }); - items.push({ 'Key': 'summary', 'Value': $("#spansummary").hasClass('iconchevrondown') ? "1" : "0" }); - items.push({ 'Key': 'cost', 'Value': $("#spancost").hasClass('iconchevrondown') ? "1" : "0" }); - - var param = JSON.stringify(items); - param = htmlencode(param); - worequest("SetWorkOrderCollapsed", param, function (data) { - }, function (err) { - }); -} - - -/*****************************************Begin Estimate*********************************************/ -var EstimateStatus = { - Draft: 0, - Pending: 1, - Cancelled: 2, - Declined: 3, - Approved: 4, - Void: 5, - None: 100, -}; -var estimateindex = 0; -var publishestindex = 0; -var addestfiledatas = []; -var cur_uploaddata; -var cur_uploadindex = ""; -function showEstimatePopup() { - $('#popupestimatemask').css('height', $('#dialog_workorder').height()); - $('#popupestimatemask').show(); - $('#dialog_estimate').show(); - $('#dialog_estimate').css({ - "top": ($("#popupestimatemask").height() - $('#dialog_estimate').height()) / 3, - "left": ($("#popupestimatemask").width() - $('#dialog_estimate').width()) / 3 - }); - - $('#dialog_segmentuser').focus(); -} - -function hideEstimatePopup() { - $('#popupestimatemask').hide(); - $('#dialog_estimate').hide(); -} - -function getEstimates() { - estimateindex = 0; - $('#tab_estimates .estimates_div').remove(); - $('#tab_estimates .estimates_table').remove(); - if (!workorderid || workorderid == "") return; - worequest("GetWorkOrderEstimates", workorderid, function (data) { - $('#tab_estimates .estimates_div').remove(); - $('#tab_estimates .estimates_table').remove(); - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - if (data) { - if (data && data.length > 0) { - if (AllowCustomer) - $('#dialog_estimatestatus').text(getEstimateStatus(data[data.length - 1].Status)); - for (var i = 0; i < data.length; i++) { - showEstimate(data[i]); - } - } - else { - if (AllowCustomer) - $('#dialog_estimatestatus').text(getEstimateStatus(100)) - } - } - - }, function (err) { - }); -} - -function dragOverEstimateAttachment(ev, index) { - ev.preventDefault(); - ev.dataTransfer.dropEffect = 'link'; -} - -function dropEstimateAttachment(ev, index) { - ev.preventDefault(); - ev.stopPropagation(); - var df = ev.dataTransfer; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - if (estimate.Status !== 0) - return; - - if (files.length > 0) - SaveEstimateAttachmentFiles(files, estimate.Id, index); -} - -function cutEstimateAttachment(ev, index) { - ev.stopPropagation(); - var df = ev.clipboardData; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - if (estimate.Status !== 0) - return; - - if (files.length > 0) - SaveEstimateAttachmentFiles(files, estimate.Id, index); -} - -function showEstimate(estimate) { - estimateindex++; - var statustext = getEstimateStatus(estimate.Status); - var div_estimates = $('#tab_estimates'); - var div_title = $('<div id="divestimate' + estimateindex + '" class="subtitle estimates_div" style="margin-right:0px;" ondrop="dropEstimateAttachment(event,' + estimateindex + ')" ondragover="dragOverEstimateAttachment(event,' + estimateindex + ')" onpaste="cutEstimateAttachment(event,' + estimateindex + ')"></div>'); - div_title.append('<span class="sbutton iconchevronright" target="tabestimate' + estimateindex + '" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span>'); - div_title.append('<span id="span_estnumber' + estimateindex + '">' + estimate.EstimateNumber + '</span>'); - div_title.append('<span id="span_eststatus' + estimateindex + '" style="margin-left:80px;font-weight:bold;">' + statustext + '</span>'); - if (!WOReadOnly && (estimate.Status == 0 || estimate.Status === 1)) { - var s_del = $('<span class="sbutton icondelete" style="float:right;margin-right: 10px; padding: 0px 0px 0px 5px;" onclick="OnDeleteEstimate(' + estimateindex + ');"></span>'); - div_title.append(s_del); - } - div_title.append('<hr />'); - div_estimates.append(div_title); - - var table = $('<table id="tabestimate' + estimateindex + '" class="estimates_table" ondrop="dropEstimateAttachment(event,' + estimateindex + ')" ondragover="dragOverEstimateAttachment(event,' + estimateindex + ')" onpaste="cutEstimateAttachment(event,' + estimateindex + ')"></table>').data('estimate', estimate).data('index', estimateindex).hide(); - div_estimates.append(table); - var tr = $('<tr></tr>'); - table.append(tr); - var td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ESTIMATENUMBER_COLON', 'Estimate #:')); - tr.append(td); - td = $('<td style="width:150px;"></td>'); - tr.append(td); - var ipt = $('<input type="text" id="dialog_est_number' + estimateindex + '" tabindex="1" class="inputbox" maxlength="50" autocomplete="off" />').val(estimate.EstimateNumber).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ESTIMATESTATUS_COLON', 'Estimate Status:')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<span style="font-weight:bold;" id="dialog_est_status' + estimateindex + '"></span>').text(statustext); - td.append(ipt); - - if ([3, 4, 5].indexOf(estimate.Status) >= 0) { - td = $('<td class="label"></td>'); - if (estimate.Status == 3) { - td.text(GetTextByKey('P_WO_REJECTEDBY_COLON', 'Rejected By:')); - } - else if (estimate.Status == 4 || estimate.Status == 5) { - td.text(GetTextByKey('P_WO_APPROVEDBY_COLON', 'Approved By:')); - } - tr.append(td); - td = $('<td></td>'); - tr.append(td); - var byph = ""; - if (estimate.ResponsePhoneStr !== "") - byph = " (" + estimate.ResponsePhoneStr + ")"; - ipt = $('<span id="dialog_est_crn' + estimateindex + '"></span>').text(estimate.ResponseName + byph); - td.append(ipt); - } - else { - tr.append('<td cospan="2"></td>'); - } - var disabled = estimate.Status === EstimateStatus.Pending || estimate.Status === EstimateStatus.Declined || estimate.Status === EstimateStatus.Approved || estimate.Status === EstimateStatus.Void; - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ESTIMATETOTALCOST_COLON', 'Estimate Total Cost ($):')); - tr.append(td); - td = $('<td style="display: inline-flex;"></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_est_totalcosts' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off"/>').val(locale(estimate.TotalCost, disabled)); - td.append(ipt); - var btntotal = $("<span class='sbutton iconequel' style='padding:3px 1px 3px 6px;font-size:12px;margin-left:2px;'></span>").click(estimateindex, function (e) { - getEstimateTotalCost(e.data); - }).attr("title", GetTextByKey('P_WO_CALCULATINGTOTALS', 'Calculating Totals')); - td.append(btntotal); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_OTHERCOST_COLON', 'Other Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_est_othercost' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(estimate.OtherCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - - if ([3, 4, 5].indexOf(estimate.Status) >= 0) { - td = $('<td class="label"></td>'); - if (estimate.Status == 3) { - td.text(GetTextByKey('P_WO_REJECTEDTIME_COLON', 'Rejected Time:')); - } - else if (estimate.Status == 4 || estimate.Status == 5) { - td.text(GetTextByKey('P_WO_APPROVEDTIME_COLON', 'Approved Time:')); - } - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<span id="dialog_est_crt' + estimateindex + '"></span>').text(estimate.CustomerResponseTimeStr); - td.append(ipt); - } - else { - tr.append('<td cospan="2"></td>'); - } - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_PARTSCOST_COLON', 'Parts Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_est_partscost' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(estimate.PartsCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TRAVELTIMECOST_COLON', 'Travel Time Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); ipt = $('<input type="text" id="dialog_est_traveltimecost' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(estimate.TravelCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - - if ([3, 4, 5].indexOf(estimate.Status) >= 0) { - td = $('<td class="label"></td>'); - if (estimate.Status == 3) { - td.text(GetTextByKey('P_WO_REASONFORREJECTION_COLON', 'Reason for Rejection:')); - } - else if (estimate.Status == 4 || estimate.Status == 5) { - td.text(GetTextByKey('P_WO_XXXXXX_COLON', 'PO #:')); - } - tr.append(td); - td = $('<td></td>'); - tr.append(td); - if (estimate.Status == 3) { - ipt = $('<span id="dialog_est_rfr' + estimateindex + '"></span>').text(estimate.RejectReason); - td.append(ipt); - } - else if (estimate.Status == 4 || estimate.Status == 5) { - ipt = $('<span id="dialog_est_rfr' + estimateindex + '"></span>').text(estimate.PONumber); - td.append(ipt); - } - } - else { - tr.append('<td cospan="2"></td>'); - } - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_LABORCOST_COLON', 'Labor Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_est_laborcost' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(estimate.LaborCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TIMETOCOMPLATEHOURS_COLON', 'Time To Complete(Hrs):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_est_timetocomplete' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(estimate.HoursToComplete).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TAXES_COLON', 'Taxes ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_est_taxes' + estimateindex + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(estimate.Taxes, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_XXX', 'PO Required:')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="checkbox" id="dialog_est_porequired' + estimateindex + '" tabindex="1" style="width: auto;" />').prop('checked', estimate.PORequired).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_CUSTOMERISSUES_COLON', 'Customer Issues:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - ipt = $('<textarea id="dialog_est_custissues' + estimateindex + '" tabindex="1" maxlength="2000" style="width: 480px; height: 80px; margin-top: 5px;"></textarea>').val(estimate.CustomerIssues).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - - if ([3, 4, 5].indexOf(estimate.Status) >= 0) { - td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_CUSTOMERNOTES_COLON', 'Customer Notes:')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<textarea id="dialog_est_custnotes' + estimateindex + '" tabindex="1" maxlength="2000" disabled="disabled" style="width: 520px; height: 80px; margin-top: 5px;"></textarea>').val(estimate.CustomerNotes); - td.append(ipt); - } - else { - tr.append('<td cospan="2"></td>'); - } - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_TECHNICIANNOTES_COLON', 'Technician Notes:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - ipt = $('<textarea id="dialog_est_technotes' + estimateindex + '" tabindex="1" maxlength="2000" style="width: 480px; height: 80px; margin-top: 5px;" ></textarea>').val(estimate.TechnicianNotes).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); - td.append(ipt); - - if (([3, 4, 5].indexOf(estimate.Status) >= 0) && estimate.Signature != null && estimate.Signature && estimate.Signature.length > 0) { - td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_SIGNATURE_COLON', 'Signature:')); - tr.append(td); - td = $('<td rowspan="2"></td>'); - tr.append(td); - var jpeg = estimate.Signature; - if (typeof (estimate.Signature) !== "string") { - jpeg = arrayBufferToBase64(estimate.Signature); - } - var imgsig = $('<img style="height: 110px;" />').attr('src', 'data:image/png;base64,' + jpeg); - td.append(imgsig); - } - else { - tr.append('<td rowspan="2"></td>'); - } - - if (estimate.Status === 0) { - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ATTACHMENTS_COLON', ' Attachments:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - var div_att = $('<div></div>'); - td.append(div_att); - if (!WOReadOnly) { - var span_addfile = $('<span class="sbutton iconadd" onclick="openWOEstAttachmentDialog(' + estimateindex + ');" />').text(GetTextByKey('P_FR_ADDFILE', 'Add File...')); - div_att.append(span_addfile); - } - } - - tr = $('<tr id="tr_est_atts' + estimateindex + '"></tr>'); - table.append(tr); - td = $('<td class="label" style="vertical-align:top;"></td>').text(estimate.Status === 0 ? "" : GetTextByKey('P_WO_ATTACHMENTS_COLON', 'Attachments:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - var tb_att = $('<table id="tab_est_attachments' + estimateindex + '" style="border: 1px solid #a8a8a8; line-height: 25px; width: 480px; display: none;"></table>'); - td.append(tb_att); - var tr_att = $('<tr></tr>'); - tb_att.append(tr_att); - var td_att = $('<td></td>'); - tr_att.append(td_att); - div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); - td_att.append(div_att); - tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>'); - div_att.append(tb_att); - - showEstimateAttachment(estimateindex); - - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>'); - tr.append(td); - ipt = $('<lable id="lable_est_visibletocustomer' + estimateindex + '"></lable>').text(GetTextByKey('P_WO_XXX', 'Available to Customer:')).hide(); - td.append(ipt); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="checkbox" id="dialog_est_visibletocustomer' + estimateindex + '" tabindex="1" style="width: auto;" />').prop('checked', estimate.VisibleToCustomer).hide().change((function (id) { return function () { updateWOEstimateVisibleToCustomer(id) } })(estimateindex)); - td.append(ipt); - td = $('<td style="text-align: right; height: 33px"></td>'); - tr.append(td); - ipt = $('<input type="button" style="width: 80px; height: 25px;" id="btn_estimatesave' + estimateindex + '" onclick="onSaveWorkOrderEstimate(' + estimateindex + ')" />').val(GetTextByKey('P_WO_SAVE', 'Save')).hide(); - td.append(ipt); - ipt = $('<input type="button" style="width: 80px; height: 25px;margin-left:16px;" id="btn_estimatepublish' + estimateindex + '" onclick="openPublishDialog(' + estimateindex + ')" />').val(GetTextByKey('P_WO_PUBLISH', 'Publish')).hide(); - td.append(ipt); - ipt = $('<input type="button" style="width: 80px; height: 25px;" id="btn_estimaterevoke' + estimateindex + '" onclick="OnRevokeEstimate(' + estimateindex + ')" />').val(GetTextByKey('P_WO_REVOKE', 'Revoke')).hide(); - td.append(ipt); - - if (!WOReadOnly) { - if (estimate.Status === 0) { - $('#btn_estimatesave' + estimateindex).show(); - $('#btn_estimatepublish' + estimateindex).show(); - } - if (estimate.Status === 1 || estimate.Status === 4) { - $('#btn_estimaterevoke' + estimateindex).show(); - } - } - if (disabled || WOReadOnly) - setEstimateDisabled(estimateindex, true); - - if (estimate.Status === 3) { - $('#span_eststatus' + estimateindex).css('color', 'red'); - $('#dialog_est_status' + estimateindex).css('color', 'red'); - } - if (estimate.Status === 4) { - $('#span_eststatus' + estimateindex).css('color', '#2eda2e'); - $('#dialog_est_status' + estimateindex).css('color', '#2eda2e'); - } - if ([3, 4, 5].indexOf(estimate.Status) >= 0) { - $('#lable_est_visibletocustomer' + estimateindex).show(); - $('#dialog_est_visibletocustomer' + estimateindex).show(); - } -} - -function arrayBufferToBase64(buffer) { - var binary = ''; - var bytes = new Uint8Array(buffer); - var len = bytes.byteLength; - for (var i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]); - } - return window.btoa(binary); -} - -function OnRevokeEstimate(index) { - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - showConfirm(GetTextByKey("P_WO_DOYOUWANTTOREVOKETHEESTIMATE", 'Do you want to revoke the estimate?'), GetTextByKey("P_WO_REVOKEESTIMATE", 'Revoke Estimate'), function () { - worequest("RevokeWorkOrderEstimate", estimate.Id, function (data) { - if (data === "OK") { - getEstimates(); - } - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILEDTOREVOKETHISESTIMATE", 'Failed to revoke this estimate.'), GetTextByKey("P_WO_REVOKEESTIMATE", 'Revoke Estimate')); - }); - }); -} - -function OnDeleteEstimate(index) { - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - showConfirm(GetTextByKey("P_WO_DOYOUWANTTODELETETHEESTIMATE", 'Do you want to delete the estimate?'), GetTextByKey("P_WO_DELETEESTIMATE", 'Delete Estimate'), function () { - worequest("DeleteWorkOrderEstimate", estimate.Id, function (data) { - if (data === "OK") { - getEstimates(); - } - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILEDTODELETETHISESTIMATE", 'Failed to delete this estimate.'), GetTextByKey("P_WO_DELETEESTIMATE", 'Delete Estimate')); - }); - }); -} - -function onSaveWorkOrderEstimate(index, next) { - var estimateid = -1; - var status = 0; - var alerttitle = GetTextByKey("P_WO_ADDESTIMATE", "Add Estimate"); - if (index !== "") { - alerttitle = GetTextByKey("P_WO_EDITESTIMATE", "Edit Estimate"); - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - estimateid = estimate.Id; - status = estimate.Status; - } - - var item = { - 'Id': estimateid, - 'WorkOrderId': workorderid, - 'Status': status, - 'EstimateNumber': $('#dialog_est_number' + index).val(), - 'TotalCost': $('#dialog_est_totalcosts' + index).val(), - 'OtherCost': $('#dialog_est_othercost' + index).val(), - 'PartsCost': $('#dialog_est_partscost' + index).val(), - 'TravelCost': $('#dialog_est_traveltimecost' + index).val(), - 'LaborCost': $('#dialog_est_laborcost' + index).val(), - 'HoursToComplete': $('#dialog_est_timetocomplete' + index).val(), - 'CustomerIssues': $('#dialog_est_custissues' + index).val(), - 'TechnicianNotes': $('#dialog_est_technotes' + index).val(), - 'Taxes': $('#dialog_est_taxes' + index).val(), - 'PORequired': $('#dialog_est_porequired' + index).prop('checked') - }; - - if (isNaN(item.TotalCost) || item.TotalCost < 0) { - showAlert(GetTextByKey('P_WO_XXXXXX_INVALID', 'Total cost is not a valid number.'), alerttitle, function () { $('#dialog_est_totalcosts' + index).focus() }); - return; - } - if (isNaN(item.OtherCost) || item.OtherCost < 0) { - showAlert(GetTextByKey('P_WO_OTHERCOST_INVALID', 'Other cost is not a valid number.'), alerttitle, function () { $('#dialog_est_totalcosts' + index).focus() }); - return; - } - if (isNaN(item.PartsCost) || item.PartsCost < 0) { - showAlert(GetTextByKey('P_WO_PARTSCOST_INVALID', 'Parts cost is not a valid number.'), alerttitle, function () { $('#dialog_est_partscost' + index).focus() }); - return; - } - if (isNaN(item.TravelCost) || item.TravelCost < 0) { - showAlert(GetTextByKey('P_WO_TRAVELTIMECOST_INVALID', 'Travel time cost is not a valid number.'), alerttitle, function () { $('#dialog_est_traveltimecost' + index).focus() }); - return; - } - if (isNaN(item.LaborCost) || item.LaborCost < 0) { - showAlert(GetTextByKey('P_WO_LABORCOST_INVALID', 'Labor cost is not a valid number.'), alerttitle, function () { $('#dialog_est_laborcost' + index).focus() }); - return; - } - if (isNaN(item.HoursToComplete) || item.HoursToComplete < 0) { - showAlert(GetTextByKey('P_WO_TIMETOCOMPLETE_INVALID', 'Time to complete is not a valid number.'), alerttitle, function () { $('#dialog_est_timetocomplete' + index).focus() }); - return; - } - if (isNaN(item.Taxes) || item.Taxes < 0) { - showAlert(GetTextByKey('P_WO_XXXXX_INVALID', 'Taxes is not a valid number.'), alerttitle, function () { $('#dialog_est_taxes' + index).focus() }); - return; - } - - $('#btn_estimatesave' + index).attr('disabled', true); - var param = JSON.stringify(item); - param = htmlencode(param); - worequest("SaveWorkOrderEstimate", param, function (data) { - if (typeof (data) === "string") { - $('#btn_estimatesave' + index).attr('disabled', false); - showAlert(data, alerttitle); - } else { - $('#btn_estimatesave' + index).attr('disabled', false); - - if (index === "") {//新增 - if (addestfiledatas && addestfiledatas.length > 0) { - SaveEstimateAttachmentFiles(addestfiledatas, data); - addestfiledatas = []; - } - - if (next) - next("", data); - else { - getEstimates(); - } - hideEstimatePopup(); - } - else {//编辑 - if (next) - next(index); - else { - showAlert(GetTextByKey("P_WO_SAVSUCCESSFULLY", "Saved successfully."), alerttitle); - $('#span_estnumber' + index).text($('#dialog_est_number' + index).val()); - } - } - } - }, function (err) { - $('#btn_estimatesave' + index).attr('disabled', false); - console.log(err); - showAlert(GetTextByKey("P_WO_FAILEDTORSAVEESTIMATE", 'Failed to save estimate.'), alerttitle); - }); -} - - -function OnAddEstimate() { - addestfiledatas = []; - $('#tab_est_atts').empty(); - $('#tab_est_attachments').hide(); - if (!workorderid || workorderid === "") { - showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDESTIMATE", "Add Estimate")); - return; - } - - $('#dialog_est_number').val(""); - $('#dialog_est_status').text(GetTextByKey('P_WO_DRAFT', 'Draft')); - $('#dialog_est_totalcosts').val(""); - $('#dialog_est_othercost').val(""); - $('#dialog_est_partscost').val(""); - $('#dialog_est_traveltimecost').val(""); - $('#dialog_est_laborcost').val(""); - $('#dialog_est_timetocomplete').val(""); - $('#dialog_est_custissues').val(""); - $('#dialog_est_technotes').val(""); - $('#dialog_est_taxes').val(""); - $('#dialog_est_porequired').prop('checked', WorkorderParams.DefaultPORequired); - if (workorderdata) { - $('#dialog_est_totalcosts').val(workorderdata.WorkOrderTotalCost == 0 ? "" : workorderdata.WorkOrderTotalCost); - $('#dialog_est_othercost').val(workorderdata.OtherCost == 0 ? "" : workorderdata.OtherCost); - $('#dialog_est_partscost').val(workorderdata.PartsCost == 0 ? "" : workorderdata.PartsCost); - $('#dialog_est_traveltimecost').val(workorderdata.TravelTimeCost == 0 ? "" : workorderdata.TravelTimeCost); - $('#dialog_est_laborcost').val(workorderdata.LaborCost == 0 ? "" : workorderdata.LaborCost); - $('#dialog_est_timetocomplete').val(workorderdata.HoursToComplete == 0 ? "" : workorderdata.HoursToComplete); - $('#dialog_est_custissues').val(workorderdata.Description); - getEstimateTotalCost(""); - } - - showEstimatePopup(); -} - -function inputChanged(index) { - $('#tabestimate' + index).data('changed', true); -} - -function setEstimateDisabled(index, di) { - $('#dialog_est_number' + index).attr('disabled', di); - $('#dialog_est_totalcosts' + index).attr('disabled', di); - $('#dialog_est_othercost' + index).attr('disabled', di); - $('#dialog_est_partscost' + index).attr('disabled', di); - $('#dialog_est_traveltimecost' + index).attr('disabled', di); - $('#dialog_est_laborcost' + index).attr('disabled', di); - $('#dialog_est_timetocomplete' + index).attr('disabled', di); - $('#dialog_est_custissues' + index).attr('disabled', di); - $('#dialog_est_technotes' + index).attr('disabled', di); - $('#dialog_est_taxes' + index).attr('disabled', di); - $('#dialog_est_porequired' + index).attr('disabled', di); -} - -function getEstimateTotalCost(index) { - var othercost = $('#dialog_est_othercost' + index).val(); - var partscost = $('#dialog_est_partscost' + index).val(); - var traveltimecost = $('#dialog_est_traveltimecost' + index).val(); - var laborcost = $('#dialog_est_laborcost' + index).val(); - var taxes = $('#dialog_est_taxes' + index).val(); - var totalcost = 0; - if (othercost !== "" && !isNaN(othercost)) - totalcost += eval(othercost); - if (partscost !== "" && !isNaN(partscost)) - totalcost += eval(partscost); - if (traveltimecost !== "" && !isNaN(traveltimecost)) - totalcost += eval(traveltimecost); - if (laborcost !== "" && !isNaN(laborcost)) - totalcost += eval(laborcost); - if (taxes !== "" && !isNaN(taxes)) - totalcost += eval(taxes); - $('#dialog_est_totalcosts' + index).val(totalcost.toFixed(2)); -} - -function getEstimateStatus(s) { - var text = ""; - if (s === 0) - text = GetTextByKey('P_WO_DRAFT', 'Draft'); - else if (s === 1) - text = GetTextByKey('P_WO_AWAITINGCUSTOMERAPPROVAL', 'Awaiting Customer Approval'); - else if (s === 2) - text = GetTextByKey('P_WO_CANCELLEDBYDEALER', 'Cancelled by Dealer'); - else if (s === 3) - text = GetTextByKey('P_WO_CUSTOMERREJECTED', 'Customer Rejected'); - else if (s === 4) - text = GetTextByKey('P_WO_CUSTOMERAPPROVED', 'Customer Approved'); - else if (s === 5) - text = GetTextByKey('P_WO_XXXX', 'Void'); - else if (s === 100) - text = ""; - return text; -} - -function showPublishEstimatePopup() { - $('#popupepublishstimatemask').css('height', $('#dialog_workorder').height()); - $('#popupepublishstimatemask').show(); - $('#dialog_publishestimate').show(); - $('#dialog_est_textmsg').val(WorkorderParams.EstimateMessage); - $('#dialog_publishestimate').css({ - "top": ($("#popupepublishstimatemask").height() - $('#dialog_publishestimate').height()) / 3, - "left": ($("#popupepublishstimatemask").width() - $('#dialog_publishestimate').width()) / 3 - }); - - $('#dialog_est_phonenum').focus(); -} - -function hidePublishEstimatePopup() { - publishestindex = 0; - $('#popupepublishstimatemask').hide(); - $('#dialog_publishestimate').hide(); -} - -function openPublishDialog(index) { - if (index == -1) { - publishestindex = index; - showPublishEstimatePopup(); - } - else { - onSaveWorkOrderEstimate(index, function () { - publishestindex = index; - showPublishEstimatePopup(); - }); - } -} - -function onPublishEstimate() { - var changed = $('#tabestimate' + publishestindex).data('changed'); - if (publishestindex === -1)//add and publish - changed = true; - if (changed) - onSaveWorkOrderEstimate(publishestindex === -1 ? "" : publishestindex, PublishEstimate) - else - PublishEstimate(publishestindex); -} - -function PublishEstimate(index, estid) { - if (index !== "") { - var estimate = $('#tabestimate' + index).data('estimate'); - estid = estimate.Id; - } - - if (!estid) - return; - - var pmemails = []; - var checked = $('#dialog_est_chksendtextmsg').prop('checked'); - if (checked) { - var phoneemail = $('#dialog_est_phonenum').val(); - if (phoneemail !== "") { - var phoneemails = phoneemail.split(';'); - for (var i = 0; i < phoneemails.length; i++) { - var pm = phoneemails[i]; - if (checkPhoneNumber(pm) || isEmail(pm)) { - pmemails.push({ 'Key': pm, 'Value': pm }); - } - else { - if (customercontacts) { - for (var j = 0; j < customercontacts.length; j++) { - var c = customercontacts[j]; - if (c.OptOut || c.OptOut_BC) continue; - var mp = $.trim(c.MobilePhone); - var email = $.trim(c.Email); - if (c.Name === pm) { - if (c.ContactPreference == "0" && checkPhoneNumber(mp)) { - pmemails.push({ 'Key': mp, 'Value': pm }); - break; - } - if (c.ContactPreference == "1" && isEmail(email)) { - pmemails.push({ 'Key': email, 'Value': pm }); - break; - } - } - } - } - } - } - } - } - - var msg = $('#dialog_est_textmsg').val(); - var includeStatusLink = $('#dialog_est_chkIncludeStatusLink').prop("checked"); - - var param = JSON.stringify([estid, workorderid, JSON.stringify(pmemails), msg, (includeStatusLink ? "1" : "0")]); - param = htmlencode(param); - - worequest("PublishEstimateToCustomer", param, function (data) { - if (data !== "") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - getEstimates(); - hidePublishEstimatePopup(); - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILEDTOPUBLISHTHISESTIMATE", 'Failed to publish this estimate.'), GetTextByKey("P_WO_PUBLISHESTIMATE", 'Publish Estimate')); - }); -} - -function updateWOEstimateVisibleToCustomer(index) { - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - var checked = $('#dialog_est_visibletocustomer' + index).prop('checked'); - var param = JSON.stringify([estimate.Id, checked]); - param = htmlencode(param); - - worequest("UpdateWOEstimateVisibleToCustomer", param, function (data) { - if (data !== "") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - }, function (err) { - showAlert(GetTextByKey("P_WO_XXXX", 'Failed to publish this estimate.'), GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); - }); -} - -function SaveEstimateAttachmentFiles(filedatas, estid, index) { - var formData = new FormData(); - var notesdata = []; - for (var i = 0; i < filedatas.length; i++) { - formData.append("iconFile" + i, filedatas[i].File); - notesdata.push(encodeURIComponent(filedatas[i].Notes)); - } - var p = JSON.stringify([estid, JSON.stringify(notesdata)]); - formData.append("MethodName", "AddEstimateAttachment"); - formData.append("ClientData", p); - var url = 'AddWorkOrder.aspx'; - $.ajax({ - url: url, - type: 'POST', - dataType: 'json', - processData: false, - contentType: false, - data: formData, - async: true, - success: function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); - } else { - if (index) { - hideWOEstAttachmentPopup(); - getEstimateAttachment(index); - } - else - getEstimates(); - } - }, - error: function (err) { - showAlert(GetTextByKey("P_WO_XXXXX", 'Upload failed'), GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); - } - }); -} - - -function getEstimateAttachment(index) { - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - - $('#tab_est_atts' + index).empty(); - $('#tab_est_attachments' + index).hide(); - - worequest("GetEstimateAttachment", estimate.Id, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - if (data && data.length > 0) { - showEstimateAttachment(index, data); - } - - }, function (err) { - }); -} - -function showEstimateAttachment(index, atts) { - var isdelete = false; - if (!atts) { - var estimate = $('#tabestimate' + index).data('estimate'); - if (!estimate) - return; - atts = estimate.Attachments; - if (estimate.Status === 0) - isdelete = true; - } - else - isdelete = true; - - $('#tab_est_atts' + index).empty(); - $('#tab_est_attachments' + index).hide(); - if (atts && atts.length > 0) { - $('#tab_est_attachments' + index).show(); - for (var i = 0; i < atts.length; i++) { - var att = atts[i]; - var tr = $('<tr></tr>').attr('id', att.AttachmentId); - var tdfile = $('<td style=""></td>'); - var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(att.Notes === "" ? att.FileName : att.Notes).click(function () { - window.open("../filesvc.ashx?attchid=" + this.parentElement.parentElement.id + "&sourceType=woestimateattachment"); - }); - var span = $('<span></span>').text(att.AddedByName).css("margin-right", 5).css("margin-left", 5).css("color", "black"); - var spanby = $('<span></span>').text(att.AddedOnLocalStr).css("color", "black"); - tdfile.append(filename, span, spanby); - - if (!WOReadOnly && isdelete) { - var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); - var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('index', index).click(function () { - deleteEstimateAttachment(this.parentElement.parentElement.id, $(this).data('index')); - }); - tdimg.append(imgDom); - tr.append(tdimg); - } - tr.append(tdfile).appendTo($('#tab_est_atts' + index)); - } - } -} - -function deleteEstimateAttachment(attid, index) { - if (confirm(GetTextByKey("P_WO_DELETEATTACHMENTTIPS", "Are you sure you want to delete the attachment?"))) { - worequest("DeleteEstimateAttachment", attid, function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); - } - else { - getEstimateAttachment(index); - } - }, function (err) { }); - } -} - -function hideWOEstAttachmentPopup() { - $('#popupewoestattachmentmask').hide(); - $('#dialog_woestattachment').hide(); -} - -function openWOEstAttachmentDialog(index) { - cur_uploaddata = undefined; - cur_uploadindex = index; - $('#btn_woestattasave').attr('disabled', false); - $('#tab_woest_atts').empty(); - $('#tab_woest_attachments').hide(); - $('#popupewoestattachmentmask').css('height', $('#dialog_workorder').height()); - $('#popupewoestattachmentmask').show(); - $('#dialog_woestattachment').show(); - $('#dialog_estatt_notes').val(''); - $('#dialog_woestattachment').css({ - "top": ($("#popupewoestattachmentmask").height() - $('#dialog_woestattachment').height()) / 3, - "left": ($("#popupewoestattachmentmask").width() - $('#dialog_woestattachment').width()) / 3 - }); - - $('#dialog_estatt_notes').focus(); -} - - -function dragOverAddEstimateAttachment(ev) { - ev.preventDefault(); - ev.dataTransfer.dropEffect = 'link'; -} - -function dropAddEstimateAttachment(ev) { - ev.preventDefault(); - ev.stopPropagation(); - var df = ev.dataTransfer; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - if (files.length > 0) { - for (var i = 0; i < files.length; i++) { - cur_uploaddata = files[i]; - onSaveWOEstAttachment(); - } - } -} - -function cutAddEstimateAttachment(ev) { - ev.stopPropagation(); - var df = ev.clipboardData; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - if (files.length > 0) { - for (var i = 0; i < files.length; i++) { - cur_uploaddata = files[i]; - onSaveWOEstAttachment(); - } - } -} - -function UpLoadEstimateAttachment() { - var file = $('<input type="file" style="display: none;" />'); - file.change(function () { - var files = this.files; - if (files.length == 0) - return; - - if (files[0].size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return false; - } - if (files[0].size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return false; - } - var notes = $('#dialog_estatt_notes').val(); - cur_uploaddata = { 'File': files[0], 'Notes': notes }; - createNewEstimateAttachment(cur_uploaddata); - - }).click(); -} - -function createNewEstimateAttachment(data) { - $('#tab_woest_atts').empty(); - $('#tab_woest_attachments').show(); - var tr = $('<tr></tr>'); - var tdfile = $('<td style=""></td>'); - var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(data.Notes === "" ? data.File.name : data.Notes); - tdfile.append(filename); - - var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); - var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').click(function () { - this.parentElement.parentElement.remove(); - cur_uploaddata = undefined; - $('#tab_woest_attachments').hide(); - }); - tdimg.append(imgDom); - tr.append(tdimg); - - tr.append(tdfile).appendTo($('#tab_woest_atts')); -} - -function onSaveWOEstAttachment() { - if (!cur_uploaddata) - return; - - $('#btn_woestattasave').attr('disabled', true); - var estimate = $('#tabestimate' + cur_uploadindex).data('estimate'); - var notes = $('#dialog_estatt_notes').val(); - cur_uploaddata.Notes = notes; - - if (!estimate) { - addestfiledatas.push(cur_uploaddata); - createAddEstimateAttachment(cur_uploaddata); - hideWOEstAttachmentPopup(); - $('#btn_woestattasave').attr('disabled', false); - } - else { - SaveEstimateAttachmentFiles([cur_uploaddata], estimate.Id, cur_uploadindex); - } -} - -function createAddEstimateAttachment(data) { - var notes = data.Notes; - var file = data.File; - $('#tab_est_attachments').show(); - var tr = $('<tr></tr>'); - var tdfile = $('<td style=""></td>'); - var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(notes === "" ? file.name : notes); - tdfile.append(filename); - - var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); - var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('filedata', data).click(function () { - this.parentElement.parentElement.remove(); - var fd = $(this).data('filedata'); - addestfiledatas.splice(addestfiledatas.indexOf(fd), 1); - if (addestfiledatas.length == 0) - $('#tab_est_attachments').hide(); - }); - tdimg.append(imgDom); - tr.append(tdimg); - - tr.append(tdfile).appendTo($('#tab_est_atts')); -} - -/*****************************************End Estimate*********************************************/ - - -/*****************************************Begin Invoice*********************************************/ - -var invoice_index = 0; -var publish_invoice_index = 0; -var add_invoice_filedatas = []; -var cur_invoice_uploaddata; -var cur_invoice_uploadindex = ""; -function showInvoicePopup() { - $('#popupinvoicemask').css('height', $('#dialog_workorder').height()); - $('#popupinvoicemask').show(); - $('#dialog_invoice').show(); - $('#dialog_invoice').css({ - "top": ($("#popupinvoicemask").height() - $('#dialog_invoice').height()) / 3, - "left": ($("#popupinvoicemask").width() - $('#dialog_invoice').width()) / 3 - }); - - $('#dialog_invoice_number').focus(); -} - -function hideInvoicePopup() { - $('#popupinvoicemask').hide(); - $('#dialog_invoice').hide(); -} - -function getInvoices() { - invoice_index = 0; - $('#tab_invoices .estimates_div').remove(); - $('#tab_invoices .estimates_table').remove(); - if (!workorderid || workorderid == "") return; - worequest("GetWorkOrderInvoices", workorderid, function (data) { - $('#tab_invoices .estimates_div').remove(); - $('#tab_invoices .estimates_table').remove(); - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - if (data) { - if (data && data.length > 0) { - //if (AllowCustomer) - // $('#dialog_invoice_status').text(getInvoiceStatus(data[data.length - 1].Status)); - for (var i = 0; i < data.length; i++) { - showInvoice(data[i]); - } - } - else { - // if (AllowCustomer) - // $('#dialog_invoice_status').text(getInvoiceStatus(100)) - } - } - - }, function (err) { - }); -} - - -function dragOverInvoiceAttachment(ev, index) { - ev.preventDefault(); - ev.dataTransfer.dropEffect = 'link'; -} - -function dropInvoiceAttachment(ev, index) { - ev.preventDefault(); - ev.stopPropagation(); - var df = ev.dataTransfer; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - if (invoice.Status !== 0) - return; - - if (files.length > 0) - SaveInvoiceAttachmentFiles(files, invoice.Id, index); -} - -function cutInvoiceAttachment(ev, index) { - ev.stopPropagation(); - var df = ev.clipboardData; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - if (invoice.Status !== 0) - return; - - if (files.length > 0) - SaveInvoiceAttachmentFiles(files, invoice.Id, index); -} - - -function showInvoice(invoice) { - invoice_index++; - var statustext = getInvoiceStatus(invoice.Status); - var div_invoices = $('#tab_invoices'); - var div_title = $('<div id="divinvoice' + invoice_index + '" class="subtitle estimates_div" style="margin-right:0px;" ondrop="dropInvoiceAttachment(event,' + invoice_index + ')" ondragover="dragOverInvoiceAttachment(event,' + invoice_index + ')" onpaste="cutInvoiceAttachment(event,' + invoice_index + ')"></div>'); - div_title.append('<span class="sbutton iconchevronright" target="tabinvoice' + invoice_index + '" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span>'); - div_title.append('<span id="span_invoice_number' + invoice_index + '">' + invoice.InvoiceNumber + '</span>'); - div_title.append('<span id="span_invoice_status' + invoice_index + '" style="margin-left:80px;font-weight:bold;">' + statustext + '</span>'); - - if (!WOReadOnly) { - if (invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.PaymentCreated || invoice.Status === InvoiceStatus.Draft) { - div_title.append($('<input type="button" style="width: 100px; height: 24px;margin-left:100px;" onclick="openWOInvoiceMarkPaidDialog(' + invoice_index + ')" />').val(GetTextByKey('P_WO_XXXXXX', 'Mark As Paid'))); - } - if (invoice.Status === InvoiceStatus.Pending) { - div_title.append($('<input type="button" style="width: 80px; height: 24px;margin-left:20px;" onclick="OnRevokeInvoice(' + invoice_index + ')" />').val(GetTextByKey('P_WO_REVOKE', 'Revoke'))); - } - - if (invoice.Status == InvoiceStatus.Draft || invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.Revoked) { - var s_del = $('<span class="sbutton icondelete" style="float:right;margin-right: 10px; padding: 0px 0px 0px 5px;" onclick="OnDeleteInvoice(' + invoice_index + ');"></span>'); - div_title.append(s_del); - } - } - div_title.append('<hr />'); - div_invoices.append(div_title); - - var disabled = invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.PaymentCreated || invoice.Status === InvoiceStatus.Paid || invoice.Status === InvoiceStatus.Revoked || invoice.Status === InvoiceStatus.ManualPaid; - - var table = $('<table id="tabinvoice' + invoice_index + '" class="estimates_table" ondrop="dropInvoiceAttachment(event,' + invoice_index + ')" ondragover="dragOverInvoiceAttachment(event,' + invoice_index + ')" onpaste="cutInvoiceAttachment(event,' + invoice_index + ')"></table>').data('invoice', invoice).data('index', invoice_index).hide(); - div_invoices.append(table); - var tr = $('<tr></tr>'); - table.append(tr); - var td = $('<td class="label"></td>').text(GetTextByKey('P_WO_INVOICENUMBER', 'Invoice #:')); - tr.append(td); - td = $('<td style="width:150px;"></td>'); - tr.append(td); - var ipt = $('<input type="text" id="dialog_invoice_number' + invoice_index + '" tabindex="1" class="inputbox" maxlength="50" autocomplete="off" />').val(invoice.InvoiceNumber).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_OTHERCOST_COLON', 'Other Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_invoice_othercost' + invoice_index + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(invoice.OtherCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - - var tdDetail = $('<td rowspan="7" style="vertical-align: top; padding-left: 20px"></td>').attr('id', 'invoice_payment_tab' + invoice_index); - tr.append(tdDetail); - //if (invoice.Status == InvoiceStatus.Paid) - { - if (invoice.PaymentItem != null) { - var btncancelpayment = "<span></span>"; - if (invoice.Status === InvoiceStatus.ManualPaid) { - btncancelpayment = $('<input type="button" style="width: 100px; height: 24px;" onclick="CancelPayment(' + invoice_index + ')" />').val(GetTextByKey('P_WO_XXXXXX', 'Cancel Payment')); - } - tdDetail.empty().append( - $('<table style="width: 100%; table-layout: fixed"></table>').append( - $('<tr></tr>').append( - $('<td style="width: 150px" class="payment-label"></td>').text(GetTextByKey('P_WO_XXXXXX', 'Payment Entered By:')), - $('<td style="width: 320px"></td>').text(invoice.PaymentItem.PaymentEnteredByName), - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CUSTOMERNAME', 'Customer Name:')), - $('<td></td>').text(invoice.PaymentItem.CustomerName) - ), - $('<tr></tr>').append( - $('<td style="width: 150px" class="payment-label"></td>').text(GetTextByKey('P_WO_PAYMENTTIME', 'Payment Time:')), - $('<td style="width: 320px"></td>').text(invoice.PaymentItem.CreatedLocalStr), - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CUSTOMEREMAIL', 'Customer Email:')), - $('<td></td>').text(invoice.PaymentItem.CustomerEmail) - ), - $('<tr></tr>').append( - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_XXXXXX', 'Payment Type:')), - $('<td></td>').text(invoice.PaymentItem.PaymentType), - $('<td></td>'), - $('<td></td>') - ), - $('<tr></tr>').append( - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_XXXXXX', 'Check #:')), - $('<td></td>').text(invoice.PaymentItem.CheckNumber), - $('<td></td>'), - $('<td></td>') - ), - $('<tr></tr>').append( - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CARDNUMBER', 'Card Number:')), - $('<td></td>').text(invoice.PaymentItem.CardNumber), - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_EXPIRATION', 'Expiration:')), - $('<td></td>').text(invoice.PaymentItem.CardExpiration) - ), - $('<tr></tr>').append( - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CARDTYPE', 'Card Type:')), - $('<td></td>').text(invoice.PaymentItem.CardType), - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_COUNTRY_COLON', 'Country:')), - $('<td></td>').text(invoice.PaymentItem.CustomerCountry) - ), - $('<tr></tr>').append( - $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_ISSUER', 'Issuer:')), - $('<td style="padding-right: 20px; white-space: nowrap"></td>').text(invoice.PaymentItem.CardIssuer), - $('<td style="text-align:right;"></td>').append(btncancelpayment), - $('<td></td>') - ) - ) - ); - } - } - //if (invoice.Status == 3 || invoice.Status === 4) { - // td = $('<td class="label"></td>'); - // if (invoice.Status == 3) { - // td.text(GetTextByKey('P_WO_REJECTEDBY_COLON', 'Rejected By:')); - // } - // else if (invoice.Status == 4) { - // td.text(GetTextByKey('P_WO_APPROVEDBY_COLON', 'Approved By:')); - // } - // tr.append(td); - // td = $('<td></td>'); - // tr.append(td); - // var byph = ""; - // if (invoice.ResponsePhoneStr !== "") - // byph = " (" + invoice.ResponsePhoneStr + ")"; - // ipt = $('<span id="dialog_invoice_crn' + invoice_index + '"></span>').text(invoice.ResponseName + byph); - // td.append(ipt); - //} - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_INVOICETOTALCOST', 'Invoice Total Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_invoice_totalcosts' + invoice_index + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(invoice.TotalCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TRAVELTIMECOST_COLON', 'Travel Time Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); ipt = $('<input type="text" id="dialog_invoice_traveltimecost' + invoice_index + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(invoice.TravelCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_PARTSCOST_COLON', 'Parts Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_invoice_partscost' + invoice_index + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(invoice.PartsCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TAXES_COLON', 'Taxes ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_invoice_taxes' + invoice_index + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(invoice.Taxes, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_LABORCOST_COLON', 'Labor Cost ($):')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="text" id="dialog_invoice_laborcost' + invoice_index + '" tabindex="1" class="inputbox" maxlength="12" autocomplete="off" />').val(locale(invoice.LaborCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_INVOICESTATUS', 'Invoice Status:')); - tr.append(td); - td = $('<td style="width: 150px"></td>'); - tr.append(td); - ipt = $('<span style="font-weight:bold;" id="dialog_invoice_status' + invoice_index + '"></span>').text(statustext); - td.append(ipt); - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_XXXXXX_COLON', 'Customer Visible:')); - tr.append(td); - td = $('<td></td>'); - tr.append(td); - ipt = $('<input type="checkbox" id="dialog_invoice_customervisible' + invoice_index + '" tabindex="1" />').prop("checked", invoice.CustomerVisible); - if (invoice.Status === InvoiceStatus.Draft || invoice.Status === InvoiceStatus.Revoked) - ipt.attr('disabled', true); - else - ipt.attr('disabled', false); - ipt.change(invoice_index, function (e) { - ChangeWOInvoiceCustomerVisible(e.data, $(e.target).prop("checked")); - }); - td.append(ipt); - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WOS_NOTES_COLON', 'Notes:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - ipt = $('<textarea id="dialog_invoice_notes' + invoice_index + '" tabindex="1" maxlength="500" style="width: 480px; height: 80px; margin-top: 5px;" ></textarea>').val(invoice.Notes).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); - td.append(ipt); - - if (invoice.Status === InvoiceStatus.Draft) { - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ATTACHMENTS_COLON', ' Attachments:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - var div_att = $('<div></div>'); - td.append(div_att); - - if (!WOReadOnly) { - var span_addfile = $('<span class="sbutton iconadd" onclick="openWOInvoiceAttachmentDialog(' + invoice_index + ');" />').text(GetTextByKey('P_FR_ADDFILE', 'Add File...')); - div_att.append(span_addfile); - } - } - - tr = $('<tr id="tr_invoice_atts' + invoice_index + '"></tr>'); - table.append(tr); - td = $('<td class="label" style="vertical-align:top;"></td>').text(invoice.Status === InvoiceStatus.Draft ? "" : GetTextByKey('P_WO_ATTACHMENTS_COLON', 'Attachments:')); - tr.append(td); - td = $('<td colspan="3"></td>'); - tr.append(td); - var tb_att = $('<table id="tab_invoice_attachments' + invoice_index + '" style="border: 1px solid #a8a8a8; line-height: 25px; width: 480px; display: none;"></table>'); - td.append(tb_att); - var tr_att = $('<tr></tr>'); - tb_att.append(tr_att); - var td_att = $('<td></td>'); - tr_att.append(td_att); - div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); - td_att.append(div_att); - tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>'); - div_att.append(tb_att); - - showInvoiceAttachment(invoice_index); - - - tr = $('<tr></tr>'); - table.append(tr); - td = $('<td colspan="4" style="text-align: right; height: 33px"></td>'); - tr.append(td); - ipt = $('<input type="button" style="width: 80px; height: 25px;" id="btn_invoice_save' + invoice_index + '" onclick="onSaveWorkOrderInvoice(' + invoice_index + ')" />').val(GetTextByKey('P_WO_SAVE', 'Save')).hide(); - td.append(ipt); - ipt = $('<input type="button" style="width: 80px; height: 25px;margin-left:20px;" id="btn_invoice_publish' + invoice_index + '" onclick="openPublishInvoiceDialog(' + invoice_index + ')" />').val(GetTextByKey('P_WO_PUBLISH', 'Publish')).hide(); - td.append(ipt); - //ipt = $('<input type="button" style="width: 100px; height: 25px;margin-left:20px;" id="btn_invoice_markaspaid' + invoice_index + '" onclick="openWOInvoiceMarkPaidDialog(' + invoice_index + ')" />').val(GetTextByKey('P_WO_XXXXXX', 'Mark As Paid')).hide(); - //td.append(ipt); - //ipt = $('<input type="button" style="width: 80px; height: 25px;margin-left:20px;" id="btn_invoice_revoke' + invoice_index + '" onclick="OnRevokeInvoice(' + invoice_index + ')" />').val(GetTextByKey('P_WO_REVOKE', 'Revoke')).hide(); - //td.append(ipt); - - if (!WOReadOnly) { - if (invoice.Status === InvoiceStatus.Draft) { - $('#btn_invoice_publish' + invoice_index).show(); - $('#btn_invoice_save' + invoice_index).show(); - } - - if (invoice.Status === InvoiceStatus.Pending) { - $('#btn_invoice_revoke' + invoice_index).show(); - } - if (invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.PaymentCreated) { - $('#btn_invoice_markaspaid' + invoice_index).show(); - } - } - if (disabled || WOReadOnly) - setInvoiceDisabled(invoice_index, true); - - if (invoice.Status === InvoiceStatus.PaymentCreated || - invoice.Status === InvoiceStatus.Failed) { - $('#span_invoice_status' + invoice_index).css('color', 'red'); - $('#dialog_invoice_status' + invoice_index).css('color', 'red'); - } - if (invoice.Status === InvoiceStatus.Paid || invoice.Status === InvoiceStatus.ManualPaid) { - $('#span_invoice_status' + invoice_index).css('color', '#2eda2e'); - $('#dialog_invoice_status' + invoice_index).css('color', '#2eda2e'); - } -} - -function OnRevokeInvoice(index) { - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - showConfirm(GetTextByKey("P_WO_CONFIRM_REVOKE_INVOICE", 'Do you want to revoke the invoice?'), GetTextByKey("P_WO_REVOKE_INVOICE", 'Revoke Invoice'), function () { - worequest("RevokeWorkOrderInvoice", invoice.Id, function (data) { - if (data === "OK") { - getInvoices(); - } - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILED_REVOKE_INVOICE", 'Failed to revoke this invoice.'), GetTextByKey("P_WO_REVOKE_INVOICE", 'Revoke Invoice')); - }); - }); -} - -function CancelPayment(index) { - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - showConfirm(GetTextByKey("P_WO_CONFIRM_XXXXXX_INVOICE", 'Are you sure you want to Cancel the Payment?'), GetTextByKey("P_WO_XXXXXX_INVOICE", 'Cancel Invoice'), function () { - worequest("CancelPayment", invoice.Id, function (data) { - if (data === "OK") { - getInvoices(); - } - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILED_REVOKE_INVOICE", 'Failed to cancel this payment.'), GetTextByKey("P_WO_XXXXXX_INVOICE", 'Cancel Invoice')); - }); - }); -} - -function ChangeWOInvoiceCustomerVisible(index, visible) { - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - worequest("ChangeWOInvoiceCustomerVisible", JSON.stringify([invoice.Id, visible ? 1 : 0]), function (data) { - }, function (err) { - }); -} - -function OnDeleteInvoice(index) { - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - showConfirm(GetTextByKey("P_WO_CONFIRM_DELETE_INVOICE", 'Do you want to delete the invoice?'), GetTextByKey("P_WO_DELETE_INVOICE", 'Delete Invoice'), function () { - worequest("DeleteWorkOrderInvoice", invoice.Id, function (data) { - if (data === "OK") { - getInvoices(); - } - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILED_DELETE_INVOICE", 'Failed to delete this invoice.'), GetTextByKey("P_WO_DELETE_INVOICE", 'Delete Invoice')); - }); - }); -} - -function onAddWorkOrderInvoice() { - var status = parseInt($('#dialog_invoice_status').val()); - if (status == InvoiceStatus.Pending) { - openPublishInvoiceDialog(-1); - } - else - onSaveWorkOrderInvoice(""); -} - -function onSaveWorkOrderInvoice(index, next) { - var invoiceid = -1; - var status = 0; - var alerttitle = GetTextByKey("P_WO_ADDINVOICE", "Add Invoice"); - if (index !== "") { - alerttitle = GetTextByKey("P_WO_EDITINVOICE", "Edit Invoice"); - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - invoiceid = invoice.Id; - status = invoice.Status; - } - else - status = parseInt($('#dialog_invoice_status').val()); - - var item = { - 'Id': invoiceid, - 'WorkOrderId': workorderid, - 'Status': status, - 'InvoiceNumber': $('#dialog_invoice_number' + index).val(), - 'TotalCost': $('#dialog_invoice_totalcosts' + index).val(), - 'OtherCost': $('#dialog_invoice_othercost' + index).val(), - 'PartsCost': $('#dialog_invoice_partscost' + index).val(), - 'TravelCost': $('#dialog_invoice_traveltimecost' + index).val(), - 'LaborCost': $('#dialog_invoice_laborcost' + index).val(), - 'Taxes': $('#dialog_invoice_taxes' + index).val(), - 'Notes': $('#dialog_invoice_notes' + index).val(), - 'CustomerVisible': $('#dialog_invoice_customervisible' + index).prop("checked"), - 'PaymentMethod': $('#dialog_invoice_paymentby' + index).val(), - 'CheckNumber': $('#dialog_invoice_checknumber' + index).val(), - }; - - if (isNaN(item.TotalCost) || item.TotalCost < 0) { - showAlert(GetTextByKey('P_WO_TOTALCOST_INVALID', 'Total cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_totalcosts' + index).focus() }); - return; - } - if (isNaN(item.OtherCost) || item.OtherCost < 0) { - showAlert(GetTextByKey('P_WO_OTHERCOST_INVALID', 'Other cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_othercost' + index).focus() }); - return; - } - if (isNaN(item.PartsCost) || item.PartsCost < 0) { - showAlert(GetTextByKey('P_WO_PARTSCOST_INVALID', 'Parts cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_partscost' + index).focus() }); - return; - } - if (isNaN(item.TravelCost) || item.TravelCost < 0) { - showAlert(GetTextByKey('P_WO_TRAVELTIMECOST_INVALID', 'Travel time cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_traveltimecost' + index).focus() }); - return; - } - if (isNaN(item.LaborCost) || item.LaborCost < 0) { - showAlert(GetTextByKey('P_WO_LABORCOST_INVALID', 'Labor cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_laborcost' + index).focus() }); - return; - } - if (isNaN(item.Taxes) || item.Taxes < 0) { - showAlert(GetTextByKey('P_WO_TAXES_INVALID', 'Taxes is not a valid number.'), alerttitle, function () { $('#dialog_invoice_taxes' + index).focus() }); - return; - } - if (status == InvoiceStatus.Pending) { - if (item.TotalCost <= 0) { - showAlert(GetTextByKey('P_WO_TOTALCOST_MUST_POSITIVE', 'Total cost must be a positive number.'), alerttitle, function () { $('#dialog_invoice_totalcosts' + index).focus() }); - return; - } - } - if ((status == InvoiceStatus.Pending || status == InvoiceStatus.ManualPaid) - && !item.CustomerVisible) { - var msg = GetTextByKey("P_WO_XXX", "Invoice will not be displayed on Customer Facing Page.<br/> Do you want to:"); - showInvoiceConfirm(msg, alerttitle, - function () { - $('#dialog_invoice_customervisible' + index).prop("checked", true) - item.CustomerVisible = true; - doSaveWorkOrderInvoice(item, index, next, alerttitle); - }, function () { - doSaveWorkOrderInvoice(item, index, next, alerttitle); - }, null); - } - else - doSaveWorkOrderInvoice(item, index, next, alerttitle); -} - -function doSaveWorkOrderInvoice(item, index, next, alerttitle) { - $('#btn_invoice_save' + index).attr('disabled', true); - var param = JSON.stringify(item); - param = htmlencode(param); - worequest("SaveWorkOrderInvoice", param, function (data) { - if (typeof (data) === "string") { - $('#btn_invoice_save' + index).attr('disabled', false); - showAlert(data, alerttitle); - } else { - $('#btn_invoice_save' + index).attr('disabled', false); - item.Id = data; - - if (index === "") {//新增 - if (add_invoice_filedatas && add_invoice_filedatas.length > 0) { - SaveInvoiceAttachmentFiles(add_invoice_filedatas, data); - add_invoice_filedatas = []; - } - - if (next) - next("", data); - else { - getInvoices(); - } - - hideInvoicePopup(); - } - else {//编辑 - if (next) - next("", data); - else { - showAlert(GetTextByKey("P_WO_SAVSUCCESSFULLY", "Saved successfully."), alerttitle); - $('#span_invoice_number' + index).text($('#dialog_invoice_number' + index).val()); - } - } - } - }, function (err) { - $('#btn_invoice_save' + index).attr('disabled', false); - console.log(err); - showAlert(GetTextByKey("P_WO_FAILED_SAVE_INVOICE", 'Failed to save invoice.'), alerttitle); - }); -} - -function OnAddInvoice() { - add_invoice_filedatas = []; - $('#tab_invoice_atts').empty(); - $('#tab_invoice_attachments').hide(); - if (!workorderid || workorderid === "") { - showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDINVOICE", "Add Invoice")); - return; - } - - $('#dialog_invoice_number').val(""); - $('#dialog_invoice_status').val("0"); - $('#tr_payment').hide(); - $('#dialog_invoice_totalcosts').val(""); - $('#dialog_invoice_othercost').val(""); - $('#dialog_invoice_partscost').val(""); - $('#dialog_invoice_traveltimecost').val(""); - $('#dialog_invoice_laborcost').val(""); - $('#dialog_invoice_taxes').val(""); - $('#dialog_invoice_notes').val(""); - $("#dialog_invoice_customervisible").prop('checked', false).attr('disabled', true); - $('#dialog_invoice_paymentby').val("Credit Card"); - $('#dialog_invoice_checknumber').val(""); - if (workorderdata) { - $('#dialog_invoice_number').val(workorderdata.InvoiceNumber || ''); - $('#dialog_invoice_totalcosts').val(workorderdata.WorkOrderTotalCost == 0 ? "" : workorderdata.WorkOrderTotalCost); - $('#dialog_invoice_othercost').val(workorderdata.OtherCost == 0 ? "" : workorderdata.OtherCost); - $('#dialog_invoice_partscost').val(workorderdata.PartsCost == 0 ? "" : workorderdata.PartsCost); - $('#dialog_invoice_traveltimecost').val(workorderdata.TravelTimeCost == 0 ? "" : workorderdata.TravelTimeCost); - $('#dialog_invoice_laborcost').val(workorderdata.LaborCost == 0 ? "" : workorderdata.LaborCost); - $('#dialog_invoice_taxes').val(workorderdata.Taxes == 0 ? "" : workorderdata.Taxes); - //getInvoiceTotalCost(""); - } - - showInvoicePopup(); -} - -function inputInvoiceChanged(index) { - $('#tabinvoice' + index).data('changed', true); -} - -function setInvoiceDisabled(index, di) { - $('#dialog_invoice_number' + index).attr('disabled', di); - $('#dialog_invoice_totalcosts' + index).attr('disabled', di); - $('#dialog_invoice_othercost' + index).attr('disabled', di); - $('#dialog_invoice_partscost' + index).attr('disabled', di); - $('#dialog_invoice_traveltimecost' + index).attr('disabled', di); - $('#dialog_invoice_laborcost' + index).attr('disabled', di); - $('#dialog_invoice_taxes' + index).attr('disabled', di); - $('#dialog_invoice_notes' + index).attr('disabled', di); - //$('#dialog_invoice_status' + index).attr('disabled', di); - //$('#dialog_invoice_customervisible' + index).attr('disabled', di); -} - -function getInvoiceTotalCost(index) { - var othercost = $('#dialog_invoice_othercost' + index).val(); - var partscost = $('#dialog_invoice_partscost' + index).val(); - var traveltimecost = $('#dialog_invoice_traveltimecost' + index).val(); - var laborcost = $('#dialog_invoice_laborcost' + index).val(); - var totalcost = 0; - if (othercost !== "" && !isNaN(othercost)) - totalcost += eval(othercost); - if (partscost !== "" && !isNaN(partscost)) - totalcost += eval(partscost); - if (traveltimecost !== "" && !isNaN(traveltimecost)) - totalcost += eval(traveltimecost); - if (laborcost !== "" && !isNaN(laborcost)) - totalcost += eval(laborcost); - $('#dialog_invoice_totalcosts' + index).val(locale(totalcost, true)); -} - -function locale(num, disabled) { - if (!disabled) { - return num; - } - var backup = num; - if (typeof num !== 'number') { - num = Number(num); - } - if (isNaN(num)) { - return backup; - } - var s = num.toFixed(2); - var array = s.split('.'); - var integer = array[0].split('').reverse().join('').replace(/(\d{3})+?/g, function (s) { return s + ',' }).split('').reverse().join(''); - if (integer[0] == ',') { - integer = integer.substring(1); - } - return integer + '.' + array[1]; -} - -var InvoiceStatus = { - Draft: 0, - Pending: 1, - Cancelled: 2, - PaymentCreated: 3, - Paid: 4, - Failed: 5, - ManualPaid: 6, - Revoked: 10 -}; - -function getInvoiceStatus(s) { - var text = ""; - if (s === InvoiceStatus.Draft) - text = GetTextByKey('P_WO_DRAFT', 'Draft'); - else if (s === InvoiceStatus.Pending) - text = GetTextByKey('P_WO_AWATING_PAYMENT', 'Awaiting Payment'); - else if (s === InvoiceStatus.Cancelled) - text = GetTextByKey('P_WO_CANCELLEDBYDEALER', 'Cancelled by Dealer'); - else if (s === InvoiceStatus.PaymentCreated) - text = GetTextByKey('P_WO_AWATING_PAYMENT', 'Awaiting Payment'); - else if (s === InvoiceStatus.Paid || s === InvoiceStatus.ManualPaid) - text = GetTextByKey('P_WO_CUSTOMER_PAID', 'Customer Paid'); - else if (s === InvoiceStatus.Failed) - text = GetTextByKey('P_WO_PAYMENT_FAILURE', 'Payment Failure'); - else if (s === InvoiceStatus.Revoked) - text = GetTextByKey('P_WO_REVOKED', 'Revoked'); - else if (s === 100) - text = ""; - return text; -} - -function showPublishInvoicePopup() { - $('#popup_publish_invoice_mask').css('height', $('#dialog_workorder').height()); - $('#popup_publish_invoice_mask').show(); - $('#dialog_publish_invoice').show(); - $('#dialog_invoice_textmsg').val(WorkorderParams.InvoiceMessage); - $('#dialog_publish_invoice').css({ - "top": ($("#popup_publish_invoice_mask").height() - $('#dialog_publish_invoice').height()) / 3, - "left": ($("#popup_publish_invoice_mask").width() - $('#dialog_publish_invoice').width()) / 3 - }); - - $('#dialog_invoice_phonenum').focus(); -} - -function hidePublishInvoicePopup() { - publish_invoice_index = 0; - $('#popup_publish_invoice_mask').hide(); - $('#dialog_publish_invoice').hide(); -} - -function openPublishInvoiceDialog(index) { - if (index == -1) { - publish_invoice_index = index; - showPublishInvoicePopup(); - } - else { - onSaveWorkOrderInvoice(index, function () { - publish_invoice_index = index; - showPublishInvoicePopup(); - }); - } -} - -function onPublishInvoice() { - var changed = $('#tabinvoice' + publish_invoice_index).data('changed'); - if (publish_invoice_index === -1)//add and publish - changed = true; - if (changed) - onSaveWorkOrderInvoice(publish_invoice_index === -1 ? "" : publish_invoice_index, PublishInvoice) - else - PublishInvoice(publish_invoice_index); -} - -function PublishInvoice(index, invoiceid) { - if (index !== "") { - var invoice = $('#tabinvoice' + index).data('invoice'); - invoiceid = invoice.Id; - } - - if (!invoiceid) - return; - - var pmemails = []; - var checked = $('#dialog_invoice_chksendtextmsg').prop('checked'); - if (checked) { - var phoneemail = $('#dialog_invoice_phonenum').val(); - if (phoneemail !== "") { - var phoneemails = phoneemail.split(';'); - for (var i = 0; i < phoneemails.length; i++) { - var pm = phoneemails[i]; - if (checkPhoneNumber(pm) || isEmail(pm)) { - pmemails.push({ 'Key': pm, 'Value': pm }); - } - else { - if (customercontacts) { - for (var j = 0; j < customercontacts.length; j++) { - var c = customercontacts[j]; - if (c.OptOut || c.OptOut_BC) continue; - var mp = $.trim(c.MobilePhone); - var email = $.trim(c.Email); - if (c.Name === pm) { - if (c.ContactPreference == "0" && checkPhoneNumber(mp)) { - pmemails.push({ 'Key': mp, 'Value': pm }); - break; - } - if (c.ContactPreference == "1" && isEmail(email)) { - pmemails.push({ 'Key': email, 'Value': pm }); - break; - } - } - } - } - } - } - } - } - - var msg = $('#dialog_invoice_textmsg').val(); - var includeStatusLink = $('#dialog_invoice_chkIncludeStatusLink').prop("checked"); - - var param = JSON.stringify([invoiceid, workorderid, JSON.stringify(pmemails), msg, (includeStatusLink ? "1" : "0")]); - param = htmlencode(param); - - worequest("PublishInvoiceToCustomer", param, function (data) { - if (data !== "") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - getInvoices(); - hidePublishInvoicePopup(); - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILED_PUBLISH_INVOICE", 'Failed to publish this invoice.'), GetTextByKey("P_WO_PUBLISH_INVOICE", 'Publish Invoice')); - }); -} - -function SaveInvoiceAttachmentFiles(filedatas, invoiceid, index) { - var formData = new FormData(); - var notesdata = []; - for (var i = 0; i < filedatas.length; i++) { - formData.append("iconFile" + i, filedatas[i].File); - notesdata.push(encodeURIComponent(filedatas[i].Notes)); - } - var p = JSON.stringify([invoiceid, JSON.stringify(notesdata)]); - formData.append("MethodName", "AddInvoiceAttachment"); - formData.append("ClientData", p); - var url = 'AddWorkOrder.aspx'; - $.ajax({ - url: url, - type: 'POST', - dataType: 'json', - processData: false, - contentType: false, - data: formData, - async: true, - success: function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); - } else { - if (index) { - hideWOInvoiceAttachmentPopup(); - getInvoiceAttachment(index); - } - else - getInvoices(); - } - }, - error: function (err) { - showAlert(err.statusText, GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); - } - }); -} - - -function getInvoiceAttachment(index) { - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - - $('#tab_invoice_atts' + index).empty(); - $('#tab_invoice_attachments' + index).hide(); - - worequest("GetWorkOrderInvoiceAttachments", invoice.Id, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - if (data && data.length > 0) { - showInvoiceAttachment(index, data); - } - - }, function (err) { - }); -} - -function showInvoiceAttachment(index, atts) { - var candelete = false; - if (!atts) { - var invoice = $('#tabinvoice' + index).data('invoice'); - if (!invoice) - return; - atts = invoice.Attachments; - if (invoice.Status === InvoiceStatus.Draft || invoice.Status === InvoiceStatus.Revoked) - candelete = true; - } - else - candelete = true; - - $('#tab_invoice_atts' + index).empty(); - $('#tab_invoice_attachments' + index).hide(); - if (atts && atts.length > 0) { - $('#tab_invoice_attachments' + index).show(); - for (var i = 0; i < atts.length; i++) { - var att = atts[i]; - var tr = $('<tr></tr>').attr('id', att.AttachmentId); - var tdfile = $('<td style=""></td>'); - var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(att.Notes === "" ? att.FileName : att.Notes).click(function () { - window.open("../filesvc.ashx?attchid=" + this.parentElement.parentElement.id + "&sourceType=woestimateattachment"); - }); - var span = $('<span></span>').text(att.AddedByName).css("margin-right", 5).css("margin-left", 5).css("color", "black"); - var spanby = $('<span></span>').text(att.AddedOnLocalStr).css("color", "black"); - tdfile.append(filename, span, spanby); - - if (!WOReadOnly && candelete) { - var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); - var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('index', index).click(function () { - deleteInvoiceAttachment(this.parentElement.parentElement.id, $(this).data('index')); - }); - tdimg.append(imgDom); - tr.append(tdimg); - } - tr.append(tdfile).appendTo($('#tab_invoice_atts' + index)); - } - } -} - -function deleteInvoiceAttachment(attid, index) { - if (confirm(GetTextByKey("P_WO_DELETEATTACHMENTTIPS", "Are you sure you want to delete the attachment?"))) { - worequest("DeleteInvoiceAttachment", attid, function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); - } - else { - getInvoiceAttachment(index); - } - }, function (err) { }); - } -} - -function hideWOInvoiceAttachmentPopup() { - $('#popup_woinvoice_attachment_mask').hide(); - $('#dialog_woinvoice_attachment').hide(); -} - -function openWOInvoiceAttachmentDialog(index) { - cur_invoice_uploaddata = undefined; - cur_invoice_uploadindex = index; - $('#btn_woinvoice_att_save').attr('disabled', false); - $('#tab_woinvoice_atts').empty(); - $('#tab_woinvoice_attachments').hide(); - $('#popup_woinvoice_attachment_mask').css('height', $('#dialog_workorder').height()); - $('#popup_woinvoice_attachment_mask').show(); - $('#dialog_woinvoice_attachment').show(); - $('#dialog_invoice_att_notes').val(''); - $('#dialog_woinvoice_attachment').css({ - "top": ($("#popup_woinvoice_attachment_mask").height() - $('#dialog_woinvoice_attachment').height()) / 3, - "left": ($("#popup_woinvoice_attachment_mask").width() - $('#dialog_woinvoice_attachment').width()) / 3 - }); - - $('#dialog_invoice_att_notes').focus(); -} - - -function dragOverAddInvoiceAttachment(ev) { - ev.preventDefault(); - ev.dataTransfer.dropEffect = 'link'; -} - -function dropAddInvoiceAttachment(ev) { - ev.preventDefault(); - ev.stopPropagation(); - var df = ev.dataTransfer; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - if (files.length > 0) { - for (var i = 0; i < files.length; i++) { - cur_invoice_uploaddata = files[i]; - onSaveWOInvoiceAttachment(); - } - } -} - -function cutAddInvoiceAttachment(ev) { - ev.stopPropagation(); - var df = ev.clipboardData; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - - if (file.size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return; - } - if (file.size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return; - } - - files.push({ 'File': file, 'Notes': '' }); - } - } - } - - if (files.length > 0) { - for (var i = 0; i < files.length; i++) { - cur_invoice_uploaddata = files[i]; - onSaveWOInvoiceAttachment(); - } - } -} - -function UpLoadInvoiceAttachment() { - var file = $('<input type="file" style="display: none;" />'); - file.change(function () { - var files = this.files; - if (files.length == 0) - return; - - if (files[0].size == 0) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - return false; - } - if (files[0].size > 50 * 1024 * 1024) { - alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - return false; - } - var notes = $('#dialog_invoice_att_notes').val(); - cur_invoice_uploaddata = { 'File': files[0], 'Notes': notes }; - createNewInvoiceAttachment(cur_invoice_uploaddata); - - }).click(); -} - -function createNewInvoiceAttachment(data) { - $('#tab_woinvoice_atts').empty(); - $('#tab_woinvoice_attachments').show(); - var tr = $('<tr></tr>'); - var tdfile = $('<td style=""></td>'); - var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(data.Notes === "" ? data.File.name : data.Notes); - tdfile.append(filename); - - var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); - var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').click(function () { - this.parentElement.parentElement.remove(); - cur_invoice_uploaddata = undefined; - $('#tab_woinvoice_attachments').hide(); - }); - tdimg.append(imgDom); - tr.append(tdimg); - - tr.append(tdfile).appendTo($('#tab_woinvoice_atts')); -} - -function onSaveWOInvoiceAttachment() { - if (!cur_invoice_uploaddata) - return; - - $('#btn_woinvoice_att_save').attr('disabled', true); - var invoice = $('#tabinvoice' + cur_invoice_uploadindex).data('invoice'); - var notes = $('#dialog_invoice_att_notes').val(); - cur_invoice_uploaddata.Notes = notes; - - if (!invoice) { - add_invoice_filedatas.push(cur_invoice_uploaddata); - createAddInvoiceAttachment(cur_invoice_uploaddata); - hideWOInvoiceAttachmentPopup(); - $('#btn_woinvoice_att_save').attr('disabled', false); - } - else { - SaveInvoiceAttachmentFiles([cur_invoice_uploaddata], invoice.Id, cur_invoice_uploadindex); - } -} - -function createAddInvoiceAttachment(data) { - var notes = data.Notes; - var file = data.File; - $('#tab_invoice_attachments').show(); - var tr = $('<tr></tr>'); - var tdfile = $('<td style=""></td>'); - var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(notes === "" ? file.name : notes); - tdfile.append(filename); - - var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); - var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('filedata', data).click(function () { - this.parentElement.parentElement.remove(); - var fd = $(this).data('filedata'); - add_invoice_filedatas.splice(add_invoice_filedatas.indexOf(fd), 1); - if (add_invoice_filedatas.length == 0) - $('#tab_invoice_attachments').hide(); - }); - tdimg.append(imgDom); - tr.append(tdimg); - - tr.append(tdfile).appendTo($('#tab_invoice_atts')); -} - - - -function hideWOInvoiceMakePaidPopup() { - $('#popup_woinvoice_markpaid_mask').hide(); - $('#dialog_woinvoice_markpaid').hide(); -} - -function openWOInvoiceMarkPaidDialog(index) { - cur_invoice_uploadindex = index; - $('#btn_woinvoice_maikpaid_save').attr('disabled', false); - $('#popup_woinvoice_markpaid_mask').css('height', $('#dialog_workorder').height()); - $('#popup_woinvoice_markpaid_mask').show(); - $('#dialog_woinvoice_markpaid').show(); - $('#dialog_invoice_markpaid_paymentby').val("Credit Card"); - $('#dialog_invoice_markpaid_number').val(''); - $('#dialog_woinvoice_markpaid').css({ - "top": ($("#popup_woinvoice_markpaid_mask").height() - $('#dialog_woinvoice_markpaid').height()) / 3, - "left": ($("#popup_woinvoice_markpaid_mask").width() - $('#dialog_woinvoice_markpaid').width()) / 3 - }); - - $('#dialog_invoice_markpaid_paymentby').focus(); -} - - -function OnMarkAsPaid() { - var changed = $('#tabinvoice' + cur_invoice_uploadindex).data('changed'); - if (changed) - onSaveWorkOrderInvoice(cur_invoice_uploadindex, MarkAsPaid) - else - MarkAsPaid(); -} - -function MarkAsPaid() { - var invoice = $('#tabinvoice' + cur_invoice_uploadindex).data('invoice'); - var item = [invoice.Id, $('#dialog_invoice_markpaid_paymentby').val(), $('#dialog_invoice_markpaid_number').val()]; - var param = JSON.stringify(item); - param = htmlencode(param); - - $("#dialog_woinvoice_markpaid .maskbg").show(); - worequest('MarkAsPaid', param, function (data) { - $("#dialog_woinvoice_markpaid .maskbg").hide(); - if (data === 'OK') { - hideWOInvoiceMakePaidPopup(); - getInvoices(); - } - }, function (err) { - $("#dialog_woinvoice_markpaid .maskbg").hide(); - }); -} - - - -/*****************************************End Invoice*********************************************/ - - /*****************************************Begin Completed Status**************************************************/ var cur_exit = 0; @@ -3350,20 +467,17 @@ var cur_callback = undefined; function openCompletedStatusDialog(exit, callback) { cur_exit = exit; cur_callback = callback; - $('#popupecompletedstatusmask').css('height', $('#dialog_workorder').height()); - $('#popupecompletedstatusmask').show(); - $('#dialog_completedstatus').show(); - $('#dialog_completed_status').dropdownVal(''); - $('#dialog_completedstatus').css({ - "top": ($("#popupecompletedstatusmask").height() - $('#dialog_completedstatus').height()) / 3, - "left": ($("#popupecompletedstatusmask").width() - $('#dialog_completedstatus').width()) / 3 - }); - $('#dialog_completed_status').focus(); + $('#dialog_completed_status').dropdownVal(''); + showmaskbg(true); + $('#dialog_completedstatus').css({ + 'top': (document.documentElement.clientHeight - $('#dialog_completedstatus').height()) / 3, + 'left': (document.documentElement.clientWidth - $('#dialog_completedstatus').width()) / 2 + }).showDialogfixed(); } function hideCompletedStatusPopup() { - $('#popupecompletedstatusmask').hide(); + showmaskbg(false); $('#dialog_completedstatus').hide(); } @@ -3376,182 +490,3 @@ function onSaveCompletedStatus() { } /*****************************************End Completed Status**************************************************/ - -function createSegment(p_div) { - var div = $('<div class="function_title"></div>'); - p_div.append(div); - var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDSEGMENT">Add Segment</span>'); - span_add.click(OnAddSegment); - div.append(span_add); -} - -function createEstimate(p_div) { - var div = $('<div class="function_title"></div>'); - p_div.append(div); - var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDESTIMATE">Add Estimate</span>'); - span_add.click(OnAddEstimate); - div.append(span_add); -} - -function createInvoice(p_div) { - var div = $('<div class="function_title"></div>'); - p_div.append(div); - var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDINVOICE">Add Invoice</span>'); - span_add.click(OnAddInvoice); - div.append(span_add); -} - -function createAlert(p_div) { - var div_ftitle = $('<div class="function_title"></div>'); - p_div.append(div_ftitle); - var span_add = $('<span class="sbutton iconadd" id="span_addalerts" data-lgid="P_WO_ADDALERTS">Add Alerts</span>'); - span_add.click(OnAddAlerts); - div_ftitle.append(span_add); - var span_del = $('<span class="sbutton icondelete" id="span_removealerts" data-lgid="P_WO_REMOVEALERTS">Remove Alerts</span>'); - span_del.click(OnRemoveAlerts); - div_ftitle.append(span_del); - - p_div.append('<div class="clear"></div>'); - - //DTC Alerts - var divdtcalerts = $('<div id="divdtcalerts" style="height: 260px; display: none;"></div>'); - divdtcalerts.append('<div class="subtitle"><span data-lgid="P_WO_DTCALERTS">DTC Alerts</span></div>'); - divdtcalerts.append('<div id="dtcalertslist"></div>'); - p_div.append(divdtcalerts); - - //PM Alerts - var divpmaalerts = $('<div id="divpmaalerts" style="height: 260px;"></div>'); - var divpmaalerts_title = $('<div class="subtitle"></div>'); - var span_addpmalerts = $('<span class="sbutton iconadd" id="btnaddpmalerts" style="color: black;" data-lgid="P_WO_ADDPMALERTS">Add PM Alerts (Alerts not yet triggered)</span>'); - span_addpmalerts.click(OnAddAllPMSchedules); - divpmaalerts_title.append('<span data-lgid="P_WO_PMALERTS">PM Alerts</span>'); - divpmaalerts_title.append(span_addpmalerts); - divpmaalerts.append(divpmaalerts_title); - divpmaalerts.append('<div id="pmaalertslist"></div>'); - p_div.append(divpmaalerts); - - //Inspect Alerts - var divispalerts = $('<div id="divinspectalerts" style="height: 260px; display: none;"></div>'); - divispalerts.append('<div class="subtitle"><span data-lgid="P_WO_INSPECTALERTS">Inspect Alerts</span></div>'); - divispalerts.append('<div id="inspectalertslist"></div>'); - p_div.append(divispalerts); - - //Oil Alerts - var divoilalerts = $('<div id="divoilalerts" style="height: 260px; display: none;"></div>'); - divoilalerts.append('<div class="subtitle"><span data-lgid="P_WO_OILALERTS">Oil Alerts</span></div>'); - divoilalerts.append('<div id="oilalertslist"></div>'); - p_div.append(divoilalerts); -} - -function createAttachment(p_div) { - var div_ftitle = $('<div class="function_title"></div>'); - p_div.append(div_ftitle); - var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDFILE">Add File</span>'); - span_add.click(UpLoadWorkOrderAttachment); - div_ftitle.append(span_add); - var span_print = $('<span id="spPrint" class="sbutton iconprint" data-lgid="P_WO_PRINT">Print</span>'); - span_print.click(function () { openPAndDGDialog(0) }); - div_ftitle.append(span_print); - var span_view = $('<span class="sbutton iconviewatt" id="span_viewatttype" data-lgid="P_WO_XXX">View</span>'); - div_ftitle.append(span_view); - - //View Menu - var div_viewmenu = $('<div class="panel_holder attviewtypemenus"></div>'); - p_div.append(div_viewmenu); - var attviewtypemenu_panel = $('<div id="attviewtypemenu_panel" class="panel" style="min-width: 150px; background-color: white;"></div>'); - div_viewmenu.append(attviewtypemenu_panel); - var viewmenu_ul = $('<ul class="lefttitlemenu_ul" style="line-height: 32px;"></ul>') - attviewtypemenu_panel.append(viewmenu_ul); - var viewlarge_li = $('<li><a style="padding-left: 0;"><span class="sbutton iconlarge" data-lgid="P_WO_XXX">Large</span></a></li>'); - viewlarge_li.click(function () { onViewAttachment(0); }); - viewmenu_ul.append(viewlarge_li); - var viewlist_li = $('<li> <a style="padding-left: 0;"><span class="sbutton iconlist" data-lgid="P_WO_XXX">List</span></a></li>'); - viewlist_li.click(function () { onViewAttachment(1); }); - viewmenu_ul.append(viewlist_li); - attviewtypemenu_panel.append('<div class="trigledown"></div>'); - attviewtypemenu_panel.append('<div class="trigledown white"></div>'); - p_div.append('<div id="dialogattdragmask" class="maskbg" style="display: none; z-index: 501;"></div>'); - - //Large - var div_attlarge = $('<div id="div_attlarge"></div>'); - p_div.append(div_attlarge); - //WO Attachments Large - var tb_woattlarge = $('<table id="tb_woattlarge" class="main_table maintenance" ondrop="dropWOAttachment(event)" ondragover="dragOverWOAttachment(event)" onpaste="cutWOAttachment(event)"></table>'); - div_attlarge.append(tb_woattlarge); - tb_woattlarge.append('<tr style="line-height: 35px;"><td class="subtitle"><span class="sbutton iconchevrondown woattafoldicon" target="woaatts_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span><span data-lgid="P_WO_WORKORDERATTACHMENTS">Work Order Attachments</span></td></tr>'); - tb_woattlarge.append('<tr id="woaatts_tr" class="tr_intervals woattafoldtr"><td><div id="div_woatts" style="min-height: 80px; overflow: auto; padding-left: 20px;"></div></td></tr>'); - //Asset Attachments Large - var tb_assetattlarge = $('<table class="main_table maintenance"></table>'); - div_attlarge.append(tb_assetattlarge); - tb_assetattlarge.append('<tr style="line-height: 35px;"><td class="subtitle"><span class="sbutton iconchevrondown woattafoldicon" target="woassetatts_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span><span data-lgid="P_WO_ASSETATTACHMENTS">Asset Attachments</span></td></tr>'); - tb_assetattlarge.append('<tr id="woassetatts_tr" class="tr_intervals woattafoldtr"><td><div id="div_aatts" style="min-height: 80px; overflow: auto; padding-left: 20px;"></div></td></tr>'); - //Inspection Attachments Large - var tb_ispattlarge = $('<table class="main_table maintenance"></table>'); - div_attlarge.append(tb_ispattlarge); - tb_ispattlarge.append('<tr style="line-height: 35px;"><td class="subtitle"><span class="sbutton iconchevrondown woattafoldicon" target="woiptatts_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span><span data-lgid="P_WO_INSPECTIONATTACHMENTS">Inspection Attachments</span></td></tr>'); - tb_ispattlarge.append('<tr id="woiptatts_tr" class="tr_intervals woattafoldtr"><td><div id="div_iatts" style="min-height: 80px; overflow: auto; padding-left: 20px;"></div></td></tr>'); - - //List - var div_attlist = $('<div id="div_attlist" style="display: none;"></div>'); - p_div.append(div_attlist); - //WO Attachments List - var tb_wolist = $('<table class="main_table maintenance" ondrop="dropWOAttachment(event)" ondragover="dragOverWOAttachment(event)" onpaste="cutWOAttachment(event)"></table>'); - div_attlist.append(tb_wolist); - var tr_wolist = $('<tr style="line-height: 35px;"></tr>'); - tb_wolist.append(tr_wolist); - var td_wolist = $('<td class="subtitle"></td>'); - tr_wolist.append(td_wolist); - td_wolist.append('<span class="sbutton iconchevrondown woattafoldicon" target="woattslist_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span>'); - td_wolist.append('<span data-lgid="P_WO_WORKORDERATTACHMENTS">Work Order Attachments</span>'); - td_wolist.append('<lable class="lable_attuploadname" style="margin-left: 200px;"></lable>'); - tr_wolist = $('<tr id="woattslist_tr" class="tr_intervals woattafoldtr"></tr>'); - tb_wolist.append(tr_wolist); - td_wolist = $('<td></td>'); - tr_wolist.append(td_wolist); - var tab_woattslist = $('<table class="table_intervals"></table>'); - td_wolist.append(tab_woattslist); - tab_woattslist.append('<thead><tr><th style="width: 30px;"></th><th style="width: 60px;"></th><th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th><th style="width: 130px;" data-lgid="P_WO_AVAILABLETOCUSTOMER"></th><th class="td_funcs"></th></tr></thead>'); - tab_woattslist.append('<tbody id="woattslist_tbody"></tbody>'); - //Asset Attachments List - var tb_assetlist = $('<table class="main_table maintenance"></table>'); - div_attlist.append(tb_assetlist); - var tr_assetlist = $('<tr style="line-height: 35px;"></tr>'); - tb_assetlist.append(tr_assetlist); - var td_assetlist = $('<td class="subtitle"></td>'); - tr_assetlist.append(td_assetlist); - td_assetlist.append('<span class="sbutton iconchevrondown woattafoldicon" target="woassetattslist_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span>'); - td_assetlist.append('<span data-lgid="P_WO_ASSETATTACHMENTS">Asset Attachments</span>'); - tr_assetlist = $('<tr id="woassetattslist_tr" class="tr_intervals woattafoldtr"></tr>'); - tb_assetlist.append(tr_assetlist); - td_assetlist = $('<td></td>'); - tr_assetlist.append(td_assetlist); - var tab_assetattslist = $('<table class="table_intervals"></table>'); - td_assetlist.append(tab_assetattslist); - tab_assetattslist.append('<thead><tr><th style="width: 30px;"></th><th style="width: 60px;"></th><th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th><th style="width: 130px;"></th><th class="td_funcs"></th></<tr>></thead>'); - tab_assetattslist.append('<tbody id="woassetattslist_tbody"></tbody>'); - //Inspection Attachments List - var tb_isplist = $('<table class="main_table maintenance"></table>'); - div_attlist.append(tb_isplist); - var tr_isplist = $('<tr style="line-height: 35px;"></tr>'); - tb_isplist.append(tr_isplist); - var td_isplist = $('<td class="subtitle"></td>'); - tr_isplist.append(td_isplist); - td_isplist.append('<span class="sbutton iconchevrondown woattafoldicon" target="woiptattslist_tr" onclick="OnExpend(this)" style="margin-left: 0; padding-right: 5px;"></span>'); - td_isplist.append('<span data-lgid="P_WO_INSPECTIONATTACHMENTS">Inspection Attachments</span>'); - tr_isplist = $('<tr id="woiptattslist_tr" class="tr_intervals woattafoldtr"></tr>'); - tb_isplist.append(tr_isplist); - tb_isplist = $('<td></td>'); - tr_isplist.append(tb_isplist); - var tab_ispattslist = $('<table class="table_intervals"></table>'); - tb_isplist.append(tab_ispattslist); - tab_ispattslist.append('<thead><tr> <th style="width: 30px;"></th><th style="width: 60px;"></th><th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th><th style="width: 130px;"></th><th class="td_funcs"></th></tr></thead>'); - tab_ispattslist.append('<tbody id="woiptattslist_tbody"></tbody>'); - - var div_attuoloadmsgmenus = $('<div class="panel_holder attuoloadmsgmenus"></div>') - p_div.append(div_attuoloadmsgmenus); - var attuplodmsg_panel = $('<div id="attuplodmsg_panel" class="panel" style="min-width: 150px; background-color: white; max-width: 480px; max-height: 400px;"></div>'); - div_attuoloadmsgmenus.append(attuplodmsg_panel); - attuplodmsg_panel.append('<ul class="lefttitlemenu_ul" id="attupload_ul"></ul>') - attuplodmsg_panel.append('<div class="trigledown"></div>') - attuplodmsg_panel.append('<div class="trigledown white"></div>') -} diff --git a/Site/Maintenance/js/customerrecord.js b/Site/Maintenance/js/customerrecord.js index 667941e..bd2a966 100644 --- a/Site/Maintenance/js/customerrecord.js +++ b/Site/Maintenance/js/customerrecord.js @@ -51,7 +51,6 @@ function OnMachineAdd() { return s.Values.ID; }); dialogAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } var _selectedMachines = []; @@ -196,7 +195,7 @@ function InitGridSelectedMachines() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, diff --git a/Site/Maintenance/js/fuelrecordattachments.js b/Site/Maintenance/js/fuelrecordattachments.js index 7ede758..ba80a90 100644 --- a/Site/Maintenance/js/fuelrecordattachments.js +++ b/Site/Maintenance/js/fuelrecordattachments.js @@ -16,20 +16,20 @@ function onSaveAttachment(files) { fileupload_errors = ""; if (!fuelid) { OnSave(0, this, function () { - $('#att_mask_bg').show(); + showloading(true); if (filesinuploading.length > 0) { for (var i = 0; i < files.length; i++) filesinuploading.push(fuelid, files[i]); } else { - filesinuploading = files; + filesinuploading = files; DoUploadAttachments(fuelid); } }); return; } else { - $('#att_mask_bg').show(); + showloading(true); if (filesinuploading.length > 0) { for (var i = 0; i < files.length; i++) filesinuploading.push(files[i]); @@ -55,7 +55,7 @@ function DoUploadAttachments(fid) { getAttachments(); if (fileupload_errors !== "") showAlert(fileupload_errors, GetTextByKey("P_WO_XXXXX", 'Upload failed')); - $('#att_mask_bg').hide(); + showloading(false); return; } var file = filesinuploading[uploadingindex]; diff --git a/Site/Maintenance/js/manageworkorder.js b/Site/Maintenance/js/manageworkorder.js index 09d278b..e9418e7 100644 --- a/Site/Maintenance/js/manageworkorder.js +++ b/Site/Maintenance/js/manageworkorder.js @@ -193,7 +193,7 @@ function InitGridData() { || item.TextMessageStatus == 412)//Landline return '#FFC107'; if (!item.CommunicationAcknowledged) - return '#1E88E5'; + return '#79B6FF'; if (!item.EstimateAcknowledged) { if (item.ApprovedEstimates > 0) return '#07FF93'; @@ -202,13 +202,28 @@ function InitGridData() { } } }; + var styleFilter = function (item) { + if (item.Id.Value > 0 && IsAdvisor) { + if (item.TextMessageStatus == 0//Undelivered + || item.TextMessageStatus == 9//Failed + || item.TextMessageStatus == 10//Opt-Out + || item.TextMessageStatus == 412//Landline + || !item.CommunicationAcknowledged + || (!item.EstimateAcknowledged && (item.ApprovedEstimates > 0 || item.RejectedEstimates > 0)) + ) + return { "font-weight": "bold" }; + } + return {}; + } + if (col.name !== 'Edit' && col.name !== "Print" && col.name !== "Delete" && col.name !== "AssetAlert") + col.styleFilter = styleFilter; if (!IsCustomerRecordAllow && (col.name === "Customer")) { continue; } if (!AllowWorkOrderSurveys && (col.name === "Surveys")) { continue; } - if (!HasCustomerRecord && (col.name === "Advisor" || col.name === "CustomerCode" || col.name === "Contacts" + if (!AllowCustomer && (col.name === "Advisor" || col.name === "CustomerCode" || col.name === "Contacts" || col.name === "LastCommunication" || col.name === "LastCommunicationDate" || col.name === "LastCommunicationBy" || col.name === "AlternateStatus" || col.name === "EstimateStatus" || col.name === "Surveys" || col.name === "PublishedEstimates" || col.name === "ApprovedEstimates" || col.name === "RejectedEstimates" || col.name === "PendingEstimates" @@ -292,8 +307,8 @@ function InitGridData() { return selector; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "WorkOrderType") { @@ -333,8 +348,8 @@ function InitGridData() { updateWorkOrder(item); }); } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "Advisor") { @@ -376,8 +391,8 @@ function InitGridData() { } }); } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "AssignedToName") { @@ -463,8 +478,8 @@ function InitGridData() { }); return selector; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "DueDate") { @@ -502,8 +517,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "CompleteDate") { @@ -537,8 +552,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "NextFollowUpDate") { @@ -552,7 +567,7 @@ function InitGridData() { var color = !item.Completed && item.NextFollowUpDate.Value && new Date(item.NextFollowUpDate.Value) < new Date(currentdate) ? 'red' : null; return $('<span class="margin-input-span status-cell"></span>').css({ 'background-color': color, - 'color': 'white' + //'color': 'white' }).text(item.NextFollowUpDateStr); }; col.editFilter = function (item) { @@ -560,7 +575,7 @@ function InitGridData() { var color = !item.Completed && item.NextFollowUpDate.Value && new Date(item.NextFollowUpDate.Value) < new Date(currentdate) ? 'red' : null; return $('<span class="margin-input-span status-cell"></span>').css({ 'background-color': color, - 'color': 'white' + //'color': 'white' }).text(item.NextFollowUpDateStr); } @@ -596,8 +611,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "Description") { @@ -647,9 +662,9 @@ function InitGridData() { } } else if (col.name === 'AssetName') { - col.styleFilter = function () { - return { 'white-space': 'pre-line', 'line-height': '20px' }; - }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { 'white-space': 'pre-line', 'line-height': '20px' }); + } } else if (col.name === 'InspectionCount') { col.styleFilter = function (item) { @@ -826,12 +841,12 @@ function InitGridData() { return tb; } }; - col.styleFilter = function () { - return { + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { 'margin-top': '3px', 'margin-bottom': '0px', - }; - } + }); + }; } else if (col.name === "PartsExpectedDate") { col.allowHtml = true; @@ -868,8 +883,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "LastLaborDate") { @@ -907,8 +922,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "InspectionRequired") { @@ -933,8 +948,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%" }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%" }); } } else if (col.name === "AutoText") { @@ -959,8 +974,8 @@ function InitGridData() { } return ipt; } - col.styleFilter = function () { - return { "width": "100%" }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%" }); } } else if (col.name === "Department") { @@ -1049,8 +1064,8 @@ function InitGridData() { }); return selector; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "Location") { @@ -1139,8 +1154,8 @@ function InitGridData() { }); return selector; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "SalespersonName") { @@ -1210,8 +1225,8 @@ function InitGridData() { }); return selector; } - col.styleFilter = function () { - return { "width": "100%", 'padding': 0 }; + col.styleFilter = function (item) { + return Object.assign({}, styleFilter(item), { "width": "100%", 'padding': 0 }); } } else if (col.name === "LastCommunication") { @@ -1276,7 +1291,10 @@ function InitGridData() { grid_dt.selectedrowchanged = function (rowindex) { var rowdata = grid_dt.source[rowindex]; - if (rowdata) { + if (rowdata && rowdata.Values.Id.Value > 0) { + if (!wowidgetobj) + wowidgetobj = new WorkOrderWidget(); + wowidgetobj.changeWorkOrder(rowdata.Values); } } diff --git a/Site/Maintenance/js/wocommunication.js b/Site/Maintenance/js/wocommunication.js index 0ce3101..f92a9b4 100644 --- a/Site/Maintenance/js/wocommunication.js +++ b/Site/Maintenance/js/wocommunication.js @@ -77,7 +77,6 @@ function resetComments() { internal.text = ''; internal.load(); } - } @@ -119,168 +118,6 @@ function getCommunications(reset) { }); } -function showCommunication(txt, isfirst) { - var commoentctrl = $("#divcommunications"); - var div = $("<div class='txtdiv'></div>").appendTo(commoentctrl); - if (isfirst) - div.css("margin-top", 0); - var name = ""; - if (txt.IsReply) { - for (var i = 0; i < customercontacts.length; i++) { - var contact = customercontacts[i]; - if (isEmail(txt.Sender)) { - if (contact.Email === txt.Sender) { - name = contact.Name; - break; - } - } - else { - if (contact.MobilePhone === txt.Sender) { - name = contact.Name; - break; - } - } - } - } - if (name !== "") { - $("<div style='font-weight:bold;'></div>").text(name).appendTo(div); - } - - var sendto = ""; - if (!txt.IsReply && txt.OriPhoneNumbers && txt.OriPhoneNumbers.length > 0) { - for (var i = 0; i < txt.OriPhoneNumbers.length; i++) { - var oriph = txt.OriPhoneNumbers[i]; - if (customercontacts && customercontacts.length > 0) { - var cname = ""; - for (var j = 0; j < customercontacts.length; j++) { - var contact = customercontacts[j]; - if (isEmail(oriph)) { - if (contact.Email === oriph) { - cname = contact.Email + " - " + contact.Name + "\r\n"; - break; - } - } - else { - if (contact.MobilePhone === oriph) { - cname = contact.MobilePhone + " - " + contact.Name + "\r\n"; - break; - } - } - } - if (cname === "") { - for (var j = 0; j < followers.length; j++) { - var follower = followers[j]; - if (isEmail(oriph)) { - if (follower.Email === oriph) { - cname = follower.Email + " - " + follower.Name + "\r\n"; - break; - } - } - else { - if (follower.MobilePhone === oriph) { - cname = follower.MobilePhone + " - " + follower.Name + "\r\n"; - break; - } - } - } - } - if (cname === "") - sendto += oriph + "\r\n"; - else - sendto += cname; - } - else { - sendto += oriph + "\r\n"; - } - } - } - - if (sendto !== "") - sendto = GetTextByKey("P_WO_SENTTO_COLON", "Send To :") + "\r\n" + sendto; - - $("<div class='txttime'></div>").text(((txt.IsReply && $.trim(txt.FormatSender) !== "") ? txt.FormatSender : txt.Sender) + " - " + txt.TimeStr).attr('title', txt.IsReply ? "" : sendto).appendTo(div); - var contentctrl = $("<div></div>").appendTo(div); - if (txt.Message.toLowerCase().indexOf("http://") >= 0 || txt.Message.toLowerCase().indexOf("https://") >= 0) { - contentctrl.html(formatUrl(txt.Message)); - } - else { - contentctrl.text(txt.Message); - } - if (txt.IsReply) - contentctrl.addClass("txtother"); - else { - contentctrl.addClass("txtself"); - var status = getMsgStatus(txt); - if (status.Status != -100) { - var statustext = ""; - if (status.Status == 0) { - statustext = GetTextByKey("P_WO_XXXXXX", "Pending"); - contentctrl.css("background-color", "#FFC107"); - } - else if (status.Status == 1) { - statustext = GetTextByKey("P_WO_XXXXXX", "Sent"); - } - else if (status.Status == 9) { - statustext = GetTextByKey("P_WO_XXXXXX", "Failed"); - contentctrl.css("background-color", "#FFC107"); - } - else if (status.Status == 10) { - statustext = GetTextByKey("P_WO_XXXXXX", "Opt-Out"); - contentctrl.css("background-color", "#FFC107"); - } - else if (status.Status == 412) { - statustext = GetTextByKey("P_WO_XXXXXX", "Landline"); - contentctrl.css("background-color", "#FFC107"); - } - else { - statustext = GetTextByKey("P_WO_XXXXXX", "Undelivered"); - contentctrl.css("background-color", "#FFC107"); - } - - var divstatus = $("<div style='text-align:right;margin-top:3px;font-weight:bold;margin-right:-12px;font-size:10px;'>Failed</div>").text(statustext); - if (status.Status == -10) - divstatus.attr('title', status.StatusMsg) - } - contentctrl.append(divstatus); - div.css("text-align", "right"); - } -} - -function getMsgStatus(txt) { - var status = -100;//没有状态,页面上不显示 - var ls = []; - var statusmsg = ""; - if (!txt.StatusIncorrect && txt.Participator != null && txt.Participator.length > 0) { - for (var i = 0; i < txt.Participator.length; i++) { - var p = txt.Participator[i]; - if (!isEmail(p.CustomerNumber)) { - if (ls.indexOf(p.Status) < 0) - ls.push(p.Status); - - if (statusmsg == "") - statusmsg = p.CustomerNumber + ": "; - else - statusmsg += "\r\n" + p.CustomerNumber + ": "; - - if (p.Status == 0) { - statusmsg += GetTextByKey("P_WO_XXXXXX", "Undelivered"); - } - else if (p.Status == 1) { - statusmsg += GetTextByKey("P_WO_XXXXXX", "Sent"); - } - else if (p.Status == 9) { - statusmsg += GetTextByKey("P_WO_XXXXXX", "Failed"); - } - } - } - } - if (ls.length == 1) - status = ls[0]; - else if (ls.length > 1) - status = -10;//多种状态 - return { Status: status, StatusMsg: statusmsg }; -} - function addWorkOrderCommunication() { var pmemails = customer?.contacts; if (pmemails == null || pmemails.length === 0) { @@ -324,36 +161,4 @@ function resetCommunications() { customer.text = ''; customer.load(); } - -} - -function setPhoneNumber() { - if (customercontacts) { - var names = ""; - for (var i = 0; i < customercontacts.length; i++) { - var c = customercontacts[i]; - if (c.OptOut || c.OptOut_BC) continue; - var mp = $.trim(c.MobilePhone); - var email = $.trim(c.Email); - if ((c.ContactPreference == "0" && (checkPhoneNumber(mp)) - || (c.ContactPreference == "1" && isEmail(email)))) { - if (names == "") - names = c.Name; - else - names += ";" + c.Name; - } - } - if (typeof customer !== 'undefined') { - customer.contacts = customercontacts; - } - $('#dialog_est_phonenum').val(names); - $('#dialog_invoice_phonenum').val(names); - } - else { - if (typeof customer !== 'undefined') { - customer.contacts = null; - } - $('#dialog_est_phonenum').val(""); - $('#dialog_invoice_phonenum').val(''); - } } \ No newline at end of file diff --git a/Site/Maintenance/js/workorderalert.js b/Site/Maintenance/js/workorderalert.js deleted file mode 100644 index b524978..0000000 --- a/Site/Maintenance/js/workorderalert.js +++ /dev/null @@ -1,720 +0,0 @@ - -function showAllAlerts(alerts) { - if (alerts.DTCAlerts && alerts.DTCAlerts.length > 0) { - _DTCAlerts = alerts.DTCAlerts; - $("#divdtcalerts").show(); - showAlerts(_DTCAlerts, grid_dtcalertdt); - } - else { - _DTCAlerts = []; - showAlerts(_DTCAlerts, grid_dtcalertdt); - } - - if (alerts.PMAlerts && alerts.PMAlerts.length > 0) { - _PMAAlerts = alerts.PMAlerts; - //$("#divpmaalerts").show(); - showAlerts(_PMAAlerts, grid_pmaalertdt); - - $('#dialog_expectedcost').val(alerts.AllExpectedCost === 0 ? '' : alerts.AllExpectedCost); - } - else { - _PMAAlerts = []; - showAlerts(_PMAAlerts, grid_pmaalertdt); - } - - if (alerts.InspectAlerts && alerts.InspectAlerts.length > 0) { - _InspectAlerts = alerts.InspectAlerts; - $("#divinspectalerts").show(); - showAlerts(_InspectAlerts, grid_inspectalertdt); - } - else { - _InspectAlerts = []; - showAlerts(_InspectAlerts, grid_inspectalertdt); - } - - if (alerts.OilAlerts && alerts.OilAlerts.length > 0) { - _OilAlerts = alerts.OilAlerts; - $("#divoilalerts").show(); - showAlerts(_OilAlerts, grid_oilalertdt); - } - else { - _OilAlerts = []; - showAlerts(_OilAlerts, grid_oilalertdt); - } -} - -function showAlerts(data, grid_dt) { - var rows = []; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - alertids.push(r.AlertID); - if (r.RepeatedAlerts) { - for (var j = 0; j < r.RepeatedAlerts.length; j++) { - alertids.push(r.RepeatedAlerts[j]); - } - } - for (var j in r) { - r["EngineHoursObj"] = { DisplayValue: r["EngineHours"] == 0 ? "" : r["EngineHours"], Value: r["EngineHours"] }; - r["AlertLocalTime"] = { DisplayValue: r["AlertLocalTimeStr"], Value: r["AlertLocalTime"] }; - } - var fr = { Values: r }; - rows.push(fr); - } - - grid_dt.setData(rows); -} - -var grid_dtcalertdt; -function InitDTCAlertGridData() { - grid_dtcalertdt = new GridView('#dtcalertslist'); - grid_dtcalertdt.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 480, 'text-align': 'left' } }, - //{ name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, - { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.type = list_columns[hd].type; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - if (col.name === "Selected") { - col.allcheck = true; - } - } - grid_dtcalertdt.canMultiSelect = false; - grid_dtcalertdt.columns = columns; - grid_dtcalertdt.init(); - - grid_dtcalertdt.selectedrowchanged = function (rowindex) { - var rowdata = grid_dtcalertdt.source[rowindex]; - if (rowdata) { - } - } -} - -var grid_pmaalertdt; -function InitPMAAlertGridData() { - grid_pmaalertdt = new GridView('#pmaalertslist'); - grid_pmaalertdt.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 240, 'text-align': 'left' } }, - { name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, - { name: 'ExpectedCost', caption: GetTextByKey("P_PM_EXPECTEDCOST", "Expected Cost"), valueIndex: 'ExpectedCost', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.type = list_columns[hd].type; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - if (col.name === "Selected") { - col.allcheck = true; - } - } - grid_pmaalertdt.canMultiSelect = false; - grid_pmaalertdt.columns = columns; - grid_pmaalertdt.init(); - - grid_pmaalertdt.selectedrowchanged = function (rowindex) { - var rowdata = grid_pmaalertdt.source[rowindex]; - if (rowdata) { - } - } -} - -var grid_inspectalertdt; -function InitInspectAlertGridData() { - grid_inspectalertdt = new GridView('#inspectalertslist'); - grid_inspectalertdt.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 480, 'text-align': 'left' } }, - //{ name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, - { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.type = list_columns[hd].type; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - if (col.name === "Selected") { - col.allcheck = true; - } - } - grid_inspectalertdt.canMultiSelect = false; - grid_inspectalertdt.columns = columns; - grid_inspectalertdt.init(); - - grid_inspectalertdt.selectedrowchanged = function (rowindex) { - var rowdata = grid_inspectalertdt.source[rowindex]; - if (rowdata) { - } - } -} - -var grid_oilalertdt; -function InitOilAlertGridData() { - grid_oilalertdt = new GridView('#oilalertslist'); - grid_oilalertdt.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 480, 'text-align': 'left' } }, - //{ name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, - { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, - { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.type = list_columns[hd].type; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - if (col.name === "Selected") { - col.allcheck = true; - } - } - grid_oilalertdt.canMultiSelect = false; - grid_oilalertdt.columns = columns; - grid_oilalertdt.init(); - - grid_oilalertdt.selectedrowchanged = function (rowindex) { - var rowdata = grid_oilalertdt.source[rowindex]; - if (rowdata) { - } - } -} - -function showNoneAssienedAlerts(data) { - var rows = []; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - for (var j in r) { - if (j === "EngineHours") - r[j] = { DisplayValue: r[j] == 0 ? "" : r[j], Value: r[j] }; - else if (j === "AlertLocalTime") - r[j] = { DisplayValue: r["AlertLocalTimeStr"], Value: r[j] }; - } - var fr = { Values: r }; - rows.push(fr); - } - - grid_noneassignedalertdt.setData(rows); -} -var grid_noneassignedalertdt; -function InitNoneAssignedAlertGridData() { - grid_noneassignedalertdt = new GridView('#noneassignedalertlist'); - grid_noneassignedalertdt.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHours', css: { 'width': 80, 'text-align': 'left' } }, - { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, - { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 200, 'text-align': 'left' } }, - { name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 200, 'text-align': 'left' } }, - { name: 'AlertTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertTime', css: { 'width': 125, 'text-align': 'left' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.type = list_columns[hd].type; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - if (col.name === "Selected") { - col.allcheck = true; - } - } - grid_noneassignedalertdt.canMultiSelect = false; - grid_noneassignedalertdt.columns = columns; - grid_noneassignedalertdt.init(); - - grid_noneassignedalertdt.selectedrowchanged = function (rowindex) { - var rowdata = grid_noneassignedalertdt.source[rowindex]; - if (rowdata) { - } - } -} - -function clearAlertData() { - _DTCAlerts = []; - _PMAAlerts = []; - _InspectAlerts = []; - _OilAlerts = []; - grid_dtcalertdt.setData([]); - grid_pmaalertdt.setData([]); - grid_inspectalertdt.setData([]); - grid_oilalertdt.setData([]); -} - -var _DTCAlerts = []; -var _PMAAlerts = []; -var _InspectAlerts = []; -var _OilAlerts = []; -function getAlerts() { - $("#divdtcalerts").hide(); - //$("#divpmaalerts").hide(); - $("#divinspectalerts").hide(); - $("#divoilalerts").hide(); - - clearAlertData(); - - alertrequest("GETWORKORDERALERTS", workorderid, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - showAllAlerts(data); - }, function (err) { - }); -} - -function getAssetAlerts(mid) { - $("#divdtcalerts").hide(); - //$("#divpmaalerts").hide(); - $("#divinspectalerts").hide(); - $("#divoilalerts").hide(); - - clearAlertData(); - - if (!mid) - mid = machineid; - - showloading(true); - alertrequest("GETASSETALERTS", mid + String.fromCharCode(170) + JSON.stringify(alertids), function (data) { - showloading(false); - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - showAllAlerts(data); - }, function (err) { - showloading(false); - }); -} - - -function reshowgrid() { - setTimeout(function () { - $("#dtcalertslist").css("height", 240); - grid_dtcalertdt && grid_dtcalertdt.resize(); - $("#pmaalertslist").css("height", 240); - grid_pmaalertdt && grid_pmaalertdt.resize(); - $("#inspectalertslist").css("height", 240); - grid_inspectalertdt && grid_inspectalertdt.resize(); - $("#oilalertslist").css("height", 240); - grid_oilalertdt && grid_oilalertdt.resize(); - }); -} - -function showAlertPopup() { - $('#alertpopupmask').show(); - $('#alertpopupdialog').show(); - $('#alertpopupdialog').css({ - "top": ($("#alertpopupmask").height() - $('#alertpopupdialog').height()) / 2, - "left": ($("#alertpopupmask").width() - $('#alertpopupdialog').width()) / 2 - }); - - //$("#noneassignedalertlist").css("height", $('#alertpopupdialog').height() - $("#alertpopupdialog").offset().top - 4); - grid_noneassignedalertdt && grid_noneassignedalertdt.resize(); -} - -function hideAlertPopup() { - $('#alertpopupdialog').hide(); - $('#alertpopupmask').hide(); -} - -function OnAddAlerts() { - if (!workorderid || workorderid === "") { - showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDALERTS", 'Add Alerts')); - return; - } - getNoneAssignedAlerts(); -} - -var noneassignedalerts = []; -function getNoneAssignedAlerts() { - var mid; - if (typeof editableSelectMachine != "undefined") { - var machine = editableSelectMachine.selecteditem(); - if (machine) - mid = machine.Id; - } - else - mid = machineid; - - if (!mid) { - showAlert(GetTextByKey("P_WO_PLEASESELECTANASSET", "Please select an Asset."), GetTextByKey("P_WO_SENDEMAIL", "Send Email")); - $('#dialog_machine').focus(); - return; - } - - worequest("GetNoneAssignedAlerts", mid, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - showAlertPopup(); - noneassignedalerts = data; - showNoneAssienedAlerts(noneassignedalerts); - }, function (err) { - }); -} - - -function AddOrRemoveAlertsFromWorkOrder(isadd, alertids) { - worequest("AddOrRemoveAlertsFromWorkOrder", workorderid + String.fromCharCode(170) + JSON.stringify(alertids) + String.fromCharCode(170) + isadd, function (data) { - if (isadd) - hideAlertPopup(); - getAlerts(); - }, function (err) { - }); - -} - -function OnRemoveAlerts() { - var alerts = []; - alertids = []; - if (_DTCAlerts.length > 0) { - for (var i = _DTCAlerts.length - 1; i >= 0; i--) { - var alert = _DTCAlerts[i]; - if (alert.Selected) { - alerts.push(alert.AlertID); - _DTCAlerts.splice(i, 1); - //if (alertids.indexOf(alert.AlertID) >= 0) - // alertids.splice(alertids.indexOf(alert.AlertID), 1); - if (alert.RepeatedAlerts) { - for (var j = 0; j < alert.RepeatedAlerts.length; j++) { - alerts.push(alert.RepeatedAlerts[j]); - //alertids.splice(alertids.indexOf(alert.RepeatedAlerts[j]), 1); - } - } - } - } - showAlerts(_DTCAlerts, grid_dtcalertdt); - } - if (_PMAAlerts.length > 0) { - for (var i = _PMAAlerts.length - 1; i >= 0; i--) { - var alert = _PMAAlerts[i]; - if (alert.Selected) { - alerts.push(alert.AlertID); - _PMAAlerts.splice(i, 1); - //if (alertids.indexOf(alert.AlertID) >= 0) - // alertids.splice(alertids.indexOf(alert.AlertID), 1); - if (alert.RepeatedAlerts) { - for (var j = 0; j < alert.RepeatedAlerts.length; j++) { - alerts.push(alert.RepeatedAlerts[j]); - //alertids.splice(alertids.indexOf(alert.RepeatedAlerts[j]), 1); - } - } - } - } - showAlerts(_PMAAlerts, grid_pmaalertdt); - //grid_pmaalertdt.setData(_PMAAlerts); - } - if (_InspectAlerts.length > 0) { - for (var i = _InspectAlerts.length - 1; i >= 0; i--) { - var alert = _InspectAlerts[i]; - if (alert.Selected) { - alerts.push(alert.AlertID); - _InspectAlerts.splice(i, 1); - //if (alertids.indexOf(alert.AlertID) >= 0) - // alertids.splice(alertids.indexOf(alert.AlertID), 1); - if (alert.RepeatedAlerts) { - for (var j = 0; j < alert.RepeatedAlerts.length; j++) { - alerts.push(alert.RepeatedAlerts[j]); - //alertids.splice(alertids.indexOf(alert.RepeatedAlerts[j]), 1); - } - } - } - } - showAlerts(_InspectAlerts, grid_inspectalertdt); - } - if (_OilAlerts.length > 0) { - for (var i = _OilAlerts.length - 1; i >= 0; i--) { - var alert = _OilAlerts[i]; - if (alert.Selected) { - alerts.push(alert.AlertID); - _OilAlerts.splice(i, 1); - //if (alertids.indexOf(alert.AlertID) >= 0) - // alertids.splice(alertids.indexOf(alert.AlertID), 1); - if (alert.RepeatedAlerts) { - for (var j = 0; j < alert.RepeatedAlerts.length; j++) { - alerts.push(alert.RepeatedAlerts[j]); - //alertids.splice(alertids.indexOf(alert.RepeatedAlerts[j]), 1); - } - } - } - } - showAlerts(_OilAlerts, grid_oilalertdt); - } - if (alerts.length == 0) { - showAlert(GetTextByKey("P_WO_PLEASESELECTANALERT", "Please select an Alert."), GetTextByKey("P_WO_REMOVEALERTS", "Remove Alerts")); - return; - } - - if (workorderid && workorderid !== "") { - AddOrRemoveAlertsFromWorkOrder(false, alerts); - } -} - - -function OnSaveAlerts() { - var alerts = []; - if (noneassignedalerts.length > 0) { - for (var i in noneassignedalerts) { - var alert = noneassignedalerts[i]; - if (alert.Selected) { - alerts.push(alert.ID); - } - } - } - if (alerts.length == 0) { - showAlert(GetTextByKey("P_WO_PLEASESELECTANALERT", "Please select an Alert."), GetTextByKey("P_WO_ADDALERTS", "Add Alerts")); - return; - } - AddOrRemoveAlertsFromWorkOrder(true, alerts); -} - - - -//**********************************Add PM Alerts (Alerts not yet triggered)***********************************************/ - - -function showAllPMSchedules(data) { - var rows = []; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - for (var j in r) { - } - var fr = { Values: r }; - rows.push(fr); - } - - grid_pmschedulesdt.setData(rows); -} - -var grid_pmschedulesdt; -function InitAllPMSchedulesGridData() { - grid_pmschedulesdt = new GridView('#allpmpmalertslist'); - grid_pmschedulesdt.lang = { - all: GetTextByKey("P_GRID_ALL", "(All)"), - ok: GetTextByKey("P_GRID_OK", "OK"), - reset: GetTextByKey("P_GRID_RESET", "Reset") - }; - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'Name', caption: GetTextByKey("P_MV_SCHEDULENAME", "Schedule Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } } - ]; - var columns = []; - // head - for (var hd in list_columns) { - var col = {}; - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.type = list_columns[hd].type; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - if (col.name === "Selected") { - col.allcheck = true; - } - } - grid_pmschedulesdt.canMultiSelect = false; - grid_pmschedulesdt.columns = columns; - grid_pmschedulesdt.init(); - - grid_pmschedulesdt.selectedrowchanged = function (rowindex) { - var rowdata = grid_pmschedulesdt.source[rowindex]; - if (rowdata) { - } - } -} - -function showAllPMSchedulePopup() { - $('#allpmschedulepopupmask').show(); - $('#allpmschedulepopupdialog').show(); - $('#allpmschedulepopupdialog').css({ - "top": ($("#allpmschedulepopupmask").height() - $('#allpmschedulepopupdialog').height()) / 2, - "left": ($("#allpmschedulepopupmask").width() - $('#allpmschedulepopupdialog').width()) / 2 - }); - - grid_pmschedulesdt && grid_pmschedulesdt.resize(); -} - -function hideAllPMSchedulePopup() { - $('#allpmschedulepopupdialog').hide(); - $('#allpmschedulepopupmask').hide(); -} - -function OnAddAllPMSchedules() { - if (!workorderid || workorderid === "") { - showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDALERTS", 'Add Alerts')); - return; - } - GetPMSchedulesByAsset(); -} - -var allpmschedules = []; -function GetPMSchedulesByAsset() { - var mid; - if (typeof editableSelectMachine != "undefined") { - var machine = editableSelectMachine.selecteditem(); - if (machine) - mid = machine.Id; - } - else - mid = machineid; - - if (!mid) { - showAlert(GetTextByKey("P_WO_PLEASESELECTANASSET", "Please select an Asset."), GetTextByKey("P_WO_SENDEMAIL", "Send Email")); - $('#dialog_machine').focus(); - return; - } - - showAllPMSchedulePopup(); - worequest("GetPMSchedulesByAsset", mid, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - allpmschedules = data; - showAllPMSchedules(allpmschedules); - }, function (err) { - }); -} - -function GenerateManualPMAlerts() { - var schids = []; - if (allpmschedules.length > 0) { - for (var i in allpmschedules) { - var pmsch = allpmschedules[i]; - if (pmsch.Selected) { - schids.push(pmsch.Id); - } - } - } - if (schids.length == 0) { - showAlert(GetTextByKey("P_WO_PLEASESELECTAPLAN", "Please select a plan."), GetTextByKey("P_WO_ADDALERTS", "Add Alerts")); - return; - } - - var mid; - if (typeof editableSelectMachine != "undefined") { - var machine = editableSelectMachine.selecteditem(); - if (machine) - mid = machine.Id; - } - else - mid = machineid; - - if (!mid) { - showAlert(GetTextByKey("P_WO_PLEASESELECTANASSET", "Please select an Asset."), GetTextByKey("P_WO_SENDEMAIL", "Send Email")); - $('#dialog_machine').focus(); - return; - } - - worequest("GenerateManualPMAlerts", JSON.stringify([mid, workorderid, JSON.stringify(schids)]) - , function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - else { - var msg = ""; - for (var i = 0; i < data.length; i++) { - var r = data[i]; - if (r.Status == -1) - msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT", "Failed to generate alert.") + " (" + r.ScheduleName + ")\r\n"; - else if (r.Status == 1) - msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT1", "Unable to generate alert because there already exists an unmaintained alert.") + " (" + r.ScheduleName + ")\r\n"; - else if (r.Status == 2) { - if (r.UOM == "hour(s)") - msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT2", "Unable to generate alert until Hour Meter is higher than ") + r.NextTargetValue.toLocaleString() + " " + r.UOM + " (" + r.ScheduleName + ")\r\n"; - else if (r.UOM == "day(s)") - msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT3", "Unable to generate alert until {0} later {1}").replace('{0}', r.NextTargetValue.toLocaleString() + " " + r.UOM).replace('{1}', " (" + r.ScheduleName + ")\r\n"); - else - msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT4", "Unable to generate alert until odometer is higher than ") + r.NextTargetValue.toLocaleString() + " " + r.UOM + " (" + r.ScheduleName + ")\r\n"; - } - } - if (msg !== "") - showAlert(msg, GetTextByKey("P_WO_ERROR", 'Error')); - } - hideAllPMSchedulePopup(); - getAlerts(); - }, function (err) { - }); -} - diff --git a/Site/Maintenance/js/workorderattachments.js b/Site/Maintenance/js/workorderattachments.js deleted file mode 100644 index 2b84284..0000000 --- a/Site/Maintenance/js/workorderattachments.js +++ /dev/null @@ -1,801 +0,0 @@ - -function UpLoadWorkOrderAttachment() { - var file = $('<input type="file" style="display: none;" multiple="multiple" />'); - file.change(function () { - var files = this.files; - if (files.length > 0) { - onSaveWOAttachment(files); - } - }).click(); -} - -var filesinuploading = []; -var uploadingindex = -1; -var fileupload_errors = ""; -function onSaveWOAttachment(files) { - fileupload_errors = ""; - if (!workorderid) { - OnSave(0, function () { - showLoading(); - $('.span_attupload').show(); - $('.span_vieuploadmsg').css('margin-left', 0); - $('.span_vieuploadmsg').show(); - if (filesinuploading.length > 0) { - for (var i = 0; i < files.length; i++) - filesinuploading.push(workorderid, files[i]); - showUplpadingStatus(0); - } - else { - filesinuploading = files; - DoUploadWorkOrderAttachments(workorderid); - } - }); - } - else { - showLoading(); - $('.span_attupload').show(); - $('.span_vieuploadmsg').css('margin-left', 0); - $('.span_vieuploadmsg').show(); - if (filesinuploading.length > 0) { - for (var i = 0; i < files.length; i++) - filesinuploading.push(files[i]); - showUplpadingStatus(0); - } - else { - filesinuploading = files; - DoUploadWorkOrderAttachments(workorderid); - } - } -} - -function DoUploadWorkOrderAttachments(woid) { - if (woid != workorderid) { - filesinuploading = []; - uploadingindex = -1; - return; - } - uploadingindex++; - if (uploadingindex >= filesinuploading.length) { - uploadingindex--; - showUplpadingStatus(3); - filesinuploading = []; - uploadingindex = -1; - $('.span_attupload').hide(); - $('.span_vieuploadmsg').css('margin-left', 200); - getWorkOrderAttachments(); - - hideLoading(); - if (fileupload_errors !== "") - showAlert(fileupload_errors, GetTextByKey("P_WO_XXXXX", 'Upload failed')); - return; - } - var file = filesinuploading[uploadingindex]; - if (file.name.length > 200) { - showUplpadingStatus(2, GetTextByKey("P_WO_XXX", "Attachment name length cannot be greater than 200.")); - DoUploadWorkOrderAttachments(woid); - return; - } - if (file.size == 0) { - showUplpadingStatus(2, GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); - DoUploadWorkOrderAttachments(woid); - return; - } - if (file.size > 50 * 1024 * 1024) { - showUplpadingStatus(2, GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); - DoUploadWorkOrderAttachments(woid); - return; - } - - showUplpadingStatus(0); - - var top = $(window).height() / 2 - 100; - var left = $(window).width() / 2 - 100; - var width = $('#dialogattmask .lable_attuploadname').width(); - $('#dialogattmask .loading_icon').css({ top: top, left: left }); - $('#dialogattmask .lable_attuploadname').css({ top: top + 70, left: ($(window).width() - width - 100) / 2 }); - - var p = JSON.stringify([workorderid, ""]); - var formData = new FormData(); - formData.append("iconFile", file); - formData.append("MethodName", "AddAttachment"); - formData.append("ClientData", p); - var url = 'AddWorkOrder.aspx'; - $.ajax({ - url: url, - type: 'POST', - dataType: 'json', - processData: false, - contentType: false, - data: formData, - async: true, - success: function (data) { - if (data !== 'OK') { - showAlert(GetTextByKey("P_WO_XXXXX", 'Upload failed'), GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); - } - showUplpadingStatus(1); - DoUploadWorkOrderAttachments(woid); - }, - error: function (err) { - showUplpadingStatus(2, GetTextByKey("P_WO_XXXXX", 'Upload failed')); - DoUploadWorkOrderAttachments(woid); - } - }); -} - -function showUplpadingStatus(status, msg) { - if (filesinuploading.length == 0) return; - var filename = filesinuploading[uploadingindex].name; - if (filename.length > 50) - filename = filename.substring(0, 49) + "..."; - - var statustxt = ""; - if (status == 0) { - statustxt = "Uploading " + filename + " (" + (uploadingindex + 1) + "/" + filesinuploading.length + ")"; - $('.lable_attuploadname').text(statustxt); - } - else if (status == 1) { - statustxt = filename; - $('#attupload_ul').append('<li style="padding-left: 0;height:unset;line-height:24px;"><span class="sbutton iconattsuc">' + statustxt + '</span></li>'); - } - else if (status == 2) { - statustxt = filename + " - " + msg; - $('#attupload_ul').append('<li style="padding-left: 0;height:unset;line-height:24px;"><span class="sbutton iconatterror">' + statustxt + '</span></li>'); - if (fileupload_errors === "") - fileupload_errors = statustxt; - else - fileupload_errors = fileupload_errors + " \n " + statustxt; - } - else if (status == 3) { - statustxt = "Upload Completed"; - statustxt = ""; - $('.lable_attuploadname').text(statustxt); - } -} - -function deleteAttachment(attID) { - if (confirm(GetTextByKey("P_WO_DELETEATTACHMENTTIPS", "Are you sure you want to delete the attachment?"))) { - worequest("DeleteAttachment", attID, function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); - } - else { - getWorkOrderAttachments(); - } - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILEDDELETEATTACHMENT", 'Failed to delete this attachment.'), GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); - }); - } -} - -var allAttachments; -var viewtype = 0; -function onViewAttachment(type) { - viewtype = type; - if (typeof setCookie === "function") - setCookie("woattachmentviewtype", viewtype); - - $(".woattafoldicon").removeClass("iconchevronright").addClass("iconchevrondown"); - $(".woattafoldtr").show(); - showWOAttachments(); -} - -function showWOAttachments() { - $('#div_woatts').empty(); - $('#div_atts').empty(); - $('#div_iatts').empty(); - $('#woattslist_tbody').empty(); - $('#woassetattslist_tbody').empty(); - $('#woiptattslist_tbody').empty(); - - if (!viewtype) - viewtype = 0; - - if (parseInt(viewtype) === 1) { - $('#div_attlarge').hide(); - $('#div_attlist').show(); - showAttachmentList(allAttachments); - } - else { - $('#div_attlarge').show(); - $('#div_attlist').hide(); - showWorkOrderAttachments(allAttachments); - } - $('#dialogattmask').height($(document).outerHeight(false)).width($(document).outerWidth(false)); -} - -function getWorkOrderAttachments(next) { - if (workorderid) { - worequest('GetAttachments', JSON.stringify([workorderid, machineid]), function (data) { - if (data && typeof data != "string") { - allAttachments = data; - if (next) - next(); - else { - showWOAttachments(allAttachments); - } - } - }); - } -} - -var imgTypes = [".jfif", ".jpg", ".jpeg", ".bmp", ".png", ".tiff", ".gif"]; -var printTypes = ['.pdf', ".jfif", ".jpg", ".jpeg", ".bmp", ".png", ".tiff", ".gif"];//types to be loaded to print -function showWorkOrderAttachments(attas) { - var div_aatts = $('#div_aatts'); - div_aatts.empty(); - var div_woatts = $('#div_woatts'); - div_woatts.empty(); - var div_iatts = $('#div_iatts'); - div_iatts.empty(); - if (attas.AssetAttachments && attas.AssetAttachments.length > 0) { - for (var i = 0; i < attas.AssetAttachments.length; i++) { - var att = attas.AssetAttachments[i]; - if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) - att.ThumbnailUrl = att.Url + "&thumb=1"; - var div = createAttaDiv(att); - - if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - var sprint = $('<span class="attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { - openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); - }); - div.append(sprint); - } - - if (att.FileType.toLowerCase() != "url") { - var sdownload = $('<span class="attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { - openDownloadFrame(e.data.Url + "&d=1"); - }); - div.append(sdownload); - } - - div_aatts.append(div); - } - } - if (attas.WorkOrderAttachments && attas.WorkOrderAttachments.length > 0) { - for (var i = 0; i < attas.WorkOrderAttachments.length; i++) { - var att = attas.WorkOrderAttachments[i]; - - var pdiv = $('<div class="divattp"></div>'); - var div = createAttaDiv(att, true); - - var div1 = $('<div style=" margin-top: 15px;"></div>'); - var ext_span = $('<span style="font-weight:500;"></span>').text(GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); - var ext_chk = $('<input type="checkbox" />').prop('checked', att.AvailableToCustomer).click(att, function (e) { - updateWOAttachmentExtension(e.data.AttachmentId, $(this).prop('checked')); - }); - div1.append(ext_chk).append(ext_span); - pdiv.append(div1); - - if (AllowDeleteAtta) { - var sdel = $('<span class="delete"></span>').attr('title', GetTextByKey("P_WO_DELETE", 'Delete')).click(att, function (e) { - deleteAttachment(e.data.AttachmentId); - }); - div.append(sdel); - } - - if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - var sprint = $('<span class="attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { - openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); - }); - div.append(sprint); - } - - var sdownload = $('<span class="attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { - openDownloadFrame(e.data.Url + "&d=1"); - }); - div.append(sdownload); - pdiv.append(div); - - var caption = att.Notes === "" ? att.FileName : att.Notes; - var div3 = $('<div style="text-align:center;clear:both;height:25px;"></div>'); - var iptcaption = $('<input type="text" style="width: 296px;" class="inp_name" style="height:24px;" maxlength="200"/>').attr('data-ori', caption).val(caption); - iptcaption.data('attdata', att); - div3.append(iptcaption); - iptcaption.focus({ AttachmentId: att.AttachmentId, iptcaption: iptcaption }, function (e) { - e.data.iptcaption.addClass('focused'); - }); - iptcaption.blur({ div: div, AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { - e.data.iptcaption.removeClass('focused'); - updateWOAttachmentCaption(e.data); - }); - iptcaption.keydown({ div: div, AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { - if (e.keyCode == 13 || e.keyCode == 9) { - e.data.iptcaption.blur(); - } - }); - pdiv.append(div3); - div_woatts.append(pdiv); - } - } - if (attas.InspectionAttachments && attas.InspectionAttachments.length > 0) { - for (var i = 0; i < attas.InspectionAttachments.length; i++) { - var att = attas.InspectionAttachments[i]; - var div = createAttaDiv(att); - - if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - var sprint = $('<span class="attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { - openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); - }); - div.append(sprint); - } - - var sdownload = $('<span class="attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { - openDownloadFrame(e.data.Url + "&d=1"); - }); - div.append(sdownload); - - div_iatts.append(div); - } - } -} - -function createAttaDiv(att, iswoatta) { - var div = $('<div class="divatt"></div>').attr('title', att.FileName); - if (iswoatta) - div.attr('title', att.Notes === "" ? att.FileName : att.Notes) - - if (!att.FileType || att.FileType == "") att.FileType = ".jpg"; - if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) { - var pic = $('<img class="picture"></img>').attr('src', att.ThumbnailUrl); - pic.click(att, function (e) { - window.open(e.data.Url, "_blank") - }); - div.append(pic); - } - else { - var sdown = $('<img class="picture" />').click(att, function (e) { - window.open(e.data.Url); - }); - setAttachemntIcon(att.FileType, sdown); - div.append(sdown); - } - return div -} - -function updateWOAttachmentExtension(attID, chk) { - var item = { - 'Key': "1", - 'Value': chk - }; - - var param = JSON.stringify(item); - param = htmlencode(param); - - worequest('UpdateWOAttachmentExtension', JSON.stringify([attID, param]), function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); - } - if (allAttachments && allAttachments.WorkOrderAttachments) { - for (var i = 0; i < allAttachments.WorkOrderAttachments.length; i++) { - if (allAttachments.WorkOrderAttachments[i].AttachmentId == attID) { - allAttachments.WorkOrderAttachments[i].AvailableToCustomer = chk; - break; - } - } - } - }, function (err) { - }); -} - -var grid_panddattachments -function InitPAndDGrid() { - grid_panddattachments = new GridView('#dialog_wopanddattachmentlist'); - var list_columns = [ - { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } }, - { name: 'ThumbnailUrl', caption: "", valueIndex: 'ThumbnailUrl', css: { 'width': 42, 'text-align': 'center' } }, - { name: 'FileName', caption: GetTextByKey("P_WO_NAME", "Name"), valueIndex: 'FileName', css: { 'width': 280, 'text-align': 'left' } } - ]; - - var columns = []; - for (var hd in list_columns) { - var col = {}; - if (list_columns[hd].type) { - col.type = list_columns[hd].type; - } - col.name = list_columns[hd].name; - col.caption = list_columns[hd].caption; - col.visible = true; - col.sortable = true; - col.width = list_columns[hd].css.width; - col.align = list_columns[hd].css["text-align"] - col.key = list_columns[hd].valueIndex; - columns.push(col); - - if (col.name == "Selected") { - col.allcheck = true; - col.sortable = false; - } - else if (col.name == "ThumbnailUrl") { - col.allowHtml = true; - col.filterCustom = true; - col.filter = function (item) { - if (imgTypes.indexOf(item.FileType.toLowerCase()) >= 0) - return $('<img style="height:30px;width:30px;"></img>').attr('src', item.ThumbnailUrl); - else { - var sdown = $('<img style="height:30px;width:30px;line-height:40px;" />') - setAttachemntIcon(item.FileType, sdown); - return sdown; - } - } - col.styleFilter = function () { - return { "width": "100%", 'margin': 0 }; - } - } - } - grid_panddattachments.canMultiSelect = true; - grid_panddattachments.columns = columns; - grid_panddattachments.init(); -} - -function openPAndDGDialog(type) { - if (!allAttachments) return; - - var d = $("#dialog_panddattachments"); - if (!d.data("loaded")) { - d.data("loaded", true); - InitPAndDGrid(); - } - if (type == 0) { - $("#btnPrintWOAttachments").show(); - $("#btnDownloadWOAttachments").hide(); - } - else { - $("#btnPrintWOAttachments").hide(); - $("#btnDownloadWOAttachments").show(); - } - var data = []; - if (allAttachments.AssetAttachments && allAttachments.AssetAttachments.length > 0) - data = data.concat(allAttachments.AssetAttachments); - if (allAttachments.WorkOrderAttachments && allAttachments.WorkOrderAttachments.length > 0) - data = data.concat(allAttachments.WorkOrderAttachments); - if (allAttachments.InspectionAttachments && allAttachments.InspectionAttachments.length > 0) - data = data.concat(allAttachments.InspectionAttachments); - - var count = 0; - var rows = []; - for (var i = 0; i < data.length; i++) { - var att = data[i]; - if (att.FileType.toLowerCase() == "url") continue; - if (type == 1 || $.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - var fr = { - Values: { - FileName: att.Notes === "" ? att.FileName : att.Notes, - FileType: att.FileType, - Url: att.Url, - ThumbnailUrl: att.ThumbnailUrl, - AttachmentType: att.AttachmentType, - AttachmentIdStr: att.AttachmentIdStr, - Selected: false, - } - }; - rows.push(fr); - count++; - } - } - - $('#dialog_panddattachments .dialog-title span.title').text(GetTextByKey("P_WO_ATTACHMENTS", 'Attachments') + " (" + count + ")"); - showmaskbg(true); - d.css({ - 'top': (document.documentElement.clientHeight - d.height()) / 3, - 'left': (document.documentElement.clientWidth - d.width()) / 2 - }).showDialogfixed(); - - setTimeout(function () { - grid_panddattachments.setData(rows); - }); -} - -function getSelectedPAndDAttas() { - var sels = []; - if (grid_panddattachments && grid_panddattachments.source) { - for (var i = 0; i < grid_panddattachments.source.length; i++) { - var a = grid_panddattachments.source[i].Values; - if (a.Selected) - sels.push(a); - } - } - return sels; -} - -function printWOAttachments() { - var sels = getSelectedPAndDAttas(); - if (!sels || sels.length == 0) return; - if (sels && sels.length > 0) { - for (var i = 0; i < sels.length; i++) { - var att = sels[i]; - if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - openPrintFrame(att.AttachmentType, att.AttachmentIdStr); - } - } - } - showmaskbg(false); - $('#dialog_panddattachments').hideDialog(); -} - -function openPrintFrame(attatype, id) { - var frame = $("<iframe style='display:none;'></iframe>"); - $(document.body).after(frame); - //frame.attr("src", url); - frame.attr("src", _network.root + "Print.aspx?pt=3&at=" + attatype + "&id=" + id); - - frame.on('load', function () { - setTimeout(function () { - frame.contents().find("body").css("text-align", "center"); - //frame.contents().find("img").css("max-height", window.screen.availHeight).css("max-width", window.screen.availWidth); - frame.contents().find("img").css("max-height", "98%").css("max-width", "98%"); - frame[0].contentWindow.print(); - }); - setTimeout(function () { - frame.remove(); - }, 60000); - }); -} - -function downloadWOAttachments() { - var sels = getSelectedPAndDAttas(); - if (!sels || sels.length == 0) return; - if (sels && sels.length > 0) { - for (var i = 0; i < sels.length; i++) { - var att = sels[i]; - openDownloadFrame(att.Url + "&d=1"); - } - } - - showmaskbg(false); - $('#dialog_panddattachments').hideDialog(); -} - -function openDownloadFrame(url) { - var frame = $("<iframe style='display:none;'></iframe>"); - $(document.body).after(frame); - frame.attr("src", url); - - var timer = setInterval(function () { - if (frame[0].contentDocument && (frame[0].contentDocument.readyState == "complete" || frame[0].contentDocument.readyState == 4)) { - frame.remove(); - clearInterval(timer); - } - }, 5000); -} - -function updateWOAttachmentCaption(edata) { - var attid = edata.AttachmentId; - var caption = edata.iptcaption.val(); - - if (caption === "") { - var pcap = edata.caption; - if (edata.iptcaption.data('caption')) - pcap = edata.iptcaption.data('caption'); - edata.iptcaption.val(pcap); - return; - } - - var att = edata.iptcaption.data('attdata'); - att.Notes = caption; - - if (allAttachments && allAttachments.WorkOrderAttachments) { - for (var i = 0; i < allAttachments.WorkOrderAttachments.length; i++) { - if (allAttachments.WorkOrderAttachments[i].AttachmentId == att.AttachmentId) { - allAttachments.WorkOrderAttachments[i] = att; - break; - } - } - } - worequest('UpdateWorkOrderAttachmentCaption', JSON.stringify([attid, htmlencode(caption)]), function (data) { - if (data !== 'OK') { - showAlert(data, GetTextByKey("P_WO_XXX", 'Update Caption')); - } - else { - if (edata.div) - edata.div.attr('title', caption); - edata.iptcaption.data('caption', caption); - } - }, function (err) { - }); -} - -//***********************************Begin Attachment List************************************// - -function showAttachmentList(data) { - $('#woattslist_tbody').empty(); - $('#woassetattslist_tbody').empty(); - $('#woiptattslist_tbody').empty(); - if (data.WorkOrderAttachments && data.WorkOrderAttachments.length > 0) { - for (var i = 0; i < data.WorkOrderAttachments.length; i++) { - var att = data.WorkOrderAttachments[i]; - var tr = createWOAttachmentTr(att); - $('#woattslist_tbody').append(tr); - } - } - if (data.AssetAttachments && data.AssetAttachments.length > 0) { - for (var i = 0; i < data.AssetAttachments.length; i++) { - var att = data.AssetAttachments[i]; - if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) - att.ThumbnailUrl = att.Url + "&thumb=1"; - var tr = createWOOtherAttachmentTr(att); - $('#woassetattslist_tbody').append(tr); - } - } - if (data.InspectionAttachments && data.InspectionAttachments.length > 0) { - for (var i = 0; i < data.InspectionAttachments.length; i++) { - var att = data.InspectionAttachments[i]; - var tr = createWOOtherAttachmentTr(att); - $('#woiptattslist_tbody').append(tr); - } - } -} - -function createWOAttachmentTr(att) { - var caption = att.Notes === "" ? att.FileName : att.Notes; - var tr = $('<tr></tr>').attr('data-id', att.AttachmentId); - var td; - tr.append('<td></td>'); - - td = $('<td></td>'); - if (!att.FileType || att.FileType == "") - att.FileType = ".jpg"; - - var divpic = $('<div style="width:60px;height:60px;text-align:center;"></div>'); - td.append(divpic); - if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) { - var pic = $('<img class="wolist_picture"></img>').attr('src', att.ThumbnailUrl); - pic.click(att, function (e) { - window.open(e.data.Url, "_blank") - }); - divpic.append(pic); - } - else { - var sdown = $('<img class="wolist_picture" />').click(att, function (e) { - window.open(e.data.Url); - }); - setAttachemntIcon(att.FileType, sdown); - divpic.append(sdown); - } - tr.append(td); - - td = $('<td style="padding-left:20px;"></td>'); - var iptcaption = $('<input type="text" class="inp_name" maxlength="200" style="height:24px;"/>').css('width', '100%').attr('data-ori', caption).val(caption); - iptcaption.data('attdata', att); - td.append(iptcaption); - iptcaption.focus({ AttachmentId: att.AttachmentId, iptcaption: iptcaption }, function (e) { - e.data.iptcaption.addClass('focused'); - }); - iptcaption.blur({ AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { - e.data.iptcaption.removeClass('focused'); - updateWOAttachmentCaption(e.data); - }); - - iptcaption.keydown({ AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { - if (e.keyCode == 13 || e.keyCode == 9) { - e.data.iptcaption.blur(); - } - }); - tr.append(td); - - - td = $('<td></td>'); - var chk_tocust = $('<input type="checkbox" class="inp_recurring"/>').attr('data-ori', att.AvailableToCustomer).prop('checked', att.AvailableToCustomer); - td.append(chk_tocust); - chk_tocust.click(att, function (e) { - updateWOAttachmentExtension(e.data.AttachmentId, $(this).prop('checked')); - }); - tr.append(td); - - td = $('<td class="td_funcs"></td>'); - var sdel = $('<span class="wolist_icon wolist_delete"></span>').attr('title', GetTextByKey("P_WO_DELETE", 'Delete')).click(att, function (e) { - deleteAttachment(e.data.AttachmentId); - }); - td.append(sdel); - - var sdownload = $('<span class="wolist_icon wolist_attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { - openDownloadFrame(e.data.Url + "&d=1"); - }); - td.append(sdownload); - - if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - var sprint = $('<span class="wolist_icon wolist_attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { - openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); - }); - td.append(sprint); - } - - tr.append(td); - return tr; -} - -function createWOOtherAttachmentTr(att) { - var tr = $('<tr></tr>').attr('data-id', att.AttachmentId); - var td; - tr.append('<td></td>'); - - td = $('<td></td>'); - if (!att.FileType || att.FileType == "") - att.FileType = ".jpg"; - - var divpic = $('<div style="width:60px;height:60px;text-align:center;"></div>'); - td.append(divpic); - if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) { - var pic = $('<img class="wolist_picture"></img>').attr('src', att.ThumbnailUrl); - pic.click(att, function (e) { - window.open(e.data.Url, "_blank") - }); - divpic.append(pic); - } - else { - var sdown = $('<img class="wolist_picture" />').click(att, function (e) { - window.open(e.data.Url); - }); - setAttachemntIcon(att.FileType, sdown); - divpic.append(sdown); - } - tr.append(td); - - td = $('<td style="padding-left:20px;"></td>').text(att.FileName); - tr.append(td); - - tr.append('<td></td>'); - - td = $('<td class="td_funcs"></td>'); - if (att.FileType.toLowerCase() != "url") { - var sdownload = $('<span class="wolist_icon wolist_attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { - openDownloadFrame(e.data.Url + "&d=1"); - }); - td.append(sdownload); - } - - if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { - var sprint = $('<span class="wolist_icon wolist_attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { - openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); - }); - td.append(sprint); - } - - tr.append(td); - return tr; -} - -//***********************************End Attachment List************************************// - - -function dragOverWOAttachment(ev) { - ev.preventDefault(); - ev.dataTransfer.dropEffect = 'link'; - //$('#dialogattdragmask').css({ height: $('#tb_woattlarge').height(), top: $('#tb_woattlarge').offset().top }); - //$('#dialogattdragmask').show(); - -} -function dropWOAttachment(ev) { - //$('#dialogattdragmask').hide(); - ev.preventDefault(); - ev.stopPropagation(); - var df = ev.dataTransfer; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - files.push(file); - } - } - } - if (files.length > 0) - onSaveWOAttachment(files); -} - -function cutWOAttachment(ev) { - ev.stopPropagation(); - var df = ev.clipboardData; - var files = []; - if (df.items !== undefined) { - for (var i = 0; i < df.items.length; i++) { - var item = df.items[i]; - if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { - var file = item.getAsFile(); - files.push(file); - } - } - } - if (files.length > 0) - onSaveWOAttachment(files); -} diff --git a/Site/Maintenance/js/workordersegment.js b/Site/Maintenance/js/workordersegment.js deleted file mode 100644 index 0f97c6f..0000000 --- a/Site/Maintenance/js/workordersegment.js +++ /dev/null @@ -1,444 +0,0 @@ -$(function () { - $("#dialog_segmenthour").keydown(numberinput); - $("#dialog_segmentcost").keydown(numberinput); -}); - -function numberinput(e) { - var keyCode = e.which; - if (keyCode === 9//tab - || keyCode === 8 || keyCode === 46 //delete - || keyCode === 110 || keyCode === 190//. - || keyCode === 37 || keyCode === 39//left right - || keyCode === 55 || keyCode === 56//home end - || (keyCode >= 48 && keyCode <= 57) - || (keyCode >= 96 && keyCode <= 105)) - return true; - else - return false; -} - -function GetSegmentDataSource(next) { - worequest("GetSegmentDataSource", '', function (data) { - if (data.Users && data.Users.length > 0) { - userdata = data.Users; - $('#dialog_segmentuser').dropdownSource(userdata); - } - if (data.JobSites && data.JobSites.length > 0) { - var jss = [{ ID: '-1', Name: ' ', html: ' ' }]; - for (var js of data.JobSites) { - jss.push(js); - } - jobsitedata = jss; - $("#dialog_segmentjobsite").dropdownSource(jobsitedata); - } - if (data.Components && data.Components.length > 0) { - var source = []; - for (var type of data.Components) { - source.push({ value: type }); - } - components = source; - $("#dialog_segmentcomponent").dropdownSource(components); - } - if (data.SegmentTypes && data.SegmentTypes.length > 0) { - var source = []; - for (var type of data.SegmentTypes) { - source.push({ value: type }); - } - segmenttypes = source; - $("#dialog_segmenttype").dropdownSource(segmenttypes); - } - - if (next) - next(); - - }, function (err) { - console.log(err);; - }); -} - -function GetSegmentDataSource1(next) { - worequest("GetSegmentDataSource1", '', function (data) { - if (data.Components && data.Components.length > 0) { - var source = []; - for (var type of data.Components) { - source.push({ value: type }); - } - components = source; - $("#dialog_segmentcomponent").dropdownSource(components); - } - if (data.SegmentTypes && data.SegmentTypes.length > 0) { - var source = []; - for (var type of data.SegmentTypes) { - source.push({ value: type }); - } - segmenttypes = source; - $("#dialog_segmenttype").dropdownSource(segmenttypes); - } - - if (next) - next(); - - }, function (err) { - console.log(err);; - }); -} - -function SetCompleted(index) { - var date = $('#dialog_segmentcompleteddate' + index).val(); - if (date.length > 0 && checkDate(date)) { - $('#dialog_segmentcompleted' + index).prop('checked', true); - } -} - -var segmentdata = []; -function initControl(index) { - $('#dialog_segmentcompleteddate' + index).datetimepicker({ - timepicker: false, - format: 'm/d/Y', - enterLikeTab: false, - onSelectDate: function (v, inp) { - var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00'); - inp.parent().data('val', [date]); - } - }); - - $('#dialog_segmentuser' + index).dropdown(userdata || [], { - search: true, - valueKey: 'IID', - textKey: 'DisplayName' - }); - - - $("#dialog_segmentjobsite" + index).dropdown(jobsitedata || [], { - search: true, - valueKey: 'ID', - textKey: 'Name' - }); - - - $("#dialog_segmenttype" + index).dropdown(segmenttypes || [], { - input: true, - maxlength: 50, - textKey: 'value' - }); - - - $("#dialog_segmentcomponent" + index).dropdown(components || [], { - input: true, - maxlength: 40, - textKey: 'value' - }); -} - -function getSegments(callbake) { - segmentindex = 0; - $('#tab_segments .segments_table').remove(); - if (!workorderid || workorderid == "") return; - worequest("GetSegments", workorderid, function (data) { - if (typeof (data) === "string") { - showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); - return; - } - if (data && data.length > 0) { - //$('#dialog_workordercosts').attr('disabled', true); - segmentdata = data; - var wocost = 0; - for (var i = 0; i < segmentdata.length; i++) { - wocost += segmentdata[i].Cost; - showSegment(segmentdata[i]); - } - $('#dialog_workordercosts').val(wocost); - } - else { - //$('#dialog_workordercosts').attr('disabled', false); - if (workorderdata) - $('#dialog_workordercosts').val(workorderdata.WorkOrderTotalCost == 0 ? "" : workorderdata.WorkOrderTotalCost); - segmentdata = []; - if (callbake) - callbake(); - } - - }, function (err) { - }); -} - -var segmentindex = 0; -function showSegment(segment) { - segmentindex++; - var div_segments = $('#tab_segments'); - var table = $('<table id="tabsegment_' + segmentindex + '" class="segments_table"></table>'); - table.data('index', segmentindex); - var tr1 = $('<tr></tr>'); - var tr1_td1 = $('<td class="label" style="font-size:14px;font-weight:500;text-align:left;">' + GetTextByKey("P_WO_SEGMENT", "Segment") + " " + segmentindex + '</td>"'); - if (!WOReadOnly) { - var s_del = $('<span class="sbutton icondelete" onclick="DeleteSegment(' + segmentindex + ');"></span>'); - tr1_td1.append(s_del); - } - var tr1_td2 = $('<td></td>"'); - tr1.append(tr1_td1).append(tr1_td2); - table.append(tr1); - - var tr = $('<tr></tr>'); - var td1 = $('<td class="label">' + GetTextByKey("P_WO_USER_COLON", " User:") + '</td>"'); - var td2 = $('<td></td>"'); - var sel_user = $('<div id="dialog_segmentuser' + segmentindex + '" class="dropdown"></div>').css("width", 320); - td2.append(sel_user); - var td3 = $('<td class="label">' + GetTextByKey("P_WO_COMPLETED_COLON", "Completed:") + '</td>"'); - var td4 = $('<td></td>"'); - var chk_completed = $('<input type="checkbox" id="dialog_segmentcompleted' + segmentindex + '" class="inputbox" />'); - td4.append(chk_completed); - tr.append(td1).append(td2).append(td3).append(td4); - table.append(tr); - - tr = $('<tr></tr>'); - td1 = $('<td class="label">' + GetTextByKey("P_WO_HOURS_COLON", "Hours:") + '</td>"'); - td2 = $('<td></td>"'); - var input_hour = $('<input type="text" id="dialog_segmenthour' + segmentindex + '" class="inputbox" maxlength="12" />') - .keydown(numberinput); - td2.append(input_hour); - td3 = $('<td class="label">' + GetTextByKey("P_WO_COMPLETEDDATE_COLON", "Completed Date:") + '</td>"'); - td4 = $('<td></td>"'); - var input_completeddate = $('<input type="text" id="dialog_segmentcompleteddate' + segmentindex + '" class="inputbox" onchange="SetCompleted(' + segmentindex + ')" />'); - td4.append(input_completeddate); - tr.append(td1).append(td2).append(td3).append(td4); - table.append(tr); - - - tr = $('<tr></tr>'); - td1 = $('<td class="label">' + GetTextByKey("P_WO_JOBSITE_COLON", "Jobsite:") + '</td>"'); - td2 = $('<td></td>"'); - var sel_jobsite = $('<div id="dialog_segmentjobsite' + segmentindex + '" class="dropdown"></div>').css("width", 320); - td2.append(sel_jobsite); - td3 = $('<td class="label"><span>' + GetTextByKey("P_WO_DESCRIPTION_COLON", "Description:") + '</span><span class="redasterisk">*</span></td>"'); - td4 = $('<td></td>"'); - var input_desc = $('<input type="text" id="dialog_segmentdesc' + segmentindex + '" class="inputbox" maxlength="200" />'); - td4.append(input_desc); - tr.append(td1).append(td2).append(td3).append(td4); - table.append(tr); - - tr = $('<tr></tr>'); - td1 = $('<td class="label">' + GetTextByKey("P_WO_COST_COLON", "Cost:") + '</td>"'); - td2 = $('<td></td>"'); - var input_cost = $('<input type="text" id="dialog_segmentcost' + segmentindex + '" class="inputbox" />') - .keydown(numberinput); - td2.append(input_cost); - td3 = $('<td class="label">' + GetTextByKey("P_WO_NOTES_COLON", "Notes:") + '</td>"'); - td4 = $('<td rowspan="4"></td>"').css("vertical-align", "top"); - var textarea_notes = $('<textarea id="dialog_segmentnotes' + segmentindex + '" class="inputbox" maxlength="500" style="width: 450px; height: 120px;"></textarea>') - td4.append(textarea_notes); - tr.append(td1).append(td2).append(td3).append(td4); - table.append(tr); - - tr = $('<tr></tr>'); - td1 = $('<td class="label">' + GetTextByKey("P_WO_XXXXXX_COLON", "Segment Type:") + '</td>"'); - td2 = $('<td></td>"'); - var sel_segmenttype = $('<div id="dialog_segmenttype' + segmentindex + '" class="dropdown"></div>').css("width", 320); - td2.append(sel_segmenttype); - tr.append(td1).append(td2); - table.append(tr); - - tr = $('<tr></tr>'); - td1 = $('<td class="label">' + GetTextByKey("P_WO_COMPONENT_COLON", "Component:") + '</td>"'); - td2 = $('<td></td>"'); - var sel_component = $('<div id="dialog_segmentcomponent' + segmentindex + '" class="dropdown"></div>').css("width", 320); - td2.append(sel_component); - tr.append(td1).append(td2); - table.append(tr); - - tr = $('<tr></tr>'); - td1 = $('<td class="label">' + GetTextByKey("P_WO_XXXXXX_COLON", "Billable:") + '</td>"'); - td2 = $('<td></td>"'); - var chk_billable = $('<input type="checkbox" id="dialog_segmentbillable' + segmentindex + '" class="inputbox" />'); - td2.append(chk_billable); - tr.append(td1).append(td2); - table.append(tr); - - if (!WOReadOnly) { - tr = $('<tr></tr>'); - td1 = $('<td colspan="4" style="text-align: right;"></td>"'); - var input_save = $('<input type="button" value="Save" style="width:80px;height:25px;" id="btn_savesegment' + segmentindex + '" onclick="SaveSegment(' + segmentindex + ')" />').val(GetTextByKey("P_WO_SAVE", "Save")); - var input_cancel = $('<input type="button" value="Cancel" style="width:80px;height:25px;margin-left:10px;" onclick="CancelSegment(' + segmentindex + ')"/>').val(GetTextByKey("P_WO_CANCEL", "Cancel")); - td1.append(input_save).append(input_cancel); - tr.append(td1); - table.append(tr); - } - - div_segments.append(table); - - initControl(segmentindex); - $('#tabsegment_' + segmentindex).data('segment', segment); - $('#dialog_segmentuser' + segmentindex).dropdownVal(segment.UserIID); - $('#dialog_segmentdesc' + segmentindex).val(segment.Description); - $('#dialog_segmenthour' + segmentindex).val(segment.Hours === 0 ? "" : segment.Hours); - $('#dialog_segmentnotes' + segmentindex).val(segment.Notes); - $('#dialog_segmentjobsite' + segmentindex).dropdownVal(segment.JobsiteID); - $('#dialog_segmentcost' + segmentindex).val(segment.Cost === 0 ? "" : segment.Cost); - $('#dialog_segmenttype' + segmentindex).dropdownVal(segment.SegmentType); - $('#dialog_segmentcompleted' + segmentindex).prop('checked', segment.Completed); - $('#dialog_segmentcompleteddate' + segmentindex).val(segment.CompletedDateStr); - $('#dialog_segmentcomponent' + segmentindex).dropdownVal(segment.Component); - $('#dialog_segmentbillable' + segmentindex).prop('checked', segment.Billable); -} - -function OnAddSegment() { - if (!workorderid || workorderid === "") { - showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDSEGMENT", "Add Segment")); - return; - } - - $('#dialog_segmentuser').dropdownVal(''); - $('#dialog_segmentdesc').val(''); - $('#dialog_segmenthour').val(''); - $('#dialog_segmentnotes').val(''); - $('#dialog_segmentjobsite').dropdownVal(''); - $('#dialog_segmentcost').val(''); - $('#dialog_segmentcompleted').prop('checked', false); - $('#dialog_segmentcompleteddate').val(''); - $('#dialog_segmenttype').dropdownVal(''); - $('#dialog_segmentcomponent').dropdownVal(''); - $('#dialog_segmentbillable').prop('checked', false); - - showPopup(); -} - -function DeleteSegment(index) { - var segment = $('#tabsegment_' + index).data('segment'); - if (!segment) - return; - showConfirm(GetTextByKey("P_WO_DOYOUWANTTODELETETHESEGMENT", 'Do you want to delete the segment?'), GetTextByKey("P_WO_DELETESEGMENT", 'Delete Segment'), function () { - worequest("DeleteSegment", segment.SegmentID, function (data) { - GetSegmentDataSource1(function () { - getSegments(getTotalCost); - }); - }, function (err) { - showAlert(GetTextByKey("P_WO_FAILEDDELETESEGMENT", 'Failed to delete this segment.'), GetTextByKey("P_WO_DELETESEGMENT", 'Delete Segment')); - }); - }); - -} - -function CancelSegment(index) { - var segment = $('#tabsegment_' + index).data('segment'); - if (!segment) - return; - $('#dialog_segmentuser' + index).dropdownVal(segment.UserIID); - $('#dialog_segmentdesc' + index).val(segment.Description); - $('#dialog_segmenthour' + index).val(segment.Hours); - $('#dialog_segmentnotes' + index).val(segment.Notes); - $('#dialog_segmentjobsite' + index).dropdownVal(segment.JobsiteID); - $('#dialog_segmentcost' + index).val(segment.Cost); - $('#dialog_segmentcompleted' + index).prop('checked', segment.Completed); - $('#dialog_segmentcompleteddate' + index).val(segment.CompletedDateStr); - $('#dialog_segmenttype' + index).dropdownVal(segment.SegmentType); - $('#dialog_segmentcomponent' + index).dropdownVal(segment.Component); - $('#dialog_segmentbillable' + index).prop('checked', segment.Billable); -} - -function SaveSegment(index) { - $('#btn_savesegment' + index).attr('disabled', true); - var segmentid = -1; - var alerttitle = GetTextByKey("P_WO_ADDSEGMENT", "Add Segment"); - if (index !== "") { - var alerttitle = GetTextByKey("P_WO_EDITSEGMENT", "Edit Segment"); - var segment = $('#tabsegment_' + index).data('segment'); - if (!segment) - return; - segmentid = segment.SegmentID; - } - var item = { - 'SegmentID': segmentid, - 'WorkOrderID': workorderid, - 'UserIID': $('#dialog_segmentuser' + index).dropdownVal(), - 'Description': $('#dialog_segmentdesc' + index).val(), - 'Hours': $('#dialog_segmenthour' + index).val(), - 'Notes': $('#dialog_segmentnotes' + index).val(), - 'JobsiteID': $('#dialog_segmentjobsite' + index).dropdownVal(), - 'Cost': $('#dialog_segmentcost' + index).val(), - 'Completed': $('#dialog_segmentcompleted' + index).prop('checked'), - 'CompletedDate': $('#dialog_segmentcompleteddate' + index).val(), - 'SegmentType': $('#dialog_segmenttype' + index).dropdownVal(), - 'Component': $('#dialog_segmentcomponent' + index).dropdownVal(), - 'Billable': $('#dialog_segmentbillable' + index).prop('checked') - }; - - if (item.Description === "" || item.Description.length == 0) { - showAlert(GetTextByKey("P_WO_DESCRIPTIONREQUIRED", 'Description is required.'), alerttitle); - $('#btn_savesegment' + index).attr('disabled', false); - return; - } - - if (item.Hours !== "") { - if (isNaN(item.Hours)) { - showAlert(GetTextByKey("P_WO_HOURSFORMATERROR", 'Hours format error.'), alerttitle); - $('#btn_savesegment' + index).attr('disabled', false); - return; - } - else { - if (item.Hours <= 0) { - showAlert(GetTextByKey("P_WO_HOURSMUSTBEGREATERTHAN0", 'Hours must be greater than 0.'), alerttitle); - $('#btn_savesegment' + index).attr('disabled', false); - return; - } - } - } - - if (item.Cost !== "") { - if (isNaN(item.Cost)) { - showAlert(GetTextByKey("P_WO_COSTFORMATERROR", 'Cost format error.'), alerttitle); - $('#btn_savesegment' + index).attr('disabled', false); - return; - } - else { - if (item.Cost <= 0) { - showAlert(GetTextByKey("P_WO_COSTMUSTBEGREATERTHAN0", 'Cost must be greater than 0.'), alerttitle); - $('#btn_savesegment' + index).attr('disabled', false); - return; - } - } - } - - if (item.Cost === "") - item.Cost = -1; - if (item.Hours === "") - item.Hours = -1; - - var param = JSON.stringify(item); - param = htmlencode(param); - worequest("SaveSegment", param, function (data) { - if (typeof (data) === "string") { - $('#btn_savesegment' + index).attr('disabled', false); - showAlert(data, alerttitle); - } else { - $('#btn_savesegment' + index).attr('disabled', false); - if (index !== "") { - showAlert(GetTextByKey("P_WO_SAVSUCCESSFULLY", "Saved successfully."), alerttitle); - } - GetSegmentDataSource1(function () { - getSegments(getTotalCost); - }); - hidePopup(); - } - }, function (err) { - $('#btn_savesegment' + index).attr('disabled', false); - console.log(err); - showAlert(GetTextByKey("P_WO_FAILEDTOSAVESEGMENT", 'Failed to save segment.'), alerttitle); - }); - -} - -function showPopup() { - $('#popupmask').css('height', $('#dialog_workorder').height()); - $('#popupmask').show(); - $('#popupdialog').show(); - $('#popupdialog').css({ - "top": ($("#popupmask").height() - $('#popupdialog').height()) / 2, - "left": ($("#popupmask").width() - $('#popupdialog').width()) / 2 - }); - - $('#dialog_segmentuser').focus(); -} - -function hidePopup() { - $('#popupmask').hide(); - $('#popupdialog').hide(); -} \ No newline at end of file diff --git a/Site/Maintenance/js/workordersendemail.js b/Site/Maintenance/js/workordersendemail.js index 62be8a7..a54263a 100644 --- a/Site/Maintenance/js/workordersendemail.js +++ b/Site/Maintenance/js/workordersendemail.js @@ -18,6 +18,13 @@ showICContactList(false); }); + $('#sendemailpopupdialog').dialog(function () { + showmaskbg(false); + }); + + $('#sendicemailpopupdialog').dialog(function () { + showmaskbg(false); + }); }); var machineContacts = []; @@ -40,7 +47,7 @@ function getMachineContacts(assetid) { function showContactList(newopen) { var rows = []; if (machineContacts && machineContacts.length > 0) { - var filter = $('#sendworkorder_search').val().trim().toLowerCase(); + var filter = $('#sendworkorder_search').val()?.trim()?.toLowerCase(); var assignedto = $.trim($('#dialog_assignto').val()); for (var i = 0; i < machineContacts.length; i++) { var r = machineContacts[i]; @@ -74,6 +81,7 @@ function showContactList(newopen) { } } } + rows = rows.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) }); grid_contactdt.setData(rows); } @@ -149,19 +157,16 @@ function openSendEmail() { } getMachineContacts(mid); - $('#sendemailpopupmask').css('height', $('#dialog_workorder').height()); - $('#sendemailpopupmask').css('min-width', $('#divcontent').width()); - $('#sendemailpopupmask').show(); - $('#sendemailpopupdialog').show(); + showmaskbg(true); $('#sendemailpopupdialog').css({ - "top": ($("#sendemailpopupmask").height() - $('#sendemailpopupdialog').height()) / 2, - "left": ($("#sendemailpopupmask").width() - $('#sendemailpopupdialog').width()) / 2 - }); + 'top': (document.documentElement.clientHeight - $('#sendemailpopupdialog').height()) / 3, + 'left': (document.documentElement.clientWidth - $('#sendemailpopupdialog').width()) / 2 + }).showDialogfixed(); } function hideSendEmailPopup() { - $('#sendemailpopupmask').hide(); + showmaskbg(false); $('#sendemailpopupdialog').hide(); } @@ -293,6 +298,7 @@ function showICContactList(newopen) { } } } + rows = rows.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) }); grid_iccontactdt.setData(rows); } @@ -321,19 +327,16 @@ function openSendICEmail() { } getMachineContacts(mid); - $('#sendicemailpopupmask').css('height', $('#dialog_workorder').height()); - $('#sendicemailpopupmask').css('min-width', $('#divcontent').width()); - $('#sendicemailpopupmask').show(); - $('#sendicemailpopupdialog').show(); + showmaskbg(true); $('#sendicemailpopupdialog').css({ - "top": ($("#sendicemailpopupmask").height() - $('#sendicemailpopupdialog').height()) / 2, - "left": ($("#sendicemailpopupmask").width() - $('#sendicemailpopupdialog').width()) / 2 - }); + 'top': (document.documentElement.clientHeight - $('#sendicemailpopupdialog').height()) / 3, + 'left': (document.documentElement.clientWidth - $('#sendicemailpopupdialog').width()) / 2 + }).showDialogfixed(); } function hideSendICEmailPopup() { - $('#sendicemailpopupmask').hide(); + showmaskbg(false); $('#sendicemailpopupdialog').hide(); } @@ -393,7 +396,10 @@ function onSendInternalComments() { internal.text = ''; } hideSendICEmailPopup(); - getComments(); + if (typeof wowidgetobj != 'undefined') + wowidgetobj.reloaddata("InternalComments"); + else + getComments(); }, function (err) { hideSendICEmailPopup(); diff --git a/Site/Maintenance/js/workordertabitems.js b/Site/Maintenance/js/workordertabitems.js new file mode 100644 index 0000000..a298c14 --- /dev/null +++ b/Site/Maintenance/js/workordertabitems.js @@ -0,0 +1,6279 @@ + + +function locale(num, disabled) { + if (!disabled) { + return num; + } + var backup = num; + if (typeof num !== 'number') { + num = Number(num); + } + if (isNaN(num)) { + return backup; + } + var s = num.toFixed(2); + var array = s.split('.'); + var integer = array[0].split('').reverse().join('').replace(/(\d{3})+?/g, function (s) { return s + ',' }).split('').reverse().join(''); + if (integer[0] == ',') { + integer = integer.substring(1); + } + return integer + '.' + array[1]; +} + + +function OnExpendInTab(e) { + var t = $(e); + var tid = t.attr("target"); + if (t.hasClass("iconchevrondown")) { + t.removeClass("iconchevrondown").addClass("iconchevronright"); + $("#" + tid).hide(); + } + else { + t.removeClass("iconchevronright").addClass("iconchevrondown"); + $("#" + tid).show(); + } +} + + +/*************************Inspections********************************/ +if (typeof ($woinspection) !== "function") { + $woinspection = function (option) { + this.option = option || {}; + var _this = this; + var inspectionDiv = null; + + this.changewo = function (woid, aid) { + //if (woid !== option.workorderid) { + this.option.workorderid = woid; + if (aid) + this.option.machineid = aid; + inspectionDiv && inspectionDiv.empty(); + getWOInspectItems(); + //} + } + this.close = function () { + } + + this.changeasset = function (aid) { + this.option.machineid = aid; + } + + this.createInspectionDiv = function (p_div) { + inspectionDiv = $('<div style="overflow: auto; min-width: 1610px; height: 668px;"></div>'); + p_div.append(inspectionDiv); + } + + this.createInspectionDiv(this.option.parent); + window.onresize = resizeContent; + resizeContent(); + function resizeContent() { + inspectionDiv && inspectionDiv.css('height', $(window).height() - inspectionDiv.offset().top - 4); + } + + + var assetworkorders; + var inloading = false; + function getWOInspectItems() { + inspectionDiv.empty(); + assetworkorders = []; + if (!_this.option.workorderid || _this.option.workorderid == "") return; + if (inloading) + return; + inloading = true; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + worequest("GetWOInspectItems", JSON.stringify([_this.option.workorderid, _this.option.machineid]), function (data) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data.WorkOrderID != _this.option.workorderid) { + getWOInspectItems(); + return; + } + data = data.Data; + if (data && data.length > 0) { + assetworkorders = data[0].WorkOrders; + ShowWOInspects(data); + } + else { + inspectionDiv.empty(); + inspectionDiv.append($('<div class="noinspection"></div>').text(GetTextByKey("P_WO_NOINSPECTION", 'No Inspection'))); + } + resizeContent(); + }, function (err) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + + function ShowWOInspects(inspects) { + var div = inspectionDiv; + div.empty(); + + for (var i = 0; i < inspects.length; i++) { + var ipt = inspects[i]; + var targetid = "tbinspect_" + i; + var div_title = $('<div class="subtitle" style="position:relative;"></div>'); + var spimg = $('<span class="sbutton iconchevronright" target="' + targetid + '" style="margin-left: 0; padding-right: 5px;"></span>').data('iptid', ipt.Id).click(function () { + var t = $(this); + var tid = t.attr("target"); + if (t.hasClass("iconchevrondown")) { + t.removeClass("iconchevrondown").addClass("iconchevronright"); + $("#" + tid).hide(); + } + else { + t.removeClass("iconchevronright").addClass("iconchevrondown"); + $("#" + tid).show(); + var iptid = t.data("iptid"); + var iframe = $("#iframe_" + iptid); + if (iframe.data("load") == 0) { + iframe.attr('src', '../Inspection/ReportForWorkOrder.aspx?rid=' + iptid); + iframe.data("load", 1); + } + } + }); + var span = $('<span></span>').text(ipt.TemplateName); + div_title.append(spimg).append(span); + span = $('<span style="margin-left:80px;"></span>').text(ipt.CommitTimeLocalStr + ' by ' + ipt.CommitedByUserName); + div_title.append(span); + var ext_chk = $('<input type="checkbox" style="margin-left:80px;"/>').prop('checked', ipt.VisibleToCustomer).click(ipt, function (e) { + updateInspectVisibleToCustomer(e.data.Id, $(this).prop('checked')); + }); + div_title.append(ext_chk); + span = $('<span style="margin-left:5px;"></span>').text(GetTextByKey('P_WO_VISIBLETOCUSTOMER', 'Visible To Customer')); + if (WOReadOnly) + ext_chk.prop('disabled', true); + div_title.append(span); + if (AllowReassignWorkorders) { + span = $('<span style="margin-left:80px;"></span>').text(GetTextByKey('P_WO_WORKORDERASSIGNMENT', 'Work Order Assignment')); + div_title.append(span); + + var div_editableselect = $('<div style="margin-left:8px;width: 200px;display:inline-block;" class="dropdown"></div>'); + div_editableselect + .attr({ + 'inspection-id': ipt.Id, + 'old-wo-id': ipt.WorkOrderId + }) + .dropdown(assetworkorders || [], { + input: true, + valueKey: 'Id', + textKey: 'WorkOrderNumber', + selected: ipt.WorkOrderNumber + }).on('select', function (_e, wo) { + console.log(1) + var et = $(_e.target); + if (wo) { + var msg1 = GetTextByKey('P_WO_AREYOUSURETHATYOUWANTTOPROCEED', 'Are you sure that you want to proceed ?'); + var msg = GetTextByKey('P_WO_YOUAREREASSIGNINGTHISWORKORDER', 'You are reassigning this work order. ') + "<br/>" + msg1; + if (wo.Completed) + msg = GetTextByKey('P_WO_YOUAREREASSIGNINGTHISWORKORDERTOACLOSEDWORKORDER', 'You are reassigning this Work Order to a CLOSED Work Order.') + "<br/>" + msg1; + showConfirm(msg, GetTextByKey("P_WO_WORKORDERASSIGNMENT", 'Work Order Assignment'), function () { + updateInspectionWorkOrder(et.attr('inspection-id'), wo.Id); + }, function () { + et.dropdownVal(et.attr('old-wo-id')); + }); + } + }); + div_title.append(div_editableselect); + } + div_title.append('<hr />'); + div.append(div_title); + + var tab = $('<table style="display: none;width:100%;height:100%;" id="' + targetid + '"></table>'); + tr = $("<tr></tr>"); + td = $('<td></td>'); + var iframe = $('<iframe style="width: 100%; height: 100%; display: block; border: none;"></iframe>').attr("id", "iframe_" + ipt.Id).data("load", 0); + td.append(iframe); + tr.append(td); + tab.append(tr); + div.append(tab); + } + } + + function updateInspectionWorkOrder(id, woid) { + var p = JSON.stringify([id, woid, _this.option.workorderid]); + worequest("UpdateInspectionWorkOrder", htmlencode(p), function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_WORKORDERASSIGNMENT", 'Work Order Assignment')); + return; + } + getWOInspectItems(); + getAlerts(); + woattachmentobj && woattachmentobj.refresh(); + }, function (err) { + }); + } + + function updateInspectVisibleToCustomer(id, chk) { + var item = [id, chk]; + var param = JSON.stringify(item); + param = htmlencode(param); + + worequest('UpdateInspectionVisibleToCustomer', param, function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); + } + }, function (err) { + }); + } + } +} + +/*************************End Inspections********************************/ + + +/*****************************************Begin Estimate*********************************************/ +if (typeof ($woestimate) !== "function") { + $woestimate = function (option) { + this.option = option || {}; + var _this = this; + + var EstimateStatus = { + Draft: 0, + Pending: 1, + Cancelled: 2, + Declined: 3, + Approved: 4, + Void: 5, + None: 100, + }; + + var estimateindex = 0; + var publishestindex = 0; + var addestfiledatas = []; + var cur_uploaddata; + var cur_uploadindex = ""; + + var btn_woestattasave = null; + + this.changewo = function (woid) { + //if (woid !== option.workorderid) { + this.option.workorderid = woid; + getEstimates(); + //} + } + + this.close = function () { + estimateDialog?.remove(); + estimatePublishDialog?.remove(); + estimateAttachmentDialog?.remove(); + } + + this.setwodata = function (wodata) { + this.option.workorderdata = wodata; + } + + this.updatecontact = function (contacts) { + this.option.customercontacts = contacts + + if (this.option.customercontacts) { + var names = ""; + for (var i = 0; i < this.option.customercontacts.length; i++) { + var c = this.option.customercontacts[i]; + if (c.OptOut || c.OptOut_BC) continue; + var mp = $.trim(c.MobilePhone); + var email = $.trim(c.Email); + if ((c.ContactPreference == "0" && (checkPhoneNumber(mp)) + || (c.ContactPreference == "1" && isEmail(email)))) { + if (names == "") + names = c.Name; + else + names += ";" + c.Name; + } + } + + $('#dialog_est_phonenum').val(names); + } + else { + $('#dialog_est_phonenum').val(""); + } + } + + this.createEstimate = function (p_div) { + p_div.addClass('tab_estimates'); + var div = $('<div class="function_title"></div>'); + p_div.append(div); + var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDESTIMATE">Add Estimate</span>'); + span_add.click(OnAddEstimate); + div.append(span_add); + } + this.createEstimate(this.option.parent); + var estimateDialog = createEstimateDialog(); + var estimatePublishDialog = createPublishEstimateDialog(); + var estimateAttachmentDialog = createEstimateAttachmentDialog(); + + function createEstimateDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.on('drop', function (ev) { + dropAddEstimateAttachment(ev.originalEvent); + }).on('dragover', function (ev) { + dragOverAddEstimateAttachment(ev.originalEvent); + }).on('paste', function (ev) { + cutAddEstimateAttachment(ev.originalEvent); + }); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_ADDESTIMATE">Add Estimate</span><em class="dialog-close"></em></div>'); + + var tb = $('<table></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td class="label" data-lgid="P_WO_ESTIMATENUMBER_COLON">Estimate #:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_number = $('<input type="text" id="dialog_est_number" tabindex="1" maxlength="50" style="width:150px;" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_ESTIMATESTATUS_COLON">Estimate Status:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_status = $('<span id="dialog_est_status">Draft</span>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_ESTIMATETOTALCOST_COLON">Estimate Total Cost ($):</td>').appendTo(tr); + td = $('<td class="cont"></td>').appendTo(tr); + var dialog_est_totalcosts = $('<input type="text" id="dialog_est_totalcosts" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off">').appendTo(td); + var icon = $('<span class="sbutton iconequel" style="padding: 3px 1px 3px 6px; font-size: 12px;" data-title-lgid="P_WO_CALCULATINGTOTALS" title="Calculating Totals"></span>').appendTo(td); + icon.on('click', function () { + getEstimateTotalCost(''); + }); + td = $('<td class="label" data-lgid="P_WO_OTHERCOST_COLON">Other Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_othercost = $('<input type="text" id="dialog_est_othercost" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_PARTSCOST_COLON">Parts Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_partscost = $('<input type="text" id="dialog_est_partscost" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_TRAVELTIMECOST_COLON">Travel Time Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_traveltimecost = $('<input type="text" id="dialog_est_traveltimecost" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_LABORCOST_COLON">Labor Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_laborcost = $('<input type="text" id="dialog_est_laborcost" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_TIMETOCOMPLATEHOURS_COLON">Time To Complete(Hrs):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_timetocomplete = $('<input type="text" id="dialog_est_timetocomplete" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_TAXES_COLON">Taxes ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_taxes = $('<input type="text" id="dialog_est_taxes" maxlength="12" style="width:150px;" tabindex="1" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_XXX">PO Required:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_porequired = $('<input type="checkbox" id="dialog_est_porequired" style="width: auto;" tabindex="1" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_CUSTOMERISSUES_COLON" style="vertical-align: top;">Customer Issues:</td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var dialog_est_custissues = $('<textarea id="dialog_est_custissues" tabindex="1" maxlength="2000" style="height:80px;width:450px;"></textarea>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_TECHNICIANNOTES_COLON" style="vertical-align: top;">Technician Notes:</td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var dialog_est_technotes = $('<textarea id="dialog_est_technotes" tabindex="1" maxlength="500" style="height:80px;width:450px;"></textarea>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top;">Attachments:</td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var spanAtta = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDFILE">Add File</span>').appendTo(td); + spanAtta.on('click', function () { + openWOEstAttachmentDialog(''); + }) + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label"></td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var tb_att = $('<table id="tab_est_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 450px; display: none;"></table>'); + td.append(tb_att); + var tr_att = $('<tr></tr>'); + tb_att.append(tr_att); + var td_att = $('<td></td>'); + tr_att.append(td_att); + div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); + td_att.append(div_att); + tb_att = $('<table id="tab_est_atts" style="table-layout: fixed;"></table>'); + div_att.append(tb_att); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="11" />'); + var btnpub = $('<input type="button" value="Publish" data-lgid="P_WO_PUBLISH" tabindex="11" />'); + btnpub.on('click', function () { + openPublishDialog(-1); + }); + func.append(btnpub); + + var btnok = $('<input type="button" value="OK" data-lgid="P_WO_OK" tabindex="11" />'); + btnok.on('click', function () { + onSaveWorkOrderEstimate(''); + }); + func.append(btnok); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + + return dialog; + } + + function createPublishEstimateDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_PUBLISHESTIMATE">Publish Estimate</span><em class="pubestpopus-close"></em></div>'); + + var tb = $('<table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td style="text-align: right;"></td>').appendTo(tr); + var dialog_est_chksendtextmsg = $('<input id="dialog_est_chksendtextmsg" type="checkbox" checked="checked" style="width: unset;" />').appendTo(td); + dialog_est_chksendtextmsg.change(function () { + var checked = $('#dialog_est_chksendtextmsg').prop('checked'); + $('#dialog_est_phonenum').prop('disabled', !checked); + $('#dialog_est_chkIncludeStatusLink').prop('disabled', !checked); + $('#dialog_est_textmsg').prop('disabled', !checked); + }); + td = $('<td></td>').appendTo(tr); + $('<label for="dialog_est_chksendtextmsg" data-lgid="P_WO_SENDUPDATETOCUSTOMER" style="user-select: none;">Send Update To Customer</label>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td></td>').appendTo(tr); + $('<div style="font-size: 20px; margin-right: 5px; float: right;"><em class="spanbtn iconmobile" style="font-weight: 900; font-size: 14px; cursor: default; padding-left: 0; padding-right: 3px; padding-top: 0;"></em></div>').appendTo(td); + td = $('<td></td>').appendTo(tr); + var dialog_est_phonenum = $('<input type="text" id="dialog_est_phonenum" tabindex="1" autocomplete="off" maxlength="100" style="width: 320px;" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td style="text-align: right;"></td>').appendTo(tr); + var dialog_est_chkIncludeStatusLink = $('<input id="dialog_est_chkIncludeStatusLink" type="checkbox" checked="checked" style="width: unset;" />').appendTo(td); + td = $('<td></td>').appendTo(tr); + $('<label for="dialog_est_chkIncludeStatusLink" data-lgid="P_WO_INCLUDESTATUSLINK" style="user-select: none;">Include Status Link</label>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" style="width: unset;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_est_variables = $('<select id="dialog_est_variables" style="width: 156px;"></select>').appendTo(td); + dialog_est_variables.append('<option value="0">[Site_Name]</option>'); + dialog_est_variables.append('<option value="1">[Location]</option>'); + dialog_est_variables.append('<option value="14">[Asset]</option>'); + dialog_est_variables.append('<option value="4">[VIN]</option>'); + dialog_est_variables.append('<option value="2">[Make]</option>'); + dialog_est_variables.append('<option value="3">[Model]</option>'); + dialog_est_variables.append('<option value="5">[Id_Phone]</option>'); + dialog_est_variables.append('<option value="6">[Advisor]</option>'); + dialog_est_variables.append('<option value="7">[Company_Name]</option>'); + dialog_est_variables.append('<option value="8">[Contact_Name]</option>'); + dialog_est_variables.append('<option value="9">[Contact_First_Name]</option>'); + dialog_est_variables.append('<option value="10">[Status_Link]</option>'); + dialog_est_variables.append('<option value="11">[Technician_Name]</option>'); + dialog_est_variables.append('<option value="12">[Work_Order_Number]</option>'); + dialog_est_variables.append('<option value="13">[Parts_Order_Number]</option>'); + + var dialog_est_insertfield = $('<input type="button" id="dialog_est_insertfield" data-lgid="P_WO_ADD" value="Add" style="width: 35px; height: auto; margin-left: 5px;" tabindex="1" /><br />').appendTo(td); + dialog_est_insertfield.on('click', function () { + insertestfield(); + }); + var dialog_est_textmsg = $('<textarea id="dialog_est_textmsg" tabindex="1" style="width: 320px; height: 120px; margin-top: 6px;" maxlength="2000"></textarea>').appendTo(td); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="11" />'); + btn_publish = $('<input type="button" value="Publish" data-lgid="P_WO_PUBLISH" tabindex="1" />'); + btn_publish.on('click', function () { + onPublishEstimate(); + }); + func.append(btn_publish); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + hidePublishEstimatePopup(); + }); + + return dialog; + } + + function createEstimateAttachmentDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_ADDATTACHMENT">Add Attachment</span><em class="dialog-close"></em></div>'); + + var tb = $('<table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td class="label" style="width: unset;"><span data-lgid="P_WO_CAPTION_COLON">Caption:</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_estatt_notes = $('<input type="text" id="dialog_estatt_notes" maxlength="200" tabindex="1" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top; width: unset;">Attachments:</td>').appendTo(tr); + td = $('<td class="cont"></td>').appendTo(tr); + var dialog_woestatt_uploadattfile = $('<input id="dialog_woestatt_uploadattfile" type="button" value="Add File..." data-lgid="P_FR_ADDFILE" tabindex="1" style="background-color: #0099FF; color: #FFFFFF; height: 20px; width: 200px;" />').appendTo(td); + dialog_woestatt_uploadattfile.on('click', function () { + UpLoadEstimateAttachment(); + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label"></td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var tb_att = $('<table id="tab_woest_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 450px; display: none;"></table>'); + td.append(tb_att); + var tr_att = $('<tr></tr>'); + tb_att.append(tr_att); + var td_att = $('<td></td>'); + tr_att.append(td_att); + div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); + td_att.append(div_att); + tb_att = $('<table id="tab_woest_atts" style="table-layout: fixed;"></table>'); + div_att.append(tb_att); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="11" />'); + btn_woestattasave = $('<input type="button" value="Save" data-lgid="P_WO_SAVE" tabindex="11" />'); + btn_woestattasave.on('click', function () { + onSaveWOEstAttachment(); + }); + func.append(btn_woestattasave); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + hideWOEstAttachmentPopup(); + }); + + return dialog; + } + + function insertestfield() { + var field = $("#dialog_est_variables").find("option:selected").text(); + $("#dialog_est_textmsg").focus(); + document.execCommand('insertText', false, field); + } + + function showEstimatePopup() { + showmaskbg(true); + estimateDialog.css({ + 'top': (document.documentElement.clientHeight - estimateDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - estimateDialog.width()) / 2 + }).showDialogfixed(); + } + + function hideEstimatePopup() { + showmaskbg(false); + estimateDialog.hide(); + } + + var inloading = false; + function getEstimates() { + estimateindex = 0; + _this.option.parent.find('.estimates_div').remove(); + _this.option.parent.find('.estimates_table').remove(); + if (!_this.option.workorderid || _this.option.workorderid == "") return; + if (inloading) + return; + inloading = true; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + worequest("GetWorkOrderEstimates", _this.option.workorderid, function (data) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + _this.option.parent.find('.estimates_div').remove(); + _this.option.parent.find('.estimates_table').remove(); + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data.WorkOrderID != _this.option.workorderid) { + getEstimates(); + return; + } + data = data.Data; + if (data) { + if (data && data.length > 0) { + if (AllowCustomer) + $('#dialog_estimatestatus').text(_this.getEstimateStatus(data[data.length - 1].Status)); + for (var i = 0; i < data.length; i++) { + showEstimate(data[i]); + } + } + else { + if (AllowCustomer) + $('#dialog_estimatestatus').text(_this.getEstimateStatus(100)) + } + } + + }, function (err) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + + function dragOverEstimateAttachment(ev, index) { + ev.preventDefault(); + ev.dataTransfer.dropEffect = 'link'; + } + + function dropEstimateAttachment(ev, index) { + ev.preventDefault(); + ev.stopPropagation(); + var df = ev.dataTransfer; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + if (estimate.Status !== 0) + return; + + if (files.length > 0) + SaveEstimateAttachmentFiles(files, estimate.Id, index); + } + + function cutEstimateAttachment(ev, index) { + ev.stopPropagation(); + var df = ev.clipboardData; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + if (estimate.Status !== 0) + return; + + if (files.length > 0) + SaveEstimateAttachmentFiles(files, estimate.Id, index); + } + + function showEstimate(estimate) { + estimateindex++; + var statustext = _this.getEstimateStatus(estimate.Status); + var div_estimates = _this.option.parent; + var div_title = $('<div id="divestimate' + estimateindex + '" class="subtitle estimates_div" style="margin-right:0px;"></div>'); + div_title.on('drop', estimateindex, function (ev) { + dropEstimateAttachment(ev.originalEvent, ev.data); + }).on('dragover', estimateindex, function (ev) { + dragOverEstimateAttachment(ev.originalEvent, ev.data); + }).on('paste', estimateindex, function (ev) { + cutEstimateAttachment(ev.originalEvent, ev.data); + }); + + div_title.append('<span class="sbutton iconchevronright" target="tabestimate' + estimateindex + '" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span>'); + div_title.append('<span id="span_estnumber' + estimateindex + '">' + estimate.EstimateNumber + '</span>'); + div_title.append('<span id="span_eststatus' + estimateindex + '" style="margin-left:80px;font-weight:bold;">' + statustext + '</span>'); + if (!WOReadOnly && (estimate.Status == 0 || estimate.Status === 1)) { + var s_del = $('<span class="sbutton icondelete" style="float:right;margin-right: 10px; padding: 0px 0px 0px 5px;"></span>'); + s_del.on('click', estimateindex, function (e) { + OnDeleteEstimate(e.data); + }); + div_title.append(s_del); + } + div_title.append('<hr />'); + div_estimates.append(div_title); + + var table = $('<table id="tabestimate' + estimateindex + '" class="estimates_table"></table>').data('estimate', estimate).data('index', estimateindex).hide(); + table.on('drop', estimateindex, function (ev) { + dropEstimateAttachment(ev.originalEvent, ev.data); + }).on('dragover', estimateindex, function (ev) { + dragOverEstimateAttachment(ev.originalEvent, ev.data); + }).on('paste', estimateindex, function (ev) { + cutEstimateAttachment(ev.originalEvent, ev.data); + }); + div_estimates.append(table); + var tr = $('<tr></tr>'); + table.append(tr); + var td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ESTIMATENUMBER_COLON', 'Estimate #:')); + tr.append(td); + td = $('<td style="width:150px;"></td>'); + tr.append(td); + var ipt = $('<input type="text" id="dialog_est_number' + estimateindex + '" tabindex="1" maxlength="50" autocomplete="off" />').val(estimate.EstimateNumber).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ESTIMATESTATUS_COLON', 'Estimate Status:')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<span style="font-weight:bold;" id="dialog_est_status' + estimateindex + '"></span>').text(statustext); + td.append(ipt); + + if ([3, 4, 5].indexOf(estimate.Status) >= 0) { + td = $('<td class="label"></td>'); + if (estimate.Status == 3) { + td.text(GetTextByKey('P_WO_REJECTEDBY_COLON', 'Rejected By:')); + } + else if (estimate.Status == 4 || estimate.Status == 5) { + td.text(GetTextByKey('P_WO_APPROVEDBY_COLON', 'Approved By:')); + } + tr.append(td); + td = $('<td></td>'); + tr.append(td); + var byph = ""; + if (estimate.ResponsePhoneStr !== "") + byph = " (" + estimate.ResponsePhoneStr + ")"; + ipt = $('<span id="dialog_est_crn' + estimateindex + '"></span>').text(estimate.ResponseName + byph); + td.append(ipt); + } + else { + tr.append('<td cospan="2"></td>'); + } + var disabled = estimate.Status === EstimateStatus.Pending || estimate.Status === EstimateStatus.Declined || estimate.Status === EstimateStatus.Approved || estimate.Status === EstimateStatus.Void; + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ESTIMATETOTALCOST_COLON', 'Estimate Total Cost ($):')); + tr.append(td); + td = $('<td style="display: inline-flex;"></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_est_totalcosts' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off"/>').val(locale(estimate.TotalCost, disabled)); + td.append(ipt); + var btntotal = $("<span class='sbutton iconequel' style='padding:3px 1px 3px 6px;font-size:12px;margin-left:2px;'></span>").click(estimateindex, function (e) { + getEstimateTotalCost(e.data); + }).attr("title", GetTextByKey('P_WO_CALCULATINGTOTALS', 'Calculating Totals')); + td.append(btntotal); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_OTHERCOST_COLON', 'Other Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_est_othercost' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(estimate.OtherCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + + if ([3, 4, 5].indexOf(estimate.Status) >= 0) { + td = $('<td class="label"></td>'); + if (estimate.Status == 3) { + td.text(GetTextByKey('P_WO_REJECTEDTIME_COLON', 'Rejected Time:')); + } + else if (estimate.Status == 4 || estimate.Status == 5) { + td.text(GetTextByKey('P_WO_APPROVEDTIME_COLON', 'Approved Time:')); + } + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<span id="dialog_est_crt' + estimateindex + '"></span>').text(estimate.CustomerResponseTimeStr); + td.append(ipt); + } + else { + tr.append('<td cospan="2"></td>'); + } + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_PARTSCOST_COLON', 'Parts Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_est_partscost' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(estimate.PartsCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TRAVELTIMECOST_COLON', 'Travel Time Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); ipt = $('<input type="text" id="dialog_est_traveltimecost' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(estimate.TravelCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + + if ([3, 4, 5].indexOf(estimate.Status) >= 0) { + td = $('<td class="label"></td>'); + if (estimate.Status == 3) { + td.text(GetTextByKey('P_WO_REASONFORREJECTION_COLON', 'Reason for Rejection:')); + } + else if (estimate.Status == 4 || estimate.Status == 5) { + td.text(GetTextByKey('P_WO_XXXXXX_COLON', 'PO #:')); + } + tr.append(td); + td = $('<td></td>'); + tr.append(td); + if (estimate.Status == 3) { + ipt = $('<span id="dialog_est_rfr' + estimateindex + '"></span>').text(estimate.RejectReason); + td.append(ipt); + } + else if (estimate.Status == 4 || estimate.Status == 5) { + ipt = $('<span id="dialog_est_rfr' + estimateindex + '"></span>').text(estimate.PONumber); + td.append(ipt); + } + } + else { + tr.append('<td cospan="2"></td>'); + } + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_LABORCOST_COLON', 'Labor Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_est_laborcost' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(estimate.LaborCost, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TIMETOCOMPLATEHOURS_COLON', 'Time To Complete(Hrs):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_est_timetocomplete' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off" />').val(estimate.HoursToComplete).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TAXES_COLON', 'Taxes ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_est_taxes' + estimateindex + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(estimate.Taxes, disabled)).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_XXX', 'PO Required:')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="checkbox" id="dialog_est_porequired' + estimateindex + '" tabindex="1" style="width: auto;" />').prop('checked', estimate.PORequired).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_CUSTOMERISSUES_COLON', 'Customer Issues:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + ipt = $('<textarea id="dialog_est_custissues' + estimateindex + '" tabindex="1" maxlength="2000" style="width: 480px; height: 80px; margin-top: 5px;"></textarea>').val(estimate.CustomerIssues).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + + if ([3, 4, 5].indexOf(estimate.Status) >= 0) { + td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_CUSTOMERNOTES_COLON', 'Customer Notes:')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<textarea id="dialog_est_custnotes' + estimateindex + '" tabindex="1" maxlength="2000" disabled="disabled" style="width: 520px; height: 80px; margin-top: 5px;"></textarea>').val(estimate.CustomerNotes); + td.append(ipt); + } + else { + tr.append('<td cospan="2"></td>'); + } + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_TECHNICIANNOTES_COLON', 'Technician Notes:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + ipt = $('<textarea id="dialog_est_technotes' + estimateindex + '" tabindex="1" maxlength="2000" style="width: 480px; height: 80px; margin-top: 5px;" ></textarea>').val(estimate.TechnicianNotes).change((function (id) { return function () { inputChanged(id) } })(estimateindex)); + td.append(ipt); + + if (([3, 4, 5].indexOf(estimate.Status) >= 0) && estimate.Signature != null && estimate.Signature && estimate.Signature.length > 0) { + td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WO_SIGNATURE_COLON', 'Signature:')); + tr.append(td); + td = $('<td rowspan="2"></td>'); + tr.append(td); + var jpeg = estimate.Signature; + if (typeof (estimate.Signature) !== "string") { + jpeg = arrayBufferToBase64(estimate.Signature); + } + var imgsig = $('<img style="height: 110px;" />').attr('src', 'data:image/png;base64,' + jpeg); + td.append(imgsig); + } + else { + tr.append('<td rowspan="2"></td>'); + } + + if (estimate.Status === 0) { + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ATTACHMENTS_COLON', ' Attachments:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + var div_att = $('<div></div>'); + td.append(div_att); + if (!WOReadOnly) { + var span_addfile = $('<span class="sbutton iconadd" />').text(GetTextByKey('P_FR_ADDFILE', 'Add File...')); + span_addfile.on('click', estimateindex, function (e) { + openWOEstAttachmentDialog(e.data); + }) + div_att.append(span_addfile); + } + } + + tr = $('<tr id="tr_est_atts' + estimateindex + '"></tr>'); + table.append(tr); + td = $('<td class="label" style="vertical-align:top;"></td>').text(estimate.Status === 0 ? "" : GetTextByKey('P_WO_ATTACHMENTS_COLON', 'Attachments:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + var tb_att = $('<table id="tab_est_attachments' + estimateindex + '" style="border: 1px solid #a8a8a8; line-height: 25px; width: 480px; display: none;"></table>'); + td.append(tb_att); + var tr_att = $('<tr></tr>'); + tb_att.append(tr_att); + var td_att = $('<td></td>'); + tr_att.append(td_att); + div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); + td_att.append(div_att); + tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>'); + div_att.append(tb_att); + + showEstimateAttachment(estimateindex); + + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>'); + tr.append(td); + ipt = $('<lable id="lable_est_visibletocustomer' + estimateindex + '"></lable>').text(GetTextByKey('P_WO_XXX', 'Available to Customer:')).hide(); + td.append(ipt); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="checkbox" id="dialog_est_visibletocustomer' + estimateindex + '" tabindex="1" style="width: auto;" />').prop('checked', estimate.VisibleToCustomer).hide().change((function (id) { return function () { updateWOEstimateVisibleToCustomer(id) } })(estimateindex)); + td.append(ipt); + td = $('<td style="text-align: right; height: 33px"></td>'); + tr.append(td); + ipt = $('<input type="button" style="width: 80px; height: 25px;" id="btn_estimatesave' + estimateindex + '" />').val(GetTextByKey('P_WO_SAVE', 'Save')).hide(); + ipt.on('click', estimateindex, function (e) { + onSaveWorkOrderEstimate(e.data); + }); + td.append(ipt); + ipt = $('<input type="button" style="width: 80px; height: 25px;margin-left:16px;" id="btn_estimatepublish' + estimateindex + '" />').val(GetTextByKey('P_WO_PUBLISH', 'Publish')).hide(); + ipt.on('click', estimateindex, function (e) { + openPublishDialog(e.data); + }); + td.append(ipt); + ipt = $('<input type="button" style="width: 80px; height: 25px;" id="btn_estimaterevoke' + estimateindex + '" />').val(GetTextByKey('P_WO_REVOKE', 'Revoke')).hide(); + ipt.on('click', estimateindex, function (e) { + OnRevokeEstimate(e.data); + }); + td.append(ipt); + + if (!WOReadOnly) { + if (estimate.Status === 0) { + $('#btn_estimatesave' + estimateindex).show(); + $('#btn_estimatepublish' + estimateindex).show(); + } + if (estimate.Status === 1 || estimate.Status === 4) { + $('#btn_estimaterevoke' + estimateindex).show(); + } + } + if (disabled || WOReadOnly) + setEstimateDisabled(estimateindex, true); + + if (estimate.Status === 3) { + $('#span_eststatus' + estimateindex).css('color', 'red'); + $('#dialog_est_status' + estimateindex).css('color', 'red'); + } + if (estimate.Status === 4) { + $('#span_eststatus' + estimateindex).css('color', '#2eda2e'); + $('#dialog_est_status' + estimateindex).css('color', '#2eda2e'); + } + if ([3, 4, 5].indexOf(estimate.Status) >= 0) { + $('#lable_est_visibletocustomer' + estimateindex).show(); + $('#dialog_est_visibletocustomer' + estimateindex).show(); + } + } + + function arrayBufferToBase64(buffer) { + var binary = ''; + var bytes = new Uint8Array(buffer); + var len = bytes.byteLength; + for (var i = 0; i < len; i++) { + binary += String.fromCharCode(bytes[i]); + } + return window.btoa(binary); + } + + function OnRevokeEstimate(index) { + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + showConfirm(GetTextByKey("P_WO_DOYOUWANTTOREVOKETHEESTIMATE", 'Do you want to revoke the estimate?'), GetTextByKey("P_WO_REVOKEESTIMATE", 'Revoke Estimate'), function () { + worequest("RevokeWorkOrderEstimate", estimate.Id, function (data) { + if (data === "OK") { + getEstimates(); + } + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILEDTOREVOKETHISESTIMATE", 'Failed to revoke this estimate.'), GetTextByKey("P_WO_REVOKEESTIMATE", 'Revoke Estimate')); + }); + }); + } + + function OnDeleteEstimate(index) { + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + showConfirm(GetTextByKey("P_WO_DOYOUWANTTODELETETHEESTIMATE", 'Do you want to delete the estimate?'), GetTextByKey("P_WO_DELETEESTIMATE", 'Delete Estimate'), function () { + worequest("DeleteWorkOrderEstimate", estimate.Id, function (data) { + if (data === "OK") { + getEstimates(); + } + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILEDTODELETETHISESTIMATE", 'Failed to delete this estimate.'), GetTextByKey("P_WO_DELETEESTIMATE", 'Delete Estimate')); + }); + }); + } + + function onSaveWorkOrderEstimate(index, next) { + var estimateid = -1; + var status = 0; + var alerttitle = GetTextByKey("P_WO_ADDESTIMATE", "Add Estimate"); + if (index !== "") { + alerttitle = GetTextByKey("P_WO_EDITESTIMATE", "Edit Estimate"); + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + estimateid = estimate.Id; + status = estimate.Status; + } + + var item = { + 'Id': estimateid, + 'WorkOrderId': _this.option.workorderid, + 'Status': status, + 'EstimateNumber': $('#dialog_est_number' + index).val(), + 'TotalCost': $('#dialog_est_totalcosts' + index).val(), + 'OtherCost': $('#dialog_est_othercost' + index).val(), + 'PartsCost': $('#dialog_est_partscost' + index).val(), + 'TravelCost': $('#dialog_est_traveltimecost' + index).val(), + 'LaborCost': $('#dialog_est_laborcost' + index).val(), + 'HoursToComplete': $('#dialog_est_timetocomplete' + index).val(), + 'CustomerIssues': $('#dialog_est_custissues' + index).val(), + 'TechnicianNotes': $('#dialog_est_technotes' + index).val(), + 'Taxes': $('#dialog_est_taxes' + index).val(), + 'PORequired': $('#dialog_est_porequired' + index).prop('checked') + }; + + if (isNaN(item.TotalCost) || item.TotalCost < 0) { + showAlert(GetTextByKey('P_WO_XXXXXX_INVALID', 'Total cost is not a valid number.'), alerttitle, function () { $('#dialog_est_totalcosts' + index).focus() }); + return; + } + if (isNaN(item.OtherCost) || item.OtherCost < 0) { + showAlert(GetTextByKey('P_WO_OTHERCOST_INVALID', 'Other cost is not a valid number.'), alerttitle, function () { $('#dialog_est_totalcosts' + index).focus() }); + return; + } + if (isNaN(item.PartsCost) || item.PartsCost < 0) { + showAlert(GetTextByKey('P_WO_PARTSCOST_INVALID', 'Parts cost is not a valid number.'), alerttitle, function () { $('#dialog_est_partscost' + index).focus() }); + return; + } + if (isNaN(item.TravelCost) || item.TravelCost < 0) { + showAlert(GetTextByKey('P_WO_TRAVELTIMECOST_INVALID', 'Travel time cost is not a valid number.'), alerttitle, function () { $('#dialog_est_traveltimecost' + index).focus() }); + return; + } + if (isNaN(item.LaborCost) || item.LaborCost < 0) { + showAlert(GetTextByKey('P_WO_LABORCOST_INVALID', 'Labor cost is not a valid number.'), alerttitle, function () { $('#dialog_est_laborcost' + index).focus() }); + return; + } + if (isNaN(item.HoursToComplete) || item.HoursToComplete < 0) { + showAlert(GetTextByKey('P_WO_TIMETOCOMPLETE_INVALID', 'Time to complete is not a valid number.'), alerttitle, function () { $('#dialog_est_timetocomplete' + index).focus() }); + return; + } + if (isNaN(item.Taxes) || item.Taxes < 0) { + showAlert(GetTextByKey('P_WO_XXXXX_INVALID', 'Taxes is not a valid number.'), alerttitle, function () { $('#dialog_est_taxes' + index).focus() }); + return; + } + + $('#btn_estimatesave' + index).attr('disabled', true); + var param = JSON.stringify(item); + param = htmlencode(param); + worequest("SaveWorkOrderEstimate", param, function (data) { + if (typeof (data) === "string") { + $('#btn_estimatesave' + index).attr('disabled', false); + showAlert(data, alerttitle); + } else { + $('#btn_estimatesave' + index).attr('disabled', false); + + if (index === "") {//新增 + if (addestfiledatas && addestfiledatas.length > 0) { + SaveEstimateAttachmentFiles(addestfiledatas, data); + addestfiledatas = []; + } + + if (next) + next("", data); + else { + getEstimates(); + } + hideEstimatePopup(); + } + else {//编辑 + if (next) + next(index); + else { + showAlert(GetTextByKey("P_WO_SAVSUCCESSFULLY", "Saved successfully."), alerttitle); + $('#span_estnumber' + index).text($('#dialog_est_number' + index).val()); + } + } + } + }, function (err) { + $('#btn_estimatesave' + index).attr('disabled', false); + console.log(err); + showAlert(GetTextByKey("P_WO_FAILEDTORSAVEESTIMATE", 'Failed to save estimate.'), alerttitle); + }); + } + + + function OnAddEstimate() { + addestfiledatas = []; + $('#tab_est_atts').empty(); + $('#tab_est_attachments').hide(); + if (!_this.option.workorderid || _this.option.workorderid === "") { + showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDESTIMATE", "Add Estimate")); + return; + } + + $('#dialog_est_number').val(""); + $('#dialog_est_status').text(GetTextByKey('P_WO_DRAFT', 'Draft')); + $('#dialog_est_totalcosts').val(""); + $('#dialog_est_othercost').val(""); + $('#dialog_est_partscost').val(""); + $('#dialog_est_traveltimecost').val(""); + $('#dialog_est_laborcost').val(""); + $('#dialog_est_timetocomplete').val(""); + $('#dialog_est_custissues').val(""); + $('#dialog_est_technotes').val(""); + $('#dialog_est_taxes').val(""); + $('#dialog_est_porequired').prop('checked', WorkorderParams.DefaultPORequired); + if (_this.option.workorderdata) { + $('#dialog_est_totalcosts').val(_this.option.workorderdata.WorkOrderTotalCost == 0 ? "" : _this.option.workorderdata.WorkOrderTotalCost); + $('#dialog_est_othercost').val(_this.option.workorderdata.OtherCost == 0 ? "" : _this.option.workorderdata.OtherCost); + $('#dialog_est_partscost').val(_this.option.workorderdata.PartsCost == 0 ? "" : _this.option.workorderdata.PartsCost); + $('#dialog_est_traveltimecost').val(_this.option.workorderdata.TravelTimeCost == 0 ? "" : _this.option.workorderdata.TravelTimeCost); + $('#dialog_est_laborcost').val(_this.option.workorderdata.LaborCost == 0 ? "" : _this.option.workorderdata.LaborCost); + $('#dialog_est_timetocomplete').val(_this.option.workorderdata.HoursToComplete == 0 ? "" : _this.option.workorderdata.HoursToComplete); + $('#dialog_est_custissues').val(_this.option.workorderdata.Description); + getEstimateTotalCost(""); + } + + showEstimatePopup(); + } + + function inputChanged(index) { + $('#tabestimate' + index).data('changed', true); + } + + function setEstimateDisabled(index, di) { + $('#dialog_est_number' + index).attr('disabled', di); + $('#dialog_est_totalcosts' + index).attr('disabled', di); + $('#dialog_est_othercost' + index).attr('disabled', di); + $('#dialog_est_partscost' + index).attr('disabled', di); + $('#dialog_est_traveltimecost' + index).attr('disabled', di); + $('#dialog_est_laborcost' + index).attr('disabled', di); + $('#dialog_est_timetocomplete' + index).attr('disabled', di); + $('#dialog_est_custissues' + index).attr('disabled', di); + $('#dialog_est_technotes' + index).attr('disabled', di); + $('#dialog_est_taxes' + index).attr('disabled', di); + $('#dialog_est_porequired' + index).attr('disabled', di); + } + + function getEstimateTotalCost(index) { + var othercost = $('#dialog_est_othercost' + index).val(); + var partscost = $('#dialog_est_partscost' + index).val(); + var traveltimecost = $('#dialog_est_traveltimecost' + index).val(); + var laborcost = $('#dialog_est_laborcost' + index).val(); + var taxes = $('#dialog_est_taxes' + index).val(); + var totalcost = 0; + if (othercost !== "" && !isNaN(othercost)) + totalcost += eval(othercost); + if (partscost !== "" && !isNaN(partscost)) + totalcost += eval(partscost); + if (traveltimecost !== "" && !isNaN(traveltimecost)) + totalcost += eval(traveltimecost); + if (laborcost !== "" && !isNaN(laborcost)) + totalcost += eval(laborcost); + if (taxes !== "" && !isNaN(taxes)) + totalcost += eval(taxes); + $('#dialog_est_totalcosts' + index).val(totalcost.toFixed(2)); + } + + this.getEstimateStatus = function (s) { + var text = ""; + if (s === 0) + text = GetTextByKey('P_WO_DRAFT', 'Draft'); + else if (s === 1) + text = GetTextByKey('P_WO_AWAITINGCUSTOMERAPPROVAL', 'Awaiting Customer Approval'); + else if (s === 2) + text = GetTextByKey('P_WO_CANCELLEDBYDEALER', 'Cancelled by Dealer'); + else if (s === 3) + text = GetTextByKey('P_WO_CUSTOMERREJECTED', 'Customer Rejected'); + else if (s === 4) + text = GetTextByKey('P_WO_CUSTOMERAPPROVED', 'Customer Approved'); + else if (s === 5) + text = GetTextByKey('P_WO_XXXX', 'Void'); + else if (s === 100) + text = ""; + return text; + } + + function showPublishEstimatePopup() { + if (publishestindex <= 0) + estimateDialog.find('.maskbg').show(); + else + showmaskbg(true); + $('#dialog_est_textmsg').val(WorkorderParams.EstimateMessage); + estimatePublishDialog.css({ + 'top': (document.documentElement.clientHeight - estimatePublishDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - estimatePublishDialog.width()) / 2 + }).showDialogfixed(); + } + + function hidePublishEstimatePopup() { + if (publishestindex <= 0) + estimateDialog.find('.maskbg').hide(); + else + showmaskbg(false); + publishestindex = 0; + estimatePublishDialog.hide(); + } + + function openPublishDialog(index) { + if (index == -1) { + publishestindex = index; + showPublishEstimatePopup(); + } + else { + onSaveWorkOrderEstimate(index, function () { + publishestindex = index; + showPublishEstimatePopup(); + }); + } + } + + function onPublishEstimate() { + var changed = $('#tabestimate' + publishestindex).data('changed'); + if (publishestindex === -1)//add and publish + changed = true; + if (changed) + onSaveWorkOrderEstimate(publishestindex === -1 ? "" : publishestindex, PublishEstimate) + else + PublishEstimate(publishestindex); + } + + function PublishEstimate(index, estid) { + if (index !== "") { + var estimate = $('#tabestimate' + index).data('estimate'); + estid = estimate.Id; + } + + if (!estid) + return; + + var pmemails = []; + var checked = $('#dialog_est_chksendtextmsg').prop('checked'); + if (checked) { + var phoneemail = $('#dialog_est_phonenum').val(); + if (phoneemail !== "") { + var phoneemails = phoneemail.split(';'); + for (var i = 0; i < phoneemails.length; i++) { + var pm = phoneemails[i]; + if (checkPhoneNumber(pm) || isEmail(pm)) { + pmemails.push({ 'Key': pm, 'Value': pm }); + } + else { + if (_this.option.customercontacts) { + for (var j = 0; j < _this.option.customercontacts.length; j++) { + var c = _this.option.customercontacts[j]; + if (c.OptOut || c.OptOut_BC) continue; + var mp = $.trim(c.MobilePhone); + var email = $.trim(c.Email); + if (c.Name === pm) { + if (c.ContactPreference == "0" && checkPhoneNumber(mp)) { + pmemails.push({ 'Key': mp, 'Value': pm }); + break; + } + if (c.ContactPreference == "1" && isEmail(email)) { + pmemails.push({ 'Key': email, 'Value': pm }); + break; + } + } + } + } + } + } + } + } + + var msg = $('#dialog_est_textmsg').val(); + var includeStatusLink = $('#dialog_est_chkIncludeStatusLink').prop("checked"); + + var param = JSON.stringify([estid, _this.option.workorderid, JSON.stringify(pmemails), msg, (includeStatusLink ? "1" : "0")]); + param = htmlencode(param); + + worequest("PublishEstimateToCustomer", param, function (data) { + if (data !== "") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + getEstimates(); + hidePublishEstimatePopup(); + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILEDTOPUBLISHTHISESTIMATE", 'Failed to publish this estimate.'), GetTextByKey("P_WO_PUBLISHESTIMATE", 'Publish Estimate')); + }); + } + + function updateWOEstimateVisibleToCustomer(index) { + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + var checked = $('#dialog_est_visibletocustomer' + index).prop('checked'); + var param = JSON.stringify([estimate.Id, checked]); + param = htmlencode(param); + + worequest("UpdateWOEstimateVisibleToCustomer", param, function (data) { + if (data !== "") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + }, function (err) { + showAlert(GetTextByKey("P_WO_XXXX", 'Failed to publish this estimate.'), GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); + }); + } + + function SaveEstimateAttachmentFiles(filedatas, estid, index) { + var formData = new FormData(); + var notesdata = []; + for (var i = 0; i < filedatas.length; i++) { + formData.append("iconFile" + i, filedatas[i].File); + notesdata.push(encodeURIComponent(filedatas[i].Notes)); + } + var p = JSON.stringify([estid, JSON.stringify(notesdata)]); + formData.append("MethodName", "AddEstimateAttachment"); + formData.append("ClientData", p); + var url = 'AddWorkOrder.aspx'; + $.ajax({ + url: url, + type: 'POST', + dataType: 'json', + processData: false, + contentType: false, + data: formData, + async: true, + success: function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); + } else { + if (index) { + hideWOEstAttachmentPopup(); + getEstimateAttachment(index); + } + else + getEstimates(); + } + }, + error: function (err) { + showAlert(GetTextByKey("P_WO_XXXXX", 'Upload failed'), GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); + } + }); + } + + + function getEstimateAttachment(index) { + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + + $('#tab_est_atts' + index).empty(); + $('#tab_est_attachments' + index).hide(); + + worequest("GetEstimateAttachment", estimate.Id, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data && data.length > 0) { + showEstimateAttachment(index, data); + } + + }, function (err) { + }); + } + + function showEstimateAttachment(index, atts) { + var isdelete = false; + if (!atts) { + var estimate = $('#tabestimate' + index).data('estimate'); + if (!estimate) + return; + atts = estimate.Attachments; + if (estimate.Status === 0) + isdelete = true; + } + else + isdelete = true; + + $('#tab_est_atts' + index).empty(); + $('#tab_est_attachments' + index).hide(); + if (atts && atts.length > 0) { + $('#tab_est_attachments' + index).show(); + for (var i = 0; i < atts.length; i++) { + var att = atts[i]; + var tr = $('<tr></tr>').attr('id', att.AttachmentId); + var tdfile = $('<td style=""></td>'); + var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(att.Notes === "" ? att.FileName : att.Notes).click(function () { + window.open("../filesvc.ashx?attchid=" + this.parentElement.parentElement.id + "&sourceType=woestimateattachment"); + }); + var span = $('<span></span>').text(att.AddedByName).css("margin-right", 5).css("margin-left", 5).css("color", "black"); + var spanby = $('<span></span>').text(att.AddedOnLocalStr).css("color", "black"); + tdfile.append(filename, span, spanby); + + if (!WOReadOnly && isdelete) { + var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); + var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('index', index).click(function () { + deleteEstimateAttachment(this.parentElement.parentElement.id, $(this).data('index')); + }); + tdimg.append(imgDom); + tr.append(tdimg); + } + tr.append(tdfile).appendTo($('#tab_est_atts' + index)); + } + } + } + + function deleteEstimateAttachment(attid, index) { + if (confirm(GetTextByKey("P_WO_DELETEATTACHMENTTIPS", "Are you sure you want to delete the attachment?"))) { + worequest("DeleteEstimateAttachment", attid, function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); + } + else { + getEstimateAttachment(index); + } + }, function (err) { }); + } + } + + function hideWOEstAttachmentPopup() { + if (cur_uploadindex == '') + estimateDialog.find('.maskbg').hide(); + else + showmaskbg(false); + estimateAttachmentDialog.hide(); + } + + function openWOEstAttachmentDialog(index) { + cur_uploaddata = undefined; + cur_uploadindex = index; + if (index == '') + estimateDialog.find('.maskbg').show(); + else + showmaskbg(true); + btn_woestattasave.attr('disabled', false); + $('#tab_woest_atts').empty(); + $('#tab_woest_attachments').hide(); + $('#dialog_estatt_notes').val(''); + estimateAttachmentDialog.css({ + 'top': (document.documentElement.clientHeight - estimateAttachmentDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - estimateAttachmentDialog.width()) / 2 + }).showDialogfixed(); + } + + + function dragOverAddEstimateAttachment(ev) { + ev.preventDefault(); + ev.dataTransfer.dropEffect = 'link'; + } + + function dropAddEstimateAttachment(ev) { + ev.preventDefault(); + ev.stopPropagation(); + var df = ev.dataTransfer; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + if (files.length > 0) { + for (var i = 0; i < files.length; i++) { + cur_uploaddata = files[i]; + onSaveWOEstAttachment(); + } + } + } + + function cutAddEstimateAttachment(ev) { + ev.stopPropagation(); + var df = ev.clipboardData; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + if (files.length > 0) { + for (var i = 0; i < files.length; i++) { + cur_uploaddata = files[i]; + onSaveWOEstAttachment(); + } + } + } + + function UpLoadEstimateAttachment() { + var file = $('<input type="file" style="display: none;" />'); + file.change(function () { + var files = this.files; + if (files.length == 0) + return; + + if (files[0].size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return false; + } + if (files[0].size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return false; + } + var notes = $('#dialog_estatt_notes').val(); + cur_uploaddata = { 'File': files[0], 'Notes': notes }; + createNewEstimateAttachment(cur_uploaddata); + + }).click(); + } + + function createNewEstimateAttachment(data) { + $('#tab_woest_atts').empty(); + $('#tab_woest_attachments').show(); + var tr = $('<tr></tr>'); + var tdfile = $('<td style=""></td>'); + var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(data.Notes === "" ? data.File.name : data.Notes); + tdfile.append(filename); + + var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); + var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').click(function () { + this.parentElement.parentElement.remove(); + cur_uploaddata = undefined; + $('#tab_woest_attachments').hide(); + }); + tdimg.append(imgDom); + tr.append(tdimg); + + tr.append(tdfile).appendTo($('#tab_woest_atts')); + } + + function onSaveWOEstAttachment() { + if (!cur_uploaddata) + return; + + btn_woestattasave.attr('disabled', true); + var estimate = $('#tabestimate' + cur_uploadindex).data('estimate'); + var notes = $('#dialog_estatt_notes').val(); + cur_uploaddata.Notes = notes; + + if (!estimate) { + addestfiledatas.push(cur_uploaddata); + createAddEstimateAttachment(cur_uploaddata); + hideWOEstAttachmentPopup(); + btn_woestattasave.attr('disabled', false); + } + else { + SaveEstimateAttachmentFiles([cur_uploaddata], estimate.Id, cur_uploadindex); + } + } + + function createAddEstimateAttachment(data) { + var notes = data.Notes; + var file = data.File; + $('#tab_est_attachments').show(); + var tr = $('<tr></tr>'); + var tdfile = $('<td style=""></td>'); + var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(notes === "" ? file.name : notes); + tdfile.append(filename); + + var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); + var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('filedata', data).click(function () { + this.parentElement.parentElement.remove(); + var fd = $(this).data('filedata'); + addestfiledatas.splice(addestfiledatas.indexOf(fd), 1); + if (addestfiledatas.length == 0) + $('#tab_est_attachments').hide(); + }); + tdimg.append(imgDom); + tr.append(tdimg); + + tr.append(tdfile).appendTo($('#tab_est_atts')); + } + } +} + +/*****************************************End Estimate*********************************************/ + + +/*****************************************Begin Invoice*********************************************/ +if (typeof ($woinvoice) !== "function") { + $woinvoice = function (option) { + this.option = option || {}; + var _this = this; + + var invoice_index = 0; + var publish_invoice_index = 0; + var add_invoice_filedatas = []; + var cur_invoice_uploaddata; + var cur_invoice_uploadindex = ""; + + this.changewo = function (woid) { + //if (woid !== option.workorderid) { + this.option.workorderid = woid; + getInvoices(); + //} + } + + this.close = function () { + invoiceDialog?.remove(); + invoicePublishDialog?.remove(); + invoiceAttachmentDialog?.remove(); + invoiceMarkPaidDialog?.remove(); + } + + this.setwodata = function (wodata) { + this.option.workorderdata = wodata; + } + + this.updatecontact = function (contacts) { + this.option.customercontacts = contacts + + if (this.option.customercontacts) { + var names = ""; + for (var i = 0; i < this.option.customercontacts.length; i++) { + var c = this.option.customercontacts[i]; + if (c.OptOut || c.OptOut_BC) continue; + var mp = $.trim(c.MobilePhone); + var email = $.trim(c.Email); + if ((c.ContactPreference == "0" && (checkPhoneNumber(mp)) + || (c.ContactPreference == "1" && isEmail(email)))) { + if (names == "") + names = c.Name; + else + names += ";" + c.Name; + } + } + + $('#dialog_invoice_phonenum').val(names); + } + else { + $('#dialog_invoice_phonenum').val(''); + } + } + + this.createInvoice = function (p_div) { + p_div.addClass('tab_invoices'); + var div = $('<div class="function_title"></div>'); + p_div.append(div); + var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDINVOICE">Add Invoice</span>'); + span_add.click(OnAddInvoice); + div.append(span_add); + } + this.createInvoice(this.option.parent); + var invoiceDialog = createInvoiceDialog(); + var invoicePublishDialog = createPublishInvoiceDialog(); + var invoiceAttachmentDialog = createInvoiceAttachmentDialog(); + var invoiceMarkPaidDialog = createInvoiceMarkPaidDialog(); + + function createInvoiceDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.on('drop', function (ev) { + dropAddInvoiceAttachment(ev.originalEvent); + }).on('dragover', function (ev) { + dragOverAddInvoiceAttachment(ev.originalEvent); + }).on('paste', function (ev) { + cutAddInvoiceAttachment(ev.originalEvent); + }); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_ADDINVOICE">Add Invoice</span><em class="dialog-close"></em></div>'); + + var tb = $('<table></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td class="label" data-lgid="P_WO_INVOICENUMBER">Invoice #:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_number = $('<input type="text" id="dialog_invoice_number" tabindex="1" style="width:150px;" maxlength="50" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_OTHERCOST_COLON">Other Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_othercost = $('<input type="text" id="dialog_invoice_othercost" maxlength="12" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_INVOICETOTALCOST">Invoice Total Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_totalcosts = $('<input type="text" id="dialog_invoice_totalcosts" maxlength="12" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_TRAVELTIMECOST_COLON">Travel Time Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_traveltimecost = $('<input type="text" id="dialog_invoice_traveltimecost" maxlength="12" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_PARTSCOST_COLON">Parts Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_partscost = $('<input type="text" id="dialog_invoice_partscost" maxlength="12" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_TAXES_COLON">Taxes ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_taxes = $('<input type="text" id="dialog_invoice_taxes" maxlength="12" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_LABORCOST_COLON">Labor Cost ($):</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_laborcost = $('<input type="text" id="dialog_invoice_laborcost" maxlength="12" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_INVOICESTATUS">Invoice Status:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_status = $('<select id="dialog_invoice_status" style="width: 150px; height: 24px;"><option value="0">Draft</option><option value="1">Awaiting Payment</option><option value="6">Paid</option><option value="10">Revoked</option></select>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_XXXXXX">Payment By:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_paymentby = $('<select id="dialog_invoice_paymentby" style="width: 150px; height: 24px;"><option value="Credit Card">Credit Card</option><option value="Check">Check</option><option value="Cash">Cash</option></select>').appendTo(td); + td = $('<td class="label" data-lgid="P_WO_XXXXXX_COLON">Check #:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_checknumber = $('<input type="text" id="dialog_invoice_checknumber" maxlength="200" tabindex="1" style="width:150px;" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + td = $('<td class="label" data-lgid="P_WO_XXXXXX_COLON">Customer Visible:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_customervisible = $('<input type="checkbox" id="dialog_invoice_customervisible" tabindex="1" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WOS_NOTES_COLON" style="vertical-align: top;">Notes:</td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var dialog_invoice_notes = $('<textarea id="dialog_invoice_notes" tabindex="1" maxlength="500" style="height:80px;width:450px;"></textarea>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top;">Attachments:</td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var spanAtta = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDFILE">Add File</span>').appendTo(td); + spanAtta.on('click', function () { + openWOInvoiceAttachmentDialog(''); + }) + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label"></td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var tb_att = $('<table id="tab_invoice_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 450px; display: none;"></table>'); + td.append(tb_att); + var tr_att = $('<tr></tr>'); + tb_att.append(tr_att); + var td_att = $('<td></td>'); + tr_att.append(td_att); + div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); + td_att.append(div_att); + tb_att = $('<table id="tab_invoice_atts" style="table-layout: fixed;"></table>'); + div_att.append(tb_att); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="11" />'); + var btnok = $('<input type="button" value="OK" data-lgid="P_WO_OK" tabindex="11" />'); + btnok.on('click', function () { + onAddWorkOrderInvoice(''); + }); + func.append(btnok); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + + return dialog; + } + + function createPublishInvoiceDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_PUBLISH_INVOICE">Publish Invoice</span><em class="dialog-close"></em></div>'); + + var tb = $('<table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td style="text-align: right;"></td>').appendTo(tr); + var dialog_invoice_chksendtextmsg = $('<input id="dialog_invoice_chksendtextmsg" type="checkbox" checked="checked" style="width: unset;" />').appendTo(td); + dialog_invoice_chksendtextmsg.change(function () { + var checked = $('#dialog_invoice_chksendtextmsg').prop('checked'); + $('#dialog_invoice_phonenum').prop('disabled', !checked); + $('#dialog_invoice_chkIncludeStatusLink').prop('disabled', !checked); + $('#dialog_invoice_textmsg').prop('disabled', !checked); + }); + td = $('<td></td>').appendTo(tr); + $('<label for="dialog_invoice_chksendtextmsg" data-lgid="P_WO_SENDUPDATETOCUSTOMER" style="user-select: none;">Send Update To Customer</label>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td></td>').appendTo(tr); + $('<div style="font-size: 20px; margin-right: 5px; float: right;"><em class="spanbtn iconmobile" style="font-weight: 900; font-size: 14px; cursor: default; padding-left: 0; padding-right: 3px; padding-top: 0;"></em></div>').appendTo(td); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_phonenum = $('<input type="text" id="dialog_invoice_phonenum" tabindex="1" autocomplete="off" maxlength="100" style="width: 320px;" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td style="text-align: right;"></td>').appendTo(tr); + var dialog_invoice_chkIncludeStatusLink = $('<input id="dialog_invoice_chkIncludeStatusLink" type="checkbox" checked="checked" style="width: unset;" />').appendTo(td); + td = $('<td></td>').appendTo(tr); + $('<label for="dialog_invoice_chkIncludeStatusLink" data-lgid="P_WO_INCLUDESTATUSLINK" style="user-select: none;">Include Status Link</label>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" style="width: unset;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_variables = $('<select id="dialog_invoice_variables" style="width: 156px;"></select>').appendTo(td); + dialog_invoice_variables.append('<option value="0">[Site_Name]</option>'); + dialog_invoice_variables.append('<option value="1">[Location]</option>'); + dialog_invoice_variables.append('<option value="14">[Asset]</option>'); + dialog_invoice_variables.append('<option value="4">[VIN]</option>'); + dialog_invoice_variables.append('<option value="2">[Make]</option>'); + dialog_invoice_variables.append('<option value="3">[Model]</option>'); + dialog_invoice_variables.append('<option value="5">[Id_Phone]</option>'); + dialog_invoice_variables.append('<option value="6">[Advisor]</option>'); + dialog_invoice_variables.append('<option value="7">[Company_Name]</option>'); + dialog_invoice_variables.append('<option value="8">[Contact_Name]</option>'); + dialog_invoice_variables.append('<option value="9">[Contact_First_Name]</option>'); + dialog_invoice_variables.append('<option value="10">[Status_Link]</option>'); + dialog_invoice_variables.append('<option value="11">[Technician_Name]</option>'); + dialog_invoice_variables.append('<option value="12">[Work_Order_Number]</option>'); + dialog_invoice_variables.append('<option value="13">[Parts_Order_Number]</option>'); + + var dialog_invoice_insertfield = $('<input type="button" id="dialog_invoice_insertfield" data-lgid="P_WO_ADD" value="Add" style="width: 35px; height: auto; margin-left: 5px;" tabindex="1" /><br />').appendTo(td); + dialog_invoice_insertfield.on('click', function () { + insertinvoicefield(); + }); + var dialog_invoice_textmsg = $('<textarea id="dialog_invoice_textmsg" tabindex="1" style="width: 320px; height: 120px; margin-top: 6px;" maxlength="2000"></textarea>').appendTo(td); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="11" />'); + btn_publish = $('<input type="button" value="Publish" data-lgid="P_WO_PUBLISH" tabindex="1" />'); + btn_publish.on('click', function () { + onPublishInvoice(); + }); + func.append(btn_publish); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + hidePublishInvoicePopup(); + }); + + return dialog; + } + + function createInvoiceAttachmentDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_ADDATTACHMENT">Add Attachment</span><em class="dialog-close"></em></div>'); + + var tb = $('<table style="line-height: 30px; margin-left: 10px; margin-right: 10px;"></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td class="label" style="width: unset;"><span data-lgid="P_WO_CAPTION_COLON">Caption:</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_att_notes = $('<input type="text" id="dialog_invoice_att_notes" maxlength="200" tabindex="1" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_ATTACHMENTS_COLON" style="vertical-align: top; width: unset;">Attachments:</td>').appendTo(tr); + td = $('<td class="cont"></td>').appendTo(tr); + var dialog_woinvoiceatt_uploadattfile = $('<input id="dialog_woinvoiceatt_uploadattfile" type="button" value="Add File..." data-lgid="P_FR_ADDFILE" tabindex="1" style="background-color: #0099FF; color: #FFFFFF; height: 20px; width: 200px;" />').appendTo(td); + dialog_woinvoiceatt_uploadattfile.on('click', function () { + UpLoadInvoiceAttachment(); + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label"></td>').appendTo(tr); + td = $('<td colspan="3"></td>').appendTo(tr); + var tb_att = $('<table id="tab_woinvoice_attachments" style="border: 1px solid #a8a8a8; line-height: 25px; width: 450px; display: none;"></table>'); + td.append(tb_att); + var tr_att = $('<tr></tr>'); + tb_att.append(tr_att); + var td_att = $('<td></td>'); + tr_att.append(td_att); + div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); + td_att.append(div_att); + tb_att = $('<table id="tab_woinvoice_atts" style="table-layout: fixed;"></table>'); + div_att.append(tb_att); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="11" />'); + var btn_woinvoice_att_save = $('<input type="button" value="Save" data-lgid="P_WO_SAVE" tabindex="11" />'); + btn_woinvoice_att_save.on('click', function () { + onSaveWOInvoiceAttachment(); + }); + func.append(btn_woinvoice_att_save); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + hideWOInvoiceAttachmentPopup(); + }); + + return dialog; + } + + + function createInvoiceMarkPaidDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_XXX">Mark as Paid</span><em class="dialog-close"></em></div>'); + + var tb = $('<table style="line-height: 40px; margin-left: 10px; margin-right: 10px;">'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td class="label"><span data-lgid="P_WO_XXXXXX">Payment By:</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_markpaid_paymentby = $('<select id="dialog_invoice_markpaid_paymentby" style="width: 320px; height: 24px;"><option value="Credit Card">Credit Card</option><option value="Check">Check</option><option value="Cash">Cash</option></select>').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label"><span data-lgid="P_WO_XXX">Check #:</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + var dialog_invoice_markpaid_number = $('<input type="text" id="dialog_invoice_markpaid_number" maxlength="200" tabindex="1" autocomplete="off" />').appendTo(td); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="1" />'); + var btnok = $('<input type="button" id="btn_woinvoice_maikpaid_save" value="OK" data-lgid="P_WO_OK" tabindex="1" />'); + btnok.on('click', function () { + OnMarkAsPaid(); + }); + func.append(btnok); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + + return dialog; + } + + function insertinvoicefield() { + var field = $("#dialog_invoice_variables").find("option:selected").text(); + $("#dialog_invoice_textmsg").focus(); + document.execCommand('insertText', false, field); + } + + function showInvoicePopup() { + showmaskbg(true); + invoiceDialog.show(); + invoiceDialog.css({ + 'top': (document.documentElement.clientHeight - invoiceDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - invoiceDialog.width()) / 2 + }).showDialogfixed(); + } + + function hideInvoicePopup() { + showmaskbg(false); + invoiceDialog.hide(); + } + + var inloading = false; + function getInvoices() { + invoice_index = 0; + _this.option.parent.find('.estimates_div').remove(); + _this.option.parent.find('.estimates_table').remove(); + if (!_this.option.workorderid || _this.option.workorderid == "") return; + if (inloading) + return; + inloading = true; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + worequest("GetWorkOrderInvoices", _this.option.workorderid, function (data) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + _this.option.parent.find('.estimates_div').remove(); + _this.option.parent.find('.estimates_table').remove(); + if (data.WorkOrderID != _this.option.workorderid) { + getInvoices(); + return; + } + data = data.Data; + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data) { + if (data && data.length > 0) { + for (var i = 0; i < data.length; i++) { + showInvoice(data[i]); + } + } + } + + }, function (err) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + + + function dragOverInvoiceAttachment(ev, index) { + ev.preventDefault(); + ev.dataTransfer.dropEffect = 'link'; + } + + function dropInvoiceAttachment(ev, index) { + ev.preventDefault(); + ev.stopPropagation(); + var df = ev.dataTransfer; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + if (invoice.Status !== 0) + return; + + if (files.length > 0) + SaveInvoiceAttachmentFiles(files, invoice.Id, index); + } + + function cutInvoiceAttachment(ev, index) { + ev.stopPropagation(); + var df = ev.clipboardData; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + if (invoice.Status !== 0) + return; + + if (files.length > 0) + SaveInvoiceAttachmentFiles(files, invoice.Id, index); + } + + function showInvoice(invoice) { + invoice_index++; + var statustext = getInvoiceStatus(invoice.Status); + var div_invoices = _this.option.parent; + var div_title = $('<div id="divinvoice' + invoice_index + '" class="subtitle estimates_div" style="margin-right:0px;" ></div>'); + div_title.on('drop', invoice_index, function (ev) { + dropInvoiceAttachment(ev.originalEvent, ev.data); + }).on('dragover', function (ev) { + dragOverInvoiceAttachment(ev.originalEvent, ev.data); + }).on('paste', function (ev) { + cutInvoiceAttachment(ev.originalEvent, ev.data); + }); + div_title.append('<span class="sbutton iconchevronright" target="tabinvoice' + invoice_index + '" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span>'); + div_title.append('<span id="span_invoice_number' + invoice_index + '">' + invoice.InvoiceNumber + '</span>'); + div_title.append('<span id="span_invoice_status' + invoice_index + '" style="margin-left:80px;font-weight:bold;">' + statustext + '</span>'); + + if (!WOReadOnly) { + if (invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.PaymentCreated || invoice.Status === InvoiceStatus.Draft) { + var ipt = $('<input type="button" style="width: 100px; height: 24px;margin-left:100px;" />').val(GetTextByKey('P_WO_XXXXXX', 'Mark As Paid')); + ipt.on("click", invoice_index, function (e) { + openWOInvoiceMarkPaidDialog(e.data); + }); + div_title.append(ipt); + } + if (invoice.Status === InvoiceStatus.Pending) { + var ipt = $('<input type="button" style="width: 80px; height: 24px;margin-left:20px;" />').val(GetTextByKey('P_WO_REVOKE', 'Revoke')); + ipt.on("click", invoice_index, function (e) { + OnRevokeInvoice(e.data); + }); + div_title.append(ipt); + } + + if (invoice.Status == InvoiceStatus.Draft || invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.Revoked) { + var s_del = $('<span class="sbutton icondelete" style="float:right;margin-right: 10px; padding: 0px 0px 0px 5px;" ></span>'); + s_del.on("click", invoice_index, function (e) { + OnDeleteInvoice(e.data); + }); + div_title.append(s_del); + } + } + div_title.append('<hr />'); + div_invoices.append(div_title); + + var disabled = invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.PaymentCreated || invoice.Status === InvoiceStatus.Paid || invoice.Status === InvoiceStatus.Revoked || invoice.Status === InvoiceStatus.ManualPaid; + + var table = $('<table id="tabinvoice' + invoice_index + '" class="estimates_table" ></table>').data('invoice', invoice).data('index', invoice_index).hide(); + table.on('drop', invoice_index, function (ev) { + dropInvoiceAttachment(ev.originalEvent, ev.data); + }).on('dragover', function (ev) { + dragOverInvoiceAttachment(ev.originalEvent, ev.data); + }).on('paste', function (ev) { + cutInvoiceAttachment(ev.originalEvent, ev.data); + }); + div_invoices.append(table); + var tr = $('<tr></tr>'); + table.append(tr); + var td = $('<td class="label"></td>').text(GetTextByKey('P_WO_INVOICENUMBER', 'Invoice #:')); + tr.append(td); + td = $('<td style="width:150px;"></td>'); + tr.append(td); + var ipt = $('<input type="text" id="dialog_invoice_number' + invoice_index + '" tabindex="1" maxlength="50" autocomplete="off" />').val(invoice.InvoiceNumber).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_OTHERCOST_COLON', 'Other Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_invoice_othercost' + invoice_index + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(invoice.OtherCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + + var tdDetail = $('<td rowspan="7" style="vertical-align: top; padding-left: 20px"></td>').attr('id', 'invoice_payment_tab' + invoice_index); + tr.append(tdDetail); + //if (invoice.Status == InvoiceStatus.Paid) + { + if (invoice.PaymentItem != null) { + var btncancelpayment = "<span></span>"; + if (invoice.Status === InvoiceStatus.ManualPaid) { + btncancelpayment = $('<input type="button" style="width: 100px; height: 24px;" />').val(GetTextByKey('P_WO_XXXXXX', 'Cancel Payment')); + btncancelpayment.on('click', invoice_index, function (e) { + CancelPayment(e.data); + }); + } + tdDetail.empty().append( + $('<table style="width: 100%; table-layout: fixed"></table>').append( + $('<tr></tr>').append( + $('<td style="width: 150px" class="payment-label"></td>').text(GetTextByKey('P_WO_XXXXXX', 'Payment Entered By:')), + $('<td style="width: 320px"></td>').text(invoice.PaymentItem.PaymentEnteredByName), + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CUSTOMERNAME', 'Customer Name:')), + $('<td></td>').text(invoice.PaymentItem.CustomerName) + ), + $('<tr></tr>').append( + $('<td style="width: 150px" class="payment-label"></td>').text(GetTextByKey('P_WO_PAYMENTTIME', 'Payment Time:')), + $('<td style="width: 320px"></td>').text(invoice.PaymentItem.CreatedLocalStr), + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CUSTOMEREMAIL', 'Customer Email:')), + $('<td></td>').text(invoice.PaymentItem.CustomerEmail) + ), + $('<tr></tr>').append( + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_XXXXXX', 'Payment Type:')), + $('<td></td>').text(invoice.PaymentItem.PaymentType), + $('<td></td>'), + $('<td></td>') + ), + $('<tr></tr>').append( + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_XXXXXX', 'Check #:')), + $('<td></td>').text(invoice.PaymentItem.CheckNumber), + $('<td></td>'), + $('<td></td>') + ), + $('<tr></tr>').append( + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CARDNUMBER', 'Card Number:')), + $('<td></td>').text(invoice.PaymentItem.CardNumber), + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_EXPIRATION', 'Expiration:')), + $('<td></td>').text(invoice.PaymentItem.CardExpiration) + ), + $('<tr></tr>').append( + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_CARDTYPE', 'Card Type:')), + $('<td></td>').text(invoice.PaymentItem.CardType), + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_COUNTRY_COLON', 'Country:')), + $('<td></td>').text(invoice.PaymentItem.CustomerCountry) + ), + $('<tr></tr>').append( + $('<td class="payment-label"></td>').text(GetTextByKey('P_WO_ISSUER', 'Issuer:')), + $('<td style="padding-right: 20px; white-space: nowrap"></td>').text(invoice.PaymentItem.CardIssuer), + $('<td style="text-align:right;"></td>').append(btncancelpayment), + $('<td></td>') + ) + ) + ); + } + } + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_INVOICETOTALCOST', 'Invoice Total Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_invoice_totalcosts' + invoice_index + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(invoice.TotalCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TRAVELTIMECOST_COLON', 'Travel Time Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); ipt = $('<input type="text" id="dialog_invoice_traveltimecost' + invoice_index + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(invoice.TravelCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_PARTSCOST_COLON', 'Parts Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_invoice_partscost' + invoice_index + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(invoice.PartsCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_TAXES_COLON', 'Taxes ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_invoice_taxes' + invoice_index + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(invoice.Taxes, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_LABORCOST_COLON', 'Labor Cost ($):')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="text" id="dialog_invoice_laborcost' + invoice_index + '" tabindex="1" maxlength="12" autocomplete="off" />').val(locale(invoice.LaborCost, disabled)).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_INVOICESTATUS', 'Invoice Status:')); + tr.append(td); + td = $('<td style="width: 150px"></td>'); + tr.append(td); + ipt = $('<span style="font-weight:bold;" id="dialog_invoice_status' + invoice_index + '"></span>').text(statustext); + td.append(ipt); + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_XXXXXX_COLON', 'Customer Visible:')); + tr.append(td); + td = $('<td></td>'); + tr.append(td); + ipt = $('<input type="checkbox" id="dialog_invoice_customervisible' + invoice_index + '" tabindex="1" />').prop("checked", invoice.CustomerVisible); + if (invoice.Status === InvoiceStatus.Draft || invoice.Status === InvoiceStatus.Revoked) + ipt.attr('disabled', true); + else + ipt.attr('disabled', false); + ipt.change(invoice_index, function (e) { + ChangeWOInvoiceCustomerVisible(e.data, $(e.target).prop("checked")); + }); + td.append(ipt); + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label" style="vertical-align:top;"></td>').text(GetTextByKey('P_WOS_NOTES_COLON', 'Notes:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + ipt = $('<textarea id="dialog_invoice_notes' + invoice_index + '" tabindex="1" maxlength="500" style="width: 480px; height: 80px; margin-top: 5px;" ></textarea>').val(invoice.Notes).change((function (id) { return function () { inputInvoiceChanged(id) } })(invoice_index)); + td.append(ipt); + + if (invoice.Status === InvoiceStatus.Draft) { + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td class="label"></td>').text(GetTextByKey('P_WO_ATTACHMENTS_COLON', ' Attachments:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + var div_att = $('<div></div>'); + td.append(div_att); + + if (!WOReadOnly) { + var span_addfile = $('<span class="sbutton iconadd" />').text(GetTextByKey('P_FR_ADDFILE', 'Add File...')); + span_addfile.on("click", invoice_index, function (e) { + openWOInvoiceAttachmentDialog(e.data); + }); + div_att.append(span_addfile); + } + } + + tr = $('<tr id="tr_invoice_atts' + invoice_index + '"></tr>'); + table.append(tr); + td = $('<td class="label" style="vertical-align:top;"></td>').text(invoice.Status === InvoiceStatus.Draft ? "" : GetTextByKey('P_WO_ATTACHMENTS_COLON', 'Attachments:')); + tr.append(td); + td = $('<td colspan="3"></td>'); + tr.append(td); + var tb_att = $('<table id="tab_invoice_attachments' + invoice_index + '" style="border: 1px solid #a8a8a8; line-height: 25px; width: 480px; display: none;"></table>'); + td.append(tb_att); + var tr_att = $('<tr></tr>'); + tb_att.append(tr_att); + var td_att = $('<td></td>'); + tr_att.append(td_att); + div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); + td_att.append(div_att); + tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>'); + div_att.append(tb_att); + + showInvoiceAttachment(invoice_index); + + + tr = $('<tr></tr>'); + table.append(tr); + td = $('<td colspan="4" style="text-align: right; height: 33px"></td>'); + tr.append(td); + ipt = $('<input type="button" style="width: 80px; height: 25px;" id="btn_invoice_save' + invoice_index + '" />').val(GetTextByKey('P_WO_SAVE', 'Save')).hide(); + ipt.on("click", invoice_index, function (e) { + onSaveWorkOrderInvoice(e.data); + }); + td.append(ipt); + ipt = $('<input type="button" style="width: 80px; height: 25px;margin-left:20px;" id="btn_invoice_publish' + invoice_index + '" />').val(GetTextByKey('P_WO_PUBLISH', 'Publish')).hide(); + ipt.on("click", invoice_index, function (e) { + openPublishInvoiceDialog(e.data); + }); + td.append(ipt); + + if (!WOReadOnly) { + if (invoice.Status === InvoiceStatus.Draft) { + $('#btn_invoice_publish' + invoice_index).show(); + $('#btn_invoice_save' + invoice_index).show(); + } + + if (invoice.Status === InvoiceStatus.Pending) { + $('#btn_invoice_revoke' + invoice_index).show(); + } + if (invoice.Status === InvoiceStatus.Pending || invoice.Status === InvoiceStatus.PaymentCreated) { + $('#btn_invoice_markaspaid' + invoice_index).show(); + } + } + if (disabled || WOReadOnly) + setInvoiceDisabled(invoice_index, true); + + if (invoice.Status === InvoiceStatus.PaymentCreated || + invoice.Status === InvoiceStatus.Failed) { + $('#span_invoice_status' + invoice_index).css('color', 'red'); + $('#dialog_invoice_status' + invoice_index).css('color', 'red'); + } + if (invoice.Status === InvoiceStatus.Paid || invoice.Status === InvoiceStatus.ManualPaid) { + $('#span_invoice_status' + invoice_index).css('color', '#2eda2e'); + $('#dialog_invoice_status' + invoice_index).css('color', '#2eda2e'); + } + } + + function OnRevokeInvoice(index) { + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + showConfirm(GetTextByKey("P_WO_CONFIRM_REVOKE_INVOICE", 'Do you want to revoke the invoice?'), GetTextByKey("P_WO_REVOKE_INVOICE", 'Revoke Invoice'), function () { + worequest("RevokeWorkOrderInvoice", invoice.Id, function (data) { + if (data === "OK") { + getInvoices(); + } + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILED_REVOKE_INVOICE", 'Failed to revoke this invoice.'), GetTextByKey("P_WO_REVOKE_INVOICE", 'Revoke Invoice')); + }); + }); + } + + function CancelPayment(index) { + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + showConfirm(GetTextByKey("P_WO_CONFIRM_XXXXXX_INVOICE", 'Are you sure you want to Cancel the Payment?'), GetTextByKey("P_WO_XXXXXX_INVOICE", 'Cancel Invoice'), function () { + worequest("CancelPayment", invoice.Id, function (data) { + if (data === "OK") { + getInvoices(); + } + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILED_REVOKE_INVOICE", 'Failed to cancel this payment.'), GetTextByKey("P_WO_XXXXXX_INVOICE", 'Cancel Invoice')); + }); + }); + } + + function ChangeWOInvoiceCustomerVisible(index, visible) { + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + worequest("ChangeWOInvoiceCustomerVisible", JSON.stringify([invoice.Id, visible ? 1 : 0]), function (data) { + }, function (err) { + }); + } + + function OnDeleteInvoice(index) { + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + showConfirm(GetTextByKey("P_WO_CONFIRM_DELETE_INVOICE", 'Do you want to delete the invoice?'), GetTextByKey("P_WO_DELETE_INVOICE", 'Delete Invoice'), function () { + worequest("DeleteWorkOrderInvoice", invoice.Id, function (data) { + if (data === "OK") { + getInvoices(); + } + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILED_DELETE_INVOICE", 'Failed to delete this invoice.'), GetTextByKey("P_WO_DELETE_INVOICE", 'Delete Invoice')); + }); + }); + } + + function onAddWorkOrderInvoice() { + var status = parseInt($('#dialog_invoice_status').val()); + if (status == InvoiceStatus.Pending) { + openPublishInvoiceDialog(-1); + } + else + onSaveWorkOrderInvoice(""); + } + + function onSaveWorkOrderInvoice(index, next) { + var invoiceid = -1; + var status = 0; + var alerttitle = GetTextByKey("P_WO_ADDINVOICE", "Add Invoice"); + if (index !== "") { + alerttitle = GetTextByKey("P_WO_EDITINVOICE", "Edit Invoice"); + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + invoiceid = invoice.Id; + status = invoice.Status; + } + else + status = parseInt($('#dialog_invoice_status').val()); + + var item = { + 'Id': invoiceid, + 'WorkOrderId': _this.option.workorderid, + 'Status': status, + 'InvoiceNumber': $('#dialog_invoice_number' + index).val(), + 'TotalCost': $('#dialog_invoice_totalcosts' + index).val(), + 'OtherCost': $('#dialog_invoice_othercost' + index).val(), + 'PartsCost': $('#dialog_invoice_partscost' + index).val(), + 'TravelCost': $('#dialog_invoice_traveltimecost' + index).val(), + 'LaborCost': $('#dialog_invoice_laborcost' + index).val(), + 'Taxes': $('#dialog_invoice_taxes' + index).val(), + 'Notes': $('#dialog_invoice_notes' + index).val(), + 'CustomerVisible': $('#dialog_invoice_customervisible' + index).prop("checked"), + 'PaymentMethod': $('#dialog_invoice_paymentby' + index).val(), + 'CheckNumber': $('#dialog_invoice_checknumber' + index).val(), + }; + + if (isNaN(item.TotalCost) || item.TotalCost < 0) { + showAlert(GetTextByKey('P_WO_TOTALCOST_INVALID', 'Total cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_totalcosts' + index).focus() }); + return; + } + if (isNaN(item.OtherCost) || item.OtherCost < 0) { + showAlert(GetTextByKey('P_WO_OTHERCOST_INVALID', 'Other cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_othercost' + index).focus() }); + return; + } + if (isNaN(item.PartsCost) || item.PartsCost < 0) { + showAlert(GetTextByKey('P_WO_PARTSCOST_INVALID', 'Parts cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_partscost' + index).focus() }); + return; + } + if (isNaN(item.TravelCost) || item.TravelCost < 0) { + showAlert(GetTextByKey('P_WO_TRAVELTIMECOST_INVALID', 'Travel time cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_traveltimecost' + index).focus() }); + return; + } + if (isNaN(item.LaborCost) || item.LaborCost < 0) { + showAlert(GetTextByKey('P_WO_LABORCOST_INVALID', 'Labor cost is not a valid number.'), alerttitle, function () { $('#dialog_invoice_laborcost' + index).focus() }); + return; + } + if (isNaN(item.Taxes) || item.Taxes < 0) { + showAlert(GetTextByKey('P_WO_TAXES_INVALID', 'Taxes is not a valid number.'), alerttitle, function () { $('#dialog_invoice_taxes' + index).focus() }); + return; + } + if (status == InvoiceStatus.Pending) { + if (item.TotalCost <= 0) { + showAlert(GetTextByKey('P_WO_TOTALCOST_MUST_POSITIVE', 'Total cost must be a positive number.'), alerttitle, function () { $('#dialog_invoice_totalcosts' + index).focus() }); + return; + } + } + if ((status == InvoiceStatus.Pending || status == InvoiceStatus.ManualPaid) + && !item.CustomerVisible) { + var msg = GetTextByKey("P_WO_XXX", "Invoice will not be displayed on Customer Facing Page.<br/> Do you want to:"); + showInvoiceConfirm(msg, alerttitle, + function () { + $('#dialog_invoice_customervisible' + index).prop("checked", true) + item.CustomerVisible = true; + doSaveWorkOrderInvoice(item, index, next, alerttitle); + }, function () { + doSaveWorkOrderInvoice(item, index, next, alerttitle); + }, null); + } + else + doSaveWorkOrderInvoice(item, index, next, alerttitle); + } + + function doSaveWorkOrderInvoice(item, index, next, alerttitle) { + $('#btn_invoice_save' + index).attr('disabled', true); + var param = JSON.stringify(item); + param = htmlencode(param); + worequest("SaveWorkOrderInvoice", param, function (data) { + if (typeof (data) === "string") { + $('#btn_invoice_save' + index).attr('disabled', false); + showAlert(data, alerttitle); + } else { + $('#btn_invoice_save' + index).attr('disabled', false); + item.Id = data; + + if (index === "") {//新增 + if (add_invoice_filedatas && add_invoice_filedatas.length > 0) { + SaveInvoiceAttachmentFiles(add_invoice_filedatas, data); + add_invoice_filedatas = []; + } + + if (next) + next("", data); + else { + getInvoices(); + } + + hideInvoicePopup(); + } + else {//编辑 + if (next) + next("", data); + else { + showAlert(GetTextByKey("P_WO_SAVSUCCESSFULLY", "Saved successfully."), alerttitle); + $('#span_invoice_number' + index).text($('#dialog_invoice_number' + index).val()); + } + } + } + }, function (err) { + $('#btn_invoice_save' + index).attr('disabled', false); + console.log(err); + showAlert(GetTextByKey("P_WO_FAILED_SAVE_INVOICE", 'Failed to save invoice.'), alerttitle); + }); + } + + function OnAddInvoice() { + add_invoice_filedatas = []; + $('#tab_invoice_atts').empty(); + $('#tab_invoice_attachments').hide(); + if (!_this.option.workorderid || _this.option.workorderid === "") { + showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDINVOICE", "Add Invoice")); + return; + } + + $('#dialog_invoice_number').val(""); + $('#dialog_invoice_status').val("0"); + $('#tr_payment').hide(); + $('#dialog_invoice_totalcosts').val(""); + $('#dialog_invoice_othercost').val(""); + $('#dialog_invoice_partscost').val(""); + $('#dialog_invoice_traveltimecost').val(""); + $('#dialog_invoice_laborcost').val(""); + $('#dialog_invoice_taxes').val(""); + $('#dialog_invoice_notes').val(""); + $("#dialog_invoice_customervisible").prop('checked', false).attr('disabled', true); + $('#dialog_invoice_paymentby').val("Credit Card"); + $('#dialog_invoice_checknumber').val(""); + if (_this.option.workorderdata) { + $('#dialog_invoice_number').val(_this.option.workorderdata.InvoiceNumber || ''); + $('#dialog_invoice_totalcosts').val(_this.option.workorderdata.WorkOrderTotalCost == 0 ? "" : _this.option.workorderdata.WorkOrderTotalCost); + $('#dialog_invoice_othercost').val(_this.option.workorderdata.OtherCost == 0 ? "" : _this.option.workorderdata.OtherCost); + $('#dialog_invoice_partscost').val(_this.option.workorderdata.PartsCost == 0 ? "" : _this.option.workorderdata.PartsCost); + $('#dialog_invoice_traveltimecost').val(_this.option.workorderdata.TravelTimeCost == 0 ? "" : workorderdata.TravelTimeCost); + $('#dialog_invoice_laborcost').val(_this.option.workorderdata.LaborCost == 0 ? "" : _this.option.workorderdata.LaborCost); + $('#dialog_invoice_taxes').val(_this.option.workorderdata.Taxes == 0 ? "" : _this.option.workorderdata.Taxes); + //getInvoiceTotalCost(""); + } + + showInvoicePopup(); + } + + function inputInvoiceChanged(index) { + $('#tabinvoice' + index).data('changed', true); + } + + function setInvoiceDisabled(index, di) { + $('#dialog_invoice_number' + index).attr('disabled', di); + $('#dialog_invoice_totalcosts' + index).attr('disabled', di); + $('#dialog_invoice_othercost' + index).attr('disabled', di); + $('#dialog_invoice_partscost' + index).attr('disabled', di); + $('#dialog_invoice_traveltimecost' + index).attr('disabled', di); + $('#dialog_invoice_laborcost' + index).attr('disabled', di); + $('#dialog_invoice_taxes' + index).attr('disabled', di); + $('#dialog_invoice_notes' + index).attr('disabled', di); + //$('#dialog_invoice_status' + index).attr('disabled', di); + //$('#dialog_invoice_customervisible' + index).attr('disabled', di); + } + + function getInvoiceTotalCost(index) { + var othercost = $('#dialog_invoice_othercost' + index).val(); + var partscost = $('#dialog_invoice_partscost' + index).val(); + var traveltimecost = $('#dialog_invoice_traveltimecost' + index).val(); + var laborcost = $('#dialog_invoice_laborcost' + index).val(); + var totalcost = 0; + if (othercost !== "" && !isNaN(othercost)) + totalcost += eval(othercost); + if (partscost !== "" && !isNaN(partscost)) + totalcost += eval(partscost); + if (traveltimecost !== "" && !isNaN(traveltimecost)) + totalcost += eval(traveltimecost); + if (laborcost !== "" && !isNaN(laborcost)) + totalcost += eval(laborcost); + $('#dialog_invoice_totalcosts' + index).val(locale(totalcost, true)); + } + + var InvoiceStatus = { + Draft: 0, + Pending: 1, + Cancelled: 2, + PaymentCreated: 3, + Paid: 4, + Failed: 5, + ManualPaid: 6, + Revoked: 10 + }; + + function getInvoiceStatus(s) { + var text = ""; + if (s === InvoiceStatus.Draft) + text = GetTextByKey('P_WO_DRAFT', 'Draft'); + else if (s === InvoiceStatus.Pending) + text = GetTextByKey('P_WO_AWATING_PAYMENT', 'Awaiting Payment'); + else if (s === InvoiceStatus.Cancelled) + text = GetTextByKey('P_WO_CANCELLEDBYDEALER', 'Cancelled by Dealer'); + else if (s === InvoiceStatus.PaymentCreated) + text = GetTextByKey('P_WO_AWATING_PAYMENT', 'Awaiting Payment'); + else if (s === InvoiceStatus.Paid || s === InvoiceStatus.ManualPaid) + text = GetTextByKey('P_WO_CUSTOMER_PAID', 'Customer Paid'); + else if (s === InvoiceStatus.Failed) + text = GetTextByKey('P_WO_PAYMENT_FAILURE', 'Payment Failure'); + else if (s === InvoiceStatus.Revoked) + text = GetTextByKey('P_WO_REVOKED', 'Revoked'); + else if (s === 100) + text = ""; + return text; + } + + function showPublishInvoicePopup() { + if (publish_invoice_index <= 0) + invoiceDialog.find('.maskbg').show(); + else + showmaskbg(true); + $('#dialog_invoice_textmsg').val(WorkorderParams.InvoiceMessage); + invoicePublishDialog.css({ + 'top': (document.documentElement.clientHeight - invoicePublishDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - invoicePublishDialog.width()) / 2 + }).showDialogfixed(); + } + + function hidePublishInvoicePopup() { + if (publish_invoice_index <= 0) + invoiceDialog.find('.maskbg').hide(); + else + showmaskbg(false); + publish_invoice_index = 0; + invoicePublishDialog.hide(); + } + + function openPublishInvoiceDialog(index) { + if (index == -1) { + publish_invoice_index = index; + showPublishInvoicePopup(); + } + else { + onSaveWorkOrderInvoice(index, function () { + publish_invoice_index = index; + showPublishInvoicePopup(); + }); + } + } + + function onPublishInvoice() { + var changed = $('#tabinvoice' + publish_invoice_index).data('changed'); + if (publish_invoice_index === -1)//add and publish + changed = true; + if (changed) + onSaveWorkOrderInvoice(publish_invoice_index === -1 ? "" : publish_invoice_index, PublishInvoice) + else + PublishInvoice(publish_invoice_index); + } + + function PublishInvoice(index, invoiceid) { + if (index !== "") { + var invoice = $('#tabinvoice' + index).data('invoice'); + invoiceid = invoice.Id; + } + + if (!invoiceid) + return; + + var pmemails = []; + var checked = $('#dialog_invoice_chksendtextmsg').prop('checked'); + if (checked) { + var phoneemail = $('#dialog_invoice_phonenum').val(); + if (phoneemail !== "") { + var phoneemails = phoneemail.split(';'); + for (var i = 0; i < phoneemails.length; i++) { + var pm = phoneemails[i]; + if (checkPhoneNumber(pm) || isEmail(pm)) { + pmemails.push({ 'Key': pm, 'Value': pm }); + } + else { + if (_this.option.customercontacts) { + for (var j = 0; j < _this.option.customercontacts.length; j++) { + var c = _this.option.customercontacts[j]; + if (c.OptOut || c.OptOut_BC) continue; + var mp = $.trim(c.MobilePhone); + var email = $.trim(c.Email); + if (c.Name === pm) { + if (c.ContactPreference == "0" && checkPhoneNumber(mp)) { + pmemails.push({ 'Key': mp, 'Value': pm }); + break; + } + if (c.ContactPreference == "1" && isEmail(email)) { + pmemails.push({ 'Key': email, 'Value': pm }); + break; + } + } + } + } + } + } + } + } + + var msg = $('#dialog_invoice_textmsg').val(); + var includeStatusLink = $('#dialog_invoice_chkIncludeStatusLink').prop("checked"); + + var param = JSON.stringify([invoiceid, _this.option.workorderid, JSON.stringify(pmemails), msg, (includeStatusLink ? "1" : "0")]); + param = htmlencode(param); + + worequest("PublishInvoiceToCustomer", param, function (data) { + if (data !== "") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + getInvoices(); + hidePublishInvoicePopup(); + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILED_PUBLISH_INVOICE", 'Failed to publish this invoice.'), GetTextByKey("P_WO_PUBLISH_INVOICE", 'Publish Invoice')); + }); + } + + function SaveInvoiceAttachmentFiles(filedatas, invoiceid, index) { + var formData = new FormData(); + var notesdata = []; + for (var i = 0; i < filedatas.length; i++) { + formData.append("iconFile" + i, filedatas[i].File); + notesdata.push(encodeURIComponent(filedatas[i].Notes)); + } + var p = JSON.stringify([invoiceid, JSON.stringify(notesdata)]); + formData.append("MethodName", "AddInvoiceAttachment"); + formData.append("ClientData", p); + var url = 'AddWorkOrder.aspx'; + $.ajax({ + url: url, + type: 'POST', + dataType: 'json', + processData: false, + contentType: false, + data: formData, + async: true, + success: function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); + } else { + if (index) { + hideWOInvoiceAttachmentPopup(); + getInvoiceAttachment(index); + } + else + getInvoices(); + } + }, + error: function (err) { + showAlert(err.statusText, GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); + } + }); + } + + + function getInvoiceAttachment(index) { + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + + $('#tab_invoice_atts' + index).empty(); + $('#tab_invoice_attachments' + index).hide(); + + worequest("GetWorkOrderInvoiceAttachments", invoice.Id, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data && data.length > 0) { + showInvoiceAttachment(index, data); + } + + }, function (err) { + }); + } + + function showInvoiceAttachment(index, atts) { + var candelete = false; + if (!atts) { + var invoice = $('#tabinvoice' + index).data('invoice'); + if (!invoice) + return; + atts = invoice.Attachments; + if (invoice.Status === InvoiceStatus.Draft || invoice.Status === InvoiceStatus.Revoked) + candelete = true; + } + else + candelete = true; + + $('#tab_invoice_atts' + index).empty(); + $('#tab_invoice_attachments' + index).hide(); + if (atts && atts.length > 0) { + $('#tab_invoice_attachments' + index).show(); + for (var i = 0; i < atts.length; i++) { + var att = atts[i]; + var tr = $('<tr></tr>').attr('id', att.AttachmentId); + var tdfile = $('<td style=""></td>'); + var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(att.Notes === "" ? att.FileName : att.Notes).click(function () { + window.open("../filesvc.ashx?attchid=" + this.parentElement.parentElement.id + "&sourceType=woestimateattachment"); + }); + var span = $('<span></span>').text(att.AddedByName).css("margin-right", 5).css("margin-left", 5).css("color", "black"); + var spanby = $('<span></span>').text(att.AddedOnLocalStr).css("color", "black"); + tdfile.append(filename, span, spanby); + + if (!WOReadOnly && candelete) { + var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); + var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('index', index).click(function () { + deleteInvoiceAttachment(this.parentElement.parentElement.id, $(this).data('index')); + }); + tdimg.append(imgDom); + tr.append(tdimg); + } + tr.append(tdfile).appendTo($('#tab_invoice_atts' + index)); + } + } + } + + function deleteInvoiceAttachment(attid, index) { + if (confirm(GetTextByKey("P_WO_DELETEATTACHMENTTIPS", "Are you sure you want to delete the attachment?"))) { + worequest("DeleteInvoiceAttachment", attid, function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); + } + else { + getInvoiceAttachment(index); + } + }, function (err) { }); + } + } + + function hideWOInvoiceAttachmentPopup() { + if (cur_invoice_uploadindex == '') + invoiceDialog.find('.maskbg').hide(); + else + showmaskbg(false); + invoiceAttachmentDialog.hide(); + } + + function openWOInvoiceAttachmentDialog(index) { + cur_invoice_uploaddata = undefined; + cur_invoice_uploadindex = index; + + if (index == '') + invoiceDialog.find('.maskbg').show(); + else + showmaskbg(true); + $('#btn_woinvoice_att_save').attr('disabled', false); + $('#tab_woinvoice_atts').empty(); + $('#tab_woinvoice_attachments').hide(); + $('#dialog_invoice_att_notes').val(''); + invoiceAttachmentDialog.css({ + 'top': (document.documentElement.clientHeight - invoiceAttachmentDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - invoiceAttachmentDialog.width()) / 2 + }).showDialogfixed(); + } + + function dragOverAddInvoiceAttachment(ev) { + ev.preventDefault(); + ev.dataTransfer.dropEffect = 'link'; + } + + function dropAddInvoiceAttachment(ev) { + ev.preventDefault(); + ev.stopPropagation(); + var df = ev.dataTransfer; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + if (files.length > 0) { + for (var i = 0; i < files.length; i++) { + cur_invoice_uploaddata = files[i]; + onSaveWOInvoiceAttachment(); + } + } + } + + function cutAddInvoiceAttachment(ev) { + ev.stopPropagation(); + var df = ev.clipboardData; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + + if (file.size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return; + } + if (file.size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return; + } + + files.push({ 'File': file, 'Notes': '' }); + } + } + } + + if (files.length > 0) { + for (var i = 0; i < files.length; i++) { + cur_invoice_uploaddata = files[i]; + onSaveWOInvoiceAttachment(); + } + } + } + + function UpLoadInvoiceAttachment() { + var file = $('<input type="file" style="display: none;" />'); + file.change(function () { + var files = this.files; + if (files.length == 0) + return; + + if (files[0].size == 0) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + return false; + } + if (files[0].size > 50 * 1024 * 1024) { + alert(GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + return false; + } + var notes = $('#dialog_invoice_att_notes').val(); + cur_invoice_uploaddata = { 'File': files[0], 'Notes': notes }; + createNewInvoiceAttachment(cur_invoice_uploaddata); + + }).click(); + } + + function createNewInvoiceAttachment(data) { + $('#tab_woinvoice_atts').empty(); + $('#tab_woinvoice_attachments').show(); + var tr = $('<tr></tr>'); + var tdfile = $('<td style=""></td>'); + var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(data.Notes === "" ? data.File.name : data.Notes); + tdfile.append(filename); + + var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); + var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').click(function () { + this.parentElement.parentElement.remove(); + cur_invoice_uploaddata = undefined; + $('#tab_woinvoice_attachments').hide(); + }); + tdimg.append(imgDom); + tr.append(tdimg); + + tr.append(tdfile).appendTo($('#tab_woinvoice_atts')); + } + + function onSaveWOInvoiceAttachment() { + if (!cur_invoice_uploaddata) + return; + + $('#btn_woinvoice_att_save').attr('disabled', true); + var invoice = $('#tabinvoice' + cur_invoice_uploadindex).data('invoice'); + var notes = $('#dialog_invoice_att_notes').val(); + cur_invoice_uploaddata.Notes = notes; + + if (!invoice) { + add_invoice_filedatas.push(cur_invoice_uploaddata); + createAddInvoiceAttachment(cur_invoice_uploaddata); + hideWOInvoiceAttachmentPopup(); + $('#btn_woinvoice_att_save').attr('disabled', false); + } + else { + SaveInvoiceAttachmentFiles([cur_invoice_uploaddata], invoice.Id, cur_invoice_uploadindex); + } + } + + function createAddInvoiceAttachment(data) { + var notes = data.Notes; + var file = data.File; + $('#tab_invoice_attachments').show(); + var tr = $('<tr></tr>'); + var tdfile = $('<td style=""></td>'); + var filename = $("<label style='border-bottom: 1px solid RGB(30, 144, 255);color: RGB(30,144,255);cursor:pointer;'></label>").text(notes === "" ? file.name : notes); + tdfile.append(filename); + + var tdimg = $('<td style="width:18px;border:none;text-align:center;"></td>'); + var imgDom = $('<span class="sbutton icondelete" style="padding:0;" ></span>').data('filedata', data).click(function () { + this.parentElement.parentElement.remove(); + var fd = $(this).data('filedata'); + add_invoice_filedatas.splice(add_invoice_filedatas.indexOf(fd), 1); + if (add_invoice_filedatas.length == 0) + $('#tab_invoice_attachments').hide(); + }); + tdimg.append(imgDom); + tr.append(tdimg); + + tr.append(tdfile).appendTo($('#tab_invoice_atts')); + } + + + + function hideWOInvoiceMakePaidPopup() { + showmaskbg(false); + invoiceMarkPaidDialog.hide(); + } + + function openWOInvoiceMarkPaidDialog(index) { + cur_invoice_uploadindex = index; + $('#btn_woinvoice_maikpaid_save').attr('disabled', false); + showmaskbg(true); + $('#dialog_invoice_markpaid_paymentby').val("Credit Card"); + $('#dialog_invoice_markpaid_number').val(''); + invoiceMarkPaidDialog.css({ + 'top': (document.documentElement.clientHeight - invoiceMarkPaidDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - invoiceMarkPaidDialog.width()) / 2 + }).showDialogfixed(); + } + + + function OnMarkAsPaid() { + var changed = $('#tabinvoice' + cur_invoice_uploadindex).data('changed'); + if (changed) + onSaveWorkOrderInvoice(cur_invoice_uploadindex, MarkAsPaid) + else + MarkAsPaid(); + } + + function MarkAsPaid() { + var invoice = $('#tabinvoice' + cur_invoice_uploadindex).data('invoice'); + var item = [invoice.Id, $('#dialog_invoice_markpaid_paymentby').val(), $('#dialog_invoice_markpaid_number').val()]; + var param = JSON.stringify(item); + param = htmlencode(param); + + $("#dialog_woinvoice_markpaid .maskbg").show(); + worequest('MarkAsPaid', param, function (data) { + $("#dialog_woinvoice_markpaid .maskbg").hide(); + if (data === 'OK') { + hideWOInvoiceMakePaidPopup(); + getInvoices(); + } + }, function (err) { + $("#dialog_woinvoice_markpaid .maskbg").hide(); + }); + } + + + + _dialog.showInvoiceConfirm = function (msg, title, fedit, fcancel, fclose, iniframe, shownote) { + if (!fclose) + fclose = fcancel; + _dialog.showButtonDialog(msg, title, 'question', fclose, [{ + value: GetTextByKey("P_WO_XXX", 'Mark as Customer Visible'), + func: fcancel + }, { + value: GetTextByKey("P_WO_XXX", 'Continue Without Making Visible'), + func: fedit + }], iniframe, shownote); + }; + + function showInvoiceConfirm(msg, title, fcancel, fedit, fclose) { + invoicePublishDialog.find('.maskbg').show(); + _dialog.showInvoiceConfirm(msg, title, function (e) { + invoicePublishDialog.find('.maskbg').show(); + if (typeof fedit === 'function') { + fedit(e); + } + }, function (e) { + invoicePublishDialog.find('.maskbg').show(); + if (typeof fcancel === 'function') { + fcancel(e); + } + }, function (e) { + invoicePublishDialog.find('.maskbg').show(); + if (typeof fclose === 'function') { + fclose(e); + } + }); + } + + } +} + + +/*****************************************End Invoice*********************************************/ + + +/*****************************************Begin Segment*********************************************/ +if (typeof ($wosegment) !== "function") { + $wosegment = function (option) { + this.option = option || {}; + var _this = this; + + var userdata = []; + var jobsitedata = []; + var components = []; + var segmenttypes = []; + + var dialog_segmentuser; + var dialog_segmenthour; + var dialog_segmentjobsite; + var dialog_segmentcost; + var dialog_segmenttype; + var dialog_segmentcomponent; + var dialog_segmentbillable; + var dialog_segmentcompleted; + var dialog_segmentcompleteddate; + var dialog_segmentdesc; + var dialog_segmentnotes; + + this.changewo = function (woid) { + //if (woid !== option.workorderid) { + this.option.workorderid = woid; + GetSegmentDataSource(getSegments); + //} + } + this.close = function () { + segmentDialog?.remove(); + } + + this.loadsource = function () { + GetSegmentDataSource(); + } + this.setwodata = function (wodata) { + this.option.workorderdata = wodata; + } + + this.createSegment = function (p_div) { + p_div.addClass("tab_segments"); + var div = $('<div class="function_title"></div>'); + p_div.append(div); + var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDSEGMENT">Add Segment</span>'); + span_add.click(OnAddSegment); + div.append(span_add); + } + + this.createSegment(this.option.parent); + var segmentDialog = createSegmentDialog(); + + function createSegmentDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" id="popupTitle" data-lgid="P_WO_ADDSEGMENT">Add Segment</span><em class="dialog-close"></em></div>'); + + var tb = $('<table style="line-height: 28px;"></table>'); + dialog.append($('<div class="dialog-content"></div>').append(tb)); + var tr = $('<tr></tr>').appendTo(tb); + var td = $('<td class="label" data-lgid="P_WO_USER_COLON">User:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentuser = $('<div id="dialog_segmentuser" tabindex="101" style="width: 320px" class="dropdown"></div>').appendTo(td); + dialog_segmentuser.dropdown([], { + search: true, + valueKey: 'IID', + textKey: 'DisplayName', + parent: '.dialog-content' + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_HOURS_COLON">Hours:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmenthour = $('<input type="text" id="dialog_segmenthour" tabindex="102" maxlength="200" autocomplete="off" />').appendTo(td); + dialog_segmenthour.keydown(numberinput); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_JOBSITE_COLON">Jobsite:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentjobsite = $('<div id="dialog_segmentjobsite" tabindex="103" style="width: 320px" class="dropdown"></div>').appendTo(td); + dialog_segmentjobsite.dropdown([], { + search: true, + valueKey: 'ID', + textKey: 'Name', + parent: '.dialog-content' + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_COST_COLON">Cost:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentcost = $('<input type="text" id="dialog_segmentcost" tabindex="104" maxlength="200" autocomplete="off" />').appendTo(td); + dialog_segmentcost.keydown(numberinput); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_XXXXXX_COLON">Segment Type:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmenttype = $('<div id="dialog_segmenttype" tabindex="104" style="width: 320px" class="dropdown"></div>').appendTo(td); + dialog_segmenttype.dropdown([], { + input: true, + maxlength: 50, + textKey: 'value', + parent: '.dialog-content' + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_COMPONENT_COLON">Component:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentcomponent = $('<div id="dialog_segmentcomponent" tabindex="104" style="width: 320px" class="dropdown"></div>').appendTo(td); + dialog_segmentcomponent.dropdown([], { + input: true, + maxlength: 40, + textKey: 'value', + parent: '.dialog-content' + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_XXXXXX_COLON">Billable:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentbillable = $('<input type="checkbox" id="dialog_segmentbillable" tabindex="105" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_COMPLETED_COLON">Completed:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentcompleted = $('<input type="checkbox" id="dialog_segmentcompleted" tabindex="105" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_COMPLETEDDATE_COLON">Completed Date:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentcompleteddate = $('<input type="text" id="dialog_segmentcompleteddate" tabindex="106" maxlength="200" autocomplete="off" />').appendTo(td); + dialog_segmentcompleteddate.datetimepicker({ + timepicker: false, + format: 'm/d/Y', + enterLikeTab: false, + scrollInput: false, + onSelectDate: function (v, inp) { + var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00'); + inp.parent().data('val', [date]); + } + }); + + dialog_segmentcompleteddate.change(function () { + var date = dialog_segmentcompleteddate.val(); + if (date.length > 0 && checkDate(date)) { + dialog_segmentcompleted.prop('checked', true); + } + }); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label"><span data-lgid="P_WO_DESCRIPTION_COLON">Description:</span><span class="redasterisk">*</span></td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentdesc = $('<input type="text" id="dialog_segmentdesc" tabindex="107" maxlength="200" autocomplete="off" />').appendTo(td); + + tr = $('<tr></tr>').appendTo(tb); + td = $('<td class="label" data-lgid="P_WO_NOTES_COLON">Notes:</td>').appendTo(tr); + td = $('<td></td>').appendTo(tr); + dialog_segmentnotes = $('<textarea id="dialog_segmentnotes" maxlength="1000" tabindex="108" style="width: 540px; height: 120px;"></textarea>').appendTo(td); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="53" />'); + var btnok = $('<input type="button" value="OK" data-lgid="P_WO_OK" tabindex="52" />'); + btnok.on('click', function () { + SaveSegment(''); + }); + func.append(btnok); + func.append('<div class="clear"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + + return dialog; + } + + function numberinput(e) { + var keyCode = e.which; + if (keyCode === 9//tab + || keyCode === 8 || keyCode === 46 //delete + || keyCode === 110 || keyCode === 190//. + || keyCode === 37 || keyCode === 39//left right + || keyCode === 55 || keyCode === 56//home end + || (keyCode >= 48 && keyCode <= 57) + || (keyCode >= 96 && keyCode <= 105)) + return true; + else + return false; + } + + function GetSegmentDataSource(next) { + worequest("GetSegmentDataSource", '', function (data) { + if (data.Users && data.Users.length > 0) { + userdata = data.Users; + dialog_segmentuser.dropdownSource(userdata); + } + if (data.JobSites && data.JobSites.length > 0) { + var jss = [{ ID: '-1', Name: ' ', html: ' ' }]; + for (var js of data.JobSites) { + jss.push(js); + } + jobsitedata = jss; + dialog_segmentjobsite.dropdownSource(jobsitedata); + } + if (data.Components && data.Components.length > 0) { + var source = []; + for (var type of data.Components) { + source.push({ value: type }); + } + components = source; + dialog_segmentcomponent.dropdownSource(components); + } + if (data.SegmentTypes && data.SegmentTypes.length > 0) { + var source = []; + for (var type of data.SegmentTypes) { + source.push({ value: type }); + } + segmenttypes = source; + dialog_segmenttype.dropdownSource(segmenttypes); + } + + if (next) + next(); + + }, function (err) { + console.log(err);; + }); + } + + function GetSegmentDataSource1(next) { + worequest("GetSegmentDataSource1", '', function (data) { + if (data.Components && data.Components.length > 0) { + var source = []; + for (var type of data.Components) { + source.push({ value: type }); + } + components = source; + $("#dialog_segmentcomponent").dropdownSource(components); + } + if (data.SegmentTypes && data.SegmentTypes.length > 0) { + var source = []; + for (var type of data.SegmentTypes) { + source.push({ value: type }); + } + segmenttypes = source; + $("#dialog_segmenttype").dropdownSource(segmenttypes); + } + + if (next) + next(); + + }, function (err) { + console.log(err);; + }); + } + + function SetCompleted(index) { + var date = $('#dialog_segmentcompleteddate' + index).val(); + if (date.length > 0 && checkDate(date)) { + $('#dialog_segmentcompleted' + index).prop('checked', true); + } + } + + var segmentdata = []; + function initControl(index) { + $('#dialog_segmentcompleteddate' + index).datetimepicker({ + timepicker: false, + format: 'm/d/Y', + enterLikeTab: false, + onSelectDate: function (v, inp) { + var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00'); + inp.parent().data('val', [date]); + } + }); + + $('#dialog_segmentuser' + index).dropdown(userdata || [], { + search: true, + valueKey: 'IID', + textKey: 'DisplayName' + }); + + + $("#dialog_segmentjobsite" + index).dropdown(jobsitedata || [], { + search: true, + valueKey: 'ID', + textKey: 'Name' + }); + + + $("#dialog_segmenttype" + index).dropdown(segmenttypes || [], { + input: true, + maxlength: 50, + textKey: 'value' + }); + + + $("#dialog_segmentcomponent" + index).dropdown(components || [], { + input: true, + maxlength: 40, + textKey: 'value' + }); + } + + var inloading = false; + function getSegments(callback) { + segmentindex = 0; + _this.option.parent.find('.segments_table').remove(); + if (!_this.option.workorderid || _this.option.workorderid == "") return; + if (inloading) + return; + inloading = true; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + worequest("GetSegments", _this.option.workorderid, function (data) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data.WorkOrderID != _this.option.workorderid) { + getSegments(callback); + return; + } + data = data.Data; + if (data && data.length > 0) { + //$('#dialog_workordercosts').attr('disabled', true); + segmentdata = data; + var wocost = 0; + for (var i = 0; i < segmentdata.length; i++) { + wocost += segmentdata[i].Cost; + showSegment(segmentdata[i]); + } + $('#dialog_workordercosts').val(wocost); + } + else { + //$('#dialog_workordercosts').attr('disabled', false); + if (_this.option.workorderdata) + $('#dialog_workordercosts').val(_this.option.workorderdata.WorkOrderTotalCost == 0 ? "" : _this.option.workorderdata.WorkOrderTotalCost); + segmentdata = []; + if (callback) + callback(); + } + + }, function (err) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + + var segmentindex = 0; + function showSegment(segment) { + segmentindex++; + var div_segments = _this.option.parent; + var table = $('<table id="tabsegment_' + segmentindex + '" class="segments_table"></table>'); + table.data('index', segmentindex); + var tr1 = $('<tr></tr>'); + var tr1_td1 = $('<td class="label" style="font-size:14px;font-weight:500;text-align:left;">' + GetTextByKey("P_WO_SEGMENT", "Segment") + " " + segmentindex + '</td>"'); + if (!WOReadOnly) { + var s_del = $('<span class="sbutton icondelete" ></span>'); + s_del.on('click', segmentindex, function (e) { + DeleteSegment(e.data); + }) + tr1_td1.append(s_del); + } + var tr1_td2 = $('<td></td>"'); + tr1.append(tr1_td1).append(tr1_td2); + table.append(tr1); + + var tr = $('<tr></tr>'); + var td1 = $('<td class="label">' + GetTextByKey("P_WO_USER_COLON", " User:") + '</td>"'); + var td2 = $('<td></td>"'); + var sel_user = $('<div id="dialog_segmentuser' + segmentindex + '" class="dropdown"></div>').css("width", 320); + td2.append(sel_user); + var td3 = $('<td class="label">' + GetTextByKey("P_WO_COMPLETED_COLON", "Completed:") + '</td>"'); + var td4 = $('<td></td>"'); + var chk_completed = $('<input type="checkbox" id="dialog_segmentcompleted' + segmentindex + '" />'); + td4.append(chk_completed); + tr.append(td1).append(td2).append(td3).append(td4); + table.append(tr); + + tr = $('<tr></tr>'); + td1 = $('<td class="label">' + GetTextByKey("P_WO_HOURS_COLON", "Hours:") + '</td>"'); + td2 = $('<td></td>"'); + var input_hour = $('<input type="text" id="dialog_segmenthour' + segmentindex + '" maxlength="12" />') + .keydown(numberinput); + td2.append(input_hour); + td3 = $('<td class="label">' + GetTextByKey("P_WO_COMPLETEDDATE_COLON", "Completed Date:") + '</td>"'); + td4 = $('<td></td>"'); + var input_completeddate = $('<input type="text" id="dialog_segmentcompleteddate' + segmentindex + '" />'); + input_completeddate.on("change", segmentindex, function (e) { + SetCompleted(e.data); + }); + td4.append(input_completeddate); + tr.append(td1).append(td2).append(td3).append(td4); + table.append(tr); + + tr = $('<tr></tr>'); + td1 = $('<td class="label">' + GetTextByKey("P_WO_JOBSITE_COLON", "Jobsite:") + '</td>"'); + td2 = $('<td></td>"'); + var sel_jobsite = $('<div id="dialog_segmentjobsite' + segmentindex + '" class="dropdown"></div>').css("width", 320); + td2.append(sel_jobsite); + td3 = $('<td class="label"><span>' + GetTextByKey("P_WO_DESCRIPTION_COLON", "Description:") + '</span><span class="redasterisk">*</span></td>"'); + td4 = $('<td></td>"'); + var input_desc = $('<input type="text" id="dialog_segmentdesc' + segmentindex + '" maxlength="200" />'); + td4.append(input_desc); + tr.append(td1).append(td2).append(td3).append(td4); + table.append(tr); + + tr = $('<tr></tr>'); + td1 = $('<td class="label">' + GetTextByKey("P_WO_COST_COLON", "Cost:") + '</td>"'); + td2 = $('<td></td>"'); + var input_cost = $('<input type="text" id="dialog_segmentcost' + segmentindex + '" />') + .keydown(numberinput); + td2.append(input_cost); + td3 = $('<td class="label">' + GetTextByKey("P_WO_NOTES_COLON", "Notes:") + '</td>"'); + td4 = $('<td rowspan="4"></td>"').css("vertical-align", "top"); + var textarea_notes = $('<textarea id="dialog_segmentnotes' + segmentindex + '" maxlength="500" style="width: 450px; height: 120px;"></textarea>') + td4.append(textarea_notes); + tr.append(td1).append(td2).append(td3).append(td4); + table.append(tr); + + tr = $('<tr></tr>'); + td1 = $('<td class="label">' + GetTextByKey("P_WO_XXXXXX_COLON", "Segment Type:") + '</td>"'); + td2 = $('<td></td>"'); + var sel_segmenttype = $('<div id="dialog_segmenttype' + segmentindex + '" class="dropdown"></div>').css("width", 320); + td2.append(sel_segmenttype); + tr.append(td1).append(td2); + table.append(tr); + + tr = $('<tr></tr>'); + td1 = $('<td class="label">' + GetTextByKey("P_WO_COMPONENT_COLON", "Component:") + '</td>"'); + td2 = $('<td></td>"'); + var sel_component = $('<div id="dialog_segmentcomponent' + segmentindex + '" class="dropdown"></div>').css("width", 320); + td2.append(sel_component); + tr.append(td1).append(td2); + table.append(tr); + + tr = $('<tr></tr>'); + td1 = $('<td class="label">' + GetTextByKey("P_WO_XXXXXX_COLON", "Billable:") + '</td>"'); + td2 = $('<td></td>"'); + var chk_billable = $('<input type="checkbox" id="dialog_segmentbillable' + segmentindex + '" />'); + td2.append(chk_billable); + tr.append(td1).append(td2); + table.append(tr); + + if (!WOReadOnly) { + tr = $('<tr></tr>'); + td1 = $('<td colspan="4" style="text-align: right;"></td>"'); + var input_save = $('<input type="button" value="Save" style="width:80px;height:25px;" id="btn_savesegment' + segmentindex + '" />').val(GetTextByKey("P_WO_SAVE", "Save")); + input_save.on('click', segmentindex, function (e) { + SaveSegment(e.data); + }) + var input_cancel = $('<input type="button" value="Cancel" style="width:80px;height:25px;margin-left:10px;" />').val(GetTextByKey("P_WO_CANCEL", "Cancel")); + input_cancel.on('click', segmentindex, function (e) { + CancelSegment(e.data); + }); + td1.append(input_save).append(input_cancel); + tr.append(td1); + table.append(tr); + } + + div_segments.append(table); + + initControl(segmentindex); + $('#tabsegment_' + segmentindex).data('segment', segment); + $('#dialog_segmentuser' + segmentindex).dropdownVal(segment.UserIID); + $('#dialog_segmentdesc' + segmentindex).val(segment.Description); + $('#dialog_segmenthour' + segmentindex).val(segment.Hours === 0 ? "" : segment.Hours); + $('#dialog_segmentnotes' + segmentindex).val(segment.Notes); + $('#dialog_segmentjobsite' + segmentindex).dropdownVal(segment.JobsiteID); + $('#dialog_segmentcost' + segmentindex).val(segment.Cost === 0 ? "" : segment.Cost); + $('#dialog_segmenttype' + segmentindex).dropdownVal(segment.SegmentType); + $('#dialog_segmentcompleted' + segmentindex).prop('checked', segment.Completed); + $('#dialog_segmentcompleteddate' + segmentindex).val(segment.CompletedDateStr); + $('#dialog_segmentcomponent' + segmentindex).dropdownVal(segment.Component); + $('#dialog_segmentbillable' + segmentindex).prop('checked', segment.Billable); + } + + function OnAddSegment() { + if (!_this.option.workorderid || _this.option.workorderid === "") { + showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDSEGMENT", "Add Segment")); + return; + } + + $('#dialog_segmentuser').dropdownVal(''); + $('#dialog_segmentdesc').val(''); + $('#dialog_segmenthour').val(''); + $('#dialog_segmentnotes').val(''); + $('#dialog_segmentjobsite').dropdownVal(''); + $('#dialog_segmentcost').val(''); + $('#dialog_segmentcompleted').prop('checked', false); + $('#dialog_segmentcompleteddate').val(''); + $('#dialog_segmenttype').dropdownVal(''); + $('#dialog_segmentcomponent').dropdownVal(''); + $('#dialog_segmentbillable').prop('checked', false); + + showPopup(); + } + + function DeleteSegment(index) { + var segment = $('#tabsegment_' + index).data('segment'); + if (!segment) + return; + showConfirm(GetTextByKey("P_WO_DOYOUWANTTODELETETHESEGMENT", 'Do you want to delete the segment?'), GetTextByKey("P_WO_DELETESEGMENT", 'Delete Segment'), function () { + worequest("DeleteSegment", segment.SegmentID, function (data) { + GetSegmentDataSource1(function () { + if (typeof getTotalCost == 'function') + getSegments(getTotalCost); + else + getSegments(); + }); + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILEDDELETESEGMENT", 'Failed to delete this segment.'), GetTextByKey("P_WO_DELETESEGMENT", 'Delete Segment')); + }); + }); + + } + + function CancelSegment(index) { + var segment = $('#tabsegment_' + index).data('segment'); + if (!segment) + return; + $('#dialog_segmentuser' + index).dropdownVal(segment.UserIID); + $('#dialog_segmentdesc' + index).val(segment.Description); + $('#dialog_segmenthour' + index).val(segment.Hours); + $('#dialog_segmentnotes' + index).val(segment.Notes); + $('#dialog_segmentjobsite' + index).dropdownVal(segment.JobsiteID); + $('#dialog_segmentcost' + index).val(segment.Cost); + $('#dialog_segmentcompleted' + index).prop('checked', segment.Completed); + $('#dialog_segmentcompleteddate' + index).val(segment.CompletedDateStr); + $('#dialog_segmenttype' + index).dropdownVal(segment.SegmentType); + $('#dialog_segmentcomponent' + index).dropdownVal(segment.Component); + $('#dialog_segmentbillable' + index).prop('checked', segment.Billable); + } + + function SaveSegment(index) { + $('#btn_savesegment' + index).attr('disabled', true); + var segmentid = -1; + var alerttitle = GetTextByKey("P_WO_ADDSEGMENT", "Add Segment"); + if (index !== "") { + var alerttitle = GetTextByKey("P_WO_EDITSEGMENT", "Edit Segment"); + var segment = $('#tabsegment_' + index).data('segment'); + if (!segment) + return; + segmentid = segment.SegmentID; + } + var item = { + 'SegmentID': segmentid, + 'WorkOrderID': _this.option.workorderid, + 'UserIID': $('#dialog_segmentuser' + index).dropdownVal(), + 'Description': $('#dialog_segmentdesc' + index).val(), + 'Hours': $('#dialog_segmenthour' + index).val(), + 'Notes': $('#dialog_segmentnotes' + index).val(), + 'JobsiteID': $('#dialog_segmentjobsite' + index).dropdownVal(), + 'Cost': $('#dialog_segmentcost' + index).val(), + 'Completed': $('#dialog_segmentcompleted' + index).prop('checked'), + 'CompletedDate': $('#dialog_segmentcompleteddate' + index).val(), + 'SegmentType': $('#dialog_segmenttype' + index).dropdownVal(), + 'Component': $('#dialog_segmentcomponent' + index).dropdownVal(), + 'Billable': $('#dialog_segmentbillable' + index).prop('checked') + }; + + if (item.Description === "" || item.Description.length == 0) { + showAlert(GetTextByKey("P_WO_DESCRIPTIONREQUIRED", 'Description is required.'), alerttitle); + $('#btn_savesegment' + index).attr('disabled', false); + return; + } + + if (item.Hours !== "") { + if (isNaN(item.Hours)) { + showAlert(GetTextByKey("P_WO_HOURSFORMATERROR", 'Hours format error.'), alerttitle); + $('#btn_savesegment' + index).attr('disabled', false); + return; + } + else { + if (item.Hours <= 0) { + showAlert(GetTextByKey("P_WO_HOURSMUSTBEGREATERTHAN0", 'Hours must be greater than 0.'), alerttitle); + $('#btn_savesegment' + index).attr('disabled', false); + return; + } + } + } + + if (item.Cost !== "") { + if (isNaN(item.Cost)) { + showAlert(GetTextByKey("P_WO_COSTFORMATERROR", 'Cost format error.'), alerttitle); + $('#btn_savesegment' + index).attr('disabled', false); + return; + } + else { + if (item.Cost <= 0) { + showAlert(GetTextByKey("P_WO_COSTMUSTBEGREATERTHAN0", 'Cost must be greater than 0.'), alerttitle); + $('#btn_savesegment' + index).attr('disabled', false); + return; + } + } + } + + if (item.Cost === "") + item.Cost = -1; + if (item.Hours === "") + item.Hours = -1; + + var param = JSON.stringify(item); + param = htmlencode(param); + worequest("SaveSegment", param, function (data) { + if (typeof (data) === "string") { + $('#btn_savesegment' + index).attr('disabled', false); + showAlert(data, alerttitle); + } else { + $('#btn_savesegment' + index).attr('disabled', false); + if (index !== "") { + showAlert(GetTextByKey("P_WO_SAVSUCCESSFULLY", "Saved successfully."), alerttitle); + } + GetSegmentDataSource1(function () { + if (typeof getTotalCost == 'function') + getSegments(getTotalCost); + else + getSegments(); + }); + hidePopup(); + } + }, function (err) { + $('#btn_savesegment' + index).attr('disabled', false); + console.log(err); + showAlert(GetTextByKey("P_WO_FAILEDTOSAVESEGMENT", 'Failed to save segment.'), alerttitle); + }); + } + + function showPopup() { + showmaskbg(true); + segmentDialog.css({ + 'top': (document.documentElement.clientHeight - segmentDialog.height()) / 3, + 'left': (document.documentElement.clientWidth - segmentDialog.width()) / 2 + }).showDialogfixed(); + } + + function hidePopup() { + showmaskbg(false); + segmentDialog.hide(); + } + } +} +/*****************************************End Segment*********************************************/ + + +/*****************************************Begin Alert*********************************************/ +if (typeof ($woalert) !== "function") { + $woalert = function (option) { + this.option = option || {}; + var _this = this; + + var alertids = this.option.alertids ? this.option.alertids : []; + + var divdtcalerts; + var divpmaalerts; + var divinspectalerts; + var divoilalerts; + + var span_addalerts; + var span_removealerts; + var span_addpmalerts; + + this.refresh = function () { + getAlerts(); + } + + this.changewo = function (woid, aid) { + //if (woid !== option.workorderid) { + this.option.workorderid = woid; + if (aid) + this.option.machineid = aid; + getAlerts(); + //} + } + + this.close = function () { + } + + this.changeasset = function (aid) { + this.option.machineid = aid; + } + + this.getalertids = function () { + return alertids; + } + + this.createAlert = function (p_div) { + var div_ftitle = $('<div class="function_title"></div>'); + p_div.append(div_ftitle); + span_addalerts = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDALERTS">Add Alerts</span>'); + span_addalerts.click(OnAddAlerts); + div_ftitle.append(span_addalerts); + span_removealerts = $('<span class="sbutton icondelete" data-lgid="P_WO_REMOVEALERTS">Remove Alerts</span>'); + span_removealerts.click(OnRemoveAlerts); + div_ftitle.append(span_removealerts); + + p_div.append('<div class="clear"></div>'); + + //DTC Alerts + divdtcalerts = $('<div style="height: 260px;min-width:400px; display: none;"></div>'); + divdtcalerts.append('<div class="subtitle"><span data-lgid="P_WO_DTCALERTS">DTC Alerts</span></div>'); + divdtcalerts.append('<div id="dtcalertslist"></div>'); + p_div.append(divdtcalerts); + + //PM Alerts + divpmaalerts = $('<div style="height: 260px; min-width:400px;"></div>'); + var divpmaalerts_title = $('<div class="subtitle"></div>'); + span_addpmalerts = $('<span class="sbutton iconadd" style="color: black;" data-lgid="P_WO_ADDPMALERTS">Add PM Alerts (Alerts not yet triggered)</span>'); + span_addpmalerts.click(OnAddAllPMSchedules); + divpmaalerts_title.append('<span data-lgid="P_WO_PMALERTS">PM Alerts</span>'); + divpmaalerts_title.append(span_addpmalerts); + divpmaalerts.append(divpmaalerts_title); + divpmaalerts.append('<div id="pmaalertslist"></div>'); + p_div.append(divpmaalerts); + + //Inspect Alerts + divinspectalerts = $('<div style="height: 260px;min-width:400px; display: none;"></div>'); + divinspectalerts.append('<div class="subtitle"><span data-lgid="P_WO_INSPECTALERTS">Inspect Alerts</span></div>'); + divinspectalerts.append('<div id="inspectalertslist"></div>'); + p_div.append(divinspectalerts); + + //Oil Alerts + divoilalerts = $('<div style="height: 260px;min-width:400px; display: none;"></div>'); + divoilalerts.append('<div class="subtitle"><span data-lgid="P_WO_OILALERTS">Oil Alerts</span></div>'); + divoilalerts.append('<div id="oilalertslist"></div>'); + p_div.append(divoilalerts); + } + + this.createAlert(this.option.parent); + + InitDTCAlertGridData(); + InitPMAAlertGridData(); + InitInspectAlertGridData(); + InitOilAlertGridData(); + + var alertpopupdialog = createNoneAssignedAlertDialog(); + var allpmschedulepopupdialog = createAllPMSchedulesDialog(); + + function showAllAlerts(alerts) { + if (alerts.DTCAlerts && alerts.DTCAlerts.length > 0) { + _DTCAlerts = alerts.DTCAlerts; + divdtcalerts.show(); + showAlerts(_DTCAlerts, grid_dtcalertdt); + } + else { + _DTCAlerts = []; + showAlerts(_DTCAlerts, grid_dtcalertdt); + } + + if (alerts.PMAlerts && alerts.PMAlerts.length > 0) { + _PMAAlerts = alerts.PMAlerts; + //divpmaalerts.show(); + showAlerts(_PMAAlerts, grid_pmaalertdt); + + $('#dialog_expectedcost').val(alerts.AllExpectedCost === 0 ? '' : alerts.AllExpectedCost); + } + else { + _PMAAlerts = []; + showAlerts(_PMAAlerts, grid_pmaalertdt); + } + + if (alerts.InspectAlerts && alerts.InspectAlerts.length > 0) { + _InspectAlerts = alerts.InspectAlerts; + divinspectalerts.show(); + showAlerts(_InspectAlerts, grid_inspectalertdt); + } + else { + _InspectAlerts = []; + showAlerts(_InspectAlerts, grid_inspectalertdt); + } + + if (alerts.OilAlerts && alerts.OilAlerts.length > 0) { + _OilAlerts = alerts.OilAlerts; + divoilalerts.show(); + showAlerts(_OilAlerts, grid_oilalertdt); + } + else { + _OilAlerts = []; + showAlerts(_OilAlerts, grid_oilalertdt); + } + } + + function showAlerts(data, grid_dt) { + var rows = []; + for (var i = 0; i < data.length; i++) { + var r = data[i]; + alertids.push(r.AlertID); + if (r.RepeatedAlerts) { + for (var j = 0; j < r.RepeatedAlerts.length; j++) { + alertids.push(r.RepeatedAlerts[j]); + } + } + for (var j in r) { + r["EngineHoursObj"] = { DisplayValue: r["EngineHours"] == 0 ? "" : r["EngineHours"], Value: r["EngineHours"] }; + r["AlertLocalTime"] = { DisplayValue: r["AlertLocalTimeStr"], Value: r["AlertLocalTime"] }; + } + var fr = { Values: r }; + rows.push(fr); + } + + grid_dt.setData(rows); + } + + var grid_dtcalertdt; + function InitDTCAlertGridData() { + grid_dtcalertdt = new GridView('#dtcalertslist'); + grid_dtcalertdt.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 480, 'text-align': 'left' } }, + //{ name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, + { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, + { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } + ]; + var columns = []; + // head + for (var hd in list_columns) { + var col = {}; + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.type = list_columns[hd].type; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + if (col.name === "Selected") { + col.allcheck = true; + } + } + grid_dtcalertdt.canMultiSelect = false; + grid_dtcalertdt.columns = columns; + grid_dtcalertdt.init(); + + grid_dtcalertdt.selectedrowchanged = function (rowindex) { + var rowdata = grid_dtcalertdt.source[rowindex]; + if (rowdata) { + } + } + } + + var grid_pmaalertdt; + function InitPMAAlertGridData() { + grid_pmaalertdt = new GridView('#pmaalertslist'); + grid_pmaalertdt.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 240, 'text-align': 'left' } }, + { name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, + { name: 'ExpectedCost', caption: GetTextByKey("P_PM_EXPECTEDCOST", "Expected Cost"), valueIndex: 'ExpectedCost', css: { 'width': 100, 'text-align': 'left' } }, + { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, + { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } + ]; + var columns = []; + // head + for (var hd in list_columns) { + var col = {}; + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.type = list_columns[hd].type; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + if (col.name === "Selected") { + col.allcheck = true; + } + } + grid_pmaalertdt.canMultiSelect = false; + grid_pmaalertdt.columns = columns; + grid_pmaalertdt.init(); + + grid_pmaalertdt.selectedrowchanged = function (rowindex) { + var rowdata = grid_pmaalertdt.source[rowindex]; + if (rowdata) { + } + } + } + + var grid_inspectalertdt; + function InitInspectAlertGridData() { + grid_inspectalertdt = new GridView('#inspectalertslist'); + grid_inspectalertdt.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 480, 'text-align': 'left' } }, + //{ name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, + { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, + { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } + ]; + var columns = []; + // head + for (var hd in list_columns) { + var col = {}; + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.type = list_columns[hd].type; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + if (col.name === "Selected") { + col.allcheck = true; + } + } + grid_inspectalertdt.canMultiSelect = false; + grid_inspectalertdt.columns = columns; + grid_inspectalertdt.init(); + + grid_inspectalertdt.selectedrowchanged = function (rowindex) { + var rowdata = grid_inspectalertdt.source[rowindex]; + if (rowdata) { + } + } + } + + var grid_oilalertdt; + function InitOilAlertGridData() { + grid_oilalertdt = new GridView('#oilalertslist'); + grid_oilalertdt.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHoursObj', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 480, 'text-align': 'left' } }, + //{ name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 240, 'text-align': 'left' } }, + { name: 'AlertCount', caption: GetTextByKey("P_WO_COUNT", "Count"), valueIndex: 'AlertCount', css: { 'width': 100, 'text-align': 'left' } }, + { name: 'AlertLocalTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } } + ]; + var columns = []; + // head + for (var hd in list_columns) { + var col = {}; + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.type = list_columns[hd].type; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + if (col.name === "Selected") { + col.allcheck = true; + } + } + grid_oilalertdt.canMultiSelect = false; + grid_oilalertdt.columns = columns; + grid_oilalertdt.init(); + + grid_oilalertdt.selectedrowchanged = function (rowindex) { + var rowdata = grid_oilalertdt.source[rowindex]; + if (rowdata) { + } + } + } + + function createNoneAssignedAlertDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_ADDALERTS">Add Alerts</span><em class="dialog-close"></em></div>'); + + var noneassignedalertlist = $('<div id="noneassignedalertlist" style="width:820px; height: 200px;"></div>'); + dialog.append($('<div class="dialog-content"></div>').append(noneassignedalertlist)) + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="53" style="margin-right: 30px;" />'); + var btnok = $('<input type="button" value="OK" data-lgid="P_WO_OK" tabindex="52" />'); + btnok.on('click', function () { + OnSaveAlerts(); + }); + func.append(btnok); + func.append('<div class="clear"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + InitNoneAssignedAlertGridData(noneassignedalertlist); + + return dialog; + } + + var grid_noneassignedalertdt; + function InitNoneAssignedAlertGridData(pdiv) { + grid_noneassignedalertdt = new GridView(pdiv); + grid_noneassignedalertdt.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'EngineHours', caption: GetTextByKey("P_WO_HOURS", "Hours"), valueIndex: 'EngineHours', css: { 'width': 80, 'text-align': 'left' } }, + { name: 'AlertType', caption: GetTextByKey("P_WO_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', css: { 'width': 150, 'text-align': 'left' } }, + { name: 'Description', caption: GetTextByKey("P_WO_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 200, 'text-align': 'left' } }, + { name: 'ServiceDescription', caption: GetTextByKey("P_WO_SERVICEDESCRIPTION", "Service Description"), valueIndex: 'ServiceDescription', css: { 'width': 200, 'text-align': 'left' } }, + { name: 'AlertTime', caption: GetTextByKey("P_WO_LATESTDATETIME", "Latest DateTime"), valueIndex: 'AlertTime', css: { 'width': 125, 'text-align': 'left' } } + ]; + var columns = []; + // head + for (var hd in list_columns) { + var col = {}; + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.type = list_columns[hd].type; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + if (col.name === "Selected") { + col.allcheck = true; + } + } + grid_noneassignedalertdt.canMultiSelect = false; + grid_noneassignedalertdt.columns = columns; + grid_noneassignedalertdt.init(); + + grid_noneassignedalertdt.selectedrowchanged = function (rowindex) { + var rowdata = grid_noneassignedalertdt.source[rowindex]; + if (rowdata) { + } + } + } + + function clearAlertData() { + _DTCAlerts = []; + _PMAAlerts = []; + _InspectAlerts = []; + _OilAlerts = []; + grid_dtcalertdt.setData([]); + grid_pmaalertdt.setData([]); + grid_inspectalertdt.setData([]); + grid_oilalertdt.setData([]); + } + + var _DTCAlerts = []; + var _PMAAlerts = []; + var _InspectAlerts = []; + var _OilAlerts = []; + var inloading = false; + function getAlerts() { + alertids = []; + divdtcalerts.hide(); + //divpmaalerts.hide(); + divinspectalerts.hide(); + divoilalerts.hide(); + + clearAlertData(); + + if (inloading) + return; + inloading = true; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + alertrequest("GETWORKORDERALERTS", _this.option.workorderid, function (data) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data.WorkOrderID != _this.option.workorderid) { + getAlerts(); + return; + } + data = data.Data; + showAllAlerts(data); + _this.reshowalertgrid(); + //resizeContent(); + }, function (err) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + + this.getAssetAlerts = function (mid) {//widget里面不会调用这个方法 + alertids = []; + divdtcalerts.hide(); + //divpmaalerts.hide(); + divinspectalerts.hide(); + divoilalerts.hide(); + + clearAlertData(); + + if (mid) + _this.option.machineid = mid; + + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + alertrequest("GETASSETALERTS", _this.option.machineid + String.fromCharCode(170) + JSON.stringify(alertids), function (data) { + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + if (data.MachineID != _this.option.machineid) return; + data = data.Data; + showAllAlerts(data); + }, function (err) { + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + + this.reshowalertgrid = function () { + setTimeout(function () { + $("#dtcalertslist").css("height", 240); + grid_dtcalertdt && grid_dtcalertdt.resize(); + $("#pmaalertslist").css("height", 240); + grid_pmaalertdt && grid_pmaalertdt.resize(); + $("#inspectalertslist").css("height", 240); + grid_inspectalertdt && grid_inspectalertdt.resize(); + $("#oilalertslist").css("height", 240); + grid_oilalertdt && grid_oilalertdt.resize(); + }); + } + + function showAlertPopup() { + showmaskbg(true); + alertpopupdialog.css({ + 'top': (document.documentElement.clientHeight - alertpopupdialog.height()) / 3, + 'left': (document.documentElement.clientWidth - alertpopupdialog.width()) / 2 + }).showDialogfixed(); + + grid_noneassignedalertdt && grid_noneassignedalertdt.resize(); + } + + function hideAlertPopup() { + alertpopupdialog.hide(); + showmaskbg(false); + } + + function OnAddAlerts() { + if (!_this.option.workorderid || _this.option.workorderid === "") { + showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDALERTS", 'Add Alerts')); + return; + } + getNoneAssignedAlerts(); + } + + var noneassignedalerts = []; + function getNoneAssignedAlerts() { + if (!_this.option.machineid) { + showAlert(GetTextByKey("P_WO_PLEASESELECTANASSET", "Please select an Asset."), GetTextByKey("P_WO_SENDEMAIL", "Send Email")); + $('#dialog_machine').focus(); + return; + } + + worequest("GetNoneAssignedAlerts", _this.option.machineid, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + showAlertPopup(); + noneassignedalerts = data; + showNoneAssienedAlerts(noneassignedalerts); + }, function (err) { + }); + } + + function showNoneAssienedAlerts(data) { + var rows = []; + for (var i = 0; i < data.length; i++) { + var r = data[i]; + for (var j in r) { + if (j === "EngineHours") + r[j] = { DisplayValue: r[j] == 0 ? "" : r[j], Value: r[j] }; + else if (j === "AlertLocalTime") + r[j] = { DisplayValue: r["AlertLocalTimeStr"], Value: r[j] }; + } + var fr = { Values: r }; + rows.push(fr); + } + + grid_noneassignedalertdt.setData(rows); + } + + + function AddOrRemoveAlertsFromWorkOrder(isadd, alertids) { + worequest("AddOrRemoveAlertsFromWorkOrder", _this.option.workorderid + String.fromCharCode(170) + JSON.stringify(alertids) + String.fromCharCode(170) + isadd, function (data) { + if (isadd) + hideAlertPopup(); + getAlerts(); + }, function (err) { + }); + + } + + function OnRemoveAlerts() { + var alerts = []; + if (_DTCAlerts.length > 0) { + for (var i = _DTCAlerts.length - 1; i >= 0; i--) { + var alert = _DTCAlerts[i]; + if (alert.Selected) { + alerts.push(alert.AlertID); + _DTCAlerts.splice(i, 1); + if (alert.RepeatedAlerts) { + for (var j = 0; j < alert.RepeatedAlerts.length; j++) { + alerts.push(alert.RepeatedAlerts[j]); + } + } + } + } + showAlerts(_DTCAlerts, grid_dtcalertdt); + } + if (_PMAAlerts.length > 0) { + for (var i = _PMAAlerts.length - 1; i >= 0; i--) { + var alert = _PMAAlerts[i]; + if (alert.Selected) { + alerts.push(alert.AlertID); + _PMAAlerts.splice(i, 1); + if (alert.RepeatedAlerts) { + for (var j = 0; j < alert.RepeatedAlerts.length; j++) { + alerts.push(alert.RepeatedAlerts[j]); + } + } + } + } + showAlerts(_PMAAlerts, grid_pmaalertdt); + //grid_pmaalertdt.setData(_PMAAlerts); + } + if (_InspectAlerts.length > 0) { + for (var i = _InspectAlerts.length - 1; i >= 0; i--) { + var alert = _InspectAlerts[i]; + if (alert.Selected) { + alerts.push(alert.AlertID); + _InspectAlerts.splice(i, 1); + if (alert.RepeatedAlerts) { + for (var j = 0; j < alert.RepeatedAlerts.length; j++) { + alerts.push(alert.RepeatedAlerts[j]); + } + } + } + } + showAlerts(_InspectAlerts, grid_inspectalertdt); + } + if (_OilAlerts.length > 0) { + for (var i = _OilAlerts.length - 1; i >= 0; i--) { + var alert = _OilAlerts[i]; + if (alert.Selected) { + alerts.push(alert.AlertID); + _OilAlerts.splice(i, 1); + if (alert.RepeatedAlerts) { + for (var j = 0; j < alert.RepeatedAlerts.length; j++) { + alerts.push(alert.RepeatedAlerts[j]); + } + } + } + } + showAlerts(_OilAlerts, grid_oilalertdt); + } + if (alerts.length == 0) { + showAlert(GetTextByKey("P_WO_PLEASESELECTANALERT", "Please select an Alert."), GetTextByKey("P_WO_REMOVEALERTS", "Remove Alerts")); + return; + } + + if (_this.option.workorderid && _this.option.workorderid !== "") { + AddOrRemoveAlertsFromWorkOrder(false, alerts); + } + } + + + function OnSaveAlerts() { + var alerts = []; + if (noneassignedalerts.length > 0) { + for (var i in noneassignedalerts) { + var alert = noneassignedalerts[i]; + if (alert.Selected) { + alerts.push(alert.ID); + } + } + } + if (alerts.length == 0) { + showAlert(GetTextByKey("P_WO_PLEASESELECTANALERT", "Please select an Alert."), GetTextByKey("P_WO_ADDALERTS", "Add Alerts")); + return; + } + AddOrRemoveAlertsFromWorkOrder(true, alerts); + } + + + + //**********************************Add PM Alerts (Alerts not yet triggered)***********************************************/ + + function createAllPMSchedulesDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_SELECTPLANFORALERT">Select Plan for Alert</span><em class="dialog-close"></em></div>'); + + var allpmpmalertslist = $('<div id="allpmpmalertslist" style="width: 420px; height: 200px;"></div>'); + dialog.append($('<div class="dialog-content"></div>').append(allpmpmalertslist)) + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="53" style="margin-right: 30px;" />'); + var btnok = $('<input type="button" value="OK" data-lgid="P_WO_OK" tabindex="52" />'); + btnok.on('click', function () { + GenerateManualPMAlerts(); + }); + func.append(btnok); + func.append('<div class="clear"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + InitAllPMSchedulesGridData(allpmpmalertslist); + + return dialog; + } + + function showAllPMSchedules(data) { + var rows = []; + for (var i = 0; i < data.length; i++) { + var r = data[i]; + for (var j in r) { + } + var fr = { Values: r }; + rows.push(fr); + } + + grid_pmschedulesdt.setData(rows); + } + + var grid_pmschedulesdt; + function InitAllPMSchedulesGridData(pdiv) { + grid_pmschedulesdt = new GridView(pdiv); + grid_pmschedulesdt.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'Name', caption: GetTextByKey("P_MV_SCHEDULENAME", "Schedule Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } } + ]; + var columns = []; + // head + for (var hd in list_columns) { + var col = {}; + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.type = list_columns[hd].type; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + if (col.name === "Selected") { + col.allcheck = true; + } + } + grid_pmschedulesdt.canMultiSelect = false; + grid_pmschedulesdt.columns = columns; + grid_pmschedulesdt.init(); + + grid_pmschedulesdt.selectedrowchanged = function (rowindex) { + var rowdata = grid_pmschedulesdt.source[rowindex]; + if (rowdata) { + } + } + } + + function showAllPMSchedulePopup() { + showmaskbg(true); + allpmschedulepopupdialog.css({ + 'top': (document.documentElement.clientHeight - allpmschedulepopupdialog.height()) / 3, + 'left': (document.documentElement.clientWidth - allpmschedulepopupdialog.width()) / 2 + }).showDialogfixed(); + grid_pmschedulesdt && grid_pmschedulesdt.resize(); + } + + function hideAllPMSchedulePopup() { + allpmschedulepopupdialog.hide(); + showmaskbg(false); + } + + function OnAddAllPMSchedules() { + if (!_this.option.workorderid || _this.option.workorderid === "") { + showAlert(GetTextByKey("P_WO_SAVEWORKORDERFIRST", "Please save work order first."), GetTextByKey("P_WO_ADDALERTS", 'Add Alerts')); + return; + } + GetPMSchedulesByAsset(); + } + + var allpmschedules = []; + function GetPMSchedulesByAsset() { + if (!_this.option.machineid) { + showAlert(GetTextByKey("P_WO_PLEASESELECTANASSET", "Please select an Asset."), GetTextByKey("P_WO_SENDEMAIL", "Send Email")); + $('#dialog_machine').focus(); + return; + } + + showAllPMSchedulePopup(); + worequest("GetPMSchedulesByAsset", _this.option.machineid, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + allpmschedules = data; + showAllPMSchedules(allpmschedules); + }, function (err) { + }); + } + + function GenerateManualPMAlerts() { + var schids = []; + if (allpmschedules.length > 0) { + for (var i in allpmschedules) { + var pmsch = allpmschedules[i]; + if (pmsch.Selected) { + schids.push(pmsch.Id); + } + } + } + if (schids.length == 0) { + showAlert(GetTextByKey("P_WO_PLEASESELECTAPLAN", "Please select a plan."), GetTextByKey("P_WO_ADDALERTS", "Add Alerts")); + return; + } + + if (!_this.option.machineid) { + showAlert(GetTextByKey("P_WO_PLEASESELECTANASSET", "Please select an Asset."), GetTextByKey("P_WO_SENDEMAIL", "Send Email")); + $('#dialog_machine').focus(); + return; + } + + worequest("GenerateManualPMAlerts", JSON.stringify([_this.option.machineid, _this.option.workorderid, JSON.stringify(schids)]) + , function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + else { + var msg = ""; + for (var i = 0; i < data.length; i++) { + var r = data[i]; + if (r.Status == -1) + msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT", "Failed to generate alert.") + " (" + r.ScheduleName + ")\r\n"; + else if (r.Status == 1) + msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT1", "Unable to generate alert because there already exists an unmaintained alert.") + " (" + r.ScheduleName + ")\r\n"; + else if (r.Status == 2) { + if (r.UOM == "hour(s)") + msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT2", "Unable to generate alert until Hour Meter is higher than ") + r.NextTargetValue.toLocaleString() + " " + r.UOM + " (" + r.ScheduleName + ")\r\n"; + else if (r.UOM == "day(s)") + msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT3", "Unable to generate alert until {0} later {1}").replace('{0}', r.NextTargetValue.toLocaleString() + " " + r.UOM).replace('{1}', " (" + r.ScheduleName + ")\r\n"); + else + msg += GetTextByKey("P_WO_FAILEDTOGENERATEALERT4", "Unable to generate alert until odometer is higher than ") + r.NextTargetValue.toLocaleString() + " " + r.UOM + " (" + r.ScheduleName + ")\r\n"; + } + } + if (msg !== "") + showAlert(msg, GetTextByKey("P_WO_ERROR", 'Error')); + } + hideAllPMSchedulePopup(); + getAlerts(); + }, function (err) { + }); + } + + function resizeContent() { + grid_dtcalertdt && grid_dtcalertdt.resize(); + grid_pmaalertdt && grid_pmaalertdt.resize(); + grid_inspectalertdt && grid_inspectalertdt.resize(); + grid_oilalertdt && grid_oilalertdt.resize(); + grid_noneassignedalertdt && grid_noneassignedalertdt.resize(); + grid_pmschedulesdt && grid_pmschedulesdt.resize(); + } + + window.onresize = resizeContent; + resizeContent(); + } +} +/*****************************************End Alert*********************************************/ + + +/*****************************************Begin Attachment*********************************************/ +if (typeof ($woattachment) !== "function") { + $woattachment = function (option) { + this.option = option || {}; + var _this = this; + + var allAttachments; + var viewtype = 0; + + var div_attlarge; + var div_woatts; + var div_aatts; + var div_iatts; + + var div_attlist; + var woattslist_tbody; + var woassetattslist_tbody; + var woiptattslist_tbody; + + var panddlist; + var btn_print; + var btn_download; + + var attupload_ul; + + viewtype = getCookie("woattachmentviewtype"); + + this.refresh = function () { + getWorkOrderAttachments(); + } + + this.changewo = function (woid, aid) { + //if (woid !== option.workorderid) { + this.option.workorderid = woid; + if (aid) + this.option.machineid = aid; + getWorkOrderAttachments(); + //} + } + + this.close = function () { + dialog_panddattachments?.remove(); + } + + this.createAttachment = function (p_div) { + var div_ftitle = $('<div class="function_title" style="min-width:400px;"></div>'); + p_div.append(div_ftitle); + var span_add = $('<span class="sbutton iconadd" data-lgid="P_WO_ADDFILE">Add File</span>'); + span_add.click(UpLoadWorkOrderAttachment); + div_ftitle.append(span_add); + + if (this.option.canExport) { + var span_print = $('<span class="sbutton iconprint" data-lgid="P_WO_PRINT">Print</span>'); + span_print.click(function () { openPAndDGDialog(0) }); + div_ftitle.append(span_print); + + var span_down = $('<span class="sbutton icondownload" data-lgid="P_WO_DOWNLOAD">Download</span>'); + span_down.click(function () { openPAndDGDialog(1) }); + div_ftitle.append(span_down); + } + + var span_view = $('<div class="sbutton iconviewatt" style="display:inline-block;position: relative;" data-lgid="P_WO_XXX">View</div>'); + div_ftitle.append(span_view); + span_view.click(function (ev) { + if ($('.panel_holder.attviewtypemenus').is(':visible')) { + return; + } + hidePanels(); + var left = $(this).offset().left; + var top = $(this).offset().top; + $('.panel_holder.attviewtypemenus').css({ + 'opacity': 0, + 'left': -35, + 'right': 'auto', + 'top': 35 + }).show().animate({ 'opacity': 1 }, 100); + $('.panel_holder.attviewtypemenus .trigledown').css({ + 'left': 50, + 'right': 'auto', + 'top': -20 + }); + return false; + }); + + //View Menu + var div_viewmenu = $('<div class="panel_holder attviewtypemenus"></div>'); + span_view.append(div_viewmenu); + var attviewtypemenu_panel = $('<div class="panel" style="min-width: 150px; background-color: white;"></div>'); + div_viewmenu.append(attviewtypemenu_panel); + var viewmenu_ul = $('<ul class="lefttitlemenu_ul" style="line-height: 32px;"></ul>') + attviewtypemenu_panel.append(viewmenu_ul); + var viewlarge_li = $('<li><a style="padding-left: 0;"><span class="sbutton iconlarge" data-lgid="P_WO_XXX">Large</span></a></li>'); + viewlarge_li.click(function () { onViewAttachment(0); }); + viewmenu_ul.append(viewlarge_li); + var viewlist_li = $('<li> <a style="padding-left: 0;"><span class="sbutton iconlist" data-lgid="P_WO_XXX">List</span></a></li>'); + viewlist_li.click(function () { onViewAttachment(1); }); + viewmenu_ul.append(viewlist_li); + attviewtypemenu_panel.append('<div class="trigledown"></div>'); + attviewtypemenu_panel.append('<div class="trigledown white"></div>'); + + //Large + div_attlarge = $('<div></div>'); + p_div.append(div_attlarge); + //WO Attachments Large + var tb_woattlarge = $('<table class="main_table maintenance" ></table>'); + tb_woattlarge.on('drop', function (ev) { + dropWOAttachment(ev.originalEvent); + }).on('dragover', function (ev) { + dragOverWOAttachment(ev.originalEvent); + }).on('paste', function (ev) { + cutWOAttachment(ev.originalEvent); + }); + div_attlarge.append(tb_woattlarge); + tb_woattlarge.append('<tr style="line-height: 35px;"><td class="subtitle"><span class="sbutton iconchevrondown woattafoldicon" target="woaatts_tr" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span><span data-lgid="P_WO_WORKORDERATTACHMENTS">Work Order Attachments</span></td></tr>'); + var tr = $('<tr id="woaatts_tr" class="tr_intervals woattafoldtr"></tr>').appendTo(tb_woattlarge); + var td = $('<td></td>').appendTo(tr); + div_woatts = $('<div style="min-height: 80px; overflow: auto; padding-left: 20px;"></div>').appendTo(td); + //Asset Attachments Large + var tb_assetattlarge = $('<table class="main_table maintenance"></table>'); + div_attlarge.append(tb_assetattlarge); + tb_assetattlarge.append('<tr style="line-height: 35px;"><td class="subtitle"><span class="sbutton iconchevrondown woattafoldicon" target="woassetatts_tr" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span><span data-lgid="P_WO_ASSETATTACHMENTS">Asset Attachments</span></td></tr>'); + + var tr = $('<tr id="woassetatts_tr" class="tr_intervals woattafoldtr"></tr>').appendTo(tb_assetattlarge); + var td = $('<td></td>').appendTo(tr); + div_aatts = $('<div style="min-height: 80px; overflow: auto; padding-left: 20px;"></div>').appendTo(td) + //Inspection Attachments Large + var tb_ispattlarge = $('<table class="main_table maintenance"></table>'); + div_attlarge.append(tb_ispattlarge); + tb_ispattlarge.append('<tr style="line-height: 35px;"><td class="subtitle"><span class="sbutton iconchevrondown woattafoldicon" target="woiptatts_tr" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span><span data-lgid="P_WO_INSPECTIONATTACHMENTS">Inspection Attachments</span></td></tr>'); + + var tr = $('<tr id="woiptatts_tr" class="tr_intervals woattafoldtr"></tr>').appendTo(tb_ispattlarge); + var td = $('<td></td>').appendTo(tr); + div_iatts = $('<div style="min-height: 80px; overflow: auto; padding-left: 20px;"></div>').appendTo(td); + + //List + div_attlist = $('<div style="display: none;"></div>'); + p_div.append(div_attlist); + //WO Attachments List + var tb_wolist = $('<table class="main_table maintenance"></table>'); + tb_wolist.on('drop', function (ev) { + dropWOAttachment(ev.originalEvent); + }).on('dragover', function (ev) { + dragOverWOAttachment(ev.originalEvent); + }).on('paste', function (ev) { + cutWOAttachment(ev.originalEvent); + }); + div_attlist.append(tb_wolist); + var tr_wolist = $('<tr style="line-height: 35px;"></tr>'); + tb_wolist.append(tr_wolist); + var td_wolist = $('<td class="subtitle"></td>'); + tr_wolist.append(td_wolist); + td_wolist.append('<span class="sbutton iconchevrondown woattafoldicon" target="woattslist_tr" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span>'); + td_wolist.append('<span data-lgid="P_WO_WORKORDERATTACHMENTS">Work Order Attachments</span>'); + td_wolist.append('<lable class="lable_attuploadname" style="margin-left: 200px;"></lable>'); + tr_wolist = $('<tr id="woattslist_tr" class="tr_intervals woattafoldtr"></tr>'); + tb_wolist.append(tr_wolist); + td_wolist = $('<td></td>'); + tr_wolist.append(td_wolist); + var tab_woattslist = $('<table class="table_intervals"></table>'); + td_wolist.append(tab_woattslist); + tab_woattslist.append('<thead><tr><th style="width: 30px;"></th><th style="width: 60px;"></th><th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th><th style="width: 130px;" data-lgid="P_WO_AVAILABLETOCUSTOMER"></th><th class="td_funcs"></th></tr></thead>'); + woattslist_tbody = $('<tbody></tbody>').appendTo(tab_woattslist); + //Asset Attachments List + var tb_assetlist = $('<table class="main_table maintenance"></table>'); + div_attlist.append(tb_assetlist); + var tr_assetlist = $('<tr style="line-height: 35px;"></tr>'); + tb_assetlist.append(tr_assetlist); + var td_assetlist = $('<td class="subtitle"></td>'); + tr_assetlist.append(td_assetlist); + td_assetlist.append('<span class="sbutton iconchevrondown woattafoldicon" target="woassetattslist_tr" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span>'); + td_assetlist.append('<span data-lgid="P_WO_ASSETATTACHMENTS">Asset Attachments</span>'); + tr_assetlist = $('<tr id="woassetattslist_tr" class="tr_intervals woattafoldtr"></tr>'); + tb_assetlist.append(tr_assetlist); + td_assetlist = $('<td></td>'); + tr_assetlist.append(td_assetlist); + var tab_assetattslist = $('<table class="table_intervals"></table>'); + td_assetlist.append(tab_assetattslist); + tab_assetattslist.append('<thead><tr><th style="width: 30px;"></th><th style="width: 60px;"></th><th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th><th style="width: 130px;"></th><th class="td_funcs"></th></<tr>></thead>'); + woassetattslist_tbody = $('<tbody></tbody>').appendTo(tab_assetattslist); + + //Inspection Attachments List + var tb_isplist = $('<table class="main_table maintenance"></table>'); + div_attlist.append(tb_isplist); + var tr_isplist = $('<tr style="line-height: 35px;"></tr>'); + tb_isplist.append(tr_isplist); + var td_isplist = $('<td class="subtitle"></td>'); + tr_isplist.append(td_isplist); + td_isplist.append('<span class="sbutton iconchevrondown woattafoldicon" target="woiptattslist_tr" onclick="OnExpendInTab(this)" style="margin-left: 0; padding-right: 5px;"></span>'); + td_isplist.append('<span data-lgid="P_WO_INSPECTIONATTACHMENTS">Inspection Attachments</span>'); + tr_isplist = $('<tr id="woiptattslist_tr" class="tr_intervals woattafoldtr"></tr>'); + tb_isplist.append(tr_isplist); + tb_isplist = $('<td></td>'); + tr_isplist.append(tb_isplist); + var tab_ispattslist = $('<table class="table_intervals"></table>'); + tb_isplist.append(tab_ispattslist); + tab_ispattslist.append('<thead><tr> <th style="width: 30px;"></th><th style="width: 60px;"></th><th style="width: 400px; padding-left: 20px;" data-lgid="P_WO_XXX">Caption</th><th style="width: 130px;"></th><th class="td_funcs"></th></tr></thead>'); + woiptattslist_tbody = $('<tbody></tbody>').appendTo(tab_ispattslist); + + var div_attuoloadmsgmenus = $('<div class="panel_holder attuoloadmsgmenus"></div>') + p_div.append(div_attuoloadmsgmenus); + var attuplodmsg_panel = $('<div class="panel" style="min-width: 150px; background-color: white; max-width: 480px; max-height: 400px;"></div>'); + div_attuoloadmsgmenus.append(attuplodmsg_panel); + attupload_ul = $('<ul class="lefttitlemenu_ul"></ul>'); + attuplodmsg_panel.append(attupload_ul); + attuplodmsg_panel.append('<div class="trigledown"></div>'); + attuplodmsg_panel.append('<div class="trigledown white"></div>'); + } + + this.createAttachment(this.option.parent); + var dialog_panddattachments = createPAndDAttachmentDialog(); + + function createPAndDAttachmentDialog() { + var dialog = $('<div class="dialog" style="display: none;"></div>'); + dialog.append('<div class="dialog-title"><span class="title" data-lgid="P_WO_ATTACHMENTS">Attachments</span><em class="dialog-close"></em></div>'); + + panddlist = $('<div style="height: 320px; width:420px;"></div>'); + dialog.append($('<div class="dialog-content"></div>').append(panddlist)); + + var func = $('<div class="dialog-func"></div>'); + dialog.append(func); + + func.append('<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="1" style="height: unset;" />'); + btn_print = $('<input type="button" value="Print" data-lgid="P_WO_PRINT" tabindex="1" />'); + btn_print.on('click', function () { + printWOAttachments(); + }); + func.append(btn_print); + + btn_download = $('<input type="button" value="Download" data-lgid="P_WO_DOWNLOAD" tabindex="1" />'); + btn_download.on('click', function () { + downloadWOAttachments(); + }); + func.append(btn_download); + func.append('<div class="clear"></div>'); + + dialog.append('<div class="maskbg" style="display: none;"></div>'); + + $(document.body).append(dialog); + dialog.dialog(function () { + showmaskbg(false); + }); + + return dialog; + } + + function UpLoadWorkOrderAttachment() { + var file = $('<input type="file" style="display: none;" multiple="multiple" />'); + file.change(function () { + var files = this.files; + if (files.length > 0) { + onSaveWOAttachment(files); + } + }).click(); + } + + var filesinuploading = []; + var uploadingindex = -1; + var fileupload_errors = ""; + function onSaveWOAttachment(files) { + fileupload_errors = ""; + if (!_this.option.workorderid) { + OnSave(0, function () { + showLoading(); + $('.span_attupload').show(); + $('.span_vieuploadmsg').css('margin-left', 0); + $('.span_vieuploadmsg').show(); + if (filesinuploading.length > 0) { + for (var i = 0; i < files.length; i++) + filesinuploading.push(_this.option.workorderid, files[i]); + showUploadingStatus(0); + } + else { + filesinuploading = files; + DoUploadWorkOrderAttachments(_this.option.workorderid); + } + }); + } + else { + showLoading(); + $('.span_attupload').show(); + $('.span_vieuploadmsg').css('margin-left', 0); + $('.span_vieuploadmsg').show(); + if (filesinuploading.length > 0) { + for (var i = 0; i < files.length; i++) + filesinuploading.push(files[i]); + showUploadingStatus(0); + } + else { + filesinuploading = files; + DoUploadWorkOrderAttachments(_this.option.workorderid); + } + } + } + + function DoUploadWorkOrderAttachments(woid) { + if (woid != _this.option.workorderid) { + filesinuploading = []; + uploadingindex = -1; + return; + } + uploadingindex++; + if (uploadingindex >= filesinuploading.length) { + uploadingindex--; + showUploadingStatus(3); + filesinuploading = []; + uploadingindex = -1; + $('.span_attupload').hide(); + $('.span_vieuploadmsg').css('margin-left', 200); + getWorkOrderAttachments(); + + hideLoading(); + if (fileupload_errors !== "") + showAlert(fileupload_errors, GetTextByKey("P_WO_XXXXX", 'Upload failed')); + return; + } + var file = filesinuploading[uploadingindex]; + if (file.name.length > 200) { + showUploadingStatus(2, GetTextByKey("P_WO_XXX", "Attachment name length cannot be greater than 200.")); + DoUploadWorkOrderAttachments(woid); + return; + } + if (file.size == 0) { + showUploadingStatus(2, GetTextByKey("P_WO_ATTACHMENTSTIPS", "Attachment size is 0kb, uploading failed.")); + DoUploadWorkOrderAttachments(woid); + return; + } + if (file.size > 50 * 1024 * 1024) { + showUploadingStatus(2, GetTextByKey("P_WO_ATTACHMENTSTIPS1", "Attachment is too large. Maximum file size is 50 MB.")); + DoUploadWorkOrderAttachments(woid); + return; + } + + showUploadingStatus(0); + + var top = $(window).height() / 2 - 100; + var left = $(window).width() / 2 - 100; + var width = $('#dialogattmask .lable_attuploadname').width(); + $('#dialogattmask .loading_icon').css({ top: top, left: left }); + $('#dialogattmask .lable_attuploadname').css({ top: top + 70, left: ($(window).width() - width - 100) / 2 }); + + var p = JSON.stringify([_this.option.workorderid, ""]); + var formData = new FormData(); + formData.append("iconFile", file); + formData.append("MethodName", "AddAttachment"); + formData.append("ClientData", p); + var url = 'AddWorkOrder.aspx'; + $.ajax({ + url: url, + type: 'POST', + dataType: 'json', + processData: false, + contentType: false, + data: formData, + async: true, + success: function (data) { + if (data !== 'OK') { + showAlert(GetTextByKey("P_WO_XXXXX", 'Upload failed'), GetTextByKey("P_WO_ATTACHMENTFILE", 'Attachment File')); + } + showUploadingStatus(1); + DoUploadWorkOrderAttachments(woid); + }, + error: function (err) { + showUploadingStatus(2, GetTextByKey("P_WO_XXXXX", 'Upload failed')); + DoUploadWorkOrderAttachments(woid); + } + }); + } + + function showUploadingStatus(status, msg) { + if (filesinuploading.length == 0) return; + var filename = filesinuploading[uploadingindex].name; + if (filename.length > 50) + filename = filename.substring(0, 49) + "..."; + + var statustxt = ""; + if (status == 0) { + statustxt = "Uploading " + filename + " (" + (uploadingindex + 1) + "/" + filesinuploading.length + ")"; + $('.lable_attuploadname').text(statustxt); + } + else if (status == 1) { + statustxt = filename; + attupload_ul.append('<li style="padding-left: 0;height:unset;line-height:24px;"><span class="sbutton iconattsuc">' + statustxt + '</span></li>'); + } + else if (status == 2) { + statustxt = filename + " - " + msg; + attupload_ul.append('<li style="padding-left: 0;height:unset;line-height:24px;"><span class="sbutton iconatterror">' + statustxt + '</span></li>'); + if (fileupload_errors === "") + fileupload_errors = statustxt; + else + fileupload_errors = fileupload_errors + " \n " + statustxt; + } + else if (status == 3) { + statustxt = "Upload Completed"; + statustxt = ""; + $('.lable_attuploadname').text(statustxt); + } + } + + function deleteAttachment(attID) { + if (confirm(GetTextByKey("P_WO_DELETEATTACHMENTTIPS", "Are you sure you want to delete the attachment?"))) { + worequest("DeleteAttachment", attID, function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); + } + else { + getWorkOrderAttachments(); + } + }, function (err) { + showAlert(GetTextByKey("P_WO_FAILEDDELETEATTACHMENT", 'Failed to delete this attachment.'), GetTextByKey("P_WO_DELETEATTACHMENT", 'Delete Attachment')); + }); + } + } + + function onViewAttachment(type) { + viewtype = type; + if (typeof setCookie === "function") + setCookie("woattachmentviewtype", viewtype); + + $(".woattafoldicon").removeClass("iconchevronright").addClass("iconchevrondown"); + $(".woattafoldtr").show(); + showWOAttachments(); + } + + function showWOAttachments() { + div_woatts.empty(); + div_aatts.empty(); + div_iatts.empty(); + woattslist_tbody.empty(); + woassetattslist_tbody.empty(); + woiptattslist_tbody.empty(); + + if (!viewtype) + viewtype = 0; + + if (parseInt(viewtype) === 1) { + div_attlarge.hide(); + div_attlist.show(); + showAttachmentList(allAttachments); + } + else { + div_attlarge.show(); + div_attlist.hide(); + showWorkOrderAttachments(allAttachments); + } + $('#dialogattmask').height($(document).outerHeight(false)).width($(document).outerWidth(false)); + } + + var inloading = false; + function getWorkOrderAttachments() { + div_woatts.empty(); + div_aatts.empty(); + div_iatts.empty(); + woattslist_tbody.empty(); + woassetattslist_tbody.empty(); + woiptattslist_tbody.empty(); + if (inloading) + return; + inloading = true; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(true); + if (_this.option.workorderid) { + worequest('GetAttachments', JSON.stringify([_this.option.workorderid, _this.option.machineid]), function (data) { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + if (data && typeof data != "string") { + if (data.WorkOrderID != _this.option.workorderid) { + getWorkOrderAttachments(); + return; + } + data = data.Data; + allAttachments = data; + showWOAttachments(allAttachments); + } + }, function () { + inloading = false; + if (typeof _this.option.showloading == 'function') + _this.option.showloading(false); + }); + } + } + + var imgTypes = [".jfif", ".jpg", ".jpeg", ".bmp", ".png", ".tiff", ".gif"]; + var printTypes = ['.pdf', ".jfif", ".jpg", ".jpeg", ".bmp", ".png", ".tiff", ".gif"];//types to be loaded to print + function showWorkOrderAttachments(attas) { + div_woatts.empty(); + div_aatts.empty(); + div_iatts.empty(); + if (attas.AssetAttachments && attas.AssetAttachments.length > 0) { + for (var i = 0; i < attas.AssetAttachments.length; i++) { + var att = attas.AssetAttachments[i]; + if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) + att.ThumbnailUrl = att.Url + "&thumb=1"; + var div = createAttaDiv(att); + + if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + var sprint = $('<span class="attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { + openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); + }); + div.append(sprint); + } + + if (att.FileType.toLowerCase() != "url") { + var sdownload = $('<span class="attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { + openDownloadFrame(e.data.Url + "&d=1"); + }); + div.append(sdownload); + } + + div_aatts.append(div); + } + } + if (attas.WorkOrderAttachments && attas.WorkOrderAttachments.length > 0) { + for (var i = 0; i < attas.WorkOrderAttachments.length; i++) { + var att = attas.WorkOrderAttachments[i]; + + var pdiv = $('<div class="divattp"></div>'); + var div = createAttaDiv(att, true); + + var div1 = $('<div style=" margin-top: 15px;"></div>'); + var ext_span = $('<span style="font-weight:500;"></span>').text(GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); + var ext_chk = $('<input type="checkbox" />').prop('checked', att.AvailableToCustomer).click(att, function (e) { + updateWOAttachmentExtension(e.data.AttachmentId, $(this).prop('checked')); + }); + div1.append(ext_chk).append(ext_span); + pdiv.append(div1); + + if (AllowDeleteAtta) { + var sdel = $('<span class="delete"></span>').attr('title', GetTextByKey("P_WO_DELETE", 'Delete')).click(att, function (e) { + deleteAttachment(e.data.AttachmentId); + }); + div.append(sdel); + } + + if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + var sprint = $('<span class="attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { + openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); + }); + div.append(sprint); + } + + var sdownload = $('<span class="attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { + openDownloadFrame(e.data.Url + "&d=1"); + }); + div.append(sdownload); + pdiv.append(div); + + var caption = att.Notes === "" ? att.FileName : att.Notes; + var div3 = $('<div style="text-align:center;clear:both;height:25px;"></div>'); + var iptcaption = $('<input type="text" style="width: 296px;" class="inp_name" style="height:24px;" maxlength="200"/>').attr('data-ori', caption).val(caption); + iptcaption.data('attdata', att); + div3.append(iptcaption); + iptcaption.focus({ AttachmentId: att.AttachmentId, iptcaption: iptcaption }, function (e) { + e.data.iptcaption.addClass('focused'); + }); + iptcaption.blur({ div: div, AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { + e.data.iptcaption.removeClass('focused'); + updateWOAttachmentCaption(e.data); + }); + iptcaption.keydown({ div: div, AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { + if (e.keyCode == 13 || e.keyCode == 9) { + e.data.iptcaption.blur(); + } + }); + pdiv.append(div3); + div_woatts.append(pdiv); + } + } + if (attas.InspectionAttachments && attas.InspectionAttachments.length > 0) { + for (var i = 0; i < attas.InspectionAttachments.length; i++) { + var att = attas.InspectionAttachments[i]; + var div = createAttaDiv(att); + + if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + var sprint = $('<span class="attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { + openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); + }); + div.append(sprint); + } + + var sdownload = $('<span class="attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { + openDownloadFrame(e.data.Url + "&d=1"); + }); + div.append(sdownload); + + div_iatts.append(div); + } + } + } + + function createAttaDiv(att, iswoatta) { + var div = $('<div class="divatt"></div>').attr('title', att.FileName); + if (iswoatta) + div.attr('title', att.Notes === "" ? att.FileName : att.Notes) + + if (!att.FileType || att.FileType == "") att.FileType = ".jpg"; + if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) { + var pic = $('<img class="picture"></img>').attr('src', att.ThumbnailUrl); + pic.click(att, function (e) { + window.open(e.data.Url, "_blank") + }); + div.append(pic); + } + else { + var sdown = $('<img class="picture" />').click(att, function (e) { + window.open(e.data.Url); + }); + setAttachemntIcon(att.FileType, sdown); + div.append(sdown); + } + return div + } + + function updateWOAttachmentExtension(attID, chk) { + var item = { + 'Key': "1", + 'Value': chk + }; + + var param = JSON.stringify(item); + param = htmlencode(param); + + worequest('UpdateWOAttachmentExtension', JSON.stringify([attID, param]), function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_AVAILABLETOCUSTOMER", 'Available to Customer')); + } + if (allAttachments && allAttachments.WorkOrderAttachments) { + for (var i = 0; i < allAttachments.WorkOrderAttachments.length; i++) { + if (allAttachments.WorkOrderAttachments[i].AttachmentId == attID) { + allAttachments.WorkOrderAttachments[i].AvailableToCustomer = chk; + break; + } + } + } + }, function (err) { + }); + } + + var grid_panddattachments + function InitPAndDGrid() { + grid_panddattachments = new GridView(panddlist); + var list_columns = [ + { name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }, + { name: 'ThumbnailUrl', caption: "", valueIndex: 'ThumbnailUrl', css: { 'width': 42, 'text-align': 'center' } }, + { name: 'FileName', caption: GetTextByKey("P_WO_NAME", "Name"), valueIndex: 'FileName', css: { 'width': 280, 'text-align': 'left' } } + ]; + + var columns = []; + for (var hd in list_columns) { + var col = {}; + if (list_columns[hd].type) { + col.type = list_columns[hd].type; + } + col.name = list_columns[hd].name; + col.caption = list_columns[hd].caption; + col.visible = true; + col.sortable = true; + col.width = list_columns[hd].css.width; + col.align = list_columns[hd].css["text-align"] + col.key = list_columns[hd].valueIndex; + columns.push(col); + + if (col.name == "Selected") { + col.allcheck = true; + col.sortable = false; + } + else if (col.name == "ThumbnailUrl") { + col.allowHtml = true; + col.filterCustom = true; + col.filter = function (item) { + if (imgTypes.indexOf(item.FileType.toLowerCase()) >= 0) + return $('<img style="height:30px;width:30px;"></img>').attr('src', item.ThumbnailUrl); + else { + var sdown = $('<img style="height:30px;width:30px;line-height:40px;" />') + setAttachemntIcon(item.FileType, sdown); + return sdown; + } + } + col.styleFilter = function () { + return { "width": "100%", 'margin': 0 }; + } + } + } + grid_panddattachments.canMultiSelect = true; + grid_panddattachments.columns = columns; + grid_panddattachments.init(); + } + + function openPAndDGDialog(type) { + if (!allAttachments) return; + + var d = dialog_panddattachments; + if (!d.data("loaded")) { + d.data("loaded", true); + InitPAndDGrid(); + } + if (type == 0) { + btn_print.show(); + btn_download.hide(); + } + else { + btn_print.hide(); + btn_download.show(); + } + var data = []; + if (allAttachments.AssetAttachments && allAttachments.AssetAttachments.length > 0) + data = data.concat(allAttachments.AssetAttachments); + if (allAttachments.WorkOrderAttachments && allAttachments.WorkOrderAttachments.length > 0) + data = data.concat(allAttachments.WorkOrderAttachments); + if (allAttachments.InspectionAttachments && allAttachments.InspectionAttachments.length > 0) + data = data.concat(allAttachments.InspectionAttachments); + + var count = 0; + var rows = []; + for (var i = 0; i < data.length; i++) { + var att = data[i]; + if (att.FileType.toLowerCase() == "url") continue; + if (type == 1 || $.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + var fr = { + Values: { + FileName: att.Notes === "" ? att.FileName : att.Notes, + FileType: att.FileType, + Url: att.Url, + ThumbnailUrl: att.ThumbnailUrl, + AttachmentType: att.AttachmentType, + AttachmentIdStr: att.AttachmentIdStr, + Selected: false, + } + }; + rows.push(fr); + count++; + } + } + + d.find('.dialog-title span.title').text(GetTextByKey("P_WO_ATTACHMENTS", 'Attachments') + " (" + count + ")"); + showmaskbg(true); + d.css({ + 'top': (document.documentElement.clientHeight - d.height()) / 3, + 'left': (document.documentElement.clientWidth - d.width()) / 2 + }).showDialogfixed(); + + setTimeout(function () { + grid_panddattachments.setData(rows); + }); + } + + function getSelectedPAndDAttas() { + var sels = []; + if (grid_panddattachments && grid_panddattachments.source) { + for (var i = 0; i < grid_panddattachments.source.length; i++) { + var a = grid_panddattachments.source[i].Values; + if (a.Selected) + sels.push(a); + } + } + return sels; + } + + function printWOAttachments() { + var sels = getSelectedPAndDAttas(); + if (!sels || sels.length == 0) return; + if (sels && sels.length > 0) { + for (var i = 0; i < sels.length; i++) { + var att = sels[i]; + if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + openPrintFrame(att.AttachmentType, att.AttachmentIdStr); + } + } + } + showmaskbg(false); + dialog_panddattachments.hideDialog(); + } + + function openPrintFrame(attatype, id) { + var frame = $("<iframe style='display:none;'></iframe>"); + $(document.body).after(frame); + //frame.attr("src", url); + frame.attr("src", _network.root + "Print.aspx?pt=3&at=" + attatype + "&id=" + id); + + frame.on('load', function () { + setTimeout(function () { + frame.contents().find("body").css("text-align", "center"); + //frame.contents().find("img").css("max-height", window.screen.availHeight).css("max-width", window.screen.availWidth); + frame.contents().find("img").css("max-height", "98%").css("max-width", "98%"); + frame[0].contentWindow.print(); + }); + setTimeout(function () { + frame.remove(); + }, 60000); + }); + } + + function downloadWOAttachments() { + var sels = getSelectedPAndDAttas(); + if (!sels || sels.length == 0) return; + if (sels && sels.length > 0) { + for (var i = 0; i < sels.length; i++) { + var att = sels[i]; + openDownloadFrame(att.Url + "&d=1"); + } + } + + showmaskbg(false); + dialog_panddattachments.hideDialog(); + } + + function openDownloadFrame(url) { + var frame = $("<iframe style='display:none;'></iframe>"); + $(document.body).after(frame); + frame.attr("src", url); + + worequest('RecordDownloadLog', JSON.stringify([url]), function (data) { + + }, function (err) { + }); + + var timer = setInterval(function () { + if (frame[0].contentDocument && (frame[0].contentDocument.readyState == "complete" || frame[0].contentDocument.readyState == 4)) { + frame.remove(); + clearInterval(timer); + } + }, 5000); + } + + function updateWOAttachmentCaption(edata) { + var attid = edata.AttachmentId; + var caption = edata.iptcaption.val(); + + if (caption === "") { + var pcap = edata.caption; + if (edata.iptcaption.data('caption')) + pcap = edata.iptcaption.data('caption'); + edata.iptcaption.val(pcap); + return; + } + + var att = edata.iptcaption.data('attdata'); + att.Notes = caption; + + if (allAttachments && allAttachments.WorkOrderAttachments) { + for (var i = 0; i < allAttachments.WorkOrderAttachments.length; i++) { + if (allAttachments.WorkOrderAttachments[i].AttachmentId == att.AttachmentId) { + allAttachments.WorkOrderAttachments[i] = att; + break; + } + } + } + worequest('UpdateWorkOrderAttachmentCaption', JSON.stringify([attid, htmlencode(caption)]), function (data) { + if (data !== 'OK') { + showAlert(data, GetTextByKey("P_WO_XXX", 'Update Caption')); + } + else { + if (edata.div) + edata.div.attr('title', caption); + edata.iptcaption.data('caption', caption); + } + }, function (err) { + }); + } + + //***********************************Begin Attachment List************************************// + + function showAttachmentList(data) { + woattslist_tbody.empty(); + woassetattslist_tbody.empty(); + woiptattslist_tbody.empty(); + if (data.WorkOrderAttachments && data.WorkOrderAttachments.length > 0) { + for (var i = 0; i < data.WorkOrderAttachments.length; i++) { + var att = data.WorkOrderAttachments[i]; + var tr = createWOAttachmentTr(att); + woattslist_tbody.append(tr); + } + } + if (data.AssetAttachments && data.AssetAttachments.length > 0) { + for (var i = 0; i < data.AssetAttachments.length; i++) { + var att = data.AssetAttachments[i]; + if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) + att.ThumbnailUrl = att.Url + "&thumb=1"; + var tr = createWOOtherAttachmentTr(att); + woassetattslist_tbody.append(tr); + } + } + if (data.InspectionAttachments && data.InspectionAttachments.length > 0) { + for (var i = 0; i < data.InspectionAttachments.length; i++) { + var att = data.InspectionAttachments[i]; + var tr = createWOOtherAttachmentTr(att); + woiptattslist_tbody.append(tr); + } + } + } + + function createWOAttachmentTr(att) { + var caption = att.Notes === "" ? att.FileName : att.Notes; + var tr = $('<tr></tr>').attr('data-id', att.AttachmentId); + var td; + tr.append('<td></td>'); + + td = $('<td></td>'); + if (!att.FileType || att.FileType == "") + att.FileType = ".jpg"; + + var divpic = $('<div style="width:60px;height:60px;text-align:center;"></div>'); + td.append(divpic); + if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) { + var pic = $('<img class="wolist_picture"></img>').attr('src', att.ThumbnailUrl); + pic.click(att, function (e) { + window.open(e.data.Url, "_blank") + }); + divpic.append(pic); + } + else { + var sdown = $('<img class="wolist_picture" />').click(att, function (e) { + window.open(e.data.Url); + }); + setAttachemntIcon(att.FileType, sdown); + divpic.append(sdown); + } + tr.append(td); + + td = $('<td style="padding-left:20px;"></td>'); + var iptcaption = $('<input type="text" class="inp_name" maxlength="200" style="height:24px;"/>').css('width', '100%').attr('data-ori', caption).val(caption); + iptcaption.data('attdata', att); + td.append(iptcaption); + iptcaption.focus({ AttachmentId: att.AttachmentId, iptcaption: iptcaption }, function (e) { + e.data.iptcaption.addClass('focused'); + }); + iptcaption.blur({ AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { + e.data.iptcaption.removeClass('focused'); + updateWOAttachmentCaption(e.data); + }); + + iptcaption.keydown({ AttachmentId: att.AttachmentId, iptcaption: iptcaption, caption: caption }, function (e) { + if (e.keyCode == 13 || e.keyCode == 9) { + e.data.iptcaption.blur(); + } + }); + tr.append(td); + + + td = $('<td></td>'); + var chk_tocust = $('<input type="checkbox" class="inp_recurring"/>').attr('data-ori', att.AvailableToCustomer).prop('checked', att.AvailableToCustomer); + td.append(chk_tocust); + chk_tocust.click(att, function (e) { + updateWOAttachmentExtension(e.data.AttachmentId, $(this).prop('checked')); + }); + tr.append(td); + + td = $('<td class="td_funcs"></td>'); + var sdel = $('<span class="wolist_icon wolist_delete"></span>').attr('title', GetTextByKey("P_WO_DELETE", 'Delete')).click(att, function (e) { + deleteAttachment(e.data.AttachmentId); + }); + td.append(sdel); + + var sdownload = $('<span class="wolist_icon wolist_attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { + openDownloadFrame(e.data.Url + "&d=1"); + }); + td.append(sdownload); + + if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + var sprint = $('<span class="wolist_icon wolist_attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { + openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); + }); + td.append(sprint); + } + + tr.append(td); + return tr; + } + + function createWOOtherAttachmentTr(att) { + var tr = $('<tr></tr>').attr('data-id', att.AttachmentId); + var td; + tr.append('<td></td>'); + + td = $('<td></td>'); + if (!att.FileType || att.FileType == "") + att.FileType = ".jpg"; + + var divpic = $('<div style="width:60px;height:60px;text-align:center;"></div>'); + td.append(divpic); + if (imgTypes.indexOf(att.FileType.toLowerCase()) >= 0) { + var pic = $('<img class="wolist_picture"></img>').attr('src', att.ThumbnailUrl); + pic.click(att, function (e) { + window.open(e.data.Url, "_blank") + }); + divpic.append(pic); + } + else { + var sdown = $('<img class="wolist_picture" />').click(att, function (e) { + window.open(e.data.Url); + }); + setAttachemntIcon(att.FileType, sdown); + divpic.append(sdown); + } + tr.append(td); + + td = $('<td style="padding-left:20px;"></td>').text(att.FileName); + tr.append(td); + + tr.append('<td></td>'); + + td = $('<td class="td_funcs"></td>'); + if (att.FileType.toLowerCase() != "url") { + var sdownload = $('<span class="wolist_icon wolist_attadownload"></span>').attr('title', GetTextByKey("P_WO_DOWNLOAD", 'Download')).click(att, function (e) { + openDownloadFrame(e.data.Url + "&d=1"); + }); + td.append(sdownload); + } + + if ($.inArray(att.FileType.toLowerCase(), printTypes) >= 0) { + var sprint = $('<span class="wolist_icon wolist_attaprint"></span>').attr('title', GetTextByKey("P_WO_PRINT", 'Print')).click(att, function (e) { + openPrintFrame(e.data.AttachmentType, e.data.AttachmentIdStr); + }); + td.append(sprint); + } + + tr.append(td); + return tr; + } + + //***********************************End Attachment List************************************// + + + function dragOverWOAttachment(ev) { + ev.preventDefault(); + ev.dataTransfer.dropEffect = 'link'; + + } + function dropWOAttachment(ev) { + ev.preventDefault(); + ev.stopPropagation(); + var df = ev.dataTransfer; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + files.push(file); + } + } + } + if (files.length > 0) + onSaveWOAttachment(files); + } + + function cutWOAttachment(ev) { + ev.stopPropagation(); + var df = ev.clipboardData; + var files = []; + if (df.items !== undefined) { + for (var i = 0; i < df.items.length; i++) { + var item = df.items[i]; + if (item.kind === "file" && (item.webkitGetAsEntry() == null || item.webkitGetAsEntry().isFile)) { + var file = item.getAsFile(); + files.push(file); + } + } + } + if (files.length > 0) + onSaveWOAttachment(files); + } + } +} +/*****************************************End Attachment*********************************************/ + + +/*****************************************Begin Customer Communication*********************************************/ +if (typeof $wocommunication !== 'function') { + $wocommunication = function (option) { + var _this = this; + this.customercontacts = []; + this.followers = []; + + this.changewo = function (woid, aid, wo) { + option.workorderid = woid; + if (aid) + option.machineid = aid; + if (wo) + option.wo = wo; + this.updatecontact([]);//清空联系人 + this.followers = []; + this.customer.followers = []; + this.getWorkOrderFollowers(woid); + this.getCommunications(true); + + var customer = this.customer; + if (customer && option.wo) { + customer.companyName = option.wo.CustomerName; + customer.companyCode = option.wo.CustomerCode; + customer.setData('companyCode', option.wo.CustomerCode); + customer.autoUpdates = option.wo.AutoText?.Value; + } + }; + + this.updatecontact = function (contacts) { + this.customercontacts = contacts + this.showCustomerContacts(this.customercontacts); + } + + this.close = function () { + } + + this.resetCommunications = function () { + var customer = _this.customer; + if (typeof customer !== 'undefined') { + customer.text = ''; + customer.load(); + } + } + + var communicationsLoading = false; + var communicationsLoadingWaitCount = 0; + /**Communication */ + this.getCommunications = function (reset) { + if (reset) { + _this.resetCommunications(); + } + if (communicationsLoading) { + communicationsLoadingWaitCount++; + return; + } + communicationsLoading = true; + + if (!option.workorderid || option.workorderid == "") return; + option.showloading(true); + worequest("GetCommunications", option.workorderid, function (data) { + communicationsLoading = false; + option.showloading(false); + if (typeof (data) === "string") { + return; + } + _this.customer?.load(data, _this.customercontacts, _this.followers); + + if (communicationsLoadingWaitCount > 0) { + communicationsLoadingWaitCount = 0; + _this.getCommunications(reset); + } + }, function () { + communicationsLoading = false; + if (communicationsLoadingWaitCount > 0) { + communicationsLoadingWaitCount = 0; + _this.getCommunications(reset); + } + option.showloading(false); + }); + }; + + this.showCustomerContacts = function (data) { + var customer = this.customer; + if (customer != null) { + customer.setData('contacts', data); + customer.contacts = data; + } + }; + + this.getCustomerContacts = function (custid, next) { + worequest('GetCustomerContacts', custid, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); + if (next) + next([]);//next 在Communication选Contacts时传入 + return; + } + if (next) { + next(data);//next 在Communication选Contacts时传入 + return; + } + + _this.showCustomerContacts(data); + _this.SaveWorkorderContact(); + }, function () { + }); + } + + this.SaveWorkorderContact = function (data, next) { + var workorderid = option.workorderid; + if (!workorderid || workorderid == "") + return; + var custid = option.wo.CustomerId; + if (!custid) + custid = -1; + + var param = JSON.stringify([workorderid, custid, JSON.stringify(data ?? _this.customercontacts)]); + param = htmlencode(param); + worequest("SaveWorkOrderContact", param, function (data) { + if (typeof next === 'function') { + next(data); + return; + } + if (typeof data === "string") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + }, function () { + //showmaskbg(false); + }); + }; + + this.SaveWorkOrderFollower = function (next) { + var workorderid = option.workorderid; + if (!workorderid || workorderid == "") + return; + + var param = JSON.stringify([workorderid, JSON.stringify(_this.followers)]); + param = htmlencode(param); + worequest("SaveWorkOrderFollower", param, function (data) { + if (typeof next === 'function') { + next(data); + } else { + if (data !== "OK") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + } + }, function () { + //showmaskbg(false); + }); + }; + + this.getWorkOrderFollowers = function (woid) { + worequest('GetWorkOrderFollowers', woid, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); + return; + } + _this.followers = data; + _this.customer.followers = _this.followers; + }, function () { + }); + }; + + var isloadfollower = false; + var allfollowers = []; + this.getAllFollowers = function (next) { + worequest('GetAllFollowers', '', function (data) { + if (typeof next === 'function') { + next(data); + } else { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); + return; + } + isloadfollower = true; + allfollowers = data; + _this.customer.setData('allfollowers', data); + } + }, function () { + }); + }; + + window.customer = this.customer = new window['lib-app'].CustomerCommunication({ + autoUpdates: false, + readonly: WOReadOnly || COMMReadOnly, + recordReadonly: !AllowCustomer || WOReadOnly || CRReadOnly, + onMasking: window.parent.onmaskbg, + onAddMessage: function () { + var customer = _this.customer; + var pmemails = customer?.contacts; + if (pmemails == null || pmemails.length === 0) { + showAlert(GetTextByKey("P_WO_PLEASEINPUTTHEPHONENUMBEROREMAL", "Please input the phone number or email."), GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + + var comm = customer?.text; + if ($.trim(comm) == "") { + showAlert(GetTextByKey("P_WO_PLEASEINPUTTHEMESSAGE", "Please input the message."), GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + + var includeStatusLink = customer?.statusLink; + + var param = JSON.stringify([option.workorderid, JSON.stringify(pmemails), comm, (includeStatusLink ? "1" : "0")]); + param = htmlencode(param); + option.showloading(true); + worequest("AddWorkOrderCommunication", param, function (data) { + option.showloading(false); + if (data !== "") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + customer.text = ''; + //setTimeout(function () { _this.getCommunications() }, 400); + }, function () { + option.showloading(false); + }); + }, + onSave: function (item, add) { + var contact; + if (!add) { + contact = _this.customercontacts.filter(function (f) { return f.Id < 0 ? f.Name === item.Name && f.MobilePhone === item.MobilePhone : f.Id === item.Id })[0]; + } + var array = []; + for (let c of _this.customercontacts) { + if (c === contact) { + let ct = { + ...contact, + Name: item.Name, + ContactPreference: item.ContactPreference, + Email: item.Email, + MobilePhone: item.MobilePhone, + OptOut: item.OptOut, + Notes: item.Notes, + SaveToCustomer: item.SaveToCustomer + }; + + if (parseInt(ct.ContactPreference) == 0) { + ct.ContactPreferenceStr = GetTextByKey("P_CR_TEXT", "Text"); + } else if (parseInt(ct.ContactPreference) == 1) { + ct.ContactPreferenceStr = GetTextByKey("P_CR_EMAIL", "Email"); + } else if (parseInt(ct.ContactPreference) == 2) { + ct.ContactPreferenceStr = GetTextByKey("P_CR_PHONE", "Phone"); + } + array.push(ct) + } else { + array.push(c); + } + } + if (add) { + item.Id = -1; + array.push(item); + } + + return new Promise(function (resolve, reject) { + _this.SaveWorkorderContact(array, function (data) { + if (typeof data === 'string') { + ui.showAlert(GetTextByKey("P_WO_ERROR", 'Error'), data, 'error') + reject(); + } else { + for (let d of data) { + const c = _this.customercontacts.find(function (c) { + return c.Id < 0 ? + c.Name === d.Name && c.MobilePhone === d.MobilePhone : + c.Id === d.Id + }); + if (c != null) { + d.selected = c.selected; + } else { + d.selected = true; + } + } + _this.showCustomerContacts(_this.customercontacts = data); + resolve(data); + } + }); + }); + }, + onDelete: function (_op, item, customer) { + var index; + var customercontacts = _this.customercontacts; + if (customer) { + index = customercontacts.findIndex(function (c) { return c.Id === item.Id }); + } else { + index = customercontacts.findIndex(function (c) { return c.Name === item.Name && c.MobilePhone === item.MobilePhone }); + } + if (index >= 0) { + customercontacts.splice(index, 1); + _this.SaveWorkorderContact(); + _this.showCustomerContacts(customercontacts); + + // from customer record + if (customer) { + _network.request("Maintenance/AddCustomerRecord.aspx", -1, 'DeleteContact', item.Id, function () { }, function (e) { + console.log(e); + ui.showAlert(GetTextByKey("P_WO_ERROR", 'Error'), GetTextByKey('P_UM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), 'error'); + }); + } + } + }, + onChanged: function (source) { + _this.customer.contacts = source; + }, + onDeleteFollower: function (_op, f) { + var followers = _this.followers; + var index = followers.findIndex(function (c) { return c.UserIID === f.UserIID }); + if (index < 0) { + return; + } + followers.splice(index, 1); + _this.SaveWorkOrderFollower(); + _this.customer.followers = followers; + }, + onChangeFollower: function (_op, f, text, email) { + var follower = _this.followers.find(function (c) { return c.UserIID === f.UserIID }); + if (follower != null) { + follower.SendText = text; + follower.SendEmail = email; + _this.SaveWorkOrderFollower(); + _this.customer.followers = followers; + } + }, + onInitFollower: function (selfollowers) { + if (isloadfollower && allfollowers?.length > 0) { + for (let f of allfollowers) { + f.Email = false; + f.Text = false; + if (selfollowers) { + var tf = selfollowers.find(function (c) { return c.UserIID.toLowerCase() === f.IID.toLowerCase() }); + if (tf) { + f.Email = tf.SendEmail; + f.Text = tf.SendText; + } + } + } + return Promise.resolve(allfollowers); + } + return new Promise(function (resolve) { + _this.getAllFollowers(function (data) { + if (Array.isArray(data)) { + isloadfollower = true; + allfollowers = data; + } + for (let f of allfollowers) { + f.Email = false; + f.Text = false; + if (selfollowers) { + var tf = selfollowers.find(function (c) { return c.UserIID.toLowerCase() === f.IID.toLowerCase() }); + if (tf) { + f.Email = tf.SendEmail; + f.Text = tf.SendText; + } + } + } + resolve(data); + }); + }); + }, + onAddFollower: function (list) { + var followers = _this.followers = []; + for (let f of list) { + let o = { + Id: -1, + UserIID: f.IID, + Name: f.DisplayName, + Email: f.ID, + MobilePhone: f.Mobile, + SendEmail: f.Email, + SendText: f.Text + }; + followers.push(o); + } + return new Promise(function (resolve, reject) { + _this.SaveWorkOrderFollower(function (data) { + if (data !== 'OK') { + ui.showAlert(GetTextByKey("P_WO_ERROR", 'Error'), data, 'error') + reject(); + } else { + resolve(followers); + } + }); + }); + }, + onOpenSelectCRContacts: function () { + return new Promise(function (resolve) { + var customerid = option.wo.CustomerId; + if (!customerid || customerid === "") { + setTimeout(function () { resolve([]) }, 0); + return; + } + _this.getCustomerContacts(customerid, function (data) { + resolve(data); + }); + }); + }, + onSelectCRContacts: function (list) { + if (_this.customercontacts) { + var temp = []; + for (var i = 0; i < _this.customercontacts.length; i++) {//移除上一个Customer的Contacts + if (_this.customercontacts[i].Id > 0) continue; + temp.push(_this.customercontacts[i]); + } + _this.customercontacts = temp; + } + + for (var i = 0; i < list.length; i++) { + var r = list[i]; + var item = { ...r }; + var contactexists = false; + if (_this.customercontacts) { + for (var j = 0; j < _this.customercontacts.length; j++) { + var ct = _this.customercontacts[j]; + if (ct.Name === item.Name && ct.MobilePhone === item.MobilePhone) { + ct.Id = item.Id; + contactexists = true; + break; + } + } + } + + if (!contactexists) + _this.customercontacts.push(item); + } + + _this.showCustomerContacts(_this.customercontacts); + _this.SaveWorkorderContact(); + } + }); + + option.parent.append(this.customer.create()); + } +} +/*****************************************End Customer Communication*********************************************/ + + +/*****************************************Begin Internal Communcation*********************************************/ +if (typeof $wointernal !== 'function') { + $wointernal = function (option) { + var _this = this; + + this.changewo = function (woid, aid) { + //if (woid !== option.workorderid) { + option.workorderid = woid; + if (aid) + option.machineid = aid; + this.getComments(true); + //} + }; + this.close = function () { + } + + this.resetComments = function () { + var internal = this.internal; + if (internal != null) { + internal.text = ''; + internal.load(); + } + }; + + this.getComments = function (reset) { + option.showloading(true); + if (reset) { + this.resetComments(); + } + var workorderid = option.workorderid; + if (!workorderid || workorderid == "") return; + worequest("GetComments", workorderid, function (data) { + option.showloading(false); + if (typeof (data) === "string") { + return; + } + $("#li_comments").data("loaded", true); + _this.internal?.load(data); + }, function () { + option.showloading(false); + }); + }; + + window.internal = this.internal = new window['lib-app'].InternalComment({ + readonly: WOReadOnly, + onAddMessage: openSendICEmail, + onAddComment: function (comment) { + if ($.trim(comment) == "") { + //showAlert(GetTextByKey("P_FR_PLEASEINPUTTHECOMMENT", "Please input the comment."), GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + + var param = JSON.stringify([option.workorderid, comment]); + param = htmlencode(param); + option.showloading(true); + worequest("AddWorkOrderComment", param, function (data) { + option.showloading(false); + if (data !== "") { + showAlert(data, GetTextByKey("P_WO_ERROR", 'Error')); + return; + } + _this.internal.text = ''; + $('#commentsinputcount').text("0/" + $('#dialog_comments').attr("maxlength")); + //setTimeout(function () { _this.getComments() }, 400); + }, function () { + option.showloading(false); + }); + } + }); + + option.parent.append(this.internal.create()); + }; +} +/*****************************************End Internal Communcation*********************************************/ diff --git a/Site/Maintenance/js/workorderwidgets.js b/Site/Maintenance/js/workorderwidgets.js new file mode 100644 index 0000000..600ac2f --- /dev/null +++ b/Site/Maintenance/js/workorderwidgets.js @@ -0,0 +1,407 @@ +var $wowidgetselector = function (id) { + this.containerId = id; + this.title = GetTextByKey("P_XXX", 'Widgets'); + this.companyId = null;; + this.forceSingle = false; + this.exceptShareAsset = false; + this.onOK = null; + this.onDialogClosed = null; + this.includechild = true; + this.allowhidden = true; + this.uid = null; +}; + +(function () { + var __proto = $wowidgetselector.prototype; + + function initWidgetsGrid(parent) { + var grid = new GridView(parent); + grid.lang = { + all: GetTextByKey("P_GRID_ALL", "(All)"), + ok: GetTextByKey("P_GRID_OK", "OK"), + reset: GetTextByKey("P_GRID_RESET", "Reset") + }; + var styleFilter = function (item) { + if (item.Suggested) { + return { + //'background-color': 'yellow', + 'display': 'block', + 'margin': 0, + 'box-sizing': 'border-box', + 'padding': '0 4px', + 'height': '27px', + 'line-height': '27px', + 'overflow': 'hidden', + 'text-overflow': 'ellipsis' + }; + } + }; + var bgFilter = function (item) { + if (item.Suggested) + return 'yellow'; + }; + var columns = []; + columns.push({ + // checkbox + name: 'check', + key: 'Visible', + width: 45, + align: 'center', + sortable: false, + allcheck: true, + type: 3 + }, + { + key: 'WidgetName', + caption: 'Name', + width: 300, + styleFilter: styleFilter, + bgFilter: bgFilter + }); + //grid.canMultiSelect = true; + grid.columns = columns; + grid.init(); + + this.gridWidgets = grid; + } + + function createDialog() { + var dialog = $('<div class="dialog" style="display: none; width: 550px; height: 440px">').attr('id', this.containerId); + + var title = $('<div class="dialog-title"></div>').appendTo(dialog); + title.append($('<span class="title"></span>').text(this.title)); + title.append('<em class="dialog-close"></em>'); + + var content = $('<div class="dialog-content"></div>').appendTo(dialog); + + var labeldiv = $('<div style="margin: 4px 0 0 10px; line-height: 25px"></div>').appendTo(content); + $('<span></span>').text(GetTextByKey("P_XXX", 'Which Widgets Should be Displayed?')).appendTo(labeldiv); + + this.widgetList = $('<div style="width: 520px; height: 320px; margin: 10px 0 4px"></div>').appendTo(content); + + var dialogFunction = $('<div class="dialog-func"></div>').appendTo(dialog); + $('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_CANCEL", "Cancel") + '" class="dialog-close" />').appendTo(dialogFunction).css("height", 'unset'); + $('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_OK", "OK") + '" />').click(onOKClick.bind(this)).appendTo(dialogFunction); + $('<div class="clear"></div>').appendTo(dialogFunction); + + $('<div class="maskbg" style="display: none"><div class="loading_icon icon c-spin"></div></div>').appendTo(dialog); + + // init + initWidgetsGrid.call(this, this.widgetList); + $(document.body).append(dialog); + + dialog.dialog(this.onDialogClosed); + return dialog; + } + + __proto.showSelector = function (topRatio, force) { + var dialog; + if (force) { + $('#' + this.containerId).remove(); + dialog = createDialog.call(this); + } else { + dialog = $('#' + this.containerId); + if (!dialog.length) { + dialog = createDialog.call(this); + } + } + this.dialog = dialog; + dialog.attr('init', '1').css({ + 'top': (document.documentElement.clientHeight - dialog.height()) / (topRatio || 3), + 'left': (document.documentElement.clientWidth - dialog.width()) / 2 + }).showDialogfixed(); + this.gridWidgets.setData(widgetdata); + onSearch.call(this); + }; + + function worequest(method, param, callback, error) { + var path = ""; + if (_network.root != null && _network.root.length > 0) { + path = "Maintenance/"; + } + _network.request(path + "WorkOrderMaintenance.aspx", -1, method, param, callback, error || function (e) { + console.log(e); + }); + } + + function onSearch() { + var maskbg = this.dialog.find('.maskbg'); + maskbg.show(); + var gridWidgets = this.gridWidgets; + var title = this.title; + + worequest("GetWorkOrderWidgets", "", function (data) { + if (typeof data === 'string') { + showAlert(GetTextByKey("P_XXX", 'Error'), title); + maskbg.hide(); + return; + } + var items = []; + for (var i = 0; i < widgetdata.length; i++) { + var item = widgetdata[i].Values; + for (var j = 0; j < data.length; j++) { + if (item.WidgetId == data[j].WidgetId) { + item.Visible = true; + break; + } + } + items.push({ Values: item }); + } + + gridWidgets.setData(items); + maskbg.hide(); + }, function () { + showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title); + maskbg.hide(); + }); + } + + function onOKClick() { + var widgets = []; + for (var i = 0; i < this.gridWidgets.source.length; i++) { + widgets.push(this.gridWidgets.source[i].Values); + } + + var _this = this; + var alerttitle = GetTextByKey("P_WO_XXX", "Save Widgets"); + var param = JSON.stringify(widgets); + param = htmlencode(param); + worequest("SaveWorkOrderWidgets", param, function (data) { + if (data !== 'OK') { + showAlert(data, alerttitle); + return; + } + _this.onOK && _this.onOK(); + _this.dialog.hideDialog(); + showmaskbg(false); + }, function (err) { + }); + } +})(); + +var WorkOrderWidget = function () { + this.workorderid = null; + this.assetid = null; + this.workorderwidgets = null; + this.widgets = {}; + this.popups = {}; + var _this = this; + this.getWorkOrderWidgets = function () { + this.workorderwidgets = null; + var title = GetTextByKey("P_XXX", 'Widget'); + worequest("GetWorkOrderWidgets", "", function (data) { + if (typeof data === 'string') { + showAlert(GetTextByKey("P_XXX", 'Error'), title); + return; + } + _this.workorderwidgets = data; + _this.showWorkOrderWidgets(); + _this.getWorkOrderContacts(_this.workorderid); + + }, function () { + showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title); + }); + } + + this.changeWorkOrder = function (wo) { + window.workorderid = this.workorderid = wo.Id.Value; + window.machineid = this.assetid = wo.AssetId; + this.wo = wo; + if (!this.workorderwidgets) { + this.getWorkOrderWidgets(); + } else { + for (let w of this.workorderwidgets) { + if (Object.prototype.hasOwnProperty.call(this.widgets, w.WidgetId)) { + this.widgets[w.WidgetId].changewo(this.workorderid, this.assetid, wo); + } + } + this.getWorkOrderContacts(this.workorderid); + } + } + + this.reloadWidgets = function () { + if (this.workorderwidgets != null) { + for (let w of this.workorderwidgets) { + this.popups[w.WidgetId]?.close(false); + if (this.widgets[w.WidgetId] && typeof this.widgets[w.WidgetId].close == 'function') + this.widgets[w.WidgetId].close(); + } + } + this.getWorkOrderWidgets(); + }; + + this.onmsgreceived = function (data) { + if (this.workorderwidgets != null) { + if (data && this.workorderid == data.Message) { + if (data.Code == "501") { + for (let w of this.workorderwidgets) { + this.widgets[w.WidgetId].changewo(this.workorderid); + } + this.getWorkOrderContacts(this.workorderid); + } + else if (data.Code == "503" || data.Code == "504" || data.Code == "507") { + this.widgets['CustomerCommunication']?.changewo(this.workorderid); + this.getWorkOrderContacts(this.workorderid); + } + else if (data.Code == "505") { + this.widgets['InternalComments']?.changewo(this.workorderid); + } + else if (data.Code == "506") { + this.getWorkOrderContacts(this.workorderid); + } + else if (data.Code == "502")//delete + { + for (let w of this.workorderwidgets) { + this.popups[w.WidgetId]?.close(false); + if (this.widgets[w.WidgetId] && typeof this.widgets[w.WidgetId].close == 'function') + this.widgets[w.WidgetId].close(); + } + this.workorderwidgets = null; + this.popups = []; + this.widgets = []; + } + } + } + }; + + this.reloaddata = function (widgetid) { + if (this.workorderwidgets != null) { + this.widgets[widgetid]?.changewo(this.workorderid); + } + this.getWorkOrderContacts(this.workorderid); + }; + + this.showWorkOrderWidgets = function () { + this.defX = 0; + this.defY = 0; + this.currentZIndex = 200 + this.workorderwidgets.length; + for (let w of this.workorderwidgets) { + this.createWidgetDialog(w); + } + } + + this.saveWorkOrderWidgets = function (widget, layout) { + widget.Layout = JSON.stringify(layout); + + var title = GetTextByKey("P_XXX", 'Widget'); + worequest('SaveWorkOrderWidgetLayout', JSON.stringify(widget), function (data) { + if (data === 'OK') { + return; + } + showAlert(data, title); + }, function () { + showAlert(GetTextByKey("P_XXXX", 'Failed to save the work order widget layout.'), title); + }); + }; + + this.getWorkOrderContacts = function (woid) { + worequest('GetWorkOrderContacts', woid, function (data) { + if (typeof (data) === "string") { + showAlert(data, GetTextByKey('P_CUSTOMERRECORD', "Customer Record")); + return; + } + if (_this.workorderwidgets != null) { + for (let w of _this.workorderwidgets) { + if (_this.widgets[w.WidgetId] && typeof _this.widgets[w.WidgetId].updatecontact == 'function') + _this.widgets[w.WidgetId].updatecontact(data); + } + } + }, function () { + }); + }; + + this.createWidgetDialog = function (widget) { + const ui = window['lib-ui']; + + let layout = widget.Layout; + if (!layout || layout === '') { + let x = this.defX; + let y = this.defY; + let width = $(document.body).width(); + let height = $(document.body).height(); + let left = 20 + 320 * x; + if (left + 300 > width) { + x = 0; + left = 20; + y++; + this.defY = y; + } + let top = height - (y == 0 ? 420 : 320 * (y + 1)); + x++; + this.defX = x; + layout = { left, top, width: 300, height: 400 }; + } else { + layout = JSON.parse(widget.Layout); + } + let zIndex = this.currentZIndex--; + + var container = ui.createElement('div', 'class-content'); + var _this = this; + const popup = new ui.Popup({ + title: widgetdata.find(function (v) { return v.Values.WidgetId == widget.WidgetId })?.Values?.WidgetName, + content: container, + mask: false, + // movable: false, + resizable: true, + collapsable: true, + zIndex, + changeZIndex: true, + minWidth: 210, + minHeight: 200, + buttons: [ + //{ + // text: 'Loading', trigger: p => { + // p.loading = true; + // setTimeout(() => p.loading = false, 1000); + // return false; + // } + //}, + //{ text: 'OK' } + ], + onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }, + onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) } + }); + popup.show(); + popup.rect = layout; + this.popups[widget.WidgetId] = popup; + + let options = { + parent: $(container), + canExport: canExport, + showloading: function (flag) { + popup.loading = flag; + } + }; + let content; + switch (widget.WidgetId) { + case 'CustomerCommunication': + content = new $wocommunication(options); + let checkLink = ui.createCheckbox({ + className: 'check-status-link', + enabled: !content.customer.readonly, + checkedNode: ui.createIcon('fa-regular', 'link'), + uncheckedNode: ui.createIcon('fa-regular', 'unlink'), + onchange: function () { + content.customer.statusLink = this.checked; + ui.setTooltip(checkLink, this.checked ? + GetTextByKey('P_WO_XXXXXX', 'Status Link Included') : + GetTextByKey('P_WO_XXXXXX', 'Status Link Excluded')); + } + }); + ui.setTooltip(checkLink, GetTextByKey('P_WO_XXXXXX', 'Status Link Excluded')); + $(checkLink).insertAfter(options.parent.parents('.ui-popup-container').find('.ui-popup-header>.ui-popup-header-title')); + break; + case 'InternalComments': content = new $wointernal(options); break; + case 'Alerts': content = new $woalert(options); break; + case 'Segments': content = new $wosegment(options); break; + case 'Attachments': content = new $woattachment(options); break; + case 'Inspections': content = new $woinspection(options); break; + case 'Estimates': content = new $woestimate(options); break; + case 'Invoices': content = new $woinvoice(options); break; + } + if (content != null) { + this.widgets[widget.WidgetId] = content; + content.changewo(this.workorderid, this.assetid, this.wo); + } + }; +} diff --git a/Site/MapView.aspx b/Site/MapView.aspx index ebe39f6..a2f8d51 100644 --- a/Site/MapView.aspx +++ b/Site/MapView.aspx @@ -646,6 +646,7 @@ var canViewInspection = <%=CanViewInspection?"true":"false"%>; var canViewPM = <%=CanViewPM?"true":"false"%>; var showTooltipIcons = true; + var MSGWebSocketURL = "<%=MSGWebSocketURL%>"; var IsSupperAdmin =<%=IsSupperAdmin ?"true":"false"%>; var isAllowed = <%=CanAjdustAttr ?"true":"false"%>; @@ -950,7 +951,7 @@ $(".showall").click(null, function (e) { $("#selOnroad").val("-1"); - $("#selAttachment").val("0"); + $("#selAttachment").val("-1"); $('#txtMachineSearchText').val(""); $('#txtJobSiteSearchText').val(""); $('#txtAssetGroupSearchText').val(""); @@ -1156,9 +1157,8 @@ $('#sendlocation_otheremailaddress').val(''); $('#sendlocation_othertextaddress').val(''); $('#sendlocation_desc').val(''); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_sendlocation .dialog-title span.title').text(title); - //$('#mask_bg').show(); $('#dialog_sendlocation') .attr('act', 'edit') .css({ @@ -2043,24 +2043,24 @@ $('#dialog_parameter').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); pivotsDialogOpend = false; }); $('#dialog_sendlocation').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_requestvideo').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_addodometer').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_addenginehours').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialogadd_odometerdate').datetimepicker({ timepicker: false, format: 'm/d/Y', @@ -2081,15 +2081,15 @@ }); $('#dialog_importshapefile').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_lochis').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_assetattachments').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $("#dialog_timeperiod").change(null, function (e) { @@ -2272,7 +2272,7 @@ { name: 'DisplayName', caption: GetTextByKey("P_MV_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 148, 'text-align': 'left' } }, { name: 'ContactTypeName', caption: GetTextByKey("P_MV_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 148, 'text-align': 'left' } }, { name: 'Text', caption: GetTextByKey("P_MV_TEXT", "Text"), valueIndex: 'Text', type: 3, css: { 'width': 45, 'text-align': 'center' } }, - { name: 'Email', caption: GetTextByKey("P_MV_EMAIL", "Email"), valueIndex: 'Email', type: 3, css: { 'width': 55, 'text-align': 'center' } } + { name: 'Email', caption: GetTextByKey("P_MV_EMAIL", "Email"), valueIndex: 'Email', type: 3, css: { 'width': 60, 'text-align': 'center' } } ]; var columns = []; // head @@ -2343,9 +2343,8 @@ $('#sendlocation_desc').val('Fleet Intelligence on behalf of [site name]. [User Name] sent info to [jobsite]. Please do not reply to this text.'); else $('#sendlocation_desc').val(''); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_sendlocation .dialog-title span.title').text(title); - //$('#mask_bg').show(); $('#dialog_sendlocation').data("cid", cid) .attr('act', 'edit') .css({ @@ -2359,7 +2358,7 @@ var cid = $('#dialog_sendlocation').data("cid"); if (grid_dt.source.length == 0) { $('#dialog_sendlocation').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); return; } var title = ""; @@ -2412,7 +2411,7 @@ if (emailaddress.length == 0 && textaddress.length == 0) { $('#dialog_sendlocation').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); return; } @@ -2439,7 +2438,7 @@ _dialog.showAlert(data, GetTextByKey("P_MV_ERROR", 'Error')); $('#dialog_sendlocation').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); }, function (err) { if (_setype == 1) _dialog.showAlert(GetTextByKey("P_MV_FAILEDTOSENDJOBSITE", 'Failed to send jobsite.'), title); @@ -2712,9 +2711,9 @@ </div> <div style="margin-left: 10px;"> <select id="selAttachment" style="width: 120px;margin-left: 5px;"> - <option value="0" data-lgid="P_SELECT_ALL">All</option> + <option value="-1" data-lgid="P_SELECT_ALL">All</option> <option value="1" data-lgid="P_MV_ATTACHMENTSONLY">Attachments Only</option> - <option value="2" data-lgid="P_MV_NOATTACHMENTS">No Attachments</option> + <option value="0" data-lgid="P_MV_NOATTACHMENTS">No Attachments</option> </select> </div> </div> diff --git a/Site/MapView.aspx.cs b/Site/MapView.aspx.cs index 4561949..d2ebe44 100644 --- a/Site/MapView.aspx.cs +++ b/Site/MapView.aspx.cs @@ -16,6 +16,7 @@ public partial class MapView : MapViewBasePage public string LocationHistoryDateFrom = DateTime.Now.Date.AddMonths(-2).ToShortDateString(); public string LocationHistoryDateTo = DateTime.Now.Date.ToShortDateString(); public string CurrentDate = ""; + public string MSGWebSocketURL = ""; private string Logo1html = "<img class=\"logo\" src=\"{0}\" style=\"width:24px;height:24px; \" />"; protected string Logo1 = ""; @@ -38,6 +39,7 @@ public partial class MapView : MapViewBasePage } DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow); CurrentDate = userlocaldate.ToShortDateString(); + MSGWebSocketURL = SystemParams.WebSocketURL + "&msgcodes=200,201"; } private void GetLogoHtml(CustomerInfo cmp) diff --git a/Site/MapViewChart.aspx.cs b/Site/MapViewChart.aspx.cs index f7c64a3..97040df 100644 --- a/Site/MapViewChart.aspx.cs +++ b/Site/MapViewChart.aspx.cs @@ -158,7 +158,7 @@ public partial class MapViewChart : ContractorBasePage string companyid = ""; if (SystemParams.IsDealer) { - var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(); + var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(session.SessionID); AssetBasicInfo m = null; if (string.IsNullOrEmpty(machineid)) { @@ -191,10 +191,13 @@ public partial class MapViewChart : ContractorBasePage private string GetCompanyID(string machineid, string vin) { + var session = GetCurrentLoginSession(); + if (session == null) + return null; string companyid = ""; if (SystemParams.IsDealer) { - var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(); + var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(session.SessionID); AssetBasicInfo m = null; if (string.IsNullOrEmpty(machineid)) { diff --git a/Site/OTRConfig/ManageHarshDriving.aspx b/Site/OTRConfig/ManageHarshDriving.aspx index a97a460..2364f2d 100644 --- a/Site/OTRConfig/ManageHarshDriving.aspx +++ b/Site/OTRConfig/ManageHarshDriving.aspx @@ -41,18 +41,6 @@ padding: 0; } - #dialog_user_group { - z-index: 500; - width: 800px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - #dialog_group_description { padding: 2px; height: 60px; diff --git a/Site/OTRConfig/ManageSpeeding.aspx b/Site/OTRConfig/ManageSpeeding.aspx index b1acc2a..5c35d6f 100644 --- a/Site/OTRConfig/ManageSpeeding.aspx +++ b/Site/OTRConfig/ManageSpeeding.aspx @@ -41,18 +41,6 @@ padding: 0; } - #dialog_user_group { - z-index: 500; - width: 800px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - #dialog_group_description { padding: 2px; height: 60px; diff --git a/Site/OTRConfig/OTRConfig.master b/Site/OTRConfig/OTRConfig.master index 185ebfa..3b76d00 100644 --- a/Site/OTRConfig/OTRConfig.master +++ b/Site/OTRConfig/OTRConfig.master @@ -62,7 +62,6 @@ function resizeContent() { if ($('.content_main').length > 0) $('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4); - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); } $(window).resize(function () { diff --git a/Site/Security/AddUser.aspx b/Site/Security/AddUser.aspx index e97728a..5ef3e56 100644 --- a/Site/Security/AddUser.aspx +++ b/Site/Security/AddUser.aspx @@ -140,7 +140,7 @@ line-height: 30px; margin-left: 20px; margin-bottom: 15px; - width: 1000px !important; + width: 860px !important; table-layout: fixed; } @@ -211,6 +211,30 @@ var editableSelectMachine; var loadingCount = 0; + function showmaskbg1(flag, noanimation) { + if (window.parent && typeof window.parent.onmaskbg == 'function') { + window.parent.onmaskbg(flag, noanimation); + } + $('#mask_bg').children().hide(); + if (noanimation) { + $('#mask_bg').css('display', flag ? '' : 'none'); + } else { + if (flag) { + $('#mask_bg').fadeIn(100); + } else { + $('#mask_bg').fadeOut(100); + } + } + } + + function showAlert(msg, title, icon, next) {//覆盖FIC的showAlert + if (window.parent && typeof window.parent.showalert == 'function') { + window.parent.showalert(msg, title, icon, next); + } else { + _dialog.showAlert(msg, title, icon, next); + } + } + function userrequest(method, param, callback, error) { _network.request("Security/AddUser.aspx", -1, method, param, callback, error || function (e) { console.log(e); @@ -341,6 +365,8 @@ function OnAdd() { avatarFile = null; + $("#btnNext").hide(); + $("#btnPrevious").hide(); $('#span_tooltip').css('padding-top', 70); $('#dialog_user_id').prop('disabled', false).val(''); $('#dialog_avatar').attr('src', _network.root + "titlelogo.ashx?tp=avatar&uid=0"); @@ -408,7 +434,7 @@ } var u = data; user = data; - useritem = { IID: { Value: uid }, ExcelExports: true }; + useritem = { IID: { Value: uid }, CanExportFile: true }; $('#dialog_user_id').prop('disabled', true).val(u.ID); $('#dialog_avatar').attr('src', _network.root + "titlelogo.ashx?tp=avatar&uid=" + uid + "&sn=" + Math.random()); $('#dialog_user_name').val(u.DisplayName); @@ -420,7 +446,7 @@ 'disabled': isMyself(u.IID) }); $('#dialog_excelexports').on('change', function (e) { - useritem.ExcelExports = $(this).prop('checked'); + useritem.CanExportFile = $(this).prop('checked'); }); $('#dialog_isuser').prop({ 'checked': u.IsUser, @@ -892,6 +918,7 @@ uid = data[0]; init(uid); } + reloadsubscribe(); if (userfiltertemplateloaded) getUserFilterData(); if (assignmenloaded) {//assignment保存后,需要情况Filter的数据源 @@ -930,7 +957,7 @@ } $("#dialog_workorderfollower").prop("checked", data.WorkOrderFollower); $("#dialog_excelexports").prop("checked", data.ExcelExports); - useritem.ExcelExports = data.ExcelExports; + useritem.CanExportFile = data.ExcelExports; $("#dialog_accessallassets").prop("checked", data.AccessAllAssets); if (data.AccessAllAssets) { $('#tab_assignment .iconadd').hide(); @@ -1004,15 +1031,15 @@ $('#tab_header_subscribe').show(); //$('#tab_header_security').show(); $('#tab_header_email').show(); - $('#tab_header_filter').show(); - if (!IsDealer) + if (!IsDealer) { $('.cononly').show(); + $('#tab_header_filter').show(); + } + else + $('#tab_header_filter').hide(); // prepare subscribe message - var subscribe = new $subscribeMSGpanel(); - subscribe.append($('#subscribe_message').empty(), uid, -1, null, true, 450); - //$('#subscribe_message').applyLanguageText(true); - scriber = subscribe; + reloadsubscribe(); OnEdit(); } @@ -1024,7 +1051,7 @@ //$('#tab_header_security').hide(); $('#tab_header_email').hide(); $('#tab_header_filter').hide(); - if (!IsDealer) + if (!IsDealer) $('.cononly').show(); } $('#tab_header_info').click(); @@ -1033,6 +1060,13 @@ assignmenloaded = false; } + function reloadsubscribe() { + var subscribe = new $subscribeMSGpanel(); + subscribe.append($('#subscribe_message').empty(), uid, -1, null, true, 450); + //$('#subscribe_message').applyLanguageText(true); + scriber = subscribe; + } + function getUsers() { userrequest("GetUsers", JSON.stringify([-1, ""]), function (data) { var users = []; @@ -1724,7 +1758,8 @@ for (var j = 0; j < feature.AvailablePermissions.length; j++) { var pm = feature.AvailablePermissions[j]; - td = $('<td style="width: 170px;text-align:right;"></td>'); + td = $('<td style="text-align:right;"></td>'); + td.css('width', (j == 1 || j == 2) ? 170 : 130); tr.append(td); var name = ""; if (pm === 0) @@ -1756,7 +1791,8 @@ td.append(ipt); } for (var k = feature.AvailablePermissions.length; k < 4; k++) {//目前最多4列,不足4列的补齐4列 - td = $('<td style="width: 170px;text-align:right;"></td>'); + td = $('<td></td>'); + td.css('width', (k == 1 || k == 2) ? 170 : 130); tr.append(td); } $("input:radio[name='feature_" + feature.Id + "'][value='" + features[i].Item2[0] + "']").prop("checked", true); @@ -1897,7 +1933,7 @@ $('#dialog_allowloginintoinspectmobile').prop('checked', false); $('#dialog_allowloginintofleetmobile').prop('checked', false); $('#dialog_mobileappbarcodescanner').prop('checked', false); - $('#dialog_excelexports').prop('checked', false); + //$('#dialog_excelexports').prop('checked', false); } else { $('.tr_otheronly').show(); @@ -2049,9 +2085,6 @@ </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 500;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="function_title"> <span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_UM_SAVE">Save</span> <span class="sbutton iconsave" onclick="OnSave(1);" data-lgid="P_UM_SAVE1">Save and Exit</span> @@ -2072,7 +2105,7 @@ <li id="tab_header_email" data-href="tab_email" onclick="reshowgrid()" data-lgid="P_UM_EMAILSUBSCRIBING">Email Subscribing</li> <li id="tab_header_assignment" data-href="tab_assignment" class="cononly" onclick="onassignmentclick()" data-lgid="P_UM_ASSETASSIGNMENT" style="display: none;">Asset Assignment</li> <li id="tab_header_message" data-href="tab_message" class="cononly" style="display: none;" data-lgid="P_UM_XXX">SMS Messages</li> - <li id="tab_header_filter" data-href="tab_filter" onclick="onuserfilterclick()" data-lgid="P_XXXX">Asset Alert Filter Templates</li> + <li id="tab_header_filter" data-href="tab_filter" onclick="onuserfilterclick()" data-lgid="P_XXXX" style="display: none;">Asset Alert Filter Templates</li> </ul> <div id="tab_userinfo" data-page="tab_userinfo"> <div id="div_userinfo" style="overflow: auto; min-width: 800px;"> @@ -2197,7 +2230,7 @@ <tr id="tr_hourlyrate" style="display: none;"> <td class="label" data-lgid="P_UM_HOURLYRATE_COLON">Hourly Rate ($):</td> <td> - <input type="text" id="dialog_hourlyrate" class="inputbox" maxlength="7" tabindex="11" autocomplete="off" /></td> + <input type="text" id="dialog_hourlyrate" maxlength="7" tabindex="11" autocomplete="off" /></td> </tr> <tr> <td class="label" data-lgid="P_UM_EMPLOYEEIDORFOB_COLON">Employee ID or FOB:</td> @@ -2315,7 +2348,7 @@ <div id="subscribe_message" style="overflow: auto; position: relative; padding-left: 50px; min-width: 1045px;"></div> </div> <div id="tab_security" data-page="tab_security" style="display: none"> - <div id="security_message" style="position: relative; padding-left: 100px; overflow: auto; min-width: 800px;"> + <div id="security_message" style="position: relative; padding-left: 20px; overflow: auto; min-width: 800px;"> </div> </div> <div id="tab_email" data-page="tab_email" style="display: none"> @@ -2412,7 +2445,7 @@ <div id="div_filter" style="overflow: auto; min-width: 800px;"> <div style="margin: 9px 6px 10px 6px;"> <span class="title" data-lgid="P_XXXX">Filter Templates:</span> - <select id="sel_filtertemplate" style="width: 300px;"></select> + <select id="sel_filtertemplate" style="width: 300px; height: 20px;"></select> <span class="sbutton iconadd" onclick="onOpenFilterTemplate(0);" data-lgid="P_UM_ADD"></span> <span class="sbutton iconedit" onclick="onOpenFilterTemplate(1);" data-lgid="P_UM_EDIT"></span> <span class="sbutton iconcopy" onclick="onOpenFilterTemplate(2);" data-lgid="P_IPT_COPY"></span> @@ -2461,6 +2494,9 @@ </div> </div> </div> + <div id="dialogmask" class="maskbg" style="display: none;"> + <div class="loading_icon icon c-spin"></div> + </div> </div> <div id="mask_bg" style="display: none;"> <div class="loading c-spin"></div> @@ -2477,7 +2513,7 @@ <div id="availableassetgrouplist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetSelectAssetGroups();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div class="clear"></div> </div> @@ -2495,7 +2531,7 @@ <div id="availablejobsitelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetSelectJobSites();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -2512,7 +2548,7 @@ <div id="availableassettypelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetSelectAssetTypes();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -2529,7 +2565,7 @@ <div id="availablefilterassetgrouplist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectAssetGroups();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div class="clear"></div> </div> @@ -2547,7 +2583,7 @@ <div id="filteravailablejobsitelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectJobSites();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -2564,7 +2600,7 @@ <div id="filteravailableassettypelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectAssetTypes();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -2582,7 +2618,7 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterTemplate();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> diff --git a/Site/Security/CurfewManage.aspx b/Site/Security/CurfewManage.aspx index 471690d..1e5bb29 100644 --- a/Site/Security/CurfewManage.aspx +++ b/Site/Security/CurfewManage.aspx @@ -77,18 +77,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } @@ -207,16 +195,6 @@ margin-bottom: 1px; vertical-align: middle; } - - .machine_maskbg { - top: 0; - left: 0; - width: 100%; - height: 100%; - position: absolute; - background: #000; - opacity: 0.2; - } </style> <script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script> <script> @@ -504,12 +482,12 @@ /*************************************************************************/ function OnMachineAdd() { showmaskbg(true); + $("#dialogmask").show().children().hide(); dialogAssets.exceptSource = grid_dtsm.innerSource.map(function (s) { return s.Values.ID; }); dialogAssets.companyId = $('#sel_contractor').val(); dialogAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } var allMachines; @@ -523,7 +501,7 @@ var title = GetTextByKey("P_CM_ASSETASSIGNMENT", 'Asset Assignment');// + " " + jobsite.Name + " " + "Radius_UOM: " + jobsite.Radius_UOM $('#dialog_managemahchine .dialog-title span.title').html(title); - $('.machine_maskbg').show(); + showmaskbg(true); $('#dialog_managemahchine') .attr('init', 1) .css({ @@ -670,7 +648,7 @@ // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -763,7 +741,7 @@ var title = GetTextByKey("P_CM_JOBSITEASSIGNMENT", "Jobsite Assignment"); $('#dialog_managejobsite .dialog-title span.title').html(title); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_managejobsite') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_managejobsite').height()) / 5, @@ -1066,7 +1044,7 @@ }); $('#dialog_managemahchine').dialog(function () { - $('.machine_maskbg').hide(); + showmaskbg(false); }); $('#dialog_managejobsite').dialog(function () { @@ -1100,7 +1078,7 @@ dialogAssets = new $assetselector('dialog_machines'); dialogAssets.onDialogClosed = function () { - showmaskbg(false); + $("#dialogmask").hide(); }; dialogAssets.onOK = function (source) { var items = []; @@ -1124,9 +1102,8 @@ curfewid, JSON.stringify(items.map(function (f) { return f.Values.ID; })) ]; - $("#dialogmask").show(); + $("#dialogmask").show().children().show(); curfewquery('AssignAssetsToUser', params.join(String.fromCharCode(170)), function (r) { - showmaskbg(false); $("#dialogmask").hide(); if (r === 'OK') { grid_dtsm.setData(grid_dtsm.innerSource.concat(items)); @@ -1162,14 +1139,13 @@ <div class="clear"></div> <div id="curfewlist"></div> - <div class="machine_maskbg" style="display: none;"></div> + <div id="mask_bg" style="display: none;"> + <div class="loading c-spin"></div> + </div> <div class="dialog" id="dialog_managemahchine" style="display: none;"> - <div id="dialogmask" class="maskbg" style="display: none; z-index: 1;"> - <div class="loading_icon icon c-spin"></div> - </div> <div class="dialog-title"><span class="title" data-lgid="P_CM_ASSETASSIGNMENT">Asset Assignment</span><em class="dialog-close"></em></div> - <div class="machine_filter" style="display: none"> + <div class="machine_filter" style="display: none;"> <span data-lgid="P_CM_TYPE_COLON">Type: </span> <select id="sel_machine_type" tabindex="20"></select> <input type="text" id="txt_machine_key" tabindex="21" /> @@ -1206,11 +1182,11 @@ <input type="button" onclick="OnSaveMachines();" value="OK" data-lgid="P_CM_OK" tabindex="27" style="display: none" /> <div class="clear"></div> </div> + <div id="dialogmask" class="maskbg" style="display: none;"> + <div class="loading_icon icon c-spin"></div> + </div> </div> - <div id="mask_bg" style="display: none;"> - <div class="loading c-spin"></div> - </div> <div class="dialog" id="dialog_curfew" style="display: none; height: 100%; border-bottom: 0; border-top: 0;"> <iframe id="iframecurfew" src="AddCurfew.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe> <div class="maskbg" style="display: none;"></div> @@ -1222,7 +1198,7 @@ </div> <div class="dialog-title"><span class="title" data-lgid="P_CM_JOBSITEASSIGNMENT">Jobsite Assignment</span><em class="dialog-close"></em></div> - <div class="machine_filter"> + <div class="machine_filter" style="margin: 9px 6px 7px"> <input type="text" id="txt_jobsite_key" style="margin-left: 8px; width: 280px;" tabindex="40" /> <input type="button" class="ybutton" id="button_jobsite_filter" data-lgid="P_CM_FILTER" value="Filter" tabindex="42" /> </div> diff --git a/Site/Security/CurfewMovementTolerance.aspx b/Site/Security/CurfewMovementTolerance.aspx index 4c682a6..39c6c57 100644 --- a/Site/Security/CurfewMovementTolerance.aspx +++ b/Site/Security/CurfewMovementTolerance.aspx @@ -73,18 +73,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } diff --git a/Site/Security/Security.master b/Site/Security/Security.master index aed9b3c..6d01f1f 100644 --- a/Site/Security/Security.master +++ b/Site/Security/Security.master @@ -76,7 +76,6 @@ function resizeContent() { if ($('.content_main').length > 0) $('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4); - $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); } $(window).resize(function () { diff --git a/Site/Security/UserGroup.aspx b/Site/Security/UserGroup.aspx index 0f486d3..092709c 100644 --- a/Site/Security/UserGroup.aspx +++ b/Site/Security/UserGroup.aspx @@ -41,22 +41,6 @@ padding: 0; } - #dialog_user_group { - z-index: 500; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - - #dialog_group_description { - padding: 2px; - height: 60px; - } - .group_table .main_table thead tr { display: block; } @@ -90,10 +74,13 @@ line-height: 30px; margin-left: 20px; margin-bottom: 15px; + width: 860px !important; + table-layout: fixed; } .td_module { - width: 200px; + width: 220px; + font-weight: bold; } .label { /*cover tab.css*/ @@ -700,46 +687,96 @@ $('#security_message').append(div); createFeatures(ft.Features); } + WOFeaturesChange(); } + function createFeatures(features) { var nonetext = GetTextByKey("P_UM_NONE", "None"); var readonlytext = GetTextByKey("P_UM_READONLY", "Read Only"); var fullcontroltext = GetTextByKey("P_UM_FULLCONTROL", "Full Control"); var requestonlytext = GetTextByKey("P_UM_REQUESTONLY", "Request Only"); - var tb = $('<table class="table_module" style="width:640px;"></table>'); + var mywotext = GetTextByKey("P_UM_XXX", "My Work Orders"); + var locdeptext = GetTextByKey("P_UM_XXX", "My Location Or Department"); + var tb = $('<table class="table_module" ></table>'); $('#security_message').append(tb); for (var i = 0; i < features.length; i++) { var feature = features[i].Item1; var tr = $('<tr></tr>'); tb.append(tr); var td = $('<td class="td_module"></td>').text(feature.CurrentName); + if ([239, 252, 253, 254, 255, 256, 257].indexOf(feature.Id) >= 0) + td.css('padding-left', 30); tr.append(td); for (var j = 0; j < feature.AvailablePermissions.length; j++) { var pm = feature.AvailablePermissions[j]; - td = $('<td style="width: 100px;"></td>'); + td = $('<td style="text-align:right;"></td>'); + td.css('width', (j == 1 || j == 2) ? 170 : 130); tr.append(td); var name = ""; if (pm === 0) name = nonetext; else if (pm === 1) name = readonlytext; + else if (pm === 2) + name = mywotext; else if (pm === 10) name = requestonlytext; + else if (pm === 11) { + name = locdeptext; + td.css('width', 170); + } else if (pm === 99999) name = fullcontroltext; var lab = $('<label></label>').text(name); td.append(lab); var ipt = $('<input type="radio" class="featureradio" />').attr('name', 'feature_' + feature.Id).val(pm).data('featureid', feature.Id); + ipt.change(function () { + WOFeaturesChange(); + }); td.append(ipt); } + + for (var k = feature.AvailablePermissions.length; k < 4; k++) {//目前最多4列,不足4列的补齐4列 + td = $('<td></td>'); + td.css('width', (k == 1 || k == 2) ? 170 : 130); + tr.append(td); + } $("input:radio[name='feature_" + feature.Id + "'][value='" + features[i].Item2[0] + "']").prop("checked", true); td = $('<td></td>'); tr.append(td); } } + function WOFeaturesChange() { + var wopermission = $("input:radio[name='feature_210']:checked").val(); + wopermission = parseInt(wopermission); + if (wopermission === 0) { + $("input:radio[name='feature_253']").prop("disabled", true); + $("input:radio[name='feature_254']").prop("disabled", true); + $("input:radio[name='feature_252']").prop("disabled", true); + $("input:radio[name='feature_255']").prop("disabled", true); + $("input:radio[name='feature_256']").prop("disabled", true); + $("input:radio[name='feature_239']").prop("disabled", true); + } + else if (wopermission === 1) { + $("input:radio[name='feature_253']").prop("disabled", false); + $("input:radio[name='feature_254']").prop("disabled", false); + $("input:radio[name='feature_252']").prop("disabled", true); + $("input:radio[name='feature_255']").prop("disabled", true); + $("input:radio[name='feature_256']").prop("disabled", true); + $("input:radio[name='feature_239']").prop("disabled", true); + } + else if (wopermission === 99999) { + $("input:radio[name='feature_253']").prop("disabled", false); + $("input:radio[name='feature_254']").prop("disabled", false); + $("input:radio[name='feature_252']").prop("disabled", false); + $("input:radio[name='feature_255']").prop("disabled", false); + $("input:radio[name='feature_256']").prop("disabled", false); + $("input:radio[name='feature_239']").prop("disabled", false); + } + } /**************************End Security********************************/ /*****************************************************************************/ @@ -776,7 +813,7 @@ <div id="mask_bg" style="display: none;"> <div class="loading c-spin"></div> </div> - <div class="dialog" id="dialog_user_group" style="display: none; z-index: 500; width: 840px;"> + <div class="dialog" id="dialog_user_group" style="display: none; width: 950px;"> <div class="dialog-title"><span class="title" data-lgid="P_UG_ADDUSERGROUP">Add User Group</span><em class="dialog-close"></em></div> <div class="dialog-content"> <div id="div_container"> @@ -790,12 +827,12 @@ <tr style="height: 27px;"> <td class="label" data-lgid="P_UG_USERGROUPNAME_COLON">User Group Name:</td> <td> - <input type="text" class="inputbox" id="dialog_group_name" tabindex="1" maxlength="100" /></td> + <input type="text" id="dialog_group_name" style="padding: 2px; width:320px;" tabindex="1" maxlength="100" /></td> </tr> <tr> <td class="label" data-lgid="P_UG_DESCRIPTION_COLON">Description:</td> <td> - <textarea class="inputbox" id="dialog_group_description" tabindex="2" maxlength="200"></textarea></td> + <textarea id="dialog_group_description" style="padding: 2px; height: 60px; width:320px;" tabindex="2" maxlength="200"></textarea></td> </tr> </table> <div class="dialog-subheader" data-lgid="P_UG_GROUPMEMBERS">Group Members</div> @@ -826,7 +863,7 @@ </table> </div> <div id="tab_security" data-page="tab_security" style="display: none"> - <div id="security_message" style="padding-left: 50px; height: 440px; overflow: auto;"> + <div id="security_message" style="padding-left: 20px; height: 440px; overflow: auto;"> </div> </div> <div class="mask_loading dialog" style="display: none;"></div> diff --git a/Site/Security/UserManage.aspx b/Site/Security/UserManage.aspx index 3d87a03..7103e5a 100644 --- a/Site/Security/UserManage.aspx +++ b/Site/Security/UserManage.aspx @@ -71,18 +71,6 @@ padding: 0; } - #dialog_machinegroup { - z-index: 500; - width: 870px; - top: 60px; - left: 150px; - } - - .inputbox { - width: 500px; - padding: 1px; - } - .group_table .main_table { table-layout: fixed; } @@ -1501,7 +1489,7 @@ if (v) { isSelect = true; copyuseriid = v.IID; - $('#mask_bg').show(); + showmaskbg(true); $('#tr_copyuser').hide(); $('#dialog_copy_user') .css({ @@ -1512,7 +1500,7 @@ } else { isSelect = false; - $('#mask_bg').show(); + showmaskbg(true); $('#tr_copyuser').show(); var source = []; if (isalluser) { diff --git a/Site/Security/js/adduser.js b/Site/Security/js/adduser.js index 5fc4f86..adb6d41 100644 --- a/Site/Security/js/adduser.js +++ b/Site/Security/js/adduser.js @@ -12,7 +12,7 @@ $(function () { dialogAUAssets.allowhidden = false; dialogAUAssets.allowotherfilter = false; dialogAUAssets.onDialogClosed = function () { - showbg(false);//showmaskbg被FIC里面的覆盖,使用FIC中的showbg + showmaskbg1(false);//showmaskbg被FIC里面的覆盖,使用FIC中的showmaskbg1 }; dialogAUAssets.onOK = function (source) { var items = []; @@ -32,19 +32,19 @@ $(function () { } } grid_dtassets.setData(grid_dtassets.innerSource.concat(items)); - showbg(false); + showmaskbg1(false); }; $('#dialog_assetgroup').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_jobsite').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_assettype').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $("#txt_assetgroup_key").keypress(onAssetGroupKeyPress); @@ -91,7 +91,7 @@ function InitGridSelectedMachines() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -160,12 +160,11 @@ function OnAssetAdd() { } function OnAssetAdd1() { - showbg(true); + showmaskbg1(true); dialogAUAssets.exceptSource = grid_dtassets.innerSource.map(function (s) { return s.Values.ID; }); dialogAUAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } function OnMachineDelete() { @@ -225,7 +224,7 @@ function InitGridSelectedMachineGroups() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -289,7 +288,7 @@ function InitGridAvailableMachineGroups() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -408,7 +407,7 @@ function OnAssetGroupAdd() { function OnAssetGroupAdd1() { $('#txt_assetgroup_key').val(''); $('#dialog_assetgroup .dialog-title span.title').text(GetTextByKey("P_UM_SELECTASSETGROUPS", 'Select Asset Groups')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_assetgroup') .attr('act', 'edit') .css({ @@ -431,7 +430,7 @@ function OnSetSelectAssetGroups() { } showSelectedMachineGroup(_selectedAssetGroups); $('#dialog_assetgroup').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnAssetGroupDelete() { @@ -474,7 +473,7 @@ function InitGridSelectedJobsites() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -539,7 +538,7 @@ function InitGridAvailableJobsites() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -665,7 +664,7 @@ function OnJobsiteAdd() { function OnJobsiteAdd1() { $('#txt_jobsite_key').val(''); $('#dialog_jobsite .dialog-title span.title').text(GetTextByKey("P_UM_SELECTJOBSITES", 'Select Jobsites')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_jobsite') .attr('act', 'edit') .css({ @@ -687,7 +686,7 @@ function OnSetSelectJobSites() { } showSelectedJobsite(_selectedJobsites); $('#dialog_jobsite').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnJobsiteDelete() { @@ -732,7 +731,7 @@ function InitGridSelectedAssetTypes() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -797,7 +796,7 @@ function InitGridAvailableAssetTypes() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -923,7 +922,7 @@ function OnAssetTypeAdd() { function OnAssetTypeAdd1() { $('#txt_assettype_key').val(''); $('#dialog_assettype .dialog-title span.title').text(GetTextByKey("P_UM_SELECTASSETTYPES", 'Select Asset Types')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_assettype') .attr('act', 'edit') .css({ @@ -945,7 +944,7 @@ function OnSetSelectAssetTypes() { } showSelectedAssetType(_selectedAssetTypes); $('#dialog_assettype').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnAssetTypeDelete() { diff --git a/Site/Security/js/userfilter.js b/Site/Security/js/userfilter.js index 6a59f96..8985569 100644 --- a/Site/Security/js/userfilter.js +++ b/Site/Security/js/userfilter.js @@ -13,7 +13,7 @@ $(function () { dialogFUAssets.allowotherfilter = false; dialogFUAssets.uid = uid; dialogFUAssets.onDialogClosed = function () { - showbg(false);//showmaskbg被FIC里面的覆盖,使用FIC中的showbg + showmaskbg1(false);//showmaskbg被FIC里面的覆盖,使用showmaskbg1 }; dialogFUAssets.onOK = function (source) { var items = []; @@ -58,23 +58,23 @@ $(function () { } grid_dtfilterassets.setData(grid_dtfilterassets.innerSource.concat(items)); - showbg(false); + showmaskbg1(false); }; $('#dialog_filterassetgroup').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_filterjobsite').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_filterassettype').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_filtertemplate').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $("#sel_filtertemplate").change(function () { @@ -121,7 +121,7 @@ function InitGridFilterSelectedAssets() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -173,13 +173,12 @@ function OnFilterAssetAdd() { if (!filterid) return; - showbg(true); + showmaskbg1(true); dialogFUAssets.uid = uid; dialogFUAssets.exceptSource = grid_dtfilterassets.innerSource.map(function (s) { - return s.Values.ID; + return s.Values.ID || s.Values.Id; }); dialogFUAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } function OnFilterMachineDelete() { @@ -228,7 +227,7 @@ function InitGridFilterSelectedAssetGroups() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -292,7 +291,7 @@ function InitGridFilterAvailableAssetGroups() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -398,7 +397,7 @@ function OnFilterAssetGroupAdd() { return; $('#txt_filterassetgroup_key').val(''); $('#dialog_filterassetgroup .dialog-title span.title').text(GetTextByKey("P_UM_SELECTASSETGROUPS", 'Select Asset Groups')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filterassetgroup') .attr('act', 'edit') .css({ @@ -434,7 +433,7 @@ function OnSetFilterSelectAssetGroups() { showFilterSelectedAssetGroup(assetgroups); $('#dialog_filterassetgroup').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnFilterAssetGroupDelete() { @@ -482,7 +481,7 @@ function InitGridFilterSelectedJobsites() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -547,7 +546,7 @@ function InitGridFilterAvailableJobsites() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -656,7 +655,7 @@ function OnFilterJobsiteAdd() { $('#txt_filterjobsite_key').val(''); $('#dialog_filterjobsite .dialog-title span.title').text(GetTextByKey("P_UM_SELECTJOBSITES", 'Select Jobsites')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filterjobsite') .attr('act', 'edit') .css({ @@ -692,7 +691,7 @@ function OnSetFilterSelectJobSites() { showFilterSelectedJobsite(jobsites); $('#dialog_filterjobsite').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnFilterJobsiteDelete() { @@ -742,7 +741,7 @@ function InitGridFilterSelectedAssetTypes() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -807,7 +806,7 @@ function InitGridFilterAvailableAssetTypes() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -917,7 +916,7 @@ function OnFilterAssetTypeAdd() { $('#txt_filterassettype_key').val(''); $('#dialog_filterassettype .dialog-title span.title').text(GetTextByKey("P_UM_SELECTASSETTYPES", 'Select Asset Types')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filterassettype') .attr('act', 'edit') .css({ @@ -954,7 +953,7 @@ function OnSetFilterSelectAssetTypes() { showFilterSelectedAssetType(assettypes); $('#dialog_filterassettype').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnFilterAssetTypeDelete() { @@ -1069,7 +1068,7 @@ function OnAddFilterTemplate() { tile = GetTextByKey('P_XXXX', 'Copy Filter Template'); $('#dialog_filtertemplate .dialog-title span.title').text(tile); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filtertemplate') .attr('act', 'add') .css({ @@ -1084,7 +1083,7 @@ function OnEditFilterTemplate() { $('#dialog_filtertemplatename').val(''); $('#dialog_filtertemplate .dialog-title span.title').text(GetTextByKey('P_XXXX', 'Edit Filter Template')); var tempname = $('#sel_filtertemplate').find("option:selected").text(); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filtertemplate') .attr('act', 'edit') .css({ @@ -1129,7 +1128,7 @@ function OnSetFilterTemplate() { } $('#dialog_filtertemplate').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } diff --git a/Site/Security/js/usermanage.js b/Site/Security/js/usermanage.js index d9bbc60..cea402e 100644 --- a/Site/Security/js/usermanage.js +++ b/Site/Security/js/usermanage.js @@ -359,7 +359,7 @@ function InitGridSelectedMachines() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, diff --git a/Site/SystemSettings/AssetAertFilter.aspx b/Site/SystemSettings/AssetAertFilter.aspx index b13be71..b7a2210 100644 --- a/Site/SystemSettings/AssetAertFilter.aspx +++ b/Site/SystemSettings/AssetAertFilter.aspx @@ -318,7 +318,7 @@ <div id="availablefilterassetgrouplist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectAssetGroups();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div class="clear"></div> </div> @@ -336,7 +336,7 @@ <div id="filteravailablejobsitelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectJobSites();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -353,7 +353,7 @@ <div id="filteravailableassettypelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectAssetTypes();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -371,7 +371,7 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterTemplate();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> diff --git a/Site/SystemSettings/ManageDepartments.aspx b/Site/SystemSettings/ManageDepartments.aspx index 19059d2..3116727 100644 --- a/Site/SystemSettings/ManageDepartments.aspx +++ b/Site/SystemSettings/ManageDepartments.aspx @@ -373,7 +373,7 @@ <tr> <td class="label" data-lgid="P_SET_NOTES_COLON">Notes:</td> <td> - <textarea id="dialog_notes" class="inputbox" maxlength="1000" tabindex="1" style="width: 320px;"></textarea></td> + <textarea id="dialog_notes" maxlength="1000" tabindex="1" style="width: 320px;"></textarea></td> </tr> </table> </div> diff --git a/Site/SystemSettings/ManageLocations.aspx b/Site/SystemSettings/ManageLocations.aspx index 285894f..1682f1d 100644 --- a/Site/SystemSettings/ManageLocations.aspx +++ b/Site/SystemSettings/ManageLocations.aspx @@ -508,6 +508,7 @@ $('#dialog_selectlocation').dialog(function () { if (!$("#dialog_location").is(":visible")) showmaskbg(false); + $('#dialog_location').find('.maskbg').hide(); }); $('#searchinputtxt').keydown(searchEnter); @@ -557,6 +558,7 @@ $('#dialog_selectlocation .dialog-title span.title').text(GetTextByKey("P_SET_SELECTLOCATION", "Select Location")); showmaskbg(true); + $('#dialog_location').find('.maskbg').show(); d.css({ 'top': (document.documentElement.clientHeight - d.height()) / 3, 'left': (document.documentElement.clientWidth - d.width()) / 2 @@ -595,6 +597,7 @@ function OnSelectLocationOK() { $('#dialog_selectlocation').hideDialog(); + $('#dialog_location').find('.maskbg').hide(); var loc = mapctrl.getLocation(); if (locationdata) { locationdata.Latitude = loc[0]; @@ -763,7 +766,7 @@ <tr> <td class="label" data-lgid="P_SET_NOTES_COLON">Notes:</td> <td colspan="2"> - <textarea id="dialog_notes" class="inputbox" maxlength="1000" tabindex="6" style="width: 320px;"></textarea></td> + <textarea id="dialog_notes" maxlength="1000" tabindex="6" style="width: 320px;"></textarea></td> </tr> </table> </div> @@ -772,6 +775,7 @@ <input type="button" onclick="OnDialogOK();" value="OK" data-lgid="P_SET_OK" tabindex="7" /> <div class="clear"></div> </div> + <div class="maskbg" style="display: none;"></div> </div> <div class="dialog" id="dialog_selectlocation" style="display: none;"> diff --git a/Site/SystemSettings/ManageRegions.aspx b/Site/SystemSettings/ManageRegions.aspx index f46c31a..0239c66 100644 --- a/Site/SystemSettings/ManageRegions.aspx +++ b/Site/SystemSettings/ManageRegions.aspx @@ -413,7 +413,7 @@ <tr> <td class="label" data-lgid="P_SET_NOTES_COLON">Notes:</td> <td> - <textarea id="dialog_notes" class="inputbox" maxlength="1000" tabindex="1" style="width: 320px;"></textarea></td> + <textarea id="dialog_notes" maxlength="1000" tabindex="1" style="width: 320px;"></textarea></td> </tr> </table> </div> diff --git a/Site/SystemSettings/SettingColors.aspx b/Site/SystemSettings/SettingColors.aspx index dd06824..a7be827 100644 --- a/Site/SystemSettings/SettingColors.aspx +++ b/Site/SystemSettings/SettingColors.aspx @@ -304,7 +304,7 @@ IsDefault: $('#isdefault').is(':checked'), UIStyleID: $('#styleID').text() == "" ? -1 : parseInt($('#styleID').text()), - UIStyleName: encodeURIComponent($.trim($('#stylename_input').val())) + UIStyleName: htmlencode($.trim($('#stylename_input').val())) }; if (!iscolorStr(styledata.ChartTitleBackgroundColor)) { diff --git a/Site/SystemSettings/SystemParams.aspx b/Site/SystemSettings/SystemParams.aspx index af7ba01..44fdd9f 100644 --- a/Site/SystemSettings/SystemParams.aspx +++ b/Site/SystemSettings/SystemParams.aspx @@ -159,7 +159,7 @@ <table> <tr> <td> - <textarea id="dialog_paramvalue" class="inputbox" tabindex="1" style="width: 475px; height: 200px;"></textarea></td> + <textarea id="dialog_paramvalue" tabindex="1" style="width: 475px; height: 200px;"></textarea></td> </tr> </table> </div> diff --git a/Site/SystemSettings/UserOptions.aspx b/Site/SystemSettings/UserOptions.aspx index c0e4886..d4575be 100644 --- a/Site/SystemSettings/UserOptions.aspx +++ b/Site/SystemSettings/UserOptions.aspx @@ -195,6 +195,22 @@ var uid = '<%=IID%>'; var IsSupperAdmin =<%=IsSupperAdmin ?"true":"false"%>; + function showmaskbg1(flag, noanimation) { + if (window.parent && typeof window.parent.onmaskbg == 'function') { + window.parent.onmaskbg(flag, noanimation); + } + $('#mask_bg').children().hide(); + if (noanimation) { + $('#mask_bg').css('display', flag ? '' : 'none'); + } else { + if (flag) { + $('#mask_bg').fadeIn(100); + } else { + $('#mask_bg').fadeOut(100); + } + } + } + function requestFIC(service, method, param, callback, error) { $.ajax({ url: _network.root + 'fic/fic/FICSvc.ashx?fmt=json&SN=' + Math.random(), @@ -508,7 +524,7 @@ <div id="tab_filter" data-page="tab_filter" style="display: none;"> <div style="margin: 9px 6px 20px"> <span class="title" data-lgid="P_XXXX">Filter Templates:</span> - <select id="sel_filtertemplate" style="width: 300px;"></select> + <select id="sel_filtertemplate" style="width: 300px; height: 20px;"></select> <span class="sbutton iconadd" onclick="onOpenFilterTemplate(0);" data-lgid="P_UM_ADD"></span> <span class="sbutton iconedit" onclick="onOpenFilterTemplate(1);" data-lgid="P_UM_EDIT"></span> <span class="sbutton iconcopy" onclick="onOpenFilterTemplate(2);" data-lgid="P_IPT_COPY"></span> @@ -571,7 +587,7 @@ <div id="availablefilterassetgrouplist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectAssetGroups();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> <div class="clear"></div> </div> @@ -589,7 +605,7 @@ <div id="filteravailablejobsitelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectJobSites();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -606,7 +622,7 @@ <div id="filteravailableassettypelist" style="height: 400px; width: 630px; margin: 10px 0 4px;"></div> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterSelectAssetTypes();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> @@ -624,7 +640,7 @@ </table> </div> <div class="dialog-func"> - <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" /> + <input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" /> <input type="button" onclick="OnSetFilterTemplate();" value="OK" data-lgid="P_UM_OK" tabindex="17" /> </div> <div class="maskbg" style="display: none;"></div> diff --git a/Site/SystemSettings/js/userfilter.js b/Site/SystemSettings/js/userfilter.js index 5aee5fa..ee77295 100644 --- a/Site/SystemSettings/js/userfilter.js +++ b/Site/SystemSettings/js/userfilter.js @@ -13,7 +13,7 @@ $(function () { dialogFUAssets.allowotherfilter = false; dialogFUAssets.uid = uid; dialogFUAssets.onDialogClosed = function () { - showbg(false);//showmaskbg被FIC里面的覆盖,使用FIC中的showbg + showmaskbg1(false); }; dialogFUAssets.onOK = function (source) { var items = []; @@ -58,23 +58,23 @@ $(function () { } grid_dtfilterassets.setData(grid_dtfilterassets.innerSource.concat(items)); - showbg(false); + showmaskbg1(false); }; $('#dialog_filterassetgroup').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_filterjobsite').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_filterassettype').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $('#dialog_filtertemplate').prop('iframe', true).dialog(function () { - showbg(false); + showmaskbg1(false); }); $("#sel_filtertemplate").change(function () { @@ -117,7 +117,7 @@ function InitGridFilterSelectedAssets() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -169,12 +169,11 @@ function OnFilterAssetAdd() { if (!filterid) return; - showbg(true); + showmaskbg1(true); dialogFUAssets.exceptSource = grid_dtfilterassets.innerSource.map(function (s) { return s.Values.ID; }); dialogFUAssets.showSelector(); - $('#mask_bg').css('height', '100%'); } function OnFilterMachineDelete() { @@ -223,7 +222,7 @@ function InitGridFilterSelectedAssetGroups() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -287,7 +286,7 @@ function InitGridFilterAvailableAssetGroups() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -392,14 +391,14 @@ function OnFilterAssetGroupAdd() { return; $('#txt_filterassetgroup_key').val(''); $('#dialog_filterassetgroup .dialog-title span.title').text(GetTextByKey("P_UM_SELECTASSETGROUPS", 'Select Asset Groups')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filterassetgroup') .attr('act', 'edit') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_filterassetgroup').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_filterassetgroup').width()) / 2 }) - .showDialog(); + .showDialogfixed(); GetFilerAssetGroupList(); } @@ -428,7 +427,7 @@ function OnSetFilterSelectAssetGroups() { showFilterSelectedAssetGroup(assetgroups); $('#dialog_filterassetgroup').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnFilterAssetGroupDelete() { @@ -476,7 +475,7 @@ function InitGridFilterSelectedJobsites() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -541,7 +540,7 @@ function InitGridFilterAvailableJobsites() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -649,14 +648,14 @@ function OnFilterJobsiteAdd() { $('#txt_filterjobsite_key').val(''); $('#dialog_filterjobsite .dialog-title span.title').text(GetTextByKey("P_UM_SELECTJOBSITES", 'Select Jobsites')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filterjobsite') .attr('act', 'edit') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_filterjobsite').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_filterjobsite').width()) / 2 }) - .showDialog(); + .showDialogfixed(); GetFilterJobsiteList(); } @@ -685,7 +684,7 @@ function OnSetFilterSelectJobSites() { showFilterSelectedJobsite(jobsites); $('#dialog_filterjobsite').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnFilterJobsiteDelete() { @@ -735,7 +734,7 @@ function InitGridFilterSelectedAssetTypes() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -800,7 +799,7 @@ function InitGridFilterAvailableAssetTypes() { // checkbox name: 'check', key: 'selected', - width: 30, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -909,14 +908,14 @@ function OnFilterAssetTypeAdd() { $('#txt_filterassettype_key').val(''); $('#dialog_filterassettype .dialog-title span.title').text(GetTextByKey("P_UM_SELECTASSETTYPES", 'Select Asset Types')); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filterassettype') .attr('act', 'edit') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_filterassettype').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_filterassettype').width()) / 2 }) - .showDialog(); + .showDialogfixed(); GetFilterAssetTypeList(); } @@ -946,7 +945,7 @@ function OnSetFilterSelectAssetTypes() { showFilterSelectedAssetType(assettypes); $('#dialog_filterassettype').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } function OnFilterAssetTypeDelete() { @@ -1058,14 +1057,14 @@ function OnAddFilterTemplate() { tile = GetTextByKey('P_XXXX', 'Copy Filter Template'); $('#dialog_filtertemplate .dialog-title span.title').text(tile); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filtertemplate') .attr('act', 'add') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_filtertemplate').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_filtertemplate').width()) / 2 }) - .showDialog(); + .showDialogfixed(); $('#dialog_filtertemplatename').focus(); } @@ -1073,14 +1072,14 @@ function OnEditFilterTemplate() { $('#dialog_filtertemplatename').val(''); $('#dialog_filtertemplate .dialog-title span.title').text(GetTextByKey('P_XXXX', 'Edit Filter Template')); var tempname = $('#sel_filtertemplate').find("option:selected").text(); - $('#mask_bg').show(); + showmaskbg1(true); $('#dialog_filtertemplate') .attr('act', 'edit') .css({ 'top': (document.documentElement.clientHeight - $('#dialog_filtertemplate').height()) / 3, 'left': (document.documentElement.clientWidth - $('#dialog_filtertemplate').width()) / 2 }) - .showDialog(); + .showDialogfixed(); $('#dialog_filtertemplatename').val(tempname).focus(); } @@ -1118,7 +1117,7 @@ function OnSetFilterTemplate() { } $('#dialog_filtertemplate').hideDialog(); - $('#mask_bg').hide(); + showmaskbg1(false); } diff --git a/Site/css/default.css b/Site/css/default.css index e0e1a44..e86dcda 100644 --- a/Site/css/default.css +++ b/Site/css/default.css @@ -184,13 +184,18 @@ input[type="checkbox"], input[type="radio"] { .maskbg { top: 0; left: 0; - right:0; - bottom:0; - position: fixed; + right: 0; + bottom: 0; background: #000; opacity: 0.2; /*margin: 0 4px;*/ - /*z-index: 500;*/ + /*z-index: unset !important;*/ +} +#mask_bg { + position: fixed; +} +.maskbg { + position: absolute; } .loading { @@ -406,7 +411,8 @@ input[type="checkbox"], input[type="radio"] { } .loading_icon:before { - content: '\e61a'; + font-family: 'Fontawesome'; + content: '\f021'; } .sorticonasc:before { @@ -854,6 +860,10 @@ input[type="checkbox"], input[type="radio"] { content: '\f0b0'; } +.iconwidget:before { + content: '\f1ea'; +} + .iconshare:before { content: '\f2b5'; } diff --git a/Site/css/override.css b/Site/css/override.css index 815d525..34af7d2 100644 --- a/Site/css/override.css +++ b/Site/css/override.css @@ -1,6 +1,7 @@ :root { --header-line-height: 26px; --header-border-color: #aaa; + --cell-border-color: #e0e0e0 } .data-grid .data-grid-header .data-column-header-split { @@ -81,7 +82,7 @@ } .data-grid, .data-grid input[type=text] { - font-size: 12px; + font-size: 12px; } .status-cell { @@ -94,6 +95,7 @@ overflow: hidden; text-overflow: ellipsis; } + .ui-grid { height: 100%; width: 100%; @@ -116,4 +118,10 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -} \ No newline at end of file +} + +.ui-popup-mask .ui-popup-container { + max-height: unset; + min-width: 200px; + max-width: unset; +} diff --git a/Site/css/panel.css b/Site/css/panel.css index 35a5d16..387f870 100644 --- a/Site/css/panel.css +++ b/Site/css/panel.css @@ -484,7 +484,7 @@ .lefttitlemenu_ul li { height: 32px; - line-height: 40px; + line-height: 32px; cursor: pointer; overflow: hidden; padding: 6px; @@ -526,7 +526,7 @@ width: 24px; height: 24px; margin: 0 auto; - margin-top: 8px; + margin-top: 5px; } .settingsicon { diff --git a/Site/css/playbar.css b/Site/css/playbar.css index 779e5a3..eabb541 100644 --- a/Site/css/playbar.css +++ b/Site/css/playbar.css @@ -10,7 +10,7 @@ .BarBeginTime { min-width: 40px; - max-width: 48px; + max-width: 50px; height: 20px; color: #fff; font-size: 12px; @@ -20,7 +20,7 @@ .TheBar { position: relative; - width: calc(100% - 140px); + width: calc(100% - 144px); margin-left: 2px; height: 4px; border-radius: 2px; @@ -83,7 +83,7 @@ .BarFinishTime { min-width: 40px; - max-width: 48px; + max-width: 50px; height: 20px; color: #fff; font-size: 12px; diff --git a/Site/css/split.css b/Site/css/split.css index e6e29cc..29a171c 100644 --- a/Site/css/split.css +++ b/Site/css/split.css @@ -156,5 +156,6 @@ } .loading_holder .loading_icon:before { - content: '\e61a'; + font-family: 'Fontawesome'; + content: '\f021'; } diff --git a/Site/fic/Languages/en-au/textres.xml b/Site/fic/Languages/en-au/textres.xml index 1c62dbd..cf10e63 100644 --- a/Site/fic/Languages/en-au/textres.xml +++ b/Site/fic/Languages/en-au/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="en-us" ver="2021-03-18 11:06"> +<root lgid="en-us" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>Clear Local Storage</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>Are you sure to clear the local storage?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>Please check whether the user ID already exists in another FI product.</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -455,6 +455,8 @@ <FI_FRS_BCL097>YTD Static</FI_FRS_BCL097> <FI_FRS_BCL098>R12 Static</FI_FRS_BCL098> <FI_FRS_BCL099>Set Value</FI_FRS_BCL099> + <FI_FRS_BCL100>Set Department And Location Region Percentages </FI_FRS_BCL100> + <FI_FRS_BCL101>The department/region allocation percentage is not set.</FI_FRS_BCL101> <FI_FRS_BGT001>The Budget Name or Ledger ID already exists.</FI_FRS_BGT001> <FI_FRS_BGT002>This Budget Version already exists.</FI_FRS_BGT002> <FI_FRS_BGT003>This data source is in use and cannot be deleted.</FI_FRS_BGT003> @@ -674,6 +676,8 @@ <FI_FRS_C0054>Connector Settings</FI_FRS_C0054> <FI_FRS_C0055>Connection</FI_FRS_C0055> <FI_FRS_C0056>Use Excel Connector</FI_FRS_C0056> + <FI_FRS_C0057>Export Budget Package</FI_FRS_C0057> + <FI_FRS_C0058>Import Budget Package</FI_FRS_C0058> <FI_FRS_CC001>Manage Constants</FI_FRS_CC001> <FI_FRS_CC002>Name</FI_FRS_CC002> <FI_FRS_CC003>Description</FI_FRS_CC003> @@ -803,6 +807,10 @@ <FI_FRS_IMPKG024>Lock password:</FI_FRS_IMPKG024> <FI_FRS_IMPKG025>Confirm lock password:</FI_FRS_IMPKG025> <FI_FRS_IMPKG026>Passwords do not match.</FI_FRS_IMPKG026> + <FI_FRS_IMPKG027>Available Budgets</FI_FRS_IMPKG027> + <FI_FRS_IMPKG028>Please select budgets to export.</FI_FRS_IMPKG028> + <FI_FRS_IMPKG029>Replace the budget.</FI_FRS_IMPKG029> + <FI_FRS_IMPKG030>Options for locking budgets</FI_FRS_IMPKG030> <FI_FRS_LD001>Default Row Level Definitions</FI_FRS_LD001> <FI_FRS_LD002>Level Description</FI_FRS_LD002> <FI_FRS_LD003>Level</FI_FRS_LD003> @@ -918,6 +926,7 @@ <FI_FRS_MPG035>New Budget</FI_FRS_MPG035> <FI_FRS_MPG036>Dashboard</FI_FRS_MPG036> <FI_FRS_MPG037>FI Common</FI_FRS_MPG037> + <FI_FRS_MPG038>Enter Region Data</FI_FRS_MPG038> <FI_FRS_PG0001>Login failed. Please retry.</FI_FRS_PG0001> <FI_FRS_PG0002>Please Login</FI_FRS_PG0002> <FI_FRS_PG0003>User ID:</FI_FRS_PG0003> @@ -1300,6 +1309,7 @@ <FI_HOST_EXT_A011>Import Application File</FI_HOST_EXT_A011> <FI_HOST_MANAGEMENT_USER_A002>Save Permissions</FI_HOST_MANAGEMENT_USER_A002> <FI_HOST_MANAGEMENT_USER_A005>Define Style</FI_HOST_MANAGEMENT_USER_A005> + <FI_HOST_MANAGEMENT_USER_A006>Email Verification</FI_HOST_MANAGEMENT_USER_A006> <FI_HOST_MANAGEMENT_USER_A008>Saved permissions successfully.</FI_HOST_MANAGEMENT_USER_A008> <FI_HOST_MANAGEMENT_USER_A009>Failed to save the user operation.</FI_HOST_MANAGEMENT_USER_A009> <FI_HOST_MANAGEMENT_USER_A043>User Management</FI_HOST_MANAGEMENT_USER_A043> @@ -1312,6 +1322,7 @@ <FI_HOST_MANAGEMENT_USER_A113>One or more user(s) will be deleted from FRS, Do you want to continue?</FI_HOST_MANAGEMENT_USER_A113> <FI_HOST_MANAGEMENT_USER_A114>Maintenance of Application Plug In</FI_HOST_MANAGEMENT_USER_A114> <FI_HOST_MANAGEMENT_USER_A115>Use of Application Plug In</FI_HOST_MANAGEMENT_USER_A115> + <FI_HOST_MANAGEMENT_USER_A116>Copy User</FI_HOST_MANAGEMENT_USER_A116> <FICTIP>Foresight Intelligence Center: Full Version</FICTIP> <FULL_SCREEN>Full Screen</FULL_SCREEN> <G5_FORGOTPWD>Forgot your password? Click <a href="{0}">here</a> to send a reminder email.</G5_FORGOTPWD> @@ -1543,7 +1554,7 @@ <LHBIS_EXCEPTION_E0X6502701B>An error occurred while searching for users in the system.</LHBIS_EXCEPTION_E0X6502701B> <LHBIS_EXCEPTION_E0X6502701C>Failed to get the authenticated user list.</LHBIS_EXCEPTION_E0X6502701C> <LHBIS_EXCEPTION_E0X6502701D>Failed to get the users list.</LHBIS_EXCEPTION_E0X6502701D> - <LHBIS_EXCEPTION_E0X6502701E>The user ID has been used by another user.</LHBIS_EXCEPTION_E0X6502701E> + <LHBIS_EXCEPTION_E0X6502701E>The user ID or email address has been used by another user.</LHBIS_EXCEPTION_E0X6502701E> <LHBIS_EXCEPTION_E0X6502701F>Failed to add the user.</LHBIS_EXCEPTION_E0X6502701F> <LHBIS_EXCEPTION_E0X65027020>Failed to save the user.</LHBIS_EXCEPTION_E0X65027020> <LHBIS_EXCEPTION_E0X65027021>Failed to delete the user.</LHBIS_EXCEPTION_E0X65027021> @@ -2077,6 +2088,8 @@ <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A012>The Refresh Time(s)'s value must be between 30 and 100,000 seconds.</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A012> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A013>Display Create Time</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTINFORMATIONCTRL_A013> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A001>Chart Notes:</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A001> + <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A002>Internal Chart Notes:</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A002> + <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A003>Internal Chart Notes</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTNOTECTRL_A003> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A001>Type</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A001> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A002>Group</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A002> <LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A003>Level</LHBIS_FIC_CLIENT_FICCONTROLS_CHARTSELECTCTRL_A003> @@ -2457,6 +2470,10 @@ <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A118>My Database Detail</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A118> <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A119>Tables</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A119> <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A120>Views</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A120> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A121>Data Table Cache</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A121> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A122>Data replication</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A122> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A123>SQL Queries</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A123> + <LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A124>Schedules</LHBIS_FIC_CLIENT_MANAGEMENT_MAINPAGE_A124> <LHBIS_FIC_CLIENT_MODULES_A001>User Management</LHBIS_FIC_CLIENT_MODULES_A001> <LHBIS_FIC_CLIENT_MODULES_A002>Add User</LHBIS_FIC_CLIENT_MODULES_A002> <LHBIS_FIC_CLIENT_MODULES_A003>Import User</LHBIS_FIC_CLIENT_MODULES_A003> @@ -3012,6 +3029,17 @@ <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A140>Please input the excel file name.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A140> <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A141>Execution Timeout Expired. Would you like to retry it?</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A141> <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A142>File extension required.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A142> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A143>Please enter a Cache Data Table Name.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A143> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A144>Index Name</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A144> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A145>Fields</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A145> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A146>Use Local Cache:</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A146> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A147>Cache Data Table Name:</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A147> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A148>Indexes</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A148> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A149>Index names cannot be duplicate.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A149> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A150>Data Table Cache</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A150> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A151>The Cache Data Table name {0} already exists.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A151> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A152>Cache Name</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A152> + <LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A153>Please name the filter.</LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A153> <LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A001>Add</LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A001> <LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A002>Delete</LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A002> <LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A003>Refresh</LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A003> @@ -3253,6 +3281,8 @@ <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A016>Saturday</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A016> <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A017>Sunday</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A017> <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A018>End of Month</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A018> + <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A019>Annually</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A019> + <LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A020>Month</LHBIS_FIC_CLIENT_MODULES_JOBDETAIL_FREQUENCY_A020> <LHBIS_FIC_CLIENT_MODULES_JOBDETAILMODULE_A001>Job Detail</LHBIS_FIC_CLIENT_MODULES_JOBDETAILMODULE_A001> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A001>Job List</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A001> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A002>Add</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A002> @@ -3266,6 +3296,9 @@ <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A010>Execute failed.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A010> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A011>Save</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A011> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A012>Jobs executed successfully.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A012> + <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A013>Execute</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A013> + <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A014>Are you sure want to execute the sql queries?</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A014> + <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A015>Sql Query executed successfully.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A015> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A001>An error occurred while getting the Job Schedule list.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A001> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A002>An error occurred while getting the Job Schedule information.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A002> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A003>An error occurred while modifying the Job Schedule information.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_EXCEPTION_A003> @@ -3282,6 +3315,24 @@ <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A007>The daily frequency's "ending time" value is invalid. This can be left empty.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A007> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A008>The Job Name cannot be empty.</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A008> <LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A009>Monthly Everyday Count is out of range. (1-31)</LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_NOTICE_A009> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A001><!DOCTYPE html><html><head><meta content=""text/html; charset=UTF-8"" http-equiv=""content-type""> +<style type=""text/css"">p{{font-family:Calibri,Tahoma,Verdana;color:black;}}</style></head> +<body><table><tr><td><p>An account has been established for you by {0}. Your password is <b>{1}</b></p> +<p>This password is a temporary password, please log on <a href='{2}'>Here</a>&nbsp;to change your password. If you have any questions, please contact us.</p> +<p>Regards,<br /> +{0}</p></td></tr></table></body></html></LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A001> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A002><!DOCTYPE html><html><head><meta content=""text/html; charset=UTF-8"" http-equiv=""content-type""> +<style type=""text/css"">p{{font-family:Calibri,Tahoma,Verdana;color:black;}}</style></head> +<body><table><tr><td><p>An account has been established for you by {0}. Your ID is <b>{1}</b></p> +<p>Another email with your temporary password will be sent under separate email. If you have any questions, please contact us.</p> +<p>Regards,<br /> +{0}</p></td></tr></table></body></html></LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A002> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A003>New Alert:</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A003> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A004>Alert Name: </LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A004> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A005>Create Time: </LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A005> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A006>Alert Content:</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A006> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A007>{0} User ID</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A007> + <LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A008>{0} Password</LHBIS_FIC_CLIENT_MODULES_MAILLANGUAGE_A008> <LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A001>Navigation Definitions</LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A001> <LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A002>Navigation Name</LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A002> <LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A003>Single window mode</LHBIS_FIC_CLIENT_MODULES_NAVIGATION_A003> @@ -3345,6 +3396,9 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A016>Schedule</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A016> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>Note: Labels of values where the percentage is less than 1 may not be shown.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>Attachments</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>Resend</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>The execute starting time must be early than the ending time.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>Resend Email Subscription</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>Group:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>Level:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A003>Email:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A003> @@ -3367,6 +3421,8 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A020>The text message address is invalid.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A021>Do you still want to save?</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A021> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A022>The email is blank.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A022> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A023>This user does not have Data Table Access Rights to view this chart. Would you like to continue?</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A023> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A024>Only send if Chart has data</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A024> <LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A001>Workspace Name</LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A002>Description</LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A002> <LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A003>Group Name</LHBIS_FIC_CLIENT_MODULES_RWORKSPACEEDITDIALOG_A003> @@ -3663,6 +3719,7 @@ <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A073>Tonne</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A073> <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A074>Pound</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A074> <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A075>Ton (U.S.)</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A075> + <LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A076>Always prompt</LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A076> <LHBIS_FIC_CLIENT_MODULES_TASKLOG_A001>Task schedule logs</LHBIS_FIC_CLIENT_MODULES_TASKLOG_A001> <LHBIS_FIC_CLIENT_MODULES_TASKLOG_A002>Delete</LHBIS_FIC_CLIENT_MODULES_TASKLOG_A002> <LHBIS_FIC_CLIENT_MODULES_TASKLOG_A003>Delete All</LHBIS_FIC_CLIENT_MODULES_TASKLOG_A003> @@ -3816,6 +3873,9 @@ <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A072>Linked To Azure</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A072> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A073>Are you sure you want to Clear this?</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A073> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A074>Link To Local User</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A074> + <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A075>Language</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A075> + <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A076>Email Verification</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A076> + <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A077>Azure user</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_A077> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B007>User ID</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B007> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B008>User Name</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B008> <LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B009>User Level</LHBIS_FIC_CLIENT_MODULES_USERMANAGERCTRL_B009> @@ -4097,6 +4157,7 @@ <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A094>Overwrite Top Records</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A094> <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A095>Chart Color Scheme Name</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A095> <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A096>Chart Color Scheme</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A096> + <LHBIS_FIC_CLIENT_PACKAGE_CREATE_A097>SQL Query</LHBIS_FIC_CLIENT_PACKAGE_CREATE_A097> <LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A001>Please enter the Publisher.</LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A001> <LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A002>Please enter the Name.</LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A002> <LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A003>Please enter the Password.</LHBIS_FIC_CLIENT_PACKAGE_EXPORTDATACONNECTIONS_A003> @@ -4673,6 +4734,9 @@ <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A410>Pound</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A410> <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A411>Ton (U.S.)</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A411> <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A412>Pivot Enabled</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A412> + <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A413>Count Distinct</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A413> + <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A414>Chart Title:</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A414> + <LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A415>Filter And DataSources</LHBIS_FIC_CLIENT_WIZARD_CHARTWIZARDHELPER_A415> <LHBIS_FIC_CLIENT_WSP_A001>Each of the parameters, @cy and @cm, can only be used once in a chart.</LHBIS_FIC_CLIENT_WSP_A001> <LHBIS_FIC_DATAMODEL_COMMON_A001>Language resource 1</LHBIS_FIC_DATAMODEL_COMMON_A001> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A001>Please install Silverlight 5.0</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A001> @@ -4737,6 +4801,12 @@ <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A16>The SilverLight Isolated Storage space is not large enough.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A16> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A17>You are currently logged in on another computer. If you log in here, the other session will be disconnected. Would you like to proceed?</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A17> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A18>Forgot Password</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A18> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A19>Two-Factor Authentication:</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A19> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A20>An Email with a verification code has been sent to: {0}. Please enter the code to continue.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A20> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A22>An incorrect verification code has been entered. Please try again.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A22> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A23>Below is the one-time code for logging into your account.</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A23> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A24>Your one-time code: {0}</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A24> + <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A25>Valid for : 10 min</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A25> <LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_B001>Language:</LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_B001> <LHBIS_FIC_SILVERLIGHT_WSP_ERROR_A001>Get the list of data table errors.</LHBIS_FIC_SILVERLIGHT_WSP_ERROR_A001> <LHBIS_FIC_SILVERLIGHT_WSP_INOTIFYCHANGED_A001>At least one chart has been changed in the current board.</LHBIS_FIC_SILVERLIGHT_WSP_INOTIFYCHANGED_A001> @@ -4774,6 +4844,7 @@ <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A027>Language</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A027> <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A028>Copy Cell</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A028> <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A029>Copy Row</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A029> + <LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A030>Refresh Board Cached Data</LHBIS_FIC_SILVERLIGHT_WSP_RMENUCTRL_A030> <LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A001>Logout</LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A001> <LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A002>Add Board</LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A002> <LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A003>Board</LHBIS_FIC_SILVERLIGHT_WSP_WORKSPACEPAGE_A003> diff --git a/Site/fic/Languages/en-us/textres.xml b/Site/fic/Languages/en-us/textres.xml index 3d46982..cf10e63 100644 --- a/Site/fic/Languages/en-us/textres.xml +++ b/Site/fic/Languages/en-us/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="en-us" ver="2022-10-21 09:56"> +<root lgid="en-us" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>Clear Local Storage</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>Are you sure to clear the local storage?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>Please check whether the user ID already exists in another FI product.</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -3397,6 +3397,7 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>Note: Labels of values where the percentage is less than 1 may not be shown.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>Attachments</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>Resend</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>The execute starting time must be early than the ending time.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>Resend Email Subscription</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>Group:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>Level:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> diff --git a/Site/fic/Languages/fr-fr/textres.xml b/Site/fic/Languages/fr-fr/textres.xml index 82637cc..0694d9e 100644 --- a/Site/fic/Languages/fr-fr/textres.xml +++ b/Site/fic/Languages/fr-fr/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="fr-fr" ver="2022-10-21 09:56"> +<root lgid="fr-fr" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>Effacer le stockage local</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>Etes-vous sûr d'effacer le stockage local?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>Veuillez s'il vous plaît vérifier si l'identifiant d'utilisateur existe déjà dans un autre produit FI.</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -3397,6 +3397,7 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>Remarque: Les étiquettes de valeurs où le pourcentage est inférieur à 1 peuvent ne pas être affichées.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>Pièces jointes</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>Rediffusion</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>L’heure de début d’exécution doit être antérieure à l’heure de fin.</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>Revendre les abonnements par courriel</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>Groupe:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>Niveau:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> diff --git a/Site/fic/Languages/zh-chs/textres.xml b/Site/fic/Languages/zh-chs/textres.xml index 58076a1..79e2b35 100644 --- a/Site/fic/Languages/zh-chs/textres.xml +++ b/Site/fic/Languages/zh-chs/textres.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<root lgid="zh-chs" ver="2022-10-21 09:56"> +<root lgid="zh-chs" ver="2023-05-19 09:13"> <CLEAR_LOCAL_STORAGE>清除本地存储</CLEAR_LOCAL_STORAGE> <CONFIRM_LOCAL_STORAGE>您确定要清除本地存储吗?</CONFIRM_LOCAL_STORAGE> <ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002>请检查该用户是否已经存在于FI其它系统中。</ERROR_LHBIS_AUTHORIZATION_AUTHORAGENT_A0002> @@ -3398,6 +3398,7 @@ <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017>注意:百分比小于1的值的标签将不会显示。</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A017> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018>附件</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A018> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019>重发</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A019> + <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020>执行开始时间必须早于结束时间。</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB>重发邮件订阅</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_BBBB> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001>分类:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A001> <LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002>级别:</LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBEMESSAGEDIALOG_A002> diff --git a/Site/fic/fic/Template/EmailSubscription.html b/Site/fic/fic/Template/EmailSubscription.html index bc53363..658de0d 100644 --- a/Site/fic/fic/Template/EmailSubscription.html +++ b/Site/fic/fic/Template/EmailSubscription.html @@ -12,7 +12,7 @@ <script src="../js/controls/dialog.js?v=20210813"></script> <script src="../js/controls/controls.js"></script> <script src="../js/Management/func.js?v=20210517"></script> - <script src="../js/Management/UserManagement.js?v=20230328"></script> + <script src="../js/Management/UserManagement.js?v=20230519"></script> <title></title> <link href="../../css/datepicker.min.css" rel="stylesheet" /> <link href="../js/components/css/datagrid.css" rel="stylesheet" /> diff --git a/Site/fic/fic/js/Management/UserManagement.js b/Site/fic/fic/js/Management/UserManagement.js index d92aa22..68a352c 100644 --- a/Site/fic/fic/js/Management/UserManagement.js +++ b/Site/fic/fic/js/Management/UserManagement.js @@ -1356,11 +1356,55 @@ if (typeof $schedulePage != 'function') { pv.dataTableIID = r.Result.Data.DataTableIID; pivot.PivotResult.SelectedValues = wrapSelectedValue(inputer.val(), pivot.PivotResult.PivotItemList); if (level.length > 0) { - pivot.PivotResult.SelectedLevel = level.val(); + var lv = level.val(); + var lvValue = 0; + var changed = false; + switch (lv) { + case "Location": + changed = true; + lvValue = 0; + break; + case "Company": + changed = true; + lvValue = 1; + break; + case "District": + changed = true; + lvValue = 2; + break; + } + if (changed) { + pivot.PivotResult.SelectedLevel = lvValue; + } + else { + //pivot.PivotResult.SelectedLevel = level.val(); + } + pv.onLevelSelected = function (t, lv, ispush) { if (!ispush) { var lvn = parseInt(lv); - level.val(isNaN(lvn) || lvn <= 0 ? '0' : lv); + if (isNaN(lvn)) { + var lvValue = 0; + switch (lv) { + case "Location": + lvValue = 0; + break; + case "Company": + lvValue = 1; + break; + case "District": + lvValue = 2; + break; + default: + lvValue = 0; + break; + } + level.val(lvValue); + } + else { + level.val(isNaN(lvn) || lvn <= 0 ? '0' : lv); + } + } }; } @@ -1568,7 +1612,19 @@ if (typeof $schedulePage != 'function') { pivot.selectPivotItem(v, null, true); var lv = level.val(); var lvn = parseInt(lv); - pivot.selectLevel(isNaN(lvn) || lvn <= 0 ? 'Detail' : lv, true); + if (!isNaN(lvn)) { + if (pivot.pivotData.Level.length >= lvn) { + pivot.selectLevel(pivot.pivotData.Level[lvn], true); + } + else { + pivot.selectLevel(isNaN(lvn) || lvn <= 0 ? 'Detail' : lv, true); + } + + } + else { + pivot.selectLevel(isNaN(lvn) || lvn <= 0 ? 'Detail' : lv, true); + } + dv.show(); } else if (z.PivotResult != null) { dv = $('<div class="chart_pivot_block"></div>'); @@ -2473,8 +2529,8 @@ if (typeof $schedulePage != 'function') { var dtEnd = new Date('1900-01-01T' + schedule.Daily.EndingAt); if (dtStart > dtEnd) { showAlert({ - 'LGID': 'LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A011', - 'Default': 'The execute starting date must be early than the ending date.' + 'LGID': 'LHBIS_FIC_CLIENT_MODULES_RSUBSCRIBE_A020', + 'Default': 'The execute starting time must be early than the ending time.' }, null, null, function () { _this.container.find('#text-starting-at').focus(); }); diff --git a/Site/js/assetselector.js b/Site/js/assetselector.js index 77f4750..213ff5c 100644 --- a/Site/js/assetselector.js +++ b/Site/js/assetselector.js @@ -49,7 +49,7 @@ // checkbox name: 'check', key: 'Selected', - width: 40, + width: 45, align: 'center', sortable: false, allcheck: true, @@ -125,53 +125,57 @@ allowFilter: true, styleFilter: styleFilter, bgFilter: bgFilter - }, - { - key: 'AcquisitionType', - caption: GetTextByKey("P_MA_ACQUISITIONTYPE", "Acquisition Type"), - width: 120, - allowFilter: true, - styleFilter: styleFilter, - bgFilter: bgFilter - }, - { - key: 'AssetGroups', - caption: GetTextByKey("P_JS_ASSETGROUP", "Asset Group"), - width: 160, - allowFilter: false, - styleFilter: styleFilter, - bgFilter: bgFilter, - filter: function (item) { - if (item.AssetGroups) - return item.AssetGroups.join(", "); - else - return ""; - } - }, - { - key: 'Jobsites', - caption: GetTextByKey("P_JOBSITE", "Jobsite"), - width: 160, - allowFilter: false, - styleFilter: styleFilter, - bgFilter: bgFilter, - filter: function (item) { - if (item.Jobsites && item.Jobsites.length > 0) { - var r = ""; - for (var i = 0; i < item.Jobsites.length; i++) { - r += item.Jobsites[i].Key; - if (item.Jobsites[i].Value && item.Jobsites[i].Value != "") - r += "(" + item.Jobsites[i].Value + ")"; - r += ", "; - } - r = r.substring(0, r.length - 2); - return r; - } - else - return ""; - } } ); + if (this.jobsiteId == null) { + columns.push( + { + key: 'AcquisitionType', + caption: GetTextByKey("P_MA_ACQUISITIONTYPE", "Acquisition Type"), + width: 120, + allowFilter: true, + styleFilter: styleFilter, + bgFilter: bgFilter + }, + { + key: 'AssetGroups', + caption: GetTextByKey("P_JS_ASSETGROUP", "Asset Group"), + width: 160, + allowFilter: false, + styleFilter: styleFilter, + bgFilter: bgFilter, + filter: function (item) { + if (item.AssetGroups) + return item.AssetGroups.join(", "); + else + return ""; + } + }, + { + key: 'Jobsites', + caption: GetTextByKey("P_JOBSITE", "Jobsite"), + width: 160, + allowFilter: false, + styleFilter: styleFilter, + bgFilter: bgFilter, + filter: function (item) { + if (item.Jobsites && item.Jobsites.length > 0) { + var r = ""; + for (var i = 0; i < item.Jobsites.length; i++) { + r += item.Jobsites[i].Key; + if (item.Jobsites[i].Value && item.Jobsites[i].Value != "") + r += "(" + item.Jobsites[i].Value + ")"; + r += ", "; + } + r = r.substring(0, r.length - 2); + return r; + } + else + return ""; + } + } + ); + } //grid.canMultiSelect = true; grid.columns = columns; grid.init(); @@ -233,11 +237,11 @@ this.machineList = $('<div style="width: 1188px; height: 400px; margin: 10px 0 4px"></div>').appendTo(content); var dialogFunction = $('<div class="dialog-func"></div>').appendTo(dialog); - $('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_CANCEL", "Cancel") + '" class="dialog-close" />').appendTo(dialogFunction).css("height", 26);//height与Workspace.css冲突 + $('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_CANCEL", "Cancel") + '" class="dialog-close" />').appendTo(dialogFunction).css("height", "unset");//height与Workspace.css冲突 $('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_OK", "OK") + '" />').click(onOKClick.bind(this)).appendTo(dialogFunction); $('<div class="clear"></div>').appendTo(dialogFunction); - $('<div class="maskbg" style="display: none"><div class="loading_icon icon c-spin"></div></div>').appendTo(dialog); + $('<div class="maskbg" style="display: none"><div class="loading_icon c-spin"></div></div>').appendTo(dialog); // init initMachinesGrid.call(this, this.machineList); @@ -263,10 +267,10 @@ if (this.jobsiteId == null && this.allowhidden) { this.showHidden.prop('checked', false); } - dialog.attr('init', '1').showDialog().css({ + dialog.attr('init', '1').css({ 'top': (document.documentElement.clientHeight - $('#dialog_machines').height()) / (topRatio || 3), 'left': (document.documentElement.clientWidth - $('#dialog_machines').width()) / 2 - }); + }).showDialogfixed(); this.gridAssets.setData([]); onSearch.call(this); }; diff --git a/Site/js/assetsummary.js b/Site/js/assetsummary.js index e64b41a..6ae367f 100644 --- a/Site/js/assetsummary.js +++ b/Site/js/assetsummary.js @@ -4,6 +4,8 @@ if (typeof ($assetsummary) != "function") { var assetIconCollapsed = false; var alertsCollapsed = false; var infowindowScrollTop = 0; + var assetInfoCache = []; + var assetExtCache = []; $assetsummary = function (p, cid, assetid, alerttips, type, assets) {//type 0.left;1.bottom if (typeof p === "string") p = $("#" + p); @@ -53,7 +55,7 @@ if (typeof ($assetsummary) != "function") { //this.maskbgctrl = $('<div class="maskbg"><div class="loading_icon icon c-spin"></div></div>'); //p.append(this.maskbgctrl); - this.loadingicon = $('<span class="loading c-spin" style="top: 60px;right: 13px;font-size: 20px;color: black;position: absolute;left:unset;width:unset;height:unset;line-height:unset;"></span>'); + this.loadingicon = $('<span class="loading c-spin" style="top: 60px;right: 13px;font-size: 20px;color: black;position: absolute;left:unset;width:unset;height:unset;line-height:unset;display:none;"></span>'); p.append(this.loadingicon); this.loadingCount = 0; @@ -75,6 +77,10 @@ if (typeof ($assetsummary) != "function") { loadAssetExtInfo(); } + this.clearCache = function () { + assetInfoCache = []; + assetExtCache = []; + } if (this.assetid) { loadAssetInfo(); @@ -545,6 +551,13 @@ if (typeof ($assetsummary) != "function") { } function loadAssetInfo() { + var asset = assetInfoCache['' + _this.assetid]; + if (asset) { + _this.asset = asset; + if (_this.status == 0) + showAssetInfo(); + return; + } _this.showLoading(); devicerequest('GetAssetSummaryInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) { _this.hideLoading(); @@ -553,6 +566,7 @@ if (typeof ($assetsummary) != "function") { return; } _this.asset = data; + assetInfoCache['' + _this.assetid] = data; if (_this.status == 0) showAssetInfo(); }, function () { @@ -561,6 +575,13 @@ if (typeof ($assetsummary) != "function") { } function loadAssetExtInfo() { + var ext = assetExtCache['' + _this.assetid]; + if (ext) { + _this.assetext = ext; + if (_this.status == 0 && _this.asset) + showAssetExtInfo(_this.assetext); + return; + } _this.showLoading(); devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) { _this.hideLoading(); @@ -568,6 +589,7 @@ if (typeof ($assetsummary) != "function") { return; } _this.assetext = data; + assetExtCache['' + _this.assetid] = data; if (_this.status == 0 && _this.asset) showAssetExtInfo(_this.assetext); }, function () { diff --git a/Site/js/favorite.js b/Site/js/favorite.js index 7c15fd9..8f94a9d 100644 --- a/Site/js/favorite.js +++ b/Site/js/favorite.js @@ -4,7 +4,7 @@ var navigate; $(function () { $('#dialog_favorite').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); $('.maskbg').hide(); }); }); @@ -127,7 +127,7 @@ function saveFavorites(data, issort) { else { if (issort) { $('#dialog_favorite').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); } refreshFavorites(); } @@ -543,7 +543,7 @@ function showFavoritesGridList(data) { } function openFavoriteDialog() { - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_favorite .dialog-title span.title').text(GetTextByKey("P_FAV_EDITFAVORITES", 'Edit Favorites')); $('#dialog_favorite') @@ -876,7 +876,7 @@ function createDashboardTitle(menudiv) { } function openDashboardsDialog() { - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_dashboards .dialog-title span.title').text(GetTextByKey("P_MAIN_REPORTSDASHBOARDS", 'Reports & Dashboards')); $('#dialog_dashboards') @@ -901,7 +901,7 @@ function openDashboard() { if (dah.IsChart.Value) { setRecentOpenedDashboard(dah.ID); $('#dialog_dashboards').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); openFleetChart(dah.ID, dah.Name); } else { diff --git a/Site/js/language.js b/Site/js/language.js index b25dfd1..c3d5543 100644 --- a/Site/js/language.js +++ b/Site/js/language.js @@ -102,7 +102,12 @@ function loadLanguageRes(ver) { var lang = _fleet.currentLang; if (!lang) lang = "en-us"; - return loadJsonFromServer(sp + "Languages\\" + lang + ".json?s=" + ver); + try { + return loadJsonFromServer(sp + "Languages\\" + lang + ".json?s=" + ver); + } + catch { + return loadJsonFromServer(sp + "Languages\\en-us.json?s=" + ver); + } } } diff --git a/Site/js/lib/app.min.css b/Site/js/lib/app.min.css index 426664a..38f27bf 100644 --- a/Site/js/lib/app.min.css +++ b/Site/js/lib/app.min.css @@ -1 +1 @@ -.ui-popup-mask .wrapper-edit-method{width:100%}.ui-popup-mask .wrapper-edit-method .ui-check-wrapper{padding:0 28px}.comm{display:flex;flex-direction:column;width:320px;background-color:var(--dark-fore-color);border:1px solid var(--title-bg-color);margin-left:12px}.comm{--dark-fore-color: #fff;--dark-fore-opacity-color: rgba(255, 255, 255, .6);--strong-color: #333;--light-color: #ccc}.comm .roundbtn{width:30px;height:30px;display:inline-block;box-sizing:border-box;cursor:pointer;padding:7px;margin-left:10px;fill:var(--dark-fore-color);border-radius:15px;border:none;transition:background-color .2s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.comm .roundbtn:focus,.comm .roundbtn:focus-visible{outline:none}.comm .roundbtn:hover{background-color:var(--dark-fore-opacity-color)}.comm .roundbtn:hover>svg{opacity:.6}.comm .roundbtn.disabled,.comm .roundbtn:disabled{background-color:transparent!important}.comm .roundbtn.disabled,.comm .roundbtn:disabled{fill:#d3d3d3}.comm .roundbtn.disabled:hover>svg,.comm .roundbtn:disabled:hover>svg{opacity:1;opacity:initial}.comm .roundbtn>svg{width:13px;height:14px;display:block;transition:opacity .2s}.comm .title-bar{flex:0 0 auto;padding:5px 0 5px 10px;color:var(--title-color);background-color:var(--title-bg-color);line-height:24px;display:flex;align-items:center;font-size:var(--font-larger-size)}.comm .title-bar>div{flex:1 1 auto}.comm .title-bar>.title-functions{flex:0 0 auto;display:flex;padding:4px}.comm .title-bar>.title-functions>label{margin:0 4px;box-sizing:border-box;cursor:pointer;width:30px;height:30px;background-color:var(--dark-fore-color);border-radius:15px;display:flex;align-items:center;justify-content:center;transition:background-color .2s}.comm .title-bar>.title-functions>label>svg{fill:var(--strong-color);width:14px;height:14px;transition:opacity .2s}.comm .title-bar>.title-functions>label:hover{background-color:var(--dark-fore-opacity-color)}.comm .title-bar>.title-functions>label:hover>svg{opacity:.6}.comm .title-bar>.title-functions>label.disabled{cursor:default;opacity:.6}.comm .title-bar>.title-functions>label.disabled:hover{background-color:var(--dark-fore-color)}.comm .title-bar>.title-functions>label.disabled:hover>svg{opacity:1;opacity:initial}.comm .contact-bar{flex:0 0 auto;padding:4px 0;display:flex;border-bottom:1px solid var(--title-bg-color)}.comm .contact-bar>.bar-icon{flex:0 0 auto}.comm .contact-bar>.bar-icon>svg{width:30px;height:30px;margin:0 8px}.comm .contact-bar>.bar-list{flex:1 1 auto;width:calc(100% - 46px)}.comm .contact-bar>.bar-list .bar-list-container{max-height:120px;overflow:auto}.comm .contact-bar>.bar-list .contact-item{display:flex;align-items:center;line-height:22px}.comm .contact-bar>.bar-list .contact-item>svg{flex:0 0 auto;width:16px;height:16px;margin-right:6px;fill:var(--strong-color)}.comm .contact-bar>.bar-list .contact-item>span{color:var(--strong-color);font-size:var(--font-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:10px}.comm .contact-bar .roundbtn{float:right;margin:4px 10px 10px}.comm .contact-bar .roundbtn>svg{width:16px}.comm .message-bar{flex:0 0 auto;border-bottom:1px solid var(--title-bg-color);display:flex;flex-direction:column}.comm .message-bar>textarea{padding:10px 10px 0;border:1px solid var(--title-bg-color);border-radius:5px;height:70px;resize:none;font-size:var(--font-smaller-size);font-family:var(--font-family);margin:3px 5px;background:#f0f0f0}.comm .message-bar>textarea:focus,.comm .message-bar>textarea:focus-visible{outline:none}.comm .message-bar>div{padding:0 10px 10px}.comm .message-bar>div>.customer-name{float:left}.comm .message-bar>div>.customer-name>span{font-size:var(--font-smaller-size)}.comm .message-bar>div>.customer-name>.ui-input{margin-left:4px;width:150px;border-top:none;border-left:none;border-right:none}.comm .message-bar>div>.prompt-count{display:inline-block;color:var(--light-color);font-size:var(--font-smaller-size)}.comm .list-bar{flex:1 1 auto;overflow:auto;margin-top:8px}.comm .list-bar .item-div{margin-top:5px;border-bottom:solid 1px lightgray;padding:3px 10px 5px;line-height:1.5rem;white-space:normal;word-break:break-word;overflow:hidden;font-size:var(--font-size);color:#333;display:flex;flex-direction:column}.comm .list-bar .item-div:last-child{border-bottom:none}.comm .list-bar .item-div .item-poster{font-weight:700;font-size:var(--font-size);align-self:flex-start}.comm .list-bar .item-div .item-poster .ui-tooltip-wrapper>.ui-tooltip-content{font-weight:400}.comm .list-bar .item-div .item-content{line-height:1.2rem;padding:8px 20px;border-radius:5px;white-space:pre-wrap;word-break:break-word;max-width:240px;background-color:#f4f4f4}.comm .list-bar .item-div .item-content a>svg{width:13px;height:13px;fill:#2140fb}.comm .list-bar .item-div .item-content a>svg:hover{border-bottom:1px solid}.comm .list-bar .item-div .item-content>span:after{content:"";display:block}.comm .list-bar .item-div .item-content .item-status{text-align:right;margin-top:3px;font-weight:700;margin-right:-12px;font-size:.625rem;float:right}.comm .list-bar .item-div .item-time{align-self:flex-end;color:#aaa;font-size:.6875rem}.comm .list-bar .item-div.item-other .item-content{margin-left:10px;align-self:flex-start}.comm .list-bar .item-div.item-self .item-poster,.comm .list-bar .item-div.item-self .item-content{align-self:flex-end}.comm .list-bar .item-div.item-self .item-content{margin-right:10px;background-color:#9eea6a}.comm .list-bar .item-div.item-sent .item-content{background-color:#a4e2fb}.comm .ui-popup-mask .ui-grid{height:100%;min-height:120px}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td{vertical-align:top}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon{padding:10px 4px 10px 8px}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .icon-contact-type{cursor:inherit}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .icon-contact-type>svg{fill:#333}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .icon-contact-type:hover>svg{opacity:1;opacity:initial}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .contact-wrapper{width:100px;padding:var(--spacing-cell)}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .contact-wrapper .contact-name{overflow:hidden;text-overflow:ellipsis}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .contact-wrapper .contact-note{color:#999}.comm .ui-popup-mask .follower-wrapper{display:flex;flex-direction:column;width:600px}.comm .ui-popup-mask .follower-wrapper>.follower-search{margin-bottom:6px}.comm .ui-popup-mask .follower-wrapper>.follower-grid{height:380px} +.ui-popup-mask .wrapper-edit-method{width:100%}.ui-popup-mask .wrapper-edit-method .ui-check-wrapper{padding:0 28px}.comm{display:flex;flex-direction:column;width:320px;background-color:var(--dark-fore-color);border:1px solid var(--title-bg-color);margin-left:12px}.comm{--dark-fore-color: #fff;--dark-fore-opacity-color: rgba(255, 255, 255, .6);--strong-color: #333;--light-color: #ccc}.comm .roundbtn{width:30px;height:30px;display:inline-block;box-sizing:border-box;cursor:pointer;padding:7px;margin-left:10px;fill:var(--dark-fore-color);border-radius:15px;border:none;transition:background-color .2s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.comm .roundbtn:focus,.comm .roundbtn:focus-visible{outline:none}.comm .roundbtn:hover{background-color:var(--dark-fore-opacity-color)}.comm .roundbtn:hover>svg{opacity:.6}.comm .roundbtn.disabled,.comm .roundbtn:disabled{background-color:transparent!important}.comm .roundbtn.disabled,.comm .roundbtn:disabled{fill:#d3d3d3}.comm .roundbtn.disabled:hover>svg,.comm .roundbtn:disabled:hover>svg{opacity:1;opacity:initial}.comm .roundbtn>svg{width:13px;height:14px;display:block;transition:opacity .2s}.comm .title-bar{flex:0 0 auto;padding:5px 0 5px 10px;color:var(--title-color);background-color:var(--title-bg-color);line-height:24px;display:flex;align-items:center;font-size:var(--font-larger-size)}.comm .title-bar>div{flex:1 1 auto}.comm .title-bar>.title-functions{flex:0 0 auto;display:flex;padding:4px}.comm .title-bar>.title-functions>label{margin:0 4px;box-sizing:border-box;cursor:pointer;width:30px;height:30px;background-color:var(--dark-fore-color);border-radius:15px;display:flex;align-items:center;justify-content:center;transition:background-color .2s}.comm .title-bar>.title-functions>label>svg{fill:var(--strong-color);width:14px;height:14px;transition:opacity .2s}.comm .title-bar>.title-functions>label:hover{background-color:var(--dark-fore-opacity-color)}.comm .title-bar>.title-functions>label:hover>svg{opacity:.6}.comm .title-bar>.title-functions>label.disabled{cursor:default;opacity:.6}.comm .title-bar>.title-functions>label.disabled:hover{background-color:var(--dark-fore-color)}.comm .title-bar>.title-functions>label.disabled:hover>svg{opacity:1;opacity:initial}.comm .contact-bar{flex:0 0 auto;padding:4px 0;display:flex;border-bottom:1px solid var(--title-bg-color)}.comm .contact-bar>.bar-icon{flex:0 0 auto}.comm .contact-bar>.bar-icon>svg{width:30px;height:30px;margin:0 8px}.comm .contact-bar>.bar-list{flex:1 1 auto;width:calc(100% - 46px)}.comm .contact-bar>.bar-list .bar-list-container{max-height:120px;overflow:auto}.comm .contact-bar>.bar-list .contact-item{display:flex;align-items:center;line-height:22px}.comm .contact-bar>.bar-list .contact-item>svg{flex:0 0 auto;width:16px;height:16px;margin-right:6px;fill:var(--strong-color)}.comm .contact-bar>.bar-list .contact-item>span{color:var(--strong-color);font-size:var(--font-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:10px}.comm .contact-bar .roundbtn{float:right;margin:4px 10px 10px}.comm .contact-bar .roundbtn>svg{width:16px}.comm .message-bar{flex:0 0 auto;border-bottom:1px solid var(--title-bg-color);display:flex;flex-direction:column}.comm .message-bar>textarea{padding:10px 10px 0;border:1px solid var(--title-bg-color);border-radius:5px;height:70px;resize:none;font-size:var(--font-smaller-size);font-family:var(--font-family);margin:3px 5px;background:#f0f0f0}.comm .message-bar>textarea:focus,.comm .message-bar>textarea:focus-visible{outline:none}.comm .message-bar>div{padding:0 10px 10px}.comm .message-bar>div>.customer-name{float:left}.comm .message-bar>div>.customer-name>span{font-size:var(--font-smaller-size)}.comm .message-bar>div>.customer-name>.ui-input{margin-left:4px;width:150px;border-top:none;border-left:none;border-right:none}.comm .message-bar>div>.prompt-count{display:inline-block;color:var(--light-color);font-size:var(--font-smaller-size)}.comm .list-bar{flex:1 1 auto;overflow:auto;margin-top:8px;min-height:100px}.comm .list-bar .item-div{margin-top:5px;border-bottom:solid 1px lightgray;padding:3px 10px 5px;line-height:1.5rem;white-space:normal;word-break:break-word;overflow:hidden;font-size:var(--font-size);color:#333;display:flex;flex-direction:column}.comm .list-bar .item-div:last-child{border-bottom:none}.comm .list-bar .item-div .item-poster{font-weight:700;font-size:var(--font-size);align-self:flex-start}.comm .list-bar .item-div .item-poster .ui-tooltip-wrapper>.ui-tooltip-content{font-weight:400}.comm .list-bar .item-div .item-content{line-height:1.2rem;padding:8px 20px;border-radius:5px;white-space:pre-wrap;word-break:break-word;max-width:240px;background-color:#f4f4f4}.comm .list-bar .item-div .item-content a>svg{width:13px;height:13px;fill:#2140fb}.comm .list-bar .item-div .item-content a>svg:hover{border-bottom:1px solid}.comm .list-bar .item-div .item-content>span:after{content:"";display:block}.comm .list-bar .item-div .item-content .item-status{text-align:right;margin-top:3px;font-weight:700;margin-right:-12px;font-size:.625rem;float:right}.comm .list-bar .item-div .item-time{align-self:flex-end;color:#aaa;font-size:.6875rem}.comm .list-bar .item-div.item-other .item-content{margin-left:10px;align-self:flex-start}.comm .list-bar .item-div.item-self .item-poster,.comm .list-bar .item-div.item-self .item-content{align-self:flex-end}.comm .list-bar .item-div.item-self .item-content{margin-right:10px;background-color:#9eea6a}.comm .list-bar .item-div.item-sent .item-content{background-color:#a4e2fb}.comm .ui-popup-mask .ui-grid{height:100%;min-height:120px}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td{vertical-align:top}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon{padding:10px 4px 10px 8px}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .icon-contact-type{cursor:inherit}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .icon-contact-type>svg{fill:#333}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .icon-contact-type:hover>svg{opacity:1;opacity:initial}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .contact-wrapper{width:100px;padding:var(--spacing-cell)}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .contact-wrapper .contact-name{overflow:hidden;text-overflow:ellipsis}.comm .ui-popup-mask .ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .contact-wrapper .contact-note{color:#999;overflow:hidden;text-overflow:ellipsis}.comm .ui-popup-mask .follower-wrapper{display:flex;flex-direction:column;width:600px}.comm .ui-popup-mask .follower-wrapper>.follower-search{margin-bottom:6px}.comm .ui-popup-mask .follower-wrapper>.follower-grid{height:380px}.comm .ui-popup-mask .selcontact-wrapper{display:flex;flex-direction:column;width:780px}.comm .ui-popup-mask .selcontact-wrapper>.selcontact-grid{height:200px} diff --git a/Site/js/lib/app.min.js b/Site/js/lib/app.min.js index 96717d7..e056199 100644 --- a/Site/js/lib/app.min.js +++ b/Site/js/lib/app.min.js @@ -1,12 +1,11 @@ -(function(k,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(k=typeof globalThis<"u"?globalThis:k||self,E(k["lib-app"]={}))})(this,function(k){var $,L,z,Q,x,v,X,Z,ie,B,W,V,H,j,ue,ee,me,te,he,be,Le,ge,Pe,we,Fe,Y,P,G,ne;"use strict";var Se=(k,E,M)=>{if(!E.has(k))throw TypeError("Cannot "+M)};var t=(k,E,M)=>(Se(k,E,"read from private field"),M?M.call(k):E.get(k)),C=(k,E,M)=>{if(E.has(k))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(k):E.set(k,M)},T=(k,E,M,ae)=>(Se(k,E,"write to private field"),ae?ae.call(k,M):E.set(k,M),M);var xe=(k,E,M)=>(Se(k,E,"access private method"),M);const E="",M=window["lib-ui"].createElement;function ae(se,e){const n=M("div","comm"),a=M("div","title-bar",se,M("div","title-functions",...e));return n.appendChild(a),n}const De=window["lib-ui"].Dropdown,O=window["lib-ui"].createElement,$e=window["lib-ui"].createCheckbox,Ae=window["lib-ui"].createPopup,Ce=window["lib-ui"].showAlert,Ue=window["lib-utility"].isEmail,re=window["lib-utility"].nullOrEmpty,S=window["lib-utility"].r;class Ee{constructor(e={}){C(this,$,void 0);C(this,L,void 0);T(this,$,e)}async show(e=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(i=>i.tabIndex??0))+3,a=t(this,$).contact,y=O("input",i=>{i.type="text",i.className="ui-input",i.tabIndex=n+1,i.maxLength=200,i.autocomplete="off"}),m=new De({tabIndex:n+2});m.source=[{value:"0",text:S("text","Text")},{value:"1",text:S("email","Email")},{value:"2",text:S("phone","Phone")}];const o=O("input",i=>{i.type="email",i.className="ui-input",i.tabIndex=n+3,i.maxLength=100,i.autocomplete="off"}),r=O("input",i=>{i.type="tel",i.className="ui-input",i.tabIndex=n+4,i.maxLength=50,i.autocomplete="off"}),s=$e({tabIndex:n+5}),d=O("textarea",i=>{i.className="ui-text",i.tabIndex=n+6,i.maxLength=2e3,i.style.height="100px"}),b=[];t(this,$).company&&b.push({text:a==null?S("addContactRecord","Add Contact Record"):S("editContactRecord","Edit Contact Record"),trigger:()=>{const i=this.prepare();if(i==null)return!1;if(i.SaveToCustomer=1,typeof t(this,$).onSave=="function")return t(this,$).onSave.call(this,i,"customerrecord")}}),b.push({text:S("workOrderOnly","Work Order Only"),trigger:()=>{const i=this.prepare();if(i==null)return!1;if(i.Id=-1,i.SaveToCustomer=0,typeof t(this,$).onSave=="function")return t(this,$).onSave.call(this,i,"workorder")}},{text:S("cancel","Cancel")});const p=Ae(a==null?S("addContact","Add Contact"):S("editContact","Edit Contact"),O("div",i=>{i.className="setting-wrapper",i.style.width="500px"},O("div","setting-item",O("span","setting-label setting-required",S("contactNameColon","Contact Name:")),y),O("div","setting-item",O("span","setting-label",S("contactPreferencesColon","Contact Preferences:")),m.create()),O("div","setting-item",O("span","setting-label",S("contactEmailColon","Email Address:")),o),O("div","setting-item",O("span","setting-label",S("contactMobileColon","Mobile:")),r),O("div","setting-item",O("span","setting-label",S("contactOptColon","Opt Out:")),s),O("div","setting-item",O("span","setting-label",S("contactNotesColon","Notes:")),d)),...b);a!=null?(y.value=a.Name,m.select(String(a.ContactPreference)),o.value=a.Email,r.value=a.MobilePhone,s.querySelector("input").checked=a.OptOut,d.value=a.Notes):m.select("0"),T(this,L,{contactName:y,preferences:m,contactEmail:o,contactMobile:r,checkOpt:s,contactNotes:d});const g=await p.show(e);return setTimeout(()=>y.focus()),g}prepare(){const e=t(this,L).contactName.value,n=t(this,L).preferences.selected.value,a=t(this,L).contactEmail.value,y=t(this,L).contactMobile.value,m=t(this,L).checkOpt.querySelector("input").checked,o=t(this,L).contactNotes.value,r=t(this,$).contact==null?S("addContact","Add Contact"):S("editContact","Edit Contact");if(re(e))return Ce(r,S("contactNameRequired","Contact Name cannot be empty."),"warn").then(()=>t(this,L).contactName.focus()),null;if(re(a)&&re(y))return Ce(r,S("contactEmailPhoneRequired","Email and Mobile Phone cannot both be empty."),"warn").then(()=>re(a)?t(this,L).contactEmail.focus():t(this,L).contactMobile.focus()),null;if(!re(a)&&!Ue(a))return Ce(r,S("contactEmailInvalid","The email address is invalid."),"warn").then(()=>t(this,L).contactEmail.focus()),null;let s=t(this,$).contact;return s==null?s={}:s.OptOut!==m&&(m!==!1||s.OptOut_BC===!1)&&(s.selected=!m),s.Name=e,s.ContactPreference=n,s.Email=a,s.MobilePhone=y,s.OptOut=m,s.Notes=o,s}}$=new WeakMap,L=new WeakMap;const ke=window["lib-ui"].Grid,pe=window["lib-ui"].createElement,We=window["lib-ui"].createPopup,Te=window["lib-utility"].nullOrEmpty,J=window["lib-utility"].r,He=window["lib-utility"].contains;class _e{constructor(e={}){C(this,z,void 0);C(this,Q,void 0);T(this,z,e)}async show(e=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(r=>r.tabIndex??0))+3,a=pe("div","follower-grid"),m=await We(J("addFollowers","Add Followers"),pe("div","follower-wrapper",pe("div",r=>r.innerText=J("whoWantReceiveCustomerNotification","Who do you want to receive customer notifications?")),pe("input",r=>{r.type="text",r.tabIndex=n+3,r.className="ui-input follower-search",r.addEventListener("input",()=>{const s=r.value;Te(s)?t(this,Q).source=t(this,z).followers:t(this,Q).source=t(this,z).followers.filter(d=>d.Text||d.Email||He(d.DisplayName,s,!0))})}),a),{text:J("ok","OK"),key:"ok",trigger:()=>{if(typeof t(this,z).onOk=="function")return t(this,z).onOk.call(this,t(this,Q).source.filter(r=>r.Email||r.Text))}},{text:J("cancel","Cancel"),key:"cancel"}).show(e);m.querySelector(".follower-search").focus();const o=new ke(a);return o.columns=[{key:"DisplayName",caption:J("contactName","Contact Name"),width:240},{key:"ContactTypeName",caption:J("contactType","Contact Type"),width:120},{key:"Text",caption:J("text","Text"),type:ke.ColumnTypes.Checkbox,width:60,enabled:r=>!Te(r.Mobile)},{key:"Email",caption:J("email","Email"),type:ke.ColumnTypes.Checkbox,width:70}],o.init(),o.source=t(this,z).followers,T(this,Q,o),m}}z=new WeakMap,Q=new WeakMap;const K=window["lib-ui"].Grid,h=window["lib-ui"].createElement,I=window["lib-ui"].setTooltip,D=window["lib-ui"].createIcon,fe=window["lib-ui"].createCheckbox,Oe=window["lib-ui"].createRadiobox,qe=window["lib-ui"].createPopup,ce=window["lib-ui"].showAlert,de=window["lib-ui"].showConfirm,l=window["lib-utility"].r,N=window["lib-utility"].nullOrEmpty,Be=window["lib-utility"].formatUrl,ye=window["lib-utility"].isEmail,Ve=window["lib-utility"].isPhone;class je extends K.GridColumn{static create(){return h("div","contact-wrapper",h("div","contact-name"),h("div","contact-note"))}static setValue(e,n,a,y,m){const o=e.querySelector(".contact-name");o.innerText=a.Name,o.scrollWidth>o.offsetWidth&&I(o,a.Name,!1,m.element),e.querySelector(".contact-note").innerText=a.Notes}}class Ge{constructor(e){C(this,ee);C(this,te);C(this,be);C(this,ge);C(this,we);C(this,x,void 0);C(this,v,void 0);C(this,X,void 0);C(this,Z,void 0);C(this,ie,void 0);C(this,B,void 0);C(this,W,void 0);C(this,V,{});C(this,H,void 0);C(this,j,void 0);C(this,ue,void 0);T(this,v,e??{})}get autoUpdatesEnabled(){var e;return((e=t(this,ee,me))==null?void 0:e.disabled)!==!0}set autoUpdatesEnabled(e){var a,y,m,o;const n=t(this,ee,me);n!=null&&(e===!1?(n.disabled=!0,(y=(a=n.parentElement)==null?void 0:a.classList)==null||y.add("disabled")):(n.disabled=!1,(o=(m=n.parentElement)==null?void 0:m.classList)==null||o.remove("disabled")))}get autoUpdates(){var e;return(e=t(this,ee,me))==null?void 0:e.checked}set autoUpdates(e){const n=t(this,ee,me);n!=null&&(n.checked=e,n.dispatchEvent(new Event("change")))}get statusLinkEnabled(){var e;return((e=t(this,te,he))==null?void 0:e.disabled)!==!0}set statusLinkEnabled(e){var a,y,m,o;const n=t(this,te,he);n!=null&&(e===!1?(n.disabled=!0,(y=(a=n.parentElement)==null?void 0:a.classList)==null||y.add("disabled")):(n.disabled=!1,(o=(m=n.parentElement)==null?void 0:m.classList)==null||o.remove("disabled")))}get statusLink(){var e;return(e=t(this,te,he))==null?void 0:e.checked}set statusLink(e){const n=t(this,te,he);n!=null&&(n.checked=e,n.dispatchEvent(new Event("change")))}set loading(e){t(this,x)!=null&&(t(this,B).disabled=e,t(this,x).querySelector(".customer-name>.ui-input").disabled=e,t(this,x).querySelector(".button-send-message").disabled=e,t(this,x).querySelector(".button-edit-contacts").disabled=e,t(this,x).querySelector(".button-edit-followers").disabled=e)}get text(){var e;return(e=t(this,B))==null?void 0:e.value}set text(e){const n=t(this,B);n!=null&&(n.value=e,e=String(N(e)?0:val.length)+"/"+String(t(this,v).maxLength),t(this,x).querySelector(".message-bar .prompt-count").innerText=e)}get customerName(){var e;return(e=t(this,x).querySelector(".customer-name>.ui-input"))==null?void 0:e.value}set customerName(e){const n=t(this,x).querySelector(".customer-name>.ui-input");n!=null&&(n.value=e)}get contacts(){return[...t(this,X).children].map(e=>{const n=e.querySelector("span");return{Key:n.dataset.to,Value:n.dataset.name}})}set contacts(e){if(t(this,X).replaceChildren(),(e==null?void 0:e.length)>0){for(let n of e){if(n.OptOut||n.OptOut_BC||n.selected===!1)continue;const a=String(n.MobilePhoneDisplayText).trim(),y=String(n.Email).trim(),m=String(n.ContactPreference);if(m!=="1"&&!Ve(a)||m==="1"&&!ye(y))continue;const o=m==="1"?y:a;let r,s;switch(m){case"0":r="comment-lines",s=l("textsToColon","Texts to:");break;case"2":r="mobile",s=l("callsToColon","Calls to:");break;default:r="envelope",s=l("emailsToColon","Emails to:");break}const d=h("span",g=>{g.dataset.to=o,g.dataset.name=n.Name,g.innerText=n.Name}),b=h("div","contact-item",D("fa-light",r),d);t(this,X).appendChild(b);let p=`${s} ${o}`;d.scrollWidth>d.offsetWidth&&(p=l("nameColon","Name:")+` ${n.Name} -${p}`),I(d,p)}t(this,W).scrollTop=t(this,W).scrollHeight}}set readonly(e){if(t(this,v).readonly=e,t(this,x)==null)return;const n=t(this,x).querySelector(".check-status-link");e===!0?n.classList.add("disabled"):n.classList.remove("disabled"),n.querySelector("input").disabled=e;const a=e===!0?"none":"";t(this,x).querySelector(".button-edit-contacts").style.display=a,t(this,x).querySelector(".button-edit-followers").style.display=a,t(this,x).querySelector(".message-bar").style.display=a}set recordReadonly(e){t(this,v).recordReadonly=e,t(this,x)!=null&&(t(this,x).querySelector(".button-edit-contacts").style.display=e===!0?"none":"",t(this,x).querySelector(".button-edit-followers").style.display=e===!0?"none":"")}set companyName(e){t(this,v).companyName=e;const n=t(this,x).querySelector(".title-company");N(e)?n.style.display="none":(n.innerText=e,n.style.display="")}set companyCode(e){t(this,v).companyCode=e;const n=t(this,x).querySelector(".title-company");N(t(this,v).companyName)?n.style.display="none":(n.innerText=t(this,v).companyName,N(e)||(n.innerText=t(this,v).companyName+"/"+e),n.style.display="")}get followers(){return[...t(this,Z).children].map(e=>{const n=e.querySelector("span");return{Email:n.dataset.email,MobilePhone:n.dataset.mp,Value:n.dataset.name}})}set followers(e){if(t(this,V).followers=e,t(this,Z).replaceChildren(),(e==null?void 0:e.length)>0){t(this,x).querySelector(".follower-bar").style.display="",t(this,x).querySelector(".follower-bar>.bar-list").appendChild(t(this,ie));for(let n of e){if(n.OptOut)continue;const a=String(n.MobilePhone).trim(),y=String(n.Email).trim(),m=[];n.SendEmail&&m.push(l("emailsToColon","Emails to:")+` ${y}`),n.SendText&&m.push(l("textsToColon",`Texts to: ${a}`));let o;n.SendText&&n.SendEmail?o="at":o=n.SendText?"comment-lines":"envelope";const r=h("span",d=>{n.SendEmail&&(d.dataset.email=y),n.SendText&&(d.dataset.mp=a),d.dataset.name=n.Name,d.innerText=n.Name}),s=h("div","contact-item",D("fa-light",o),r);t(this,Z).appendChild(s),r.scrollWidth>r.offsetWidth&&m.splice(0,0,l("nameColon","Name:")+` ${c.Name}`),I(r,m.join(` -`))}}else t(this,x).querySelector(".follower-bar").style.display="none",t(this,x).querySelector(".button-edit-contacts").insertAdjacentElement("beforebegin",t(this,ie));t(this,W).scrollTop=t(this,W).scrollHeight}setData(e,n){t(this,V)[e]=n}create(){const e=t(this,v),n=e.readonly,a=fe({className:"check-auto-update",checked:e.autoUpdates,checkedNode:D("fa-regular","redo-alt"),uncheckedNode:D("fa-regular","ban"),onchange:function(){I(a,this.checked?l("autoUpdateEnabled","Auto Updates Enabled"):l("autoUpdateDisabled","Auto Updates Disabled"))}});e.autoUpdatesVisible===!1&&(a.style.display="none");const y=fe({className:"check-status-link",enabled:!n,checked:e.statusLink,checkedNode:D("fa-regular","link"),uncheckedNode:D("fa-regular","unlink"),onchange:function(){I(y,this.checked?l("statusLinkIncluded","Status Link Included"):l("statusLinkExcluded","Status Link Excluded"))}});e.statusLinkVisible===!1&&(y.style.display="none");const m=ae(h("div",null,h("div",s=>{s.className="title-module",s.innerText=e.title??l("messages","Customer Communication")}),h("div",s=>{s.className="title-company",N(e.companyName)?s.style.display="none":N(e.companyCode)?s.innerText=e.companyName:s.innerText=e.companyName+"/"+e.companyCode})),[I(a,l("autoUpdateEnabled","Auto Updates Enabled")),I(y,l("statusLinkExcluded","Status Link Excluded"))]);T(this,X,xe(this,be,Le).call(this,m,e)),T(this,Z,xe(this,ge,Pe).call(this,m,e));const o=h("textarea","ui-text");o.placeholder=l("typeMessage","Enter Message Here"),e.maxLength??(e.maxLength=3e3),o.maxLength=e.maxLength,o.addEventListener("input",()=>{const s=t(this,B).value,d=String(N(s)?0:s.length)+"/"+String(e.maxLength);t(this,x).querySelector(".message-bar .prompt-count").innerText=d}),T(this,B,o),m.appendChild(h("div",s=>{s.className="message-bar",n===!0&&(s.style.display="none")},o,h("div",s=>s.style.textAlign="right",h("div",s=>{s.className="customer-name",e.customerNameVisible!==!0&&(s.style.display="none")},h("span",s=>s.innerText=l("nameColon","Name:")),h("input",s=>{s.type="text",s.className="ui-input"})),h("div","prompt-count"),h("button",s=>{s.className="roundbtn button-send-message",s.style.backgroundColor="rgb(19, 150, 204)",s.appendChild(D("fa-solid","paper-plane")),I(s,l("sendMessage","Send Message")),s.addEventListener("click",()=>{const d=t(this,B).value;if(N(d==null?void 0:d.trim())){ce(l("error","Error"),l("messageRequired","Please input the message."),"warn");return}typeof t(this,v).onAddMessage=="function"&&t(this,v).onAddMessage(t(this,B).value)})}))));const r=h("div","list-bar");return T(this,W,r),m.appendChild(r),T(this,x,m)}load(e,n,a){var m;const y=[];if((e==null?void 0:e.length)>0){n??(n=t(this,V).contacts),a??(a=t(this,V).allfollowers);for(let o of e){const r=h("div","item-div");let s;if(o.IsReply&&(n==null?void 0:n.length)>0){const p=ye(o.Sender)?n.find(g=>g.Email===o.Sender):n.find(g=>g.MobilePhone===o.Sender);s=p==null?void 0:p.Name}s??(s=o.IsReply&&String(o.FormatSender)!==""?o.FormatSender:o.Sender);let d="";if(!o.IsReply&&((m=o.OriPhoneNumbers)==null?void 0:m.length)>0)for(let p of o.OriPhoneNumbers){let g;const i=ye(p);if((n==null?void 0:n.length)>0){let w=i?n.find(f=>f.Email===p):n.find(f=>f.MobilePhone===p);w!=null?g=`${i?w.Email:w.MobilePhoneDisplayText} - ${w.Name}`:(a==null?void 0:a.length)>0&&(w=i?a.find(f=>f.Email===p):a.find(f=>f.MobilePhone===p),w!=null&&(g=`${i?w.Email:w.MobilePhoneDisplayText} - ${w.Name}`))}d+=(g??p)+` -`}d!==""&&(d=l("sendToColon","Send To :")+` -${d}`),r.appendChild(h("div",p=>{p.className="item-poster",p.innerText=s,!o.IsReply&&(d==null?void 0:d.length)>0&&I(p,d)}));const b=h("div","item-content");if(b.appendChild(h("span",p=>{/https?:\/\//i.test(o.Message)?p.innerHTML=Be(o.Message):p.innerText=o.Message})),o.IsReply)r.classList.add("item-other");else{r.classList.add("item-self");const[p,g]=xe(this,we,Fe).call(this,o);if(p!==-100){let i;switch(p){case 0:i=l("pending","Pending"),b.style.backgroundColor="#ffc107";break;case 1:i=l("sent","Sent");break;case 9:i=l("failed","Failed"),b.style.backgroundColor="#ffc107";break;case 10:i=l("optOut","Opt-Out"),b.style.backgroundColor="#ffc107";break;case 412:i=l("landline","Landline"),b.style.backgroundColor="#ffc107";break;default:i=l("undelivered","Undelivered"),b.style.backgroundColor="#ffc107";break}const w=h("div",f=>{f.className="item-status",f.innerText=i,p==-10&&I(f,g)});b.appendChild(w)}}r.append(b,h("div",p=>{p.className="item-time",p.innerText=o.TimeStr})),y.push(r)}y[0].style.marginTop="0"}t(this,W).replaceChildren(...y),t(this,W).scrollTop=t(this,W).scrollHeight}}x=new WeakMap,v=new WeakMap,X=new WeakMap,Z=new WeakMap,ie=new WeakMap,B=new WeakMap,W=new WeakMap,V=new WeakMap,H=new WeakMap,j=new WeakMap,ue=new WeakMap,ee=new WeakSet,me=function(){return t(this,x).querySelector(".check-auto-update>input")},te=new WeakSet,he=function(){return t(this,x).querySelector(".check-status-link>input")},be=new WeakSet,Le=function(e,n){const a=n.readonly,y=n.recordReadonly,m=h("div","bar-list-container");return e.append(h("div","contact-bar",h("div","bar-icon",D("fa-solid","user-circle",{fill:"lightgray"})),h("div","bar-list",m,h("button",o=>{o.className="roundbtn button-edit-contacts",o.style.backgroundColor="rgb(1, 199, 172)",a===!0&&(o.style.display="none"),o.appendChild(D("fa-solid","user-edit")),I(o,l("editContacts","Edit Contacts")),o.addEventListener("click",()=>{const r=qe(h("div",s=>{s.style.display="flex",s.style.alignItems="center",s.append(h("div",d=>{d.className="ui-popup-move",d.style.flex="1 1 auto"},h("div",d=>d.innerText=l("editContacts","Edit Contacts")),h("div",d=>{d.className="title-company",N(n.companyName)?d.style.display="none":N(n.companyCode)?d.innerText=n.companyName:d.innerText=n.companyName+"/"+n.companyCode})),h("button",d=>{d.style.flex="0 0 auto",d.style.backgroundColor="rgb(1, 199, 172)",d.style.marginRight="10px",d.className="roundbtn button-add-contact",y&&(d.style.display="none"),d.appendChild(D("fa-solid","user-plus",{width:"16px",height:"16px"})),d.addEventListener("click",()=>{new Ee({company:!N(t(this,v).companyName),onSave:p=>{if(t(this,H).source.some(i=>i.Name===p.Name&&i.MobilePhone===p.MobilePhone))return ce(l("addContact","Add Contact"),l("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const i=n.onSave(p,!0);return typeof(i==null?void 0:i.then)=="function"?i.then(w=>(t(this,H).source=w.filter(f=>f.Id>=0).map(f=>(f.OptOut||f.OptOut_BC||typeof f.selected>"u"&&(f.selected=!0),f)),t(this,j).source=w.filter(f=>f.Id<0).map(f=>(f.OptOut||f.OptOut_BC||typeof f.selected>"u"&&(f.selected=!0),f)),w)):!1}}}).show(e)}),I(d,l("addContact","Add Contact"))}))}),h("div",null,h("div",s=>{N(t(this,v).companyName)&&(s.style.display="none"),s.style.fontWeight="bold",s.innerText=l("contactFromRecord","Contacts from Customer Record")}),h("div",s=>{N(t(this,v).companyName)&&(s.style.display="none"),s.className="contacts-record",s.style.maxHeight="200px",s.style.width="675px",s.style.overflow="auto"}),h("div",s=>{s.style.fontWeight="bold",s.innerText=l("contactFromWorkOrder","Contacts not on Customer Record")}),h("div",s=>{s.className="contacts-wo",s.style.maxHeight="200px",s.style.width="675px",s.style.overflow="auto"})));r.show(e).then(()=>{const s=u=>({key:"selected",type:K.ColumnTypes.Checkbox,width:50,enabled:F=>!F.OptOut&&!F.OptOut_BC,onchanged:function(){typeof n.onChanged=="function"&&n.onChanged([...t(u,H).source,...t(u,j).source])}}),d={key:"type",type:K.ColumnTypes.Icon,width:50,filter:u=>{switch(String(u.ContactPreference)){case"0":return"comment-lines";case"2":return"mobile";default:return"envelope"}},className:"icon-contact-type",iconType:"fa-light"},b={key:"Name",type:je,width:160},p={type:K.ColumnTypes.Icon,width:40,visible:!y,align:"center",iconType:"fa-light"},g=u=>({key:"edit",...p,text:"edit",tooltip:l("edit","Edit"),events:{onclick:function(){new Ee({contact:this,company:!N(t(u,v).companyName),onSave:(A,le)=>{if(t(u,H).source.some(U=>U!==this&&U.Name===A.Name&&U.MobilePhone===A.MobilePhone)||t(u,j).source.some(U=>U!==this&&U.Name===A.Name&&U.MobilePhone===A.MobilePhone))return ce(l("editContact","Edit Contact"),l("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const U=n.onSave(A);return typeof(U==null?void 0:U.then)=="function"?U.then(Ne=>(t(u,H).source=Ne.filter(q=>q.Id>=0).map(q=>(q.OptOut||q.OptOut_BC||typeof q.selected>"u"&&(q.selected=!0),q)),t(u,j).source=Ne.filter(q=>q.Id<0).map(q=>(q.OptOut||q.OptOut_BC||typeof q.selected>"u"&&(q.selected=!0),q)),Ne)):!1}}}).show(e)}}}),i=new K;i.height=0,i.allowHtml=!0,i.headerVisible=!1,i.columns=[s(this),d,b,{key:"Email",width:180},{key:"MobilePhoneDisplayText",width:130},g(this),{key:"delete",...p,text:"times",tooltip:l("delete","Delete"),events:{onclick:function(){de(l("remoteContact","Remove Contact"),h("div",null,h("div",u=>{u.style.paddingLeft="16px",u.innerText=l("removeFrom","Remove {name} from").replace("{name}",this.Name)}),h("div",u=>{u.style.display="flex",u.style.justifyContent="center",u.style.marginTop="10px"},Oe({name:"remove-type",label:l("customerRecord","Customer Record"),checked:!0,className:"radio-customer-record"}),Oe({name:"remove-type",label:l("workOrder","Work Order")}))),[{key:"ok",text:l("ok","OK")},{key:"cancel",text:l("cancel","Cancel")}]).then(u=>{if((u==null?void 0:u.key)==="ok"){const F=u.popup.container.querySelector(".radio-customer-record>input").checked;typeof n.onDelete=="function"&&n.onDelete(u.key,this,F);const A=i.source.indexOf(this);if(A>=0){const le=i.source;le.splice(A,1),i.extraRows=le.filter(Re=>!N(Re.Notes)).length,i.source=le}}})}}}],i.init(r.container.querySelector(".contacts-record"));const w=t(this,V).contacts.filter(u=>u.Id>=0).map(u=>(u.OptOut||u.OptOut_BC||typeof u.selected>"u"&&(u.selected=!0),u));i.extraRows=w.filter(u=>!N(u.Notes)).length,i.source=w,i.selectedRowChanged=u=>{var F;u>=0&&((F=t(this,j).selectedIndexes)==null?void 0:F.length)>0&&(t(this,j).selectedIndexes=[])},T(this,H,i);const f=new K;f.height=0,f.allowHtml=!0,f.headerVisible=!1,f.columns=[s(this),d,b,{key:"Email",width:180},{key:"MobilePhoneDisplayText",width:130},g(this),{key:"delete",...p,text:"times",tooltip:l("delete","Delete"),events:{onclick:function(){de(l("remoteContact","Remove Contact"),l("removeFromWorkorder",`You are removing {name} from work order. +(function(v,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(v=typeof globalThis<"u"?globalThis:v||self,E(v["lib-app"]={}))})(this,function(v){var _,q,K,Q,V,X,w,k,Z,ee,Y,G,W,A,U,H,te,de,ne,ue,fe,Ae,ye,$e,ge,Fe,z,$,j,oe;"use strict";var ve=(v,E,P)=>{if(!E.has(v))throw TypeError("Cannot "+P)};var e=(v,E,P)=>(ve(v,E,"read from private field"),P?P.call(v):E.get(v)),N=(v,E,P)=>{if(E.has(v))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(v):E.set(v,P)},O=(v,E,P,re)=>(ve(v,E,"write to private field"),re?re.call(v,P):E.set(v,P),P);var be=(v,E,P)=>(ve(v,E,"access private method"),P);const E="",P=window["lib-ui"].createElement;function re(ie,t){const n=P("div","comm"),s=P("div","title-bar",ie,P("div","title-functions",...t));return n.appendChild(s),n}const Ce=window["lib-ui"].Grid,_e=window["lib-ui"].Dropdown,S=window["lib-ui"].createElement,Ue=window["lib-ui"].createCheckbox,Oe=window["lib-ui"].Popup,we=window["lib-ui"].showAlert,De=window["lib-utility"].isEmail,ce=window["lib-utility"].nullOrEmpty,x=window["lib-utility"].r;class Ee{constructor(t={}){N(this,_,void 0);N(this,q,void 0);O(this,_,t)}async show(t=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(l=>l.tabIndex??0))+3,s=e(this,_).contact,u=S("input",l=>{l.type="text",l.className="ui-input",l.tabIndex=n+1,l.maxLength=200,l.autocomplete="off"}),p=new _e({tabIndex:n+2});p.source=[{value:"0",text:x("text","Text")},{value:"1",text:x("email","Email")},{value:"2",text:x("phone","Phone")}];const i=S("input",l=>{l.type="email",l.className="ui-input",l.tabIndex=n+3,l.maxLength=100,l.autocomplete="off"}),d=S("input",l=>{l.type="tel",l.className="ui-input",l.tabIndex=n+4,l.maxLength=50,l.autocomplete="off"}),o=Ue({tabIndex:n+5}),a=S("textarea",l=>{l.className="ui-text",l.tabIndex=n+6,l.maxLength=2e3,l.style.height="100px"}),b=[];e(this,_).company&&b.push({text:s==null?x("addContactRecord","Add Contact Record"):x("editContactRecord","Edit Contact Record"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.SaveToCustomer=1,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"customerrecord")}}),b.push({text:x("workOrderOnly","Work Order Only"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.Id=-1,l.SaveToCustomer=0,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"workorder")}},{text:x("cancel","Cancel")});const y=new Oe({onMasking:e(this,_).onMasking,title:s==null?x("addContact","Add Contact"):x("editContact","Edit Contact"),content:S("div",l=>{l.className="setting-wrapper",l.style.width="500px"},S("div","setting-item",S("span","setting-label setting-required",x("contactNameColon","Contact Name:")),u),S("div","setting-item",S("span","setting-label",x("contactPreferencesColon","Contact Preferences:")),p.create()),S("div","setting-item",S("span","setting-label",x("contactEmailColon","Email Address:")),i),S("div","setting-item",S("span","setting-label",x("contactMobileColon","Mobile:")),d),S("div","setting-item",S("span","setting-label",x("contactOptColon","Opt Out:")),o),S("div","setting-item",S("span","setting-label",x("contactNotesColon","Notes:")),a)),buttons:b});s!=null?(u.value=s.Name,p.select(String(s.ContactPreference)),i.value=s.Email,d.value=s.MobilePhone,o.querySelector("input").checked=s.OptOut,a.value=s.Notes):p.select("0"),O(this,q,{contactName:u,preferences:p,contactEmail:i,contactMobile:d,checkOpt:o,contactNotes:a});const C=await y.show(t);return setTimeout(()=>u.focus()),C}prepare(){const t=e(this,q).contactName.value,n=e(this,q).preferences.selected.value,s=e(this,q).contactEmail.value,u=e(this,q).contactMobile.value,p=e(this,q).checkOpt.querySelector("input").checked,i=e(this,q).contactNotes.value,d=e(this,_).contact==null?x("addContact","Add Contact"):x("editContact","Edit Contact");if(ce(t))return we(d,x("contactNameRequired","Contact Name cannot be empty."),"warn").then(()=>e(this,q).contactName.focus()),null;if(ce(s)&&ce(u))return we(d,x("contactEmailPhoneRequired","Email and Mobile Phone cannot both be empty."),"warn").then(()=>ce(s)?e(this,q).contactEmail.focus():e(this,q).contactMobile.focus()),null;if(!ce(s)&&!De(s))return we(d,x("contactEmailInvalid","The email address is invalid."),"warn").then(()=>e(this,q).contactEmail.focus()),null;let o=e(this,_).contact;return o==null?o={}:o.OptOut!==p&&(p!==!1||o.OptOut_BC===!1)&&(o.selected=!p),o.Name=t,o.ContactPreference=n,o.Email=s,o.MobilePhone=u,o.OptOut=p,o.Notes=i,o}}_=new WeakMap,q=new WeakMap;class Be{constructor(t={}){N(this,K,void 0);N(this,Q,void 0);O(this,K,t)}async show(t,n=document.body){const s=S("div","selcontact-grid"),p=await new Oe({onMasking:e(this,K).onMasking,title:t,content:S("div","selcontact-wrapper",s),buttons:[{text:x("ok","OK"),key:"ok",trigger:()=>{if(typeof e(this,K).onOk=="function")return e(this,K).onOk.call(this,e(this,Q).source.filter(d=>d.selected))}},{text:x("cancel","Cancel"),key:"cancel"}]}).show(n),i=new Ce(s);return i.columns=[{key:"selected",type:Ce.ColumnTypes.Checkbox,width:40},{key:"Name",caption:x("P_CR_CONTACTNAME","Contact Name"),width:100},{key:"Email",caption:x("P_CR_CONTACTEMAIL","Contact Email"),css:{width:180,"text-align":"left"}},{key:"MobilePhoneDisplayText",caption:x("P_CR_CONTACTMOBILE","Contact Mobile"),width:130},{key:"ContactPreferenceStr",caption:x("P_CR_CONTACTPREFERENCES","Contact Preferences"),width:100},{key:"OptOut",caption:x("P_CR_OPTOUT","Opt Out"),type:Ce.ColumnTypes.Checkbox,width:70,enabled:!1,align:"center"},{key:"Notes",caption:x("P_CR_NOTES","Notes"),width:120}],i.init(),i.source=e(this,K).contacts.sort(function(d,o){return(o.Text||o.Email?1:0)-(d.Text||d.Email?1:0)}),O(this,Q,i),p}set source(t){e(this,K).contacts=t,e(this,Q)!=null&&(e(this,Q).source=t)}}K=new WeakMap,Q=new WeakMap;const xe=window["lib-ui"].Grid,me=window["lib-ui"].createElement,We=window["lib-ui"].Popup,Se=window["lib-utility"].nullOrEmpty,J=window["lib-utility"].r,He=window["lib-utility"].contains;class Ve{constructor(t={}){N(this,V,void 0);N(this,X,void 0);O(this,V,t)}async show(t,n=document.body){const s=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(o=>o.tabIndex??0))+3,u=me("div","follower-grid"),i=await new We({onMasking:e(this,V).onMasking,title:t,content:me("div","follower-wrapper",me("div",o=>o.innerText=J("whoWantReceiveCustomerNotification","Who do you want to receive customer notifications?")),me("input",o=>{o.type="text",o.tabIndex=s+3,o.className="ui-input follower-search",o.addEventListener("input",()=>{const a=o.value;Se(a)?e(this,X).source=e(this,V).followers.sort(function(b,y){return(y.Text||y.Email?1:0)-(b.Text||b.Email?1:0)}):e(this,X).source=e(this,V).followers.filter(b=>b.Text||b.Email||He(b.DisplayName,a,!0)).sort(function(b,y){return(y.Text||y.Email?1:0)-(b.Text||b.Email?1:0)})})}),u),buttons:[{text:J("ok","OK"),key:"ok",trigger:()=>{if(typeof e(this,V).onOk=="function")return e(this,V).onOk.call(this,e(this,X).source.filter(o=>o.Email||o.Text))}},{text:J("cancel","Cancel"),key:"cancel"}]}).show(n);i.querySelector(".follower-search").focus();const d=new xe(u);return d.columns=[{key:"DisplayName",caption:J("contactName","Contact Name"),width:240},{key:"ContactTypeName",caption:J("contactType","Contact Type"),width:120},{key:"Text",caption:J("text","Text"),type:xe.ColumnTypes.Checkbox,width:60,enabled:o=>!Se(o.Mobile)},{key:"Email",caption:J("email","Email"),type:xe.ColumnTypes.Checkbox,width:70}],d.init(),d.source=e(this,V).followers.sort(function(o,a){return(a.Text||a.Email?1:0)-(o.Text||o.Email?1:0)}),O(this,X,d),i}}V=new WeakMap,X=new WeakMap;const se=window["lib-ui"].Grid,f=window["lib-ui"].createElement,M=window["lib-ui"].setTooltip,F=window["lib-ui"].createIcon,Te=window["lib-ui"].createCheckbox,Me=window["lib-ui"].createRadiobox,pe=window["lib-ui"].showAlert,Re=window["lib-ui"].showConfirm,Ge=window["lib-ui"].Popup,r=window["lib-utility"].r,T=window["lib-utility"].nullOrEmpty,je=window["lib-utility"].formatUrl,he=window["lib-utility"].isEmail,Ke=window["lib-utility"].isPhone;class ze extends se.GridColumn{static create(){return f("div","contact-wrapper",f("div","contact-name"),f("div","contact-note"))}static setValue(t,n,s,u,p){const i=t.querySelector(".contact-name");i.innerText=s.Name,i.scrollWidth>i.offsetWidth&&M(i,s.Name,!1,p.element),t.querySelector(".contact-note").innerText=s.Notes}}class Ye{constructor(t){N(this,te);N(this,ne);N(this,fe);N(this,ye);N(this,ge);N(this,w,void 0);N(this,k,void 0);N(this,Z,void 0);N(this,ee,void 0);N(this,Y,void 0);N(this,G,void 0);N(this,W,void 0);N(this,A,{});N(this,U,void 0);N(this,H,void 0);O(this,k,t??{})}get autoUpdatesEnabled(){var t;return((t=e(this,te,de))==null?void 0:t.disabled)!==!0}set autoUpdatesEnabled(t){var s,u,p,i;const n=e(this,te,de);n!=null&&(t===!1?(n.disabled=!0,(u=(s=n.parentElement)==null?void 0:s.classList)==null||u.add("disabled")):(n.disabled=!1,(i=(p=n.parentElement)==null?void 0:p.classList)==null||i.remove("disabled")))}get autoUpdates(){var t;return(t=e(this,te,de))==null?void 0:t.checked}set autoUpdates(t){const n=e(this,te,de);n!=null&&(n.checked=t,n.dispatchEvent(new Event("change")))}get statusLinkEnabled(){var t;return((t=e(this,ne,ue))==null?void 0:t.disabled)!==!0}set statusLinkEnabled(t){var s,u,p,i;const n=e(this,ne,ue);n!=null&&(t===!1?(n.disabled=!0,(u=(s=n.parentElement)==null?void 0:s.classList)==null||u.add("disabled")):(n.disabled=!1,(i=(p=n.parentElement)==null?void 0:p.classList)==null||i.remove("disabled")))}get statusLink(){var t;return(t=e(this,ne,ue))==null?void 0:t.checked}set statusLink(t){const n=e(this,ne,ue);n!=null&&(n.checked=t,n.dispatchEvent(new Event("change")))}set loading(t){e(this,w)!=null&&(e(this,G).disabled=t,e(this,w).querySelector(".customer-name>.ui-input").disabled=t,e(this,w).querySelector(".button-send-message").disabled=t,e(this,w).querySelector(".button-edit-contacts").disabled=t,e(this,w).querySelector(".button-edit-followers").disabled=t)}get text(){var t;return(t=e(this,G))==null?void 0:t.value}set text(t){const n=e(this,G);n!=null&&(n.value=t,t=String(T(t)?0:val.length)+"/"+String(e(this,k).maxLength),e(this,w).querySelector(".message-bar .prompt-count").innerText=t)}get customerName(){var t;return(t=e(this,w).querySelector(".customer-name>.ui-input"))==null?void 0:t.value}set customerName(t){const n=e(this,w).querySelector(".customer-name>.ui-input");n!=null&&(n.value=t)}get contacts(){return[...e(this,Z).children].filter(t=>t.querySelector("span").dataset.notsend=="false").map(t=>{const n=t.querySelector("span");return{Key:n.dataset.to,Value:n.dataset.name}})}set contacts(t){if(e(this,Z).replaceChildren(),(t==null?void 0:t.length)>0){var n=t.sort(function(s,u){return s.Name==u.Name?0:s.Name>u.Name?1:-1});for(let s of n){const u=String(s.MobilePhoneDisplayText).trim(),p=String(s.Email).trim(),i=String(s.ContactPreference);if(i!=="1"&&!Ke(u)||i==="1"&&!he(p))continue;const d=i==="1"?p:u;let o,a;if(s.OptOut||s.OptOut_BC||s.selected===!1)o="times",a=r("optedOut","Opted Out:");else switch(i){case"0":o="comment-lines",a=r("textsToColon","Texts to:");break;case"2":o="mobile",a=r("callsToColon","Calls to:");break;default:o="envelope",a=r("emailsToColon","Emails to:");break}const b=f("span",l=>{l.dataset.to=d,l.dataset.name=s.Name,l.dataset.notsend=s.OptOut||s.OptOut_BC||s.selected===!1,l.innerText=s.Name}),y=f("div","contact-item",F("fa-light",o,{fill:s.OptOut||s.OptOut_BC||s.selected===!1?"red":""}),b);e(this,Z).appendChild(y);let C=`${a} ${d}`;b.scrollWidth>b.offsetWidth&&(C=r("nameColon","Name:")+` ${s.Name} +${C}`),M(b,C)}e(this,W).scrollTop=e(this,W).scrollHeight}}set readonly(t){if(e(this,k).readonly=t,e(this,w)==null)return;const n=e(this,w).querySelector(".check-status-link");t===!0?n.classList.add("disabled"):n.classList.remove("disabled"),n.querySelector("input").disabled=t;const s=t===!0?"none":"";e(this,w).querySelector(".button-edit-contacts").style.display=s,e(this,w).querySelector(".button-edit-followers").style.display=s,e(this,w).querySelector(".message-bar").style.display=s}set recordReadonly(t){e(this,k).recordReadonly=t,e(this,w)!=null&&(e(this,w).querySelector(".button-edit-contacts").style.display=t===!0?"none":"",e(this,w).querySelector(".button-edit-followers").style.display=t===!0?"none":"")}set companyName(t){e(this,k).companyName=t;const n=e(this,w).querySelector(".title-company");T(t)?n.style.display="none":(n.innerText=t,n.style.display="")}set companyCode(t){e(this,k).companyCode=t;const n=e(this,w).querySelector(".title-company");T(e(this,k).companyName)?n.style.display="none":(n.innerText=e(this,k).companyName,T(t)||(n.innerText=e(this,k).companyName+"/"+t),n.style.display="")}get followers(){return[...e(this,ee).children].map(t=>{const n=t.querySelector("span");return{Email:n.dataset.email,MobilePhone:n.dataset.mp,Value:n.dataset.name}})}set followers(t){if(e(this,A).followers=t,e(this,ee).replaceChildren(),(t==null?void 0:t.length)>0){e(this,w).querySelector(".follower-bar").style.display="",M(e(this,Y),r("editFollower","Edit Followers")),e(this,w).querySelector(".follower-bar>.bar-list").appendChild(e(this,Y));for(let n of t){if(n.OptOut)continue;const s=String(n.MobilePhone).trim(),u=String(n.Email).trim(),p=[];n.SendEmail&&p.push(r("emailsToColon","Emails to:")+` ${u}`),n.SendText&&p.push(r("textsToColon",`Texts to: ${s}`));let i;n.SendText&&n.SendEmail?i="at":i=n.SendText?"comment-lines":"envelope";const d=f("span",a=>{n.SendEmail&&(a.dataset.email=u),n.SendText&&(a.dataset.mp=s),a.dataset.name=n.Name,a.innerText=n.Name}),o=f("div","contact-item",F("fa-light",i),d);e(this,ee).appendChild(o),d.scrollWidth>d.offsetWidth&&p.splice(0,0,r("nameColon","Name:")+` ${c.Name}`),M(d,p.join(` +`))}}else e(this,w).querySelector(".follower-bar").style.display="none",M(e(this,Y),r("addFollowers","Add Followers")),e(this,w).querySelector(".button-edit-contacts").insertAdjacentElement("beforebegin",e(this,Y));e(this,W).scrollTop=e(this,W).scrollHeight}setData(t,n){e(this,A)[t]=n}create(){const t=e(this,k),n=t.readonly,s=Te({className:"check-auto-update",checked:t.autoUpdates,checkedNode:F("fa-regular","redo-alt"),uncheckedNode:F("fa-regular","ban"),onchange:function(){M(s,this.checked?r("autoUpdateEnabled","Auto Updates Enabled"):r("autoUpdateDisabled","Auto Updates Disabled"))}});t.autoUpdatesVisible===!1&&(s.style.display="none");const u=Te({className:"check-status-link",enabled:!n,checked:t.statusLink,checkedNode:F("fa-regular","link"),uncheckedNode:F("fa-regular","unlink"),onchange:function(){M(u,this.checked?r("statusLinkIncluded","Status Link Included"):r("statusLinkExcluded","Status Link Excluded"))}});t.statusLinkVisible===!1&&(u.style.display="none");const p=re(f("div",null,f("div",o=>{o.className="title-module",o.innerText=t.title??r("messages","Customer Communication")}),f("div",o=>{o.className="title-company",T(t.companyName)?o.style.display="none":T(t.companyCode)?o.innerText=t.companyName:o.innerText=t.companyName+"/"+t.companyCode})),[M(s,r("autoUpdateEnabled","Auto Updates Enabled")),M(u,r("statusLinkExcluded","Status Link Excluded"))]);O(this,Z,be(this,fe,Ae).call(this,p,t)),O(this,ee,be(this,ye,$e).call(this,p,t));const i=f("textarea","ui-text");i.placeholder=r("typeMessage","Enter Message Here"),t.maxLength??(t.maxLength=3e3),i.maxLength=t.maxLength,i.addEventListener("input",()=>{const o=e(this,G).value,a=String(T(o)?0:o.length)+"/"+String(t.maxLength);e(this,w).querySelector(".message-bar .prompt-count").innerText=a}),O(this,G,i),p.appendChild(f("div",o=>{o.className="message-bar",n===!0&&(o.style.display="none")},i,f("div",o=>o.style.textAlign="right",f("div",o=>{o.className="customer-name",t.customerNameVisible!==!0&&(o.style.display="none")},f("span",o=>o.innerText=r("nameColon","Name:")),f("input",o=>{o.type="text",o.className="ui-input"})),f("div","prompt-count"),f("button",o=>{o.className="roundbtn button-send-message",o.style.backgroundColor="rgb(19, 150, 204)",o.appendChild(F("fa-solid","paper-plane")),M(o,r("sendMessage","Send Message")),o.addEventListener("click",()=>{const a=e(this,G).value;if(T(a==null?void 0:a.trim())){pe(r("error","Error"),r("messageRequired","Please input the message."),"warn");return}typeof e(this,k).onAddMessage=="function"&&e(this,k).onAddMessage(e(this,G).value)})}))));const d=f("div","list-bar");return O(this,W,d),p.appendChild(d),O(this,w,p)}load(t,n,s){var p;const u=[];if((t==null?void 0:t.length)>0){n??(n=e(this,A).contacts),s??(s=e(this,A).allfollowers);for(let i of t){const d=f("div","item-div");let o;if(i.IsReply&&(n==null?void 0:n.length)>0){const y=he(i.Sender)?n.find(C=>C.Email===i.Sender):n.find(C=>C.MobilePhone===i.Sender);o=y==null?void 0:y.Name}o??(o=i.IsReply&&String(i.FormatSender)!==""?i.FormatSender:i.Sender);let a="";if(!i.IsReply&&((p=i.OriPhoneNumbers)==null?void 0:p.length)>0)for(let y of i.OriPhoneNumbers){let C;const l=he(y);if((n==null?void 0:n.length)>0){let m=l?n.find(g=>g.Email===y):n.find(g=>g.MobilePhone===y);m!=null?C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`:(s==null?void 0:s.length)>0&&(m=l?s.find(g=>g.Email===y):s.find(g=>g.MobilePhone===y),m!=null&&(C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`))}a+=(C??y)+` +`}a!==""&&(a=r("sendToColon","Send To :")+` +${a}`),d.appendChild(f("div",y=>{y.className="item-poster",y.innerText=o,!i.IsReply&&(a==null?void 0:a.length)>0&&M(y,a)}));const b=f("div","item-content");if(b.appendChild(f("span",y=>{/https?:\/\//i.test(i.Message)?y.innerHTML=je(i.Message):y.innerText=i.Message})),i.IsReply)d.classList.add("item-other");else{d.classList.add("item-self");const[y,C]=be(this,ge,Fe).call(this,i);if(y!==-100){let l;switch(y){case 0:l=r("pending","Pending"),b.style.backgroundColor="#ffc107";break;case 1:l=r("sent","Sent");break;case 9:l=r("failed","Failed"),b.style.backgroundColor="#ffc107";break;case 10:l=r("optOut","Opt-Out"),b.style.backgroundColor="#ffc107";break;case 412:l=r("landline","Landline"),b.style.backgroundColor="#ffc107";break;default:l=r("undelivered","Undelivered"),b.style.backgroundColor="#ffc107";break}const m=f("div",g=>{g.className="item-status",g.innerText=l,y==-10&&M(g,C)});b.appendChild(m)}}d.append(b,f("div",y=>{y.className="item-time",y.innerText=i.TimeStr})),u.push(d)}u[0].style.marginTop="0"}e(this,W).replaceChildren(...u),e(this,W).scrollTop=e(this,W).scrollHeight}}w=new WeakMap,k=new WeakMap,Z=new WeakMap,ee=new WeakMap,Y=new WeakMap,G=new WeakMap,W=new WeakMap,A=new WeakMap,U=new WeakMap,H=new WeakMap,te=new WeakSet,de=function(){return e(this,w).querySelector(".check-auto-update>input")},ne=new WeakSet,ue=function(){return e(this,w).querySelector(".check-status-link>input")},fe=new WeakSet,Ae=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container");return t.append(f("div","contact-bar",f("div","bar-icon",F("fa-solid","user-circle",{fill:"lightgray"})),f("div","bar-list",p,f("button",i=>{i.className="roundbtn button-edit-contacts",i.style.backgroundColor="rgb(1, 199, 172)",s===!0&&(i.style.display="none"),i.appendChild(F("fa-solid","user-edit")),M(i,r("editContacts","Edit Contacts")),i.addEventListener("click",()=>{const d=new Ge({onMasking:n.onMasking,title:f("div",o=>{o.style.display="flex",o.style.alignItems="center",o.append(f("div",a=>{a.className="ui-popup-move",a.style.flex="1 1 auto"},f("div",a=>a.innerText=r("editContacts","Edit Contacts")),f("div",a=>{a.className="title-company",T(n.companyName)?a.style.display="none":T(n.companyCode)?a.innerText=n.companyName:a.innerText=n.companyName+"/"+n.companyCode})),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-from-customer-record",u&&(a.style.display="none"),a.appendChild(F("fa-solid","handshake",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{const b=new Be({contacts:[],onOk:C=>{typeof e(this,k).onSelectCRContacts=="function"&&(C==null||C.map(m=>(delete m.selected,m)),e(this,k).onSelectCRContacts(C));const l=e(this,A).contacts;e(this,U).source=l.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),e(this,H).source=l.filter(m=>m.Id<0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m))}});var y=r("selectFromCustomerRecord","Select from Customer Record");if(b.show(y,t),typeof e(this,k).onOpenSelectCRContacts=="function"){const C=e(this,k).onOpenSelectCRContacts();return typeof(C==null?void 0:C.then)=="function"?C.then(l=>(l.map(m=>{for(let g of e(this,A).contacts)if(m.Id===g.Id){m.selected=!0;break}return typeof m.selected>"u"&&(m.selected=!1),m}),e(this,A).contacts.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),b.source=l,l)):!1}}),M(a,r("selectFromCustomerRecord","Select from Customer Record"))}),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-add-contact",u&&(a.style.display="none"),a.appendChild(F("fa-solid","user-plus",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{new Ee({company:!T(e(this,k).companyName),onSave:y=>{if(e(this,U).source.some(l=>l.Name===y.Name&&l.MobilePhone===y.MobilePhone))return pe(r("addContact","Add Contact"),r("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const l=n.onSave(y,!0);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>(e(this,U).source=m.filter(g=>g.Id>=0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),e(this,H).source=m.filter(g=>g.Id<0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),m)):!1}}}).show(t)}),M(a,r("addContact","Add Contact"))}))}),content:f("div",null,f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.style.fontWeight="bold",o.innerText=r("contactFromRecord","Contacts from Customer Record")}),f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.className="contacts-record",o.style.maxHeight="200px",o.style.width="675px",o.style.overflow="auto"}),f("div",o=>{o.style.fontWeight="bold",o.innerText=r("contactFromWorkOrder","Contacts not on Customer Record")}),f("div",o=>{o.className="contacts-wo",o.style.maxHeight="200px",o.style.width="675px",o.style.overflow="auto"}))});d.show(t).then(()=>{const o=h=>({key:"selected",type:se.ColumnTypes.Checkbox,width:50,enabled:I=>!I.OptOut&&!I.OptOut_BC,onchanged:function(){typeof n.onChanged=="function"&&n.onChanged([...e(h,U).source,...e(h,H).source])},tooltip:I=>I.selected?r("optedIn","Opted In"):r("optedOut","Opted Out")}),a={key:"type",type:se.ColumnTypes.Icon,width:50,filter:h=>{switch(String(h.ContactPreference)){case"0":return"comment-lines";case"2":return"mobile";default:return"envelope"}},className:"icon-contact-type",iconType:"fa-light"},b={key:"Name",type:ze,width:160},y={type:se.ColumnTypes.Icon,width:40,visible:!u,align:"center",iconType:"fa-light"},C=h=>({key:"edit",...y,text:"edit",tooltip:r("edit","Edit"),events:{onclick:function(){new Ee({contact:this,company:!T(e(h,k).companyName),onSave:(D,ae)=>{if(e(h,U).source.some(B=>B!==this&&B.Name===D.Name&&B.MobilePhone===D.MobilePhone)||e(h,H).source.some(B=>B!==this&&B.Name===D.Name&&B.MobilePhone===D.MobilePhone))return pe(r("editContact","Edit Contact"),r("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const B=n.onSave(D);return typeof(B==null?void 0:B.then)=="function"?B.then(Ne=>(e(h,U).source=Ne.filter(R=>R.Id>=0).map(R=>(R.OptOut||R.OptOut_BC||typeof R.selected>"u"&&(R.selected=!0),R)),e(h,H).source=Ne.filter(R=>R.Id<0).map(R=>(R.OptOut||R.OptOut_BC||typeof R.selected>"u"&&(R.selected=!0),R)),Ne)):!1}}}).show(t)}}}),l=new se;l.height=0,l.allowHtml=!0,l.headerVisible=!1,l.columns=[o(this),a,b,{key:"Email",width:180},{key:"MobilePhoneDisplayText",width:130},C(this),{key:"delete",...y,text:"times",tooltip:r("delete","Delete"),events:{onclick:function(){Re(r("remoteContact","Remove Contact"),f("div",null,f("div",h=>{h.style.paddingLeft="16px",h.innerText=r("removeFrom","Remove {name} from").replace("{name}",this.Name)}),f("div",h=>{h.style.display="flex",h.style.justifyContent="center",h.style.marginTop="10px"},Me({name:"remove-type",label:r("customerRecord","Customer Record"),checked:!0,className:"radio-customer-record"}),Me({name:"remove-type",label:r("workOrder","Work Order")}))),[{key:"ok",text:r("ok","OK")},{key:"cancel",text:r("cancel","Cancel")}]).then(h=>{if((h==null?void 0:h.key)==="ok"){const I=h.popup.container.querySelector(".radio-customer-record>input").checked;typeof n.onDelete=="function"&&n.onDelete(h.key,this,I);const D=l.source.indexOf(this);if(D>=0){const ae=l.source;ae.splice(D,1),l.extraRows=ae.filter(qe=>!T(qe.Notes)).length,l.source=ae}}})}}}],l.init(d.container.querySelector(".contacts-record"));const m=e(this,A).contacts.filter(h=>h.Id>=0).map(h=>(h.OptOut||h.OptOut_BC||typeof h.selected>"u"&&(h.selected=!0),h));l.extraRows=m.filter(h=>!T(h.Notes)).length,l.source=m,l.selectedRowChanged=h=>{var I;h>=0&&((I=e(this,H).selectedIndexes)==null?void 0:I.length)>0&&(e(this,H).selectedIndexes=[])},O(this,U,l);const g=new se;g.height=0,g.allowHtml=!0,g.headerVisible=!1,g.columns=[o(this),a,b,{key:"Email",width:180},{key:"MobilePhoneDisplayText",width:130},C(this),{key:"delete",...y,text:"times",tooltip:r("delete","Delete"),events:{onclick:function(){Re(r("remoteContact","Remove Contact"),r("removeFromWorkorder",`You are removing {name} from work order. -Do you want to Continue?`).replace("{name}",this.Name),[{key:"continue",text:l("continue","Continue")},{key:"cancel",text:l("cancel","Cancel")}]).then(u=>{if((u==null?void 0:u.key)==="continue"){typeof n.onDelete=="function"&&n.onDelete(u.key,this);const F=f.source.indexOf(this);if(F>=0){const A=f.source;A.splice(F,1),f.extraRows=A.filter(le=>!N(le.Notes)).length,f.source=A}}})}}}],f.init(r.container.querySelector(".contacts-wo"));const _=t(this,V).contacts.filter(u=>u.Id<0).map(u=>(u.OptOut||u.OptOut_BC||typeof u.selected>"u"&&(u.selected=!0),u));f.extraRows=_.filter(u=>!N(u.Notes)).length,f.source=_,f.selectedRowChanged=u=>{var F;u>=0&&((F=t(this,H).selectedIndexes)==null?void 0:F.length)>0&&(t(this,H).selectedIndexes=[])},T(this,j,f)})})})))),m},ge=new WeakSet,Pe=function(e,n){const a=n.readonly,y=n.recordReadonly,m=h("div","bar-list-container"),o=h("button",r=>{r.className="roundbtn button-edit-followers",r.style.backgroundColor="rgb(48, 107, 255)",(a===!0||y)&&(r.style.display="none"),r.appendChild(D("fa-solid","pen")),I(r,l("editFollower","Edit Followers")),r.addEventListener("click",()=>{const s=qe(h("div",d=>{d.style.display="flex",d.style.alignItems="center",d.append(h("div",b=>{b.className="ui-popup-move",b.style.flex="1 1 auto",b.innerText=l("editContacts","Edit Contacts")+` -`+l("followers","Followers")}),h("button",b=>{b.style.flex="0 0 auto",b.style.backgroundColor="rgb(1, 199, 172)",b.style.marginRight="10px",b.className="roundbtn button-add-follower",b.appendChild(D("fa-solid","user-plus",{width:"16px",height:"16px"})),b.addEventListener("click",()=>{typeof t(this,v).onInitFollower=="function"&&t(this,v).onInitFollower().then(p=>{if(typeof p=="string"){ce(l("customerRecord","Customer Record"),p,"warn");return}new _e({followers:p,onOk:i=>{if(typeof t(this,v).onAddFollower=="function"){const w=t(this,v).onAddFollower(i);return typeof(w==null?void 0:w.then)=="function"?w.then(f=>(t(this,ue).source=f,f)):!1}}}).show(e)})}),I(b,l("addFollower","Add Follower"))}))}),h("div",null,h("div",d=>{d.style.fontWeight="bold",d.innerText=l("contactFromRecord","Contacts from Customer Record")}),h("div",d=>{d.className="followers-record",d.style.maxHeight="400px",d.style.width="675px",d.style.overflow="auto"})));s.show(e).then(()=>{const d={type:K.ColumnTypes.Icon,width:40,align:"center",iconType:"fa-light"},b=new K;b.height=0,b.allowHtml=!0,b.headerVisible=!1,b.columns=[{key:"type",type:K.ColumnTypes.Icon,width:50,filter:p=>p.SendText&&p.SendEmail?"at":p.SendText?"comment-lines":"envelope",className:"icon-contact-type",iconType:"fa-light"},{key:"Name",width:160},{key:"Email",width:180},{key:"MobilePhoneDisplayText",width:130},{key:"edit",...d,text:"edit",tooltip:l("edit","Edit"),events:{onclick:function(){typeof n.onInitFollower=="function"&&n.onInitFollower().then(p=>{if(typeof p=="string"){ce(l("customerRecord","Customer Record"),p,"warn");return}const g=p.find(i=>i.IID===this.UserIID);de(l("editContactMethod","Edit Contact Method"),h("div","wrapper-edit-method",h("div",i=>{i.style.display="flex",i.style.justifyContent="center",i.style.marginTop="20px"},fe({label:l("text","Text"),checked:this.SendText&&!N(g==null?void 0:g.Mobile),enabled:!N(g==null?void 0:g.Mobile),className:"check-method-text"}),fe({label:l("email","Email"),checked:this.SendEmail,className:"check-method-email"}))),[{key:"ok",text:l("ok","OK"),trigger:(i,w)=>{const f=i.container.querySelector(".check-method-text>input").checked,_=i.container.querySelector(".check-method-email>input").checked;return!f&&!_?de(l("editContactMethod","Edit Contact Method"),l("promptRemoveFollower","Contact method is required. If you continue, user will be removed as a follower."),[{key:"update",text:l("updateContactMethod","Update Contact Method")},{key:"remove",text:l("removeFollower","Remove Follower")}],"question").then(u=>(u==null?void 0:u.key)==="remove"?{key:u.key,popup:i}:!1):{key:w.key,popup:i}}},{key:"cancel",text:l("cancel","Cancel")}],null).then(i=>{const w=i==null?void 0:i.key;if(w==="remove"){typeof n.onDeleteFollower=="function"&&n.onDeleteFollower(i.key,this);const f=b.source.indexOf(this);if(f>=0){const _=b.source;_.splice(f,1),b.extraRows=_.filter(u=>!N(u.Notes)).length,b.source=_}}else if(w==="ok"){const f=i.popup.container.querySelector(".check-method-text>input").checked,_=i.popup.container.querySelector(".check-method-email>input").checked;typeof n.onChangeFollower=="function"&&n.onChangeFollower(i.key,this,f,_),this.SendText=f,this.SendEmail=_,b.refresh()}})})}}},{key:"delete",...d,text:"times",tooltip:l("delete","Delete"),events:{onclick:function(){de(l("deleteFollower","Delete Follower"),l("promptDeleteFollower","Do you want to delete this follower?")).then(p=>{if((p==null?void 0:p.key)==="yes"){typeof n.onDeleteFollower=="function"&&n.onDeleteFollower(p.key,this);const g=b.source.indexOf(this);if(g>=0){const i=b.source;i.splice(g,1),b.extraRows=i.filter(w=>!N(w.Notes)).length,b.source=i}}})}}}],b.init(s.container.querySelector(".followers-record")),b.source=t(this,V).followers,T(this,ue,b)})})});return T(this,ie,o),e.append(h("div",r=>{r.className="contact-bar follower-bar",r.style.display="none"},I(h("div","bar-icon",D("fa-solid","user-tag",{fill:"#fff","background-color":"lightgray","box-sizing":"border-box","border-radius":"15px",padding:"4px"})),l("copied","Copied")),h("div","bar-list",m,o))),m},we=new WeakSet,Fe=function(e){var m;let n=-100;const a=[];let y="";if(!e.StatusIncorrect&&((m=e.Participator)==null?void 0:m.length)>0){for(let o of e.Participator)if(!ye(o.CustomerNumber)){a.indexOf(o.Status)<0&&a.push(o.Status),y.length>0&&(y+=` -`),y+=`${o.CustomerNumber}: `;const r={0:l("undelivered","Undelivered"),1:l("sent","Sent"),9:l("failed","Failed")}[o.Status];r!=null&&(y+=r)}}return a.length===1?n=a[0]:a.length>1&&(n=-10),[n,y]};const R=window["lib-ui"].createElement,ve=window["lib-ui"].setTooltip,Me=window["lib-ui"].createIcon,oe=window["lib-utility"].r,Ie=window["lib-utility"].nullOrEmpty,Ke=window["lib-utility"].escapeHtml;class ze{constructor(e){C(this,Y,void 0);C(this,P,void 0);C(this,G,void 0);C(this,ne,void 0);T(this,P,e??{})}get text(){var e;return(e=t(this,G))==null?void 0:e.value}set text(e){const n=t(this,G);n!=null&&(n.value=e,e=String(Ie(e)?0:val.length)+"/"+String(t(this,P).maxLength),t(this,Y).querySelector(".message-bar .prompt-count").innerText=e)}set readonly(e){t(this,P).readonly=e,t(this,Y)!=null&&(t(this,G).disabled=e===!0,t(this,Y).querySelector(".button-send-message").style.display=e===!0?"none":"",t(this,Y).querySelector(".button-post-note").style.display=e===!0?"none":"")}create(){var m;const e=ae(R("div",null,R("div",o=>{o.className="title-module",o.innerText=oe("internalComments","Internal Comments")})),[]),n=t(this,P).readonly,a=R("textarea","ui-text");a.placeholder=oe("typeComment","Enter Comment Here"),a.maxLength=(m=t(this,P)).maxLength??(m.maxLength=3e3),a.addEventListener("input",()=>{const o=t(this,G).value,r=String(Ie(o)?0:o.length)+"/"+String(t(this,P).maxLength);t(this,Y).querySelector(".message-bar .prompt-count").innerText=r}),n===!0&&(a.disabled=!0),T(this,G,a),e.appendChild(R("div","message-bar",a,R("div",o=>o.style.textAlign="right",R("div","prompt-count"),R("button",o=>{o.className="roundbtn button-send-message",o.style.backgroundColor="rgb(19, 150, 204)",(n===!0||t(this,P).noMessage===!0)&&(o.style.display="none"),o.appendChild(Me("fa-solid","paper-plane")),ve(o,oe("sendMessage","Send Message")),o.addEventListener("click",()=>{typeof t(this,P).onAddMessage=="function"&&t(this,P).onAddMessage(t(this,G).value)})}),R("button",o=>{o.className="roundbtn button-post-note",o.style.border="1px solid rgb(19, 150, 204)",o.style.fill="rgb(19, 150, 204)",n===!0&&(o.style.display="none"),o.appendChild(Me("fa-solid","comment-alt-lines")),ve(o,oe("postNote","Post Note")),o.addEventListener("click",()=>{typeof t(this,P).onAddComment=="function"&&t(this,P).onAddComment(t(this,G).value)})}))));const y=R("div","list-bar");return T(this,ne,y),e.appendChild(y),T(this,Y,e)}load(e){var a;const n=[];if((e==null?void 0:e.length)>0){for(let y of e){const m=R("div","item-div");m.appendChild(R("div",r=>{r.className="item-poster",r.innerText=y.UserName}));const o=R("div","item-content");if(o.appendChild(R("span",r=>r.innerHTML=Ke(y.Comment))),((a=y.FollowUp)==null?void 0:a.length)>0){m.classList.add("item-sent");const r=oe("sendToColon","Send To :")+`\r -`+y.FollowUp.split(";").join(`\r -`);o.appendChild(R("div",s=>{s.className="item-status",s.innerText=oe("sent","Sent"),ve(s,r)}))}m.append(o,R("div",r=>{r.className="item-time",r.innerText=y.SubmitDateStr})),n.push(m)}n[0].style.marginTop="0"}t(this,ne).replaceChildren(...n),t(this,ne).scrollTop=t(this,ne).scrollHeight}}Y=new WeakMap,P=new WeakMap,G=new WeakMap,ne=new WeakMap,k.CustomerCommunication=Ge,k.InternalComment=ze,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}); +Do you want to Continue?`).replace("{name}",this.Name),[{key:"continue",text:r("continue","Continue")},{key:"cancel",text:r("cancel","Cancel")}]).then(h=>{if((h==null?void 0:h.key)==="continue"){typeof n.onDelete=="function"&&n.onDelete(h.key,this);const I=g.source.indexOf(this);if(I>=0){const D=g.source;D.splice(I,1),g.extraRows=D.filter(ae=>!T(ae.Notes)).length,g.source=D}}})}}}],g.init(d.container.querySelector(".contacts-wo"));const Le=e(this,A).contacts.filter(h=>h.Id<0).map(h=>(h.OptOut||h.OptOut_BC||typeof h.selected>"u"&&(h.selected=!0),h));g.extraRows=Le.filter(h=>!T(h.Notes)).length,g.source=Le,g.selectedRowChanged=h=>{var I;h>=0&&((I=e(this,U).selectedIndexes)==null?void 0:I.length)>0&&(e(this,U).selectedIndexes=[])},O(this,H,g)})})})))),p},ye=new WeakSet,$e=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container"),i=f("button",d=>{d.className="roundbtn button-edit-followers",d.style.backgroundColor="rgb(48, 107, 255)",(s===!0||u)&&(d.style.display="none"),d.appendChild(F("fa-solid","pen")),M(d,r("editFollower","Edit Followers")),d.addEventListener("click",()=>{typeof e(this,k).onInitFollower=="function"&&e(this,k).onInitFollower(e(this,A).followers).then(o=>{var y;if(typeof o=="string"){pe(r("customerRecord","Customer Record"),o,"warn");return}const a=new Ve({onMasking:n.onMasking,followers:o,onOk:C=>{if(typeof e(this,k).onAddFollower=="function"){const l=e(this,k).onAddFollower(C);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>m):!1}}});var b=((y=e(this,A).followers)==null?void 0:y.length)>0?r("editFollowers","Edit Followers"):r("addFollowers","Add Followers");a.show(b,t)})})});return O(this,Y,i),t.append(f("div",d=>{d.className="contact-bar follower-bar",d.style.display="none"},M(f("div","bar-icon",F("fa-solid","user-tag",{fill:"#fff","background-color":"lightgray","box-sizing":"border-box","border-radius":"15px",padding:"4px"})),r("copied","Copied")),f("div","bar-list",p,i))),p},ge=new WeakSet,Fe=function(t){var p;let n=-100;const s=[];let u="";if(!t.StatusIncorrect&&((p=t.Participator)==null?void 0:p.length)>0){for(let i of t.Participator)if(!he(i.CustomerNumber)){s.indexOf(i.Status)<0&&s.push(i.Status),u.length>0&&(u+=` +`),u+=`${i.CustomerNumber}: `;const d={0:r("undelivered","Undelivered"),1:r("sent","Sent"),9:r("failed","Failed")}[i.Status];d!=null&&(u+=d)}}return s.length===1?n=s[0]:s.length>1&&(n=-10),[n,u]};const L=window["lib-ui"].createElement,ke=window["lib-ui"].setTooltip,Pe=window["lib-ui"].createIcon,le=window["lib-utility"].r,Ie=window["lib-utility"].nullOrEmpty,Je=window["lib-utility"].escapeHtml;class Qe{constructor(t){N(this,z,void 0);N(this,$,void 0);N(this,j,void 0);N(this,oe,void 0);O(this,$,t??{})}get text(){var t;return(t=e(this,j))==null?void 0:t.value}set text(t){const n=e(this,j);n!=null&&(n.value=t,t=String(Ie(t)?0:val.length)+"/"+String(e(this,$).maxLength),e(this,z).querySelector(".message-bar .prompt-count").innerText=t)}set readonly(t){e(this,$).readonly=t,e(this,z)!=null&&(e(this,j).disabled=t===!0,e(this,z).querySelector(".button-send-message").style.display=t===!0?"none":"",e(this,z).querySelector(".button-post-note").style.display=t===!0?"none":"")}create(){var p;const t=re(L("div",null,L("div",i=>{i.className="title-module",i.innerText=le("internalComments","Internal Comments")})),[]),n=e(this,$).readonly,s=L("textarea","ui-text");s.placeholder=le("typeComment","Enter Comment Here"),s.maxLength=(p=e(this,$)).maxLength??(p.maxLength=3e3),s.addEventListener("input",()=>{const i=e(this,j).value,d=String(Ie(i)?0:i.length)+"/"+String(e(this,$).maxLength);e(this,z).querySelector(".message-bar .prompt-count").innerText=d}),n===!0&&(s.disabled=!0),O(this,j,s),t.appendChild(L("div","message-bar",s,L("div",i=>i.style.textAlign="right",L("div","prompt-count"),L("button",i=>{i.className="roundbtn button-send-message",i.style.backgroundColor="rgb(19, 150, 204)",(n===!0||e(this,$).noMessage===!0)&&(i.style.display="none"),i.appendChild(Pe("fa-solid","paper-plane")),ke(i,le("sendMessage","Send Message")),i.addEventListener("click",()=>{typeof e(this,$).onAddMessage=="function"&&e(this,$).onAddMessage(e(this,j).value)})}),L("button",i=>{i.className="roundbtn button-post-note",i.style.border="1px solid rgb(19, 150, 204)",i.style.fill="rgb(19, 150, 204)",n===!0&&(i.style.display="none"),i.appendChild(Pe("fa-solid","comment-alt-lines")),ke(i,le("postNote","Post Note")),i.addEventListener("click",()=>{typeof e(this,$).onAddComment=="function"&&e(this,$).onAddComment(e(this,j).value)})}))));const u=L("div","list-bar");return O(this,oe,u),t.appendChild(u),O(this,z,t)}load(t){var s;const n=[];if((t==null?void 0:t.length)>0){for(let u of t){const p=L("div","item-div");p.appendChild(L("div",d=>{d.className="item-poster",d.innerText=u.UserName}));const i=L("div","item-content");if(i.appendChild(L("span",d=>d.innerHTML=Je(u.Comment))),((s=u.FollowUp)==null?void 0:s.length)>0){p.classList.add("item-sent");const d=le("sendToColon","Send To :")+`\r +`+u.FollowUp.split(";").join(`\r +`);i.appendChild(L("div",o=>{o.className="item-status",o.innerText=le("sent","Sent"),ke(o,d)}))}p.append(i,L("div",d=>{d.className="item-time",d.innerText=u.SubmitDateStr})),n.push(p)}n[0].style.marginTop="0"}e(this,oe).replaceChildren(...n),e(this,oe).scrollTop=e(this,oe).scrollHeight}}z=new WeakMap,$=new WeakMap,j=new WeakMap,oe=new WeakMap,v.CustomerCommunication=Ye,v.InternalComment=Qe,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=app.min.js.map diff --git a/Site/js/lib/app.min.js.map b/Site/js/lib/app.min.js.map index 391c22f..55f5b23 100644 --- a/Site/js/lib/app.min.js.map +++ b/Site/js/lib/app.min.js.map @@ -1 +1 @@ -{"version":3,"file":"app.min.js","sources":["../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Dropdown, createElement, createCheckbox, createPopup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = createPopup(\r\n c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactPreferencesColon', 'Contact Preferences:')),\r\n preferences.create()\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactEmailColon', 'Email Address:')),\r\n contactEmail\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactMobileColon', 'Mobile:')),\r\n contactMobile\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactOptColon', 'Opt Out:')),\r\n checkOpt\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactNotesColon', 'Notes:')),\r\n contactNotes\r\n )\r\n ),\r\n ...buttons\r\n )\r\n if (c != null) {\r\n contactName.value = c.Name;\r\n preferences.select(String(c.ContactPreference));\r\n contactEmail.value = c.Email;\r\n contactMobile.value = c.MobilePhone;\r\n checkOpt.querySelector('input').checked = c.OptOut;\r\n contactNotes.value = c.Notes;\r\n } else {\r\n preferences.select('0');\r\n }\r\n this.#refs = {\r\n contactName,\r\n preferences,\r\n contactEmail,\r\n contactMobile,\r\n checkOpt,\r\n contactNotes\r\n };\r\n const result = await popup.show(parent);\r\n setTimeout(() => contactName.focus());\r\n return result;\r\n }\r\n\r\n prepare() {\r\n const name = this.#refs.contactName.value;\r\n const pref = this.#refs.preferences.selected.value;\r\n const email = this.#refs.contactEmail.value;\r\n const phone = this.#refs.contactMobile.value;\r\n const opt = this.#refs.checkOpt.querySelector('input').checked;\r\n const notes = this.#refs.contactNotes.value;\r\n const title = this.#option.contact == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact');\r\n if (nullOrEmpty(name)) {\r\n showAlert(title, r('contactNameRequired', 'Contact Name cannot be empty.'), 'warn')\r\n .then(() => this.#refs.contactName.focus());\r\n return null;\r\n }\r\n if (nullOrEmpty(email) && nullOrEmpty(phone)) {\r\n showAlert(title, r('contactEmailPhoneRequired', 'Email and Mobile Phone cannot both be empty.'), 'warn')\r\n .then(() => nullOrEmpty(email) ?\r\n this.#refs.contactEmail.focus() :\r\n this.#refs.contactMobile.focus());\r\n return null;\r\n }\r\n if (!nullOrEmpty(email) && !isEmail(email)) {\r\n showAlert(title, r('contactEmailInvalid', 'The email address is invalid.'), 'warn')\r\n .then(() => this.#refs.contactEmail.focus());\r\n return null;\r\n }\r\n\r\n let contact = this.#option.contact;\r\n if (contact == null) {\r\n contact = {};\r\n } else if (contact.OptOut !== opt) {\r\n if (opt !== false || contact.OptOut_BC === false) {\r\n contact.selected = !opt;\r\n }\r\n }\r\n contact.Name = name;\r\n contact.ContactPreference = pref;\r\n contact.Email = email;\r\n contact.MobilePhone = phone;\r\n contact.OptOut = opt;\r\n contact.Notes = notes;\r\n return contact;\r\n }\r\n}\r\n\r\nexport default Contact;","import { Grid, createElement, createPopup } from \"../../ui\";\r\nimport { nullOrEmpty, r, contains } from \"../../utility\";\r\n\r\nclass Follower {\r\n #option;\r\n #grid;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const gridContainer = createElement('div', 'follower-grid');\r\n const popup = createPopup(\r\n r('addFollowers', 'Add Followers'),\r\n createElement('div', 'follower-wrapper',\r\n createElement('div', div => div.innerText = r('whoWantReceiveCustomerNotification', 'Who do you want to receive customer notifications?')),\r\n createElement('input', search => {\r\n search.type = 'text';\r\n search.tabIndex = tabIndex + 3;\r\n search.className = 'ui-input follower-search';\r\n search.addEventListener('input', () => {\r\n const key = search.value;\r\n if (nullOrEmpty(key)) {\r\n this.#grid.source = this.#option.followers;\r\n } else {\r\n this.#grid.source = this.#option.followers.filter(f => f.Text || f.Email || contains(f.DisplayName, key, true));\r\n }\r\n });\r\n }),\r\n gridContainer\r\n ),\r\n {\r\n text: r('ok', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n if (typeof this.#option.onOk === 'function') {\r\n return this.#option.onOk.call(this, this.#grid.source.filter(f => f.Email || f.Text));\r\n }\r\n }\r\n },\r\n { text: r('cancel', 'Cancel'), key: 'cancel' }\r\n );\r\n const result = await popup.show(parent);\r\n result.querySelector('.follower-search').focus();\r\n // grid\r\n const grid = new Grid(gridContainer);\r\n grid.columns = [\r\n { key: 'DisplayName', caption: r('contactName', 'Contact Name'), width: 240 },\r\n { key: 'ContactTypeName', caption: r('contactType', 'Contact Type'), width: 120 },\r\n {\r\n key: 'Text',\r\n caption: r('text', 'Text'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 60,\r\n enabled: item => !nullOrEmpty(item.Mobile)\r\n },\r\n {\r\n key: 'Email',\r\n caption: r('email', 'Email'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 70,\r\n // enabled: item => !nullOrEmpty(item.ID)\r\n }\r\n ];\r\n grid.init();\r\n grid.source = this.#option.followers;\r\n this.#grid = grid;\r\n return result;\r\n }\r\n}\r\n\r\nexport default Follower;","import { Grid, createElement, setTooltip, createIcon, createCheckbox, createRadiobox, createPopup, showAlert, showConfirm } from \"../../ui\";\r\nimport { r, nullOrEmpty, formatUrl, isEmail, isPhone } from \"../../utility\";\r\nimport { createBox } from \"./lib\";\r\nimport Contact from \"./contact\";\r\nimport Follower from \"./follower\";\r\n\r\nclass NoteCol extends Grid.GridColumn {\r\n static create() {\r\n const wrapper = createElement('div', 'contact-wrapper',\r\n createElement('div', 'contact-name'),\r\n createElement('div', 'contact-note')\r\n );\r\n return wrapper;\r\n }\r\n\r\n static setValue(element, _val, item, _col, grid) {\r\n const name = element.querySelector('.contact-name');\r\n name.innerText = item.Name;\r\n if (name.scrollWidth > name.offsetWidth) {\r\n setTooltip(name, item.Name, false, grid.element);\r\n }\r\n element.querySelector('.contact-note').innerText = item.Notes;\r\n }\r\n}\r\n\r\nclass CustomerCommunication {\r\n #container;\r\n #option;\r\n #contacts;\r\n #followers;\r\n #buttonFollower;\r\n #enter;\r\n #message;\r\n #data = {};\r\n #gridContact;\r\n #gridWo;\r\n #gridFollower;\r\n\r\n constructor(opt) {\r\n this.#option = opt ?? {};\r\n }\r\n\r\n get #autoUpdates() { return this.#container.querySelector('.check-auto-update>input') }\r\n get autoUpdatesEnabled() { return this.#autoUpdates?.disabled !== true }\r\n set autoUpdatesEnabled(flag) {\r\n const element = this.#autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get autoUpdates() { return this.#autoUpdates?.checked }\r\n set autoUpdates(flag) {\r\n const element = this.#autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n get #statusLink() { return this.#container.querySelector('.check-status-link>input') }\r\n get statusLinkEnabled() { return this.#statusLink?.disabled !== true }\r\n set statusLinkEnabled(flag) {\r\n const element = this.#statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get statusLink() { return this.#statusLink?.checked }\r\n set statusLink(flag) {\r\n const element = this.#statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set loading(flag) {\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#enter.disabled = flag;\r\n this.#container.querySelector('.customer-name>.ui-input').disabled = flag;\r\n this.#container.querySelector('.button-send-message').disabled = flag;\r\n this.#container.querySelector('.button-edit-contacts').disabled = flag;\r\n this.#container.querySelector('.button-edit-followers').disabled = flag;\r\n }\r\n\r\n get text() { return this.#enter?.value }\r\n set text(s) {\r\n const element = this.#enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n get customerName() { return this.#container.querySelector('.customer-name>.ui-input')?.value }\r\n set customerName(name) {\r\n const element = this.#container.querySelector('.customer-name>.ui-input');\r\n if (element == null) {\r\n return;\r\n }\r\n element.value = name;\r\n }\r\n\r\n get contacts() {\r\n return [...this.#contacts.children].map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Key': span.dataset.to, 'Value': span.dataset.name };\r\n });\r\n }\r\n set contacts(contacts) {\r\n this.#contacts.replaceChildren();\r\n if (contacts?.length > 0) {\r\n for (let c of contacts) {\r\n if (c.OptOut || c.OptOut_BC || c.selected === false) {\r\n continue;\r\n }\r\n const mp = String(c.MobilePhoneDisplayText).trim();\r\n const email = String(c.Email).trim();\r\n const pref = String(c.ContactPreference);\r\n if ((pref !== '1') && !isPhone(mp) ||\r\n pref === '1' && !isEmail(email)) {\r\n continue;\r\n }\r\n const to = pref === '1' ? email : mp;\r\n let icon;\r\n let method;\r\n switch (pref) {\r\n case '0':\r\n icon = 'comment-lines';\r\n method = r('textsToColon', 'Texts to:');\r\n break;\r\n case '2':\r\n icon = 'mobile';\r\n method = r('callsToColon', 'Calls to:');\r\n break;\r\n default:\r\n icon = 'envelope';\r\n method = r('emailsToColon', 'Emails to:');\r\n break;\r\n }\r\n const span = createElement('span', span => {\r\n span.dataset.to = to;\r\n span.dataset.name = c.Name;\r\n span.innerText = c.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon),\r\n span\r\n );\r\n this.#contacts.appendChild(item);\r\n let tip = `${method} ${to}`;\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tip = r('nameColon', 'Name:') + ` ${c.Name}\\n${tip}`;\r\n }\r\n setTooltip(span, tip);\r\n }\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this.#option.readonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n const link = this.#container.querySelector('.check-status-link');\r\n if (flag === true) {\r\n link.classList.add('disabled');\r\n } else {\r\n link.classList.remove('disabled');\r\n }\r\n link.querySelector('input').disabled = flag;\r\n const display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-edit-contacts').style.display = display;\r\n this.#container.querySelector('.button-edit-followers').style.display = display;\r\n // this.#enter.disabled = flag === true;\r\n this.#container.querySelector('.message-bar').style.display = display;\r\n // this.#container.querySelector('.button-send-message').style.display = display;\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set recordReadonly(flag) {\r\n this.#option.recordReadonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#container.querySelector('.button-edit-contacts').style.display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-edit-followers').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n /**\r\n * @param {String} name\r\n */\r\n set companyName(name) {\r\n this.#option.companyName = name;\r\n const div = this.#container.querySelector('.title-company');\r\n if (nullOrEmpty(name)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = name;\r\n div.style.display = '';\r\n }\r\n }\r\n /**\r\n * @param {String} code\r\n */\r\n set companyCode(code) {\r\n this.#option.companyCode = code;\r\n const div = this.#container.querySelector('.title-company');\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = this.#option.companyName;\r\n if (!nullOrEmpty(code))\r\n div.innerText = this.#option.companyName + \"/\" + code;\r\n div.style.display = '';\r\n }\r\n }\r\n\r\n get followers() {\r\n return [...this.#followers.children].map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Email': span.dataset.email, 'MobilePhone': span.dataset.mp, 'Value': span.dataset.name };\r\n });\r\n }\r\n set followers(followers) {\r\n this.#data.followers = followers;\r\n this.#followers.replaceChildren();\r\n if (followers?.length > 0) {\r\n this.#container.querySelector('.follower-bar').style.display = '';\r\n this.#container.querySelector('.follower-bar>.bar-list').appendChild(this.#buttonFollower);\r\n for (let f of followers) {\r\n if (f.OptOut) {\r\n continue;\r\n }\r\n const mp = String(f.MobilePhone).trim();\r\n const email = String(f.Email).trim();\r\n const tips = [];\r\n if (f.SendEmail) {\r\n tips.push(r('emailsToColon', 'Emails to:') + ` ${email}`);\r\n }\r\n if (f.SendText) {\r\n tips.push(r('textsToColon', 'Texts to:' + ` ${mp}`));\r\n }\r\n let icon;\r\n if (f.SendText && f.SendEmail) {\r\n icon = 'at';\r\n } else {\r\n icon = f.SendText ? 'comment-lines' : 'envelope';\r\n }\r\n const span = createElement('span', span => {\r\n if (f.SendEmail) {\r\n span.dataset.email = email;\r\n }\r\n if (f.SendText) {\r\n span.dataset.mp = mp;\r\n }\r\n span.dataset.name = f.Name;\r\n span.innerText = f.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon),\r\n span\r\n );\r\n this.#followers.appendChild(item);\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tips.splice(0, 0, r('nameColon', 'Name:') + ` ${c.Name}`);\r\n }\r\n setTooltip(span, tips.join('\\n'));\r\n }\r\n } else {\r\n this.#container.querySelector('.follower-bar').style.display = 'none';\r\n this.#container.querySelector('.button-edit-contacts').insertAdjacentElement('beforebegin', this.#buttonFollower)\r\n }\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n }\r\n\r\n setData(key, data) {\r\n this.#data[key] = data;\r\n }\r\n\r\n create() {\r\n const option = this.#option;\r\n const readonly = option.readonly;\r\n // functions\r\n const checkAutoUpdate = createCheckbox({\r\n className: 'check-auto-update',\r\n checked: option.autoUpdates,\r\n checkedNode: createIcon('fa-regular', 'redo-alt'),\r\n uncheckedNode: createIcon('fa-regular', 'ban'),\r\n onchange: function () {\r\n setTooltip(checkAutoUpdate, this.checked ?\r\n r('autoUpdateEnabled', 'Auto Updates Enabled') :\r\n r('autoUpdateDisabled', 'Auto Updates Disabled'));\r\n }\r\n });\r\n if (option.autoUpdatesVisible === false) {\r\n checkAutoUpdate.style.display = 'none';\r\n }\r\n const checkLink = createCheckbox({\r\n className: 'check-status-link',\r\n enabled: !readonly,\r\n checked: option.statusLink,\r\n checkedNode: createIcon('fa-regular', 'link'),\r\n uncheckedNode: createIcon('fa-regular', 'unlink'),\r\n onchange: function () {\r\n setTooltip(checkLink, this.checked ?\r\n r('statusLinkIncluded', 'Status Link Included') :\r\n r('statusLinkExcluded', 'Status Link Excluded'));\r\n }\r\n });\r\n if (option.statusLinkVisible === false) {\r\n checkLink.style.display = 'none';\r\n }\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = option.title ?? r('messages', 'Customer Communication');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n [\r\n setTooltip(checkAutoUpdate, r('autoUpdateEnabled', 'Auto Updates Enabled')),\r\n setTooltip(checkLink, r('statusLinkExcluded', 'Status Link Excluded'))\r\n ]\r\n );\r\n // contacts\r\n this.#contacts = this.#createContacts(container, option);\r\n // followers\r\n this.#followers = this.#createFollowers(container, option);\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('typeMessage', 'Enter Message Here');\r\n option.maxLength ??= 3000;\r\n enter.maxLength = option.maxLength;\r\n // if (readonly === true) {\r\n // enter.disabled = true;\r\n // }\r\n enter.addEventListener('input', () => {\r\n const val = this.#enter.value;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n this.#enter = enter;\r\n container.appendChild(\r\n createElement('div', div => {\r\n div.className = 'message-bar';\r\n if (readonly === true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', div => {\r\n div.className = 'customer-name';\r\n if (option.customerNameVisible !== true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n createElement('span', span => span.innerText = r('nameColon', 'Name:')),\r\n createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n })\r\n ),\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n // if (readonly === true) {\r\n // button.style.display = 'none';\r\n // }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('sendMessage', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n const val = this.#enter.value;\r\n if (nullOrEmpty(val?.trim())) {\r\n showAlert(r('error', 'Error'), r('messageRequired', 'Please input the message.'), 'warn');\r\n return;\r\n }\r\n if (typeof this.#option.onAddMessage === 'function') {\r\n this.#option.onAddMessage(this.#enter.value);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this.#message = message;\r\n container.appendChild(message);\r\n return this.#container = container;\r\n }\r\n\r\n #createContacts(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const contacts = createElement('div', 'bar-list-container');\r\n container.append(\r\n createElement('div', 'contact-bar',\r\n createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-circle', {\r\n 'fill': 'lightgray'\r\n })\r\n ),\r\n createElement('div', 'bar-list',\r\n contacts,\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-edit-contacts';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-edit'));\r\n setTooltip(button, r('editContacts', 'Edit Contacts'));\r\n button.addEventListener('click', () => {\r\n const pop = createPopup(\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.alignItems = 'center';\r\n div.append(\r\n createElement('div', div => {\r\n div.className = 'ui-popup-move';\r\n div.style.flex = '1 1 auto';\r\n },\r\n createElement('div', div => div.innerText = r('editContacts', 'Edit Contacts')),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-add-contact';\r\n if (recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-plus', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n const add = new Contact({\r\n company: !nullOrEmpty(this.#option.companyName),\r\n onSave: item => {\r\n const exists = this.#gridContact.source.some(s => s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('addContact', 'Add Contact'), r('contactUniqueRequired', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item, true);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n this.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n this.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n add.show(container);\r\n });\r\n setTooltip(button, r('addContact', 'Add Contact'))\r\n })\r\n )\r\n }),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n }\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromRecord', 'Contacts from Customer Record');\r\n }),\r\n createElement('div', div => {\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n }\r\n div.className = 'contacts-record';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n }),\r\n createElement('div', div => {\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromWorkOrder', 'Contacts not on Customer Record');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'contacts-wo';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n })\r\n )\r\n );\r\n pop.show(container).then(() => {\r\n const selectedCol = This => {\r\n return {\r\n key: 'selected',\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 50,\r\n enabled: item => !item.OptOut && !item.OptOut_BC,\r\n onchanged: function () {\r\n if (typeof option.onChanged === 'function') {\r\n option.onChanged([...This.#gridContact.source, ...This.#gridWo.source]);\r\n }\r\n }\r\n }\r\n };\r\n const iconCol = {\r\n key: 'type',\r\n type: Grid.ColumnTypes.Icon,\r\n width: 50,\r\n filter: c => {\r\n switch (String(c.ContactPreference)) {\r\n case '0': return 'comment-lines';\r\n case '2': return 'mobile';\r\n default: return 'envelope';\r\n }\r\n },\r\n className: 'icon-contact-type',\r\n iconType: 'fa-light'\r\n };\r\n const nameCol = { key: 'Name', type: NoteCol, width: 160 };\r\n const buttonCol = {\r\n type: Grid.ColumnTypes.Icon,\r\n width: 40,\r\n visible: !recordReadonly,\r\n align: 'center',\r\n iconType: 'fa-light'\r\n };\r\n const createEditCol = (This) => {\r\n return {\r\n key: 'edit',\r\n ...buttonCol,\r\n text: 'edit',\r\n tooltip: r('edit', 'Edit'),\r\n events: {\r\n onclick: function () {\r\n const edit = new Contact({\r\n contact: this,\r\n company: !nullOrEmpty(This.#option.companyName),\r\n onSave: (item, _op) => {\r\n const exists =\r\n This.#gridContact.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone) ||\r\n This.#gridWo.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('editContact', 'Edit Contact'), r('contactUniqueRequired', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n This.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n This.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n edit.show(container);\r\n }\r\n }\r\n }\r\n };\r\n // contacts from customer record\r\n const grid = new Grid();\r\n grid.height = 0;\r\n grid.allowHtml = true;\r\n grid.headerVisible = false;\r\n grid.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(\r\n r('remoteContact', 'Remove Contact'),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.style.paddingLeft = '16px';\r\n div.innerText = r('removeFrom', 'Remove {name} from').replace('{name}', this.Name);\r\n }),\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.justifyContent = 'center';\r\n div.style.marginTop = '10px';\r\n },\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('customerRecord', 'Customer Record'),\r\n checked: true,\r\n className: 'radio-customer-record'\r\n }),\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('workOrder', 'Work Order')\r\n })\r\n )\r\n ),\r\n [\r\n { key: 'ok', text: r('ok', 'OK') },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ]\r\n ).then(result => {\r\n if (result?.key === 'ok') {\r\n const isRecord = result.popup.container.querySelector('.radio-customer-record>input').checked;\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this, isRecord);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n grid.init(pop.container.querySelector('.contacts-record'));\r\n const customerRecords = this.#data.contacts.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n grid.extraRows = customerRecords.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = customerRecords;\r\n grid.selectedRowChanged = index => {\r\n if (index >= 0 && this.#gridWo.selectedIndexes?.length > 0) {\r\n this.#gridWo.selectedIndexes = [];\r\n }\r\n };\r\n this.#gridContact = grid;\r\n\r\n // contacts from work order only\r\n const gridWo = new Grid();\r\n gridWo.height = 0;\r\n gridWo.allowHtml = true;\r\n gridWo.headerVisible = false;\r\n gridWo.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(r('remoteContact', 'Remove Contact'), r('removeFromWorkorder', 'You are removing {name} from work order.\\n\\nDo you want to Continue?').replace('{name}', this.Name), [\r\n { key: 'continue', text: r('continue', 'Continue') },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ]).then(result => {\r\n if (result?.key === 'continue') {\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this);\r\n }\r\n const index = gridWo.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = gridWo.source;\r\n source.splice(index, 1);\r\n gridWo.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n gridWo.init(pop.container.querySelector('.contacts-wo'));\r\n const workOrderOnly = this.#data.contacts.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n gridWo.extraRows = workOrderOnly.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = workOrderOnly;\r\n gridWo.selectedRowChanged = index => {\r\n if (index >= 0 && this.#gridContact.selectedIndexes?.length > 0) {\r\n this.#gridContact.selectedIndexes = [];\r\n }\r\n };\r\n this.#gridWo = gridWo;\r\n });\r\n });\r\n })\r\n )\r\n )\r\n );\r\n return contacts;\r\n }\r\n\r\n #createFollowers(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const followers = createElement('div', 'bar-list-container');\r\n const buttonEditFollower = createElement('button', button => {\r\n button.className = 'roundbtn button-edit-followers';\r\n button.style.backgroundColor = 'rgb(48, 107, 255)';\r\n if (readonly === true || recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'pen'));\r\n setTooltip(button, r('editFollower', 'Edit Followers'));\r\n button.addEventListener('click', () => {\r\n const pop = createPopup(\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.alignItems = 'center';\r\n div.append(\r\n createElement('div', div => {\r\n div.className = 'ui-popup-move';\r\n div.style.flex = '1 1 auto';\r\n div.innerText = r('editContacts', 'Edit Contacts') + '\\n' + r('followers', 'Followers');\r\n }),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-add-follower';\r\n button.appendChild(createIcon('fa-solid', 'user-plus', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onInitFollower === 'function') {\r\n this.#option.onInitFollower().then(data => {\r\n if (typeof data === 'string') {\r\n showAlert(r('customerRecord', 'Customer Record'), data, 'warn');\r\n return;\r\n }\r\n const add = new Follower({\r\n followers: data,\r\n onOk: list => {\r\n if (typeof this.#option.onAddFollower === 'function') {\r\n const result = this.#option.onAddFollower(list);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n this.#gridFollower.source = r;\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n add.show(container);\r\n });\r\n }\r\n });\r\n setTooltip(button, r('addFollower', 'Add Follower'))\r\n })\r\n )\r\n }),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromRecord', 'Contacts from Customer Record');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'followers-record';\r\n div.style.maxHeight = '400px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n })\r\n )\r\n );\r\n pop.show(container).then(() => {\r\n const buttonCol = {\r\n type: Grid.ColumnTypes.Icon,\r\n width: 40,\r\n align: 'center',\r\n iconType: 'fa-light'\r\n };\r\n const grid = new Grid();\r\n grid.height = 0;\r\n grid.allowHtml = true;\r\n grid.headerVisible = false;\r\n grid.columns = [\r\n {\r\n key: 'type',\r\n type: Grid.ColumnTypes.Icon,\r\n width: 50,\r\n filter: c => c.SendText && c.SendEmail ? 'at' : (c.SendText ? 'comment-lines' : 'envelope'),\r\n className: 'icon-contact-type',\r\n iconType: 'fa-light'\r\n },\r\n { key: 'Name', width: 160 },\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n {\r\n key: 'edit',\r\n ...buttonCol,\r\n text: 'edit',\r\n tooltip: r('edit', 'Edit'),\r\n events: {\r\n onclick: function () {\r\n if (typeof option.onInitFollower === 'function') {\r\n option.onInitFollower().then(data => {\r\n if (typeof data === 'string') {\r\n showAlert(r('customerRecord', 'Customer Record'), data, 'warn');\r\n return;\r\n }\r\n const contact = data.find(d => d.IID === this.UserIID);\r\n showConfirm(\r\n r('editContactMethod', 'Edit Contact Method'),\r\n createElement('div', 'wrapper-edit-method',\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.justifyContent = 'center';\r\n div.style.marginTop = '20px';\r\n },\r\n createCheckbox({\r\n label: r('text', 'Text'),\r\n checked: this.SendText && !nullOrEmpty(contact?.Mobile),\r\n enabled: !nullOrEmpty(contact?.Mobile),\r\n className: 'check-method-text'\r\n }),\r\n createCheckbox({\r\n label: r('email', 'Email'),\r\n checked: this.SendEmail,\r\n className: 'check-method-email'\r\n })\r\n )\r\n ),\r\n [\r\n {\r\n key: 'ok',\r\n text: r('ok', 'OK'),\r\n trigger: (popup, button) => {\r\n const text = popup.container.querySelector('.check-method-text>input').checked;\r\n const email = popup.container.querySelector('.check-method-email>input').checked;\r\n\r\n if (!text && !email) {\r\n return showConfirm(r('editContactMethod', 'Edit Contact Method'), r('promptRemoveFollower', 'Contact method is required. If you continue, user will be removed as a follower.'), [\r\n { key: 'update', text: r('updateContactMethod', 'Update Contact Method') },\r\n { key: 'remove', text: r('removeFollower', 'Remove Follower') }\r\n ], 'question').then(result => {\r\n if (result?.key === 'remove') {\r\n return {\r\n key: result.key,\r\n popup\r\n };\r\n }\r\n return false;\r\n });\r\n }\r\n return {\r\n key: button.key,\r\n popup\r\n };\r\n }\r\n },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ],\r\n null\r\n ).then(result => {\r\n const key = result?.key;\r\n if (key === 'remove') {\r\n if (typeof option.onDeleteFollower === 'function') {\r\n option.onDeleteFollower(result.key, this);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n } else if (key === 'ok') {\r\n const text = result.popup.container.querySelector('.check-method-text>input').checked;\r\n const email = result.popup.container.querySelector('.check-method-email>input').checked;\r\n if (typeof option.onChangeFollower === 'function') {\r\n option.onChangeFollower(result.key, this, text, email);\r\n }\r\n this.SendText = text;\r\n this.SendEmail = email;\r\n grid.refresh();\r\n }\r\n });\r\n });\r\n }\r\n }\r\n }\r\n },\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(\r\n r('deleteFollower', 'Delete Follower'),\r\n r('promptDeleteFollower', 'Do you want to delete this follower?')\r\n ).then(result => {\r\n if (result?.key === 'yes') {\r\n if (typeof option.onDeleteFollower === 'function') {\r\n option.onDeleteFollower(result.key, this);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n grid.init(pop.container.querySelector('.followers-record'));\r\n grid.source = this.#data.followers;\r\n this.#gridFollower = grid;\r\n });\r\n });\r\n });\r\n this.#buttonFollower = buttonEditFollower;\r\n container.append(\r\n createElement('div', div => {\r\n div.className = 'contact-bar follower-bar';\r\n div.style.display = 'none';\r\n },\r\n setTooltip(createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-tag', {\r\n 'fill': '#fff',\r\n 'background-color': 'lightgray',\r\n 'box-sizing': 'border-box',\r\n 'border-radius': '15px',\r\n 'padding': '4px'\r\n })\r\n ), r('copied', 'Copied')),\r\n createElement('div', 'bar-list',\r\n followers,\r\n buttonEditFollower\r\n )\r\n )\r\n );\r\n return followers;\r\n }\r\n\r\n load(data, contacts, followers) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n contacts ??= this.#data.contacts;\r\n followers ??= this.#data.allfollowers;\r\n for (let comm of data) {\r\n const div = createElement('div', 'item-div');\r\n let name;\r\n if (comm.IsReply && contacts?.length > 0) {\r\n const c = isEmail(comm.Sender) ?\r\n contacts.find(c => c.Email === comm.Sender) :\r\n contacts.find(c => c.MobilePhone === comm.Sender);\r\n name = c?.Name;\r\n }\r\n name ??= comm.IsReply && String(comm.FormatSender) !== '' ? comm.FormatSender : comm.Sender;\r\n let sendto = '';\r\n if (!comm.IsReply && comm.OriPhoneNumbers?.length > 0) {\r\n for (let oriph of comm.OriPhoneNumbers) {\r\n let cname;\r\n const email = isEmail(oriph);\r\n if (contacts?.length > 0) {\r\n let c = email ?\r\n contacts.find(c => c.Email === oriph) :\r\n contacts.find(c => c.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n } else if (followers?.length > 0) {\r\n c = email ?\r\n followers.find(f => f.Email === oriph) :\r\n followers.find(f => f.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n }\r\n }\r\n }\r\n sendto += (cname ?? oriph) + '\\n';\r\n }\r\n }\r\n if (sendto !== '') {\r\n sendto = r('sendToColon', 'Send To :') + `\\n${sendto}`;\r\n }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = name;\r\n if (!comm.IsReply && sendto?.length > 0) {\r\n setTooltip(div, sendto);\r\n }\r\n }));\r\n const content = createElement('div', 'item-content');\r\n content.appendChild(createElement('span', span => {\r\n if (/https?:\\/\\//i.test(comm.Message)) {\r\n span.innerHTML = formatUrl(comm.Message);\r\n } else {\r\n span.innerText = comm.Message;\r\n }\r\n }));\r\n if (comm.IsReply) {\r\n div.classList.add('item-other');\r\n } else {\r\n div.classList.add('item-self');\r\n const [status, statusmsg] = this.#getMessageStatus(comm);\r\n if (status !== -100) {\r\n let statustext;\r\n switch (status) {\r\n case 0:\r\n statustext = r('pending', 'Pending');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 1:\r\n statustext = r('sent', 'Sent');\r\n break;\r\n case 9:\r\n statustext = r('failed', 'Failed');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 10:\r\n statustext = r('optOut', 'Opt-Out');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 412:\r\n statustext = r('landline', 'Landline');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n default:\r\n statustext = r('undelivered', 'Undelivered');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n }\r\n const divstatus = createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = statustext;\r\n if (status == -10) {\r\n setTooltip(div, statusmsg);\r\n }\r\n });\r\n content.appendChild(divstatus);\r\n }\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comm.TimeStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this.#message.replaceChildren(...children);\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n // setTimeout(() => this.#message.scrollTop = this.#message.scrollHeight, 0);\r\n }\r\n\r\n #getMessageStatus(comm) {\r\n let status = -100; // 没有状态,页面上不显示\r\n const ls = [];\r\n let statusmsg = '';\r\n if (!comm.StatusIncorrect && comm.Participator?.length > 0) {\r\n for (let p of comm.Participator) {\r\n if (!isEmail(p.CustomerNumber)) {\r\n if (ls.indexOf(p.Status) < 0) {\r\n ls.push(p.Status);\r\n }\r\n if (statusmsg.length > 0) {\r\n statusmsg += '\\n';\r\n }\r\n statusmsg += `${p.CustomerNumber}: `;\r\n const st = ({\r\n 0: r('undelivered', 'Undelivered'),\r\n 1: r('sent', 'Sent'),\r\n 9: r('failed', 'Failed')\r\n })[p.Status];\r\n if (st != null) {\r\n statusmsg += st;\r\n }\r\n }\r\n }\r\n }\r\n if (ls.length === 1) {\r\n status = ls[0];\r\n } else if (ls.length > 1) {\r\n status = -10; // 多种状态\r\n }\r\n return [status, statusmsg];\r\n }\r\n}\r\n\r\nexport default CustomerCommunication;","import { createElement, setTooltip, createIcon } from \"../../ui\";\r\nimport { r, nullOrEmpty, escapeHtml } from \"../../utility\";\r\nimport { createBox } from \"./lib\";\r\n\r\nclass InternalComment {\r\n #container;\r\n #option;\r\n #enter;\r\n #message;\r\n\r\n constructor(opt) {\r\n this.#option = opt ?? {};\r\n }\r\n\r\n get text() { return this.#enter?.value }\r\n set text(s) {\r\n const element = this.#enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this.#option.readonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#enter.disabled = flag === true;\r\n this.#container.querySelector('.button-send-message').style.display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-post-note').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n create() {\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = r('internalComments', 'Internal Comments');\r\n })\r\n ), []\r\n );\r\n const readonly = this.#option.readonly;\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('typeComment', 'Enter Comment Here');\r\n enter.maxLength = this.#option.maxLength ??= 3000;\r\n enter.addEventListener('input', () => {\r\n const val = this.#enter.value;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n if (readonly === true) {\r\n enter.disabled = true;\r\n }\r\n this.#enter = enter;\r\n container.appendChild(\r\n createElement('div', 'message-bar',\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n if (readonly === true || this.#option.noMessage === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('sendMessage', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onAddMessage === 'function') {\r\n this.#option.onAddMessage(this.#enter.value);\r\n }\r\n })\r\n }),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-post-note';\r\n button.style.border = '1px solid rgb(19, 150, 204)';\r\n button.style.fill = 'rgb(19, 150, 204)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'comment-alt-lines'));\r\n setTooltip(button, r('postNote', 'Post Note'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onAddComment === 'function') {\r\n this.#option.onAddComment(this.#enter.value);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this.#message = message;\r\n container.appendChild(message);\r\n return this.#container = container;\r\n }\r\n\r\n load(data) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n for (let comment of data) {\r\n const div = createElement('div', 'item-div');\r\n // if (sendto !== '') {\r\n // sendto = r('sendToColon', 'Send To :') + `\\n${sendto}`;\r\n // }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = comment.UserName;\r\n }));\r\n const content = createElement('div', 'item-content');\r\n content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(comment.Comment)));\r\n if (comment.FollowUp?.length > 0) {\r\n div.classList.add('item-sent');\r\n const sendto = r('sendToColon', 'Send To :') + '\\r\\n' + comment.FollowUp.split(';').join('\\r\\n');\r\n content.appendChild(createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = r('sent', 'Sent');\r\n setTooltip(div, sendto);\r\n }));\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comment.SubmitDateStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this.#message.replaceChildren(...children);\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n // setTimeout(() => this.#message.scrollTop = this.#message.scrollHeight, 0);\r\n }\r\n}\r\n\r\nexport default InternalComment;"],"names":["createElement","createBox","title","functions","container","header","Dropdown","isEmail","Contact","option","__privateAdd","_option","_refs","__privateSet","parent","tabIndex","e","c","__privateGet","contactName","input","preferences","r","contactEmail","contactMobile","checkOpt","createCheckbox","contactNotes","txt","buttons","item","popup","createPopup","wrapper","result","name","pref","email","phone","opt","notes","nullOrEmpty","showAlert","contact","Grid","Follower","_grid","gridContainer","div","search","key","f","contains","grid","NoteCol","element","_val","_col","setTooltip","CustomerCommunication","_autoUpdates","_statusLink","_createContacts","_createFollowers","_getMessageStatus","_container","_contacts","_followers","_buttonFollower","_enter","_message","_data","_gridContact","_gridWo","_gridFollower","_a","autoUpdates_get","flag","_b","_d","_c","statusLink_get","s","el","span","contacts","mp","isPhone","to","icon","method","createIcon","tip","link","display","code","followers","tips","data","readonly","checkAutoUpdate","checkLink","__privateMethod","createContacts_fn","createFollowers_fn","enter","val","button","message","children","comm","sendto","oriph","cname","content","formatUrl","status","statusmsg","getMessageStatus_fn","statustext","divstatus","recordReadonly","pop","selectedCol","This","iconCol","nameCol","buttonCol","createEditCol","_op","showConfirm","createRadiobox","isRecord","index","source","customerRecords","gridWo","workOrderOnly","buttonEditFollower","list","d","text","ls","p","st","InternalComment","comment","escapeHtml"],"mappings":"qsBAAAA,EAAA,OAAA,QAAA,EAAA,cAEA,SAASC,GAAUC,GAAOC,EAAW,CACjC,MAAMC,EAAYJ,EAAc,MAAO,MAAM,EACvCK,EAASL,EAAc,MAAO,YAChCE,GACAF,EAAc,MAAO,kBAAmB,GAAGG,CAAS,CAC5D,EACI,OAAAC,EAAU,YAAYC,CAAM,EACrBD,CACX,CCVA,MAAAE,GAAA,OAAA,QAAA,EAAA,2IACAC,GAAA,OAAA,aAAA,EAAA,uEAEA,MAAMC,EAAQ,CAIV,YAAYC,EAAS,GAAI,CAHzBC,EAAA,KAAAC,EAAA,QACAD,EAAA,KAAAE,EAAA,QAGIC,EAAA,KAAKF,EAAUF,EAClB,CAED,MAAM,KAAKK,EAAS,SAAS,KAAM,CAC/B,MAAMC,EAAW,KAAK,IAAI,MAAM,KAAM,CAAC,GAAG,SAAS,iBAAiB,YAAY,CAAC,EAAE,IAAIC,GAAKA,EAAE,UAAY,CAAC,CAAC,EAAI,EAE1GC,EAAIC,EAAA,KAAKP,GAAQ,QACjBQ,EAAcnB,EAAc,QAASoB,GAAS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AAY,IAElC3F,EAAA,KAAKoD,IAAS,gBAAgB,GAAGuC,CAAQ,EACzC3F,EAAA,KAAKoD,IAAS,UAAYpD,EAAA,KAAKoD,IAAS,YAE3C,CACL,CAzIIL,EAAA,YACAtD,EAAA,YACA0D,EAAA,YACAC,GAAA"} \ No newline at end of file +{"version":3,"file":"app.min.js","sources":["../../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Grid, Dropdown, createElement, createCheckbox, Popup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = new Popup({\r\n onMasking: this.#option.onMasking,\r\n title: c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n content: createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactPreferencesColon', 'Contact Preferences:')),\r\n preferences.create()\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactEmailColon', 'Email Address:')),\r\n contactEmail\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactMobileColon', 'Mobile:')),\r\n contactMobile\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactOptColon', 'Opt Out:')),\r\n checkOpt\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactNotesColon', 'Notes:')),\r\n contactNotes\r\n )\r\n ),\r\n buttons\r\n })\r\n if (c != null) {\r\n contactName.value = c.Name;\r\n preferences.select(String(c.ContactPreference));\r\n contactEmail.value = c.Email;\r\n contactMobile.value = c.MobilePhone;\r\n checkOpt.querySelector('input').checked = c.OptOut;\r\n contactNotes.value = c.Notes;\r\n } else {\r\n preferences.select('0');\r\n }\r\n this.#refs = {\r\n contactName,\r\n preferences,\r\n contactEmail,\r\n contactMobile,\r\n checkOpt,\r\n contactNotes\r\n };\r\n const result = await popup.show(parent);\r\n setTimeout(() => contactName.focus());\r\n return result;\r\n }\r\n\r\n prepare() {\r\n const name = this.#refs.contactName.value;\r\n const pref = this.#refs.preferences.selected.value;\r\n const email = this.#refs.contactEmail.value;\r\n const phone = this.#refs.contactMobile.value;\r\n const opt = this.#refs.checkOpt.querySelector('input').checked;\r\n const notes = this.#refs.contactNotes.value;\r\n const title = this.#option.contact == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact');\r\n if (nullOrEmpty(name)) {\r\n showAlert(title, r('contactNameRequired', 'Contact Name cannot be empty.'), 'warn')\r\n .then(() => this.#refs.contactName.focus());\r\n return null;\r\n }\r\n if (nullOrEmpty(email) && nullOrEmpty(phone)) {\r\n showAlert(title, r('contactEmailPhoneRequired', 'Email and Mobile Phone cannot both be empty.'), 'warn')\r\n .then(() => nullOrEmpty(email) ?\r\n this.#refs.contactEmail.focus() :\r\n this.#refs.contactMobile.focus());\r\n return null;\r\n }\r\n if (!nullOrEmpty(email) && !isEmail(email)) {\r\n showAlert(title, r('contactEmailInvalid', 'The email address is invalid.'), 'warn')\r\n .then(() => this.#refs.contactEmail.focus());\r\n return null;\r\n }\r\n\r\n let contact = this.#option.contact;\r\n if (contact == null) {\r\n contact = {};\r\n } else if (contact.OptOut !== opt) {\r\n if (opt !== false || contact.OptOut_BC === false) {\r\n contact.selected = !opt;\r\n }\r\n }\r\n contact.Name = name;\r\n contact.ContactPreference = pref;\r\n contact.Email = email;\r\n contact.MobilePhone = phone;\r\n contact.OptOut = opt;\r\n contact.Notes = notes;\r\n return contact;\r\n }\r\n}\r\n\r\nclass CustomerRecordContact {\r\n #option;\r\n #grid;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(title, parent = document.body) {\r\n // const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const gridContainer = createElement('div', 'selcontact-grid');\r\n const popup = new Popup({\r\n onMasking: this.#option.onMasking,\r\n title,\r\n content: createElement('div', 'selcontact-wrapper',\r\n gridContainer\r\n ),\r\n buttons: [\r\n {\r\n text: r('ok', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n if (typeof this.#option.onOk === 'function') {\r\n return this.#option.onOk.call(this, this.#grid.source.filter(f => f.selected));\r\n }\r\n }\r\n },\r\n { text: r('cancel', 'Cancel'), key: 'cancel' }\r\n ]\r\n });\r\n const result = await popup.show(parent);\r\n // grid\r\n const grid = new Grid(gridContainer);\r\n grid.columns = [\r\n {\r\n key: 'selected',\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 40,\r\n // enabled: item => !nullOrEmpty(item.ID)\r\n },\r\n { key: 'Name', caption: r(\"P_CR_CONTACTNAME\", \"Contact Name\"), width: 100 },\r\n { key: 'Email', caption: r(\"P_CR_CONTACTEMAIL\", \"Contact Email\"), css: { 'width': 180, 'text-align': 'left' } },\r\n { key: 'MobilePhoneDisplayText', caption: r(\"P_CR_CONTACTMOBILE\", \"Contact Mobile\"), width: 130 },\r\n { key: 'ContactPreferenceStr', caption: r(\"P_CR_CONTACTPREFERENCES\", \"Contact Preferences\"), width: 100 },\r\n { key: 'OptOut', caption: r(\"P_CR_OPTOUT\", \"Opt Out\"), type: Grid.ColumnTypes.Checkbox, width: 70, enabled: false, align: 'center' },\r\n { key: 'Notes', caption: r(\"P_CR_NOTES\", \"Notes\"), width: 120 }\r\n ];\r\n grid.init();\r\n grid.source = this.#option.contacts.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n this.#grid = grid;\r\n return result;\r\n }\r\n\r\n set source(contacts) {\r\n this.#option.contacts = contacts;\r\n const grid = this.#grid;\r\n if (grid != null) {\r\n this.#grid.source = contacts;\r\n }\r\n }\r\n}\r\n\r\nexport { Contact, CustomerRecordContact };","import { Grid, createElement, Popup } from \"../../ui\";\r\nimport { nullOrEmpty, r, contains } from \"../../utility\";\r\n\r\nclass Follower {\r\n #option;\r\n #grid;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(title, parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const gridContainer = createElement('div', 'follower-grid');\r\n const popup = new Popup({\r\n onMasking: this.#option.onMasking,\r\n title,\r\n content: createElement('div', 'follower-wrapper',\r\n createElement('div', div => div.innerText = r('whoWantReceiveCustomerNotification', 'Who do you want to receive customer notifications?')),\r\n createElement('input', search => {\r\n search.type = 'text';\r\n search.tabIndex = tabIndex + 3;\r\n search.className = 'ui-input follower-search';\r\n search.addEventListener('input', () => {\r\n const key = search.value;\r\n if (nullOrEmpty(key)) {\r\n this.#grid.source = this.#option.followers.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n } else {\r\n this.#grid.source = this.#option.followers.filter(f => f.Text || f.Email || contains(f.DisplayName, key, true))\r\n .sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n }\r\n });\r\n }),\r\n gridContainer\r\n ),\r\n buttons: [\r\n {\r\n text: r('ok', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n if (typeof this.#option.onOk === 'function') {\r\n return this.#option.onOk.call(this, this.#grid.source.filter(f => f.Email || f.Text));\r\n }\r\n }\r\n },\r\n { text: r('cancel', 'Cancel'), key: 'cancel' }\r\n ]\r\n });\r\n const result = await popup.show(parent);\r\n result.querySelector('.follower-search').focus();\r\n // grid\r\n const grid = new Grid(gridContainer);\r\n grid.columns = [\r\n { key: 'DisplayName', caption: r('contactName', 'Contact Name'), width: 240 },\r\n { key: 'ContactTypeName', caption: r('contactType', 'Contact Type'), width: 120 },\r\n {\r\n key: 'Text',\r\n caption: r('text', 'Text'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 60,\r\n enabled: item => !nullOrEmpty(item.Mobile)\r\n },\r\n {\r\n key: 'Email',\r\n caption: r('email', 'Email'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 70,\r\n // enabled: item => !nullOrEmpty(item.ID)\r\n }\r\n ];\r\n grid.init();\r\n grid.source = this.#option.followers.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n this.#grid = grid;\r\n return result;\r\n }\r\n}\r\n\r\nexport default Follower;","import { Grid, createElement, setTooltip, createIcon, createCheckbox, createRadiobox, showAlert, showConfirm, Popup } from \"../../ui\";\r\nimport { r, nullOrEmpty, formatUrl, isEmail, isPhone } from \"../../utility\";\r\nimport { createBox } from \"./lib\";\r\nimport { Contact, CustomerRecordContact } from \"./contact\";\r\nimport Follower from \"./follower\";\r\n\r\nclass NoteCol extends Grid.GridColumn {\r\n static create() {\r\n const wrapper = createElement('div', 'contact-wrapper',\r\n createElement('div', 'contact-name'),\r\n createElement('div', 'contact-note')\r\n );\r\n return wrapper;\r\n }\r\n\r\n static setValue(element, _val, item, _col, grid) {\r\n const name = element.querySelector('.contact-name');\r\n name.innerText = item.Name;\r\n if (name.scrollWidth > name.offsetWidth) {\r\n setTooltip(name, item.Name, false, grid.element);\r\n }\r\n element.querySelector('.contact-note').innerText = item.Notes;\r\n }\r\n}\r\n\r\nclass CustomerCommunication {\r\n #container;\r\n #option;\r\n #contacts;\r\n #followers;\r\n #buttonFollower;\r\n #enter;\r\n #message;\r\n #data = {};\r\n #gridContact;\r\n #gridWo;\r\n\r\n constructor(opt) {\r\n this.#option = opt ?? {};\r\n }\r\n\r\n get #autoUpdates() { return this.#container.querySelector('.check-auto-update>input') }\r\n get autoUpdatesEnabled() { return this.#autoUpdates?.disabled !== true }\r\n set autoUpdatesEnabled(flag) {\r\n const element = this.#autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get autoUpdates() { return this.#autoUpdates?.checked }\r\n set autoUpdates(flag) {\r\n const element = this.#autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n get #statusLink() { return this.#container.querySelector('.check-status-link>input') }\r\n get statusLinkEnabled() { return this.#statusLink?.disabled !== true }\r\n set statusLinkEnabled(flag) {\r\n const element = this.#statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get statusLink() { return this.#statusLink?.checked }\r\n set statusLink(flag) {\r\n const element = this.#statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set loading(flag) {\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#enter.disabled = flag;\r\n this.#container.querySelector('.customer-name>.ui-input').disabled = flag;\r\n this.#container.querySelector('.button-send-message').disabled = flag;\r\n this.#container.querySelector('.button-edit-contacts').disabled = flag;\r\n this.#container.querySelector('.button-edit-followers').disabled = flag;\r\n }\r\n\r\n get text() { return this.#enter?.value }\r\n set text(s) {\r\n const element = this.#enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n get customerName() { return this.#container.querySelector('.customer-name>.ui-input')?.value }\r\n set customerName(name) {\r\n const element = this.#container.querySelector('.customer-name>.ui-input');\r\n if (element == null) {\r\n return;\r\n }\r\n element.value = name;\r\n }\r\n\r\n get contacts() {\r\n return [...this.#contacts.children].filter(el => {\r\n return el.querySelector('span').dataset.notsend == \"false\";\r\n }).map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Key': span.dataset.to, 'Value': span.dataset.name };\r\n });\r\n }\r\n set contacts(contacts) {\r\n this.#contacts.replaceChildren();\r\n if (contacts?.length > 0) {\r\n var cs = contacts.sort(function (a, b) {\r\n if (a.Name == b.Name) return 0; return a.Name > b.Name ? 1 : -1;\r\n });\r\n for (let c of cs) {\r\n //if (c.OptOut || c.OptOut_BC || c.selected === false) {\r\n // continue;\r\n //}\r\n const mp = String(c.MobilePhoneDisplayText).trim();\r\n const email = String(c.Email).trim();\r\n const pref = String(c.ContactPreference);\r\n if ((pref !== '1') && !isPhone(mp) ||\r\n pref === '1' && !isEmail(email)) {\r\n continue;\r\n }\r\n const to = pref === '1' ? email : mp;\r\n let icon;\r\n let method;\r\n if (c.OptOut || c.OptOut_BC || c.selected === false) {\r\n icon = 'times';\r\n method = r('optedOut', 'Opted Out:');\r\n }\r\n else {\r\n switch (pref) {\r\n case '0':\r\n icon = 'comment-lines';\r\n method = r('textsToColon', 'Texts to:');\r\n break;\r\n case '2':\r\n icon = 'mobile';\r\n method = r('callsToColon', 'Calls to:');\r\n break;\r\n default:\r\n icon = 'envelope';\r\n method = r('emailsToColon', 'Emails to:');\r\n break;\r\n }\r\n }\r\n const span = createElement('span', span => {\r\n span.dataset.to = to;\r\n span.dataset.name = c.Name;\r\n span.dataset.notsend = c.OptOut || c.OptOut_BC || c.selected === false;\r\n span.innerText = c.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon, { 'fill': (c.OptOut || c.OptOut_BC || c.selected === false) ? 'red' : '' }),\r\n span\r\n );\r\n this.#contacts.appendChild(item);\r\n let tip = `${method} ${to}`;\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tip = r('nameColon', 'Name:') + ` ${c.Name}\\n${tip}`;\r\n }\r\n setTooltip(span, tip);\r\n }\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this.#option.readonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n const link = this.#container.querySelector('.check-status-link');\r\n if (flag === true) {\r\n link.classList.add('disabled');\r\n } else {\r\n link.classList.remove('disabled');\r\n }\r\n link.querySelector('input').disabled = flag;\r\n const display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-edit-contacts').style.display = display;\r\n this.#container.querySelector('.button-edit-followers').style.display = display;\r\n // this.#enter.disabled = flag === true;\r\n this.#container.querySelector('.message-bar').style.display = display;\r\n // this.#container.querySelector('.button-send-message').style.display = display;\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set recordReadonly(flag) {\r\n this.#option.recordReadonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#container.querySelector('.button-edit-contacts').style.display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-edit-followers').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n /**\r\n * @param {String} name\r\n */\r\n set companyName(name) {\r\n this.#option.companyName = name;\r\n const div = this.#container.querySelector('.title-company');\r\n if (nullOrEmpty(name)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = name;\r\n div.style.display = '';\r\n }\r\n }\r\n /**\r\n * @param {String} code\r\n */\r\n set companyCode(code) {\r\n this.#option.companyCode = code;\r\n const div = this.#container.querySelector('.title-company');\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = this.#option.companyName;\r\n if (!nullOrEmpty(code))\r\n div.innerText = this.#option.companyName + \"/\" + code;\r\n div.style.display = '';\r\n }\r\n }\r\n\r\n get followers() {\r\n return [...this.#followers.children].map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Email': span.dataset.email, 'MobilePhone': span.dataset.mp, 'Value': span.dataset.name };\r\n });\r\n }\r\n set followers(followers) {\r\n this.#data.followers = followers;\r\n this.#followers.replaceChildren();\r\n if (followers?.length > 0) {\r\n this.#container.querySelector('.follower-bar').style.display = '';\r\n setTooltip(this.#buttonFollower, r('editFollower', 'Edit Followers'));\r\n this.#container.querySelector('.follower-bar>.bar-list').appendChild(this.#buttonFollower);\r\n for (let f of followers) {\r\n if (f.OptOut) {\r\n continue;\r\n }\r\n const mp = String(f.MobilePhone).trim();\r\n const email = String(f.Email).trim();\r\n const tips = [];\r\n if (f.SendEmail) {\r\n tips.push(r('emailsToColon', 'Emails to:') + ` ${email}`);\r\n }\r\n if (f.SendText) {\r\n tips.push(r('textsToColon', 'Texts to:' + ` ${mp}`));\r\n }\r\n let icon;\r\n if (f.SendText && f.SendEmail) {\r\n icon = 'at';\r\n } else {\r\n icon = f.SendText ? 'comment-lines' : 'envelope';\r\n }\r\n const span = createElement('span', span => {\r\n if (f.SendEmail) {\r\n span.dataset.email = email;\r\n }\r\n if (f.SendText) {\r\n span.dataset.mp = mp;\r\n }\r\n span.dataset.name = f.Name;\r\n span.innerText = f.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon),\r\n span\r\n );\r\n this.#followers.appendChild(item);\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tips.splice(0, 0, r('nameColon', 'Name:') + ` ${c.Name}`);\r\n }\r\n setTooltip(span, tips.join('\\n'));\r\n }\r\n } else {\r\n this.#container.querySelector('.follower-bar').style.display = 'none';\r\n setTooltip(this.#buttonFollower, r('addFollowers', 'Add Followers'));\r\n this.#container.querySelector('.button-edit-contacts').insertAdjacentElement('beforebegin', this.#buttonFollower)\r\n }\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n }\r\n\r\n setData(key, data) {\r\n this.#data[key] = data;\r\n }\r\n\r\n create() {\r\n const option = this.#option;\r\n const readonly = option.readonly;\r\n // functions\r\n const checkAutoUpdate = createCheckbox({\r\n className: 'check-auto-update',\r\n checked: option.autoUpdates,\r\n checkedNode: createIcon('fa-regular', 'redo-alt'),\r\n uncheckedNode: createIcon('fa-regular', 'ban'),\r\n onchange: function () {\r\n setTooltip(checkAutoUpdate, this.checked ?\r\n r('autoUpdateEnabled', 'Auto Updates Enabled') :\r\n r('autoUpdateDisabled', 'Auto Updates Disabled'));\r\n }\r\n });\r\n if (option.autoUpdatesVisible === false) {\r\n checkAutoUpdate.style.display = 'none';\r\n }\r\n const checkLink = createCheckbox({\r\n className: 'check-status-link',\r\n enabled: !readonly,\r\n checked: option.statusLink,\r\n checkedNode: createIcon('fa-regular', 'link'),\r\n uncheckedNode: createIcon('fa-regular', 'unlink'),\r\n onchange: function () {\r\n setTooltip(checkLink, this.checked ?\r\n r('statusLinkIncluded', 'Status Link Included') :\r\n r('statusLinkExcluded', 'Status Link Excluded'));\r\n }\r\n });\r\n if (option.statusLinkVisible === false) {\r\n checkLink.style.display = 'none';\r\n }\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = option.title ?? r('messages', 'Customer Communication');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n [\r\n setTooltip(checkAutoUpdate, r('autoUpdateEnabled', 'Auto Updates Enabled')),\r\n setTooltip(checkLink, r('statusLinkExcluded', 'Status Link Excluded'))\r\n ]\r\n );\r\n // contacts\r\n this.#contacts = this.#createContacts(container, option);\r\n // followers\r\n this.#followers = this.#createFollowers(container, option);\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('typeMessage', 'Enter Message Here');\r\n option.maxLength ??= 3000;\r\n enter.maxLength = option.maxLength;\r\n // if (readonly === true) {\r\n // enter.disabled = true;\r\n // }\r\n enter.addEventListener('input', () => {\r\n const val = this.#enter.value;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n this.#enter = enter;\r\n container.appendChild(\r\n createElement('div', div => {\r\n div.className = 'message-bar';\r\n if (readonly === true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', div => {\r\n div.className = 'customer-name';\r\n if (option.customerNameVisible !== true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n createElement('span', span => span.innerText = r('nameColon', 'Name:')),\r\n createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n })\r\n ),\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n // if (readonly === true) {\r\n // button.style.display = 'none';\r\n // }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('sendMessage', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n const val = this.#enter.value;\r\n if (nullOrEmpty(val?.trim())) {\r\n showAlert(r('error', 'Error'), r('messageRequired', 'Please input the message.'), 'warn');\r\n return;\r\n }\r\n if (typeof this.#option.onAddMessage === 'function') {\r\n this.#option.onAddMessage(this.#enter.value);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this.#message = message;\r\n container.appendChild(message);\r\n return this.#container = container;\r\n }\r\n\r\n #createContacts(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const contacts = createElement('div', 'bar-list-container');\r\n container.append(\r\n createElement('div', 'contact-bar',\r\n createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-circle', {\r\n 'fill': 'lightgray'\r\n })\r\n ),\r\n createElement('div', 'bar-list',\r\n contacts,\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-edit-contacts';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-edit'));\r\n setTooltip(button, r('editContacts', 'Edit Contacts'));\r\n button.addEventListener('click', () => {\r\n const pop = new Popup({\r\n onMasking: option.onMasking,\r\n title: createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.alignItems = 'center';\r\n div.append(\r\n createElement('div', div => {\r\n div.className = 'ui-popup-move';\r\n div.style.flex = '1 1 auto';\r\n },\r\n createElement('div', div => div.innerText = r('editContacts', 'Edit Contacts')),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-from-customer-record';\r\n if (recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'handshake', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n const sel = new CustomerRecordContact({\r\n // onMasking: option.onMasking,\r\n contacts: [],\r\n onOk: list => {\r\n if (typeof this.#option.onSelectCRContacts === 'function') {\r\n list?.map(c => {\r\n delete c.selected;\r\n return c;\r\n });\r\n const result = this.#option.onSelectCRContacts(list);\r\n }\r\n const r = this.#data.contacts;\r\n this.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n this.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n }\r\n });\r\n var title = r('selectFromCustomerRecord', 'Select from Customer Record');\r\n sel.show(title, container);\r\n\r\n if (typeof this.#option.onOpenSelectCRContacts === 'function') {\r\n const result = this.#option.onOpenSelectCRContacts();\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n r.map(c => {\r\n for (let cc of this.#data.contacts) {\r\n if (c.Id === cc.Id) {\r\n c.selected = true;\r\n break;\r\n }\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = false;\r\n }\r\n return c;\r\n });\r\n this.#data.contacts.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n\r\n sel.source = r;\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n });\r\n setTooltip(button, r('selectFromCustomerRecord', 'Select from Customer Record'))\r\n }),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-add-contact';\r\n if (recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-plus', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n const add = new Contact({\r\n // onMasking: option.onMasking,\r\n company: !nullOrEmpty(this.#option.companyName),\r\n onSave: item => {\r\n const exists = this.#gridContact.source.some(s => s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('addContact', 'Add Contact'), r('contactUniqueRequired', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item, true);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n this.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n this.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n add.show(container);\r\n });\r\n setTooltip(button, r('addContact', 'Add Contact'))\r\n })\r\n )\r\n }),\r\n content: createElement('div', null,\r\n createElement('div', div => {\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n }\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromRecord', 'Contacts from Customer Record');\r\n }),\r\n createElement('div', div => {\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n }\r\n div.className = 'contacts-record';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n }),\r\n createElement('div', div => {\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromWorkOrder', 'Contacts not on Customer Record');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'contacts-wo';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n })\r\n )\r\n });\r\n pop.show(container).then(() => {\r\n const selectedCol = This => {\r\n return {\r\n key: 'selected',\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 50,\r\n enabled: item => !item.OptOut && !item.OptOut_BC,\r\n onchanged: function () {\r\n if (typeof option.onChanged === 'function') {\r\n option.onChanged([...This.#gridContact.source, ...This.#gridWo.source]);\r\n }\r\n },\r\n tooltip: item => item.selected ? r('optedIn', 'Opted In') : r('optedOut', 'Opted Out')\r\n }\r\n };\r\n const iconCol = {\r\n key: 'type',\r\n type: Grid.ColumnTypes.Icon,\r\n width: 50,\r\n filter: c => {\r\n switch (String(c.ContactPreference)) {\r\n case '0': return 'comment-lines';\r\n case '2': return 'mobile';\r\n default: return 'envelope';\r\n }\r\n },\r\n className: 'icon-contact-type',\r\n iconType: 'fa-light'\r\n };\r\n const nameCol = { key: 'Name', type: NoteCol, width: 160 };\r\n const buttonCol = {\r\n type: Grid.ColumnTypes.Icon,\r\n width: 40,\r\n visible: !recordReadonly,\r\n align: 'center',\r\n iconType: 'fa-light'\r\n };\r\n const createEditCol = (This) => {\r\n return {\r\n key: 'edit',\r\n ...buttonCol,\r\n text: 'edit',\r\n tooltip: r('edit', 'Edit'),\r\n events: {\r\n onclick: function () {\r\n const edit = new Contact({\r\n // onMasking: option.onMasking,\r\n contact: this,\r\n company: !nullOrEmpty(This.#option.companyName),\r\n onSave: (item, _op) => {\r\n const exists =\r\n This.#gridContact.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone) ||\r\n This.#gridWo.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('editContact', 'Edit Contact'), r('contactUniqueRequired', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n This.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n This.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n edit.show(container);\r\n }\r\n }\r\n }\r\n };\r\n // contacts from customer record\r\n const grid = new Grid();\r\n grid.height = 0;\r\n grid.allowHtml = true;\r\n grid.headerVisible = false;\r\n grid.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(\r\n r('remoteContact', 'Remove Contact'),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.style.paddingLeft = '16px';\r\n div.innerText = r('removeFrom', 'Remove {name} from').replace('{name}', this.Name);\r\n }),\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.justifyContent = 'center';\r\n div.style.marginTop = '10px';\r\n },\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('customerRecord', 'Customer Record'),\r\n checked: true,\r\n className: 'radio-customer-record'\r\n }),\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('workOrder', 'Work Order')\r\n })\r\n )\r\n ),\r\n [\r\n { key: 'ok', text: r('ok', 'OK') },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ]\r\n ).then(result => {\r\n if (result?.key === 'ok') {\r\n const isRecord = result.popup.container.querySelector('.radio-customer-record>input').checked;\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this, isRecord);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n grid.init(pop.container.querySelector('.contacts-record'));\r\n const customerRecords = this.#data.contacts.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n grid.extraRows = customerRecords.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = customerRecords;\r\n grid.selectedRowChanged = index => {\r\n if (index >= 0 && this.#gridWo.selectedIndexes?.length > 0) {\r\n this.#gridWo.selectedIndexes = [];\r\n }\r\n };\r\n this.#gridContact = grid;\r\n\r\n // contacts from work order only\r\n const gridWo = new Grid();\r\n gridWo.height = 0;\r\n gridWo.allowHtml = true;\r\n gridWo.headerVisible = false;\r\n gridWo.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(r('remoteContact', 'Remove Contact'), r('removeFromWorkorder', 'You are removing {name} from work order.\\n\\nDo you want to Continue?').replace('{name}', this.Name), [\r\n { key: 'continue', text: r('continue', 'Continue') },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ]).then(result => {\r\n if (result?.key === 'continue') {\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this);\r\n }\r\n const index = gridWo.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = gridWo.source;\r\n source.splice(index, 1);\r\n gridWo.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n gridWo.init(pop.container.querySelector('.contacts-wo'));\r\n const workOrderOnly = this.#data.contacts.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n gridWo.extraRows = workOrderOnly.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = workOrderOnly;\r\n gridWo.selectedRowChanged = index => {\r\n if (index >= 0 && this.#gridContact.selectedIndexes?.length > 0) {\r\n this.#gridContact.selectedIndexes = [];\r\n }\r\n };\r\n this.#gridWo = gridWo;\r\n });\r\n });\r\n })\r\n )\r\n )\r\n );\r\n return contacts;\r\n }\r\n\r\n #createFollowers(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const followers = createElement('div', 'bar-list-container');\r\n const buttonEditFollower = createElement('button', button => {\r\n button.className = 'roundbtn button-edit-followers';\r\n button.style.backgroundColor = 'rgb(48, 107, 255)';\r\n if (readonly === true || recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'pen'));\r\n setTooltip(button, r('editFollower', 'Edit Followers'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onInitFollower === 'function') {\r\n this.#option.onInitFollower(this.#data.followers).then(data => {\r\n if (typeof data === 'string') {\r\n showAlert(r('customerRecord', 'Customer Record'), data, 'warn');\r\n return;\r\n }\r\n const add = new Follower({\r\n onMasking: option.onMasking,\r\n followers: data,\r\n onOk: list => {\r\n if (typeof this.#option.onAddFollower === 'function') {\r\n const result = this.#option.onAddFollower(list);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n // this.followers = r;\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n var title = this.#data.followers?.length > 0 ? r('editFollowers', 'Edit Followers') : r('addFollowers', 'Add Followers');\r\n add.show(title, container);\r\n });\r\n }\r\n });\r\n });\r\n this.#buttonFollower = buttonEditFollower;\r\n container.append(\r\n createElement('div', div => {\r\n div.className = 'contact-bar follower-bar';\r\n div.style.display = 'none';\r\n },\r\n setTooltip(createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-tag', {\r\n 'fill': '#fff',\r\n 'background-color': 'lightgray',\r\n 'box-sizing': 'border-box',\r\n 'border-radius': '15px',\r\n 'padding': '4px'\r\n })\r\n ), r('copied', 'Copied')),\r\n createElement('div', 'bar-list',\r\n followers,\r\n buttonEditFollower\r\n )\r\n )\r\n );\r\n return followers;\r\n }\r\n\r\n load(data, contacts, followers) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n contacts ??= this.#data.contacts;\r\n followers ??= this.#data.allfollowers;\r\n for (let comm of data) {\r\n const div = createElement('div', 'item-div');\r\n let name;\r\n if (comm.IsReply && contacts?.length > 0) {\r\n const c = isEmail(comm.Sender) ?\r\n contacts.find(c => c.Email === comm.Sender) :\r\n contacts.find(c => c.MobilePhone === comm.Sender);\r\n name = c?.Name;\r\n }\r\n name ??= comm.IsReply && String(comm.FormatSender) !== '' ? comm.FormatSender : comm.Sender;\r\n let sendto = '';\r\n if (!comm.IsReply && comm.OriPhoneNumbers?.length > 0) {\r\n for (let oriph of comm.OriPhoneNumbers) {\r\n let cname;\r\n const email = isEmail(oriph);\r\n if (contacts?.length > 0) {\r\n let c = email ?\r\n contacts.find(c => c.Email === oriph) :\r\n contacts.find(c => c.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n } else if (followers?.length > 0) {\r\n c = email ?\r\n followers.find(f => f.Email === oriph) :\r\n followers.find(f => f.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n }\r\n }\r\n }\r\n sendto += (cname ?? oriph) + '\\n';\r\n }\r\n }\r\n if (sendto !== '') {\r\n sendto = r('sendToColon', 'Send To :') + `\\n${sendto}`;\r\n }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = name;\r\n if (!comm.IsReply && sendto?.length > 0) {\r\n setTooltip(div, sendto);\r\n }\r\n }));\r\n const content = createElement('div', 'item-content');\r\n content.appendChild(createElement('span', span => {\r\n if (/https?:\\/\\//i.test(comm.Message)) {\r\n span.innerHTML = formatUrl(comm.Message);\r\n } else {\r\n span.innerText = comm.Message;\r\n }\r\n }));\r\n if (comm.IsReply) {\r\n div.classList.add('item-other');\r\n } else {\r\n div.classList.add('item-self');\r\n const [status, statusmsg] = this.#getMessageStatus(comm);\r\n if (status !== -100) {\r\n let statustext;\r\n switch (status) {\r\n case 0:\r\n statustext = r('pending', 'Pending');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 1:\r\n statustext = r('sent', 'Sent');\r\n break;\r\n case 9:\r\n statustext = r('failed', 'Failed');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 10:\r\n statustext = r('optOut', 'Opt-Out');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 412:\r\n statustext = r('landline', 'Landline');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n default:\r\n statustext = r('undelivered', 'Undelivered');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n }\r\n const divstatus = createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = statustext;\r\n if (status == -10) {\r\n setTooltip(div, statusmsg);\r\n }\r\n });\r\n content.appendChild(divstatus);\r\n }\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comm.TimeStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this.#message.replaceChildren(...children);\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n // setTimeout(() => this.#message.scrollTop = this.#message.scrollHeight, 0);\r\n }\r\n\r\n #getMessageStatus(comm) {\r\n let status = -100; // 没有状态,页面上不显示\r\n const ls = [];\r\n let statusmsg = '';\r\n if (!comm.StatusIncorrect && comm.Participator?.length > 0) {\r\n for (let p of comm.Participator) {\r\n if (!isEmail(p.CustomerNumber)) {\r\n if (ls.indexOf(p.Status) < 0) {\r\n ls.push(p.Status);\r\n }\r\n if (statusmsg.length > 0) {\r\n statusmsg += '\\n';\r\n }\r\n statusmsg += `${p.CustomerNumber}: `;\r\n const st = ({\r\n 0: r('undelivered', 'Undelivered'),\r\n 1: r('sent', 'Sent'),\r\n 9: r('failed', 'Failed')\r\n })[p.Status];\r\n if (st != null) {\r\n statusmsg += st;\r\n }\r\n }\r\n }\r\n }\r\n if (ls.length === 1) {\r\n status = ls[0];\r\n } else if (ls.length > 1) {\r\n status = -10; // 多种状态\r\n }\r\n return [status, statusmsg];\r\n }\r\n}\r\n\r\nexport default CustomerCommunication;","import { createElement, setTooltip, createIcon } from \"../../ui\";\r\nimport { r, nullOrEmpty, escapeHtml } from \"../../utility\";\r\nimport { createBox } from \"./lib\";\r\n\r\nclass InternalComment {\r\n #container;\r\n #option;\r\n #enter;\r\n #message;\r\n\r\n constructor(opt) {\r\n this.#option = opt ?? {};\r\n }\r\n\r\n get text() { return this.#enter?.value }\r\n set text(s) {\r\n const element = this.#enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this.#option.readonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#enter.disabled = flag === true;\r\n this.#container.querySelector('.button-send-message').style.display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-post-note').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n create() {\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = r('internalComments', 'Internal Comments');\r\n })\r\n ), []\r\n );\r\n const readonly = this.#option.readonly;\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('typeComment', 'Enter Comment Here');\r\n enter.maxLength = this.#option.maxLength ??= 3000;\r\n enter.addEventListener('input', () => {\r\n const val = this.#enter.value;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n if (readonly === true) {\r\n enter.disabled = true;\r\n }\r\n this.#enter = enter;\r\n container.appendChild(\r\n createElement('div', 'message-bar',\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n if (readonly === true || this.#option.noMessage === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('sendMessage', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onAddMessage === 'function') {\r\n this.#option.onAddMessage(this.#enter.value);\r\n }\r\n })\r\n }),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-post-note';\r\n button.style.border = '1px solid rgb(19, 150, 204)';\r\n button.style.fill = 'rgb(19, 150, 204)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'comment-alt-lines'));\r\n setTooltip(button, r('postNote', 'Post Note'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onAddComment === 'function') {\r\n this.#option.onAddComment(this.#enter.value);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this.#message = message;\r\n container.appendChild(message);\r\n return this.#container = container;\r\n }\r\n\r\n load(data) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n for (let comment of data) {\r\n const div = createElement('div', 'item-div');\r\n // if (sendto !== '') {\r\n // sendto = r('sendToColon', 'Send To :') + `\\n${sendto}`;\r\n // }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = comment.UserName;\r\n }));\r\n const content = createElement('div', 'item-content');\r\n content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(comment.Comment)));\r\n if (comment.FollowUp?.length > 0) {\r\n div.classList.add('item-sent');\r\n const sendto = r('sendToColon', 'Send To :') + '\\r\\n' + comment.FollowUp.split(';').join('\\r\\n');\r\n content.appendChild(createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = r('sent', 'Sent');\r\n setTooltip(div, sendto);\r\n }));\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comment.SubmitDateStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this.#message.replaceChildren(...children);\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n // setTimeout(() => this.#message.scrollTop = this.#message.scrollHeight, 0);\r\n }\r\n}\r\n\r\nexport default InternalComment;"],"names":["createElement","createBox","title","functions","container","header","Grid","isEmail","Contact","option","__privateAdd","_option","_refs","__privateSet","parent","tabIndex","e","c","__privateGet","contactName","input","preferences","Dropdown","r","contactEmail","contactMobile","checkOpt","createCheckbox","contactNotes","txt","buttons","item","popup","Popup","wrapper","result","name","pref","email","phone","opt","notes","nullOrEmpty","showAlert","contact","CustomerRecordContact","_grid","gridContainer","f","grid","a","b","contacts","Follower","div","search","key","contains","NoteCol","element","_val","_col","setTooltip","CustomerCommunication","_autoUpdates","_statusLink","_createContacts","_createFollowers","_getMessageStatus","_container","_contacts","_followers","_buttonFollower","_enter","_message","_data","_gridContact","_gridWo","_a","autoUpdates_get","flag","_b","_d","_c","statusLink_get","s","el","span","cs","mp","isPhone","to","icon","method","createIcon","tip","link","display","code","followers","tips","data","readonly","checkAutoUpdate","checkLink","__privateMethod","createContacts_fn","createFollowers_fn","enter","val","button","message","children","comm","sendto","oriph","cname","content","formatUrl","status","statusmsg","getMessageStatus_fn","statustext","divstatus","recordReadonly","pop","sel","list","cc","selectedCol","This","iconCol","nameCol","buttonCol","createEditCol","_op","showConfirm","createRadiobox","isRecord","index","source","customerRecords","gridWo","workOrderOnly","buttonEditFollower","add","ls","p","st","InternalComment","comment","escapeHtml"],"mappings":"ssBAAAA,EAAA,OAAA,QAAA,EAAA,cAEA,SAASC,GAAUC,GAAOC,EAAW,CACjC,MAAMC,EAAYJ,EAAc,MAAO,MAAM,EACvCK,EAASL,EAAc,MAAO,YAChCE,GACAF,EAAc,MAAO,kBAAmB,GAAGG,CAAS,CAC5D,EACI,OAAAC,EAAU,YAAYC,CAAM,EACrBD,CACX,CCVA,MAAAE,GAAA,OAAA,QAAA,EAAA,8JACAC,GAAA,OAAA,aAAA,EAAA,uEAEA,MAAMC,EAAQ,CAIV,YAAYC,EAAS,GAAI,CAHzBC,EAAA,KAAAC,EAAA,QACAD,EAAA,KAAAE,EAAA,QAGIC,EAAA,KAAKF,EAAUF,EAClB,CAED,MAAM,KAAKK,EAAS,SAAS,KAAM,CAC/B,MAAMC,EAAW,KAAK,IAAI,MAAM,KAAM,CAAC,GAAG,SAAS,iBAAiB,YAAY,CAAC,EAAE,IAAIC,GAAKA,EAAE,UAAY,CAAC,CAAC,EAAI,EAE1GC,EAAIC,EAAA,KAAKP,GAAQ,QACjBQ,EAAcnB,EAAc,QAASoB,GAAS,CAChDA,EAAM,KAA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,KAAK;AAAA,CAAM,EAC/FjC,EAAQ,YAAYrH,EAAc,MAAOsD,GAAO,CAC5CA,EAAI,UAAY,cAChBA,EAAI,UAAY/B,GAAE,OAAQ,MAAM,EAChCuC,GAAWR,EAAK4D,CAAM,CACzB,CAAA,CAAC,EAEN5D,EAAI,OACA+D,EACArH,EAAc,MAAOsD,GAAO,CACxBA,EAAI,UAAY,YAChBA,EAAI,UAAYgG,EAAQ,aAChD,CAAqB,CACrB,EACgBtC,EAAS,KAAK1D,CAAG,EAErB0D,EAAS,CAAC,EAAE,MAAM,UAAY,IAElC9F,EAAA,KAAKwD,IAAS,gBAAgB,GAAGsC,CAAQ,EACzC9F,EAAA,KAAKwD,IAAS,UAAYxD,EAAA,KAAKwD,IAAS,YAE3C,CACL,CAzIIL,EAAA,YACA1D,EAAA,YACA8D,EAAA,YACAC,GAAA"} \ No newline at end of file diff --git a/Site/js/lib/ui.min.css b/Site/js/lib/ui.min.css index b1d97ce..d1249be 100644 --- a/Site/js/lib/ui.min.css +++ b/Site/js/lib/ui.min.css @@ -1 +1 @@ -@-webkit-keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}:root{--color: #201f1e;--bg-color: #fff;--border-color: #b9b9b9;--focus-border-color: #666;--shadow-color: rgba(0, 0, 0,.11);--disabled-color: #aaa;--disabled-bg-color: #e9e9e9;--disabled-border-color: #d9d9d9;--red-color: red;--title-color: #fff;--title-bg-color: rgb(68, 114, 196);--hover-bg-color: #eee;--link-color: #1890ff;--primary-color: rgb(123, 28, 33);--loading-bg-color: hsla(0, 0%, 100%, .4);--loading-fore-color: rgba(0, 0, 0, .2);--border-radius: 2px;--text-indent: 4px;--line-height: 24px;--font-size: .8125rem;--font-smaller-size: .75rem;--font-larger-size: .875rem;--font-family: "Franklin Gothic Book", "San Francisco", "Segoe UI", "Open Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei UI", sans-serif}.ui-text,.ui-input[type]{font-size:var(--font-size);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-text:focus,.ui-text:focus-visible,.ui-input[type]:focus,.ui-input[type]:focus-visible{outline:none}.ui-text:focus,.ui-text:hover,.ui-input[type]:focus,.ui-input[type]:hover{border-color:var(--focus-border-color)}.ui-text:disabled,.ui-input[type]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-input{text-indent:var(--text-indent);line-height:var(--line-height)}.ui-check-image-wrapper>input[type=checkbox]{display:none}.ui-check-image-wrapper>input[type=checkbox]:checked~.checked{display:inline}.ui-check-image-wrapper>input[type=checkbox]:checked~.unchecked{display:none}.ui-check-image-wrapper>.checked{display:none}.ui-check-image-wrapper>.unchecked{display:inline}.ui-check-wrapper{display:inline-flex;align-items:center;padding:0 8px;height:36px}.ui-check-wrapper .ui-check-inner{position:relative;display:inline-block;padding:0;width:14px;height:14px;background-color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:focus-visible{outline:none}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:hover{border-color:var(--focus-border-color)}.ui-check-wrapper .ui-check-inner:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-check-wrapper .ui-check-inner>svg{position:absolute;top:0;left:0;width:100%;height:100%;fill:#fff;-webkit-transform:scale(0);transform:scale(0);opacity:0;transition:all .08s cubic-bezier(.78,.14,.15,.86)}.ui-check-wrapper.ui-radio-wrapper .ui-check-inner{box-sizing:border-box;border-radius:8px;width:16px;height:16px}.ui-check-wrapper>input[type=checkbox],.ui-check-wrapper>input[type=radio]{display:none}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner{border-color:var(--link-color);background-color:var(--link-color)}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner>svg,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner>svg{-webkit-transform:scale(1);transform:scale(1);opacity:1}.ui-check-wrapper>input[type=checkbox]:disabled:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled:checked+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-border-color)}.ui-check-wrapper>input[type=checkbox]:disabled+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);cursor:default}.ui-check-wrapper>input[type=checkbox]:disabled~span,.ui-check-wrapper>input[type=radio]:disabled~span{color:var(--disabled-border-color);cursor:default}.ui-check-wrapper .ui-check-inner{flex:0 0 auto}.ui-check-wrapper .ui-check-inner+*{flex:1 1 auto;font-weight:400;font-size:var(--font-size);padding-left:8px;padding-right:6px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:var(--color)}.ui-tooltip-color{background-color:#fff;color:#323130;border-color:#cccc}.ui-tooltip-color:focus,.ui-tooltip-color:focus-visible{outline:none}.ui-tooltip-wrapper{position:absolute;word-wrap:break-word;height:auto;text-align:left;z-index:250;min-width:45px;max-width:480px;min-height:32px;border-radius:2px;box-shadow:0 3.2px 7.2px #00000021,0 .6px 1.8px #0000001c;transition:visibility 0s linear .12s,opacity .12s ease}.ui-tooltip-wrapper>.ui-tooltip-pointer{box-sizing:border-box;box-shadow:0 5px 15px 2px #0000004d;border:1px solid #fff;z-index:-1;width:16px;height:16px;position:absolute;left:calc(50% - 8px);bottom:-8px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:center;transform-origin:center}.ui-tooltip-wrapper>.ui-tooltip-curtain{position:absolute;width:100%;height:100%;z-index:-1}.ui-tooltip-wrapper>.ui-tooltip-content{font-size:var(--font-smaller-size);line-height:1rem;white-space:normal;overflow:hidden;margin:8px;height:calc(100% - 16px);-webkit-user-select:none;-ms-user-select:none;user-select:none}.ui-drop-wrapper{display:inline-block;border:none;border-radius:0;border-radius:initial;-webkit-user-select:none;-ms-user-select:none;user-select:none;position:relative;font-size:var(--font-size);font-family:var(--font-family)}.ui-drop-wrapper>.ui-drop-header{background-color:var(--bg-color);display:flex;height:26px;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-drop-wrapper>.ui-drop-header:focus,.ui-drop-wrapper>.ui-drop-header:focus-visible{outline:none}.ui-drop-wrapper>.ui-drop-header:focus,.ui-drop-wrapper>.ui-drop-header:hover{border-color:var(--focus-border-color)}.ui-drop-wrapper>.ui-drop-header:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-drop-wrapper>.ui-drop-header>.ui-drop-text{flex:1 1 auto;cursor:pointer;font-size:var(--font-size);padding:0 6px;overflow:hidden;text-overflow:ellipsis;border:none;white-space:nowrap}.ui-drop-wrapper>.ui-drop-header>.ui-drop-text:focus,.ui-drop-wrapper>.ui-drop-header>.ui-drop-text:focus-visible{outline:none}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text{cursor:auto;cursor:initial}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text::-webkit-input-placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text:-ms-input-placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text::-ms-input-placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text::placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>.ui-drop-caret{flex:0 0 auto;width:26px;display:flex;justify-content:center;align-items:center;cursor:pointer}.ui-drop-wrapper>.ui-drop-header>.ui-drop-caret:after{display:block;content:"";border-top:4px solid;border-left:4px solid transparent;border-right:4px solid transparent;height:0;width:0}.ui-drop-wrapper>.ui-drop-header.disabled{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);color:var(--disabled-color)}.ui-drop-wrapper>.ui-drop-header.disabled:focus{border-color:var(--disabled-border-color)}.ui-drop-wrapper>.ui-drop-header.disabled>.ui-drop-text,.ui-drop-wrapper>.ui-drop-header.disabled>.ui-drop-caret{cursor:default}.ui-drop-wrapper>.ui-drop-box{position:absolute;visibility:hidden;opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:top;transform-origin:top;background-color:var(--bg-color);top:28px;z-index:2;transition:opacity .12s ease,visibility .12s ease,-webkit-transform .12s ease;transition:transform .12s ease,opacity .12s ease,visibility .12s ease;transition:transform .12s ease,opacity .12s ease,visibility .12s ease,-webkit-transform .12s ease;width:calc(100% + 2px);box-sizing:border-box;box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;left:-1px}.ui-drop-wrapper>.ui-drop-box.slide-up{-webkit-transform-origin:bottom;transform-origin:bottom;top:auto;top:initial;bottom:28px}.ui-drop-wrapper>.ui-drop-box.active{visibility:visible;opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search{box-sizing:border-box;height:36px;line-height:36px;padding:0 8px;position:relative;display:flex;align-items:center}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]{box-sizing:border-box;width:100%;height:26px;padding:0 6px 0 22px;color:var(--color);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:focus,.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:focus-visible{outline:none}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:focus,.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:hover{border-color:var(--focus-border-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]::-webkit-input-placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:-ms-input-placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]::-ms-input-placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]::placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>svg{position:absolute;left:14px;width:13px;height:100%;cursor:text}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list{margin:0;padding:0;list-style:none;max-height:210px;overflow-y:auto;font-size:var(--font-size)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list::-webkit-scrollbar{width:8px;height:8px}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list.filtered>li:first-child{background-color:var(--hover-bg-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li{line-height:30px;height:30px;padding:0 10px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li:hover,.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li.selected{background-color:var(--hover-bg-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li>.ui-check-wrapper{height:30px;display:flex}.ui-grid{position:relative;box-sizing:border-box;display:flex;flex-direction:column;overflow:visible;overflow-x:hidden}.ui-grid{--cell-hover-bg-color: lightyellow;--header-border-color: #adaba9;--header-bg-color: #fafafa;--header-fore-color: #000;--cell-border-color: #f0f0f0;--cell-fore-color: #333;--dark-border-color: #666;--split-border-color: #b3b3b3;--dragger-bg-color: #fff;--dragger-cursor-color: #333;--row-bg-color: #fff;--row-active-bg-color: #fafafa;--row-selected-bg-color: #e6f2fb;--text-disabled-color: gray;--filter-shadow: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05);--filter-transition: transform .12s ease, opacity .24s ease;--row-height: 36px;--header-line-height: 26px;--text-indent: 8px;--loading-size: 40px;--loading-border-radius: 20px;--arrow-size: 4px;--filter-size: 10px;--split-width: 8px;--dragger-size: 20px;--dragger-opacity: .6;--dragger-cursor-size: 4px;--dragger-cursor-pos: -4px;--dragger-cursor-opacity: .3;--header-padding: 4px 12px 4px 8px;--header-filter-padding: 4px 26px 4px 8px;--spacing-s: 4px;--spacing-cell: 6px 4px 6px 8px;--filter-line-height: 30px;--filter-item-padding: 0 4px}.ui-grid:focus,.ui-grid:focus-visible{outline:none}.ui-grid,.ui-grid input[type=text],.ui-grid textarea{font-size:var(--font-size);font-family:var(--font-family)}.ui-grid>.ui-grid-sizer{position:absolute;white-space:nowrap;font-weight:700;visibility:hidden}.ui-grid>.ui-grid-header{width:100%;min-width:100%;margin:0;border-bottom:1px solid var(--header-border-color);background-color:var(--header-bg-color);color:var(--header-fore-color);-webkit-user-select:none;-ms-user-select:none;user-select:none;border-collapse:collapse;border-spacing:0;table-layout:fixed}.ui-grid>.ui-grid-header tr{position:relative}.ui-grid>.ui-grid-header tr>th{padding:0;margin:0;word-wrap:break-word;white-space:normal;position:relative}.ui-grid>.ui-grid-header tr>th>div{line-height:var(--header-line-height);min-height:var(--row-height);display:flex;align-items:center;padding:var(--header-padding);box-sizing:border-box}.ui-grid>.ui-grid-header tr>th>div>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ui-grid>.ui-grid-header tr>th>.arrow{width:0;height:0;top:50%;margin-top:calc(0px - var(--arrow-size) / 2);right:calc(var(--arrow-size) / 2);position:absolute}.ui-grid>.ui-grid-header tr>th>.arrow.asc{border-bottom:var(--arrow-size) solid var(--dark-border-color)}.ui-grid>.ui-grid-header tr>th>.arrow.desc{border-top:var(--arrow-size) solid var(--dark-border-color)}.ui-grid>.ui-grid-header tr>th>.arrow.asc,.ui-grid>.ui-grid-header tr>th>.arrow.desc{border-left:var(--arrow-size) solid transparent;border-right:var(--arrow-size) solid transparent}.ui-grid>.ui-grid-header tr>th>.filter{width:var(--filter-size);height:var(--filter-size);top:50%;margin-top:calc(0px - var(--filter-size) / 2);right:calc(var(--arrow-size) * 2 + 4px);position:absolute;display:flex}.ui-grid>.ui-grid-header tr>th>.filter>svg{width:100%;height:100%;fill:var(--color);opacity:.2;transition:opacity .12s ease}.ui-grid>.ui-grid-header tr>th>.filter>svg:hover{opacity:.8}.ui-grid>.ui-grid-header tr>th>.filter.hover>svg{opacity:.8}.ui-grid>.ui-grid-header tr>th>.filter.active>svg{opacity:1}.ui-grid>.ui-grid-header tr>th>.spliter{position:absolute;height:100%;top:0;right:calc(0px - var(--split-width) / 2);width:var(--split-width);cursor:ew-resize;z-index:1}.ui-grid>.ui-grid-header tr>th>.spliter:after{content:"";height:100%;width:1px;display:block;margin:0 auto;transition:background-color .12s ease}.ui-grid>.ui-grid-header tr>th>.spliter:hover:after{background-color:var(--split-border-color)}.ui-grid>.ui-grid-header tr>th>.dragger{position:absolute;left:0;top:0;min-width:var(--dragger-size);height:100%;background-color:var(--dragger-bg-color);opacity:var(--dragger-opacity);display:none}.ui-grid>.ui-grid-header tr>th>.dragger-cursor{position:absolute;top:0;height:100%;border:1px solid var(--dragger-cursor-color);box-sizing:border-box;margin-left:0;opacity:var(--dragger-cursor-opacity);display:none;transition:left .12s ease}.ui-grid>.ui-grid-header tr>th>.dragger-cursor:before{top:-1px;border-top:var(--dragger-cursor-size) solid}.ui-grid>.ui-grid-header tr>th>.dragger-cursor:after{bottom:-1px;border-bottom:var(--dragger-cursor-size) solid}.ui-grid>.ui-grid-header tr>th>.dragger-cursor:before,.ui-grid>.ui-grid-header tr>th>.dragger-cursor:after{content:"";position:absolute;left:var(--dragger-cursor-pos);border-left:var(--dragger-cursor-size) solid transparent;border-right:var(--dragger-cursor-size) solid transparent}.ui-grid>.ui-grid-header tr>th.header-filter>div{padding:var(--header-filter-padding)}.ui-grid>.ui-grid-body{flex:1 1 auto;overflow:auto;color:var(--cell-fore-color)}.ui-grid>.ui-grid-body::-webkit-scrollbar{width:8px;height:8px}.ui-grid>.ui-grid-body::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-grid>.ui-grid-body .ui-grid-body-content{position:absolute;min-width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row{line-height:var(--line-height);white-space:nowrap;background-color:var(--row-bg-color);border-bottom:1px solid var(--cell-border-color);box-sizing:border-box}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row:hover{background-color:var(--row-active-bg-color)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row.selected{background-color:var(--row-selected-bg-color)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td{padding:0}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>span{padding:var(--spacing-cell);display:block;overflow:hidden;text-overflow:ellipsis;white-space:pre}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text],.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea{border:none;box-sizing:border-box;width:100%;padding:0}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]:focus,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]:focus-visible,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea:focus,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea:focus-visible{outline:none}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]:disabled,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea:disabled{color:var(--text-disabled-color)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]{height:var(--row-height);text-indent:var(--text-indent)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea{resize:none;line-height:var(--line-height);display:block;padding:var(--spacing-cell);white-space:nowrap}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea::-webkit-scrollbar{width:8px;height:8px}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-check-wrapper{display:flex;justify-content:center}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-check-wrapper .ui-check-inner,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-check-wrapper .ui-check-inner>svg{transition:none}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper{height:var(--row-height);width:100%;display:flex;flex-direction:column}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-header{border:none;height:100%}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-header>.ui-drop-text{padding:var(--spacing-cell)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-box{top:calc(var(--row-height) + 2px)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-box.slide-up{top:auto;top:initial;bottom:calc(var(--row-height) + 2px)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon{display:flex;cursor:pointer;justify-content:center;align-items:center;position:relative}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon>svg{width:16px;height:16px;fill:var(--primary-color);transition:opacity .12s ease}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon:hover>svg{opacity:.4}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon.disabled{cursor:inherit}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon.disabled>svg{fill:var(--header-border-color);opacity:1;opacity:initial}.ui-grid>.ui-grid-body .ui-grid-hover-holder{box-sizing:border-box;position:absolute;line-height:var(--line-height);padding:var(--spacing-cell);background-color:var(--cell-hover-bg-color);white-space:pre;display:flex;align-items:center;visibility:hidden;opacity:0;transition:visibility 0s linear .12s,opacity .12s ease}.ui-grid>.ui-grid-body .ui-grid-hover-holder.active{visibility:visible;opacity:1}.ui-grid>.ui-grid-loading{position:absolute;top:0;right:0;bottom:0;left:0;visibility:hidden;opacity:0;transition:visibility 0s linear .12s,opacity .12s ease;background-color:var(--loading-bg-color);display:flex;justify-content:center;align-items:center;z-index:1}.ui-grid>.ui-grid-loading>div{background-color:var(--loading-fore-color);border-radius:var(--loading-border-radius)}.ui-grid>.ui-grid-loading>div>svg{width:var(--loading-size);height:var(--loading-size);padding:20px;-webkit-animation:loading-spinner 1.2s infinite linear;animation:loading-spinner 1.2s infinite linear}.ui-grid>.filter-panel{position:absolute;width:200px;height:300px;box-shadow:var(--filter-shadow);transition:var(--filter-transition);background-color:var(--bg-color);-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:top;transform-origin:top;opacity:0;display:flex;flex-direction:column}.ui-grid>.filter-panel.active{-webkit-transform:scaleY(1);transform:scaleY(1);opacity:1}.ui-grid>.filter-panel>.filter-search-holder{position:relative;margin:8px 8px 4px}.ui-grid>.filter-panel>.filter-search-holder>.filter-search-box{box-sizing:border-box;text-indent:16px;width:100%;font-size:var(--font-smaller-size);height:var(--line-height);line-height:var(--line-height)}.ui-grid>.filter-panel>.filter-search-holder>svg{position:absolute;width:12px;height:12px;top:calc(50% - 6px);left:4px;fill:var(--color);cursor:text}.ui-grid>.filter-panel>.filter-item-list{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ui-grid>.filter-panel>.filter-item-list::-webkit-scrollbar{width:8px;height:8px}.ui-grid>.filter-panel>.filter-item-list::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-grid>.filter-panel>.filter-item-list>.filter-content{position:absolute;width:100%}.ui-grid>.filter-panel>.filter-item-list .filter-item{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;padding:var(--filter-item-padding)}.ui-grid>.filter-panel>.filter-item-list .filter-item:hover{background-color:var(--hover-bg-color)}.ui-grid>.filter-panel>.filter-item-list .filter-item .ui-check-wrapper{height:var(--filter-line-height);display:flex}.ui-grid>.filter-panel>.filter-item-list .filter-item .ui-check-wrapper .ui-check-inner+*{font-size:var(--font-smaller-size)}.ui-grid>.filter-panel>.filter-function{display:flex;justify-content:flex-end;padding:4px}.ui-grid>.filter-panel>.filter-function>button{box-sizing:border-box;margin-right:10px;min-width:40px;height:var(--filter-line-height);border:none;background-color:transparent;cursor:pointer;border-radius:0;transition:background-color .12s ease}.ui-grid>.filter-panel>.filter-function>button:focus,.ui-grid>.filter-panel>.filter-function>button:focus-visible{outline:none}.ui-grid>.filter-panel>.filter-function>button:hover{background-color:var(--hover-bg-color)}.ui-popup-mask{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0003;display:flex;justify-content:center;align-items:center;opacity:0;z-index:200;transition:opacity .12s ease}.ui-popup-mask{--corner-radius: 6px;--loading-size: 20px;--loading-border-radius: 10px}.ui-popup-mask.ui-popup-active .ui-popup-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.ui-popup-mask.ui-popup-transparent{right:auto;right:initial;bottom:auto;bottom:initial}.ui-popup-mask .ui-popup-container{min-width:400px;max-width:800px;max-height:90vh;background-color:var(--bg-color);border-radius:var(--corner-radius);box-shadow:0 2px 8px var(--shadow-color);transition:opacity .12s ease,-webkit-transform .12s ease;transition:opacity .12s ease,transform .12s ease;transition:opacity .12s ease,transform .12s ease,-webkit-transform .12s ease;position:absolute;display:flex;flex-direction:column}.ui-popup-mask .ui-popup-container:focus,.ui-popup-mask .ui-popup-container:focus-visible{outline:none}.ui-popup-mask .ui-popup-container .ui-popup-header{flex:0 0 auto;padding:10px 12px 6px;border-radius:var(--corner-radius) var(--corner-radius) 0 0;line-height:24px;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--title-bg-color);color:var(--title-color);display:flex;align-items:center}.ui-popup-mask .ui-popup-container .ui-popup-header>div{flex:1 1 auto;font-size:1rem}.ui-popup-mask .ui-popup-container .ui-popup-header>.ui-popup-header-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-popup-mask .ui-popup-container .ui-popup-header>svg{flex:0 0 auto;width:24px;height:24px;fill:var(--title-color);padding:4px;cursor:pointer;box-sizing:border-box;transition:opacity .12s ease}.ui-popup-mask .ui-popup-container .ui-popup-header>svg:hover{opacity:.8}.ui-popup-mask .ui-popup-container .ui-popup-header>svg:focus,.ui-popup-mask .ui-popup-container .ui-popup-header>svg:focus-visible{outline:none;opacity:.8;background-color:#0000001a;border-radius:var(--corner-radius)}.ui-popup-mask .ui-popup-container .ui-popup-body{margin:6px 10px;flex:1 1 auto;line-height:24px;position:relative;min-height:100px}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading{position:absolute;top:0;right:0;bottom:-46px;left:0;visibility:hidden;opacity:0;transition:visibility 0s linear .12s,opacity .12s ease;background-color:var(--loading-bg-color);display:flex;justify-content:center;align-items:center;z-index:1}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading>div{background-color:var(--loading-fore-color);border-radius:var(--loading-border-radius)}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading>div>svg{width:var(--loading-size);height:var(--loading-size);padding:20px;-webkit-animation:loading-spinner 1.2s infinite linear;animation:loading-spinner 1.2s infinite linear}.ui-popup-mask .ui-popup-container .ui-popup-body>.message-wrapper{display:flex;margin:10px}.ui-popup-mask .ui-popup-container .ui-popup-body>.message-wrapper>svg{width:40px;height:40px}.ui-popup-mask .ui-popup-container .ui-popup-body>.message-wrapper>svg+span{padding-left:16px}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper{--line-height: 28px}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item{display:flex;align-items:center;line-height:var(--line-height);margin:4px 0}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label{flex:0 0 auto;width:120px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:10px}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label.setting-required:after{content:"*";color:var(--red-color);font-weight:700}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label+*{flex:1 1 auto;margin-right:10px;box-sizing:border-box;height:var(--line-height);line-height:var(--line-height)}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label+textarea{text-indent:var(--text-indent)}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label+.ui-check-wrapper{padding:0}.ui-popup-mask .ui-popup-container .ui-popup-footer{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;padding:4px 10px 16px 2px}.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button{margin-left:12px;border:none;line-height:28px;color:var(--title-color);border-radius:var(--corner-radius);padding:4px 16px;box-sizing:border-box;min-width:70px;text-align:center;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--title-bg-color);transition:opacity .12s ease}.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:focus,.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:hover{opacity:.8}.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:focus,.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:focus-visible{outline:none}.ui-popup-mask .ui-popup-container .ui-popup-border{position:absolute}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-right{width:6px;height:100%;top:0;cursor:ew-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom{width:100%;height:6px;left:0;cursor:ns-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{width:8px;height:8px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right{cursor:nwse-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{cursor:nesw-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{left:-4px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right{right:-4px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right{top:-4px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{bottom:-4px}.ui-popup-mask .ui-popup-container.ui-popup-collapse{min-height:40px;min-width:160px}.ui-popup-mask .ui-popup-container.ui-popup-collapse .ui-popup-body,.ui-popup-mask .ui-popup-container.ui-popup-collapse .ui-popup-footer,.ui-popup-mask .ui-popup-container.ui-popup-collapse .ui-popup-border{display:none} +@-webkit-keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}:root{--color: #201f1e;--bg-color: #fff;--border-color: #b9b9b9;--focus-border-color: #666;--shadow-color: rgba(0, 0, 0,.11);--disabled-color: #aaa;--disabled-bg-color: #e9e9e9;--disabled-border-color: #d9d9d9;--red-color: red;--title-color: #fff;--title-bg-color: rgb(68, 114, 196);--hover-bg-color: #eee;--link-color: #1890ff;--primary-color: rgb(123, 28, 33);--loading-bg-color: hsla(0, 0%, 100%, .4);--loading-fore-color: rgba(0, 0, 0, .2);--border-radius: 2px;--text-indent: 4px;--line-height: 24px;--font-size: .8125rem;--font-smaller-size: .75rem;--font-larger-size: .875rem;--font-family: "Franklin Gothic Book", "San Francisco", "Segoe UI", "Open Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei UI", sans-serif}.ui-text,.ui-input[type]{font-size:var(--font-size);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-text:focus,.ui-text:focus-visible,.ui-input[type]:focus,.ui-input[type]:focus-visible{outline:none}.ui-text:focus,.ui-text:hover,.ui-input[type]:focus,.ui-input[type]:hover{border-color:var(--focus-border-color)}.ui-text:disabled,.ui-input[type]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-input{text-indent:var(--text-indent);line-height:var(--line-height)}.ui-check-image-wrapper>input[type=checkbox]{display:none}.ui-check-image-wrapper>input[type=checkbox]:checked~.checked{display:inline}.ui-check-image-wrapper>input[type=checkbox]:checked~.unchecked{display:none}.ui-check-image-wrapper>.checked{display:none}.ui-check-image-wrapper>.unchecked{display:inline}.ui-check-wrapper{display:inline-flex;align-items:center;padding:0 8px;height:36px}.ui-check-wrapper .ui-check-inner{position:relative;display:inline-block;padding:0;width:14px;height:14px;background-color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:focus-visible{outline:none}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:hover{border-color:var(--focus-border-color)}.ui-check-wrapper .ui-check-inner:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-check-wrapper .ui-check-inner>svg{position:absolute;top:0;left:0;width:100%;height:100%;fill:#fff;-webkit-transform:scale(0);transform:scale(0);opacity:0;transition:all .08s cubic-bezier(.78,.14,.15,.86)}.ui-check-wrapper.ui-radio-wrapper .ui-check-inner{box-sizing:border-box;border-radius:8px;width:16px;height:16px}.ui-check-wrapper>input[type=checkbox],.ui-check-wrapper>input[type=radio]{display:none}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner{border-color:var(--link-color);background-color:var(--link-color)}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner>svg,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner>svg{-webkit-transform:scale(1);transform:scale(1);opacity:1}.ui-check-wrapper>input[type=checkbox]:disabled:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled:checked+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-border-color)}.ui-check-wrapper>input[type=checkbox]:disabled+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);cursor:default}.ui-check-wrapper>input[type=checkbox]:disabled~span,.ui-check-wrapper>input[type=radio]:disabled~span{color:var(--disabled-border-color);cursor:default}.ui-check-wrapper .ui-check-inner{flex:0 0 auto}.ui-check-wrapper .ui-check-inner+*{flex:1 1 auto;font-weight:400;font-size:var(--font-size);padding-left:8px;padding-right:6px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:var(--color)}.ui-tooltip-color{background-color:#fff;color:#323130;border-color:#cccc}.ui-tooltip-color:focus,.ui-tooltip-color:focus-visible{outline:none}.ui-tooltip-wrapper{position:absolute;word-wrap:break-word;height:auto;text-align:left;z-index:250;min-width:45px;max-width:480px;min-height:32px;border-radius:2px;box-shadow:0 3.2px 7.2px #00000021,0 .6px 1.8px #0000001c;transition:visibility 0s linear .12s,opacity .12s ease}.ui-tooltip-wrapper>.ui-tooltip-pointer{box-sizing:border-box;box-shadow:0 5px 15px 2px #0000004d;border:1px solid #fff;z-index:-1;width:16px;height:16px;position:absolute;left:calc(50% - 8px);bottom:-8px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:center;transform-origin:center}.ui-tooltip-wrapper>.ui-tooltip-curtain{position:absolute;width:100%;height:100%;z-index:-1}.ui-tooltip-wrapper>.ui-tooltip-content{font-size:var(--font-smaller-size);line-height:1rem;white-space:normal;overflow:hidden;margin:8px;height:calc(100% - 16px);-webkit-user-select:none;-ms-user-select:none;user-select:none}.ui-drop-wrapper{display:inline-block;border:none;border-radius:0;border-radius:initial;-webkit-user-select:none;-ms-user-select:none;user-select:none;position:relative;font-size:var(--font-size);font-family:var(--font-family)}.ui-drop-wrapper>.ui-drop-header{background-color:var(--bg-color);display:flex;height:26px;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-drop-wrapper>.ui-drop-header:focus,.ui-drop-wrapper>.ui-drop-header:focus-visible{outline:none}.ui-drop-wrapper>.ui-drop-header:focus,.ui-drop-wrapper>.ui-drop-header:hover{border-color:var(--focus-border-color)}.ui-drop-wrapper>.ui-drop-header:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-drop-wrapper>.ui-drop-header>.ui-drop-text{flex:1 1 auto;cursor:pointer;font-size:var(--font-size);padding:0 6px;overflow:hidden;text-overflow:ellipsis;border:none;white-space:nowrap}.ui-drop-wrapper>.ui-drop-header>.ui-drop-text:focus,.ui-drop-wrapper>.ui-drop-header>.ui-drop-text:focus-visible{outline:none}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text{cursor:auto;cursor:initial}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text::-webkit-input-placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text:-ms-input-placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text::-ms-input-placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>input.ui-drop-text::placeholder{font-size:var(--font-smaller-size);font-style:italic}.ui-drop-wrapper>.ui-drop-header>.ui-drop-caret{flex:0 0 auto;width:26px;display:flex;justify-content:center;align-items:center;cursor:pointer}.ui-drop-wrapper>.ui-drop-header>.ui-drop-caret:after{display:block;content:"";border-top:4px solid;border-left:4px solid transparent;border-right:4px solid transparent;height:0;width:0}.ui-drop-wrapper>.ui-drop-header.disabled{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);color:var(--disabled-color)}.ui-drop-wrapper>.ui-drop-header.disabled:focus{border-color:var(--disabled-border-color)}.ui-drop-wrapper>.ui-drop-header.disabled>.ui-drop-text,.ui-drop-wrapper>.ui-drop-header.disabled>.ui-drop-caret{cursor:default}.ui-drop-wrapper>.ui-drop-box{position:absolute;visibility:hidden;opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:top;transform-origin:top;background-color:var(--bg-color);top:28px;z-index:2;transition:opacity .12s ease,visibility .12s ease,-webkit-transform .12s ease;transition:transform .12s ease,opacity .12s ease,visibility .12s ease;transition:transform .12s ease,opacity .12s ease,visibility .12s ease,-webkit-transform .12s ease;width:calc(100% + 2px);box-sizing:border-box;box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;left:-1px}.ui-drop-wrapper>.ui-drop-box.slide-up{-webkit-transform-origin:bottom;transform-origin:bottom;top:auto;top:initial;bottom:28px}.ui-drop-wrapper>.ui-drop-box.active{visibility:visible;opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search{box-sizing:border-box;height:36px;line-height:36px;padding:0 8px;position:relative;display:flex;align-items:center}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]{box-sizing:border-box;width:100%;height:26px;padding:0 6px 0 22px;color:var(--color);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:focus,.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:focus-visible{outline:none}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:focus,.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:hover{border-color:var(--focus-border-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]::-webkit-input-placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]:-ms-input-placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]::-ms-input-placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>input[type=text]::placeholder{font-style:italic}.ui-drop-wrapper>.ui-drop-box>.ui-drop-search>svg{position:absolute;left:14px;width:13px;height:100%;cursor:text}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list{margin:0;padding:0;list-style:none;max-height:210px;overflow-y:auto;font-size:var(--font-size)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list::-webkit-scrollbar{width:8px;height:8px}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list.filtered>li:first-child{background-color:var(--hover-bg-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li{line-height:30px;height:30px;padding:0 10px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li:hover,.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li.selected{background-color:var(--hover-bg-color)}.ui-drop-wrapper>.ui-drop-box>.ui-drop-list>li>.ui-check-wrapper{height:30px;display:flex}.ui-grid{position:relative;box-sizing:border-box;display:flex;flex-direction:column;overflow:visible;overflow-x:hidden}.ui-grid{--cell-hover-bg-color: lightyellow;--header-border-color: #adaba9;--header-bg-color: #fafafa;--header-fore-color: #000;--cell-border-color: #f0f0f0;--cell-fore-color: #333;--dark-border-color: #666;--split-border-color: #b3b3b3;--dragger-bg-color: #fff;--dragger-cursor-color: #333;--row-bg-color: #fff;--row-active-bg-color: #fafafa;--row-selected-bg-color: #e6f2fb;--text-disabled-color: gray;--filter-shadow: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05);--filter-transition: transform .12s ease, opacity .24s ease;--row-height: 36px;--header-line-height: 26px;--text-indent: 8px;--loading-size: 40px;--loading-border-radius: 20px;--arrow-size: 4px;--filter-size: 10px;--split-width: 8px;--dragger-size: 20px;--dragger-opacity: .6;--dragger-cursor-size: 4px;--dragger-cursor-pos: -4px;--dragger-cursor-opacity: .3;--header-padding: 4px 12px 4px 8px;--header-filter-padding: 4px 26px 4px 8px;--spacing-s: 4px;--spacing-cell: 6px 4px 6px 8px;--filter-line-height: 30px;--filter-item-padding: 0 4px}.ui-grid:focus,.ui-grid:focus-visible{outline:none}.ui-grid,.ui-grid input[type=text],.ui-grid textarea{font-size:var(--font-size);font-family:var(--font-family)}.ui-grid>.ui-grid-sizer{position:absolute;white-space:nowrap;font-weight:700;visibility:hidden}.ui-grid>.ui-grid-header{width:100%;min-width:100%;margin:0;border-bottom:1px solid var(--header-border-color);background-color:var(--header-bg-color);color:var(--header-fore-color);-webkit-user-select:none;-ms-user-select:none;user-select:none;border-collapse:collapse;border-spacing:0;table-layout:fixed}.ui-grid>.ui-grid-header tr{position:relative}.ui-grid>.ui-grid-header tr>th{padding:0;margin:0;word-wrap:break-word;white-space:normal;position:relative}.ui-grid>.ui-grid-header tr>th>div{line-height:var(--header-line-height);min-height:var(--row-height);display:flex;align-items:center;padding:var(--header-padding);box-sizing:border-box}.ui-grid>.ui-grid-header tr>th>div>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ui-grid>.ui-grid-header tr>th>.arrow{width:0;height:0;top:50%;margin-top:calc(0px - var(--arrow-size) / 2);right:calc(var(--arrow-size) / 2);position:absolute}.ui-grid>.ui-grid-header tr>th>.arrow.asc{border-bottom:var(--arrow-size) solid var(--dark-border-color)}.ui-grid>.ui-grid-header tr>th>.arrow.desc{border-top:var(--arrow-size) solid var(--dark-border-color)}.ui-grid>.ui-grid-header tr>th>.arrow.asc,.ui-grid>.ui-grid-header tr>th>.arrow.desc{border-left:var(--arrow-size) solid transparent;border-right:var(--arrow-size) solid transparent}.ui-grid>.ui-grid-header tr>th>.filter{width:var(--filter-size);height:var(--filter-size);top:50%;margin-top:calc(0px - var(--filter-size) / 2);right:calc(var(--arrow-size) * 2 + 4px);position:absolute;display:flex}.ui-grid>.ui-grid-header tr>th>.filter>svg{width:100%;height:100%;fill:var(--color);opacity:.2;transition:opacity .12s ease}.ui-grid>.ui-grid-header tr>th>.filter>svg:hover{opacity:.8}.ui-grid>.ui-grid-header tr>th>.filter.hover>svg{opacity:.8}.ui-grid>.ui-grid-header tr>th>.filter.active>svg{opacity:1}.ui-grid>.ui-grid-header tr>th>.spliter{position:absolute;height:100%;top:0;right:calc(0px - var(--split-width) / 2);width:var(--split-width);cursor:ew-resize;z-index:1}.ui-grid>.ui-grid-header tr>th>.spliter:after{content:"";height:100%;width:1px;display:block;margin:0 auto;transition:background-color .12s ease}.ui-grid>.ui-grid-header tr>th>.spliter:hover:after{background-color:var(--split-border-color)}.ui-grid>.ui-grid-header tr>th>.dragger{position:absolute;left:0;top:0;min-width:var(--dragger-size);height:100%;background-color:var(--dragger-bg-color);opacity:var(--dragger-opacity);display:none}.ui-grid>.ui-grid-header tr>th>.dragger-cursor{position:absolute;top:0;height:100%;border:1px solid var(--dragger-cursor-color);box-sizing:border-box;margin-left:0;opacity:var(--dragger-cursor-opacity);display:none;transition:left .12s ease}.ui-grid>.ui-grid-header tr>th>.dragger-cursor:before{top:-1px;border-top:var(--dragger-cursor-size) solid}.ui-grid>.ui-grid-header tr>th>.dragger-cursor:after{bottom:-1px;border-bottom:var(--dragger-cursor-size) solid}.ui-grid>.ui-grid-header tr>th>.dragger-cursor:before,.ui-grid>.ui-grid-header tr>th>.dragger-cursor:after{content:"";position:absolute;left:var(--dragger-cursor-pos);border-left:var(--dragger-cursor-size) solid transparent;border-right:var(--dragger-cursor-size) solid transparent}.ui-grid>.ui-grid-header tr>th.header-filter>div{padding:var(--header-filter-padding)}.ui-grid>.ui-grid-body{flex:1 1 auto;overflow:auto;color:var(--cell-fore-color)}.ui-grid>.ui-grid-body::-webkit-scrollbar{width:8px;height:8px}.ui-grid>.ui-grid-body::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-grid>.ui-grid-body .ui-grid-body-content{position:absolute;min-width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row{line-height:var(--line-height);white-space:nowrap;background-color:var(--row-bg-color);border-bottom:1px solid var(--cell-border-color);box-sizing:border-box}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row:hover{background-color:var(--row-active-bg-color)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row.selected{background-color:var(--row-selected-bg-color)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td{padding:0}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>span{padding:var(--spacing-cell);display:block;overflow:hidden;text-overflow:ellipsis;white-space:pre}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text],.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea{border:none;box-sizing:border-box;width:100%;padding:0}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]:focus,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]:focus-visible,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea:focus,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea:focus-visible{outline:none}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]:disabled,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea:disabled{color:var(--text-disabled-color)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>input[type=text]{height:var(--row-height);text-indent:var(--text-indent)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea{resize:none;line-height:var(--line-height);display:block;padding:var(--spacing-cell);white-space:nowrap}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea::-webkit-scrollbar{width:8px;height:8px}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td>textarea::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-check-wrapper{display:flex;justify-content:center}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-check-wrapper .ui-check-inner,.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-check-wrapper .ui-check-inner>svg{transition:none}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper{height:var(--row-height);width:100%;display:flex;flex-direction:column}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-header{border:none;height:100%}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-header>.ui-drop-text{padding:var(--spacing-cell)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-box{top:calc(var(--row-height) + 2px)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .ui-drop-wrapper>.ui-drop-box.slide-up{top:auto;top:initial;bottom:calc(var(--row-height) + 2px)}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon{display:flex;cursor:pointer;justify-content:center;align-items:center;position:relative}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon>svg{width:16px;height:16px;fill:var(--primary-color);transition:opacity .12s ease}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon:hover>svg{opacity:.4}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon.disabled{cursor:inherit}.ui-grid>.ui-grid-body .ui-grid-body-content>.ui-grid-row>td .col-icon.disabled>svg{fill:var(--header-border-color);opacity:1;opacity:initial}.ui-grid>.ui-grid-body .ui-grid-hover-holder{box-sizing:border-box;position:absolute;line-height:var(--line-height);padding:var(--spacing-cell);background-color:var(--cell-hover-bg-color);white-space:pre;display:flex;align-items:center;visibility:hidden;opacity:0;transition:visibility 0s linear .12s,opacity .12s ease}.ui-grid>.ui-grid-body .ui-grid-hover-holder.active{visibility:visible;opacity:1}.ui-grid>.ui-grid-loading{position:absolute;top:0;right:0;bottom:0;left:0;visibility:hidden;opacity:0;transition:visibility 0s linear .12s,opacity .12s ease;background-color:var(--loading-bg-color);display:flex;justify-content:center;align-items:center;z-index:1}.ui-grid>.ui-grid-loading>div{background-color:var(--loading-fore-color);border-radius:var(--loading-border-radius)}.ui-grid>.ui-grid-loading>div>svg{width:var(--loading-size);height:var(--loading-size);padding:20px;-webkit-animation:loading-spinner 1.2s infinite linear;animation:loading-spinner 1.2s infinite linear}.ui-grid>.filter-panel{position:absolute;width:200px;height:300px;box-shadow:var(--filter-shadow);transition:var(--filter-transition);background-color:var(--bg-color);-webkit-transform:scaleY(0);transform:scaleY(0);-webkit-transform-origin:top;transform-origin:top;opacity:0;display:flex;flex-direction:column}.ui-grid>.filter-panel.active{-webkit-transform:scaleY(1);transform:scaleY(1);opacity:1}.ui-grid>.filter-panel>.filter-search-holder{position:relative;margin:8px 8px 4px}.ui-grid>.filter-panel>.filter-search-holder>.filter-search-box{box-sizing:border-box;text-indent:16px;width:100%;font-size:var(--font-smaller-size);height:var(--line-height);line-height:var(--line-height)}.ui-grid>.filter-panel>.filter-search-holder>svg{position:absolute;width:12px;height:12px;top:calc(50% - 6px);left:4px;fill:var(--color);cursor:text}.ui-grid>.filter-panel>.filter-item-list{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ui-grid>.filter-panel>.filter-item-list::-webkit-scrollbar{width:8px;height:8px}.ui-grid>.filter-panel>.filter-item-list::-webkit-scrollbar-thumb{background-color:#a8a8a8e6;border-radius:4px}.ui-grid>.filter-panel>.filter-item-list>.filter-content{position:absolute;width:100%}.ui-grid>.filter-panel>.filter-item-list .filter-item{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;padding:var(--filter-item-padding)}.ui-grid>.filter-panel>.filter-item-list .filter-item:hover{background-color:var(--hover-bg-color)}.ui-grid>.filter-panel>.filter-item-list .filter-item .ui-check-wrapper{height:var(--filter-line-height);display:flex}.ui-grid>.filter-panel>.filter-item-list .filter-item .ui-check-wrapper .ui-check-inner+*{font-size:var(--font-smaller-size)}.ui-grid>.filter-panel>.filter-function{display:flex;justify-content:flex-end;padding:4px}.ui-grid>.filter-panel>.filter-function>button{box-sizing:border-box;margin-right:10px;min-width:40px;height:var(--filter-line-height);border:none;background-color:transparent;cursor:pointer;border-radius:0;transition:background-color .12s ease}.ui-grid>.filter-panel>.filter-function>button:focus,.ui-grid>.filter-panel>.filter-function>button:focus-visible{outline:none}.ui-grid>.filter-panel>.filter-function>button:hover{background-color:var(--hover-bg-color)}.ui-popup-mask{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0003;display:flex;justify-content:center;align-items:center;opacity:0;z-index:200;transition:opacity .12s ease}.ui-popup-mask{--corner-radius: 6px;--loading-size: 20px;--loading-border-radius: 10px}.ui-popup-mask.ui-popup-active .ui-popup-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.ui-popup-mask.ui-popup-transparent{right:auto;right:initial;bottom:auto;bottom:initial}.ui-popup-mask .ui-popup-container{min-width:400px;max-width:800px;max-height:90vh;background-color:var(--bg-color);border-radius:var(--corner-radius);box-shadow:0 2px 8px var(--shadow-color);transition:opacity .12s ease,-webkit-transform .12s ease;transition:opacity .12s ease,transform .12s ease;transition:opacity .12s ease,transform .12s ease,-webkit-transform .12s ease;position:absolute;display:flex;flex-direction:column}.ui-popup-mask .ui-popup-container:focus,.ui-popup-mask .ui-popup-container:focus-visible{outline:none}.ui-popup-mask .ui-popup-container .ui-popup-header{flex:0 0 auto;padding:10px 12px 6px;border-radius:var(--corner-radius) var(--corner-radius) 0 0;line-height:24px;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--title-bg-color);color:var(--title-color);display:flex;align-items:center}.ui-popup-mask .ui-popup-container .ui-popup-header>div{flex:1 1 auto;font-size:1rem}.ui-popup-mask .ui-popup-container .ui-popup-header>.ui-popup-header-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-popup-mask .ui-popup-container .ui-popup-header>svg{flex:0 0 auto;width:24px;height:24px;fill:var(--title-color);padding:4px;cursor:pointer;box-sizing:border-box;transition:opacity .12s ease}.ui-popup-mask .ui-popup-container .ui-popup-header>svg:hover{opacity:.8}.ui-popup-mask .ui-popup-container .ui-popup-header>svg:focus,.ui-popup-mask .ui-popup-container .ui-popup-header>svg:focus-visible{outline:none;opacity:.8;background-color:#0000001a;border-radius:var(--corner-radius)}.ui-popup-mask .ui-popup-container .ui-popup-body{margin:6px 10px;flex:1 1 auto;line-height:24px;position:relative;min-height:100px}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading{position:absolute;top:0;right:0;bottom:-46px;left:0;visibility:hidden;opacity:0;transition:visibility 0s linear .12s,opacity .12s ease;background-color:var(--loading-bg-color);display:flex;justify-content:center;align-items:center;z-index:1}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading>div{background-color:var(--loading-fore-color);border-radius:var(--loading-border-radius)}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading>div>svg{width:var(--loading-size);height:var(--loading-size);padding:20px;-webkit-animation:loading-spinner 1.2s infinite linear;animation:loading-spinner 1.2s infinite linear}.ui-popup-mask .ui-popup-container .ui-popup-body>.ui-popup-loading.ui-popup-loading-content{bottom:0}.ui-popup-mask .ui-popup-container .ui-popup-body>.message-wrapper{display:flex;margin:10px}.ui-popup-mask .ui-popup-container .ui-popup-body>.message-wrapper>svg{width:40px;height:40px}.ui-popup-mask .ui-popup-container .ui-popup-body>.message-wrapper>svg+span{padding-left:16px}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper{--line-height: 28px}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item{display:flex;align-items:center;line-height:var(--line-height);margin:4px 0}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label{flex:0 0 auto;width:120px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:10px}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label.setting-required:after{content:"*";color:var(--red-color);font-weight:700}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label+*{flex:1 1 auto;margin-right:10px;box-sizing:border-box;height:var(--line-height);line-height:var(--line-height)}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label+textarea{text-indent:var(--text-indent)}.ui-popup-mask .ui-popup-container .ui-popup-body .setting-wrapper>.setting-item>.setting-label+.ui-check-wrapper{padding:0}.ui-popup-mask .ui-popup-container .ui-popup-footer{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;padding:4px 10px 16px 2px}.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button{margin-left:12px;border:none;line-height:28px;color:var(--title-color);border-radius:var(--corner-radius);padding:4px 16px;box-sizing:border-box;min-width:70px;text-align:center;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--title-bg-color);transition:opacity .12s ease}.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:focus,.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:hover{opacity:.8}.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:focus,.ui-popup-mask .ui-popup-container .ui-popup-footer .ui-popup-button:focus-visible{outline:none}.ui-popup-mask .ui-popup-container .ui-popup-border{position:absolute}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-right{width:6px;height:100%;top:0;cursor:ew-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom{width:100%;height:6px;left:0;cursor:ns-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{width:8px;height:8px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right{cursor:nwse-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{cursor:nesw-resize}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{left:-4px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right{right:-4px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-left,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-top-right{top:-4px}.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-right,.ui-popup-mask .ui-popup-container .ui-popup-border.ui-popup-border-bottom-left{bottom:-4px}.ui-popup-mask .ui-popup-container.ui-popup-collapse{min-height:40px;min-width:160px}.ui-popup-mask .ui-popup-container.ui-popup-collapse .ui-popup-body,.ui-popup-mask .ui-popup-container.ui-popup-collapse .ui-popup-footer,.ui-popup-mask .ui-popup-container.ui-popup-collapse .ui-popup-border{display:none} diff --git a/Site/js/lib/ui.min.js b/Site/js/lib/ui.min.js index 4ac2f93..8a24a86 100644 --- a/Site/js/lib/ui.min.js +++ b/Site/js/lib/ui.min.js @@ -1,3 +1,3 @@ -(function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w["lib-ui"]={}))})(this,function(w){var A,F,O,P,Y,me,He,re,oe,ae,Ke,be,vt,ve,xt,Oe,_t,$e,qt,Pe,Rt,ze,Ht,j,$,xe,W,v,we,ke,M,K,ce,de,ee,U,Ce,ue,Le,I,At,Ee,wt,lt,Zt,rt,ei,ot,ti,at,ii,he,Ue,ct,si,dt,ni,Ve,Ot,z,X,te,Se,fe,Ge,We,$t,Me,Pt,De,zt,pe,Je,ut,li,Fe,Vt,je,Wt,ht,ri,ft,oi,pt,ai,yt,ci,gt,di,mt,ui,bt,hi,Be,Mt,Xe,Dt,Te,kt,G,H,J,B,Q;"use strict";var _i=Object.defineProperty;var qi=Object.getPrototypeOf;var Ri=Reflect.get;var Hi=(w,L,N)=>L in w?_i(w,L,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[L]=N;var C=(w,L,N)=>(Hi(w,typeof L!="symbol"?L+"":L,N),N),It=(w,L,N)=>{if(!L.has(w))throw TypeError("Cannot "+N)};var a=(w,L,N)=>(It(w,L,"read from private field"),N?N.call(w):L.get(w)),g=(w,L,N)=>{if(L.has(w))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(w):L.set(w,N)},x=(w,L,N,f)=>(It(w,L,"write to private field"),f?f.call(w,N):L.set(w,N),N);var y=(w,L,N)=>(It(w,L,"access private method"),N),Qt=(w,L,N)=>Ri(qi(w),N,L);const L="",N="";function f(c,e,...t){const s=document.createElement(c);return typeof e=="function"?e(s):e!=null&&(s.className=e),t.length>0&&s.append(...t),s}const Ft="http://www.w3.org/2000/svg";function Ct(c,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,r=document.createElementNS(Ft,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${c}.svg${n}#${e}`),r}function Ne(c,e,t){return c instanceof SVGElement&&c.replaceChildren(Ct(e,t)),c}function V(c,e,t){const s=document.createElementNS(Ft,"svg");if(s.appendChild(Ct(c,e)),t!=null)for(let n of Object.entries(t))s.style.setProperty(n[0],n[1]);return s}function fi(c){const e=c.querySelectorAll("svg[data-id]");for(let t of e){const s=t.dataset.type,n=t.dataset.id;t.replaceChildren(Ct(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return c}const Oi="";function Qe(c,e="fa-regular",t,s=-1,n="check"){c.appendChild(f("layer",r=>{r.className="ui-check-inner",r.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const l=c.querySelector("input");l!=null&&(l.checked=!l.checked,l.dispatchEvent(new Event("change")))}}),s>=0&&(r.tabIndex=s)},V(e,n))),t instanceof Element?c.appendChild(t):(t==null?void 0:t.length)>0&&c.appendChild(f("span",r=>r.innerText=t))}function pi(c={}){const e=f("label","ui-check-wrapper ui-radio-wrapper",f("input",t=>{if(t.setAttribute("type","radio"),t.name=c.name,c.checked===!0&&(t.checked=!0),c.enabled===!1&&(t.disabled=!0),c.customerAttributes!=null)for(let s of Object.entries(c.customerAttributes))t.setAttribute(s[0],s[1]);typeof c.onchange=="function"&&t.addEventListener("change",c.onchange)}));return c.className&&e.classList.add(c.className),Qe(e,c.type,c.label,c.tabIndex,"circle"),e}function ie(c={}){const e=f("label","ui-check-wrapper",f("input",t=>{if(t.setAttribute("type","checkbox"),c.checked===!0&&(t.checked=!0),c.enabled===!1&&(t.disabled=!0),c.customerAttributes!=null)for(let s of Object.entries(c.customerAttributes))t.setAttribute(s[0],s[1]);typeof c.onchange=="function"&&t.addEventListener("change",c.onchange)}));return c.className&&e.classList.add(c.className),c.enabled===!1&&e.classList.add("disabled"),c.checkedNode!=null&&c.uncheckedNode!=null?(e.classList.add("ui-check-image-wrapper"),c.imageHeight,c.checkedNode.classList.add("checked"),e.appendChild(c.checkedNode),c.uncheckedNode.classList.add("unchecked"),e.appendChild(c.uncheckedNode)):Qe(e,c.type,c.label,c.tabIndex),e}function yi(c=document.body,e){if(e){const s=c.querySelectorAll('input[type="checkbox"]');for(let n of s){if(n.parentElement.classList.contains("ui-check-wrapper"))continue;const r=n.id;let i,l;if(r!=null&&(i=c.querySelector(`label[for="${r}"]`)),i==null){const o=n.nextElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:o.tagName==="SPAN"&&o.dataset.lgid!=null&&(l=o.innerText,o.style.display="none"))}if(i==null){const o=n.previousElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:l==null&&o.tagName==="SPAN"&&o.dataset.lgid!=null&&(l=o.innerText,o.style.display="none"))}i==null?(i=f("label"),n.parentElement.insertBefore(i,n)):l=i.innerText,n.disabled?i.className="ui-check-wrapper disabled":i.className="ui-check-wrapper",i.replaceChildren(),Qe(i,"fa-regular",l,n.tabIndex),i.insertBefore(n,i.firstChild)}}const t=c.querySelectorAll("label[data-checkbox]");for(let s of t){s.classList.contains("ui-check-wrapper")||s.classList.add("ui-check-wrapper"),s.hasChildNodes()?s.classList.contains("ui-check-image-wrapper")||s.classList.add("ui-check-image-wrapper"):(Qe(s,s.dataset.type,s.dataset.label,s.dataset.tabIndex),s.removeAttribute("data-type"),s.removeAttribute("data-label"));const n=f("input"),r=s.dataset.id;(r==null?void 0:r.length)>0&&(n.id=r),s.dataset.checked!=null&&(n.checked=!0),n.setAttribute("type","checkbox"),s.insertBefore(n,s.firstChild)}return c}const $i="";function Lt(c,e,t=!1,s=null){const n=s instanceof HTMLElement;if(n){const l=c.dataset.tipId,o=s.querySelector(`.ui-tooltip-wrapper[data-tip-id="${l}"]`);o==null||o.remove()}else{const l=c.querySelector(".ui-tooltip-wrapper");l==null||l.remove()}const r=f("div",l=>{l.className="ui-tooltip-wrapper ui-tooltip-color",l.style.visibility="hidden",l.style.opacity=0,l.style.top="0",l.style.left="0"},f("div","ui-tooltip-pointer ui-tooltip-color"),f("div","ui-tooltip-curtain ui-tooltip-color"),f("div",l=>{l.className="ui-tooltip-content",e instanceof Element?l.appendChild(e):l.innerText=e}));if(n){const l=String(Math.random()).substring(2);c.dataset.tipId=l,r.dataset.tipId=l,s.appendChild(r)}else c.appendChild(r);let i;return c.addEventListener("mouseenter",()=>{i&&clearTimeout(i);let l=c;for(;(l==null?void 0:l.offsetWidth)==null;)l=l.parentElement;l!=null&&(!t||l.scrollWidth>l.offsetWidth)&&(i=setTimeout(()=>{let o,d,u;if(d=l.offsetLeft,u=l.offsetTop,n)for(o=l.offsetParent;o!=null&&o!==s;)d+=o.offsetLeft,u+=o.offsetTop,o=o.offsetParent;o=l.parentElement;const p=l.offsetParent;for(;o!=null&&o!==(n?s:p);)d-=o.scrollLeft,u-=o.scrollTop,o=o.parentElement;d+=(l.offsetWidth-r.offsetWidth)/2,u-=r.offsetHeight+14,r.style.left=`${d}px`,r.style.top=`${u}px`,r.style.visibility="visible",r.style.opacity=1},100))}),c.addEventListener("mouseleave",()=>{i&&clearTimeout(i),i=setTimeout(()=>{r.style.visibility="hidden",r.style.opacity=0},300)}),c}function gi(c=document.body){const e=c.querySelectorAll("[title]");for(let t of e){const s=t.getAttribute("title");s!=null&&(t.removeAttribute("title"),Lt(t,s))}return c}const Pi="";function se(c){return c==null||typeof c!="string"||c.length===0}function mi(c,e,t){return se(c)||e==null?!1:(typeof e!="string"&&(e=String(e)),t?c.toLowerCase().indexOf(e.toLowerCase())>=0:c.indexOf(e)>=0)}function D(c,e){return e}let ne=typeof globalThis<"u"?globalThis:self;function Ae(c){return!isNaN(c)&&c>0}function bi(){return/mobile/i.test(navigator.userAgent)}function Ie(c,e=100,t=ne,...s){if(c==null)return;c.tiid&&clearTimeout(c.tiid);const n=new Date;c.tdate==null||n-c.tdate>e?(c.apply(t,s),c.tdate=n):c.tiid=setTimeout(()=>c.apply(t,s),e)}function vi(c){return(c>0?Math.floor:Math.ceil)(c)}const jt=Symbol.for("ui-dropdown"),xi=26,wi=30;let le=ne[jt];le==null&&(le={},Object.defineProperty(le,"clear",{writable:!1,configurable:!1,enumerable:!1,value:function(){const c=document.querySelector(".ui-drop-wrapper .ui-drop-box.active");if(c==null)return;c.classList.remove("active");const e=c.parentElement.dataset.dropId;if(e==null)return;const t=this[e];t!=null&&t.multiselect&&typeof t.oncollapsed=="function"&&t.oncollapsed()}}),ne[jt]=le,document.addEventListener("mousedown",c=>{let e=c.target;for(;e!=null;){if(e.classList.contains("ui-drop-box")){c.stopPropagation();return}e=e.parentElement}le.clear()}));function Bt(c,e,t,s){const n=e.map(r=>r[t]);if(n.some(r=>r instanceof HTMLElement))c.replaceChildren(...n.filter(r=>r!=null).map(r=>r.cloneNode(!0)));else{let r=e.map(i=>i[s]).join(", ");se(r)&&(r=D("noneItem","( None )")),c.innerText=r}}function Et(c,e,t,s){return(!Array.isArray(c)||c.length===0)&&(c=[e]),t.length>0&&(s=s.filter(n=>{for(let r of c)if(mi(n[r].toLowerCase(),t))return!0;return!1})),s}const St=class{constructor(e={}){g(this,ae);g(this,be);g(this,ve);g(this,Oe);g(this,A,void 0);g(this,F,void 0);g(this,O,void 0);g(this,P,void 0);g(this,Y,void 0);g(this,me,void 0);g(this,He,void 0);g(this,re,void 0);g(this,oe,void 0);C(this,"sourceFilter");C(this,"onselectedlist");C(this,"onselected");C(this,"onexpanded");e.searchplaceholder??(e.searchplaceholder=D("searchHolder","Search...")),e.textkey??(e.textkey="text"),e.valuekey??(e.valuekey="value"),e.htmlkey??(e.htmlkey="html"),e.maxlength??(e.maxlength=500),x(this,A,e)}create(){const e=a(this,A),t=f("div","ui-drop-wrapper"),s=String(Math.random()).substring(2);t.dataset.dropId=s,le[s]=this,x(this,F,t);const n=f("div","ui-drop-header");n.addEventListener("keypress",i=>{(i.key===" "||i.key==="Enter")&&n.dispatchEvent(new MouseEvent("click"))}),n.addEventListener("keydown",i=>{var d;const l=i.key==="ArrowUp",o=i.key==="ArrowDown";if(l||o){const u=this.source,p=u.length,b=a(this,A).valuekey;let h=u==null?void 0:u.indexOf(a(this,re));isNaN(h)||h<-1?h=-1:h>=p&&(h=p-1),l?h>0?h--:h=0:o&&(h<0?h=0:h<p?h++:h=p-1);const m=(d=u[h])==null?void 0:d[b];m!=null&&this.select(m)}else i.key==="Tab"&&y(this,be,vt).call(this,!1)}),n.addEventListener("click",()=>{if(this.disabled)return;const i=a(this,ae,Ke),l=a(this,P);i&&l.ownerDocument.activeElement===l||(y(this,be,vt).call(this,!i),!i&&typeof this.onexpanded=="function"&&setTimeout(()=>this.onexpanded(),120))});let r;return e.input?(r=f("input","ui-drop-text"),r.setAttribute("type","text"),e.placeholder&&r.setAttribute("placeholder",e.placeholder),Ae(e.maxlength)&&r.setAttribute("maxlength",e.maxlength),Ae(e.tabIndex)&&r.setAttribute("tabindex",e.tabIndex),r.addEventListener("input",i=>{const l=i.target.value.toLowerCase(),o=Et(e.searchkeys,e.textkey,l,this.source);y(this,ve,xt).call(this,o),a(this,O).classList.add("active")}),r.addEventListener("blur",i=>this.select(i.target.value)),r.addEventListener("mousedown",i=>a(this,ae,Ke)&&i.stopPropagation())):(Ae(e.tabIndex)&&n.setAttribute("tabindex",e.tabIndex),r=f("label","ui-drop-text")),x(this,P,r),e.multiselect?Array.isArray(e.selectedlist)?this.selectlist(e.selectedlist,!0):(x(this,Y,!0),r.innerText=D("allItem","( All )")):e.selected!=null&&this.select(e.selected,!0),n.append(r,f("label","ui-drop-caret")),t.appendChild(n),this.disabled=e.disabled||!1,t}get multiselect(){return a(this,A).multiselect}get disabled(){return a(this,F)==null||a(this,F).querySelector(".ui-drop-header.disabled")!=null}set disabled(e){a(this,F)!=null&&(e?a(this,F).querySelector(".ui-drop-header").classList.add("disabled"):a(this,F).querySelector(".ui-drop-header").classList.remove("disabled"))}get source(){let e=a(this,me);return(e==null||!Array.isArray(e))&&(typeof this.sourceFilter=="function"&&(e=this.sourceFilter()),Array.isArray(e)||(e=[]),x(this,me,e)),e}set source(e){Array.isArray(e)&&(x(this,me,e),a(this,ae,Ke)&&setTimeout(()=>y(this,be,vt).call(this),120))}get selected(){return a(this,re)}get selectedlist(){return a(this,oe)||[]}select(e,t){if(a(this,He)===e)return!1;x(this,He,e);const s=a(this,A).valuekey,n=a(this,A).textkey,r=a(this,A).htmlkey;let i=this.source.find(l=>l[s]===e);if(a(this,A).input)i==null&&(i={[s]:e}),a(this,P).value=e;else{const l=a(this,ae,Ke);if(l&&a(this,O).querySelectorAll("li[data-value].selected").forEach(d=>d.classList.remove("selected")),i==null)return x(this,re,null),a(this,P).innerText=" ",!1;const o=i[r];if(o instanceof HTMLElement)a(this,P).replaceChildren(o.cloneNode(!0));else{let d=i[n];se(d)&&(d=" "),a(this,P).innerText=d}if(l){const d=e.replace(/"/g,'\\"'),u=a(this,O).querySelector(`li[data-value="${d}"]`);u!=null&&u.classList.add("selected")}}x(this,re,i),!t&&typeof this.onselected=="function"&&this.onselected(i)}selectlist(e,t){const s=this.source,n=a(this,A).valuekey,r=a(this,A).textkey,i=a(this,A).htmlkey,l=e.map(o=>{let d=s.find(u=>u[n]===o);return d==null&&(d={[n]:o,[r]:o}),d});if(l.length===0)return x(this,oe,null),a(this,P).innerText=none,!1;Bt(a(this,P),l,i,r),x(this,oe,l),!t&&typeof this.onselectedlist=="function"&&this.onselectedlist(l)}static resolve(e=document.body){const t=e.querySelectorAll("select");for(let s of t){const n=[...s.children].map(i=>({value:i.value,text:i.innerText})),r=new St({selected:s.value,disabled:s.disabled,tabIndex:s.tabIndex});r.source=n,s.parentElement.replaceChild(r.create(),s)}return e}};let Ze=St;A=new WeakMap,F=new WeakMap,O=new WeakMap,P=new WeakMap,Y=new WeakMap,me=new WeakMap,He=new WeakMap,re=new WeakMap,oe=new WeakMap,ae=new WeakSet,Ke=function(){var e,t;return(t=(e=a(this,O))==null?void 0:e.classList)==null?void 0:t.contains("active")},be=new WeakSet,vt=function(e=!0){const t=a(this,A);let s=a(this,O);if(s==null){if(s=f("div","ui-drop-box"),!t.input&&t.search){const r=f("div","ui-drop-search"),i=f("input");i.setAttribute("type","text"),Ae(t.tabIndex)&&i.setAttribute("tabindex",t.tabIndex),!se(t.searchplaceholder)&&i.setAttribute("placeholder",t.searchplaceholder),i.addEventListener("input",l=>{const o=l.target.value.toLowerCase(),d=Et(t.searchkeys,t.textkey,o,this.source);y(this,ve,xt).call(this,d)}),r.append(i,V("fa-light","search")),s.appendChild(r)}const n=f("ul","ui-drop-list");this.multiselect||n.addEventListener("click",r=>{let i=r.target;for(;i.tagName!=="LI";)if(i=i.parentElement,i==null)return;const l=i.dataset.value;this.select(l)!==!1&&le.clear()}),s.appendChild(n),x(this,O,s),a(this,F).appendChild(s)}if(e){let n=this.source;if(!t.input&&t.search){const r=s.querySelector(".ui-drop-search > input");se(r==null?void 0:r.value)||(n=Et(t.searchkeys,t.textkey,r.value,n))}if(y(this,ve,xt).call(this,n),!t.slidefixed){let r=t.parent??document.body,i=a(this,F),l=i.offsetTop;for(;(i=i.parentElement)!=null&&i!==r;)l-=i.scrollTop;l-r.offsetTop+xi+s.offsetHeight>=r.offsetHeight?s.classList.add("slide-up"):s.classList.remove("slide-up")}s.classList.add("active")}else s.classList.remove("active")},ve=new WeakSet,xt=function(e){const t=a(this,O).querySelector(".ui-drop-list");t.replaceChildren();const s=this.multiselect,n=a(this,Y);s&&t.appendChild(f("li",null,ie({label:D("allItem","( All )"),checked:n,customerAttributes:{isall:"1"},onchange:p=>y(this,Oe,_t).call(this,p.target)})));const r=a(this,A).valuekey,i=a(this,A).textkey,l=a(this,A).htmlkey,o=this.selected,d=this.selectedlist;let u;e.slice(0,200).forEach((p,b)=>{const h=p[r],m=f("li");m.dataset.value=h,m.setAttribute("title",p[i]);let k;const T=p[l];if(T instanceof HTMLElement&&(k=T),s){const q=d.some(S=>S[r]===h);k==null&&(k=f("span"),k.innerText=p[i]);const _=ie({label:k,checked:n||q,customerAttributes:{class:"dataitem","data-value":h},onchange:S=>y(this,Oe,_t).call(this,S.target)});m.appendChild(_)}else k==null?m.innerText=p[i]:m.appendChild(k),o!=null&&o[r]===h&&(u=wi*b,m.classList.add("selected"));t.appendChild(m)}),u!=null&&setTimeout(()=>t.scrollTop=u,10)},Oe=new WeakSet,_t=function(e){let t;const s=a(this,A).valuekey,n=a(this,A).textkey,r=a(this,A).htmlkey;if(e.getAttribute("isall")==="1"){const i=x(this,Y,e.checked);a(this,O).querySelectorAll("input.dataitem").forEach(o=>o.checked=i),t=[]}else if(e.checked)if(a(this,O).querySelectorAll("input.dataitem:not(:checked)").length===0)x(this,Y,!0),a(this,O).querySelector('input[isall="1"]').checked=!0,t=[];else{const i=this.source;t=[...a(this,O).querySelectorAll("input.dataitem:checked")].map(l=>i.find(o=>o[s]===l.dataset.value)).filter(l=>l!=null)}else{const i=e.dataset.value;a(this,Y)?(x(this,Y,!1),a(this,O).querySelector('input[isall="1"]').checked=!1,t=this.source.filter(l=>l[s]!==i)):t=this.selectedlist.filter(l=>l[s]!==i)}a(this,Y)?a(this,P).innerText=D("allItem","( All )"):Bt(a(this,P),t,r,n),x(this,oe,t),typeof this.onselectedlist=="function"&&this.onselectedlist(itemlist)};const zi="";class Z{static create(){return f("span")}static setValue(e,t){e.innerText=t}static setStyle(e,t){for(let s of Object.entries(t))e.style.setProperty(s[0],s[1])}}class Xt extends Z{static get editing(){return!0}static createEdit(e,t,s,n){const r=f("input");return r.setAttribute("type","text"),typeof e=="function"&&r.addEventListener("change",e),r.addEventListener("input",()=>{n.__editing==null?n.__editing={[t.key]:!0}:n.__editing[t.key]=!0}),r}static setValue(e,t){e.tagName!=="INPUT"?super.setValue(e,t):e.value=t}static getValue(e){return e.target.value}static setEnabled(e,t){e.disabled=t===!1}}class ki extends Xt{static createEdit(e,t,s,n){const r=f("textarea");return typeof e=="function"&&r.addEventListener("change",e),r.addEventListener("input",()=>{n.__editing==null?n.__editing={[t.key]:!0}:n.__editing[t.key]=!0}),r}static setValue(e,t,s,n,r){if(e.tagName!=="TEXTAREA")super.setValue(e,t);else if(e.value=t,t!=null){const i=String(t).split(` -`).length;e.style.height=`${i*r.lineHeight+12}px`}}}const Ci=Symbol.for("ui-dropdown"),Nt=class extends Z{static createEdit(e,t,s){const n=new Ze({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=y(this,Pe,Rt).call(this,s,n);i instanceof Promise?i.then(l=>y(this,ze,Ht).call(this,l,e,t)):y(this,ze,Ht).call(this,i,e,t);return}const r=y(this,$e,qt).call(this,e);if(r!=null){if(r.source==null||r.source.length===0){let i=y(this,Pe,Rt).call(this,s,n);if(i instanceof Promise){i.then(l=>{r.source=l,r.select(t,!0)});return}else i!=null&&(r.source=i)}r.select(t,!0)}}static getValue(e){return e.value}static setEnabled(e,t){const s=y(this,$e,qt).call(this,e);s!=null&&(s.disabled=t===!1)}};let ge=Nt;$e=new WeakSet,qt=function(e){const t=ne[Ci];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},Pe=new WeakSet,Rt=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},ze=new WeakSet,Ht=function(e,t,s){const n=e==null?void 0:e.find(r=>r.value===s);n!=null&&(s=n.text),Qt(Nt,this,"setValue").call(this,t,s)},g(ge,$e),g(ge,Pe),g(ge,ze);class Tt extends Z{static createEdit(e){return ie({onchange:typeof e=="function"?e:null})}static setValue(e,t){e.querySelector("input").checked=t}static getValue(e){return e.target.checked}static setEnabled(e,t){e.querySelector("input").disabled=t===!1}}class Li extends Z{static create(){return f("span","col-icon")}static setValue(e,t,s,n,r){let i=n.className;typeof i=="function"&&(i=i.call(n,s)),i==null?e.className="col-icon":e.className=`col-icon ${i}`;let l=n.iconType;if(typeof l=="function"&&(l=l.call(n,s)),l??(l="fa-regular"),e.dataset.type!==l||e.dataset.icon!==t){const o=V(l,t);e.replaceChildren(o),!se(n.tooltip)&&Lt(e,n.tooltip,!1,r.element),e.dataset.type=l,e.dataset.icon=t}}static setEnabled(e,t){t===!1?e.classList.add("disabled"):e.classList.remove("disabled");const s=e.querySelector(".ui-tooltip-wrapper");s!=null&&(s.style.display=t===!1?"none":"")}}const et={Reorder:"reorder",Resize:"resize",Sort:"sort"},tt=bi()?32:0,Ei=200,Yt=4,Kt=4,_e=50,Ut=200;function it(c){var t;return c==null?null:(c.touches&&((t=c.touches[0])==null?void 0:t.clientX))??c.clientX}function Ti(c){let e=0;for(;c!=null;)e+=c.offsetLeft,c=c.offsetParent;return e}function qe(c){return Array.prototype.indexOf.call(c.parentElement.children,c)}const Si={0:Z,1:Xt,2:ge,3:Tt,4:Li,5:ki},Ye=class{constructor(e){g(this,Ee);g(this,lt);g(this,rt);g(this,ot);g(this,at);g(this,he);g(this,ct);g(this,dt);g(this,Ve);g(this,z);g(this,te);g(this,fe);g(this,We);g(this,Me);g(this,De);g(this,pe);g(this,ut);g(this,Fe);g(this,je);g(this,ht);g(this,ft);g(this,pt);g(this,yt);g(this,gt);g(this,mt);g(this,bt);g(this,Be);g(this,Xe);g(this,Te);g(this,j,void 0);g(this,$,void 0);g(this,xe,void 0);g(this,W,void 0);g(this,v,void 0);g(this,we,void 0);g(this,ke,-1);g(this,M,void 0);g(this,K,0);g(this,ce,void 0);g(this,de,void 0);g(this,ee,void 0);g(this,U,-1);g(this,Ce,void 0);g(this,ue,void 0);g(this,Le,{});g(this,I,{});g(this,At,[]);C(this,"columns",[]);C(this,"langs",{all:D("allItem","( All )"),ok:D("ok","OK"),reset:D("reset","Reset")});C(this,"virtualCount",100);C(this,"rowHeight",36);C(this,"lineHeight",24);C(this,"extraRows",0);C(this,"filterRowHeight",30);C(this,"height");C(this,"readonly");C(this,"multiSelect",!1);C(this,"fullrowClick",!0);C(this,"allowHtml",!1);C(this,"holderDisabled",!1);C(this,"headerVisible",!0);C(this,"window",ne);C(this,"sortIndex",-1);C(this,"sortDirection",1);C(this,"willSelect");C(this,"selectedRowChanged");C(this,"cellDblClicked");C(this,"cellClicked");C(this,"rowDblClicked");C(this,"columnChanged");x(this,xe,e)}get element(){return a(this,W)}get source(){var e;return(e=a(this,j))==null?void 0:e.map(t=>t.values)}set source(e){if(a(this,W)==null)throw new Error("grid has not been initialized.");if(!Array.isArray(e))throw new Error("source is not an Array.");e=e.map(t=>({values:t})),x(this,j,e),y(this,Ee,wt).call(this,e)}get virtual(){var e;return((e=a(this,$))==null?void 0:e.length)>this.virtualCount}get sortKey(){var e;return this.columns==null?null:(e=this.columns[this.sortIndex])==null?void 0:e.key}get selectedIndexes(){return a(this,M)}set selectedIndexes(e){const t=a(this,K);a(this,M).splice(0,a(this,M).length,...e),this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((s,n)=>{e.indexOf(t+n)>=0?s.classList.add("selected"):s.classList.contains("selected")&&s.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged()}get selectedIndex(){return(a(this,M)&&a(this,M)[0])??-1}get loading(){var e,t;return((t=(e=a(this,v).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){a(this,v).loading!=null&&(e===!1?(a(this,v).loading.style.visibility="hidden",a(this,v).loading.style.opacity=0):(a(this,v).loading.style.visibility="visible",a(this,v).loading.style.opacity=1))}get scrollTop(){var e;return(e=a(this,v).body)==null?void 0:e.scrollTop}set scrollTop(e){a(this,v).body!=null&&(a(this,v).body.scrollTop=e,this.reload())}init(e=a(this,xe)){if(x(this,W,null),x(this,v,{}),x(this,we,!0),!(e instanceof HTMLElement))throw new Error("no specified parent.");x(this,xe,e);const t=f("div","ui-grid");t.setAttribute("tabindex",0),t.addEventListener("keydown",l=>{var u;let o=this.selectedIndex,d=!1;if(l.key==="ArrowUp")o>0&&(d=!0,o-=1);else if(l.key==="ArrowDown"){const p=((u=a(this,$))==null?void 0:u.length)??0;o<p-1&&(d=!0,o+=1)}d&&(x(this,M,[o]),this.scrollToIndex(o),this.refresh(),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged(o),l.stopPropagation())}),e.replaceChildren(t);const s=f("span","ui-grid-sizer");t.appendChild(s),a(this,v).sizer=s;const n=y(this,lt,Zt).call(this);t.appendChild(n);const r=y(this,rt,ei).call(this);t.appendChild(r);const i=f("div","ui-grid-loading",f("div",null,V("fa-regular","spinner-third")));a(this,v).loading=i,t.appendChild(i),x(this,W,t),x(this,we,!1),a(this,j)!=null&&this.sortIndex>=0&&this.sortColumn()}scrollToIndex(e){const t=y(this,Ve,Ot).call(this,e*(this.rowHeight+1),!0);a(this,v).body.scrollTop=t}resize(e){if(a(this,we)||a(this,W)==null)return;const t=a(this,v).body,s=this.headerVisible===!1?0:a(this,v).header.offsetHeight;let n=this.height;n===0?n=a(this,de):(isNaN(n)||n<0)&&(n=a(this,W).offsetHeight-s);const r=vi((n-1)/(this.rowHeight+1))+Yt*2+1;(e||r!==a(this,U))&&(x(this,U,r),this.reload()),x(this,ee,t.clientWidth)}reload(){let e=a(this,$).length;this.extraRows>0&&(e+=this.extraRows),x(this,de,e*(this.rowHeight+1)),a(this,v).body.scrollTop=0,a(this,v).body.scrollLeft=0,a(this,v).bodyContent.style.top="0px",a(this,v).bodyContainer.style.height=`${a(this,de)}px`,y(this,ot,ti).call(this,a(this,v).bodyContent),this.refresh()}refresh(){if(a(this,v).bodyContent==null)throw new Error("body has not been created.");const e=a(this,v).bodyContent.children,t={};y(this,at,ii).call(this,e,this.columns,t),a(this,ce)&&t.flag&&(x(this,ce,!1),this.columns.forEach((s,n)=>{if(!y(this,z,X).call(this,s.key,"autoResize"))return;let r=t[n];r<s.width&&(r=s.width),r>0&&y(this,he,Ue).call(this,n,r)}))}resetChange(){if(a(this,j)!=null)for(let e of a(this,j))delete e.__changed}sortColumn(e){const t=this.sortIndex,s=this.columns[t];if(s==null)return;const n=this.sortDirection;[...a(this,v).header.children].forEach((i,l)=>{const o=i.querySelector(".arrow");o!=null&&(l===t?o.className=`arrow ${n!==1?"desc":"asc"}`:o.className!=="arrow"&&(o.className="arrow"))});let r;if(typeof s.sortFilter!="function"){const i=this.sortDirection;isNaN(i)&&(i=1),r=(l,o)=>{if(l=y(this,fe,Ge).call(this,l.values,s.key,s.filter),o=y(this,fe,Ge).call(this,o.values,s.key,s.filter),l==null&&typeof o=="number")l=0;else if(typeof l=="number"&&o==null)o=0;else{if(l!=null&&o==null)return i;typeof l=="string"&&typeof o=="string"&&(l=l.toLowerCase(),o=o.toLowerCase())}return l===o?0:(l>o?1:-1)*i}}else r=(i,l)=>s.sortFilter(i.values,l.values)*n;a(this,j).sort(r),a(this,I).__filtered===!0&&a(this,$).sort(r),!(a(this,U)<0)&&(e?this.reload():this.refresh())}};let Re=Ye;j=new WeakMap,$=new WeakMap,xe=new WeakMap,W=new WeakMap,v=new WeakMap,we=new WeakMap,ke=new WeakMap,M=new WeakMap,K=new WeakMap,ce=new WeakMap,de=new WeakMap,ee=new WeakMap,U=new WeakMap,Ce=new WeakMap,ue=new WeakMap,Le=new WeakMap,I=new WeakMap,At=new WeakMap,Ee=new WeakSet,wt=function(e){e??(e=a(this,j)),a(this,I).__filtered===!0?x(this,$,e.filter(t=>{for(let s of this.columns)if(Array.isArray(s.filterValues)){const n=y(this,fe,Ge).call(this,t.values,s.key,s.filter);if(s.filterValues.indexOf(n)<0)return!1}return!0})):x(this,$,e),x(this,ke,-1),x(this,M,[]),x(this,K,0),x(this,Ce,0),x(this,ue,0),x(this,U,-1),this.sortIndex>=0&&this.sortColumn(),this.resize()},lt=new WeakSet,Zt=function(){const e=f("table","ui-grid-header");this.headerVisible===!1&&(e.style.display="none");const t=f("tr");e.appendChild(t);const s=a(this,v).sizer;for(let i of this.columns){if(i.visible===!1){const h=f("th");h.style.display="none",i.sortable!==!1&&(h.dataset.key=i.key,h.addEventListener("click",m=>y(this,De,zt).call(this,m,i,!0))),t.appendChild(h);continue}const l=Ye.ColumnTypes.isCheckbox(i.type);if(!(i.width>0)){y(this,te,Se).call(this,i.key,"autoResize",!0),x(this,ce,!0),s.innerText=i.caption??"";let h=s.offsetWidth+22;!this.readonly&&i.enabled!==!1&&i.allcheck&&l&&(h+=32),i.allowFilter===!0&&(h+=14),h<_e&&(h=_e),i.width=h}i.align??(i.align=l?"center":"left"),i.sortable!==!1&&(i.sortable=!0);const o=`${i.width}px`,d={width:o,"max-width":o,"min-width":o,"text-align":i.align};y(this,te,Se).call(this,i.key,"style",d);const u=f("th","column");u.dataset.key=i.key;for(let h of Object.entries(d))u.style.setProperty(h[0],h[1]);i.sortable&&(u.style.cursor="pointer",u.addEventListener("click",h=>y(this,De,zt).call(this,h,i))),i.orderable!==!1&&(i.orderable=!0,u.addEventListener("mousedown",h=>y(this,ft,oi).call(this,h,i)));const p=f("div");if(u.appendChild(p),!this.readonly&&i.enabled!==!1&&i.allcheck&&l){const h=ie({onchange:m=>y(this,gt,di).call(this,i,m.target.checked)});p.appendChild(h)}const b=f("span");if(i.textStyle!=null)for(let h of Object.entries(i.textStyle))b.style.setProperty(h[0],h[1]);if(b.innerText=i.caption??"",p.appendChild(b),i.sortable&&u.appendChild(f("layer","arrow")),i.allowFilter===!0){const h=f("layer","filter");h.appendChild(V("fa-solid","filter")),h.addEventListener("mousedown",m=>y(this,ut,li).call(this,m,i)),u.classList.add("header-filter"),u.appendChild(h)}if(i.resizable!==!1){const h=f("layer","spliter");h.addEventListener("mousedown",m=>y(this,pt,ai).call(this,m,i)),h.addEventListener("dblclick",m=>y(this,yt,ci).call(this,m,i)),u.appendChild(h)}t.appendChild(u)}const n=f("div","dragger"),r=f("layer","dragger-cursor");return t.appendChild(f("th",null,n,r)),s.replaceChildren(),a(this,v).header=t,a(this,v).dragger=n,a(this,v).draggerCursor=r,e},rt=new WeakSet,ei=function(){const e=f("div","ui-grid-body");e.addEventListener("scroll",i=>Ie(y(this,mt,ui),tt,this,i),{passive:!0});const t=this.columns;let s=1;for(let i of t)i.visible!==!1&&!isNaN(i.width)&&(s+=i.width+1);const n=f("div");n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="1px",s>0&&(n.style.width=`${s}px`),e.appendChild(n);const r=f("table","ui-grid-body-content");if(r.addEventListener("mousedown",i=>{let[l,o]=y(this,We,$t).call(this,i.target);const d=qe(l);let u=qe(o);u>=this.columns.length&&(u=-1),y(this,Be,Mt).call(this,i,d,u)}),r.addEventListener("dblclick",i=>y(this,Xe,Dt).call(this,i)),n.appendChild(r),!this.holderDisabled){const i=f("div","ui-grid-hover-holder");i.addEventListener("mousedown",l=>{const o=l.currentTarget,d=Number(o.dataset.row),u=Number(o.dataset.col);return o.classList.contains("active")&&o.classList.remove("active"),y(this,Be,Mt).call(this,l,d+a(this,K),u)}),i.addEventListener("dblclick",l=>y(this,Xe,Dt).call(this,l)),n.appendChild(i),e.addEventListener("mousemove",l=>Ie(y(this,bt,hi),Ei,this,l,i),{passive:!0})}return a(this,v).body=e,a(this,v).bodyContainer=n,a(this,v).bodyContent=r,e},ot=new WeakSet,ti=function(){let e=a(this,U);(isNaN(e)||e<0||!this.virtual)&&(e=a(this,$).length);const t=this.columns,s=a(this,v).bodyContent,n=s.children.length;if(e-=n,e>0)for(let r=0;r<e;r+=1){const i=f("tr","ui-grid-row");t.forEach((l,o)=>{const d=f("td");if(l.visible!==!1){d.dataset.row=String(n+r),d.dataset.col=String(o);const u=y(this,z,X).call(this,l.key,"style");if(u!=null)for(let p of Object.entries(u))d.style.setProperty(p[0],p[1]);if(l.css!=null)for(let p of Object.entries(l.css))d.style.setProperty(p[0],p[1]);if(Ye.ColumnTypes.isCheckbox(l.type))d.appendChild(Tt.createEdit(p=>y(this,Te,kt).call(this,p,n+r,l,p.target.checked)));else{let p=a(this,Le)[l.key];p==null&&(isNaN(l.type)?this.allowHtml&&l.type!=null&&(p=l.type):p=Si[l.type],p??(p=Z),a(this,Le)[l.key]=p),d.appendChild(p.create(l))}}i.appendChild(d)}),i.appendChild(f("td")),s.appendChild(i)}else if(e<0)for(let r=-1;r>=e;r-=1)s.children[n+r].remove()},at=new WeakSet,ii=function(e,t,s){const n=a(this,K),r=a(this,M);[...e].forEach((i,l)=>{const o=a(this,$)[n+l];if(o==null||!Ae(i.children.length))return;const d=o.values,u=r.indexOf(n+l)>=0;u?i.classList.add("selected"):i.classList.contains("selected")&&i.classList.remove("selected");const p=o.__selected^u;u?o.__selected=!0:delete o.__selected,t.forEach((b,h)=>{var ye;if(b.visible===!1)return;let m;b.text!=null?m=b.text:typeof b.filter=="function"?m=b.filter(d):(m=d[b.key],(m==null?void 0:m.displayValue)!=null&&(m=m.displayValue)),m??(m="");const k=i.children[h];if(typeof b.bgFilter=="function"){const E=b.bgFilter(d);k.style.backgroundColor=E??""}const T=Ye.ColumnTypes.isCheckbox(b.type),q=T?Tt:a(this,Le)[b.key]??Z;let _;!T&&p&&typeof q.createEdit=="function"?((ye=o.__editing)!=null&&ye[b.key]&&q.editing&&(m=q.getValue({target:k.children[0]}),y(this,Te,kt).call(this,null,n+l,b,m,!0)),_=u?q.createEdit(E=>y(this,Te,kt).call(this,E,n+l,b,q.getValue(E)),b,a(this,v).bodyContent,o):q.create(b),k.replaceChildren(_)):_=k.children[0];let S;if(this.readonly?S=!1:(S=b.enabled,typeof S=="function"?S=S.call(b,d):typeof S=="string"&&(S=d[S])),q.setValue(_,m,d,b,this),typeof q.setEnabled=="function"&&q.setEnabled(_,S),a(this,ce)&&y(this,z,X).call(this,b.key,"autoResize")){const E=_.scrollWidth+12;E>0&&s!=null&&(isNaN(s[h])||s[h]<E)&&(s[h]=E,s.flag=!0)}if(typeof b.styleFilter=="function"){const E=b.styleFilter(d);E!=null&&q.setStyle(_,E)}if(b.events!=null)for(let E of Object.entries(b.events))_[E[0]]=E[1].bind(d);if(b.attrs!=null){let E=b.attrs;typeof E=="function"&&(E=E(d));for(let Jt of Object.entries(E))_.setAttribute(Jt[0],Jt[1])}}),o.__editing!=null&&delete o.__editing})},he=new WeakSet,Ue=function(e,t){const s=this.columns[e],n=`${t}px`;s.width=t;const r=y(this,z,X).call(this,s.key,"style");r.width=n,r["max-width"]=n,r["min-width"]=n;let i=a(this,v).header.children[e];i.style.width=n,i.style.maxWidth=n,i.style.minWidth=n;const l=a(this,v).bodyContent;for(let o of l.children)i=o.children[e],i!=null&&(i.style.width=n,i.style.maxWidth=n,i.style.minWidth=n)},ct=new WeakSet,si=function(e,t,s,n){const r=a(this,v).header.children;let i=r[e];a(this,v).dragger.style.left=`${i.offsetLeft-n+t}px`,a(this,v).dragger.style.width=i.style.width,a(this,v).dragger.style.display="block",t=s-Ti(i);let l;if(t<0){t=-t;for(let o=e-1;o>=0&&t>=0&&(i=r[o],!(i==null||i.className!=="column"));o-=1){if(t<i.offsetWidth){l=t>i.offsetWidth/2?o:o+1;break}t-=i.offsetWidth}l??(l=0)}else{const o=r.length;for(let d=e;d<o-1&&t>=0;d+=1){if(i=r[d],i==null||i.className!=="column"){l=d;break}if(t<i.offsetWidth){l=t>i.offsetWidth/2?d+1:d;break}t-=i.offsetWidth}l??(l=o-1)}if(l!==a(this,I).__orderIndex){if(a(this,I).__orderIndex=l,i=r[l],i==null)return;a(this,v).draggerCursor.style.left=`${i.offsetLeft-n}px`,a(this,v).draggerCursor.style.display="block"}},dt=new WeakSet,ni=function(e){a(this,v).dragger.style.display="",a(this,v).draggerCursor.style.display="";const t=a(this,I).__orderIndex;if(t>=0&&t!==e){let s=t-e;if(s>=0&&s<=1)return;const n=a(this,v).header,r=n.children,i=a(this,v).bodyContent.children,l=this.columns;if(s>1){s=t-1;const o=l.splice(e,1)[0];l.splice(s,0,o),n.insertBefore(r[e],r[s].nextElementSibling);for(let d of i)d.insertBefore(d.children[e],d.children[s].nextElementSibling)}else{s=t;const o=l.splice(e,1)[0];l.splice(s,0,o),n.insertBefore(r[e],r[s]);for(let d of i)d.insertBefore(d.children[e],d.children[s])}[...r].forEach((o,d)=>{const u=o.querySelector(".arrow");u!=null&&u.className!=="arrow"&&(this.sortIndex=d)}),typeof this.columnChanged=="function"&&this.columnChanged(et.Reorder,e,s)}},Ve=new WeakSet,Ot=function(e,t){const s=this.rowHeight+1;if(e-=e%(s*2)+Yt*s,e<0)e=0;else{let n=a(this,de)-(t?0:a(this,U)*s);n<0&&(n=0),e>n&&(e=n)}return a(this,Ce)!==e?(x(this,Ce,e),this.virtual&&x(this,K,e/s),this.refresh(),this.virtual&&(a(this,v).bodyContent.style.top=`${e}px`)):t&&this.refresh(),e},z=new WeakSet,X=function(e,t){const s=a(this,I)[e];return s==null?null:s[t]},te=new WeakSet,Se=function(e,t,s){const n=a(this,I)[e];n==null?a(this,I)[e]={[t]:s}:n[t]=s},fe=new WeakSet,Ge=function(e,t,s){let n;return typeof s=="function"?n=s(e):n=e[t],(n==null?void 0:n.value)??n},We=new WeakSet,$t=function(e){let t;for(;(t=e.parentElement)!=null&&!t.classList.contains("ui-grid-row");)e=t;return[t,e]},Me=new WeakSet,Pt=function(e){return/^(input|label|layer|svg|use)$/i.test(e)},De=new WeakSet,zt=function(e,t,s){if(!(!s&&(y(this,z,X).call(this,t.key,"resizing")||y(this,z,X).call(this,t.key,"dragging")))&&!y(this,Me,Pt).call(this,e.target.tagName)){const n=this.columns.indexOf(t);if(n<0)return;this.sortIndex===n?this.sortDirection=this.sortDirection===1?-1:1:this.sortIndex=n,this.sortColumn(!0),typeof this.columnChanged=="function"&&this.columnChanged(et.Sort,n,this.sortDirection)}},pe=new WeakSet,Je=function(){const e=a(this,W).querySelectorAll(".filter-panel.active");if(e.length>0){e.forEach(s=>s.classList.remove("active")),setTimeout(()=>a(this,W).querySelectorAll(".filter-panel").forEach(s=>s.remove()),120);const t=a(this,I).__filtering;return t instanceof HTMLElement&&t.classList.remove("hover"),delete a(this,I).__filtering,!0}return!1},ut=new WeakSet,li=function(e,t){if(y(this,pe,Je).call(this))return;const s=h=>{h.target.tagName==="LAYER"&&h.target.classList.contains("filter")||h.target.tagName==="use"||y(this,pe,Je).call(this)&&document.removeEventListener("mousedown",s)};document.addEventListener("mousedown",s);const n=f("div","filter-panel");n.addEventListener("mousedown",h=>h.stopPropagation());const r=e.currentTarget,i=r.parentElement,l=i.offsetWidth;n.style.top=`${i.offsetHeight}px`,n.style.left=i.offsetLeft+(l>Ut?l-Ut:0)+"px";let o;if(t.allowSearch!==!1){const h=f("div","filter-search-holder");o=f("input","filter-search-box ui-text"),o.type="text";const m=V("fa-regular","search");m.addEventListener("mousedown",k=>{o.focus(),k.preventDefault()}),h.append(o,m),n.append(h)}const d=f("div","filter-item-list");d.addEventListener("scroll",h=>Ie(y(this,ht,ri),tt,this,t,d,h.target.scrollTop),{passive:!0});const u=f("div","filter-item filter-all");u.appendChild(ie({label:this.langs.all,onchange:h=>{const m=h.target.checked;d.querySelectorAll(".filter-content input").forEach(k=>k.checked=m)}})),d.appendChild(u);let p;if(Array.isArray(t.filterSource))p=t.filterSource;else if(typeof t.filterSource=="function")p=t.filterSource.call(this,t);else{const h=Object.create(null);for(let m of a(this,j)){const k=y(this,fe,Ge).call(this,m.values,t.key,t.filter);if(!Object.hasOwnProperty.call(h,k)){const T=m.values[t.key];h[k]={value:k,displayValue:typeof t.filter=="function"?t.filter(m.values):(T==null?void 0:T.displayValue)??T}}}p=Object.values(h).sort((m,k)=>(m=(m==null?void 0:m.value)??m,k=(k==null?void 0:k.value)??k,m>k?1:m<k?-1:0))}p=p.map(h=>Object.prototype.hasOwnProperty.call(h,"value")&&Object.prototype.hasOwnProperty.call(h,"displayValue")?h:{value:h,displayValue:h??""}),y(this,Fe,Vt).call(this,t,d,p,u),u.querySelector("input").checked=![...d.querySelectorAll(".filter-content input")].some(h=>!h.checked),n.appendChild(d),o!=null&&o.addEventListener("input",h=>{const m=h.currentTarget.value.toLowerCase(),k=m.length===0?p:p.filter(T=>{const q=(T==null?void 0:T.displayValue)??T;return String(q??"").indexOf(m)>=0});y(this,Fe,Vt).call(this,t,d,k,u)});const b=f("div","filter-function");b.append(f("button",h=>{h.innerText=this.langs.ok,h.addEventListener("click",()=>{const m=y(this,z,X).call(this,t.key,"filterSource").filter(k=>k.__checked!==!1);typeof t.onFilterOk=="function"?t.onFilterOk.call(this,t,m):t.filterValues=m.map(k=>k.value),a(this,I).__filtered=!0,y(this,Ee,wt).call(this),typeof t.onFiltered=="function"&&t.onFiltered.call(this,t),r.classList.add("active"),y(this,pe,Je).call(this)})}),f("button",h=>{h.innerText=this.langs.reset,h.addEventListener("click",()=>{delete t.filterValues,a(this,I).__filtered=this.columns.some(m=>t.filterValues!=null),y(this,Ee,wt).call(this),typeof t.onFiltered=="function"&&t.onFiltered.call(this,t),r.classList.remove("active"),y(this,pe,Je).call(this)})})),n.appendChild(b),a(this,W).appendChild(n),setTimeout(()=>n.classList.add("active"),0),a(this,I).__filtering=r,r.classList.add("hover")},Fe=new WeakSet,Vt=function(e,t,s,n){var d,u;(d=t.querySelector(".filter-holder"))==null||d.remove(),(u=t.querySelector(".filter-content"))==null||u.remove();const r=this.filterRowHeight,i=s.length*r;y(this,te,Se).call(this,e.key,"filterHeight",i);const l=f("div","filter-holder");l.style.height=`${i}px`;const o=f("div","filter-content");o.style.top=`${r}px`,y(this,te,Se).call(this,e.key,"filterSource",s);for(let p of s)p.__checked=!Array.isArray(e.filterValues)||e.filterValues.indexOf(p.value??p)>=0;s.length>12&&(s=s.slice(0,12)),y(this,je,Wt).call(this,o,s,n),t.append(l,o)},je=new WeakSet,Wt=function(e,t,s){for(let n of t){const r=f("div","filter-item");r.appendChild(ie({checked:n.__checked,label:(n==null?void 0:n.displayValue)??n,onchange:i=>{n.__checked=i.target.checked,s.querySelector("input").checked=![...e.querySelectorAll("input")].some(l=>!l.checked)}})),e.appendChild(r)}},ht=new WeakSet,ri=function(e,t,s){const n=this.filterRowHeight;if(s-=s%(n*2)+n,s<0)s=0;else{let r=y(this,z,X).call(this,e.key,"filterHeight")-12*n;r<0&&(r=0),s>r&&(s=r)}if(y(this,z,X).call(this,e.key,"filterTop")!==s){y(this,te,Se).call(this,e.key,"filterTop",s);const r=s/n;let i=y(this,z,X).call(this,e.key,"filterSource");r+12<i.length?i=i.slice(r,r+12):i=i.slice(-12);const l=t.querySelector(".filter-content");l.replaceChildren(),y(this,je,Wt).call(this,l,i,t.querySelector(".filter-all>input")),l.style.top=`${s+n}px`}},ft=new WeakSet,oi=function(e,t){if(y(this,Me,Pt).call(this,e.target.tagName))return;const s=it(e),n=qe(e.currentTarget),r=d=>{for(let u of["mousemove","mouseup"])d.hasOwnProperty(u)&&(window.removeEventListener(u,d[u]),delete d[u])};let i=a(this,I)[t.key];i==null?i=a(this,I)[t.key]={}:r(i),i.dragging=!0;const l=a(this,v).header.querySelector("th:last-child").offsetLeft,o=d=>{const u=it(d),p=u-s;let b=i.offset,h;(b==null&&(p>Kt||p<-Kt)||b!==p)&&(h=!0),h&&(y(this,ct,si).call(this,n,p,u,l),i.offset=p)};i.mousemove=d=>Ie(o,tt,this,d),i.mouseup=()=>{r(i),i.offset==null?delete i.dragging:(setTimeout(()=>{delete i.dragging,delete i.offset}),y(this,dt,ni).call(this,n))},["mousemove","mouseup"].forEach(d=>window.addEventListener(d,i[d]))},pt=new WeakSet,ai=function(e,t){const s=it(e),n=t.width,r=qe(e.currentTarget.parentElement),i=this.window??ne,l=u=>{for(let p of["mousemove","mouseup"])u.hasOwnProperty(p)&&(i.removeEventListener(p,u[p]),delete u[p])};let o=a(this,I)[t.key];o==null?o=a(this,I)[t.key]={}:l(o),o.resizing=n;const d=u=>{const p=it(u),b=n+(p-s);b<_e||(o.resizing=b,o.sizing=!0,y(this,he,Ue).call(this,r,b))};o.mousemove=u=>Ie(d,tt,this,u),o.mouseup=u=>{l(o);const p=o.resizing;p!=null&&(setTimeout(()=>delete o.resizing),o.sizing&&(delete o.sizing,delete o.autoResize,y(this,he,Ue).call(this,r,p),typeof this.columnChanged=="function"&&this.columnChanged(et.Resize,r,p))),u.stopPropagation(),u.preventDefault()},["mousemove","mouseup"].forEach(u=>i.addEventListener(u,o[u]))},yt=new WeakSet,ci=function(e,t){const s=e.currentTarget.parentElement,n=qe(s);let r=s.querySelector("div:first-child").scrollWidth;for(let i of a(this,v).bodyContent.children){const o=i.children[n].children[0].scrollWidth;o>r&&(r=o)}r<_e&&(r=_e),r>0&&r!==t.width&&(r+=12,y(this,he,Ue).call(this,n,r),typeof this.columnChanged=="function"&&this.columnChanged(et.Resize,n,r))},gt=new WeakSet,di=function(e,t){if(a(this,$)==null)return;const s=e.key,n=typeof e.enabled=="function",r=typeof e.enabled=="string";if(typeof e.onallchecked=="function")e.onallchecked.call(this,e,t);else{for(let i of a(this,$)){const l=i.values;if(l==null)continue;(n?e.enabled(l):r?l[e.enabled]:e.enabled)!==!1&&(l[s]=t,i.__changed=!0,typeof e.onchanged=="function"&&e.onchanged.call(this,l,t))}this.refresh()}},mt=new WeakSet,ui=function(e){const t=e.target.scrollLeft;if(a(this,ue)!==t&&(x(this,ue,t),a(this,v).header.style.left=`${-t}px`),!this.virtual)return;const s=e.target.scrollTop;y(this,Ve,Ot).call(this,s)},bt=new WeakSet,hi=function(e,t){if(e.target.classList.contains("ui-grid-hover-holder"))return;let[s,n]=y(this,We,$t).call(this,e.target);if(s==null){delete t.dataset.row,delete t.dataset.col,t.classList.contains("active")&&t.classList.remove("active");return}const r=n.children[0];if((r==null?void 0:r.tagName)!=="SPAN"){t.classList.contains("active")&&(delete t.dataset.row,delete t.dataset.col,t.classList.remove("active"));return}const i=n.dataset.row,l=n.dataset.col;if(!(t.dataset.row===i&&t.dataset.col===l))if(r.scrollWidth>r.offsetWidth){t.dataset.row=i,t.dataset.col=l,t.innerText=r.innerText;const o=a(this,v).bodyContent.offsetTop+n.offsetTop;let d=n.offsetLeft,u=t.offsetWidth;u>a(this,ee)&&(u=a(this,ee));const p=a(this,ee)+a(this,ue)-u;d>p&&(d=p);const b=n.offsetHeight;t.style.cssText=`top: ${o}px; left: ${d}px; max-width: ${a(this,ee)}px; height: ${b-2}px`,t.classList.add("active")}else t.classList.contains("active")&&(delete t.dataset.row,delete t.dataset.col,t.classList.remove("active"))},Be=new WeakSet,Mt=function(e,t,s){const n=a(this,K),r=n+t;if(typeof this.willSelect=="function"&&!this.willSelect(r,s))return;let i=!1;const l=a(this,M);if(this.multiSelect){if(e.ctrlKey){const o=l.indexOf(r);o<0?l.push(r):l.splice(o,1),i=!0}else if(e.shiftKey&&l.length>0&&(l.length>1||l[0]!==r)){let o=l[l.length-1],d;o>r?(d=o,o=r):d=r,l.splice(0);for(let u=o;u<=d;u+=1)l.push(u);i=!0}}(!i&&l.length!==1||l[0]!==r)&&(l.splice(0,l.length,r),i=!0),i&&(this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((o,d)=>{l.indexOf(n+d)>=0?o.classList.add("selected"):o.classList.contains("selected")&&o.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged(r)),x(this,ke,s),(this.fullrowClick||s>=0)&&e.buttons===1&&typeof this.cellClicked=="function"&&this.cellClicked(r,s)===!1&&(e.stopPropagation(),e.preventDefault())},Xe=new WeakSet,Dt=function(e){if(e.target.tagName==="INPUT"||e.target.tagName==="TEXTAREA"||e.target.tagName==="LAYER"&&e.target.className==="ui-check-inner"||e.target.tagName==="LABEL"&&(e.target.className==="ui-drop-text"||e.target.className==="ui-drop-caret"))return;const t=this.selectedIndex;if(typeof this.rowDblClicked=="function"&&this.rowDblClicked(t),typeof this.cellDblClicked=="function"){const s=a(this,ke);(this.fullrowClick||s>=0)&&this.cellDblClicked(t,s)}},Te=new WeakSet,kt=function(e,t,s,n,r){if(a(this,$)==null)return;const i=a(this,$)[a(this,K)+t],l=i.values;if(l==null)return;let o=s.enabled;typeof o=="function"?o=o.call(s,l):typeof o=="string"&&(o=l[o]),o!==!1&&(l[s.key]=n,i.__changed=!0,r?typeof s.oneditend=="function"&&s.oneditend.call(this,l,n):typeof s.onchanged=="function"&&s.onchanged.call(this,l,n))},C(Re,"ColumnTypes",{Common:0,Input:1,Dropdown:2,Checkbox:3,Icon:4,Text:5,isCheckbox(e){return e===3}}),C(Re,"GridColumn",Z);const Vi="",R={right:1,bottom:2,left:4,top:8,bottomRight:3,bottomLeft:6,topRight:9,topLeft:12};function st(c){if(typeof c!="string")return c;if(c.endsWith("px")){const e=Number(c.substring(0,c.length-2));return isNaN(e)?c:e}return c}class nt{constructor(e={}){g(this,B);g(this,G,void 0);g(this,H,void 0);g(this,J,void 0);x(this,H,e)}get container(){return a(this,G).querySelector(".ui-popup-container")}get rect(){const e=this.container;if(e==null)return null;const t=ne.getComputedStyle(e),s=e.classList.contains("ui-popup-collapse"),n=a(this,J);return{collapsed:s,left:st(t.left),top:st(t.top),width:s===!0&&n!=null?n.width:st(t.width),height:s===!0&&n!=null?n.height:st(t.height)}}set rect(e){const t=this.container;if(t==null)return;const s=[];isNaN(e.left)||s.push(`left: ${e.left}px`),isNaN(e.top)||s.push(`top: ${e.top}px`);const n=t.querySelector(".ui-popup-header>.icon-expand");e.collapsed===!0?(s.push("width: 160px","height: 40px"),x(this,J,e),t.classList.add("ui-popup-collapse"),n!=null&&Ne(n,"fa-regular","expand-alt")):(!isNaN(e.width)&&e.width>0&&s.push(`width: ${e.width}px`),!isNaN(e.height)&&e.height>0&&s.push(`height: ${e.height}px`),t.classList.remove("ui-popup-collapse"),x(this,J,null),n!=null&&Ne(n,"fa-regular","compress-alt")),s.length>0&&(t.style.cssText+=s.join("; "))}create(){const e=f("div","ui-popup-mask");a(this,H).mask===!1&&e.classList.add("ui-popup-transparent");const t=f("div","ui-popup-container");let s=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(i=>i.tabIndex??0));s<0&&(s=0),t.tabIndex=s+1;const n=()=>{e.classList.add("ui-popup-active"),e.style.opacity=0,setTimeout(()=>e.remove(),120)};let r=a(this,H).content;if(r instanceof HTMLElement||(r=f("div",i=>i.innerText=r)),t.append(f("div",i=>{i.className="ui-popup-header";let l=a(this,H).title;if(l instanceof HTMLElement||(l=f("div",d=>{d.className="ui-popup-header-title",d.innerText=l})),i.appendChild(l),a(this,H).movable!==!1&&(l.querySelector(".ui-popup-move")??l).addEventListener("mousedown",u=>{const p=u.clientX-t.offsetLeft,b=u.clientY-t.offsetTop;let h;const m=T=>{t.style.left=`${T.clientX-p}px`,t.style.top=`${T.clientY-b}px`,h=!0};e.addEventListener("mousemove",m,{passive:!1});const k=()=>{e.removeEventListener("mousemove",m,{passive:!1}),e.removeEventListener("mouseup",k),h===!0&&typeof a(this,H).onMoveEnded=="function"&&a(this,H).onMoveEnded.call(this),h=!1};e.addEventListener("mouseup",k)}),a(this,H).collapsable===!0){const d=V("fa-regular","compress-alt");d.tabIndex=s+2,d.classList.add("icon-expand"),d.addEventListener("keypress",u=>{(u.key===" "||u.key==="Enter")&&d.dispatchEvent(new MouseEvent("click"))}),d.addEventListener("click",()=>{if(t.classList.contains("ui-popup-collapse")){const u=a(this,J);u!=null&&(t.style.cssText+=`width: ${u.width}px; height: ${u.height}px`,x(this,J,null)),t.classList.remove("ui-popup-collapse"),Ne(d,"fa-regular","compress-alt")}else{const u=this.rect;x(this,J,u),t.style.cssText+="width: 160px; height: 40px",t.classList.add("ui-popup-collapse"),Ne(d,"fa-regular","expand-alt")}}),i.appendChild(d)}const o=V("fa-regular","times");o.tabIndex=s+3,o.addEventListener("keypress",d=>{(d.key===" "||d.key==="Enter")&&n()}),o.addEventListener("click",()=>n()),i.appendChild(o)}),f("div","ui-popup-body",r,f("div","ui-popup-loading",f("div",null,V("fa-regular","spinner-third"))))),Array.isArray(a(this,H).buttons)){s=Math.max.apply(null,[...t.querySelectorAll("[tabindex]")].map(u=>u.tabIndex??0)),t.appendChild(f("div","ui-popup-footer",...a(this,H).buttons.map((u,p)=>{const b=f("button","ui-popup-button");return u.tabIndex>0?b.tabIndex=u.tabIndex:b.tabIndex=s+p+1,b.innerText=u.text,b.addEventListener("click",()=>{if(typeof u.trigger=="function"){const h=u.trigger(this);typeof(h==null?void 0:h.then)=="function"?h.then(m=>{m!==!1&&n()}).catch(()=>{}):h!==!1&&n()}else n()}),b})));const i=[...t.querySelectorAll("[tabindex]")].map(u=>u.tabIndex??0),l=Math.min.apply(null,i),o=Math.max.apply(null,i),d=t.querySelector(`[tabindex="${o}"]`);d!=null&&d.addEventListener("keydown",u=>{if(u.key==="Tab"){const p=t.querySelector(`[tabindex="${l}"]`);p==null||p.focus(),u.preventDefault()}})}return a(this,H).resizable===!0&&t.append(f("layer",i=>{i.className="ui-popup-border ui-popup-border-right",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.right,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-bottom",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.bottom,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-left",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.left,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-top",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.top,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-bottom-right",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.bottomRight,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-bottom-left",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.bottomLeft,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-top-left",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.topLeft,l))}),f("layer",i=>{i.className="ui-popup-border ui-popup-border-top-right",i.addEventListener("mousedown",l=>y(this,B,Q).call(this,R.topRight,l))})),e.appendChild(t),x(this,G,e),e}show(e=document.body){if(e==null)return;let t=a(this,G)??this.create();if(e.appendChild(t),a(this,H).mask===!1){const s=this.container;s.style.left=String((e.offsetWidth-s.offsetWidth)/2)+"px",s.style.top=String((e.offsetHeight-s.offsetHeight)/2)+"px"}return new Promise(s=>{setTimeout(()=>{t.style.opacity=1,this.container.focus(),s(t)},0)})}get loading(){var e,t,s;return((s=(t=(e=a(this,G))==null?void 0:e.querySelector(".ui-popup-body>.ui-popup-loading"))==null?void 0:t.style)==null?void 0:s.visibility)==="visible"}set loading(e){var s;let t=(s=a(this,G))==null?void 0:s.querySelector(".ui-popup-body>.ui-popup-loading");t!=null&&(e===!1?(t.style.visibility="hidden",t.style.opacity=0):(t.style.visibility="visible",t.style.opacity=1))}}G=new WeakMap,H=new WeakMap,J=new WeakMap,B=new WeakSet,Q=function(e,t){const s=this.container,n=a(this,H);typeof n.onResizeStarted=="function"&&n.onResizeStarted.call(this);const r=a(this,G),i=t.clientX,l=t.clientY,o={width:s.offsetWidth,height:s.offsetHeight,left:s.offsetLeft,top:s.offsetTop},d=n.minWidth??200,u=n.minHeight??200;let p;const b=k=>{const T=k.clientX-i,q=k.clientY-l;let _=o.width,S=o.height,ye=o.left,E=o.top;(e&R.right)===R.right&&(_+=T,_<d&&(_=d)),(e&R.bottom)===R.bottom&&(S+=q,S<u&&(S=u)),(e&R.left)===R.left&&(_-=T,_<d?(_=d,ye=i+o.width-d):ye+=T),(e&R.top)===R.top&&(S-=q,S<u?(S=u,E=l+o.height-u):E+=q),typeof n.onResizing=="function"?n.onResizing.call(this,ye,E,_,S):s.style.cssText+=`left: ${ye}px; top: ${E}px; width: ${_}px; height: ${S}px`,p=!0},h=n.mask===!1?r.parentElement:r;h.addEventListener("mousemove",b,{passive:!1});const m=()=>{h.removeEventListener("mousemove",b,{passive:!1}),h.removeEventListener("mouseup",m),p===!0&&typeof n.onResizeEnded=="function"&&n.onResizeEnded.call(this),p=!1};h.addEventListener("mouseup",m)};function Ni(c,e,...t){return new nt({title:c,content:e,buttons:t})}const Gt={info:"info-circle",information:"info-circle",warn:"exclamation-triangle",warning:"exclamation-triangle",question:"question-circle",error:"times-circle"};function Ai(c,e,t="info",s=document.body){return new Promise(n=>{new nt({title:c,content:f("div","message-wrapper",V("fa-solid",Gt[t]??"info-circle"),f("span",i=>i.innerText=e)),buttons:[{text:D("ok","OK"),trigger:n}]}).show(s).then(i=>{const l=i.querySelector(".ui-popup-container .ui-popup-footer .ui-popup-button:last-child");l==null||l.focus()})})}function Ii(c,e,t,s="question",n=document.body){return new Promise(r=>{const i=f("div","message-wrapper");se(s)||i.appendChild(V("fa-solid",Gt[s]??"question-circle")),i.appendChild(e instanceof HTMLElement?e:f("span",o=>o.innerText=e)),new nt({title:c,content:i,buttons:(t==null?void 0:t.map(o=>({text:o.text,trigger:d=>{let u;if(typeof o.trigger=="function"){if(u=o.trigger(d,o),typeof(u==null?void 0:u.then)=="function")return u.then(p=>(p!==!1&&r(p),p));u!==!1&&r(u)}else u={key:o.key,popup:d},r(u);return u}})))??[{text:D("yes","Yes"),trigger:o=>r({key:"yes",popup:o})},{text:D("no","No"),trigger:o=>r({key:"no",popup:o})}]}).show(n).then(o=>{const d=o.querySelector(".ui-popup-container .ui-popup-footer .ui-popup-button:last-child");d==null||d.focus()})})}w.Dropdown=Ze,w.Grid=Re,w.Popup=nt,w.changeIcon=Ne,w.createCheckbox=ie,w.createElement=f,w.createIcon=V,w.createPopup=Ni,w.createRadiobox=pi,w.resolveCheckbox=yi,w.resolveIcon=fi,w.resolveTooltip=gi,w.setTooltip=Lt,w.showAlert=Ai,w.showConfirm=Ii,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}); +(function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w["lib-ui"]={}))})(this,function(w){var I,D,R,O,Y,be,He,oe,ae,ce,Ue,ve,wt,xe,kt,Oe,_t,$e,zt,Pe,Rt,Ve,Ht,F,H,we,V,v,ke,Ce,M,K,de,ue,ie,Z,Le,he,Ee,A,At,Te,Ct,ot,ti,at,ii,ct,si,dt,ni,fe,Ge,ut,li,ht,ri,Me,Ot,$,X,se,Ne,pe,Ze,We,$t,De,Pt,Fe,Vt,ye,Je,ft,oi,je,Mt,Be,Wt,pt,ai,yt,ci,gt,di,mt,ui,bt,hi,vt,fi,xt,pi,Xe,Dt,Ye,Ft,Se,Lt,j,U,J,B,Q;"use strict";var zi=Object.defineProperty;var Ri=Object.getPrototypeOf;var Hi=Reflect.get;var Oi=(w,L,N)=>L in w?zi(w,L,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[L]=N;var C=(w,L,N)=>(Oi(w,typeof L!="symbol"?L+"":L,N),N),qt=(w,L,N)=>{if(!L.has(w))throw TypeError("Cannot "+N)};var a=(w,L,N)=>(qt(w,L,"read from private field"),N?N.call(w):L.get(w)),g=(w,L,N)=>{if(L.has(w))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(w):L.set(w,N)},x=(w,L,N,p)=>(qt(w,L,"write to private field"),p?p.call(w,N):L.set(w,N),N);var y=(w,L,N)=>(qt(w,L,"access private method"),N),ei=(w,L,N)=>Hi(Ri(w),N,L);const L="",N="";function p(d,e,...t){const s=document.createElement(d);return typeof e=="function"?e(s):e!=null&&(s.className=e),t.length>0&&s.append(...t),s}const jt="http://www.w3.org/2000/svg";function Et(d,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,l=document.createElementNS(jt,"use");return l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),l}function Ie(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Et(e,t)),d}function P(d,e,t){const s=document.createElementNS(jt,"svg");if(s.appendChild(Et(d,e)),t!=null)for(let n of Object.entries(t))s.style.setProperty(n[0],n[1]);return s}function yi(d){const e=d.querySelectorAll("svg[data-id]");for(let t of e){const s=t.dataset.type,n=t.dataset.id;t.replaceChildren(Et(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return d}const $i="";function Qe(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(p("layer",l=>{l.className="ui-check-inner",l.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const r=d.querySelector("input");r!=null&&(r.checked=!r.checked,r.dispatchEvent(new Event("change")))}}),s>=0&&(l.tabIndex=s)},P(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(p("span",l=>l.innerText=t))}function gi(d={}){const e=p("label","ui-check-wrapper ui-radio-wrapper",p("input",t=>{if(t.setAttribute("type","radio"),t.name=d.name,d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),Qe(e,d.type,d.label,d.tabIndex,"circle"),e}function ne(d={}){const e=p("label","ui-check-wrapper",p("input",t=>{if(t.setAttribute("type","checkbox"),d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),d.enabled===!1&&e.classList.add("disabled"),d.checkedNode!=null&&d.uncheckedNode!=null?(e.classList.add("ui-check-image-wrapper"),d.imageHeight,d.checkedNode.classList.add("checked"),e.appendChild(d.checkedNode),d.uncheckedNode.classList.add("unchecked"),e.appendChild(d.uncheckedNode)):Qe(e,d.type,d.label,d.tabIndex),e}function mi(d=document.body,e){if(e){const s=d.querySelectorAll('input[type="checkbox"]');for(let n of s){if(n.parentElement.classList.contains("ui-check-wrapper"))continue;const l=n.id;let i,r;if(l!=null&&(i=d.querySelector(`label[for="${l}"]`)),i==null){const o=n.nextElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:o.tagName==="SPAN"&&o.dataset.lgid!=null&&(r=o.innerText,o.style.display="none"))}if(i==null){const o=n.previousElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:r==null&&o.tagName==="SPAN"&&o.dataset.lgid!=null&&(r=o.innerText,o.style.display="none"))}i==null?(i=p("label"),n.parentElement.insertBefore(i,n)):r=i.innerText,n.disabled?i.className="ui-check-wrapper disabled":i.className="ui-check-wrapper",i.replaceChildren(),Qe(i,"fa-regular",r,n.tabIndex),i.insertBefore(n,i.firstChild)}}const t=d.querySelectorAll("label[data-checkbox]");for(let s of t){s.classList.contains("ui-check-wrapper")||s.classList.add("ui-check-wrapper"),s.hasChildNodes()?s.classList.contains("ui-check-image-wrapper")||s.classList.add("ui-check-image-wrapper"):(Qe(s,s.dataset.type,s.dataset.label,s.dataset.tabIndex),s.removeAttribute("data-type"),s.removeAttribute("data-label"));const n=p("input"),l=s.dataset.id;(l==null?void 0:l.length)>0&&(n.id=l),s.dataset.checked!=null&&(n.checked=!0),n.setAttribute("type","checkbox"),s.insertBefore(n,s.firstChild)}return d}const Pi="";function et(d,e,t=!1,s=null){const n=s instanceof HTMLElement;if(n){const r=d.dataset.tipId,o=s.querySelector(`.ui-tooltip-wrapper[data-tip-id="${r}"]`);o==null||o.remove()}else{const r=d.querySelector(".ui-tooltip-wrapper");r==null||r.remove()}const l=p("div",r=>{r.className="ui-tooltip-wrapper ui-tooltip-color",r.style.visibility="hidden",r.style.opacity=0,r.style.top="0",r.style.left="0"},p("div","ui-tooltip-pointer ui-tooltip-color"),p("div","ui-tooltip-curtain ui-tooltip-color"),p("div",r=>{r.className="ui-tooltip-content",e instanceof Element?r.appendChild(e):r.innerText=e}));if(n){const r=String(Math.random()).substring(2);d.dataset.tipId=r,l.dataset.tipId=r,s.appendChild(l)}else d.appendChild(l);let i;return d.addEventListener("mouseenter",()=>{i&&clearTimeout(i);let r=d;for(;(r==null?void 0:r.offsetWidth)==null;)r=r.parentElement;r!=null&&(!t||r.scrollWidth>r.offsetWidth)&&(i=setTimeout(()=>{let o,c,u;if(c=r.offsetLeft,u=r.offsetTop,n)for(o=r.offsetParent;o!=null&&o!==s;)c+=o.offsetLeft,u+=o.offsetTop,o=o.offsetParent;o=r.parentElement;const f=r.offsetParent;for(;o!=null&&o!==(n?s:f);)c-=o.scrollLeft,u-=o.scrollTop,o=o.parentElement;c+=(r.offsetWidth-l.offsetWidth)/2,u-=l.offsetHeight+14,l.style.left=`${c}px`,l.style.top=`${u}px`,l.style.visibility="visible",l.style.opacity=1},100))}),d.addEventListener("mouseleave",()=>{i&&clearTimeout(i),i=setTimeout(()=>{l.style.visibility="hidden",l.style.opacity=0},300)}),d}function bi(d=document.body){const e=d.querySelectorAll("[title]");for(let t of e){const s=t.getAttribute("title");s!=null&&(t.removeAttribute("title"),et(t,s))}return d}const Vi="";function ee(d){return d==null||typeof d!="string"||d.length===0}function vi(d,e,t){return ee(d)||e==null?!1:(typeof e!="string"&&(e=String(e)),t?d.toLowerCase().indexOf(e.toLowerCase())>=0:d.indexOf(e)>=0)}function W(d,e){return e}let le=typeof globalThis<"u"?globalThis:self;function Ae(d){return!isNaN(d)&&d>0}function xi(){return/mobile/i.test(navigator.userAgent)}function qe(d,e=100,t=le,...s){if(d==null)return;d.tiid&&clearTimeout(d.tiid);const n=new Date;d.tdate==null||n-d.tdate>e?(d.apply(t,s),d.tdate=n):d.tiid=setTimeout(()=>d.apply(t,s),e)}function wi(d){return(d>0?Math.floor:Math.ceil)(d)}const Bt=Symbol.for("ui-dropdown"),ki=26,Ci=30;let re=le[Bt];re==null&&(re={},Object.defineProperty(re,"clear",{writable:!1,configurable:!1,enumerable:!1,value:function(){const d=document.querySelector(".ui-drop-wrapper .ui-drop-box.active");if(d==null)return;d.classList.remove("active");const e=d.parentElement.dataset.dropId;if(e==null)return;const t=this[e];t!=null&&t.multiselect&&typeof t.oncollapsed=="function"&&t.oncollapsed()}}),le[Bt]=re,document.addEventListener("mousedown",d=>{let e=d.target;for(;e!=null;){if(e.classList.contains("ui-drop-box")){d.stopPropagation();return}e=e.parentElement}re.clear()}));function Xt(d,e,t,s){const n=e.map(l=>l[t]);if(n.some(l=>l instanceof HTMLElement))d.replaceChildren(...n.filter(l=>l!=null).map(l=>l.cloneNode(!0)));else{let l=e.map(i=>i[s]).join(", ");ee(l)&&(l=W("noneItem","( None )")),d.innerText=l}}function Tt(d,e,t,s){return(!Array.isArray(d)||d.length===0)&&(d=[e]),t.length>0&&(s=s.filter(n=>{for(let l of d)if(vi(n[l].toLowerCase(),t))return!0;return!1})),s}const Nt=class{constructor(e={}){g(this,ce);g(this,ve);g(this,xe);g(this,Oe);g(this,I,void 0);g(this,D,void 0);g(this,R,void 0);g(this,O,void 0);g(this,Y,void 0);g(this,be,void 0);g(this,He,void 0);g(this,oe,void 0);g(this,ae,void 0);C(this,"sourceFilter");C(this,"onselectedlist");C(this,"onselected");C(this,"onexpanded");e.searchplaceholder??(e.searchplaceholder=W("searchHolder","Search...")),e.textkey??(e.textkey="text"),e.valuekey??(e.valuekey="value"),e.htmlkey??(e.htmlkey="html"),e.maxlength??(e.maxlength=500),x(this,I,e)}create(){const e=a(this,I),t=p("div","ui-drop-wrapper"),s=String(Math.random()).substring(2);t.dataset.dropId=s,re[s]=this,x(this,D,t);const n=p("div","ui-drop-header");n.addEventListener("keypress",i=>{(i.key===" "||i.key==="Enter")&&n.dispatchEvent(new MouseEvent("click"))}),n.addEventListener("keydown",i=>{var c;const r=i.key==="ArrowUp",o=i.key==="ArrowDown";if(r||o){const u=this.source,f=u.length,b=a(this,I).valuekey;let h=u==null?void 0:u.indexOf(a(this,oe));isNaN(h)||h<-1?h=-1:h>=f&&(h=f-1),r?h>0?h--:h=0:o&&(h<0?h=0:h<f?h++:h=f-1);const m=(c=u[h])==null?void 0:c[b];m!=null&&this.select(m)}else i.key==="Tab"&&y(this,ve,wt).call(this,!1)}),n.addEventListener("click",()=>{if(this.disabled)return;const i=a(this,ce,Ue),r=a(this,O);i&&r.ownerDocument.activeElement===r||(y(this,ve,wt).call(this,!i),!i&&typeof this.onexpanded=="function"&&setTimeout(()=>this.onexpanded(),120))});let l;return e.input?(l=p("input","ui-drop-text"),l.setAttribute("type","text"),e.placeholder&&l.setAttribute("placeholder",e.placeholder),Ae(e.maxlength)&&l.setAttribute("maxlength",e.maxlength),Ae(e.tabIndex)&&l.setAttribute("tabindex",e.tabIndex),l.addEventListener("input",i=>{const r=i.target.value.toLowerCase(),o=Tt(e.searchkeys,e.textkey,r,this.source);y(this,xe,kt).call(this,o),a(this,R).classList.add("active")}),l.addEventListener("blur",i=>this.select(i.target.value)),l.addEventListener("mousedown",i=>a(this,ce,Ue)&&i.stopPropagation())):(Ae(e.tabIndex)&&n.setAttribute("tabindex",e.tabIndex),l=p("label","ui-drop-text")),x(this,O,l),e.multiselect?Array.isArray(e.selectedlist)?this.selectlist(e.selectedlist,!0):(x(this,Y,!0),l.innerText=W("allItem","( All )")):e.selected!=null&&this.select(e.selected,!0),n.append(l,p("label","ui-drop-caret")),t.appendChild(n),this.disabled=e.disabled||!1,t}get multiselect(){return a(this,I).multiselect}get disabled(){return a(this,D)==null||a(this,D).querySelector(".ui-drop-header.disabled")!=null}set disabled(e){a(this,D)!=null&&(e?a(this,D).querySelector(".ui-drop-header").classList.add("disabled"):a(this,D).querySelector(".ui-drop-header").classList.remove("disabled"))}get source(){let e=a(this,be);return(e==null||!Array.isArray(e))&&(typeof this.sourceFilter=="function"&&(e=this.sourceFilter()),Array.isArray(e)||(e=[]),x(this,be,e)),e}set source(e){Array.isArray(e)&&(x(this,be,e),a(this,ce,Ue)&&setTimeout(()=>y(this,ve,wt).call(this),120))}get selected(){return a(this,oe)}get selectedlist(){return a(this,ae)||[]}select(e,t){if(a(this,He)===e)return!1;x(this,He,e);const s=a(this,I).valuekey,n=a(this,I).textkey,l=a(this,I).htmlkey;let i=this.source.find(r=>r[s]===e);if(a(this,I).input)i==null&&(i={[s]:e}),a(this,O).value=e;else{const r=a(this,ce,Ue);if(r&&a(this,R).querySelectorAll("li[data-value].selected").forEach(c=>c.classList.remove("selected")),i==null)return x(this,oe,null),a(this,O).innerText=" ",!1;const o=i[l];if(o instanceof HTMLElement)a(this,O).replaceChildren(o.cloneNode(!0));else{let c=i[n];ee(c)&&(c=" "),a(this,O).innerText=c}if(r){const c=e.replace(/"/g,'\\"'),u=a(this,R).querySelector(`li[data-value="${c}"]`);u!=null&&u.classList.add("selected")}}x(this,oe,i),!t&&typeof this.onselected=="function"&&this.onselected(i)}selectlist(e,t){const s=this.source,n=a(this,I).valuekey,l=a(this,I).textkey,i=a(this,I).htmlkey,r=e.map(o=>{let c=s.find(u=>u[n]===o);return c==null&&(c={[n]:o,[l]:o}),c});if(r.length===0)return x(this,ae,null),a(this,O).innerText=none,!1;Xt(a(this,O),r,i,l),x(this,ae,r),!t&&typeof this.onselectedlist=="function"&&this.onselectedlist(r)}static resolve(e=document.body){const t=e.querySelectorAll("select");for(let s of t){const n=[...s.children].map(i=>({value:i.value,text:i.innerText})),l=new Nt({selected:s.value,disabled:s.disabled,tabIndex:s.tabIndex});l.source=n,s.parentElement.replaceChild(l.create(),s)}return e}};let tt=Nt;I=new WeakMap,D=new WeakMap,R=new WeakMap,O=new WeakMap,Y=new WeakMap,be=new WeakMap,He=new WeakMap,oe=new WeakMap,ae=new WeakMap,ce=new WeakSet,Ue=function(){var e,t;return(t=(e=a(this,R))==null?void 0:e.classList)==null?void 0:t.contains("active")},ve=new WeakSet,wt=function(e=!0){const t=a(this,I);let s=a(this,R);if(s==null){if(s=p("div","ui-drop-box"),!t.input&&t.search){const l=p("div","ui-drop-search"),i=p("input");i.setAttribute("type","text"),Ae(t.tabIndex)&&i.setAttribute("tabindex",t.tabIndex),!ee(t.searchplaceholder)&&i.setAttribute("placeholder",t.searchplaceholder),i.addEventListener("input",r=>{const o=r.target.value.toLowerCase(),c=Tt(t.searchkeys,t.textkey,o,this.source);y(this,xe,kt).call(this,c)}),l.append(i,P("fa-light","search")),s.appendChild(l)}const n=p("ul","ui-drop-list");this.multiselect||n.addEventListener("click",l=>{let i=l.target;for(;i.tagName!=="LI";)if(i=i.parentElement,i==null)return;const r=i.dataset.value;this.select(r)!==!1&&re.clear()}),s.appendChild(n),x(this,R,s),a(this,D).appendChild(s)}if(e){let n=this.source;if(!t.input&&t.search){const l=s.querySelector(".ui-drop-search > input");ee(l==null?void 0:l.value)||(n=Tt(t.searchkeys,t.textkey,l.value,n))}if(y(this,xe,kt).call(this,n),!t.slidefixed){let l=t.parent??document.body,i=a(this,D),r=i.offsetTop;for(;(i=i.parentElement)!=null&&i!==l;)r-=i.scrollTop;r-l.offsetTop+ki+s.offsetHeight>=l.offsetHeight?s.classList.add("slide-up"):s.classList.remove("slide-up")}s.classList.add("active")}else s.classList.remove("active")},xe=new WeakSet,kt=function(e){const t=a(this,R).querySelector(".ui-drop-list");t.replaceChildren();const s=this.multiselect,n=a(this,Y);s&&t.appendChild(p("li",null,ne({label:W("allItem","( All )"),checked:n,customerAttributes:{isall:"1"},onchange:f=>y(this,Oe,_t).call(this,f.target)})));const l=a(this,I).valuekey,i=a(this,I).textkey,r=a(this,I).htmlkey,o=this.selected,c=this.selectedlist;let u;e.slice(0,200).forEach((f,b)=>{const h=f[l],m=p("li");m.dataset.value=h,m.setAttribute("title",f[i]);let k;const E=f[r];if(E instanceof HTMLElement&&(k=E),s){const _=c.some(S=>S[l]===h);k==null&&(k=p("span"),k.innerText=f[i]);const T=ne({label:k,checked:n||_,customerAttributes:{class:"dataitem","data-value":h},onchange:S=>y(this,Oe,_t).call(this,S.target)});m.appendChild(T)}else k==null?m.innerText=f[i]:m.appendChild(k),o!=null&&o[l]===h&&(u=Ci*b,m.classList.add("selected"));t.appendChild(m)}),u!=null&&setTimeout(()=>t.scrollTop=u,10)},Oe=new WeakSet,_t=function(e){let t;const s=a(this,I).valuekey,n=a(this,I).textkey,l=a(this,I).htmlkey;if(e.getAttribute("isall")==="1"){const i=x(this,Y,e.checked);a(this,R).querySelectorAll("input.dataitem").forEach(o=>o.checked=i),t=[]}else if(e.checked)if(a(this,R).querySelectorAll("input.dataitem:not(:checked)").length===0)x(this,Y,!0),a(this,R).querySelector('input[isall="1"]').checked=!0,t=[];else{const i=this.source;t=[...a(this,R).querySelectorAll("input.dataitem:checked")].map(r=>i.find(o=>o[s]===r.dataset.value)).filter(r=>r!=null)}else{const i=e.dataset.value;a(this,Y)?(x(this,Y,!1),a(this,R).querySelector('input[isall="1"]').checked=!1,t=this.source.filter(r=>r[s]!==i)):t=this.selectedlist.filter(r=>r[s]!==i)}a(this,Y)?a(this,O).innerText=W("allItem","( All )"):Xt(a(this,O),t,l,n),x(this,ae,t),typeof this.onselectedlist=="function"&&this.onselectedlist(itemlist)};const Mi="";class te{static create(){return p("span")}static setValue(e,t){e.innerText=t}static setStyle(e,t){for(let s of Object.entries(t))e.style.setProperty(s[0],s[1])}static setEnabled(e,t){const s=e.querySelector(".ui-tooltip-wrapper");s!=null&&(s.style.display=t===!1?"none":"")}}class Yt extends te{static get editing(){return!0}static createEdit(e,t,s,n){const l=p("input");return l.setAttribute("type","text"),typeof e=="function"&&l.addEventListener("change",e),l.addEventListener("input",()=>{n.__editing==null?n.__editing={[t.key]:!0}:n.__editing[t.key]=!0}),l}static setValue(e,t){e.tagName!=="INPUT"?super.setValue(e,t):e.value=t}static getValue(e){return e.target.value}static setEnabled(e,t){super.setEnabled(e,t),e.disabled=t===!1}}class Li extends Yt{static createEdit(e,t,s,n){const l=p("textarea");return typeof e=="function"&&l.addEventListener("change",e),l.addEventListener("input",()=>{n.__editing==null?n.__editing={[t.key]:!0}:n.__editing[t.key]=!0}),l}static setValue(e,t,s,n,l){if(e.tagName!=="TEXTAREA")super.setValue(e,t);else if(e.value=t,t!=null){const i=String(t).split(` +`).length;e.style.height=`${i*l.lineHeight+12}px`}}}const Ei=Symbol.for("ui-dropdown"),It=class extends te{static createEdit(e,t,s){const n=new tt({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=y(this,Pe,Rt).call(this,s,n);i instanceof Promise?i.then(r=>y(this,Ve,Ht).call(this,r,e,t)):y(this,Ve,Ht).call(this,i,e,t);return}const l=y(this,$e,zt).call(this,e);if(l!=null){if(l.source==null||l.source.length===0){let i=y(this,Pe,Rt).call(this,s,n);if(i instanceof Promise){i.then(r=>{l.source=r,l.select(t,!0)});return}else i!=null&&(l.source=i)}l.select(t,!0)}}static getValue(e){return e.value}static setEnabled(e,t){super.setEnabled(e,t);const s=y(this,$e,zt).call(this,e);s!=null&&(s.disabled=t===!1)}};let me=It;$e=new WeakSet,zt=function(e){const t=le[Ei];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},Pe=new WeakSet,Rt=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},Ve=new WeakSet,Ht=function(e,t,s){const n=e==null?void 0:e.find(l=>l.value===s);n!=null&&(s=n.text),ei(It,this,"setValue").call(this,t,s)},g(me,$e),g(me,Pe),g(me,Ve);class St extends te{static createEdit(e){return ne({onchange:typeof e=="function"?e:null})}static setValue(e,t){e.querySelector("input").checked=t}static getValue(e){return e.target.checked}static setEnabled(e,t){super.setEnabled(e,t),e.querySelector("input").disabled=t===!1}}class Ti extends te{static create(){return p("span","col-icon")}static setValue(e,t,s,n,l){let i=n.className;typeof i=="function"&&(i=i.call(n,s)),i==null?e.className="col-icon":e.className=`col-icon ${i}`;let r=n.iconType;if(typeof r=="function"&&(r=r.call(n,s)),r??(r="fa-regular"),e.dataset.type!==r||e.dataset.icon!==t){const o=P(r,t);e.replaceChildren(o),e.dataset.type=r,e.dataset.icon=t}}static setEnabled(e,t){super.setEnabled(e,t),t===!1?e.classList.add("disabled"):e.classList.remove("disabled")}}const it={Reorder:"reorder",Resize:"resize",Sort:"sort"},st=xi()?32:0,Si=200,Kt=4,Ut=4,_e=50,Gt=200;function nt(d){var t;return d==null?null:(d.touches&&((t=d.touches[0])==null?void 0:t.clientX))??d.clientX}function Ni(d){let e=0;for(;d!=null;)e+=d.offsetLeft,d=d.offsetParent;return e}function ze(d){return Array.prototype.indexOf.call(d.parentElement.children,d)}const Ii={0:te,1:Yt,2:me,3:St,4:Ti,5:Li},Ke=class{constructor(e){g(this,Te);g(this,ot);g(this,at);g(this,ct);g(this,dt);g(this,fe);g(this,ut);g(this,ht);g(this,Me);g(this,$);g(this,se);g(this,pe);g(this,We);g(this,De);g(this,Fe);g(this,ye);g(this,ft);g(this,je);g(this,Be);g(this,pt);g(this,yt);g(this,gt);g(this,mt);g(this,bt);g(this,vt);g(this,xt);g(this,Xe);g(this,Ye);g(this,Se);g(this,F,void 0);g(this,H,void 0);g(this,we,void 0);g(this,V,void 0);g(this,v,void 0);g(this,ke,void 0);g(this,Ce,-1);g(this,M,void 0);g(this,K,0);g(this,de,void 0);g(this,ue,void 0);g(this,ie,void 0);g(this,Z,-1);g(this,Le,void 0);g(this,he,void 0);g(this,Ee,{});g(this,A,{});g(this,At,[]);C(this,"columns",[]);C(this,"langs",{all:W("allItem","( All )"),ok:W("ok","OK"),reset:W("reset","Reset")});C(this,"virtualCount",100);C(this,"rowHeight",36);C(this,"lineHeight",24);C(this,"extraRows",0);C(this,"filterRowHeight",30);C(this,"height");C(this,"readonly");C(this,"multiSelect",!1);C(this,"fullrowClick",!0);C(this,"allowHtml",!1);C(this,"holderDisabled",!1);C(this,"headerVisible",!0);C(this,"window",le);C(this,"sortIndex",-1);C(this,"sortDirection",1);C(this,"willSelect");C(this,"selectedRowChanged");C(this,"cellDblClicked");C(this,"cellClicked");C(this,"rowDblClicked");C(this,"columnChanged");x(this,we,e)}get element(){return a(this,V)}get source(){var e;return(e=a(this,F))==null?void 0:e.map(t=>t.values)}set source(e){if(a(this,V)==null)throw new Error("grid has not been initialized.");if(!Array.isArray(e))throw new Error("source is not an Array.");e=e.map(t=>({values:t})),x(this,F,e),y(this,Te,Ct).call(this,e)}get virtual(){var e;return((e=a(this,H))==null?void 0:e.length)>this.virtualCount}get sortKey(){var e;return this.columns==null?null:(e=this.columns[this.sortIndex])==null?void 0:e.key}get selectedIndexes(){return a(this,M)}set selectedIndexes(e){const t=a(this,K);a(this,M).splice(0,a(this,M).length,...e),this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((s,n)=>{e.indexOf(t+n)>=0?s.classList.add("selected"):s.classList.contains("selected")&&s.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged()}get selectedIndex(){return(a(this,M)&&a(this,M)[0])??-1}get loading(){var e,t;return((t=(e=a(this,v).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){a(this,v).loading!=null&&(e===!1?(a(this,v).loading.style.visibility="hidden",a(this,v).loading.style.opacity=0):(a(this,v).loading.style.visibility="visible",a(this,v).loading.style.opacity=1))}get scrollTop(){var e;return(e=a(this,v).body)==null?void 0:e.scrollTop}set scrollTop(e){a(this,v).body!=null&&(a(this,v).body.scrollTop=e,this.reload())}init(e=a(this,we)){if(x(this,V,null),x(this,v,{}),x(this,ke,!0),!(e instanceof HTMLElement))throw new Error("no specified parent.");x(this,we,e);const t=p("div","ui-grid");t.setAttribute("tabindex",0),t.addEventListener("keydown",r=>{var u;let o=this.selectedIndex,c=!1;if(r.key==="ArrowUp")o>0&&(c=!0,o-=1);else if(r.key==="ArrowDown"){const f=((u=a(this,H))==null?void 0:u.length)??0;o<f-1&&(c=!0,o+=1)}c&&(x(this,M,[o]),this.scrollToIndex(o),this.refresh(),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged(o),r.stopPropagation())}),e.replaceChildren(t);const s=p("span","ui-grid-sizer");t.appendChild(s),a(this,v).sizer=s;const n=y(this,ot,ti).call(this);t.appendChild(n);const l=y(this,at,ii).call(this);t.appendChild(l);const i=p("div","ui-grid-loading",p("div",null,P("fa-regular","spinner-third")));a(this,v).loading=i,t.appendChild(i),x(this,V,t),x(this,ke,!1),a(this,F)!=null&&this.sortIndex>=0&&this.sortColumn()}scrollToIndex(e){const t=y(this,Me,Ot).call(this,e*(this.rowHeight+1),!0);a(this,v).body.scrollTop=t}resize(e){if(a(this,ke)||a(this,V)==null)return;const t=a(this,v).body,s=this.headerVisible===!1?0:a(this,v).header.offsetHeight;let n=this.height;n===0?n=a(this,ue):(isNaN(n)||n<0)&&(n=a(this,V).offsetHeight-s);const l=wi((n-1)/(this.rowHeight+1))+Kt*2+1;(e||l!==a(this,Z))&&(x(this,Z,l),this.reload()),x(this,ie,t.clientWidth)}reload(){let e=a(this,H).length;this.extraRows>0&&(e+=this.extraRows),x(this,ue,e*(this.rowHeight+1)),a(this,v).body.scrollTop=0,a(this,v).body.scrollLeft=0,a(this,v).bodyContent.style.top="0px",a(this,v).bodyContainer.style.height=`${a(this,ue)}px`,y(this,ct,si).call(this,a(this,v).bodyContent),this.refresh()}refresh(){if(a(this,v).bodyContent==null)throw new Error("body has not been created.");const e=a(this,v).bodyContent.children,t={};y(this,dt,ni).call(this,e,this.columns,t),a(this,de)&&t.flag&&(x(this,de,!1),this.columns.forEach((s,n)=>{if(!y(this,$,X).call(this,s.key,"autoResize"))return;let l=t[n];l<s.width&&(l=s.width),l>0&&y(this,fe,Ge).call(this,n,l)}))}resetChange(){if(a(this,F)!=null)for(let e of a(this,F))delete e.__changed}sortColumn(e){const t=this.sortIndex,s=this.columns[t];if(s==null)return;const n=this.sortDirection;[...a(this,v).header.children].forEach((i,r)=>{const o=i.querySelector(".arrow");o!=null&&(r===t?o.className=`arrow ${n!==1?"desc":"asc"}`:o.className!=="arrow"&&(o.className="arrow"))});let l;if(typeof s.sortFilter!="function"){const i=this.sortDirection;isNaN(i)&&(i=1),l=(r,o)=>{if(r=y(this,pe,Ze).call(this,r.values,s.key,s.filter),o=y(this,pe,Ze).call(this,o.values,s.key,s.filter),r==null&&typeof o=="number")r=0;else if(typeof r=="number"&&o==null)o=0;else{if(r!=null&&o==null)return i;typeof r=="string"&&typeof o=="string"&&(r=r.toLowerCase(),o=o.toLowerCase())}return r===o?0:(r>o?1:-1)*i}}else l=(i,r)=>s.sortFilter(i.values,r.values)*n;a(this,F).sort(l),a(this,A).__filtered===!0&&a(this,H).sort(l),!(a(this,Z)<0)&&(e?this.reload():this.refresh())}};let Re=Ke;F=new WeakMap,H=new WeakMap,we=new WeakMap,V=new WeakMap,v=new WeakMap,ke=new WeakMap,Ce=new WeakMap,M=new WeakMap,K=new WeakMap,de=new WeakMap,ue=new WeakMap,ie=new WeakMap,Z=new WeakMap,Le=new WeakMap,he=new WeakMap,Ee=new WeakMap,A=new WeakMap,At=new WeakMap,Te=new WeakSet,Ct=function(e){e??(e=a(this,F)),a(this,A).__filtered===!0?x(this,H,e.filter(t=>{for(let s of this.columns)if(Array.isArray(s.filterValues)){const n=y(this,pe,Ze).call(this,t.values,s.key,s.filter);if(s.filterValues.indexOf(n)<0)return!1}return!0})):x(this,H,e),x(this,Ce,-1),x(this,M,[]),x(this,K,0),x(this,Le,0),x(this,he,0),x(this,Z,-1),this.sortIndex>=0&&this.sortColumn(),this.resize()},ot=new WeakSet,ti=function(){const e=p("table","ui-grid-header");this.headerVisible===!1&&(e.style.display="none");const t=p("tr");e.appendChild(t);const s=a(this,v).sizer;for(let i of this.columns){if(i.visible===!1){const h=p("th");h.style.display="none",i.sortable!==!1&&(h.dataset.key=i.key,h.addEventListener("click",m=>y(this,Fe,Vt).call(this,m,i,!0))),t.appendChild(h);continue}const r=Ke.ColumnTypes.isCheckbox(i.type);if(!(i.width>0)){y(this,se,Ne).call(this,i.key,"autoResize",!0),x(this,de,!0),s.innerText=i.caption??"";let h=s.offsetWidth+22;!this.readonly&&i.enabled!==!1&&i.allcheck&&r&&(h+=32),i.allowFilter===!0&&(h+=14),h<_e&&(h=_e),i.width=h}i.align??(i.align=r?"center":"left"),i.sortable!==!1&&(i.sortable=!0);const o=`${i.width}px`,c={width:o,"max-width":o,"min-width":o,"text-align":i.align};y(this,se,Ne).call(this,i.key,"style",c);const u=p("th","column");u.dataset.key=i.key;for(let h of Object.entries(c))u.style.setProperty(h[0],h[1]);i.sortable&&(u.style.cursor="pointer",u.addEventListener("click",h=>y(this,Fe,Vt).call(this,h,i))),i.orderable!==!1&&(i.orderable=!0,u.addEventListener("mousedown",h=>y(this,yt,ci).call(this,h,i)));const f=p("div");if(u.appendChild(f),!this.readonly&&i.enabled!==!1&&i.allcheck&&r){const h=ne({onchange:m=>y(this,bt,hi).call(this,i,m.target.checked)});f.appendChild(h)}const b=p("span");if(i.textStyle!=null)for(let h of Object.entries(i.textStyle))b.style.setProperty(h[0],h[1]);if(b.innerText=i.caption??"",f.appendChild(b),i.sortable&&u.appendChild(p("layer","arrow")),i.allowFilter===!0){const h=p("layer","filter");h.appendChild(P("fa-solid","filter")),h.addEventListener("mousedown",m=>y(this,ft,oi).call(this,m,i)),u.classList.add("header-filter"),u.appendChild(h)}if(i.resizable!==!1){const h=p("layer","spliter");h.addEventListener("mousedown",m=>y(this,gt,di).call(this,m,i)),h.addEventListener("dblclick",m=>y(this,mt,ui).call(this,m,i)),u.appendChild(h)}t.appendChild(u)}const n=p("div","dragger"),l=p("layer","dragger-cursor");return t.appendChild(p("th",null,n,l)),s.replaceChildren(),a(this,v).header=t,a(this,v).dragger=n,a(this,v).draggerCursor=l,e},at=new WeakSet,ii=function(){const e=p("div","ui-grid-body");e.addEventListener("scroll",i=>qe(y(this,vt,fi),st,this,i),{passive:!0});const t=this.columns;let s=1;for(let i of t)i.visible!==!1&&!isNaN(i.width)&&(s+=i.width+1);const n=p("div");n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="1px",s>0&&(n.style.width=`${s}px`),e.appendChild(n);const l=p("table","ui-grid-body-content");if(l.addEventListener("mousedown",i=>{let[r,o]=y(this,We,$t).call(this,i.target);const c=ze(r);let u=ze(o);u>=this.columns.length&&(u=-1),y(this,Xe,Dt).call(this,i,c,u)}),l.addEventListener("dblclick",i=>y(this,Ye,Ft).call(this,i)),n.appendChild(l),!this.holderDisabled){const i=p("div","ui-grid-hover-holder");i.addEventListener("mousedown",r=>{const o=r.currentTarget,c=Number(o.dataset.row),u=Number(o.dataset.col);return o.classList.contains("active")&&o.classList.remove("active"),y(this,Xe,Dt).call(this,r,c+a(this,K),u)}),i.addEventListener("dblclick",r=>y(this,Ye,Ft).call(this,r)),n.appendChild(i),e.addEventListener("mousemove",r=>qe(y(this,xt,pi),Si,this,r,i),{passive:!0})}return a(this,v).body=e,a(this,v).bodyContainer=n,a(this,v).bodyContent=l,e},ct=new WeakSet,si=function(){let e=a(this,Z);(isNaN(e)||e<0||!this.virtual)&&(e=a(this,H).length);const t=this.columns,s=a(this,v).bodyContent,n=s.children.length;if(e-=n,e>0)for(let l=0;l<e;l+=1){const i=p("tr","ui-grid-row");t.forEach((r,o)=>{const c=p("td");if(r.visible!==!1){c.dataset.row=String(n+l),c.dataset.col=String(o);const u=y(this,$,X).call(this,r.key,"style");if(u!=null)for(let f of Object.entries(u))c.style.setProperty(f[0],f[1]);if(r.css!=null)for(let f of Object.entries(r.css))c.style.setProperty(f[0],f[1]);if(Ke.ColumnTypes.isCheckbox(r.type))c.appendChild(St.createEdit(f=>y(this,Se,Lt).call(this,f,n+l,r,f.target.checked,c)));else{let f=a(this,Ee)[r.key];f==null&&(isNaN(r.type)?this.allowHtml&&r.type!=null&&(f=r.type):f=Ii[r.type],f??(f=te),a(this,Ee)[r.key]=f),c.appendChild(f.create(r))}}i.appendChild(c)}),i.appendChild(p("td")),s.appendChild(i)}else if(e<0)for(let l=-1;l>=e;l-=1)s.children[n+l].remove()},dt=new WeakSet,ni=function(e,t,s){const n=a(this,K),l=a(this,M);[...e].forEach((i,r)=>{const o=a(this,H)[n+r];if(o==null||!Ae(i.children.length))return;const c=o.values,u=l.indexOf(n+r)>=0;u?i.classList.add("selected"):i.classList.contains("selected")&&i.classList.remove("selected");const f=o.__selected^u;u?o.__selected=!0:delete o.__selected,t.forEach((b,h)=>{var ge,Jt;if(b.visible===!1)return;let m;b.text!=null?m=b.text:typeof b.filter=="function"?m=b.filter(c):(m=c[b.key],(m==null?void 0:m.displayValue)!=null&&(m=m.displayValue)),m??(m="");const k=i.children[h];if(typeof b.bgFilter=="function"){const q=b.bgFilter(c);k.style.backgroundColor=q??""}const E=Ke.ColumnTypes.isCheckbox(b.type),_=E?St:a(this,Ee)[b.key]??te;let T;!E&&f&&typeof _.createEdit=="function"?((ge=o.__editing)!=null&&ge[b.key]&&_.editing&&(m=_.getValue({target:k.children[0]}),y(this,Se,Lt).call(this,null,n+r,b,m,k,!0)),T=u?_.createEdit(q=>y(this,Se,Lt).call(this,q,n+r,b,_.getValue(q),k),b,a(this,v).bodyContent,o):_.create(b),k.replaceChildren(T)):T=k.children[0];let S;this.readonly?S=!1:(S=b.enabled,typeof S=="function"?S=S.call(b,c):typeof S=="string"&&(S=c[S])),_.setValue(T,m,c,b,this);let G=b.tooltip;if(typeof G=="function"&&(G=G.call(b,c)),ee(G)?(Jt=T.querySelector(".ui-tooltip-wrapper"))==null||Jt.remove():et(T,G,!1,this.element),typeof _.setEnabled=="function"&&_.setEnabled(T,S),a(this,de)&&y(this,$,X).call(this,b.key,"autoResize")){const q=T.scrollWidth+12;q>0&&s!=null&&(isNaN(s[h])||s[h]<q)&&(s[h]=q,s.flag=!0)}if(typeof b.styleFilter=="function"){const q=b.styleFilter(c);q!=null&&_.setStyle(T,q)}if(b.events!=null)for(let q of Object.entries(b.events))T[q[0]]=q[1].bind(c);if(b.attrs!=null){let q=b.attrs;typeof q=="function"&&(q=q(c));for(let Qt of Object.entries(q))T.setAttribute(Qt[0],Qt[1])}}),o.__editing!=null&&delete o.__editing})},fe=new WeakSet,Ge=function(e,t){const s=this.columns[e],n=`${t}px`;s.width=t;const l=y(this,$,X).call(this,s.key,"style");l.width=n,l["max-width"]=n,l["min-width"]=n;let i=a(this,v).header.children[e];i.style.width=n,i.style.maxWidth=n,i.style.minWidth=n;const r=a(this,v).bodyContent;for(let o of r.children)i=o.children[e],i!=null&&(i.style.width=n,i.style.maxWidth=n,i.style.minWidth=n)},ut=new WeakSet,li=function(e,t,s,n){const l=a(this,v).header.children;let i=l[e];a(this,v).dragger.style.left=`${i.offsetLeft-n+t}px`,a(this,v).dragger.style.width=i.style.width,a(this,v).dragger.style.display="block",t=s-Ni(i);let r;if(t<0){t=-t;for(let o=e-1;o>=0&&t>=0&&(i=l[o],!(i==null||i.className!=="column"));o-=1){if(t<i.offsetWidth){r=t>i.offsetWidth/2?o:o+1;break}t-=i.offsetWidth}r??(r=0)}else{const o=l.length;for(let c=e;c<o-1&&t>=0;c+=1){if(i=l[c],i==null||i.className!=="column"){r=c;break}if(t<i.offsetWidth){r=t>i.offsetWidth/2?c+1:c;break}t-=i.offsetWidth}r??(r=o-1)}if(r!==a(this,A).__orderIndex){if(a(this,A).__orderIndex=r,i=l[r],i==null)return;a(this,v).draggerCursor.style.left=`${i.offsetLeft-n}px`,a(this,v).draggerCursor.style.display="block"}},ht=new WeakSet,ri=function(e){a(this,v).dragger.style.display="",a(this,v).draggerCursor.style.display="";const t=a(this,A).__orderIndex;if(t>=0&&t!==e){let s=t-e;if(s>=0&&s<=1)return;const n=a(this,v).header,l=n.children,i=a(this,v).bodyContent.children,r=this.columns;if(s>1){s=t-1;const o=r.splice(e,1)[0];r.splice(s,0,o),n.insertBefore(l[e],l[s].nextElementSibling);for(let c of i)c.insertBefore(c.children[e],c.children[s].nextElementSibling)}else{s=t;const o=r.splice(e,1)[0];r.splice(s,0,o),n.insertBefore(l[e],l[s]);for(let c of i)c.insertBefore(c.children[e],c.children[s])}[...l].forEach((o,c)=>{const u=o.querySelector(".arrow");u!=null&&u.className!=="arrow"&&(this.sortIndex=c)}),typeof this.columnChanged=="function"&&this.columnChanged(it.Reorder,e,s)}},Me=new WeakSet,Ot=function(e,t){const s=this.rowHeight+1;if(e-=e%(s*2)+Kt*s,e<0)e=0;else{let n=a(this,ue)-(t?0:a(this,Z)*s);n<0&&(n=0),e>n&&(e=n)}return a(this,Le)!==e?(x(this,Le,e),this.virtual&&x(this,K,e/s),this.refresh(),this.virtual&&(a(this,v).bodyContent.style.top=`${e}px`)):t&&this.refresh(),e},$=new WeakSet,X=function(e,t){const s=a(this,A)[e];return s==null?null:s[t]},se=new WeakSet,Ne=function(e,t,s){const n=a(this,A)[e];n==null?a(this,A)[e]={[t]:s}:n[t]=s},pe=new WeakSet,Ze=function(e,t,s){let n;return typeof s=="function"?n=s(e):n=e[t],(n==null?void 0:n.value)??n},We=new WeakSet,$t=function(e){let t;for(;(t=e.parentElement)!=null&&!t.classList.contains("ui-grid-row");)e=t;return[t,e]},De=new WeakSet,Pt=function(e){return/^(input|label|layer|svg|use)$/i.test(e)},Fe=new WeakSet,Vt=function(e,t,s){if(!(!s&&(y(this,$,X).call(this,t.key,"resizing")||y(this,$,X).call(this,t.key,"dragging")))&&!y(this,De,Pt).call(this,e.target.tagName)){const n=this.columns.indexOf(t);if(n<0)return;this.sortIndex===n?this.sortDirection=this.sortDirection===1?-1:1:this.sortIndex=n,this.sortColumn(!0),typeof this.columnChanged=="function"&&this.columnChanged(it.Sort,n,this.sortDirection)}},ye=new WeakSet,Je=function(){const e=a(this,V).querySelectorAll(".filter-panel.active");if(e.length>0){e.forEach(s=>s.classList.remove("active")),setTimeout(()=>a(this,V).querySelectorAll(".filter-panel").forEach(s=>s.remove()),120);const t=a(this,A).__filtering;return t instanceof HTMLElement&&t.classList.remove("hover"),delete a(this,A).__filtering,!0}return!1},ft=new WeakSet,oi=function(e,t){if(y(this,ye,Je).call(this))return;const s=h=>{h.target.tagName==="LAYER"&&h.target.classList.contains("filter")||h.target.tagName==="use"||y(this,ye,Je).call(this)&&document.removeEventListener("mousedown",s)};document.addEventListener("mousedown",s);const n=p("div","filter-panel");n.addEventListener("mousedown",h=>h.stopPropagation());const l=e.currentTarget,i=l.parentElement,r=i.offsetWidth;n.style.top=`${i.offsetHeight}px`,n.style.left=i.offsetLeft+(r>Gt?r-Gt:0)+"px";let o;if(t.allowSearch!==!1){const h=p("div","filter-search-holder");o=p("input","filter-search-box ui-text"),o.type="text";const m=P("fa-regular","search");m.addEventListener("mousedown",k=>{o.focus(),k.preventDefault()}),h.append(o,m),n.append(h)}const c=p("div","filter-item-list");c.addEventListener("scroll",h=>qe(y(this,pt,ai),st,this,t,c,h.target.scrollTop),{passive:!0});const u=p("div","filter-item filter-all");u.appendChild(ne({label:this.langs.all,onchange:h=>{const m=h.target.checked;c.querySelectorAll(".filter-content input").forEach(k=>k.checked=m)}})),c.appendChild(u);let f;if(Array.isArray(t.filterSource))f=t.filterSource;else if(typeof t.filterSource=="function")f=t.filterSource.call(this,t);else{const h=Object.create(null);for(let m of a(this,F)){const k=y(this,pe,Ze).call(this,m.values,t.key,t.filter);if(!Object.hasOwnProperty.call(h,k)){const E=m.values[t.key];h[k]={value:k,displayValue:typeof t.filter=="function"?t.filter(m.values):(E==null?void 0:E.displayValue)??E}}}f=Object.values(h).sort((m,k)=>(m=(m==null?void 0:m.value)??m,k=(k==null?void 0:k.value)??k,m>k?1:m<k?-1:0))}f=f.map(h=>Object.prototype.hasOwnProperty.call(h,"value")&&Object.prototype.hasOwnProperty.call(h,"displayValue")?h:{value:h,displayValue:h??""}),y(this,je,Mt).call(this,t,c,f,u),u.querySelector("input").checked=![...c.querySelectorAll(".filter-content input")].some(h=>!h.checked),n.appendChild(c),o!=null&&o.addEventListener("input",h=>{const m=h.currentTarget.value.toLowerCase(),k=m.length===0?f:f.filter(E=>{const _=(E==null?void 0:E.displayValue)??E;return String(_??"").indexOf(m)>=0});y(this,je,Mt).call(this,t,c,k,u)});const b=p("div","filter-function");b.append(p("button",h=>{h.innerText=this.langs.ok,h.addEventListener("click",()=>{const m=y(this,$,X).call(this,t.key,"filterSource").filter(k=>k.__checked!==!1);typeof t.onFilterOk=="function"?t.onFilterOk.call(this,t,m):t.filterValues=m.map(k=>k.value),a(this,A).__filtered=!0,y(this,Te,Ct).call(this),typeof t.onFiltered=="function"&&t.onFiltered.call(this,t),l.classList.add("active"),y(this,ye,Je).call(this)})}),p("button",h=>{h.innerText=this.langs.reset,h.addEventListener("click",()=>{delete t.filterValues,a(this,A).__filtered=this.columns.some(m=>t.filterValues!=null),y(this,Te,Ct).call(this),typeof t.onFiltered=="function"&&t.onFiltered.call(this,t),l.classList.remove("active"),y(this,ye,Je).call(this)})})),n.appendChild(b),a(this,V).appendChild(n),setTimeout(()=>n.classList.add("active"),0),a(this,A).__filtering=l,l.classList.add("hover")},je=new WeakSet,Mt=function(e,t,s,n){var c,u;(c=t.querySelector(".filter-holder"))==null||c.remove(),(u=t.querySelector(".filter-content"))==null||u.remove();const l=this.filterRowHeight,i=s.length*l;y(this,se,Ne).call(this,e.key,"filterHeight",i);const r=p("div","filter-holder");r.style.height=`${i}px`;const o=p("div","filter-content");o.style.top=`${l}px`,y(this,se,Ne).call(this,e.key,"filterSource",s);for(let f of s)f.__checked=!Array.isArray(e.filterValues)||e.filterValues.indexOf(f.value??f)>=0;s.length>12&&(s=s.slice(0,12)),y(this,Be,Wt).call(this,o,s,n),t.append(r,o)},Be=new WeakSet,Wt=function(e,t,s){for(let n of t){const l=p("div","filter-item");l.appendChild(ne({checked:n.__checked,label:(n==null?void 0:n.displayValue)??n,onchange:i=>{n.__checked=i.target.checked,s.querySelector("input").checked=![...e.querySelectorAll("input")].some(r=>!r.checked)}})),e.appendChild(l)}},pt=new WeakSet,ai=function(e,t,s){const n=this.filterRowHeight;if(s-=s%(n*2)+n,s<0)s=0;else{let l=y(this,$,X).call(this,e.key,"filterHeight")-12*n;l<0&&(l=0),s>l&&(s=l)}if(y(this,$,X).call(this,e.key,"filterTop")!==s){y(this,se,Ne).call(this,e.key,"filterTop",s);const l=s/n;let i=y(this,$,X).call(this,e.key,"filterSource");l+12<i.length?i=i.slice(l,l+12):i=i.slice(-12);const r=t.querySelector(".filter-content");r.replaceChildren(),y(this,Be,Wt).call(this,r,i,t.querySelector(".filter-all>input")),r.style.top=`${s+n}px`}},yt=new WeakSet,ci=function(e,t){if(y(this,De,Pt).call(this,e.target.tagName))return;const s=nt(e),n=ze(e.currentTarget),l=c=>{for(let u of["mousemove","mouseup"])c.hasOwnProperty(u)&&(window.removeEventListener(u,c[u]),delete c[u])};let i=a(this,A)[t.key];i==null?i=a(this,A)[t.key]={}:l(i),i.dragging=!0;const r=a(this,v).header.querySelector("th:last-child").offsetLeft,o=c=>{const u=nt(c),f=u-s;let b=i.offset,h;(b==null&&(f>Ut||f<-Ut)||b!==f)&&(h=!0),h&&(y(this,ut,li).call(this,n,f,u,r),i.offset=f)};i.mousemove=c=>qe(o,st,this,c),i.mouseup=()=>{l(i),i.offset==null?delete i.dragging:(setTimeout(()=>{delete i.dragging,delete i.offset}),y(this,ht,ri).call(this,n))},["mousemove","mouseup"].forEach(c=>window.addEventListener(c,i[c]))},gt=new WeakSet,di=function(e,t){const s=nt(e),n=t.width,l=ze(e.currentTarget.parentElement),i=this.window??le,r=u=>{for(let f of["mousemove","mouseup"])u.hasOwnProperty(f)&&(i.removeEventListener(f,u[f]),delete u[f])};let o=a(this,A)[t.key];o==null?o=a(this,A)[t.key]={}:r(o),o.resizing=n;const c=u=>{const f=nt(u),b=n+(f-s);b<_e||(o.resizing=b,o.sizing=!0,y(this,fe,Ge).call(this,l,b))};o.mousemove=u=>qe(c,st,this,u),o.mouseup=u=>{r(o);const f=o.resizing;f!=null&&(setTimeout(()=>delete o.resizing),o.sizing&&(delete o.sizing,delete o.autoResize,y(this,fe,Ge).call(this,l,f),typeof this.columnChanged=="function"&&this.columnChanged(it.Resize,l,f))),u.stopPropagation(),u.preventDefault()},["mousemove","mouseup"].forEach(u=>i.addEventListener(u,o[u]))},mt=new WeakSet,ui=function(e,t){const s=e.currentTarget.parentElement,n=ze(s);let l=s.querySelector("div:first-child").scrollWidth;for(let i of a(this,v).bodyContent.children){const o=i.children[n].children[0].scrollWidth;o>l&&(l=o)}l<_e&&(l=_e),l>0&&l!==t.width&&(l+=12,y(this,fe,Ge).call(this,n,l),typeof this.columnChanged=="function"&&this.columnChanged(it.Resize,n,l))},bt=new WeakSet,hi=function(e,t){if(a(this,H)==null)return;const s=e.key,n=typeof e.enabled=="function",l=typeof e.enabled=="string";if(typeof e.onallchecked=="function")e.onallchecked.call(this,e,t);else{for(let i of a(this,H)){const r=i.values;if(r==null)continue;(n?e.enabled(r):l?r[e.enabled]:e.enabled)!==!1&&(r[s]=t,i.__changed=!0,typeof e.onchanged=="function"&&e.onchanged.call(this,r,t))}this.refresh()}},vt=new WeakSet,fi=function(e){const t=e.target.scrollLeft;if(a(this,he)!==t&&(x(this,he,t),a(this,v).header.style.left=`${-t}px`),!this.virtual)return;const s=e.target.scrollTop;y(this,Me,Ot).call(this,s)},xt=new WeakSet,pi=function(e,t){if(e.target.classList.contains("ui-grid-hover-holder"))return;let[s,n]=y(this,We,$t).call(this,e.target);if(s==null){delete t.dataset.row,delete t.dataset.col,t.classList.contains("active")&&t.classList.remove("active");return}const l=n.children[0];if((l==null?void 0:l.tagName)!=="SPAN"){t.classList.contains("active")&&(delete t.dataset.row,delete t.dataset.col,t.classList.remove("active"));return}const i=n.dataset.row,r=n.dataset.col;if(!(t.dataset.row===i&&t.dataset.col===r))if(l.scrollWidth>l.offsetWidth){t.dataset.row=i,t.dataset.col=r,t.innerText=l.innerText;const o=a(this,v).bodyContent.offsetTop+n.offsetTop;let c=n.offsetLeft,u=t.offsetWidth;u>a(this,ie)&&(u=a(this,ie));const f=a(this,ie)+a(this,he)-u;c>f&&(c=f);const b=n.offsetHeight;t.style.cssText=`top: ${o}px; left: ${c}px; max-width: ${a(this,ie)}px; height: ${b-2}px`,t.classList.add("active")}else t.classList.contains("active")&&(delete t.dataset.row,delete t.dataset.col,t.classList.remove("active"))},Xe=new WeakSet,Dt=function(e,t,s){const n=a(this,K),l=n+t;if(typeof this.willSelect=="function"&&!this.willSelect(l,s))return;let i=!1;const r=a(this,M);if(this.multiSelect){if(e.ctrlKey){const o=r.indexOf(l);o<0?r.push(l):r.splice(o,1),i=!0}else if(e.shiftKey&&r.length>0&&(r.length>1||r[0]!==l)){let o=r[r.length-1],c;o>l?(c=o,o=l):c=l,r.splice(0);for(let u=o;u<=c;u+=1)r.push(u);i=!0}}(!i&&r.length!==1||r[0]!==l)&&(r.splice(0,r.length,l),i=!0),i&&(this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((o,c)=>{r.indexOf(n+c)>=0?o.classList.add("selected"):o.classList.contains("selected")&&o.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged(l)),x(this,Ce,s),(this.fullrowClick||s>=0)&&e.buttons===1&&typeof this.cellClicked=="function"&&this.cellClicked(l,s)===!1&&(e.stopPropagation(),e.preventDefault())},Ye=new WeakSet,Ft=function(e){if(e.target.tagName==="INPUT"||e.target.tagName==="TEXTAREA"||e.target.tagName==="LAYER"&&e.target.className==="ui-check-inner"||e.target.tagName==="LABEL"&&(e.target.className==="ui-drop-text"||e.target.className==="ui-drop-caret"))return;const t=this.selectedIndex;if(typeof this.rowDblClicked=="function"&&this.rowDblClicked(t),typeof this.cellDblClicked=="function"){const s=a(this,Ce);(this.fullrowClick||s>=0)&&this.cellDblClicked(t,s)}},Se=new WeakSet,Lt=function(e,t,s,n,l,i){var u;if(a(this,H)==null)return;const r=a(this,H)[a(this,K)+t],o=r.values;if(o==null)return;let c=s.enabled;if(typeof c=="function"?c=c.call(s,o):typeof c=="string"&&(c=o[c]),c!==!1){o[s.key]=n;let f=s.tooltip;typeof f=="function"&&(f=f.call(s,o)),ee(f)?(u=l.querySelector(".ui-tooltip-wrapper"))==null||u.remove():et(l.children[0],f,!1,this.element),r.__changed=!0,i?typeof s.oneditend=="function"&&s.oneditend.call(this,o,n):typeof s.onchanged=="function"&&s.onchanged.call(this,o,n)}},C(Re,"ColumnTypes",{Common:0,Input:1,Dropdown:2,Checkbox:3,Icon:4,Text:5,isCheckbox(e){return e===3}}),C(Re,"GridColumn",te);const Wi="",z={right:1,bottom:2,left:4,top:8,bottomRight:3,bottomLeft:6,topRight:9,topLeft:12};function lt(d){if(typeof d!="string")return d;if(d.endsWith("px")){const e=Number(d.substring(0,d.length-2));return isNaN(e)?d:e}return d}class rt{constructor(e={}){g(this,B);g(this,j,void 0);g(this,U,void 0);g(this,J,void 0);x(this,U,e)}get container(){return a(this,j).querySelector(".ui-popup-container")}get rect(){const e=this.container;if(e==null)return null;const t=le.getComputedStyle(e),s=e.classList.contains("ui-popup-collapse"),n=a(this,J);return{collapsed:s,left:lt(t.left),top:lt(t.top),width:s===!0&&n!=null?n.width:lt(t.width),height:s===!0&&n!=null?n.height:lt(t.height)}}set rect(e){const t=this.container;if(t==null)return;const s=[];isNaN(e.left)||s.push(`left: ${e.left}px`),isNaN(e.top)||s.push(`top: ${e.top}px`);const n=t.querySelector(".ui-popup-header>.icon-expand");e.collapsed===!0?(s.push("width: 160px","height: 40px"),x(this,J,e),t.classList.add("ui-popup-collapse"),n!=null&&Ie(n,"fa-regular","expand-alt")):(!isNaN(e.width)&&e.width>0&&s.push(`width: ${e.width}px`),!isNaN(e.height)&&e.height>0&&s.push(`height: ${e.height}px`),t.classList.remove("ui-popup-collapse"),x(this,J,null),n!=null&&Ie(n,"fa-regular","compress-alt")),s.length>0&&(t.style.cssText+=s.join("; "))}close(e=!0){const t=a(this,j);e?(t.classList.add("ui-popup-active"),t.style.opacity=0,setTimeout(()=>{t.remove()},120)):t.remove(),typeof a(this,U).onMasking=="function"&&a(this,U).onMasking.call(this,!1)}create(){const e=p("div","ui-popup-mask"),t=a(this,U);t.mask===!1?e.classList.add("ui-popup-transparent"):typeof t.onMasking=="function"&&a(this,U).onMasking.call(this,!0),isNaN(t.zIndex)||(e.style.zIndex=String(t.zIndex));const s=p("div","ui-popup-container");t.changeZIndex===!0&&s.addEventListener("mousedown",()=>{const i=[...a(this,j).parentElement.children].filter(o=>o.classList.contains("ui-popup-mask"));let r=200;i.forEach(o=>{let c;o.dataset.zindex!=null?(c=parseInt(o.dataset.zindex),o.style.zIndex=isNaN(c)?"":String(c),delete o.dataset.zindex):c=parseInt(o.style.zIndex),c>r&&(r=c)}),e.dataset.zindex=e.style.zIndex,e.style.zIndex=r+1});let n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(i=>i.tabIndex??0));n<0&&(n=0),s.tabIndex=n+1;let l=t.content;if(l instanceof HTMLElement||(l=p("div",i=>i.innerText=l)),s.append(p("div",i=>{i.className="ui-popup-header";let r=t.title;if(r instanceof HTMLElement||(r=p("div",c=>{c.className="ui-popup-header-title",c.innerText=r})),i.appendChild(r),t.movable!==!1&&(r.querySelector(".ui-popup-move")??r).addEventListener("mousedown",u=>{if(u.buttons!==1)return;const f=u.clientX-s.offsetLeft,b=u.clientY-s.offsetTop;let h;const m=E=>{E.buttons===1?(s.style.left=`${E.clientX-f}px`,s.style.top=`${E.clientY-b}px`,h=!0):e.dispatchEvent(new MouseEvent("mouseup"))};e.addEventListener("mousemove",m,{passive:!1});const k=()=>{e.removeEventListener("mousemove",m,{passive:!1}),e.removeEventListener("mouseup",k),h===!0&&typeof t.onMoveEnded=="function"&&t.onMoveEnded.call(this),h=!1};e.addEventListener("mouseup",k)}),t.collapsable===!0){const c=P("fa-regular","compress-alt");c.tabIndex=n+2,c.classList.add("icon-expand"),c.addEventListener("keypress",u=>{(u.key===" "||u.key==="Enter")&&c.dispatchEvent(new MouseEvent("click"))}),c.addEventListener("click",()=>{if(s.classList.contains("ui-popup-collapse")){const u=a(this,J);u!=null&&(s.style.cssText+=`width: ${u.width}px; height: ${u.height}px`,x(this,J,null)),s.classList.remove("ui-popup-collapse"),Ie(c,"fa-regular","compress-alt")}else{const u=this.rect;x(this,J,u),s.style.cssText+="width: 160px; height: 40px",s.classList.add("ui-popup-collapse"),Ie(c,"fa-regular","expand-alt")}typeof t.onResizeEnded=="function"&&t.onResizeEnded.call(this)}),i.appendChild(c)}const o=P("fa-regular","times");o.tabIndex=n+3,o.addEventListener("keypress",c=>{(c.key===" "||c.key==="Enter")&&this.close()}),o.addEventListener("click",()=>this.close()),i.appendChild(o)}),p("div","ui-popup-body",l,p("div","ui-popup-loading",p("div",null,P("fa-regular","spinner-third"))))),Array.isArray(t.buttons)&&t.buttons.length>0){n=Math.max.apply(null,[...s.querySelectorAll("[tabindex]")].map(u=>u.tabIndex??0)),s.appendChild(p("div","ui-popup-footer",...t.buttons.map((u,f)=>{const b=p("button","ui-popup-button");return u.tabIndex>0?b.tabIndex=u.tabIndex:b.tabIndex=n+f+1,b.innerText=u.text,b.addEventListener("click",()=>{if(typeof u.trigger=="function"){const h=u.trigger(this);typeof(h==null?void 0:h.then)=="function"?h.then(m=>{m!==!1&&this.close()}).catch(m=>console.warn(m)):h!==!1&&this.close()}else this.close()}),b})));const i=[...s.querySelectorAll("[tabindex]")].map(u=>u.tabIndex??0),r=Math.min.apply(null,i),o=Math.max.apply(null,i),c=s.querySelector(`[tabindex="${o}"]`);c!=null&&c.addEventListener("keydown",u=>{if(u.key==="Tab"){const f=s.querySelector(`[tabindex="${r}"]`);f==null||f.focus(),u.preventDefault()}})}else s.querySelector(".ui-popup-body>.ui-popup-loading").classList.add("ui-popup-loading-content");return t.resizable===!0&&s.append(p("layer",i=>{i.className="ui-popup-border ui-popup-border-right",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.right,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-bottom",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.bottom,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-left",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.left,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-top",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.top,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-bottom-right",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.bottomRight,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-bottom-left",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.bottomLeft,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-top-left",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.topLeft,r))}),p("layer",i=>{i.className="ui-popup-border ui-popup-border-top-right",i.addEventListener("mousedown",r=>y(this,B,Q).call(this,z.topRight,r))})),e.appendChild(s),x(this,j,e),e}show(e=document.body){if(e==null)return;let t=a(this,j)??this.create();const s=[...e.children].filter(l=>l.classList.contains("ui-popup-mask"));let n=0;for(let l of s){let i=parseInt(l.style.zIndex);!isNaN(i)&&i>n&&(n=i)}if(n>0&&(t.style.zIndex=String(n+1)),e.appendChild(t),a(this,U).mask===!1){const l=this.container;l.style.left=String((e.offsetWidth-l.offsetWidth)/2)+"px",l.style.top=String((e.offsetHeight-l.offsetHeight)/2)+"px"}return new Promise(l=>{setTimeout(()=>{t.style.opacity=1,this.container.focus(),l(t)},0)})}get loading(){var e,t,s;return((s=(t=(e=a(this,j))==null?void 0:e.querySelector(".ui-popup-body>.ui-popup-loading"))==null?void 0:t.style)==null?void 0:s.visibility)==="visible"}set loading(e){var s;let t=(s=a(this,j))==null?void 0:s.querySelector(".ui-popup-body>.ui-popup-loading");t!=null&&(e===!1?(t.style.visibility="hidden",t.style.opacity=0):(t.style.visibility="visible",t.style.opacity=1))}}j=new WeakMap,U=new WeakMap,J=new WeakMap,B=new WeakSet,Q=function(e,t){if(t.buttons!==1)return;const s=this.container,n=a(this,U);typeof n.onResizeStarted=="function"&&n.onResizeStarted.call(this);const l=a(this,j),i=t.clientX,r=t.clientY,o={width:s.offsetWidth,height:s.offsetHeight,left:s.offsetLeft,top:s.offsetTop},c=n.minWidth??200,u=n.minHeight??200;let f;const b=n.mask===!1?l.parentElement:l,h=k=>{if(k.buttons!==1){b.dispatchEvent(new MouseEvent("mouseup"));return}const E=k.clientX-i,_=k.clientY-r;let T=o.width,S=o.height,G=o.left,ge=o.top;(e&z.right)===z.right&&(T+=E,T<c&&(T=c)),(e&z.bottom)===z.bottom&&(S+=_,S<u&&(S=u)),(e&z.left)===z.left&&(T-=E,T<c?(T=c,G=i+o.width-c):G+=E),(e&z.top)===z.top&&(S-=_,S<u?(S=u,ge=r+o.height-u):ge+=_),typeof n.onResizing=="function"?n.onResizing.call(this,G,ge,T,S):s.style.cssText+=`left: ${G}px; top: ${ge}px; width: ${T}px; height: ${S}px`,f=!0};b.addEventListener("mousemove",h,{passive:!1});const m=()=>{b.removeEventListener("mousemove",h,{passive:!1}),b.removeEventListener("mouseup",m),f===!0&&typeof n.onResizeEnded=="function"&&n.onResizeEnded.call(this),f=!1};b.addEventListener("mouseup",m)};function Ai(d,e,...t){return new rt({title:d,content:e,buttons:t})}const Zt={info:"info-circle",information:"info-circle",warn:"exclamation-triangle",warning:"exclamation-triangle",question:"question-circle",error:"times-circle"};function qi(d,e,t="info",s=document.body){return new Promise(n=>{new rt({title:d,content:p("div","message-wrapper",P("fa-solid",Zt[t]??"info-circle"),p("span",i=>i.innerText=e)),buttons:[{text:W("ok","OK"),trigger:n}]}).show(s).then(i=>{const r=i.querySelector(".ui-popup-container .ui-popup-footer .ui-popup-button:last-child");r==null||r.focus()})})}function _i(d,e,t,s="question",n=document.body){return new Promise(l=>{const i=p("div","message-wrapper");ee(s)||i.appendChild(P("fa-solid",Zt[s]??"question-circle")),i.appendChild(e instanceof HTMLElement?e:p("span",o=>o.innerText=e)),new rt({title:d,content:i,buttons:(t==null?void 0:t.map(o=>({text:o.text,trigger:c=>{let u;if(typeof o.trigger=="function"){if(u=o.trigger(c,o),typeof(u==null?void 0:u.then)=="function")return u.then(f=>(f!==!1&&l(f),f));u!==!1&&l(u)}else u={key:o.key,popup:c},l(u);return u}})))??[{text:W("yes","Yes"),trigger:o=>l({key:"yes",popup:o})},{text:W("no","No"),trigger:o=>l({key:"no",popup:o})}]}).show(n).then(o=>{const c=o.querySelector(".ui-popup-container .ui-popup-footer .ui-popup-button:last-child");c==null||c.focus()})})}w.Dropdown=tt,w.Grid=Re,w.Popup=rt,w.changeIcon=Ie,w.createCheckbox=ne,w.createElement=p,w.createIcon=P,w.createPopup=Ai,w.createRadiobox=gi,w.resolveCheckbox=mi,w.resolveIcon=yi,w.resolveTooltip=bi,w.setTooltip=et,w.showAlert=qi,w.showConfirm=_i,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=ui.min.js.map diff --git a/Site/js/lib/ui.min.js.map b/Site/js/lib/ui.min.js.map index 05cccf1..92d4812 100644 --- a/Site/js/lib/ui.min.js.map +++ b/Site/js/lib/ui.min.js.map @@ -1 +1 @@ -{"version":3,"file":"ui.min.js","sources":["../lib/functions.js","../lib/ui/icon.js","../lib/ui/checkbox.js","../lib/ui/tooltip.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js","../lib/ui/dropdown.js","../lib/ui/grid/column.js","../lib/ui/grid/grid.js","../lib/ui/popup.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path || '';\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nfunction changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nfunction createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nfunction resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createIcon,\r\n changeIcon,\r\n resolveIcon\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label?.length > 0) {\r\n container.appendChild(\r\n createElement('span', span => span.innerText = label)\r\n );\r\n }\r\n}\r\n\r\nfunction createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');\r\n return container;\r\n}\r\n\r\nfunction createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n if (opts.enabled === false) {\r\n container.classList.add('disabled');\r\n }\r\n if (opts.checkedNode != null && opts.uncheckedNode != null) {\r\n container.classList.add('ui-check-image-wrapper');\r\n let height = opts.imageHeight;\r\n if (isNaN(height) || height <= 0) {\r\n height = 14;\r\n }\r\n opts.checkedNode.classList.add('checked');\r\n container.appendChild(opts.checkedNode);\r\n opts.uncheckedNode.classList.add('unchecked');\r\n container.appendChild(opts.uncheckedNode);\r\n } else {\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex);\r\n }\r\n return container;\r\n}\r\n\r\nfunction resolveCheckbox(container = document.body, legacy) {\r\n if (legacy) {\r\n const checks = container.querySelectorAll('input[type=\"checkbox\"]');\r\n for (let chk of checks) {\r\n if (chk.parentElement.classList.contains('ui-check-wrapper')) {\r\n // skip\r\n continue;\r\n }\r\n const id = chk.id;\r\n let label, text;\r\n if (id != null) {\r\n label = container.querySelector(`label[for=\"${id}\"]`);\r\n }\r\n if (label == null) {\r\n const e = chk.nextElementSibling;\r\n if (e != null) {\r\n if (e.tagName === 'LABEL') {\r\n label = e;\r\n } else if (e.tagName === 'SPAN' && e.dataset.lgid != null) {\r\n text = e.innerText;\r\n e.style.display = 'none';\r\n }\r\n }\r\n }\r\n if (label == null) {\r\n const e = chk.previousElementSibling;\r\n if (e != null) {\r\n if (e.tagName === 'LABEL') {\r\n label = e;\r\n } else if (text == null && e.tagName === 'SPAN' && e.dataset.lgid != null) {\r\n text = e.innerText;\r\n e.style.display = 'none';\r\n }\r\n }\r\n }\r\n if (label == null) {\r\n label = createElement('label');\r\n chk.parentElement.insertBefore(label, chk);\r\n } else {\r\n text = label.innerText;\r\n }\r\n if (chk.disabled) {\r\n label.className = 'ui-check-wrapper disabled';\r\n } else {\r\n label.className = 'ui-check-wrapper';\r\n }\r\n label.replaceChildren();\r\n fillCheckbox(label, 'fa-regular', text, chk.tabIndex);\r\n label.insertBefore(chk, label.firstChild);\r\n }\r\n }\r\n const boxes = container.querySelectorAll('label[data-checkbox]');\r\n for (let box of boxes) {\r\n if (!box.classList.contains('ui-check-wrapper')) {\r\n box.classList.add('ui-check-wrapper');\r\n }\r\n if (box.hasChildNodes()) {\r\n if (!box.classList.contains('ui-check-image-wrapper')) {\r\n box.classList.add('ui-check-image-wrapper');\r\n }\r\n } else {\r\n fillCheckbox(box,\r\n box.dataset.type,\r\n box.dataset.label,\r\n box.dataset.tabIndex)\r\n box.removeAttribute('data-type');\r\n box.removeAttribute('data-label');\r\n }\r\n const input = createElement('input');\r\n const id = box.dataset.id;\r\n if (id?.length > 0) {\r\n input.id = id;\r\n }\r\n if (box.dataset.checked != null) {\r\n input.checked = true;\r\n }\r\n input.setAttribute('type', 'checkbox');\r\n box.insertBefore(input, box.firstChild);\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createCheckbox,\r\n resolveCheckbox,\r\n createRadiobox\r\n}","import './css/tooltip.scss';\r\nimport { createElement } from \"../functions\";\r\n// import { global } from \"../utility\";\r\n\r\nfunction setTooltip(container, content, flag = false, parent = null) {\r\n const isParent = parent instanceof HTMLElement;\r\n if (isParent) {\r\n const tipid = container.dataset.tipId;\r\n const tip = parent.querySelector(`.ui-tooltip-wrapper[data-tip-id=\"${tipid}\"]`);\r\n tip?.remove();\r\n } else {\r\n const tip = container.querySelector('.ui-tooltip-wrapper');\r\n tip?.remove();\r\n }\r\n const wrapper = createElement('div', wrapper => {\r\n wrapper.className = 'ui-tooltip-wrapper ui-tooltip-color';\r\n wrapper.style.visibility = 'hidden';\r\n wrapper.style.opacity = 0;\r\n wrapper.style.top = '0';\r\n wrapper.style.left = '0';\r\n },\r\n createElement('div', 'ui-tooltip-pointer ui-tooltip-color'),\r\n createElement('div', 'ui-tooltip-curtain ui-tooltip-color'),\r\n createElement('div', cnt => {\r\n cnt.className = 'ui-tooltip-content';\r\n if (content instanceof Element) {\r\n cnt.appendChild(content);\r\n } else {\r\n cnt.innerText = content;\r\n }\r\n })\r\n );\r\n // container.insertAdjacentElement('afterend', wrapper);\r\n if (isParent) {\r\n const tipId = String(Math.random()).substring(2);\r\n container.dataset.tipId = tipId;\r\n wrapper.dataset.tipId = tipId;\r\n parent.appendChild(wrapper);\r\n } else {\r\n container.appendChild(wrapper);\r\n }\r\n\r\n let tid;\r\n container.addEventListener('mouseenter', () => {\r\n tid && clearTimeout(tid);\r\n let c = container;\r\n while (c?.offsetWidth == null) {\r\n c = c.parentElement;\r\n }\r\n if (c == null) {\r\n return;\r\n }\r\n if (!flag || c.scrollWidth > c.offsetWidth) {\r\n tid = setTimeout(() => {\r\n let p;\r\n let left;\r\n let top;\r\n left = c.offsetLeft;\r\n top = c.offsetTop;\r\n if (isParent) {\r\n p = c.offsetParent;\r\n while (p != null && p !== parent) {\r\n left += p.offsetLeft;\r\n top += p.offsetTop;\r\n p = p.offsetParent;\r\n }\r\n }\r\n p = c.parentElement;\r\n const offsetParent = c.offsetParent;\r\n while (p != null && p !== (isParent ? parent : offsetParent)) {\r\n left -= p.scrollLeft;\r\n top -= p.scrollTop;\r\n p = p.parentElement;\r\n }\r\n left += (c.offsetWidth - wrapper.offsetWidth) / 2;\r\n top -= wrapper.offsetHeight + 14;\r\n wrapper.style.left = `${left}px`;\r\n wrapper.style.top = `${top}px`;\r\n wrapper.style.visibility = 'visible';\r\n wrapper.style.opacity = 1;\r\n }, 100);\r\n }\r\n });\r\n container.addEventListener('mouseleave', () => {\r\n tid && clearTimeout(tid);\r\n tid = setTimeout(() => {\r\n wrapper.style.visibility = 'hidden';\r\n wrapper.style.opacity = 0;\r\n }, 300);\r\n });\r\n return container;\r\n}\r\n\r\nfunction resolveTooltip(container = document.body) {\r\n const tips = container.querySelectorAll('[title]');\r\n for (let tip of tips) {\r\n const title = tip.getAttribute('title');\r\n if (title != null) {\r\n tip.removeAttribute('title');\r\n setTooltip(tip, title);\r\n }\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n setTooltip,\r\n resolveTooltip\r\n}","function nullOrEmpty(s) {\r\n return s == null || typeof s !== 'string' || s.length === 0;\r\n}\r\n\r\nfunction contains(s, key, ignoreCase) {\r\n if (nullOrEmpty(s) || key == null) {\r\n return false;\r\n }\r\n if (typeof key !== 'string') {\r\n key = String(key);\r\n }\r\n if (ignoreCase) {\r\n return s.toLowerCase().indexOf(key.toLowerCase()) >= 0;\r\n }\r\n return s.indexOf(key) >= 0;\r\n}\r\n\r\nfunction endsWith(s, suffix) {\r\n if (nullOrEmpty(s) || nullOrEmpty(suffix)) {\r\n return false;\r\n }\r\n return s.indexOf(suffix) === s.length - suffix.length;\r\n}\r\n\r\nfunction padStart(s, num, char) {\r\n if (nullOrEmpty(s) || isNaN(num) || num <= s.length) {\r\n return s;\r\n }\r\n return (char ?? ' ').repeat(num - s.length);\r\n}\r\n\r\nfunction formatUrl(msg) {\r\n //const urlReg = /(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?/ig;\r\n //const urlArrray = str.match(urlReg);\r\n const p = /(http|ftp|https):\\/\\/.+?(\\s|\\r\\n|\\r|\\n|\\\"|\\'|\\*|$)/g;\r\n const r = msg.match(p);\r\n msg = escapeHtml(msg);\r\n\r\n if (r?.length > 0) {\r\n const rs = [];\r\n for (let t of r) {\r\n t = t.replace(/[\"'\\r\\n ]/g, '');\r\n if (rs.indexOf(t) < 0) {\r\n rs.push(t);\r\n }\r\n }\r\n\r\n for (let r of rs) {\r\n msg = msg.replaceAll(r, '<a target=\"_blank\" href=\"' + r + '\"><svg><use xlink:href=\"' + ((typeof consts !== 'undefined' && consts.path) || '') + 'fonts/fa-regular.svg#link\"></use></svg></a>');\r\n }\r\n }\r\n\r\n return msg;\r\n}\r\n\r\nfunction escapeHtml(text) {\r\n if (text == null) {\r\n return '';\r\n }\r\n return String(text)\r\n .replaceAll('&', '&')\r\n .replaceAll('<', '<')\r\n .replaceAll('>', '>')\r\n .replaceAll('\\r\\n', '<br/>')\r\n .replaceAll('\\n', '<br/>')\r\n .replaceAll(' ', ' ');\r\n}\r\n\r\nexport {\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml\r\n}","import { getCookie } from \"./cookie\";\r\nimport { get } from \"./request\";\r\nimport { nullOrEmpty } from \"./strings\";\r\n\r\nlet cache;\r\n\r\nfunction getCurrentLgId() {\r\n let lgid;\r\n if (typeof consts !== 'undefined') {\r\n lgid = getCookie(consts.cookie?.lang);\r\n if (nullOrEmpty(lgid)) {\r\n lgid = consts.user?.language;\r\n }\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = getCookie('lgid');\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = navigator.language || 'en-us';\r\n }\r\n lgid = lgid.toLowerCase().replace(/-/g, '_');\r\n if (nullOrEmpty(lgid)) {\r\n lgid = 'en';\r\n }\r\n switch (lgid) {\r\n case 'en':\r\n case 'en_au':\r\n case 'fr':\r\n case 'zh_cn':\r\n return lgid;\r\n }\r\n const lang = lgid.split('_')[0];\r\n switch (lang) {\r\n case 'en':\r\n case 'fr':\r\n return lang;\r\n }\r\n return 'en';\r\n}\r\n\r\nfunction getStorageKey(lgid) {\r\n if (typeof consts !== 'undefined') {\r\n return (consts.prefix || '') + `res_${lgid}`;\r\n }\r\n return `res_${lgid}`;\r\n}\r\n\r\nasync function doRefreshLgres(template = '') {\r\n const lgid = getCurrentLgId();\r\n const r = await get(`language/${lgid}${template}`);\r\n const dict = await r.json();\r\n localStorage.setItem(getStorageKey(lgid), JSON.stringify(dict));\r\n return dict;\r\n}\r\n\r\nasync function refreshLgres(template, lgres) {\r\n if (lgres == null || typeof consts === 'undefined') {\r\n lgres = await doRefreshLgres(template);\r\n }\r\n const ver = Number(consts.resver);\r\n if (isNaN(lgres.ver) || isNaN(ver) || ver > lgres.ver) {\r\n console.log(`found new language res version: ${lgres.ver} => ${ver}`);\r\n lgres = await doRefreshLgres(template);\r\n }\r\n Object.defineProperty(lgres, 'r', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function (key, defaultValue) {\r\n return getLanguage(this, key, defaultValue);\r\n }\r\n });\r\n cache = lgres;\r\n return lgres;\r\n}\r\n\r\nfunction getLanguage(lgres, key, defaultValue) {\r\n let value = lgres[key];\r\n return value ?? defaultValue;\r\n}\r\n\r\nfunction applyLanguage(dom, result) {\r\n for (let text of dom.querySelectorAll('[data-lgid]')) {\r\n const key = text.dataset.lgid;\r\n if (text.tagName === 'INPUT') {\r\n text.value = getLanguage(result, key, text.value);\r\n } else {\r\n text.innerText = getLanguage(result, key, text.innerText);\r\n }\r\n }\r\n for (let title of dom.querySelectorAll('[data-title-lgid]')) {\r\n const key = title.dataset.titleLgid;\r\n title.setAttribute('title', getLanguage(result, key, title.getAttribute('title')));\r\n }\r\n for (let holder of dom.querySelectorAll('[data-placeholder-lgid]')) {\r\n const key = holder.dataset.placeholderLgid;\r\n holder.setAttribute('placeholder', getLanguage(result, key, holder.getAttribute('placeholder')));\r\n }\r\n}\r\n\r\nasync function init(dom = document.body, options = {}) {\r\n const lgid = getCurrentLgId();\r\n let lgres = localStorage.getItem(getStorageKey(lgid));\r\n let result;\r\n if (lgres != null) {\r\n try {\r\n lgres = JSON.parse(lgres);\r\n result = await refreshLgres(options.template, lgres);\r\n } catch (e) {\r\n console.error('error while parsing lgres, try refresh ...', e);\r\n result = await refreshLgres(options.template);\r\n }\r\n } else {\r\n result = await refreshLgres(options.template);\r\n }\r\n\r\n try {\r\n if (document.readyState === 'loading') {\r\n return await new Promise((resolve, reject) => {\r\n let tid = setTimeout(() => reject('timeout'), 30000);\r\n document.addEventListener('DOMContentLoaded', () => {\r\n clearTimeout(tid);\r\n tid = void 0;\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n resolve(result);\r\n });\r\n });\r\n }\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n return result;\r\n } catch (err) {\r\n console.error('error while loading language res ...', err);\r\n }\r\n}\r\n\r\nfunction r(key, defaultValue) {\r\n if (cache != null) {\r\n return getLanguage(cache, key, defaultValue);\r\n }\r\n return defaultValue;\r\n}\r\n\r\nconst lang = {\r\n get current() {\r\n return getCurrentLgId();\r\n },\r\n get unknownError() {\r\n return r('unknownError', 'An unknown error occurred, please contact the administrator.');\r\n },\r\n get savedSuccessfully() {\r\n return r('savedSuccessfully', 'Saved successfully.');\r\n }\r\n}\r\n\r\nexport {\r\n init,\r\n r,\r\n lang\r\n}","import { getCookie, setCookie, deleteCookie } from \"./utility/cookie\";\r\nimport { init, r, lang } from \"./utility/lgres\";\r\nimport { get, post, upload } from \"./utility/request\";\r\nimport { nullOrEmpty, contains, endsWith, padStart, formatUrl, escapeHtml } from \"./utility/strings\";\r\n\r\nlet g = typeof globalThis !== 'undefined' ? globalThis : self;\r\n\r\nfunction isPositive(n) {\r\n return !isNaN(n) && n > 0;\r\n}\r\n\r\nfunction isMobile() {\r\n return /mobile/i.test(navigator.userAgent);\r\n}\r\n\r\nfunction throttle(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n const current = new Date();\r\n if (method.tdate == null || current - method.tdate > delay) {\r\n method.apply(context, args);\r\n method.tdate = current;\r\n } else {\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n }\r\n}\r\n\r\nfunction debounce(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n}\r\n\r\nfunction truncate(v) {\r\n return (v > 0 ? Math.floor : Math.ceil)(v);\r\n}\r\n\r\nfunction isEmail(text) {\r\n return /^\\w[-\\w.+]*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/.test(text);\r\n}\r\n\r\nfunction isPhone(text) {\r\n if (/^[1-9]\\d{9,}$/.test(text)) {\r\n return true;\r\n }\r\n if (/^\\+?[1-9][\\d-]{9,}\\d$/.test(text) && /^[1-9]\\d{9,}$/.test(text.replace('+', '').replace(new RegExp('-', 'g'), ''))) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport {\r\n // cookie\r\n getCookie,\r\n setCookie,\r\n deleteCookie,\r\n // lgres\r\n init,\r\n r,\r\n lang,\r\n // request\r\n get,\r\n post,\r\n upload,\r\n // strings\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml,\r\n // variables\r\n g as global,\r\n isPositive,\r\n isMobile,\r\n // functions\r\n throttle,\r\n debounce,\r\n truncate,\r\n isEmail,\r\n isPhone\r\n}","// import { r, global, contains, isPositive, nullOrEmpty } from \"../utility\";\r\nimport './css/dropdown.scss';\r\nimport { r } from \"../utility/lgres\";\r\nimport { contains, nullOrEmpty } from \"../utility/strings\";\r\nimport { global, isPositive } from \"../utility\";\r\nimport { createElement } from \"../functions\";\r\nimport { createCheckbox } from \"./checkbox\";\r\nimport { createIcon } from \"./icon\"\r\n\r\nconst SymbolDropdown = Symbol.for('ui-dropdown');\r\nconst DropdownTitleHeight = 26;\r\nconst DropdownItemHeight = 30;\r\n\r\nlet dropdownGlobal = global[SymbolDropdown];\r\n\r\nif (dropdownGlobal == null) {\r\n // init\r\n dropdownGlobal = {};\r\n Object.defineProperty(dropdownGlobal, 'clear', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function () {\r\n const panel = document.querySelector('.ui-drop-wrapper .ui-drop-box.active');\r\n if (panel == null) {\r\n return;\r\n }\r\n panel.classList.remove('active');\r\n const dropId = panel.parentElement.dataset.dropId;\r\n if (dropId == null) {\r\n return;\r\n }\r\n const dropdown = this[dropId];\r\n if (dropdown?.multiselect && typeof dropdown.oncollapsed === 'function') {\r\n dropdown.oncollapsed();\r\n }\r\n }\r\n })\r\n global[SymbolDropdown] = dropdownGlobal;\r\n\r\n document.addEventListener('mousedown', e => {\r\n let parent = e.target;\r\n while (parent != null) {\r\n if (parent.classList.contains('ui-drop-box')) {\r\n e.stopPropagation();\r\n return;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n dropdownGlobal.clear();\r\n });\r\n}\r\n\r\nfunction selectItems(label, itemlist, htmlkey, textkey) {\r\n const htmls = itemlist.map(it => it[htmlkey]);\r\n if (htmls.some(it => it instanceof HTMLElement)) {\r\n label.replaceChildren(...htmls.filter(it => it != null).map(it => it.cloneNode(true)));\r\n } else {\r\n let text = itemlist.map(it => it[textkey]).join(', ');\r\n if (nullOrEmpty(text)) {\r\n text = r('noneItem', '( None )');\r\n }\r\n label.innerText = text;\r\n }\r\n}\r\n\r\nfunction filterSource(searchkeys, textkey, key, source) {\r\n if (!Array.isArray(searchkeys) || searchkeys.length === 0) {\r\n searchkeys = [textkey];\r\n }\r\n if (key.length > 0) {\r\n source = source.filter(it => {\r\n for (let k of searchkeys) {\r\n if (contains(it[k].toLowerCase(), key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n return source;\r\n}\r\n\r\nclass Dropdown {\r\n #options;\r\n\r\n #wrapper;\r\n #container;\r\n #label;\r\n\r\n #allChecked;\r\n #source;\r\n #lastSelected;\r\n #selected;\r\n #selectedList;\r\n\r\n sourceFilter;\r\n onselectedlist;\r\n onselected;\r\n onexpanded;\r\n\r\n constructor(options = {}) {\r\n options.searchplaceholder ??= r('searchHolder', 'Search...');\r\n options.textkey ??= 'text';\r\n options.valuekey ??= 'value';\r\n options.htmlkey ??= 'html';\r\n options.maxlength ??= 500;\r\n this.#options = options;\r\n }\r\n\r\n create() {\r\n const options = this.#options;\r\n\r\n // wrapper\r\n const wrapper = createElement('div', 'ui-drop-wrapper');\r\n const dropId = String(Math.random()).substring(2);\r\n wrapper.dataset.dropId = dropId;\r\n dropdownGlobal[dropId] = this;\r\n this.#wrapper = wrapper;\r\n\r\n // header\r\n const header = createElement('div', 'ui-drop-header');\r\n header.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n header.dispatchEvent(new MouseEvent('click'));\r\n }\r\n });\r\n header.addEventListener('keydown', e => {\r\n const up = e.key === 'ArrowUp';\r\n const down = e.key === 'ArrowDown';\r\n if (up || down) {\r\n const source = this.source;\r\n const count = source.length;\r\n const valuekey = this.#options.valuekey;\r\n let index = source?.indexOf(this.#selected);\r\n if (isNaN(index) || index < -1) {\r\n index = -1;\r\n } else if (index >= count) {\r\n index = count - 1;\r\n }\r\n if (up) {\r\n if (index > 0) {\r\n index--;\r\n } else {\r\n index = 0;\r\n }\r\n } else if (down) {\r\n if (index < 0) {\r\n index = 0;\r\n } else if (index < count) {\r\n index++;\r\n } else {\r\n index = count - 1;\r\n }\r\n }\r\n const target = source[index]?.[valuekey];\r\n if (target != null) {\r\n this.select(target);\r\n }\r\n } else if (e.key === 'Tab') {\r\n this.#dropdown(false);\r\n }\r\n });\r\n header.addEventListener('click', () => {\r\n if (this.disabled) {\r\n return;\r\n }\r\n const active = this.#expanded;\r\n const label = this.#label;\r\n if (active && label.ownerDocument.activeElement === label) {\r\n return;\r\n }\r\n this.#dropdown(!active);\r\n if (!active && typeof this.onexpanded === 'function') {\r\n setTimeout(() => this.onexpanded(), 120);\r\n }\r\n });\r\n\r\n // label or input\r\n let label;\r\n if (options.input) {\r\n label = createElement('input', 'ui-drop-text');\r\n label.setAttribute('type', 'text');\r\n options.placeholder && label.setAttribute('placeholder', options.placeholder);\r\n isPositive(options.maxlength) && label.setAttribute('maxlength', options.maxlength);\r\n isPositive(options.tabIndex) && label.setAttribute('tabindex', options.tabIndex);\r\n label.addEventListener('input', e => {\r\n const key = e.target.value.toLowerCase();\r\n const source = filterSource(options.searchkeys, options.textkey, key, this.source);\r\n this.#filllist(source);\r\n this.#container.classList.add('active');\r\n });\r\n label.addEventListener('blur', e => this.select(e.target.value));\r\n label.addEventListener('mousedown', e => this.#expanded && e.stopPropagation());\r\n } else {\r\n isPositive(options.tabIndex) && header.setAttribute('tabindex', options.tabIndex);\r\n label = createElement('label', 'ui-drop-text');\r\n }\r\n this.#label = label;\r\n if (options.multiselect) {\r\n if (Array.isArray(options.selectedlist)) {\r\n this.selectlist(options.selectedlist, true);\r\n } else {\r\n this.#allChecked = true;\r\n label.innerText = r('allItem', '( All )');\r\n }\r\n } else if (options.selected != null) {\r\n this.select(options.selected, true);\r\n }\r\n header.append(label, createElement('label', 'ui-drop-caret'));\r\n wrapper.appendChild(header);\r\n\r\n this.disabled = options.disabled || false;\r\n return wrapper;\r\n }\r\n\r\n get multiselect() { return this.#options.multiselect }\r\n\r\n get disabled() { return this.#wrapper == null || this.#wrapper.querySelector('.ui-drop-header.disabled') != null }\r\n\r\n set disabled(flag) {\r\n if (this.#wrapper == null) {\r\n return;\r\n }\r\n if (flag) {\r\n this.#wrapper.querySelector('.ui-drop-header').classList.add('disabled');\r\n } else {\r\n this.#wrapper.querySelector('.ui-drop-header').classList.remove('disabled');\r\n }\r\n }\r\n\r\n get source() {\r\n let source = this.#source;\r\n if (source == null || !Array.isArray(source)) {\r\n if (typeof this.sourceFilter === 'function') {\r\n source = this.sourceFilter();\r\n }\r\n if (!Array.isArray(source)) {\r\n source = [];\r\n }\r\n this.#source = source;\r\n }\r\n return source;\r\n }\r\n\r\n set source(list) {\r\n if (!Array.isArray(list)) {\r\n return;\r\n }\r\n this.#source = list;\r\n if (this.#expanded) {\r\n setTimeout(() => this.#dropdown(), 120);\r\n }\r\n }\r\n\r\n get selected() { return this.#selected }\r\n\r\n get selectedlist() { return this.#selectedList || [] }\r\n\r\n select(selected, silence) {\r\n if (this.#lastSelected === selected) {\r\n return false;\r\n }\r\n this.#lastSelected = selected;\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n let item = this.source.find(it => it[valuekey] === selected);\r\n if (this.#options.input) {\r\n if (item == null) {\r\n item = { [valuekey]: selected };\r\n }\r\n this.#label.value = selected;\r\n } else {\r\n const expanded = this.#expanded;\r\n if (expanded) {\r\n this.#container.querySelectorAll('li[data-value].selected').forEach(li => li.classList.remove('selected'));\r\n }\r\n if (item == null) {\r\n this.#selected = null;\r\n this.#label.innerText = ' ';\r\n return false;\r\n }\r\n const html = item[htmlkey];\r\n if (html instanceof HTMLElement) {\r\n this.#label.replaceChildren(html.cloneNode(true));\r\n } else {\r\n let text = item[textkey];\r\n if (nullOrEmpty(text)) {\r\n text = ' ';\r\n }\r\n this.#label.innerText = text;\r\n }\r\n if (expanded) {\r\n const val = selected.replace(/\"/g, '\\\\\"');\r\n const li = this.#container.querySelector(`li[data-value=\"${val}\"]`);\r\n if (li != null) {\r\n li.classList.add('selected');\r\n }\r\n }\r\n }\r\n this.#selected = item;\r\n if (!silence && typeof this.onselected === 'function') {\r\n this.onselected(item);\r\n }\r\n }\r\n\r\n selectlist(selectedlist, silence) {\r\n const source = this.source;\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n const itemlist = selectedlist.map(v => {\r\n let item = source.find(it => it[valuekey] === v);\r\n if (item == null) {\r\n item = { [valuekey]: v, [textkey]: v };\r\n }\r\n return item;\r\n });\r\n if (itemlist.length === 0) {\r\n this.#selectedList = null;\r\n this.#label.innerText = none;\r\n return false;\r\n }\r\n selectItems(this.#label, itemlist, htmlkey, textkey);\r\n this.#selectedList = itemlist;\r\n if (!silence && typeof this.onselectedlist === 'function') {\r\n this.onselectedlist(itemlist);\r\n }\r\n }\r\n\r\n get #expanded() { return this.#container?.classList?.contains('active') }\r\n\r\n #dropdown(flag = true) {\r\n const options = this.#options;\r\n let panel = this.#container;\r\n if (panel == null) {\r\n panel = createElement('div', 'ui-drop-box');\r\n // search box\r\n if (!options.input && options.search) {\r\n const search = createElement('div', 'ui-drop-search');\r\n const input = createElement('input');\r\n input.setAttribute('type', 'text');\r\n isPositive(options.tabIndex) && input.setAttribute('tabindex', options.tabIndex);\r\n !nullOrEmpty(options.searchplaceholder) && input.setAttribute('placeholder', options.searchplaceholder);\r\n input.addEventListener('input', e => {\r\n const key = e.target.value.toLowerCase();\r\n const source = filterSource(options.searchkeys, options.textkey, key, this.source);\r\n this.#filllist(source);\r\n })\r\n search.append(input, createIcon('fa-light', 'search'));\r\n panel.appendChild(search);\r\n }\r\n // list\r\n const list = createElement('ul', 'ui-drop-list');\r\n if (!this.multiselect) {\r\n list.addEventListener('click', e => {\r\n let li = e.target;\r\n while (li.tagName !== 'LI') {\r\n li = li.parentElement;\r\n if (li == null) {\r\n return;\r\n }\r\n }\r\n const value = li.dataset.value;\r\n if (this.select(value) !== false) {\r\n dropdownGlobal.clear();\r\n }\r\n });\r\n }\r\n panel.appendChild(list);\r\n this.#container = panel;\r\n this.#wrapper.appendChild(panel);\r\n }\r\n if (flag) {\r\n let source = this.source;\r\n if (!options.input && options.search) {\r\n const search = panel.querySelector('.ui-drop-search > input');\r\n if (!nullOrEmpty(search?.value)) {\r\n source = filterSource(options.searchkeys, options.textkey, search.value, source);\r\n }\r\n }\r\n this.#filllist(source);\r\n // slide direction\r\n if (!options.slidefixed) {\r\n let parent = options.parent ?? document.body;\r\n let p = this.#wrapper;\r\n let top = p.offsetTop;\r\n while ((p = p.parentElement) != null && p !== parent) {\r\n top -= p.scrollTop;\r\n }\r\n if (top - parent.offsetTop + DropdownTitleHeight + panel.offsetHeight >= parent.offsetHeight) {\r\n panel.classList.add('slide-up');\r\n } else {\r\n panel.classList.remove('slide-up');\r\n }\r\n }\r\n panel.classList.add('active');\r\n } else {\r\n panel.classList.remove('active');\r\n }\r\n }\r\n\r\n #filllist(source) {\r\n const list = this.#container.querySelector('.ui-drop-list');\r\n list.replaceChildren();\r\n const multiselect = this.multiselect;\r\n const allchecked = this.#allChecked;\r\n if (multiselect) {\r\n list.appendChild(\r\n createElement('li', null,\r\n createCheckbox({\r\n label: r('allItem', '( All )'),\r\n checked: allchecked,\r\n customerAttributes: { 'isall': '1' },\r\n onchange: e => this.#triggerselect(e.target)\r\n })\r\n )\r\n );\r\n }\r\n // TODO: virtual mode\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n const selected = this.selected;\r\n const selectedlist = this.selectedlist;\r\n let scrolled;\r\n source.slice(0, 200).forEach((item, i) => {\r\n const val = item[valuekey];\r\n const li = createElement('li');\r\n li.dataset.value = val;\r\n li.setAttribute('title', item[textkey]);\r\n let label;\r\n const html = item[htmlkey];\r\n if (html instanceof HTMLElement) {\r\n label = html;\r\n }\r\n if (multiselect) {\r\n const selected = selectedlist.some(s => s[valuekey] === val);\r\n if (label == null) {\r\n label = createElement('span');\r\n label.innerText = item[textkey];\r\n }\r\n const box = createCheckbox({\r\n label,\r\n checked: allchecked || selected,\r\n customerAttributes: {\r\n 'class': 'dataitem',\r\n 'data-value': val\r\n },\r\n onchange: e => this.#triggerselect(e.target)\r\n });\r\n li.appendChild(box);\r\n } else {\r\n if (label == null) {\r\n li.innerText = item[textkey];\r\n } else {\r\n li.appendChild(label);\r\n }\r\n if (selected != null && selected[valuekey] === val) {\r\n scrolled = DropdownItemHeight * i;\r\n li.classList.add('selected');\r\n }\r\n }\r\n list.appendChild(li);\r\n });\r\n if (scrolled != null) {\r\n setTimeout(() => list.scrollTop = scrolled, 10);\r\n }\r\n }\r\n\r\n #triggerselect(checkbox) {\r\n let list;\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n if (checkbox.getAttribute('isall') === '1') {\r\n const allchecked = this.#allChecked = checkbox.checked;\r\n const boxes = this.#container.querySelectorAll('input.dataitem');\r\n boxes.forEach(box => box.checked = allchecked);\r\n list = [];\r\n } else if (checkbox.checked) {\r\n if (this.#container.querySelectorAll('input.dataitem:not(:checked)').length === 0) {\r\n this.#allChecked = true;\r\n this.#container.querySelector('input[isall=\"1\"]').checked = true;\r\n list = [];\r\n } else {\r\n const source = this.source;\r\n list = [...this.#container.querySelectorAll('input.dataitem:checked')]\r\n .map(c => source.find(it => it[valuekey] === c.dataset.value))\r\n .filter(it => it != null);\r\n }\r\n } else {\r\n const val = checkbox.dataset.value;\r\n if (this.#allChecked) {\r\n this.#allChecked = false;\r\n this.#container.querySelector('input[isall=\"1\"]').checked = false;\r\n list = this.source.filter(it => it[valuekey] !== val);\r\n } else {\r\n list = this.selectedlist.filter(it => it[valuekey] !== val);\r\n }\r\n }\r\n if (this.#allChecked) {\r\n this.#label.innerText = r('allItem', '( All )');\r\n } else {\r\n selectItems(this.#label, list, htmlkey, textkey);\r\n }\r\n this.#selectedList = list;\r\n if (typeof this.onselectedlist === 'function') {\r\n this.onselectedlist(itemlist);\r\n }\r\n }\r\n\r\n static resolve(dom = document.body) {\r\n const selects = dom.querySelectorAll('select');\r\n for (let sel of selects) {\r\n const source = [...sel.children].map(it => {\r\n return { value: it.value, text: it.innerText }\r\n });\r\n const drop = new Dropdown({\r\n selected: sel.value,\r\n disabled: sel.disabled,\r\n tabIndex: sel.tabIndex\r\n });\r\n drop.source = source;\r\n sel.parentElement.replaceChild(drop.create(), sel);\r\n }\r\n return dom;\r\n }\r\n}\r\n\r\nexport default Dropdown;","import { global } from \"../../utility\";\r\nimport { nullOrEmpty } from \"../../utility/strings\";\r\nimport { createElement } from \"../../functions\";\r\nimport { createIcon } from \"../icon\";\r\nimport { createCheckbox } from \"../checkbox\";\r\nimport { setTooltip } from \"../tooltip\";\r\nimport Dropdown from \"../dropdown\";\r\n\r\nclass GridColumn {\r\n static create() {\r\n return createElement('span');\r\n }\r\n\r\n static setValue(element, val) {\r\n element.innerText = val;\r\n }\r\n\r\n static setStyle(element, style) {\r\n for (let css of Object.entries(style)) {\r\n element.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n}\r\n\r\nclass GridInputColumn extends GridColumn {\r\n static get editing() { return true };\r\n\r\n static createEdit(trigger, col, _parent, vals) {\r\n const input = createElement('input');\r\n input.setAttribute('type', 'text');\r\n if (typeof trigger === 'function') {\r\n input.addEventListener('change', trigger);\r\n }\r\n input.addEventListener('input', () => {\r\n if (vals.__editing == null) {\r\n vals.__editing = {\r\n [col.key]: true\r\n }\r\n } else {\r\n vals.__editing[col.key] = true;\r\n }\r\n });\r\n return input;\r\n }\r\n\r\n static setValue(element, val) {\r\n if (element.tagName !== 'INPUT') {\r\n super.setValue(element, val);\r\n } else {\r\n element.value = val;\r\n }\r\n }\r\n\r\n static getValue(e) { return e.target.value }\r\n\r\n static setEnabled(element, enabled) {\r\n element.disabled = enabled === false;\r\n }\r\n}\r\n\r\nclass GridTextColumn extends GridInputColumn {\r\n static createEdit(trigger, col, _parent, vals) {\r\n const input = createElement('textarea');\r\n if (typeof trigger === 'function') {\r\n input.addEventListener('change', trigger);\r\n }\r\n input.addEventListener('input', () => {\r\n if (vals.__editing == null) {\r\n vals.__editing = {\r\n [col.key]: true\r\n }\r\n } else {\r\n vals.__editing[col.key] = true;\r\n }\r\n });\r\n return input;\r\n }\r\n\r\n static setValue(element, val, _item, _col, grid) {\r\n if (element.tagName !== 'TEXTAREA') {\r\n super.setValue(element, val);\r\n } else {\r\n element.value = val;\r\n if (val != null) {\r\n const lines = String(val).split('\\n').length;\r\n element.style.height = `${lines * grid.lineHeight + 12}px`;\r\n }\r\n // TODO: bad performance\r\n }\r\n }\r\n}\r\n\r\nconst SymbolDropdown = Symbol.for('ui-dropdown');\r\n\r\nclass GridDropdownColumn extends GridColumn {\r\n static createEdit(trigger, col, parent) {\r\n const drop = new Dropdown({ ...col.dropOptions, parent });\r\n drop.onselected = trigger;\r\n return drop.create();\r\n }\r\n\r\n static #getDrop(element) {\r\n const dropGlobal = global[SymbolDropdown];\r\n if (dropGlobal == null) {\r\n return null;\r\n }\r\n const dropId = element.dataset.dropId;\r\n const drop = dropGlobal[dropId];\r\n if (drop == null) {\r\n return null;\r\n }\r\n return drop;\r\n }\r\n\r\n static #getSource(item, col) {\r\n let source = col.source;\r\n if (typeof source === 'function') {\r\n source = source(item);\r\n }\r\n return source;\r\n }\r\n\r\n static #setValue(source, element, val) {\r\n const data = source?.find(v => v.value === val);\r\n if (data != null) {\r\n val = data.text;\r\n }\r\n super.setValue(element, val);\r\n }\r\n\r\n static setValue(element, val, item, col) {\r\n if (element.tagName !== 'DIV') {\r\n let source = this.#getSource(item, col);\r\n if (source instanceof Promise) {\r\n source.then(s => this.#setValue(s, element, val));\r\n } else {\r\n this.#setValue(source, element, val);\r\n }\r\n return;\r\n }\r\n const drop = this.#getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n if (drop.source == null || drop.source.length === 0) {\r\n let source = this.#getSource(item, col);\r\n if (source instanceof Promise) {\r\n source.then(s => {\r\n drop.source = s;\r\n drop.select(val, true);\r\n })\r\n return;\r\n } else if (source != null) {\r\n drop.source = source;\r\n }\r\n }\r\n drop.select(val, true);\r\n }\r\n\r\n static getValue(e) {\r\n return e.value;\r\n }\r\n\r\n static setEnabled(element, enabled) {\r\n const drop = this.#getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n drop.disabled = enabled === false;\r\n }\r\n}\r\n\r\nclass GridCheckboxColumn extends GridColumn {\r\n static createEdit(trigger) {\r\n const check = createCheckbox({\r\n onchange: typeof trigger === 'function' ? trigger : null\r\n });\r\n return check;\r\n }\r\n\r\n static setValue(element, val) {\r\n element.querySelector('input').checked = val;\r\n }\r\n\r\n static getValue(e) { return e.target.checked }\r\n\r\n static setEnabled(element, enabled) {\r\n element.querySelector('input').disabled = enabled === false;\r\n }\r\n}\r\n\r\nclass GridIconColumn extends GridColumn {\r\n static create() { return createElement('span', 'col-icon') }\r\n\r\n static setValue(element, val, item, col, grid) {\r\n let className = col.className;\r\n if (typeof className === 'function') {\r\n className = className.call(col, item);\r\n }\r\n if (className == null) {\r\n element.className = 'col-icon';\r\n } else {\r\n element.className = `col-icon ${className}`;\r\n }\r\n let type = col.iconType;\r\n if (typeof type === 'function') {\r\n type = type.call(col, item);\r\n }\r\n type ??= 'fa-regular';\r\n if (element.dataset.type !== type || element.dataset.icon !== val) {\r\n const icon = createIcon(type, val);\r\n // const layer = element.children[0];\r\n element.replaceChildren(icon);\r\n !nullOrEmpty(col.tooltip) && setTooltip(element, col.tooltip, false, grid.element);\r\n element.dataset.type = type;\r\n element.dataset.icon = val;\r\n }\r\n }\r\n\r\n static setEnabled(element, enabled) {\r\n if (enabled === false) {\r\n element.classList.add('disabled');\r\n } else {\r\n element.classList.remove('disabled');\r\n }\r\n const tooltip = element.querySelector('.ui-tooltip-wrapper');\r\n if (tooltip != null) {\r\n tooltip.style.display = enabled === false ? 'none' : '';\r\n }\r\n }\r\n}\r\n\r\nexport {\r\n GridColumn,\r\n GridInputColumn,\r\n GridTextColumn,\r\n GridDropdownColumn,\r\n GridCheckboxColumn,\r\n GridIconColumn\r\n}","import '../css/grid.scss';\r\nimport { global, isPositive, isMobile, throttle, truncate } from \"../../utility\";\r\nimport { r } from \"../../utility/lgres\";\r\nimport { createElement } from \"../../functions\";\r\nimport { createIcon } from \"../icon\";\r\nimport { createCheckbox } from \"../checkbox\";\r\nimport { GridColumn, GridInputColumn, GridTextColumn, GridDropdownColumn, GridCheckboxColumn, GridIconColumn } from \"./column\";\r\n\r\nconst ColumnChangedType = {\r\n Reorder: 'reorder',\r\n Resize: 'resize',\r\n Sort: 'sort'\r\n};\r\nconst RefreshInterval = isMobile() ? 32 : 0;\r\nconst HoverInternal = 200;\r\nconst RedumCount = 4;\r\nconst MiniDragOffset = 4;\r\nconst MiniColumnWidth = 50;\r\nconst FilterPanelWidth = 200;\r\n\r\nfunction getClientX(e) {\r\n if (e == null) {\r\n return null;\r\n }\r\n const cx = e.touches && e.touches[0]?.clientX;\r\n return cx ?? e.clientX;\r\n}\r\n\r\nfunction getOffsetLeftFromWindow(element) {\r\n let left = 0;\r\n while (element != null) {\r\n left += element.offsetLeft;\r\n element = element.offsetParent;\r\n }\r\n return left;\r\n}\r\n\r\nfunction indexOfParent(target) {\r\n // return [...target.parentElement.children].indexOf(target);\r\n return Array.prototype.indexOf.call(target.parentElement.children, target);\r\n}\r\n\r\nconst ColumnTypes = {\r\n 0: GridColumn,\r\n 1: GridInputColumn,\r\n 2: GridDropdownColumn,\r\n 3: GridCheckboxColumn,\r\n 4: GridIconColumn,\r\n 5: GridTextColumn\r\n};\r\n\r\nclass Grid {\r\n #source;\r\n #currentSource;\r\n #parent;\r\n #el;\r\n #refs;\r\n #rendering;\r\n #selectedColumnIndex = -1;\r\n #selectedIndexes;\r\n #startIndex = 0;\r\n #needResize;\r\n #containerHeight;\r\n #bodyClientWidth;\r\n #rowCount = -1;\r\n #scrollTop;\r\n #scrollLeft;\r\n #colTypes = {};\r\n #colAttrs = {};\r\n #vtable = [];\r\n\r\n columns = [];\r\n langs = {\r\n all: r('allItem', '( All )'),\r\n ok: r('ok', 'OK'),\r\n reset: r('reset', 'Reset')\r\n };\r\n virtualCount = 100;\r\n rowHeight = 36;\r\n lineHeight = 24;\r\n extraRows = 0;\r\n filterRowHeight = 30;\r\n height;\r\n readonly;\r\n multiSelect = false;\r\n fullrowClick = true;\r\n allowHtml = false;\r\n holderDisabled = false;\r\n headerVisible = true;\r\n window = global;\r\n sortIndex = -1;\r\n sortDirection = 1;\r\n\r\n willSelect;\r\n selectedRowChanged;\r\n cellDblClicked;\r\n cellClicked;\r\n rowDblClicked;\r\n columnChanged;\r\n\r\n static ColumnTypes = {\r\n Common: 0,\r\n Input: 1,\r\n Dropdown: 2,\r\n Checkbox: 3,\r\n Icon: 4,\r\n Text: 5,\r\n isCheckbox(type) { return type === 3 }\r\n };\r\n\r\n static GridColumn = GridColumn;\r\n\r\n constructor(container) {\r\n this.#parent = container;\r\n }\r\n\r\n get element() { return this.#el }\r\n\r\n get source() { return this.#source?.map(s => s.values) }\r\n set source(list) {\r\n if (this.#el == null) {\r\n throw new Error('grid has not been initialized.')\r\n }\r\n if (!Array.isArray(list)) {\r\n throw new Error('source is not an Array.')\r\n }\r\n list = list.map(i => { return { values: i } });\r\n this.#source = list;\r\n this.#refreshSource(list);\r\n }\r\n\r\n #refreshSource(list) {\r\n list ??= this.#source;\r\n if (this.#colAttrs.__filtered === true) {\r\n this.#currentSource = list.filter(it => {\r\n for (let col of this.columns) {\r\n if (Array.isArray(col.filterValues)) {\r\n const v = this.#getItemValue(it.values, col.key, col.filter);\r\n if (col.filterValues.indexOf(v) < 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n } else {\r\n this.#currentSource = list;\r\n }\r\n this.#selectedColumnIndex = -1;\r\n this.#selectedIndexes = [];\r\n this.#startIndex = 0;\r\n this.#scrollTop = 0;\r\n this.#scrollLeft = 0;\r\n this.#rowCount = -1;\r\n\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn();\r\n }\r\n this.resize();\r\n }\r\n\r\n get virtual() { return this.#currentSource?.length > this.virtualCount }\r\n\r\n get sortKey() {\r\n if (this.columns == null) {\r\n return null;\r\n }\r\n return this.columns[this.sortIndex]?.key;\r\n }\r\n\r\n get selectedIndexes() { return this.#selectedIndexes }\r\n set selectedIndexes(indexes) {\r\n const startIndex = this.#startIndex;\r\n this.#selectedIndexes.splice(0, this.#selectedIndexes.length, ...indexes);\r\n if (this.readonly !== true) {\r\n this.refresh();\r\n } else {\r\n [...this.#refs.bodyContent.children].forEach((row, i) => {\r\n if (indexes.indexOf(startIndex + i) >= 0) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n });\r\n }\r\n if (typeof this.selectedRowChanged === 'function') {\r\n this.selectedRowChanged();\r\n }\r\n }\r\n\r\n get selectedIndex() { return (this.#selectedIndexes && this.#selectedIndexes[0]) ?? -1 }\r\n\r\n get loading() { return this.#refs.loading?.style?.visibility === 'visible' }\r\n set loading(flag) {\r\n if (this.#refs.loading == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n this.#refs.loading.style.visibility = 'hidden';\r\n this.#refs.loading.style.opacity = 0;\r\n } else {\r\n this.#refs.loading.style.visibility = 'visible';\r\n this.#refs.loading.style.opacity = 1;\r\n }\r\n }\r\n\r\n get scrollTop() { return this.#refs.body?.scrollTop; }\r\n set scrollTop(top) {\r\n if (this.#refs.body == null) {\r\n return;\r\n }\r\n this.#refs.body.scrollTop = top;\r\n this.reload();\r\n }\r\n\r\n init(container = this.#parent) {\r\n this.#el = null;\r\n this.#refs = {};\r\n this.#rendering = true;\r\n if (!(container instanceof HTMLElement)) {\r\n throw new Error('no specified parent.');\r\n }\r\n this.#parent = container;\r\n const grid = createElement('div', 'ui-grid');\r\n grid.setAttribute('tabindex', 0);\r\n grid.addEventListener('keydown', e => {\r\n let index = this.selectedIndex;\r\n let flag = false;\r\n if (e.key === 'ArrowUp') {\r\n // up\r\n if (index > 0) {\r\n flag = true;\r\n index -= 1;\r\n }\r\n } else if (e.key === 'ArrowDown') {\r\n // down\r\n const count = this.#currentSource?.length ?? 0;\r\n if (index < count - 1) {\r\n flag = true;\r\n index += 1;\r\n }\r\n }\r\n if (flag) {\r\n this.#selectedIndexes = [index];\r\n this.scrollToIndex(index);\r\n this.refresh();\r\n if (typeof this.selectedRowChanged === 'function') {\r\n this.selectedRowChanged(index);\r\n }\r\n e.stopPropagation();\r\n }\r\n });\r\n container.replaceChildren(grid);\r\n const sizer = createElement('span', 'ui-grid-sizer');\r\n grid.appendChild(sizer);\r\n this.#refs.sizer = sizer;\r\n\r\n // header & body\r\n const header = this.#createHeader();\r\n grid.appendChild(header);\r\n const body = this.#createBody();\r\n grid.appendChild(body);\r\n\r\n // loading\r\n const loading = createElement('div', 'ui-grid-loading',\r\n createElement('div', null, createIcon('fa-regular', 'spinner-third'))\r\n );\r\n this.#refs.loading = loading;\r\n grid.appendChild(loading);\r\n this.#el = grid;\r\n\r\n this.#rendering = false;\r\n if (this.#source != null && this.sortIndex >= 0) {\r\n this.sortColumn();\r\n }\r\n }\r\n\r\n scrollToIndex(index) {\r\n const top = this.#scrollToTop(index * (this.rowHeight + 1), true);\r\n this.#refs.body.scrollTop = top;\r\n }\r\n\r\n resize(force) {\r\n if (this.#rendering || this.#el == null) {\r\n return;\r\n }\r\n const body = this.#refs.body;\r\n // let height = this.#refs.header.offsetHeight + 2;\r\n // let top = body.offsetTop;\r\n // if (top !== height) {\r\n // body.style.top = `${height}px`;\r\n // top = height;\r\n // }\r\n const top = this.headerVisible === false ? 0 : this.#refs.header.offsetHeight;\r\n\r\n let height = this.height;\r\n if (height === 0) {\r\n height = this.#containerHeight;\r\n } else if (isNaN(height) || height < 0) {\r\n height = this.#el.offsetHeight - top;\r\n }\r\n const count = truncate((height - 1) / (this.rowHeight + 1)) + (RedumCount * 2) + 1;\r\n if (force || count !== this.#rowCount) {\r\n this.#rowCount = count;\r\n this.reload();\r\n }\r\n this.#bodyClientWidth = body.clientWidth;\r\n }\r\n\r\n reload() {\r\n let length = this.#currentSource.length;\r\n if (this.extraRows > 0) {\r\n length += this.extraRows;\r\n }\r\n this.#containerHeight = length * (this.rowHeight + 1);\r\n this.#refs.body.scrollTop = 0;\r\n this.#refs.body.scrollLeft = 0;\r\n this.#refs.bodyContent.style.top = '0px';\r\n this.#refs.bodyContainer.style.height = `${this.#containerHeight}px`;\r\n this.#adjustRows(this.#refs.bodyContent);\r\n this.refresh();\r\n }\r\n\r\n refresh() {\r\n if (this.#refs.bodyContent == null) {\r\n throw new Error('body has not been created.');\r\n }\r\n const rows = this.#refs.bodyContent.children;\r\n const widths = {};\r\n this.#fillRows(rows, this.columns, widths);\r\n if (this.#needResize && widths.flag) {\r\n this.#needResize = false;\r\n this.columns.forEach((col, i) => {\r\n if (!this.#get(col.key, 'autoResize')) {\r\n return;\r\n }\r\n let width = widths[i];\r\n if (width < col.width) {\r\n width = col.width;\r\n }\r\n if (width > 0) {\r\n this.#changeColumnWidth(i, width);\r\n }\r\n });\r\n }\r\n }\r\n\r\n resetChange() {\r\n if (this.#source == null) {\r\n return;\r\n }\r\n for (let row of this.#source) {\r\n delete row.__changed;\r\n }\r\n }\r\n\r\n sortColumn(reload) {\r\n const index = this.sortIndex;\r\n const col = this.columns[index];\r\n if (col == null) {\r\n return;\r\n }\r\n const direction = this.sortDirection;\r\n [...this.#refs.header.children].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n if (i === index) {\r\n arrow.className = `arrow ${(direction !== 1 ? 'desc' : 'asc')}`;\r\n } else if (arrow.className !== 'arrow') {\r\n arrow.className = 'arrow';\r\n }\r\n });\r\n let comparer;\r\n if (typeof col.sortFilter !== 'function') {\r\n const direction = this.sortDirection;\r\n if (isNaN(direction)) {\r\n direction = 1;\r\n }\r\n comparer = (a, b) => {\r\n a = this.#getItemValue(a.values, col.key, col.filter);\r\n b = this.#getItemValue(b.values, col.key, col.filter);\r\n if (a == null && typeof b === 'number') {\r\n a = 0;\r\n } else if (typeof a === 'number' && b == null) {\r\n b = 0;\r\n } else if (a != null && b == null) {\r\n return direction;\r\n } else if (typeof a === 'string' && typeof b === 'string') {\r\n a = a.toLowerCase();\r\n b = b.toLowerCase();\r\n }\r\n return a === b ? 0 : (a > b ? 1 : -1) * direction;\r\n };\r\n } else {\r\n comparer = (a, b) => col.sortFilter(a.values, b.values) * direction;\r\n }\r\n this.#source.sort(comparer);\r\n if (this.#colAttrs.__filtered === true) {\r\n this.#currentSource.sort(comparer);\r\n }\r\n if (this.#rowCount < 0) {\r\n return;\r\n }\r\n if (reload) {\r\n this.reload();\r\n } else {\r\n this.refresh();\r\n }\r\n }\r\n\r\n #createHeader() {\r\n const thead = createElement('table', 'ui-grid-header');\r\n if (this.headerVisible === false) {\r\n thead.style.display = 'none';\r\n }\r\n const header = createElement('tr');\r\n thead.appendChild(header);\r\n const sizer = this.#refs.sizer;\r\n for (let col of this.columns) {\r\n if (col.visible === false) {\r\n const hidden = createElement('th');\r\n hidden.style.display = 'none';\r\n if (col.sortable !== false) {\r\n hidden.dataset.key = col.key;\r\n hidden.addEventListener('click', e => this.#onHeaderClicked(e, col, true));\r\n }\r\n header.appendChild(hidden);\r\n continue;\r\n }\r\n // style\r\n const isCheckbox = Grid.ColumnTypes.isCheckbox(col.type);\r\n if (col.width > 0) {\r\n // col.autoResize = false;\r\n } else {\r\n this.#set(col.key, 'autoResize', true);\r\n this.#needResize = true;\r\n sizer.innerText = col.caption ?? '';\r\n let width = sizer.offsetWidth + 22;\r\n if (!this.readonly && col.enabled !== false && col.allcheck && isCheckbox) {\r\n width += 32;\r\n }\r\n if (col.allowFilter === true) {\r\n width += 14;\r\n }\r\n if (width < MiniColumnWidth) {\r\n width = MiniColumnWidth;\r\n }\r\n col.width = width;\r\n }\r\n col.align ??= isCheckbox ? 'center' : 'left';\r\n if (col.sortable !== false) {\r\n col.sortable = true;\r\n }\r\n const w = `${col.width}px`;\r\n const style = {\r\n 'width': w,\r\n 'max-width': w,\r\n 'min-width': w,\r\n 'text-align': col.align\r\n };\r\n this.#set(col.key, 'style', style);\r\n // element\r\n const th = createElement('th', 'column');\r\n th.dataset.key = col.key;\r\n for (let css of Object.entries(style)) {\r\n th.style.setProperty(css[0], css[1]);\r\n }\r\n if (col.sortable) {\r\n th.style.cursor = 'pointer';\r\n th.addEventListener('click', e => this.#onHeaderClicked(e, col));\r\n }\r\n if (col.orderable !== false) {\r\n col.orderable = true;\r\n th.addEventListener('mousedown', e => this.#onDragStart(e, col));\r\n }\r\n const wrapper = createElement('div');\r\n th.appendChild(wrapper);\r\n if (!this.readonly && col.enabled !== false && col.allcheck && isCheckbox) {\r\n const check = createCheckbox({\r\n onchange: e => this.#onColumnAllChecked(col, e.target.checked)\r\n });\r\n wrapper.appendChild(check);\r\n }\r\n const caption = createElement('span');\r\n if (col.textStyle != null) {\r\n for (let css of Object.entries(col.textStyle)) {\r\n caption.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n caption.innerText = col.caption ?? '';\r\n wrapper.appendChild(caption);\r\n // order arrow\r\n if (col.sortable) {\r\n th.appendChild(createElement('layer', 'arrow'));\r\n }\r\n // filter\r\n if (col.allowFilter === true) {\r\n const filter = createElement('layer', 'filter');\r\n filter.appendChild(createIcon('fa-solid', 'filter'));\r\n filter.addEventListener('mousedown', e => this.#onFilter(e, col));\r\n th.classList.add('header-filter');\r\n th.appendChild(filter);\r\n }\r\n // resize spliter\r\n if (col.resizable !== false) {\r\n const spliter = createElement('layer', 'spliter');\r\n spliter.addEventListener('mousedown', e => this.#onResizeStart(e, col));\r\n spliter.addEventListener('dblclick', e => this.#onAutoResize(e, col));\r\n th.appendChild(spliter);\r\n }\r\n // tooltip\r\n // !nullOrEmpty(col.tooltip) && setTooltip(th, col.tooltip);\r\n header.appendChild(th);\r\n }\r\n const dragger = createElement('div', 'dragger');\r\n const draggerCursor = createElement('layer', 'dragger-cursor');\r\n header.appendChild(createElement('th', null, dragger, draggerCursor));\r\n\r\n sizer.replaceChildren();\r\n this.#refs.header = header;\r\n this.#refs.dragger = dragger;\r\n this.#refs.draggerCursor = draggerCursor;\r\n return thead;\r\n }\r\n\r\n #createBody() {\r\n const body = createElement('div', 'ui-grid-body');\r\n body.addEventListener('scroll', e => throttle(this.#onScroll, RefreshInterval, this, e), { passive: true });\r\n const cols = this.columns;\r\n let width = 1;\r\n for (let col of cols) {\r\n if (col.visible !== false && !isNaN(col.width)) {\r\n width += col.width + 1;\r\n }\r\n }\r\n // body container\r\n const bodyContainer = createElement('div');\r\n bodyContainer.style.position = 'relative';\r\n bodyContainer.style.minWidth = '100%';\r\n bodyContainer.style.minHeight = '1px';\r\n if (width > 0) {\r\n bodyContainer.style.width = `${width}px`;\r\n }\r\n body.appendChild(bodyContainer);\r\n // body content\r\n const bodyContent = createElement('table', 'ui-grid-body-content');\r\n bodyContent.addEventListener('mousedown', e => {\r\n let [parent, target] = this.#getRowTarget(e.target);\r\n const rowIndex = indexOfParent(parent);\r\n let colIndex = indexOfParent(target);\r\n if (colIndex >= this.columns.length) {\r\n colIndex = -1;\r\n }\r\n this.#onRowClicked(e, rowIndex, colIndex);\r\n });\r\n bodyContent.addEventListener('dblclick', e => this.#onRowDblClicked(e));\r\n bodyContainer.appendChild(bodyContent);\r\n // this.#adjustRows();\r\n // events\r\n if (!this.holderDisabled) {\r\n const holder = createElement('div', 'ui-grid-hover-holder');\r\n holder.addEventListener('mousedown', e => {\r\n const holder = e.currentTarget;\r\n const row = Number(holder.dataset.row);\r\n const col = Number(holder.dataset.col);\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n }\r\n return this.#onRowClicked(e, row + this.#startIndex, col);\r\n });\r\n holder.addEventListener('dblclick', e => this.#onRowDblClicked(e));\r\n bodyContainer.appendChild(holder);\r\n body.addEventListener('mousemove', e => throttle(this.#onBodyMouseMove, HoverInternal, this, e, holder), { passive: true });\r\n }\r\n this.#refs.body = body;\r\n this.#refs.bodyContainer = bodyContainer;\r\n this.#refs.bodyContent = bodyContent;\r\n\r\n // this.refresh();\r\n return body;\r\n }\r\n\r\n #adjustRows() {\r\n let count = this.#rowCount;\r\n if (isNaN(count) || count < 0 || !this.virtual) {\r\n count = this.#currentSource.length;\r\n }\r\n const cols = this.columns;\r\n const content = this.#refs.bodyContent;\r\n const exists = content.children.length;\r\n count -= exists;\r\n if (count > 0) {\r\n for (let i = 0; i < count; i += 1) {\r\n const row = createElement('tr', 'ui-grid-row');\r\n // row.addEventListener('mousedown', e => this.#onRowClicked(e, exists + i));\r\n // row.addEventListener('dblclick', e => this.#onRowDblClicked(e));\r\n cols.forEach((col, j) => {\r\n const cell = createElement('td');\r\n if (col.visible !== false) {\r\n cell.dataset.row = String(exists + i);\r\n cell.dataset.col = String(j);\r\n const style = this.#get(col.key, 'style');\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n cell.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n if (col.css != null) {\r\n for (let css of Object.entries(col.css)) {\r\n cell.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n if (Grid.ColumnTypes.isCheckbox(col.type)) {\r\n cell.appendChild(GridCheckboxColumn.createEdit(e => this.#onRowChanged(e, exists + i, col, e.target.checked)));\r\n // this.#colTypes[col.key] = GridCheckboxColumn;\r\n } else {\r\n let type = this.#colTypes[col.key];\r\n if (type == null) {\r\n if (isNaN(col.type)) {\r\n if (this.allowHtml && col.type != null) {\r\n type = col.type;\r\n }\r\n } else {\r\n type = ColumnTypes[col.type];\r\n }\r\n type ??= GridColumn;\r\n this.#colTypes[col.key] = type;\r\n }\r\n cell.appendChild(type.create(col));\r\n }\r\n }\r\n row.appendChild(cell);\r\n });\r\n row.appendChild(createElement('td'));\r\n content.appendChild(row);\r\n }\r\n } else if (count < 0) {\r\n for (let i = -1; i >= count; i -= 1) {\r\n // content.removeChild(content.children[exists + i]);\r\n content.children[exists + i].remove();\r\n }\r\n }\r\n }\r\n\r\n #fillRows(rows, cols, widths) {\r\n const startIndex = this.#startIndex;\r\n const selectedIndexes = this.#selectedIndexes;\r\n [...rows].forEach((row, i) => {\r\n const vals = this.#currentSource[startIndex + i];\r\n if (vals == null) {\r\n return;\r\n }\r\n if (!isPositive(row.children.length)) {\r\n return;\r\n }\r\n const item = vals.values;\r\n const selected = selectedIndexes.indexOf(startIndex + i) >= 0;\r\n if (selected) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n // data\r\n const selectChanged = vals.__selected ^ selected;\r\n if (selected) {\r\n vals.__selected = true;\r\n } else {\r\n delete vals.__selected;\r\n }\r\n cols.forEach((col, j) => {\r\n if (col.visible === false) {\r\n return;\r\n }\r\n let val;\r\n if (col.text != null) {\r\n val = col.text;\r\n } else if (typeof col.filter === 'function') {\r\n val = col.filter(item);\r\n } else {\r\n val = item[col.key];\r\n if (val?.displayValue != null) {\r\n val = val.displayValue;\r\n }\r\n }\r\n val ??= '';\r\n // fill\r\n const cell = row.children[j];\r\n if (typeof col.bgFilter === 'function') {\r\n const bgColor = col.bgFilter(item);\r\n cell.style.backgroundColor = bgColor ?? '';\r\n }\r\n const isCheckbox = Grid.ColumnTypes.isCheckbox(col.type);\r\n const type = isCheckbox ? GridCheckboxColumn : this.#colTypes[col.key] ?? GridColumn;\r\n let element;\r\n if (!isCheckbox && selectChanged && typeof type.createEdit === 'function') {\r\n if (vals.__editing?.[col.key] && type.editing) {\r\n val = type.getValue({ target: cell.children[0] });\r\n this.#onRowChanged(null, startIndex + i, col, val, true);\r\n }\r\n element = selected ?\r\n type.createEdit(e => this.#onRowChanged(e, startIndex + i, col, type.getValue(e)), col, this.#refs.bodyContent, vals) :\r\n type.create(col);\r\n cell.replaceChildren(element);\r\n } else {\r\n element = cell.children[0];\r\n }\r\n let enabled;\r\n if (this.readonly) {\r\n enabled = false;\r\n } else {\r\n enabled = col.enabled;\r\n if (typeof enabled === 'function') {\r\n enabled = enabled.call(col, item);\r\n } else if (typeof enabled === 'string') {\r\n enabled = item[enabled];\r\n }\r\n }\r\n type.setValue(element, val, item, col, this);\r\n if (typeof type.setEnabled === 'function') {\r\n type.setEnabled(element, enabled);\r\n }\r\n // auto resize\r\n if (this.#needResize && this.#get(col.key, 'autoResize')) {\r\n const width = element.scrollWidth + 12;\r\n if (width > 0 && widths != null && (isNaN(widths[j]) || widths[j] < width)) {\r\n widths[j] = width;\r\n widths.flag = true;\r\n }\r\n }\r\n if (typeof col.styleFilter === 'function') {\r\n const style = col.styleFilter(item);\r\n if (style != null) {\r\n type.setStyle(element, style);\r\n }\r\n }\r\n if (col.events != null) {\r\n for (let ev of Object.entries(col.events)) {\r\n element[ev[0]] = ev[1].bind(item);\r\n }\r\n }\r\n if (col.attrs != null) {\r\n let attrs = col.attrs;\r\n if (typeof attrs === 'function') {\r\n attrs = attrs(item);\r\n }\r\n for (let attr of Object.entries(attrs)) {\r\n element.setAttribute(attr[0], attr[1]);\r\n }\r\n }\r\n });\r\n if (vals.__editing != null) {\r\n delete vals.__editing;\r\n }\r\n });\r\n }\r\n\r\n #changeColumnWidth(index, width) {\r\n const col = this.columns[index];\r\n // const oldwidth = col.width;\r\n const w = `${width}px`;\r\n col.width = width;\r\n const style = this.#get(col.key, 'style');\r\n style.width = w;\r\n style['max-width'] = w;\r\n style['min-width'] = w;\r\n let element = this.#refs.header.children[index];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n const body = this.#refs.bodyContent;\r\n for (let row of body.children) {\r\n element = row.children[index];\r\n if (element != null) {\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n }\r\n }\r\n // } else {\r\n // width = this.#refs.bodyContainer.offsetWidth - oldwidth + width;\r\n // this.#refs.bodyContainer.style.width = `${width}px`;\r\n // }\r\n }\r\n\r\n #changingColumnOrder(index, offset, x, offsetLeft) {\r\n const children = this.#refs.header.children;\r\n let element = children[index];\r\n this.#refs.dragger.style.left = `${element.offsetLeft - offsetLeft + offset}px`;\r\n this.#refs.dragger.style.width = element.style.width;\r\n this.#refs.dragger.style.display = 'block';\r\n offset = x - getOffsetLeftFromWindow(element);\r\n let idx;\r\n if (offset < 0) {\r\n offset = -offset;\r\n for (let i = index - 1; i >= 0 && offset >= 0; i -= 1) {\r\n element = children[i];\r\n if (element == null || element.className !== 'column') {\r\n break;\r\n }\r\n if (offset < element.offsetWidth) {\r\n idx = (offset > element.offsetWidth / 2) ? i : i + 1;\r\n break;\r\n }\r\n offset -= element.offsetWidth;\r\n }\r\n idx ??= 0;\r\n } else {\r\n const count = children.length;\r\n for (let i = index; i < count - 1 && offset >= 0; i += 1) {\r\n element = children[i];\r\n if (element == null || element.className !== 'column') {\r\n idx = i;\r\n break;\r\n }\r\n if (offset < element.offsetWidth) {\r\n idx = (offset > element.offsetWidth / 2) ? i + 1 : i;\r\n break;\r\n }\r\n offset -= element.offsetWidth;\r\n }\r\n idx ??= count - 1;\r\n }\r\n if (idx !== this.#colAttrs.__orderIndex) {\r\n this.#colAttrs.__orderIndex = idx;\r\n element = children[idx];\r\n if (element == null) {\r\n return;\r\n }\r\n this.#refs.draggerCursor.style.left = `${element.offsetLeft - offsetLeft}px`;\r\n this.#refs.draggerCursor.style.display = 'block';\r\n }\r\n }\r\n\r\n #changeColumnOrder(index) {\r\n this.#refs.dragger.style.display = '';\r\n this.#refs.draggerCursor.style.display = '';\r\n const orderIndex = this.#colAttrs.__orderIndex;\r\n if (orderIndex >= 0 && orderIndex !== index) {\r\n let targetIndex = orderIndex - index;\r\n if (targetIndex >= 0 && targetIndex <= 1) {\r\n return;\r\n }\r\n const header = this.#refs.header;\r\n const children = header.children;\r\n const rows = this.#refs.bodyContent.children;\r\n const columns = this.columns;\r\n if (targetIndex > 1) {\r\n targetIndex = orderIndex - 1;\r\n // const current = columns[index];\r\n // for (let i = index; i < targetIndex; i += 1) {\r\n // columns[i] = columns[i + 1];\r\n // }\r\n // columns[targetIndex] = current;\r\n const current = columns.splice(index, 1)[0];\r\n columns.splice(targetIndex, 0, current);\r\n header.insertBefore(children[index], children[targetIndex].nextElementSibling);\r\n for (let row of rows) {\r\n row.insertBefore(row.children[index], row.children[targetIndex].nextElementSibling);\r\n }\r\n } else {\r\n targetIndex = orderIndex;\r\n // const current = columns[index];\r\n // for (let i = index; i > targetIndex; i -= 1) {\r\n // columns[i] = columns[i - 1];\r\n // }\r\n // columns[targetIndex] = current;\r\n const current = columns.splice(index, 1)[0];\r\n columns.splice(targetIndex, 0, current);\r\n header.insertBefore(children[index], children[targetIndex]);\r\n for (let row of rows) {\r\n row.insertBefore(row.children[index], row.children[targetIndex]);\r\n }\r\n }\r\n // refresh sortIndex\r\n [...children].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n if (arrow.className !== 'arrow') {\r\n this.sortIndex = i;\r\n }\r\n });\r\n\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Reorder, index, targetIndex);\r\n }\r\n }\r\n }\r\n\r\n #scrollToTop(top, reload) {\r\n const rowHeight = (this.rowHeight + 1);\r\n top -= (top % (rowHeight * 2)) + (RedumCount * rowHeight);\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this.#containerHeight - (reload ? 0 : this.#rowCount * rowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this.#scrollTop !== top) {\r\n this.#scrollTop = top;\r\n if (this.virtual) {\r\n this.#startIndex = top / rowHeight;\r\n }\r\n this.refresh();\r\n if (this.virtual) {\r\n this.#refs.bodyContent.style.top = `${top}px`;\r\n }\r\n } else if (reload) {\r\n this.refresh();\r\n }\r\n\r\n return top;\r\n }\r\n\r\n #get(key, name) {\r\n const attr = this.#colAttrs[key];\r\n if (attr == null) {\r\n return null;\r\n }\r\n return attr[name];\r\n }\r\n\r\n #set(key, name, value) {\r\n const attr = this.#colAttrs[key];\r\n if (attr == null) {\r\n this.#colAttrs[key] = { [name]: value };\r\n } else {\r\n attr[name] = value;\r\n }\r\n }\r\n\r\n #getItemValue(item, key, filter) {\r\n let value;\r\n if (typeof filter === 'function') {\r\n value = filter(item);\r\n } else {\r\n value = item[key];\r\n }\r\n return value?.value ?? value;\r\n }\r\n\r\n #getRowTarget(target) {\r\n let parent;\r\n while ((parent = target.parentElement) != null && !parent.classList.contains('ui-grid-row')) {\r\n target = parent;\r\n }\r\n return [parent, target];\r\n }\r\n\r\n #notHeader(tagName) {\r\n return /^(input|label|layer|svg|use)$/i.test(tagName);\r\n }\r\n\r\n #onHeaderClicked(e, col, force) {\r\n if (!force && (this.#get(col.key, 'resizing') || this.#get(col.key, 'dragging'))) {\r\n return;\r\n }\r\n if (!this.#notHeader(e.target.tagName)) {\r\n const index = this.columns.indexOf(col);\r\n if (index < 0) {\r\n return;\r\n }\r\n if (this.sortIndex === index) {\r\n this.sortDirection = this.sortDirection === 1 ? -1 : 1;\r\n } else {\r\n this.sortIndex = index;\r\n }\r\n this.sortColumn(true);\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Sort, index, this.sortDirection);\r\n }\r\n }\r\n }\r\n\r\n #onCloseFilter() {\r\n const panels = this.#el.querySelectorAll('.filter-panel.active');\r\n if (panels.length > 0) {\r\n panels.forEach(el => el.classList.remove('active'));\r\n setTimeout(() => this.#el.querySelectorAll('.filter-panel').forEach(el => el.remove()), 120);\r\n const filtering = this.#colAttrs.__filtering;\r\n if (filtering instanceof HTMLElement) {\r\n filtering.classList.remove('hover');\r\n }\r\n delete this.#colAttrs.__filtering;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n #onFilter(e, col) {\r\n if (this.#onCloseFilter()) {\r\n return;\r\n }\r\n const close = e => {\r\n if ((e.target.tagName === 'LAYER' && e.target.classList.contains('filter')) ||\r\n e.target.tagName === 'use') {\r\n return;\r\n }\r\n if (this.#onCloseFilter()) {\r\n document.removeEventListener('mousedown', close);\r\n }\r\n }\r\n document.addEventListener('mousedown', close);\r\n const panel = createElement('div', 'filter-panel');\r\n panel.addEventListener('mousedown', e => e.stopPropagation());\r\n const filter = e.currentTarget;\r\n const th = filter.parentElement;\r\n const width = th.offsetWidth;\r\n panel.style.top = `${th.offsetHeight}px`;\r\n panel.style.left = (th.offsetLeft + (width > FilterPanelWidth ? width - FilterPanelWidth : 0)) + 'px';\r\n\r\n // search\r\n let searchbox;\r\n if (col.allowSearch !== false) {\r\n const searchholder = createElement('div', 'filter-search-holder');\r\n searchbox = createElement('input', 'filter-search-box ui-text');\r\n searchbox.type = 'text';\r\n const searchicon = createIcon('fa-regular', 'search');\r\n searchicon.addEventListener('mousedown', e => {\r\n searchbox.focus();\r\n e.preventDefault();\r\n });\r\n searchholder.append(searchbox, searchicon);\r\n panel.append(searchholder);\r\n }\r\n // list\r\n const itemlist = createElement('div', 'filter-item-list');\r\n itemlist.addEventListener('scroll', e => throttle(this.#onFilterScroll, RefreshInterval, this, col, itemlist, e.target.scrollTop), { passive: true });\r\n // - all\r\n const itemall = createElement('div', 'filter-item filter-all');\r\n itemall.appendChild(createCheckbox({\r\n label: this.langs.all,\r\n onchange: e => {\r\n const checked = e.target.checked;\r\n itemlist.querySelectorAll('.filter-content input').forEach(box => box.checked = checked);\r\n }\r\n }));\r\n itemlist.appendChild(itemall);\r\n // - items\r\n let array;\r\n if (Array.isArray(col.filterSource)) {\r\n array = col.filterSource;\r\n } else if (typeof col.filterSource === 'function') {\r\n array = col.filterSource.call(this, col);\r\n } else {\r\n const dict = Object.create(null);\r\n for (let item of this.#source) {\r\n const val = this.#getItemValue(item.values, col.key, col.filter);\r\n if (!Object.hasOwnProperty.call(dict, val)) {\r\n const v = item.values[col.key];\r\n dict[val] = {\r\n value: val,\r\n displayValue: typeof col.filter === 'function' ? col.filter(item.values) : v?.displayValue ?? v\r\n };\r\n }\r\n }\r\n array = Object.values(dict)\r\n .sort((a, b) => {\r\n a = a?.value ?? a;\r\n b = b?.value ?? b;\r\n return a > b ? 1 : a < b ? -1 : 0;\r\n });\r\n }\r\n array = array.map(i => {\r\n if (Object.prototype.hasOwnProperty.call(i, 'value') &&\r\n Object.prototype.hasOwnProperty.call(i, 'displayValue')) {\r\n return i;\r\n }\r\n return {\r\n value: i,\r\n displayValue: i == null ? '' : i\r\n };\r\n });\r\n this.#fillFilterList(col, itemlist, array, itemall);\r\n itemall.querySelector('input').checked = ![...itemlist.querySelectorAll('.filter-content input')].some(i => !i.checked);\r\n panel.appendChild(itemlist);\r\n if (searchbox != null) {\r\n searchbox.addEventListener('input', e => {\r\n const key = e.currentTarget.value.toLowerCase();\r\n const items = key.length === 0 ? array : array.filter(i => {\r\n const displayValue = i?.displayValue ?? i;\r\n return String(displayValue ?? '').indexOf(key) >= 0;\r\n });\r\n this.#fillFilterList(col, itemlist, items, itemall);\r\n });\r\n }\r\n // function\r\n const functions = createElement('div', 'filter-function');\r\n functions.append(\r\n createElement('button', ok => {\r\n ok.innerText = this.langs.ok;\r\n ok.addEventListener('click', () => {\r\n const array = this.#get(col.key, 'filterSource').filter(i => i.__checked !== false);\r\n if (typeof col.onFilterOk === 'function') {\r\n col.onFilterOk.call(this, col, array);\r\n } else {\r\n col.filterValues = array.map(a => a.value);\r\n }\r\n this.#colAttrs.__filtered = true;\r\n this.#refreshSource();\r\n if (typeof col.onFiltered === 'function') {\r\n col.onFiltered.call(this, col);\r\n }\r\n filter.classList.add('active');\r\n this.#onCloseFilter();\r\n });\r\n }),\r\n createElement('button', reset => {\r\n reset.innerText = this.langs.reset;\r\n reset.addEventListener('click', () => {\r\n delete col.filterValues;\r\n this.#colAttrs.__filtered = this.columns.some(c => col.filterValues != null)\r\n this.#refreshSource();\r\n if (typeof col.onFiltered === 'function') {\r\n col.onFiltered.call(this, col);\r\n }\r\n filter.classList.remove('active');\r\n this.#onCloseFilter();\r\n });\r\n })\r\n );\r\n panel.appendChild(functions);\r\n\r\n this.#el.appendChild(panel);\r\n setTimeout(() => panel.classList.add('active'), 0);\r\n this.#colAttrs.__filtering = filter;\r\n filter.classList.add('hover');\r\n }\r\n\r\n #fillFilterList(col, list, array, all) {\r\n list.querySelector('.filter-holder')?.remove();\r\n list.querySelector('.filter-content')?.remove();\r\n const rowHeight = this.filterRowHeight;\r\n const height = array.length * rowHeight;\r\n this.#set(col.key, 'filterHeight', height);\r\n const holder = createElement('div', 'filter-holder');\r\n holder.style.height = `${height}px`;\r\n const content = createElement('div', 'filter-content');\r\n content.style.top = `${rowHeight}px`;\r\n this.#set(col.key, 'filterSource', array);\r\n for (let item of array) {\r\n item.__checked = !Array.isArray(col.filterValues) || col.filterValues.indexOf(item.value ?? item) >= 0;\r\n }\r\n if (array.length > 12) {\r\n array = array.slice(0, 12);\r\n }\r\n this.#doFillFilterList(content, array, all);\r\n list.append(holder, content);\r\n }\r\n\r\n #doFillFilterList(content, array, all) {\r\n for (let item of array) {\r\n const div = createElement('div', 'filter-item');\r\n div.appendChild(createCheckbox({\r\n checked: item.__checked,\r\n label: item?.displayValue ?? item,\r\n onchange: e => {\r\n item.__checked = e.target.checked;\r\n all.querySelector('input').checked = ![...content.querySelectorAll('input')].some(i => !i.checked);\r\n }\r\n }));\r\n content.appendChild(div);\r\n }\r\n }\r\n\r\n #onFilterScroll(col, list, top) {\r\n const rowHeight = this.filterRowHeight;\r\n top -= (top % (rowHeight * 2)) + rowHeight;\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this.#get(col.key, 'filterHeight') - (12 * rowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this.#get(col.key, 'filterTop') !== top) {\r\n this.#set(col.key, 'filterTop', top);\r\n const startIndex = top / rowHeight;\r\n let array = this.#get(col.key, 'filterSource');\r\n if (startIndex + 12 < array.length) {\r\n array = array.slice(startIndex, startIndex + 12);\r\n } else {\r\n array = array.slice(-12);\r\n }\r\n const content = list.querySelector('.filter-content');\r\n content.replaceChildren();\r\n this.#doFillFilterList(content, array, list.querySelector('.filter-all>input'));\r\n content.style.top = `${top + rowHeight}px`;\r\n }\r\n }\r\n\r\n #onDragStart(e, col) {\r\n if (this.#notHeader(e.target.tagName)) {\r\n return;\r\n }\r\n const cx = getClientX(e);\r\n const index = indexOfParent(e.currentTarget);\r\n const clearEvents = attr => {\r\n for (let event of ['mousemove', 'mouseup']) {\r\n if (attr.hasOwnProperty(event)) {\r\n window.removeEventListener(event, attr[event]);\r\n delete attr[event];\r\n }\r\n }\r\n };\r\n let attr = this.#colAttrs[col.key];\r\n if (attr == null) {\r\n attr = this.#colAttrs[col.key] = {};\r\n } else {\r\n clearEvents(attr);\r\n }\r\n attr.dragging = true;\r\n const offsetLeft = this.#refs.header.querySelector('th:last-child').offsetLeft;\r\n const dragmove = e => {\r\n const cx2 = getClientX(e);\r\n const offset = cx2 - cx;\r\n let pos = attr.offset;\r\n let dragging;\r\n if (pos == null && (offset > MiniDragOffset || offset < -MiniDragOffset)) {\r\n dragging = true;\r\n } else if (pos !== offset) {\r\n dragging = true;\r\n }\r\n if (dragging) {\r\n this.#changingColumnOrder(index, offset, cx2, offsetLeft);\r\n attr.offset = offset;\r\n }\r\n };\r\n attr.mousemove = e => throttle(dragmove, RefreshInterval, this, e);\r\n attr.mouseup = () => {\r\n clearEvents(attr);\r\n if (attr.offset == null) {\r\n delete attr.dragging;\r\n } else {\r\n setTimeout(() => {\r\n delete attr.dragging;\r\n delete attr.offset;\r\n });\r\n this.#changeColumnOrder(index);\r\n }\r\n };\r\n ['mousemove', 'mouseup'].forEach(event => window.addEventListener(event, attr[event]));\r\n }\r\n\r\n #onResizeStart(e, col) {\r\n const cx = getClientX(e);\r\n const width = col.width;\r\n const index = indexOfParent(e.currentTarget.parentElement);\r\n const window = this.window ?? global;\r\n const clearEvents = attr => {\r\n for (let event of ['mousemove', 'mouseup']) {\r\n if (attr.hasOwnProperty(event)) {\r\n window.removeEventListener(event, attr[event]);\r\n delete attr[event];\r\n }\r\n }\r\n };\r\n let attr = this.#colAttrs[col.key];\r\n if (attr == null) {\r\n attr = this.#colAttrs[col.key] = {};\r\n } else {\r\n clearEvents(attr);\r\n }\r\n attr.resizing = width;\r\n const resizemove = e => {\r\n const cx2 = getClientX(e);\r\n const val = width + (cx2 - cx);\r\n if (val < MiniColumnWidth) {\r\n return;\r\n }\r\n attr.resizing = val;\r\n attr.sizing = true;\r\n this.#changeColumnWidth(index, val);\r\n };\r\n attr.mousemove = e => throttle(resizemove, RefreshInterval, this, e);\r\n attr.mouseup = e => {\r\n clearEvents(attr);\r\n const width = attr.resizing;\r\n if (width != null) {\r\n setTimeout(() => delete attr.resizing);\r\n if (attr.sizing) {\r\n delete attr.sizing;\r\n delete attr.autoResize;\r\n this.#changeColumnWidth(index, width);\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Resize, index, width);\r\n }\r\n }\r\n }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n ['mousemove', 'mouseup'].forEach(event => window.addEventListener(event, attr[event]));\r\n }\r\n\r\n #onAutoResize(e, col) {\r\n const th = e.currentTarget.parentElement;\r\n const index = indexOfParent(th);\r\n let width = th.querySelector('div:first-child').scrollWidth;\r\n for (let row of this.#refs.bodyContent.children) {\r\n const element = row.children[index].children[0];\r\n const w = element.scrollWidth;\r\n if (w > width) {\r\n width = w;\r\n }\r\n }\r\n if (width < MiniColumnWidth) {\r\n width = MiniColumnWidth;\r\n }\r\n if (width > 0 && width !== col.width) {\r\n width += 12;\r\n this.#changeColumnWidth(index, width);\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Resize, index, width);\r\n }\r\n }\r\n }\r\n\r\n #onColumnAllChecked(col, flag) {\r\n if (this.#currentSource == null) {\r\n return;\r\n }\r\n const key = col.key;\r\n const isFunction = typeof col.enabled === 'function';\r\n const isString = typeof col.enabled === 'string';\r\n if (typeof col.onallchecked === 'function') {\r\n col.onallchecked.call(this, col, flag);\r\n } else {\r\n for (let row of this.#currentSource) {\r\n const item = row.values;\r\n if (item == null) {\r\n continue;\r\n }\r\n const enabled = isFunction ? col.enabled(item) : isString ? item[col.enabled] : col.enabled;\r\n if (enabled !== false) {\r\n item[key] = flag;\r\n row.__changed = true;\r\n if (typeof col.onchanged === 'function') {\r\n col.onchanged.call(this, item, flag);\r\n }\r\n }\r\n }\r\n this.refresh();\r\n }\r\n }\r\n\r\n #onScroll(e) {\r\n const left = e.target.scrollLeft;\r\n if (this.#scrollLeft !== left) {\r\n this.#scrollLeft = left;\r\n this.#refs.header.style.left = `${-left}px`;\r\n }\r\n if (!this.virtual) {\r\n return;\r\n }\r\n const top = e.target.scrollTop;\r\n this.#scrollToTop(top);\r\n }\r\n\r\n #onBodyMouseMove(e, holder) {\r\n if (e.target.classList.contains('ui-grid-hover-holder')) {\r\n return;\r\n }\r\n let [parent, target] = this.#getRowTarget(e.target);\r\n if (parent == null) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n }\r\n return;\r\n }\r\n const element = target.children[0];\r\n if (element?.tagName !== 'SPAN') {\r\n if (holder.classList.contains('active')) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n holder.classList.remove('active');\r\n }\r\n return;\r\n }\r\n const row = target.dataset.row;\r\n const col = target.dataset.col;\r\n if (holder.dataset.row === row &&\r\n holder.dataset.col === col) {\r\n return;\r\n }\r\n if (element.scrollWidth > element.offsetWidth) {\r\n holder.dataset.row = row;\r\n holder.dataset.col = col;\r\n holder.innerText = element.innerText;\r\n const top = this.#refs.bodyContent.offsetTop + target.offsetTop;\r\n let left = target.offsetLeft;\r\n let width = holder.offsetWidth;\r\n if (width > this.#bodyClientWidth) {\r\n width = this.#bodyClientWidth;\r\n }\r\n const maxleft = this.#bodyClientWidth + this.#scrollLeft - width;\r\n if (left > maxleft) {\r\n left = maxleft;\r\n }\r\n const height = target.offsetHeight;\r\n holder.style.cssText = `top: ${top}px; left: ${left}px; max-width: ${this.#bodyClientWidth}px; height: ${height - 2}px`;\r\n holder.classList.add('active');\r\n } else if (holder.classList.contains('active')) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n holder.classList.remove('active');\r\n }\r\n }\r\n\r\n #onRowClicked(e, index, colIndex) {\r\n const startIndex = this.#startIndex;\r\n const selectedIndex = startIndex + index;\r\n if (typeof this.willSelect === 'function' && !this.willSelect(selectedIndex, colIndex)) {\r\n return;\r\n }\r\n // multi-select\r\n let flag = false;\r\n const selectedIndexes = this.#selectedIndexes;\r\n if (this.multiSelect) {\r\n if (e.ctrlKey) {\r\n const i = selectedIndexes.indexOf(selectedIndex);\r\n if (i < 0) {\r\n selectedIndexes.push(selectedIndex);\r\n } else {\r\n selectedIndexes.splice(i, 1);\r\n }\r\n flag = true;\r\n } else if (e.shiftKey && selectedIndexes.length > 0) {\r\n if (selectedIndexes.length > 1 || selectedIndexes[0] !== selectedIndex) {\r\n let start = selectedIndexes[selectedIndexes.length - 1];\r\n let end;\r\n if (start > selectedIndex) {\r\n end = start;\r\n start = selectedIndex;\r\n } else {\r\n end = selectedIndex;\r\n }\r\n selectedIndexes.splice(0);\r\n for (let i = start; i <= end; i += 1) {\r\n selectedIndexes.push(i);\r\n }\r\n flag = true;\r\n }\r\n }\r\n }\r\n if (!flag && selectedIndexes.length !== 1 || selectedIndexes[0] !== selectedIndex) {\r\n selectedIndexes.splice(0, selectedIndexes.length, selectedIndex);\r\n flag = true;\r\n }\r\n // apply style\r\n if (flag) {\r\n if (this.readonly !== true) {\r\n this.refresh();\r\n } else {\r\n [...this.#refs.bodyContent.children].forEach((row, i) => {\r\n if (selectedIndexes.indexOf(startIndex + i) >= 0) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n });\r\n }\r\n if (typeof this.selectedRowChanged === 'function') {\r\n this.selectedRowChanged(selectedIndex);\r\n }\r\n }\r\n this.#selectedColumnIndex = colIndex;\r\n if ((this.fullrowClick || colIndex >= 0) && e.buttons === 1 && typeof this.cellClicked === 'function') {\r\n if (this.cellClicked(selectedIndex, colIndex) === false) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n\r\n #onRowDblClicked(e) {\r\n if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'LAYER' && e.target.className === 'ui-check-inner' || e.target.tagName === 'LABEL' && (e.target.className === 'ui-drop-text' || e.target.className === 'ui-drop-caret')) {\r\n return;\r\n }\r\n const index = this.selectedIndex;\r\n if (typeof this.rowDblClicked === 'function') {\r\n this.rowDblClicked(index);\r\n }\r\n if (typeof this.cellDblClicked === 'function') {\r\n const colIndex = this.#selectedColumnIndex;\r\n if (this.fullrowClick || colIndex >= 0) {\r\n this.cellDblClicked(index, colIndex);\r\n }\r\n }\r\n }\r\n\r\n #onRowChanged(_e, index, col, value, blur) {\r\n if (this.#currentSource == null) {\r\n return;\r\n }\r\n const row = this.#currentSource[this.#startIndex + index];\r\n const item = row.values;\r\n if (item == null) {\r\n return;\r\n }\r\n let enabled = col.enabled;\r\n if (typeof enabled === 'function') {\r\n enabled = enabled.call(col, item);\r\n } else if (typeof enabled === 'string') {\r\n enabled = item[enabled];\r\n }\r\n if (enabled !== false) {\r\n item[col.key] = value;\r\n row.__changed = true;\r\n if (blur) {\r\n if (typeof col.oneditend === 'function') {\r\n col.oneditend.call(this, item, value);\r\n }\r\n } else {\r\n if (typeof col.onchanged === 'function') {\r\n col.onchanged.call(this, item, value);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default Grid;","import \"./css/popup.scss\";\r\nimport { r } from \"../utility/lgres\";\r\nimport { nullOrEmpty } from \"../utility/strings\";\r\nimport { global } from \"../utility\";\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon, changeIcon } from \"./icon\";\r\n\r\nconst ResizeMods = {\r\n right: 1,\r\n bottom: 2,\r\n left: 4,\r\n top: 8,\r\n bottomRight: 2 | 1,\r\n bottomLeft: 2 | 4,\r\n topRight: 8 | 1,\r\n topLeft: 8 | 4\r\n}\r\n\r\n// const Cursors = {\r\n// [ResizeMods.right]: 'ew-resize',\r\n// [ResizeMods.bottom]: 'ns-resize',\r\n// [ResizeMods.bottomRight]: 'nwse-resize',\r\n// [ResizeMods.left]: 'ew-resize',\r\n// [ResizeMods.bottomLeft]: 'nesw-resize',\r\n// [ResizeMods.top]: 'ns-resize',\r\n// [ResizeMods.topRight]: 'nesw-resize',\r\n// [ResizeMods.topLeft]: 'nwse-resize'\r\n// }\r\n\r\nfunction trimPx(px) {\r\n if (typeof px !== 'string') {\r\n return px;\r\n }\r\n if (px.endsWith('px')) {\r\n const size = Number(px.substring(0, px.length - 2));\r\n return isNaN(size) ? px : size;\r\n }\r\n return px;\r\n}\r\n\r\nclass Popup {\r\n #mask;\r\n #option;\r\n #bounds;\r\n // #cursor;\r\n\r\n constructor(opts = {}) {\r\n this.#option = opts;\r\n }\r\n\r\n get container() { return this.#mask.querySelector('.ui-popup-container') }\r\n\r\n get rect() {\r\n const container = this.container;\r\n if (container == null) {\r\n return null;\r\n }\r\n const style = global.getComputedStyle(container);\r\n const collapsed = container.classList.contains('ui-popup-collapse');\r\n const bounds = this.#bounds;\r\n return {\r\n collapsed,\r\n left: trimPx(style.left),\r\n top: trimPx(style.top),\r\n width: collapsed === true && bounds != null ? bounds.width : trimPx(style.width),\r\n height: collapsed === true && bounds != null ? bounds.height : trimPx(style.height)\r\n };\r\n }\r\n set rect(r) {\r\n const container = this.container;\r\n if (container == null) {\r\n return;\r\n }\r\n const css = [];\r\n if (!isNaN(r.left)) {\r\n css.push(`left: ${r.left}px`);\r\n }\r\n if (!isNaN(r.top)) {\r\n css.push(`top: ${r.top}px`);\r\n }\r\n const collapse = container.querySelector('.ui-popup-header>.icon-expand');\r\n if (r.collapsed === true) {\r\n css.push('width: 160px', 'height: 40px');\r\n this.#bounds = r;\r\n container.classList.add('ui-popup-collapse');\r\n if (collapse != null) {\r\n changeIcon(collapse, 'fa-regular', 'expand-alt');\r\n }\r\n } else {\r\n if (!isNaN(r.width) && r.width > 0) {\r\n css.push(`width: ${r.width}px`);\r\n }\r\n if (!isNaN(r.height) && r.height > 0) {\r\n css.push(`height: ${r.height}px`);\r\n }\r\n container.classList.remove('ui-popup-collapse');\r\n this.#bounds = null;\r\n if (collapse != null) {\r\n changeIcon(collapse, 'fa-regular', 'compress-alt');\r\n }\r\n }\r\n if (css.length > 0) {\r\n container.style.cssText += css.join('; ');\r\n }\r\n }\r\n\r\n create() {\r\n const mask = createElement('div', 'ui-popup-mask');\r\n if (this.#option.mask === false) {\r\n mask.classList.add('ui-popup-transparent');\r\n }\r\n const container = createElement('div', 'ui-popup-container');\r\n let tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0));\r\n if (tabIndex < 0) {\r\n tabIndex = 0;\r\n }\r\n container.tabIndex = tabIndex + 1;\r\n const close = () => {\r\n mask.classList.add('ui-popup-active');\r\n mask.style.opacity = 0;\r\n setTimeout(() => mask.remove(), 120);\r\n };\r\n let content = this.#option.content;\r\n if (!(content instanceof HTMLElement)) {\r\n content = createElement('div', d => d.innerText = content);\r\n }\r\n container.append(\r\n createElement('div', header => {\r\n header.className = 'ui-popup-header';\r\n let title = this.#option.title;\r\n if (!(title instanceof HTMLElement)) {\r\n title = createElement('div', t => {\r\n t.className = 'ui-popup-header-title';\r\n t.innerText = title;\r\n });\r\n }\r\n header.appendChild(title);\r\n if (this.#option.movable !== false) {\r\n const move = title.querySelector('.ui-popup-move') ?? title;\r\n move.addEventListener('mousedown', e => {\r\n const x = e.clientX - container.offsetLeft;\r\n const y = e.clientY - container.offsetTop;\r\n let moved;\r\n const move = e => {\r\n container.style.left = `${e.clientX - x}px`;\r\n container.style.top = `${e.clientY - y}px`;\r\n moved = true;\r\n };\r\n mask.addEventListener('mousemove', move, { passive: false });\r\n const up = () => {\r\n mask.removeEventListener('mousemove', move, { passive: false });\r\n mask.removeEventListener('mouseup', up);\r\n if (moved === true && typeof this.#option.onMoveEnded === 'function') {\r\n this.#option.onMoveEnded.call(this);\r\n }\r\n moved = false;\r\n };\r\n mask.addEventListener('mouseup', up);\r\n });\r\n }\r\n if (this.#option.collapsable === true) {\r\n const collapse = createIcon('fa-regular', 'compress-alt');\r\n collapse.tabIndex = tabIndex + 2;\r\n collapse.classList.add('icon-expand');\r\n collapse.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n collapse.dispatchEvent(new MouseEvent('click'));\r\n }\r\n });\r\n collapse.addEventListener('click', () => {\r\n if (container.classList.contains('ui-popup-collapse')) {\r\n const bounds = this.#bounds;\r\n if (bounds != null) {\r\n container.style.cssText += `width: ${bounds.width}px; height: ${bounds.height}px`;\r\n this.#bounds = null;\r\n }\r\n container.classList.remove('ui-popup-collapse');\r\n changeIcon(collapse, 'fa-regular', 'compress-alt');\r\n } else {\r\n const rect = this.rect;\r\n this.#bounds = rect;\r\n container.style.cssText += `width: 160px; height: 40px`;\r\n container.classList.add('ui-popup-collapse');\r\n changeIcon(collapse, 'fa-regular', 'expand-alt');\r\n }\r\n });\r\n header.appendChild(collapse);\r\n }\r\n const cancel = createIcon('fa-regular', 'times');\r\n cancel.tabIndex = tabIndex + 3;\r\n cancel.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n close();\r\n }\r\n });\r\n cancel.addEventListener('click', () => close());\r\n header.appendChild(cancel);\r\n }),\r\n createElement('div', 'ui-popup-body', content, createElement('div', 'ui-popup-loading',\r\n createElement('div', null, createIcon('fa-regular', 'spinner-third'))\r\n ))\r\n );\r\n if (Array.isArray(this.#option.buttons)) {\r\n tabIndex = Math.max.apply(null, [...container.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0));\r\n container.appendChild(\r\n createElement('div', 'ui-popup-footer', ...this.#option.buttons.map((b, i) => {\r\n const button = createElement('button', 'ui-popup-button');\r\n if (b.tabIndex > 0) {\r\n button.tabIndex = b.tabIndex;\r\n } else {\r\n button.tabIndex = tabIndex + i + 1;\r\n }\r\n button.innerText = b.text;\r\n button.addEventListener('click', () => {\r\n if (typeof b.trigger === 'function') {\r\n const result = b.trigger(this);\r\n if (typeof result?.then === 'function') {\r\n result.then(r => {\r\n if (r !== false) {\r\n close();\r\n }\r\n }).catch(() => { });\r\n } else if (result !== false) {\r\n close();\r\n }\r\n } else {\r\n close();\r\n }\r\n });\r\n return button;\r\n }))\r\n );\r\n const tabs = [...container.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0);\r\n const tabMin = Math.min.apply(null, tabs);\r\n const tabMax = Math.max.apply(null, tabs);\r\n const last = container.querySelector(`[tabindex=\"${tabMax}\"]`);\r\n if (last != null) {\r\n last.addEventListener('keydown', e => {\r\n if (e.key === 'Tab') {\r\n const first = container.querySelector(`[tabindex=\"${tabMin}\"]`);\r\n first?.focus();\r\n e.preventDefault();\r\n }\r\n });\r\n }\r\n }\r\n // resizable\r\n if (this.#option.resizable === true) {\r\n container.append(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-right';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.right, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.bottom, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-left';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.left, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.top, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom-right';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.bottomRight, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom-left';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.bottomLeft, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top-left';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.topLeft, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top-right';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.topRight, e));\r\n })\r\n )\r\n }\r\n mask.appendChild(container);\r\n this.#mask = mask;\r\n return mask;\r\n }\r\n\r\n show(parent = document.body) {\r\n if (parent == null) {\r\n return;\r\n }\r\n let mask = this.#mask ?? this.create();\r\n parent.appendChild(mask);\r\n if (this.#option.mask === false) {\r\n // calculator position\r\n const container = this.container;\r\n container.style.left = String((parent.offsetWidth - container.offsetWidth) / 2) + 'px';\r\n container.style.top = String((parent.offsetHeight - container.offsetHeight) / 2) + 'px';\r\n }\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n mask.style.opacity = 1;\r\n this.container.focus();\r\n resolve(mask);\r\n }, 0);\r\n });\r\n }\r\n\r\n get loading() { return this.#mask?.querySelector('.ui-popup-body>.ui-popup-loading')?.style?.visibility === 'visible' }\r\n set loading(flag) {\r\n let loading = this.#mask?.querySelector('.ui-popup-body>.ui-popup-loading');\r\n if (loading == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n loading.style.visibility = 'hidden';\r\n loading.style.opacity = 0;\r\n } else {\r\n loading.style.visibility = 'visible';\r\n loading.style.opacity = 1;\r\n }\r\n }\r\n\r\n #resize(mod, e) {\r\n const container = this.container;\r\n const option = this.#option;\r\n if (typeof option.onResizeStarted === 'function') {\r\n option.onResizeStarted.call(this);\r\n }\r\n const mask = this.#mask;\r\n // this.#cursor = mask.style.cursor;\r\n // mask.style.cursor = Cursors[mod];\r\n const originalX = e.clientX;\r\n const originalY = e.clientY;\r\n const original = {\r\n width: container.offsetWidth,\r\n height: container.offsetHeight,\r\n left: container.offsetLeft,\r\n top: container.offsetTop\r\n };\r\n const minWidth = option.minWidth ?? 200;\r\n const minHeight = option.minHeight ?? 200;\r\n let resized;\r\n const move = e => {\r\n const offsetX = e.clientX - originalX;\r\n const offsetY = e.clientY - originalY;\r\n let width = original.width;\r\n let height = original.height;\r\n let x = original.left;\r\n let y = original.top;\r\n if ((mod & ResizeMods.right) === ResizeMods.right) {\r\n width += offsetX;\r\n if (width < minWidth) {\r\n width = minWidth;\r\n }\r\n }\r\n if ((mod & ResizeMods.bottom) === ResizeMods.bottom) {\r\n height += offsetY;\r\n if (height < minHeight) {\r\n height = minHeight;\r\n }\r\n }\r\n if ((mod & ResizeMods.left) === ResizeMods.left) {\r\n width -= offsetX;\r\n if (width < minWidth) {\r\n width = minWidth;\r\n x = originalX + original.width - minWidth;\r\n } else {\r\n x += offsetX;\r\n }\r\n }\r\n if ((mod & ResizeMods.top) === ResizeMods.top) {\r\n height -= offsetY;\r\n if (height < minHeight) {\r\n height = minHeight;\r\n y = originalY + original.height - minHeight;\r\n } else {\r\n y += offsetY;\r\n }\r\n }\r\n if (typeof option.onResizing === 'function') {\r\n option.onResizing.call(this, x, y, width, height);\r\n } else {\r\n container.style.cssText += `left: ${x}px; top: ${y}px; width: ${width}px; height: ${height}px`;\r\n }\r\n resized = true;\r\n }\r\n const parent = option.mask === false ? mask.parentElement : mask;\r\n parent.addEventListener('mousemove', move, { passive: false });\r\n const up = () => {\r\n parent.removeEventListener('mousemove', move, { passive: false });\r\n parent.removeEventListener('mouseup', up);\r\n // mask.style.cursor = this.#cursor;\r\n if (resized === true && typeof option.onResizeEnded === 'function') {\r\n option.onResizeEnded.call(this);\r\n }\r\n resized = false;\r\n };\r\n parent.addEventListener('mouseup', up);\r\n }\r\n}\r\n\r\nexport default Popup;\r\n\r\nexport function createPopup(title, content, ...buttons) {\r\n const popup = new Popup({\r\n title,\r\n content,\r\n buttons\r\n });\r\n return popup;\r\n}\r\n\r\nconst iconTypes = {\r\n 'info': 'info-circle',\r\n 'information': 'info-circle',\r\n 'warn': 'exclamation-triangle',\r\n 'warning': 'exclamation-triangle',\r\n 'question': 'question-circle',\r\n 'error': 'times-circle'\r\n}\r\n\r\nexport function showAlert(title, message, iconType = 'info', parent = document.body) {\r\n return new Promise(resolve => {\r\n const popup = new Popup({\r\n title,\r\n content: createElement('div', 'message-wrapper',\r\n createIcon('fa-solid', iconTypes[iconType] ?? 'info-circle'),\r\n createElement('span', span => span.innerText = message)\r\n ),\r\n buttons: [\r\n { text: r('ok', 'OK'), trigger: resolve }\r\n ]\r\n });\r\n popup.show(parent).then(mask => {\r\n const button = mask.querySelector('.ui-popup-container .ui-popup-footer .ui-popup-button:last-child');\r\n button?.focus();\r\n });\r\n });\r\n}\r\n\r\nexport function showConfirm(title, content, buttons, iconType = 'question', parent = document.body) {\r\n return new Promise(resolve => {\r\n const wrapper = createElement('div', 'message-wrapper');\r\n if (!nullOrEmpty(iconType)) {\r\n wrapper.appendChild(createIcon('fa-solid', iconTypes[iconType] ?? 'question-circle'));\r\n }\r\n wrapper.appendChild(content instanceof HTMLElement ?\r\n content :\r\n createElement('span', span => span.innerText = content));\r\n const popup = new Popup({\r\n title,\r\n content: wrapper,\r\n buttons: buttons?.map(b => {\r\n return {\r\n text: b.text,\r\n trigger: p => {\r\n let result;\r\n if (typeof b.trigger === 'function') {\r\n result = b.trigger(p, b);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n r !== false && resolve(r);\r\n return r;\r\n });\r\n }\r\n result !== false && resolve(result);\r\n } else {\r\n result = {\r\n key: b.key,\r\n popup: p\r\n };\r\n resolve(result);\r\n }\r\n return result;\r\n }\r\n };\r\n }) ??\r\n [\r\n { text: r('yes', 'Yes'), trigger: p => resolve({ key: 'yes', popup: p }) },\r\n { text: r('no', 'No'), trigger: p => resolve({ key: 'no', popup: p }) }\r\n ]\r\n });\r\n popup.show(parent).then(mask => {\r\n const button = mask.querySelector('.ui-popup-container .ui-popup-footer .ui-popup-button:last-child');\r\n button?.focus();\r\n });\r\n });\r\n}"],"names":["createElement","tagName","init","children","element","svgns","createUse","type","id","c","path","ver","use","changeIcon","svg","createIcon","style","css","resolveIcon","container","svgs","icon","fillCheckbox","label","tabindex","charactor","layer","e","input","span","createRadiobox","opts","entry","createCheckbox","resolveCheckbox","legacy","checks","chk","text","boxes","box","setTooltip","content","flag","parent","isParent","tipid","tip","wrapper","cnt","tipId","tid","p","left","top","offsetParent","resolveTooltip","tips","title","nullOrEmpty","s","contains","key","ignoreCase","r","defaultValue","g","isPositive","n","isMobile","throttle","method","delay","context","args","current","truncate","v","SymbolDropdown","DropdownTitleHeight","DropdownItemHeight","dropdownGlobal","global","panel","dropId","dropdown","selectItems","itemlist","htmlkey","textkey","htmls","it","filterSource","searchkeys","source","k","_Dropdown","options","__privateAdd","_expanded","_dropdown","_filllist","_triggerselect","_options","_wrapper","_container","_label","_allChecked","_source","_lastSelected","_selected","_selectedList","__publicField","__privateSet","__privateGet","header","up","down","count","valuekey","index","target","_a","__privateMethod","dropdown_fn","active","expanded_get","filllist_fn","list","selected","silence","item","expanded","li","html","val","selectedlist","dom","selects","sel","drop","Dropdown","_b","search","value","multiselect","allchecked","triggerselect_fn","scrolled","i","checkbox","GridColumn","GridInputColumn","trigger","col","_parent","vals","enabled","GridTextColumn","_item","_col","grid","lines","_GridDropdownColumn","_getSource","getSource_fn","_setValue","setValue_fn","_getDrop","getDrop_fn","GridDropdownColumn","dropGlobal","data","__superGet","GridCheckboxColumn","GridIconColumn","className","tooltip","ColumnChangedType","RefreshInterval","HoverInternal","RedumCount","MiniDragOffset","MiniColumnWidth","FilterPanelWidth","getClientX","getOffsetLeftFromWindow","indexOfParent","ColumnTypes","_Grid","_refreshSource","_createHeader","_createBody","_adjustRows","_fillRows","_changeColumnWidth","_changingColumnOrder","_changeColumnOrder","_scrollToTop","_get","_set","_getItemValue","_getRowTarget","_notHeader","_onHeaderClicked","_onCloseFilter","_onFilter","_fillFilterList","_doFillFilterList","_onFilterScroll","_onDragStart","_onResizeStart","_onAutoResize","_onColumnAllChecked","_onScroll","_onBodyMouseMove","_onRowClicked","_onRowDblClicked","_onRowChanged","_currentSource","_el","_refs","_rendering","_selectedColumnIndex","_selectedIndexes","_startIndex","_needResize","_containerHeight","_bodyClientWidth","_rowCount","_scrollTop","_scrollLeft","_colTypes","_colAttrs","_vtable","refreshSource_fn","indexes","startIndex","row","sizer","createHeader_fn","body","createBody_fn","loading","scrollToTop_fn","force","height","length","adjustRows_fn","rows","widths","fillRows_fn","get_fn","width","changeColumnWidth_fn","reload","direction","th","arrow","comparer","a","b","getItemValue_fn","Grid","thead","hidden","onHeaderClicked_fn","isCheckbox","set_fn","w","onDragStart_fn","check","onColumnAllChecked_fn","caption","filter","onFilter_fn","spliter","onResizeStart_fn","onAutoResize_fn","dragger","draggerCursor","onScroll_fn","cols","bodyContainer","bodyContent","getRowTarget_fn","rowIndex","colIndex","onRowClicked_fn","onRowDblClicked_fn","holder","onBodyMouseMove_fn","exists","j","cell","onRowChanged_fn","selectedIndexes","selectChanged","bgColor","ev","attrs","attr","changingColumnOrder_fn","offset","x","offsetLeft","idx","changeColumnOrder_fn","orderIndex","targetIndex","columns","rowHeight","bottomTop","name","notHeader_fn","onCloseFilter_fn","panels","el","filtering","close","searchbox","searchholder","searchicon","onFilterScroll_fn","itemall","checked","array","dict","fillFilterList_fn","items","displayValue","functions","ok","reset","all","doFillFilterList_fn","div","cx","clearEvents","event","dragmove","cx2","pos","dragging","window","resizemove","isFunction","isString","maxleft","selectedIndex","start","end","_e","blur","ResizeMods","trimPx","px","size","Popup","_resize","_mask","_option","_bounds","collapsed","bounds","collapse","mask","tabIndex","d","t","y","moved","move","rect","cancel","button","result","tabs","tabMin","tabMax","last","first","resize_fn","resolve","_c","mod","option","originalX","originalY","original","minWidth","minHeight","resized","offsetX","offsetY","createPopup","buttons","iconTypes","showAlert","message","iconType","showConfirm"],"mappings":"opCAAO,SAASA,EAAcC,EAASC,KAASC,EAAU,CACtD,MAAMC,EAAU,SAAS,cAAcH,CAAO,EAC9C,OAAI,OAAOC,GAAS,WAChBA,EAAKE,CAAO,EACLF,GAAQ,OACfE,EAAQ,UAAYF,GAEpBC,EAAS,OAAS,GAClBC,EAAQ,OAAO,GAAGD,CAAQ,EAEvBC,CACX,CCXA,MAAMC,GAAQ,6BAEd,SAASC,GAAUC,EAAMC,EAAI,CACzB,MAAMC,EAAI,OAAO,OAAW,IAAc,OAAS,CAAA,EAC7CC,EAAOD,EAAE,MAAQ,GACjBE,EAAMF,EAAE,QAAU,KAAO,GAAK,IAAIA,EAAE,SACpCG,EAAM,SAAS,gBAAgBP,GAAO,KAAK,EACjD,OAAAO,EAAI,eAAe,+BAAgC,aAAc,GAAGF,UAAaH,QAAWI,KAAOH,GAAI,EAChGI,CACX,CAEA,SAASC,GAAWC,EAAKP,EAAMC,EAAI,CAC/B,OAAIM,aAAe,YACfA,EAAI,gBAAgBR,GAAUC,EAAMC,CAAE,CAAC,EAEpCM,CACX,CAEA,SAASC,EAAWR,EAAMC,EAAIQ,EAAO,CACjC,MAAMF,EAAM,SAAS,gBAAgBT,GAAO,KAAK,EAEjD,GADAS,EAAI,YAAYR,GAAUC,EAAMC,CAAE,CAAC,EAC/BQ,GAAS,KACT,QAASC,KAAO,OAAO,QAAQD,CAAK,EAChCF,EAAI,MAAM,YAAYG,EAAI,CAAC,EAAGA,EAAI,CAAC,CAAC,EAG5C,OAAOH,CACX,CAEA,SAASI,GAAYC,EAAW,CAC5B,MAAMC,EAAOD,EAAU,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,EAAE,SAAY,WAAY,CAEjC,GADAmH,EAASnH,EAAE,QAAQjN,EAAGiN,CAAC,EACnB,OAAOmH,GAAA,YAAAA,EAAQ,OAAS,WACxB,OAAOA,EAAO,KAAKxT,IACfA,IAAM,IAAS+T,EAAQ/T,CAAC,EACjBA,EACV,EAELwT,IAAW,IAASO,EAAQP,CAAM,OAElCA,EAAS,CACL,IAAKnH,EAAE,IACP,MAAOjN,CACvC,EAC4B2U,EAAQP,CAAM,EAElB,OAAOA,CACV,CACrB,MAEgB,CACI,CAAE,KAAMxT,EAAE,MAAO,KAAK,EAAG,QAASZ,GAAK2U,EAAQ,CAAE,IAAK,MAAO,MAAO3U,CAAG,CAAA,CAAG,EAC1E,CAAE,KAAMY,EAAE,KAAM,IAAI,EAAG,QAASZ,GAAK2U,EAAQ,CAAE,IAAK,KAAM,MAAO3U,CAAG,CAAA,CAAG,CAC1E,CACjB,CAAS,EACK,KAAKR,CAAM,EAAE,KAAKkU,GAAQ,CAC5B,MAAMS,EAAST,EAAK,cAAc,kEAAkE,EACpGS,GAAA,MAAAA,EAAQ,OACpB,CAAS,CACT,CAAK,CACL"} \ No newline at end of file +{"version":3,"file":"ui.min.js","sources":["../lib/functions.js","../lib/ui/icon.js","../lib/ui/checkbox.js","../lib/ui/tooltip.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js","../lib/ui/dropdown.js","../lib/ui/grid/column.js","../lib/ui/grid/grid.js","../lib/ui/popup.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path || '';\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nfunction changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nfunction createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nfunction resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createIcon,\r\n changeIcon,\r\n resolveIcon\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label?.length > 0) {\r\n container.appendChild(\r\n createElement('span', span => span.innerText = label)\r\n );\r\n }\r\n}\r\n\r\nfunction createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');\r\n return container;\r\n}\r\n\r\nfunction createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n if (opts.enabled === false) {\r\n container.classList.add('disabled');\r\n }\r\n if (opts.checkedNode != null && opts.uncheckedNode != null) {\r\n container.classList.add('ui-check-image-wrapper');\r\n let height = opts.imageHeight;\r\n if (isNaN(height) || height <= 0) {\r\n height = 14;\r\n }\r\n opts.checkedNode.classList.add('checked');\r\n container.appendChild(opts.checkedNode);\r\n opts.uncheckedNode.classList.add('unchecked');\r\n container.appendChild(opts.uncheckedNode);\r\n } else {\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex);\r\n }\r\n return container;\r\n}\r\n\r\nfunction resolveCheckbox(container = document.body, legacy) {\r\n if (legacy) {\r\n const checks = container.querySelectorAll('input[type=\"checkbox\"]');\r\n for (let chk of checks) {\r\n if (chk.parentElement.classList.contains('ui-check-wrapper')) {\r\n // skip\r\n continue;\r\n }\r\n const id = chk.id;\r\n let label, text;\r\n if (id != null) {\r\n label = container.querySelector(`label[for=\"${id}\"]`);\r\n }\r\n if (label == null) {\r\n const e = chk.nextElementSibling;\r\n if (e != null) {\r\n if (e.tagName === 'LABEL') {\r\n label = e;\r\n } else if (e.tagName === 'SPAN' && e.dataset.lgid != null) {\r\n text = e.innerText;\r\n e.style.display = 'none';\r\n }\r\n }\r\n }\r\n if (label == null) {\r\n const e = chk.previousElementSibling;\r\n if (e != null) {\r\n if (e.tagName === 'LABEL') {\r\n label = e;\r\n } else if (text == null && e.tagName === 'SPAN' && e.dataset.lgid != null) {\r\n text = e.innerText;\r\n e.style.display = 'none';\r\n }\r\n }\r\n }\r\n if (label == null) {\r\n label = createElement('label');\r\n chk.parentElement.insertBefore(label, chk);\r\n } else {\r\n text = label.innerText;\r\n }\r\n if (chk.disabled) {\r\n label.className = 'ui-check-wrapper disabled';\r\n } else {\r\n label.className = 'ui-check-wrapper';\r\n }\r\n label.replaceChildren();\r\n fillCheckbox(label, 'fa-regular', text, chk.tabIndex);\r\n label.insertBefore(chk, label.firstChild);\r\n }\r\n }\r\n const boxes = container.querySelectorAll('label[data-checkbox]');\r\n for (let box of boxes) {\r\n if (!box.classList.contains('ui-check-wrapper')) {\r\n box.classList.add('ui-check-wrapper');\r\n }\r\n if (box.hasChildNodes()) {\r\n if (!box.classList.contains('ui-check-image-wrapper')) {\r\n box.classList.add('ui-check-image-wrapper');\r\n }\r\n } else {\r\n fillCheckbox(box,\r\n box.dataset.type,\r\n box.dataset.label,\r\n box.dataset.tabIndex)\r\n box.removeAttribute('data-type');\r\n box.removeAttribute('data-label');\r\n }\r\n const input = createElement('input');\r\n const id = box.dataset.id;\r\n if (id?.length > 0) {\r\n input.id = id;\r\n }\r\n if (box.dataset.checked != null) {\r\n input.checked = true;\r\n }\r\n input.setAttribute('type', 'checkbox');\r\n box.insertBefore(input, box.firstChild);\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createCheckbox,\r\n resolveCheckbox,\r\n createRadiobox\r\n}","import './css/tooltip.scss';\r\nimport { createElement } from \"../functions\";\r\n// import { global } from \"../utility\";\r\n\r\nfunction setTooltip(container, content, flag = false, parent = null) {\r\n const isParent = parent instanceof HTMLElement;\r\n if (isParent) {\r\n const tipid = container.dataset.tipId;\r\n const tip = parent.querySelector(`.ui-tooltip-wrapper[data-tip-id=\"${tipid}\"]`);\r\n tip?.remove();\r\n } else {\r\n const tip = container.querySelector('.ui-tooltip-wrapper');\r\n tip?.remove();\r\n }\r\n const wrapper = createElement('div', wrapper => {\r\n wrapper.className = 'ui-tooltip-wrapper ui-tooltip-color';\r\n wrapper.style.visibility = 'hidden';\r\n wrapper.style.opacity = 0;\r\n wrapper.style.top = '0';\r\n wrapper.style.left = '0';\r\n },\r\n createElement('div', 'ui-tooltip-pointer ui-tooltip-color'),\r\n createElement('div', 'ui-tooltip-curtain ui-tooltip-color'),\r\n createElement('div', cnt => {\r\n cnt.className = 'ui-tooltip-content';\r\n if (content instanceof Element) {\r\n cnt.appendChild(content);\r\n } else {\r\n cnt.innerText = content;\r\n }\r\n })\r\n );\r\n // container.insertAdjacentElement('afterend', wrapper);\r\n if (isParent) {\r\n const tipId = String(Math.random()).substring(2);\r\n container.dataset.tipId = tipId;\r\n wrapper.dataset.tipId = tipId;\r\n parent.appendChild(wrapper);\r\n } else {\r\n container.appendChild(wrapper);\r\n }\r\n\r\n let tid;\r\n container.addEventListener('mouseenter', () => {\r\n tid && clearTimeout(tid);\r\n let c = container;\r\n while (c?.offsetWidth == null) {\r\n c = c.parentElement;\r\n }\r\n if (c == null) {\r\n return;\r\n }\r\n if (!flag || c.scrollWidth > c.offsetWidth) {\r\n tid = setTimeout(() => {\r\n let p;\r\n let left;\r\n let top;\r\n left = c.offsetLeft;\r\n top = c.offsetTop;\r\n if (isParent) {\r\n p = c.offsetParent;\r\n while (p != null && p !== parent) {\r\n left += p.offsetLeft;\r\n top += p.offsetTop;\r\n p = p.offsetParent;\r\n }\r\n }\r\n p = c.parentElement;\r\n const offsetParent = c.offsetParent;\r\n while (p != null && p !== (isParent ? parent : offsetParent)) {\r\n left -= p.scrollLeft;\r\n top -= p.scrollTop;\r\n p = p.parentElement;\r\n }\r\n left += (c.offsetWidth - wrapper.offsetWidth) / 2;\r\n top -= wrapper.offsetHeight + 14;\r\n wrapper.style.left = `${left}px`;\r\n wrapper.style.top = `${top}px`;\r\n wrapper.style.visibility = 'visible';\r\n wrapper.style.opacity = 1;\r\n }, 100);\r\n }\r\n });\r\n container.addEventListener('mouseleave', () => {\r\n tid && clearTimeout(tid);\r\n tid = setTimeout(() => {\r\n wrapper.style.visibility = 'hidden';\r\n wrapper.style.opacity = 0;\r\n }, 300);\r\n });\r\n return container;\r\n}\r\n\r\nfunction resolveTooltip(container = document.body) {\r\n const tips = container.querySelectorAll('[title]');\r\n for (let tip of tips) {\r\n const title = tip.getAttribute('title');\r\n if (title != null) {\r\n tip.removeAttribute('title');\r\n setTooltip(tip, title);\r\n }\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n setTooltip,\r\n resolveTooltip\r\n}","function nullOrEmpty(s) {\r\n return s == null || typeof s !== 'string' || s.length === 0;\r\n}\r\n\r\nfunction contains(s, key, ignoreCase) {\r\n if (nullOrEmpty(s) || key == null) {\r\n return false;\r\n }\r\n if (typeof key !== 'string') {\r\n key = String(key);\r\n }\r\n if (ignoreCase) {\r\n return s.toLowerCase().indexOf(key.toLowerCase()) >= 0;\r\n }\r\n return s.indexOf(key) >= 0;\r\n}\r\n\r\nfunction endsWith(s, suffix) {\r\n if (nullOrEmpty(s) || nullOrEmpty(suffix)) {\r\n return false;\r\n }\r\n return s.indexOf(suffix) === s.length - suffix.length;\r\n}\r\n\r\nfunction padStart(s, num, char) {\r\n if (nullOrEmpty(s) || isNaN(num) || num <= s.length) {\r\n return s;\r\n }\r\n return (char ?? ' ').repeat(num - s.length);\r\n}\r\n\r\nfunction formatUrl(msg) {\r\n //const urlReg = /(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?/ig;\r\n //const urlArrray = str.match(urlReg);\r\n const p = /(http|ftp|https):\\/\\/.+?(\\s|\\r\\n|\\r|\\n|\\\"|\\'|\\*|$)/g;\r\n const r = msg.match(p);\r\n msg = escapeHtml(msg);\r\n\r\n if (r?.length > 0) {\r\n const rs = [];\r\n for (let t of r) {\r\n t = t.replace(/[\"'\\r\\n ]/g, '');\r\n if (rs.indexOf(t) < 0) {\r\n rs.push(t);\r\n }\r\n }\r\n\r\n for (let r of rs) {\r\n msg = msg.replaceAll(r, '<a target=\"_blank\" href=\"' + r + '\"><svg><use xlink:href=\"' + ((typeof consts !== 'undefined' && consts.path) || '') + 'fonts/fa-regular.svg#link\"></use></svg></a>');\r\n }\r\n }\r\n\r\n return msg;\r\n}\r\n\r\nfunction escapeHtml(text) {\r\n if (text == null) {\r\n return '';\r\n }\r\n return String(text)\r\n .replaceAll('&', '&')\r\n .replaceAll('<', '<')\r\n .replaceAll('>', '>')\r\n .replaceAll('\\r\\n', '<br/>')\r\n .replaceAll('\\n', '<br/>')\r\n .replaceAll(' ', ' ');\r\n}\r\n\r\nexport {\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml\r\n}","import { getCookie } from \"./cookie\";\r\nimport { get } from \"./request\";\r\nimport { nullOrEmpty } from \"./strings\";\r\n\r\nlet cache;\r\n\r\nfunction getCurrentLgId() {\r\n let lgid;\r\n if (typeof consts !== 'undefined') {\r\n lgid = getCookie(consts.cookie?.lang);\r\n if (nullOrEmpty(lgid)) {\r\n lgid = consts.user?.language;\r\n }\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = getCookie('lgid');\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = navigator.language || 'en-us';\r\n }\r\n lgid = lgid.toLowerCase().replace(/-/g, '_');\r\n if (nullOrEmpty(lgid)) {\r\n lgid = 'en';\r\n }\r\n switch (lgid) {\r\n case 'en':\r\n case 'en_au':\r\n case 'fr':\r\n case 'zh_cn':\r\n return lgid;\r\n }\r\n const lang = lgid.split('_')[0];\r\n switch (lang) {\r\n case 'en':\r\n case 'fr':\r\n return lang;\r\n }\r\n return 'en';\r\n}\r\n\r\nfunction getStorageKey(lgid) {\r\n if (typeof consts !== 'undefined') {\r\n return (consts.prefix || '') + `res_${lgid}`;\r\n }\r\n return `res_${lgid}`;\r\n}\r\n\r\nasync function doRefreshLgres(template = '') {\r\n const lgid = getCurrentLgId();\r\n const r = await get(`language/${lgid}${template}`);\r\n const dict = await r.json();\r\n localStorage.setItem(getStorageKey(lgid), JSON.stringify(dict));\r\n return dict;\r\n}\r\n\r\nasync function refreshLgres(template, lgres) {\r\n if (lgres == null || typeof consts === 'undefined') {\r\n lgres = await doRefreshLgres(template);\r\n }\r\n const ver = Number(consts.resver);\r\n if (isNaN(lgres.ver) || isNaN(ver) || ver > lgres.ver) {\r\n console.log(`found new language res version: ${lgres.ver} => ${ver}`);\r\n lgres = await doRefreshLgres(template);\r\n }\r\n Object.defineProperty(lgres, 'r', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function (key, defaultValue) {\r\n return getLanguage(this, key, defaultValue);\r\n }\r\n });\r\n cache = lgres;\r\n return lgres;\r\n}\r\n\r\nfunction getLanguage(lgres, key, defaultValue) {\r\n let value = lgres[key];\r\n return value ?? defaultValue;\r\n}\r\n\r\nfunction applyLanguage(dom, result) {\r\n for (let text of dom.querySelectorAll('[data-lgid]')) {\r\n const key = text.dataset.lgid;\r\n if (text.tagName === 'INPUT') {\r\n text.value = getLanguage(result, key, text.value);\r\n } else {\r\n text.innerText = getLanguage(result, key, text.innerText);\r\n }\r\n }\r\n for (let title of dom.querySelectorAll('[data-title-lgid]')) {\r\n const key = title.dataset.titleLgid;\r\n title.setAttribute('title', getLanguage(result, key, title.getAttribute('title')));\r\n }\r\n for (let holder of dom.querySelectorAll('[data-placeholder-lgid]')) {\r\n const key = holder.dataset.placeholderLgid;\r\n holder.setAttribute('placeholder', getLanguage(result, key, holder.getAttribute('placeholder')));\r\n }\r\n}\r\n\r\nasync function init(dom = document.body, options = {}) {\r\n const lgid = getCurrentLgId();\r\n let lgres = localStorage.getItem(getStorageKey(lgid));\r\n let result;\r\n if (lgres != null) {\r\n try {\r\n lgres = JSON.parse(lgres);\r\n result = await refreshLgres(options.template, lgres);\r\n } catch (e) {\r\n console.error('error while parsing lgres, try refresh ...', e);\r\n result = await refreshLgres(options.template);\r\n }\r\n } else {\r\n result = await refreshLgres(options.template);\r\n }\r\n\r\n try {\r\n if (document.readyState === 'loading') {\r\n return await new Promise((resolve, reject) => {\r\n let tid = setTimeout(() => reject('timeout'), 30000);\r\n document.addEventListener('DOMContentLoaded', () => {\r\n clearTimeout(tid);\r\n tid = void 0;\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n resolve(result);\r\n });\r\n });\r\n }\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n return result;\r\n } catch (err) {\r\n console.error('error while loading language res ...', err);\r\n }\r\n}\r\n\r\nfunction r(key, defaultValue) {\r\n if (cache != null) {\r\n return getLanguage(cache, key, defaultValue);\r\n }\r\n return defaultValue;\r\n}\r\n\r\nconst lang = {\r\n get current() {\r\n return getCurrentLgId();\r\n },\r\n get unknownError() {\r\n return r('unknownError', 'An unknown error occurred, please contact the administrator.');\r\n },\r\n get savedSuccessfully() {\r\n return r('savedSuccessfully', 'Saved successfully.');\r\n }\r\n}\r\n\r\nexport {\r\n init,\r\n r,\r\n lang\r\n}","import { getCookie, setCookie, deleteCookie } from \"./utility/cookie\";\r\nimport { init, r, lang } from \"./utility/lgres\";\r\nimport { get, post, upload } from \"./utility/request\";\r\nimport { nullOrEmpty, contains, endsWith, padStart, formatUrl, escapeHtml } from \"./utility/strings\";\r\n\r\nlet g = typeof globalThis !== 'undefined' ? globalThis : self;\r\n\r\nfunction isPositive(n) {\r\n return !isNaN(n) && n > 0;\r\n}\r\n\r\nfunction isMobile() {\r\n return /mobile/i.test(navigator.userAgent);\r\n}\r\n\r\nfunction throttle(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n const current = new Date();\r\n if (method.tdate == null || current - method.tdate > delay) {\r\n method.apply(context, args);\r\n method.tdate = current;\r\n } else {\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n }\r\n}\r\n\r\nfunction debounce(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n}\r\n\r\nfunction truncate(v) {\r\n return (v > 0 ? Math.floor : Math.ceil)(v);\r\n}\r\n\r\nfunction isEmail(text) {\r\n return /^\\w[-\\w.+]*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/.test(text);\r\n}\r\n\r\nfunction isPhone(text) {\r\n if (/^[1-9]\\d{9,}$/.test(text)) {\r\n return true;\r\n }\r\n if (/^\\+?[1-9][\\d-]{9,}\\d$/.test(text) && /^[1-9]\\d{9,}$/.test(text.replace('+', '').replace(new RegExp('-', 'g'), ''))) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport {\r\n // cookie\r\n getCookie,\r\n setCookie,\r\n deleteCookie,\r\n // lgres\r\n init,\r\n r,\r\n lang,\r\n // request\r\n get,\r\n post,\r\n upload,\r\n // strings\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml,\r\n // variables\r\n g as global,\r\n isPositive,\r\n isMobile,\r\n // functions\r\n throttle,\r\n debounce,\r\n truncate,\r\n isEmail,\r\n isPhone\r\n}","// import { r, global, contains, isPositive, nullOrEmpty } from \"../utility\";\r\nimport './css/dropdown.scss';\r\nimport { r } from \"../utility/lgres\";\r\nimport { contains, nullOrEmpty } from \"../utility/strings\";\r\nimport { global, isPositive } from \"../utility\";\r\nimport { createElement } from \"../functions\";\r\nimport { createCheckbox } from \"./checkbox\";\r\nimport { createIcon } from \"./icon\"\r\n\r\nconst SymbolDropdown = Symbol.for('ui-dropdown');\r\nconst DropdownTitleHeight = 26;\r\nconst DropdownItemHeight = 30;\r\n\r\nlet dropdownGlobal = global[SymbolDropdown];\r\n\r\nif (dropdownGlobal == null) {\r\n // init\r\n dropdownGlobal = {};\r\n Object.defineProperty(dropdownGlobal, 'clear', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function () {\r\n const panel = document.querySelector('.ui-drop-wrapper .ui-drop-box.active');\r\n if (panel == null) {\r\n return;\r\n }\r\n panel.classList.remove('active');\r\n const dropId = panel.parentElement.dataset.dropId;\r\n if (dropId == null) {\r\n return;\r\n }\r\n const dropdown = this[dropId];\r\n if (dropdown?.multiselect && typeof dropdown.oncollapsed === 'function') {\r\n dropdown.oncollapsed();\r\n }\r\n }\r\n })\r\n global[SymbolDropdown] = dropdownGlobal;\r\n\r\n document.addEventListener('mousedown', e => {\r\n let parent = e.target;\r\n while (parent != null) {\r\n if (parent.classList.contains('ui-drop-box')) {\r\n e.stopPropagation();\r\n return;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n dropdownGlobal.clear();\r\n });\r\n}\r\n\r\nfunction selectItems(label, itemlist, htmlkey, textkey) {\r\n const htmls = itemlist.map(it => it[htmlkey]);\r\n if (htmls.some(it => it instanceof HTMLElement)) {\r\n label.replaceChildren(...htmls.filter(it => it != null).map(it => it.cloneNode(true)));\r\n } else {\r\n let text = itemlist.map(it => it[textkey]).join(', ');\r\n if (nullOrEmpty(text)) {\r\n text = r('noneItem', '( None )');\r\n }\r\n label.innerText = text;\r\n }\r\n}\r\n\r\nfunction filterSource(searchkeys, textkey, key, source) {\r\n if (!Array.isArray(searchkeys) || searchkeys.length === 0) {\r\n searchkeys = [textkey];\r\n }\r\n if (key.length > 0) {\r\n source = source.filter(it => {\r\n for (let k of searchkeys) {\r\n if (contains(it[k].toLowerCase(), key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n return source;\r\n}\r\n\r\nclass Dropdown {\r\n #options;\r\n\r\n #wrapper;\r\n #container;\r\n #label;\r\n\r\n #allChecked;\r\n #source;\r\n #lastSelected;\r\n #selected;\r\n #selectedList;\r\n\r\n sourceFilter;\r\n onselectedlist;\r\n onselected;\r\n onexpanded;\r\n\r\n constructor(options = {}) {\r\n options.searchplaceholder ??= r('searchHolder', 'Search...');\r\n options.textkey ??= 'text';\r\n options.valuekey ??= 'value';\r\n options.htmlkey ??= 'html';\r\n options.maxlength ??= 500;\r\n this.#options = options;\r\n }\r\n\r\n create() {\r\n const options = this.#options;\r\n\r\n // wrapper\r\n const wrapper = createElement('div', 'ui-drop-wrapper');\r\n const dropId = String(Math.random()).substring(2);\r\n wrapper.dataset.dropId = dropId;\r\n dropdownGlobal[dropId] = this;\r\n this.#wrapper = wrapper;\r\n\r\n // header\r\n const header = createElement('div', 'ui-drop-header');\r\n header.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n header.dispatchEvent(new MouseEvent('click'));\r\n }\r\n });\r\n header.addEventListener('keydown', e => {\r\n const up = e.key === 'ArrowUp';\r\n const down = e.key === 'ArrowDown';\r\n if (up || down) {\r\n const source = this.source;\r\n const count = source.length;\r\n const valuekey = this.#options.valuekey;\r\n let index = source?.indexOf(this.#selected);\r\n if (isNaN(index) || index < -1) {\r\n index = -1;\r\n } else if (index >= count) {\r\n index = count - 1;\r\n }\r\n if (up) {\r\n if (index > 0) {\r\n index--;\r\n } else {\r\n index = 0;\r\n }\r\n } else if (down) {\r\n if (index < 0) {\r\n index = 0;\r\n } else if (index < count) {\r\n index++;\r\n } else {\r\n index = count - 1;\r\n }\r\n }\r\n const target = source[index]?.[valuekey];\r\n if (target != null) {\r\n this.select(target);\r\n }\r\n } else if (e.key === 'Tab') {\r\n this.#dropdown(false);\r\n }\r\n });\r\n header.addEventListener('click', () => {\r\n if (this.disabled) {\r\n return;\r\n }\r\n const active = this.#expanded;\r\n const label = this.#label;\r\n if (active && label.ownerDocument.activeElement === label) {\r\n return;\r\n }\r\n this.#dropdown(!active);\r\n if (!active && typeof this.onexpanded === 'function') {\r\n setTimeout(() => this.onexpanded(), 120);\r\n }\r\n });\r\n\r\n // label or input\r\n let label;\r\n if (options.input) {\r\n label = createElement('input', 'ui-drop-text');\r\n label.setAttribute('type', 'text');\r\n options.placeholder && label.setAttribute('placeholder', options.placeholder);\r\n isPositive(options.maxlength) && label.setAttribute('maxlength', options.maxlength);\r\n isPositive(options.tabIndex) && label.setAttribute('tabindex', options.tabIndex);\r\n label.addEventListener('input', e => {\r\n const key = e.target.value.toLowerCase();\r\n const source = filterSource(options.searchkeys, options.textkey, key, this.source);\r\n this.#filllist(source);\r\n this.#container.classList.add('active');\r\n });\r\n label.addEventListener('blur', e => this.select(e.target.value));\r\n label.addEventListener('mousedown', e => this.#expanded && e.stopPropagation());\r\n } else {\r\n isPositive(options.tabIndex) && header.setAttribute('tabindex', options.tabIndex);\r\n label = createElement('label', 'ui-drop-text');\r\n }\r\n this.#label = label;\r\n if (options.multiselect) {\r\n if (Array.isArray(options.selectedlist)) {\r\n this.selectlist(options.selectedlist, true);\r\n } else {\r\n this.#allChecked = true;\r\n label.innerText = r('allItem', '( All )');\r\n }\r\n } else if (options.selected != null) {\r\n this.select(options.selected, true);\r\n }\r\n header.append(label, createElement('label', 'ui-drop-caret'));\r\n wrapper.appendChild(header);\r\n\r\n this.disabled = options.disabled || false;\r\n return wrapper;\r\n }\r\n\r\n get multiselect() { return this.#options.multiselect }\r\n\r\n get disabled() { return this.#wrapper == null || this.#wrapper.querySelector('.ui-drop-header.disabled') != null }\r\n\r\n set disabled(flag) {\r\n if (this.#wrapper == null) {\r\n return;\r\n }\r\n if (flag) {\r\n this.#wrapper.querySelector('.ui-drop-header').classList.add('disabled');\r\n } else {\r\n this.#wrapper.querySelector('.ui-drop-header').classList.remove('disabled');\r\n }\r\n }\r\n\r\n get source() {\r\n let source = this.#source;\r\n if (source == null || !Array.isArray(source)) {\r\n if (typeof this.sourceFilter === 'function') {\r\n source = this.sourceFilter();\r\n }\r\n if (!Array.isArray(source)) {\r\n source = [];\r\n }\r\n this.#source = source;\r\n }\r\n return source;\r\n }\r\n\r\n set source(list) {\r\n if (!Array.isArray(list)) {\r\n return;\r\n }\r\n this.#source = list;\r\n if (this.#expanded) {\r\n setTimeout(() => this.#dropdown(), 120);\r\n }\r\n }\r\n\r\n get selected() { return this.#selected }\r\n\r\n get selectedlist() { return this.#selectedList || [] }\r\n\r\n select(selected, silence) {\r\n if (this.#lastSelected === selected) {\r\n return false;\r\n }\r\n this.#lastSelected = selected;\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n let item = this.source.find(it => it[valuekey] === selected);\r\n if (this.#options.input) {\r\n if (item == null) {\r\n item = { [valuekey]: selected };\r\n }\r\n this.#label.value = selected;\r\n } else {\r\n const expanded = this.#expanded;\r\n if (expanded) {\r\n this.#container.querySelectorAll('li[data-value].selected').forEach(li => li.classList.remove('selected'));\r\n }\r\n if (item == null) {\r\n this.#selected = null;\r\n this.#label.innerText = ' ';\r\n return false;\r\n }\r\n const html = item[htmlkey];\r\n if (html instanceof HTMLElement) {\r\n this.#label.replaceChildren(html.cloneNode(true));\r\n } else {\r\n let text = item[textkey];\r\n if (nullOrEmpty(text)) {\r\n text = ' ';\r\n }\r\n this.#label.innerText = text;\r\n }\r\n if (expanded) {\r\n const val = selected.replace(/\"/g, '\\\\\"');\r\n const li = this.#container.querySelector(`li[data-value=\"${val}\"]`);\r\n if (li != null) {\r\n li.classList.add('selected');\r\n }\r\n }\r\n }\r\n this.#selected = item;\r\n if (!silence && typeof this.onselected === 'function') {\r\n this.onselected(item);\r\n }\r\n }\r\n\r\n selectlist(selectedlist, silence) {\r\n const source = this.source;\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n const itemlist = selectedlist.map(v => {\r\n let item = source.find(it => it[valuekey] === v);\r\n if (item == null) {\r\n item = { [valuekey]: v, [textkey]: v };\r\n }\r\n return item;\r\n });\r\n if (itemlist.length === 0) {\r\n this.#selectedList = null;\r\n this.#label.innerText = none;\r\n return false;\r\n }\r\n selectItems(this.#label, itemlist, htmlkey, textkey);\r\n this.#selectedList = itemlist;\r\n if (!silence && typeof this.onselectedlist === 'function') {\r\n this.onselectedlist(itemlist);\r\n }\r\n }\r\n\r\n get #expanded() { return this.#container?.classList?.contains('active') }\r\n\r\n #dropdown(flag = true) {\r\n const options = this.#options;\r\n let panel = this.#container;\r\n if (panel == null) {\r\n panel = createElement('div', 'ui-drop-box');\r\n // search box\r\n if (!options.input && options.search) {\r\n const search = createElement('div', 'ui-drop-search');\r\n const input = createElement('input');\r\n input.setAttribute('type', 'text');\r\n isPositive(options.tabIndex) && input.setAttribute('tabindex', options.tabIndex);\r\n !nullOrEmpty(options.searchplaceholder) && input.setAttribute('placeholder', options.searchplaceholder);\r\n input.addEventListener('input', e => {\r\n const key = e.target.value.toLowerCase();\r\n const source = filterSource(options.searchkeys, options.textkey, key, this.source);\r\n this.#filllist(source);\r\n })\r\n search.append(input, createIcon('fa-light', 'search'));\r\n panel.appendChild(search);\r\n }\r\n // list\r\n const list = createElement('ul', 'ui-drop-list');\r\n if (!this.multiselect) {\r\n list.addEventListener('click', e => {\r\n let li = e.target;\r\n while (li.tagName !== 'LI') {\r\n li = li.parentElement;\r\n if (li == null) {\r\n return;\r\n }\r\n }\r\n const value = li.dataset.value;\r\n if (this.select(value) !== false) {\r\n dropdownGlobal.clear();\r\n }\r\n });\r\n }\r\n panel.appendChild(list);\r\n this.#container = panel;\r\n this.#wrapper.appendChild(panel);\r\n }\r\n if (flag) {\r\n let source = this.source;\r\n if (!options.input && options.search) {\r\n const search = panel.querySelector('.ui-drop-search > input');\r\n if (!nullOrEmpty(search?.value)) {\r\n source = filterSource(options.searchkeys, options.textkey, search.value, source);\r\n }\r\n }\r\n this.#filllist(source);\r\n // slide direction\r\n if (!options.slidefixed) {\r\n let parent = options.parent ?? document.body;\r\n let p = this.#wrapper;\r\n let top = p.offsetTop;\r\n while ((p = p.parentElement) != null && p !== parent) {\r\n top -= p.scrollTop;\r\n }\r\n if (top - parent.offsetTop + DropdownTitleHeight + panel.offsetHeight >= parent.offsetHeight) {\r\n panel.classList.add('slide-up');\r\n } else {\r\n panel.classList.remove('slide-up');\r\n }\r\n }\r\n panel.classList.add('active');\r\n } else {\r\n panel.classList.remove('active');\r\n }\r\n }\r\n\r\n #filllist(source) {\r\n const list = this.#container.querySelector('.ui-drop-list');\r\n list.replaceChildren();\r\n const multiselect = this.multiselect;\r\n const allchecked = this.#allChecked;\r\n if (multiselect) {\r\n list.appendChild(\r\n createElement('li', null,\r\n createCheckbox({\r\n label: r('allItem', '( All )'),\r\n checked: allchecked,\r\n customerAttributes: { 'isall': '1' },\r\n onchange: e => this.#triggerselect(e.target)\r\n })\r\n )\r\n );\r\n }\r\n // TODO: virtual mode\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n const selected = this.selected;\r\n const selectedlist = this.selectedlist;\r\n let scrolled;\r\n source.slice(0, 200).forEach((item, i) => {\r\n const val = item[valuekey];\r\n const li = createElement('li');\r\n li.dataset.value = val;\r\n li.setAttribute('title', item[textkey]);\r\n let label;\r\n const html = item[htmlkey];\r\n if (html instanceof HTMLElement) {\r\n label = html;\r\n }\r\n if (multiselect) {\r\n const selected = selectedlist.some(s => s[valuekey] === val);\r\n if (label == null) {\r\n label = createElement('span');\r\n label.innerText = item[textkey];\r\n }\r\n const box = createCheckbox({\r\n label,\r\n checked: allchecked || selected,\r\n customerAttributes: {\r\n 'class': 'dataitem',\r\n 'data-value': val\r\n },\r\n onchange: e => this.#triggerselect(e.target)\r\n });\r\n li.appendChild(box);\r\n } else {\r\n if (label == null) {\r\n li.innerText = item[textkey];\r\n } else {\r\n li.appendChild(label);\r\n }\r\n if (selected != null && selected[valuekey] === val) {\r\n scrolled = DropdownItemHeight * i;\r\n li.classList.add('selected');\r\n }\r\n }\r\n list.appendChild(li);\r\n });\r\n if (scrolled != null) {\r\n setTimeout(() => list.scrollTop = scrolled, 10);\r\n }\r\n }\r\n\r\n #triggerselect(checkbox) {\r\n let list;\r\n const valuekey = this.#options.valuekey;\r\n const textkey = this.#options.textkey;\r\n const htmlkey = this.#options.htmlkey;\r\n if (checkbox.getAttribute('isall') === '1') {\r\n const allchecked = this.#allChecked = checkbox.checked;\r\n const boxes = this.#container.querySelectorAll('input.dataitem');\r\n boxes.forEach(box => box.checked = allchecked);\r\n list = [];\r\n } else if (checkbox.checked) {\r\n if (this.#container.querySelectorAll('input.dataitem:not(:checked)').length === 0) {\r\n this.#allChecked = true;\r\n this.#container.querySelector('input[isall=\"1\"]').checked = true;\r\n list = [];\r\n } else {\r\n const source = this.source;\r\n list = [...this.#container.querySelectorAll('input.dataitem:checked')]\r\n .map(c => source.find(it => it[valuekey] === c.dataset.value))\r\n .filter(it => it != null);\r\n }\r\n } else {\r\n const val = checkbox.dataset.value;\r\n if (this.#allChecked) {\r\n this.#allChecked = false;\r\n this.#container.querySelector('input[isall=\"1\"]').checked = false;\r\n list = this.source.filter(it => it[valuekey] !== val);\r\n } else {\r\n list = this.selectedlist.filter(it => it[valuekey] !== val);\r\n }\r\n }\r\n if (this.#allChecked) {\r\n this.#label.innerText = r('allItem', '( All )');\r\n } else {\r\n selectItems(this.#label, list, htmlkey, textkey);\r\n }\r\n this.#selectedList = list;\r\n if (typeof this.onselectedlist === 'function') {\r\n this.onselectedlist(itemlist);\r\n }\r\n }\r\n\r\n static resolve(dom = document.body) {\r\n const selects = dom.querySelectorAll('select');\r\n for (let sel of selects) {\r\n const source = [...sel.children].map(it => {\r\n return { value: it.value, text: it.innerText }\r\n });\r\n const drop = new Dropdown({\r\n selected: sel.value,\r\n disabled: sel.disabled,\r\n tabIndex: sel.tabIndex\r\n });\r\n drop.source = source;\r\n sel.parentElement.replaceChild(drop.create(), sel);\r\n }\r\n return dom;\r\n }\r\n}\r\n\r\nexport default Dropdown;","import { global } from \"../../utility\";\r\n// import { nullOrEmpty } from \"../../utility/strings\";\r\nimport { createElement } from \"../../functions\";\r\nimport { createIcon } from \"../icon\";\r\nimport { createCheckbox } from \"../checkbox\";\r\n// import { setTooltip } from \"../tooltip\";\r\nimport Dropdown from \"../dropdown\";\r\n\r\nclass GridColumn {\r\n static create() {\r\n return createElement('span');\r\n }\r\n\r\n static setValue(element, val) {\r\n element.innerText = val;\r\n }\r\n\r\n static setStyle(element, style) {\r\n for (let css of Object.entries(style)) {\r\n element.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n\r\n static setEnabled(element, enabled) {\r\n const tooltip = element.querySelector('.ui-tooltip-wrapper');\r\n if (tooltip != null) {\r\n tooltip.style.display = enabled === false ? 'none' : '';\r\n }\r\n }\r\n}\r\n\r\nclass GridInputColumn extends GridColumn {\r\n static get editing() { return true };\r\n\r\n static createEdit(trigger, col, _parent, vals) {\r\n const input = createElement('input');\r\n input.setAttribute('type', 'text');\r\n if (typeof trigger === 'function') {\r\n input.addEventListener('change', trigger);\r\n }\r\n input.addEventListener('input', () => {\r\n if (vals.__editing == null) {\r\n vals.__editing = {\r\n [col.key]: true\r\n }\r\n } else {\r\n vals.__editing[col.key] = true;\r\n }\r\n });\r\n return input;\r\n }\r\n\r\n static setValue(element, val) {\r\n if (element.tagName !== 'INPUT') {\r\n super.setValue(element, val);\r\n } else {\r\n element.value = val;\r\n }\r\n }\r\n\r\n static getValue(e) { return e.target.value }\r\n\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element , enabled);\r\n element.disabled = enabled === false;\r\n }\r\n}\r\n\r\nclass GridTextColumn extends GridInputColumn {\r\n static createEdit(trigger, col, _parent, vals) {\r\n const input = createElement('textarea');\r\n if (typeof trigger === 'function') {\r\n input.addEventListener('change', trigger);\r\n }\r\n input.addEventListener('input', () => {\r\n if (vals.__editing == null) {\r\n vals.__editing = {\r\n [col.key]: true\r\n }\r\n } else {\r\n vals.__editing[col.key] = true;\r\n }\r\n });\r\n return input;\r\n }\r\n\r\n static setValue(element, val, _item, _col, grid) {\r\n if (element.tagName !== 'TEXTAREA') {\r\n super.setValue(element, val);\r\n } else {\r\n element.value = val;\r\n if (val != null) {\r\n const lines = String(val).split('\\n').length;\r\n element.style.height = `${lines * grid.lineHeight + 12}px`;\r\n }\r\n // TODO: bad performance\r\n }\r\n }\r\n}\r\n\r\nconst SymbolDropdown = Symbol.for('ui-dropdown');\r\n\r\nclass GridDropdownColumn extends GridColumn {\r\n static createEdit(trigger, col, parent) {\r\n const drop = new Dropdown({ ...col.dropOptions, parent });\r\n drop.onselected = trigger;\r\n return drop.create();\r\n }\r\n\r\n static #getDrop(element) {\r\n const dropGlobal = global[SymbolDropdown];\r\n if (dropGlobal == null) {\r\n return null;\r\n }\r\n const dropId = element.dataset.dropId;\r\n const drop = dropGlobal[dropId];\r\n if (drop == null) {\r\n return null;\r\n }\r\n return drop;\r\n }\r\n\r\n static #getSource(item, col) {\r\n let source = col.source;\r\n if (typeof source === 'function') {\r\n source = source(item);\r\n }\r\n return source;\r\n }\r\n\r\n static #setValue(source, element, val) {\r\n const data = source?.find(v => v.value === val);\r\n if (data != null) {\r\n val = data.text;\r\n }\r\n super.setValue(element, val);\r\n }\r\n\r\n static setValue(element, val, item, col) {\r\n if (element.tagName !== 'DIV') {\r\n let source = this.#getSource(item, col);\r\n if (source instanceof Promise) {\r\n source.then(s => this.#setValue(s, element, val));\r\n } else {\r\n this.#setValue(source, element, val);\r\n }\r\n return;\r\n }\r\n const drop = this.#getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n if (drop.source == null || drop.source.length === 0) {\r\n let source = this.#getSource(item, col);\r\n if (source instanceof Promise) {\r\n source.then(s => {\r\n drop.source = s;\r\n drop.select(val, true);\r\n })\r\n return;\r\n } else if (source != null) {\r\n drop.source = source;\r\n }\r\n }\r\n drop.select(val, true);\r\n }\r\n\r\n static getValue(e) {\r\n return e.value;\r\n }\r\n\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element , enabled);\r\n const drop = this.#getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n drop.disabled = enabled === false;\r\n }\r\n}\r\n\r\nclass GridCheckboxColumn extends GridColumn {\r\n static createEdit(trigger) {\r\n const check = createCheckbox({\r\n onchange: typeof trigger === 'function' ? trigger : null\r\n });\r\n return check;\r\n }\r\n\r\n static setValue(element, val) {\r\n element.querySelector('input').checked = val;\r\n }\r\n\r\n static getValue(e) { return e.target.checked }\r\n\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element , enabled);\r\n element.querySelector('input').disabled = enabled === false;\r\n }\r\n}\r\n\r\nclass GridIconColumn extends GridColumn {\r\n static create() { return createElement('span', 'col-icon') }\r\n\r\n static setValue(element, val, item, col, grid) {\r\n let className = col.className;\r\n if (typeof className === 'function') {\r\n className = className.call(col, item);\r\n }\r\n if (className == null) {\r\n element.className = 'col-icon';\r\n } else {\r\n element.className = `col-icon ${className}`;\r\n }\r\n let type = col.iconType;\r\n if (typeof type === 'function') {\r\n type = type.call(col, item);\r\n }\r\n type ??= 'fa-regular';\r\n if (element.dataset.type !== type || element.dataset.icon !== val) {\r\n const icon = createIcon(type, val);\r\n // const layer = element.children[0];\r\n element.replaceChildren(icon);\r\n // !nullOrEmpty(col.tooltip) && setTooltip(element, col.tooltip, false, grid.element);\r\n element.dataset.type = type;\r\n element.dataset.icon = val;\r\n }\r\n }\r\n\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element , enabled);\r\n if (enabled === false) {\r\n element.classList.add('disabled');\r\n } else {\r\n element.classList.remove('disabled');\r\n }\r\n }\r\n}\r\n\r\nexport {\r\n GridColumn,\r\n GridInputColumn,\r\n GridTextColumn,\r\n GridDropdownColumn,\r\n GridCheckboxColumn,\r\n GridIconColumn\r\n}","import '../css/grid.scss';\r\nimport { global, isPositive, isMobile, throttle, truncate } from \"../../utility\";\r\nimport { r } from \"../../utility/lgres\";\r\nimport { nullOrEmpty } from \"../../utility/strings\";\r\nimport { createElement } from \"../../functions\";\r\nimport { createIcon } from \"../icon\";\r\nimport { createCheckbox } from \"../checkbox\";\r\nimport { setTooltip } from \"../tooltip\";\r\nimport { GridColumn, GridInputColumn, GridTextColumn, GridDropdownColumn, GridCheckboxColumn, GridIconColumn } from \"./column\";\r\n\r\nconst ColumnChangedType = {\r\n Reorder: 'reorder',\r\n Resize: 'resize',\r\n Sort: 'sort'\r\n};\r\nconst RefreshInterval = isMobile() ? 32 : 0;\r\nconst HoverInternal = 200;\r\nconst RedumCount = 4;\r\nconst MiniDragOffset = 4;\r\nconst MiniColumnWidth = 50;\r\nconst FilterPanelWidth = 200;\r\n\r\nfunction getClientX(e) {\r\n if (e == null) {\r\n return null;\r\n }\r\n const cx = e.touches && e.touches[0]?.clientX;\r\n return cx ?? e.clientX;\r\n}\r\n\r\nfunction getOffsetLeftFromWindow(element) {\r\n let left = 0;\r\n while (element != null) {\r\n left += element.offsetLeft;\r\n element = element.offsetParent;\r\n }\r\n return left;\r\n}\r\n\r\nfunction indexOfParent(target) {\r\n // return [...target.parentElement.children].indexOf(target);\r\n return Array.prototype.indexOf.call(target.parentElement.children, target);\r\n}\r\n\r\nconst ColumnTypes = {\r\n 0: GridColumn,\r\n 1: GridInputColumn,\r\n 2: GridDropdownColumn,\r\n 3: GridCheckboxColumn,\r\n 4: GridIconColumn,\r\n 5: GridTextColumn\r\n};\r\n\r\nclass Grid {\r\n #source;\r\n #currentSource;\r\n #parent;\r\n #el;\r\n #refs;\r\n #rendering;\r\n #selectedColumnIndex = -1;\r\n #selectedIndexes;\r\n #startIndex = 0;\r\n #needResize;\r\n #containerHeight;\r\n #bodyClientWidth;\r\n #rowCount = -1;\r\n #scrollTop;\r\n #scrollLeft;\r\n #colTypes = {};\r\n #colAttrs = {};\r\n #vtable = [];\r\n\r\n columns = [];\r\n langs = {\r\n all: r('allItem', '( All )'),\r\n ok: r('ok', 'OK'),\r\n reset: r('reset', 'Reset')\r\n };\r\n virtualCount = 100;\r\n rowHeight = 36;\r\n lineHeight = 24;\r\n extraRows = 0;\r\n filterRowHeight = 30;\r\n height;\r\n readonly;\r\n multiSelect = false;\r\n fullrowClick = true;\r\n allowHtml = false;\r\n holderDisabled = false;\r\n headerVisible = true;\r\n window = global;\r\n sortIndex = -1;\r\n sortDirection = 1;\r\n\r\n willSelect;\r\n selectedRowChanged;\r\n cellDblClicked;\r\n cellClicked;\r\n rowDblClicked;\r\n columnChanged;\r\n\r\n static ColumnTypes = {\r\n Common: 0,\r\n Input: 1,\r\n Dropdown: 2,\r\n Checkbox: 3,\r\n Icon: 4,\r\n Text: 5,\r\n isCheckbox(type) { return type === 3 }\r\n };\r\n\r\n static GridColumn = GridColumn;\r\n\r\n constructor(container) {\r\n this.#parent = container;\r\n }\r\n\r\n get element() { return this.#el }\r\n\r\n get source() { return this.#source?.map(s => s.values) }\r\n set source(list) {\r\n if (this.#el == null) {\r\n throw new Error('grid has not been initialized.')\r\n }\r\n if (!Array.isArray(list)) {\r\n throw new Error('source is not an Array.')\r\n }\r\n list = list.map(i => { return { values: i } });\r\n this.#source = list;\r\n this.#refreshSource(list);\r\n }\r\n\r\n #refreshSource(list) {\r\n list ??= this.#source;\r\n if (this.#colAttrs.__filtered === true) {\r\n this.#currentSource = list.filter(it => {\r\n for (let col of this.columns) {\r\n if (Array.isArray(col.filterValues)) {\r\n const v = this.#getItemValue(it.values, col.key, col.filter);\r\n if (col.filterValues.indexOf(v) < 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n } else {\r\n this.#currentSource = list;\r\n }\r\n this.#selectedColumnIndex = -1;\r\n this.#selectedIndexes = [];\r\n this.#startIndex = 0;\r\n this.#scrollTop = 0;\r\n this.#scrollLeft = 0;\r\n this.#rowCount = -1;\r\n\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn();\r\n }\r\n this.resize();\r\n }\r\n\r\n get virtual() { return this.#currentSource?.length > this.virtualCount }\r\n\r\n get sortKey() {\r\n if (this.columns == null) {\r\n return null;\r\n }\r\n return this.columns[this.sortIndex]?.key;\r\n }\r\n\r\n get selectedIndexes() { return this.#selectedIndexes }\r\n set selectedIndexes(indexes) {\r\n const startIndex = this.#startIndex;\r\n this.#selectedIndexes.splice(0, this.#selectedIndexes.length, ...indexes);\r\n if (this.readonly !== true) {\r\n this.refresh();\r\n } else {\r\n [...this.#refs.bodyContent.children].forEach((row, i) => {\r\n if (indexes.indexOf(startIndex + i) >= 0) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n });\r\n }\r\n if (typeof this.selectedRowChanged === 'function') {\r\n this.selectedRowChanged();\r\n }\r\n }\r\n\r\n get selectedIndex() { return (this.#selectedIndexes && this.#selectedIndexes[0]) ?? -1 }\r\n\r\n get loading() { return this.#refs.loading?.style?.visibility === 'visible' }\r\n set loading(flag) {\r\n if (this.#refs.loading == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n this.#refs.loading.style.visibility = 'hidden';\r\n this.#refs.loading.style.opacity = 0;\r\n } else {\r\n this.#refs.loading.style.visibility = 'visible';\r\n this.#refs.loading.style.opacity = 1;\r\n }\r\n }\r\n\r\n get scrollTop() { return this.#refs.body?.scrollTop; }\r\n set scrollTop(top) {\r\n if (this.#refs.body == null) {\r\n return;\r\n }\r\n this.#refs.body.scrollTop = top;\r\n this.reload();\r\n }\r\n\r\n init(container = this.#parent) {\r\n this.#el = null;\r\n this.#refs = {};\r\n this.#rendering = true;\r\n if (!(container instanceof HTMLElement)) {\r\n throw new Error('no specified parent.');\r\n }\r\n this.#parent = container;\r\n const grid = createElement('div', 'ui-grid');\r\n grid.setAttribute('tabindex', 0);\r\n grid.addEventListener('keydown', e => {\r\n let index = this.selectedIndex;\r\n let flag = false;\r\n if (e.key === 'ArrowUp') {\r\n // up\r\n if (index > 0) {\r\n flag = true;\r\n index -= 1;\r\n }\r\n } else if (e.key === 'ArrowDown') {\r\n // down\r\n const count = this.#currentSource?.length ?? 0;\r\n if (index < count - 1) {\r\n flag = true;\r\n index += 1;\r\n }\r\n }\r\n if (flag) {\r\n this.#selectedIndexes = [index];\r\n this.scrollToIndex(index);\r\n this.refresh();\r\n if (typeof this.selectedRowChanged === 'function') {\r\n this.selectedRowChanged(index);\r\n }\r\n e.stopPropagation();\r\n }\r\n });\r\n container.replaceChildren(grid);\r\n const sizer = createElement('span', 'ui-grid-sizer');\r\n grid.appendChild(sizer);\r\n this.#refs.sizer = sizer;\r\n\r\n // header & body\r\n const header = this.#createHeader();\r\n grid.appendChild(header);\r\n const body = this.#createBody();\r\n grid.appendChild(body);\r\n\r\n // loading\r\n const loading = createElement('div', 'ui-grid-loading',\r\n createElement('div', null, createIcon('fa-regular', 'spinner-third'))\r\n );\r\n this.#refs.loading = loading;\r\n grid.appendChild(loading);\r\n this.#el = grid;\r\n\r\n this.#rendering = false;\r\n if (this.#source != null && this.sortIndex >= 0) {\r\n this.sortColumn();\r\n }\r\n }\r\n\r\n scrollToIndex(index) {\r\n const top = this.#scrollToTop(index * (this.rowHeight + 1), true);\r\n this.#refs.body.scrollTop = top;\r\n }\r\n\r\n resize(force) {\r\n if (this.#rendering || this.#el == null) {\r\n return;\r\n }\r\n const body = this.#refs.body;\r\n // let height = this.#refs.header.offsetHeight + 2;\r\n // let top = body.offsetTop;\r\n // if (top !== height) {\r\n // body.style.top = `${height}px`;\r\n // top = height;\r\n // }\r\n const top = this.headerVisible === false ? 0 : this.#refs.header.offsetHeight;\r\n\r\n let height = this.height;\r\n if (height === 0) {\r\n height = this.#containerHeight;\r\n } else if (isNaN(height) || height < 0) {\r\n height = this.#el.offsetHeight - top;\r\n }\r\n const count = truncate((height - 1) / (this.rowHeight + 1)) + (RedumCount * 2) + 1;\r\n if (force || count !== this.#rowCount) {\r\n this.#rowCount = count;\r\n this.reload();\r\n }\r\n this.#bodyClientWidth = body.clientWidth;\r\n }\r\n\r\n reload() {\r\n let length = this.#currentSource.length;\r\n if (this.extraRows > 0) {\r\n length += this.extraRows;\r\n }\r\n this.#containerHeight = length * (this.rowHeight + 1);\r\n this.#refs.body.scrollTop = 0;\r\n this.#refs.body.scrollLeft = 0;\r\n this.#refs.bodyContent.style.top = '0px';\r\n this.#refs.bodyContainer.style.height = `${this.#containerHeight}px`;\r\n this.#adjustRows(this.#refs.bodyContent);\r\n this.refresh();\r\n }\r\n\r\n refresh() {\r\n if (this.#refs.bodyContent == null) {\r\n throw new Error('body has not been created.');\r\n }\r\n const rows = this.#refs.bodyContent.children;\r\n const widths = {};\r\n this.#fillRows(rows, this.columns, widths);\r\n if (this.#needResize && widths.flag) {\r\n this.#needResize = false;\r\n this.columns.forEach((col, i) => {\r\n if (!this.#get(col.key, 'autoResize')) {\r\n return;\r\n }\r\n let width = widths[i];\r\n if (width < col.width) {\r\n width = col.width;\r\n }\r\n if (width > 0) {\r\n this.#changeColumnWidth(i, width);\r\n }\r\n });\r\n }\r\n }\r\n\r\n resetChange() {\r\n if (this.#source == null) {\r\n return;\r\n }\r\n for (let row of this.#source) {\r\n delete row.__changed;\r\n }\r\n }\r\n\r\n sortColumn(reload) {\r\n const index = this.sortIndex;\r\n const col = this.columns[index];\r\n if (col == null) {\r\n return;\r\n }\r\n const direction = this.sortDirection;\r\n [...this.#refs.header.children].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n if (i === index) {\r\n arrow.className = `arrow ${(direction !== 1 ? 'desc' : 'asc')}`;\r\n } else if (arrow.className !== 'arrow') {\r\n arrow.className = 'arrow';\r\n }\r\n });\r\n let comparer;\r\n if (typeof col.sortFilter !== 'function') {\r\n const direction = this.sortDirection;\r\n if (isNaN(direction)) {\r\n direction = 1;\r\n }\r\n comparer = (a, b) => {\r\n a = this.#getItemValue(a.values, col.key, col.filter);\r\n b = this.#getItemValue(b.values, col.key, col.filter);\r\n if (a == null && typeof b === 'number') {\r\n a = 0;\r\n } else if (typeof a === 'number' && b == null) {\r\n b = 0;\r\n } else if (a != null && b == null) {\r\n return direction;\r\n } else if (typeof a === 'string' && typeof b === 'string') {\r\n a = a.toLowerCase();\r\n b = b.toLowerCase();\r\n }\r\n return a === b ? 0 : (a > b ? 1 : -1) * direction;\r\n };\r\n } else {\r\n comparer = (a, b) => col.sortFilter(a.values, b.values) * direction;\r\n }\r\n this.#source.sort(comparer);\r\n if (this.#colAttrs.__filtered === true) {\r\n this.#currentSource.sort(comparer);\r\n }\r\n if (this.#rowCount < 0) {\r\n return;\r\n }\r\n if (reload) {\r\n this.reload();\r\n } else {\r\n this.refresh();\r\n }\r\n }\r\n\r\n #createHeader() {\r\n const thead = createElement('table', 'ui-grid-header');\r\n if (this.headerVisible === false) {\r\n thead.style.display = 'none';\r\n }\r\n const header = createElement('tr');\r\n thead.appendChild(header);\r\n const sizer = this.#refs.sizer;\r\n for (let col of this.columns) {\r\n if (col.visible === false) {\r\n const hidden = createElement('th');\r\n hidden.style.display = 'none';\r\n if (col.sortable !== false) {\r\n hidden.dataset.key = col.key;\r\n hidden.addEventListener('click', e => this.#onHeaderClicked(e, col, true));\r\n }\r\n header.appendChild(hidden);\r\n continue;\r\n }\r\n // style\r\n const isCheckbox = Grid.ColumnTypes.isCheckbox(col.type);\r\n if (col.width > 0) {\r\n // col.autoResize = false;\r\n } else {\r\n this.#set(col.key, 'autoResize', true);\r\n this.#needResize = true;\r\n sizer.innerText = col.caption ?? '';\r\n let width = sizer.offsetWidth + 22;\r\n if (!this.readonly && col.enabled !== false && col.allcheck && isCheckbox) {\r\n width += 32;\r\n }\r\n if (col.allowFilter === true) {\r\n width += 14;\r\n }\r\n if (width < MiniColumnWidth) {\r\n width = MiniColumnWidth;\r\n }\r\n col.width = width;\r\n }\r\n col.align ??= isCheckbox ? 'center' : 'left';\r\n if (col.sortable !== false) {\r\n col.sortable = true;\r\n }\r\n const w = `${col.width}px`;\r\n const style = {\r\n 'width': w,\r\n 'max-width': w,\r\n 'min-width': w,\r\n 'text-align': col.align\r\n };\r\n this.#set(col.key, 'style', style);\r\n // element\r\n const th = createElement('th', 'column');\r\n th.dataset.key = col.key;\r\n for (let css of Object.entries(style)) {\r\n th.style.setProperty(css[0], css[1]);\r\n }\r\n if (col.sortable) {\r\n th.style.cursor = 'pointer';\r\n th.addEventListener('click', e => this.#onHeaderClicked(e, col));\r\n }\r\n if (col.orderable !== false) {\r\n col.orderable = true;\r\n th.addEventListener('mousedown', e => this.#onDragStart(e, col));\r\n }\r\n const wrapper = createElement('div');\r\n th.appendChild(wrapper);\r\n if (!this.readonly && col.enabled !== false && col.allcheck && isCheckbox) {\r\n const check = createCheckbox({\r\n onchange: e => this.#onColumnAllChecked(col, e.target.checked)\r\n });\r\n wrapper.appendChild(check);\r\n }\r\n const caption = createElement('span');\r\n if (col.textStyle != null) {\r\n for (let css of Object.entries(col.textStyle)) {\r\n caption.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n caption.innerText = col.caption ?? '';\r\n wrapper.appendChild(caption);\r\n // order arrow\r\n if (col.sortable) {\r\n th.appendChild(createElement('layer', 'arrow'));\r\n }\r\n // filter\r\n if (col.allowFilter === true) {\r\n const filter = createElement('layer', 'filter');\r\n filter.appendChild(createIcon('fa-solid', 'filter'));\r\n filter.addEventListener('mousedown', e => this.#onFilter(e, col));\r\n th.classList.add('header-filter');\r\n th.appendChild(filter);\r\n }\r\n // resize spliter\r\n if (col.resizable !== false) {\r\n const spliter = createElement('layer', 'spliter');\r\n spliter.addEventListener('mousedown', e => this.#onResizeStart(e, col));\r\n spliter.addEventListener('dblclick', e => this.#onAutoResize(e, col));\r\n th.appendChild(spliter);\r\n }\r\n // tooltip\r\n // !nullOrEmpty(col.tooltip) && setTooltip(th, col.tooltip);\r\n header.appendChild(th);\r\n }\r\n const dragger = createElement('div', 'dragger');\r\n const draggerCursor = createElement('layer', 'dragger-cursor');\r\n header.appendChild(createElement('th', null, dragger, draggerCursor));\r\n\r\n sizer.replaceChildren();\r\n this.#refs.header = header;\r\n this.#refs.dragger = dragger;\r\n this.#refs.draggerCursor = draggerCursor;\r\n return thead;\r\n }\r\n\r\n #createBody() {\r\n const body = createElement('div', 'ui-grid-body');\r\n body.addEventListener('scroll', e => throttle(this.#onScroll, RefreshInterval, this, e), { passive: true });\r\n const cols = this.columns;\r\n let width = 1;\r\n for (let col of cols) {\r\n if (col.visible !== false && !isNaN(col.width)) {\r\n width += col.width + 1;\r\n }\r\n }\r\n // body container\r\n const bodyContainer = createElement('div');\r\n bodyContainer.style.position = 'relative';\r\n bodyContainer.style.minWidth = '100%';\r\n bodyContainer.style.minHeight = '1px';\r\n if (width > 0) {\r\n bodyContainer.style.width = `${width}px`;\r\n }\r\n body.appendChild(bodyContainer);\r\n // body content\r\n const bodyContent = createElement('table', 'ui-grid-body-content');\r\n bodyContent.addEventListener('mousedown', e => {\r\n let [parent, target] = this.#getRowTarget(e.target);\r\n const rowIndex = indexOfParent(parent);\r\n let colIndex = indexOfParent(target);\r\n if (colIndex >= this.columns.length) {\r\n colIndex = -1;\r\n }\r\n this.#onRowClicked(e, rowIndex, colIndex);\r\n });\r\n bodyContent.addEventListener('dblclick', e => this.#onRowDblClicked(e));\r\n bodyContainer.appendChild(bodyContent);\r\n // this.#adjustRows();\r\n // events\r\n if (!this.holderDisabled) {\r\n const holder = createElement('div', 'ui-grid-hover-holder');\r\n holder.addEventListener('mousedown', e => {\r\n const holder = e.currentTarget;\r\n const row = Number(holder.dataset.row);\r\n const col = Number(holder.dataset.col);\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n }\r\n return this.#onRowClicked(e, row + this.#startIndex, col);\r\n });\r\n holder.addEventListener('dblclick', e => this.#onRowDblClicked(e));\r\n bodyContainer.appendChild(holder);\r\n body.addEventListener('mousemove', e => throttle(this.#onBodyMouseMove, HoverInternal, this, e, holder), { passive: true });\r\n }\r\n this.#refs.body = body;\r\n this.#refs.bodyContainer = bodyContainer;\r\n this.#refs.bodyContent = bodyContent;\r\n\r\n // this.refresh();\r\n return body;\r\n }\r\n\r\n #adjustRows() {\r\n let count = this.#rowCount;\r\n if (isNaN(count) || count < 0 || !this.virtual) {\r\n count = this.#currentSource.length;\r\n }\r\n const cols = this.columns;\r\n const content = this.#refs.bodyContent;\r\n const exists = content.children.length;\r\n count -= exists;\r\n if (count > 0) {\r\n for (let i = 0; i < count; i += 1) {\r\n const row = createElement('tr', 'ui-grid-row');\r\n // row.addEventListener('mousedown', e => this.#onRowClicked(e, exists + i));\r\n // row.addEventListener('dblclick', e => this.#onRowDblClicked(e));\r\n cols.forEach((col, j) => {\r\n const cell = createElement('td');\r\n if (col.visible !== false) {\r\n cell.dataset.row = String(exists + i);\r\n cell.dataset.col = String(j);\r\n const style = this.#get(col.key, 'style');\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n cell.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n if (col.css != null) {\r\n for (let css of Object.entries(col.css)) {\r\n cell.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n if (Grid.ColumnTypes.isCheckbox(col.type)) {\r\n cell.appendChild(GridCheckboxColumn.createEdit(e => this.#onRowChanged(e, exists + i, col, e.target.checked, cell)));\r\n // this.#colTypes[col.key] = GridCheckboxColumn;\r\n } else {\r\n let type = this.#colTypes[col.key];\r\n if (type == null) {\r\n if (isNaN(col.type)) {\r\n if (this.allowHtml && col.type != null) {\r\n type = col.type;\r\n }\r\n } else {\r\n type = ColumnTypes[col.type];\r\n }\r\n type ??= GridColumn;\r\n this.#colTypes[col.key] = type;\r\n }\r\n cell.appendChild(type.create(col));\r\n }\r\n }\r\n row.appendChild(cell);\r\n });\r\n row.appendChild(createElement('td'));\r\n content.appendChild(row);\r\n }\r\n } else if (count < 0) {\r\n for (let i = -1; i >= count; i -= 1) {\r\n // content.removeChild(content.children[exists + i]);\r\n content.children[exists + i].remove();\r\n }\r\n }\r\n }\r\n\r\n #fillRows(rows, cols, widths) {\r\n const startIndex = this.#startIndex;\r\n const selectedIndexes = this.#selectedIndexes;\r\n [...rows].forEach((row, i) => {\r\n const vals = this.#currentSource[startIndex + i];\r\n if (vals == null) {\r\n return;\r\n }\r\n if (!isPositive(row.children.length)) {\r\n return;\r\n }\r\n const item = vals.values;\r\n const selected = selectedIndexes.indexOf(startIndex + i) >= 0;\r\n if (selected) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n // data\r\n const selectChanged = vals.__selected ^ selected;\r\n if (selected) {\r\n vals.__selected = true;\r\n } else {\r\n delete vals.__selected;\r\n }\r\n cols.forEach((col, j) => {\r\n if (col.visible === false) {\r\n return;\r\n }\r\n let val;\r\n if (col.text != null) {\r\n val = col.text;\r\n } else if (typeof col.filter === 'function') {\r\n val = col.filter(item);\r\n } else {\r\n val = item[col.key];\r\n if (val?.displayValue != null) {\r\n val = val.displayValue;\r\n }\r\n }\r\n val ??= '';\r\n // fill\r\n const cell = row.children[j];\r\n if (typeof col.bgFilter === 'function') {\r\n const bgColor = col.bgFilter(item);\r\n cell.style.backgroundColor = bgColor ?? '';\r\n }\r\n const isCheckbox = Grid.ColumnTypes.isCheckbox(col.type);\r\n const type = isCheckbox ? GridCheckboxColumn : this.#colTypes[col.key] ?? GridColumn;\r\n let element;\r\n if (!isCheckbox && selectChanged && typeof type.createEdit === 'function') {\r\n if (vals.__editing?.[col.key] && type.editing) {\r\n val = type.getValue({ target: cell.children[0] });\r\n this.#onRowChanged(null, startIndex + i, col, val, cell, true);\r\n }\r\n element = selected ?\r\n type.createEdit(e => this.#onRowChanged(e, startIndex + i, col, type.getValue(e), cell), col, this.#refs.bodyContent, vals) :\r\n type.create(col);\r\n cell.replaceChildren(element);\r\n } else {\r\n element = cell.children[0];\r\n }\r\n let enabled;\r\n if (this.readonly) {\r\n enabled = false;\r\n } else {\r\n enabled = col.enabled;\r\n if (typeof enabled === 'function') {\r\n enabled = enabled.call(col, item);\r\n } else if (typeof enabled === 'string') {\r\n enabled = item[enabled];\r\n }\r\n }\r\n type.setValue(element, val, item, col, this);\r\n let tip = col.tooltip;\r\n if (typeof tip === 'function') {\r\n tip = tip.call(col, item);\r\n }\r\n if (nullOrEmpty(tip)) {\r\n element.querySelector('.ui-tooltip-wrapper')?.remove();\r\n } else {\r\n setTooltip(element, tip, false, this.element);\r\n }\r\n if (typeof type.setEnabled === 'function') {\r\n type.setEnabled(element, enabled);\r\n }\r\n // auto resize\r\n if (this.#needResize && this.#get(col.key, 'autoResize')) {\r\n const width = element.scrollWidth + 12;\r\n if (width > 0 && widths != null && (isNaN(widths[j]) || widths[j] < width)) {\r\n widths[j] = width;\r\n widths.flag = true;\r\n }\r\n }\r\n if (typeof col.styleFilter === 'function') {\r\n const style = col.styleFilter(item);\r\n if (style != null) {\r\n type.setStyle(element, style);\r\n }\r\n }\r\n if (col.events != null) {\r\n for (let ev of Object.entries(col.events)) {\r\n element[ev[0]] = ev[1].bind(item);\r\n }\r\n }\r\n if (col.attrs != null) {\r\n let attrs = col.attrs;\r\n if (typeof attrs === 'function') {\r\n attrs = attrs(item);\r\n }\r\n for (let attr of Object.entries(attrs)) {\r\n element.setAttribute(attr[0], attr[1]);\r\n }\r\n }\r\n });\r\n if (vals.__editing != null) {\r\n delete vals.__editing;\r\n }\r\n });\r\n }\r\n\r\n #changeColumnWidth(index, width) {\r\n const col = this.columns[index];\r\n // const oldwidth = col.width;\r\n const w = `${width}px`;\r\n col.width = width;\r\n const style = this.#get(col.key, 'style');\r\n style.width = w;\r\n style['max-width'] = w;\r\n style['min-width'] = w;\r\n let element = this.#refs.header.children[index];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n const body = this.#refs.bodyContent;\r\n for (let row of body.children) {\r\n element = row.children[index];\r\n if (element != null) {\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n }\r\n }\r\n // } else {\r\n // width = this.#refs.bodyContainer.offsetWidth - oldwidth + width;\r\n // this.#refs.bodyContainer.style.width = `${width}px`;\r\n // }\r\n }\r\n\r\n #changingColumnOrder(index, offset, x, offsetLeft) {\r\n const children = this.#refs.header.children;\r\n let element = children[index];\r\n this.#refs.dragger.style.left = `${element.offsetLeft - offsetLeft + offset}px`;\r\n this.#refs.dragger.style.width = element.style.width;\r\n this.#refs.dragger.style.display = 'block';\r\n offset = x - getOffsetLeftFromWindow(element);\r\n let idx;\r\n if (offset < 0) {\r\n offset = -offset;\r\n for (let i = index - 1; i >= 0 && offset >= 0; i -= 1) {\r\n element = children[i];\r\n if (element == null || element.className !== 'column') {\r\n break;\r\n }\r\n if (offset < element.offsetWidth) {\r\n idx = (offset > element.offsetWidth / 2) ? i : i + 1;\r\n break;\r\n }\r\n offset -= element.offsetWidth;\r\n }\r\n idx ??= 0;\r\n } else {\r\n const count = children.length;\r\n for (let i = index; i < count - 1 && offset >= 0; i += 1) {\r\n element = children[i];\r\n if (element == null || element.className !== 'column') {\r\n idx = i;\r\n break;\r\n }\r\n if (offset < element.offsetWidth) {\r\n idx = (offset > element.offsetWidth / 2) ? i + 1 : i;\r\n break;\r\n }\r\n offset -= element.offsetWidth;\r\n }\r\n idx ??= count - 1;\r\n }\r\n if (idx !== this.#colAttrs.__orderIndex) {\r\n this.#colAttrs.__orderIndex = idx;\r\n element = children[idx];\r\n if (element == null) {\r\n return;\r\n }\r\n this.#refs.draggerCursor.style.left = `${element.offsetLeft - offsetLeft}px`;\r\n this.#refs.draggerCursor.style.display = 'block';\r\n }\r\n }\r\n\r\n #changeColumnOrder(index) {\r\n this.#refs.dragger.style.display = '';\r\n this.#refs.draggerCursor.style.display = '';\r\n const orderIndex = this.#colAttrs.__orderIndex;\r\n if (orderIndex >= 0 && orderIndex !== index) {\r\n let targetIndex = orderIndex - index;\r\n if (targetIndex >= 0 && targetIndex <= 1) {\r\n return;\r\n }\r\n const header = this.#refs.header;\r\n const children = header.children;\r\n const rows = this.#refs.bodyContent.children;\r\n const columns = this.columns;\r\n if (targetIndex > 1) {\r\n targetIndex = orderIndex - 1;\r\n // const current = columns[index];\r\n // for (let i = index; i < targetIndex; i += 1) {\r\n // columns[i] = columns[i + 1];\r\n // }\r\n // columns[targetIndex] = current;\r\n const current = columns.splice(index, 1)[0];\r\n columns.splice(targetIndex, 0, current);\r\n header.insertBefore(children[index], children[targetIndex].nextElementSibling);\r\n for (let row of rows) {\r\n row.insertBefore(row.children[index], row.children[targetIndex].nextElementSibling);\r\n }\r\n } else {\r\n targetIndex = orderIndex;\r\n // const current = columns[index];\r\n // for (let i = index; i > targetIndex; i -= 1) {\r\n // columns[i] = columns[i - 1];\r\n // }\r\n // columns[targetIndex] = current;\r\n const current = columns.splice(index, 1)[0];\r\n columns.splice(targetIndex, 0, current);\r\n header.insertBefore(children[index], children[targetIndex]);\r\n for (let row of rows) {\r\n row.insertBefore(row.children[index], row.children[targetIndex]);\r\n }\r\n }\r\n // refresh sortIndex\r\n [...children].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n if (arrow.className !== 'arrow') {\r\n this.sortIndex = i;\r\n }\r\n });\r\n\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Reorder, index, targetIndex);\r\n }\r\n }\r\n }\r\n\r\n #scrollToTop(top, reload) {\r\n const rowHeight = (this.rowHeight + 1);\r\n top -= (top % (rowHeight * 2)) + (RedumCount * rowHeight);\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this.#containerHeight - (reload ? 0 : this.#rowCount * rowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this.#scrollTop !== top) {\r\n this.#scrollTop = top;\r\n if (this.virtual) {\r\n this.#startIndex = top / rowHeight;\r\n }\r\n this.refresh();\r\n if (this.virtual) {\r\n this.#refs.bodyContent.style.top = `${top}px`;\r\n }\r\n } else if (reload) {\r\n this.refresh();\r\n }\r\n\r\n return top;\r\n }\r\n\r\n #get(key, name) {\r\n const attr = this.#colAttrs[key];\r\n if (attr == null) {\r\n return null;\r\n }\r\n return attr[name];\r\n }\r\n\r\n #set(key, name, value) {\r\n const attr = this.#colAttrs[key];\r\n if (attr == null) {\r\n this.#colAttrs[key] = { [name]: value };\r\n } else {\r\n attr[name] = value;\r\n }\r\n }\r\n\r\n #getItemValue(item, key, filter) {\r\n let value;\r\n if (typeof filter === 'function') {\r\n value = filter(item);\r\n } else {\r\n value = item[key];\r\n }\r\n return value?.value ?? value;\r\n }\r\n\r\n #getRowTarget(target) {\r\n let parent;\r\n while ((parent = target.parentElement) != null && !parent.classList.contains('ui-grid-row')) {\r\n target = parent;\r\n }\r\n return [parent, target];\r\n }\r\n\r\n #notHeader(tagName) {\r\n return /^(input|label|layer|svg|use)$/i.test(tagName);\r\n }\r\n\r\n #onHeaderClicked(e, col, force) {\r\n if (!force && (this.#get(col.key, 'resizing') || this.#get(col.key, 'dragging'))) {\r\n return;\r\n }\r\n if (!this.#notHeader(e.target.tagName)) {\r\n const index = this.columns.indexOf(col);\r\n if (index < 0) {\r\n return;\r\n }\r\n if (this.sortIndex === index) {\r\n this.sortDirection = this.sortDirection === 1 ? -1 : 1;\r\n } else {\r\n this.sortIndex = index;\r\n }\r\n this.sortColumn(true);\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Sort, index, this.sortDirection);\r\n }\r\n }\r\n }\r\n\r\n #onCloseFilter() {\r\n const panels = this.#el.querySelectorAll('.filter-panel.active');\r\n if (panels.length > 0) {\r\n panels.forEach(el => el.classList.remove('active'));\r\n setTimeout(() => this.#el.querySelectorAll('.filter-panel').forEach(el => el.remove()), 120);\r\n const filtering = this.#colAttrs.__filtering;\r\n if (filtering instanceof HTMLElement) {\r\n filtering.classList.remove('hover');\r\n }\r\n delete this.#colAttrs.__filtering;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n #onFilter(e, col) {\r\n if (this.#onCloseFilter()) {\r\n return;\r\n }\r\n const close = e => {\r\n if ((e.target.tagName === 'LAYER' && e.target.classList.contains('filter')) ||\r\n e.target.tagName === 'use') {\r\n return;\r\n }\r\n if (this.#onCloseFilter()) {\r\n document.removeEventListener('mousedown', close);\r\n }\r\n }\r\n document.addEventListener('mousedown', close);\r\n const panel = createElement('div', 'filter-panel');\r\n panel.addEventListener('mousedown', e => e.stopPropagation());\r\n const filter = e.currentTarget;\r\n const th = filter.parentElement;\r\n const width = th.offsetWidth;\r\n panel.style.top = `${th.offsetHeight}px`;\r\n panel.style.left = (th.offsetLeft + (width > FilterPanelWidth ? width - FilterPanelWidth : 0)) + 'px';\r\n\r\n // search\r\n let searchbox;\r\n if (col.allowSearch !== false) {\r\n const searchholder = createElement('div', 'filter-search-holder');\r\n searchbox = createElement('input', 'filter-search-box ui-text');\r\n searchbox.type = 'text';\r\n const searchicon = createIcon('fa-regular', 'search');\r\n searchicon.addEventListener('mousedown', e => {\r\n searchbox.focus();\r\n e.preventDefault();\r\n });\r\n searchholder.append(searchbox, searchicon);\r\n panel.append(searchholder);\r\n }\r\n // list\r\n const itemlist = createElement('div', 'filter-item-list');\r\n itemlist.addEventListener('scroll', e => throttle(this.#onFilterScroll, RefreshInterval, this, col, itemlist, e.target.scrollTop), { passive: true });\r\n // - all\r\n const itemall = createElement('div', 'filter-item filter-all');\r\n itemall.appendChild(createCheckbox({\r\n label: this.langs.all,\r\n onchange: e => {\r\n const checked = e.target.checked;\r\n itemlist.querySelectorAll('.filter-content input').forEach(box => box.checked = checked);\r\n }\r\n }));\r\n itemlist.appendChild(itemall);\r\n // - items\r\n let array;\r\n if (Array.isArray(col.filterSource)) {\r\n array = col.filterSource;\r\n } else if (typeof col.filterSource === 'function') {\r\n array = col.filterSource.call(this, col);\r\n } else {\r\n const dict = Object.create(null);\r\n for (let item of this.#source) {\r\n const val = this.#getItemValue(item.values, col.key, col.filter);\r\n if (!Object.hasOwnProperty.call(dict, val)) {\r\n const v = item.values[col.key];\r\n dict[val] = {\r\n value: val,\r\n displayValue: typeof col.filter === 'function' ? col.filter(item.values) : v?.displayValue ?? v\r\n };\r\n }\r\n }\r\n array = Object.values(dict)\r\n .sort((a, b) => {\r\n a = a?.value ?? a;\r\n b = b?.value ?? b;\r\n return a > b ? 1 : a < b ? -1 : 0;\r\n });\r\n }\r\n array = array.map(i => {\r\n if (Object.prototype.hasOwnProperty.call(i, 'value') &&\r\n Object.prototype.hasOwnProperty.call(i, 'displayValue')) {\r\n return i;\r\n }\r\n return {\r\n value: i,\r\n displayValue: i == null ? '' : i\r\n };\r\n });\r\n this.#fillFilterList(col, itemlist, array, itemall);\r\n itemall.querySelector('input').checked = ![...itemlist.querySelectorAll('.filter-content input')].some(i => !i.checked);\r\n panel.appendChild(itemlist);\r\n if (searchbox != null) {\r\n searchbox.addEventListener('input', e => {\r\n const key = e.currentTarget.value.toLowerCase();\r\n const items = key.length === 0 ? array : array.filter(i => {\r\n const displayValue = i?.displayValue ?? i;\r\n return String(displayValue ?? '').indexOf(key) >= 0;\r\n });\r\n this.#fillFilterList(col, itemlist, items, itemall);\r\n });\r\n }\r\n // function\r\n const functions = createElement('div', 'filter-function');\r\n functions.append(\r\n createElement('button', ok => {\r\n ok.innerText = this.langs.ok;\r\n ok.addEventListener('click', () => {\r\n const array = this.#get(col.key, 'filterSource').filter(i => i.__checked !== false);\r\n if (typeof col.onFilterOk === 'function') {\r\n col.onFilterOk.call(this, col, array);\r\n } else {\r\n col.filterValues = array.map(a => a.value);\r\n }\r\n this.#colAttrs.__filtered = true;\r\n this.#refreshSource();\r\n if (typeof col.onFiltered === 'function') {\r\n col.onFiltered.call(this, col);\r\n }\r\n filter.classList.add('active');\r\n this.#onCloseFilter();\r\n });\r\n }),\r\n createElement('button', reset => {\r\n reset.innerText = this.langs.reset;\r\n reset.addEventListener('click', () => {\r\n delete col.filterValues;\r\n this.#colAttrs.__filtered = this.columns.some(c => col.filterValues != null)\r\n this.#refreshSource();\r\n if (typeof col.onFiltered === 'function') {\r\n col.onFiltered.call(this, col);\r\n }\r\n filter.classList.remove('active');\r\n this.#onCloseFilter();\r\n });\r\n })\r\n );\r\n panel.appendChild(functions);\r\n\r\n this.#el.appendChild(panel);\r\n setTimeout(() => panel.classList.add('active'), 0);\r\n this.#colAttrs.__filtering = filter;\r\n filter.classList.add('hover');\r\n }\r\n\r\n #fillFilterList(col, list, array, all) {\r\n list.querySelector('.filter-holder')?.remove();\r\n list.querySelector('.filter-content')?.remove();\r\n const rowHeight = this.filterRowHeight;\r\n const height = array.length * rowHeight;\r\n this.#set(col.key, 'filterHeight', height);\r\n const holder = createElement('div', 'filter-holder');\r\n holder.style.height = `${height}px`;\r\n const content = createElement('div', 'filter-content');\r\n content.style.top = `${rowHeight}px`;\r\n this.#set(col.key, 'filterSource', array);\r\n for (let item of array) {\r\n item.__checked = !Array.isArray(col.filterValues) || col.filterValues.indexOf(item.value ?? item) >= 0;\r\n }\r\n if (array.length > 12) {\r\n array = array.slice(0, 12);\r\n }\r\n this.#doFillFilterList(content, array, all);\r\n list.append(holder, content);\r\n }\r\n\r\n #doFillFilterList(content, array, all) {\r\n for (let item of array) {\r\n const div = createElement('div', 'filter-item');\r\n div.appendChild(createCheckbox({\r\n checked: item.__checked,\r\n label: item?.displayValue ?? item,\r\n onchange: e => {\r\n item.__checked = e.target.checked;\r\n all.querySelector('input').checked = ![...content.querySelectorAll('input')].some(i => !i.checked);\r\n }\r\n }));\r\n content.appendChild(div);\r\n }\r\n }\r\n\r\n #onFilterScroll(col, list, top) {\r\n const rowHeight = this.filterRowHeight;\r\n top -= (top % (rowHeight * 2)) + rowHeight;\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this.#get(col.key, 'filterHeight') - (12 * rowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this.#get(col.key, 'filterTop') !== top) {\r\n this.#set(col.key, 'filterTop', top);\r\n const startIndex = top / rowHeight;\r\n let array = this.#get(col.key, 'filterSource');\r\n if (startIndex + 12 < array.length) {\r\n array = array.slice(startIndex, startIndex + 12);\r\n } else {\r\n array = array.slice(-12);\r\n }\r\n const content = list.querySelector('.filter-content');\r\n content.replaceChildren();\r\n this.#doFillFilterList(content, array, list.querySelector('.filter-all>input'));\r\n content.style.top = `${top + rowHeight}px`;\r\n }\r\n }\r\n\r\n #onDragStart(e, col) {\r\n if (this.#notHeader(e.target.tagName)) {\r\n return;\r\n }\r\n const cx = getClientX(e);\r\n const index = indexOfParent(e.currentTarget);\r\n const clearEvents = attr => {\r\n for (let event of ['mousemove', 'mouseup']) {\r\n if (attr.hasOwnProperty(event)) {\r\n window.removeEventListener(event, attr[event]);\r\n delete attr[event];\r\n }\r\n }\r\n };\r\n let attr = this.#colAttrs[col.key];\r\n if (attr == null) {\r\n attr = this.#colAttrs[col.key] = {};\r\n } else {\r\n clearEvents(attr);\r\n }\r\n attr.dragging = true;\r\n const offsetLeft = this.#refs.header.querySelector('th:last-child').offsetLeft;\r\n const dragmove = e => {\r\n const cx2 = getClientX(e);\r\n const offset = cx2 - cx;\r\n let pos = attr.offset;\r\n let dragging;\r\n if (pos == null && (offset > MiniDragOffset || offset < -MiniDragOffset)) {\r\n dragging = true;\r\n } else if (pos !== offset) {\r\n dragging = true;\r\n }\r\n if (dragging) {\r\n this.#changingColumnOrder(index, offset, cx2, offsetLeft);\r\n attr.offset = offset;\r\n }\r\n };\r\n attr.mousemove = e => throttle(dragmove, RefreshInterval, this, e);\r\n attr.mouseup = () => {\r\n clearEvents(attr);\r\n if (attr.offset == null) {\r\n delete attr.dragging;\r\n } else {\r\n setTimeout(() => {\r\n delete attr.dragging;\r\n delete attr.offset;\r\n });\r\n this.#changeColumnOrder(index);\r\n }\r\n };\r\n ['mousemove', 'mouseup'].forEach(event => window.addEventListener(event, attr[event]));\r\n }\r\n\r\n #onResizeStart(e, col) {\r\n const cx = getClientX(e);\r\n const width = col.width;\r\n const index = indexOfParent(e.currentTarget.parentElement);\r\n const window = this.window ?? global;\r\n const clearEvents = attr => {\r\n for (let event of ['mousemove', 'mouseup']) {\r\n if (attr.hasOwnProperty(event)) {\r\n window.removeEventListener(event, attr[event]);\r\n delete attr[event];\r\n }\r\n }\r\n };\r\n let attr = this.#colAttrs[col.key];\r\n if (attr == null) {\r\n attr = this.#colAttrs[col.key] = {};\r\n } else {\r\n clearEvents(attr);\r\n }\r\n attr.resizing = width;\r\n const resizemove = e => {\r\n const cx2 = getClientX(e);\r\n const val = width + (cx2 - cx);\r\n if (val < MiniColumnWidth) {\r\n return;\r\n }\r\n attr.resizing = val;\r\n attr.sizing = true;\r\n this.#changeColumnWidth(index, val);\r\n };\r\n attr.mousemove = e => throttle(resizemove, RefreshInterval, this, e);\r\n attr.mouseup = e => {\r\n clearEvents(attr);\r\n const width = attr.resizing;\r\n if (width != null) {\r\n setTimeout(() => delete attr.resizing);\r\n if (attr.sizing) {\r\n delete attr.sizing;\r\n delete attr.autoResize;\r\n this.#changeColumnWidth(index, width);\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Resize, index, width);\r\n }\r\n }\r\n }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n ['mousemove', 'mouseup'].forEach(event => window.addEventListener(event, attr[event]));\r\n }\r\n\r\n #onAutoResize(e, col) {\r\n const th = e.currentTarget.parentElement;\r\n const index = indexOfParent(th);\r\n let width = th.querySelector('div:first-child').scrollWidth;\r\n for (let row of this.#refs.bodyContent.children) {\r\n const element = row.children[index].children[0];\r\n const w = element.scrollWidth;\r\n if (w > width) {\r\n width = w;\r\n }\r\n }\r\n if (width < MiniColumnWidth) {\r\n width = MiniColumnWidth;\r\n }\r\n if (width > 0 && width !== col.width) {\r\n width += 12;\r\n this.#changeColumnWidth(index, width);\r\n if (typeof this.columnChanged === 'function') {\r\n this.columnChanged(ColumnChangedType.Resize, index, width);\r\n }\r\n }\r\n }\r\n\r\n #onColumnAllChecked(col, flag) {\r\n if (this.#currentSource == null) {\r\n return;\r\n }\r\n const key = col.key;\r\n const isFunction = typeof col.enabled === 'function';\r\n const isString = typeof col.enabled === 'string';\r\n if (typeof col.onallchecked === 'function') {\r\n col.onallchecked.call(this, col, flag);\r\n } else {\r\n for (let row of this.#currentSource) {\r\n const item = row.values;\r\n if (item == null) {\r\n continue;\r\n }\r\n const enabled = isFunction ? col.enabled(item) : isString ? item[col.enabled] : col.enabled;\r\n if (enabled !== false) {\r\n item[key] = flag;\r\n row.__changed = true;\r\n if (typeof col.onchanged === 'function') {\r\n col.onchanged.call(this, item, flag);\r\n }\r\n }\r\n }\r\n this.refresh();\r\n }\r\n }\r\n\r\n #onScroll(e) {\r\n const left = e.target.scrollLeft;\r\n if (this.#scrollLeft !== left) {\r\n this.#scrollLeft = left;\r\n this.#refs.header.style.left = `${-left}px`;\r\n }\r\n if (!this.virtual) {\r\n return;\r\n }\r\n const top = e.target.scrollTop;\r\n this.#scrollToTop(top);\r\n }\r\n\r\n #onBodyMouseMove(e, holder) {\r\n if (e.target.classList.contains('ui-grid-hover-holder')) {\r\n return;\r\n }\r\n let [parent, target] = this.#getRowTarget(e.target);\r\n if (parent == null) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n }\r\n return;\r\n }\r\n const element = target.children[0];\r\n if (element?.tagName !== 'SPAN') {\r\n if (holder.classList.contains('active')) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n holder.classList.remove('active');\r\n }\r\n return;\r\n }\r\n const row = target.dataset.row;\r\n const col = target.dataset.col;\r\n if (holder.dataset.row === row &&\r\n holder.dataset.col === col) {\r\n return;\r\n }\r\n if (element.scrollWidth > element.offsetWidth) {\r\n holder.dataset.row = row;\r\n holder.dataset.col = col;\r\n holder.innerText = element.innerText;\r\n const top = this.#refs.bodyContent.offsetTop + target.offsetTop;\r\n let left = target.offsetLeft;\r\n let width = holder.offsetWidth;\r\n if (width > this.#bodyClientWidth) {\r\n width = this.#bodyClientWidth;\r\n }\r\n const maxleft = this.#bodyClientWidth + this.#scrollLeft - width;\r\n if (left > maxleft) {\r\n left = maxleft;\r\n }\r\n const height = target.offsetHeight;\r\n holder.style.cssText = `top: ${top}px; left: ${left}px; max-width: ${this.#bodyClientWidth}px; height: ${height - 2}px`;\r\n holder.classList.add('active');\r\n } else if (holder.classList.contains('active')) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n holder.classList.remove('active');\r\n }\r\n }\r\n\r\n #onRowClicked(e, index, colIndex) {\r\n const startIndex = this.#startIndex;\r\n const selectedIndex = startIndex + index;\r\n if (typeof this.willSelect === 'function' && !this.willSelect(selectedIndex, colIndex)) {\r\n return;\r\n }\r\n // multi-select\r\n let flag = false;\r\n const selectedIndexes = this.#selectedIndexes;\r\n if (this.multiSelect) {\r\n if (e.ctrlKey) {\r\n const i = selectedIndexes.indexOf(selectedIndex);\r\n if (i < 0) {\r\n selectedIndexes.push(selectedIndex);\r\n } else {\r\n selectedIndexes.splice(i, 1);\r\n }\r\n flag = true;\r\n } else if (e.shiftKey && selectedIndexes.length > 0) {\r\n if (selectedIndexes.length > 1 || selectedIndexes[0] !== selectedIndex) {\r\n let start = selectedIndexes[selectedIndexes.length - 1];\r\n let end;\r\n if (start > selectedIndex) {\r\n end = start;\r\n start = selectedIndex;\r\n } else {\r\n end = selectedIndex;\r\n }\r\n selectedIndexes.splice(0);\r\n for (let i = start; i <= end; i += 1) {\r\n selectedIndexes.push(i);\r\n }\r\n flag = true;\r\n }\r\n }\r\n }\r\n if (!flag && selectedIndexes.length !== 1 || selectedIndexes[0] !== selectedIndex) {\r\n selectedIndexes.splice(0, selectedIndexes.length, selectedIndex);\r\n flag = true;\r\n }\r\n // apply style\r\n if (flag) {\r\n if (this.readonly !== true) {\r\n this.refresh();\r\n } else {\r\n [...this.#refs.bodyContent.children].forEach((row, i) => {\r\n if (selectedIndexes.indexOf(startIndex + i) >= 0) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n });\r\n }\r\n if (typeof this.selectedRowChanged === 'function') {\r\n this.selectedRowChanged(selectedIndex);\r\n }\r\n }\r\n this.#selectedColumnIndex = colIndex;\r\n if ((this.fullrowClick || colIndex >= 0) && e.buttons === 1 && typeof this.cellClicked === 'function') {\r\n if (this.cellClicked(selectedIndex, colIndex) === false) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n\r\n #onRowDblClicked(e) {\r\n if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'LAYER' && e.target.className === 'ui-check-inner' || e.target.tagName === 'LABEL' && (e.target.className === 'ui-drop-text' || e.target.className === 'ui-drop-caret')) {\r\n return;\r\n }\r\n const index = this.selectedIndex;\r\n if (typeof this.rowDblClicked === 'function') {\r\n this.rowDblClicked(index);\r\n }\r\n if (typeof this.cellDblClicked === 'function') {\r\n const colIndex = this.#selectedColumnIndex;\r\n if (this.fullrowClick || colIndex >= 0) {\r\n this.cellDblClicked(index, colIndex);\r\n }\r\n }\r\n }\r\n\r\n #onRowChanged(_e, index, col, value, cell, blur) {\r\n if (this.#currentSource == null) {\r\n return;\r\n }\r\n const row = this.#currentSource[this.#startIndex + index];\r\n const item = row.values;\r\n if (item == null) {\r\n return;\r\n }\r\n let enabled = col.enabled;\r\n if (typeof enabled === 'function') {\r\n enabled = enabled.call(col, item);\r\n } else if (typeof enabled === 'string') {\r\n enabled = item[enabled];\r\n }\r\n if (enabled !== false) {\r\n item[col.key] = value;\r\n let tip = col.tooltip;\r\n if (typeof tip === 'function') {\r\n tip = tip.call(col, item);\r\n }\r\n if (nullOrEmpty(tip)) {\r\n cell.querySelector('.ui-tooltip-wrapper')?.remove();\r\n } else {\r\n setTooltip(cell.children[0], tip, false, this.element);\r\n }\r\n row.__changed = true;\r\n if (blur) {\r\n if (typeof col.oneditend === 'function') {\r\n col.oneditend.call(this, item, value);\r\n }\r\n } else {\r\n if (typeof col.onchanged === 'function') {\r\n col.onchanged.call(this, item, value);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default Grid;","import \"./css/popup.scss\";\r\nimport { r } from \"../utility/lgres\";\r\nimport { nullOrEmpty } from \"../utility/strings\";\r\nimport { global } from \"../utility\";\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon, changeIcon } from \"./icon\";\r\n\r\nconst ResizeMods = {\r\n right: 1,\r\n bottom: 2,\r\n left: 4,\r\n top: 8,\r\n bottomRight: 2 | 1,\r\n bottomLeft: 2 | 4,\r\n topRight: 8 | 1,\r\n topLeft: 8 | 4\r\n}\r\n\r\n// const Cursors = {\r\n// [ResizeMods.right]: 'ew-resize',\r\n// [ResizeMods.bottom]: 'ns-resize',\r\n// [ResizeMods.bottomRight]: 'nwse-resize',\r\n// [ResizeMods.left]: 'ew-resize',\r\n// [ResizeMods.bottomLeft]: 'nesw-resize',\r\n// [ResizeMods.top]: 'ns-resize',\r\n// [ResizeMods.topRight]: 'nesw-resize',\r\n// [ResizeMods.topLeft]: 'nwse-resize'\r\n// }\r\n\r\nfunction trimPx(px) {\r\n if (typeof px !== 'string') {\r\n return px;\r\n }\r\n if (px.endsWith('px')) {\r\n const size = Number(px.substring(0, px.length - 2));\r\n return isNaN(size) ? px : size;\r\n }\r\n return px;\r\n}\r\n\r\nclass Popup {\r\n #mask;\r\n #option;\r\n #bounds;\r\n // #cursor;\r\n\r\n constructor(opts = {}) {\r\n this.#option = opts;\r\n }\r\n\r\n get container() { return this.#mask.querySelector('.ui-popup-container') }\r\n\r\n get rect() {\r\n const container = this.container;\r\n if (container == null) {\r\n return null;\r\n }\r\n const style = global.getComputedStyle(container);\r\n const collapsed = container.classList.contains('ui-popup-collapse');\r\n const bounds = this.#bounds;\r\n return {\r\n collapsed,\r\n left: trimPx(style.left),\r\n top: trimPx(style.top),\r\n width: collapsed === true && bounds != null ? bounds.width : trimPx(style.width),\r\n height: collapsed === true && bounds != null ? bounds.height : trimPx(style.height)\r\n };\r\n }\r\n set rect(r) {\r\n const container = this.container;\r\n if (container == null) {\r\n return;\r\n }\r\n const css = [];\r\n if (!isNaN(r.left)) {\r\n css.push(`left: ${r.left}px`);\r\n }\r\n if (!isNaN(r.top)) {\r\n css.push(`top: ${r.top}px`);\r\n }\r\n const collapse = container.querySelector('.ui-popup-header>.icon-expand');\r\n if (r.collapsed === true) {\r\n css.push('width: 160px', 'height: 40px');\r\n this.#bounds = r;\r\n container.classList.add('ui-popup-collapse');\r\n if (collapse != null) {\r\n changeIcon(collapse, 'fa-regular', 'expand-alt');\r\n }\r\n } else {\r\n if (!isNaN(r.width) && r.width > 0) {\r\n css.push(`width: ${r.width}px`);\r\n }\r\n if (!isNaN(r.height) && r.height > 0) {\r\n css.push(`height: ${r.height}px`);\r\n }\r\n container.classList.remove('ui-popup-collapse');\r\n this.#bounds = null;\r\n if (collapse != null) {\r\n changeIcon(collapse, 'fa-regular', 'compress-alt');\r\n }\r\n }\r\n if (css.length > 0) {\r\n container.style.cssText += css.join('; ');\r\n }\r\n }\r\n\r\n close(animation = true) {\r\n const mask = this.#mask;\r\n if (animation) {\r\n mask.classList.add('ui-popup-active');\r\n mask.style.opacity = 0;\r\n setTimeout(() => { mask.remove(); }, 120);\r\n } else {\r\n mask.remove();\r\n }\r\n if (typeof this.#option.onMasking === 'function') {\r\n this.#option.onMasking.call(this, false);\r\n }\r\n }\r\n\r\n create() {\r\n const mask = createElement('div', 'ui-popup-mask');\r\n const option = this.#option;\r\n if (option.mask === false) {\r\n mask.classList.add('ui-popup-transparent');\r\n } else if (typeof option.onMasking === 'function') {\r\n this.#option.onMasking.call(this, true);\r\n }\r\n if (!isNaN(option.zIndex)) {\r\n mask.style.zIndex = String(option.zIndex);\r\n }\r\n const container = createElement('div', 'ui-popup-container');\r\n if (option.changeZIndex === true) {\r\n container.addEventListener('mousedown', () => {\r\n const masks = [...this.#mask.parentElement.children].filter(e => e.classList.contains('ui-popup-mask'));\r\n let max = 200;\r\n masks.forEach(m => {\r\n let index;\r\n if (m.dataset.zindex != null) {\r\n index = parseInt(m.dataset.zindex);\r\n m.style.zIndex = isNaN(index) ? '' : String(index);\r\n delete m.dataset.zindex;\r\n } else {\r\n index = parseInt(m.style.zIndex);\r\n }\r\n if (index > max) {\r\n max = index;\r\n }\r\n });\r\n mask.dataset.zindex = mask.style.zIndex;\r\n mask.style.zIndex = max + 1;\r\n });\r\n }\r\n let tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0));\r\n if (tabIndex < 0) {\r\n tabIndex = 0;\r\n }\r\n container.tabIndex = tabIndex + 1;\r\n let content = option.content;\r\n if (!(content instanceof HTMLElement)) {\r\n content = createElement('div', d => d.innerText = content);\r\n }\r\n container.append(\r\n createElement('div', header => {\r\n header.className = 'ui-popup-header';\r\n let title = option.title;\r\n if (!(title instanceof HTMLElement)) {\r\n title = createElement('div', t => {\r\n t.className = 'ui-popup-header-title';\r\n t.innerText = title;\r\n });\r\n }\r\n header.appendChild(title);\r\n if (option.movable !== false) {\r\n const move = title.querySelector('.ui-popup-move') ?? title;\r\n move.addEventListener('mousedown', e => {\r\n if (e.buttons !== 1) {\r\n return;\r\n }\r\n const x = e.clientX - container.offsetLeft;\r\n const y = e.clientY - container.offsetTop;\r\n let moved;\r\n const move = e => {\r\n if (e.buttons === 1) {\r\n container.style.left = `${e.clientX - x}px`;\r\n container.style.top = `${e.clientY - y}px`;\r\n moved = true;\r\n } else {\r\n mask.dispatchEvent(new MouseEvent('mouseup'));\r\n }\r\n };\r\n mask.addEventListener('mousemove', move, { passive: false });\r\n const up = () => {\r\n mask.removeEventListener('mousemove', move, { passive: false });\r\n mask.removeEventListener('mouseup', up);\r\n if (moved === true && typeof option.onMoveEnded === 'function') {\r\n option.onMoveEnded.call(this);\r\n }\r\n moved = false;\r\n };\r\n mask.addEventListener('mouseup', up);\r\n });\r\n }\r\n if (option.collapsable === true) {\r\n const collapse = createIcon('fa-regular', 'compress-alt');\r\n collapse.tabIndex = tabIndex + 2;\r\n collapse.classList.add('icon-expand');\r\n collapse.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n collapse.dispatchEvent(new MouseEvent('click'));\r\n }\r\n });\r\n collapse.addEventListener('click', () => {\r\n if (container.classList.contains('ui-popup-collapse')) {\r\n const bounds = this.#bounds;\r\n if (bounds != null) {\r\n container.style.cssText += `width: ${bounds.width}px; height: ${bounds.height}px`;\r\n this.#bounds = null;\r\n }\r\n container.classList.remove('ui-popup-collapse');\r\n changeIcon(collapse, 'fa-regular', 'compress-alt');\r\n } else {\r\n const rect = this.rect;\r\n this.#bounds = rect;\r\n container.style.cssText += `width: 160px; height: 40px`;\r\n container.classList.add('ui-popup-collapse');\r\n changeIcon(collapse, 'fa-regular', 'expand-alt');\r\n }\r\n if (typeof option.onResizeEnded === 'function') {\r\n option.onResizeEnded.call(this);\r\n }\r\n });\r\n header.appendChild(collapse);\r\n }\r\n const cancel = createIcon('fa-regular', 'times');\r\n cancel.tabIndex = tabIndex + 3;\r\n cancel.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n this.close();\r\n }\r\n });\r\n cancel.addEventListener('click', () => this.close());\r\n header.appendChild(cancel);\r\n }),\r\n createElement('div', 'ui-popup-body', content, createElement('div', 'ui-popup-loading',\r\n createElement('div', null, createIcon('fa-regular', 'spinner-third'))\r\n ))\r\n );\r\n if (Array.isArray(option.buttons) && option.buttons.length > 0) {\r\n tabIndex = Math.max.apply(null, [...container.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0));\r\n container.appendChild(\r\n createElement('div', 'ui-popup-footer', ...option.buttons.map((b, i) => {\r\n const button = createElement('button', 'ui-popup-button');\r\n if (b.tabIndex > 0) {\r\n button.tabIndex = b.tabIndex;\r\n } else {\r\n button.tabIndex = tabIndex + i + 1;\r\n }\r\n button.innerText = b.text;\r\n button.addEventListener('click', () => {\r\n if (typeof b.trigger === 'function') {\r\n const result = b.trigger(this);\r\n if (typeof result?.then === 'function') {\r\n result.then(r => {\r\n if (r !== false) {\r\n this.close();\r\n }\r\n }).catch(reason => console.warn(reason));\r\n } else if (result !== false) {\r\n this.close();\r\n }\r\n } else {\r\n this.close();\r\n }\r\n });\r\n return button;\r\n }))\r\n );\r\n const tabs = [...container.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0);\r\n const tabMin = Math.min.apply(null, tabs);\r\n const tabMax = Math.max.apply(null, tabs);\r\n const last = container.querySelector(`[tabindex=\"${tabMax}\"]`);\r\n if (last != null) {\r\n last.addEventListener('keydown', e => {\r\n if (e.key === 'Tab') {\r\n const first = container.querySelector(`[tabindex=\"${tabMin}\"]`);\r\n first?.focus();\r\n e.preventDefault();\r\n }\r\n });\r\n }\r\n } else {\r\n container.querySelector('.ui-popup-body>.ui-popup-loading').classList.add('ui-popup-loading-content');\r\n }\r\n // resizable\r\n if (option.resizable === true) {\r\n container.append(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-right';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.right, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.bottom, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-left';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.left, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.top, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom-right';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.bottomRight, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom-left';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.bottomLeft, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top-left';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.topLeft, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top-right';\r\n layer.addEventListener('mousedown', e => this.#resize(ResizeMods.topRight, e));\r\n })\r\n )\r\n }\r\n mask.appendChild(container);\r\n this.#mask = mask;\r\n return mask;\r\n }\r\n\r\n show(parent = document.body) {\r\n if (parent == null) {\r\n return;\r\n }\r\n let mask = this.#mask ?? this.create();\r\n const exists = [...parent.children].filter(e => e.classList.contains('ui-popup-mask'));\r\n let zindex = 0;\r\n for (let ex of exists) {\r\n let z = parseInt(ex.style.zIndex);\r\n if (!isNaN(z) && z > zindex) {\r\n zindex = z;\r\n }\r\n }\r\n if (zindex > 0) {\r\n mask.style.zIndex = String(zindex + 1);\r\n }\r\n parent.appendChild(mask);\r\n if (this.#option.mask === false) {\r\n // calculator position\r\n const container = this.container;\r\n container.style.left = String((parent.offsetWidth - container.offsetWidth) / 2) + 'px';\r\n container.style.top = String((parent.offsetHeight - container.offsetHeight) / 2) + 'px';\r\n }\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n mask.style.opacity = 1;\r\n this.container.focus();\r\n resolve(mask);\r\n }, 0);\r\n });\r\n }\r\n\r\n get loading() { return this.#mask?.querySelector('.ui-popup-body>.ui-popup-loading')?.style?.visibility === 'visible' }\r\n set loading(flag) {\r\n let loading = this.#mask?.querySelector('.ui-popup-body>.ui-popup-loading');\r\n if (loading == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n loading.style.visibility = 'hidden';\r\n loading.style.opacity = 0;\r\n } else {\r\n loading.style.visibility = 'visible';\r\n loading.style.opacity = 1;\r\n }\r\n }\r\n\r\n #resize(mod, e) {\r\n if (e.buttons !== 1) {\r\n return;\r\n }\r\n const container = this.container;\r\n const option = this.#option;\r\n if (typeof option.onResizeStarted === 'function') {\r\n option.onResizeStarted.call(this);\r\n }\r\n const mask = this.#mask;\r\n // this.#cursor = mask.style.cursor;\r\n // mask.style.cursor = Cursors[mod];\r\n const originalX = e.clientX;\r\n const originalY = e.clientY;\r\n const original = {\r\n width: container.offsetWidth,\r\n height: container.offsetHeight,\r\n left: container.offsetLeft,\r\n top: container.offsetTop\r\n };\r\n const minWidth = option.minWidth ?? 200;\r\n const minHeight = option.minHeight ?? 200;\r\n let resized;\r\n const parent = option.mask === false ? mask.parentElement : mask;\r\n const move = e => {\r\n if (e.buttons !== 1) {\r\n parent.dispatchEvent(new MouseEvent('mouseup'));\r\n return;\r\n }\r\n const offsetX = e.clientX - originalX;\r\n const offsetY = e.clientY - originalY;\r\n let width = original.width;\r\n let height = original.height;\r\n let x = original.left;\r\n let y = original.top;\r\n if ((mod & ResizeMods.right) === ResizeMods.right) {\r\n width += offsetX;\r\n if (width < minWidth) {\r\n width = minWidth;\r\n }\r\n }\r\n if ((mod & ResizeMods.bottom) === ResizeMods.bottom) {\r\n height += offsetY;\r\n if (height < minHeight) {\r\n height = minHeight;\r\n }\r\n }\r\n if ((mod & ResizeMods.left) === ResizeMods.left) {\r\n width -= offsetX;\r\n if (width < minWidth) {\r\n width = minWidth;\r\n x = originalX + original.width - minWidth;\r\n } else {\r\n x += offsetX;\r\n }\r\n }\r\n if ((mod & ResizeMods.top) === ResizeMods.top) {\r\n height -= offsetY;\r\n if (height < minHeight) {\r\n height = minHeight;\r\n y = originalY + original.height - minHeight;\r\n } else {\r\n y += offsetY;\r\n }\r\n }\r\n if (typeof option.onResizing === 'function') {\r\n option.onResizing.call(this, x, y, width, height);\r\n } else {\r\n container.style.cssText += `left: ${x}px; top: ${y}px; width: ${width}px; height: ${height}px`;\r\n }\r\n resized = true;\r\n }\r\n parent.addEventListener('mousemove', move, { passive: false });\r\n const up = () => {\r\n parent.removeEventListener('mousemove', move, { passive: false });\r\n parent.removeEventListener('mouseup', up);\r\n // mask.style.cursor = this.#cursor;\r\n if (resized === true && typeof option.onResizeEnded === 'function') {\r\n option.onResizeEnded.call(this);\r\n }\r\n resized = false;\r\n };\r\n parent.addEventListener('mouseup', up);\r\n }\r\n}\r\n\r\nexport default Popup;\r\n\r\nexport function createPopup(title, content, ...buttons) {\r\n const popup = new Popup({\r\n title,\r\n content,\r\n buttons\r\n });\r\n return popup;\r\n}\r\n\r\nconst iconTypes = {\r\n 'info': 'info-circle',\r\n 'information': 'info-circle',\r\n 'warn': 'exclamation-triangle',\r\n 'warning': 'exclamation-triangle',\r\n 'question': 'question-circle',\r\n 'error': 'times-circle'\r\n}\r\n\r\nexport function showAlert(title, message, iconType = 'info', parent = document.body) {\r\n return new Promise(resolve => {\r\n const popup = new Popup({\r\n title,\r\n content: createElement('div', 'message-wrapper',\r\n createIcon('fa-solid', iconTypes[iconType] ?? 'info-circle'),\r\n createElement('span', span => span.innerText = message)\r\n ),\r\n buttons: [\r\n { text: r('ok', 'OK'), trigger: resolve }\r\n ]\r\n });\r\n popup.show(parent).then(mask => {\r\n const button = mask.querySelector('.ui-popup-container .ui-popup-footer .ui-popup-button:last-child');\r\n button?.focus();\r\n });\r\n });\r\n}\r\n\r\nexport function showConfirm(title, content, buttons, iconType = 'question', parent = document.body) {\r\n return new Promise(resolve => {\r\n const wrapper = createElement('div', 'message-wrapper');\r\n if (!nullOrEmpty(iconType)) {\r\n wrapper.appendChild(createIcon('fa-solid', iconTypes[iconType] ?? 'question-circle'));\r\n }\r\n wrapper.appendChild(content instanceof HTMLElement ?\r\n content :\r\n createElement('span', span => span.innerText = content));\r\n const popup = new Popup({\r\n title,\r\n content: wrapper,\r\n buttons: buttons?.map(b => {\r\n return {\r\n text: b.text,\r\n trigger: p => {\r\n let result;\r\n if (typeof b.trigger === 'function') {\r\n result = b.trigger(p, b);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n r !== false && resolve(r);\r\n return r;\r\n });\r\n }\r\n result !== false && resolve(result);\r\n } else {\r\n result = {\r\n key: b.key,\r\n popup: p\r\n };\r\n resolve(result);\r\n }\r\n return result;\r\n }\r\n };\r\n }) ??\r\n [\r\n { text: r('yes', 'Yes'), trigger: p => resolve({ key: 'yes', popup: p }) },\r\n { text: r('no', 'No'), trigger: p => resolve({ key: 'no', popup: p }) }\r\n ]\r\n });\r\n popup.show(parent).then(mask => {\r\n const button = mask.querySelector('.ui-popup-container .ui-popup-footer .ui-popup-button:last-child');\r\n button?.focus();\r\n });\r\n });\r\n}"],"names":["createElement","tagName","init","children","element","svgns","createUse","type","id","c","path","ver","use","changeIcon","svg","createIcon","style","css","resolveIcon","container","svgs","icon","fillCheckbox","label","tabindex","charactor","layer","e","input","span","createRadiobox","opts","entry","createCheckbox","resolveCheckbox","legacy","checks","chk","text","boxes","box","setTooltip","content","flag","parent","isParent","tipid","tip","wrapper","cnt","tipId","tid","p","left","top","offsetParent","resolveTooltip","tips","title","nullOrEmpty","s","contains","key","ignoreCase","r","defaultValue","g","isPositive","n","isMobile","throttle","method","delay","context","args","current","truncate","v","SymbolDropdown","DropdownTitleHeight","DropdownItemHeight","dropdownGlobal","global","panel","dropId","dropdown","selectItems","itemlist","htmlkey","textkey","htmls","it","filterSource","searchkeys","source","k","_Dropdown","options","__privateAdd","_expanded","_dropdown","_filllist","_triggerselect","_options","_wrapper","_container","_label","_allChecked","_source","_lastSelected","_selected","_selectedList","__publicField","__privateSet","__privateGet","header","up","down","count","valuekey","index","target","_a","__privateMethod","dropdown_fn","active","expanded_get","filllist_fn","list","selected","silence","item","expanded","li","html","val","selectedlist","dom","selects","sel","drop","Dropdown","_b","search","value","multiselect","allchecked","triggerselect_fn","scrolled","i","checkbox","GridColumn","enabled","tooltip","GridInputColumn","trigger","col","_parent","vals","GridTextColumn","_item","_col","grid","lines","_GridDropdownColumn","_getSource","getSource_fn","_setValue","setValue_fn","_getDrop","getDrop_fn","GridDropdownColumn","dropGlobal","data","__superGet","GridCheckboxColumn","GridIconColumn","className","ColumnChangedType","RefreshInterval","HoverInternal","RedumCount","MiniDragOffset","MiniColumnWidth","FilterPanelWidth","getClientX","getOffsetLeftFromWindow","indexOfParent","ColumnTypes","_Grid","_refreshSource","_createHeader","_createBody","_adjustRows","_fillRows","_changeColumnWidth","_changingColumnOrder","_changeColumnOrder","_scrollToTop","_get","_set","_getItemValue","_getRowTarget","_notHeader","_onHeaderClicked","_onCloseFilter","_onFilter","_fillFilterList","_doFillFilterList","_onFilterScroll","_onDragStart","_onResizeStart","_onAutoResize","_onColumnAllChecked","_onScroll","_onBodyMouseMove","_onRowClicked","_onRowDblClicked","_onRowChanged","_currentSource","_el","_refs","_rendering","_selectedColumnIndex","_selectedIndexes","_startIndex","_needResize","_containerHeight","_bodyClientWidth","_rowCount","_scrollTop","_scrollLeft","_colTypes","_colAttrs","_vtable","refreshSource_fn","indexes","startIndex","row","sizer","createHeader_fn","body","createBody_fn","loading","scrollToTop_fn","force","height","length","adjustRows_fn","rows","widths","fillRows_fn","get_fn","width","changeColumnWidth_fn","reload","direction","th","arrow","comparer","a","b","getItemValue_fn","Grid","thead","hidden","onHeaderClicked_fn","isCheckbox","set_fn","w","onDragStart_fn","check","onColumnAllChecked_fn","caption","filter","onFilter_fn","spliter","onResizeStart_fn","onAutoResize_fn","dragger","draggerCursor","onScroll_fn","cols","bodyContainer","bodyContent","getRowTarget_fn","rowIndex","colIndex","onRowClicked_fn","onRowDblClicked_fn","holder","onBodyMouseMove_fn","exists","j","cell","onRowChanged_fn","selectedIndexes","selectChanged","bgColor","ev","attrs","attr","changingColumnOrder_fn","offset","x","offsetLeft","idx","changeColumnOrder_fn","orderIndex","targetIndex","columns","rowHeight","bottomTop","name","notHeader_fn","onCloseFilter_fn","panels","el","filtering","close","searchbox","searchholder","searchicon","onFilterScroll_fn","itemall","checked","array","dict","fillFilterList_fn","items","displayValue","functions","ok","reset","all","doFillFilterList_fn","div","cx","clearEvents","event","dragmove","cx2","pos","dragging","window","resizemove","isFunction","isString","maxleft","selectedIndex","start","end","_e","blur","ResizeMods","trimPx","px","size","Popup","_resize","_mask","_option","_bounds","collapsed","bounds","collapse","animation","mask","option","masks","max","m","tabIndex","d","t","y","moved","move","rect","cancel","button","result","reason","tabs","tabMin","tabMax","last","first","resize_fn","zindex","ex","z","resolve","_c","mod","originalX","originalY","original","minWidth","minHeight","resized","offsetX","offsetY","createPopup","buttons","iconTypes","showAlert","message","iconType","showConfirm"],"mappings":"opCAAO,SAASA,EAAcC,EAASC,KAASC,EAAU,CACtD,MAAMC,EAAU,SAAS,cAAcH,CAAO,EAC9C,OAAI,OAAOC,GAAS,WAChBA,EAAKE,CAAO,EACLF,GAAQ,OACfE,EAAQ,UAAYF,GAEpBC,EAAS,OAAS,GAClBC,EAAQ,OAAO,GAAGD,CAAQ,EAEvBC,CACX,CCXA,MAAMC,GAAQ,6BAEd,SAASC,GAAUC,EAAMC,EAAI,CACzB,MAAMC,EAAI,OAAO,OAAW,IAAc,OAAS,CAAA,EAC7CC,EAAOD,EAAE,MAAQ,GACjBE,EAAMF,EAAE,QAAU,KAAO,GAAK,IAAIA,EAAE,SACpCG,EAAM,SAAS,gBAAgBP,GAAO,KAAK,EACjD,OAAAO,EAAI,eAAe,+BAAgC,aAAc,GAAGF,UAAaH,QAAWI,KAAOH,GAAI,EAChGI,CACX,CAEA,SAASC,GAAWC,EAAKP,EAAMC,EAAI,CAC/B,OAAIM,aAAe,YACfA,EAAI,gBAAgBR,GAAUC,EAAMC,CAAE,CAAC,EAEpCM,CACX,CAEA,SAASC,EAAWR,EAAMC,EAAIQ,EAAO,CACjC,MAAMF,EAAM,SAAS,gBAAgBT,GAAO,KAAK,EAEjD,GADAS,EAAI,YAAYR,GAAUC,EAAMC,CAAE,CAAC,EAC/BQ,GAAS,KACT,QAASC,KAAO,OAAO,QAAQD,CAAK,EAChCF,EAAI,MAAM,YAAYG,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P,MAAOjN,CACvC,EAC4BoV,EAAQX,CAAM,EAElB,OAAOA,CACV,CACrB,MAEgB,CACI,CAAE,KAAM7T,EAAE,MAAO,KAAK,EAAG,QAASZ,GAAKoV,EAAQ,CAAE,IAAK,MAAO,MAAOpV,CAAG,CAAA,CAAG,EAC1E,CAAE,KAAMY,EAAE,KAAM,IAAI,EAAG,QAASZ,GAAKoV,EAAQ,CAAE,IAAK,KAAM,MAAOpV,CAAG,CAAA,CAAG,CAC1E,CACjB,CAAS,EACK,KAAKR,CAAM,EAAE,KAAKmU,GAAQ,CAC5B,MAAMa,EAASb,EAAK,cAAc,kEAAkE,EACpGa,GAAA,MAAAA,EAAQ,OACpB,CAAS,CACT,CAAK,CACL"} \ No newline at end of file diff --git a/Site/js/machinealertview.js b/Site/js/machinealertview.js index 4bb3116..86113ec 100644 --- a/Site/js/machinealertview.js +++ b/Site/js/machinealertview.js @@ -392,9 +392,8 @@ function getParameterValue(paramid, paramtype) { function openSetAlertLayerParameters() { setAlertLayerParameters(); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_parameter .dialog-title span.title').text('Pivots'); - //$('#mask_bg').show(); $('#dialog_parameter') .attr('act', 'edit') .css({ @@ -411,6 +410,6 @@ function setParameterCompleted() { parametervalues = getAlertLayerParameters(); machineObject.searchMachine(false); $('#dialog_parameter').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); pivotsDialogOpend = false; } diff --git a/Site/js/mapview/asset.js b/Site/js/mapview/asset.js index 6fc6535..160ea74 100644 --- a/Site/js/mapview/asset.js +++ b/Site/js/mapview/asset.js @@ -1,5 +1,8 @@ -var allAssets; +var allBasicAssetsObj//当前用户有权限的所有机器缓存对象 +var allBasicAssetsObj_Timeout = null; +var BasicAssetsExpire = false; +var allAssets;//当前过滤条件下的全部机器 var selectedAsset = undefined; var assetDictionary = [[]]; var allGroups; @@ -7,6 +10,7 @@ var groupAssets = [[]]; var jobsiteAssets = [[]]; function updateAssets() { + assetDictionary = [[]]; groupAssets = [[]]; jobsiteAssets = [[]]; @@ -69,6 +73,8 @@ if (typeof (AssetObject) != "function") { AssetObject = function (mapHelper) { var isFirstLoad = true;//是否第一次加载,第一次加载需定位 var allMachineCheckBox = []; + var inGettingAllBasicAssets = false; + var inGettingBasicAsset = false; var inSearchingMachine = false; var allLocations; @@ -468,12 +474,80 @@ if (typeof (AssetObject) != "function") { currentShownIndex = -1; allMachineCheckBox.splice(0, allMachineCheckBox.length);//清空CheckBox数组 //this.getMachines(isauto);//getMachines放在loadMapAlertLayer加载完成后执行 + + if (allBasicAssetsObj && !BasicAssetsExpire) { + this.loadMapAlertLayer(isauto); + } + else { + this.getAssetBasicInfos(function () { + _this.loadMapAlertLayer(isauto); + }); + } this.getCompanyLocations(); - this.loadMapAlertLayer(isauto); displayFilerIcon(); } + this.getAssetBasicInfos = function (next) { + if (inGettingAllBasicAssets) + return; + inGettingAllBasicAssets = true; + _network.mapviewquery("GetAssetBasicInfos", htmlencode(JSON.stringify([companyids])), function (data) { + inGettingAllBasicAssets = false; + if (typeof (data) !== "string") { + allBasicAssetsObj = new AllBasicAssetsObject(); + allBasicAssetsObj.setAssets(data); + BasicAssetsExpire = false; + + if (allBasicAssetsObj_Timeout) + clearTimeout(allBasicAssetsObj_Timeout) + allBasicAssetsObj_Timeout = setTimeout(function () { + BasicAssetsExpire = true; + }, 5 * 60 * 1000); + + if (next) + next(); + } + else { + showMachineAlert(); + } + }, function () { + inGettingAllBasicAssets = false; + showMachineAlert(); + }); + } + + var notificationAssetQueue = []; + this.getAssetBasicInfoByAssets = function (aids) { + if (inGettingBasicAsset) { + for (var i = 0; i < aids.length; i++) { + var aid = aids[i]; + if (notificationAssetQueue.indexOf(aid) < 0) + notificationAssetQueue.push(aid); + } + return; + } + inGettingBasicAsset = true; + + _network.mapviewquery("GetAssetBasicInfoByAssets", htmlencode(JSON.stringify([companyids, JSON.stringify(aids)])), function (data) { + inGettingBasicAsset = false; + if (typeof (data) !== "string") { + if (allBasicAssetsObj) + allBasicAssetsObj.changeAssets(data); + } + if (notificationAssetQueue.length > 0) { + _this.getAssetBasicInfoByAssets(notificationAssetQueue); + notificationAssetQueue = []; + } + }, function () { + inGettingBasicAsset = false; + if (notificationAssetQueue.length > 0) { + _this.getAssetBasicInfoByAssets(notificationAssetQueue); + notificationAssetQueue = []; + } + }); + } + this.getMachines = function (isauto) { var mal = $("#selMapAlertLayer").val(); if (!mal) mal = ""; @@ -533,40 +607,26 @@ if (typeof (AssetObject) != "function") { } var ss = s.split(String.fromCharCode(170)); a.ID = Number(ss[0]); - a.VIN = ss[1]; - a.Name = ss[2]; - a.Name2 = ss[3]; - a.Make = ss[4]; - a.Model = ss[5]; - a.AssetType = ss[6]; + a.Latitude = Number(ss[1]); + a.Longitude = Number(ss[2]); + a.IconUrl = ss[3]; + a.AlertTips = ss[4]; + a.Priority = Number(ss[5]); - a.Latitude = Number(ss[7]); - a.Longitude = Number(ss[8]); - a.IconUrl = ss[9]; - a.AlertTips = ss[10]; - a.Priority = Number(ss[11]); - - if (ss[12] && ss[12] !== "") { - a.AssetGroups = ss[12].split(",") + if (allBasicAssetsObj) { + var ta = allBasicAssetsObj.getAsset(a.ID); + if (ta) { + a.VIN = ta.VIN; + a.DisplayName = ta.Name; + a.Make = ta.MakeName; + a.Model = ta.ModelName; + a.AssetType = ta.TypeName; + a.OnRoad = ta.OnRoad; + a.Attachment = ta.Attachment; + a.AssetGroups = ta.AssetGroups; + a.JobSites = ta.JobSites; + } } - else { - a.AssetGroups = []; - } - - if (ss[13] && ss[13] !== "") { - a.JobSites = ss[13].split(","); - } - else { - a.JobSites = []; - } - - a.DisplayName = a.Name2; - if (!a.DisplayName || a.DisplayName === "") - a.DisplayName = a.Name; - if (!a.DisplayName || a.DisplayName === "") - a.DisplayName = a.VIN; - if (!a.DisplayName || a.DisplayName === "") - a.DisplayName = a.ID; assets.push(a); } @@ -788,7 +848,6 @@ if (typeof (AssetObject) != "function") { this.getCompanyLocations = function () { - var _this = this; _network.mapviewquery("GetCompanyLocations", companyids, function (data) { allLocations = data; if (allLocations && allLocations.length > 0) @@ -826,7 +885,6 @@ if (typeof (AssetObject) != "function") { if (!selmal) selmal = userParams.MapAlertLayer; var p = companyids + ";" + selmal; - var _this = this; _network.mapviewquery("GetMapAlertLayers", p, function (data) { if (data && data.length > 0) { $("#mapAlertLayerDiv").show(); @@ -845,6 +903,84 @@ if (typeof (AssetObject) != "function") { $('#loadingDiv').hide(); }); } + + var _websocket; + function openmsgwebsocket() { + if (typeof MSGWebSocketURL !== "undefined") { + _websocket = new $websocket(MSGWebSocketURL); + _websocket.onreceive = onmsgreceived; + _websocket.connect(); + } + } + + function onmsgreceived(data) { + console.log(JSON.stringify(data)); + if (data) { + if (data.Code == "200" || data.Code == "201")//add, update + _this.getAssetBasicInfoByAssets([data.Message]); + } + } + + openmsgwebsocket(); + } +} + +if (typeof AllBasicAssetsObject != "function") { + AllBasicAssetsObject = function () { + var assetObjArray = []; + this.setAssets = function (assets) { + var obj = { MaxId: 0, Assets: [] }; + assetObjArray.push(obj); + for (var i = 0; i < assets.length; i++) { + var asset = assets[i]; + if (obj.Assets.length >= 500) { + var obj = { MaxId: 0, Assets: [] }; + assetObjArray.push(obj); + } + obj.MaxId = asset.Id; + obj.Assets.push(asset); + } + } + + this.getAsset = function (id) { + for (var i = 0; i < assetObjArray.length; i++) { + var obj = assetObjArray[i]; + if (obj.MaxId < id) + continue; + + for (var j = 0; j < obj.Assets.length; j++) { + var asset = obj.Assets[j]; + if (asset.Id == id) + return asset; + } + } + } + + this.changeAssets = function (assets) { + var obj = { MaxId: 0, Assets: [] }; + assetObjArray.push(obj); + for (var i = 0; i < assets.length; i++) { + var asset = assets[i]; + var ta = this.getAsset(asset.Id); + if (ta) { + Object.assign(ta, asset); + } + else + this.addAsset(asset); + } + } + + this.addAsset = function (asset) { + for (var i = 0; i < assetObjArray.length; i++) { + var obj = assetObjArray[i]; + if (obj.MaxId < asset.Id && i != assetObjArray.length - 1) + continue; + + obj.Assets.push(asset); + if (asset.Id > obj.MaxId) + obj.MaxId = asset.Id; + } + } } } @@ -862,8 +998,8 @@ var assetHisLocations = [];//历史记录的位置信息 function getAssetPopupContent(cid, asset) { var loc = asset.Location; - var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b> " + htmlencode(asset.Name) + "<br/>"; - popContent += "<b>" + GetTextByKey("P_MV_NAMECUSTOM_COLON", "Name (Custom):") + " </b>" + htmlencode(asset.Name2) + "<br/>"; + var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b> " + htmlencode(asset.DisplayName) + "<br/>"; + //popContent += "<b>" + GetTextByKey("P_MV_NAMECUSTOM_COLON", "Name (Custom):") + " </b>" + htmlencode(asset.Name2) + "<br/>"; popContent += "<b>" + GetTextByKey("P_MV_SN_COLON", "SN:") + " </b>" + asset.VIN + "<br/>"; popContent += "<b>" + GetTextByKey("P_MV_MAKE_COLON", "Make:") + " </b>" + asset.Make + "<br/>"; popContent += "<b>" + GetTextByKey("P_MV_MODEL_COLON", "Model:") + " </b>" + asset.Model + "<br/>"; diff --git a/Site/js/mapview/machinealertview.js b/Site/js/mapview/machinealertview.js index e40259a..6c62f85 100644 --- a/Site/js/mapview/machinealertview.js +++ b/Site/js/mapview/machinealertview.js @@ -412,9 +412,8 @@ function getParameterValue(paramid, isCriteria) { function openSetAlertLayerParameters() { setAlertLayerParameters(); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_parameter .dialog-title span.title').text(GetTextByKey("P_MV_PIVOTS", 'Pivots')); - //$('#mask_bg').show(); $('#dialog_parameter') .attr('act', 'edit') .css({ @@ -431,6 +430,6 @@ function setParameterCompleted() { parametervalues = getAlertLayerParameters(); assetObject.searchMachine(false); $('#dialog_parameter').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); pivotsDialogOpend = false; } diff --git a/Site/js/mapview/maphelper.js b/Site/js/mapview/maphelper.js index 245c4ee..3c39a63 100644 --- a/Site/js/mapview/maphelper.js +++ b/Site/js/mapview/maphelper.js @@ -755,6 +755,8 @@ if (typeof (MapHelper) !== "function") { var ps = []; var infowindowassetexist = false;//infowindow显示的机器是否在查询结果里 var infowindowassetid = -1; + if (toolTipAssetSummary) + toolTipAssetSummary.clearCache(); if (toolTipAssetSummary && toolTipAssetSummary.status == 0) infowindowassetid = toolTipAssetSummary.assetid; for (var i = 0; i < machines.length; i++) { @@ -1006,7 +1008,7 @@ if (typeof (MapHelper) !== "function") { this.locateJobSite = function (js) { var g = machineGraphics["JSID" + js.ID]; if (g) { - mapObj.MyMap.setExtent(g.geometry.getExtent()); + mapObj.MyMap.setExtent(g.geometry.getExtent(), true); var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b>" + htmlencode(js.Name) + "<br/>"; popContent += "<b>" + GetTextByKey("P_MV_LATITUDE_COLON", "Latitude:") + " </b>" + js.Latitude + "<br/>"; @@ -1331,7 +1333,6 @@ if (typeof (MapHelper) !== "function") { from = "1900-1-1"; if (!to) to = "2099-12-31"; - var temp = null; var dtfrom = new Date(from.replace(/-/g, "/").replace("T", " ")) var dtto = new Date(to.replace(/-/g, "/").replace("T", " ")) for (var i in locationHistoryPolylines) { @@ -1340,15 +1341,26 @@ if (typeof (MapHelper) !== "function") { var ldtend = new Date(polyLine.EndTime.replace(/-/g, "/").replace("T", " ")); if (ldtstart >= dtfrom && ldtend <= dtto) { var lineGraphic = this.createLocationHistoryLineGraphic(polyLine, color); + if (color) + lineGraphic.isTrip = true; var oldLineGraphic = locationLineGraphics[i]; mapObj.BaseMapLayer.remove(oldLineGraphic); locationLineGraphics[i] = lineGraphic; mapObj.BaseMapLayer.add(lineGraphic); - temp = lineGraphic; } } - if (temp && color) - mapObj.MyMap.setExtent(temp.geometry.getExtent()); + var tempExtent = null; + for (var i in locationLineGraphics) { + var g = locationLineGraphics[i]; + if (g.isTrip) { + if (tempExtent == null) + tempExtent = g.geometry.getExtent(); + else + tempExtent = tempExtent.union(g.geometry.getExtent()); + } + } + if (tempExtent && color) + mapObj.MyMap.setExtent(tempExtent, true); } this.createLocationHistoryPoint = function (m, point) { @@ -1582,7 +1594,7 @@ if (typeof (MapHelper) !== "function") { if (gs[0].geometry.type == "point") mapObj.MyMap.centerAt(gs[0].geometry); else - mapObj.MyMap.setExtent(gs[0].geometry.getExtent()); + mapObj.MyMap.setExtent(gs[0].geometry.getExtent(), true); } } } diff --git a/Site/js/mapview/mapview.js b/Site/js/mapview/mapview.js index 7f58765..a71d5f2 100644 --- a/Site/js/mapview/mapview.js +++ b/Site/js/mapview/mapview.js @@ -56,7 +56,6 @@ function onPlayClick(last) { function openSetLocationHistory() { $('#dialog_locationhistory .dialog-title span.title').text(GetTextByKey("P_MA_LOCATIONHISTORY", 'Location History')); - //$('#mask_bg').show(); getLocationPrimaryDataSource(); $('#locationhistoryDiv').show(); } @@ -70,15 +69,13 @@ function locationHistoryClick(e) { if (PopupViewShowing) { if (e) { - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_lochis') .css({ - 'top': 50, - 'right': 100, - 'bottom': 50, - 'left': 100, + 'width': document.documentElement.clientWidth - 200, + 'height': document.documentElement.clientHeight - 150 }) - .showDialog(); + .showDialogfixed(); execIframeFunc("getlocationhis", [e.data.CompanyID, e.data.ID, e.data.DisplayName], "iframelochis"); } return; @@ -144,7 +141,8 @@ function locationTimeperiodChange() { $('#dialog_endtimehour').val(setTimeSelect(hours)); $('#dialog_endtimeminute').val(setTimeSelect(minutes)); } - } } + } +} var lastHisFromDT; var lastHisToDT; @@ -302,8 +300,7 @@ function isAssetMatch(asset, filter) { filter = filter.toLowerCase(); if (asset.ID.toString().indexOf(filter) >= 0 || asset.VIN.toLowerCase().indexOf(filter) >= 0 - || asset.Name.toLowerCase().indexOf(filter) >= 0 - || asset.Name2.toLowerCase().indexOf(filter) >= 0 + || asset.DisplayName.toLowerCase().indexOf(filter) >= 0 || asset.Make.toLowerCase().indexOf(filter) >= 0 || asset.Model.toLowerCase().indexOf(filter) >= 0 || asset.AssetType.toLowerCase().indexOf(filter) >= 0) @@ -358,7 +355,7 @@ function openRequestVideoDialog(assetid, logid) { $("#dialog_videoct").prop("checked", false); $("#dialog_videoct").change(); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_requestvideo') .attr('act', 'edit') .css({ diff --git a/Site/js/mapview/mapviewsearch.js b/Site/js/mapview/mapviewsearch.js index 146cf7d..a9618cd 100644 --- a/Site/js/mapview/mapviewsearch.js +++ b/Site/js/mapview/mapviewsearch.js @@ -5,11 +5,11 @@ $("#btnSavedSearches").click(openSavedSearches); $("#btnSaveSearchDetault").click(openSaveSearch); $('#dialog_savedsearches').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); $('#dialog_savesearch').dialog(function () { - $('#mask_bg').hide(); + showmaskbg(false); }); }); @@ -41,7 +41,7 @@ function showSearchList(grid_dt, data) { /**********************Saved Searches***********************************/ function openSavedSearches() { - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_savedsearches .dialog-title span.title').text(GetTextByKey("P_MV_SAVEDSEARCHES", 'Saved Searches')); $('#dialog_savedsearches') .attr('act', 'edit') @@ -170,7 +170,7 @@ function onLoadSavedSearches(search) { setSavedSearche(search); refreshData(); $('#dialog_savedsearches').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); } function setSavedSearche(search) { @@ -194,7 +194,7 @@ function setSavedSearche(search) { function openSaveSearch() { $('#savesearch_searchname').val(''); $('#savesearch_default').prop('checked', false); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_savesearch .dialog-title span.title').text(GetTextByKey("P_MV_SAVESEARCH", 'Save Search')); $('#dialog_savesearch') .attr('act', 'edit') @@ -295,7 +295,7 @@ function SaveMapViewSearch(item) { $('#savesearch_default').prop('checked', false); _dialog.showAlert(GetTextByKey("P_MV_SAVSUCCESSFULLY", 'Saved successfully.'), GetTextByKey("P_MV_SAVESEARCH", 'Save Search')); $('#dialog_savesearch').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); } }, function (err) { _dialog.showAlert(GetTextByKey("P_MV_FAILEDTOSAVETHISSEARCH", 'Failed to save this search.'), GetTextByKey("P_MV_SAVESEARCH", 'Save Search')); diff --git a/Site/js/mapview/mapviewshape.js b/Site/js/mapview/mapviewshape.js index 1998e67..b11b11d 100644 --- a/Site/js/mapview/mapviewshape.js +++ b/Site/js/mapview/mapviewshape.js @@ -89,18 +89,18 @@ function getShapeFileInfos() { } function showConfirm1(msg, title, fok, fcancel) { - $('#mask_bg').show(); + showmaskbg(true); $('#addodomask').show(); $('#addenginehoursmask').show(); _dialog.showConfirm(msg, title, function (e) { - $('#mask_bg').hide(); + showmaskbg(false); $('#addodomask').hide(); $('#addenginehoursmask').hide(); if (typeof fok === 'function') { fok(e); } }, function () { - $('#mask_bg').hide(); + showmaskbg(false); $('#addodomask').hide(); $('#addenginehoursmask').hide(); }); @@ -114,7 +114,7 @@ function deleteShapeClick(e) { 'Key': e.data.CompanyID, 'Value': e.data.ID }; - $('#mask_bg').show(); + showmaskbg(true); showConfirm1(GetTextByKey("P_MV_DOYOUWANTTODELETETHESHAPEFILE", 'Do you want to delete the shape file?'), GetTextByKey("p_MV_DELETESHAPEFILE", 'Delete Shape File'), function () { _network.mapviewquery("DeleteShape", JSON.stringify(item), function (data) { mapHelper.removeShape(e.data); @@ -129,7 +129,7 @@ function openImportShapeFile() { $('#dialog_shapename').val(''); $('#dialog_shapenotes').val(''); $('#span_filename').text(''); - $('#mask_bg').show(); + showmaskbg(true); $('#dialog_importshapefile .dialog-title span.title').text(GetTextByKey("P_MV_IMPORTSHAPEFILE", 'Import Shape File')); $('#dialog_importshapefile') .attr('act', 'edit') @@ -196,7 +196,7 @@ function SaveImportShapeFile() { getShapeFileInfos(); shapefiledata = undefined; $('#dialog_importshapefile').hideDialog(); - $('#mask_bg').hide(); + showmaskbg(false); }, error: function (err) { _dialog.showAlert(err.statusText, GetTextByKey("P_MV_IMPORTSHAPEFILE", 'Import Shape File')); diff --git a/Site/js/utility.js b/Site/js/utility.js index 010a593..c9dd625 100644 --- a/Site/js/utility.js +++ b/Site/js/utility.js @@ -403,7 +403,7 @@ if (typeof $websocket !== 'function') { 'width': $(document).outerWidth(false) - left - 50, 'height': $(document).outerHeight(false) - 64 }); - $('#mask_bg').height($(document).outerHeight(false) - 64).width($(document).outerWidth(false) - 50); + $('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false)); if (this.attr("init") !== "1") { this.attr("init", "1"); @@ -1625,6 +1625,29 @@ function showConfirm(msg, title, fok, fcancel) { fok(e); } }, function () { + if (fcancel) + fcancel(); + showmaskbg(false); + }); + } +} +function showConfirmYesNoCancel(msg, title, fok, fcancel, fclose) { + if (window.parent && typeof window.parent.showconfirm == 'function') { + window.parent.showConfirmYesNoCancel(msg, title, fok, fcancel, fclose); + } else { + showmaskbg(true); + _dialog.showConfirmYesNoCancel(msg, title, function (e) { + showmaskbg(false); + if (typeof fok === 'function') { + fok(e); + } + }, function () { + if (fcancel) + fcancel(); + showmaskbg(false); + }, function () { + if (fclose) + fclose(); showmaskbg(false); }); }