sync
This commit is contained in:
@ -7,78 +7,18 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
float: left;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #fff;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-header:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.tab-header.selected {
|
||||
border-color: #d8d8d8;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tab-header.selected:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.label { /*cover tab.css*/
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.login_lable {
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.sbutton {
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
.msgdiv {
|
||||
border: solid 1px lightgray;
|
||||
margin-top: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
line-height: 24px;
|
||||
white-space: normal;
|
||||
word-break: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.msgtime {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dialog, .data-column-header-filter-panel, .data-column-header-filter-bg {
|
||||
z-index: 700;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 20px 40px 5px 0px;
|
||||
font-size: 16px;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.subtitle span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.subtitle hr {
|
||||
background-color: #d8d8d8;
|
||||
border: none;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 120px;
|
||||
}
|
||||
@ -86,15 +26,6 @@
|
||||
.dialog-content table td input[type="text"], .dialog-content table td textarea {
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 322px;
|
||||
margin: 2px 0 0 0px;
|
||||
}
|
||||
|
||||
.div_panel {
|
||||
min-width: 322px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
|
||||
@ -104,16 +35,7 @@
|
||||
<script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/language.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/modulelang.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var alerttypeparam;
|
||||
var assetgroupparam;
|
||||
var jobsitesparam;
|
||||
var assigntosparam;
|
||||
var alerttype_editmultiselect;
|
||||
var assetgroup_editmultiselect;
|
||||
var jobsite_editmultiselect;
|
||||
var assignto_editmultiselect;
|
||||
|
||||
<script type="text/javascript">
|
||||
function alertrequest(method, param, callback, error) {
|
||||
_network.request("Maintenance/AlertAutomationManagement.aspx", -1, method, param, callback, error || function (e) {
|
||||
console.log(e);
|
||||
@ -128,7 +50,7 @@
|
||||
showAlert(GetTextByKey('P_UM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_UM_QUERY', 'Query'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showstatusmask(flag) {
|
||||
if (flag) {
|
||||
@ -149,20 +71,14 @@
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
autoacknowledge_dt.setData(rows);
|
||||
}
|
||||
var autoacknowledge_dt;
|
||||
function InitAutoAcknowledgeGridData() {
|
||||
autoacknowledge_dt = new GridView('#div_autoacknowledgelist');
|
||||
autoacknowledge_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
autoacknowledge_dt = createGridView('#div_autoacknowledgelist');
|
||||
var list_columns = [
|
||||
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
|
||||
{ name: 'Value', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'Value', css: { 'width': 300, 'text-align': 'left' } }
|
||||
@ -184,7 +100,7 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
autoacknowledge_dt.canMultiSelect = false;
|
||||
autoacknowledge_dt.multiSelect = false;
|
||||
autoacknowledge_dt.columns = columns;
|
||||
autoacknowledge_dt.init();
|
||||
}
|
||||
@ -196,15 +112,10 @@
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
data.splice(0, 0, { Key: "", Value: GetTextByKey("P_XXXXX", '(Blank)') });
|
||||
data.splice(0, 0, { Key: "", Value: GetTextByKey("P_AM_BLANK", '(Blank)') });
|
||||
alerttypesdata = data;
|
||||
alerttypeparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
alerttypesdata = data;
|
||||
alerttype_editmultiselect = editmultiselect(alerttypeparam);
|
||||
$('#div_alerttype').append(alerttype_editmultiselect);
|
||||
|
||||
$("#div_alerttype").dropdownSource(alerttypesdata);
|
||||
GetAutoAcknowledgeAlertTypes();
|
||||
});
|
||||
}
|
||||
@ -215,12 +126,8 @@
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
assetgroupparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
assetgroup_editmultiselect = editmultiselect(assetgroupparam);
|
||||
$('#div_assetgroup').append(assetgroup_editmultiselect);
|
||||
|
||||
$("#div_assetgroup").dropdownSource(data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -231,12 +138,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
jobsitesparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
jobsite_editmultiselect = editmultiselect(jobsitesparam);
|
||||
$('#div_jobsites').append(jobsite_editmultiselect);
|
||||
$("#div_jobsites").dropdownSource(data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -247,12 +149,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
assigntosparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
assignto_editmultiselect = editmultiselect(assigntosparam);
|
||||
$('#div_assigntos').append(assignto_editmultiselect);
|
||||
$("#div_assigntos").dropdownSource(data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -301,8 +198,9 @@
|
||||
|
||||
function onSaveAutoAcknowledgeAlertTypes() {
|
||||
var alerttypes = [];
|
||||
for (var i = 0; i < autoacknowledge_dt.source.length; i++) {
|
||||
var ct = autoacknowledge_dt.source[i].Values;
|
||||
var tempsource = autoacknowledge_dt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var ct = tempsource[i];
|
||||
if (ct.Selected)
|
||||
alerttypes.push(ct.Key);
|
||||
}
|
||||
@ -325,22 +223,17 @@
|
||||
|
||||
var wogeneratorgrid_dt;
|
||||
function InitWOGeneratorGridData() {
|
||||
wogeneratorgrid_dt = new GridView('#wogeneratorlist');
|
||||
wogeneratorgrid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
wogeneratorgrid_dt = createGridView('#wogeneratorlist');
|
||||
var list_columns = [
|
||||
{ name: 'AlertTypesStr', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertTypesStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'AlertTypesStr', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertTypesStr', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'AssetGroupsStr', caption: GetTextByKey("P_AM_ASSETGROUP", "Asset Group"), valueIndex: 'AssetGroupsStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'JobSitesStr', caption: GetTextByKey("P_UM_JOBSITES", "Jobsite(s)"), valueIndex: 'JobSitesStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'AssignTosStr', caption: GetTextByKey("P_JS_ASSIGNEDTO", "Assigned To"), valueIndex: 'AssignTosStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'StatusAssignmentName', caption: GetTextByKey("P_AM_STATUSASSIGNMENT", "Status Assignment"), valueIndex: 'StatusAssignmentName', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'IncludeAllAlerts', caption: GetTextByKey("P_AM_INCLUDEALLALERTS", "Include All Alerts"), valueIndex: 'IncludeAllAlerts', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailWorkorder', caption: GetTextByKey("P_AM_EMAILWORKORDER", "Email Work Order"), valueIndex: 'EmailWorkorder', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailFrom', caption: GetTextByKey("P_AM_XXX", "Email From"), valueIndex: 'EmailFrom', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Description', caption: GetTextByKey("P_AM_XXX", "Description"), valueIndex: 'Description', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'StatusAssignmentName', caption: GetTextByKey("P_AM_STATUSASSIGNMENT", "Status Assignment"), valueIndex: 'StatusAssignmentName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'IncludeAllAlerts', caption: GetTextByKey("P_AM_INCLUDEALLALERTS", "Include All Alerts"), valueIndex: 'IncludeAllAlerts', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailWorkorder', caption: GetTextByKey("P_AM_EMAILWORKORDER", "Email Work Order"), valueIndex: 'EmailWorkorder', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailFrom', caption: GetTextByKey("P_AM_EMAILFROM", "Email From"), valueIndex: 'EmailFrom', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Description', caption: GetTextByKey("P_AM_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
|
||||
];
|
||||
@ -359,9 +252,10 @@
|
||||
col.type = list_columns[hd].type;
|
||||
|
||||
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 () {
|
||||
OnEditWOGenerator();
|
||||
@ -373,9 +267,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_UM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDeleteWOGenerator(this);
|
||||
@ -392,10 +287,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
wogeneratorgrid_dt.canMultiSelect = false;
|
||||
wogeneratorgrid_dt.multiSelect = false;
|
||||
wogeneratorgrid_dt.columns = columns;
|
||||
wogeneratorgrid_dt.init();
|
||||
wogeneratorgrid_dt.rowdblclick = OnEditWOGenerator;
|
||||
wogeneratorgrid_dt.onRowDblClicked = OnEditWOGenerator;
|
||||
}
|
||||
|
||||
function GetWorkOrderGenerators() {
|
||||
@ -426,10 +321,10 @@
|
||||
|
||||
for (var j in r) {
|
||||
if (j === "IncludeAllAlerts") {
|
||||
r[j] = { DisplayValue: r.IncludeAllAlerts ? "Yes" : "No", Value: r[j] };
|
||||
r[j] = { DisplayValue: r.IncludeAllAlerts ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
|
||||
}
|
||||
if (j === "EmailWorkorder") {
|
||||
r[j] = { DisplayValue: r.EmailWorkorder ? "Yes" : "No", Value: r[j] };
|
||||
r[j] = { DisplayValue: r.EmailWorkorder ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
|
||||
}
|
||||
if (j === "AlertTypesStr") {
|
||||
r[j] = { DisplayValue: r.AlertTypesStr === "" ? "All" : r.AlertTypesStr, Value: r[j] };
|
||||
@ -447,8 +342,7 @@
|
||||
r[j] = { DisplayValue: desc, Value: r[j] };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
wogeneratorgrid_dt.setData(rows);
|
||||
@ -457,11 +351,11 @@
|
||||
function OnAddWOGenerator() {
|
||||
$('#tr_desc').hide();
|
||||
generatorid = undefined;
|
||||
var alerttitle = GetTextByKey("P_AM_ADDWORKORDERGENERATOR", 'Add Work Order Generator')
|
||||
alerttype_editmultiselect.setValues([]);
|
||||
assetgroup_editmultiselect.setValues([]);
|
||||
jobsite_editmultiselect.setValues([]);
|
||||
assignto_editmultiselect.setValues([]);
|
||||
var alerttitle = GetTextByKey("P_AM_ADDWORKORDERGENERATOR", 'Add Work Order Generator');
|
||||
$('#div_alerttype').dropdownVals([]);
|
||||
$('#div_assetgroup').dropdownVals([]);
|
||||
$('#div_jobsites').dropdownVals([]);
|
||||
$('#div_assigntos').dropdownVals([]);
|
||||
$('#dialog_wostatus').val("");
|
||||
$('#dialog_includeallalerts').prop('checked', false);
|
||||
$('#dialog_emailworkorder').prop('checked', false);
|
||||
@ -483,12 +377,12 @@
|
||||
var index = wogeneratorgrid_dt.selectedIndex;
|
||||
if (index < 0) return;
|
||||
|
||||
var generator = wogeneratorgrid_dt.source[index].Values;
|
||||
var generator = wogeneratorgrid_dt.source[index];
|
||||
generatorid = generator.Id;
|
||||
alerttype_editmultiselect.setValues(generator.AlertTypes || []);
|
||||
assetgroup_editmultiselect.setValues(generator.AssetGroups || []);
|
||||
jobsite_editmultiselect.setValues(generator.JobSites || []);
|
||||
assignto_editmultiselect.setValues(generator.AssignTos || []);
|
||||
$('#div_alerttype').dropdownVals(generator.AlertTypes || []);
|
||||
$('#div_assetgroup').dropdownVals(generator.AssetGroups || []);
|
||||
$('#div_jobsites').dropdownVals(generator.JobSites || []);
|
||||
$('#div_assigntos').dropdownVals(generator.AssignTos || []);
|
||||
$('#dialog_wostatus').val(generator.StatusAssignment);
|
||||
$('#dialog_includeallalerts').prop('checked', generator.IncludeAllAlerts.Value);
|
||||
$('#dialog_emailworkorder').prop('checked', generator.EmailWorkorder.Value);
|
||||
@ -515,25 +409,10 @@
|
||||
|
||||
function onSaveWorkOrderGenerator() {
|
||||
showstatusmask(true);
|
||||
var alerttypes = [];
|
||||
if (alerttypeparam) {
|
||||
alerttypes = alerttypeparam.selectedvalue;
|
||||
}
|
||||
|
||||
var assetgroups = [];
|
||||
if (assetgroupparam) {
|
||||
assetgroups = assetgroupparam.selectedvalue;
|
||||
}
|
||||
|
||||
var jobsites = [];
|
||||
if (jobsitesparam) {
|
||||
jobsites = jobsitesparam.selectedvalue;
|
||||
}
|
||||
|
||||
var assigntos = [];
|
||||
if (assigntosparam) {
|
||||
assigntos = assigntosparam.selectedvalue;
|
||||
}
|
||||
var alerttypes = $('#div_alerttype').dropdownVals();
|
||||
var assetgroups = $('#div_assetgroup').dropdownVals();
|
||||
var jobsites = $('#div_jobsites').dropdownVals();
|
||||
var assigntos = $('#div_assigntos').dropdownVals();
|
||||
|
||||
var item = {
|
||||
'StatusAssignment': $('#dialog_wostatus').val(),
|
||||
@ -558,7 +437,7 @@
|
||||
}
|
||||
|
||||
if (item.AssignTos.length == 0) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Assigned to cannot be empty.'), alerttitle, undefined, function () {
|
||||
showAlert(GetTextByKey("P_AM_ASSIGNEDTOCANNOTBEEMPTY", 'Assigned to cannot be empty.'), alerttitle, undefined, function () {
|
||||
showstatusmask(false);
|
||||
|
||||
});
|
||||
@ -566,14 +445,14 @@
|
||||
}
|
||||
|
||||
if (!item.StatusAssignment) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Status assignment cannot be empty.'), alerttitle, undefined, function () {
|
||||
showAlert(GetTextByKey("P_AM_STATUSASSIGNMENTCANNOTBEEMPTY", 'Status assignment cannot be empty.'), alerttitle, undefined, function () {
|
||||
showstatusmask(false);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.EmailFrom !== "" && !isEmail(item.EmailFrom)) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Email from is not a valid.'), alerttitle, undefined, function () {
|
||||
showAlert(GetTextByKey("P_AM_EMAILFROMISNOTAVALID", 'Email from is not a valid.'), alerttitle, undefined, function () {
|
||||
showstatusmask(false);
|
||||
});
|
||||
return;
|
||||
@ -623,6 +502,38 @@
|
||||
InitAutoAcknowledgeGridData();
|
||||
InitWOGeneratorGridData();
|
||||
|
||||
$("#div_alerttype").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$("#div_assetgroup").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$("#div_jobsites").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$("#div_assigntos").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
GetAlertTypes();
|
||||
GetWorkOrderGenerators();
|
||||
GetAssetGroups();
|
||||
@ -735,7 +646,7 @@
|
||||
<tr>
|
||||
<td class="label"><span data-lgid="P_AM_STATUSASSIGNMENT_COLON">Status Assignment:</span></td>
|
||||
<td>
|
||||
<select id="dialog_wostatus" tabindex="1" style="width: 322px;"></select>
|
||||
<select id="dialog_wostatus" tabindex="1" style="width: 322px; height: 24px;"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -751,15 +662,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span data-lgid="P_AM_XXX">Email From:</span></td>
|
||||
<td class="label"><span data-lgid="P_AM_EMAILFROM_COLON">Email From:</span></td>
|
||||
<td>
|
||||
<input type="text" id="dialog_emailfrom" maxlength="200" tabindex="1" />
|
||||
<input type="text" id="dialog_emailfrom" maxlength="200" tabindex="1" style="height: 24px;" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span data-lgid="P_AM_XXX">Description:</span></td>
|
||||
<td class="label"><span data-lgid="P_AM_DESCRIPTION_COLON">Description:</span></td>
|
||||
<td>
|
||||
<select id="dialog_desctype" tabindex="1" style="width: 324px;">
|
||||
<select id="dialog_desctype" tabindex="1" style="width: 324px; height: 24px;">
|
||||
<option value="-1"></option>
|
||||
<option value="0">Trigger Alerts</option>
|
||||
<option value="1">All Alerts</option>
|
||||
|
Reference in New Issue
Block a user