add site
This commit is contained in:
		
							
								
								
									
										418
									
								
								Site/Maintenance/SurveyTemplateManagement.aspx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										418
									
								
								Site/Maintenance/SurveyTemplateManagement.aspx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,418 @@ | ||||
| <%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="SurveyTemplateManagement.aspx.cs" Inherits="SurveyTemplateManagement" %> | ||||
|  | ||||
| <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> | ||||
|     <style type="text/css"> | ||||
|         .no_wrap th { | ||||
|             white-space: nowrap; | ||||
|             overflow: hidden; | ||||
|             text-overflow: ellipsis; | ||||
|         } | ||||
|  | ||||
|         .max160 { | ||||
|             max-width: 160px; | ||||
|             overflow: hidden; | ||||
|             text-overflow: ellipsis; | ||||
|             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; | ||||
|         } | ||||
|  | ||||
|         .dialog-content table td textarea { | ||||
|             margin-top: 6px; | ||||
|         } | ||||
|  | ||||
|         .dialog-content table td select { | ||||
|             width: 254px; | ||||
|             height: 24px; | ||||
|         } | ||||
|  | ||||
|         .dialog-content table td input[type="checkbox"] { | ||||
|             border: none; | ||||
|         } | ||||
|  | ||||
|         .dialog-content table td textarea { | ||||
|             height: 150px; | ||||
|             width: 420px; | ||||
|             max-width: 500px; | ||||
|         } | ||||
|  | ||||
|         .ctl_button { | ||||
|             font-family: 'CalciteWebCoreIcons'; | ||||
|             display: block; | ||||
|             margin: 6px auto; | ||||
|             width: 60px; | ||||
|             height: 22px; | ||||
|             line-height: 21px; | ||||
|             padding: 0; | ||||
|         } | ||||
|  | ||||
|         #dialog_machinegroup { | ||||
|             z-index: 500; | ||||
|             width: 870px; | ||||
|             top: 60px; | ||||
|             left: 150px; | ||||
|         } | ||||
|  | ||||
|         .inputbox { | ||||
|             width: 500px; | ||||
|             padding: 1px; | ||||
|         } | ||||
|  | ||||
|         .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; | ||||
|         } | ||||
|     </style> | ||||
|     <script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script> | ||||
|     <script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script> | ||||
|     <script type="text/javascript"> | ||||
|         var IsDealer = <%=IsDealer ?"true":"false"%>; | ||||
|  | ||||
|         woquery = function (method, param, callback, error) { | ||||
|             _network.request("Maintenance/SurveyTemplateManagement.aspx", -1, method, param, callback, error); | ||||
|         }         | ||||
|  | ||||
|         function OnDelete(u) { | ||||
|             if (!u) { | ||||
|                 return; | ||||
|             } | ||||
|             var alerttitle = GetTextByKey("P_WOS_DELETESURVEYTEMPLATE", 'Delete Survey Template'); | ||||
|             showConfirm(GetTextByKey("P_WOS_DOYOUWANTTODELETETHISSURVEYTEMPLATE", 'Do you want to delete this survey template?'), alerttitle, function () { | ||||
|                 woquery('DeleteSurveyTemplate', u.Id, function (data) { | ||||
|                     OnRefresh(); | ||||
|                 }, function (err) { | ||||
|                     showAlert(GetTextByKey('P_WOS_FAILEDTODELETETHISSURVEYTEMPLATE', 'Failed to delete this survey template.'), alerttitle); | ||||
|                 }); | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         function CloseDialog(type) { | ||||
|             $('#dialog_survey').hideDialog(); | ||||
|             OnRefresh(); | ||||
|             showmaskbg(false); | ||||
|         } | ||||
|  | ||||
|         function OnAdd() { | ||||
|             execIframeFunc("init", [], "iframesurveytemplate"); | ||||
|             showmaskbg(true); | ||||
|             $('#dialog_survey') | ||||
|                 .attr('act', 'add') | ||||
|                 .showDialogRight(); | ||||
|         } | ||||
|  | ||||
|         var surveyid; | ||||
|         function OnEdit() { | ||||
|             var index = grid_dt.selectedIndex; | ||||
|             if (index < 0) { | ||||
|                 showAlert(GetTextByKey("P_WOS_PLEASESELECTSURVEYTEMPLATE", "Please select survey template."), GetTextByKey("P_WORKORDERSURVEYTEMPLATES", "Work Order Survey Templates")); return; | ||||
|             } | ||||
|             var survey = grid_dt.source[index].Values; | ||||
|             if (!survey) { | ||||
|                 surveyid = undefined; | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|             surveyid = survey.Id; | ||||
|  | ||||
|             execIframeFunc("init", [surveyid, survey.InUse], "iframesurveytemplate"); | ||||
|             showmaskbg(true); | ||||
|             $('#dialog_survey') | ||||
|                 .attr('act', 'edit') | ||||
|                 .showDialogRight(); | ||||
|         } | ||||
|  | ||||
|         function OnCopy(id) { | ||||
|             if (id == null) { | ||||
|                 showAlert(GetTextByKey("P_WOS_PLEASESELECTSURVEYTEMPLATE", "Please select survey template."), GetTextByKey("P_WORKORDERSURVEYTEMPLATES", "Work Order Survey Templates")); | ||||
|                 return; | ||||
|             } | ||||
|             execIframeFunc("init", [id, false, true], "iframesurveytemplate"); | ||||
|             showmaskbg(true); | ||||
|             $('#dialog_survey') | ||||
|                 .attr('act', 'add') | ||||
|                 .showDialogRight(); | ||||
|         } | ||||
|  | ||||
|         function OnDblClick(e) { | ||||
|             OnEdit(); | ||||
|         } | ||||
|  | ||||
|         function OnRefresh() { | ||||
|             showloading(true); | ||||
|             var searchtxt = ""; | ||||
|             searchtxt = htmlencode($.trim($('#searchinputtxt').val())); | ||||
|             woquery('GetSurveyTemplateItems', searchtxt, function (data) { | ||||
|                 showloading(false); | ||||
|                 if (typeof (data) === "string") { | ||||
|                     showAlert(data, GetTextByKey('P_WORKORDERSURVEYS', "Survey Template")); | ||||
|                     return; | ||||
|                 } | ||||
|                 showSurveyList(data); | ||||
|             }, function (err) { | ||||
|                 showloading(false); | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         function showSurveyList(data) { | ||||
|             var rows = []; | ||||
|             for (var i = 0; i < data.length; i++) { | ||||
|                 var r = data[i]; | ||||
|                 for (var j in r) { | ||||
|                 } | ||||
|  | ||||
|                 var fr = { Values: r }; | ||||
|                 rows.push(fr); | ||||
|             } | ||||
|  | ||||
|             grid_dt.setData(rows); | ||||
|         } | ||||
|  | ||||
|         var grid_dt; | ||||
|         function InitGridData() { | ||||
|             grid_dt = new GridView('#surveylist'); | ||||
|             grid_dt.lang = { | ||||
|                 all: GetTextByKey("P_GRID_ALL", "(All)"), | ||||
|                 ok: GetTextByKey("P_GRID_OK", "OK"), | ||||
|                 reset: GetTextByKey("P_GRID_RESET", "Reset") | ||||
|             }; | ||||
|             var list_columns = [ | ||||
|                 { name: 'Name', caption: GetTextByKey("P_WOS_NAME", "Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } }, | ||||
|                 { name: 'Notes', caption: GetTextByKey("P_WOS_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 320, 'text-align': 'left' } }, | ||||
|                 { name: 'Active', caption: GetTextByKey("P_UM_ACTIVE", "Active"), valueIndex: 'Active', css: { 'width': 100, 'text-align': 'center' } }, | ||||
|                 { name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } }, | ||||
|                 { name: 'Copy', caption: "", css: { 'width': 30, 'text-align': 'center' } }, | ||||
|                 { name: 'Preview', caption: "", css: { 'width': 30, 'text-align': 'center' } }, | ||||
|                 { name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } } | ||||
|             ]; | ||||
|             var columns = []; | ||||
|             // head | ||||
|             for (var hd in list_columns) { | ||||
|                 var col = {}; | ||||
|                 col.name = list_columns[hd].name; | ||||
|                 col.caption = list_columns[hd].caption; | ||||
|                 col.visible = true; | ||||
|                 col.sortable = true; | ||||
|                 col.width = list_columns[hd].css.width; | ||||
|                 col.align = list_columns[hd].css["text-align"] | ||||
|                 col.key = list_columns[hd].valueIndex; | ||||
|                 col.allowFilter = list_columns[hd].allowFilter; | ||||
|                 if (col.name === 'Active') { | ||||
|                     col.type = 3; | ||||
|                     col.enabled = false; | ||||
|                 } | ||||
|                 else if (col.name === "Edit") { | ||||
|                     col.isurl = true; | ||||
|                     col.text = "\uf044"; | ||||
|                     col.sortable = false; | ||||
|                     col.events = { | ||||
|                         onclick: function () { | ||||
|                             OnEdit(); | ||||
|                         } | ||||
|                     }; | ||||
|                     col.classFilter = function (e) { | ||||
|                         return "icon-col"; | ||||
|                     } | ||||
|                     col.attrs = { 'title': GetTextByKey("P_WOS_EDIT", 'Edit') }; | ||||
|                 } | ||||
|                 else if (col.name === 'Copy') { | ||||
|                     col.isurl = true; | ||||
|                     col.text = '\uf0c5'; | ||||
|                     col.sortable = false; | ||||
|                     col.classFilter = function () { return 'icon-col' }; | ||||
|                     col.attrs = { 'title': GetTextByKey('P_IPT_COPY', 'Copy') }; | ||||
|                     col.events = { | ||||
|                         onclick: function () { | ||||
|                             OnCopy(this.Id); | ||||
|                         } | ||||
|                     }; | ||||
|                 } | ||||
|                 else if (col.name === 'Preview') { | ||||
|                     col.isurl = true; | ||||
|                     col.text = '\uf06e'; | ||||
|                     col.sortable = false; | ||||
|                     col.classFilter = function () { return 'icon-col' }; | ||||
|                     col.attrs = { 'title': GetTextByKey('P_MA_PREVIEW', 'Preview') }; | ||||
|                     col.events = { | ||||
|                         onclick: function () { | ||||
|                             showmaskbg(true); | ||||
|                             woquery('GetSurveyPreviewUrl', encodeURIComponent(this.Id), function (data) { | ||||
|                                 if (typeof data === "string") { | ||||
|                                     showAlert(data, GetTextByKey('P_WORKORDERSURVEYS', "Survey Template")); | ||||
|                                     showmaskbg(false); | ||||
|                                     return; | ||||
|                                 } | ||||
|                                 window.open(data[0]); | ||||
|                                 showmaskbg(false); | ||||
|                             }, function (err) { | ||||
|                                 showmaskbg(false); | ||||
|                             }); | ||||
|                         } | ||||
|                     }; | ||||
|                 } | ||||
|                 else if (col.name === "Delete") { | ||||
|                     col.isurl = true; | ||||
|                     col.text = "\uf00d"; | ||||
|                     col.sortable = false; | ||||
|                     col.events = { | ||||
|                         onclick: function () { | ||||
|                             OnDelete(this); | ||||
|                         } | ||||
|                     }; | ||||
|                     col.classFilter = function (e) { | ||||
|                         return "icon-col"; | ||||
|                     }; | ||||
|                     col.styleFilter = function (e) { | ||||
|                         return { | ||||
|                             display: (e.InUse) ? 'none' : '' | ||||
|                         }; | ||||
|                     }; | ||||
|                     col.attrs = { 'title': GetTextByKey("P_WOS_DELETE", 'Delete') }; | ||||
|                 } | ||||
|                 columns.push(col); | ||||
|             } | ||||
|             grid_dt.canMultiSelect = false; | ||||
|             grid_dt.columns = columns; | ||||
|             grid_dt.init(); | ||||
|             grid_dt.rowdblclick = OnEdit; | ||||
|  | ||||
|             grid_dt.selectedrowchanged = function (rowindex) { | ||||
|                 var rowdata = grid_dt.source[rowindex]; | ||||
|                 if (rowdata) { | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|  | ||||
|         $(function () { | ||||
|             setPageTitle(GetTextByKey("P_WORKORDERSURVEYTEMPLATES", "Work Order Survey Templates"), true); | ||||
|             InitGridData(); | ||||
|             OnRefresh(); | ||||
|  | ||||
|             $('#searchinputtxt').keydown(searchEnter); | ||||
|             $(window).resize(function () { | ||||
|                 $("#surveylist").css("height", $(window).height() - $("#surveylist").offset().top - 4); | ||||
|                 grid_dt && grid_dt.resize(); | ||||
|             }).resize(); | ||||
|  | ||||
|         }); | ||||
|  | ||||
|         function searchEnter(e) { | ||||
|             if (e.keyCode == 13 || e.keyCode == 9) { | ||||
|                 OnRefresh(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         function OnExport() { | ||||
|             var searchtxt = ""; | ||||
|             searchtxt = htmlencode($.trim($('#searchinputtxt').val())); | ||||
|  | ||||
|             window.open("../ExportToFile.aspx?type=custrecord&t=" + searchtxt); | ||||
|         } | ||||
|     </script> | ||||
| </asp:Content> | ||||
| <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> | ||||
|     <div style="min-width: 400px;"> | ||||
|         <div class="page_title" data-lgid="P_WORKORDERSURVEYTEMPLATES">Work Order Survey Templates</div> | ||||
|         <div class="search_bar"> | ||||
|             <input type="password" autocomplete="new-password" style="display: none" /> | ||||
|             <input type="text" id="searchinputtxt" autocomplete="off" /> | ||||
|             <input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_CM_SEARCH" style="margin-left: 5px;" /> | ||||
|         </div> | ||||
|         <div class="function_title"> | ||||
|             <span class="sbutton iconadd" onclick="OnAdd();" data-lgid="P_UM_ADD">Add</span> | ||||
|             <span class="sbutton iconedit" onclick="OnEdit();" data-lgid="P_UM_EDIT">Edit</span> | ||||
|             <span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_UM_REFRESH">Refresh</span> | ||||
|             <%--<span class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span>--%> | ||||
|         </div> | ||||
|         <div class="clear"></div> | ||||
|         <div id="surveylist"></div> | ||||
|  | ||||
|         <div id="mask_bg" style="display: none;"> | ||||
|             <div class="loading c-spin"></div> | ||||
|         </div> | ||||
|         <div class="dialog" id="dialog_survey" style="display: none; height: 100%; border-bottom: 0; border-top: 0;"> | ||||
|             <iframe id="iframesurveytemplate" src="AddSurveyTemplate.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe> | ||||
|             <div class="maskbg" style="display: none;"></div> | ||||
|         </div> | ||||
|     </div> | ||||
| </asp:Content> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user