sync
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user