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

View File

@ -2,6 +2,10 @@
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
html, body {
height: 100%;
}
.no_wrap th {
white-space: nowrap;
overflow: hidden;
@ -15,29 +19,6 @@
white-space: nowrap;
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
line-height: 32px;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 250px;
height: 18px;
padding: 1px;
}
#dialog_machines .dialog-content table td input {
width: auto;
}
@ -61,79 +42,6 @@
max-width: 500px;
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.group_table .main_table {
table-layout: fixed;
}
.group_table .main_table thead tr {
display: block;
}
.group_table .main_table tbody {
height: 280px;
display: block;
overflow-y: auto;
}
.group_table .main_table th {
width: 165px;
}
.group_table .main_table td {
width: 165px;
white-space: nowrap;
word-break: keep-all;
}
.group_table .main_table td div {
width: 165px;
overflow: hidden;
white-space: nowrap;
word-break: keep-all;
text-overflow: ellipsis;
}
.td_controller {
vertical-align: middle;
padding: 40px 8px;
/*border-left: 1px solid #b0b0b0;
border-right: 1px solid #b0b0b0;*/
}
.ctl_button {
font-family: 'CalciteWebCoreIcons';
display: block;
margin: 6px auto;
width: 60px;
height: 22px;
line-height: 21px;
padding: 0;
}
.machine_maskbg {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
background: #000;
opacity: 0.2;
}
.div_filter .dropdown {
width: 100px;
}
.emailpopus-close {
float: right;
margin-right: 6px;
@ -149,8 +57,6 @@
height: unset;
}
</style>
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="../js/echarts.min.js"></script>
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
@ -440,19 +346,26 @@
}
function drilldowndetail(ids) {
var begindate = $('#startdatetxt').val();
var enddate = $('#enddatetxt').val();
if (begindate && !$('#startdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !$('#enddatetxt').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 template = $('#templateselectinput').find("option:selected").val();
var startdate = htmlencode($('#startdatetxt').val());
var enddate = htmlencode($('#enddatetxt').val());
var locations = [];
if (locationparam)
locations = locationparam.selectedvalue;
var advisors = [];
if (advisorparam)
advisors = advisorparam.selectedvalue;
var locations = $("#div_locations").dropdownVals();
var advisors = $("#div_advisors").dropdownVals();
var param = JSON.stringify([template, startdate, enddate, JSON.stringify(locations), JSON.stringify(advisors), ids]);
var param = JSON.stringify([template, begindate, enddate, JSON.stringify(locations), JSON.stringify(advisors), ids]);
param = htmlencode(param);
setCookieSeconds("WOSurveyReportParams", param, 60);
@ -536,65 +449,55 @@
}
}
var locationparam;
var advisorparam;
var location_editmultiselect;
var advisor_editmultiselect;
var filterDataSource = null;
function GetFilterDataSource() {
$('#div_locations').empty();
$('#div_advisors').empty();
reportrequest('GetFilterDataSource', '', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
return;
}
filterDataSource = data;
for (var i = 0; i < data.Locations.length; i++) {
var loc = data.Locations[i];
loc.sublevel = loc.PId > 0 ? 1 : 0;
}
locationparam = {
items: data.Locations,
selectedvalue: [],
width: 120,
valuepath: "ID",
textpath: "Name"
};
location_editmultiselect = editmultiselect(locationparam);
$('#div_locations').append(location_editmultiselect);
advisorparam = {
items: JSON.parse(JSON.stringify(data.Advisors)),
selectedvalue: [],
width: 120
};
advisor_editmultiselect = editmultiselect(advisorparam);
$('#div_advisors').append(advisor_editmultiselect);
$("#div_locations").dropdownSource(data.Locations);
$("#div_advisors").dropdownSource(data.Advisors);
}, function () {
});
}
function getParams(tid) {
var startdate = htmlencode($('#startdatetxt').val());
var enddate = htmlencode($('#enddatetxt').val());
var begindate = $('#startdatetxt').val();
var enddate = $('#enddatetxt').val();
if (begindate && !$('#startdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return false;
}
if (enddate && !$('#enddatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return false;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
return false;
}
var locations = [];
if (locationparam)
locations = locationparam.selectedvalue;
var advisors = [];
if (advisorparam)
advisors = advisorparam.selectedvalue;
var locations = $("#div_locations").dropdownVals();
var advisors = $("#div_advisors").dropdownVals();
return JSON.stringify([tid, startdate, enddate, JSON.stringify(locations), JSON.stringify(advisors)]);
return JSON.stringify([tid, htmlencode(begindate), htmlencode(enddate), JSON.stringify(locations), JSON.stringify(advisors)]);
}
var reportData;
function OnRefresh() {
showloading(true);
var template = $('#templateselectinput').find("option:selected").val();
var param = getParams(template);
if (param == false)
return;
param = htmlencode(param);
showloading(true);
reportrequest('GetSurveyTemplateReport', param, function (data) {
showloading(false);
//console.log(data);
@ -618,21 +521,40 @@
var selectedTemplate = $('#templateselectinput').find("option:selected");
var tid = Number(selectedTemplate.val());
if (tid < 0) {
showAlert(GetTextByKey("P_WO_XXXX", "Please select a template."), GetTextByKey("P_MR_PRINT", "Print"));
showAlert(GetTextByKey("P_WO_PLEASESELECTATEMPLATE", "Please select a template."), GetTextByKey("P_MR_PRINT", "Print"));
return;
}
var tname = encodeURIComponent(selectedTemplate.text());
var start = encodeURIComponent($('#startdatetxt').val());
var end = encodeURIComponent($('#enddatetxt').val());
var locs = locationparam == null ? '' : encodeURIComponent(locationparam.selectedvalue.map(function (v) {
var item = locationparam.items.filter(function (i) { return i.ID == v })[0];
var begindate = $('#startdatetxt').val();
var enddate = $('#enddatetxt').val();
if (begindate && !$('#startdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !$('#enddatetxt').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 start = encodeURIComponent(begindate);
var end = encodeURIComponent(enddate);
var locations = $("#div_locations").dropdownVals();
var locs = locations == null ? '' : encodeURIComponent(locations.map(function (v) {
var item = filterDataSource.Locations.filter(function (i) { return i.ID == v })[0];
if (item != null) {
return v + ';' + item.Name;
}
return v;
}).join(','));
var advs = advisorparam == null ? '' : encodeURIComponent(advisorparam.selectedvalue.map(function (v) {
var item = advisorparam.items.filter(function (i) { return i.Key == v })[0];
var advisors = $("#div_advisors").dropdownVals();
var advs = advisors == null ? '' : encodeURIComponent(advisors.map(function (v) {
var item = filterDataSource.Advisors.filter(function (i) { return i.Key == v })[0];
if (item != null) {
return v + ';' + item.Value;
}
@ -644,12 +566,7 @@
var grid_contactdt;
function InitContactGridData() {
grid_contactdt = new GridView('#contactlist');
grid_contactdt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_contactdt = createGridView('#contactlist');
var list_columns = [
{ name: 'DisplayName', caption: GetTextByKey("P_WO_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 148, 'text-align': 'left' } },
//{ name: 'ContactTypeName', caption: GetTextByKey("P_WO_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 148, 'text-align': 'left' } },
@ -672,7 +589,7 @@
}
columns.push(col);
}
grid_contactdt.canMultiSelect = false;
grid_contactdt.multiSelect = false;
grid_contactdt.columns = columns;
grid_contactdt.init();
}
@ -687,12 +604,10 @@
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = {
Values: {
ID: r.ID,
DisplayName: r.DisplayName,
ContactTypeName: r.ContactTypeName,
Email: false
}
ID: r.ID,
DisplayName: r.DisplayName,
ContactTypeName: r.ContactTypeName,
Email: false
};
rows.push(fr);
}
@ -708,7 +623,7 @@
var tid = Number(template);
if (isNaN(tid) || tid < 0) {
showAlert(GetTextByKey("P_WO_XXXX", "Please select a template."), GetTextByKey("P_WO_SENDEMAIL", "Send Email"));
showAlert(GetTextByKey("P_WO_PLEASESELECTATEMPLATE", "Please select a template."), GetTextByKey("P_WO_SENDEMAIL", "Send Email"));
return;
}
$(document.body).css('overflow', 'hidden');
@ -753,8 +668,9 @@
}
}
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.Email) {
emailaddress.push({ 'Key': ct.DisplayName, 'Value': ct.ID });
}
@ -767,6 +683,8 @@
var template = $('#templateselectinput').find("option:selected").val();
var param = getParams(template);
if (param == false)
return;
reportrequest('GetSurveyTemplateEmail', encodeURIComponent(param + String.fromCharCode(170) + JSON.stringify(emailaddress)), function (data) {
if (typeof data === 'string') {
_dialog.showAlert(data, alerttitle);
@ -783,30 +701,26 @@
GetTemplateData();
GetFilterDataSource();
$("#div_locations").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Name',
valueKey: 'ID'
});
$("#div_advisors").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$('.emailpopus-close').on('click', function () {
hideSendEmailPopup();
});
$('#startdatetxt').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
onSelectDate: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
inp.parent().data('val', [date]);
}
});
$('#enddatetxt').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
onSelectDate: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
inp.parent().data('val', [date]);
}
});
$('#templateselectinput').change(function () { OnRefresh(); });
});
@ -840,11 +754,11 @@
</div>
<span style="margin-left: 5px;" data-lgid="P_FR_BEGINDATE_COLON">Begin Date:&nbsp;</span>
<div>
<input id="startdatetxt" type="text" style="width: 80px; margin-left: 5px;" autocomplete="off" />
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" autocomplete="off" />
</div>
<span style="margin-left: 5px;" data-lgid="P_FR_ENDDATE_COLON">End Date:&nbsp;</span>
<div>
<input id="enddatetxt" type="text" style="width: 80px; margin-left: 5px;" autocomplete="off" />
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 80px; margin-left: 5px;" autocomplete="off" />
</div>
<span data-lgid="P_WO_LOCATION_COLON">Location:</span>
<div id="div_locations"></div>
@ -859,29 +773,34 @@
<br />
<div id="surveyreport"></div>
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
</div>
<div id="sendemailpopupmask" class="maskbg" style="display: none;"></div>
<div class="dialog" id="sendemailpopupdialog" style="display: none; width: 480px">
<div class="dialog-title"><span class="title" data-lgid="P_WO_XXXX">Send Survey Report</span><em class="emailpopus-close"></em></div>
<div class="dialog-content" style="height: 350px">
<table>
<div class="dialog" id="sendemailpopupdialog" style="display: none; width: 510px">
<div class="dialog-title"><span class="title" data-lgid="P_WOS_SENDSURVEYREPORT">Send Survey Report</span><em class="emailpopus-close"></em></div>
<div class="dialog-content">
<table style="line-height: 24px;">
<tr>
<td data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
<td colspan="2" data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
</tr>
<tr>
<td>
<div id="contactlist" style="height: 240px; width: 420px; margin-left: 10px; margin-right: 10px;"></div>
<td colspan="2" style="text-align: right; padding-right: 5px;">
<div id="contactlist" style="height: 240px; width: 470px; margin-left: 10px; margin-right: 10px;"></div>
</td>
</tr>
<tr>
<td data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
<td colspan="2" data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
</tr>
<tr>
<td><span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
<input type="text" id="email_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
<td style="text-align: right; padding-right: 5px;">
<span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
</td>
<td>
<input type="text" id="email_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
</tr>
</table>
</div>