This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@@ -6,6 +6,10 @@
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/default.css")%>" type="text/css" />
<style type="text/css">
:root { <%=StyleVariables%> }
</style>
<style>
html,
body {
@@ -31,6 +35,7 @@
right: 0;
top: 0;
bottom: 0;
font-size: 14px;
}
#content {
@@ -55,35 +60,30 @@
div {
cursor: default;
}
</style>
<style type="text/css">
.data-grid {
height: 100%;
font-size: 12px !important;
font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important;
#mask_bg,
.maskbg {
z-index: 500;
}
.dialog {
z-index: 651;
}
</style>
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/default.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/split_sub.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/split_sub.css")%>" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/mapview.css")%>" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/editmultiselect.css")%>" />
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
<link rel="stylesheet" href="https://js.arcgis.com/3.44/esri/css/esri.css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/playbar.css")%>" />
<link type="text/css" href="<%=GetFileUrlWithVersion("../js/components/css/gridview.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetFileUrlWithVersion("../css/override.css") %>" rel="stylesheet" />
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../fic/fic/css/form.css")%>" />
<script src="<%=GetFileUrlWithVersion("../js/jquery-" + (JQueryVersion ?? "3.6.0") + ".min.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/gridview.js") %>"></script>
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../fic/fic/js/controls/form.js") %>"></script>
<script>
var GridView = window.GridView || window['g5-gridview'];
//必须放在地图js之前
var dojoConfig = {
paths: {
@@ -96,7 +96,7 @@
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<script src="https://js.arcgis.com/3.40"></script>
<script src="https://js.arcgis.com/3.44"></script>
<%--<script src="<%=GetFileUrlWithVersion("js/mapinit3.19.js")%>"></script>--%>
<script src="<%=GetFileUrlWithVersion("../js/language.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/mapview/asset.js")%>"></script>
@@ -237,13 +237,22 @@
getLocationHistory(true);
openTrips(true);
});
$('#selLocDatasource').on('click', function () {
changeLocDatasource();
});
$('#btnTheftModeReload').on('click', function () {
getLocationHistory(true);
});
$('#dialog_requestvideo').dialog(function () {
showmaskbg(false);
});
$("#btnClearTrip").click(null, function (e) {
$("#tripDiv").hide();
$("#tbTrips").empty();
});
$("#showDealerLocationsDiv").click(null, function (e) {
if ($("#showDealerLocationsDiv").attr("state") == "0") {
assetObject.showLocations();
@@ -275,51 +284,7 @@
});
$("#dialog_timeperiod").change(null, function (e) {
currentdate = getCurrentDate();
var timeperiod = $("#dialog_timeperiod").val();
var disabled = false;
if (timeperiod !== "4") {
disabled = true;
var time = new Date(currentdate);
var nowtime = new Date(currentdate);
var hours = nowtime.getHours();
var minutes = nowtime.getMinutes();
if (timeperiod === "2") {
time.setDate(time.getDate() - 1);
nowtime.setDate(nowtime.getDate() - 1);
}
else if (timeperiod === "3") {
time.setDate(time.getDate() - 6);
}
else if (timeperiod === "5") {
time.setDate(time.getDate() - 1);
}
time = time.getMonth() + 1 + "/" + time.getDate() + "/" + time.getFullYear();
nowtime = nowtime.getMonth() + 1 + "/" + nowtime.getDate() + "/" + nowtime.getFullYear();
$('#dateFrom').val(time);
$('#dateTo').val(nowtime);
$('#dialog_starttimehour').val('00');
$('#dialog_starttimeminute').val('00');
$('#dialog_endtimehour').val('23');
$('#dialog_endtimeminute').val('59');
if (timeperiod === "5") {
var s_minutes = minutes + 1;
var s_hours = hours;
if (minutes == 59) {
s_hours = s_hours + 1;
s_minutes = 0;
}
$('#dialog_starttimehour').val(setTimeSelect(s_hours));
$('#dialog_starttimeminute').val(setTimeSelect(s_minutes));
$('#dialog_endtimehour').val(setTimeSelect(hours));
$('#dialog_endtimeminute').val(setTimeSelect(minutes));
}
}
locationTimeperiodChange();
});
//$("#splitIcon").click();
initTime();
@@ -369,6 +334,21 @@
else
c.append($("<option></option>").val(i).text(i))
}
var c = $('#dialog_videohour');
for (var i = 0; i < 24; i++) {
if (i < 10)
c.append($("<option></option>").val("0" + i).text("0" + i))
else
c.append($("<option></option>").val(i).text(i))
}
c = $('#dialog_videominute');
for (var i = 0; i < 60; i++) {
if (i < 10)
c.append($("<option></option>").val("0" + i).text("0" + i))
else
c.append($("<option></option>").val(i).text(i))
}
}
</script>
</head>
@@ -391,72 +371,134 @@
</div>
</div>
<div id="divsetting">
<table style="line-height: 25px;">
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_ASSET_COLON">Asset:</td>
<td><span id="spMachineName" data-lgid="P_MV_NOASSETSELECTED">No asset selected.</span></td>
</tr>
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_TIMEPERIOD_COLON">Time Period:</td>
<td>
<select id="dialog_timeperiod" tabindex="12" style="width: 90px; height: 22px;">
<option value="1" selected="selected" data-lgid="P_MV_TODAY">Today</option>
<option value="5" data-lgid="P_MV_LAST24HOURS">Last 24 Hours</option>
<option value="2" data-lgid="P_MV_PRIORDAY">Prior Day</option>
<option value="3" data-lgid="P_MV_LAST7DAYS">Last 7 Days</option>
<option value="4" data-lgid="P_MV_CUSTOM">Custom</option>
</select></td>
</tr>
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_FROM_COLON">From:</td>
<td>
<input type="text" id="dateFrom" maxlength="12" tabindex="27" style="width: 70px;" />
<select id="dialog_starttimehour" style="width: 48px; margin-left: 3px;" tabindex="3"></select><span style="font-weight: bold;">&nbsp;:&nbsp;</span>
<select id="dialog_starttimeminute" style="width: 48px; margin-left: 0;" tabindex="4"></select>
</td>
<div class="rightitem" id="theftDiv" style="position: relative;">
<div class="subtitle contactinfo">
<span class="sbutton iconchevrondown" target="divTheft" onclick="OnRightExpend(this)"></span>
<span data-lgid="P_MV_LOCATIONSOURCES" style="font-size: 20px; font-weight: bold;">Location Source(s)</span>
</div>
<div id="divTheft" style="width: 250px; padding-left: 20px;">
<div id="containerTheft"></div>
<div>
<select id="selLocDatasource">
<option value="0" data-lgid="P_MV_PRIMARYONLY">Primary Only</option>
<option value="1" data-lgid="P_MV_THEFTMODEMULTIPLELINES">Theft Mode (Multiple Lines)</option>
<option value="2" data-lgid="P_MV_COMBINEDSINGLELINE">Combined (Single Line)</option>
</select>
</div>
</div>
<div id="theftLoading" style="display: none;"><span class="QuickLoading c-spin"></span></div>
</div>
<div class="rightitem">
<table style="line-height: 25px; width: 100%; table-layout: fixed;">
<tr>
<td style="padding-left: 5px; width: 75px;" data-lgid="P_MV_ASSET_COLON">Asset:</td>
<td><span id="spMachineName" data-lgid="P_MV_NOASSETSELECTED" style="font-weight: bold; word-break: break-word;">No asset selected.</span></td>
</tr>
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_TIMEPERIOD_COLON">Time Period:</td>
<td>
<select id="dialog_timeperiod" tabindex="12" style="width: 90px; height: 22px;">
<option value="1" selected="selected" data-lgid="P_MV_TODAY">Today</option>
<option value="5" data-lgid="P_MV_LAST24HOURS">Last 24 Hours</option>
<option value="2" data-lgid="P_MV_PRIORDAY">Prior Day</option>
<option value="3" data-lgid="P_MV_LAST7DAYS">Last 7 Days</option>
<option value="4" data-lgid="P_MV_CUSTOM">Custom</option>
</select></td>
</tr>
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_FROM_COLON">From:</td>
<td>
<input type="text" id="dateFrom" maxlength="12" tabindex="27" style="width: 70px;" />
<select id="dialog_starttimehour" style="width: 48px; margin-left: 3px;" tabindex="3"></select><span style="font-weight: bold;">&nbsp;:&nbsp;</span>
<select id="dialog_starttimeminute" style="width: 48px; margin-left: 0;" tabindex="4"></select>
</td>
</tr>
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_TO_COLON">To:</td>
<td>
<input type="text" id="dateTo" maxlength="12" tabindex="27" style="width: 70px;" />
<select id="dialog_endtimehour" style="width: 48px; margin-left: 3px;" tabindex="5"></select><span style="font-weight: bold;">&nbsp;:&nbsp;</span>
<select id="dialog_endtimeminute" style="width: 48px; margin-left: 0;" tabindex="6"></select>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center; width: 180px;">
<div id="divPlayBar" style="background-color: #C0C0C0;"></div>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: right;">
<input id="chkExclude00Loc" style="display: none" checked="checked" type="checkbox" /><span style="margin-right: 10px; display: none" data-lgid="P_MV_TO_EXCLUDE00LOCATIONS">Exclude 0,0 Locations</span>
<%--<input type="button" value="Quick Load" data-lgid="P_MV_QUICKLOAD" id="btnQuickLoadLocationHistory" />--%>
<%--<input type="button" value="Playback" data-lgid="P_MV_PLAYBACK" id="btnLoadLocationHistory" />--%>
<%--<span class="clearbtn" id="btnClearLocationHistory" style="margin-left: 5px;"></span>--%>
<%--<input type="button" value="Clear" data-lgid="P_MV_CLEAR" id="btnClearLocationHistory" />
<input type="button" value="Trip" data-lgid="P_MV_TRIP" id="btnLoadTrip" style="display: none;" />--%>
<%--<span id="btnQuickLoadLocationHistory" class="QuickLoad" style="margin-left: 6px;" title="Quick Load/Skip to End" data-title-lgid="P_MV_QUICKLOADSKIPTOEND"></span>--%>
<span id="btnHisLoading" class="QuickLoading" style="margin-left: 6px; display: none;"></span>
<span id="btnLoadTrip" class="TripReport" style="margin-left: 6px;" title="Trip Report" data-title-lgid="P_MV_TRIPREPORT"></span>
<span class="clearbtn" id="btnClearLocationHistory" style="margin-left: 6px;" title="Clear" data-title-lgid="P_MV_CLEAR"></span>
</tr>
<tr>
<td style="padding-left: 5px;" data-lgid="P_MV_TO_COLON">To:</td>
<td>
<input type="text" id="dateTo" maxlength="12" tabindex="27" style="width: 70px;" />
<select id="dialog_endtimehour" style="width: 48px; margin-left: 3px;" tabindex="5"></select><span style="font-weight: bold;">&nbsp;:&nbsp;</span>
<select id="dialog_endtimeminute" style="width: 48px; margin-left: 0;" tabindex="6"></select>
</td>
</tr>
<tr>
<td id="playBarContainer" colspan="2" style="text-align: center; width: 180px;">
<div id="divPlayBar" style="background-color: #C0C0C0;"></div>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: right;">
<input id="chkExclude00Loc" style="display: none" checked="checked" type="checkbox" /><span style="margin-right: 10px; display: none" data-lgid="P_MV_TO_EXCLUDE00LOCATIONS">Exclude 0,0 Locations</span>
<span id="btnHisLoading" class="QuickLoading" style="margin-left: 6px; display: none;"></span>
<span id="btnLoadTrip" class="TripReport" style="margin-left: 6px;" title="Trip Report" data-title-lgid="P_MV_TRIPREPORT"></span>
<%--<span id="btnTheftMode" class="TheftMode" style="margin-left: 6px;" title="Theft Mode" data-title-lgid="P_MV_THEFTMODE"></span>--%>
<span id="btnTheftModeReload" class="BarPlayEnd" style="margin-left: 6px; display: none" title="Quick Load/Skip to End" data-title-lgid="P_MV_QUICKLOADSKIPTOEND"></span>
<span class="clearbtn" id="btnClearLocationHistory" style="margin-left: 6px;" title="Clear" data-title-lgid="P_MV_CLEAR"></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
<div id="tripDiv" style="display: none;">
<div>
<span class="clearbtn" id="btnClearTrip" style="float: right; padding: 5px;"></span>
</div>
<div style="position: absolute; top: 30px; bottom: 0; right: 0; overflow: auto; width: 100%;">
<table id="tbTrips" style="line-height: 24px; border-collapse: collapse; border-spacing: 0; width: 100%;">
<table id="tbTrips" style="line-height: 24px; border-collapse: collapse; border-spacing: 0; width: 100%;table-layout:fixed;">
</table>
</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_requestvideo" style="display: none; width: 320px;">
<div class="dialog-title"><span class="title" data-lgid="P_MV_VIDEOREQUEST">Video Request</span><em class="dialog-close"></em></div>
<div class="dialog-content">
<table>
<tr>
<td class="label" data-lgid="P_MV_CUSTOMTIME_COLON">Custom Time:</td>
<td>
<input type="checkbox" id="dialog_videoct" tabindex="1" />
</td>
</tr>
<tr>
<td class="label" data-lgid="P_MV_DATE_COLON">Date:</td>
<td>
<input type="text" id="dialog_videodate" tabindex="1" />
</td>
</tr>
<tr>
<td class="label" data-lgid="P_MV_TIME_COLON">Time:</td>
<td>
<select id="dialog_videohour" style="width: 48px;" tabindex="2"></select><span style="font-weight: bold;">&nbsp;&nbsp;:&nbsp;&nbsp;</span>
<select id="dialog_videominute" style="width: 48px;" tabindex="3"></select>
</td>
</tr>
<tr>
<td class="label" style="width: 100px;" data-lgid="P_MV_VIDEOCLIPLENGTH_COLON">Video Clip Length:</td>
<td>
<input type="radio" id="r30sec" name="cliplen" checked="checked" tabindex="5" /><label for="r30sec" data-lgid="P_MV_30SECONDS">30 Seconds</label>
</td>
</tr>
<tr>
<td class="label"></td>
<td>
<input type="radio" id="r120sec" name="cliplen" tabindex="6" /><label for="r120sec" data-lgid="P_MV_120SECONDS">120 Seconds</label>
</td>
</tr>
</table>
<input type="hidden" id="dialog_hlogid" />
</div>
<div class="dialog-func">
<input type="button" value="Cancel" data-lgid="P_MV_CANCEL" class="dialog-close" tabindex="12" />
<input type="button" onclick="requestVideo();" value="Submit" data-lgid="P_MV_SUBMIT" tabindex="11" />
<div class="clear"></div>
</div>
</div>
</div>
</form>
</body>

View File

@@ -1,13 +1,17 @@
using DocumentFormat.OpenXml.Wordprocessing;
using Foresight.Fleet.Services.Asset;
using Foresight.Fleet.Services.Customer;
using Foresight.Fleet.Services.Styles;
using IronIntel.Contractor;
using IronIntel.Contractor.iisitebase;
using IronIntel.Contractor.Machines;
using IronIntel.Contractor.MapView;
using IronIntel.Contractor.Site;
using IronIntel.Contractor.Users;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
@@ -21,6 +25,7 @@ public partial class AssetLocationHis : ContractorBasePage
private string Logo1html = "<img class=\"logo\" src=\"{0}\" style=\"width:24px;height:24px; \" />";
protected string Logo1 = "";
public string CurrentDate = "";
protected string StyleVariables = "";
protected void Page_Load(object sender, EventArgs e)
{
string tp = Request.Params["tp"];
@@ -35,6 +40,7 @@ public partial class AssetLocationHis : ContractorBasePage
{
var cmp = SystemParams.GetCompanyInfo();
GetLogoHtml(cmp);
GetUIStyle();
}
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
@@ -108,4 +114,46 @@ public partial class AssetLocationHis : ContractorBasePage
return lic;
}
}
protected StyleInfo GetUIStyle()
{
var sessionid = IronIntelBasePage.GetLoginSessionID(Request);
var user = UserManagement.GetUserBySessionID(sessionid);
CustUIStyle style = null;
if (user != null)
{
style = SystemParams.GetUIStyle(user.IID);
string color;
if (style != null)
{
color = style.TitleBarColor;
}
else
{
color = "#f78e1e";
}
string opacity;
string fore;
string ctrlbgcolor = "lightgray";
try
{
var c = ColorTranslator.FromHtml(color);
opacity = string.Format("rgb({0} {1} {2}/60%)", c.R, c.G, c.B);
var g = .299 * c.R + .587 * c.G + .114 * c.B;
fore = g < 127.5 ? "#f0f0f0" : "#0f0f0f";
ctrlbgcolor = g < 221 ? color : "lightgray";//221为light的计算值
}
catch
{
opacity = "rgb(247 142 30/60%)";
fore = "#0f0f0f";
ctrlbgcolor = "lightgray";
}
StyleVariables = string.Format("--title-color: {0}; --title-bg-color: {1}; --title-bg-opacity-color: {2};--title-ctrlbg-color: {3}; ", fore, color, opacity, ctrlbgcolor);
}
return new StyleInfo
{
User = user,
Style = style
};
}
}

View File

@@ -39,22 +39,13 @@
cursor: default;
}
</style>
<style type="text/css">
.data-grid {
height: 100%;
font-size: 12px !important;
font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important;
}
</style>
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/default.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/split_sub.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/split_sub.css")%>" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/mapview.css")%>" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/editmultiselect.css")%>" />
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
<link rel="stylesheet" href="https://js.arcgis.com/3.44/esri/css/esri.css" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" />
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/playbar.css")%>" />
<link type="text/css" href="<%=GetFileUrlWithVersion("../js/components/css/gridview.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetFileUrlWithVersion("../css/override.css") %>" rel="stylesheet" />
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" type="text/css" />
@@ -62,9 +53,7 @@
<script src="<%=GetFileUrlWithVersion("../js/jquery-" + (JQueryVersion ?? "3.6.0") + ".min.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/cookie.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/gridview.js") %>"></script>
<script>
var GridView = window.GridView || window['g5-gridview'];
//必须放在地图js之前
var dojoConfig = {
paths: {
@@ -76,7 +65,7 @@
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<script src="https://js.arcgis.com/3.40"></script>
<script src="https://js.arcgis.com/3.44"></script>
<%--<script src="<%=GetFileUrlWithVersion("js/mapinit3.19.js")%>"></script>--%>
<%--<script src="<%=GetFileUrlWithVersion("../js/mapview.js")%>"></script>--%>
<%--<script src="<%=GetFileUrlWithVersion("../js/playbar.js")%>"></script>--%>

View File

@@ -6,40 +6,23 @@
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<link type="text/css" href="<%=GetUrl("js/lib/ui.min.css") %>" rel="stylesheet" />
<link rel="stylesheet" href="<%=GetUrl("css/default.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetUrl("css/split_sub.css")%>" type="text/css" />
<style type="text/css">
#search {
background-color: rgb(235, 235, 235);
border: none;
padding-top: 5px;
padding-bottom: 5px;
cursor: pointer;
}
#search:hover {
background: rgb(225, 225, 225);
}
</style>
<style type="text/css">
:root { <%=StyleVariables%> }
.data-grid {
height: 100%;
font-size: 12px !important;
font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important;
}
</style>
<link type="text/css" href="<%=GetUrl("js/components/css/gridview.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetUrl("css/override.css") %>" rel="stylesheet" />
<script src="<%=GetUrl("js/lib/utility.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/lib/ui.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/jquery-3.6.0.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/cookie.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetUrl("js/components/gridview.js") %>"></script>
<script src="<%=GetUrl("js/language.js")%>" type="text/javascript"></script>
<script type="text/javascript">
<%-- _net.root = '<%=Page.ResolveUrl("~/")%>';--%>
var GridView = window.GridView || window['g5-gridview'];
<%-- _net.root = '<%=Page.ResolveUrl("~/")%>';--%>
var GridView = window['lib-ui'].Grid;
var canExport = <%= CanExportFile %>;
function getText(s, flag) {

View File

@@ -186,7 +186,10 @@
{
key: 'model',
caption: GetTextByKey('P_MA_MODELNAME', 'Model Name'),
width: 100
width: 100,
totalCss: {
'text-align': 'right'
}
},
{ key: 'h0', caption: '12AM-1AM', width: 94, align: 'right' },
{ key: 'h1', caption: '1AM-2AM', width: 94, align: 'right' },
@@ -249,11 +252,11 @@
var source = grid.source;
var total = {
name: GetTextByKey('P_MA_TOTALCOLON', 'Total:') + ' ' + source.length,
model: $('<span></span>').css('float', 'right').text(GetTextByKey('P_MA_TOTALRUNTIMECOLON', 'Total Runtime:'))[0].outerHTML
model: GetTextByKey('P_MA_TOTALRUNTIMECOLON', 'Total Runtime:')
};
for (var h = 0; h < 24; h++) {
var seconds = source.reduce(function (current, s) {
var n = s.Values['s' + h];
var n = s['s' + h];
return isNaN(n) ? current : current + n;
}, 0);
if (seconds > 0) {
@@ -265,7 +268,6 @@
}
}
grid.total = total;
grid.init();
loading = false;
$('.maskbg').fadeOut(100);
@@ -356,7 +358,7 @@
it['h' + h] = text;
}
source.push({ Values: it });
source.push(it);
parent.append($('<tr></tr>').append(item));
}
source = grid.source.concat(source);
@@ -390,11 +392,11 @@
function OnDateChanged() {
var date = $('#date-selector').val();
if (date == "") {
showAlert(GetTextByKey("P_WO_XXXXXX", "The date is required."), alerttitle);
showAlert(GetTextByKey("P_MA_THEDATEISREQUIRED", "The date is required."), alerttitle);
return false;
}
if (!checkDate(date)) {
showAlert(GetTextByKey("P_WO_XXXXXX", "The date is incorrect."), alerttitle);
showAlert(GetTextByKey("P_MA_THEDATEISINCORRECT", "The date is incorrect."), alerttitle);
return false;
}
getAssetTimeline(pcid, date);
@@ -413,11 +415,11 @@
function OnExport() {
var date = $('#date-selector').val();
if (date == "") {
showAlert(GetTextByKey("P_WO_XXXXXX", "The date is required."), alerttitle);
showAlert(GetTextByKey("P_MA_THEDATEISREQUIRED", "The date is required."), alerttitle);
return false;
}
if (!checkDate(date)) {
showAlert(GetTextByKey("P_WO_XXXXXX", "The date is incorrect."), alerttitle);
showAlert(GetTextByKey("P_MA_THEDATEISINCORRECT", "The date is incorrect."), alerttitle);
return false;
}

View File

@@ -7,60 +7,11 @@
display: none;
}
.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: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.a {
text-decoration: none;
color: #2140fb;
}
.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;
}
.machinetd {
white-space: nowrap;
text-overflow: ellipsis;
@@ -357,7 +308,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 src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("js/adj_odometer.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("js/adj_enginehours.js")%>"></script>
@@ -473,7 +423,7 @@
setTimeout(function () {
timelineLoaded = true;
OnRefresh();
},100);
}, 100);
});
$('#div_timeline').show();
}
@@ -688,11 +638,11 @@
GetAssetRental();
if (data.Description && data.Description !== "") {
data.Description = replaceHtmlText(data.Description);
$("#tddesc").html(data.Description);
//data.Description = replaceHtmlText(data.Description);
$("#tddesc").text(data.Description);
}
else
$("#tddesc").html("");
$("#tddesc").text("");
if ((IsSupperAdmin || isAllowed) && canAddReading() && canEditAsset) {
if (data.OnRoad) {
@@ -991,7 +941,7 @@
function GetAssetExtInfo(rentaldata) {
showloading(true);
assetrequest("GetAssetExtInfo", contractorid + String.fromCharCode(170) + assetid, function (data) {
assetrequest("GetAssetExtInfo", contractorid + String.fromCharCode(170) + assetid + String.fromCharCode(170) + "", function (data) {
showloading(false);
if (typeof (data) === "string") {
return;
@@ -1320,20 +1270,14 @@
if (j === "AlertLocalTime")
r[j] = { DisplayValue: r["AlertLocalTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_alertsdt.setData(rows);
}
function InitAlertsGridData() {
grid_alertsdt = new GridView('#divalerts');
grid_alertsdt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_alertsdt = createGridView('#divalerts');
var list_columns = [
{ name: 'AlertLocalDateStr', caption: GetTextByKey("P_MV_DATE", "Date"), valueIndex: 'AlertLocalDateStr', css: { 'width': 70, 'text-align': 'left' } },
{ name: 'AlertLocalTimeStr', caption: GetTextByKey("P_MV_TIME", "Time"), valueIndex: 'AlertLocalTimeStr', css: { 'width': 75, 'text-align': 'left' } },
@@ -1357,12 +1301,6 @@
grid_alertsdt.canMultiSelect = false;
grid_alertsdt.columns = columns;
grid_alertsdt.init();
grid_alertsdt.selectedrowchanged = function (rowindex) {
var rowdata = grid_alertsdt.source[rowindex];
if (rowdata) {
}
}
}
var grid_assetstatusdt;
@@ -1374,20 +1312,14 @@
if (j === "EventLocalTime")
r[j] = { DisplayValue: r["EventLocalTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_assetstatusdt.setData(rows);
}
function InitAssetStatusGridData() {
grid_assetstatusdt = new GridView('#divassetstatus');
grid_assetstatusdt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_assetstatusdt = createGridView('#divassetstatus');
var list_columns = [
{ name: 'EventLocalTime', caption: GetTextByKey("P_MV_DATE", "Date"), valueIndex: 'EventLocalTime', css: { 'width': 100, 'text-align': 'left' } },
{ name: 'AttributeName', caption: GetTextByKey("P_MV_READING", "Reading"), valueIndex: 'AttributeName', css: { 'width': 120, 'text-align': 'left' } },
@@ -1410,12 +1342,6 @@
grid_assetstatusdt.canMultiSelect = false;
grid_assetstatusdt.columns = columns;
grid_assetstatusdt.init();
grid_assetstatusdt.selectedrowchanged = function (rowindex) {
var rowdata = grid_assetstatusdt.source[rowindex];
if (rowdata) {
}
}
}
@@ -1428,20 +1354,14 @@
if (j === "AlertLocalTime")
r[j] = { DisplayValue: r["AlertLocalTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_utilizationdt.setData(rows);
}
function InitUtilizationGridData() {
grid_utilizationdt = new GridView('#divutilization');
grid_utilizationdt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_utilizationdt = createGridView('#divutilization');
var list_columns = [
{ name: 'AlertLocalTime', caption: "", valueIndex: 'AlertLocalTime', css: { 'width': 70, 'text-align': 'left' } },
{ name: 'TotalHours', caption: GetTextByKey("P_MV_TOTALHOURS", "Total Hours"), TotalHours: 'Level', css: { 'width': 80, 'text-align': 'left' } },
@@ -1466,12 +1386,6 @@
grid_utilizationdt.canMultiSelect = false;
grid_utilizationdt.columns = columns;
grid_utilizationdt.init();
grid_utilizationdt.selectedrowchanged = function (rowindex) {
var rowdata = grid_utilizationdt.source[rowindex];
if (rowdata) {
}
}
}
function getNowFormatDate() {
@@ -1571,9 +1485,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="clear"></div>
<div id="divcontent" style="overflow: auto; font-size: 13px;">
@@ -1605,9 +1516,9 @@
<label>{{asset.TypeName}}</label>
<br />
<b class="assetlable" data-lgid="P_MV_MAKE_COLON">Make:</b>
<b>{{asset.MakeName}}</b>
<label>{{asset.MakeName}}</label>
<b class="assetlable" data-lgid="P_MV_MODEL_COLON">Model:</b>
<b>{{asset.ModelName}}</b>
<label>{{asset.ModelName}}</label>
<br />
<label data-lgid="P_MV_VINSN_COLON">VIN/SN:</label>
<label>{{asset.VIN}}</label>
@@ -1716,6 +1627,9 @@
<div id="div_wsp" class="div-wsp">
<iframe id="ifwsp" class="iframe-wsp"></iframe>
</div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div class="dialog" id="dialog_addodometer" style="display: none; width: 600px;">
<div id="addodomask" class="maskbg" style="display: none; z-index: 1;"></div>
@@ -1723,7 +1637,7 @@
<div class="dialog-content adjust-content">
<table style="line-height: 25px; width: 100%;">
<tr>
<td class="label" title="Odometer at time of reading" data-titlt-lgid="P_MV_ODOMETERATTIMEOFREADING" data-lgid="P_MV_ODOMETER_COLON">Odometer:</td>
<td class="label" title="Odometer at time of reading" data-title-lgid="P_MV_ODOMETERATTIMEOFREADING" data-lgid="P_MV_ODOMETER_COLON">Odometer:</td>
<td>
<input type="text" id="dialogadd_odometer" maxlength="8" tabindex="151" /></td>
</tr>
@@ -1736,17 +1650,17 @@
</select></td>
</tr>
<tr>
<td class="label" title="Time zone of asset reading" data-titlt-lgid="P_MV_TIMEZONEOFASSETREADING" data-lgid="P_MV_TIMEZON_COLON">Time Zone:</td>
<td class="label" title="Time zone of asset reading" data-title-lgid="P_MV_TIMEZONEOFASSETREADING" data-lgid="P_MV_TIMEZON_COLON">Time Zone:</td>
<td>
<select id="dialogadd_odometertimezone" tabindex="153" /></td>
</tr>
<tr>
<td class="label" title="Date of reading" data-titlt-lgid="P_MV_DATEOFREADING" data-lgid="P_MV_ODOMETERDATE_COLON">Odometer Date:</td>
<td class="label" title="Date of reading" data-title-lgid="P_MV_DATEOFREADING" data-lgid="P_MV_ODOMETERDATE_COLON">Odometer Date:</td>
<td>
<input type="text" id="dialogadd_odometerdate" maxlength="8" tabindex="154" /></td>
</tr>
<tr>
<td class="label" title="Time of reading (military)" data-titlt-lgid="P_MV_TIMEOFREADINGMILITARY" data-lgid="P_MV_ODOMETERTIME_COLON">Odometer Time:</td>
<td class="label" title="Time of reading (military)" data-title-lgid="P_MV_TIMEOFREADINGMILITARY" data-lgid="P_MV_ODOMETERTIME_COLON">Odometer Time:</td>
<td>
<select id="dialogadd_timehour" style="width: 48px;" tabindex="155"></select><span style="font-weight: bold;">&nbsp;&nbsp;:&nbsp;&nbsp;</span>
<select id="dialogadd_timeminute" style="width: 48px;" tabindex="156"></select></td>
@@ -1776,17 +1690,17 @@
<input type="text" id="dialogaddgenginehours_enginehours" maxlength="8" tabindex="171" /></td>
</tr>
<tr>
<td class="label" title="Time zone of asset reading" data-titlt-lgid="P_MV_TIMEZONEOFASSETREADING" data-lgid="P_MV_TIMEZON_COLON">Time Zone:</td>
<td class="label" title="Time zone of asset reading" data-title-lgid="P_MV_TIMEZONEOFASSETREADING" data-lgid="P_MV_TIMEZON_COLON">Time Zone:</td>
<td>
<select id="dialogadd_enginehourstimezone" tabindex="172" /></td>
</tr>
<tr>
<td class="label" title="Date of reading" data-titlt-lgid="P_MV_DATEOFREADING" data-lgid="P_MV_ENGINEHOURSDATE_COLON">Engine Hours Date:</td>
<td class="label" title="Date of reading" data-title-lgid="P_MV_DATEOFREADING" data-lgid="P_MV_ENGINEHOURSDATE_COLON">Engine Hours Date:</td>
<td>
<input type="text" id="dialogaddenginehours_date" maxlength="8" tabindex="173" /></td>
</tr>
<tr>
<td class="label" title="Time of reading (military)" data-titlt-lgid="P_MV_TIMEOFREADINGMILITARY" data-lgid="P_MV_ENGINEHOURSTIME_COLON">Engine Hours Time:</td>
<td class="label" title="Time of reading (military)" data-title-lgid="P_MV_TIMEOFREADINGMILITARY" data-lgid="P_MV_ENGINEHOURSTIME_COLON">Engine Hours Time:</td>
<td>
<select id="dialogaddenginehours_timehour" style="width: 48px;" tabindex="174"></select><span style="font-weight: bold;">&nbsp;&nbsp;:&nbsp;&nbsp;</span>
<select id="dialogaddenginehours_timeminute" style="width: 48px;" tabindex="175"></select></td>
@@ -1806,7 +1720,7 @@
</div>
<div class="dialog" id="dialog_pmschedulelist" style="display: none; width: 640px;">
<div id="pmschedulelistmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div id="pmschedulelistmask" class="maskbg" style="display: none;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MV_EDITPLAN">Edit Plan</span><em class="dialog-close"></em></div>
<div class="dialog-content">
<div id="pmschedulelist" style="height: 300px;"></div>
@@ -1818,7 +1732,7 @@
</div>
</div>
<div class="dialog" id="dialog_pm" style="display: none; min-width: 540px; max-width: 720px; z-index: 2;">
<div class="dialog" id="dialog_pm" style="display: none; min-width: 540px; max-width: 720px;">
<div class="dialog-title"><span class="title" data-lgid="P_MV_ADDASSETTOSCHEDULE">Add Asset To Schedule</span><em class="dialog-close"></em></div>
<div class="dialog-content" style="line-height: 24px; padding-left: 20px; padding-right: 20px;">
</div>

View File

@@ -54,12 +54,7 @@ function showConfirmsub(msg, title, fok, fcancel) {
var pmschedules
var grid_pmschedules;
function InitPMGridData() {
grid_pmschedules = new GridView('#pmschedulelist');
grid_pmschedules.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_pmschedules = createGridView('#pmschedulelist');
var list_columns = [
{ 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' } },
@@ -87,7 +82,7 @@ function InitPMGridData() {
if (this.Selected) {
showSetPMDialog(this);
this.Selected = false;//弹出对话框并取消勾选因为此时机器并没有真正加入到计划在对话框OK刷新列表
grid_pmschedules.reload();
grid_pmschedules.reload(true);
}
else {
var item = this;
@@ -99,7 +94,7 @@ function InitPMGridData() {
removeAssetFromPMSchedule(item);
}, function () {
item.Selected = true;
grid_pmschedules.reload();
grid_pmschedules.reload(true);
});
}
}
@@ -140,8 +135,7 @@ function ShowPMSchedules() {
else
r.StartValue = r.StartDateString;
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_pmschedules.setData(rows);
}

View File

@@ -17,7 +17,7 @@
<link type="text/css" href="<%=Common.GenerateUrl("fic/css/JsTreeCss/style.min.css")%>" rel="stylesheet" />
<link type="text/css" href="<%=Common.GenerateUrl("fic/css/tabcontrol.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=Common.GenerateUrl("../css/override.css") %>" rel="stylesheet" />
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
<link rel="stylesheet" href="https://js.arcgis.com/3.44/esri/css/esri.css" />
<style type="text/css">
body {
/* 禁止选中 */
@@ -126,7 +126,7 @@
ApplicationPath = sitePath;
var isLocalForm = true;
</script>
<%--<script type="text/javascript" src="<%=Common.GenerateUrl("js/jquery-1.11.3.js") %>"></script>--%>
<script type="text/javascript" src="<%=Common.GenerateUrl("js/lib/vue.min.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("js/promise.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/components/modal.js")%>"></script>
@@ -134,108 +134,24 @@
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/dialog.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/additionalFilter.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/editGridCtrl.js") %>"></script>
<%--<script type="text/javascript" src="<%=GenerateUrl("fic/js/controls/changepassword.js") %>"></script>--%>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/workspace.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("js/echarts.min.js")%>"></script>
<%--<script type="text/javascript" src="//cdn.jsdelivr.net/npm/echarts@4.8.0/dist/echarts.js"></script>--%>
<script type="text/javascript" src="<%=Common.GenerateUrl("js/datepicker.min.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("js/lib/vue-color.min.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/components/gridview.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/about.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/menu.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/pivot.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/controls.js") %>"></script>
<%--<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/editGridCtrl.js") %>"></script>--%>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/components/datagrid.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/components/vue-ctrls.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/components/design-grid.min.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/form.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/wizardctrl.js") %>"></script>
<%-- 覆盖fic定义 --%>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/override.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/g5masterjs.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/wsp_pivot.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/board.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chart.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/gauge.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/scorecard.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/gridctrl.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/grid.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/graph.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/simplechart.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/favorites.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/charts/fifrs.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/controls/jstree.min.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/ShowBundler.min.js")%>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/ChartBundler.min.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/Management/ManagementBundler.min.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartTypeWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/selectChartType.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/selectChartSubType.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/DimWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/ListWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/Grid2DWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/Grid3DWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/RssWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/WebWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/MapViewWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/StockWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/VideoWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/FavoriteWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/AlertWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/Management/alertMessageWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/Graph2DWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/Graph3DWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/ColumnLineWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/PieWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/GaugeWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/ScatterPlotWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/FifrsWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/ScorecardWizard.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/commonOp.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/selectDTOption.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/chartFilter.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/BaseXYPivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/D1YPivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/D2XYPivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/D3XYPivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/PointSetXYPivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/xCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/zCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/parameterInitValueOption.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/shapeAndColorSetting.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/yCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/pivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/subctrls/webPivotCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/aggregatesCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/targetInputDataCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/chartNoteCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/chartInformationCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/setuprssurlCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/stockSymbolsCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/typeCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/setupFavoriteUrlCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/subscribetoAMessageCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/TargetRelation.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/SortByCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/gaugeInformationCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/drilldownselect.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/drilldownurl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/webSetup.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/drilldownchart.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/drilldownCell.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/frptSelectReportCtrl.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/frptSetPivot.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/freeReportSetCells.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/freeReportSetPivots.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/subctrls/targetMappingHeader.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/chartManage/chartWizardOptions/subctrls/cellDialog.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/Management/boardFilters.js") %>"></script>
<script type="text/javascript" src="<%=Common.GenerateUrl("fic/js/Management/workspaceFilters.js") %>"></script>
<script>
//必须放在地图js之前
@@ -248,7 +164,7 @@
cacheBust: true
};
</script>
<script src="https://js.arcgis.com/3.40"></script>
<script src="https://js.arcgis.com/3.44"></script>
<script src="<%=Common.GenerateUrl("fic/js/mapview/asset.js")%>"></script>
<script src="<%=Common.GenerateUrl("fic/js/mapview/maphelper.js")%>"></script>
<script src="<%=Common.GenerateUrl("fic/js/mapview/mapview.js")%>"></script>
@@ -256,6 +172,7 @@
<script type="text/javascript">
var LinkIcons = new Array();
var frsInstalled = false;
var GridView1 = window['lib-ui'].Grid;
_utility.rootPath = "<%=this.ResolveUrl("~/") %>";
_utility.loginedUser = {};
@@ -280,14 +197,16 @@
{ 'cmd': 'fixed_columns', 'class': '', 'text': GetLanguageByKey('FI_FRS_RD066', 'Fixed Columns') },
{ 'cmd': 'disp-reftime', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A005', 'Display Refresh Time'), 'checked': chart.displayRefreshTime },
{ 'cmd': 'reset_fixed_columns', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A027', 'Reset Fixed Columns') },
{ 'cmd': 'grid_reset_defaults', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A008', 'Reset Defaults') },
{ 'cmd': 'chart-note', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A006', 'Chart Notes') },
{ 'cmd': 'addfilter', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTCLIENT_A013', 'Additional Filtering') },
{ 'cmd': 'set_displaydataponits', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A030', 'Display Data Points') },
{ 'cmd': 'set_displayindividualvalues', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A029', 'Display Individual Values') },
{ 'cmd': 'set_yzero', 'class': 'seperator', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A013', 'Set Y axis to zero') },
{ 'cmd': 'print_chart', 'class': 'seperator', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A021', 'Print') },
//{ 'cmd': 'fullscreen', 'class': '', 'text': GetLanguageByKey('FULL_SCREEN', 'Full Screen') },
{ 'cmd': 'pinborder', 'class': 'seperator ' + pinclass, 'text': GetLanguageByKey('PIN_BORDER', 'Pin Border') },
{ 'cmd': 'adjust_column_width', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A012', 'Adjust column width'), 'checked': chart.chart && chart.chart.Adjustcolumnwidth },
{ 'cmd': 'grid_reset_defaults', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A008', 'Reset Defaults') },
{ 'cmd': 'export_Excel', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A009', 'Export to Excel') },
{ 'cmd': 'export_Xps', 'class': '', 'text': GetLanguageByKey('LHBIS_FIC_CHARTS_CHARTTITLE_A016', 'Export to XPS') },
{ 'cmd': 'export_Pdf', 'class': 'seperator', 'text': GetLanguageByKey('EXPORT_TO_PDF', 'Export to PDF') },
@@ -355,8 +274,10 @@
function initChartIcons() {
$(".chart_restore").hide();
$(".chart_close").show().click(function (e) {
if (typeof window.parent.hideChartContainer === "function")
window.parent.hideChartContainer();
if ($(e.target).parent().hasClass('chart_top')) {
if (typeof window.parent.hideChartContainer === "function")
window.parent.hideChartContainer();
}
});
favicon = $('<i class="chart_favorite fa" style="display: none"></i>');
favicon.click(function () {

View File

@@ -14,64 +14,6 @@
float: right;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
line-height: 38px;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
text-align: right;
padding-right: 10px;
line-height: 28px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 250px;
height: 18px;
padding: 1px;
}
.dialog-content table td textarea {
margin-top: 6px;
}
.dialog-content table td select {
width: 254px;
height: 24px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 150px;
width: 500px;
max-width: 500px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.table_holder {
border-collapse: collapse;
height: 400px;
@@ -265,20 +207,14 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
}
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#contactlist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#contactlist');
var list_columns = [
{ name: 'ContactName', caption: "Contact Name", valueIndex: 'ContactName', css: { 'width': 300, 'text-align': 'left' } },
{ name: 'ContactType', caption: "Contact Type", valueIndex: 'ContactType', css: { 'width': 150, 'text-align': 'left' } },
@@ -303,7 +239,6 @@
col.align = list_columns[hd].css["text-align"]
col.key = list_columns[hd].valueIndex;
if (col.name === "Edit") {
col.isurl = true;
col.text = "\uf044";
col.events = {
onclick: function () {
@@ -316,7 +251,6 @@
col.attrs = { 'title': 'Edit' };
}
else if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.events = {
onclick: function () {
@@ -329,7 +263,6 @@
col.attrs = { 'title': 'Delete' };
}
else if (col.name === "AssetAssignment") {
col.isurl = true;
col.text = "\uf63c";
col.events = {
onclick: function () {
@@ -342,7 +275,6 @@
col.attrs = { 'title': 'Asset Assignment' };
}
else if (col.name === "JobsiteAssignment") {
col.isurl = true;
col.text = "Jobsite Assignment";
col.events = {
onclick: function () {
@@ -359,9 +291,9 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = OnEdit;
grid_dt.onRowDblClicked = OnEdit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
contactid = rowdata.Values.ID;
@@ -559,8 +491,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtam.setData(rows);
@@ -568,12 +499,7 @@
var grid_dtam;
function InitGridAvailableMachines() {
grid_dtam = new GridView('#availablemachinelist');
grid_dtam.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtam = createGridView('#availablemachinelist');
var list_columns = [
{ name: 'VIN', caption: "SN", valueIndex: 'VIN', css: { 'width': 170, 'text-align': 'left' } },
{ name: 'DisplayName', caption: "Name", valueIndex: 'DisplayName', css: { 'width': 170, 'text-align': 'left' } },
@@ -593,10 +519,10 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtam.canMultiSelect = true;
grid_dtam.multiSelect = true;
grid_dtam.columns = columns;
grid_dtam.init();
grid_dtam.rowdblclick = function (rowindex) {
grid_dtam.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtam.source[rowindex];
if (rowdata) {
var machine = rowdata.Values;
@@ -607,21 +533,13 @@
showMachines();
}
};
grid_dtam.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtam.source[rowindex];
if (rowdata) {
}
}
}
function showSelectedMachine(data) {
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtsm.setData(rows);
@@ -629,12 +547,7 @@
var grid_dtsm;
function InitGridSelectedMachines() {
grid_dtsm = new GridView('#selectedmachinelist');
grid_dtsm.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtsm = createGridView('#selectedmachinelist');
var list_columns = [
{ name: 'VIN', caption: "SN", valueIndex: 'VIN', css: { 'width': 170, 'text-align': 'left' } },
{ name: 'DisplayName', caption: "Name", valueIndex: 'DisplayName', css: { 'width': 170, 'text-align': 'left' } },
@@ -654,10 +567,10 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtsm.canMultiSelect = true;
grid_dtsm.multiSelect = true;
grid_dtsm.columns = columns;
grid_dtsm.init();
grid_dtsm.rowdblclick = function (rowindex) {
grid_dtsm.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtsm.source[rowindex];
if (rowdata) {
var machine = rowdata.Values;
@@ -668,13 +581,8 @@
showMachines();
}
};
grid_dtsm.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtsm.source[rowindex];
if (rowdata) {
}
}
}
function OnEditorAdd() {
var indexs = grid_dtam.selectedIndexes;
if (indexs.length <= 0)
@@ -860,8 +768,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtaj.setData(rows);
@@ -871,8 +778,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtsj.setData(rows);
@@ -881,12 +787,7 @@
var grid_dtaj;
function InitGridAvailableJobsites() {
grid_dtaj = new GridView('#availablejobsitelist');
grid_dtaj.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtaj = createGridView('#availablejobsitelist');
var list_columns = [
{ name: 'Name', caption: "Name", valueIndex: 'Name', css: { 'width': 380, 'text-align': 'left' } }
];
@@ -903,10 +804,10 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtaj.canMultiSelect = true;
grid_dtaj.multiSelect = true;
grid_dtaj.columns = columns;
grid_dtaj.init();
grid_dtaj.rowdblclick = function (rowindex) {
grid_dtaj.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtaj.source[rowindex];
if (rowdata) {
var Jobsite = rowdata.Values;
@@ -917,23 +818,12 @@
showJobsites();
}
};
grid_dtaj.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtaj.source[rowindex];
if (rowdata) {
}
}
}
var grid_dtsj;
function InitGridSelectedJobsites() {
grid_dtsj = new GridView('#selectedjobsitelist');
grid_dtsj.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtsj = createGridView('#selectedjobsitelist');
var list_columns = [
{ name: 'Name', caption: "Name", valueIndex: 'Name', css: { 'width': 380, 'text-align': 'left' } }
];
@@ -950,10 +840,10 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtsj.canMultiSelect = true;
grid_dtsj.multiSelect = true;
grid_dtsj.columns = columns;
grid_dtsj.init();
grid_dtsj.rowdblclick = function (rowindex) {
grid_dtsj.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtsj.source[rowindex];
if (rowdata) {
var Jobsite = rowdata.Values;
@@ -964,12 +854,6 @@
showJobsites();
}
};
grid_dtsj.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtsj.source[rowindex];
if (rowdata) {
}
}
}
function OnJobsiteEditorAdd() {

View File

@@ -6,30 +6,27 @@
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<link type="text/css" href="<%=GetUrl("js/components/css/gridview.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetUrl("js/lib/ui.min.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetUrl("css/override.css") %>" rel="stylesheet" />
<link rel="stylesheet" href="<%=GetUrl("css/default.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetUrl("css/split_sub.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetUrl("css/editmultiselect.css")%>" type="text/css" />
<style type="text/css">
:root { <%=StyleVariables%> }
.data-grid {
height: 100%;
font-size: 12px !important;
font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important;
}
</style>
<script src="<%=GetUrl("js/jquery-3.6.0.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/cookie.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetUrl("js/components/gridview.js") %>"></script>
<script src="<%=GetUrl("js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/language.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/lib/utility.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/lib/ui.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/language.js")%>" type="text/javascript"></script>
<script type="text/javascript">
var GridView = window.GridView || window['g5-gridview'];
var GridView = window['lib-ui'].Grid;
_network.root = '<%=Page.ResolveUrl("~/")%>';
consts = {
path: _network.root
};
var sitePath = "<%=this.ResolveUrl("~/fic/") %>";
if (typeof _utility !== 'object') {

View File

@@ -1,58 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Credentials/Credentials.master" AutoEventWireup="true" CodeFile="ManageAPICredential.aspx.cs" Inherits="ManageAPICredential" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td {
padding-top: 30px;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
</style>
<script type="text/javascript">
var credentialType = "AEMP";
var credentialList;
@@ -80,6 +28,7 @@
$('#tr_enabled').hide();
creid = undefined;
$('#dialog_apiname').val('').removeAttr("disabled");
$('#dialog_description').val('');
$('#dialog_username').val('');
$('#dialog_password').val('');
$('#dialog_apikey').val('');
@@ -101,7 +50,7 @@
var creid;
function OnEdit() {
var cre = grid_dt.source[grid_dt.selectedIndex].Values;
var cre = grid_dt.source[grid_dt.selectedIndex];
if (!cre) {
creid = undefined;
return;
@@ -110,7 +59,12 @@
$('#tr_enabled').show();
creid = cre.ID;
$('#dialog_apiname').val(cre.ApiDefinitionId).attr("disabled", "disabled");
//$('#td_description').show();
//$('#tr_description').show();
$('#dialog_description').val(cre.Description);
var lines = 0;
if (cre.HasUserName) {
lines++;
$('#tr_username').show();
$('#dialog_username').val(cre.UserName);
}
@@ -120,6 +74,7 @@
}
if (cre.HasPassword) {
lines++;
$('#tr_password').show();
$('#dialog_password').val(cre.Password);
}
@@ -129,6 +84,7 @@
}
if (cre.HasApiKey) {
lines++;
$('#tr_apikey').show();
$('#dialog_apikey').val(cre.ApiKey);
}
@@ -138,6 +94,7 @@
}
if (cre.HasApiSecret) {
lines++;
$('#tr_apisecret').show();
$('#dialog_apisecret').val(cre.ApiSecret);
}
@@ -147,6 +104,7 @@
}
if (cre.HasApiToken) {
lines++;
$('#tr_apitoken').show();
$('#dialog_apitoken').val(cre.ApiToken);
}
@@ -156,6 +114,7 @@
}
if (cre.HasApiTokenSecret) {
lines++;
$('#tr_apitokensecret').show();
$('#dialog_apitokensecret').val(cre.ApiTokenSecret);
}
@@ -164,6 +123,7 @@
$('#dialog_apitokensecret').val('');
}
$('#dialog_description').css('height', lines * 55 - 4);
$('#dialog_enabled').attr("checked", cre.IsEnabled);
$('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_APICRE_EDITMANUFACTURE", 'Edit Credential'));
showmaskbg(true);
@@ -216,8 +176,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -227,16 +186,11 @@
function InitGridData() {
$('#btnEdit').attr("disabled", "disabled");
grid_dt = new GridView('#credentiallist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#credentiallist');
var list_columns = [
{ name: 'ApiName', caption: GetTextByKey("P_APICRE_APINAME", "API Name"), valueIndex: 'ApiName', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UserName', caption: GetTextByKey("P_APICRE_USERNAME", "User Name"), valueIndex: 'UserName', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'IsEnabled', caption: GetTextByKey("P_APICRE_ENABLED", "Enabled"), valueIndex: 'IsEnabled', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'ApiName', caption: GetTextByKey("P_APICRE_APINAME", "API Name"), valueIndex: 'ApiName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UserName', caption: GetTextByKey("P_APICRE_USERNAME", "User Name"), valueIndex: 'UserName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'IsEnabled', caption: GetTextByKey("P_APICRE_ENABLED", "Enabled"), valueIndex: 'IsEnabled', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
];
@@ -251,9 +205,13 @@
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 (col.name === "Edit") {
col.isurl = true;
col.text = "\uf044";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnEdit();
@@ -265,8 +223,11 @@
col.attrs = { 'title': GetTextByKey("P_APICRE_EDIT", 'Edit') };
}
else if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDelete(this);
@@ -282,12 +243,12 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = OnEdit;
grid_dt.onRowDblClicked = OnEdit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
creid = rowdata.Values.ID;
creid = rowdata.ID;
}
}
}
@@ -296,6 +257,7 @@
var item = {
'ApiDefinitionId': $('#dialog_apiname').val(),
'ApiName': $("#dialog_apiname").find("option:selected").text(),
'Description': encodeURIComponent($('#dialog_description').val()),
'UserName': $('#dialog_username').val().replace(/(^\s*)|(\s*$)/g, ''),
'Password': $('#dialog_password').val(),
'ApiKey': $('#dialog_apikey').val().replace(/(^\s*)|(\s*$)/g, ''),
@@ -337,12 +299,15 @@
}
function setInput(dic) {
//$('#td_description').hide();
//$('#tr_description').hide();
$('#tr_username').hide();
$('#tr_password').hide();
$('#tr_apikey').hide();
$('#tr_apitoken').hide();
$('#tr_apisecret').hide();
$('#tr_apitokensecret').hide();
$('#dialog_description').val('');
$('#dialog_username').val('');
$('#dialog_password').val('');
$('#dialog_apikey').val('');
@@ -350,24 +315,34 @@
$('#dialog_apitoken').val('');
$('#dialog_apitokensecret').val('');
if (dic) {
var lines = 0;
//$('#td_description').show();
//$('#tr_description').show();
if (dic.ApiUsername) {
lines++;
$('#tr_username').show();
}
if (dic.ApiPassword) {
lines++;
$('#tr_password').show();
}
if (dic.ApiKey) {
lines++;
$('#tr_apikey').show();
}
if (dic.ApiSecret) {
lines++;
$('#tr_apisecret').show();
}
if (dic.ApiToken) {
lines++;
$('#tr_apitoken').show();
}
if (dic.ApiTokenSecret) {
lines++;
$('#tr_apitokensecret').show();
}
$('#dialog_description').css('height', lines * 55 - 4);
}
}
@@ -407,7 +382,7 @@
<div id="mask_bg">
<div class="loading c-spin"></div>
</div>
<div class="dialog" id="dialog_credential" style="display: none; width: 500px;">
<div class="dialog" id="dialog_credential" style="display: none; width: 460px;">
<div class="dialog-title"><span class="title" data-lgid="P_APICRE_ADDMANUFACTURE">Add Credential</span><em class="dialog-close"></em></div>
<div class="dialog-content" style="padding-left: 50px;">
<table>
@@ -416,6 +391,13 @@
<td>
<select id="dialog_apiname" tabindex="1" style="width: 200px;">
</select></td>
<td id="td_description" class="label" data-lgid="P_MA_DESCRIPTION_COLON" style="display: none; text-align: left; width: 400px">Description:</td>
</tr>
<tr id="tr_description" style="display: none">
<td colspan="2" style="padding-top: 0"></td>
<td rowspan="7" style="vertical-align: top; padding-top: 0">
<textarea id="dialog_description" style="max-width: 100%; width: 380px; box-sizing: border-box"></textarea>
</td>
</tr>
<tr id="tr_username" class="tr_aicredential" style="display: none;">
<td class="label" data-lgid="P_APICRE_USERNAME_COLON">User Name:</td>

View File

@@ -1,56 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Credentials/Credentials.master" AutoEventWireup="true" CodeFile="ManageCredential.aspx.cs" Inherits="ManageCredential" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td input[type="text"],
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
width: unset;
}
.dialog-content table td textarea {
height: 100px;
max-width: 320px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
</style>
<script type="text/javascript">
var credentialType = "AEMP";
var credentialList;
@@ -79,7 +29,7 @@
$('#dialog_urlkey').val('');
$('#dialog_username').val('');
$('#dialog_password').val('');
$('#dialog_enabled').attr('checked', 'checked');
$('#dialog_enabled').prop('checked', true);
$('#dialog_orgid').val('');
$('#dialog_notes').val('');
$('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_CRE_ADDMANUFACTURE", 'Add Credential'));
@@ -96,7 +46,7 @@
var creid;
function OnEdit() {
var cre = grid_dt.source[grid_dt.selectedIndex].Values;
var cre = grid_dt.source[grid_dt.selectedIndex];
if (!cre) {
creid = undefined;
return;
@@ -107,7 +57,7 @@
$('#dialog_urlkey').val(cre.UrlKey);
$('#dialog_username').val(cre.UserName);
$('#dialog_password').val(cre.Password);
$('#dialog_enabled').attr("checked", cre.Enabled);
$('#dialog_enabled').prop("checked", cre.Enabled.Value);
$('#dialog_orgid').val(cre.OrgnizationID);
$('#dialog_notes').val(cre.Notes);
$('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_CRE_EDITMANUFACTURE", 'Edit Credential'));
@@ -142,8 +92,12 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
for (var j in r) {
if (j === "Enabled") {
r[j] = { DisplayValue: r["Enabled"] ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
rows.push(r);
}
grid_dt.setData(rows);
@@ -153,17 +107,12 @@
function InitGridData() {
$('#btnEdit').attr("disabled", "disabled");
grid_dt = new GridView('#credentiallist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#credentiallist');
var list_columns = [
{ name: 'ManufactureID', caption: GetTextByKey("P_CRE_MANUFACTURE", "Manufacture"), valueIndex: 'ManufactureID', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UrlKey', caption: GetTextByKey("P_CRE_URLKEY", "Url Key"), valueIndex: 'UrlKey', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UserName', caption: GetTextByKey("P_CRE_USERNAME", "User Name"), valueIndex: 'UserName', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Enabled', caption: GetTextByKey("P_CRE_ENABLED", "Enabled"), valueIndex: 'Enabled', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'ManufactureID', caption: GetTextByKey("P_CRE_MANUFACTURE", "Manufacture"), valueIndex: 'ManufactureID', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UrlKey', caption: GetTextByKey("P_CRE_URLKEY", "Url Key"), valueIndex: 'UrlKey', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UserName', caption: GetTextByKey("P_CRE_USERNAME", "User Name"), valueIndex: 'UserName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Enabled', caption: GetTextByKey("P_CRE_ENABLED", "Enabled"), valueIndex: 'Enabled', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Notes', caption: GetTextByKey("P_CRE_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
@@ -179,30 +128,32 @@
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 (col.name === "Edit") {
col.isurl = true;
col.text = "\uf044";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnEdit();
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_CRE_EDIT", 'Edit') };
}
else if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_CRE_DELETE", 'Delete') };
}
columns.push(col);
@@ -210,12 +161,12 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = OnEdit;
grid_dt.onRowDblClicked = OnEdit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
creid = rowdata.Values.ID;
creid = rowdata.ID;
}
}
}
@@ -226,7 +177,7 @@
'UrlKey': $('#dialog_urlkey').val().replace(/(^\s*)|(\s*$)/g, ''),
'UserName': $('#dialog_username').val().replace(/(^\s*)|(\s*$)/g, ''),
'Password': $('#dialog_password').val(),
'Enabled': $('#dialog_enabled').attr("checked") == "checked",
'Enabled': $('#dialog_enabled').prop("checked"),
'OrgnizationID': $('#dialog_orgid').val(),
'CredentialType': credentialType,
'Notes': $('#dialog_notes').val()

View File

@@ -1,58 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Credentials/Credentials.master" AutoEventWireup="true" CodeFile="ManageJDLink.aspx.cs" Inherits="ManageJDLink" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td {
padding-top: 30px;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
</style>
<script type="text/javascript">
credentialquery = function (method, param, callback, error, nolog) {
@@ -97,9 +45,7 @@
if (j === "RequestTime")
r[j] = { DisplayValue: r["RequestTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -107,17 +53,12 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#jdlinklist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#jdlinklist');
var list_columns = [
{ name: 'AccountName', caption: GetTextByKey("P_JDL_ACCOUNTNAME", "Account Name"), valueIndex: 'AccountName', css: { 'width': 400, 'text-align': 'left' } },
{ name: 'AccountName', caption: GetTextByKey("P_JDL_ACCOUNTNAME", "Account Name"), valueIndex: 'AccountName', allowFilter: true, css: { 'width': 400, 'text-align': 'left' } },
{ name: 'RequestTime', caption: GetTextByKey("P_JDL_REQUESTTIME", "Request Time"), valueIndex: 'RequestTime', css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Organization', caption: "", css: { 'width': 110, 'text-align': 'center' } },
{ name: 'ManageOrganization', caption: "", css: { 'width': 120, 'text-align': 'center' } },
{ name: 'Organization', valueIndex: 'Organization', caption: "", css: { 'width': 110, 'text-align': 'center' } },
{ name: 'ManageOrganization', valueIndex: 'ManageOrganization', caption: "", css: { 'width': 140, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
];
var columns = [];
@@ -131,59 +72,51 @@
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 (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': getText("P_JDL_DELETE", 'Delete') };
col.attrs = { 'title': GetTextByKey("P_JDL_DELETE", 'Delete') };
}
else if (col.name === "Organization") {
col.isurl = true;
col.text = GetTextByKey("P_SET_XXX", "My Organizations");
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Common;
col.styleFilter = function () { return { 'color': 'blue', "cursor": "pointer" } };
col.filter = function () { return GetTextByKey("P_JDL_MYORGANIZATIONS", "My Organizations"); };
col.events = {
onclick: function () {
openMyOrganizationsDialog(this, 0);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_SET_XXX", "My Organizations") };
col.attrs = { 'title': GetTextByKey("P_JDL_MYORGANIZATIONS", "My Organizations") };
}
else if (col.name === "ManageOrganization") {
col.isurl = true;
col.text = GetTextByKey("P_SET_XXX", "Manage Organizations");
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Common;
col.styleFilter = function () { return { 'color': 'blue', "cursor": "pointer" } };
col.filter = function () { return GetTextByKey("P_JDL_MANAGEORGANIZATIONS", "Manage Organizations"); };
col.events = {
onclick: function () {
GetJDOrganizationUrl(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_SET_XXX", "Manage Organizations") };
col.attrs = { 'title': GetTextByKey("P_JDL_MANAGEORGANIZATIONS", "Manage Organizations") };
}
columns.push(col);
}
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
creid = rowdata.Values.ID;
}
}
}
function OnDelete(cr) {
@@ -243,8 +176,7 @@
r[j] = { DisplayValue: r["RequestTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtmyjd.setData(rows);
@@ -252,17 +184,12 @@
var grid_dtmyjd;
function InitGridMyJDData() {
grid_dtmyjd = new GridView('#myjdlist');
grid_dtmyjd.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtmyjd = createGridView('#myjdlist');
var list_columns = [
{ name: 'AccountName', caption: GetTextByKey("P_JDL_ACCOUNTNAME", "Account Name"), valueIndex: 'AccountName', css: { 'width': 400, 'text-align': 'left' } },
{ name: 'AccountName', caption: GetTextByKey("P_JDL_ACCOUNTNAME", "Account Name"), valueIndex: 'AccountName', allowFilter: true, css: { 'width': 400, 'text-align': 'left' } },
{ name: 'RequestTime', caption: GetTextByKey("P_JDL_REQUESTTIME", "Request Time"), valueIndex: 'RequestTime', css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Organization', caption: "", css: { 'width': 110, 'text-align': 'center' } },
{ name: 'ManageOrganization', caption: "", css: { 'width': 120, 'text-align': 'center' } },
{ name: 'Organization', valueIndex: 'Organization', caption: "", css: { 'width': 110, 'text-align': 'center' } },
{ name: 'ManageOrganization', valueIndex: 'ManageOrganization', caption: "", css: { 'width': 140, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
];
var columns = [];
@@ -276,9 +203,13 @@
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 (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
DeleteMyJDToken(this);
@@ -290,45 +221,36 @@
col.attrs = { 'title': getText("P_JDL_DELETE", 'Delete') };
}
else if (col.name === "Organization") {
col.isurl = true;
col.text = GetTextByKey("P_SET_XXX", "My Organizations");
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Common;
col.styleFilter = function () { return { 'color': 'blue', "cursor": "pointer" } };
col.filter = function () { return GetTextByKey("P_JDL_MYORGANIZATIONS", "My Organizations"); };
col.events = {
onclick: function () {
openMyOrganizationsDialog(this, 1);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_SET_XXX", "My Organizations") };
col.attrs = { 'title': GetTextByKey("P_JDL_MYORGANIZATIONS", "My Organizations") };
}
else if (col.name === "ManageOrganization") {
col.isurl = true;
col.text = GetTextByKey("P_SET_XXX", "Manage Organizations");
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Common;
col.styleFilter = function () { return { 'color': 'blue', "cursor": "pointer" } };
col.filter = function () { return GetTextByKey("P_JDL_MANAGEORGANIZATIONS", "Manage Organizations"); };
col.events = {
onclick: function () {
GetJDOrganizationUrl(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_SET_XXX", "Manage Organizations") };
col.attrs = { 'title': GetTextByKey("P_JDL_MANAGEORGANIZATIONS", "Manage Organizations") };
}
columns.push(col);
}
grid_dtmyjd.canMultiSelect = false;
grid_dtmyjd.columns = columns;
grid_dtmyjd.init();
grid_dtmyjd.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtmyjd.source[rowindex];
if (rowdata) {
creid = rowdata.Values.ID;
}
}
}
function DeleteMyJDToken(cr) {
@@ -404,8 +326,7 @@
r[j] = { DisplayValue: r["CreateTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtnotification.setData(rows);
@@ -413,15 +334,10 @@
var grid_dtnotification;
function InitGridNotificationData() {
grid_dtnotification = new GridView('#jdnotificationlist');
grid_dtnotification.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtnotification = createGridView('#jdnotificationlist');
var list_columns = [
{ name: 'DisplayName', caption: GetTextByKey("P_JDN_DISPLAYAME", "Display Name"), valueIndex: 'DisplayName', css: { 'width': 400, 'text-align': 'left' } },
{ name: 'AccountName', caption: GetTextByKey("P_JDL_USERNAME", "User Name"), valueIndex: 'AccountName', css: { 'width': 400, 'text-align': 'left' } },
{ name: 'DisplayName', caption: GetTextByKey("P_JDN_DISPLAYAME", "Display Name"), valueIndex: 'DisplayName', allowFilter: true, css: { 'width': 400, 'text-align': 'left' } },
{ name: 'AccountName', caption: GetTextByKey("P_JDL_USERNAME", "User Name"), valueIndex: 'AccountName', allowFilter: true, css: { 'width': 400, 'text-align': 'left' } },
{ name: 'CreateTime', caption: GetTextByKey("P_JDL_SUBSCRIPTIONNDATE", "Subscription Date"), valueIndex: 'CreateTime', css: { 'width': 150, 'text-align': 'left' } },
//{ name: 'Organization', caption: "", css: { 'width': 110, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
@@ -437,9 +353,13 @@
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 (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDeleteNotification(this);
@@ -451,8 +371,7 @@
col.attrs = { 'title': getText("P_JDL_DELETE", 'Delete') };
}
else if (col.name === "Organization") {
col.isurl = true;
col.text = GetTextByKey("P_SET_XXX", "My Organizations");
col.text = GetTextByKey("P_JDL_MYORGANIZATIONS", "My Organizations");
col.sortable = false;
col.events = {
onclick: function () {
@@ -462,19 +381,13 @@
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_SET_XXX", "My Organizations") };
col.attrs = { 'title': GetTextByKey("P_JDL_MYORGANIZATIONS", "My Organizations") };
}
columns.push(col);
}
grid_dtnotification.canMultiSelect = false;
grid_dtnotification.columns = columns;
grid_dtnotification.init();
grid_dtnotification.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtnotification.source[rowindex];
if (rowdata) {
}
}
}
function OnDeleteNotification(cr) {
@@ -552,9 +465,7 @@
if (j === "Member")
r[j] = { DisplayValue: r["Member"] ? "Yes" : "", Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtmyorgs.setData(rows);
@@ -562,17 +473,12 @@
var grid_dtmyorgs;
function InitGridMyOrgData() {
grid_dtmyorgs = new GridView('#myorganization_list');
grid_dtmyorgs.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtmyorgs = createGridView('#myorganization_list');
var list_columns = [
{ name: 'Id', caption: GetTextByKey("P_JDN_XXX", "Id"), valueIndex: 'Id', css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_JDL_XXX", "Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } },
{ name: 'OrgType', caption: GetTextByKey("P_JDL_XXX", "Type"), valueIndex: 'OrgType', css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Member', caption: GetTextByKey("P_JDL_XXX", "Member"), valueIndex: 'Member', css: { 'width': 100, 'text-align': 'left' } }
{ name: 'Id', caption: GetTextByKey("P_JDL_ID", "Id"), valueIndex: 'Id', css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_JDL_NAME", "Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } },
{ name: 'OrgType', caption: GetTextByKey("P_JDL_TYPE", "Type"), valueIndex: 'OrgType', css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Member', caption: GetTextByKey("P_JDL_MEMBER", "Member"), valueIndex: 'Member', css: { 'width': 100, 'text-align': 'left' } }
];
var columns = [];
// head
@@ -590,12 +496,6 @@
grid_dtmyorgs.canMultiSelect = false;
grid_dtmyorgs.columns = columns;
grid_dtmyorgs.init();
grid_dtmyorgs.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtmyorgs.source[rowindex];
if (rowdata) {
}
}
}
//**************************************End My Organizations***************************************************//
@@ -696,7 +596,7 @@
<div class="loading c-spin"></div>
</div>
<div class="dialog" id="dialog_myorganization" style="display: none; width: 800px;">
<div class="dialog-title"><span class="title" data-lgid="P_JDN_XXX">My Organizations</span><em class="dialog-close"></em></div>
<div class="dialog-title"><span class="title" data-lgid="P_JDL_MYORGANIZATIONS">My Organizations</span><em class="dialog-close"></em></div>
<div class="dialog-content">
<div id="myorganization_list"></div>
</div>

View File

@@ -1,58 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Credentials/Credentials.master" AutoEventWireup="true" CodeFile="ManageJDNotifications.aspx.cs" Inherits="ManageJDNotifications" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td {
padding-top: 30px;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
</style>
<script type="text/javascript">
var credentialList;
var authdata = undefined;
@@ -101,9 +49,7 @@
if (j === "ExpireDate")
r[j] = { DisplayValue: r["ExpireDateStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -111,12 +57,7 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#jdlinklist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#jdlinklist');
var list_columns = [
{ name: 'UserName', caption: GetTextByKey("P_JDN_USERNAME", "User Name"), valueIndex: 'UserName', css: { 'width': 400, 'text-align': 'left' } },
{ name: 'DisplayName', caption: GetTextByKey("P_JDN_DISPLAYAME", "Display Name"), valueIndex: 'DisplayName', css: { 'width': 400, 'text-align': 'left' } },
@@ -135,8 +76,11 @@
col.align = list_columns[hd].css["text-align"]
col.key = list_columns[hd].valueIndex;
if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDelete(this);
@@ -153,7 +97,7 @@
grid_dt.columns = columns;
grid_dt.init();
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
creid = rowdata.Values.ID;

View File

@@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -40,11 +41,17 @@ public partial class ExportToFile : ContractorBasePage
case "assetsexcel":
buffer = ExportAssetErrorList(ref title);
break;
case "alertmappingexcel":
buffer = ExportAlertMappingErrorList(ref title);
break;
default:
buffer = Export(type, ref title, ref fileType);
break;
}
}
catch (ThreadAbortException ex)
{//SetExportParams Response.End();
}
catch (Exception ex)
{
SystemParams.WriteLog("error", "ExportToFile", ex.Message, ex.ToString());
@@ -80,7 +87,8 @@ public partial class ExportToFile : ContractorBasePage
private byte[] ExportDeviceErrorList(ref string title)
{
string key = Request.Params["key"];
title = "Import Devices Error List";
string lang = GetLanguageCookie();
title = SystemParams.GetTextByKey(lang, "P_MD_IMPORTDEVICESERRORLIST", "Import Devices Error List");
string p = ExportExcelManager.GetExportParams(key);
if (string.IsNullOrEmpty(p))
return null;
@@ -88,31 +96,30 @@ public partial class ExportToFile : ContractorBasePage
DeviceItem[] ds = JsonConvert.DeserializeObject<DeviceItem[]>(p);
IronIntel.Contractor.Users.UserInfo u = GetCurrentUser();
string lang = GetLanguageCookie();
ExportToExcel ete = new ExportToExcel();
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_SOURCE", "Source"), Caption = "SourceName" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_SN", "Air ID or SN"), Caption = "SerialNumber" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_ESN", "ESN"), Caption = "AlternativeSerialNumber" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_DEVICETYPE", "Device Type"), Caption = "DeviceType" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_STATUS", "Status"), Caption = "Status" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_INVOICEDATE", "Invoice Date"), Caption = "InvoiceDate" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_INVOICENUMBER", "Invoice #"), Caption = "InvoiceNumber" });
dt.Columns.Add(new DataColumn() { ColumnName = "SourceName", Caption = SystemParams.GetTextByKey(lang, "P_MD_SOURCE", "Source") });
dt.Columns.Add(new DataColumn() { ColumnName = "SerialNumber", Caption = SystemParams.GetTextByKey(lang, "P_MD_SN", "Air ID or SN") });
dt.Columns.Add(new DataColumn() { ColumnName = "AlternativeSerialNumber", Caption = SystemParams.GetTextByKey(lang, "P_MD_ESN", "ESN") });
dt.Columns.Add(new DataColumn() { ColumnName = "DeviceType", Caption = SystemParams.GetTextByKey(lang, "P_MD_DEVICETYPE", "Device Type") });
dt.Columns.Add(new DataColumn() { ColumnName = "Status", Caption = SystemParams.GetTextByKey(lang, "P_MD_STATUS", "Status") });
dt.Columns.Add(new DataColumn() { ColumnName = "InvoiceDate", Caption = SystemParams.GetTextByKey(lang, "P_MD_INVOICEDATE", "Invoice Date") });
dt.Columns.Add(new DataColumn() { ColumnName = "InvoiceNumber", Caption = SystemParams.GetTextByKey(lang, "P_MD_INVOICENUMBER", "Invoice #") });
if (u.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin)
{
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_XXXXXX", "Sales Order #"), Caption = "SalesOrderNumber" });
dt.Columns.Add(new DataColumn() { ColumnName = "SalesOrderNumber", Caption = SystemParams.GetTextByKey(lang, "P_MD_SALESORDER", "Sales Order #") });
}
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_SERVICESTATDATE", "Service Start Date"), Caption = "ServiceStartDate" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_ASSETVINSN", "Asset VIN/SN"), Caption = "VIN" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_TAMPERALERTS", "Tamper Alerts"), Caption = "TamperAlerts" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_UTILIZATION", "Utilization"), Caption = "Utilization" });
dt.Columns.Add(new DataColumn() { ColumnName = "ServiceStartDate", Caption = SystemParams.GetTextByKey(lang, "P_MD_SERVICESTATDATE", "Service Start Date") });
dt.Columns.Add(new DataColumn() { ColumnName = "VIN", Caption = SystemParams.GetTextByKey(lang, "P_MD_ASSETVINSN", "Asset VIN/SN") });
dt.Columns.Add(new DataColumn() { ColumnName = "Tamper", Caption = SystemParams.GetTextByKey(lang, "P_MD_TAMPERALERTS", "Tamper Alerts") });
dt.Columns.Add(new DataColumn() { ColumnName = "Utilization", Caption = SystemParams.GetTextByKey(lang, "P_MD_UTILIZATION", "Utilization") });
if (u.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin)
{
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_FIINSTALLATION", "FI Install"), Caption = "FIInstalltion" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_INSTALLER", "Installer"), Caption = "Installer" });
dt.Columns.Add(new DataColumn() { ColumnName = "FIInstalltion", Caption = SystemParams.GetTextByKey(lang, "P_MD_FIINSTALLATION", "FI Install") });
dt.Columns.Add(new DataColumn() { ColumnName = "Installer", Caption = SystemParams.GetTextByKey(lang, "P_MD_INSTALLER", "Installer") });
}
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MD_NOTES", "Notes"), Caption = "Notes" });
dt.Columns.Add(new DataColumn() { ColumnName = "Notes", Caption = SystemParams.GetTextByKey(lang, "P_MD_NOTES", "Notes") });
if (ds != null && ds.Length > 0)
{
@@ -124,7 +131,7 @@ public partial class ExportToFile : ContractorBasePage
dr[++index] = r.SerialNumber;
dr[++index] = r.AlternativeSerialNumber;
dr[++index] = r.DeviceType;
dr[++index] = r.Status == 1 ? "Active" : "Inactive";
dr[++index] = r.Status == 1 ? SystemParams.GetTextByKey(lang, "P_MD_ACTIVE", "Active") : SystemParams.GetTextByKey(lang, "P_MD_INACTIVE", "Inactive");
dr[++index] = r.InvoiceDateStr;
dr[++index] = r.InvoiceNumber;
if (u.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin)
@@ -133,11 +140,11 @@ public partial class ExportToFile : ContractorBasePage
}
dr[++index] = r.ServiceStartDateStr;
dr[++index] = r.PairedAsset == null ? "" : r.PairedAsset.VIN;
dr[++index] = r.Tamper ? "Yes" : "No";
dr[++index] = r.Utilization ? "Yes" : "No";
dr[++index] = r.Tamper ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
dr[++index] = r.Utilization ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
if (u.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin)
{
dr[++index] = r.FIInstalltion ? "Yes" : "No";
dr[++index] = r.FIInstalltion ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
dr[++index] = r.Installer;
}
@@ -166,37 +173,36 @@ public partial class ExportToFile : ContractorBasePage
private byte[] ExportAssetErrorList(ref string title)
{
string key = Request.Params["key"];
title = "Import Assets Error List";
string lang = GetLanguageCookie();
title = SystemParams.GetTextByKey(lang, "P_MA_IMPORTASSETSERRORLIST", "Import Assets Error List");
string p = ExportExcelManager.GetExportParams(key);
if (string.IsNullOrEmpty(p))
return null;
AssetDetailInfo2[] ds = JsonConvert.DeserializeObject<AssetDetailInfo2[]>(p);
IronIntel.Contractor.Users.UserInfo u = GetCurrentUser();
string lang = GetLanguageCookie();
ExportToExcel ete = new ExportToExcel();
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_VINSN", "SN/VIN"), Caption = "VIN" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_ASSETNAME", "Asset Name"), Caption = "Asset Name" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_ASSETNAME2", "Asset Name(Custom)"), Caption = "Asset Name(Custom)" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_YEAR", "Year"), Caption = "Year" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_TYPE", "Asset Type"), Caption = "Asset Type" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_MAKE", "Make"), Caption = "Make" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_MODEL", "Model"), Caption = "Model" });
dt.Columns.Add(new DataColumn() { ColumnName = "VIN", Caption = SystemParams.GetTextByKey(lang, "P_AG_VIN", "VIN") });
dt.Columns.Add(new DataColumn() { ColumnName = "Name", Caption = SystemParams.GetTextByKey(lang, "P_MA_ASSETNAME", "Asset Name") });
dt.Columns.Add(new DataColumn() { ColumnName = "Name2", Caption = SystemParams.GetTextByKey(lang, "P_MA_ASSETNAME2", "Asset Name(Custom)") });
dt.Columns.Add(new DataColumn() { ColumnName = "MakeYear", Caption = SystemParams.GetTextByKey(lang, "P_MA_YEAR", "Year") });
dt.Columns.Add(new DataColumn() { ColumnName = "TypeName", Caption = SystemParams.GetTextByKey(lang, "P_MA_TYPE", "Asset Type") });
dt.Columns.Add(new DataColumn() { ColumnName = "MakeName", Caption = SystemParams.GetTextByKey(lang, "P_MA_MAKE", "Make") });
dt.Columns.Add(new DataColumn() { ColumnName = "ModelName", Caption = SystemParams.GetTextByKey(lang, "P_MA_MODEL", "Model") });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_EQCLASS", "Eq.Class"), Caption = "Eq.Class" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_DESCRIPTION", "Description"), Caption = "Description" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_URINTERVAL", "Undercarriage Replacement Interval(Hours)"), Caption = "Undercarriage Replacement Interval(Hours)" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_ACQUISITIONTYPE", "Acquisition Type"), Caption = "Acquisition Type" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_COSTCENTER", "Cost Center"), Caption = "Cost Center" });
dt.Columns.Add(new DataColumn() { ColumnName = "EQClass", Caption = SystemParams.GetTextByKey(lang, "P_MA_EQCLASS", "Eq.Class") });
dt.Columns.Add(new DataColumn() { ColumnName = "Description", Caption = SystemParams.GetTextByKey(lang, "P_MA_DESCRIPTION", "Description") });
dt.Columns.Add(new DataColumn() { ColumnName = "AquisitionType", Caption = SystemParams.GetTextByKey(lang, "P_MA_ACQUISITIONTYPE", "Acquisition Type") });
dt.Columns.Add(new DataColumn() { ColumnName = "CostCenter", Caption = SystemParams.GetTextByKey(lang, "P_MA_COSTCENTER", "Cost Center") });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_HIDE", "Hide/Hidden"), Caption = "Hide/Hidden" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_ONROAD", "On-Road"), Caption = "On-Road" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_TELEMATICSENABLED", "Telematics Enabled"), Caption = "Telematics Enabled" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_ATTACHMENT", "Attachment"), Caption = "Attachment" });
dt.Columns.Add(new DataColumn() { ColumnName = "Hidden", Caption = SystemParams.GetTextByKey(lang, "P_MA_HIDE", "Hide/Hidden") });
dt.Columns.Add(new DataColumn() { ColumnName = "OnRoad", Caption = SystemParams.GetTextByKey(lang, "P_MA_ONROAD", "On-Road") });
dt.Columns.Add(new DataColumn() { ColumnName = "TelematicsEnabled", Caption = SystemParams.GetTextByKey(lang, "P_MA_TELEMATICSENABLED", "Telematics Enabled") });
dt.Columns.Add(new DataColumn() { ColumnName = "Attachment", Caption = SystemParams.GetTextByKey(lang, "P_MA_ATTACHMENT", "Attachment") });
if (u.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin)
{
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_MA_PRELOADED", "Preloaded"), Caption = "Preloaded" });
dt.Columns.Add(new DataColumn() { ColumnName = "Preloaded", Caption = SystemParams.GetTextByKey(lang, "P_MA_PRELOADED", "Preloaded") });
}
if (ds != null && ds.Length > 0)
@@ -214,17 +220,16 @@ public partial class ExportToFile : ContractorBasePage
dr[++index] = r.ModelName;
dr[++index] = r.EQClass;
dr[++index] = r.Description;
dr[++index] = r.UnderCarriageHours == null ? "" : r.UnderCarriageHours.ToString();
dr[++index] = r.AquisitionType;
dr[++index] = r.CostCenter;
dr[++index] = r.Hidden ? "Yes" : "No";
dr[++index] = r.OnRoad ? "Yes" : "No";
dr[++index] = r.TelematicsEnabled ? "Yes" : "No";
dr[++index] = r.Attachment ? "Yes" : "No";
dr[++index] = r.Hidden ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
dr[++index] = r.OnRoad ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
dr[++index] = r.TelematicsEnabled ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
dr[++index] = r.Attachment ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
if (u.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin)
{
dr[++index] = r.Preloaded ? "Yes" : "No";
dr[++index] = r.Preloaded ? SystemParams.GetTextByKey(lang, "P_UTILITY_YES", "Yes") : SystemParams.GetTextByKey(lang, "P_UTILITY_NO", "No");
}
dt.Rows.Add(dr);
}
@@ -245,12 +250,65 @@ public partial class ExportToFile : ContractorBasePage
}
private byte[] ExportAlertMappingErrorList(ref string title)
{
string key = Request.Params["key"];
title = "Import Alert Mapping Error List";
string p = ExportExcelManager.GetExportParams(key);
if (string.IsNullOrEmpty(p))
return null;
AlertMappingClient[] ds = JsonConvert.DeserializeObject<AlertMappingClient[]>(p);
IronIntel.Contractor.Users.UserInfo u = GetCurrentUser();
string lang = GetLanguageCookie();
ExportToExcel ete = new ExportToExcel();
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_SOURCE", "Source"), Caption = "Source" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_SPN", "SPN"), Caption = "SPN" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_FMI", "FMI"), Caption = "FMI" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_DESCRIPTION", "Description"), Caption = "Description" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_MAKE", "Make"), Caption = "MakeName" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_MODELS", "Models"), Caption = "ModelNames" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_ALERTTYPE", "Alert Type"), Caption = "AlertType" });
dt.Columns.Add(new DataColumn() { ColumnName = SystemParams.GetTextByKey(lang, "P_AMP_CATEGORY", "Category"), Caption = "Category" });
if (ds != null && ds.Length > 0)
{
foreach (var r in ds)
{
int index = 0;
var dr = dt.NewRow();
dr[index] = r.Source;
dr[++index] = r.SPN;
dr[++index] = r.FMI;
dr[++index] = r.Description;
dr[++index] = r.MakeName;
dr[++index] = r.ModelNames;
dr[++index] = r.AlertType;
dr[++index] = r.Category;
dt.Rows.Add(dr);
}
}
double[] widths = new double[] { 120, 120, 120, 120, 120, 120, 120, 120 };
byte[] data = ete.CreateExcel(dt, null, widths, null);
return data;
}
private byte[] ExportByParams(ref string title, ref string fileType)
{
string key = Request.Params["key"];
string p = ExportExcelManager.GetExportParams(key);
if (string.IsNullOrEmpty(p))
{
SystemParams.WriteLog("error", "ExportToFile", key + " is null", key + " is null");
return null;
}
return ExportByParams(p, ref title, ref fileType);
}
@@ -329,6 +387,12 @@ public partial class ExportToFile : ContractorBasePage
case "wohis":
buffer = ExportWorkOrderHistory(ref title, ref fileType);
break;
case "assethis":
buffer = ExportAssetHistory(ref title, ref fileType);
break;
case "alertmapping":
buffer = ExportAlertMappings(ref title, ref fileType);
break;
}
return buffer;
}
@@ -641,7 +705,7 @@ public partial class ExportToFile : ContractorBasePage
private byte[] ExportWorkOrderHistory(ref string title, ref string fileType)
{
var lang = GetLanguageCookie();
title = SystemParams.GetTextByKey(lang, "P_XXXXXX", "Work Order History");
title = SystemParams.GetTextByKey(lang, "P_WO_HIS_WORKORDERHISTORY", "Work Order History");
string clientdata = Request.Params["t"];
var searchtext = HttpUtility.HtmlDecode(clientdata);
@@ -660,11 +724,32 @@ public partial class ExportToFile : ContractorBasePage
FICHostEnvironment.WriteExportAuditTrail(session.User.UID, "WorkOrderHistory", "", "", title + ".xlsx", ".xlsx", data);
return data;
}
private byte[] ExportAssetHistory(ref string title, ref string fileType)
{
var lang = GetLanguageCookie();
title = SystemParams.GetTextByKey(lang, "P_MA_ASSETHISTORY", "Asset History");
string clientdata = Request.Params["c"];
string custid = HttpUtility.HtmlDecode(clientdata);
string from = Request.Params["from"];
string to = Request.Params["to"];
long assetid = Convert.ToInt64(HttpUtility.HtmlDecode(Request.Params["aid"]));
DateTime beginDate = Helper.DBMinDateTime;
DateTime endDate = DateTime.MaxValue;
if (!DateTime.TryParse(from, out beginDate))
beginDate = Helper.DBMinDateTime;
if (!DateTime.TryParse(to, out endDate))
endDate = DateTime.MaxValue;
var session = GetCurrentLoginSession();
var data = ExportExcelManager.ExportAssetHistory(lang, session.SessionID, custid, assetid, beginDate, endDate);
FICHostEnvironment.WriteExportAuditTrail(session.User.UID, "AssetHistory", "", "", title + ".xlsx", ".xlsx", data);
return data;
}
private byte[] ExportAssetsTimeLine(string[] ps, ref string title, ref string fileType)
{
var lang = GetLanguageCookie();
title = SystemParams.GetTextByKey(lang, "P_XXXXXX", "Time Line");
title = SystemParams.GetTextByKey(lang, "P_MA_TIMELINE", "Time Line");
string cid = ps[1];
long[] asseids = JsonConvert.DeserializeObject<long[]>(ps[2]);
@@ -678,4 +763,16 @@ public partial class ExportToFile : ContractorBasePage
FICHostEnvironment.WriteExportAuditTrail(session.User.UID, "AssetsTimeLine", "", "", title + ".xlsx", ".xlsx", data);
return data;
}
private byte[] ExportAlertMappings(ref string title, ref string fileType)
{
var lang = GetLanguageCookie();
title = SystemParams.GetTextByKey(lang, "P_ALERTMAPPINGS", "Alert Mappings");
string clientdata = Request.Params["t"];
var p = HttpUtility.HtmlDecode(clientdata);
var session = GetCurrentLoginSession();
var data = ExportExcelManager.ExportAlertMappings(lang, session.SessionID, clientdata);
FICHostEnvironment.WriteExportAuditTrail(session.User.UID, "AlertMappings", "", "", title + ".xlsx", ".xlsx", data);
return data;
}
}

View File

@@ -55,58 +55,12 @@
padding: 0 4px;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.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;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
#dialog_user_randompass {
width: auto;
height: 16px;
margin: 3px 4px 0 4px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.msgdiv {
padding-bottom: 10px;
}
@@ -251,8 +205,8 @@
<script src="js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("js/vue.min.js")%>"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
<script src="https://js.arcgis.com/3.40"></script>
<link rel="stylesheet" href="https://js.arcgis.com/3.44/esri/css/esri.css" />
<script src="https://js.arcgis.com/3.44"></script>
<script>
_network.trackerquery = function (method, param, callback, error, nolog) {
_network.request("FITracker.aspx?tp=ashx", -1, method, param, callback, error, nolog);
@@ -600,7 +554,7 @@
$("#basemapGallery").hide();
});
var basemap = "topo";
$("#basemapImg").css("background-image", "url('https://js.arcgis.com/3.40/esri/images/basemap/topo.jpg')");
$("#basemapImg").css("background-image", "url('https://js.arcgis.com/3.44/esri/images/basemap/topo.jpg')");
$("#basemapTitle").text(GetTextByKey("P_MAP_TOPOGRAPHIC", "Topographic"));
var basemapGallery = new BasemapGalleryC({
@@ -614,7 +568,7 @@
url: "http://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
})],
title: GetTextByKey("P_MAP_IMAGERY", "Imagery"),
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/satellite.jpg"
thumbnailUrl: "https://js.arcgis.com/3.44/esri/images/basemap/satellite.jpg"
});
basemapGallery.add(satellitemap);
@@ -623,7 +577,7 @@
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
})],
title: GetTextByKey("P_MAP_TOPOGRAPHIC", "Topographic"),
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/topo.jpg"
thumbnailUrl: "https://js.arcgis.com/3.44/esri/images/basemap/topo.jpg"
});
basemapGallery.add(topomap);
@@ -633,7 +587,7 @@
url: "http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"
})],
title: GetTextByKey("P_MAP_STREETS", "Streets"),
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/streets.jpg"
thumbnailUrl: "https://js.arcgis.com/3.44/esri/images/basemap/streets.jpg"
});
basemapGallery.add(streetmap);

View File

@@ -7,10 +7,10 @@
// Code that runs on application startup
IronIntel.Contractor.SystemParams.CreateDbObjects();
IronIntel.Contractor.IronIntelHost.Init();
// FI.FIC.DataProviders.Alert.Alertmanager.Instance.Start();
// FI.FIC.DataProviders.Alert.Alertmanager.Instance.Start();
//FI.FIC.Models.ScheduleService.Instance.Start();
// FI.FIC.Email.ChartProvider.StartSend();
// FI.FIC.Email.ChartProvider.StartSend();
//IronIntel.Contractor.Maintenance.IATCAlertsSyncService.Start();
}
@@ -19,8 +19,8 @@
{
//FI.FIC.Models.ScheduleService.Instance.Stop();
//FI.FIC.DataProviders.Alert.Alertmanager.Instance.Stop();
// FI.FIC.Email.ChartProvider.EndSend();
// FI.FIC.Email.ChartProvider.EndSend();
//IronIntel.Contractor.Maintenance.IATCAlertsSyncService.Stop();
}

View File

@@ -271,8 +271,7 @@
r[j] = { DisplayValue: r["QtyOnTruckStr"], Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
var height = 28 * data.length;
@@ -283,12 +282,7 @@
}
function InitGridData() {
grid_fddt = new GridView('#fueldetaillist');
grid_fddt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_fddt = createGridView('#fueldetaillist');
var list_columns = [
{ name: 'AssetName', caption: GetTextByKey("P_IPT_EQUIPMENT", "Equipment #"), valueIndex: 'AssetName', css: { 'width': 150, 'text-align': 'left' } },
{ name: 'AssetMeter', caption: GetTextByKey("P_IPT_HOURMETERODOMETER", "Hour Meter/Odometer"), valueIndex: 'AssetMeter', css: { 'width': 136, 'text-align': 'right' } },
@@ -316,12 +310,6 @@
grid_fddt.canMultiSelect = false;
grid_fddt.columns = columns;
grid_fddt.init();
grid_fddt.selectedrowchanged = function (rowindex) {
var rowdata = grid_fddt.source[rowindex];
if (rowdata) {
}
}
}
@@ -333,10 +321,9 @@
r.Selected = false;
for (var j in r) {
if (j === "UID")
r[j] = { DisplayValue: r["Name"] + "(" + r["ID"] + ")", Value: r[j] };
r[j] = { DisplayValue: r["Name"] + "(" + r["ID"] + ")", Value: r["Name"] + "(" + r["ID"] + ")" };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
$("#contactlist").css("height", 270);
@@ -345,12 +332,7 @@
var grid_dtemail;
function InitEmailGridData() {
grid_dtemail = new GridView('#contactlist');
grid_dtemail.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtemail = createGridView('#contactlist');
var list_columns = [
{ 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' } },
@@ -376,12 +358,6 @@
grid_dtemail.canMultiSelect = false;
grid_dtemail.columns = columns;
grid_dtemail.init();
grid_dtemail.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtemail.source[rowindex];
if (rowdata) {
}
}
}
$(function () {
@@ -444,6 +420,7 @@
$('#button-dl').hide();
}
$('input[placeholder=Search]').attr("placeholder", GetTextByKey("P_AM_SEARCH", "Search"));
});
function GetFuelReport() {
showmaskbg(true);
@@ -562,8 +539,9 @@
}
}
for (var i = 0; i < grid_dtemail.source.length; i++) {
var ct = grid_dtemail.source[i].Values;
var tempsource = grid_dtemail.source;
for (var i = 0; i < tempsource.length; i++) {
var ct = tempsource[i];
if (ct.Selected)
emailaddress.push(ct.ID);
}
@@ -602,7 +580,7 @@
<tr>
<td style="width: 100px;"><%=Logo2 %></td>
<td>
<h1>Fuel Log * Shipping Paper</h1>
<h1 data-lgid="P_IPT_FUELLOGSHIPPINGPAPER">Fuel Log * Shipping Paper</h1>
</td>
</tr>
</table>
@@ -678,20 +656,20 @@
</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 id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;">
</div>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none; z-index: 3;"></iframe>
<div class="dialog" id="dialog_sendemail" style="display: none; width: 320px;">
<div class="dialog" id="dialog_sendemail" style="display: none; width: 510px;">
<div class="dialog-title"><span class="title" data-lgid="P_IPT_SENDEMAIL">Send Email</span><em class="dialog-close"></em></div>
<div class="dialog-content" style="height: 378px;">
<table style="line-height: 25px;">
<div class="dialog-content">
<table style="line-height: 24px;">
<tr>
<td colspan="2" data-lgid="P_IPT_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="sendlocation_search" style="width: 445px; margin-left: 10px;" placeholder="Search" /></td>
<input type="text" id="sendlocation_search" style="width: 470px; margin-left: 10px;" placeholder="Search" /></td>
</tr>
<tr>
<td colspan="2">
@@ -702,10 +680,10 @@
<td colspan="2" data-lgid="P_IPT_EMAILADDRESSESTIPS">Separate multiple manually entered email or text addresses with a semi-colon (;).</td>
</tr>
<tr style="height: 24px;">
<td><span data-lgid="P_IPT_OTHEREMAILADDRESS">Other Email Address</span>
<td style="text-align:right;padding-right:5px;"><span data-lgid="P_IPT_OTHEREMAILADDRESS">Other Email Address</span>
</td>
<td>
<input type="text" id="sendlocation_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
<input type="text" id="sendlocation_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
</tr>
</table>
</div>

View File

@@ -8,7 +8,6 @@
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" type="text/css" />
<script src="<%=GetFileUrlWithVersion("../js/spectrum.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<%--<script src="<%=GetFileUrlWithVersion("../js/split.js")%>"></script>--%>
<style type="text/css">
.fa {
@@ -69,6 +68,7 @@
</style>
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
<script data-main="<%=GetFileUrlWithVersion("js/main.js")%>" src="<%=GetFileUrlWithVersion("../js/lib/require-2.3.6.min.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript">
var sectiontype = 0;//sectiontype:0 - global,1 - normal
var currenttemplate;//current template in editing
@@ -96,11 +96,11 @@
function showRightPopup(state) {
if (state) {
showmaskbg(true);
$("#mask_bg_left").show();
$("#right_popup").css("left", $("#set_left").width()).show();
}
else {
showmaskbg(false);
$("#mask_bg_left").hide();
$("#right_popup").hide();
}
}
@@ -277,7 +277,7 @@
{%>
<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>
<span id="span_tempdesign" class="subitem" data-lgid="P_TEMPLATEDESIGN" style="margin-left: 15px; font-weight: bold;">Template Design</span>
</li>
<%} %>
@@ -353,12 +353,14 @@
<div class="trigle white" style="left: -12px; right: auto;"></div>
</div>
<div id="mask_bg_left" class="maskbg" style="display: none;">
</div>
<div id="right_popup" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;">
</div>
<div id="right_popup1" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;"></div>
<iframe id="ifdiv" style="position: absolute; top: -9999px; height: 1px; width: 1px; border: 0; display: none; z-index: 3;"></iframe>
<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>
<iframe id="ifdiv" style="position: absolute; top: -9999px; height: 1px; width: 1px; border: 0; display: none;"></iframe>
</asp:Content>

View File

@@ -100,8 +100,8 @@ public partial class Inspection : InspectionBasePage
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
BeginDate = userlocaldate.AddDays(-13).ToShortDateString();
EndDate = userlocaldate.ToShortDateString();
BeginDate = userlocaldate.AddDays(-13).ToString("yyyy-MM-dd");
EndDate = userlocaldate.ToString("yyyy-MM-dd");
}
}
public bool IsForesight

View File

@@ -92,11 +92,10 @@
} else if (j === "LastUpdatedTimeLocal") {
r[j] = { DisplayValue: r["LastUpdatedTimeLocalStr"], Value: r[j] };
} else if (j === "VisibleToCustomer") {
r[j] = { DisplayValue: r["VisibleToCustomer"] ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r["VisibleToCustomer"] ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -104,12 +103,7 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#inspectlist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#inspectlist');
var list_columns = [
{ name: 'LastUpdatedByUserName', caption: GetTextByKey("P_IPT_USERNAME", "User Name"), valueIndex: 'LastUpdatedByUserName', css: { 'width': 300, 'text-align': 'left' } },
{ name: 'LastUpdatedTimeLocal', caption: GetTextByKey("P_IPT_DATETIME", "Date Time"), valueIndex: 'LastUpdatedTimeLocal', css: { 'width': 150, 'text-align': 'left' } },
@@ -165,7 +159,9 @@
<div class="clear"></div>
<div id="inspectlist"></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>
</asp:Content>

View File

@@ -227,6 +227,7 @@
height: 25px;
width: 120px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
@@ -304,7 +305,7 @@
<div id="divreport" style="width: 1100px; margin: 0 auto;">
<div v-if="report.ReportLayout!=null">
<table class="maintable" style="width: 100%;">
<tr class="assettr">
<tr>
<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;">
@@ -321,56 +322,70 @@
<tr v-if="report.ReportLayout==null">
<td>
<table class="maintable">
<tr class="assettr">
<td class="mainlabel" style="width: 80px;" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td style="width: 200px;">{{report.Asset.Name}}</td>
<td class="mainlabel" style="width: 130px;" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name(Custom):</td>
<td style="width: 720px;" colspan="5">{{report.Asset.Name2}}</td>
</tr>
<tr class="assettr">
<td class="mainlabel" style="width: 80px;" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td style="width: 200px;">{{report.Asset.VIN}}</td>
<td class="mainlabel" style="width: 130px;" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td style="width: 200px;">{{report.Asset.MakeName}}</td>
<td class="mainlabel" style="width: 50px;" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td style="width: 200px;">{{report.Asset.ModelName}}</td>
<td class="mainlabel" style="width: 70px;" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td style="width: 200px;">{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettr" v-if="report.WorkOrderId>0">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderNumber}}</td>
<td class="mainlabel" data-lgid="P_IPT_CUSTOMERVISIBLE_COLON">Customer Visible:</td>
<td colspan="5">{{report.VisibleToCustomer?"Yes":"No"}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" style="width: 130px;" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td>{{report.Asset.Name}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name (Custom):</td>
<td>{{report.Asset.Name2}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td>{{report.Asset.VIN}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td>{{report.Asset.MakeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td>{{report.Asset.ModelName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td>{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderId}}</td>
</tr>
<thead>
<tr class="assettr">
<th style="width: 100px;"></th>
<th style="width: 200px;"></th>
<th style="width: 165px;"></th>
<th style="width: 200px;"></th>
<th style="width: 50px;"></th>
<th style="width: 200px;"></th>
<th style="width: 80px;"></th>
<th style="width: 200px;"></th>
</tr>
</thead>
<tbody>
<tr class="assettr">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td>{{report.Asset.Name}}</td>
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name(Custom):</td>
<td colspan="5">{{report.Asset.Name2}}</td>
</tr>
<tr class="assettr">
<td class="mainlabel" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td>{{report.Asset.VIN}}</td>
<td class="mainlabel" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td>{{report.Asset.MakeName}}</td>
<td class="mainlabel" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td>{{report.Asset.ModelName}}</td>
<td class="mainlabel" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td>{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettr" v-if="report.WorkOrderId>0">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderNumber}}</td>
<td class="mainlabel" data-lgid="P_IPT_CUSTOMERVISIBLE_COLON">Customer Visible:</td>
<td colspan="5">{{report.VisibleToCustomer?"Yes":"No"}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td>{{report.Asset.Name}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name (Custom):</td>
<td>{{report.Asset.Name2}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td>{{report.Asset.VIN}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td>{{report.Asset.MakeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td>{{report.Asset.ModelName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td>{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderId}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
@@ -430,8 +445,8 @@
<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 id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;">
</div>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none; z-index: 3;"></iframe>
</asp:Content>

View File

@@ -81,8 +81,8 @@
}
.question {
min-height: 24px;
line-height: 24px;
/*min-height: 24px;
line-height: 24px;*/
padding-left: 70px;
padding-right: 10px;
font-size: 14px;
@@ -92,8 +92,8 @@
}
.answer {
min-height: 24px;
line-height: 24px;
/*min-height: 24px;
line-height: 24px;*/
padding-left: 90px;
padding-right: 10px;
}
@@ -227,6 +227,7 @@
height: 25px;
width: 120px;
overflow: hidden;
white-space:nowrap;
text-overflow: ellipsis;
}
</style>
@@ -297,10 +298,10 @@
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="holder_content" runat="Server">
<div class="function_title" style="text-align: right; margin-top: 2px;">
<%--<div class="function_title" style="text-align: right; margin-top: 2px;">
<span id="button-dl" class="sbutton icondownload" onclick="OnDownLoad();" data-lgid="P_IPT_DOWNLOAD">Download</span>
<span id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span>
</div>
</div>--%>
<div id="divreport" style="width: 1100px; margin: 0 auto;">
<div v-if="report.ReportLayout!=null">
<table class="maintable" style="width: 100%;">
@@ -320,57 +321,72 @@
<table class="maintable">
<tr v-if="report.ReportLayout==null">
<td>
<table class="maintable">
<tr class="assettr">
<td class="mainlabel" style="width: 80px;" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td style="width: 200px;">{{report.Asset.Name}}</td>
<td class="mainlabel" style="width: 130px;" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name(Custom):</td>
<td style="width: 720px;" colspan="5">{{report.Asset.Name2}}</td>
</tr>
<tr class="assettr">
<td class="mainlabel" style="width: 80px;" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td style="width: 200px;">{{report.Asset.VIN}}</td>
<td class="mainlabel" style="width: 130px;" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td style="width: 200px;">{{report.Asset.MakeName}}</td>
<td class="mainlabel" style="width: 50px;" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td style="width: 200px;">{{report.Asset.ModelName}}</td>
<td class="mainlabel" style="width: 70px;" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td style="width: 200px;">{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettr" v-if="report.WorkOrderId>0">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderNumber}}</td>
<td class="mainlabel" data-lgid="P_IPT_CUSTOMERVISIBLE_COLON">Customer Visible:</td>
<td colspan="5">{{report.VisibleToCustomer?"Yes":"No"}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" style="width: 130px;" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td>{{report.Asset.Name}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name (Custom):</td>
<td>{{report.Asset.Name2}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td>{{report.Asset.VIN}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td>{{report.Asset.MakeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td>{{report.Asset.ModelName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td>{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderId}}</td>
</tr>
<thead>
<tr class="assettr">
<th style="width: 100px;"></th>
<th style="width: 200px;"></th>
<th style="width: 165px;"></th>
<th style="width: 200px;"></th>
<th style="width: 50px;"></th>
<th style="width: 200px;"></th>
<th style="width: 80px;"></th>
<th style="width: 200px;"></th>
</tr>
</thead>
<tbody>
<tr class="assettr">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td>{{report.Asset.Name}}</td>
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name(Custom):</td>
<td colspan="5">{{report.Asset.Name2}}</td>
</tr>
<tr class="assettr">
<td class="mainlabel" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td>{{report.Asset.VIN}}</td>
<td class="mainlabel" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td>{{report.Asset.MakeName}}</td>
<td class="mainlabel" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td>{{report.Asset.ModelName}}</td>
<td class="mainlabel" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td>{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettr" v-if="report.WorkOrderId>0">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderNumber}}</td>
<td class="mainlabel" data-lgid="P_IPT_CUSTOMERVISIBLE_COLON">Customer Visible:</td>
<td colspan="5">{{report.VisibleToCustomer?"Yes":"No"}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME_COLON">Asset Name:</td>
<td>{{report.Asset.Name}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETNAME2_COLON">Asset Name (Custom):</td>
<td>{{report.Asset.Name2}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_VINSN_COLON">VIN/SN:</td>
<td>{{report.Asset.VIN}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MAKE_COLON">Make:</td>
<td>{{report.Asset.MakeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_MODEL_COLON">Model:</td>
<td>{{report.Asset.ModelName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_ASSETTYPE_COLON">Asset Type:</td>
<td>{{report.Asset.TypeName}}</td>
</tr>
<tr class="assettrmobile">
<td class="mainlabel" data-lgid="P_IPT_WORKORDER_COLON">Work Order:</td>
<td>{{report.WorkOrderId}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
@@ -430,8 +446,8 @@
<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 id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;">
</div>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none; z-index: 3;"></iframe>
</asp:Content>

View File

@@ -89,11 +89,11 @@
function showRightPopup(state) {
if (state) {
showmaskbg(true);
$("#mask_bg_left").show();
$("#right_popup").css("left", $("#set_left").width()).show();
}
else {
showmaskbg(false);
$("#mask_bg_left").hide();
$("#right_popup").hide();
}
}
@@ -167,7 +167,7 @@
}
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: 'layouts/1', Title: GetTextByKey("P_LAYOUTS", "Layouts") }];
createSubMenus(items);
var left = $(this).offset().left;
@@ -262,7 +262,7 @@
{%>
<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>
<span id="span_tempdesign" class="subitem" data-lgid="P_TEMPLATEDESIGN" style="margin-left: 15px; font-weight: bold;">Template Design</span>
</li>
<%} %>
@@ -337,11 +337,13 @@
<div class="trigle" style="left: -12px; right: auto;"></div>
<div class="trigle white" style="left: -12px; right: auto;"></div>
</div>
<div id="mask_bg" style="display: none;"></div>
<div id="right_popup" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;">
<div id="mask_bg_left" class="maskbg" style="display: none;">
</div>
<div id="right_popup1" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;"></div>
<iframe id="ifdiv" style="position: absolute; top: -9999px; height: 1px; width: 1px; border: 0; display: none;"></iframe>
<div id="right_popup" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;">
</div>
<div id="right_popup1" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;"></div>
<iframe id="ifdiv" style="position: absolute; top: -9999px; height: 1px; width: 1px; border: 0; display: none; z-index: 3;"></iframe>
<div id="mask_bg" style="display: none;"></div>
</asp:Content>

View File

@@ -77,8 +77,8 @@ public partial class TeamIntelligence : InspectionBasePage
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
BeginDate = userlocaldate.AddDays(-13).ToShortDateString();
EndDate = userlocaldate.ToShortDateString();
BeginDate = userlocaldate.AddDays(-13).ToString("yyyy-MM-dd");
EndDate = userlocaldate.ToString("yyyy-MM-dd");
}
}
public bool IsForesight

View File

@@ -8,7 +8,7 @@
display: flex;
box-sizing: border-box;
user-select: none;
margin-left: 20px;
margin-left: 10px;
}
.section-holder {

View File

@@ -174,13 +174,6 @@ define(function () {
}
gs.createMultiTextDialog = function (textbox, pageele) {
if (pageele) {
if (!pageele.IssueId || pageele.IssueId == "")
editable = true;
else
editable = false;
}
var languages = [{ Key: 'fr-fr', Label: GetTextByKey("P_IPT_FRENCH", 'French') }, { Key: 'es-es', Label: GetTextByKey("P_IPT_SPANISH", 'Spanish') }];
var inputs = [];

View File

@@ -5,7 +5,7 @@ require.config({
//spectrum: "../../js/spectrum"
},
waitSeconds: 0,
urlArgs: "v=464" //+ Math.random()
urlArgs: "v=541" //+ Math.random()
})
requirejs(['modules/pageloader'], function (loader) {

View File

@@ -37,16 +37,11 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
var div_grid = $('<div style="padding-right:10px;"></div>');
div_grid.css("height", $(window).height() - 145);
grid_dt = new GridView(div_grid);
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView(div_grid);
var list_columns = [
{ name: 'PackageName', caption: GetTextByKey("P_IPT_PACKAGENAME", "Package Name"), valueIndex: 'PackageName', css: { 'width': 300, 'text-align': 'left' } },
{ name: 'PackageName', caption: GetTextByKey("P_IPT_PACKAGENAME", "Package Name"), valueIndex: 'PackageName', allowFilter: true, css: { 'width': 300, 'text-align': 'left' } },
{ name: 'Notes', caption: GetTextByKey("P_IPT_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 300, 'text-align': 'left' } },
{ name: 'Creator', caption: GetTextByKey("P_IPT_CREATOR", "Creator"), valueIndex: 'Creator', css: { 'width': 250, 'text-align': 'left' } },
{ name: 'Creator', caption: GetTextByKey("P_IPT_CREATOR", "Creator"), valueIndex: 'Creator', allowFilter: true, css: { 'width': 250, 'text-align': 'left' } },
{ name: 'CreatedOnLocal', caption: GetTextByKey("P_IPT_DATETIMECREATED", "Date/Time Created"), valueIndex: 'CreatedOnLocal', css: { 'width': 180, 'text-align': 'left' } },
{ name: 'DownLoad', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
@@ -68,31 +63,27 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
col.allowFilter = list_columns[hd].allowFilter;
if (col.name === "DownLoad") {
col.isurl = true;
col.text = "\uf019";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "download";
col.events = {
onclick: function () {
_this.onDownLoadPackage();
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_IPT_DOWNLOADPACKAGE", 'Download Package') };
}
else if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.events = {
onclick: function () {
_this.onDeletePackage();
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_IPT_DELETEPACKAGE", 'Delete Package') };
}
@@ -102,13 +93,7 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = _this.onDownLoad;
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
grid_dt.onRowDblClicked = _this.onDownLoad;
return div_grid;
}
@@ -132,7 +117,7 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
exppkg.onDeletePackage = function () {
var _this = this;
var index = grid_dt.selectedIndex;
var package = grid_dt.source[index].Values;
var package = grid_dt.source[index];
showConfirm(GetTextByKey("P_IPT_AREYOUSUREYOUWANTTODELETETHISPACKAGE", 'Are you sure you want to delete this package?'), GetTextByKey("P_IPT_DELETEPACKAGE", 'Delete Package'), function () {
var p = JSON.stringify([teamintelligence, htmlencode(package.PackageId)]);
inspectionrequest("DeletePackage", p, function (data) {
@@ -149,7 +134,7 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
exppkg.onDownLoadPackage = function () {
var index = grid_dt.selectedIndex;
var package = grid_dt.source[index].Values;
var package = grid_dt.source[index];
window.open("../filesvc.ashx?sourceType=ipackage&attchid=" + package.PackageId);
}
@@ -162,8 +147,7 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
r[j] = { DisplayValue: r["CreatedOnLocalStr"], Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -171,7 +155,9 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
exppkg.refresh = function () {
datacontent.empty();
showloading(true);
inspectionrequest("GetCreatedPackages", '', function (data) {
showloading(false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_IPT_EXPORTPACKAGES", 'Export Packages'));
return;
@@ -181,6 +167,7 @@ define(['modules/packages/createpackage'], function (CreatePackageModule) {
showPackages(data);
}
}, function (err) {
showloading(false);
});
}
return exppkg;

View File

@@ -20,19 +20,12 @@ define([], function () {
header.append(search_bar);
search_bar.append('<input type="password" autocomplete="new-password" style="display: none" />');
search_bar.append('<span style="margin-left:5px;">' + GetTextByKey("P_IPT_BEGINDATE_COLON", "Begin Date:") + '</span>');
startdateinputcontrol = $('<input type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(begindate);
startdateinputcontrol = $('<input type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 100px;" autocomplete="off" />').val(begindate);
search_bar.append($('<span></span>').append(startdateinputcontrol));
startdateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
search_bar.append('<span style="margin-left:10px;">' + GetTextByKey("P_IPT_ENDDATE_COLON", "End Date:") + '</span>');
enddateinputcontrol = $('<input type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(enddate);
enddateinputcontrol = $('<input type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 100px;" autocomplete="off" />').val(enddate);
search_bar.append($('<span></span>').append(enddateinputcontrol));
enddateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
var btnRefresh = $('<input class="search" type="button" value="' + GetTextByKey("P_IPT_SEARCH", "Search") + '" style="margin-left:10px;"/>');
search_bar.append(btnRefresh);
@@ -75,12 +68,26 @@ define([], function () {
}
gs.refresh = function () {
var begindate = startdateinputcontrol.val();
var enddate = enddateinputcontrol.val();
if (begindate && !startdateinputcontrol.is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !enddateinputcontrol.is(':valid')) {
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var _this = this;
datacontent.empty();
var startydate = startdateinputcontrol.val();
var enddate = enddateinputcontrol.val();
var p = JSON.stringify([teamintelligence, startydate, enddate]);
var p = JSON.stringify([teamintelligence, begindate, enddate]);
showloading(true);
inspectionrequest("GetFuelReportItems", htmlencode(p), function (data) {
showloading(false);
datacontent.empty();
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_IPT_ERROR", 'Error'));
@@ -93,6 +100,7 @@ define([], function () {
//showFuelLogs(data);
}
}, function (err) {
showloading(false);
});
}
gs.createFuelLog = function (fuellog) {

View File

@@ -11,7 +11,7 @@ define(['modules/sections/section', 'modules/sections/addsection'], function (Se
sectiontype = 0;//sectiontype:0 - global,1 - normal
templatestatus = 0;//templatestatus:0 - draft,1 - published
var content = $('<div style="min-width:1940px;"></div>');
var content = $('<div style="min-width:1780px;"></div>');
function createHeader() {
var header = $('<div></div>');
@@ -46,15 +46,14 @@ 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: 400px">' + GetTextByKey("P_IPT_TYPE", "Type") + '</div>');
dataheader.append('<div class="question-cell" style="width: 370px">' + GetTextByKey("P_IPT_TYPE", "Type") + '</div>');
dataheader.append('<div class="question-cell" style="width: 80px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_DISPLAYONREPORT", "Display on Report") + '</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: 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: 65px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_INCLUDECOMMENT", "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>');
dataheader.append('<div style="flex-grow: 1;" style="width: 180px">' + GetTextByKey("P_IPT_NOTES", "Notes") + '</div>');
dataheader.append('<div class="question-cell" style="width: 90px;padding-right:20px;"></div>');
content.append(dataheader);
@@ -90,7 +89,9 @@ define(['modules/sections/section', 'modules/sections/addsection'], function (Se
gs.refresh = function () {
datacontent.empty();
showloading(true);
inspectionrequest("GetGlobalSections", teamintelligence, function (data) {
showloading(false);
datacontent.empty();
if (data) {
for (var i = 0; i < data.length; i++) {
@@ -99,6 +100,7 @@ define(['modules/sections/section', 'modules/sections/addsection'], function (Se
}
}
}, function (err) {
showloading(false);
});
}
return gs;

View File

@@ -20,12 +20,7 @@
var div_grid = $('<div style="margin-top:5px;"></div>');
div_grid.css("height", 200);
grid_templatedt = new GridView(div_grid);
grid_templatedt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_templatedt = createGridView(div_grid);
var list_columns = [
{ 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' } },
@@ -65,8 +60,7 @@
for (var i = 0; i < data.length; i++) {
var r = data[i];
r.Selected = true;
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_templatedt.setData(rows);
@@ -77,12 +71,7 @@
var div_grid = $('<div style="margin-top:5px;"></div>');
div_grid.css("height", 200);
grid_sectiondt = new GridView(div_grid);
grid_sectiondt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_sectiondt = createGridView(div_grid);
var list_columns = [
{ 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' } },
@@ -122,8 +111,7 @@
for (var i = 0; i < data.length; i++) {
var r = data[i];
r.Selected = true;
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_sectiondt.setData(rows);
@@ -141,15 +129,17 @@
}
var templateids = [];
for (var i = 0; i < grid_templatedt.source.length; i++) {
var t = grid_templatedt.source[i].Values;
var tempsource = grid_templatedt.source;
for (var i = 0; i < tempsource.length; i++) {
var t = tempsource[i];
if (t.Selected)
templateids.push(t.Id);
}
var sectionids = [];
for (var i = 0; i < grid_sectiondt.source.length; i++) {
var t = grid_sectiondt.source[i].Values;
var tempsource1 = grid_sectiondt.source;
for (var i = 0; i < tempsource1.length; i++) {
var t = tempsource1[i];
if (t.Selected)
sectionids.push(t.ItemId);
}

View File

@@ -28,27 +28,14 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
header.append(search_bar);
search_bar.append('<input type="password" autocomplete="new-password" style="display: none" />');
search_bar.append('<span style="margin-left:5px;">' + GetTextByKey("P_IPT_BEGINDATE_COLON", "Begin Date:") + '</span>');
startdateinputcontrol = $('<input type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(begindate);
startdateinputcontrol = $('<input type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 100px;" autocomplete="off" />').val(begindate);
search_bar.append($('<span></span>').append(startdateinputcontrol));
startdateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
search_bar.append('<span style="margin-left:10px;">' + GetTextByKey("P_IPT_ENDDATE_COLON", "End Date:") + '</span>');
enddateinputcontrol = $('<input type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(enddate);
enddateinputcontrol = $('<input type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 100px;" autocomplete="off" />').val(enddate);
search_bar.append($('<span></span>').append(enddateinputcontrol));
enddateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
makeinputcontrol = $('<select type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(enddate);
search_bar.append($('<span></span>').append(enddateinputcontrol));
enddateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
searchinputcontrol = $('<input type="text" style="margin-left:10px;" autocomplete="off" />');
search_bar.append(searchinputcontrol);
@@ -75,20 +62,21 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
gs.refresh();
});
func.append(iconRefresh);
var iconResetPivots = $('<span class="sbutton iconfilter">' + GetTextByKey("P_IPT_XXXXXX", "Reset Pivots") + '</span>').click(function () {
var iconResetPivots = $('<span class="sbutton iconfilter">' + GetTextByKey("P_IPT_RESETPIVOTS", "Reset Pivots") + '</span>').click(function () {
if (grid_dt && grid_dt.columns) {
for (var i = 0; i < grid_dt.columns.length; i++) {
if (grid_dt.columns[i].filterValues)
grid_dt.columns[i].filterValues = null;
}
grid_dt.refreshGrid();
grid_dt.reload();
}
});
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;
var iconprints = $('<span class="sbutton iconprint">' + GetTextByKey("P_IPT_PRINT", "Print") + '</span>').click(function () {
var tempsource = grid_dt.source;
for (var i = 0; i < tempsource.length; i++) {
var inspect = tempsource[i];
if (inspect.Selected) {
if (navigator.userAgent.indexOf('Firefox') >= 0 ||
navigator.userAgent.indexOf('Opera') >= 0) {
@@ -101,9 +89,10 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
});
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;
var icondownloads = $('<span class="sbutton icondownload">' + GetTextByKey("P_IPT_DOWNLOAD", "Download") + '</span>').click(function () {
var tempsource = grid_dt.source;
for (var i = 0; i < tempsource.length; i++) {
var inspect = tempsource[i];
if (inspect.Selected) {
openDownloadFrame(inspect.Id);
}
@@ -119,19 +108,14 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
function InitGridData() {
var div_grid = $('<div></div>');
div_grid.css("height", $(window).height() - 185);
div_grid.css({ "height": $(window).height() - 185, "position": "relative" });
grid_dt = new GridView(div_grid);
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView(div_grid);
var list_columns = [
{ name: 'TemplateName', caption: GetTextByKey("P_TEMPLATE", "Template"), allowFilter: true, valueIndex: 'TemplateName', css: { 'width': 250, 'text-align': 'left' } },
{ name: 'AssetName', caption: GetTextByKey("P_IPT_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'WorkOrderNumber', caption: GetTextByKey("P_IPT_WORKORDER", "Work Order"), valueIndex: 'WorkOrderNumber', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'CustomerName', caption: GetTextByKey("P_IPT_XXX", "Customer Name"), valueIndex: 'CustomerName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'WorkOrderNumber', caption: GetTextByKey("P_IPT_WORKORDER", "Work Order"), valueIndex: 'WorkOrderId', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'CustomerName', caption: GetTextByKey("P_IPT_CUSTOMERNAME", "Customer Name"), valueIndex: 'CustomerName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'VisibleToCustomer', caption: GetTextByKey("P_IPT_CUSTOMERVISIBLE", "Customer Visible"), valueIndex: 'VisibleToCustomer', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'VIN', caption: GetTextByKey("P_IPT_VIN", "VIN"), valueIndex: 'VIN', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'MakeName', caption: GetTextByKey("P_IPT_MAKE", "Make"), valueIndex: 'MakeName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
@@ -180,8 +164,6 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
}
if (col.name === "TemplateName" || col.name === "AssetName") {
col.isurl = true;
col.sortable = false;
col.events = {
onclick: function () {
_this.openReport();
@@ -196,37 +178,34 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
}
}
else if (col.name === "Edit") {
col.isurl = true;
col.text = "\uf044";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.events = {
onclick: function () {
_this.onedit();
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_IPT_EDIT", 'Edit') };
}
else if (col.name === "Detail") {
col.isurl = true;
col.text = "\uf0c9";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "info-circle";
col.events = {
onclick: function () {
_this.openReport();
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_IPT_DETAIL", 'Detail') };
}
else if (col.name === "DownloadPDF") {
col.isurl = true;
col.text = "\uf019";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "download";
col.visible = canExport;
col.events = {
onclick: function () {
@@ -239,9 +218,10 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
col.attrs = { 'title': GetTextByKey("P_IPT_DOWNLOADPDF", 'Download PDF') };
}
else if (col.name === "Print") {
col.isurl = true;
col.text = "\uf02f";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "print";
col.visible = canExport;
col.events = {
onclick: function () {
@@ -259,9 +239,10 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
col.attrs = { 'title': GetTextByKey("P_IPT_PRINT", 'Print') };
}
else if (col.name === "ViewChangeHistory") {
col.isurl = true;
col.text = "\uf06e";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "history";
col.events = {
onclick: function () {
_this.onViewChangeHistory();
@@ -276,41 +257,81 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
if (col.name === "AssetName" || col.name === "VIN" || col.name === "MakeName" || col.name === "ModelName" || col.name === "TypeName" || col.name === "WorkOrderNumber" || col.name === "VisibleToCustomer" || col.name === "CustomerName") {
col.visible = !teamintelligence;
}
if (!teamintelligence && AllowReassignWorkorders && col.name === "WorkOrderNumber") {
col.allowHtml = true;
col.filterCustom = true;
col.filter = function (item) {
if (item.Id === "")
return htmldecode(item.WorkOrderNumber);
col.type = GridView.ColumnTypes.Dropdown;
col.filter = function (item, editing) {
return editing ? String(item.WorkOrderId) : item.WorkOrderNumber;
};
var div = $('<div class="dropdown" style="width: 185px;"></div>');
div.dropdown(item.WorkOrders || [{ Id: -1, WorkOrderNumber: "Not Assigned" }], {
search: false,
textKey: 'WorkOrderNumber',
valueKey: 'Id',
selected: item.WorkOrderId > 0 ? item.WorkOrderId : -1,
parent: '#content'
}).on('select', function (_e, wo) {
col.dropOptions = {
search: true,
textKey: 'WorkOrderNumber',
valueKey: 'Id'
};
col.sourceCache = false;
col.source = function (item) {
return item.WorkOrders ??= [{ Id: -1, WorkOrderNumber: "Not Assigned" }];
};
col.onDropExpanded = function (item, drop) {
if (!item.WorkOrdersLoaded) {
item.WorkOrdersLoaded = true;
inspectionrequest('GetAssetWorkOrders', item.AssetId, function (data) {
if (typeof data === 'string') {
}
else if (data && data.length > 0) {
var source = [
{ Id: -1, WorkOrderNumber: "Not Assigned" }
];
var sel = null;
var exists = false;
var selected;
if (item.WorkOrders && item.WorkOrders.length == 1)
sel = item.WorkOrders[0];
else
exists = true;
for (var i = 0; i < data.length; i++) {
var u = data[i];
source.push(u);
if (item.WorkOrderId == u.Id)
item.WorkOrderId = selected = u.Id;
if (sel && (sel.Id < 0 || sel.Id == u.Id))
exists = true;
}
if (!exists) {
source.push(sel);
}
item.WorkOrders = source;
drop.source = source;
drop.select(selected, true);
}
}, function () {
});
}
};
col.onChanged = function (item, value, old, wo) {
if (value != old) {
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 () {
var oldwoid = item.WorkOrderId;
item.WorkOrderId = wo.Id;
item.WorkOrderNumber = wo.WorkOrderNumber;
updateInspectionWorkOrder(item.Id, item.WorkOrderId, oldwoid, wo.CustomerName);
updateInspectionWorkOrder(item.Id, value, old, wo.CustomerName);
}, function () {
var dropdown = div.data('dropdown');
if (dropdown)
dropdown.select(item.WorkOrderId > 0 ? item.WorkOrderId : -1);
item.WorkOrderId = old;
grid_dt?.refresh();
});
}
});
return div;
}
}
};
col.styleFilter = function () {
return { "width": "100%", 'margin': 0 };
}
@@ -321,13 +342,7 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = _this.openReport;
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
grid_dt.onRowDblClicked = _this.openReport;
return div_grid;
}
@@ -343,7 +358,7 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
gs.onedit = function () {
var _this = this;
var index = grid_dt.selectedIndex;
var inspect = grid_dt.source[index].Values;
var inspect = grid_dt.source[index];
// check permissions
@@ -356,13 +371,13 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
gs.openReport = function () {
var index = grid_dt.selectedIndex;
var inspect = grid_dt.source[index].Values;
var inspect = grid_dt.source[index];
window.open("report.aspx?rid=" + inspect.Id + "&ro=" + (ReportReadonly ? 1 : 0), "_blank");
}
gs.onViewChangeHistory = function () {
var index = grid_dt.selectedIndex;
var inspect = grid_dt.source[index].Values;
var inspect = grid_dt.source[index];
window.open("InspectionChangeHistory.aspx?rid=" + inspect.Id, "_blank");
}
@@ -373,7 +388,7 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
return;
}
if (grid_dt.selectedIndex >= 0) {
grid_dt.source[grid_dt.selectedIndex].Values.CustomerName = custname;
grid_dt.source[grid_dt.selectedIndex].CustomerName = custname;
grid_dt && grid_dt.reload();
}
@@ -398,29 +413,49 @@ define(['modules/inspects/inspect', 'modules/inspects/editinspection'], function
} else if (j === "LastUpdatedTimeLocal") {
r[j] = { DisplayValue: r["LastUpdatedTimeLocalStr"], Value: r[j] };
} else if (j === "VisibleToCustomer") {
r[j] = { DisplayValue: r["VisibleToCustomer"] ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r["VisibleToCustomer"] ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
}
gs.refresh = function () {
datacontent.empty();
var startydate = startdateinputcontrol.val();
var begindate = startdateinputcontrol.val();
var enddate = enddateinputcontrol.val();
if (begindate && !startdateinputcontrol.is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !enddateinputcontrol.is(':valid')) {
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
datacontent.empty();
var searchtxt = searchinputcontrol.val();
searchtxt = htmlencode(searchtxt);
var p = JSON.stringify([teamintelligence, startydate, enddate, searchtxt]);
var p = JSON.stringify([teamintelligence, begindate, enddate, searchtxt]);
showloading(true);
inspectionrequest("GetInspectItems", htmlencode(p), function (data) {
showloading(false);
datacontent.empty();
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
if (data) {
showInspections(data);
}
}, function (err) {
showloading(false);
});
}
return gs;

View File

@@ -18,7 +18,9 @@
for (var i = 0; i < pages.length; i++) {
var qs = $(pages[i]).find('.question-item');
for (var j = 0; j < qs.length; j++) {
var question = $(qs[j]).data('question');
var qso = $(qs[j]);
var question = qso.data('question');
var section = qso.data('section');
var q = question.question;
var a = question.getAnswer();
var flag;
@@ -32,7 +34,7 @@
(q.QuestionType === Question.types.FuelRecords
&& (q.SubType === Question.fueltypes.State ||
q.SubType === Question.fueltypes.FuelType));
if (q.IsRequired) {
if (q.IsRequired && checkConditional(_this.report.Template, q.Conditional, answers) && checkConditional(_this.report.Template, section.Conditional, answers)) {
if (isChoice) {
flag = a.SelectedItems == null || a.SelectedItems.length == 0;
} else if (a.Result == null || a.Result.length == 0) {
@@ -52,7 +54,7 @@
continue;
}
} else if (a.Result == null || a.Result.length == 0) {
if (q.QuestionType !== Question.types.Picture) {
if (q.QuestionType !== Question.types.Picture && (q.QuestionType !== Question.types.FuelRecords || q.SubType !== Question.fueltypes.Picture)) {
continue;
}
}
@@ -157,6 +159,104 @@
});
}
function checkConditional(template, cond, answers) {
if (!cond) return true;
var qid = cond.QuestionId.toLowerCase();
if (qid == "and") {
for (let scond of cond.SubItems) {
var r = checkConditional(template, scond, answers);
if (!r) return false;
}
return true;
}
else if (qid == "or") {
for (let scond of cond.SubItems) {
var r = checkConditional(template, scond, answers);
if (r) return true;
}
return false;
}
else {
var condquestion = getQuestionAndSection(template, cond.QuestionId);
if (!condquestion) return false;
if (!condquestion.Question || !checkConditional(template, condquestion.Question.Conditional, answers)) return false;
if (!condquestion.Section || !checkConditional(template, condquestion.Section.Conditional, answers)) return false;
if (!cond.Value) return cond.Operator == "noteq" ? true : false;
var ans = answers.find(c => c.QuestionId.toLowerCase() == cond.QuestionId.toLowerCase());
if (ans == null) return false;
var condValue = Number(cond.Value);
switch (cond.Operator) {
case "gt"://>
return ans.AsDouble > condValue;
case "gteq"://>=
return ans.AsDouble >= condValue;
case "lt"://<
return ans.AsDouble < condValue;
case "lteq"://<=
return ans.AsDouble <= condValue;
case "between"://between
var condValue1 = Number(cond.Value1);
return ans.AsDouble >= condValue && ans.AsDouble <= condValue1;
case "in"://in
if (!ans.SelectedItems || ans.SelectedItems.Count == 0) return false;
var condvs = cond.Value.toLowerCase().split(';');
for (let item of ans.SelectedItems) {
var sv = item.Value;
if (condquestion.Question.QuestionType == Question.types.AssetStatus || condquestion.Question.QuestionType == Question.types.YesOrNo)
sv = item.Text || ans.SelectedText;
if (!sv || condquestion.Question.LookupSource != 0)
sv = item.Text;
if (condvs.indexOf(sv.toLowerCase()) >= 0)
return true;
}
return false;
case "noteq":
var v = "";
if (condquestion.Question.QuestionType == 5// QuestionTypes.YesOrNo
|| condquestion.Question.QuestionType == 8//QuestionTypes.DropDown
|| condquestion.Question.QuestionType == 9//QuestionTypes.List
|| condquestion.Question.QuestionType == 19) {//QuestionTypes.AssetStatus)
if (!ans.SelectedItems || ans.SelectedItems.length == 0) return false;
if (ans.SelectedItems.length > 1) return true;
v = ans.SelectedItems[0].Value;
if (!v || condquestion.Question.QuestionType == 19 || condquestion.Question.QuestionType == 5 || condquestion.Question.LookupSource != 0)
v = ans.SelectedItems[0].Text;
}
else
v = ans.Result;
return cond.Value.toLowerCase() != v.toLowerCase() && ans.AsDouble != condValue;
default: //=
var v1 = "";
if (condquestion.Question.QuestionType == 5// QuestionTypes.YesOrNo
|| condquestion.Question.QuestionType == 8//QuestionTypes.DropDown
|| condquestion.Question.QuestionType == 9//QuestionTypes.List
|| condquestion.Question.QuestionType == 19) {//QuestionTypes.AssetStatus)
if (!ans.SelectedItems || ans.SelectedItems.length != 1) return false;
v1 = ans.SelectedItems[0].Value;
if (!v1 || condquestion.Question.QuestionType == 19 || condquestion.Question.QuestionType == 5 || condquestion.Question.LookupSource != 0)
v1 = ans.SelectedItems[0].Text;
}
else
v1 = ans.Result;
return cond.Value.toLowerCase() == v1.toLowerCase() || ans.AsDouble == condValue;
}
}
}
function getQuestionAndSection(template, questionid) {
for (var p of template.Pages) {
for (var s of p.Sections) {
for (var q of s.Questions) {
if (q.Id.toLowerCase() == questionid.toLowerCase())
return { Question: q, Section: s };
}
}
}
return null;
}
__proto.createContent = function () {
var _this = this;
var content = $('<div></div>');
@@ -247,7 +347,7 @@
tr.append(td);
tb.append(tr);
if (data.ForWorkOrder) {
if (data.Template.ForWorkOrder) {
tr = $('<tr></tr>');
td = $('<td style="width: 25%"><b style="display: inline-block; width: 85px">' + GetTextByKey("P_IPT_WORKORDER_COLON", "Work Order:") + '</b></td>');
var selwo = $('<select style="margin-left: 6px;width: 160px"></select>');
@@ -304,6 +404,41 @@
// content
var p = $('<div></div>').attr('data-page', name);
var answerchange = (function (panel) {
return function (e, answers) {
var qs = panel.find('.question-item');
if (!answers) {
answers = [];
for (var j = 0; j < qs.length; j++) {
var question = $(qs[j]).data('question');
var q = question.question;
var a = question.getAnswer();
answers.push(a);
}
}
for (var j = 0; j < qs.length; j++) {
var temp = $(qs[j]);
var question = temp.data('question');
if (checkConditional(data.Template, question.question.Conditional, answers))
temp.show();
else
temp.hide();
}
var ss = panel.find('.section-item');
for (var j = 0; j < ss.length; j++) {
var temp = $(ss[j]);
var section = temp.data('section');
if (checkConditional(data.Template, section.section.Conditional, answers))
temp.show();
else
temp.hide();
}
}
})(p);
var change = (function (panel) {
return function (e) {
var v = e.data.getAnswer();
@@ -373,7 +508,13 @@
}
});
}
p.append(section.createContent(change));
var sContent = section.createContent(change, answerchange);
sContent.data('section', section);
p.append(sContent);
setTimeout(function () {
answerchange(null, data.Answers);
})
}
content.append(p);

View File

@@ -58,7 +58,7 @@
// items
this.data = {};
};
question.prototype.createContent = function (answer, medias, change) {
question.prototype.createContent = function (answer, answerchange, inputchange, medias) {
this.answer = answer;
var content = $('<div class="question-item" style="line-height: 26px; margin: 0 0 22px 22px"></div>');
var q = this.question;
@@ -72,7 +72,7 @@
var div_pic = $('<div></div>');
for (var i = 0; i < q.StaticPictures.length; i++) {
var pic = q.StaticPictures[i];
var img = $('<img style="width:40px;height:40px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name);
var img = $('<img loading="lazy" style="width:40px;height:40px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name);
img.click(pic.Url, function (e) {
window.open(e.data, "_blank")
});
@@ -83,7 +83,7 @@
var cnt = $('<div style="margin: 6px 0 0 22px"></div>');
if (typeof this.createQuestion === 'function') {
this.ui.content = this.createQuestion(answer, medias, change);
this.ui.content = this.createQuestion(answer, answerchange, inputchange, medias);
cnt.append(this.ui.content);
} else {
cnt.append('<div style="font-style: italic; color: #ccc">&lt;Not implemented yet.&gt;</div>');
@@ -128,7 +128,7 @@
};
inputQuestion.prototype = Object.create(question.prototype);
inputQuestion.prototype.constructor = inputQuestion;
inputQuestion.prototype.createQuestion = function (answer, _medias, change) {
inputQuestion.prototype.createQuestion = function (answer, answerchange, inputchange, _medias) {
var content = $('<div></div>');
var input;
if (this.question.QuestionType === QTypes.MultipleLineText
@@ -145,11 +145,19 @@
input.prop('readonly', true).css('background', '#eee');
} else if (this.question.SubType === FuelRecordTypes.Quantity
|| this.question.SubType === FuelRecordTypes.UnitCost) {
if (typeof change === 'function') {
input.on('input propertychange', this, change);
if (typeof inputchange === 'function') {
input.on('input propertychange', this, inputchange);
}
}
}
if (typeof answerchange === 'function') {
if (this.question.QuestionType === QTypes.Number
|| this.question.QuestionType === QTypes.Integer
|| this.question.QuestionType === QTypes.EngingHours
|| this.question.SubType === FuelRecordTypes.UnitCost) {
input.on('change', this, answerchange);
}
}
if (answer && answer.Result) {
input.val(answer.Result);
}
@@ -169,7 +177,7 @@
var div_pic = $('<div></div>');
for (var i = 0; i < _medias.length; i++) {
var pic = _medias[i];
var img = $('<img style="width:40px;height:40px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name);
var img = $('<img loading="lazy" style="width:40px;height:40px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name);
img.click(pic.Url, function (e) {
window.open(e.data, "_blank")
});
@@ -186,6 +194,7 @@
//if (this.question.QuestionType !== QTypes.FuelRecords ||
// this.question.SubType !== FuelRecordTypes.TotalCost) {
answer.Result = this.ui.input.val();
answer.AsDouble = Number(answer.Result);
//}
return answer;
};
@@ -258,7 +267,7 @@
};
listQuestion.prototype = Object.create(question.prototype);
listQuestion.prototype.constructor = listQuestion;
listQuestion.prototype.createQuestion = function (answer) {
listQuestion.prototype.createQuestion = function (answer, answerchange) {
var content = $('<div></div>');
var q = this.question;
for (var i = 0; i < q.SelectItems.length; i++) {
@@ -275,6 +284,9 @@
check = $('<input type="radio"></input>').attr({ 'id': id, 'name': name }).val(val);
}
check.data('item', item);
if (typeof answerchange === 'function') {
check.on('change', this, answerchange);
}
if (answer && answer.SelectedItems) {
var s = answer.SelectedItems.filter(function (a) { return (a.Value || a.Text) === val });
if (s.length > 0) {
@@ -353,6 +365,9 @@
//onSelectDate: function (v, inp) {
//}
onChangeDateTime: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y');
}
});
if (q.QuestionType === QTypes.DateAndTime
|| (q.QuestionType === QTypes.FuelRecords &&
@@ -406,9 +421,9 @@
};
dropQuestion.prototype = Object.create(question.prototype);
dropQuestion.prototype.constructor = dropQuestion;
dropQuestion.prototype.createQuestion = function (answer) {
dropQuestion.prototype.createQuestion = function (answer, answerchange) {
var _this = this;
var content = $('<div></div>').click(function () { _this.openDrop(content.offset()) });
var content = $('<div></div>').click(function () { _this.openDrop(content.offset(), answerchange) });
var result = $('<div class="drop-result" style="float: left; cursor: pointer"></div>');
this.fillResult(result, answer && answer.SelectedItems);
content.append(result);
@@ -469,7 +484,7 @@
}
}
};
dropQuestion.prototype.openDrop = function (pos) {
dropQuestion.prototype.openDrop = function (pos, answerchange) {
var _this = this;
var q = this.question;
var mask = this.ui.mask;
@@ -559,6 +574,7 @@
refreshList(panelContent, items);
}
});
search.attr("placeholder", GetTextByKey("P_AM_SEARCH", "Search"));
var funcs = $('<div style="margin-right: 45px"></div>');
funcs.append(search);
panel.append($('<div class="sbutton iconcheck"></div>').css({
@@ -585,6 +601,10 @@
answer.SelectedItems = items;
_this.fillResult(_this.ui.content.find('.drop-result'), items);
_this.closeDrop();
if (typeof answerchange === 'function') {
answerchange(_this);
}
}));
panel.append(funcs);
// scroller
@@ -728,7 +748,7 @@
};
pictureQuestion.prototype = Object.create(question.prototype);
pictureQuestion.prototype.constructor = pictureQuestion;
pictureQuestion.prototype.createQuestion = function (_answer, medias) {
pictureQuestion.prototype.createQuestion = function (_answer, answerchange, inputchange, medias) {
var content = $('<div></div>');
if (medias && medias.length > 0) {
for (var i = 0; i < medias.length; i++) {
@@ -750,7 +770,7 @@
'color': '#000'
}));
} else {
ele = $('<img></img>').css({
ele = $('<img loading="lazy"></img>').css({
'float': 'left',
'border': '1px solid #ccc',
'padding': '4px',
@@ -774,7 +794,7 @@
};
assetStatusQuestion.prototype = Object.create(question.prototype);
assetStatusQuestion.prototype.constructor = assetStatusQuestion;
assetStatusQuestion.prototype.createQuestion = function (answer, medias) {
assetStatusQuestion.prototype.createQuestion = function (answer, answerchange, inputchange, medias) {
var content = $('<div></div>');
var q = this.question;
q.SelectItems = [
@@ -792,6 +812,9 @@
var val = item.Value || item.Text;
var check = $('<input type="radio"></input>').attr({ 'id': id, 'name': name }).val(val);
check.data('item', item);
if (typeof answerchange === 'function') {
check.on('change', this, answerchange);
}
if (answer && answer.SelectedItems) {
var s = answer.SelectedItems.filter(function (a) { return (a.Value || a.Text) === val });
if (s.length > 0) {
@@ -837,7 +860,7 @@
'color': '#000'
}));
} else {
ele = $('<img></img>').css({
ele = $('<img loading="lazy"></img>').css({
'float': 'left',
'border': '1px solid #ccc',
'padding': '4px',

View File

@@ -5,8 +5,8 @@
};
var __proto = ctor.prototype;
__proto.createContent = function (change) {
var content = $('<div style="margin-bottom: 20px"></div>');
__proto.createContent = function (change, answerchange) {
var content = $('<div class="section-item" style="margin-bottom: 20px"></div>');
if (this.section.StaticPictures && this.section.StaticPictures.length > 0) {
var div_pic = $('<div style="background: #eee; padding: 2px 2px;"></div>');
@@ -47,15 +47,9 @@
|| question.QuestionType === Question.types.AssetStatus;
var medias = isPicture && answer && this.report.Medias.filter(function (m) { return Question.equals(m.AnswerId, answer.Id) });
var qContent;
if (question.QuestionType === Question.types.FuelRecords
&& (question.SubType === Question.fueltypes.Quantity ||
question.SubType === Question.fueltypes.UnitCost)) {
qContent = q.createContent(answer, medias, change);
} else {
qContent = q.createContent(answer, medias);
}
var qContent = q.createContent(answer, answerchange, change, medias);
qContent.data('question', q);
qContent.data('section', this.section);
content.append(qContent);
}

View File

@@ -60,20 +60,14 @@
function InitGridData() {
var div_grid = $('<div style="flex: 1 1 auto"></div>');
var grid_dt = new GridView(div_grid);
var grid_dt = createGridView(div_grid);
layouts.grid = grid_dt;
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt.canMultiSelect = false;
grid_dt.columns = [
{
caption: GetTextByKey('P_LAYOUT_NAME', 'Layout Name'),
key: 'Name',
width: 200,
isurl: true,
events: {
onclick: function () {
doedit(this.Id);
@@ -92,31 +86,28 @@
width: 300
},
{
isurl: true,
sortable : false,
resizable: false,
orderable: false,
sortable: false,
type: GridView.ColumnTypes.Icon,
text: 'edit',
width: 40,
align: 'center',
text: '\uf044',
events: {
onclick: function () {
doedit(this.Id);
}
},
classFilter: function () { return 'icon-col' },
attrs: {
title: GetTextByKey('P_WOS_EDIT', 'Edit')
}
},
{
isurl: true,
resizable: false,
orderable: false,
sortable: false,
resizable: false,
type: GridView.ColumnTypes.Icon,
text: 'times',
width: 40,
align: 'center',
text: '\uf00d',
events: {
onclick: function () {
var id = this.Id;
@@ -141,16 +132,15 @@
);
}
},
classFilter: function () { return 'icon-col' },
attrs: {
title: GetTextByKey('P_WOS_DELETE', 'Delete')
}
}
];
grid_dt.init();
grid_dt.rowdblclick = layouts.onedit;
grid_dt.onRowDblClicked = layouts.onedit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
layouts.ui.edit.prop('disabled', rowindex >= 0);
}
return div_grid;
@@ -177,7 +167,7 @@
JSON.stringify([layouts.isteam ? 1 : 0, layouts.searchInput.val()])
), function (data) {
if ($.isArray(data)) {
layouts.grid.setData(data.map(function (i) { return { Values: i } }));
layouts.grid.setData(data.map(function (i) { return i }));
} else {
showAlert(data, GetTextByKey('P_LAYOUTS', 'Layouts'));
}
@@ -318,7 +308,7 @@
}
function editLayout(info) {
$('#right_popup').load('js/modules/layouts/addlayout.html?v=5', function () {
$('#right_popup').load('js/modules/layouts/addlayout.html?v=6', function () {
var modified = false;
var deleteIcon = false;
var deleteCenterIcon = false;
@@ -437,7 +427,13 @@
});
content.find('#layout-highlightcolor-input').keyup(null, function () {
$("#layout-highlightcolor-selector").spectrum("set", $('#layout-highlightcolor-input').val());
})
});
function resizeContent() {
content.find('.subcontent').css('height', $(window).height() - 95);
}
window.onresize = resizeContent;
resizeContent();
var save = function (exit) {
@@ -611,15 +607,17 @@
showmaskbg(true);
var p = [layouts.isteam ? 1 : 0, id];
inspectionrequest('GetInspectLayout', JSON.stringify(p), function (data) {
showmaskbg(false);
editLayout(data);
}, function () {
showmaskbg(false);
});
}
Object.defineProperty(layouts, 'onedit', {
value: function () {
if (layouts.grid && layouts.grid.selectedIndex >= 0) {
var id = layouts.grid.source[layouts.grid.selectedIndex].Values.Id;
var id = layouts.grid.source[layouts.grid.selectedIndex].Id;
doedit(id);
}
}

View File

@@ -7,128 +7,130 @@
<span class="sbutton iconsave button-save-exit" data-lgid="P_IPT_SAVE1">Save and Exit</span>
<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 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" />
<div class="subcontent" style="overflow:auto;">
<div class="page_title" data-lgid="P_LAYOUT_GENERAL">General</div>
<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_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>
<label data-lgid="P_LAYOUT_STYLE_COLON" 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 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>
<span class="icon-file">
<span class="icon-file-title" data-lgid="P_LAYOUT_LEFTLOGOFILE_COLON">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>
<span class="icon-centerfile" style="margin-left:30px;">
<span class="icon-centerfile-title" data-lgid="P_LAYOUT_CENTERLOGOFILE_COLON">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>
<span class="icon-rightfile" style="margin-left:30px;">
<span class="icon-rightfile-title" data-lgid="P_LAYOUT_RIGHTLOGOFILE_COLON">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 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 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>
</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>
<div class="settings-line">
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_LEFT">Left</span>
<div class="layout-headers-left-vars"></div>
</div>
<div class="layout-headers-left"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_MIDDLE">Middle</span>
<div class="layout-headers-middle-vars"></div>
</div>
<div class="layout-headers-middle"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_RIGHT">Right</span>
<div class="layout-headers-right-vars"></div>
</div>
<div class="layout-headers-right"></div>
</div>
<div class="page_title" data-lgid="P_LAYOUT_OPTIONS">Options</div>
<div class="settings-line">
<span>
<span data-lgid="P_LAYOUT_SPACING_COLON">Spacing:</span>
<select id="layout-spacing" class="select-layout">
<option value="0" data-lgid="P_LAYOUT_SINGLESPACE">Single Space</option>
<option value="1" data-lgid="P_LAYOUT_DOUBLESPACE">Double Space</option>
</select>
<div class="page_title" data-lgid="P_IPT_FUELRPT_FOOTER">Page Footers</div>
<div class="settings-line" style="padding-bottom: 20px">
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_LEFT">Left</span>
<div class="layout-footers-left-vars"></div>
</div>
<div class="layout-footers-left"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_MIDDLE">Middle</span>
<div class="layout-footers-middle-vars"></div>
</div>
<div class="layout-footers-middle"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_RIGHT">Right</span>
<div class="layout-footers-right-vars"></div>
</div>
<div class="layout-footers-right"></div>
</div>
<span data-lgid="P_LAYOUT_PICTURES_COLON" class="select-layout-name">Pictures:</span>
<select id="layout-picturesdisplay" class="select-layout" style="width:140px;">
<option value="0" data-lgid="P_LAYOUT_DISPLAYEDASTAKEN">Displayed As Taken</option>
<option value="1" data-lgid="P_LAYOUT_DISPLAYEDASBOTTOM">Displayed At Bottom</option>
</select>
<div id="svg-container" style="width: 0; height: 0; overflow: hidden">
<svg>
<defs>
<symbol id="symbol-undo" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z" /></g></symbol>
<symbol id="symbol-redo" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z" /></g></symbol>
<symbol id="symbol-bold" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><g><path d="M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" /></g></symbol>
<symbol id="symbol-italic" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><g><path d="M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" /></g></symbol>
<symbol id="symbol-underline" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><g><path d="M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" /></g></symbol>
<symbol id="symbol-link" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" /></g></symbol>
<symbol id="symbol-upload" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M452 432c0 11-9 20-20 20s-20-9-20-20 9-20 20-20 20 9 20 20zm-84-20c-11 0-20 9-20 20s9 20 20 20 20-9 20-20-9-20-20-20zm144-48v104c0 24.3-19.7 44-44 44H44c-24.3 0-44-19.7-44-44V364c0-24.3 19.7-44 44-44h124v-99.3h-52.7c-35.6 0-53.4-43.1-28.3-68.3L227.7 11.7c15.6-15.6 40.9-15.6 56.6 0L425 152.4c25.2 25.2 7.3 68.3-28.3 68.3H344V320h124c24.3 0 44 19.7 44 44zM200 188.7V376c0 4.4 3.6 8 8 8h96c4.4 0 8-3.6 8-8V188.7h84.7c7.1 0 10.7-8.6 5.7-13.7L261.7 34.3c-3.1-3.1-8.2-3.1-11.3 0L109.7 175c-5 5-1.5 13.7 5.7 13.7H200zM480 364c0-6.6-5.4-12-12-12H344v24c0 22.1-17.9 40-40 40h-96c-22.1 0-40-17.9-40-40v-24H44c-6.6 0-12 5.4-12 12v104c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12V364z" /></g></symbol>
<symbol id="symbol-close" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><g><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" /></g></symbol>
</defs>
</svg>
<span data-lgid="P_LAYOUT_CAPTIONIMAGES_COLON" class="select-layout-name">Caption Images:</span>
<input type="checkbox" id="layout-captionimages" />
<span data-lgid="P_LAYOUT_DIVIDER_COLON" class="select-layout-name">Divider:</span>
<select id="layout-divider" class="select-layout" style="width:80px;">
<option value="0" data-lgid="P_LAYOUT_NONE">None</option>
<option value="1" data-lgid="P_LAYOUT_LINE">Line</option>
<option value="2" data-lgid="P_LAYOUT_GRID">Grid</option>
</select>
<span data-lgid="P_LAYOUT_VIPHIGHLIGHTCOLOR_COLON" 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>
<div class="settings-line">
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_LEFT">Left</span>
<div class="layout-headers-left-vars"></div>
</div>
<div class="layout-headers-left"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_MIDDLE">Middle</span>
<div class="layout-headers-middle-vars"></div>
</div>
<div class="layout-headers-middle"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_RIGHT">Right</span>
<div class="layout-headers-right-vars"></div>
</div>
<div class="layout-headers-right"></div>
</div>
<div class="page_title" data-lgid="P_IPT_FUELRPT_FOOTER">Page Footers</div>
<div class="settings-line" style="padding-bottom: 20px">
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_LEFT">Left</span>
<div class="layout-footers-left-vars"></div>
</div>
<div class="layout-footers-left"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_MIDDLE">Middle</span>
<div class="layout-footers-middle-vars"></div>
</div>
<div class="layout-footers-middle"></div>
<div class="editor-top">
<span data-lgid="P_IPT_FUELRPT_RIGHT">Right</span>
<div class="layout-footers-right-vars"></div>
</div>
<div class="layout-footers-right"></div>
</div>
<div id="svg-container" style="width: 0; height: 0; overflow: hidden">
<svg>
<defs>
<symbol id="symbol-undo" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z" /></g></symbol>
<symbol id="symbol-redo" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z" /></g></symbol>
<symbol id="symbol-bold" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><g><path d="M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" /></g></symbol>
<symbol id="symbol-italic" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><g><path d="M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" /></g></symbol>
<symbol id="symbol-underline" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><g><path d="M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" /></g></symbol>
<symbol id="symbol-link" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" /></g></symbol>
<symbol id="symbol-upload" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g><path d="M452 432c0 11-9 20-20 20s-20-9-20-20 9-20 20-20 20 9 20 20zm-84-20c-11 0-20 9-20 20s9 20 20 20 20-9 20-20-9-20-20-20zm144-48v104c0 24.3-19.7 44-44 44H44c-24.3 0-44-19.7-44-44V364c0-24.3 19.7-44 44-44h124v-99.3h-52.7c-35.6 0-53.4-43.1-28.3-68.3L227.7 11.7c15.6-15.6 40.9-15.6 56.6 0L425 152.4c25.2 25.2 7.3 68.3-28.3 68.3H344V320h124c24.3 0 44 19.7 44 44zM200 188.7V376c0 4.4 3.6 8 8 8h96c4.4 0 8-3.6 8-8V188.7h84.7c7.1 0 10.7-8.6 5.7-13.7L261.7 34.3c-3.1-3.1-8.2-3.1-11.3 0L109.7 175c-5 5-1.5 13.7 5.7 13.7H200zM480 364c0-6.6-5.4-12-12-12H344v24c0 22.1-17.9 40-40 40h-96c-22.1 0-40-17.9-40-40v-24H44c-6.6 0-12 5.4-12 12v104c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12V364z" /></g></symbol>
<symbol id="symbol-close" role="presentation" focusable="false" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><g><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z" /></g></symbol>
</defs>
</svg>
</div>
</div>
</div>
</body>

View File

@@ -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_XXX", "Language Selection") + '"/>');
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "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_XXX", "Language Selection") + '"/>');
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(displaytextcontrol, _this.question);
});
@@ -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_XXX", "Language Selection") + '"/>');
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(optext, _this.question);
});

View File

@@ -12,6 +12,7 @@ define(['common'], function (Common) {
var namecontrol = undefined;
var displaytextcontrol = undefined;
var notescontrol = undefined;
var displayonreportcontrol = undefined;
s.prototype.createContent = function () {
var _this = this;
editable = true;
@@ -22,7 +23,7 @@ define(['common'], function (Common) {
var func = $('<div class="function_title"></div>');
if (sectiontype == 0) {
var btn = $('<span class="sbutton iconsave">' + GetTextByKey("P_IPT_SAVE","Save") + '</span>').click(function () {
var btn = $('<span class="sbutton iconsave">' + GetTextByKey("P_IPT_SAVE", "Save") + '</span>').click(function () {
saveData(0);
});
func.append(btn);
@@ -82,12 +83,18 @@ 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_XXX", "Language Selection") + '"/>');
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(displaytextcontrol, _this.section);
});
tr.append($('<td></td>').append(displaytextcontrol).append(addiText));
tr = $('<tr></tr>');
tb.append(tr);
tr.append('<td class="label">' + GetTextByKey("P_IPT_DISPLAYONREPORT_COLON", "Display on Report:") + '</td>');
displayonreportcontrol = $('<input type="checkbox" />');
tr.append($('<td></td>').append(displayonreportcontrol));
tr = $('<tr></tr>');
tb.append(tr);
tr.append('<td class="label">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>');
@@ -103,6 +110,10 @@ define(['common'], function (Common) {
namecontrol.val(section.Name).data("texts", section.LocalNames);
displaytextcontrol.val(section.DisplayText).data("texts", section.LocalDisplayTexts);
notescontrol.val(section.Notes);
displayonreportcontrol.attr('checked', section.DisplayOnReport);
}
else {
displayonreportcontrol.attr('checked', true);
}
}
@@ -110,13 +121,15 @@ define(['common'], function (Common) {
namecontrol.prop('disabled', true);
displaytextcontrol.prop('disabled', true);
notescontrol.prop('disabled', true);
displayonreportcontrol.prop('disabled', true);
}
function getData() {
var item = {
'Name': namecontrol.val(),
'DisplayText': displaytextcontrol.val(),
'Notes': notescontrol.val()
'Notes': notescontrol.val(),
'DisplayOnReport': displayonreportcontrol.prop('checked')
};
var texts = namecontrol.data("texts");
if (texts) {
@@ -129,17 +142,17 @@ define(['common'], function (Common) {
var alerttitle;
if (_this.section) {
item.Id = _this.section.Id;
alerttitle = GetTextByKey("P_IPT_EDITSECTION","Edit Section");
alerttitle = GetTextByKey("P_IPT_EDITSECTION", "Edit Section");
} else {
alerttitle = GetTextByKey("P_IPT_ADDSECTION","Add Section");
alerttitle = GetTextByKey("P_IPT_ADDSECTION", "Add Section");
}
if (!item.Name || item.Name.length == 0) {
showAlert(GetTextByKey("P_IPT_NAMENOTBEEMPTY",'Name cannot be empty.'), alerttitle);
showAlert(GetTextByKey("P_IPT_NAMENOTBEEMPTY", 'Name cannot be empty.'), alerttitle);
return false;
}
if (!item.DisplayText || item.DisplayText.length == 0) {
showAlert(GetTextByKey("P_IPT_DISPLAYTEXTNOTBEEMPTY",'Display Text cannot be empty.'), alerttitle);
showAlert(GetTextByKey("P_IPT_DISPLAYTEXTNOTBEEMPTY", 'Display Text cannot be empty.'), alerttitle);
return false;
}
@@ -162,7 +175,7 @@ define(['common'], function (Common) {
_this.section = { 'Id': data[0] };
}
if (exit == 0) {
showAlert(GetTextByKey("P_IPT_SAVSUCCESSFULLY",'Saved successfully.'), alerttitle);
showAlert(GetTextByKey("P_IPT_SAVSUCCESSFULLY", 'Saved successfully.'), alerttitle);
_this.datasaved = true;
}
if (exit == 1) {
@@ -171,7 +184,7 @@ define(['common'], function (Common) {
}
}
}, function (err) {
showAlert(GetTextByKey("P_IPT_FAILEDTOSAVESECTION",'Failed to save Section.'), alerttitle);
showAlert(GetTextByKey("P_IPT_FAILEDTOSAVESECTION", 'Failed to save Section.'), alerttitle);
});
}

View File

@@ -0,0 +1,451 @@
define([], function () {
var allowConditionQuestions = [3, 4, 5, 8, 9, 11, 12, 19];
var dropdownType = 8;
var bannedLookupSources = [2, 3];
var fuelRecordsType = 15;
var numberQuestionTypes = [3, 4, 11, 12];
var integerQuestionTypes = [4];
var dropQuestionTypes = [5, 8, 9, 19];
var numberSubTypes = [8, 10, 11, 12];
var integerSubTypes = [10];
var dropSubTypes = [9];
var selectorChanged = function (id) {
var c = this.conditional;
c.QuestionId = id;
if (['-', 'or', 'and'].includes(id)) {
this.addbutton.show();
this.span.hide();
this.selector.css('width', 80);
} else {
c.SubItems = [];
this.addbutton.hide();
this.span.show();
this.selector.css('width', 150);
var pagemodule = this.wrapper.pagemodule;
var question;
for (var i = 0; i < pagemodule.sectionmodules.length; i++) {
var section = pagemodule.sectionmodules[i];
for (var j = 0; j < section.questionmodules.length; j++) {
var q = section.questionmodules[j].question;
if (q.Id == id) {
question = q;
}
}
}
if (question == null) {
return;
}
this.question = question;
var qtype = Number(question.QuestionType);
var stype = Number(question.SubType);
var isnumber = numberQuestionTypes.includes(qtype);
var isdrop = dropQuestionTypes.includes(qtype);
isnumber |= qtype == fuelRecordsType && numberSubTypes.includes(stype);
isdrop |= qtype == fuelRecordsType && dropSubTypes.includes(stype);
var operator = this.operator;
if (isnumber) {
operator.empty().attr('data-vtype', '0').append(
'<option value="eq">&#x3d;</option>',
'<option value="noteq">&lt;&gt;</option>',
'<option value="gt">&gt;</option>',
'<option value="gteq">&gt;&#x3d;</option>',
'<option value="lt">&lt;</option>',
'<option value="lteq">&lt;&#x3d;</option>',
$('<option value="between"></option>').text(GetTextByKey('P_CDH_BETWEEN', 'Between'))
);
if (c.Operator?.length > 0 && c.Operator !== 'in') {
operator.val(c.Operator).trigger('change');
} else {
operator.val(c.Operator = 'gt').trigger('change');
}
}
if (isdrop) {
operator.empty().attr('data-vtype', '1').append(
'<option value="eq">&#x3d;</option>',
'<option value="noteq">&lt;&gt;</option>',
$('<option value="in"></option>').text(GetTextByKey('P_CDH_IN', 'In'))
);
var op = c.Operator;
if (['eq', 'noteq', 'in'].includes(op)) {
operator.val(op).trigger('change');
} else {
operator.val(c.Operator = op = 'eq').trigger('change');
}
if (['eq', 'noteq'].includes(op) && (question.SelectItems?.length > 0 || question.QuestionType == 19)) {
var valueDrop = this.valueDrop;
if (question.QuestionType == 19) {
valueDrop.empty().append(
$('<option value="In Use"></option>').text(GetTextByKey('P_MA_INUSE', 'In Use')),
$('<option value="Available"></option>').text(GetTextByKey('P_MA_AVAILABLE', 'Available')),
$('<option value="Standby"></option>').text(GetTextByKey('P_MA_STANDBY', 'Standby')),
$('<option value="Down"></option>').text(GetTextByKey('P_MA_DOWN', 'Down'))
);
var r = String(c.Value);
if (['In Use', 'Available', 'Standby', 'Down'].includes(r)) {
valueDrop.val(r);
} else {
c.Value = 'In Use';
}
} else {
valueDrop.empty().append(
...question.SelectItems.map(function (it) {
return $('<option></option>').val(it.Text).text(it.Text);
})
);
var r = String(c.Value);
if (question.SelectItems.map(function (it) { return it.Text }).includes(r)) {
valueDrop.val(r);
} else {
var i0 = question.SelectItems[0];
c.Value = i0.Text;
}
}
}
}
}
if (typeof this.wrapper.onchanged === 'function') {
this.wrapper.onchanged(id);
}
};
var onAdded = function () {
var conditional = this.conditional;
if (this.selector.val() == '-') {
this.selector.val('or');
conditional.QuestionId = 'or';
}
var c = { SubItems: [] };
conditional.SubItems.push(c);
var item = new conditionalTree(this.wrapper, c);
var items = this.children;
items.push(item);
item.ondelete = function () {
var i = items.indexOf(this);
if (i >= 0) {
items.splice(i, 1);
}
i = conditional.SubItems.indexOf(this.conditional);
if (i >= 0) {
conditional.SubItems.splice(i, 1);
}
this.tree.remove();
};
this.container.append(item.tree);
item.refresh(true);
};
var onOperatorChanged = function (op, type) {
this.conditional.Operator = op;
if (type == '1') {
this.value2.hide();
// drop
if (['eq', 'noteq'].includes(op) && (this.question.SelectItems?.length > 0 || this.question.QuestionType == 19)) {
this.value1.hide();
this.valueDrop.show();
} else {
this.value1.show();
this.valueDrop.hide();
}
} else {
this.valueDrop.hide();
this.value1.show();
if (op == 'between') {
this.value2.show();
} else {
this.value2.hide();
}
}
};
var conditionalTree = function (obj, c, root) {
this.wrapper = obj;
this.conditional = c;
this.children = [];
this.isroot = root;
var This = this;
var tree = $('<div></div>').addClass(root ? 'conditional-item-root' : 'conditional-item');
var selector = $('<select style="width: 80px; height: 26px; border: 1px solid #a9a9a9; margin-left: 6px" class="question-input"></select>')
.on('change', function () { selectorChanged.call(This, this.value) });
if (root) {
selector.append('<option selected value="-">--</option>');
}
selector.append(
$('<option selected value="or"></option>').text(GetTextByKey('P_CDH_OR', 'OR')),
$('<option value="and"></option>').text(GetTextByKey('P_CDH_AND', 'AND'))
);
tree.append(selector);
this.tree = tree;
this.selector = selector;
var addbutton = $('<span class="spanbtn iconadd" style="font-size: 14px"></span>');
addbutton.on('click', onAdded.bind(this));
tree.append(addbutton);
this.addbutton = addbutton;
var span = $('<span style="display: none"></span>');
var operator = $('<select style="width: 80px; height: 26px; border: 1px solid #a9a9a9; margin-left: 4px" class="question-input"></select>')
.on('change', function () { onOperatorChanged.call(This, this.value, $(this).attr('data-vtype')) });
var value1 = $('<input type="text" class="question-input" maxlength="200" autocomplete="off" style="width: 130px; box-sizing: border-box; height: 26px"></input>')
.on('change', function () { c.Value = this.value });
var value2 = $('<input type="text" class="question-input" maxlength="200" autocomplete="off" style="display: none; width: 130px; margin-left: 4px; box-sizing: border-box; height: 26px"></input>')
.on('change', function () { c.Value1 = this.value });
var valueDrop = $('<select class="question-input" style="display: none; height: 26px; width: 130px; border: 1px solid #a9a9a9"></select>')
.on('change', function () { c.Value = this.value });
span.append(operator, $('<span style="margin-left: 4px"></span>').append(value1, value2, valueDrop));
tree.append(span);
this.span = span;
this.operator = operator;
this.value1 = value1;
this.value2 = value2;
this.valueDrop = valueDrop;
if (!root) {
var removebutton = $('<span class="spanbtn icondelete" style="font-size: 14px"></span>');
removebutton.on('click', function () {
if (typeof This.ondelete === 'function') {
This.ondelete();
}
});
tree.append(removebutton);
}
var container = $('<div style="padding-left: 20px; overflow-y: hidden"></div>');
tree.append(container);
this.container = container;
};
conditionalTree.prototype.fill = function () {
var conditional = this.conditional;
this.selector.val(conditional.QuestionId).trigger('change');
this.operator.val(conditional.Operator).trigger('change');
this.value1.val(conditional.Value);
this.value2.val(conditional.Value1);
this.valueDrop.val(conditional.Value);
var container = this.container;
container.empty();
var items = [];
this.children = items;
if (conditional.SubItems?.length > 0) {
for (var i = 0; i < conditional.SubItems.length; i++) {
var c = conditional.SubItems[i];
var item = new conditionalTree(this.wrapper, c);
items.push(item);
item.ondelete = function () {
var i = items.indexOf(this);
if (i >= 0) {
items.splice(i, 1);
}
i = conditional.SubItems.indexOf(this.conditional);
if (i >= 0) {
conditional.SubItems.splice(i, 1);
}
this.tree.remove();
};
container.append(item.tree);
item.refresh(true);
}
}
};
conditionalTree.prototype.refresh = function (force) {
if (!force && this.wrapper.initialized) {
return;
}
this.wrapper.initialized = true;
var idIndex = this.wrapper.module.idIndex;
var secs = this.wrapper.pagemodule.sectionmodules.map(function (s) {
var qs = s.questionmodules.filter(function (q) {
return (
allowConditionQuestions.includes(Number(q.question.QuestionType)) ||
(q.question.QuestionType == fuelRecordsType && numberSubTypes.concat(dropSubTypes).includes(Number(q.question.SubType)))
) &&
idIndex > q.idIndex &&
(q.question.QuestionType != dropdownType || !bannedLookupSources.includes(Number(q.question.LookupSource)))
});
return qs.length > 0 && $('<optgroup></optgroup>').attr('label', s.section.DisplayText || s.section.Name).append(
...qs.map(function (q) {
return $('<option></option>').val(q.question.Id).text(`#${q.idIndex} - ${q.txtDisplayText?.val() || q.question.DisplayText || q.question.Name}`);
})
);
}).filter(function (s) { return s });
this.selector.children('optgroup').remove();
this.selector.append(...secs);
// fill selected
if (this.conditional.QuestionId == null) {
if (this.isroot) {
this.conditional.QuestionId = '-';
} else if (secs.length > 0) {
var f = secs[0].children('option')?.[0];
if (f != null) {
this.conditional.QuestionId = f.value;
}
}
if (this.conditional.QuestionId == null) {
this.conditional.QuestionId = 'or';
}
this.selector.val(this.conditional.QuestionId).trigger('change');
} else if (this.conditional.QuestionId?.length > 0) {
setTimeout(this.fill.bind(this), 10);
}
};
var conditionalWrapper = function (module, key, pagemodule) {
this.module = module;
this.key = key;
this.pagemodule = pagemodule;
var conditional = module.conditional;
if (conditional == null) {
conditional = module[key].Conditional;
}
if (conditional == null) {
conditional = { SubItems: [] };
}
module.conditional = conditional;
var root = new conditionalTree(this, conditional, true);
this.root = root;
};
conditionalWrapper.prototype.refresh = function () {
this.root.refresh();
};
Object.defineProperty(conditionalWrapper.prototype, 'tree', {
get: function () {
return this.root.tree;
}
});
conditionalWrapper.prototype.init = function () {
var idIndex = this.module.idIndex;
var array = this.pagemodule.sectionmodules.reduce(function (array, s) {
return array.concat(s.questionmodules.filter(function (q) {
return (
allowConditionQuestions.includes(Number(q.question.QuestionType)) ||
(q.question.QuestionType == fuelRecordsType && numberSubTypes.concat(dropSubTypes).includes(Number(q.question.SubType)))
) &&
idIndex > q.idIndex &&
(q.question.QuestionType != dropdownType || !bannedLookupSources.includes(Number(q.question.LookupSource)))
}));
}, []);
return array.length > 0;
};
conditionalWrapper.prototype.getConditional = function (nocheck, alerttitle) {
var module = this.module;
var conditional = module.conditional;
if (conditional != null) {
var questionTitle = '#' + module.idIndex + ' - ' + module[this.key].DisplayText + '\n\n';
var questions = this.pagemodule.sectionmodules.reduce(function (array, s) {
return array.concat(s.questionmodules.map(function (q) { return q }));
}, []);
var checkConditional = function (c) {
if (c.QuestionId == null || c.QuestionId == '-') {
if (c.SubItems?.length > 0) {
showAlert(questionTitle + GetTextByKey('P_CDH_MUSTBEORAND', 'If there are child nodes, the root must be "OR" or "AND".'), alerttitle);
return false;
}
return 'null';
} else if (c.QuestionId == 'or' || c.QuestionId == 'and') {
if (c.SubItems == null || c.SubItems.length == 0) {
showAlert(questionTitle + GetTextByKey('P_CDH_NOSUBITEMS', 'When the parent node is "OR" or "AND", the child node cannot be empty.'), alerttitle);
return false;
}
for (var i = c.SubItems.length - 1; i >= 0; i--) {
var sub = c.SubItems[i];
var result = checkConditional(sub);
if (result === false) {
return false;
} else if (result === 'null') {
c.SubItems.splice(i, 1);
}
}
if (c.SubItems.length === 0) {
return 'null';
}
} else {
var qmodule = questions.find(function (q) { return q.question.Id == c.QuestionId });
var q = qmodule?.question;
if (q == null) {
showAlert(questionTitle + GetTextByKey('P_CDH_NOTFOUNDQUESTION', 'Could not find the specified question: {name}.').replace('{name}', c.QuestionId), alerttitle);
return false;
}
var qname = q.DisplayText || q.Name;
if (c.Operator == null || c.Operator.length == 0) {
showAlert(questionTitle + GetTextByKey('P_CDH_INVALIDOPERATOR', 'Invalid operator of question: {name}.').replace('{name}', qname), alerttitle);
return false;
}
if (c.Value == null || c.Value.length == 0) {
showAlert(questionTitle + GetTextByKey('P_CDH_VALUEREQUIRED', 'The conditional value is required of question: {name}.').replace('{name}', qname), alerttitle);
return false;
}
if (c.Operator == 'between' && (c.Value1 == null || c.Value1.length == 0)) {
showAlert(questionTitle + GetTextByKey('P_CDH_VALUE2REQUIRED', 'If the operator is "Between", both of the values are required of question: {name}.').replace('{name}', qname), alerttitle);
return false;
}
// validate question index
if (qmodule.idIndex > module.idIndex) {
showAlert(questionTitle + GetTextByKey('P_CDH_INVALIDQUESTION', 'You can only set a previous question to be a conditional one: {name}.').replace('{name}', qname), alerttitle);
return false;
return 'null';
}
// validate question value
var qtype = Number(q.QuestionType);
var stype = Number(q.SubType);
var isnumber = numberQuestionTypes.includes(qtype);
var isdrop = dropQuestionTypes.includes(qtype);
isnumber |= qtype == fuelRecordsType && numberSubTypes.includes(stype);
isdrop |= qtype == fuelRecordsType && dropSubTypes.includes(stype);
if (isnumber) {
var nvalue = Number(c.Value);
var n2value = Number(c.Value1);
if (isNaN(nvalue)) {
showAlert(questionTitle + GetTextByKey('P_CDH_ISVALUENAN', 'Invalid number of question: {name}.').replace('{name}', qname), alerttitle);
return false;
}
if (c.Operator == 'between' && isNaN(n2value)) {
showAlert(questionTitle + GetTextByKey('P_CDH_ISVALUE2NAN', 'Invalid end number of question: {name}.').replace('{name}', qname), alerttitle);
return false;
}
if (integerQuestionTypes.includes(qtype) || (qtype == fuelRecordsType && integerSubTypes.includes(stype))) {
// integer
if (Math.floor(nvalue) != nvalue) {
showAlert(questionTitle + GetTextByKey('P_CDH_ISVALUENOTINTEGER', 'Invalid integer of question: {name}.').replace('{name}', q.DisplayText || q.Name), alerttitle);
return false;
}
if (c.Operator == 'between' && Math.floor(n2value) != n2value) {
showAlert(questionTitle + GetTextByKey('P_CDH_ISVALUE2NOTINTEGER', 'Invalid end integer of question: {name}.').replace('{name}', q.DisplayText || q.Name), alerttitle);
return false;
}
}
if (c.Operator == 'between' && n2value < nvalue) {
showAlert(questionTitle + GetTextByKey('P_CDH_INVALIDVALUERANGE', 'The end number must be greater than or equal to the start number of question: {name}.').replace('{name}', qname), alerttitle);
return false;
}
} else if (!isdrop) {
//showAlert(questionTitle + 'The question type is not supported: ' + qname + '.', alerttitle);
//return false;
return 'null';
}
}
};
if (nocheck) {
if (conditional != null && conditional.QuestionId == null && conditional.SubItems?.length == 0) {
return null;
}
return conditional;
} else {
var result = checkConditional(conditional);
if (result === false) {
return false;
}
return result === 'null' ? null : conditional;
}
}
return null;
};
return conditionalWrapper;
})

View File

@@ -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_XXX", "Language Selection") + '"/>');
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(optext);
});

View File

@@ -1,4 +1,10 @@
define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'modules/templates/picture'], function (AddQuestion, Option, Common, Picture) {
define(['modules/sections/addquestion', 'modules/sections/option', 'modules/sections/conditional', 'common', 'modules/templates/picture'], function (AddQuestion, Option, ConditionalTree, Common, Picture) {
var allowConditionQuestions = [3, 4, 5, 8, 9, 11, 12, 19];
var dropdownType = 8;
var bannedLookupSources = [2, 3];
var fuelRecordsType = 15;
var allowConditionSubTypes = [8, 9, 10, 11, 12];
var q = function (sm, question, index) {
this.sectionmodule = sm;
this.section = sm.section;
@@ -6,6 +12,15 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
this.holder = null;
this.questionholder = null;
this.index = index;
// calc id index
var idIndex = index + 1;
if (sm.pagemodule != null) {
var ss = sm.pagemodule.page.Sections;
for (var i = 0; i < sm.index; i++) {
idIndex += ss[i].Questions.length;
}
}
this.idIndex = idIndex;
this.txtName = null;
this.txtDisplayText = null;
@@ -26,8 +41,10 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
this.txtBarCodeValidate = null;
this.optionholder = undefined;
this.conditionholder = undefined;
this.optiondiv = undefined;
this.btnoption = undefined;
this.btncondition = undefined;
this.optiontr = undefined;
this.optiontd = undefined;
this.multipleselectdiv = null;
@@ -46,25 +63,22 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
q.prototype.createContent = function () {
var _this = this;
if (sectiontype === 0) {
if (!_this.question.IssueId || _this.question.IssueId == "")
editable = true;
else
editable = false;
}
var holder = $('<div class="questionitem"></div>');
_this.holder = holder;
var qholder = $('<div class="question-holder"></div>');//question holder
holder.append(qholder);
_this.questionholder = qholder;
var cholder = $('<div style="display: none"></div>'); // conditional hierarchy holder
holder.append(cholder);
_this.conditionholder = cholder;
var oholder = $('<div style="display:none;"></div>');//option holder
holder.append(oholder);
_this.optionholder = oholder;
if (this.index % 2 == 1)
qholder.addClass('holder-even');
var drag = $('<div class="question-icon" style="width:30px;" title="' + GetTextByKey("P_IPT_XXX", "Move Question") + '"><em class="spanbtn iconmove rowdrag"></em></div>');
var drag = $('<div class="question-icon" style="width:30px;" title="' + GetTextByKey("P_IPT_MOVEQUESTION", "Move Question") + '"><em class="spanbtn iconmove rowdrag"></em></div>');
qholder.append(drag);
if (!_this.section.IsLink && sectiontype == 1) {
drag.attr('draggable', true);
@@ -107,15 +121,30 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
drag.hide();
qholder.append('<div class="question-icon" style="width:30px;"><em class="fa"></em></div>');
// index
qholder.append('<div class="question-cell question-index" style="width: 30px; text-align: right">#' + String(this.idIndex) + '</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_XXX", "Language Selection") + '"/>');
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "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));
qholder.append($('<div class="question-cell question-name" style="width: 190px;padding-left:15px;"></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_XXX", "Language Selection") + '"/>');
if (_this.sectionmodule.pagemodule != null) {
_this.txtDisplayText.on('change', function () {
if ((
allowConditionQuestions.includes(_this.question.QuestionType) ||
(_this.question.QuestionType === fuelRecordsType && allowConditionSubTypes.includes(_this.question.SubType))
) &&
(q.question.QuestionType != dropdownType || !bannedLookupSources.includes(Number(q.question.LookupSource)))) {
_this.sectionmodule.pagemodule.refreshIdIndex();
}
});
}
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(_this.txtDisplayText, _this.question);
});
@@ -130,7 +159,10 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
//this.selQuestionType<70><65>createQuestionTypeCtrl<72>и<EFBFBD>ֵ
var qt = createQuestionTypeCtrl().css('width', 140);
qholder.append($('<div class="question-cell question-type" style="width: 408px"></div>').append(qt));
qholder.append($('<div class="question-cell question-type" style="width: 450px"></div>').append(qt));
if (_this.sectionmodule.pagemodule != null) {
createConditionHierarchy();
}
createOptions();
_this.chkIsRequired = $('<input type="checkbox" />');
@@ -208,13 +240,37 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
tr.append(td);
_this.selQuestionType = createQuestionType().addClass('question-input');
td.append(_this.selQuestionType);
_this.selQuestionType.change(function () {
_this.selQuestionType.on('change', function () {
_this.questionTypeChange(true);
if (_this.sectionmodule.pagemodule != null &&
(allowConditionQuestions.includes(_this.question.QuestionType) ||
(_this.question.QuestionType === fuelRecordsType && allowConditionSubTypes.includes(_this.question.SubType)))) {
_this.sectionmodule.pagemodule.refreshIdIndex();
}
});
if (_this.sectionmodule.pagemodule != null) {
td = $('<td></td>');
tr.append(td);
_this.btncondition = $('<span class="spanbtn iconconditional" style="font-size: 12px" title="' + GetTextByKey("P_IPT_CONDITIONALHIERARCHY", "Conditional Hierarchy") + '"></span>');
td.append(_this.btncondition);
_this.btncondition.click(function () {
var icon = $(this);
if (icon.hasClass('iconbold')) {
icon.removeClass('iconbold');
_this.conditionholder.hide();
}
else {
icon.addClass('iconbold');
_this.conditionalTree.refresh();
_this.conditionholder.show();
}
});
}
td = $('<td></td>');
tr.append(td);
_this.btnoption = $('<span class="spanbtn iconangleleft" style="font-size:18px;" title="' + GetTextByKey("P_IPT_XXX","Display Options") + '"></span>');
_this.btnoption = $('<span class="spanbtn iconangleleft" style="font-size:18px;" title="' + GetTextByKey("P_IPT_DISPLAYOPTIONS", "Display Options") + '"></span>');
td.append(_this.btnoption);
_this.btnoption.click(function () {
var icon = $(this);
@@ -257,21 +313,21 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
});
td.append(_this.txtTransactionDate);
_this.selState = createState().addClass('question-input').css({ 'width': 116, 'margin-left': '3px' });
_this.selState = createState().addClass('question-input').css({ 'width': 110, 'margin-left': '3px' });
_this.selState.hide();
_this.selState.change(function () {
_this.stateChange(true);
});
td.append(_this.selState);
_this.selFuelType = createFuelType().addClass('question-input').css({ 'width': 116, 'margin-left': '3px' });
_this.selFuelType = createFuelType().addClass('question-input').css({ 'width': 110, 'margin-left': '3px' });
_this.selFuelType.hide();
_this.selFuelType.change(function () {
_this.fuelTypeChange(true);
});
td.append(_this.selFuelType);
_this.selDistributedBy = createDistributedBy().addClass('question-input').css({ 'width': 116, 'margin-left': '3px' });
_this.selDistributedBy = createDistributedBy().addClass('question-input').css({ 'width': 110, 'margin-left': '3px' });
_this.selDistributedBy.hide();
_this.selDistributedBy.change(function () {
_this.distributedByChange(true);
@@ -318,6 +374,23 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
return tb;
}
function createConditionHierarchy() {
var div = $('<div style="width:680px;margin-left:540px;padding-left:5px;padding-bottom:5px; border: 1px solid #a8a8a8;line-height:32px;"></div>');
_this.conditionholder.append(div);
div.append($('<span style="font-weight: bold; margin-right: 5px"></span>').text(GetTextByKey('P_IPT_CONDITIONHIERARCHY', 'Condition Hierarchy')));
var root = new ConditionalTree(_this, 'question', _this.sectionmodule.pagemodule);
root.onchanged = function (id) {
if (id === '-') {
_this.btncondition.removeClass('iconexists');
} else {
_this.btncondition.addClass('iconexists');
}
};
_this.conditionalTree = root;
div.append(root.tree);
}
function createOptions() {
_this.optiondiv = $('<div style="width:680px;margin-left:540px;padding-left:5px;padding-bottom:5px; border: 1px solid #a8a8a8;line-height:32px;"></div>');
_this.optionholder.append(_this.optiondiv);
@@ -364,8 +437,8 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
items.push({ 'Key': 16, "Value": GetTextByKey("P_IPT_QT_BARCODE", "Bar Code") });
items.push({ 'Key': 17, "Value": GetTextByKey("P_IPT_QT_BARCODEVALIDATE", "Bar Code Validate") });
items.push({ 'Key': 18, "Value": GetTextByKey("P_IPT_QT_FUELUSED", "Fuel Used") });
items.push({ 'Key': 19, "Value": GetTextByKey("P_IPT_QT_XXX", "Asset Status") });
var sel = $('<select style="width:140px; height:26px;"></select>');
items.push({ 'Key': 19, "Value": GetTextByKey("P_IPT_QT_ASSETSTATUS", "Asset Status") });
var sel = $('<select style="width:110px; height:26px;"></select>');
for (var i = 0; i < items.length; i++) {
var item = items[i];
sel.append('<option value="' + item.Key + '">' + item.Value + '</option>');
@@ -392,7 +465,7 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
items.push({ 'Key': 14, "Value": GetTextByKey("P_IPT_ST_NOTES", "Notes") });
items.push({ 'Key': 15, "Value": GetTextByKey("P_IPT_ST_PICTURE", "Picture") });
items.push({ 'Key': 16, "Value": GetTextByKey("P_IPT_ST_DISTRIBUTEDBY", "Distributed By") });
var sel = $('<select style="width:125px; height:26px;"></select>');
var sel = $('<select style="width:110px; height:26px;"></select>');
for (var i = 0; i < items.length; i++) {
var item = items[i];
sel.append('<option value="' + item.Key + '">' + item.Value + '</option>');
@@ -405,7 +478,7 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
items.push({ 'Key': "", "Value": "" });
items.push({ 'Key': "0", "Value": GetTextByKey("P_FR_FUELINGSTATION", "Fueling Station") });
items.push({ 'Key': "1", "Value": GetTextByKey("P_FR_FUELINGASSET", "Fueling Asset") });
var sel = $('<select style="width:125px; height:26px;"></select>');
var sel = $('<select style="width:110px; height:26px;"></select>');
for (var i = 0; i < items.length; i++) {
var item = items[i];
sel.append('<option value="' + item.Key + '">' + item.Value + '</option>');
@@ -665,6 +738,8 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
_this.optionholder.find('table').remove();
_this.optionmodules = [];
}
else if (type == "5")
_this.additemspan.hide();
else {
_this.additemspan.show();
}
@@ -762,6 +837,14 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
this.question = question;
}
if (this.btncondition != null) {
if (question.Conditional != null) {
this.btncondition.addClass('iconexists');
} else {
this.btncondition.removeClass('iconexists');
}
}
this.txtName.val(question.Name).data("texts", question.LocalNames);
this.txtDisplayText.val(question.DisplayText).data("texts", question.LocalDisplayTexts);
this.selQuestionType.val(question.QuestionType);
@@ -881,12 +964,18 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
// }
// }
//}
var conditional = this.conditionalTree?.getConditional(nocheck, alerttitle);
if (conditional === false) {
return false;
}
question.Conditional = conditional;
return question;
};
q.prototype.delete = function () {
var _this = this;
showConfirm(GetTextByKey("P_IPT_AREYOUSUREYOUWANTTODELETETHISQUESTION", 'Are you sure you want to delete this question?'), GetTextByKey("P_IPT_DELETEQUESTION", "Delete Question"), function () {
if (!_this.question.Id) {
if (_this.question._isadd) {
_this.holder.remove();
return;
}
@@ -894,8 +983,9 @@ define(['modules/sections/addquestion', 'modules/sections/option', 'common', 'mo
inspectionrequest("DeleteGlobalQuestion", p, function (data) {
if (data !== 'OK')
showAlert(data, GetTextByKey("P_IPT_DELETEQUESTION", "Delete Question"));
else if (_this.sectionmodule && typeof _this.sectionmodule.refresh === "function")
else if (_this.sectionmodule && typeof _this.sectionmodule.refresh === "function") {
_this.sectionmodule.refresh();
}
}, function (err) {
showAlert(GetTextByKey("P_IPT_FAILEDTODELETEQUESTION", 'Failed to delete question.'), GetTextByKey("P_IPT_DELETEQUESTION", "Delete Question"));
});

View File

@@ -1,14 +1,32 @@
define(['modules/sections/question', 'modules/sections/addsection', 'modules/sections/addquestion', 'common', 'modules/templates/picture']
, function (Question, AddSection, AddQuestion, Common, Picture) {
var s = function (section, gsm, pm) {
define(['modules/sections/question', 'modules/sections/addsection', 'modules/sections/addquestion', 'modules/sections/conditional', 'common', 'modules/templates/picture']
, function (Question, AddSection, AddQuestion, ConditionalTree, Common, Picture) {
var s = function (section, gsm, pm, index) {
this.section = section;
this.content = null;
this.holder = null;
this.gsmodule = gsm;
this.pagemodule = pm;
if (pm != null) {
if (isNaN(index)) {
index = pm.page.Sections.length - 1;
}
this.index = index;
// calc id index
var idIndex = 1;
var ss = pm.page.Sections;
for (var i = 0; i < index; i++) {
idIndex += ss[i].Questions.length;
}
this.idIndex = idIndex;
} else {
this.index = index;
}
this.txtName = null;
this.txtDisplayText = null;
this.displayonreportcontrol = null;
this.conditionholder = null;
this.btncondition = null;
if (!this.section.Questions)
this.section.Questions = [];
@@ -22,23 +40,25 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
s.prototype.createContent = function () {
var content = $('<div></div>');
this.content = content;
var div = $('<div class="sectionitem"></div>');
var holder = $('<div class="section-holder"></div>');
content.append(holder);
var _this = this;
if (sectiontype === 0) {
if (!_this.section.IssueId || _this.section.IssueId == "")
editable = true;
else
editable = false;
div.append(holder);
var isGlobal = this.pagemodule == null;
if (!isGlobal) {
var cholder = $('<div style="display: none"></div>'); // conditional hierarchy holder
div.append(cholder);
this.conditionholder = cholder;
}
content.append(div);
var _this = this;
if (sectiontype === 0) {
var package = $('<div class="question-icon section-packages" style="width:30px;padding-left:10px;"><em class="fa icon-menu icon-packages"></em></div>');
var package = $('<div class="question-icon section-packages" style="width:30px;"><em class="spanbtn icon-packages" style="font-size:16px;"></em></div>');
holder.append(package);
}
if (sectiontype == 1) {
var drag = $('<div class="question-icon" style="width:30px;" title="' + GetTextByKey("P_IPT_XXX","Move Section") + '"><em class="spanbtn iconmove rowdrag"></em></div>');
var drag = $('<div class="question-icon" style="width:30px;" title="' + GetTextByKey("P_IPT_MOVESECTION", "Move Section") + '"><em class="spanbtn iconmove rowdrag"></em></div>');
holder.append(drag);
if (sectiontype == 1) {
drag.attr('draggable', true);
@@ -102,21 +122,21 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
}
});
holder.append(btnsection);
this.txtName = $('<input type="text" class="section-input" maxlength="100" autocomplete="off" style="width:156px;" />');
this.txtName = $('<input type="text" class="section-input" maxlength="100" autocomplete="off" style="width:191px;" />');
this.txtName.change(function () {
_this.onsave();
});
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>');
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(_this.txtName, _this.section);
});
holder.append($('<div class="section-cell section-name" style="width:200px;flex-grow:0;"></div>').append(this.txtName).append(addiText));
holder.append($('<div class="section-cell section-name" style="width:235px;flex-grow:0;"></div>').append(this.txtName).append(addiText));
this.txtDisplayText = $('<input type="text" class="section-input" maxlength="200" autocomplete="off" style="width:236px;" />');
this.txtDisplayText.change(function () {
_this.onsave();
});
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>');
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(_this.txtDisplayText, _this.section);
});
@@ -125,11 +145,55 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
var picturemodule = new Picture(false, _this.section, function () { _this.onsave() });
picturemodule.createContent();
});
holder.append($('<div class="section-cell section-display" style="width:230px;flex-grow: 1;"><span></span></div>').append(this.txtDisplayText).append(addiText).append(imgicon));
if (sectiontype === 0)
holder.append($('<div class="section-cell section-createdby" style="text-align:center;"><span></span></div>'));
var funcs = $('<div class="section-cell section-func" style="width: 120px;text-align:right;padding-right:20px;"></div>');
holder.append($('<div class="section-cell section-display" style="flex-grow: 0;"><span></span></div>').css('width', isGlobal ? 680 : 425).append(this.txtDisplayText).append(addiText).append(imgicon));
this.displayonreportcontrol = $('<input type="checkbox" />')
.attr('title', GetTextByKey("P_IPT_SECITONDISPLAYONREPORTTIPS", 'Checked indicates that the section breakout \n will appear on the final report.\n\n Unchecked indicates that the section is only \n visible during inspection completion.'));
this.displayonreportcontrol.change(function () {
_this.onsave();
});
if (!isGlobal) {
var tb = (function () {
var tb = $('<table style="line-height:unset;"></table>');
var tr = $('<tr></tr>');
tb.append(tr);
var td = $('<td></td>');
tr.append(td);
_this.btncondition = $('<span class="spanbtn iconconditional" style="font-size: 12px" title="' + GetTextByKey("P_IPT_CONDITIONALHIERARCHY", "Conditional Hierarchy") + '"></span>');
td.append(_this.btncondition);
_this.btncondition.click(function () {
var icon = $(this);
if (icon.hasClass('iconbold')) {
icon.removeClass('iconbold');
_this.conditionholder.hide();
}
else {
icon.addClass('iconbold');
_this.conditionalTree.refresh();
_this.conditionholder.show();
}
});
return tb;
})();
holder.append($('<div class="section-cell" style="width: 255px; flex-grow: 0"></div>').append(tb));
!(function createConditionHierarchy() {
var div = $('<div style="width:680px;margin-left:540px;padding-left:5px;padding-bottom:5px; border: 1px solid #a8a8a8;line-height:32px;"></div>');
_this.conditionholder.append(div);
div.append($('<span style="font-weight: bold; margin-right: 5px"></span>').text(GetTextByKey('P_IPT_CONDITIONHIERARCHY', 'Condition Hierarchy')));
var root = new ConditionalTree(_this, 'section', _this.pagemodule);
_this.conditionalTree = root;
div.append(root.tree);
})();
}
holder.append($('<div class="section-cell section-displayonreport" style="width:80px;text-align:center;flex-grow:0;"></div>').append(this.displayonreportcontrol));
holder.append($('<div style="min-width:265px;flex-grow:1;"></div>'));//ռλ
var funcs = $('<div class="section-cell section-func" style="width: 160px;text-align:right;padding-right:20px;"></div>');
holder.append(funcs);
//holder.find('.section-name span').click(function () {
@@ -163,7 +227,19 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
// }
// $('#right_popup1').empty().append(aq.createContent()).show();
//}
var question = { QuestionType: '0', IsRequired: false, CanComment: false, IsImportant: false, SeverityLevel: 0, LookupSource: 0, SelectItems: [] };
var question = {
_isadd: true,
QuestionType: '0',
IsRequired: false,
CanComment: false,
IsImportant: false,
SeverityLevel: 0,
LookupSource: 0,
SelectItems: []
};
if (!isGlobal) {
question.Id = $.generateUUID();
}
_this.section.Questions.push(question);
_this.addQuestionModule(question);
}).attr('title', GetTextByKey("P_IPT_ADDQUESTION", 'Add Question')));
@@ -207,6 +283,7 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
if (templatereadonly || !editable) {
this.txtName.prop('disabled', true);
this.txtDisplayText.prop('disabled', true);
this.displayonreportcontrol.prop('disabled', true);
this.holder.find(".iconmultitext").hide();
this.holder.find(".iconimage").hide();
@@ -236,23 +313,29 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
s.prototype.updateContent = function (section) {
if (section) {
if (sectiontype === 0) {
if (!section.IssueId || section.IssueId == "") {
if (!section.IssueId || section.IssueId == "")
this.holder.find('.section-packages em').hide();
this.holder.find('.section-createdby span').text('');
}
else {
else
this.holder.find('.section-packages em').show();
this.holder.find('.section-createdby span').text(section.IssueName);
}
}
this.txtName.val(section.Name).data("texts", section.LocalNames);
this.txtDisplayText.val(section.DisplayText).data("texts", section.LocalDisplayTexts);;
this.txtDisplayText.val(section.DisplayText).data("texts", section.LocalDisplayTexts);
if (this.btncondition != null) {
if (section.Conditional != null) {
this.btncondition.addClass('iconexists');
} else {
this.btncondition.removeClass('iconexists');
}
}
this.displayonreportcontrol.attr('checked', section.DisplayOnReport);
}
};
s.prototype.getSectionValue = function (noalert, nocheck) {
var section = this.section;
section.Name = this.txtName.val();
section.DisplayText = this.txtDisplayText.val();
section.DisplayOnReport = this.displayonreportcontrol.prop('checked');
var alerttitle = GetTextByKey("P_IPT_SECTION", "Section");
if (!nocheck) {
if (!section.Name || section.Name.length == 0) {
@@ -282,6 +365,11 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
section.Questions.push(q);
}
}
var conditional = this.conditionalTree?.getConditional(nocheck, alerttitle);
if (conditional === false) {
return false;
}
section.Conditional = conditional;
return section;
};
s.prototype.updateQuestions = function (questions) {
@@ -291,10 +379,11 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
this.questionmodules = [];
this.content.children('.question-holder').remove();
for (var i = 0; i < questions.length; i++) {
this.addQuestionModule(questions[i]);
this.addQuestionModule(questions[i], true);
}
this.pagemodule?.refreshIdIndex();
};
s.prototype.addQuestionModule = function (q) {
s.prototype.addQuestionModule = function (q, init) {
var _this = this;
if (this.section.IsLink)
q.IsLink = true;
@@ -305,13 +394,21 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
qmodule.ondelete = function (qm) {//qm:question module
_this.section.Questions.splice(_this.section.Questions.indexOf(qm.question), 1);
_this.questionmodules.splice(_this.questionmodules.indexOf(qm), 1);
_this.pagemodule?.refreshIdIndex();
}
this.questionmodules.push(qmodule);
this.content.append(qmodule.createContent());
if (!init) {
this.pagemodule?.refreshIdIndex();
}
};
s.prototype.oncopyquestion = function (question) {
question = JSON.parse(JSON.stringify(question));
question.Id = "";
question._isadd = true;
if (this.pagemodule != null) {
question.Id = $.generateUUID();
}
question.Conditional = null;
//question.IsLink = false;
//question.ReferenceId = "";
if (!this.section.Questions)
@@ -366,6 +463,7 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
if (this.section.Questions.length == 0) {
this.section.Questions.push(qm.question);
this.questionmodules.push(qm);
this.pagemodule?.refreshIdIndex();
return;
}
var tindex = 0;
@@ -377,6 +475,7 @@ define(['modules/sections/question', 'modules/sections/addsection', 'modules/sec
if (tindex >= 0) {
this.section.Questions.splice(tindex, 0, qm.question);
this.questionmodules.splice(tindex, 0, qm);
this.pagemodule?.refreshIdIndex();
}
};
s.prototype.dragInSection = function () {//called when section dragged end at question

View File

@@ -10,6 +10,7 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
var makeinputcontrol = undefined;
var modelinputcontrol = undefined;
var typeinputcontrol = undefined;
var groupinputcontrol = undefined;
tps.createContent = function (args) {
sectiontype = 1;//sectiontype:0 - global,1 - normal
if (args && args.length > 0)
@@ -35,15 +36,43 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
});
search_bar.append(makeinputcontrol);
search_bar.append('<span style="margin-left:10px;">' + GetTextByKey("P_IPT_MODEL_COLON", "Model:") + '</span>');
modelinputcontrol = $('<select type="text" style="margin-left: 5px; width:160px;height:22px;" autocomplete="off" />');
search_bar.append(modelinputcontrol)
modelinputcontrol = $('<div></div>').css('width', 160).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Name',
valueKey: 'ID',
parent: '#content'
});
search_bar.append(modelinputcontrol);
search_bar.append('<span style="margin-left:10px;">' + GetTextByKey("P_IPT_TYPE_COLON", "Type:") + '</span>');
typeinputcontrol = $('<select type="text" style="margin-left: 5px; width:160px;height:22px;" autocomplete="off" />');
search_bar.append(typeinputcontrol)
typeinputcontrol = $('<div></div>').css('width', 160).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Name',
valueKey: 'ID',
parent: '#content'
});
search_bar.append(typeinputcontrol);
search_bar.append('<span style="margin-left:10px;">' + GetTextByKey("P_AM_ASSETGROUP_COLON", "Asset Group:") + '</span>');
groupinputcontrol = $('<div></div>').css('width', 160).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Name',
valueKey: 'Id',
parent: '#content'
});
search_bar.append(groupinputcontrol);
getAssetMakes();
getAssetModels();
getAssetTypes();
getAssetGroups();
}
searchinputcontrol = $('<input type="text" autocomplete="off" style="margin-left:10px;" />');
@@ -82,7 +111,6 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
dataheader.append('<div class="question-cell" style="width:400px">' + GetTextByKey("P_IPT_NAME", "Name") + '</div>');
//dataheader.append('<div class="question-cell" style="width: 200px">Display Text</div>');
dataheader.append('<div class="question-cell" style="width:400px">' + GetTextByKey("P_IPT_NOTES", "Notes") + '</div>');
dataheader.append('<div class="question-cell" style="width:200px">' + GetTextByKey("P_IPT_CREATEDBY", "Created By") + '</div>');
dataheader.append('<div class="question-cell" style="width:90px;padding-right:20px;"></div>');
content.append(dataheader);
@@ -104,16 +132,20 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
var searchtxt = searchinputcontrol.val();
searchtxt = htmlencode(searchtxt);
var makeid = -1;
var modelid = -1;
var typeid = -1;
var modelids = [];
var typeids = [];
var groupids = [];
if (!teamintelligence) {
makeid = makeinputcontrol.val();
modelid = modelinputcontrol.val();
typeid = typeinputcontrol.val();
modelids = modelinputcontrol.dropdownVals();
typeids = typeinputcontrol.dropdownVals();
groupids = groupinputcontrol.dropdownVals();
}
var p = JSON.stringify([teamintelligence, templatestatus, searchtxt, makeid, modelid, typeid]);
var p = JSON.stringify([teamintelligence, templatestatus, searchtxt, makeid, JSON.stringify(modelids), JSON.stringify(typeids), JSON.stringify(groupids)]);
showloading(true);
inspectionrequest("GetTemplates", htmlencode(p), function (data) {
showloading(false);
datacontent.empty();
if (data) {
for (var i = 0; i < data.length; i++) {
@@ -122,12 +154,14 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
}
}
}, function (err) {
showloading(false);
});
}
var makesdata = undefined;
var modelsdata = undefined;
var typesdata = undefined;
var groupsdata = undefined;
function getAssetMakes() {
inspectionrequest("GetAssetMakes", "", function (data) {
if (data && data.length > 0) {
@@ -160,6 +194,16 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
});
}
function getAssetGroups() {
inspectionrequest("GetAssetGroups", "", function (data) {
if (data && data.length > 0) {
groupsdata = data;
showAssetGroups();
}
}, function (err) {
});
}
function showAssetMakes() {
makeinputcontrol.append('<option value="-1">*</option>');
if (makesdata && makesdata.length > 0) {
@@ -172,31 +216,45 @@ define(['modules/templates/template', 'modules/templates/addtemplate'], function
}
function showAssetModels() {
modelinputcontrol.empty();
var makeid = makeinputcontrol.val();
modelinputcontrol.append('<option value="-1">*</option>');
if (!makeid || makeid == "-1")
modelinputcontrol.prop('disabled', true);
modelinputcontrol.dropdownDisabled(true);
else
modelinputcontrol.prop('disabled', false);
modelinputcontrol.dropdownDisabled(false);
var match_items = [];
if (modelsdata && modelsdata.length > 0 && makeid != "-1") {
for (var i = 0; i < modelsdata.length; i++) {
var item = modelsdata[i];
if (item.MakeID == parseInt(makeid)) {
modelinputcontrol.append('<option value="' + item.ID + '">' + item.Name + '</option>');
match_items.push(item);
}
}
}
modelinputcontrol.dropdownSource(match_items);
modelinputcontrol.dropdownVals([-1]);
}
function showAssetTypes() {
typeinputcontrol.append('<option value="-1">*</option>');
var match_items = [];
if (typesdata && typesdata.length > 0) {
for (var i = 0; i < typesdata.length; i++) {
var item = typesdata[i];
typeinputcontrol.append('<option value="' + item.Key + '">' + item.Value + '</option>');
match_items.push(typesdata[i]);
}
}
typeinputcontrol.dropdownSource(match_items);
}
function showAssetGroups() {
var match_items = [];
if (groupsdata && groupsdata.length > 0) {
for (var i = 0; i < groupsdata.length; i++) {
match_items.push(groupsdata[i]);
}
}
groupinputcontrol.dropdownSource(match_items);
}
return tps;
});

View File

@@ -13,6 +13,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
var locationenabledcontrol = undefined;
var needsignaturecontrol = undefined;
var forworkordercontrol = undefined;
var displayidentitycontrol = undefined;
var displaycommittimecontrol = undefined;
var displaycommitbycontrol = undefined;
var displayinspectiontitlecontrol = undefined;
@@ -31,7 +32,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
s.prototype.createContent = function () {
var content = $('<div style="min-width:1350px;"></div>');
var content = $('<div style="min-width:1450px;"></div>');
this.content = content;
var _this = this;
function createHeader() {
@@ -111,19 +112,23 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
forworkordercontrol = $('<input type="checkbox"/>');
td.append(forworkordercontrol);
}
td.append($('<span style="margin-left:40px"></span>').text(GetTextByKey("P_IPT_DISPLAYIDENTIFIEDISSUES_COLON", "Display Identified Issues:")));
displayidentitycontrol = $('<input type="checkbox" checked="checked"/>');
td.append(displayidentitycontrol);
tr.append(td);
tr = $('<tr class="templatetr"></tr>');
tb.append(tr);
tr.append('<td class="label" style="width:160px;">' + GetTextByKey("P_IPT_XXXXX_COLON", "Display Commit Time:") + '</td>');
tr.append('<td class="label" style="width:160px;">' + GetTextByKey("P_IPT_DISPLAYCOMMITTIME_COLON", "Display Commit Time:") + '</td>');
displaycommittimecontrol = $('<input type="checkbox" checked="checked"/>');
displaycommitbycontrol = $('<input type="checkbox" checked="checked"/>');
displayinspectiontitlecontrol = $('<input type="checkbox" checked="checked"/>');
var td = $('<td></td>').append(
displaycommittimecontrol,
$('<span style="margin-left:40px"></span>').text(GetTextByKey("P_IPT_XXXXXX_COLON", "Display Commit By:")),
$('<span style="margin-left:40px"></span>').text(GetTextByKey("P_IPT_DISPLAYCOMMITBY_COLON", "Display Commit By:")),
displaycommitbycontrol,
$('<span style="margin-left:40px"></span>').text(GetTextByKey("P_IPT_XXXXXX_COLON", "Display Inspection Title:")),
$('<span style="margin-left:40px"></span>').text(GetTextByKey("P_IPT_DISPLAYINSPECTIONTITLE_COLON", "Display Inspection Title:")),
displayinspectiontitlecontrol
);
tr.append(td);
@@ -203,39 +208,35 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
}
function createEmailContent() {
var tb = $('<table style="line-height:25px;margin-top:10px;"></table>');
var tb = $('<table style="line-height:24px;margin-top:10px;width:470px;"></table>');
var tr = $('<tr></tr>');
tb.append(tr);
tr.append($('<td>' + GetTextByKey('P_IPT_SENDTHISTO', 'Who do you want to send this to? Select from existing relationships or manual entry.') + '</td>'));
tr.append($('<td colspan="2">' + GetTextByKey('P_IPT_SENDTHISTO', 'Who do you want to send this to? Select from existing relationships or manual entry.') + '</td>'));
tr = $('<tr></tr>');
tb.append(tr);
tr.append($('<td></td>').append(InitContactGridData()));
tr.append($('<td colspan="2"></td>').append(InitContactGridData()));
tr = $('<tr></tr>');
tb.append(tr);
tr.append($('<td>' + GetTextByKey("P_IPT_EMAILADDRESSESTIPS", "Separate multiple manually entered email addresses with a semi-colon (;).") + '</td>'));
tr.append($('<td colspan="2">' + GetTextByKey("P_IPT_EMAILADDRESSESTIPS", "Separate multiple manually entered email addresses with a semi-colon (;).") + '</td>'));
tr = $('<tr></tr>');
tb.append(tr);
otheremailcontrol = $('<input type="text" class="form-control" maxlength="1000" autocomplete="off" style="margin-left:5px;width: 312px;" autocomplete="off" />');
tr.append($('<td><span>' + GetTextByKey("P_IPT_OTHEREMAILADDRESS", "Other Email Address") + '</span></td>').append(otheremailcontrol));
otheremailcontrol = $('<input type="text" class="form-control" maxlength="1000" autocomplete="off" style="width: 350px;" autocomplete="off" />');
tr.append($('<td style="padding-right:5px;"><span>' + GetTextByKey("P_IPT_OTHEREMAILADDRESS", "Other Email Address") + '</span></td>'));
tr.append($('<td></td>').append(otheremailcontrol));
td = $('<td></td>');
td = $('<td colspan="2"></td>');
tr.append(td);
return tb;
}
function InitContactGridData() {
var div_grid = $('<div style="width:430px;height:160px;"></div>');
grid_contactdt = new GridView(div_grid);
grid_contactdt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
var div_grid = $('<div style="width:470px;height:160px;"></div>');
grid_contactdt = createGridView(div_grid);
var list_columns = [
{ 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' } },
@@ -265,12 +266,6 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
grid_contactdt.canMultiSelect = false;
grid_contactdt.columns = columns;
grid_contactdt.init();
grid_contactdt.selectedrowchanged = function (rowindex) {
var rowdata = grid_contactdt.source[rowindex];
if (rowdata) {
}
}
return div_grid;
}
@@ -308,8 +303,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
}
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_contactdt.setData(rows);
@@ -342,11 +336,11 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
filtertd.empty();
pagesicon = $('<div class="section-icon" style="width:30px;margin:10px 0 5px 15px;font-size:18px;color:#666;">' + GetTextByKey("P_IPT_PAGES", "Pages") + '</div>');
content.append(pagesicon);
subcontent.append(pagesicon);
var template = _this.template;
if (template.Id) {
if ((!template.IssueId || template.IssueId == "") && (template.Editable))
if (template.Editable)
editable = true;
else
editable = false;
@@ -356,6 +350,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
needsignaturecontrol.prop('checked', template.NeedSignature);
if (forworkordercontrol)
forworkordercontrol.prop('checked', template.ForWorkOrder);
displayidentitycontrol.prop('checked', template.DisplayInspectionIssues);
displaycommittimecontrol.prop('checked', template.DisplayCommitTime);
displaycommitbycontrol.prop('checked', template.DisplayCommitBy);
@@ -364,8 +359,6 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
layoutcontrol.val(template.ReportLayoutId);
if (IsForesight) {
lockedcontrol.prop('checked', !template.Editable);
if (template.IssueId && template.IssueId != "")
lockedcontrol.prop('disabled', true);
}
notescontrol.val(template.Notes);
@@ -374,7 +367,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
var next = function () {
pages = new Pages(template.Pages);
pagescontent = pages.createContent();
content.append(pagescontent);
subcontent.append(pagescontent);
if (!teamintelligence) {
filtersmodule = new Filters(template.Filters)
filtertd.append(filtersmodule.createContent(template));
@@ -393,7 +386,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
var next = function () {
pages = new Pages();
pagescontent = pages.createContent();
content.append(pagescontent);
subcontent.append(pagescontent);
if (!teamintelligence) {
filtersmodule = new Filters()
filtertd.append(filtersmodule.createContent());
@@ -431,6 +424,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
if (forworkordercontrol)
forworkordercontrol.prop('disabled', false);
displayidentitycontrol.prop('disabled', false);
displaycommittimecontrol.prop('disabled', false);
displaycommitbycontrol.prop('disabled', false);
@@ -446,6 +440,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
needsignaturecontrol.prop('disabled', true);
if (forworkordercontrol)
forworkordercontrol.prop('disabled', true);
displayidentitycontrol.prop('disabled', true);
displaycommittimecontrol.prop('disabled', true);
displaycommitbycontrol.prop('disabled', true);
@@ -463,6 +458,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
needsignaturecontrol.prop('disabled', true);
if (forworkordercontrol)
forworkordercontrol.prop('disabled', true);
displayidentitycontrol.prop('disabled', true);
displaycommittimecontrol.prop('disabled', true);
displaycommitbycontrol.prop('disabled', true);
@@ -534,7 +530,7 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
};
if (forworkordercontrol)
item.ForWorkOrder = forworkordercontrol.prop('checked');
item.DisplayInspectionIssues = displayidentitycontrol.prop('checked');
if (teamintelligence)
item.Target = 1;
@@ -584,8 +580,9 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
}
item.Emails = otheremailaddressstr;
item.EmailList = [];
for (var i = 0; i < grid_contactdt.source.length; i++) {
var ct = grid_contactdt.source[i].Values;
var tempsource = grid_contactdt.source;
for (var i = 0; i < tempsource.length; i++) {
var ct = tempsource[i];
if (ct.Selected)
item.EmailList.push(ct);
}
@@ -620,6 +617,10 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
}
}
}
for (var i = 0; i < pages.pageModules.length; i++) {
pages.pageModules[i]?.refreshIdIndex();
}
}
item.Filters = [];
@@ -635,18 +636,23 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
inspectionrequest("SaveTemplate", p, function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_IPT_SAVETEMPLATE", 'Save Template'));
} else {
return;
} else if (typeof data === 'number') {
if (!_this.template.Id) {
_this.template.Id = data[0];
}
if (exit == 0) {
showAlert(GetTextByKey("P_IPT_SAVSUCCESSFULLY", 'Saved successfully.'), GetTextByKey("P_IPT_SAVETEMPLATE", 'Save Template'));
_this.datasaved = true;
}
if (exit == 1) {
_this.gsmodule.refresh();
showRightPopup(false);
_this.template.Id = data;
}
} else {
_this.template = data;
}
if (exit == 0) {
showAlert(GetTextByKey("P_IPT_SAVSUCCESSFULLY", 'Saved successfully.'), GetTextByKey("P_IPT_SAVETEMPLATE", 'Save Template'));
_this.datasaved = true;
} else {
}
if (exit == 1) {
_this.gsmodule.refresh();
showRightPopup(false);
}
}, function (err) {
showAlert(GetTextByKey("P_IPT_FAILEDTOSAVETEMPLATE", 'Failed to save Template.'), GetTextByKey("P_IPT_SAVETEMPLATE", 'Save Template'));
@@ -654,7 +660,9 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
}
content.append(createHeader());
content.append(createTemplateContent());
var subcontent = $('<div style="overflow:auto;"></div>');
content.append(subcontent);
subcontent.append(createTemplateContent());
if (this.template.Id)
getTemplateInfo(this.template.Id);
@@ -666,6 +674,12 @@ define(['modules/templates/pages', 'modules/templates/filters', 'modules/templat
if (templatereadonly)
setDisabled();
function resizeContent() {
subcontent.css('height', $(window).height() - 95);
}
window.onresize = resizeContent;
resizeContent();
return content;
}
return s;

View File

@@ -62,6 +62,7 @@ define(['common'], function (Common) {
this.txtmake = null;
this.txtmodel = null;
this.txttype = null;
this.txtgroup = null;
this.ondelete = null;
};
fm.prototype.description = "Template filter module";
@@ -91,6 +92,10 @@ define(['common'], function (Common) {
this.txttype = $('<td style="width:120px;padding-left:5px;overflow:hidden;"></td>');
tr.append(this.txttype);
tr.append($('<td style="width:115px;text-align:right;">' + GetTextByKey("P_AM_ASSETGROUP_COLON", "Asset Group:") + '</td>'));
this.txtgroup = $('<td style="width:120px;padding-left:5px;overflow:hidden;"></td>');
tr.append(this.txtgroup);
var btnedit = $('<em class="spanbtn iconedit"></em>').click(function () {
_this.editFilter();
}).attr('title', GetTextByKey("P_IPT_EDIT", 'Edit'));
@@ -116,6 +121,7 @@ define(['common'], function (Common) {
this.txtmake.text(flt.MakeName);
this.txtmodel.text(flt.ModelName);
this.txttype.text(flt.TypeName);
this.txtgroup.text(flt.AssetGroupName);
}
}
fm.prototype.getFilterValue = function () {
@@ -145,7 +151,7 @@ define(['common'], function (Common) {
var selMake = null;
var selModel = null;
var selType = null;
var selGroup = null;
var _this = this;
this.beginEdit = function (filter, onok) {
@@ -154,14 +160,16 @@ define(['common'], function (Common) {
if (this.filter) {
txtVIN.val(this.filter.VIN);
selMake.val(this.filter.AssetMake);
selModel.val(this.filter.AssetModel);
selType.val(this.filter.AssetType);
selModel.dropdownVal(this.filter.AssetModel);
selType.dropdownVal(this.filter.AssetType);
selGroup.dropdownVals(this.filter.AssetGroups || []);
}
else {
txtVIN.val('');
selMake.val('-1');
selModel.val('-1');
selType.val('-1');
selModel.dropdownVal(-1);
selType.dropdownVal(-1);
selGroup.dropdownVals([]);
}
showAssetModels();
@@ -173,7 +181,7 @@ define(['common'], function (Common) {
}
this.createContent = function () {
var tb = $('<table></table>');
var tb = $('<table style="line-height:30px;"></table>');
var tr = $('<tr></tr>');
tb.append(tr);
tr.append('<td class="label">' + GetTextByKey("P_IPT_VINSN_COLON", "VIN/SN:") + '</td>');
@@ -192,35 +200,71 @@ define(['common'], function (Common) {
tr = $('<tr></tr>');
tb.append(tr);
tr.append('<td class="label">' + GetTextByKey("P_IPT_MODEL_COLON", "Model:") + '</td>');
selModel = $('<select class="form-control" style="width:204px;height:22px;"></select>');
tr.append($('<td></td>').append(selModel));
var td = $('<td></td>');
tr.append(td);
selModel = $('<div></div>').css('width', 204).dropdown([], {
search: true,
multiselect: false,
allowselectall: true,
textKey: 'Name',
valueKey: 'ID'
});
td.append(selModel);
tr = $('<tr></tr>');
tb.append(tr);
tr.append('<td class="label">' + GetTextByKey("P_IPT_ASSETTYPE_COLON", "Asset Type:") + '</td>');
selType = $('<select class="form-control" style="width:204px;height:22px;"></select>');
tr.append($('<td></td>').append(selType));
td = $('<td></td>');
tr.append(td);
selType = $('<div></div>').css('width', 204).dropdown([], {
search: true,
multiselect: false,
allowselectall: true,
textKey: 'Name',
valueKey: 'ID'
});
td.append(selType);
tr = $('<tr></tr>');
tb.append(tr);
tr.append('<td class="label">' + GetTextByKey("P_AM_ASSETGROUP_COLON", "Asset Group:") + '</td>');
td = $('<td></td>');
tr.append(td);
selGroup = $('<div></div>').css('width', 204).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Name',
valueKey: 'Id'
});
td.append(selGroup);
getAssetMakes();
getAssetModels();
getAssetTypes();
getAssetGroups();
function OnSave() {
var item = {
'VIN': $.trim(txtVIN.val()),
'AssetMake': selMake.val(),
'MakeName': selMake.find("option:selected").text(),
'AssetModel': selModel.val(),
'ModelName': selModel.find("option:selected").text(),
'AssetType': selType.val(),
'TypeName': selType.find("option:selected").text()
'AssetModel': selModel.dropdownVal(),
'ModelName': selModel.dropdownItem().Name,
'AssetType': selType.dropdownVal(),
'TypeName': selType.dropdownItem().Name,
'AssetGroups': selGroup.dropdownVals(),
'AssetGroupName': selGroup.dropdownTexts().join(',')
};
if (!item.AssetMake || item.AssetMake == '')
item.AssetMake = '-1';
if (!item.AssetModel || item.AssetModel == '')
item.AssetModel = '-1';
item.AssetModel = -1;
if (!item.AssetType || item.AssetType == '')
item.AssetType = '-1';
item.AssetType = -1;
if (!item.AssetGroup || item.AssetGroup == '')
item.AssetGroup = [];
if (_this.onok)
_this.onok(item);
_this.dialog.hideDialog();
@@ -233,6 +277,7 @@ define(['common'], function (Common) {
var makesdata = undefined;
var modelsdata = undefined;
var typesdata = undefined;
var groupsdata = undefined;
function getAssetMakes() {
inspectionrequest("GetAssetMakes", "", function (data) {
if (data && data.length > 0) {
@@ -265,6 +310,16 @@ define(['common'], function (Common) {
});
}
function getAssetGroups() {
inspectionrequest("GetAssetGroups", "", function (data) {
if (data && data.length > 0) {
groupsdata = data;
showAssetGroups();
}
}, function (err) {
});
}
function showAssetMakes() {
selMake.append('<option value="-1">*</option>');
if (makesdata && makesdata.length > 0) {
@@ -280,35 +335,53 @@ define(['common'], function (Common) {
}
function showAssetModels() {
selModel.empty();
var makeid = selMake.val();
selModel.append('<option value="-1">*</option>');
if (!makeid || makeid == "-1")
selModel.prop('disabled', true);
selModel.dropdownDisabled(true);
else
selModel.prop('disabled', false);
selModel.dropdownDisabled(false);
var match_items = [];
match_items.push({ ID: -1, Name: '*' });
if (modelsdata && modelsdata.length > 0 && makeid != "-1") {
for (var i = 0; i < modelsdata.length; i++) {
var item = modelsdata[i];
if (item.MakeID == parseInt(makeid)) {
selModel.append('<option value="' + item.ID + '">' + item.Name + '</option>');
match_items.push(item);
}
}
if (_this.filter)
selModel.val(_this.filter.AssetModel);
}
selModel.dropdownSource(match_items);
selModel.dropdownVal(-1);
if (_this.filter)
selModel.dropdownVal(_this.filter.AssetModel);
}
function showAssetTypes() {
selType.append('<option value="-1">*</option>');
var match_items = [];
match_items.push({ ID: -1, Name: '*' });
if (typesdata && typesdata.length > 0) {
for (var i = 0; i < typesdata.length; i++) {
var item = typesdata[i];
selType.append('<option value="' + item.Key + '">' + item.Value + '</option>');
match_items.push(typesdata[i]);
}
if (_this.filter)
selType.val(_this.filter.AssetType);
}
selType.dropdownSource(match_items);
if (_this.filter)
selType.dropdownVal(_this.filter.AssetType);
}
function showAssetGroups() {
var match_items = [];
if (groupsdata && groupsdata.length > 0) {
for (var i = 0; i < groupsdata.length; i++) {
match_items.push(groupsdata[i]);
}
}
selGroup.dropdownSource(match_items);
if (_this.filter)
selGroup.dropdownVals(_this.filter.AssetGroups || []);
}
};
/************end addfilter module***************/

View File

@@ -133,13 +133,13 @@ define(['common'], function (Common) {
for (var i = 0; i < data.length; i++) {
var it = data[i];
if (excepts == null || !excepted(it.Id, excepts)) {
items.push({ Values: it });
items.push(it);
}
}
gridctrl.setData(items);
maskbg.hide();
}, function (err) {
showAlert(GetTextByKey("P_IPT_FAILEDTOGETTHESECTIONS1",'Failed to get the sections.'), title);
showAlert(GetTextByKey("P_IPT_FAILEDTOGETTHESECTIONS1", 'Failed to get the sections.'), title);
maskbg.hide();
});
}

View File

@@ -5,6 +5,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
this.namecontrol = undefined;
this.displaytextcontrol = undefined;
this.notescontrol = undefined;
this.displayonreportcontrol = undefined;
this.onNameChanged = undefined;
this.datacontent = null;
@@ -28,18 +29,19 @@ 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_XXX", "Language Selection") + '"/>');
var addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(_this.namecontrol);
});
tr.append($('<td style="white-space:nowrap;"></td>').append(_this.namecontrol).append(addiText));
tr.append($('<td style="white-space:nowrap;width:370px;"></td>').append(_this.namecontrol).append(addiText));
_this.namecontrol.change(function () {
if (_this.onNameChanged)
_this.onNameChanged($.trim(_this.namecontrol.val()))
})
tr.append($('<td></td>'));
tb.append(tr);
tr.append('<td class="label" style="width:154px;">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>');
tr.append('<td class="label" style="width:100px;">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>');
_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));
@@ -47,19 +49,27 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
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_XXX", "Language Selection") + '"/>');
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
addiText.click(function () {
Common.createMultiTextDialog(_this.displaytextcontrol);
});
tr.append($('<td style="white-space:nowrap;"></td>').append(_this.displaytextcontrol).append(addiText));
var td_displayonreport = $('<td></td>')
.attr('title', GetTextByKey("P_IPT_PAGEDISPLAYONREPORTTIPS", 'Checked indicates that there will be a \n Page Break and Page Title on the report.\n\n Unchecked indicates that the Page Break \n is only visible during inspection completion.'));
tr.append(td_displayonreport);
_this.displayonreportcontrol = $('<input id="tempchk1" type="checkbox"/>');
td_displayonreport.append(_this.displayonreportcontrol);
td_displayonreport.append("<label for='tempchk1' data-lgid='P_IPT_DISPLAYONREPORT'>Display on Report</label>");
var sectioncontent = createSectionContent();
div_main.append(sectioncontent);
return div_main;
}
function createSectionContent() {
var content = $('<div style="min-width:1820px;"></div>');
var content = $('<div style="min-width:1780px;"></div>');
function createSectionHeader() {
var header = $('<div></div>');
@@ -72,7 +82,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
// updateContent(true);
//}
//$('#right_popup1').empty().append(s.createContent()).show();
var section = {};
var section = { DisplayOnReport: true };
_this.page.Sections.push(section);
addSectionModule(section);
});
@@ -91,11 +101,12 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
var dataheader = $('<div class="question-holder no-hover" style="font-weight: bold;font-size:14px;"></div>');
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: 235px">' + 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: 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: 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: 370px">' + GetTextByKey("P_IPT_TYPE", "Type") + '</div>');
dataheader.append('<div class="question-cell" style="width: 80px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_DISPLAYONREPORT", "Display on Report") + '</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: 65px; text-align: center;white-space:normal;line-height:20px;">' + GetTextByKey("P_IPT_INCLUDECOMMENT", "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>');
@@ -114,6 +125,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
_this.namecontrol.val(_this.page.Name).data("texts", _this.page.LocalNames);
_this.displaytextcontrol.val(_this.page.DisplayText).data("texts", _this.page.LocalDisplayTexts);
_this.notescontrol.val(_this.page.Notes);
_this.displayonreportcontrol.attr('checked', _this.page.DisplayOnReport);
}
if (_this.page.Sections) {
@@ -121,20 +133,22 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
_this.datacontent.empty();
for (var i = 0; i < _this.page.Sections.length; i++) {
//var s = new Section(_this.page.Sections[i], null, _this);
addSectionModule(_this.page.Sections[i]);
addSectionModule(_this.page.Sections[i], i);
}
} else
_this.page.Sections = [];
}
function addSectionModule(s) {
var sectionmodule = new Section(s, null, _this);
function addSectionModule(s, index) {
var sectionmodule = new Section(s, null, _this, index);
sectionmodule.oncopy = function (section) {
section = JSON.parse(JSON.stringify(section));
section.Id = "";
section.Conditional = null;
if (!section.IsLink && section.Questions) {
for (var j = 0; j < section.Questions.length; j++) {
section.Questions[j].Id = "";
section.Questions[j].Conditional = null;
}
}
_this.page.Sections.push(section);
@@ -152,6 +166,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
_this.namecontrol.prop('disabled', true);
_this.displaytextcontrol.prop('disabled', true);
_this.notescontrol.prop('disabled', true);
_this.displayonreportcontrol.prop('disabled', true);
content.find(".iconmultitext").hide();
content.find(".iconimage").hide();
@@ -179,7 +194,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
}
if (sections && sections.length > 0) {
for (var i = 0; i < sections.length; i++) {
var it = sections[i].Values;
var it = sections[i];
if (it.Selected && linkedSectionIds.indexOf(it.Id) >= 0) {
showAlert(GetTextByKey("P_IPT_ALREADYLINKED", '{0} has already been linked to current template.').replace("{0}", it.Name), GetTextByKey("P_ADDGLOBALSECTION", "Add Global Section"));
return;
@@ -205,7 +220,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
if (sections && sections.length > 0) {
var sids = [];
for (var i = 0; i < sections.length; i++) {
var it = sections[i].Values;
var it = sections[i];
if (it.Selected)
sids.push(it.Id);
}
@@ -252,6 +267,7 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
page.Name = this.namecontrol.val();
page.DisplayText = this.displaytextcontrol.val();
page.Notes = this.notescontrol.val();
page.DisplayOnReport = this.displayonreportcontrol.prop('checked');
var texts = this.namecontrol.data("texts");
if (texts) {
@@ -308,6 +324,69 @@ define(['modules/sections/section', 'modules/sections/addsection', 'common', 'mo
this.sectionmodules.splice(tindex, 0, sm);
}
};
p.prototype.refreshIdIndex = function () {
var id = 0;
var needRefreshes = [];
var needReloads = [];
for (var s = 0; s < this.sectionmodules.length; s++) {
var section = this.sectionmodules[s];
section.index = s;
section.btncondition.css('display', section.conditionalTree.init() ? '' : 'none');
for (var i = 0; i < section.questionmodules.length; i++) {
var question = section.questionmodules[i];
question.idIndex = ++id;
question.questionholder.children('.question-index').text('#' + String(id));
question.btncondition.css('display', question.conditionalTree.init() ? '' : 'none');
if (question.conditional?.QuestionId != null) {
needReloads.push(question);
}
var root = question.conditionalTree;
if (root == null) {
continue;
}
root.initialized = false;
if (root.tree?.is(':visible')) {
needRefreshes.push(root);
}
}
}
var qs = this.sectionmodules.reduce(function (array, s) { return array.concat(s.questionmodules) }, []);
for (var i = 0; i < needReloads.length; i++) {
var q = needReloads[i];
var conditional = q.conditional;
var r = cleanConditional(conditional, q.idIndex, qs);
if (r) {
q.conditional.QuestionId = '-';
q.conditional.SubItems = [];
}
}
for (var i = 0; i < needRefreshes.length; i++) {
needRefreshes[i].refresh();
}
};
function cleanConditional(c, index, qs) {
if (!['-', 'or', 'and'].includes(c.QuestionId)) {
var cq = qs.find(function (q) { return q.question.Id == c.QuestionId });
if (cq == null) {
return true;
}
if (cq.idIndex >= index) {
return true;
}
}
if (c.SubItems?.length > 0) {
for (var i = c.SubItems.length - 1; i >= 0; i--) {
var r = cleanConditional(c.SubItems[i], index, qs);
if (r) {
c.SubItems.splice(i, 1);
}
}
}
return false;
}
return p;
});

View File

@@ -34,7 +34,7 @@ define(['modules/templates/page'], function (Page) {
function addTab(p, newadd) {
if (!p) {
p = {};
p = { 'DisplayOnReport': true };
_this.pages.push(p);
}
var tabName = 'tab_' + tabIndex++;
@@ -149,10 +149,12 @@ define(['modules/templates/page'], function (Page) {
for (var i = 0; i < p.Sections.length; i++) {
var s = p.Sections[i];
s.Id = "";
s.Conditional = null;
if (s.Questions) {
for (var j = 0; j < s.Questions.length; j++) {
var q = s.Questions[j];
q.Id = "";
q.Id = $.generateUUID();
q.Conditional = null;
}
}
}

View File

@@ -16,10 +16,7 @@ define(['common', 'modules/templates/templatepicture'], function (Common, Templa
var nopictr = null;
var tabindex = 0;
if (sectiontype === 0) {
if (!_this.pageele.IssueId || _this.pageele.IssueId == "")
editable = true;
else
editable = false;
editable = true;
}
var content = $('<div style="max-height: 200px;overflow-y: auto;"></div>');
@@ -71,7 +68,7 @@ define(['common', 'modules/templates/templatepicture'], function (Common, Templa
if (pics && pics.length > 0) {
var sids = [];
for (var i = 0; i < pics.length; i++) {
var it = pics[i].Values;
var it = pics[i];
if (it.Selected) {
var p = {};
p.Id = $.newGuid();

View File

@@ -17,7 +17,6 @@ define(['modules/templates/addtemplate', 'common'], function (AddTemplate, Commo
holder.append('<div class="question-cell template-name" style="width:390px;padding-left:10px;"><span></span></div>');
//holder.append('<div class="question-cell template-display" style="width: 280px;"><span></span></div>');
holder.append('<div class="question-cell template-notes" style="width:400px;"></div>');
holder.append('<div class="question-cell template-createdby" style="width:200px;"><span></span></div>');
var funcs = $('<div class="question-cell template-func" style="width:110px;padding-right:20px;"></div>');
holder.append(funcs);
var _this = this;
@@ -42,11 +41,9 @@ define(['modules/templates/addtemplate', 'common'], function (AddTemplate, Commo
_this.delete();
}).attr('title', GetTextByKey("P_IPT_DELETETEMPLATE", 'Delete Template')));
if (!_this.template.IssueId || _this.template.IssueId == "") {
funcs.append($('<em class="spanbtn iconcopy"></em>').click(function () {
_this.openSaveAs();
}).attr('title', GetTextByKey("P_IPT_SAVEAS", 'Save As')));
}
funcs.append($('<em class="spanbtn iconcopy"></em>').click(function () {
_this.openSaveAs();
}).attr('title', GetTextByKey("P_IPT_SAVEAS", 'Save As')));
}
this.holder = holder;
if (this.template != null) {
@@ -69,8 +66,6 @@ define(['modules/templates/addtemplate', 'common'], function (AddTemplate, Commo
this.holder.find('.template-display span').attr('title', template.DisplayText);
this.holder.children('.template-notes').html(replaceHtmlText(template.Notes));
this.holder.children('.template-notes').attr('title', replaceHtmlText(template.Notes));
this.holder.find('.template-createdby span').text(template.IssueName);
this.holder.find('.template-createdby span').attr('title', template.IssueName);
};
q.prototype.delete = function () {
var _this = this;
@@ -114,6 +109,7 @@ define(['modules/templates/addtemplate', 'common'], function (AddTemplate, Commo
dialog.showDialog();
};
var savingas = false;
q.prototype.onSaveAs = function () {
var _this = this;
var name = newnamecontrol.val();
@@ -121,10 +117,14 @@ define(['modules/templates/addtemplate', 'common'], function (AddTemplate, Commo
showAlert(GetTextByKey("P_IPT_TEMPLATENAMENOTBEEMPTY", 'Template name cannot be empty.'), GetTextByKey("P_IPT_SAVEAS", 'Save As'));
return;
}
if (savingas) return;
savingas = true;
name = htmlencode(name);
var p = JSON.stringify([teamintelligence, _this.template.Id, name]);
inspectionrequest("TemplateSaveAs", htmlencode(p), function (data) {
savingas = false;
if (data !== 'OK')
showAlert(data, GetTextByKey("P_IPT_SAVEAS", 'Save As'));
else if (_this.templatemodule && typeof _this.templatemodule.refresh === "function")
@@ -132,6 +132,7 @@ define(['modules/templates/addtemplate', 'common'], function (AddTemplate, Commo
dialog.hideDialog();
}, function (err) {
savingas = false;
showAlert(GetTextByKey("P_IPT_FAILEDTOSAVEAS", 'Failed to save as.'), GetTextByKey("P_IPT_SAVEAS", 'Save As'));
});
};

View File

@@ -101,7 +101,7 @@ define(['common'], function (Common) {
for (var i = 0; i < currenttemplate.StaticPictures.length; i++) {
var it = currenttemplate.StaticPictures[i];
it.Selected = false;
items.push({ Values: it });
items.push(it);
}
this.gridctrl.setData(items);
}

View File

@@ -4,7 +4,7 @@ var reportdata;
var reportlayout;
var layoutStyle = 0;
var layoutDivider = 0;
var layoutSpacing = 0;
var layoutSpacing = 1;
var layoutPicturesDisplay = 0;
var layoutCaptionImages = false;
var layoutHighlightColor = "";
@@ -65,6 +65,12 @@ function GetInspectionReport() {
showmaskbg(true);
var p = JSON.stringify([teamintelligence, htmlencode(reportid)]);
inspectionrequest("GetInspectionReport", p, function (data) {
showmaskbg(false);
if (!data) {
showAlert(GetTextByKey("P_IPT_INSPECTIONCANNOTBEFOUND", 'Inspection cannot be found.'), GetTextByKey("P_IPT_ERROR", 'Error'));
$(".function_title").remove();
return;
}
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_IPT_ERROR", 'Error'));
}
@@ -83,15 +89,14 @@ function GetInspectionReport() {
};
vm.reload(data);
showReportLayout(data.ReportLayout);
showIdentifiedQuestions(data.IdentifiedQuestions);
if (data.Template.DisplayInspectionIssues)
showIdentifiedQuestions(data.IdentifiedQuestions);
showPages(data);
showSignature(data);
if (layoutPicturesDisplay == 1 && mediasdata && mediasdata.length > 0) {
showMedias();
}
}
showmaskbg(false);
}, function (err) {
showmaskbg(false);
});
@@ -156,13 +161,25 @@ function showIdentifiedQuestions(questions) {
if (!questions || questions.length == 0)
return;
var content = $('<div></div>');
content.append($('<div class="catelog">IDENTIFIED ISSUES</div>'));
content.append($('<div class="catelog">' + GetTextByKey('P_IPT_IDENTIFIEDISSUES', 'IDENTIFIED ISSUES') + '</div>'));
if (questions && questions.length > 0) {
createQuestionContent1(content, questions, true);
if (layoutStyle == 1 || layoutStyle == 2) {
var qcontent = $('<table class="question_table"style="width:100%;" ></table>');
content.append(qcontent);
createQuestionContent1(qcontent, questions, true);
if (layoutDivider == 1)//Line
qcontent.addClass('question_line');
else if (layoutDivider == 2)//Grid
qcontent.addClass('question_table_grid');
qcontent.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else
createQuestionContent1(content, questions, true);
}
else
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
$('#divquestions').append(content);
}
@@ -188,10 +205,26 @@ function showPages(report) {
var pagescontent = $('<div></div>');
pagescontent.append($('<div class="catelog" style="margin-top:20px;">' + GetTextByKey("P_IPT_INSPECTIONDETAIL", "INSPECTION DETAIL") + '</div>'));
for (var i = 0; i < pages.length; i++) {
var p = pages[i];
var pagecontent = createPage(p);
pagescontent.append(pagecontent);
if (layoutStyle == 1 || layoutStyle == 2) {
var content = $('<table class="question_table"style="width:100%;" ></table>');
pagescontent.append(content);
if (layoutDivider == 1)//Line
content.addClass('question_line');
else if (layoutDivider == 2)//Grid
content.addClass('question_table_grid');
content.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
for (var i = 0; i < pages.length; i++) {
var p = pages[i];
createPage(content, p);
}
}
else {
for (var i = 0; i < pages.length; i++) {
var p = pages[i];
createPage(pagescontent, p);
}
}
$('#divpages').append(pagescontent);
}
@@ -202,7 +235,7 @@ function showSignature(report) {
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);
var pic = $('<img loading="lazy" style="height:320px; margin-left:70px;margin-right:10px;margin-bottom:10px;"></img>').attr('src', report.SignatureUrl);
div_pic.append(pic);
if (layoutDivider == 1)//Line
@@ -217,90 +250,14 @@ function showSignature(report) {
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');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
var media_div = $('<div style="overflow:auto;"></div>');
content.append(media_div);
for (var i = 0; i < mediasdata.length; i++) {
var m = mediasdata[i];
var piccontent = createMedias(m);
media_div.append(piccontent);
}
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');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
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_standard_table_line');
else if (layoutDivider == 2)//Grid
div_question.addClass('question_standard_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
$('#divpages').append(content);
}
@@ -320,7 +277,7 @@ function createMedias(m) {
}
}
else {
var pic = $('<img class="media"></img>').attr('src', m.ThumbnailUrl);
var pic = $('<img loading="lazy" class="media"></img>').attr('src', m.ThumbnailUrl);
pic.click(m.Url, function (e) {
window.open(e.data, "_blank")
});
@@ -335,74 +292,71 @@ function createMedias(m) {
return piccontent;
}
function createPage(page) {
var content = $('<div style="padding:0px;"></div>');
var lastdisplaypageid = null;
function createPage(content, page) {
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));
if (layoutDivider == 1)//Line
tabpage.addClass('question_line');
else if (layoutDivider == 2)//Grid
tabpage.addClass('question_table_grid');
tabpage.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
if (page.DisplayOnReport) {
var trpage = $('<tr style="width:100%;text-align:center;background-color:#a9a9a9;" ></tr>');
content.append(trpage);
var tdpage = "";
if (layoutStyle == 1)
tdpage = $('<td colspan="3" style="width:100%;"></td>')
else
tdpage = $('<td colspan="4" style="width:100%;"></td>')
trpage.append(tdpage);
tdpage.append($('<span></span>').text(page.DisplayText));
}
}
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));
if (page.DisplayOnReport) {
lastdisplaypageid = page.Id;
var divpage = $('<div class="page"></div>');
content.append(divpage);
var btnpage = $('<em class="spanbtn iconangledown" style="font-size:22px;width:24px;"></em>');
btnpage.click(page.Id, function (e) {
var icon = $(this);
if (icon.hasClass('iconangleright')) {
icon.removeClass('iconangleright').addClass('iconangledown');
//icon.parent().next().show();
$(".page" + e.data).show();
$(".page" + e.data).find("em").removeClass('iconangleright').addClass('iconangledown');
}
else {
icon.removeClass('iconangledown').addClass('iconangleright');
//icon.parent().next().hide();
$(".page" + e.data).hide();
$(".page" + e.data).find("em").removeClass('iconangledown').addClass('iconangleright');
}
});
divpage.append(btnpage);
divpage.append($('<span></span>').text(page.DisplayText));
}
}
var sectioncontent = createSectionContent(page);
content.append(sectioncontent);
return content;
createSectionContent(content, page, lastdisplaypageid);
}
function createSectionContent(page) {
var content = $('<div style="margin-bottom:30px;"></div>');
var lastdisplaysectionid = null;
function createSectionContent(content, page, lastdisplaypageid) {
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 condmatched = checkConditional(s.Conditional)
if (s.DisplayOnReport && condmatched) {
var trsection = $('<tr style="width:100%;text-align:center;background-color:#cbcbcb;" ></tr>');
content.append(trsection);
var tdsection = $('<td style="width:100%;" ></td>');
if (layoutStyle == 1)
tdsection = $('<td colspan="3" style="width:100%;"></td>')
else
tdsection = $('<td colspan="4" style="width:100%;"></td>')
trsection.append(tdsection);
tdsection.append($('<span></span>').text(s.DisplayText));
}
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');
tabsection.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
var qc = createQuestionContent(s);
content.append(qc);
if (condmatched)
createQuestionContent(content, s);
}
}
}
@@ -410,104 +364,97 @@ function createSectionContent(page) {
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 (s.DisplayOnReport && checkConditional(s.Conditional)) {
lastdisplaysectionid = s.Id;
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();
var btnsection = $('<em class="spanbtn iconangledown" style="font-size:18px;display:inline-block;"></em>');
btnsection.click(s.Id, function (e) {
var icon = $(this);
if (icon.hasClass('iconangleright')) {
icon.removeClass('iconangleright').addClass('iconangledown');
$(".section" + e.data).show();
//icon.parent().next().show();
}
else {
icon.removeClass('iconangledown').addClass('iconangleright');
//icon.parent().next().hide();
$(".section" + e.data).hide();
}
});
divsection.append(btnsection);
if (lastdisplaypageid)
divsection.addClass("page" + lastdisplaypageid);
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/>');
}
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 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);
createQuestionContent(content, s, lastdisplaysectionid, lastdisplaypageid);
}
}
else
content.append($('<div class="question"></div>').text('No Sections'));
}
return content;
}
function createQuestionContent(section) {
var content = $('<div style="margin-bottom:30px;"></div>');
function createQuestionContent(content, section, lastdisplaysectionid, lastdisplaypageid) {
if (section.Questions && section.Questions.length > 0) {
createQuestionContent1(content, section.Questions, false);
createQuestionContent1(content, section.Questions, false, lastdisplaysectionid, lastdisplaypageid);
}
else
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
return content;
}
function createQuestionContent1(content, questions, isidentified) {
function createQuestionContent1(content, questions, isidentified, lastdisplaysectionid, lastdisplaypageid) {
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];
if (ignoreQuestion(q, isidentified)) continue;
if (ignoreQuestion(q, isidentified) || !checkConditional(q.Conditional)) continue;
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>');
content.append(tr_question);
tr_question.append($('<td style="width:50%;"></td>').text(q.DisplayText));
var td_answer = $('<td style="width:20%;"></td>');
tr_question.append(td_answer);
createAnswerContent(td_answer, q, isidentified);
var td_comment = $('<td style="width:33%;"></td>');
var td_comment = $('<td style="width:30%;"></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)));
var div_comment = $('<div class="answer"></div>').html(replaceHtmlText(comment));
td_comment.append(div_comment);
div_comment.css('color', (q.IsImportant && layoutHighlightColor) ? layoutHighlightColor : "#808080");
}
if (q.IsImportant && layoutHighlightColor)
tr_question.css('color', layoutHighlightColor);
}
if (layoutDivider == 1)//Line
div_question.addClass('question_line');
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else if (layoutStyle == 2) {//Split
var div_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(div_question);
var tr_question = "";
var qindex = 0;
for (var i = 0; i < questions.length; i++) {
var q = questions[i];
if (ignoreQuestion(q, isidentified)) continue;
if (ignoreQuestion(q, isidentified) || !checkConditional(q.Conditional)) continue;
if (qindex % 2 == 0) {
tr_question = $('<tr style="width:100%;"></tr>');
div_question.append(tr_question);
content.append(tr_question);
}
var td_question = $('<td style="width:25%;"></td>').text(q.DisplayText);
var td_question = $('<td style="width:35%;"></td>').text(q.DisplayText);
tr_question.append(td_question);
var td_answer = $('<td style="width:25%;"></td>');
var td_answer = $('<td style="width:15%;"></td>');
tr_question.append(td_answer);
createAnswerContent(td_answer, q, isidentified);
if (q.IsImportant && layoutHighlightColor) {
@@ -518,21 +465,18 @@ function createQuestionContent1(content, questions, isidentified) {
qindex++;
}
if (qindex % 2 != 0) {
tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>'));
tr_question.append($('<td style="width:35%;"></td><td style="width:15%;"></td>'));
}
if (layoutDivider == 1)//Line
div_question.addClass('question_line');
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else {
for (var i = 0; i < questions.length; i++) {
var q = questions[i];
if (ignoreQuestion(q, isidentified)) continue;
var tab_question = $('<table style="width:100%;" class="question_table"></table>');
if (ignoreQuestion(q, isidentified) || !checkConditional(q.Conditional)) continue;
var tab_question = $('<table style="width:100%;"></table>');
if (lastdisplaysectionid)
tab_question.addClass("section" + lastdisplaysectionid);
if (lastdisplaypageid)//没有显示Section的时候设置PageID
tab_question.addClass("page" + lastdisplaypageid);
content.append(tab_question);
var tr_question = $('<tr style="width:100%;"></tr>');
tab_question.append(tr_question);
@@ -540,7 +484,7 @@ function createQuestionContent1(content, questions, isidentified) {
tr_question.append(td_question);
var div_question = $('<div class="question"></div>');
td_question.append(div_question);
var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText);
var div_title = $('<div style="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>');
@@ -558,7 +502,6 @@ function createQuestionContent1(content, questions, isidentified) {
tab_question.addClass('question_standard_table_line');
else if (layoutDivider == 2)//Grid
tab_question.addClass('question_standard_table_grid');
tab_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
if (q.IsImportant && layoutHighlightColor) {
@@ -587,7 +530,7 @@ function createQuestionContent1(content, questions, isidentified) {
function createPictures(pictures, p) {
for (var i = 0; i < pictures.length; i++) {
var pic = pictures[i];
var img = $('<img style="height:30px;margin-left:5px;"/>').attr('src', pic.Url).attr('title', pic.Name);
var img = $('<img loading="lazy" 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")
});
@@ -627,6 +570,105 @@ function ignoreQuestion(q, isidentified) {
return ignore;
}
function checkConditional(cond) {
if (!cond) return true;
var qid = cond.QuestionId.toLowerCase();
if (qid == "and") {
for (let scond of cond.SubItems) {
var r = checkConditional(scond);
if (!r) return false;
}
return true;
}
else if (qid == "or") {
for (let scond of cond.SubItems) {
var r = checkConditional(scond);
if (r) return true;
}
return false;
}
else {
var condquestion = getQuestionAndSection(cond.QuestionId);
if (!condquestion) return false;
if (!condquestion.Question || !checkConditional(condquestion.Question.Conditional)) return false;
if (!condquestion.Section || !checkConditional(condquestion.Section.Conditional)) return false;
if (!cond.Value) return false;
var ans = reportdata.Answers.find(c => c.QuestionId.toLowerCase() == cond.QuestionId.toLowerCase());
if (ans == null) return false;
var condValue = Number(cond.Value);
switch (cond.Operator) {
case "gt"://>
return ans.AsDouble > condValue;
case "gteq"://>=
return ans.AsDouble >= condValue;
case "lt"://<
return ans.AsDouble < condValue;
case "lteq"://<=
return ans.AsDouble <= condValue;
case "between"://between
var condValue1 = Number(cond.Value1);
return ans.AsDouble >= condValue && ans.AsDouble <= condValue1;
case "in"://in
if (!ans.SelectedItems || ans.SelectedItems.length == 0) return false;
var condvs = cond.Value.toLowerCase().split(';');
for (let item of ans.SelectedItems) {
var sv = item.Value;
if (condquestion.Question.QuestionType == 19 || condquestion.Question.QuestionType == 5)
sv = item.Text;
if (!sv || condquestion.Question.LookupSource != 0)
sv = item.Text;
if (condvs.indexOf(sv.toLowerCase()) >= 0)
return true;
}
return false;
case "noteq":
var v = "";
if (condquestion.Question.QuestionType == 5// QuestionTypes.YesOrNo
|| condquestion.Question.QuestionType == 8//QuestionTypes.DropDown
|| condquestion.Question.QuestionType == 9//QuestionTypes.List
|| condquestion.Question.QuestionType == 19) {//QuestionTypes.AssetStatus)
if (!ans.SelectedItems || ans.SelectedItems.length == 0) return false;
if (ans.SelectedItems.length > 1) return true;
v = ans.SelectedItems[0].Value;
if (!v || condquestion.Question.QuestionType == 19 || condquestion.Question.QuestionType == 5 || condquestion.Question.LookupSource != 0)
v = ans.SelectedItems[0].Text;
}
else
v = ans.Result;
return cond.Value.toLowerCase() != v.toLowerCase() && ans.AsDouble != condValue;
default: //=
var v = "";
if (condquestion.Question.QuestionType == 5// QuestionTypes.YesOrNo
|| condquestion.Question.QuestionType == 8//QuestionTypes.DropDown
|| condquestion.Question.QuestionType == 9//QuestionTypes.List
|| condquestion.Question.QuestionType == 19) {//QuestionTypes.AssetStatus)
if (!ans.SelectedItems || ans.SelectedItems.length != 1) return false;
v = ans.SelectedItems[0].Value;
if (!v || condquestion.Question.QuestionType == 19 || condquestion.Question.QuestionType == 5 || condquestion.Question.LookupSource != 0)
v = ans.SelectedItems[0].Text;
}
else
v = ans.Result;
return cond.Value.toLowerCase() == v.toLowerCase() || ans.AsDouble == condValue;
}
}
}
function getQuestionAndSection(questionid) {
for (var p of reportdata.Template.Pages) {
for (var s of p.Sections) {
for (var q of s.Questions) {
if (q.Id.toLowerCase() == questionid.toLowerCase())
return { Question: q, Section: s };
}
}
}
return null;
}
function createAnswerContent(p, q, isidentified) {
var leveltext = showSeverityLevel(q.SeverityLevel);
var label_level = $('<label class="label_level"></label>').text(leveltext);
@@ -645,6 +687,8 @@ function createAnswerContent(p, q, isidentified) {
result = result.split(' ')[0];
if (q.QuestionType == 11//Odometer
|| q.QuestionType == 18 //FuelUsed
|| q.QuestionType == 12//EngineHours
|| q.QuestionType == 13//FuelRemaining
|| (q.QuestionType == 15 && q.SubType == 8)//FuelRecords Odometer
|| (q.QuestionType == 15 && q.SubType == 10))//FuelRecords Quantity
result += " " + convertUnits(a.Units);
@@ -741,11 +785,13 @@ function createAnswerContent(p, q, isidentified) {
}
else if (q.QuestionType == 10
|| (q.QuestionType == 15 && q.SubType == 15)) {//Picture
var 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);
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);
var nopics = true;
if (reportdata.Medias && reportdata.Medias.length > 0) {
for (var j = 0; j < reportdata.Medias.length; j++) {
var m = reportdata.Medias[j];
@@ -758,10 +804,13 @@ function createAnswerContent(p, q, isidentified) {
else {//Displayed As Taken
var media = createMedias(m);
pics.append(media);
nopics = false;
}
}
}
}
if (pics && nopics)
pics.hide();
}
else if (q.QuestionType == 19) {//Asset Status
var divanswer = $('<div class="answer" ></div>').data('isimportant', q.IsImportant);
@@ -779,10 +828,12 @@ function createAnswerContent(p, q, isidentified) {
p.append("<div style='clear:both;'></div>");
}
divanswer.append(label_level);
var 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);
pics = $('<div class="div_media" style="min-height:80px;overflow:auto;padding-left:90px;"></div>').data('isimportant', q.IsImportant);
p.append(pics);
}
var nopics = true;
if (reportdata.Medias && reportdata.Medias.length > 0) {
for (var j = 0; j < reportdata.Medias.length; j++) {
var m = reportdata.Medias[j];
@@ -795,10 +846,13 @@ function createAnswerContent(p, q, isidentified) {
else {//Displayed As Taken
var media = createMedias(m);
pics.append(media);
nopics = false;
}
}
}
}
if (pics && nopics)
pics.hide();
if (a.Result && a.Result != "") {
var divresult = $('<div class="answer"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result));
p.append(divresult);
@@ -864,6 +918,10 @@ function convertUnits(u) {
return "Gallon";
case "litre":
return "Litre";
case "percent":
return "Percent";
case "hour":
return "Hour(s)";
default:
break;
}

View File

@@ -5,7 +5,7 @@
//spectrum: "../../js/spectrum"
},
waitSeconds: 0,
urlArgs: "v=39" //+ Math.random()
urlArgs: "v=67" //+ Math.random()
})
requirejs(['modules/inspects/editinspection'], function (EditModule) {

View File

@@ -8,6 +8,7 @@
<title>Iron Intel</title>
<link rel="shortcut icon" href="<%=GetUrl("favicon.ico") %>" />
<link type="text/css" href="<%=GetUrl("js/lib/ui.min.css") %>" rel="stylesheet" />
<link rel="stylesheet" href="<%=GetUrl("css/default.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetUrl("css/split_sub.css")%>" type="text/css" />
<style type="text/css" runat="server" id="materStyle">
@@ -146,7 +147,7 @@
}
#button_sites:before {
content: '\e601';
content: '\f0c9';
}
#userbutton_down:before {
@@ -196,7 +197,7 @@
}
.setting:before {
content: '\e670';
content: '\f013';
}
#version_info {
@@ -323,34 +324,28 @@
width: 100%;
}
</style>
<link type="text/css" href="<%=GetUrl("css/override.css") %>" rel="stylesheet" />
<style type="text/css">
:root { <%=StyleVariables%> }
.data-grid {
height: 100%;
font-size: 12px !important;
font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important;
:root {
<%=StyleVariables%>
}
</style>
<link type="text/css" href="<%=GetUrl("js/components/css/gridview.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetUrl("css/override.css") %>" rel="stylesheet" />
<link href="<%=GetUrl("css/panel.css")%>" rel="stylesheet" type="text/css" />
<script src="<%=GetUrl("js/lib/utility.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/lib/ui.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/vue.min.js")%>"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<script src="<%=GetUrl("js/jquery-" + (JQueryVersion ?? "3.6.0") + ".min.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetUrl("js/cookie.js") %>"></script>
<script type="text/javascript" src="<%=GetUrl("js/utility.js")%>"></script>
<script type="text/javascript" src="<%=GetUrl("js/components/gridview.js") %>"></script>
<script type="text/javascript" src="<%=GetUrl("js/language.js") %>"></script>
<script type="text/javascript" src="<%=GetUrl("js/favorite.js") %>"></script>
<script type="text/javascript" src="<%=GetUrl("js/modulelang.js") %>"></script>
<script type="text/javascript" src="<%=GetUrl("js/usermessage.js") %>"></script>
<script type="text/javascript" src="<%=GetUrl("js/sitebase.min.js") %>"></script>
<%--sitebase.min.js 包含cookie.js, utility.js, language.js, favorite.js, modulelang.js, usermessage.js--%>
<script type="text/javascript">
_network.root = '<%=Page.ResolveUrl("~/")%>';
var isReadonlyUser =<%=IsReadonlyUser?"true":"false"%>;
var canExport = <%= CanExportFile %>;
var userData;
var GridView = window.GridView || window['g5-gridview'];
var GridView = window['lib-ui'].Grid;
var appmoudulesdata;
function doLogout() {
$('#txtAction').val('logout');
@@ -747,6 +742,7 @@
GetSiteHeaderNote();
getVersions();
$('#sites_panel').empty().html('<div class="panel_loading"></div>');
$("body").applyFleetLanguageText(true);
$('#button_sites').click(function () {
if ($('.panel_holder.sites').is(':visible')) {
@@ -765,6 +761,7 @@
'right': 'auto',
'top': top - 60
});
$('.panel_holder.sites .white').css('left', left + 50 - $('.panel_holder.sites').offset().left);
$('#button_sites').addClass('selected');
return false;
});
@@ -790,10 +787,11 @@
'right': 'auto'
}).show().animate({ 'opacity': 1 }, 100);
$('.panel_holder.favorites .trigle').css({
'left': -10,// left - $('.panel_holder.favorites').offset().left,
'left': left + 48 - $('.panel_holder.favorites').offset().left,
'right': 'auto',
'top': top - 70
});
$('.panel_holder.favorites .white').css('left', left + 50 - $('.panel_holder.favorites').offset().left);
$('#button_favlist').addClass('selected');
return false;
});
@@ -810,7 +808,7 @@
'right': 'auto'
}).show().animate({ 'opacity': 1 }, 100);
$('.panel_holder.usermenus .trigledown').css({
'left': left + $(this).width() - $('.panel_holder.usermenus').offset().left - 20,
'left': left + $(this).width() - $('.panel_holder.usermenus').offset().left - 40,
'right': 'auto',
});
$('#userbutton_down').addClass('selected');
@@ -834,6 +832,7 @@
'right': 'auto',
'top': top - 60
});
$('.panel_holder.menus .white').css('left', left + 50 - $('.panel_holder.menus').offset().left);
$('#button_menu').addClass('selected');
return false;
});
@@ -979,8 +978,8 @@
</div>
</div>
<div id="divfavmenu" class="button" style="width: 48px;" data-title-lgid="P_MYFAVORITES">
<div class="titleicon">
<img id="button_favlist" class="titleimgicon" src="<%=ResolveUrl("~/img/modules/favoritelist.png?t=0")%>" />
<div id="button_favlist" class="titleicon">
<img class="titleimgicon" src="<%=ResolveUrl("~/img/modules/favoritelist.png?t=0")%>" />
</div>
</div>
<div class="button" data-title-lgid="P_MAIN_FULLMENU">
@@ -1002,18 +1001,18 @@
<div id="sites_panel" class="menupanel panel"></div>
</div>
<div class="panel_holder menus">
<div class="lefttitle_title" data-title-lgid="P_MAIN_SETTINGS">Settings</div>
<div class="lefttitle_title" data-lgid="P_MAIN_SETTINGS">Settings</div>
<div id="menu_panel" class="menupanel panel" style="min-width: 250px;">
<ul class="lefttitlemenu_ul">
<li id="lisyssetting" style="line-height: 40px; padding-left: 0;"><a href="<%=ResolveUrl("~/SystemSettings/SystemSettings.aspx")%>" target="_self">
<div class="button setting" style="height: 40px; font-size: 24px; padding-left: 6px;"></div>
<span data-lgid="P_MAIN_SYSTEMSETTINGS">System Settings</span></a></li>
<li id="liVersion" style="display: none; line-height: 40px; padding-left: 0;"><a style="cursor: default;">
<div style="height: 40px;"></div>
<span id="aVersion"></span></a></li>
<li id="liFICVersion" style="display: none; line-height: 40px; padding-left: 0;"><a style="cursor: default;">
<div style="height: 40px;"></div>
<span id="aFICVersion"></span></a></li>
<li class="flex" id="lisyssetting" data-url="<%=ResolveUrl("~/SystemSettings/SystemSettings.aspx")%>">
<div class="button setting" style="font-size: 24px"></div>
<span data-lgid="P_MAIN_SYSTEMSETTINGS">System Settings</span></li>
<li class="flex" id="liVersion" style="display: none; cursor: default; padding-left: 0">
<div></div>
<span id="aVersion"></span></li>
<li class="flex" id="liFICVersion" style="display: none; cursor: default; padding-left: 0">
<div></div>
<span id="aFICVersion"></span></li>
</ul>
<div class="trigle"></div>
<div class="trigle white"></div>
@@ -1032,23 +1031,17 @@
</tr>
</table>
</li>
<li onclick="openChangePassword();">
<table>
<tr>
<td>
<img style="width: 32px; height: 32px;" src='<%=ResolveUrl("~/img/modules/changepassword.png?t=0")%>' /></td>
<td><span data-lgid="P_MAIN_CHANGEPASSWORD">Change Password</span></td>
</tr>
</table>
<li onclick="openChangePassword();" class="dynamicmenu flex">
<div>
<img style="width: 32px; height: 32px;" src='<%=ResolveUrl("~/img/modules/changepassword.png?t=0")%>' />
</div>
<span data-lgid="P_MAIN_CHANGEPASSWORD">Change Password</span>
</li>
<li onclick="logout();">
<table>
<tr>
<td>
<img style="width: 32px; height: 32px;" src='<%=ResolveUrl("~/img/modules/logout.png?t=0")%>' /></td>
<td><span data-lgid="P_MAIN_LOGOUT">Logout</span></td>
</tr>
</table>
<li onclick="logout();" class="dynamicmenu flex">
<div>
<img style="width: 32px; height: 32px;" src='<%=ResolveUrl("~/img/modules/logout.png?t=0")%>' />
</div>
<span data-lgid="P_MAIN_LOGOUT">Logout</span>
</li>
</ul>
<div class="trigledown"></div>
@@ -1066,13 +1059,13 @@
<em class="spanbtn icondelete" style="float: right; margin-right: 5px; margin-top: 0; font-size: 16px;" v-on:click="closeMessage()" data-title-lgid="P_MAIN_CLOSE"></em>
<em class="spanbtn icontrash" style="float: right; margin-right: 5px; margin-top: 0; font-size: 14px;" v-on:click="deleteMessage()" data-title-lgid="P_MAIN_REMOVE"></em>
<em class="spanbtn iconopentext" style="float: right; margin-right: 5px; margin-top: 0; font-size: 14px;" v-on:click="readMessage(null,$event)" data-title-lgid="P_MAIN_MARKASREAD"></em>
<em class="spanbtn iconrefresh" style="float: right; margin-right: 5px; margin-top: 0; font-size: 14px; display: none;" v-on:click="refreshMessage()" data-title-lgid="P_MAIN_XXXXXX"></em>
<em class="spanbtn iconrefresh" style="float: right; margin-right: 5px; margin-top: 0; font-size: 14px; display: none;" v-on:click="refreshMessage()" data-title-lgid="P_MAIN_REFRESHMESSAGES"></em>
</div>
<div style="clear: both;"></div>
<div style="line-height: 30px;">
<div style="margin-left: 10px;">
<input type="checkbox" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span>
<input type="checkbox" id="chk_selallmessage" style="height: 26px;" v-on:change="selectAll($event)" /><label for="chk_selallmessage" data-lgid="P_MAIN_SELECTALL">Select All</label>
</div>
<div id="divmsgcontainer" style="overflow: auto; position: absolute; top: 60px; bottom: 0; width: 100%;">
<div v-bind:style="bodyContainerStyle" style="position: relative">
@@ -1096,14 +1089,16 @@
</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_favorite" style="display: none;">
<div class="dialog-title"><span class="title" data-lgid="P_FAV_EDITFAVORITES">Edit Favorites</span><em class="dialog-close"></em></div>
<div class="dialog-content">
<div id="favoritelist" style="height: 350px; width: 520px;"></div>
</div>
<div class="dialog-func">
<input type="button" value="Cancel" data-lgid="P_FAV_CANCEL" class="dialog-close" tabindex="12" style="height: 26px;" />
<input type="button" value="Cancel" data-lgid="P_FAV_CANCEL" class="dialog-close" tabindex="12" style="height: unset;" />
<input type="button" id="btnfavsave" onclick="onSaveFavoriteSort();" value="Save" data-lgid="P_FAV_SAVE" tabindex="11" />
<div class="clear"></div>
</div>
@@ -1160,7 +1155,7 @@
</div>
</div>
<div class="dialog-func">
<input type="button" value="Cancel" data-lgid="P_MV_CANCEL" class="dialog-close" tabindex="12" style="height:unset;" />
<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>
@@ -1176,7 +1171,9 @@
<div class="clear"></div>
</div>
</div>
<div id="mask_bg_ds" class="maskbg" style="display: none; z-index: 100;"><div class="loading c-spin"></div></div>
<div id="mask_bg_ds" class="maskbg" style="display: none; z-index: 100;">
<div class="loading c-spin"></div>
</div>
<div class="form non-select" id="dialog_ds" style="display: none; z-index: 101;">
<div class="form-head">
<div class="form-close fa"></div>

View File

@@ -7,38 +7,6 @@
display: none;
}
.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: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.a {
text-decoration: none;
color: #2140fb;
@@ -107,7 +75,7 @@
position: absolute;
right: 30px;
top: 100px;
z-index: 199;
z-index: 2;
background-color: #EFEFEF;
height: 75px;
width: 75px;
@@ -124,19 +92,10 @@
height: 120px;
overflow: auto;
display: none;
z-index: 200;
z-index: 2;
background-color: #EFEFEF;
}
.div_filter .dropdown {
width: 322px;
margin: 2px 0 0 0px;
}
.div_panel {
min-width: 322px;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
@@ -179,16 +138,14 @@
</script>
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<%--<link rel="stylesheet" type="text/css" href="css/default.css" />--%>
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../Maintenance/js/inputdatactr.js"></script>
<%--<script src="<%=GetFileUrlWithVersion("js/mapview.js")%>"></script>--%>
<%--<script src="<%=GetFileUrlWithVersion("js/mapinit3.19.js")%>"></script>--%>
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
<script src="https://js.arcgis.com/3.40"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<link rel="stylesheet" href="https://js.arcgis.com/3.44/esri/css/esri.css" />
<script src="https://js.arcgis.com/3.44"></script>
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
<script type="text/javascript">
@@ -202,9 +159,6 @@
var foremans;
var statedata = [];
var editableSelectForeman;
var editableSelectState;
var editableSelectState_use;
var centerassetid = -1;
var currentdate = "<%=CurrentDate %>";
@@ -221,6 +175,9 @@
}
}, function () {
$("#dialogmask").hide();
if (typeof fcancel === 'function') {
fcancel();
}
});
}
@@ -247,7 +204,7 @@
$("#dialog_machine").prop("disabled", false);
$('#dialog_region').val('');
$('#dialog_number').val('');
editableSelectForeman.text('');
$('#dialog_foreman').dropdownVal('');
$('#dialog_manager').val('');
$('#dialog_phone').val('');
$('#dialog_email').val('');
@@ -255,7 +212,7 @@
$('#dialog_deliveryaddress1').val('');
$('#dialog_deliveryaddress2').val('');
$('#dialog_city').val('');
editableSelectState.text('');
$('#dialog_state').dropdownVal('');
$('#dialog_zip').val('');
$('#dialog_county').val('');
$('#dialog_notes').val('');
@@ -293,7 +250,7 @@
$('#dialog_enddate').val(jobsiteitem.EndDateStr);
$('#dialog_region').val(jobsiteitem.RegionId);
$('#dialog_number').val(jobsiteitem.Number);
editableSelectForeman.text(jobsiteitem.Foreman);
$('#dialog_foreman').dropdownVal(jobsiteitem.Foreman);
$('#dialog_manager').val(jobsiteitem.Manager);
$('#dialog_phone').val(jobsiteitem.Phone);
$('#dialog_email').val(jobsiteitem.Email);
@@ -301,7 +258,7 @@
$('#dialog_deliveryaddress1').val(jobsiteitem.Address1);
$('#dialog_deliveryaddress2').val(jobsiteitem.Address2);
$('#dialog_city').val(jobsiteitem.City);
editableSelectState.text(jobsiteitem.State);
$('#dialog_state').dropdownVal(jobsiteitem.State);
$('#dialog_zip').val(jobsiteitem.Zip);
$('#dialog_county').val(jobsiteitem.County);
$('#dialog_notes').val(jobsiteitem.Notes)
@@ -344,7 +301,7 @@
'Types': types,
'RegionId': $('#dialog_region').val(),
'Number': $('#dialog_number').val(),
'Foreman': editableSelectForeman.text(),
'Foreman': $('#dialog_foreman').dropdownVal(),
'Manager': $('#dialog_manager').val(),
'Phone': $('#dialog_phone').val(),
'Email': $('#dialog_email').val(),
@@ -352,7 +309,7 @@
'Address1': $('#dialog_deliveryaddress1').val(),
'Address2': $('#dialog_deliveryaddress2').val(),
'City': $('#dialog_city').val(),
'State': editableSelectState.text(),
'State': $('#dialog_state').dropdownVal(),
'Zip': $('#dialog_zip').val(),
'County': $('#dialog_county').val(),
'Notes': $('#dialog_notes').val()
@@ -545,8 +502,6 @@
}
else
openMap();
editableSelectForeman.reload();
editableSelectState_use.reload();
}
function getJobsiteTypes() {
@@ -615,36 +570,34 @@
}
function getStates() {
statedata.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
var data = [];
data.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
editableSelectState.datasource = statedata;
editableSelectState.valuepath = ""
editableSelectState.displaypath = "";
editableSelectState_use.datasource = statedata;
editableSelectState_use.valuepath = ""
editableSelectState_use.displaypath = "";
for (var type of data) {
statedata.push({ value: type });
}
$('#dialog_state').dropdownSource(statedata);
$('#dialog_state_use').dropdownSource(statedata);
}
function GetForemans() {
_network.jobsitequery("GetForemans", "", function (data) {
if (data && data.length > 0) {
foremans = data;
editableSelectForeman.datasource = foremans;
editableSelectForeman.valuepath = "IID"
editableSelectForeman.displaypath = "DisplayName";
}
$('#dialog_foreman').dropdownSource(foremans);
if (jobsiteitem)
editableSelectForeman.text(jobsiteitem.Foreman);
$('#dialog_foreman').dropdownVal(jobsiteitem.Foreman);
else
editableSelectForeman.text('');
$('#dialog_foreman').dropdownVal('');
}, function (err) {
});
}
function setForemanInfo() {
var foreman = editableSelectForeman.selecteditem();
var foreman = $('#dialog_foreman').dropdownItem();
if (foreman) {
$('#dialog_manager').val(foreman.ManagerName);
$('#dialog_phone').val(foreman.Mobile);
@@ -659,16 +612,25 @@
$(function () {
InitGridSelectedMachines();
editableSelectForeman = new $editableselect($("#dialog_foreman"));
editableSelectForeman.tabIndex(1);
editableSelectForeman.change(function () {
$('#dialog_foreman').dropdown([], {
input: true,
maxlength: 50,
valueKey: 'DisplayName',
textKey: 'DisplayName'
}).on('select', function (_e, item) {
setForemanInfo();
});
editableSelectState = new $editableselect($("#dialog_state"), 50);
editableSelectState.tabIndex(1);
editableSelectState_use = new $editableselect($("#dialog_state_use"), 50);
$('#dialog_state').dropdown([], {
input: true,
maxlength: 50,
textKey: 'value'
});
$('#dialog_state_use').dropdown([], {
textKey: 'value'
});
getStates();
$("#dialog_machine").change(function () {
@@ -1040,7 +1002,7 @@
$("#basemapGallery").hide();
});
var basemap = "topo";
$("#basemapImg").css("background-image", "url('https://js.arcgis.com/3.40/esri/images/basemap/topo.jpg')");
$("#basemapImg").css("background-image", "url('https://js.arcgis.com/3.44/esri/images/basemap/topo.jpg')");
$("#basemapTitle").text(GetTextByKey("P_MAP_TOPOGRAPHIC", "Topographic"));
var basemapGallery = new BasemapGalleryC({
@@ -1053,7 +1015,7 @@
url: "http://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
})],
title: GetTextByKey("P_MAP_IMAGERY", "Imagery"),
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/satellite.jpg"
thumbnailUrl: "https://js.arcgis.com/3.44/esri/images/basemap/satellite.jpg"
});
basemapGallery.add(satellitemap);
@@ -1062,7 +1024,7 @@
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
})],
title: GetTextByKey("P_MAP_TOPOGRAPHIC", "Topographic"),
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/topo.jpg"
thumbnailUrl: "https://js.arcgis.com/3.44/esri/images/basemap/topo.jpg"
});
basemapGallery.add(topomap);
@@ -1072,7 +1034,7 @@
url: "http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"
})],
title: GetTextByKey("P_MAP_STREETS", "Streets"),
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/streets.jpg"
thumbnailUrl: "https://js.arcgis.com/3.44/esri/images/basemap/streets.jpg"
});
basemapGallery.add(streetmap);
@@ -1714,16 +1676,16 @@
function AddAssetToJobSite(items) {
var params = [
'', jobsiteid,
JSON.stringify(items.map(function (f) { return f.Values.AssetId; }))
JSON.stringify(items.map(function (f) { return f.AssetId; }))
];
_network.jobsitequery('AddAssetToJobSite', params.join(String.fromCharCode(170)), function (r) {
$('#dialogmask').hide();
if (r === 'OK') {
items = items.filter(function (it) {
var assetId = it.Values.AssetId;
return grid_dtsm.innerSource.filter(function (st) { return st.Values.AssetId === assetId; }).length === 0;
var assetId = it.AssetId;
return grid_dtsm.source.filter(function (st) { return st.AssetId === assetId; }).length === 0;
});
grid_dtsm.setData(grid_dtsm.innerSource.concat(items));
grid_dtsm.setData(grid_dtsm.source.concat(items));
} else {
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
}
@@ -1743,18 +1705,16 @@
dialogAssets.onOK = function (source) {
var items = [];
for (var i = 0; i < source.length; i++) {
var it = source[i].Values;
var it = source[i];
if (it.Selected) {
items.push({
Values: {
AssetId: it.Id,
VIN: it.VIN,
Name: it.Name,
MakeName: it.MakeName,
ModelName: it.ModelName,
TypeName: it.TypeName,
OnSite: false
}
AssetId: it.Id,
VIN: it.VIN,
Name: it.Name,
MakeName: it.MakeName,
ModelName: it.ModelName,
TypeName: it.TypeName,
OnSite: false
});
}
}
@@ -1762,6 +1722,7 @@
$('#dialogmask').hide();
};
dialogAssets.showSelector(2, true);
//dialogAssets.dialog.css("z-index", 200);
}
function OnMachineDeleteSingle(item) {
@@ -1777,53 +1738,33 @@
if (r !== 'OK') {
showAlert(r, alerttitle);
} else {
for (var i = 0; i < grid_dtsm.innerSource.length; i++) {
var s = grid_dtsm.innerSource[i].Values;
if (s.AssetId === item.AssetId) {
grid_dtsm.innerSource.splice(i, 1);
break;
}
}
if (grid_dtsm.source != null) {
for (var j = 0; j < grid_dtsm.source.length; j++) {
if (item.AssetId === grid_dtsm.source[j].Values.AssetId) {
grid_dtsm.source.splice(j, 1);
break;
}
}
}
grid_dtsm.reset();
grid_dtsm.removeItem(grid_dtsm.selectedIndex);
}
});
});
}
function OnSiteChanging(item, input) {
var input_chk = $(input).closest('td').find('input');
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);
showConfirm1(text, GetTextByKey("P_JS_ONSITECHANGE", "On Site Change"), function () {
$(input_chk).prop('checked', !$(input_chk).prop('checked')).change();
});
}
function OnSiteChanged() {
var params = [
'', jobsiteid,
this.AssetId,
this.OnSite ? '1' : '0'
];
$('#dialogmask').show();
_network.jobsitequery('ChangeAssetOnSiteState', params.join(String.fromCharCode(170)), function (r) {
$("#dialogmask").hide();
if (r !== 'OK') {
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
}
var item = this;
var text = item.OnSite ?
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? ") :
GetTextByKey("P_JS_ONSITETIPS1", "Are you sure you want to change the on-site of the asset:{0}?").replace('{0}', item.Name);
showConfirm1(text, GetTextByKey("P_JS_ONSITECHANGE", "On Site Change"), function () {
var params = [
'', jobsiteid,
item.AssetId,
item.OnSite ? '1' : '0'
];
$('#dialogmask').show();
_network.jobsitequery('ChangeAssetOnSiteState', params.join(String.fromCharCode(170)), function (r) {
$("#dialogmask").hide();
if (r !== 'OK') {
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
}
});
}, function () {
item.OnSite = !item.OnSite;
grid_dtsm.refresh();
});
}
@@ -1879,8 +1820,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtsm.setData(rows);
@@ -1888,12 +1828,7 @@
var grid_dtsm;
function InitGridSelectedMachines() {
grid_dtsm = new GridView('#selectedmachinelist');
grid_dtsm.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtsm = createGridView('#selectedmachinelist');
var list_columns = [
{ name: 'OnSite', caption: GetTextByKey("P_JS_ONSITE", "On Site"), valueIndex: 'OnSite', type: 3, css: { 'width': 70, 'text-align': 'center' } },
{ name: 'DisplayName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'Name', css: { 'width': 170, 'text-align': 'left' } },
@@ -1922,10 +1857,6 @@
}
if (col.key === 'OnSite') {
col.events = {
onclick: function (e) {
OnSiteChanging(this, e.target);
return false;
},
onchange: OnSiteChanged
};
}
@@ -1936,26 +1867,19 @@
width: 30,
align: 'center',
sortable: false,
isurl: true,
text: '\uf00d',
resizable: false,
type: GridView.ColumnTypes.Icon,
text: 'times',
events: {
onclick: function () {
OnMachineDeleteSingle(this);
}
},
classFilter: function (e) {
return "icon-col";
},
attrs: { 'title': 'Delete' }
});
grid_dtsm.canMultiSelect = true;
grid_dtsm.multiSelect = true;
grid_dtsm.columns = columns;
grid_dtsm.init();
grid_dtsm.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtsm.source[rowindex];
if (rowdata) {
}
}
}
function openUseAdderss() {
@@ -1969,7 +1893,7 @@
}).showDialogfixed();
$('#dialog_address_use').val($('#dialog_deliveryaddress1').val());
$('#dialog_city_use').val($('#dialog_city').val());
editableSelectState_use.text(editableSelectState.text());
$('#dialog_state_use').dropdownVal($('#dialog_state').dropdownVal());
$('#dialog_zip_use').val($('#dialog_zip').val());
}
@@ -1980,7 +1904,7 @@
return;
}
var city = $('#dialog_city_use').val();
var state = editableSelectState_use.text();
var state = $('#dialog_state_use').dropdownVal();
var zip = $('#dialog_zip_use').val();
$('#dialog_useaddress .maskbg').show();
@@ -2087,7 +2011,7 @@
<tr>
<td class="label" data-lgid="P_JS_FOREMAN_COLON">Foreman:</td>
<td>
<div id="dialog_foreman" style="width: 322px; height: 22px;" tabindex="1"></div>
<div id="dialog_foreman" style="width: 324px; position: relative;" class="dropdown" tabindex="1"></div>
</td>
</tr>
<tr>
@@ -2128,7 +2052,7 @@
<tr>
<td class="label" data-lgid="P_JS_STATE_COLON">State:</td>
<td>
<div id="dialog_state" style="width: 322px; height: 22px;" tabindex="1"></div>
<div id="dialog_state" style="width: 324px; position: relative;" class="dropdown" tabindex="1"></div>
</td>
</tr>
<tr>
@@ -2218,11 +2142,10 @@
</div>
</div>
</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 class="dialog" id="dialog_managemahchine" style="display: none; ">
<div class="dialog-title"><span id="spTitle" class="title" data-lgid="P_JS_MANAGEASSETS"></span><em class="dialog-close"></em></div>
<div class="machine_filter" style="display: none">
<span style="margin-left: 10px;" data-lgid="P_JS_TYPE">Type: </span>
@@ -2268,7 +2191,7 @@
<tr>
<td class="label" style="width: 100px; vertical-align: middle;" data-lgid="P_JS_STATE_COLON">State:</td>
<td>
<div id="dialog_state_use" style="width: 322px; height: 22px;" tabindex="1"></div>
<div id="dialog_state_use" style="width: 322px;" class="dropdown" tabindex="1"></div>
</td>
</tr>
<tr>

View File

@@ -7,40 +7,6 @@
display: none;
}
.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: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
height: 13px;
}
.edit-content table td textarea {
height: 150px;
resize: none;
width: 600px;
/*max-width: 200px;*/
}
.a {
text-decoration: none;
color: #2140fb;
@@ -73,15 +39,6 @@
margin-left: 16px;
margin-right: 8px;
}
.div_filter .dropdown {
width: 322px;
margin: 2px 0 0 0px;
}
.div_panel {
min-width: 322px;
}
</style>
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
@@ -89,8 +46,6 @@
var IsDealer = <%=IsDealer ?"true":"false"%>;
var contractorid;
var machinetypes;
var editmultiselect_type;
var assettypeparam;
jobsitelimitquery = function (method, param, callback, error, nolog) {
_network.request("JobSite/AddJobsiteLimit.aspx", -1, method, param, callback, error || function (e) {
@@ -123,8 +78,7 @@
$('#dialog_endtimeminute').val('00');
$('#dialog_mintrucks').val('');
$('#dialog_maxtrucks').val('');
if (editmultiselect_type)
editmultiselect_type.setValues([]);
$("#dialog_assettype").dropdownVals([]);
$('#dialog_notes').val('');
}
@@ -140,9 +94,9 @@
$('#dialog_mintrucks').val(jobsitelimit.MinTrucks);
$('#dialog_maxtrucks').val(jobsitelimit.MaxTrucks);
var types = [];
types = jobsitelimit.AssetTypes.split(',');
if (assettypeparam)
editmultiselect_type.setValues(types);
if (jobsitelimit.AssetTypes)
types = jobsitelimit.AssetTypes.split(',');
$("#dialog_assettype").dropdownVals(types);
$('#dialog_notes').val(jobsitelimit.Notes);
}
@@ -152,9 +106,7 @@
var start_minute = $('#dialog_starttimeminute').val();
var end_hour = $('#dialog_endtimehour').val();
var end_minute = $('#dialog_endtimeminute').val();
var typeary = [];
if (assettypeparam)
typeary = assettypeparam.selectedvalue;
var typeary = $("#dialog_assettype").dropdownVals();
var assettypes = typeary.join(',');
var item = {
'JobSiteID': $('#dialog_jobsite').val(),
@@ -204,7 +156,7 @@
return;
}
showloading(false);
showloading(false);
var param = JSON.stringify(item);
param = htmlencode(param);
jobsitelimitquery("SaveJobsiteLimit", contractorid + String.fromCharCode(170) + param, function (data) {
@@ -247,13 +199,7 @@
showAlert(data, GetTextByKey("P_M3_ERROR", 'Error'));
return;
}
assettypeparam = {
items: data,
selectedvalue: [],
allowall: false
};
editmultiselect_type = editmultiselect(assettypeparam);
$('#dialog_assettype').append(editmultiselect_type);
$("#dialog_assettype").dropdownSource(data);
}, function (err) {
});
}
@@ -309,10 +255,19 @@
}
$(function () {
$("#dialog_assettype").css('width', 324).dropdown([], {
search: true,
multiselect: true,
allowselectall: false,
textKey: 'Value',
valueKey: 'Key'
});
GetMachineTypes();
GetActiveJobsites();
init();
initTime();
function resizeContent() {
$('#divcontent').css('height', $(window).height() - $('#divcontent').offset().top - 4);
}
@@ -324,7 +279,9 @@
</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 id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div>
<div class="function_title">
<span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_M3_SAVE">Save</span>
@@ -342,7 +299,7 @@
<tr>
<td class="label" data-lgid="P_M3_JOBSITE_COLON">JobSite:</td>
<td>
<select id="dialog_jobsite" tabindex="1" style="width: 322px;"></select></td>
<select id="dialog_jobsite" tabindex="1" style="width: 322px; height: 22px;"></select></td>
</tr>
<tr>
<td class="label"></td>

View File

@@ -7,60 +7,11 @@
display: none;
}
.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: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.a {
text-decoration: none;
color: #2140fb;
}
.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;
}
.machinetd {
white-space: nowrap;
text-overflow: ellipsis;
@@ -128,19 +79,6 @@
background-color: #EFEFEF;
}
.div_filter {
margin-top: -3px;
}
.div_filter .dropdown {
width: 200px;
margin: 2px 0 0 0px;
}
.div_panel {
min-width: 200px;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
@@ -243,12 +181,10 @@
<link href="<%=GetFileUrlWithVersion("../fic/css/datepicker.min.css")%>" rel="stylesheet" />
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../fic/js/datepicker.min.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<%--<link rel="stylesheet" type="text/css" href="css/default.css" />--%>
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../Maintenance/js/inputdatactr.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/jobsiterequirement.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/email.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/dispatchassign.js")%>" type="text/javascript"></script>
@@ -555,10 +491,8 @@
$('#begindatetxt').val('');
$('#enddatetxt').val('');
$('#pointofcontacttxt').val('');
if (assettypeipt)
assettypeipt.reset();
jobsiterequirementCtrl.setData([]);
$("#div_assettypes").dropdownVals([]);
grid_jsrequirementdt.setData([]);
allRequirements = [];
}
@@ -601,40 +535,54 @@
}
var assettypes;
var assettypeparam;
var assettypeipt;
function getAssetTypes() {
if (assettypes)
return;
$('#div_assettypes').empty();
jobsitequery('GetAssetTypes', '', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
assettypes = data;
assettypeparam = {
items: data,
selectedvalue: [],
allowall: false,
allowsearch: true,
width: 280
};
assettypeipt = editmultiselect(assettypeparam);
$('#div_assettypes').append(assettypeipt);
var ats = [...assettypes];
ats = ats.filter(t => t.Tag1 == "1");
$("#div_assettypes").dropdownSource(ats);
});
}
var editableSelectAssignAsset;
$(function () {
jobsiterequirementCtrl = new $jobsiterequirementCtrl();
jobsiterequirementCtrl.Init($("#requirementlist"), false);
InitJobsiteschedulerGridData();
InitAssetGridData();
InitEmailGridData();
editableSelectAssignAsset = new $editableselect($("#dialog_assignasset"));
editableSelectAssignAsset.setEnable(false);
InitAttachedAssetGridData();
$('#dialog_assignasset').dropdown([], {
search: true,
valueKey: 'Id',
textKey: 'DisplayName'
});
$('#dialog_assignasset').dropdownDisabled(false);
$("#div_assettypes").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: false,
textKey: 'Value',
valueKey: 'Key'
});
$("#chkmanagetypeonly").on('change', function () {
var selectedtypes = $("#div_assettypes").dropdownVals() || [];
var ats = [...assettypes];
if ($(this).prop('checked')) {
ats = ats.filter(t => t.Tag1 == "1");
}
$("#div_assettypes").dropdownSource(ats);
$("#div_assettypes").dropdownVals(selectedtypes);
});
getAssetTypes();
if (!alljobsites)
getJobsites();
@@ -694,6 +642,10 @@
showmaskbg(false);
});
$('#dialog_attachedassets').dialog(function () {
$('#dialogmask').hide();
});
$('#sendmail_othertextaddress').focus(function (e) {
var left = $('#dialog_sendmail').offset().left + $('#dialog_sendmail').width() + 2;
var top = $('#dialog_sendmail').offset().top + $("#dialog_sendmail").height() - $("#div_tooltip").height() - 9;
@@ -714,13 +666,13 @@
<%} %>
</div>
<div class="clear"></div>
<div class="edit-content" style="margin: 10px;">
<div style="margin: 10px;">
<table>
<tr>
<td>
<div class="search_bar">
<span data-lgid="P_JS_JOBSITE_COLON">Jobsite:</span>
<select id="dialog_jobsite" style="width: 150px;" tabindex="1">
<select id="dialog_jobsite" style="width: 150px; margin-left: 5px;" tabindex="1">
</select>
<span data-lgid="P_JS_BEGINDATE_COLON" style="margin-left: 10px;">Begin Date:</span>
<div>
@@ -731,8 +683,10 @@
<input type="text" id="enddatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" />
</div>
<span data-lgid="P_JS_ASSETTYPE_COLON" style="margin-left: 10px;">Asset Type:</span>
<div id="div_assettypes" style="margin-left: 5px;"></div>
<span data-lgid="P_JS_POINTOFCONTACT_COLON" style="margin-left: 10px;">Point of Contact:</span>
<div id="div_assettypes" style="margin-left: -1px;"></div>
<input type="checkbox" id="chkmanagetypeonly" style="margin-left: 5px;" checked="checked" />
<label for="chkmanagetypeonly">Managed Types Only</label>
<span data-lgid="P_JS_POINTOFCONTACT_COLON" style="margin-left: 20px!important;">Point of Contact:</span>
<div>
<input type="text" id="pointofcontacttxt" maxlength="100" autocomplete="off" style="width: 100px; margin-left: 5px;" />
</div>
@@ -750,7 +704,9 @@
</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_managemahchine" style="display: none;">
<div class="dialog-title"><span id="spTitle" class="title" data-lgid="P_JS_MANAGEASSETS"></span><em class="dialog-close"></em></div>
<div class="requireinfo">
@@ -783,10 +739,10 @@
</div>
</div>
<div class="dialog" id="dialog_sendmail" style="display: none; width: 320px;">
<div class="dialog" id="dialog_sendmail" style="display: none; width: 510px;">
<div class="dialog-title"><span class="title" data-lgid="P_JS_SENDDISPATCHREQUEST">Send Dispatch Request</span><em class="dialog-close"></em></div>
<div class="dialog-content" style="height: 378px;">
<table>
<div class="dialog-content" >
<table style="line-height:24px;">
<tr>
<td colspan="2" data-lgid="P_MV_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
</tr>
@@ -802,22 +758,20 @@
<td><span data-lgid="P_MV_OTHEREMAILADDRESS">Other Email Address</span>
</td>
<td>
<input type="text" id="sendmail_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
<input type="text" id="sendmail_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
</tr>
<tr style="height: 24px; display: none;">
<td><span data-lgid="P_MV_OTHERTEXTADDRESS">Other Text Address</span>
</td>
<td>
<input type="text" id="sendmail_othertextaddress" style="width: 312px;" autocomplete="off" />
<input type="text" id="sendmail_othertextaddress" style="width: 350px;" autocomplete="off" />
</td>
<%--<span id="span_hepler" class='helper pointer' title='Help'></span>--%>
</tr>
<tr style="height: 24px;">
<td colspan="2" data-lgid="P_MV_DESCRIPTION_COLON">Description:</td>
</tr>
<tr>
<td colspan="2">
<textarea id="sendmail_desc" style="width: 444px; height: 80px; resize: none; margin-left: 12px;"></textarea></td>
<td data-lgid="P_MV_DESCRIPTION">Description</td>
<td>
<textarea id="sendmail_desc" style="width: 350px; height: 80px; resize: none;"></textarea></td>
</tr>
</table>
</div>
@@ -837,7 +791,7 @@
</tr>
<tr>
<td>
<div id="dialog_assignasset" style="width: 320px; height: 22px;"></div>
<div id="dialog_assignasset" style="width: 320px;" class="dropdown"></div>
</td>
</tr>
</table>
@@ -848,4 +802,21 @@
<div class="clear"></div>
</div>
</div>
<div class="dialog" id="dialog_attachedassets" style="display: none;">
<div class="dialog-title"><span class="title" data-lgid="P_JS_ATTACHEDASSETS">Attached Assets</span><em class="dialog-close"></em></div>
<div class="dialog-content">
<div style="text-align: center; line-height: 20px; margin-bottom: 10px;">
<span id="span_attachedasset_tips1"></span><br />
<span id="span_attachedasset_tips2"></span>
</div>
<div id="dialog_attachedassetlist" style="height: 300px; width: 100%;"></div>
</div>
<div class="dialog-func">
<input type="button" value="Close" data-lgid="P_JS_CANCEL" class="dialog-close" tabindex="2" />
<input type="button" id="btn_addattasset" onclick="OnAddAttachedAssets();" data-lgid="P_JS_OK" value="OK" tabindex="1" />
<input type="button" id="btn_removeattasset" onclick="OnRemoveAttachedAssets();" style="display:none;" data-lgid="P_JS_REMOVE" value="Remove" tabindex="1" />
<div class="clear"></div>
</div>
</div>
</asp:Content>

View File

@@ -7,38 +7,6 @@
display: none;
}
.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: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.a {
text-decoration: none;
color: #2140fb;
@@ -128,15 +96,6 @@
background-color: #EFEFEF;
}
.div_filter {
margin-top: -3px;
}
.div_filter .dropdown {
width: 200px;
margin: 2px 0 0 0px;
}
.div_panel {
min-width: 200px;
}
@@ -239,7 +198,6 @@
<script src="<%=GetFileUrlWithVersion("../js/components/datagrid.js")%>" type="text/javascript"></script>
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<%--<link rel="stylesheet" type="text/css" href="css/default.css" />--%>
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
@@ -299,7 +257,7 @@
'PointOfContact': $('#dialog_pointofcontact').val(),
};
var machine = editableSelectMachine.selecteditem();
var machine = $('#dialog_machine').dropdownItem();
if (machine == null) {
showAlert(GetTextByKey("P_FR_ASSETNOTEMPTY", 'Asset cannot be empty.'), alerttitle);
$('#dialog_machine').focus();
@@ -383,7 +341,7 @@
}
function OnAdd() {
editableSelectMachine.val('');
$('#dialog_machine').dropdownVal('');
setMachineInfo();
$('#dialog_jobsite').val('');
$('#dialog_begindate').val('');
@@ -401,8 +359,6 @@
}
else
getJobsites();
editableSelectMachine.reload();
}
function getJobsites() {
@@ -437,9 +393,7 @@
jobsitequery("GetMachines", "", function (data) {
if (data && data.length > 0) {
machines = data;
editableSelectMachine.datasource = machines;
editableSelectMachine.valuepath = "Id"
editableSelectMachine.displaypath = "DisplayName";
$('#dialog_machine').dropdownSource(machines);
}
if (next)
next();
@@ -447,9 +401,8 @@
});
}
var editableSelectMachine;
function setMachineInfo() {
var machine = editableSelectMachine.selecteditem();
var machine = $('#dialog_machine').dropdownItem();
if (machine) {
$('#dialog_vin').text(machine.VIN);
$('#dialog_make').text(machine.MakeName);
@@ -465,9 +418,11 @@
}
$(function () {
editableSelectMachine = new $editableselect($("#dialog_machine"));
editableSelectMachine.tabIndex(1);
editableSelectMachine.change(function () {
$('#dialog_machine').dropdown([], {
search: true,
valueKey: 'Id',
textKey: 'DisplayName'
}).on('select', function (_e, item) {
setMachineInfo();
});
@@ -522,7 +477,7 @@
<tr>
<td class="label" data-lgid="P_FR_ASSET_COLON">Asset:</td>
<td colspan="4">
<div id="dialog_machine" style="width: 322px; height: 22px;"></div>
<div id="dialog_machine" style="width: 322px;" class="dropdown"></div>
</td>
</tr>
<tr>

View File

@@ -54,30 +54,7 @@
.user_main {
padding: 0 4px;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.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;
}
#dialog_machines .dialog-content table td input,
#dialog_layouts .dialog-content table td input {
@@ -94,12 +71,6 @@
margin: 3px 4px 0 4px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.ybutton {
width: 80px;
line-height: normal;
@@ -157,10 +128,6 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.div_filter .dropdown {
width: 120px;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
@@ -203,7 +170,7 @@
else if (j === "EndDate")
r[j] = { DisplayValue: r["EndDateStr"], Value: r[j] };
else if (j === "Completed")
r[j] = { DisplayValue: r["Completed"] ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r["Completed"] ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
else if (j === "CompletedTime")
r[j] = { DisplayValue: r["CompletedTimeStr"], Value: r[j] };
else if (j === "AddedOn")
@@ -211,8 +178,7 @@
else if (j === "DeletedOn")
r[j] = { DisplayValue: r["DeletedOnStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -221,12 +187,7 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#dispatchlist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#dispatchlist');
var list_columns = [
{ name: 'BeginDate', caption: GetTextByKey("P_JS_MOVEDATE", "Move Date"), valueIndex: 'BeginDate', css: { 'width': 100, 'text-align': 'left' } },
{ name: 'AssetName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 200, 'text-align': 'left' } },
@@ -269,12 +230,6 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
}
$(function () {

View File

@@ -1,84 +1,7 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/JobSite/JobSiteMasterPage.master" AutoEventWireup="true" CodeFile="DispatchRequests.aspx.cs" Inherits="DispatchRequests" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<style type="text/css">
.itemselcted {
background-color: #ccc;
}
.itemhidden {
display: none;
}
.itemsuggested {
background-color: #ffff99;
}
#tbMachineTypes tbody tr:hover {
cursor: default;
background: #ddd;
}
#tbodyAssigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodyUnassigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodySelected tr:hover {
cursor: default;
background: #ddd;
}
#contentctrl {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.float_left {
float: left;
}
.function_bar {
float: right;
}
.user_main {
padding: 0 4px;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.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;
}
#dialog_machines .dialog-content table td input,
#dialog_layouts .dialog-content table td input {
width: auto;
@@ -87,94 +10,15 @@
.dialog-content table td input[type="checkbox"] {
border: none;
}
#dialog_user_randompass {
width: auto;
height: 16px;
margin: 3px 4px 0 4px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.ybutton {
width: 80px;
line-height: normal;
margin-left: 6px;
border: none;
background: rgb(249, 189, 117);
padding: 5px 14px;
cursor: pointer;
}
.ybutton:hover {
background: #d7690E;
}
.td_controller {
vertical-align: middle;
padding: 40px 8px;
/*border-left: 1px solid #b0b0b0;
border-right: 1px solid #b0b0b0;*/
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.subdialog {
width: -moz-calc(100% - 24px);
width: -webkit-calc(100% - 24px);
width: calc(100% - 24px);
}
.machine_maskbg {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: #000;
opacity: 0.2;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
font-weight: lighter;
font-size: 18px;
width: 770px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.div_filter .dropdown {
width: 120px;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/email.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/dispatchassign.js")%>" type="text/javascript"></script>
<script>
jobsitequery = function (method, param, callback, error, nolog) {
_network.request("JobSite/DispatchRequests.aspx?tp=ashx", -1, method, param, callback, error, nolog);
}
var jobsiteparam;
var regionparam;
var IsReadOnly = <%=IsReadOnly ?"true":"false"%>;
var allroadassets;
var _sendType = 1;
@@ -182,7 +26,7 @@
var _selectdispatchids;
/***************************Jobsites***************************/
function OnDelete(dis) {
if (!dis) {
return;
@@ -211,18 +55,18 @@
}
function OnRefresh() {
var lateststartdate = $.trim($('#latesdatetxt').val());
if (lateststartdate && !$('#latesdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_THELATESTSTARTDATEISINVALID', "The latest start date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
showloading(false);
return;
}
var jobsites = $('#div_jobsites').dropdownVals();
var regions = $('#div_region').dropdownVals();
showloading(true);
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var regions = [];
if (regionparam)
regions = regionparam.selectedvalue;
var p = {
"LatestStartDate": $.trim($('#latesdatetxt').val()),
"LatestStartDate": lateststartdate,
"JobSites": jobsites,
"Regions": regions,
"SearchText": $.trim($('#searchinputtxt').val()),
@@ -255,8 +99,7 @@
else if (j === "CompletedTime")
r[j] = { DisplayValue: r["CompletedTimeStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -265,12 +108,7 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#dispatchlist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#dispatchlist');
var list_columns = [
//{ 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' } },
@@ -338,16 +176,14 @@
}
if (col.name === "Delete") {
col.sortable = false;
col.isurl = true;
col.text = "\uf00d";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_JS_DELETE", 'Delete') };
col.styleFilter = function (e) {
if (e.Completed)
@@ -359,16 +195,14 @@
}
if (col.name === "History") {
col.sortable = false;
col.isurl = true;
col.text = "\uf06e";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'eye';
col.events = {
onclick: function () {
OnViewChangeHistory(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_MR_VIEWCHANGEHIS", 'View Change History') };
col.visible = !IsReadOnly;
}
@@ -377,12 +211,6 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
}
@@ -393,53 +221,39 @@
}
var alljobsites;
var jobsite_editmultiselect;
function getJobsitesAndRegions() {
jobsitequery('GetJobsitesAndRegions', '', function (data) {
jobsitequery('GetJobsitesAndRegions', '1', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
alljobsites = data.Jobsites;
jobsiteparam = {
allitems: data.Jobsites,
items: JSON.parse(JSON.stringify(data.Jobsites)),
selectedvalue: [],
width: 240
};
jobsite_editmultiselect = editmultiselect(jobsiteparam);
$('#div_jobsites').append(jobsite_editmultiselect);
$("#div_jobsites").dropdownSource(data.Jobsites);
regionparam = {
items: data.Regions,
selectedvalue: [],
width: 240,
oncompleted: onregioncompleted
};
var ipt = editmultiselect(regionparam);
$('#div_region').append(ipt);
$('#div_region').dropdownSource(data.Regions);
});
}
function onregioncompleted() {
if (!jobsiteparam || !jobsiteparam.allitems) return;
jobsiteparam.items.length = 0;
for (var i in jobsiteparam.allitems) {
var item = jobsiteparam.allitems[i];
if (!regionparam.selectedvalue
|| regionparam.selectedvalue.length == 0
|| regionparam.selectedvalue.indexOf(item.Tag3) >= 0)
jobsiteparam.items.push(item);
}
jobsite_editmultiselect.reset();
if (!alljobsites) return;
var regions = $('#div_region').dropdownVals();
var jss = [...alljobsites];
if (regions && regions.length > 0)
jss = jss.filter(t => regions.indexOf(t.Tag3) >= 0);
$("#div_jobsites").dropdownSource(jss);
var seljss = $("#div_jobsites").dropdownVals();
$("#div_jobsites").dropdownSource(jss).dropdownVals(seljss);
}
var editableSelectAssignAsset;
$(function () {
setPageTitle(GetTextByKey("P_JS_DISPATCHREQUESTS", "Dispatch Requests"), true);
editableSelectAssignAsset = new $editableselect($("#dialog_assignasset"));
editableSelectAssignAsset.setEnable(false);
$('#dialog_assignasset').dropdown([], {
search: true,
valueKey: 'Id',
textKey: 'DisplayName'
});
$('#dialog_assignasset').dropdownDisabled(false);
InitGridData();
InitEmailGridData();
getJobsitesAndRegions();
@@ -451,6 +265,22 @@
}).resize();
OnRefresh();
$("#div_region").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
}).on('collapsed', onregioncompleted);
$("#div_jobsites").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$('#searchinputtxt').keydown(searchEnter);
$('#dialog_sendmail').dialog(function () {
@@ -467,16 +297,6 @@
$('#div_tooltip').css({ 'display': '', 'left': left, 'top': top });
});
$('#latesdatetxt').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]);
}
});
if (!canExport) {
$('#spExport').hide();
}
@@ -515,16 +335,15 @@
}
function OnExport() {
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var regions = [];
if (regionparam)
regions = regionparam.selectedvalue;
var jobsites = $('#div_jobsites').dropdownVals();
var regions = $('#div_region').dropdownVals();
var lateststartdate = $.trim($('#latesdatetxt').val());
if (lateststartdate && !$('#latesdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_THELATESTSTARTDATEISINVALID', "The latest start date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var p = {
"LatestStartDate": $.trim($('#latesdatetxt').val()),
"LatestStartDate": lateststartdate,
"JobSites": jobsites,
"Regions": regions,
"SearchText": $.trim($('#searchinputtxt').val()),
@@ -541,7 +360,7 @@
<div class="search_bar">
<input type="password" autocomplete="new-password" style="display: none" />
<span data-lgid="P_JS_LATESTSTARTDATE_COLON"></span>
<input type="text" id="latesdatetxt" autocomplete="off" style="float: left; width: 80px; margin-left: 5px;" value="<%=LatestStartDate %>" />
<input type="date" class="type-date" required min="1900-01-01" id="latesdatetxt" autocomplete="off" style="float: left; width: 89px; margin-left: 5px;" value="<%=LatestStartDate %>" />
<span data-lgid="P_JS_REGION_COLON">Region:</span>
<div id="div_region"></div>
<span data-lgid="P_JS_JOBSITES_COLON">Jobsites:</span>
@@ -560,42 +379,42 @@
<div id="dispatchlist"></div>
</div>
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
<div class="dialog" id="dialog_sendmail" style="display: none; width: 320px;">
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div class="dialog" id="dialog_sendmail" style="display: none; width: 510px;">
<div class="dialog-title"><span class="title" data-lgid="P_JS_SENDDISPATCHREQUEST">Send Dispatch Request</span><em class="dialog-close"></em></div>
<div class="dialog-content" style="height: 378px;">
<div class="dialog-content" style="line-height: 24px;">
<table>
<tr>
<td colspan="2" data-lgid="P_MV_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
</tr>
<tr>
<td colspan="2">
<div id="contactlist" style="height: 168px; width: 440px; margin-left: 10px; margin-right: 10px;"></div>
<div id="contactlist" style="height: 168px; width: 470px; margin-left: 10px; margin-right: 10px;"></div>
</td>
</tr>
<tr style="height: 24px;">
<td colspan="2" data-lgid="P_MV_EMAILORTEXTADDRESSESTIPS">Separate multiple manually entered email or text addresses with a semi-colon (;).</td>
</tr>
<tr style="height: 24px;">
<td><span data-lgid="P_MV_OTHEREMAILADDRESS">Other Email Address</span>
<td style="text-align: right; padding-right: 5px;"><span data-lgid="P_MV_OTHEREMAILADDRESS">Other Email Address</span>
</td>
<td>
<input type="text" id="sendmail_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
<input type="text" id="sendmail_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
</tr>
<tr style="height: 24px; display: none;">
<td><span data-lgid="P_MV_OTHERTEXTADDRESS">Other Text Address</span>
<td style="text-align: right; padding-right: 5px;"><span data-lgid="P_MV_OTHERTEXTADDRESS">Other Text Address</span>
</td>
<td>
<input type="text" id="sendmail_othertextaddress" style="width: 312px;" autocomplete="off" />
<input type="text" id="sendmail_othertextaddress" style="width: 350px;" autocomplete="off" />
</td>
<%--<span id="span_hepler" class='helper pointer' title='Help'></span>--%>
</tr>
<tr style="height: 24px;">
<td colspan="2" data-lgid="P_MV_DESCRIPTION_COLON">Description:</td>
</tr>
<tr>
<td colspan="2">
<textarea id="sendmail_desc" style="width: 444px; height: 80px; resize: none; margin-left: 12px;"></textarea></td>
<td style="text-align: right; padding-right: 5px;" data-lgid="P_MV_DESCRIPTION">Description</td>
<td>
<textarea id="sendmail_desc" style="width: 350px; height: 80px; resize: none;"></textarea></td>
</tr>
</table>
</div>
@@ -615,7 +434,7 @@
</tr>
<tr>
<td>
<div id="dialog_assignasset" style="width: 320px; height: 22px;"></div>
<div id="dialog_assignasset" style="width: 320px; position: relative;" class="dropdown"></div>
</td>
</tr>
</table>

View File

@@ -38,14 +38,14 @@ public partial class DispatchRequests : JobSiteRequirementsBasePage
}
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
LatestStartDate = userlocaldate.ToShortDateString();
LatestStartDate = userlocaldate.ToString("yyyy-MM-dd");
}
protected override int FeatureID
{
get
{
return Foresight.Fleet.Services.User.Feature.JOB_SITES_DISPATCHREQUESTS;
return Feature.JOB_SITES_DISPATCHREQUESTS;
}
}
}

View File

@@ -2,195 +2,14 @@
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<style type="text/css">
.itemselcted {
background-color: #ccc;
}
.itemhidden {
display: none;
}
.itemsuggested {
background-color: #ffff99;
}
#tbMachineTypes tbody tr:hover {
cursor: default;
background: #ddd;
}
#tbodyAssigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodyUnassigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodySelected tr:hover {
cursor: default;
background: #ddd;
}
#contentctrl {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.float_left {
float: left;
}
.function_bar {
float: right;
}
.user_main {
padding: 0 4px;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.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;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
#dialog_machines .dialog-content table td input,
#dialog_layouts .dialog-content table td input {
width: auto;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
#dialog_user_randompass {
width: auto;
height: 16px;
margin: 3px 4px 0 4px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.machine_filter {
height: 20px;
line-height: 20px;
}
.machine_filter select {
height: 23px;
min-width: 100px;
max-width: 300px;
}
.ybutton {
width: 80px;
line-height: normal;
margin-left: 6px;
border: none;
background: rgb(249, 189, 117);
padding: 5px 14px;
cursor: pointer;
}
.ybutton:hover {
background: #d7690E;
}
.td_controller {
vertical-align: middle;
padding: 40px 8px;
/*border-left: 1px solid #b0b0b0;
border-right: 1px solid #b0b0b0;*/
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.subdialog {
width: -moz-calc(100% - 24px);
width: -webkit-calc(100% - 24px);
width: calc(100% - 24px);
}
.machine_maskbg {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: #000;
opacity: 0.2;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
font-weight: lighter;
font-size: 18px;
width: 770px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/editmultiselect.css" />
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/datagrid.js")%>"></script>
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/gridlayout.js")%>" type="text/javascript"></script>
<script>
_network.jobsitequery = function (method, param, callback, error, nolog) {
@@ -199,10 +18,9 @@
var gridLayoutID = "Jobsites";
var _allJobSites;
var jobsitetypeparam;
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
/***************************Jobsites***************************/
/***************************Jobsites***************************/
function OnDelete(jobsite) {
if (!jobsite) {
@@ -263,7 +81,7 @@
var jobsiteid;
function OnEdit() {
var jobsite = grid_dt.source[grid_dt.selectedIndex].Values;
var jobsite = grid_dt.source[grid_dt.selectedIndex];
if (!jobsite) {
jobsiteid = undefined;
return;
@@ -285,9 +103,7 @@
var searchtxt = "";
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
var jobsitetypes = [];
if (jobsitetypeparam)
jobsitetypes = jobsitetypeparam.selectedvalue;
var jobsitetypes = $("#div_jobsitetype").dropdownVals();
var active = $('#chk_activesitesonly').prop('checked');
_network.jobsitequery("GetJobSites", JSON.stringify(jobsitetypes) + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + active, function (data) {
@@ -303,6 +119,13 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var radiusstr = "";
if (r.Radius > 0) {
if (r.Radius_UOM === "Mile")
radiusstr = r.Radius + " " + GetTextByKey('P_JS_MILE', 'Mile') + '(s)';
else if (r.Radius_UOM === "Kilometre")
radiusstr = r.Radius + " " + GetTextByKey('P_JS_KILOMETER', 'Kilometer') + '(s)';
}
for (var j in r) {
//if (j === "Radius_UOM")
// r[j] = { DisplayValue: r["Radius"] > 0 ? r["Radius_UOM"] : '', Value: r["Radius"] > 0 ? r[j] : '' };
@@ -312,9 +135,10 @@
r[j] = { DisplayValue: r["EndDateStr"], Value: r[j] };
else if (j === "ProjectedEndDate")
r[j] = { DisplayValue: r["ProjectedEndDateStr"], Value: r[j] };
else if (j === "RadiusStr")
r[j] = { DisplayValue: radiusstr, Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -323,36 +147,31 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#jobsitelist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#jobsitelist');
var list_columns = [
{ name: 'Name', caption: GetTextByKey("P_JS_NAME", "Name"), valueIndex: 'Name', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Region', caption: GetTextByKey("P_JS_REGION", "Region"), valueIndex: 'Region', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Number', caption: GetTextByKey("P_JS_NUMBER", "Number"), valueIndex: 'Number', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Code', caption: GetTextByKey("P_JS_CODE", "Code"), valueIndex: 'Code', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_JS_NAME", "Name"), valueIndex: 'Name', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Region', caption: GetTextByKey("P_JS_REGION", "Region"), valueIndex: 'Region', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Number', caption: GetTextByKey("P_JS_NUMBER", "Number"), valueIndex: 'Number', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Code', caption: GetTextByKey("P_JS_CODE", "Code"), valueIndex: 'Code', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Types', caption: GetTextByKey("P_JS_TYPES", "Types"), valueIndex: 'Types', allowFilter: true, css: { 'width': 160, 'text-align': 'left' } },
{ name: 'Latitude', caption: GetTextByKey("P_JS_LATITUDE", "Latitude"), valueIndex: 'Latitude', css: { 'width': 100, 'text-align': 'right' } },
{ name: 'Longitude', caption: GetTextByKey("P_JS_LONGITUDE", "Longitude"), valueIndex: 'Longitude', css: { 'width': 100, 'text-align': 'right' } },
{ name: 'ColorString', caption: GetTextByKey("P_JS_COLOR", "Color"), valueIndex: 'ColorString', css: { 'width': 60, 'text-align': 'center' } },
{ name: 'RadiusStr', caption: GetTextByKey("P_JS_RADIUS", "RadiusStr"), valueIndex: 'RadiusStr', css: { 'width': 100, 'text-align': 'right' } },
{ name: 'BaseonAsset', caption: GetTextByKey("P_JS_BINDINGTOASSET", "Binding to Asset"), valueIndex: 'BaseonMachineName', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Latitude', caption: GetTextByKey("P_JS_LATITUDE", "Latitude"), valueIndex: 'Latitude', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
{ name: 'Longitude', caption: GetTextByKey("P_JS_LONGITUDE", "Longitude"), valueIndex: 'Longitude', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
{ name: 'ColorString', caption: GetTextByKey("P_JS_COLOR", "Color"), valueIndex: 'ColorString', css: { 'width': 80, 'text-align': 'center' } },
{ name: 'RadiusStr', caption: GetTextByKey("P_JS_RADIUS", "RadiusStr"), valueIndex: 'RadiusStr', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
{ name: 'BaseonAsset', caption: GetTextByKey("P_JS_BINDINGTOASSET", "Binding to Asset"), valueIndex: 'BaseonMachineName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
//{ name: 'Radius', caption: GetTextByKey("P_JS_RADIUS", "Radius"), valueIndex: 'Radius', css: { 'width': 100, 'text-align': 'right' } },
//{ name: 'Radius_UOM', caption: GetTextByKey("P_JS_RADIUSUOM", "Radius UOM"), valueIndex: 'Radius_UOM', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Foreman', caption: GetTextByKey("P_JS_FOREMAN", "Foreman"), valueIndex: 'Foreman', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Manager', caption: GetTextByKey("P_JS_MANAGER", "Manager"), valueIndex: 'Manager', visible: false, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Phone', caption: GetTextByKey("P_JS_PHONE", "Phone"), valueIndex: 'Phone', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Email', caption: GetTextByKey("P_JS_EMAIL", "Email"), valueIndex: 'Email', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Group', caption: GetTextByKey("P_JS_GROUP", "Group"), valueIndex: 'Group', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Address1', caption: GetTextByKey("P_JS_DELIVERYADDRESS1", "Delivery Address 1"), valueIndex: 'Address1', visible: false, css: { 'width': 140, 'text-align': 'left' } },
{ name: 'Address2', caption: GetTextByKey("P_JS_DELIVERYADDRESS2", "Delivery Address 2"), valueIndex: 'Address2', visible: false, css: { 'width': 140, 'text-align': 'left' } },
{ name: 'City', caption: GetTextByKey("P_JS_CITY", "City"), valueIndex: 'City', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'State', caption: GetTextByKey("P_JS_STATE", "State"), valueIndex: 'State', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Zip', caption: GetTextByKey("P_JS_ZIP", "Zip"), valueIndex: 'Zip', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'County', caption: GetTextByKey("P_JS_COUNTY", "County"), valueIndex: 'County', visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Foreman', caption: GetTextByKey("P_JS_FOREMAN", "Foreman"), valueIndex: 'Foreman', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Manager', caption: GetTextByKey("P_JS_MANAGER", "Manager"), valueIndex: 'Manager', allowFilter: true, visible: false, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Phone', caption: GetTextByKey("P_JS_PHONE", "Phone"), valueIndex: 'Phone', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Email', caption: GetTextByKey("P_JS_EMAIL", "Email"), valueIndex: 'Email', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Group', caption: GetTextByKey("P_JS_GROUP", "Group"), valueIndex: 'Group', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Address1', caption: GetTextByKey("P_JS_DELIVERYADDRESS1", "Delivery Address 1"), allowFilter: true, valueIndex: 'Address1', visible: false, css: { 'width': 140, 'text-align': 'left' } },
{ name: 'Address2', caption: GetTextByKey("P_JS_DELIVERYADDRESS2", "Delivery Address 2"), allowFilter: true, valueIndex: 'Address2', visible: false, css: { 'width': 140, 'text-align': 'left' } },
{ name: 'City', caption: GetTextByKey("P_JS_CITY", "City"), valueIndex: 'City', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'State', caption: GetTextByKey("P_JS_STATE", "State"), valueIndex: 'State', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'Zip', caption: GetTextByKey("P_JS_ZIP", "Zip"), valueIndex: 'Zip', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'County', caption: GetTextByKey("P_JS_COUNTY", "County"), valueIndex: 'County', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'StartDate', caption: GetTextByKey("P_JS_STATDATE", "Start Date"), valueIndex: 'StartDate', css: { 'width': 100, 'text-align': 'left' } },
{ name: 'ProjectedEndDate', caption: GetTextByKey("P_JS_PROJECTEDENDDATE", "Projected End Date"), valueIndex: 'ProjectedEndDate', css: { 'width': 130, 'text-align': 'left' } },
{ name: 'EndDate', caption: GetTextByKey("P_JS_ENDDATE", "End Date"), valueIndex: 'EndDate', css: { 'width': 100, 'text-align': 'left' } },
@@ -377,68 +196,68 @@
col.alwaysshow = list_columns[hd].alwaysshow;
if (col.name === "Edit") {
col.sortable = false;
col.isurl = true;
col.text = "\uf044";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.events = {
onclick: function () {
OnEdit()
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_JS_EDIT", 'Edit') };
}
else if (col.name === "Delete") {
col.sortable = false;
col.isurl = true;
col.text = "\uf00d";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_JS_DELETE", 'Delete') };
}
else if (col.name === "ManageAssets") {
col.sortable = false;
col.isurl = true;
col.text = "\uf63c";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'truck-pickup';
col.events = {
onclick: function () {
OnManageMachine(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_JS_MANAGEASSETS", 'Manage Assets') };
} else if (col.name === 'ColorString') {
col.allowHtml = true;
col.filter = function (item) {
}
else if (col.name === 'ColorString') {
col.sortable = false;
col.styleFilter = function (item) {
var bg = 'rgb(' + item.Color.Red + ',' + item.Color.Green + ',' + item.Color.Blue + ')';
var cb = '<div style="background:' + bg + ';width:16px;height:16px;"></div>';
//return cb + item.ColorString;
return cb;
return { 'background-color': bg }
};
col.styleFilter = function () {
return { display: 'block' };
col.filter = function () { "" };
}
else if (col.name === 'RadiusStr') {
col.sortFilter = function (a, b) {
var ra = a.Radius;
if (a.Radius_UOM == "Mile")
ra = ra * 1.609344;
var rb = b.Radius;
if (b.Radius_UOM == "Mile")
rb = rb * 1.609344;
return ra > rb ? 1 : -1;
};
}
columns.push(col);
}
grid_dt.canMultiSelect = false;
//grid_dt.columns = columns;
//grid_dt.init();
grid_dt.rowdblclick = OnEdit;
grid_dt.onRowDblClicked = OnEdit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
jobsiteid = rowdata.Values.ID;
jobsiteid = rowdata.ID;
}
}
grid_dt.allcolumns = columns;
@@ -461,33 +280,31 @@
dialogAssets.onOK = function (source) {
var items = [];
for (var i = 0; i < source.length; i++) {
var it = source[i].Values;
var it = source[i];
if (it.Selected) {
items.push({
Values: {
AssetId: it.Id,
VIN: it.VIN,
Name: it.Name,
MakeName: it.MakeName,
ModelName: it.ModelName,
TypeName: it.TypeName,
OnSite: false
}
AssetId: it.Id,
VIN: it.VIN,
Name: it.Name,
MakeName: it.MakeName,
ModelName: it.ModelName,
TypeName: it.TypeName,
OnSite: false
});
}
}
$("#dialogmask").hide();
var params = [
'', jobsiteid,
JSON.stringify(items.map(function (f) { return f.Values.AssetId; }))
JSON.stringify(items.map(function (f) { return f.AssetId; }))
];
_network.jobsitequery('AddAssetToJobSite', params.join(String.fromCharCode(170)), function (r) {
if (r === 'OK') {
items = items.filter(function (it) {
var assetId = it.Values.AssetId;
return grid_dtsm.innerSource.filter(function (st) { return st.Values.AssetId === assetId; }).length === 0;
var assetId = it.AssetId;
return grid_dtsm.source.filter(function (st) { return st.AssetId === assetId; }).length === 0;
});
grid_dtsm.setData(grid_dtsm.innerSource.concat(items));
grid_dtsm.setData(grid_dtsm.source.concat(items));
} else {
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
}
@@ -509,52 +326,33 @@
if (r !== 'OK') {
showAlert(r, alerttitle);
} else {
for (var i = 0; i < grid_dtsm.innerSource.length; i++) {
var s = grid_dtsm.innerSource[i].Values;
if (s.AssetId === item.AssetId) {
grid_dtsm.innerSource.splice(i, 1);
break;
}
}
if (grid_dtsm.source != null) {
for (var j = 0; j < grid_dtsm.source.length; j++) {
if (item.AssetId === grid_dtsm.source[j].Values.AssetId) {
grid_dtsm.source.splice(j, 1);
break;
}
}
}
grid_dtsm.reset();
grid_dtsm.removeItem(grid_dtsm.selectedIndex);
}
});
});
}
function OnSiteChanging(item, input) {
var input_chk = $(input).closest('td').find('input');
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);
showConfirm(text, GetTextByKey("P_JS_ONSITECHANGE", "On Site Change"), function () {
$(input_chk).prop('checked', !$(input_chk).prop('checked')).change();
});
}
function OnSiteChanged() {
var params = [
'', jobsiteid,
this.AssetId,
this.OnSite ? '1' : '0'
];
$('#dialogmask').show();
_network.jobsitequery('ChangeAssetOnSiteState', params.join(String.fromCharCode(170)), function (r) {
$("#dialogmask").hide();
if (r !== 'OK') {
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
}
var item = this;
var text = item.OnSite ?
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? ") :
GetTextByKey("P_JS_ONSITETIPS1", "Are you sure you want to change the on-site of the asset:{0}?").replace('{0}', item.Name);
showConfirm(text, GetTextByKey("P_JS_ONSITECHANGE", "On Site Change"), function () {
var params = [
'', jobsiteid,
item.AssetId,
item.OnSite ? '1' : '0'
];
$('#dialogmask').show();
_network.jobsitequery('ChangeAssetOnSiteState', params.join(String.fromCharCode(170)), function (r) {
$("#dialogmask").hide();
if (r !== 'OK') {
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
}
});
}, function () {
item.OnSite = !item.OnSite;
grid_dtsm.refresh();
});
}
@@ -669,8 +467,7 @@
for (var i = 0; i < data.length; i++) {
var r = data[i];
r.State = "UNASSIGNED";
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtam.setData(rows);
@@ -680,8 +477,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtsm.setData(rows);
@@ -689,12 +485,7 @@
var grid_dtam;
function InitGridAvailableMachines() {
grid_dtam = new GridView('#availablemachinelist');
grid_dtam.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtam = createGridView('#availablemachinelist');
var list_columns = [
{ name: 'DisplayName', caption: "Asset Name", valueIndex: 'DisplayName', css: { 'width': 170, 'text-align': 'left' } },
{ name: 'State', caption: "Current State", valueIndex: 'State', css: { 'width': 100, 'text-align': 'left' } },
@@ -728,13 +519,13 @@
}
};
}
grid_dtam.canMultiSelect = true;
grid_dtam.multiSelect = true;
grid_dtam.columns = columns;
grid_dtam.init();
grid_dtam.rowdblclick = function (rowindex) {
grid_dtam.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtam.source[rowindex];
if (rowdata) {
var machine = rowdata.Values;
var machine = rowdata;
_availableMachines.splice(_availableMachines.indexOf(machine), 1);
machine.OnSite = true;
_selectedMachines.push(machine);
@@ -743,23 +534,12 @@
showMachines();
}
};
grid_dtam.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtam.source[rowindex];
if (rowdata) {
}
}
}
var grid_dtsm;
function InitGridSelectedMachines() {
grid_dtsm = new GridView('#selectedmachinelist');
grid_dtsm.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtsm = createGridView('#selectedmachinelist');
var list_columns = [
{ name: 'OnSite', caption: GetTextByKey("P_JS_ONSITE", "On Site"), valueIndex: 'OnSite', type: 3, css: { 'width': 70, 'text-align': 'center' } },
{ name: 'DisplayName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'Name', css: { 'width': 170, 'text-align': 'left' } },
@@ -788,10 +568,6 @@
}
if (col.key === 'OnSite') {
col.events = {
onclick: function (e) {
OnSiteChanging(this, e.target);
return false;
},
onchange: OnSiteChanged
};
}
@@ -802,38 +578,19 @@
width: 30,
align: 'center',
sortable: false,
isurl: true,
text: '\uf00d',
resizable: false,
type: GridView.ColumnTypes.Icon,
text: 'times',
events: {
onclick: function () {
OnMachineDeleteSingle(this);
}
},
classFilter: function (e) {
return "icon-col";
},
attrs: { 'title': 'Delete' }
});
grid_dtsm.canMultiSelect = true;
grid_dtsm.multiSelect = true;
grid_dtsm.columns = columns;
grid_dtsm.init();
//grid_dtsm.rowdblclick = function (rowindex) {
// var rowdata = grid_dtsm.source[rowindex];
// if (rowdata) {
// var machine = rowdata.Values;
// _selectedMachines.splice(_selectedMachines.indexOf(machine), 1);
// _showSelectedMachines.splice(_showSelectedMachines.indexOf(machine), 1);
// _availableMachines.push(machine);
// showMachines();
// }
//};
grid_dtsm.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtsm.source[rowindex];
if (rowdata) {
}
}
}
@@ -843,7 +600,7 @@
return;
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
var m = grid_dtam.source[index].Values;
var m = grid_dtam.source[index];
_availableMachines.splice(_availableMachines.indexOf(m), 1);
m.OnSite = true;
_selectedMachines.push(m);
@@ -867,7 +624,7 @@
return;
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
var m = grid_dtsm.source[index].Values;
var m = grid_dtsm.source[index];
_selectedMachines.splice(_selectedMachines.indexOf(m), 1);
_showSelectedMachines.splice(_showSelectedMachines.indexOf(m), 1);
_availableMachines.push(m);
@@ -890,8 +647,9 @@
'ID': jobsiteid,
'Machines': []
};
for (var i = 0; i < grid_dtsm.innerSource.length; i++) {
var m = grid_dtsm.innerSource[i].Values;
var tempsource = grid_dtsm.source;
for (var i = 0; i < tempsource.length; i++) {
var m = tempsource[i];
item.Machines.push({
'AssetId': m.AssetId,
'VIN': m.VIN,
@@ -959,7 +717,6 @@
}
}
var jobsitetypesdata;
function getJobsiteTypes() {
_network.jobsitequery('GetJobSiteTypes', '', function (data) {
if (typeof (data) === "string") {
@@ -971,13 +728,7 @@
for (var i = 0; i < data.length; i++) {
items.push({ 'Key': data[i], 'Value': data[i] })
}
jobsitetypeparam = {
items: items,
selectedvalue: []
};
jobsitetypesdata = data;
var iptalertype = editmultiselect(jobsitetypeparam);
$('#div_jobsitetype').append(iptalertype);
$('#div_jobsitetype').dropdownSource(items);
});
}
@@ -990,6 +741,14 @@
InitGridData();
InitGridSelectedMachines();
$("#div_jobsitetype").css('width', 200).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
getJobsiteTypes();
$('#tbody_jobsite').click(function (e) {
var target = $(e.target);
@@ -1053,9 +812,7 @@
function OnExport() {
var searchtxt = "";
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
var jobsitetypes = [];
if (jobsitetypeparam)
jobsitetypes = jobsitetypeparam.selectedvalue;
var jobsitetypes = $("#div_jobsitetype").dropdownVals();
var active = $('#chk_activesitesonly').prop('checked');
var layout = getLayoutOnGrid(grid_dt);
@@ -1122,6 +879,7 @@
formData.append("iconFile", fildata);
formData.append("MethodName", "GetImportJobsiteColumns");
formData.append("ClientData", '');
showloading(true);
$.ajax({
url: 'JobSIteManage.aspx',
type: 'POST',
@@ -1133,6 +891,7 @@
success: function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_JS_IMPORT", 'Import'));
showloading(false);
} else {
CreateImportColumns(data);
$('#dialog_import')
@@ -1145,6 +904,7 @@
}
},
error: function (err) {
showloading(false);
showAlert(err.statusText, GetTextByKey("P_JS_IMPORT", 'Import'));
}
});
@@ -1202,6 +962,7 @@
formData.append("iconFile", fildata);
formData.append("MethodName", "ImportJobsites");
formData.append("ClientData", param);
$('#dialogimportmask').show();
$.ajax({
url: 'JobSIteManage.aspx',
type: 'POST',
@@ -1214,6 +975,7 @@
importing = false;
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_JS_IMPORT", 'Import'));
$('#dialogimportmask').hide();
} else {
showAlert(data + GetTextByKey("P_JS_JOBSITESIMPORTEDSUCCESSFULLY", ' jobsite(s) imported successfully.'), GetTextByKey("P_JS_IMPORT", 'Import Jobsites'));
$('#dialog_import').hideDialog();
@@ -1224,6 +986,7 @@
error: function (err) {
importing = false;
showAlert(err.statusText, GetTextByKey("P_JS_IMPORT", 'Import'));
$('#dialogimportmask').hide();
}
});
@@ -1263,7 +1026,7 @@
<%}%>
<span class="sbutton iconlayout iconmenu" data-lgid="P_MR_LAYOUT">Layout</span>
</div>
<div id="jobsitelist"></div>
<div id="jobsitelist" class="fixedgrid"></div>
</div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
@@ -1283,7 +1046,7 @@
<span class="sbutton iconrefresh" onclick="GetSelectedMachines()" data-lgid="P_JS_REFRESH"></span>
</div>
<div class="machine_title">
<div id="machine-name"></div>
<div id="machine-name" style="padding-left: 15px;"></div>
</div>
<div class="div_machines">
<table class="table_holder">
@@ -1292,7 +1055,7 @@
<td>Available Assets</td>
<td></td>
<td>Assigned Assets
<input type="checkbox" id="chk_showallassignedassets" title="When checked, all associated or linked items will display regardless of filter. " /><label for="chk_showallassignedassets">Show All Assigned</label>
<input type="checkbox" id="chk_showallassignedassets" title="When checked, all associated or linked items will display regardless of filter. " /><label for="chk_showallassignedassets" data-lgid="P_M3_SHOWALLASSIGNED">Show All Assigned</label>
</td>
</tr>
</thead>
@@ -1354,5 +1117,6 @@
<input type="button" onclick="OnImportJobsites();" value="OK" tabindex="27" />
<div class="clear"></div>
</div>
<div id="dialogimportmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
</asp:Content>

View File

@@ -6,31 +6,51 @@
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<link type="text/css" href="<%=GetUrl("js/components/css/gridview.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetUrl("js/lib/ui.min.css") %>" rel="stylesheet" />
<link type="text/css" href="<%=GetUrl("css/override.css") %>" rel="stylesheet" />
<link rel="stylesheet" href="<%=GetUrl("css/default.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetUrl("css/split_sub.css")%>" type="text/css" />
<link rel="stylesheet" href="<%=GetUrl("css/editmultiselect.css")%>" type="text/css" />
<style type="text/css">
:root { <%=StyleVariables%> }
.data-grid {
height: 100%;
font-size: 12px !important;
font-family: "Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",sans-serif !important;
:root {
<%=StyleVariables%>
}
.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;
}
</style>
<script src="<%=GetUrl("js/lib/utility.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/lib/ui.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/jquery-3.6.0.min.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/cookie.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="<%=GetUrl("js/components/gridview.js") %>"></script>
<script src="<%=GetUrl("js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetUrl("js/language.js")%>" type="text/javascript"></script>
<script type="text/javascript">
var GridView = window.GridView || window['g5-gridview'];
var GridView = window['lib-ui'].Grid;
var canExport = <%= CanExportFile %>;
_network.root = '<%=Page.ResolveUrl("~/")%>';
var sitePath = "<%=this.ResolveUrl("~/fic/") %>";
var userid = '<%=UserID%>';
var companyid = '<%=CompanyID%>';
//if (typeof _utility !== 'object') {
// _utility = {};

View File

@@ -13,6 +13,9 @@ using System.Web.UI.WebControls;
public partial class JobSiteMasterPage : CommonBase
{
protected string UserID;
protected string CompanyID;
protected override bool ExportModule
{
get { return true; }
@@ -32,4 +35,15 @@ public partial class JobSiteMasterPage : CommonBase
}
}
}
protected override StyleInfo GetUIStyle()
{
var style = base.GetUIStyle();
if (style != null && style.User != null)
{
UserID = style.User.ID;
}
CompanyID = SystemParams.CompanyID;
return style;
}
}

View File

@@ -3,170 +3,16 @@
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<style type="text/css">
.itemselcted {
background-color: #ccc;
}
.itemhidden {
display: none;
}
.itemsuggested {
background-color: #ffff99;
}
#tbMachineTypes tbody tr:hover {
cursor: default;
background: #ddd;
}
#tbodyAssigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodyUnassigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodySelected tr:hover {
cursor: default;
background: #ddd;
}
#contentctrl {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.float_left {
float: left;
}
.function_bar {
float: right;
}
.user_main {
padding: 0 4px;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.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;
}
#dialog_machines .dialog-content table td input,
#dialog_layouts .dialog-content table td input {
width: auto;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog .dialog-func input {
width: unset;
}
#dialog_user_randompass {
width: auto;
height: 16px;
margin: 3px 4px 0 4px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.ybutton {
width: 80px;
line-height: normal;
margin-left: 6px;
border: none;
background: rgb(249, 189, 117);
padding: 5px 14px;
cursor: pointer;
}
.ybutton:hover {
background: #d7690E;
}
.td_controller {
vertical-align: middle;
padding: 40px 8px;
/*border-left: 1px solid #b0b0b0;
border-right: 1px solid #b0b0b0;*/
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.subdialog {
width: -moz-calc(100% - 24px);
width: -webkit-calc(100% - 24px);
width: calc(100% - 24px);
}
.machine_maskbg {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: #000;
opacity: 0.2;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
font-weight: lighter;
font-size: 18px;
width: 770px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.div_filter .dropdown {
width: 120px;
}
.requireinfo {
line-height: 30px;
margin-left: 10px;
@@ -205,8 +51,6 @@
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/jobsiterequirement.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/dispatchassign.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/email.js")%>" type="text/javascript"></script>
@@ -216,8 +60,6 @@
_network.request("JobSite/JobSiteRequirements.aspx?tp=ashx", -1, method, param, callback, error, nolog);
}
var jobsiteparam;
var regionparam;
var addrequirement = false;
var IsReadOnly = <%=IsReadOnly ?"true":"false"%>;
var IsRequestOnly = <%=IsRequestOnly ?"true":"false"%>;
@@ -227,7 +69,7 @@
var _selectdispatchids;
var currentdate = "<%=CurrentDate %>";
/***************************Jobsites***************************/
/***************************Jobsites***************************/
_dialog.showRequirementConfirm = function (msg, title, fprint, femail, fsave, fcancel, fclose, iniframe, shownote) {
if (!fclose)
@@ -337,23 +179,23 @@
var requireid;
function OnRefresh(keepmasg) {
showloading(true);
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var regions = [];
if (regionparam)
regions = regionparam.selectedvalue;
var jobsites = $('#div_jobsites').dropdownVals();
var regions = $('#div_region').dropdownVals();
var lateststartdate = $.trim($('#latesdatetxt').val());
if (lateststartdate && !$('#latesdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_THELATESTSTARTDATEISINVALID', "The latest start date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
showloading(false);
return;
}
var p = {
"LatestStartDate": $.trim($('#latesdatetxt').val()),
"LatestStartDate": lateststartdate,
"JobSites": jobsites,
"Regions": regions,
"SearchText": $.trim($('#searchinputtxt').val()),
"UnScheduledOnly": $('#chk_unscheduled').prop('checked')
};
showloading(true);
jobsitequery("GetRequirements", htmlencode(JSON.stringify(p)), function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
@@ -379,9 +221,10 @@
r[j] = { DisplayValue: r["BeginDateStr"], Value: r[j] };
else if (j === "EndDate")
r[j] = { DisplayValue: r["EndDateStr"], Value: r[j] };
else if (j === "FulfilledByName")
r[j] = r[j].split(',');
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -390,20 +233,15 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#jobsitelist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#jobsitelist');
var list_columns = [
{ 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' } },
{ name: 'AssetTypeName', caption: GetTextByKey("P_JS_ASSETTYPE", "Asset Type"), valueIndex: 'AssetTypeName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
{ name: 'Quantity', caption: GetTextByKey("P_JS_QUANTITY", "Quantity"), valueIndex: 'Quantity', css: { 'width': 80, 'text-align': 'right' } },
{ name: 'ScheduledQuantity', caption: GetTextByKey("P_JS_SCHEDULED", "Scheduled"), valueIndex: 'ScheduledQuantity', css: { 'width': 80, 'text-align': 'right' } },
{ name: 'ScheduledQuantity', caption: GetTextByKey("P_JS_SCHEDULED", "Scheduled"), valueIndex: 'ScheduledQuantity', allowFilter: true, css: { 'width': 80, 'text-align': 'right' } },
{ name: 'JobSiteName', caption: GetTextByKey("P_JOBSITE", "Jobsite"), valueIndex: 'JobSiteName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'NumberOfDays', caption: GetTextByKey("P_JS_NUMBEROFDAYS", "Number of Days"), valueIndex: 'NumberOfDays', css: { 'width': 120, 'text-align': 'right' } },
{ name: 'NumberOfDays', caption: GetTextByKey("P_JS_NUMBEROFDAYS", "Number of Days"), valueIndex: 'NumberOfDays', allowFilter: true, css: { 'width': 120, 'text-align': 'right' } },
{ name: 'Notes', caption: GetTextByKey("P_JS_NOTES", "Notes"), valueIndex: 'Notes', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'PointOfContact', caption: GetTextByKey("P_JS_POINTOFCONTACT", "Point Of Contact"), allowFilter: true, valueIndex: 'PointOfContact', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'AddedByName', caption: GetTextByKey("P_JS_CREATOR", "Creator"), valueIndex: 'AddedByName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
@@ -428,46 +266,40 @@
col.alwaysshow = list_columns[hd].alwaysshow;
if (col.name === "ManageAssets") {
col.sortable = false;
col.isurl = true;
col.text = "\uf63c";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'truck-pickup';
col.events = {
onclick: function () {
onManageAssets(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_JS_MANAGEASSETS", "Manage Assets") };
col.visible = !IsReadOnly && !IsRequestOnly;
}
else if (col.name === "Delete") {
col.sortable = false;
col.isurl = true;
col.text = "\uf00d";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_JS_DELETE", 'Delete') };
col.visible = !IsReadOnly && !IsRequestOnly;
}
if (col.name === "History") {
col.sortable = false;
col.isurl = true;
col.text = "\uf06e";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'eye';
col.events = {
onclick: function () {
OnViewChangeHistory(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_MR_VIEWCHANGEHIS", 'View Change History') };
col.visible = !IsReadOnly && !IsRequestOnly;
}
@@ -476,20 +308,14 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = function (rowindex) {
grid_dt.onRowDblClicked = function (rowindex) {
if (!IsReadOnly && !IsRequestOnly) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
onManageAssets(rowdata.Values);
onManageAssets(rowdata);
}
}
}
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
}
function searchEnter(e) {
@@ -498,35 +324,19 @@
}
}
var jobsite_editmultiselect;
var region_editmultiselect;
var alljobsites;
function getJobsitesAndRegions() {
showmaskbg(true);
jobsitequery('GetJobsitesAndRegions', '', function (data) {
jobsitequery('GetJobsitesAndRegions', '1', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
alljobsites = data.Jobsites;
jobsiteparam = {
allitems: data.Jobsites,
items: JSON.parse(JSON.stringify(data.Jobsites)),
selectedvalue: [],
width: 240
};
jobsite_editmultiselect = editmultiselect(jobsiteparam);
$('#div_jobsites').append(jobsite_editmultiselect);
$("#div_jobsites").dropdownSource(data.Jobsites);
regionparam = {
items: data.Regions,
selectedvalue: [],
width: 240,
oncompleted: onregioncompleted
};
region_editmultiselect = editmultiselect(regionparam);
$('#div_region').append(region_editmultiselect);
$('#div_region').dropdownSource(data.Regions);
getRequirmentsDefault();
}, function () {
@@ -535,30 +345,49 @@
}
function onregioncompleted() {
if (!jobsiteparam || !jobsiteparam.allitems) return;
jobsiteparam.items.length = 0;
for (var i in jobsiteparam.allitems) {
var item = jobsiteparam.allitems[i];
if (!regionparam.selectedvalue
|| regionparam.selectedvalue.length == 0
|| regionparam.selectedvalue.indexOf(item.Tag3) >= 0)
jobsiteparam.items.push(item);
}
jobsite_editmultiselect.reset();
if (!alljobsites) return;
var regions = $('#div_region').dropdownVals();
var jss = [...alljobsites];
if (regions && regions.length > 0)
jss = jss.filter(t => regions.indexOf(t.Tag3) >= 0);
var seljss = $("#div_jobsites").dropdownVals();
$("#div_jobsites").dropdownSource(jss).dropdownVals(seljss);
}
var editableSelectAssignAsset;
$(function () {
setPageTitle(GetTextByKey("P_JS_JOBSITEREQUIREMENTS", "Jobsite Requirements"), true);
editableSelectAssignAsset = new $editableselect($("#dialog_assignasset"));
editableSelectAssignAsset.setEnable(false);
$('#dialog_assignasset').dropdown([], {
search: true,
valueKey: 'Id',
textKey: 'DisplayName'
});
$('#dialog_assignasset').dropdownDisabled(false);
InitGridData();
InitAssetGridData();
InitAllAssetGridData();
InitEmailGridData();
InitAttachedAssetGridData();
getJobsitesAndRegions();
$("#div_region").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
}).on('collapsed', onregioncompleted);
$("#div_jobsites").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$(window).resize(function () {
$("#jobsitelist").css("height", $(window).height() - $("#jobsitelist").offset().top - 14);
grid_dt && grid_dt.resize();
@@ -578,6 +407,11 @@
$('#dialogmask').hide();
})
$('#dialog_attachedassets').dialog(function () {
$('#dialog_allassetmask').hide();
$('#dialogmask').hide();
})
$('#dialog_assignment').dialog(function () {
showmaskbg(false);
$('#dialogmask').hide();
@@ -593,16 +427,6 @@
$('#div_tooltip').css({ 'display': '', 'left': left, 'top': top });
});
$('#latesdatetxt').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]);
}
});
if (!canExport) {
$('#spExport').hide();
}
@@ -615,16 +439,15 @@
}
function OnExport() {
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var regions = [];
if (regionparam)
regions = regionparam.selectedvalue;
var jobsites = $('#div_jobsites').dropdownVals();
var regions = $('#div_region').dropdownVals();
var lateststartdate = $.trim($('#latesdatetxt').val());
if (lateststartdate && !$('#latesdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_THELATESTSTARTDATEISINVALID', "The latest start date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var p = {
"LatestStartDate": $.trim($('#latesdatetxt').val()),
"LatestStartDate": lateststartdate,
"JobSites": jobsites,
"Regions": regions,
"SearchText": $.trim($('#searchinputtxt').val()),
@@ -642,9 +465,10 @@
return;
}
if (data) {
region_editmultiselect.setValues(data.Regions);
$('#div_region').dropdownVals(data.Regions);
onregioncompleted();
jobsite_editmultiselect.setValues(data.Jobsites);
$("#div_jobsites").dropdownVals(data.Jobsites);
}
OnRefresh();
}, function (err) {
@@ -653,13 +477,8 @@
}
function onSaveDefault() {
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var regions = [];
if (regionparam)
regions = regionparam.selectedvalue;
var jobsites = $('#div_jobsites').dropdownVals();
var regions = $('#div_region').dropdownVals();
var item = {
'JobSites': jobsites,
@@ -707,7 +526,7 @@
<div class="search_bar">
<input type="password" autocomplete="new-password" style="display: none" />
<span data-lgid="P_JS_LATESTSTARTDATE_COLON"></span>
<input type="text" id="latesdatetxt" autocomplete="off" style="width: 80px; margin-left: 5px;" value="<%=LatestStartDate %>" />
<input type="date" class="type-date" required min="1900-01-01" id="latesdatetxt" autocomplete="off" style="width: 90px; margin-left: 5px;" value="<%=LatestStartDate %>" />
<span data-lgid="P_JS_REGION_COLON">Region:</span>
<div id="div_region"></div>
<span data-lgid="P_JS_JOBSITES_COLON">Jobsites:</span>
@@ -716,7 +535,7 @@
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_CM_SEARCH" style="margin-left: 5px;" />
<input id="chk_unscheduled" type="checkbox" checked="checked" onclick="OnRefresh();" />
<label data-lgid="P_JS_UNSCHEDULEDREQUIREMENTSONLY" for="chk_unscheduled">Unscheduled Requirements Only</label>
<span class="sbutton iconsave" onclick="onSaveDefault();" style="margin-left: 20px;padding: 0px 0px 0px 7px;" data-title-lgid="P_JS_SAVEJOBSITEANDREGIONSELECTIONASDEFAULT"></span>
<span class="sbutton iconsave" onclick="onSaveDefault();" style="margin-left: 20px; padding: 0px 0px 0px 7px;" data-title-lgid="P_JS_SAVEJOBSITEANDREGIONSELECTIONASDEFAULT"></span>
</div>
<div class="function_title">
<%if (!IsReadOnly)
@@ -730,7 +549,9 @@
</div>
<div id="jobsitelist"></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 subdialog" id="dialog_requirements" style="display: none; border-bottom: 0; border-top: 0;">
<%--<div class="dialog-title"><span class="title">Add Work Order</span></div>--%>
<iframe id="iframerequirements" src="AddRequirements.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
@@ -776,43 +597,44 @@
<input type="button" onclick="onAddDispatch();" data-lgid="P_JS_OK" value="OK" tabindex="27" />
<div class="clear"></div>
</div>
<div id="dialog_allassetmask" class="maskbg" style="display: none;">
<div class="loading_icon icon c-spin"></div>
</div>
</div>
<div class="dialog" id="dialog_sendmail" style="display: none; width: 320px;">
<div class="dialog" id="dialog_sendmail" style="display: none; width: 510px;">
<div class="dialog-title"><span class="title" data-lgid="P_JS_SENDDISPATCHREQUEST">Send Dispatch Request</span><em class="dialog-close"></em></div>
<div class="dialog-content" style="height: 378px;">
<table>
<div class="dialog-content">
<table style="line-height: 24px;">
<tr>
<td colspan="2" data-lgid="P_MV_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
</tr>
<tr>
<td colspan="2">
<div id="contactlist" style="height: 168px; width: 440px; margin-left: 10px; margin-right: 10px;"></div>
<div id="contactlist" style="height: 168px; width: 470px; margin-left: 10px; margin-right: 10px;"></div>
</td>
</tr>
<tr style="height: 24px;">
<td colspan="2" data-lgid="P_MV_EMAILORTEXTADDRESSESTIPS">Separate multiple manually entered email or text addresses with a semi-colon (;).</td>
</tr>
<tr style="height: 24px;">
<td><span data-lgid="P_MV_OTHEREMAILADDRESS">Other Email Address</span>
<td style="text-align: right; padding-right: 5px;"><span data-lgid="P_MV_OTHEREMAILADDRESS">Other Email Address</span>
</td>
<td>
<input type="text" id="sendmail_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
<input type="text" id="sendmail_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
</tr>
<tr style="height: 24px; display: none;">
<td><span data-lgid="P_MV_OTHERTEXTADDRESS">Other Text Address</span>
<td style="text-align: right; padding-right: 5px;"><span data-lgid="P_MV_OTHERTEXTADDRESS">Other Text Address</span>
</td>
<td>
<input type="text" id="sendmail_othertextaddress" style="width: 312px;" autocomplete="off" />
<input type="text" id="sendmail_othertextaddress" style="width: 350px;" autocomplete="off" />
</td>
<%--<span id="span_hepler" class='helper pointer' title='Help'></span>--%>
</tr>
<tr style="height: 24px;">
<td colspan="2" data-lgid="P_MV_DESCRIPTION_COLON">Description:</td>
</tr>
<tr>
<td colspan="2">
<textarea id="sendmail_desc" style="width: 444px; height: 80px; resize: none; margin-left: 12px;"></textarea></td>
<td style="text-align: right; padding-right: 5px;" data-lgid="P_MV_DESCRIPTION_COLON">Description:</td>
<td>
<textarea id="sendmail_desc" style="width: 350px; height: 80px; resize: none;"></textarea></td>
</tr>
</table>
</div>
@@ -832,7 +654,7 @@
</tr>
<tr>
<td>
<div id="dialog_assignasset" style="width: 320px; height: 22px;"></div>
<div id="dialog_assignasset" style="width: 320px;" class="dropdown"></div>
</td>
</tr>
</table>
@@ -844,4 +666,22 @@
</div>
</div>
<div class="dialog" id="dialog_attachedassets" style="display: none;">
<div class="dialog-title"><span class="title" data-lgid="P_JS_ATTACHEDASSETS">Attached Assets</span><em class="dialog-close"></em></div>
<div class="dialog-content">
<div style="text-align: center; line-height: 20px; margin-bottom: 10px;">
<span id="span_attachedasset_tips1"></span>
<br />
<span id="span_attachedasset_tips2"></span>
</div>
<div id="dialog_attachedassetlist" style="height: 300px; width: 100%;"></div>
</div>
<div class="dialog-func">
<input type="button" value="Close" data-lgid="P_JS_CANCEL" class="dialog-close" tabindex="2" />
<input type="button" id="btn_addattasset" onclick="OnAddAttachedAssets();" data-lgid="P_JS_OK" value="OK" tabindex="1" />
<input type="button" id="btn_removeattasset" onclick="OnRemoveAttachedAssets();" style="display: none;" data-lgid="P_JS_REMOVE" value="Remove" tabindex="1" />
<div class="clear"></div>
</div>
</div>
</asp:Content>

View File

@@ -42,7 +42,7 @@ public partial class JobSiteRequirements : JobSiteRequirementsBasePage
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
LatestStartDate = userlocaldate.ToShortDateString();
LatestStartDate = userlocaldate.ToString("yyyy-MM-dd");
CurrentDate = userlocaldate.ToShortDateString();
}

View File

@@ -7,46 +7,10 @@
display: none;
}
.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: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td input[type="radio"] {
border: none;
width: unset;
height: unset;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.dialog, .data-column-header-filter-bg, .data-column-header-filter-panel {
z-index: 2;
.edit-content table td input[type="radio"] {
border: none;
width: unset;
height: unset;
}
</style>
@@ -69,22 +33,20 @@
var items = [];
var itemids = [];
for (var i = 0; i < source.length; i++) {
var it = source[i].Values;
var it = source[i];
if (it.Selected) {
items.push({
Values: {
AssetId: it.Id,
VIN: it.VIN,
Name: it.Name,
MakeName: it.MakeName,
ModelName: it.ModelName,
TypeName: it.TypeName
}
AssetId: it.Id,
VIN: it.VIN,
Name: it.Name,
MakeName: it.MakeName,
ModelName: it.ModelName,
TypeName: it.TypeName
});
itemids.push(it.Id);
}
}
grid_dtassets.setData(grid_dtassets.innerSource.concat(items));
grid_dtassets.setData(grid_dtassets.source.concat(items));
doSave(0, itemids);
showmaskbg(false);
};
@@ -105,6 +67,7 @@
//window.onresize = resizeContent;
//resizeContent();
$('input[placeholder=Search]').attr("placeholder", GetTextByKey("P_AM_SEARCH", "Search"));
getConfigData();
});
@@ -130,12 +93,7 @@
//**************************************Asset(s)****************************************************//
var grid_dtassets;
function InitGridSelectedMachines() {
grid_dtassets = new GridView('#selectedmachinelist');
grid_dtassets.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtassets = createGridView('#selectedmachinelist');
var list_columns = [
{ name: 'VIN', caption: GetTextByKey("P_UM_SN", "SN"), valueIndex: 'VIN', css: { 'width': 160, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_UM_NAME", "Name"), valueIndex: 'Name', css: { 'width': 160, 'text-align': 'left' } },
@@ -165,7 +123,6 @@
col.width = list_columns[hd].css.width;
col.align = list_columns[hd].css["text-align"]
col.key = list_columns[hd].valueIndex;
col.allowFilter = col.name === 'TypeName';
col.styleFilter = function (item) {
if (item.Highlight)
return { 'background-color': 'yellow' };
@@ -173,7 +130,7 @@
columns.push(col);
}
grid_dtassets.canMultiSelect = true;
grid_dtassets.multiSelect = true;
grid_dtassets.columns = columns;
grid_dtassets.init();
}
@@ -182,8 +139,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtassets.setData(rows);
@@ -221,8 +177,8 @@
function OnAssetAdd() {
showmaskbg(true);
dialogAUAssets.exceptSource = grid_dtassets.innerSource.map(function (s) {
return s.Values.AssetId;
dialogAUAssets.exceptSource = grid_dtassets.source.map(function (s) {
return s.AssetId;
});
dialogAUAssets.showSelector();
}
@@ -230,22 +186,15 @@
function OnMachineDelete() {
showConfirm(GetTextByKey("P_JS_AREYOUSUREYOUWANTTODELETETHESESELECTEDASSETS", 'Are you sure you want to delete these selected asset(s)?'), GetTextByKey("P_JS_CONFIGURATION", "Configuration"), function () {
deleteitems = [];
for (var i = grid_dtassets.innerSource.length - 1; i >= 0; i--) {
var s = grid_dtassets.innerSource[i].Values;
var temp = grid_dtassets.source;
for (var i = temp.length - 1; i >= 0; i--) {
var s = temp[i];
if (s.selected) {
grid_dtassets.innerSource.splice(i, 1);
temp.splice(i, 1);
deleteitems.push(s.AssetId);
}
}
if (grid_dtassets.source != null) {
for (var j = grid_dtassets.source.length - 1; j >= 0; j--) {
var l = grid_dtassets.source[j].Values;
if (l.selected) {
grid_dtassets.source.splice(j, 1);
}
}
}
grid_dtassets.reset();
grid_dtassets.setData(temp);
if (deleteitems.length > 0)
doDelete(0, deleteitems);
});
@@ -254,12 +203,7 @@
//**************************************Asset Type(s)****************************************************//
var grid_dtat;
function InitGridSelectedAssetTypes() {
grid_dtat = new GridView('#selectedassettypelist');
grid_dtat.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtat = createGridView('#selectedassettypelist');
var list_columns = [
{ name: 'Name', caption: GetTextByKey("P_UM_NAME", "Name"), valueIndex: 'Name', css: { 'width': 380, 'text-align': 'left' } }
];
@@ -288,7 +232,7 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtat.canMultiSelect = true;
grid_dtat.multiSelect = true;
grid_dtat.columns = columns;
grid_dtat.init();
}
@@ -297,8 +241,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtat.setData(rows);
@@ -306,12 +249,7 @@
var grid_dtnjs;
function InitGridAvailableAssetTypes() {
grid_dtnjs = new GridView('#availableassettypelist');
grid_dtnjs.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtnjs = createGridView('#availableassettypelist');
var list_columns = [
{ name: 'Name', caption: GetTextByKey("P_UM_NAME", "Name"), valueIndex: 'Name', css: { 'width': 380, 'text-align': 'left' } }
];
@@ -340,30 +278,16 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtnjs.canMultiSelect = true;
grid_dtnjs.multiSelect = true;
grid_dtnjs.columns = columns;
grid_dtnjs.init();
grid_dtnjs.rowdblclick = function (rowindex) {
var rowdata = grid_dtnjs.source[rowindex];
if (rowdata) {
var AssetType = rowdata.Values;
}
};
grid_dtnjs.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtnjs.source[rowindex];
if (rowdata) {
}
}
}
function showAvailableAssetType(data) {
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtnjs.setData(rows);
@@ -433,8 +357,9 @@
function OnSelectAssetTypes() {
var itemids = [];
for (var i = 0; i < grid_dtnjs.source.length; i++) {
var m = grid_dtnjs.source[i].Values;
var tempsource = grid_dtnjs.source;
for (var i = 0; i < tempsource.length; i++) {
var m = tempsource[i];
if (m.selected) {
m.selected = false;
_selectedAssetTypes.push(m);
@@ -451,11 +376,12 @@
showConfirm(GetTextByKey("P_JS_AREYOUSUREYOUWANTTODELETETHESESELECTEDASSETTYPES", 'Are you sure you want to delete these selected asset type(s)?'), GetTextByKey("P_JS_CONFIGURATION", 'Configuration'), function () {
_selectedAssetTypes = [];
var deleteitems = [];
if (grid_dtat.source != null) {
for (var j = grid_dtat.source.length - 1; j >= 0; j--) {
var l = grid_dtat.source[j].Values;
var temp = grid_dtat.source;
if (temp != null) {
for (var i = temp.length - 1; i >= 0; i--) {
var l = temp[i];
if (l.selected) {
grid_dtat.source.splice(j, 1);
temp.splice(i, 1);
deleteitems.push(l.AssetId || l.ID);
}
else {
@@ -463,7 +389,7 @@
}
}
}
grid_dtat.reset();
grid_dtat.setData(temp);
if (deleteitems.length > 0)
doDelete(1, deleteitems);
@@ -518,11 +444,11 @@
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="mask_bg" style="display: none; z-index: 1">
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div>
<div id="dialogmask" class="maskbg" style="display: none; z-index: 1;">
<div id="dialogmask" class="maskbg" style="display: none;">
<div class="loading_icon icon c-spin"></div>
</div>
<div class="function_title">
@@ -569,7 +495,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" />
<input type="button" onclick="OnSelectAssetTypes();" value="OK" data-lgid="P_UM_OK" tabindex="17" />
<div class="clear"></div>
</div>

View File

@@ -20,43 +20,6 @@
white-space: nowrap;
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
line-height: 32px;
}
.dialog-content table td.label {
width: 124px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 250px;
height: 18px;
padding: 1px;
}
.dialog-content table td select {
width: 254px;
height: 24px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
#dialog_user_randompass {
width: auto;
height: 16px;
@@ -268,7 +231,7 @@
var jlid;
function OnEdit() {
var jl = grid_dt.source[grid_dt.selectedIndex].Values;
var jl = grid_dt.source[grid_dt.selectedIndex];
if (!jl) {
jlid = undefined;
return;
@@ -351,23 +314,17 @@
var r = data[i];
for (var j in r) {
if (j === "Active") {
r[j] = { DisplayValue: r.Active ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r.Active ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
}
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#jobsitelimitlist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#jobsitelimitlist');
var list_columns = [
{ name: 'ID', caption: GetTextByKey("P_M3_ID", "ID"), valueIndex: 'ID', css: { 'width': 40, 'text-align': 'left' } },
{ name: 'JobSiteName', caption: GetTextByKey("P_M3_JOBSITENAME", "Jobsite Name"), valueIndex: 'JobSiteName', css: { 'width': 200, 'text-align': 'left' } },
@@ -395,37 +352,37 @@
col.allowFilter = list_columns[hd].allowFilter;
col.key = list_columns[hd].valueIndex;
if (col.name === "Active") {
col.filterSource = [{ Value: true, DisplayValue: 'Yes' }, { Value: false, DisplayValue: 'No' }];
col.filterSource = [{ Value: true, DisplayValue: GetTextByKey('P_UTILITY_YES', 'Yes') }, { Value: false, DisplayValue: GetTextByKey('P_UTILITY_NO', 'No') }];
}
else if (col.name === "Edit") {
col.isurl = true;
col.text = "\uf044";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.events = {
onclick: function () {
OnEdit()
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_M3_EDIT", 'Edit') };
}
else if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_M3_DELETE", 'Delete') };
}
else if (col.name === "Subscribe") {
col.isurl = true;
col.text = "\uf0e0";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'envelope';
col.events = {
onclick: function () {
OnSubscribe(this);
@@ -441,12 +398,12 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = OnEdit;
grid_dt.onRowDblClicked = OnEdit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
curfewid = rowdata.Values.CurfewID;
curfewid = rowdata.CurfewID;
}
}
}
@@ -612,8 +569,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtac.setData(rows);
@@ -623,8 +579,7 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dtsc.setData(rows);
@@ -633,12 +588,7 @@
var grid_dtac;
function InitGridAvailableContacts() {
grid_dtac = new GridView('#availablecontacts');
grid_dtac.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtac = createGridView('#availablecontacts');
var list_columns = [
{ name: 'DisplayName', caption: GetTextByKey("P_M3_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 240, 'text-align': 'left' } },
{ name: 'ContactTypeName', caption: GetTextByKey("P_M3_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 150, 'text-align': 'left' } },
@@ -656,13 +606,13 @@
col.key = list_columns[hd].valueIndex;
columns.push(col);
}
grid_dtac.canMultiSelect = true;
grid_dtac.multiSelect = true;
grid_dtac.columns = columns;
grid_dtac.init();
grid_dtac.rowdblclick = function (rowindex) {
grid_dtac.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtac.source[rowindex];
if (rowdata) {
var contact = rowdata.Values;
var contact = rowdata;
_availableContacts.splice(_availableContacts.indexOf(contact), 1);
_selectedContacts.push(contact);
_showSelectedContacts.push(contact);
@@ -670,23 +620,12 @@
showContacts();
}
};
grid_dtac.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtac.source[rowindex];
if (rowdata) {
}
}
}
var grid_dtsc;
function InitGridSelectedContacts() {
grid_dtsc = new GridView('#selectedcontacts');
grid_dtsc.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dtsc = createGridView('#selectedcontacts');
var list_columns = [
{ name: 'DisplayName', caption: GetTextByKey("P_M3_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 240, 'text-align': 'left' } },
{ name: 'ContactTypeName', caption: GetTextByKey("P_M3_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 150, 'text-align': 'left' } },
@@ -708,13 +647,13 @@
}
columns.push(col);
}
grid_dtsc.canMultiSelect = true;
grid_dtsc.multiSelect = true;
grid_dtsc.columns = columns;
grid_dtsc.init();
grid_dtsc.rowdblclick = function (rowindex) {
grid_dtsc.onRowDblClicked = function (rowindex) {
var rowdata = grid_dtsc.source[rowindex];
if (rowdata) {
var contact = rowdata.Values;
var contact = rowdata;
_selectedContacts.splice(_selectedContacts.indexOf(contact), 1);
_showSelectedContacts.splice(_showSelectedContacts.indexOf(contact), 1);
_availableContacts.push(contact);
@@ -722,12 +661,6 @@
showContacts();
}
};
grid_dtsc.selectedrowchanged = function (rowindex) {
var rowdata = grid_dtsc.source[rowindex];
if (rowdata) {
}
}
}
function OnContactEditorAdd() {
@@ -736,7 +669,7 @@
return;
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
var c = grid_dtac.source[index].Values;
var c = grid_dtac.source[index];
_availableContacts.splice(_availableContacts.indexOf(c), 1);
_selectedContacts.push(c);
_showSelectedContacts.push(c);
@@ -758,7 +691,7 @@
return;
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
var c = grid_dtsc.source[index].Values;
var c = grid_dtsc.source[index];
_selectedContacts.splice(_selectedContacts.indexOf(c), 1);
_showSelectedContacts.splice(_showSelectedContacts.indexOf(c), 1);
_availableContacts.push(c);

View File

@@ -1,232 +1,19 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/JobSite/JobSiteMasterPage.master" AutoEventWireup="true" CodeFile="RequirementChangeHistory.aspx.cs" Inherits="RequirementChangeHistory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<style type="text/css">
.itemselcted {
background-color: #ccc;
}
.itemhidden {
display: none;
}
.itemsuggested {
background-color: #ffff99;
}
#tbMachineTypes tbody tr:hover {
cursor: default;
background: #ddd;
}
#tbodyAssigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodyUnassigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodySelected tr:hover {
cursor: default;
background: #ddd;
}
#contentctrl {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.float_left {
float: left;
}
.function_bar {
float: right;
}
.user_main {
padding: 0 4px;
}
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.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;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 200px;
height: 18px;
padding: 1px;
}
#dialog_machines .dialog-content table td input,
#dialog_layouts .dialog-content table td input {
width: auto;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
.dialog-content table td textarea {
height: 100px;
max-width: 200px;
}
#dialog_user_randompass {
width: auto;
height: 16px;
margin: 3px 4px 0 4px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.ybutton {
width: 80px;
line-height: normal;
margin-left: 6px;
border: none;
background: rgb(249, 189, 117);
padding: 5px 14px;
cursor: pointer;
}
.ybutton:hover {
background: #d7690E;
}
.td_controller {
vertical-align: middle;
padding: 40px 8px;
/*border-left: 1px solid #b0b0b0;
border-right: 1px solid #b0b0b0;*/
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.subdialog {
width: -moz-calc(100% - 24px);
width: -webkit-calc(100% - 24px);
width: calc(100% - 24px);
}
.machine_maskbg {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: #000;
opacity: 0.2;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
font-weight: lighter;
font-size: 18px;
width: 770px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.div_filter .dropdown {
width: 120px;
}
.requireinfo {
line-height: 30px;
margin-left: 10px;
}
.requireinfospan {
font-weight: 500;
margin-left: 20px;
}
.quantity {
padding: 3px 0 3px 10px;
margin-top: 5px;
margin-bottom: 5px;
/*color: gray;*/
font-weight: 500;
font-size: 16px;
/*width: 770px;*/
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #f0f0f0;
}
.span-caption {
position: absolute;
}
.span-bar {
position: absolute;
height: 100%;
margin: 0;
vertical-align: bottom;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/jobsiterequirement.js")%>" type="text/javascript"></script>
<script>
jobsitequery = function (method, param, callback, error, nolog) {
_network.request("JobSite/RequirementChangeHistory.aspx?tp=ashx", -1, method, param, callback, error, nolog);
}
var currentdate = "<%=CurrentDate %>";
var jobsiteparam;
var IsReadOnly = <%=IsReadOnly ?"true":"false"%>;
var IsRequestOnly = <%=IsRequestOnly ?"true":"false"%>;
/***************************Jobsites***************************/
/***************************Jobsites***************************/
function showConfirmIndialog(msg, title, fok, fcancel, shownote) {
$("#dialogmask").show();
@@ -243,13 +30,24 @@
function OnRefresh() {
showloading(true);
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var jobsites = $('#div_jobsites').dropdownVals() || [];
var begindate = $('#startdatetxt').val();
var enddate = $('#enddatetxt').val();
if (begindate && !$('#startdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_THEDELETEDBEGINDATEISINVALID', "The deleted begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !$('#enddatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_THEDELETEDENDDATEISINVALID', "The deleted end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_DELETEDENDDATEMUSTBELATERTHANDELETEDBEGINDATE", "Deleted end date must be later than deleted begin date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var p = [
htmlencode($('#startdatetxt').val()),
htmlencode($('#enddatetxt').val()),
htmlencode(begindate),
htmlencode(enddate),
JSON.stringify(jobsites),
$.trim($('#searchinputtxt').val())
];
@@ -278,8 +76,7 @@
else if (j === "DeletedOn")
r[j] = { DisplayValue: r["DeletedOnStr"], Value: r[j] };
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@@ -288,12 +85,7 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#jobsitelist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#jobsitelist');
var list_columns = [
{ 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' } },
@@ -329,21 +121,7 @@
}
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = function (rowindex) {
if (!IsReadOnly && !IsRequestOnly) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
onManageAssets(rowdata.Values);
}
}
}
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
grid_dt.init();
}
function searchEnter(e) {
@@ -352,24 +130,16 @@
}
}
var jobsite_editmultiselect;
var alljobsites;
function getJobsitesAndRegions() {
showmaskbg(true);
jobsitequery('GetJobsitesAndRegions', '', function (data) {
jobsitequery('GetJobsitesAndRegions', '0', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
alljobsites = data.Jobsites;
jobsiteparam = {
items: data.Jobsites,
selectedvalue: [],
width: 300
};
jobsite_editmultiselect = editmultiselect(jobsiteparam);
$('#div_jobsites').append(jobsite_editmultiselect);
$("#div_jobsites").dropdownSource(data.Jobsites);
}, function () {
showmaskbg(false);
@@ -381,6 +151,14 @@
getJobsitesAndRegions();
OnRefresh();
$("#div_jobsites").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$(window).resize(function () {
$("#jobsitelist").css("height", $(window).height() - $("#jobsitelist").offset().top - 14);
grid_dt && grid_dt.resize();
@@ -389,25 +167,6 @@
$('#searchinputtxt').keydown(searchEnter);
$('#startdatetxt').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]);
}
});
$('#enddatetxt').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]);
}
});
});
function searchEnter(e) {
@@ -426,11 +185,11 @@
<input type="password" autocomplete="new-password" style="display: none" />
<span data-lgid="P_JS_DELETEDBEGINDATE_COLON">Deleted Begin Date:</span>
<div>
<input type="text" id="startdatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" value="<%=BeginDate %>" />
<input type="date" class="type-date" required min="1900-01-01" id="startdatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" value="<%=BeginDate %>" />
</div>
<span style="margin-left: 10px;" data-lgid="P_JS_DELETEDENDDATE_COLON">Deleted End Date:</span>
<div>
<input type="text" id="enddatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" value="<%=EndDate %>" />
<input type="date" class="type-date" required min="1900-01-01" id="enddatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" value="<%=EndDate %>" />
</div>
<input type="text" id="searchinputtxt" autocomplete="off" style="margin-left: 5px; display: none;" />
<span style="margin-left: 10px;" data-lgid="P_JS_JOBSITES_COLON">Jobsites:</span>

View File

@@ -15,7 +15,6 @@ public partial class RequirementChangeHistory : JobSiteRequirementsBasePage
protected bool IsRequestOnly = false;
public string BeginDate = "";
public string EndDate = "";
public string CurrentDate = "";
protected void Page_Load(object sender, EventArgs e)
{
string methodName = Request.Form["MethodName"];
@@ -43,9 +42,8 @@ public partial class RequirementChangeHistory : JobSiteRequirementsBasePage
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
BeginDate = userlocaldate.AddDays(-6).ToShortDateString();
EndDate = userlocaldate.ToShortDateString();
CurrentDate = userlocaldate.ToShortDateString();
BeginDate = userlocaldate.AddDays(-6).ToString("yyyy-MM-dd");
EndDate = userlocaldate.ToString("yyyy-MM-dd");
}
protected override int FeatureID

View File

@@ -3,157 +3,19 @@
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<style type="text/css">
.itemselcted {
background-color: #ccc;
}
.itemhidden {
display: none;
}
.itemsuggested {
background-color: #ffff99;
}
#tbMachineTypes tbody tr:hover {
cursor: default;
background: #ddd;
}
#tbodyAssigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodyUnassigned tr:hover {
cursor: default;
background: #ddd;
}
#tbodySelected tr:hover {
cursor: default;
background: #ddd;
}
#contentctrl {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.float_left {
float: left;
}
.function_bar {
float: right;
}
.user_main {
padding: 0 4px;
}
.edit-content table {
border-collapse: collapse;
width: 100%;
}
.edit-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
.ybutton {
width: 80px;
line-height: normal;
margin-left: 6px;
border: none;
background: rgb(249, 189, 117);
padding: 5px 14px;
cursor: pointer;
}
.ybutton:hover {
background: #d7690E;
}
.td_controller {
vertical-align: middle;
padding: 40px 8px;
/*border-left: 1px solid #b0b0b0;
border-right: 1px solid #b0b0b0;*/
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.subdialog {
width: -moz-calc(100% - 24px);
width: -webkit-calc(100% - 24px);
width: calc(100% - 24px);
}
.machine_maskbg {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: #000;
opacity: 0.2;
}
#machine-name {
margin: 10px 10px 6px;
/*color: gray;*/
font-weight: lighter;
font-size: 18px;
width: 770px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.div_filter .dropdown {
width: 100px;
.assetlabel {
width: 200px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
font-weight: 500;
}
.span-caption {
@@ -175,7 +37,12 @@
height: 24px;
font-weight: 500;
}
.edit-content table td.label {
width: 130px;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>" type="text/javascript"></script>
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
<script src="<%=GetFileUrlWithVersion("../js/components/datagrid.js")%>" type="text/javascript"></script>
@@ -184,15 +51,17 @@
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/gridlayout.js")%>" type="text/javascript"></script>
<script src="../Maintenance/js/inputdatactr.js"></script>
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/scheduler.js")%>" type="text/javascript"></script>
<script>
jobsitequery = function (method, param, callback, error, nolog) {
_network.request("JobSite/SchedulerManagement.aspx?tp=ashx", -1, method, param, callback, error, nolog);
}
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
var IsReadOnly = <%=IsReadOnly ?"true":"false"%>;
var currentdate = "<%=CurrentDate %>";
var currentdate = "<%=CurrentDate %>";
var gridLayoutID = "JobSiteScheduler";
/***************************Jobsites***************************/
@@ -228,49 +97,29 @@
var assetsObj;
function OnRefresh() {
var alerttitle = GetTextByKey('P_JS_SCHEDULER', 'Scheduler');
var begindate = $.trim($('#txtbegindate').val());
var enddate = $.trim($('#txtenddate').val());
if (begindate && !checkDate(begindate)) {
showAlert(GetTextByKey("P_JS_BEGINDATEFORMATERROR", "Begin Date format error."), alerttitle);
if (begindate && !$('#txtbegindate').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !checkDate(enddate)) {
showAlert(GetTextByKey("P_JS_ENDDATEFORMATERROR", "End Date format error."), alerttitle);
if (enddate && !$('#txtenddate').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (begindate && enddate) {
var sdate = begindate;
var stdt = new Date(sdate.replace("-", "/"));
var edate = enddate;
var etdt = new Date(edate.replace("-", "/"));
if (stdt > etdt) {
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), alerttitle);
return;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
showloading(true);
var jobsites = [];
if (jobsiteparam)
jobsites = jobsiteparam.selectedvalue;
var jobsites = $('#div_jobsites').dropdownVals() || [];
var regions = $('#div_region').dropdownVals() || [];
var agroups = $('#div_assetgroup').dropdownVals() || [];
var atypes = $('#div_assettypes').dropdownVals() || [];
var regions = [];
if (regionparam)
regions = regionparam.selectedvalue;
var agroups = [];
if (assetgroupparam)
agroups = assetgroupparam.selectedvalue;
var atypes = [];
if (assettypeparam)
atypes = assettypeparam.selectedvalue;
var unscheduled = $('#chk_unscheduled').prop('checked') ? "1" : "0";
var scheduled = $('#sel_scheduled').val()
var p = [
JSON.stringify(jobsites),
JSON.stringify(regions),
@@ -279,7 +128,7 @@
$.trim($('#searchinputtxt').val()),
begindate,
enddate,
unscheduled
scheduled
];
jobsitequery("GetAssetSchedulers", htmlencode(JSON.stringify(p)), function (data) {
showloading(false);
@@ -300,49 +149,30 @@
}
var alljobsites;
var jobsiteparam;
var regionparam;
var jobsite_editmultiselect;
function getJobsitesAndRegions() {
jobsitequery('GetJobsitesAndRegions', '', function (data) {
jobsitequery('GetJobsitesAndRegions', '1', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
alljobsites = data.Jobsites;
jobsiteparam = {
allitems: data.Jobsites,
items: JSON.parse(JSON.stringify(data.Jobsites)),
selectedvalue: [],
width: 240
};
jobsite_editmultiselect = editmultiselect(jobsiteparam);
$('#div_jobsites').append(jobsite_editmultiselect);
$("#div_jobsites").dropdownSource(data.Jobsites);
setJobsites();
regionparam = {
items: data.Regions,
selectedvalue: [],
width: 240,
oncompleted: onregioncompleted
};
var ipt = editmultiselect(regionparam);
$('#div_region').append(ipt);
$('#div_region').dropdownSource(data.Regions);
});
}
function onregioncompleted() {
if (!jobsiteparam || !jobsiteparam.allitems) return;
jobsiteparam.items.length = 0;
for (var i in jobsiteparam.allitems) {
var item = jobsiteparam.allitems[i];
if (!regionparam.selectedvalue
|| regionparam.selectedvalue.length == 0
|| regionparam.selectedvalue.indexOf(item.Tag3) >= 0)
jobsiteparam.items.push(item);
}
jobsite_editmultiselect.reset();
if (!alljobsites) return;
var regions = $('#div_region').dropdownVals();
var jss = [...alljobsites];
if (regions && regions.length > 0)
jss = jss.filter(t => regions.indexOf(t.Tag3) >= 0);
$("#div_jobsites").dropdownSource(jss);
var seljss = $("#div_jobsites").dropdownVals();
$("#div_jobsites").dropdownSource(jss).dropdownVals(seljss);
}
function setJobsites() {
@@ -358,32 +188,25 @@
}
var assettypes;
var assettypeparam;
function getAssetTypes() {
if (assettypes)
return;
$('#div_assettypes').empty();
jobsitequery('GetAssetTypes', '', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
assettypes = data;
assettypeparam = {
items: data,
selectedvalue: [],
allowall: false,
width: 280
};
var ipt = editmultiselect(assettypeparam);
$('#div_assettypes').append(ipt);
var ats = [...assettypes];
ats = ats.filter(t => t.Tag1 == "1");
$("#div_assettypes").dropdownSource(ats);
});
}
var assetgroups;
var assetgroupparam;
function getAssetGroups() {
jobsitequery('GetAssetGroups', '', function (data) {
if (typeof (data) === "string") {
@@ -391,21 +214,22 @@
return;
}
assetgroups = data;
assetgroupparam = {
items: data,
selectedvalue: [],
width: 240
};
var ipt = editmultiselect(assetgroupparam);
$('#div_assetgroup').append(ipt);
$("#div_assetgroup").dropdownSource(assetgroups);
});
}
function OnSorts() {
grid_dt.showSortPanel();
}
$(function () {
setPageTitle(GetTextByKey("P_JS_SCHEDULER", "Scheduler"), true);
$('.iconlayout').on('click', function (ev) {
CreateLayoutMenus(ev.target, gridLayoutID, grid_dt);
return false;
});
InitGridData();
jobsiteschedulerCtrl = new $jobsiteschedulerCtrl();
jobsiteschedulerCtrl.Init($("#schedulerlist1"), false);
InitJobsiteschedulerGridData();
getJobsitesAndRegions();
getAssetGroups();
getAssetTypes();
@@ -417,6 +241,48 @@
}).resize();
OnRefresh();
$("#div_assettypes").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: false,
textKey: 'Value',
valueKey: 'Key'
});
$("#div_region").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
}).on('collapsed', onregioncompleted);
$("#div_jobsites").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$("#div_assetgroup").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$("#chkmanagetypeonly").on('change', function () {
var selectedtypes = $("#div_assettypes").dropdownVals() || [];
var ats = [...assettypes];
if ($(this).prop('checked')) {
ats = ats.filter(t => t.Tag1 == "1");
}
$("#div_assettypes").dropdownSource(ats);
$("#div_assettypes").dropdownVals(selectedtypes);
});
$('#searchinputtxt').keydown(searchEnter);
$('#dialog_managescheduler').dialog(function () {
@@ -428,15 +294,7 @@
$('#dialogmask').hide();
$('#dialogmask1').hide();
})
$("#txtbegindate").datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
$("#txtenddate").datetimepicker({
timepicker: false,
format: 'm/d/Y'
}); $('#dialog_addbegindate').datetimepicker({
$('#dialog_addbegindate').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
@@ -459,17 +317,17 @@
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="contentctrl">
<div id="contentctrl" style="min-width: 1540px;">
<div class="page_title" data-lgid="P_JS_SCHEDULER">Scheduler</div>
<div class="search_bar" style="min-width: 1300px;">
<div class="search_bar">
<input type="password" autocomplete="new-password" style="display: none" />
<span data-lgid="P_AM_BEGINDATE_COLON">Begin Date:</span>
<div>
<input type="text" style="margin-left: 5px; width: 75px;" id="txtbegindate" value="<%=BeginDate %>" autocomplete="off" />
<input id="txtbegindate" type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 90px;" value="<%=BeginDate %>" autocomplete="off" />
</div>
<span data-lgid="P_AM_ENDDATE_COLON">End Date:</span>
<div>
<input type="text" style="margin-left: 5px; width: 75px;" id="txtenddate" autocomplete="off" />
<input id="txtenddate" type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 90px;" autocomplete="off" />
</div>
<span data-lgid="P_JS_REGION_COLON">Region:</span>
<div id="div_region" style="margin-top: 1px;"></div>
@@ -479,10 +337,15 @@
<div id="div_assetgroup" style="margin-top: 1px;"></div>
<span data-lgid="P_JS_ASSETTYPE_COLON" style="margin-left: 10px;">Asset Type:</span>
<div id="div_assettypes" style="margin-top: 1px;"></div>
<input type="checkbox" id="chkmanagetypeonly" style="margin-left: 5px;" checked="checked" />
<label for="chkmanagetypeonly" data-lgid="P_JS_MANAGEDTYPESONLY">Managed Types Only</label>
<input type="text" id="searchinputtxt" autocomplete="off" style="margin-left: 5px; width: 100px;" />
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_CM_SEARCH" style="margin-left: 5px;" />
<input id="chk_unscheduled" type="checkbox" onclick="OnRefresh();" />
<label data-lgid="P_JS_UNSCHEDULED" for="chk_unscheduled">Unscheduled</label>
<select id="sel_scheduled" onchange="OnRefresh();" style="margin-left: 5px; width: 160px;">
<option value="0" data-lgid="P_JS_SCHEDULEDONLY">Scheduled Only</option>
<option value="1" data-lgid="P_JS_UNSCHEDULEDONLY">Unscheduled Only</option>
<option value="-1" data-lgid="P_JS_BOTHSCHEDULEDUNSCHEDULED">Both Scheduled & Unscheduled</option>
</select>
</div>
<div class="function_title">
<%if (!IsReadOnly)
@@ -490,11 +353,15 @@
<span class="sbutton iconadd" onclick="OnAdd();" data-lgid="P_JS_ADD"></span>
<%} %>
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_JS_REFRESH"></span>
<span class="sbutton iconlayout iconmenu" data-lgid="P_MR_LAYOUT">Layout</span>
<span class="sbutton iconfilter" onclick="OnSorts();" data-lgid="P_GRID_SORT">Sort</span>
</div>
<div id="schedulerlist"></div>
<div id="schedulerlist" style="position: relative"></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 subdialog" id="dialog_scheduler" style="display: none; border-bottom: 0; border-top: 0;">
<%--<div class="dialog-title"><span class="title">Add Work Order</span></div>--%>
<iframe id="iframescheduler" src="AddScheduler.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
@@ -523,7 +390,7 @@
<span class="sbutton iconadd" onclick="openAddScheduler()" data-lgid="P_JS_ADD">Add</span>
<span class="sbutton icondelete" onclick="onDeleteScheduler()" data-lgid="P_JS_DELETE">Delete</span>
</div>
<div id="schedulerlist1" style="height: 300px; width: 600px;"></div>
<div id="schedulerlist1" style="height: 360px; width: 720px;"></div>
<div class="dialog-func">
<input type="button" value="Close" data-lgid="P_JS_CANCEL" class="dialog-close" tabindex="28" />
@@ -535,10 +402,10 @@
</div>
</div>
<div class="dialog" id="dialog_addscheduler" style="display: none; width: 500px;">
<div class="dialog" id="dialog_addscheduler" style="display: none; width: 480px;">
<div class="dialog-title"><span class="title" data-lgid="P_JS_ADDSCHEDULER"></span><em class="dialog-close"></em></div>
<div class="edit-content">
<table style="line-height: 30px;">
<table style="line-height: 30px; margin-top: 10px;">
<tr>
<td class="label" data-lgid="P_JS_JOBSITE_COLON"></td>
<td>
@@ -558,7 +425,7 @@
<tr>
<td class="label" data-lgid="P_JS_POINTOFCONTACT_COLON">Point of Contact:</td>
<td>
<input type="text" id="dialog_pointofcontact" maxlength="100" autocomplete="off" style="width: 100px;" />
<input type="text" id="dialog_pointofcontact" maxlength="100" tabindex="1" autocomplete="off" style="width: 100px;" />
</td>
</tr>
<tr>
@@ -570,8 +437,8 @@
</table>
</div>
<div class="dialog-func">
<input type="button" value="Close" data-lgid="P_JS_CANCEL" class="dialog-close" tabindex="28" />
<input type="button" onclick="onAddScheduler();" data-lgid="P_JS_OK" value="OK" tabindex="27" />
<input type="button" value="Close" data-lgid="P_JS_CANCEL" class="dialog-close" tabindex="3" />
<input type="button" onclick="onAddScheduler();" data-lgid="P_JS_OK" value="OK" tabindex="2" />
<div class="clear"></div>
</div>
<div id="dialogmask1" class="maskbg" style="display: none;">

View File

@@ -40,7 +40,7 @@ public partial class SchedulerManagement : JobSiteRequirementsBasePage
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
BeginDate = userlocaldate.ToShortDateString();
BeginDate = userlocaldate.ToString("yyyy-MM-dd");
CurrentDate = userlocaldate.ToShortDateString();
}
@@ -51,4 +51,15 @@ public partial class SchedulerManagement : JobSiteRequirementsBasePage
return Foresight.Fleet.Services.User.Feature.JOB_SITES_SCHEDULER;
}
}
public bool IsAdmin
{
get
{
var user = GetCurrentUser();
if (user.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin || user.UserType == IronIntel.Contractor.Users.UserTypes.Admin)
return true;
else
return false;
}
}
}

View File

@@ -3,11 +3,8 @@ function GetRoadMachines() {
jobsitequery("GetRoadMachines", "", function (data) {
if (data && data.length > 0) {
allroadassets = data;
editableSelectAssignAsset.setEnable(true);
editableSelectAssignAsset.datasource = data;
editableSelectAssignAsset.valuepath = "Id"
editableSelectAssignAsset.displaypath = "DisplayName";
$('#dialog_assignasset').dropdownDisabled(false);
$('#dialog_assignasset').dropdownSource(data);
}
}, function (err) {
@@ -19,8 +16,9 @@ function openAssignDispatch(seltype,) {
_seltype = seltype;
if (_sendType == 1) {
_selectdispatchids = [];
for (var i = 0; i < grid_dt.source.length; i++) {
var ct = grid_dt.source[i].Values;
var tempsource = grid_dt.source;
for (var i = 0; i < tempsource.length; i++) {
var ct = tempsource[i];
if (ct.Selected) {
_selectdispatchids.push(ct.DispatchId);
}
@@ -38,7 +36,7 @@ function openAssignDispatch(seltype,) {
if (!allroadassets)
GetRoadMachines();
editableSelectAssignAsset.val('');
$('#dialog_assignasset').dropdownVal('');
showmaskbg(true);
$('#dialog_assignment .dialog-title span.title').text(GetTextByKey('P_JS_DISPATCHASSIGNMENT', 'Dispatch Assignment'));
$('#dialog_assignment')
@@ -53,7 +51,7 @@ function openAssignDispatch(seltype,) {
var assignAsset = null;
function onAssignContinue() {
assignAsset = editableSelectAssignAsset.selecteditem();
assignAsset = $('#dialog_assignasset').dropdownItem();
if (assignAsset == null) {
onAssignSkip();
}

View File

@@ -15,8 +15,7 @@ function showContactList(data) {
}
r.Text = false;
r.Email = false;
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_maildt.setData(rows);
@@ -24,12 +23,7 @@ function showContactList(data) {
var grid_maildt;
function InitEmailGridData() {
grid_maildt = new GridView('#contactlist');
grid_maildt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_maildt = createGridView('#contactlist');
var list_columns = [
{ 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' } },
@@ -65,12 +59,6 @@ function InitEmailGridData() {
grid_maildt.canMultiSelect = false;
grid_maildt.columns = columns;
grid_maildt.init();
grid_maildt.selectedrowchanged = function (rowindex) {
var rowdata = grid_maildt.source[rowindex];
if (rowdata) {
}
}
}
@@ -84,8 +72,9 @@ function getDispatchContacts(assetids) {
ids = assetids;
}
else {
for (var i = 0; i < grid_dt.source.length; i++) {
var ct = grid_dt.source[i].Values;
var tempsource = grid_dt.source;
for (var i = 0; i < tempsource.length; i++) {
var ct = tempsource[i];
if (ct.Selected && ids.indexOf(ct.AssetId) < 0)
ids.push(ct.AssetId);
}
@@ -177,8 +166,9 @@ function onSendEmails() {
}
}
for (var i = 0; i < grid_maildt.source.length; i++) {
var ct = grid_maildt.source[i].Values;
var tempsource = grid_maildt.source;
for (var i = 0; i < tempsource.length; i++) {
var ct = tempsource[i];
if (ct.Email) {
emailaddress.push({ 'Key': ct.IID, 'Value': ct.ID });
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,10 +2,11 @@
function showSchedulerData(data) {
if (data) {
assetsObj = data;
var col = grid_dt.columns.find(c => c.name === 'Schedules');
if (assetsObj.HasSchedule)
grid_dt.columns[grid_dt.columns.length - 1].width = assetsObj.TotalDays * 5;
col.width = assetsObj.TotalDays * 5;
else
grid_dt.columns[grid_dt.columns.length - 1].width = 320;
col.width = 320;
grid_dt.init();
showSchedulerList(data.DispatchAssets);
}
@@ -21,8 +22,22 @@ function showSchedulerList(data) {
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
for (var j in r) {
if (j === "StartDate") {
r[j] = { DisplayValue: r["StartDateStr"], Value: r[j] };
}
else if (j === "FinishDate") {
r[j] = { DisplayValue: r["FinishDateStr"], Value: r[j] };
}
else if (j === "EngineHours") {
r[j] = { DisplayValue: r[j] === null ? "" : r[j], Value: r[j] };
}
if (r.AttachedToAsset)
r.AttachedToAssetName = r.AttachedToAsset.AssetName;
else
r.AttachedToAssetName = r.AssetName;
}
rows.push(r);
}
grid_dt.setData(rows);
@@ -31,21 +46,21 @@ function showSchedulerList(data) {
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#schedulerlist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#schedulerlist', true);
var list_columns = [
{ name: 'TypeName', caption: GetTextByKey("P_JS_ASSETTYPE", "Asset Type"), valueIndex: 'TypeName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'MakeName', caption: GetTextByKey("P_PM_MAKE", "Make"), valueIndex: 'MakeName', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'ModelName', caption: GetTextByKey("P_PM_MODEL", "Model"), valueIndex: 'ModelName', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'MakeName', caption: GetTextByKey("P_JS_MAKE", "Make"), valueIndex: 'MakeName', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'ModelName', caption: GetTextByKey("P_JS_MODEL", "Model"), valueIndex: 'ModelName', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'AssetName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'AttachedToAsset', caption: GetTextByKey("P_JS_ATTACHEDTO", "Attached To"), valueIndex: 'AttachedToAssetName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'CurrentJobSite', caption: GetTextByKey("P_JS_CURRJOBSITE", "Current Jobsite"), allowFilter: true, valueIndex: 'CurrentJobSite', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'NextJobSite', caption: GetTextByKey("P_JS_SCHEDULEDFOR", "Scheduled For"), allowFilter: true, valueIndex: 'NextJobSite', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'AssetGroups', caption: GetTextByKey("P_JS_ASSETGROUP", "Asset Group"), valueIndex: 'AssetGroups', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'EngineHours', caption: GetTextByKey("P_JS_ENGINEHOURS", "Engine Hours"), valueIndex: 'EngineHours', css: { 'width': 100, 'text-align': 'right' } },
{ name: 'EngineHours', caption: GetTextByKey("P_JS_ENGINEHOURS", "Engine Hours"), valueIndex: 'EngineHours', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
{ name: 'AquisitionType', caption: GetTextByKey("P_JS_ACQUISITIONTYPE", "Acquisition Type"), valueIndex: 'AquisitionType', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'StartDate', caption: GetTextByKey("P_JS_START", "Start"), valueIndex: 'StartDate', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'FinishDate', caption: GetTextByKey("P_JS_FINISH", "Finish"), valueIndex: 'FinishDate', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
{ name: 'DurationDays', caption: GetTextByKey("P_JS_DURATIONDAYS", "Duration (days)"), valueIndex: 'DurationDays', allowFilter: true, css: { 'width': 120, 'text-align': 'right' } },
{ name: 'Schedules', caption: "gantt", valueIndex: 'ScheduleParts', css: { 'width': 320, 'text-align': 'left' } }
];
var columns = [];
@@ -63,286 +78,176 @@ function InitGridData() {
col.type = list_columns[hd].type;
col.alwaysshow = list_columns[hd].alwaysshow;
if (col.name === "Schedules") {
var labelCount = 4;
if (col.name === "AttachedToAsset") {
col.sortFilter = function (a, b) {
col.sortable = false;
col.allowHtml = true;
col.caption = function () {
if (!assetsObj || !assetsObj.HasSchedule) return;
var container = $('<span></span>').css({ position: 'relative', height: '100%', display: 'block' });
var left = 0;
for (var i = 0; i < assetsObj.Labels.length; i++) {
var label = assetsObj.Labels[i];
var sp = $('<span class="span-caption"></span>').text(label.Key).css({ left: left });
left += parseInt(label.Value) * 5;
container.append(sp);
}
grid_dt.resize();
//var totalDays = (led.getTime() - fbd.getTime()) / (1000 * 60 * 60 * 24);
//var interval = parseInt(totalDays / labelCount);
//if (totalDays % labelCount != 0)
// interval += 1;
//var d = new Date(assetsObj.BeginDate);
//var w = col.width / labelCount;
//for (var i = 0; i < labelCount; i++) {
// var label = new DateFormatter().formatDate(d, 'm/d/Y');
// var sp = $('<span class="span-caption"></span>').text(label).css({ left: w * i });
// container.append(sp);
// d = new Date(d.getTime() + interval * 1000 * 60 * 60 * 24);
//}
return container;
a = a.AttachedToAssetName + (a.AttachedToAsset ? "1" : "");
b = b.AttachedToAssetName + (b.AttachedToAsset ? "1" : "");
return a > b ? 1 : -1;
}
col.filter = function (item) {
if (item.ScheduleParts && assetsObj && assetsObj.HasSchedule) {
var totalDays = assetsObj.TotalDays;
var interval = parseInt(totalDays / labelCount);
if (totalDays % labelCount != 0)
interval += 1;
totalDays = interval * labelCount;
var container = $('<div></div>').css({
position: 'relative',
height: '20px',
});
var d = new Date(assetsObj.BeginDate);
for (var i = 0; i < item.ScheduleParts.length; i++) {
var sp = item.ScheduleParts[i];
var bdate = new Date(sp.BeginDate);
var edate = new Date(sp.EndDate);
var l = (bdate.getTime() - d.getTime()) / (1000 * 60 * 60 * 24) / totalDays * col.width;
var w = (edate.getTime() - bdate.getTime()) / (1000 * 60 * 60 * 24) / totalDays * col.width;
var color = "";
if (sp.Schedules.length == 1)
color = sp.Schedules[0].Color;
else {
for (var j = 0; j < sp.Schedules.length; j++) {
if (color !== "")
color += ","
color += sp.Schedules[j].Color;
}
}
var df = new DateFormatter();
var title = df.formatDate(bdate, 'm/d/Y') + " - " + df.formatDate(new Date((edate.getTime() - 1000 * 60 * 60 * 24)), 'm/d/Y') + "\n";
for (var j = 0; j < sp.Schedules.length; j++) {
var bd = new Date(sp.Schedules[j].BeginDate);
var ed = new Date(sp.Schedules[j].EndDate);
title += sp.Schedules[j].JobSiteName + ": " + df.formatDate(bd, 'm/d/Y') + " - " + df.formatDate(ed, 'm/d/Y');
if (sp.Schedules[j].PointOfContact)
title += "\n " + GetTextByKey("P_JS_CONTACT_COLON", "Contact: ") + " " + sp.Schedules[j].PointOfContact;
if (sp.Schedules[j].Creator)
title += "\n " + GetTextByKey("P_JS_CREATOR_COLON", "Creator: ") + " " + sp.Schedules[j].Creator;
if (j != sp.Schedules.length - 1)
title += "\n";
}
var bar = $('<span class="span-bar"></span>');
bar.css({
left: l,
width: w - 1,
'border-left': '1px solid transparen'
});
if (sp.Schedules.length == 1)
bar.css("backgroundColor", color);
else {
//bar.css("background", "url(img/gridline.jpg) repeat 20px 20px");
//bar.css("background", "linear-gradient(45deg," + color + ")");
//bar.css("background-image", "repeating-linear-gradient(45deg,white, white 5px,#ff9900 5px,#ff9900 7px)");
//bar.css("background-image", "repeating-linear-gradient(135deg,blue 1px, transparent 0), repeating-linear-gradient(45deg, red 1px, transparent 0)");
//bar.css("background-size", "5px 5px");
//bar.css("background-image", "url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><g fill='orange' fill-opacity='1'><path fill-rule='evenodd' d='M0 0h4v4H0V0zm4 4h4v4H4V4z'/></g></svg>\")");
bar.css("background-image", "url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><g fill-opacity='0.5'><path d='M0 0L8 8z M0 8L8 0z' style='fill:white;stroke:gray;stroke-width:1'/></g></svg>\")");
}
bar.attr("title", title);
if (!IsReadOnly) {
bar.dblclick(sp, function (e) {
onEditScheduler(item, e.data.Schedules);
});
}
container.append(bar);
}
return container;
}
}
else if (col.name === "Schedules") {
col.sortable = false;
col.orderable = false;
col.type = SchedulesColumn;
col.onScheduleClicked = function (item, sp) {
onEditScheduler(item, sp.Schedules);
};
col.styleFilter = function () {
return {
'margin-top': '3px',
'margin-bottom': '0px',
'position': 'relative',
'height': '36px',
};
}
}
columns.push(col);
}
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.celldblclick = function (rowindex, columnIndex) {
grid_dt.onCellDblClicked = function (rowindex, columnIndex) {
if (!IsReadOnly) {
if (columnIndex != grid_dt.columns.length - 1) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
onEditScheduler(rowdata.Values);
onEditScheduler(rowdata);
}
}
}
}
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
grid_dt.allcolumns = columns;
// multiple sort
grid_dt.columnchanged = function (ev) {
if (ev === 'sort') {
try {
var sorts = JSON.parse(window.localStorage.getItem('jobsite_schedulers_sorts'));
delete sorts[`${companyid}_${userid}`];
window.localStorage.setItem('jobsite_schedulers_sorts', JSON.stringify(sorts));
}
catch { }
}
}
};
grid_dt.onsorts = function (arr) {
var sorts;
try {
sorts = JSON.parse(window.localStorage.getItem('jobsite_schedulers_sorts'));
if (sorts == null) {
sorts = {};
}
}
catch {
sorts = {};
}
sorts[`${companyid}_${userid}`] = arr;
window.localStorage.setItem('jobsite_schedulers_sorts', JSON.stringify(sorts));
};
try {
var sorts = JSON.parse(window.localStorage.getItem('jobsite_schedulers_sorts'));
grid_dt.sortArray = sorts[`${companyid}_${userid}`];
} catch { }
getGridLayout(gridLayoutID, grid_dt);
}
if (typeof jobsiteschedulerCtrl !== 'function') {
$jobsiteschedulerCtrl = function jobsiteschedulerCtrl() {
this.tmpobj = {
};
this.wizardCtrl = null;
this.vue = null;
};
(function () {
'use strict';
var dataGrid = window.DataGrid || window['g5-datagrid'];
$jobsiteschedulerCtrl.prototype.getData = function (/*dataObj, tmpdata*/) {
return this.vue.source;
};
$jobsiteschedulerCtrl.prototype.setData = function (data) {
if (data) {
for (var i = 0; i < data.length; i++) {
data[i].Selected = false;
}
function showJobsiteSchedulerList(data) {
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
r.Selected = false;
r.Changed = false;
for (var j in r) {
if (j === "BeginDate") {
r[j] = { DisplayValue: r["BeginDateStr"], Value: r[j] };
}
if (j === "EndDate") {
r[j] = { DisplayValue: r["EndDateStr"], Value: r[j] };
}
this.vue.source = data ? data : [];
this.vue.$refs.grid.resize();
};
$jobsiteschedulerCtrl.prototype.reload = function () {
this.vue.$refs.grid.reload()
};
$jobsiteschedulerCtrl.prototype.Init = function (parent, newselected) {
var ethis = this;
//加载子页面模版
parent.load('../template/JobsiteSchedulerCtrl.html?v=8', function () {
ethis.vue = new Vue({
el: parent.find('.JobsiteSchedulerCtrl')[0],
components: {
'data-grid': dataGrid
},
data: {
wnd: window.parent,
//editable: true,
columns: [],
source: []
},
computed: {
},
watch: {
source: function (val) {
}
},
methods: {
cellvaluechanged: function (item, key) {
},
rowdblclick: function (e) {
}
}
});
ethis.vue.columns = createGridColumn(newselected);
});
};
function createGridColumn(newselected) {
var editable = true;
var columns = [
{
key: 'Selected',
caption: '',
type: dataGrid.COLUMN_TYPE.checkbox,
width: 30,
align: 'center',
sortable: false,
orderable: false,
resizable: false,
allcheck: false,
enabled: function (item) {
return !item.Completed;
}
},
{
key: 'JobSiteName',
caption: GetTextByKey("P_JS_JOBSITE", "Jobsite"),
type: dataGrid.COLUMN_TYPE.label,
width: 200,
orderable: false,
resizable: false,
enabled: false
},
{
key: 'BeginDateStr',
caption: GetTextByKey("P_JS_BEGINDATE", 'Begin Date'),
type: dataGrid.COLUMN_TYPE.datepicker,
width: 120,
orderable: false,
resizable: false,
enabled: editable,
onchanged: function (item) {
item.Changed = true;
}
},
{
key: 'EndDateStr',
caption: GetTextByKey("P_JS_ENDDATE", 'End Date'),
type: dataGrid.COLUMN_TYPE.datepicker,
width: 120,
orderable: false,
resizable: false,
enabled: editable,
onchanged: function (item) {
item.Changed = true;
}
},
{
key: 'Delete',
type: dataGrid.COLUMN_TYPE.link,
align: 'center',
width: 30,
orderable: false,
resizable: false,
enabled: editable,
filter: function (item) {
return item.Completed ? '' : '\uf00d';
},
onclick: function (e, item) {
onDeleteScheduler(item);
},
styleFilter: function (item) {
return {
'font-family': 'FontAwesome',
'cursor': 'pointer',
'color': 'rgb(123, 28, 33)'
};
},
attrs: { 'title': GetTextByKey("P_JS_DELETE", 'Delete') }
}
];
return columns;
}
}());
rows.push(r);
}
grid_jsschedulerdt.setData(rows);
grid_jsschedulerdt.refresh();
}
var grid_jsschedulerdt;
function InitJobsiteschedulerGridData() {
grid_jsschedulerdt = createGridView('#schedulerlist1');
grid_jsschedulerdt.isEditable = true;
var list_columns = [
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
{ name: 'JobSiteName', caption: GetTextByKey("P_JOBSITES", "Jobsite"), valueIndex: 'JobSiteName', allowFilter: true, css: { 'width': 130, 'text-align': 'left' } },
{ name: 'BeginDate', caption: GetTextByKey("P_JS_BEGINDATE", 'Begin Date'), valueIndex: 'BeginDate', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'EndDate', caption: GetTextByKey("P_JS_ENDDATE", 'End Date'), valueIndex: 'EndDate', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Delete', caption: "", alwaysshow: true, 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;
col.oldFilterValues = col.filterValues;
if (list_columns[hd].type) {
col.type = list_columns[hd].type;
}
col.alwaysshow = list_columns[hd].alwaysshow;
var DateColumn = window['lib-ui'].GridDateColumn;
if (col.name === "BeginDate") {
col.type = DateColumn;
col.filter = function (item, editing) {
return item.BeginDateStr;
};
col.sortFilter = function (a, b) {
a = a.BeginDate.Value;
b = b.BeginDate.Value;
return a > b ? 1 : (a < b ? -1 : 0);
};
col.onChanged = function (item, value) {
item.BeginDateStr = item.BeginDate.DisplayValue = DateColumn.formatDate(value);
item.BeginDate = item.BeginDate.Value;
item.Changed = true;
};
}
else if (col.name === "EndDate") {
col.type = DateColumn;
col.filter = function (item, editing) {
return item.EndDateStr;
};
col.sortFilter = function (a, b) {
a = a.EndDate.Value;
b = b.EndDate.Value;
return a > b ? 1 : (a < b ? -1 : 0);
};
col.onChanged = function (item, value) {
item.EndDateStr = item.EndDate.DisplayValue = DateColumn.formatDate(value);
item.EndDate = item.EndDate.Value;
item.Changed = true;
};
}
else if (col.name === "Delete") {
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.events = {
onclick: function () {
onDeleteScheduler(this);
}
};
col.attrs = { 'title': GetTextByKey("P_WO_DELETE", 'Delete') };
}
columns.push(col);
}
grid_jsschedulerdt.multiSelect = true;
grid_jsschedulerdt.columns = columns;
grid_jsschedulerdt.init();
}
var currentscheduler;
@@ -372,10 +277,7 @@ function onEditScheduler(item, schedules) {
'left': (document.documentElement.clientWidth - $('#dialog_managescheduler').width()) / 2
}).showDialogfixed();
if (jobsiteschedulerCtrl) {
jobsiteschedulerCtrl.setData(allSchedulers);
}
showJobsiteSchedulerList(allSchedulers);
}
function onDeleteScheduler(item) {
@@ -385,8 +287,9 @@ function onDeleteScheduler(item) {
ids.push(schduler.DispatchId);
}
else {
for (var i = 0; i < jobsiteschedulerCtrl.vue.source.length; i++) {
var sch = jobsiteschedulerCtrl.vue.source[i];
var tempsource = grid_jsschedulerdt.source;
for (var i = 0; i < tempsource.length; i++) {
var sch = tempsource[i];
if (sch.Selected && !sch.Completed) {
ids.push(sch.DispatchId);
}
@@ -402,15 +305,16 @@ function onDeleteScheduler(item) {
var dispatchids = [];
if (schduler) {
dispatchids.push(schduler.DispatchId);
var index = jobsiteschedulerCtrl.vue.source.indexOf(schduler);
jobsiteschedulerCtrl.vue.$refs.grid.deleteRow(index);
var index = grid_jsschedulerdt.selectedIndex;
grid_jsschedulerdt.removeItem(index);
}
else {
for (var i = jobsiteschedulerCtrl.vue.source.length - 1; i >= 0; i--) {
var sch = jobsiteschedulerCtrl.vue.source[i];
var tempsource = grid_jsschedulerdt.source;
for (var i = tempsource.length - 1; i >= 0; i--) {
var sch = tempsource[i];
if (sch.Selected && !sch.Completed) {
dispatchids.push(sch.DispatchId);
jobsiteschedulerCtrl.vue.$refs.grid.deleteRow(i);
grid_jsschedulerdt.removeItem(i);
}
}
}
@@ -432,8 +336,9 @@ function onDeleteScheduler(item) {
function checkSchedulerItems(alerttitle) {
var items = [];
for (var i = 0; i < jobsiteschedulerCtrl.vue.source.length; i++) {
var sch = jobsiteschedulerCtrl.vue.source[i];
var tempsource = grid_jsschedulerdt.source;
for (var i = 0; i < tempsource.length; i++) {
var sch = tempsource[i];
if (sch.Changed) {
var item = {
'DispatchId': sch.DispatchId,
@@ -488,7 +393,7 @@ function checkSchedulerItems(alerttitle) {
}
function onUpdateScheduler() {
if (jobsiteschedulerCtrl.vue.source.length == 0) {
if (grid_jsschedulerdt.source.length == 0) {
$('#dialog_managescheduler').hide();
showmaskbg(false);
OnRefresh();
@@ -528,7 +433,7 @@ function onUpdateScheduler() {
function openAddScheduler() {
showmaskbg(true);
$('#dialogmask').show();
$('#dialog_addjobsite').val('');
//$('#dialog_addjobsite').val('');
$('#dialog_addbegindate').val('');
$('#dialog_addenddate').val('');
$('#dialog_addnotes').val('');
@@ -623,6 +528,7 @@ function onAddScheduler(ignorebeginpast) {
scheduleritem.BeginDateStr = item.BeginDate;
scheduleritem.EndDateStr = item.EndDate;
allSchedulers.push(scheduleritem);
showJobsiteSchedulerList(allSchedulers);
}
}, function (err) {
console.log(err);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More