sync
This commit is contained in:
@ -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>
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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
|
||||
|
@ -8,7 +8,7 @@
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
user-select: none;
|
||||
margin-left: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.section-holder {
|
||||
|
@ -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 = [];
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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"><Not implemented yet.></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',
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
451
Site/Inspection/js/modules/sections/conditional.js
Normal file
451
Site/Inspection/js/modules/sections/conditional.js
Normal 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">=</option>',
|
||||
'<option value="noteq"><></option>',
|
||||
'<option value="gt">></option>',
|
||||
'<option value="gteq">>=</option>',
|
||||
'<option value="lt"><</option>',
|
||||
'<option value="lteq"><=</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">=</option>',
|
||||
'<option value="noteq"><></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;
|
||||
})
|
@ -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);
|
||||
});
|
||||
|
@ -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"));
|
||||
});
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
});
|
@ -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;
|
||||
|
@ -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***************/
|
||||
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
@ -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;
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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'));
|
||||
});
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user