3 lines
85 KiB
JavaScript
3 lines
85 KiB
JavaScript
!function e(t,a,l){function n(o,r){if(!a[o]){if(!t[o]){var s="function"==typeof require&&require;if(!r&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=a[o]={exports:{}};t[o][0].call(u.exports,(function(e){return n(t[o][1][e]||e)}),u,u.exports,e,t,a,l)}return a[o].exports}for(var i="function"==typeof require&&require,o=0;o<l.length;o++)n(l[o]);return n}({1:[function(e,t,a){"use strict";var l=o(e("../../../api/AdapterBase")),n=o(e("../../../api/CustomFieldAdapter")),i=o(e("../../../api/ApproveAdminAdapter"));function o(e){return e&&e.__esModule?e:{default:e}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function u(e,t,a){return t&&c(e.prototype,t),a&&c(e,a),e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=m(e);if(t){var n=m(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return h(this,a)}}function h(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){d(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return u(a,[{key:"getDataMapping",value:function(){return["id","name","details","required","alert_on_missing","alert_before_expiry"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Details"},{sTitle:"Compulsory"},{sTitle:"Alert If Not Found"},{sTitle:"Alert Before Expiry"}]}},{key:"getFormFields",value:function(){for(var e=[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["details",{label:"Details",type:"textarea",validation:"none"}],["required",{label:"Compulsory",type:"select",source:[["No","No"],["Yes","Yes"]]}],["alert_on_missing",{label:"Alert If Not Found",type:"select",source:[["No","No"],["Yes","Yes"]]}],["alert_before_expiry",{label:"Alert Before Expiry",type:"select",source:[["No","No"],["Yes","Yes"]]}],["alert_before_day_number",{label:"Days for Expiry Alert",type:"text",validation:""}]],t=0;t<this.customFields.length;t++)e.push(this.customFields[t]);return e}}]),a}(l.default),y=function(e){d(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return u(a,[{key:"getDataMapping",value:function(){return["id","employee","document","documentname","valid_until","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Document"},{sTitle:"Document Id"},{sTitle:"Valid Until"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2","remote-source":["Employee","id","first_name+last_name"]}],["document",{label:"Document",type:"select2","remote-source":["ImmigrationDocument","id","name"]}],["documentname",{label:"Document Id",type:"text",validation:""}],["valid_until",{label:"Valid Until",type:"date",validation:"none"}],["status",{label:"Status",type:"select",source:[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],["details",{label:"Details",type:"textarea",validation:"none"}],["attachment1",{label:"Attachment 1",type:"fileupload",validation:"none"}],["attachment2",{label:"Attachment 2",type:"fileupload",validation:"none"}],["attachment3",{label:"Attachment 3",type:"fileupload",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2","remote-source":["Employee","id","first_name+last_name"]}]]}}]),a}(l.default),g=function(e){d(a,e);var t=p(a);function a(e,l,n,i){var o;return s(this,a),(o=t.call(this,e,l,n,i)).itemName="TravelRequest",o.itemNameLower="travelrequest",o.modulePathName="travel",o}return u(a,[{key:"getDataMapping",value:function(){return["id","employee","type","purpose","travel_from","travel_to","travel_date","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Travel Type"},{sTitle:"Purpose"},{sTitle:"From"},{sTitle:"To"},{sTitle:"Travel Date"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return this.addCustomFields([["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["type",{label:"Means of Transportation",type:"select",source:[["Plane","Plane"],["Rail","Rail"],["Taxi","Taxi"],["Own Vehicle","Own Vehicle"],["Rented Vehicle","Rented Vehicle"],["Other","Other"]]}],["purpose",{label:"Purpose of Travel",type:"textarea",validation:""}],["travel_from",{label:"Travel From",type:"text",validation:""}],["travel_to",{label:"Travel To",type:"text",validation:""}],["travel_date",{label:"Travel Date",type:"datetime",validation:""}],["return_date",{label:"Return Date",type:"datetime",validation:""}],["details",{label:"Notes",type:"textarea",validation:"none"}],["currency",{label:"Currency",type:"select2","allow-null":!1,"remote-source":["CurrencyType","id","code"]}],["funding",{label:"Total Funding Proposed",type:"text",validation:"float",default:"0.00",mask:"9{0,10}.99"}],["attachment1",{label:"Attachment",type:"fileupload",validation:"none"}],["attachment2",{label:"Attachment",type:"fileupload",validation:"none"}],["attachment3",{label:"Attachment",type:"fileupload",validation:"none"}]])}}]),a}(i.default);t.exports={ImmigrationDocumentAdapter:v,EmployeeImmigrationAdapter:y,EmployeeTravelRecordAdminAdapter:g,CustomFieldAdapter:n.default}},{"../../../api/AdapterBase":3,"../../../api/ApproveAdminAdapter":4,"../../../api/CustomFieldAdapter":6}],2:[function(e,t,a){"use strict";function l(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,a,n;return t=e,(a=[{key:"getKey",value:function(e,t){var a="".concat(e,"|");for(var l in t)a+="".concat(l,"=").concat(t[l],"|");return a}},{key:"invalidateTable",value:function(e){for(var t,a=0;a<localStorage.length;a++)(t=localStorage.key(a)).indexOf("t=".concat(e))>0&&localStorage.removeItem(t)}},{key:"getData",value:function(e){var t;if("undefined"==typeof Storage)return null;var a=localStorage.getItem(e);return void 0!==a&&null!=a&&""!==a?void 0===(t=JSON.parse(a))||null==t||void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status?null:t:null}},{key:"setData",value:function(e,t){if("undefined"==typeof Storage)return null;if(void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status)return null;var a=JSON.stringify(t);return localStorage.setItem(e,a),a}}])&&l(t.prototype,a),n&&l(t,n),e}();a.default=n},{}],3:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l=i(e("./ModuleBase")),n=i(e("../api-common/RequestCache"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=d(e);if(t){var n=d(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return u(this,a)}}function u(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,e);var t,a,l,i=c(o);function o(e,t,a,l){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=i.call(this)).moduleRelativeURL=null,n.tableData=[],n.sourceData=[],n.filter=null,n.origFilter=null,n.orderBy=null,n.currentElement=null,n.initAdapter(e,t,a,l),n}return t=o,(a=[{key:"initAdapter",value:function(e,t,a,l){this.moduleRelativeURL=baseUrl,this.table=e,this.tab=null==t?e:t,this.filter=null==a?null:a,this.origFilter=this.filter,this.orderBy=null==l?null:l,this.trackEvent("initAdapter",t),this.requestCache=new n.default}},{key:"setFilter",value:function(e){this.filter=e}},{key:"preSetFilterExternal",value:function(e){this.initialFilter=e}},{key:"setFilterExternal",value:function(e){var t=e;null==t&&(t=this.initialFilter),null!=t&&(this.setFilter(t),this.filtersAlreadySet=!0,$("#".concat(this.getTableName(),"_resetFilters")).show(),this.currentFilterString=this.getFilterString(t))}},{key:"getFilter",value:function(){return this.filter}},{key:"setOrderBy",value:function(e){this.orderBy=e}},{key:"getOrderBy",value:function(){return this.orderBy}},{key:"add",value:function(e,t,a,l){var n=this;null==a&&(a=!0),$(e).attr("a","add"),$(e).attr("t",this.table),n.showLoader(),this.requestCache.invalidateTable(this.table),$.post(this.moduleRelativeURL,e,(function(e){"SUCCESS"===e.status?n.addSuccessCallBack(t,e.object,a,l,n):n.addFailCallBack(t,e.object)}),"json").always((function(){n.hideLoader()})),this.trackEvent("add",this.tab,this.table)}},{key:"addSuccessCallBack",value:function(e,t,a,l,n){a&&this.get(e),this.initFieldMasterData(),null!=l&&l.apply(n,[t]),this.trackEvent("addSuccess",this.tab,this.table)}},{key:"addFailCallBack",value:function(e,t){try{this.closePlainMessage()}catch(e){}this.showMessage("Error saving",t),this.trackEvent("addFailed",this.tab,this.table)}},{key:"deleteObj",value:function(e,t){var a=this;a.showLoader(),this.requestCache.invalidateTable(this.table),$.post(this.moduleRelativeURL,{t:this.table,a:"delete",id:e},(function(e){"SUCCESS"===e.status?a.deleteSuccessCallBack(t,e.object):a.deleteFailCallBack(t,e.object)}),"json").always((function(){a.hideLoader()})),this.trackEvent("delete",this.tab,this.table)}},{key:"deleteSuccessCallBack",value:function(e,t){this.get(e),this.clearDeleteParams()}},{key:"deleteFailCallBack",value:function(e,t){this.clearDeleteParams(),this.showMessage("Error Occurred while Deleting Item",t)}},{key:"get",value:function(e){var t=this;if(this.getRemoteTable())return this.createTableServer(this.getTableName()),$("#".concat(this.getTableName(),"Form")).hide(),void $("#".concat(this.getTableName())).show();var a=JSON.stringify(this.getSourceMapping()),l="";null!==this.getFilter()&&(l=JSON.stringify(this.getFilter()));var n="";null!==this.getOrderBy()&&(n=this.getOrderBy()),a=this.fixJSON(a),l=this.fixJSON(l),t.showLoader(),$.post(this.moduleRelativeURL,{t:this.table,a:"get",sm:a,ft:l,ob:n},(function(a){"SUCCESS"===a.status?t.getSuccessCallBack(e,a.object):t.getFailCallBack(e,a.object)}),"json").always((function(){t.hideLoader()})),t.initFieldMasterData(),this.trackEvent("get",this.tab,this.table)}},{key:"getDataUrl",value:function(e){var t=JSON.stringify(this.getSourceMapping()),a=JSON.stringify(e),l="";null!==this.getFilter()&&(l=JSON.stringify(this.getFilter()));var n="";null!==this.getOrderBy()&&(n=this.getOrderBy());var i=this.moduleRelativeURL.replace("service.php","data.php");return i="".concat(i,"?t=").concat(this.table),i="".concat(i,"&sm=").concat(this.fixJSON(t)),i="".concat(i,"&cl=").concat(this.fixJSON(a)),i="".concat(i,"&ft=").concat(this.fixJSON(l)),i="".concat(i,"&ob=").concat(n),this.isSubProfileTable()&&(i="".concat(i,"&type=sub")),this.remoteTableSkipProfileRestriction()&&(i="".concat(i,"&skip=1")),i}},{key:"isSubProfileTable",value:function(){return!1}},{key:"remoteTableSkipProfileRestriction",value:function(){return!1}},{key:"preProcessTableData",value:function(e){return e}},{key:"getSuccessCallBack",value:function(e,t){for(var a=[],l=this.getDataMapping(),n=0;n<t.length;n++){for(var i=[],o=0;o<l.length;o++)i[o]=t[n][l[o]];a.push(this.preProcessTableData(i))}this.sourceData=t,void 0!==e.callBack&&null!==e.callBack&&(void 0!==e.callBackData&&null!==e.callBackData||(e.callBackData=[]),e.callBackData.push(t),e.callBackData.push(a),this.callFunction(e.callBack,e.callBackData)),this.tableData=a,void 0!==e.noRender&&null!==e.noRender&&!0===e.noRender||(this.createTable(this.getTableName()),$("#".concat(this.getTableName(),"Form")).hide(),$("#".concat(this.getTableName())).show())}},{key:"getFailCallBack",value:function(e,t){}},{key:"getElement",value:function(e,t,a){var l=this,n=JSON.stringify(this.getSourceMapping());n=this.fixJSON(n),l.showLoader(),$.post(this.moduleRelativeURL,{t:this.table,a:"getElement",id:e,sm:n},(function(e){"SUCCESS"===e.status?(a&&delete e.object.id,this.currentElement=e.object,l.getElementSuccessCallBack.apply(l,[t,e.object])):l.getElementFailCallBack.apply(l,[t,e.object])}),"json").always((function(){l.hideLoader()})),this.trackEvent("getElement",this.tab,this.table)}},{key:"getElementSuccessCallBack",value:function(e,t){void 0!==e.callBack&&null!==e.callBack&&(void 0!==e.callBackData&&null!==e.callBackData||(e.callBackData=[]),e.callBackData.push(t),this.callFunction(e.callBack,e.callBackData,this)),this.currentElement=t,void 0!==e.noRender&&null!==e.noRender&&!0===e.noRender||this.renderForm(t)}},{key:"getElementFailCallBack",value:function(e,t){}},{key:"getTableData",value:function(){return this.tableData}},{key:"getTableName",value:function(){return this.tab}},{key:"getFieldValues",value:function(e,t){var a=this,l="",n="";void 0!==e[3]&&null!==e[3]&&(l=e[3]),void 0!==e[4]&&null!==e[4]&&(n=JSON.stringify(e[4]));var i=this.requestCache.getKey(this.moduleRelativeURL,{t:e[0],key:e[1],value:e[2],method:l,methodParams:n,a:"getFieldValues"}),o=this.requestCache.getData(i);null!=o&&"SUCCESS"===o.status&&(t.callBackData.push(o.data),null!==t.callBackSuccess&&void 0!==t.callBackSuccess&&t.callBackData.push(t.callBackSuccess),a.callFunction(t.callBack,t.callBackData));var r=function e(l){if("SUCCESS"===l.status){a.requestCache.setData(this.success.key,l);var n=t;n.callBackData=[t.callBackData[0]],n.callBackData.push(l.data),null!==n.callBackSuccess&&void 0!==n.callBackSuccess&&n.callBackData.push(t.callBackSuccess),a.callFunction(n.callBack,n.callBackData)}else"Access violation"===l.message&&alert("Error : ".concat(e.table," ").concat(l.message))};r.key=i,r.table=e[0],$.post(this.moduleRelativeURL,{t:e[0],key:e[1],value:e[2],method:l,methodParams:n,a:"getFieldValues"},r,"json")}},{key:"setAdminProfile",value:function(e){try{localStorage.clear()}catch(e){}$.post(this.moduleRelativeURL,{a:"setAdminEmp",empid:e},(function(){top.location.href=clientUrl}),"json")}},{key:"customAction",value:function(e,t,a,l,n){var i=this;a=this.fixJSON(a),n?$.post(this.moduleRelativeURL,{t:this.table,a:"ca",sa:e,mod:t,req:a},(function(e){"SUCCESS"===e.status?(l.callBackData.push(e.data),i.callFunction(l.callBackSuccess,l.callBackData)):(l.callBackData.push(e.data),i.callFunction(l.callBackFail,l.callBackData))}),"json"):$.getJSON(this.moduleRelativeURL,{t:this.table,a:"ca",sa:e,mod:t,req:a},(function(e){"SUCCESS"===e.status?(l.callBackData.push(e.data),i.callFunction(l.callBackSuccess,l.callBackData)):(l.callBackData.push(e.data),i.callFunction(l.callBackFail,l.callBackData))}))}},{key:"sendCustomRequest",value:function(e,t,a,l){t.a=e,$.post(this.moduleRelativeURL,t,(function(e){"SUCCESS"===e.status?a(e.data):l(e.data)}),"json")}},{key:"getCustomActionUrl",value:function(e,t){t.a=e;var a="";for(var l in t)t.hasOwnProperty(l)&&(""!==a&&(a+="&"),a+="".concat(l,"=").concat(t[l]));return"".concat(this.moduleRelativeURL,"?").concat(a)}},{key:"getClientDataUrl",value:function(){return"".concat(this.moduleRelativeURL.replace("service.php",""),"data/")}},{key:"getCustomUrl",value:function(e){return this.moduleRelativeURL.replace("service.php",e)}}])&&r(t.prototype,a),l&&r(t,l),o}(l.default);a.default=f},{"../api-common/RequestCache":2,"./ModuleBase":9}],4:[function(e,t,a){"use strict";var l;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function r(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=c(e);if(t){var n=c(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return s(this,a)}}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,e);var t,a,l,n=r(s);function s(e,t,a,l){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),n.call(this,e,t,a,l)}return t=s,(a=[{key:"getStatusFieldPosition",value:function(){return this.getDataMapping().length-1}},{key:"openStatus",value:function(e,t){$("#".concat(this.itemNameLower,"StatusModel")).modal("show"),$("#".concat(this.itemNameLower,"_status")).html(this.getStatusOptions(t)),$("#".concat(this.itemNameLower,"_status")).val(t),this.statusChangeId=e}},{key:"closeDialog",value:function(){$("#".concat(this.itemNameLower,"StatusModel")).modal("hide")}},{key:"changeStatus",value:function(){var e=$("#".concat(this.itemNameLower,"_status")).val(),t=$("#".concat(this.itemNameLower,"_reason")).val();if(null!=e&&null!=e&&""!=e){var a={id:this.statusChangeId,status:e,reason:t},l=JSON.stringify(a),n=[];n.callBackData=[],n.callBackSuccess="changeStatusSuccessCallBack",n.callBackFail="changeStatusFailCallBack",this.customAction("changeStatus","admin=".concat(this.modulePathName),l,n),this.closeDialog(),this.statusChangeId=null}else this.showMessage("Error","Please select ".concat(this.itemNameLower," status"))}},{key:"changeStatusSuccessCallBack",value:function(e){this.showMessage("Successful","".concat(this.itemName," Request status changed successfully")),this.get([])}},{key:"changeStatusFailCallBack",value:function(e){this.showMessage("Error","Error occurred while changing ".concat(this.itemName," request status"))}},{key:"getActionButtonsHtml",value:function(e,t){var a='<div style="width:120px;">_edit__delete__status__logs_</div>',l=this.getStatusOptionsData(t[this.getStatusFieldPosition()]);return a=(a=Object.keys(l).length>0?a.replace("_status_",'<img class="tableActionButton" src="_BASE_images/run.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Change Status" onclick="modJs.openStatus(_id_, \'_cstatus_\');return false;"></img>'):a.replace("_status_","")).replace("_logs_",'<img class="tableActionButton" src="_BASE_images/log.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="View Logs" onclick="modJs.getLogs(_id_);return false;"></img>'),a=this.showDelete?a.replace("_delete_",'<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>'):a.replace("_delete_",""),a=(a=(a=(a=this.showEdit?a.replace("_edit_",'<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>'):a.replace("_edit_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)).replace(/_cstatus_/g,t[this.getStatusFieldPosition()])}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}},{key:"getStatusOptionsData",value:function(e){var t={};return"Approved"==e||("Pending"==e?(t.Approved="Approved",t.Rejected="Rejected"):"Rejected"==e||"Cancelled"==e||"Processing"==e||(t["Cancellation Requested"]="Cancellation Requested",t.Cancelled="Cancelled")),t}},{key:"getStatusOptions",value:function(e){return this.generateOptions(this.getStatusOptionsData(e))}}])&&i(t.prototype,a),l&&i(t,l),s}(((l=e("./LogViewAdapter"))&&l.__esModule?l:{default:l}).default);a.default=u},{"./LogViewAdapter":8}],5:[function(e,t,a){"use strict";var l;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=u(e);if(t){var n=u(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return c(this,a)}}function c(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(c,e);var t,a,l,n=s(c);function c(){return i(this,c),n.apply(this,arguments)}return t=c,(a=[{key:"cancelRequest",value:function(e){var t={};t.id=e;var a=JSON.stringify(t),l=[];l.callBackData=[],l.callBackSuccess="cancelSuccessCallBack",l.callBackFail="cancelFailCallBack",this.customAction("cancel","modules=".concat(this.modulePathName),a,l)}},{key:"cancelSuccessCallBack",value:function(e){this.showMessage("Successful","".concat(this.itemName," cancellation request sent")),this.get([])}},{key:"cancelFailCallBack",value:function(e){this.showMessage("Error Occurred while cancelling ".concat(this.itemName),e)}},{key:"getActionButtonsHtml",value:function(e,t){var a='<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Cancel '.concat(this.itemName,'" onclick="modJs.cancelRequest(_id_);return false;"></img>'),l='<div style="width:120px;">_edit__logs__delete_</div>';return l=l.replace("_logs_",'<img class="tableActionButton" src="_BASE_images/log.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="View Logs" onclick="modJs.getLogs(_id_);return false;"></img>'),l=this.showDelete?"Approved"===t[7]?l.replace("_delete_",a):"Pending"===t[7]||"Admin"===this.user.user_level?l.replace("_delete_",'<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>'):l.replace("_delete_",""):l.replace("_delete_",""),l=(l=(l=this.showEdit?l.replace("_edit_",'<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>'):l.replace("_edit_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}}])&&o(t.prototype,a),l&&o(t,l),c}(((l=e("./LogViewAdapter"))&&l.__esModule?l:{default:l}).default);a.default=d},{"./LogViewAdapter":8}],6:[function(e,t,a){"use strict";var l;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function r(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=c(e);if(t){var n=c(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return s(this,a)}}function s(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,e);var t,a,l,n=r(s);function s(e,t,a,l){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(i=n.call(this,e,t,a,l)).tableType="",i}return t=s,(a=[{key:"getDataMapping",value:function(){return["id","name","display","display_order"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Display Status"},{sTitle:"Priority"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["display",{label:"Display Status",type:"select",source:[["Form","Show"],["Hidden","Hidden"]]}],["field_type",{label:"Field Type",type:"select",source:[["text","Text Field"],["textarea","Text Area"],["select","Select"],["select2","Select2"],["select2multi","Multi Select"],["fileupload","File Upload"],["date","Date"],["datetime","Date Time"],["time","Time"]]}],["field_label",{label:"Field Label",type:"text",validation:""}],["field_validation",{label:"Validation",type:"select2",validation:"none",sort:"none","null-label":"Required","allow-null":!0,source:[["none","None"],["number","Number"],["numberOrEmpty","Number or Empty"],["float","Decimal"],["email","Email"],["emailOrEmpty","Email or Empty"]]}],["field_options",{label:"Field Options",type:"datagroup",form:[["label",{label:"Label",type:"text",validation:""}],["value",{label:"Value",type:"text",validation:"none"}]],html:'<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">#_label_#</span>:#_value_#</div></div>',validation:"none"}],["display_order",{label:"Priority",type:"text",validation:"number"}],["display_section",{label:"Display Section",type:"text",validation:"none"}]]}},{key:"setTableType",value:function(e){this.tableType=e}},{key:"doCustomValidation",value:function(e){var t;return null!=(t=e.name)&&/^[a-z][a-z0-9._]+$/.test(t)?null:"Invalid name for custom field"}},{key:"forceInjectValuesBeforeSave",value:function(e){var t,a=[e.name],l=[];if(a.push({}),a[1].label=e.field_label,a[1].type=e.field_type,a[1].validation=e.field_validation,["select","select2","select2multi"].indexOf(e.field_type)>=0){for(var n in t=""===e.field_options||void 0===e.field_options?[]:JSON.parse(e.field_options))l.push([t[n].value,t[n].label]);a[1].source=l}return null!=e.field_validation&&void 0!==e.field_validation||(e.field_validation=""),e.data=JSON.stringify(a),e.type=this.tableType,e}}])&&i(t.prototype,a),l&&i(t,l),s}(((l=e("./AdapterBase"))&&l.__esModule?l:{default:l}).default);a.default=u},{"./AdapterBase":3}],7:[function(e,t,a){"use strict";function l(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n={float:function(e){return!(null==e||!e.match(/^[-+]?[0-9]+(\.[0-9]+)?$/))},number:function(e){return!(null==e||!e.match(/^[0-9]+$/))},numberOrEmpty:function(e){if(""===e)return!0;return!(null==e||!e.match(/^[0-9]+$/))},email:function(e){return null!=e&&/^\s*[\w\-+_]+(\.[\w\-+_]+)*@[\w\-+_]+\.[\w\-+_]+(\.[\w\-+_]+)*\s*$/.test(e)},emailOrEmpty:function(e){if(""===e)return!0;return null!=e&&/^\s*[\w\-+_]+(\.[\w\-+_]+)*@[\w\-+_]+\.[\w\-+_]+(\.[\w\-+_]+)*\s*$/.test(e)},username:function(e){return null!=e&&/^[a-zA-Z0-9.-]+$/.test(e)},input:function(e){return null!=e&&e.length>0}},i=function(){function e(t,a,l){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tempOptions={},this.formId=t,this.formError=!1,this.formObject=null,this.errorMessages="",this.popupDialog=null,this.validateAll=a,this.errorMap=[],this.settings={thirdPartyPopup:null,LabelErrorClass:!1,ShowPopup:!0},this.settings=jQuery.extend(this.settings,l),this.inputTypes=["text","radio","checkbox","file","password","select-one","select-multi","textarea","fileupload","signature"],this.validator=n}var t,a,i;return t=e,a=[{key:"clearError",value:function(e,t){var a=e.attr("id");$("#".concat(this.formId," #field_").concat(a)).removeClass("error"),$("#".concat(this.formId," #help_").concat(a)).html("")}},{key:"addError",value:function(e,t){this.formError=!0,null!=e.attr("message")?(this.errorMessages+="".concat(e.attr("message"),"\n"),this.errorMap[e.attr("name")]=e.attr("message")):this.errorMap[e.attr("name")]="";var a=e.attr("id"),l=e.attr("validation"),n=e.attr("validation");$("#".concat(this.formId," #field_").concat(a)).addClass("error"),void 0===n||null==n||""===n?$("#".concat(this.formId," #help_err_").concat(a)).html(n):void 0===l||null==l||""===l?$("#".concat(this.formId," #help_err_").concat(a)).html("Required"):"float"===l||"number"===l?$("#".concat(this.formId," #help_err_").concat(a)).html("Number required"):"email"===l?$("#".concat(this.formId," #help_err_").concat(a)).html("Email required"):$("#".concat(this.formId," #help_err_").concat(a)).html("Required")}},{key:"showErrors",value:function(){this.formError&&(void 0!==this.settings.thirdPartyPopup&&null!=this.settings.thirdPartyPopup?this.settings.thirdPartyPopup.alert():!0===this.settings.ShowPopup&&(void 0!==this.tempOptions.popupTop&&null!=this.tempOptions.popupTop?this.alert("Errors Found",this.errorMessages,this.tempOptions.popupTop):this.alert("Errors Found",this.errorMessages,-1)))}},{key:"checkValues",value:function(e){this.tempOptions=e;var t=this;this.formError=!1,this.errorMessages="",this.formObject={};var a=function(e){var a=null,l=e.attr("name");!1!==t.settings.LabelErrorClass&&$("label[for='".concat(l,"']")).removeClass(t.settings.LabelErrorClass);var n=e.attr("id"),i=e.attr("type");if(e.hasClass("select2-focusser")||e.hasClass("select2-input"))return!0;if(jQuery.inArray(i,t.inputTypes)>=0){if(e.hasClass("uploadInput"))a=e.attr("val");else if("radio"===i||"checkbox"===i)a=$("input[name='".concat(l,"']:checked")).val();else if(e.hasClass("select2Field"))a=null!=$("#".concat(t.formId," #").concat(n)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(n)).select2("data")?$("#".concat(t.formId," #").concat(n)).select2("data").id:"";else if(e.hasClass("select2Multi"))if(null!=$("#".concat(t.formId," #").concat(n)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(n)).select2("data")){var o=$("#".concat(t.formId," #").concat(n)).select2("data");a=[];for(var r=0;r<o.length;r++)a.push(o[r].id);a=JSON.stringify(a)}else a="";else a=e.hasClass("signatureField")?$("#".concat(t.formId," #").concat(n)).data("signaturePad").isEmpty()?"":$("#".concat(n)).data("signaturePad").toDataURL():e.hasClass("simplemde")?$("#".concat(t.formId," #").concat(n)).data("simplemde").value():e.hasClass("code")?$("#".concat(t.formId," #").concat(n)).data("codemirror").getValue():e.hasClass("tinymce")?tinyMCE.get(n).getContent({format:"raw"}):e.val();var s=e.attr("validation"),c=!1;void 0!==s&&null!=s&&void 0!==t.validator[s]&&null!=t.validator[s]?c=t.validator[s](a):(c=!t.validateAll||void 0!==s&&null!=s&&"none"===s||t.validator.input(a),t.formObject[n]=a),c?(t.clearError(e,null),t.formObject[n]=a):t.addError(e,null)}},l=$("#".concat(this.formId," :input"));return l.each((function(){a($(this))})),(l=$("#".concat(this.formId," .uploadInput"))).each((function(){a($(this))})),this.showErrors(),this.tempOptions={},!this.formError}},{key:"getFormParameters",value:function(){return this.formObject}},{key:"alert",value:function(e){function t(t,a){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){alert(t)}))}],i=[{key:"getValidationRules",value:function(){return n}}],a&&l(t.prototype,a),i&&l(t,i),e}();a.default=i},{}],8:[function(e,t,a){"use strict";var l;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=u(e);if(t){var n=u(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return c(this,a)}}function c(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(c,e);var t,a,l,n=s(c);function c(){return i(this,c),n.apply(this,arguments)}return t=c,(a=[{key:"getLogs",value:function(e){var t={id:e},a=JSON.stringify(t),l=[];l.callBackData=[],l.callBackSuccess="getLogsSuccessCallBack",l.callBackFail="getLogsFailCallBack",this.customAction("getLogs","admin=".concat(this.modulePathName),a,l)}},{key:"getLogsSuccessCallBack",value:function(e){for(var t='<table class="table table-condensed table-bordered table-striped" style="font-size:14px;"><thead><tr><th>Notes</th></tr></thead><tbody>_days_</tbody></table> ',a=e.data,l="",n="",i=0;i<a.length;i++){var o='<tr><td><span class="logTime label label-default">_date_</span> <b>_status_</b><br/>_note_</td></tr>';n+=o=(o=(o=o.replace(/_date_/g,a[i].time)).replace(/_status_/g,"".concat(a[i].status_from," -> ").concat(a[i].status_to))).replace(/_note_/g,a[i].note)}""!==n&&(l+=t=t.replace("_days_",n)),this.showMessage("Logs",l),timeUtils.convertToRelativeTime($(".logTime"))}},{key:"getLogsFailCallBack",value:function(e){this.showMessage("Error","Error occured while getting data")}}])&&o(t.prototype,a),l&&o(t,l),c}(((l=e("./AdapterBase"))&&l.__esModule?l:{default:l}).default);a.default=d},{"./AdapterBase":3}],9:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l,n=(l=e("./FormValidation"))&&l.__esModule?l:{default:l};function i(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.deleteParams={},this.createRemoteTable=!1,this.instanceId="None",this.ga=[],this.showEdit=!0,this.showDelete=!0,this.showSave=!0,this.showCancel=!0,this.showFormOnPopup=!1,this.filtersAlreadySet=!1,this.currentFilterString="",this.sorting=0,this.settings={},this.translations={},this.customFields=[],this.csrfRequired=!1,this.fieldTemplates=null,this.templates=null,this.customTemplates=null,this.emailTemplates=null,this.fieldMasterData=null,this.fieldMasterDataKeys=null,this.fieldMasterDataCallback=null,this.sourceMapping=null,this.currentId=null,this.currentElement=null,this.user=null,this.currentProfile=null,this.permissions={},this.baseUrl=null}var t,a,l;return t=e,(a=[{key:"init",value:function(e,t,a,l){}},{key:"setNoJSONRequests",value:function(e){this.noJSONRequests=e}},{key:"setPermissions",value:function(e){this.permissions=e}},{key:"sortingStarted",value:function(e){this.sorting=e}},{key:"checkPermission",value:function(e){return void 0===this.permissions[e]||null==this.permissions[e]||"Yes"===this.permissions[e]?"Yes":this.permissions[e]}},{key:"setBaseUrl",value:function(e){this.baseUrl=e}},{key:"setUser",value:function(e){this.user=e}},{key:"getUser",value:function(){return this.user}},{key:"setInstanceId",value:function(e){this.instanceId=e}},{key:"setCSRFRequired",value:function(e){this.csrfRequired=e}},{key:"scrollToTop",value:function(){$("html, body").animate({scrollTop:0},"fast")}},{key:"scrollToBottom",value:function(){$("html, body").animate({scrollTop:$(document).height()},"slow")}},{key:"scrollToElement",value:function(e){$(window).height()<=e.offset().top&&$("html, body").animate({scrollTop:e.offset().top},"slow")}},{key:"scrollToElementBottom",value:function(e){$(window).height()<=e.offset().top+e.height()&&$("html, body").animate({scrollTop:e.offset().top+e.height()},"slow")}},{key:"setTranslations",value:function(e){this.translations=e.messages[""]}},{key:"setTranslationsSubModules",value:function(e){this.translations=e}},{key:"gt",value:function(e){return void 0===this.translations[e]||null===this.translations[e]?e:this.translations[e][0]}},{key:"addToLangTerms",value:function(e){var t,a=localStorage.getItem("terms");if(void 0===a)t={};else try{t=JSON.parse(a)}catch(e){t={}}void 0===this.translations[e]&&(t[e]=e,localStorage.setItem("terms",JSON.stringify(t)))}},{key:"showActionButtons",value:function(){return!0}},{key:"trackEvent",value:function(e,t,a){try{void 0===t||null==t?this.ga.push(["_trackEvent",this.instanceId,e]):void 0===a||null==a?this.ga.push(["_trackEvent",this.instanceId,e,t]):this.ga.push(["_trackEvent",this.instanceId,e,t,a])}catch(e){}}},{key:"setCurrentProfile",value:function(e){this.currentProfile=e}},{key:"getCurrentProfile",value:function(){return this.currentProfile}},{key:"initFieldMasterData",value:function(e,t,a){var l;void 0!==this.showAddNew&&null!=this.showAddNew||(this.showAddNew=!0),this.fieldMasterData={},this.fieldMasterDataKeys={},this.fieldMasterDataCallback=t,this.fieldMasterDataCallbackData=a,this.sourceMapping={};var n=this.getFormFields(),i=this.getFilters();if(null!=i)for(var o=0;o<i.length;o++)(null==(l=this.getMetaFieldValues(i[o][0],n))||"select"!==l.type&&"select2"!==l.type&&"select2multi"!==l.type)&&n.push(i[o]);for(var r=[],s=[],c=null,u=null,d=0;d<n.length;d++)if(void 0!==(c=n[d])[1]["remote-source"]&&null!==c[1]["remote-source"]){var f="".concat(c[1]["remote-source"][0],"_").concat(c[1]["remote-source"][1],"_").concat(c[1]["remote-source"][2]);r.push(c),s.push(f)}else if(void 0!==c[1].form&&null!==c[1].form)for(var p=0;p<c[1].form.length;p++)if(void 0!==(u=c[1].form[p])[1]["remote-source"]&&null!==u[1]["remote-source"]){var h="".concat(u[1]["remote-source"][0],"_").concat(u[1]["remote-source"][1],"_").concat(u[1]["remote-source"][2]);s.indexOf(h)<0&&(r.push(u),s.push(h))}for(var m=0;m<r.length;m++){var v=r[m];if(void 0!==v[1]["remote-source"]&&null!=v[1]["remote-source"]){var y="".concat(v[1]["remote-source"][0],"_").concat(v[1]["remote-source"][1],"_").concat(v[1]["remote-source"][2]);this.fieldMasterDataKeys[y]=!1,this.sourceMapping[v[0]]=v[1]["remote-source"];var g={callBack:"initFieldMasterDataResponse"};g.callBackData=[y],null!=e&&(g.callBackSuccess=e),this.getFieldValues(v[1]["remote-source"],g)}}}},{key:"setShowFormOnPopup",value:function(e){this.showFormOnPopup=e}},{key:"setRemoteTable",value:function(e){this.createRemoteTable=e}},{key:"setSettings",value:function(e){this.settings=e}},{key:"getRemoteTable",value:function(){return this.createRemoteTable}},{key:"isAllLoaded",value:function(e){for(var t in e)if(!1===e[t])return!1;return!0}},{key:"initFieldMasterDataResponse",value:function(e,t,a,l){this.fieldMasterData[e]=t,this.fieldMasterDataKeys[e]=!0,null!=a&&a(),null!==this.fieldMasterDataCallback&&void 0!==this.fieldMasterDataCallback&&this.isAllLoaded(this.fieldMasterDataKeys)&&null!==this.fieldMasterDataCallbackData&&void 0!==this.fieldMasterDataCallbackData?this.fieldMasterDataCallback(this.fieldMasterDataCallbackData):null!==this.fieldMasterDataCallback&&void 0!==this.fieldMasterDataCallback&&this.isAllLoaded(this.fieldMasterDataKeys)&&this.fieldMasterDataCallback()}},{key:"getMetaFieldValues",value:function(e,t){for(var a=0;a<t.length;a++)if(e===t[a][0])return t[a][1];return null}},{key:"getThemeColors",value:function(){return["red","yellow","aqua","blue","light-blue","green","navy","teal","olive","orange","fuchsia","purple"]}},{key:"getColorByRandomString",value:function(e){var t=this.getThemeColors();return t[e.charCodeAt(0)%t.length]}},{key:"getColorByFileType",value:function(e){e=e.toLowerCase();var t={pdf:"red",csv:"yellow",xls:"green",xlsx:"green",doc:"light-blue",docx:"light-blue"};return t.docx="blue",t.ppt="orange",t.pptx="orange",t.jpg="teal",t.jpeg="teal",t.gif="green",t.png="yellow",t.bmp="fuchsia",void 0!==t[e]||null!=t[e]?t[e]:this.getColorByRandomString(e)}},{key:"getIconByFileType",value:function(e){var t={pdf:"fa fa-file-pdf-o",csv:"fa fa fa-file-code-o",xls:"fa fa-file-excel-o",xlsx:"fa fa-file-excel-o",doc:"fa fa-file-word-o",docx:"fa fa-file-word-o",ppt:"fa fa-file-powerpoint-o",pptx:"fa fa-file-powerpoint-o",jpg:"fa fa-file-image-o",jpeg:"fa fa-file-image-o",gif:"fa fa-file-image-o",png:"fa fa-file-image-o",bmp:"fa fa-file-image-o",txt:"fa fa-file-text-o",rtf:"fa fa-file-text-o"};return void 0!==t[e=e.toLowerCase()]||null!=t[e]?t[e]:"fa fa-file-o"}},{key:"getSourceMapping",value:function(){return this.sourceMapping}},{key:"setTesting",value:function(e){this.testing=e}},{key:"consoleLog",value:function(e){this.testing&&console.log(e)}},{key:"setClientMessages",value:function(e){this.msgList=e}},{key:"setTemplates",value:function(e){this.templates=e}},{key:"getWSProperty",value:function(e,t){return e.hasOwnProperty(t)?e[t]:null}},{key:"getClientMessage",value:function(e){return this.getWSProperty(this.msgList,e)}},{key:"getTemplate",value:function(e){return this.getWSProperty(this.templates,e)}},{key:"setGoogleAnalytics",value:function(e){this.gaq=e}},{key:"showView",value:function(e){null!=this.currentView&&(this.previousView=this.currentView,$("#".concat(this.currentView)).hide()),$("#".concat(e)).show(),this.currentView=e,this.moveToTop()}},{key:"showPreviousView",value:function(){this.showView(this.previousView)}},{key:"moveToTop",value:function(){}},{key:"callFunction",value:function(e,t,a){if($.isFunction(e))try{null==a?e.apply(document,t):e.apply(a,t)}catch(e){console.log(e.message)}else{var l=this[e];if($.isFunction(l))try{l.apply(this,t)}catch(e){console.log(e.message)}}}},{key:"getTableTopButtonHtml",value:function(){var e="";return this.getShowAddNew()&&(e='<button onclick="modJs.renderForm();return false;" class="btn btn-small btn-primary">'.concat(this.gt(this.getAddNewLabel()),' <i class="fa fa-plus"></i></button>')),null!=this.getFilters()&&(""!==e&&(e+=" "),e+='<button onclick="modJs.showFilters();return false;" class="btn btn-small btn-primary">'.concat(this.gt("Filter"),' <i class="fa fa-filter"></i></button>'),e+=" ",this.filtersAlreadySet?e+='<button id="__id___resetFilters" onclick="modJs.resetFilters();return false;" class="btn btn-small btn-default">__filterString__ <i class="fa fa-times"></i></button>':e+='<button id="__id___resetFilters" onclick="modJs.resetFilters();return false;" class="btn btn-small btn-default" style="display:none;">__filterString__ <i class="fa fa-times"></i></button>'),e=e.replace(/__id__/g,this.getTableName()),""!==(e=""!==this.currentFilterString&&null!=this.currentFilterString?e.replace(/__filterString__/g,this.currentFilterString):e.replace(/__filterString__/g,"Reset Filters"))&&(e='<div class="row"><div class="col-xs-12">'.concat(e,"</div></div>")),e}},{key:"getActionButtonHeader",value:function(){return{sTitle:"",sClass:"center"}}},{key:"getTableHTMLTemplate",value:function(){return'<div class="box-body table-responsive"><table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="grid"></table></div>'}},{key:"isSortable",value:function(){return!0}},{key:"createTable",value:function(e){if(this.getRemoteTable())this.createTableServer(e);else{var t=this.getHeaders();for(var a in t)t[a].sTitle=this.gt(t[a].sTitle);var l,n=this.getTableData();if(this.showActionButtons()&&t.push(this.getActionButtonHeader()),this.showActionButtons())for(var i=0;i<n.length;i++)n[i].push(this.getActionButtonsHtml(n[i][0],n[i]));l=this.getTableTopButtonHtml()+this.getTableHTMLTemplate();var o=$("#".concat(e," .dataTables_paginate .active a")).html(),r=0;void 0!==o&&null!=o&&(r=15*parseInt(o,10)-15),$("#".concat(e)).html(l);var s={oLanguage:{sLengthMenu:"_MENU_ records per page"},aaData:n,aoColumns:t,bSort:this.isSortable(),iDisplayLength:15,iDisplayStart:r},c=this.getCustomTableParams();$.extend(s,c),$("#".concat(e," #grid")).dataTable(s),$(".dataTables_paginate ul").addClass("pagination"),$(".dataTables_length").hide(),$(".dataTables_filter input").addClass("form-control"),$(".dataTables_filter input").attr("placeholder","Search"),$(".dataTables_filter label").contents().filter((function(){return 3===this.nodeType})).remove(),$(".tableActionButton").tooltip()}}},{key:"createTableServer",value:function(e){var t,a=this.getHeaders();for(var l in a.push({sTitle:"",sClass:"center"}),a)a[l].sTitle=this.gt(a[l].sTitle);t=this.getTableTopButtonHtml()+this.getTableHTMLTemplate();var n=$("#".concat(e," .dataTables_paginate .active a")).html(),i=0;void 0!==n&&null!=n&&(i=15*parseInt(n,10)-15),$("#".concat(e)).html(t);var o={oLanguage:{sLengthMenu:"_MENU_ records per page"},bProcessing:!0,bServerSide:!0,sAjaxSource:this.getDataUrl(this.getDataMapping()),aoColumns:a,bSort:this.isSortable(),parent:this,iDisplayLength:15,iDisplayStart:i};this.showActionButtons()&&(o.aoColumnDefs=[{fnRender:this.getActionButtons,aTargets:[this.getDataMapping().length]}]);var r=this.getCustomTableParams();$.extend(o,r),$("#".concat(e," #grid")).dataTable(o),$(".dataTables_paginate ul").addClass("pagination"),$(".dataTables_length").hide(),$(".dataTables_filter input").addClass("form-control"),$(".dataTables_filter input").attr("placeholder","Search"),$(".dataTables_filter label").contents().filter((function(){return 3===this.nodeType})).remove(),$(".tableActionButton").tooltip()}},{key:"getHeaders",value:function(){}},{key:"getDataMapping",value:function(){}},{key:"getFormFields",value:function(){}},{key:"getTableData",value:function(){}},{key:"getFilters",value:function(){return null}},{key:"edit",value:function(e){this.currentId=e,this.getElement(e,[])}},{key:"copyRow",value:function(e){this.getElement(e,[],!0)}},{key:"renderModel",value:function(e,t,a){$("#".concat(e,"ModelBody")).html(""),void 0!==a&&null!=a||(a=""),$("#".concat(e,"ModelLabel")).html(t),$("#".concat(e,"ModelBody")).html(a)}},{key:"renderYesNoModel",value:function(e,t,a,l,n,i){var o=this,r="#yesnoModel";void 0!==t&&null!=t||(t=""),$("".concat(r,"Label")).html(e),$("".concat(r,"Body")).html(t),null!=a&&$("".concat(r,"YesBtn")).html(a),null!=l&&$("".concat(r,"NoBtn")).html(l),$("".concat(r,"YesBtn")).off().on("click",(function(){void 0!==n&&null!=n&&(n.apply(o,i),o.cancelYesno())})),$(r).modal({backdrop:"static"})}},{key:"renderModelFromDom",value:function(e,t,a){$("#".concat(e,"ModelBody")).html(""),void 0!==a&&null!=a||(a=$("<div></div>")),$("#".concat(e,"ModelLabel")).html(t),$("#".concat(e,"ModelBody")).html(""),$("#".concat(e,"ModelBody")).append(a)}},{key:"deleteRow",value:function(e){this.deleteParams.id=e,this.renderModel("delete","Confirm Deletion","Are you sure you want to delete this item ?"),$("#deleteModel").modal("show")}},{key:"showMessage",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this,o="";o=n?"#plainMessageModel":"#messageModel",$(o).off(),n?this.renderModel("plainMessage",e,t):this.renderModel("message",e,t),null!=a?($(o).modal({show:!0}),$(o).on("hidden.bs.modal",(function(){a.apply(i,l),$(".modal-backdrop").remove()}))):$(o).modal({backdrop:"static"})}},{key:"showDomElement",value:function(e,t,a,l,n){var i=this,o="";o=n?"#dataMessageModel":"#messageModel",$(o).unbind("hide"),n?this.renderModelFromDom("dataMessage",e,t):this.renderModelFromDom("message",e,t),null!=a?($(o).modal({show:!0}),$(o).on("hidden.bs.modal",(function(){a.apply(i,l),$(".modal-backdrop").remove()}))):$(o).modal({backdrop:"static"})}},{key:"confirmDelete",value:function(){void 0===this.deleteParams.id&&null==this.deleteParams.id||this.deleteObj(this.deleteParams.id,[]),$("#deleteModel").modal("hide")}},{key:"cancelDelete",value:function(){$("#deleteModel").modal("hide"),this.deleteParams.id=null}},{key:"closeMessage",value:function(){$("#messageModel").modal("hide")}},{key:"cancelYesno",value:function(){$("#yesnoModel").modal("hide")}},{key:"closePlainMessage",value:function(){$("#plainMessageModel").modal("hide"),$("#dataMessageModel").modal("hide")}},{key:"closeDataMessage",value:function(){$("#dataMessageModel").modal("hide")}},{key:"save",value:function(e,t){var a=new n.default("".concat(this.getTableName(),"_submit"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(a.checkValues()){var l=a.getFormParameters();l=this.forceInjectValuesBeforeSave(l);var i=this.doCustomValidation(l);if(null==i){this.csrfRequired&&(l.csrf=$("#".concat(this.getTableName(),"Form")).data("csrf"));var o=$("#".concat(this.getTableName(),"_submit #id")).val();null!=o&&void 0!==o&&""!==o&&(l.id=o),l=this.makeEmptyDateFieldsNull(l),this.add(l,[],e,t)}else $("#".concat(this.getTableName(),"Form .label")).html(i),$("#".concat(this.getTableName(),"Form .label")).show(),this.scrollToTop()}}},{key:"makeEmptyDateFieldsNull",value:function(e){return this.getFormFields().forEach((function(t){"date"!==t[1].type&&"datetime"!==t[1].type||""!==e[t[0]]&&"0000-00-00"!==e[t[0]]&&"0000-00-00 00:00:00"!==e[t[0]]||("none"===t[1].validation?e[t[0]]="NULL":delete e[t[0]])})),e}},{key:"validatePassword",value:function(e){return e.length<8?this.gt("Password too short"):e.length>20?this.gt("Password too long"):e.match(/.*[0-9]+.*$/)?e.match(/.*[a-z]+.*$/)?e.match(/.*[A-Z]+.*$/)?e.match(/.*[\W]+.*$/)?null:this.gt("Password must include at least one symbol"):this.gt("Password must include at least one uppercase letter"):this.gt("Password must include at least one lowercase letter"):this.gt("Password must include at least one number")}},{key:"forceInjectValuesBeforeSave",value:function(e){return e}},{key:"doCustomValidation",value:function(e){return null}},{key:"filterQuery",value:function(){var e=new n.default("".concat(this.getTableName(),"_filter"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters();if(this.doCustomFilterValidation(t)){for(var a in t)t.hasOwnProperty(a)&&"NULL"===t[a]&&delete t[a];this.setFilter(t),this.filtersAlreadySet=!0,$("#".concat(this.getTableName(),"_resetFilters")).show(),this.currentFilterString=this.getFilterString(t),this.get([]),this.closePlainMessage()}}}},{key:"getFilterString",value:function(e){var t,a,l,n,i,o,r="",s=this.getFilters();for(var c in null==l&&(l=[]),e)if(e.hasOwnProperty(c)){if(i="",o=null,"select"===(l=this.getMetaFieldValues(c,s)).type||"select2"===l.type){if(void 0!==l["remote-source"]&&null!=l["remote-source"])t=l["remote-source"],"NULL"===e[c]?i=void 0!==l["null-label"]&&null!=l["null-label"]?l["null-label"]:"Not Selected":o=i=this.fieldMasterData["".concat(t[0],"_").concat(t[1],"_").concat(t[2])][e[c]];else if(a=l.source[0],"NULL"===e[c])i=void 0!==l["null-label"]&&null!=l["null-label"]?l["null-label"]:"Not Selected";else for(var u=0;u<a.length;u++)if(e[c]===l.source[u][0]){o=i=l.source[u][1];break}}else if("select2multi"===l.type){n=[];try{n=JSON.parse(e[c])}catch(e){}""!==(i=n.join(","))&&(o=i)}else""!==(i=e[c])&&(o=i);null!=o&&(""!==r&&(r+=" | "),r+="".concat(l.label," = ").concat(i))}return r}},{key:"doCustomFilterValidation",value:function(e){return!0}},{key:"resetFilters",value:function(){this.filter=this.origFilter,this.filtersAlreadySet=!1,$("#".concat(this.getTableName(),"_resetFilters")).hide(),this.currentFilterString="",this.get([])}},{key:"showFilters",value:function(e){for(var t=this.templates.filterTemplate,a="",l=this.getFilters(),n=0;n<l.length;n++){var i=this.getMetaFieldForRendering(l[n][0]);if(""===i||void 0===i)a+=this.renderFormField(l[n]);else{var o=e[i];""!==o&&null!=o&&void 0!==o&&""!==o.trim()?a+=this.renderFormField(JSON.parse(o)):a+=this.renderFormField(l[n])}}t=(t=t.replace(/_id_/g,"".concat(this.getTableName(),"_filter"))).replace(/_fields_/g,a);var r=this.generateRandom(14),s=$('<div class="reviewBlock popupForm" data-content="Form"></div>');s.attr("id",r),s.html(t),s.find(".datefield").datepicker({viewMode:2}),s.find(".timefield").datetimepicker({language:"en",pickDate:!1}),s.find(".datetimefield").datetimepicker({language:"en"}),s.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(s.attr("id")," .tinymce"),height:"400"}),s.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)})),s.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),s.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),a=t.find(".select2-choices").height();t.height(parseInt(a,10))}))})),this.showDomElement("Edit",s,null,null,!0),$(".filterBtn").off(),$(".filterBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.filterQuery()}catch(e){}return!1})),void 0!==this.filter&&null!=this.filter&&""!==this.filter&&this.fillForm(this.filter,"#".concat(this.getTableName(),"_filter"),this.getFilters())}},{key:"preRenderForm",value:function(e){}},{key:"renderForm",value:function(e){var t=[];null!=e&&void 0!==e||(this.currentId=null),this.preRenderForm(e);for(var a,l=this.templates.formTemplate,n="",i=this.getFormFields(),o=0;o<i.length;o++){var r=this.getMetaFieldForRendering(i[o][0]);if(""===r||void 0===r)n+=this.renderFormField(i[o]);else{var s=e[r];""!==s&&null!=s&&void 0!==s&&""!==s.trim()?n+=this.renderFormField(JSON.parse(s)):n+=this.renderFormField(i[o])}}l=(l=l.replace(/_id_/g,"".concat(this.getTableName(),"_submit"))).replace(/_fields_/g,n);var c=this.generateRandom(14);this.showFormOnPopup?(a=$('<div class="reviewBlock popupForm" data-content="Form"></div>')).attr("id",c):a=$("#".concat(this.getTableName(),"Form")),a.html(l),a.find(".datefield").datepicker({viewMode:2}),a.find(".timefield").datetimepicker({language:"en",pickDate:!1}),a.find(".datetimefield").datetimepicker({language:"en"}),a.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(a.attr("id")," .tinymce"),height:"400"}),a.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)}));var u=this.codeMirror;u&&a.find(".code").each((function(){var e=u.fromTextArea($(this)[0],{lineNumbers:!1,matchBrackets:!0,continueComments:"Enter",extraKeys:{"Ctrl-Q":"toggleComment"}});$(this).data("codemirror",e)})),a.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),a.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),a=t.find(".select2-choices").height();t.height(parseInt(a,10))}))})),a.find(".signatureField").each((function(){t.push($(this).attr("id"))}));for(var d=0;d<i.length;d++)"datagroup"===i[d][1].type&&a.find("#".concat(i[d][0])).data("field",i[d]);if(!1===this.showSave?a.find(".saveBtn").remove():(a.find(".saveBtn").off(),a.find(".saveBtn").data("modJs",this),a.find(".saveBtn").on("click",(function(){return null!=$(this).data("modJs").saveSuccessItemCallback&&void 0!==$(this).data("modJs").saveSuccessItemCallback?$(this).data("modJs").save($(this).data("modJs").retriveItemsAfterSave(),$(this).data("modJs").saveSuccessItemCallback):$(this).data("modJs").save(),!1}))),!1===this.showCancel?a.find(".cancelBtn").remove():(a.find(".cancelBtn").off(),a.find(".cancelBtn").data("modJs",this),a.find(".cancelBtn").on("click",(function(){return $(this).data("modJs").cancel(),!1}))),a.find("[mask]").each((function(){$(this).inputmask($(this).attr("mask"))})),a.find("[datemask]").each((function(){$(this).inputmask({mask:"y-1-2",placeholder:"YYYY-MM-DD",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"})})),a.find("[datetimemask]").each((function(){$(this).inputmask("datetime",{mask:"y-2-1 h:s:00",placeholder:"YYYY-MM-DD hh:mm:ss",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"})})),this.showFormOnPopup){this.showMessage("Edit","",null,null,!0),$("#plainMessageModel .modal-body").html(""),$("#plainMessageModel .modal-body").append(a);for(var f=0;f<t.length;f++)$("#".concat(t[f])).data("signaturePad",new SignaturePad(document.getElementById(t[f])));void 0!==e&&null!=e?this.fillForm(e,"#".concat(c)):this.setDefaultValues("#".concat(c))}else{$("#".concat(this.getTableName(),"Form")).show(),$("#".concat(this.getTableName())).hide();for(var p=0;p<t.length;p++)$("#".concat(t[p])).data("signaturePad",new SignaturePad(document.getElementById(t[p])));void 0!==e&&null!=e?this.fillForm(e):this.setDefaultValues(),this.scrollToTop()}this.postRenderForm(e,a)}},{key:"setDefaultValues",value:function(e,t){null!=t&&void 0!==t||(t=this.getFormFields()),null!=e&&void 0!==e&&""!==e||(e="#".concat(this.getTableName(),"Form"));for(var a=0;a<t.length;a++)"text"!==t[a][1].type&&"textarea"!==t[a][1].type||void 0!==t[a][1].default&&null!==t[a][1].default&&$("".concat(e," #").concat(t[a][0])).val(t[a][1].default)}},{key:"retriveItemsAfterSave",value:function(){return!0}},{key:"postRenderForm",value:function(e,t){}},{key:"dataGroupToHtml",value:function(e,t){var a,l,n,i,o=JSON.parse(e),r=t[1].html;null!=o&&void 0!==o&&void 0!==t[1]["sort-function"]&&null!=t[1]["sort-function"]&&o.sort(t[1]["sort-function"]);for(var s=$('<div id="'.concat(t[0],'_div_inner"></div>')),c=0;c<o.length;c++){for(var u in l=o[c],void 0!==t[1]["pre-format-function"]&&null!=t[1]["pre-format-function"]&&(l=t[1]["pre-format-function"].apply(this,[l])),a=(a=(a=(a=r).replace("#_delete_#",'<a id="#_id_#_delete" onclick="modJs.deleteDataGroupItem(\'#_id_#\');return false;" type="button" style="float:right;margin-right:3px;" tooltip="Delete"><li class="fa fa-times"></li></a>')).replace("#_edit_#",'<a id="#_id_#_edit" onclick="modJs.editDataGroupItem(\'#_id_#\');return false;" type="button" style="float:right;margin-right:5px;" tooltip="Edit"><li class="fa fa-edit"></li></a>')).replace(/#_id_#/g,l.id),l)void 0!==(i=l[u])&&null!=i&&"string"==typeof i&&(i=i.replace(/(?:\r\n|\r|\n)/g,"<br />")),a=a.replace("#_".concat(u,"_#"),i);void 0!==t[1].render&&null!=t[1].render&&(a=a.replace("#_renderFunction_#",t[1].render(l))),(n=$(a)).attr("fieldId","".concat(t[0],"_div")),s.append(n)}return s}},{key:"resetDataGroup",value:function(e){$("#".concat(e[0])).val(""),$("#".concat(e[0],"_div")).html("")}},{key:"showDataGroup",value:function(e,t){var a=this.templates.datagroupTemplate,l="",n=e[1].form;void 0!==t&&null!=t&&void 0!==t.id?this.currentDataGroupItemId=t.id:this.currentDataGroupItemId=null;for(var i=0;i<n.length;i++)l+=this.renderFormField(n[i]);a=(a=a.replace(/_id_/g,"".concat(this.getTableName(),"_field_").concat(e[0]))).replace(/_fields_/g,l);var o=this.generateRandom(14),r=$('<div class="reviewBlock popupForm" data-content="Form"></div>');r.attr("id",o),r.html(a),r.find(".datefield").datepicker({viewMode:2}),r.find(".timefield").datetimepicker({language:"en",pickDate:!1}),r.find(".datetimefield").datetimepicker({language:"en"}),r.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(r.attr("id")," .tinymce"),height:"400"}),r.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)})),r.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),r.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),a=t.find(".select2-choices").height();t.height(parseInt(a,10))}))})),this.currentDataGroupField=e,this.showDomElement("Add ".concat(e[1].label),r,null,null,!0),void 0!==t&&null!=t?this.fillForm(t,"#".concat(this.getTableName(),"_field_").concat(e[0]),e[1].form):this.setDefaultValues("#".concat(this.getTableName(),"_field_").concat(e[0]),e[1].form),$(".groupAddBtn").off(),void 0!==t&&null!=t&&void 0!==t.id?$(".groupAddBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.editDataGroup()}catch(e){console.log("Error editing data group: ".concat(e.message))}return!1})):$(".groupAddBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.addDataGroup()}catch(e){console.log("Error adding data group: ".concat(e.message))}return!1}))}},{key:"addDataGroup",value:function(){var e,t=this.currentDataGroupField;$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).html(""),$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).hide();var a=new n.default("".concat(this.getTableName(),"_field_").concat(t[0]),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(a.checkValues()){var l=a.getFormParameters();if(void 0!==t[1]["custom-validate-function"]&&null!=t[1]["custom-validate-function"]){if(!(e=t[1]["custom-validate-function"].apply(this,[l])).valid)return $("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).html(e.message),$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).show(),!1;l=e.params}var i=$("#".concat(t[0])).val();""===i&&(i="[]");var o=JSON.parse(i);l.id="".concat(t[0],"_").concat(this.dataGroupGetNextAutoIncrementId(o)),o.push(l),void 0!==t[1]["sort-function"]&&null!=t[1]["sort-function"]&&o.sort(t[1]["sort-function"]),i=JSON.stringify(o);var r=this.dataGroupToHtml(i,t);$("#".concat(t[0],"_div")).html(""),$("#".concat(t[0],"_div")).append(r),this.makeDataGroupSortable(t,$("#".concat(t[0],"_div_inner"))),$("#".concat(t[0])).val(i),this.orderDataGroup(t),this.closeDataMessage(),this.showMessage("Item Added","This change will be effective only when you save the form")}return!0}},{key:"nl2br",value:function(e,t){var a="";try{for(var l=e.split(" "),n=0,i=0;i<l.length;i++)(n+=l[i].length+1)>t?(a+="".concat(l[i],"<br/>"),n=0):a+="".concat(l[i]," ")}catch(e){}return a}},{key:"makeDataGroupSortable",value:function(e,t){t.data("field",e),t.data("firstSort",!0),t.sortable({create:function(){$(this).height($(this).height())},"ui-floating":!1,start:function(e,t){$("#sortable-ul-selector-id").sortable({sort:function(e,t){var a=$(e.target);if(!/html|body/i.test(a.offsetParent()[0].tagName)){var l=e.pageY-a.offsetParent().offset().top-t.helper.outerHeight(!0)/2;t.helper.css({top:"".concat(l,"px")})}}})},revert:!0,stop:function(){modJs.orderDataGroup($(this).data("field"))},axis:"y",scroll:!1,placeholder:"sortable-placeholder",cursor:"move"})}},{key:"orderDataGroup",value:function(e){var t,a=[],l=$("#".concat(e[0],"_div_inner [fieldid='").concat(e[0],"_div']")),n=$("#".concat(e[0])).val();""===n&&(n="[]");var i=JSON.parse(n);l.each((function(){for(var e in t=$(this).attr("id"),i)if(i[e].id===t){a.push(i[e]);break}})),$("#".concat(e[0])).val(JSON.stringify(a))}},{key:"editDataGroup",value:function(){var e=this.currentDataGroupField,t=this.currentDataGroupItemId,a=new n.default("".concat(this.getTableName(),"_field_").concat(e[0]),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(a.checkValues()){var l=a.getFormParameters();if(void 0!==e[1]["custom-validate-function"]&&null!=e[1]["custom-validate-function"]){var i=e[1]["custom-validate-function"].apply(this,[l]);if(!i.valid)return $("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).html(i.message),$("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).show(),!1;l=i.params}if(this.doCustomFilterValidation(l)){var o=$("#".concat(e[0])).val();""===o&&(o="[]");for(var r=JSON.parse(o),s={},c=-1,u=[],d=0;d<r.length;d++){var f=r[d];f.id===t&&(s=f,c=d),u.push(f)}l.id=s.id,u[c]=l,void 0!==e[1]["sort-function"]&&null!=e[1]["sort-function"]&&u.sort(e[1]["sort-function"]),o=JSON.stringify(u),$("#".concat(e[0])).val(o);var p=this.dataGroupToHtml(o,e);this.orderDataGroup(e),$("#".concat(e[0],"_div")).html(""),$("#".concat(e[0],"_div")).append(p),this.makeDataGroupSortable(e,$("#".concat(e[0],"_div_inner"))),this.closeDataMessage(),this.showMessage("Item Edited","This change will be effective only when you save the form")}}return!0}},{key:"editDataGroupItem",value:function(e){for(var t=e.substring(0,e.lastIndexOf("_")),a=$("#".concat(t)).val(),l=JSON.parse(a),n={},i=0;i<l.length;i++){var o=l[i];o.id===e&&(n=o)}this.showDataGroup($("#".concat(t)).data("field"),n)}},{key:"dataGroupGetNextAutoIncrementId",value:function(e){for(var t,a=1,l=0;l<e.length;l++){var n=e[l];void 0!==n.id&&null!=n.id||(n.id=1),(t=n.id.substring(n.id.lastIndexOf("_")+1,n.id.length))>=a&&(a=parseInt(t,10)+1)}return a}},{key:"deleteDataGroupItem",value:function(e){for(var t=e.substring(0,e.lastIndexOf("_")),a=$("#".concat(t)).val(),l=JSON.parse(a),n=[],i=0;i<l.length;i++){var o=l[i];o.id!==e&&n.push(o)}$("#".concat(t)).val(JSON.stringify(n)),$("#".concat(e)).remove(),this.showMessage("Item Removed","Item removed. This change will be effective only when you save the form")}},{key:"fillForm",value:function(e,t,a){var l;null!=a&&void 0!==a||(a=this.getFormFields()),null!=t&&void 0!==t&&""!==t||(t="#".concat(this.getTableName(),"Form"));for(var n=0;n<a.length;n++)if("date"===a[n][1].type)"0000-00-00"!==e[a[n][0]]&&""!==e[a[n][0]]&&null!=e[a[n][0]]&&void 0!==e[a[n][0]]&&$("".concat(t," #").concat(a[n][0],"_date")).datepicker("setValue",e[a[n][0]]);else if("colorpick"===a[n][1].type)null!=e[a[n][0]]&&void 0!==e[a[n][0]]&&($("".concat(t," #").concat(a[n][0],"_colorpick")).colorpicker("setValue",e[a[n][0]]),$("".concat(t," #").concat(a[n][0])).val(e[a[n][0]]));else if("datetime"===a[n][1].type||"time"===a[n][1].type){if("0000-00-00 00:00:00"!==e[a[n][0]]&&""!==e[a[n][0]]&&null!=e[a[n][0]]&&void 0!==e[a[n][0]]){var i=e[a[n][0]].split(" "),o=i[0].split("-"),r=i[1].split(":");$("".concat(t," #").concat(a[n][0],"_datetime")).data("datetimepicker").setLocalDate(new Date(o[0],parseInt(o[1],10)-1,o[2],r[0],r[1],r[2]))}}else if("label"===a[n][1].type)$("".concat(t," #").concat(a[n][0])).html(e[a[n][0]]);else if("placeholder"===a[n][1].type){if(void 0!==a[n][1]["remote-source"]&&null!=a[n][1]["remote-source"]){var s="".concat(a[n][1]["remote-source"][0],"_").concat(a[n][1]["remote-source"][1],"_").concat(a[n][1]["remote-source"][2]);l=this.fieldMasterData[s][e[a[n][0]]]}else l=e[a[n][0]];if(void 0===l||null==l)l="";else try{l=l.replace(/(?:\r\n|\r|\n)/g,"<br />")}catch(e){}if(void 0!==a[n][1].formatter&&a[n][1].formatter&&$.isFunction(a[n][1].formatter))try{l=a[n][1].formatter(l)}catch(e){}$("".concat(t," #").concat(a[n][0])).html(l)}else if("fileupload"===a[n][1].type)null!=e[a[n][0]]&&void 0!==e[a[n][0]]&&""!==e[a[n][0]]&&($("".concat(t," #").concat(a[n][0])).html(e[a[n][0]]),$("".concat(t," #").concat(a[n][0])).attr("val",e[a[n][0]]),$("".concat(t," #").concat(a[n][0])).show(),$("".concat(t," #").concat(a[n][0],"_download")).show(),$("".concat(t," #").concat(a[n][0],"_remove")).show()),!0===a[n][1].readonly&&$("".concat(t," #").concat(a[n][0],"_upload")).remove();else if("select"===a[n][1].type)void 0!==e[a[n][0]]&&null!=e[a[n][0]]&&""!==e[a[n][0]]||(e[a[n][0]]="NULL"),$("".concat(t," #").concat(a[n][0])).val(e[a[n][0]]);else if("select2"===a[n][1].type)void 0!==e[a[n][0]]&&null!=e[a[n][0]]&&""!==e[a[n][0]]||(e[a[n][0]]="NULL"),$("".concat(t," #").concat(a[n][0])).select2("val",e[a[n][0]]);else if("select2multi"===a[n][1].type){void 0!==e[a[n][0]]&&null!=e[a[n][0]]&&""!==e[a[n][0]]||(e[a[n][0]]="NULL");var c=[];if(void 0!==e[a[n][0]]&&null!=e[a[n][0]]&&""!==e[a[n][0]])try{c=JSON.parse(e[a[n][0]])}catch(e){}$("".concat(t," #").concat(a[n][0])).select2("val",c);var u=$("".concat(t," #").concat(a[n][0])).find(".select2-choices").height();$("".concat(t," #").concat(a[n][0])).find(".controls").css("min-height","".concat(u,"px")),$("".concat(t," #").concat(a[n][0])).css("min-height","".concat(u,"px"))}else if("datagroup"===a[n][1].type)try{var d=this.dataGroupToHtml(e[a[n][0]],a[n]);$("".concat(t," #").concat(a[n][0])).val(e[a[n][0]]),$("".concat(t," #").concat(a[n][0],"_div")).html(""),$("".concat(t," #").concat(a[n][0],"_div")).append(d),this.makeDataGroupSortable(a[n],$("".concat(t," #").concat(a[n][0],"_div_inner")))}catch(e){}else if("signature"===a[n][1].type)""===e[a[n][0]]&&void 0===e[a[n][0]]&&null==e[a[n][0]]||$("".concat(t," #").concat(a[n][0])).data("signaturePad").fromDataURL(e[a[n][0]]);else if("simplemde"===a[n][1].type)$("".concat(t," #").concat(a[n][0])).data("simplemde").value(e[a[n][0]]);else if("code"===a[n][1].type){var f=$("".concat(t," #").concat(a[n][0])).data("codemirror");f&&f.getDoc().setValue(e[a[n][0]])}else $("".concat(t," #").concat(a[n][0])).val(e[a[n][0]])}},{key:"cancel",value:function(){$("#".concat(this.getTableName(),"Form")).hide(),$("#".concat(this.getTableName())).show()}},{key:"renderFormField",value:function(e){var t=0;if(void 0===this.fieldTemplates[e[1].type]||null==this.fieldTemplates[e[1].type])return"";var a=this.fieldTemplates[e[1].type];if(e[1].label=this.gt(e[1].label),"none"!==e[1].validation&&"emailOrEmpty"!==e[1].validation&&"numberOrEmpty"!==e[1].validation&&"placeholder"!==e[1].type&&e[1].label.indexOf("*")<0&&(["select","select2"].indexOf(e[1].type)>=0&&!0===e[1]["allow-null"]||(e[1].label="".concat(e[1].label,'<font class="redFont">*</font>'))),"select"===e[1].type||"select2"===e[1].type||"select2multi"===e[1].type){if(a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label),void 0!==e[1].source&&null!=e[1].source)a=a.replace("_options_",this.renderFormSelectOptions(e[1].source,e));else if(void 0!==e[1]["remote-source"]&&null!=e[1]["remote-source"]){var l="".concat(e[1]["remote-source"][0],"_").concat(e[1]["remote-source"][1],"_").concat(e[1]["remote-source"][2]);a=a.replace("_options_",this.renderFormSelectOptionsRemote(this.fieldMasterData[l],e))}}else if("colorpick"===e[1].type)a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("date"===e[1].type)a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("datetime"===e[1].type)a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("time"===e[1].type)a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("fileupload"===e[1].type){a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);var n=this.getCurrentProfile();t=null!=n&&void 0!==n?n.id:-1*this.getUser().id,a=(a=a.replace(/_userId_/g,t)).replace(/_group_/g,this.tab),a=(a=void 0!==e[1].filetypes&&null!=e[1].filetypes?a.replace(/_filetypes_/g,e[1].filetypes):a.replace(/_filetypes_/g,"all")).replace(/_rand_/g,this.generateRandom(14))}else"datagroup"===e[1].type||"signature"===e[1].type||"tinymce"===e[1].type||e[1].type,a=(a=a.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);return a=void 0!==e[1].validation&&null!=e[1].validation&&""!==e[1].validation?a.replace(/_validation_/g,'validation="'.concat(e[1].validation,'"')):a.replace(/_validation_/g,""),a=void 0!==e[1].help&&null!==e[1].help?(a=a.replace(/_helpline_/g,e[1].help)).replace(/_hidden_class_help_/g,""):(a=a.replace(/_helpline_/g,"")).replace(/_hidden_class_help_/g,"hide"),a=void 0!==e[1].placeholder&&null!==e[1].placeholder?a.replace(/_placeholder_/g,'placeholder="'.concat(e[1].placeholder,'"')):a.replace(/_placeholder_/g,""),a=void 0!==e[1].mask&&null!==e[1].mask?a.replace(/_mask_/g,'mask="'.concat(e[1].mask,'"')):a.replace(/_mask_/g,"")}},{key:"renderFormSelectOptions",value:function(e,t){var a="";null!=t&&void 0!==t&&!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?a+='<option value="NULL">'.concat(this.gt(t[1]["null-label"]),"</option>"):a+='<option value="NULL">Select</option>');var l=[];for(var n in e)l.push(e[n]);!0===t[1].sort&&l.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var i=0;i<l.length;i++){var o=l[i][0],r=l[i][1],s='<option value="_id_">_val_</option>';a+=s=(s=s.replace("_id_",o)).replace("_val_",this.gt(r))}return a}},{key:"renderFormSelectOptionsRemote",value:function(e,t){var a="";!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?a+='<option value="NULL">'.concat(this.gt(t[1]["null-label"]),"</option>"):a+='<option value="NULL">Select</option>');var l=[];for(var n in e)l.push([n,e[n]]);"true"===t[1].sort&&l.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var i=0;i<l.length;i++){var o=l[i][0],r=l[i][1],s='<option value="_id_">_val_</option>';a+=s=(s=s.replace("_id_",o)).replace("_val_",this.gt(r))}return a}},{key:"setCustomTemplates",value:function(e){this.customTemplates=e}},{key:"setEmailTemplates",value:function(e){this.emailTemplates=e}},{key:"getCustomTemplate",value:function(e){return this.customTemplates[e]}},{key:"setFieldTemplates",value:function(e){this.fieldTemplates=e}},{key:"getMetaFieldForRendering",value:function(e){return""}},{key:"clearDeleteParams",value:function(){this.deleteParams={}}},{key:"getShowAddNew",value:function(){return this.showAddNew}},{key:"getAddNewLabel",value:function(){return"Add New"}},{key:"setShowAddNew",value:function(e){this.showAddNew=e}},{key:"setShowDelete",value:function(e){this.showDelete=e}},{key:"setShowEdit",value:function(e){this.showEdit=e}},{key:"setShowSave",value:function(e){this.showSave=e}},{key:"setShowCancel",value:function(e){this.showCancel=e}},{key:"getCustomTableParams",value:function(){return{}}},{key:"getActionButtons",value:function(e){return modJs.getActionButtonsHtml(e.aData[0],e.aData)}},{key:"getActionButtonsHtml",value:function(e,t){var a='<div style="width:80px;">_edit__delete__clone_</div>';return a=this.showAddNew?a.replace("_clone_",'<img class="tableActionButton" src="_BASE_images/clone.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Copy" onclick="modJs.copyRow(_id_);return false;"></img>'):a.replace("_clone_",""),a=this.showDelete?a.replace("_delete_",'<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>'):a.replace("_delete_",""),a=(a=(a=this.showEdit?a.replace("_edit_",'<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>'):a.replace("_edit_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"generateRandom",value:function(e){for(var t=new Date,a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",l="",n=e;n>0;--n)l+=a[Math.round(Math.random()*(a.length-1))];return l+t.getTime()}},{key:"checkFileType",value:function(e,t){var a=document.getElementById(e),l="";return a.value.lastIndexOf(".")>0&&(l=a.value.substring(a.value.lastIndexOf(".")+1,a.value.length)),l=l.toLowerCase(),!(t.split(",").indexOf(l)<0&&(a.value="",this.showMessage("File Type Error","Selected file type is not supported"),this.clearFileElement(e),1))}},{key:"clearFileElement",value:function(e){var t=$("#".concat(e));t.replaceWith(t=t.val("").clone(!0))}},{key:"fixJSON",value:function(e){return"1"===this.noJSONRequests&&(e=window.btoa(e)),e}},{key:"getClientDate",value:function(e){var t=this.getClientGMTOffset();return e.addMinutes(60*t)}},{key:"getClientGMTOffset",value:function(){var e=new Date,t=new Date(e.getFullYear(),0,1,0,0,0,0),a=t.toGMTString();return(t-new Date(a.substring(0,a.lastIndexOf(" ")-1)))/36e5}},{key:"getHelpLink",value:function(){return null}},{key:"showLoader",value:function(){$("#iceloader").show()}},{key:"hideLoader",value:function(){$("#iceloader").hide()}},{key:"generateOptions",value:function(e){var t="";for(var a in e)t+='<option value="__val__">__text__</option>'.replace("__val__",a).replace("__text__",e[a]);return t}},{key:"isModuleInstalled",value:function(e,t){return void 0!==modulesInstalled&&null!==modulesInstalled&&1===modulesInstalled["".concat(e,"_").concat(t)]}},{key:"setCustomFields",value:function(e){for(var t,a,l=0;l<e.length;l++)if("Hidden"!==(t=e[l]).display&&""!==t.data&&void 0!==t.data)try{if(void 0===(a=JSON.parse(t.data))||null==a)continue;if(2!==a.length)continue;if(void 0===a[1].type||null==a[1].type)continue;this.customFields.push(a)}catch(e){}}},{key:"addCustomFields",value:function(e){for(var t=0;t<this.customFields.length;t++)e.push(this.customFields[t]);return e}}])&&i(t.prototype,a),l&&i(t,l),e}();a.default=o},{"./FormValidation":7}],10:[function(e,t,a){"use strict";var l=e("./lib");window.EmployeeImmigrationAdapter=l.EmployeeImmigrationAdapter,window.EmployeeTravelRecordAdapter=l.EmployeeTravelRecordAdapter,window.EmployeeTravelRecordApproverAdapter=l.EmployeeTravelRecordApproverAdapter,window.SubordinateEmployeeTravelRecordAdapter=l.SubordinateEmployeeTravelRecordAdapter},{"./lib":11}],11:[function(e,t,a){"use strict";var l=o(e("../../../api/AdapterBase")),n=o(e("../../../api/ApproveModuleAdapter")),i=e("../../../admin/src/travel/lib");function o(e){return e&&e.__esModule?e:{default:e}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var a=0;a<t.length;a++){var l=t[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function u(e,t,a){return t&&c(e.prototype,t),a&&c(e,a),e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,l=m(e);if(t){var n=m(this).constructor;a=Reflect.construct(l,arguments,n)}else a=l.apply(this,arguments);return h(this,a)}}function h(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){d(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return u(a,[{key:"getDataMapping",value:function(){return["id","document","documentname","valid_until","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Document"},{sTitle:"Document Id"},{sTitle:"Valid Until"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["document",{label:"Document",type:"select2","remote-source":["ImmigrationDocument","id","name"]}],["documentname",{label:"Document Id",type:"text",validation:""}],["valid_until",{label:"Valid Until",type:"date",validation:"none"}],["status",{label:"Status",type:"select",source:[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],["details",{label:"Details",type:"textarea",validation:"none"}],["attachment1",{label:"Attachment 1",type:"fileupload",validation:"none"}],["attachment2",{label:"Attachment 2",type:"fileupload",validation:"none"}],["attachment3",{label:"Attachment 3",type:"fileupload",validation:"none"}]]}}]),a}(l.default),y=function(e){d(a,e);var t=p(a);function a(e,l,n,i){var o;return s(this,a),(o=t.call(this,e,l,n,i)).itemName="Travel",o.itemNameLower="employeetravelrecord",o.modulePathName="travel",o}return u(a,[{key:"getDataMapping",value:function(){return["id","type","purpose","travel_from","travel_to","travel_date","return_date","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Travel Type"},{sTitle:"Purpose"},{sTitle:"From"},{sTitle:"To"},{sTitle:"Travel Date"},{sTitle:"Return Date"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return this.addCustomFields([["id",{label:"ID",type:"hidden"}],["type",{label:"Means of Transportation",type:"select",source:[["Plane","Plane"],["Rail","Rail"],["Taxi","Taxi"],["Own Vehicle","Own Vehicle"],["Rented Vehicle","Rented Vehicle"],["Other","Other"]]}],["purpose",{label:"Purpose of Travel",type:"textarea",validation:""}],["travel_from",{label:"Travel From",type:"text",validation:""}],["travel_to",{label:"Travel To",type:"text",validation:""}],["travel_date",{label:"Travel Date",type:"datetime",validation:""}],["return_date",{label:"Return Date",type:"datetime",validation:""}],["details",{label:"Notes",type:"textarea",validation:"none"}],["currency",{label:"Currency",type:"select2","allow-null":!1,"remote-source":["CurrencyType","id","code"]}],["funding",{label:"Total Funding Proposed",type:"text",validation:"float",default:"0.00",mask:"9{0,10}.99"}],["attachment1",{label:"Attachment",type:"fileupload",validation:"none"}],["attachment2",{label:"Attachment",type:"fileupload",validation:"none"}],["attachment3",{label:"Attachment",type:"fileupload",validation:"none"}]])}}]),a}(n.default),g=function(e){d(a,e);var t=p(a);function a(e,l,n,i){var o;return s(this,a),(o=t.call(this,e,l,n,i)).itemName="Travel",o.itemNameLower="employeetravelrecord",o.modulePathName="travel",o}return u(a,[{key:"getActionButtonsHtml",value:function(e,t){var a='<div style="width:80px;">_status__logs_</div>';return a=a.replace("_logs_",'<img class="tableActionButton" src="_BASE_images/log.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="View Logs" onclick="modJs.getLogs(_id_);return false;"></img>'),a=(a=(a=(a="Processing"===t[this.getStatusFieldPosition()]?a.replace("_status_",'<img class="tableActionButton" src="_BASE_images/run.png" style="cursor:pointer;" rel="tooltip" title="Change Status" onclick="modJs.openStatus(_id_, \'_cstatus_\');return false;"></img>'):a.replace("_status_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)).replace(/_cstatus_/g,t[this.getStatusFieldPosition()])}},{key:"getStatusOptionsData",value:function(e){var t={};return"Processing"===e&&(t.Approved="Approved",t.Rejected="Rejected"),t}},{key:"getStatusOptions",value:function(e){return this.generateOptions(this.getStatusOptionsData(e))}}]),a}(i.EmployeeTravelRecordAdminAdapter),b=function(e){d(a,e);var t=p(a);function a(e,l,n,i){var o;return s(this,a),(o=t.call(this,e,l,n,i)).itemName="Travel",o.itemNameLower="employeetravelrecord",o.modulePathName="travel",o}return a}(i.EmployeeTravelRecordAdminAdapter);t.exports={EmployeeImmigrationAdapter:v,EmployeeTravelRecordAdapter:y,EmployeeTravelRecordApproverAdapter:g,SubordinateEmployeeTravelRecordAdapter:b}},{"../../../admin/src/travel/lib":1,"../../../api/AdapterBase":3,"../../../api/ApproveModuleAdapter":5}]},{},[10]);
|
|
//# sourceMappingURL=travel.js.map
|