3 lines
114 KiB
JavaScript
3 lines
114 KiB
JavaScript
!function e(t,a,l){function i(o,s){if(!a[o]){if(!t[o]){var r="function"==typeof require&&require;if(!s&&r)return r(o,!0);if(n)return n(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 i(t[o][1][e]||e)}),u,u.exports,e,t,a,l)}return a[o].exports}for(var n="function"==typeof require&&require,o=0;o<l.length;o++)i(l[o]);return i}({1:[function(e,t,a){"use strict";var l=e("./lib");window.EmployeeAdapter=l.EmployeeAdapter,window.TerminatedEmployeeAdapter=l.TerminatedEmployeeAdapter,window.ArchivedEmployeeAdapter=l.ArchivedEmployeeAdapter,window.EmployeeSkillAdapter=l.EmployeeSkillAdapter,window.EmployeeEducationAdapter=l.EmployeeEducationAdapter,window.EmployeeCertificationAdapter=l.EmployeeCertificationAdapter,window.EmployeeLanguageAdapter=l.EmployeeLanguageAdapter,window.EmployeeDependentAdapter=l.EmployeeDependentAdapter,window.EmergencyContactAdapter=l.EmergencyContactAdapter,window.EmployeeImmigrationAdapter=l.EmployeeImmigrationAdapter,window.EmployeeSubSkillsAdapter=l.EmployeeSubSkillsAdapter,window.EmployeeSubEducationAdapter=l.EmployeeSubEducationAdapter,window.EmployeeSubCertificationAdapter=l.EmployeeSubCertificationAdapter,window.EmployeeSubLanguageAdapter=l.EmployeeSubLanguageAdapter,window.EmployeeSubDependentAdapter=l.EmployeeSubDependentAdapter,window.EmployeeSubEmergencyContactAdapter=l.EmployeeSubEmergencyContactAdapter,window.EmployeeSubDocumentAdapter=l.EmployeeSubDocumentAdapter,window.EmployeeDocumentAdapter=l.EmployeeDocumentAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=n(e("../../../api/AdapterBase")),i=n(e("../../../api/SubAdapterBase"));function n(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 s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 c(e,t,a){return t&&r(e.prototype,t),a&&r(e,a),e}function u(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&&d(e,t)}function d(e,t){return(d=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=f(e);if(t){var i=f(this).constructor;a=Reflect.construct(l,arguments,i)}else a=l.apply(this,arguments);return m(this,a)}}function m(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 f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","skill_id","details"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Skill"},{sTitle:"Details"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["skill_id",{label:"Skill",type:"select2","allow-null":!0,"remote-source":["Skill","id","name"]}],["details",{label:"Details",type:"textarea",validation:""}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Skills")}},{key:"getSubItemHtml",value:function(e,t,a){return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(t).concat(a,'</h5><p class="list-group-item-text">').concat(nl2br(e[3]),"</p></div>"))}}]),a}(i.default),y=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","education_id","institute","date_start","date_end"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Qualification"},{sTitle:"Institute"},{sTitle:"Start Date"},{sTitle:"Completed On"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["education_id",{label:"Qualification",type:"select2","allow-null":!1,"remote-source":["Education","id","name"]}],["institute",{label:"Institute",type:"text",validation:""}],["date_start",{label:"Start Date",type:"date",validation:"none"}],["date_end",{label:"Completed On",type:"date",validation:"none"}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Education")}},{key:"getSubItemHtml",value:function(e,t,a){var l="";try{l=Date.parse(e[4]).toString("MMM d, yyyy")}catch(e){console.log("Error:".concat(e.message))}var i="";try{i=Date.parse(e[5]).toString("MMM d, yyyy")}catch(e){console.log("Error:".concat(e.message))}return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(t).concat(a,'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Start: <b>').concat(l,'</b></p><p class="list-group-item-text"><i class="fa fa-calendar"></i> Completed: <b>').concat(i,'</b></p><p class="list-group-item-text">')+'<i class="fa fa-building-o"></i> Institute: <b>'.concat(e[3],"</b></p></div>"))}}]),a}(i.default),b=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","certification_id","institute","date_start","date_end"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Certification"},{sTitle:"Institute"},{sTitle:"Granted On"},{sTitle:"Valid Thru"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["certification_id",{label:"Certification",type:"select2","allow-null":!1,"remote-source":["Certification","id","name"]}],["institute",{label:"Institute",type:"text",validation:""}],["date_start",{label:"Granted On",type:"date",validation:"none"}],["date_end",{label:"Valid Thru",type:"date",validation:"none"}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Certifications")}},{key:"getSubItemHtml",value:function(e,t,a){var l="";try{l=Date.parse(e[4]).toString("MMM d, yyyy")}catch(e){console.log("Error:".concat(e.message))}var i="";try{i=Date.parse(e[5]).toString("MMM d, yyyy")}catch(e){console.log("Error:".concat(e.message))}return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(t).concat(a,'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Granted On: <b>').concat(l,'</b></p><p class="list-group-item-text"><i class="fa fa-calendar"></i> Valid Thru: <b>').concat(i,'</b></p><p class="list-group-item-text"><i class="fa fa-building-o"></i> Institute: <b>').concat(e[3],"</b></p></div>"))}}]),a}(i.default),v=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","language_id","reading","speaking","writing","understanding"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Language"},{sTitle:"Reading"},{sTitle:"Speaking"},{sTitle:"Writing"},{sTitle:"Understanding"}]}},{key:"getFormFields",value:function(){var e=[["Elementary Proficiency","Elementary Proficiency"],["Limited Working Proficiency","Limited Working Proficiency"],["Professional Working Proficiency","Professional Working Proficiency"],["Full Professional Proficiency","Full Professional Proficiency"],["Native or Bilingual Proficiency","Native or Bilingual Proficiency"]];return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["language_id",{label:"Language",type:"select2","allow-null":!1,"remote-source":["Language","id","name"]}],["reading",{label:"Reading",type:"select",source:e}],["speaking",{label:"Speaking",type:"select",source:e}],["writing",{label:"Writing",type:"select",source:e}],["understanding",{label:"Understanding",type:"select",source:e}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Languages")}},{key:"getSubItemHtml",value:function(e,t,a){return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(t).concat(a,'</h5><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Reading: <b>').concat(e[3],'</b></p><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Speaking: <b>').concat(e[4],'</b></p><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Writing: <b>').concat(e[5],'</b></p><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Understanding: <b>').concat(e[6],"</b></p></div>"))}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(i.default),g=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","name","relationship","dob","id_number"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Name"},{sTitle:"Relationship"},{sTitle:"Date of Birth"},{sTitle:"Id Number"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["relationship",{label:"Relationship",type:"select",source:[["Child","Child"],["Spouse","Spouse"],["Parent","Parent"],["Other","Other"]]}],["dob",{label:"Date of Birth",type:"date",validation:""}],["id_number",{label:"Id Number",type:"text",validation:"none"}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Dependents")}},{key:"getSubItemHtml",value:function(e,t,a){return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(t).concat(a,'</h5><p class="list-group-item-text"><i class="fa fa-users"></i> Relationship: <b>').concat(e[3],'</b></p><p class="list-group-item-text"><i class="fa fa-user"></i> Name: <b>').concat(e[2],"</b></p></div>"))}}]),a}(i.default),_=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","name","relationship","home_phone","work_phone","mobile_phone"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Name"},{sTitle:"Relationship"},{sTitle:"Home Phone"},{sTitle:"Work Phone"},{sTitle:"Mobile Phone"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["name",{label:"Name",type:"text",validation:""}],["relationship",{label:"Relationship",type:"text",validation:"none"}],["home_phone",{label:"Home Phone",type:"text",validation:"none"}],["work_phone",{label:"Work Phone",type:"text",validation:"none"}],["mobile_phone",{label:"Mobile Phone",type:"text",validation:"none"}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Emergency Contacts")}},{key:"getSubItemHtml",value:function(e,t,a){return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(t).concat(a,'</h5><p class="list-group-item-text"><i class="fa fa-users"></i> Relationship: <b>').concat(e[3],'</b></p><p class="list-group-item-text"><i class="fa fa-user"></i> Name: <b>').concat(e[2],'</b></p><p class="list-group-item-text"><i class="fa fa-phone"></i> Home Phone: <b>').concat(e[4],'</b></p><p class="list-group-item-text"><i class="fa fa-phone"></i> Mobile Phone: <b>').concat(e[6],"</b></p></div>"))}}]),a}(i.default),k=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","document","details","date_added","valid_until","status","attachment"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Document"},{sTitle:"Details"},{sTitle:"Date Added"},{sTitle:"Status"},{sTitle:"Attachment",bVisible:!1}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"hidden"}],["document",{label:"Document",type:"select2","remote-source":["Document","id","name"]}],["date_added",{label:"Date Added",type:"date",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"}],["attachment",{label:"Attachment",type:"fileupload",validation:"none"}]]}},{key:"forceInjectValuesBeforeSave",value:function(e){return e.employee=this.parent.currentId,e}},{key:"getSubHeaderTitle",value:function(){return'<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'.concat(this.tab,'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>')+this.gt("Documents")}},{key:"getSubItemHtml",value:function(e,t,a){var l="";try{l=Date.parse(e[5]).toString("MMM d, yyyy")}catch(e){console.log(e.message)}var i='<button id="#_id_#_download" onclick="download(\''.concat(e[7],'\');return false;" type="button" style="position: absolute;bottom: 5px;right: 70px;font-size: 13px;" tooltip="Download"><li class="fa fa-cloud-download"></li></button>');return $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'.concat(e[2]).concat(i).concat(t).concat(a,'</h5><p class="list-group-item-text">').concat(nl2br(e[3]),'</p><p class="list-group-item-text"><i class="fa fa-calendar"></i> Expire On: <b>').concat(l,"</b></p></div>"))}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(i.default),S=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(l.default),w=function(e){u(a,e);var t=p(a);function a(e,l,i,n){var o;return s(this,a),(o=t.call(this,e,l,i,n)).fieldNameMap={},o.hiddenFields={},o.tableFields={},o.formOnlyFields={},o}return c(a,[{key:"setFieldNameMap",value:function(e){for(var t,a=0;a<e.length;a++)t=e[a],this.fieldNameMap[t.name]=t,"Hidden"===t.display?this.hiddenFields[t.name]=t:"Table and Form"===t.display||"Form"===t.display?this.tableFields[t.name]=t:this.formOnlyFields[t.name]=t}},{key:"getCustomTableParams",value:function(){var e=this;return{aoColumnDefs:[{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,1)},aTargets:[1]},{fnRender:e.getActionButtons,aTargets:[e.getDataMapping().length]}]}}},{key:"preProcessRemoteTableData",value:function(e,t,a){if(1===a){return'<img src="_img_" class="img-circle" style="width:45px;height: 45px;" alt="User Image">'.replace("_img_",t)}return t}},{key:"getTableHTMLTemplate",value:function(){return'<div class="box-body table-responsive"><table cellpadding="0" cellspacing="0" border="0" class="table table-striped" id="grid"></table></div>'}},{key:"getTableFields",value:function(){return["id","image","employee_id","first_name","last_name","mobile_phone","department","gender","supervisor"]}},{key:"getDataMapping",value:function(){for(var e=this.getTableFields(),t=[],a=0;a<e.length;a++)void 0!==this.hiddenFields[e[a]]&&null!==this.hiddenFields[e[a]]||void 0!==this.formOnlyFields[e[a]]&&null!==this.formOnlyFields[e[a]]||t.push(e[a]);return t}},{key:"getHeaders",value:function(){for(var e=this.getTableFields(),t=[{sTitle:"ID",bVisible:!1},{sTitle:"",bSortable:!1}],a="",l=0;l<e.length;l++)void 0!==this.hiddenFields[e[l]]&&null!==this.hiddenFields[e[l]]||void 0!==this.formOnlyFields[e[l]]&&null!==this.formOnlyFields[e[l]]||void 0!==this.fieldNameMap[e[l]]&&null!==this.fieldNameMap[e[l]]&&(null==(a=this.fieldNameMap[e[l]].textMapped)||""===a?t.push({sTitle:a}):"gender"===e[l]?t.push({sTitle:a,translate:!0}):t.push({sTitle:a}));return t}},{key:"getFormFields",value:function(){for(var e,t,a=[],l=[["id",{label:"ID",type:"hidden",validation:""}],["employee_id",{label:"Employee Number",type:"text",validation:""}],["first_name",{label:"First Name",type:"text",validation:""}],["middle_name",{label:"Middle Name",type:"text",validation:"none"}],["last_name",{label:"Last Name",type:"text",validation:""}],["nationality",{label:"Nationality",type:"select2","remote-source":["Nationality","id","name"]}],["birthday",{label:"Date of Birth",type:"date",validation:""}],["gender",{label:"Gender",type:"select",source:[["Male","Male"],["Female","Female"],["Divers","Divers"]]}],["marital_status",{label:"Marital Status",type:"select",source:[["Married","Married"],["Single","Single"],["Divorced","Divorced"],["Widowed","Widowed"],["Other","Other"]]}],["ethnicity",{label:"Ethnicity",type:"select2","allow-null":!0,"remote-source":["Ethnicity","id","name"]}],["immigration_status",{label:"Immigration Status",type:"select2","allow-null":!0,"remote-source":["ImmigrationStatus","id","name"]}],["ssn_num",{label:"SSN/NRIC",type:"text",validation:"none"}],["nic_num",{label:"NIC",type:"text",validation:"none"}],["other_id",{label:"Other ID",type:"text",validation:"none"}],["driving_license",{label:"Driving License No",type:"text",validation:"none"}],["employment_status",{label:"Employment Status",type:"select2","remote-source":["EmploymentStatus","id","name"]}],["job_title",{label:"Job Title",type:"select2","remote-source":["JobTitle","id","name"]}],["pay_grade",{label:"Pay Grade",type:"select2","allow-null":!0,"remote-source":["PayGrade","id","name"]}],["work_station_id",{label:"Work Station Id",type:"text",validation:"none"}],["address1",{label:"Address Line 1",type:"text",validation:"none"}],["address2",{label:"Address Line 2",type:"text",validation:"none"}],["city",{label:"City",type:"text",validation:"none"}],["country",{label:"Country",type:"select2","remote-source":["Country","code","name"]}],["province",{label:"State",type:"select2","allow-null":!0,"remote-source":["Province","id","name"]}],["postal_code",{label:"Postal/Zip Code",type:"text",validation:"none"}],["home_phone",{label:"Home Phone",type:"text",validation:"none"}],["mobile_phone",{label:"Mobile Phone",type:"text",validation:"none"}],["work_phone",{label:"Work Phone",type:"text",validation:"none"}],["work_email",{label:"Work Email",type:"text",validation:"emailOrEmpty"}],["private_email",{label:"Private Email",type:"text",validation:"emailOrEmpty"}],["joined_date",{label:"Joined Date",type:"date",validation:""}],["confirmation_date",{label:"Confirmation Date",type:"date",validation:"none"}],["termination_date",{label:"Termination Date",type:"date",validation:"none"}],["department",{label:"Department",type:"select2","remote-source":["CompanyStructure","id","title"]}],["supervisor",{label:"Direct Supervisor",type:"select2","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}],["indirect_supervisors",{label:"Indirect Supervisors",type:"select2multi","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}],["approver1",{label:"First Level Approver",type:"select2","allow-null":!0,"null-label":"None","remote-source":["Employee","id","first_name+last_name"]}],["approver2",{label:"Second Level Approver",type:"select2","allow-null":!0,"null-label":"None","remote-source":["Employee","id","first_name+last_name"]}],["approver3",{label:"Third Level Approver",type:"select2","allow-null":!0,"null-label":"None","remote-source":["Employee","id","first_name+last_name"]}],["notes",{label:"Notes",type:"datagroup",form:[["note",{label:"Note",type:"textarea",validation:""}]],html:'<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">Date: #_date_#</span><hr/>#_note_#</div></div>',validation:"none","sort-function":function(e,t){return Date.parse(e.date).getTime()<Date.parse(t.date).getTime()},"custom-validate-function":function(e){var t={valid:!0};return e.date=(new Date).toString("d-MMM-yyyy hh:mm tt"),t.params=e,t}}]],i=0;i<this.customFields.length;i++)l.push(this.customFields[i]);for(var n=0;n<l.length;n++)e=l[n],void 0!==this.hiddenFields[e[0]]&&null!==this.hiddenFields[e[0]]||(void 0!==this.fieldNameMap[e[0]]&&null!==this.fieldNameMap[e[0]]&&(t=this.fieldNameMap[e[0]].textMapped,e[1].label=t),a.push(e));return a}},{key:"getFilters",value:function(){return[["job_title",{label:"Job Title",type:"select2","allow-null":!0,"null-label":"All Job Titles","remote-source":["JobTitle","id","name"]}],["department",{label:"Department",type:"select2","allow-null":!0,"null-label":"All Departments","remote-source":["CompanyStructure","id","title"]}],["supervisor",{label:"Supervisor",type:"select2","allow-null":!0,"null-label":"Anyone","remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"getActionButtonsHtml",value:function(e){var t='<img class="tableActionButton" src="_BASE_images/connect-no.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Terminate Employee" onclick="modJs.terminateEmployee(_id_);return false;"></img>';!1===this.showDelete&&(t="");var a='<div style="width:130px;">\n<img class="tableActionButton" src="_BASE_images/user.png" style="cursor:pointer;" rel="tooltip" title="Login as this Employee" onclick="modJs.setAdminProfile(_id_);return false;"></img>\n<img class="tableActionButton" src="_BASE_images/view.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="View" onclick="modJs.view(_id_);return false;"></img>\n<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>\n'.concat(t,"\n</div>");return a=(a=a.replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"getHelpLink",value:function(){return"https://thilinah.gitbooks.io/icehrm-guide/content/employee-information-setup.html"}},{key:"saveSuccessItemCallback",value:function(e){this.lastSavedEmployee=e,null===this.currentId&&$("#createUserModel").modal("show")}},{key:"closeCreateUser",value:function(){$("#createUserModel").modal("hide")}},{key:"createUser",value:function(){var e={};e.employee=this.lastSavedEmployee.id,e.user_level="Employee",e.email=this.lastSavedEmployee.work_email,e.username=this.lastSavedEmployee.work_email.split("@")[0],top.location.href=this.getCustomUrl("?g=admin&n=users&m=admin_Admin&action=new&object=".concat(Base64.encodeURI(JSON.stringify(e))))}},{key:"deleteEmployee",value:function(e){if(confirm("Are you sure you want to archive this employee? Data for this employee will be saved to an archive table. But you will not be able to covert the archived employee data into a normal employee.")){var t=[];t.callBackData=[],t.callBackSuccess="deleteEmployeeSuccessCallback",t.callBackFail="deleteEmployeeFailCallback",this.customAction("deleteEmployee","admin=employees",JSON.stringify({id:e}),t)}}},{key:"deleteEmployeeSuccessCallback",value:function(e){this.showMessage("Delete Success","Employee deleted. You can find archived information for this employee in Archived Employees tab"),this.get([])}},{key:"deleteEmployeeFailCallback",value:function(e){this.showMessage("Error occurred while deleting Employee",e)}},{key:"terminateEmployee",value:function(e){if(confirm("Are you sure you want to terminate this employee contract? You will still be able to access all details of this employee.")){var t={};t.id=e;var a=JSON.stringify(t),l=[];l.callBackData=[],l.callBackSuccess="terminateEmployeeSuccessCallback",l.callBackFail="terminateEmployeeFailCallback",this.customAction("terminateEmployee","admin=employees",a,l)}}},{key:"terminateEmployeeSuccessCallback",value:function(e){this.showMessage("Success","Employee contract terminated. You can find terminated employee information under Terminated Employees menu."),this.get([])}},{key:"terminateEmployeeFailCallback",value:function(e){this.showMessage("Error occured while terminating Employee",e)}},{key:"activateEmployee",value:function(e){if(confirm("Are you sure you want to re-activate this employee contract?")){var t={};t.id=e;var a=JSON.stringify(t),l=[];l.callBackData=[],l.callBackSuccess="activateEmployeeSuccessCallback",l.callBackFail="activateEmployeeFailCallback",this.customAction("activateEmployee","admin=employees",a,l)}}},{key:"activateEmployeeSuccessCallback",value:function(e){this.showMessage("Success","Employee contract re-activated."),this.get([])}},{key:"activateEmployeeFailCallback",value:function(e){this.showMessage("Error occurred while activating Employee",e)}},{key:"view",value:function(e){this.currentId=e;var t={id:e,map:JSON.stringify(this.getSourceMapping())},a=JSON.stringify(t),l=[];l.callBackData=[],l.callBackSuccess="renderEmployee",l.callBackFail="viewFailCallBack",this.customAction("get","modules=employees",a,l)}},{key:"viewFailCallBack",value:function(e){this.showMessage("Error","Error Occured while retriving candidate")}},{key:"renderEmployee",value:function(e){var t,a=this.getFormFields();e[1],e[1],e[2];e=e[0],this.currentEmployee=e;for(var l=this.getCustomTemplate("myDetails.html"),i=0;i<a.length;i++)void 0!==this.fieldNameMap[a[i][0]]&&null!==this.fieldNameMap[a[i][0]]&&(t=this.gt(this.fieldNameMap[a[i][0]].textMapped),l=l.replace("#_label_".concat(a[i][0],"_#"),t));l=(l=l.replace(/#_.+_#/gi,"")).replace(/_id_/g,e.id),$("#".concat(this.getTableName())).html(l);for(var n=0;n<a.length;n++)$("#".concat(this.getTableName()," #").concat(a[n][0])).html(e[a[n][0]]),$("#".concat(this.getTableName()," #").concat(a[n][0],"_Name")).html(e["".concat(a[n][0],"_Name")]);for(var o="",s=0;s<e.subordinates.length;s++)void 0!==e.subordinates[s].first_name&&null!==e.subordinates[s].first_name&&(o+="".concat(e.subordinates[s].first_name," ")),void 0!==e.subordinates[s].middle_name&&null!==e.subordinates[s].middle_name&&""!==e.subordinates[s].middle_name&&(o+="".concat(e.subordinates[s].middle_name," ")),void 0!==e.subordinates[s].last_name&&null!==e.subordinates[s].last_name&&""!==e.subordinates[s].last_name&&(o+=e.subordinates[s].last_name),o+="<br/>";if($("#".concat(this.getTableName()," #subordinates")).html(o),$("#".concat(this.getTableName()," #name")).html("".concat(e.first_name," ").concat(e.last_name)),this.currentUserId=e.id,$("#".concat(this.getTableName()," #profile_image_").concat(e.id)).attr("src",e.image),void 0!==e.customFields&&null!==e.customFields&&Object.keys(e.customFields).length>0){var r;for(var c in e.customFields){e.customFields[c][1]||(e.customFields[c][1]=this.gt("Other Details"));var u=e.customFields[c][1].toLocaleLowerCase();if(u=u.replace(" ","_"),$("#cont_".concat(u)).length<=0){var d='<div class="panel panel-default" style="width:97.5%;"><div class="panel-heading"><h4>#_section.name_#</h4></div> <div class="panel-body" id="cont_#_section_#"> </div></div>';d=(d=d.replace("#_section_#",u)).replace("#_section.name_#",e.customFields[c][1]),$("#customFieldsCont").append($(d))}r=(r='<div class="col-xs-6 col-md-3" style="font-size:16px;"><label class="control-label col-xs-12" style="font-size:13px;">#_label_#</label><label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;">#_value_#</label></div>').replace("#_label_#",c),r="fileupload"===e.customFields[c][2]?r.replace("#_value_#","<button onclick=\"download('".concat(e.customFields[c][0],'\');return false;" class="btn btn-mini btn-inverse" type="button">View: ').concat(c,"</button>")):r.replace("#_value_#",e.customFields[c][0]),$("#cont_".concat(u)).append($(r))}}else $("#customFieldsCont").remove();for(var p in this.cancel(),this.isModuleInstalled("admin","documents")||$("#tabDocuments").remove(),window.modJs=this,modJs.subModJsList=[],modJs.subModJsList.tabEmployeeSkillSubTab=new h("EmployeeSkill","EmployeeSkillSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeSkillSubTab.parent=this,modJs.subModJsList.tabEmployeeEducationSubTab=new y("EmployeeEducation","EmployeeEducationSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeEducationSubTab.parent=this,modJs.subModJsList.tabEmployeeCertificationSubTab=new b("EmployeeCertification","EmployeeCertificationSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeCertificationSubTab.parent=this,modJs.subModJsList.tabEmployeeLanguageSubTab=new v("EmployeeLanguage","EmployeeLanguageSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeLanguageSubTab.parent=this,modJs.subModJsList.tabEmployeeDependentSubTab=new g("EmployeeDependent","EmployeeDependentSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeDependentSubTab.parent=this,modJs.subModJsList.tabEmployeeEmergencyContactSubTab=new _("EmergencyContact","EmployeeEmergencyContactSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeEmergencyContactSubTab.parent=this,this.isModuleInstalled("admin","documents")&&(modJs.subModJsList.tabEmployeeDocumentSubTab=new k("EmployeeDocument","EmployeeDocumentSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeDocumentSubTab.parent=this),modJs.subModJsList)modJs.subModJsList.hasOwnProperty(p)&&(modJs.subModJsList[p].setTranslationsSubModules(this.translations),modJs.subModJsList[p].setPermissions(this.permissions),modJs.subModJsList[p].setFieldTemplates(this.fieldTemplates),modJs.subModJsList[p].setTemplates(this.templates),modJs.subModJsList[p].setCustomTemplates(this.customTemplates),modJs.subModJsList[p].setEmailTemplates(this.emailTemplates),modJs.subModJsList[p].setUser(this.user),modJs.subModJsList[p].initFieldMasterData(),modJs.subModJsList[p].setBaseUrl(this.baseUrl),modJs.subModJsList[p].setCurrentProfile(this.currentProfile),modJs.subModJsList[p].setInstanceId(this.instanceId),modJs.subModJsList[p].setGoogleAnalytics(ga),modJs.subModJsList[p].setNoJSONRequests(this.noJSONRequests));modJs.subModJsList.tabEmployeeSkillSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeSkillSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeSkillSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeSkillSubTab.get([]),modJs.subModJsList.tabEmployeeEducationSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeEducationSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeEducationSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeEducationSubTab.get([]),modJs.subModJsList.tabEmployeeCertificationSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeCertificationSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeCertificationSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeCertificationSubTab.get([]),modJs.subModJsList.tabEmployeeLanguageSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeLanguageSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeLanguageSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeLanguageSubTab.get([]),modJs.subModJsList.tabEmployeeDependentSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeDependentSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeDependentSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeDependentSubTab.get([]),modJs.subModJsList.tabEmployeeEmergencyContactSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeEmergencyContactSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeEmergencyContactSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeEmergencyContactSubTab.get([]),this.isModuleInstalled("admin","documents")&&(modJs.subModJsList.tabEmployeeDocumentSubTab.setShowFormOnPopup(!0),modJs.subModJsList.tabEmployeeDocumentSubTab.setShowAddNew(!1),modJs.subModJsList.tabEmployeeDocumentSubTab.setShowCancel(!1),modJs.subModJsList.tabEmployeeDocumentSubTab.get([])),$("#subModTab a").off().on("click",(function(e){e.preventDefault(),$(this).tab("show")}))}},{key:"deleteProfileImage",value:function(e){var t={id:e},a=JSON.stringify(t),l=[];l.callBackData=[],l.callBackSuccess="modEmployeeDeleteProfileImageCallBack",l.callBackFail="modEmployeeDeleteProfileImageCallBack",this.customAction("deleteProfileImage","modules=employees",a,l)}},{key:"modEmployeeDeleteProfileImageCallBack",value:function(e){}}]),a}(S),E=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","image","employee_id","first_name","last_name","mobile_phone","department","gender","supervisor"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID"},{sTitle:"",bSortable:!1},{sTitle:"Employee Number"},{sTitle:"First Name"},{sTitle:"Last Name"},{sTitle:"Mobile"},{sTitle:"Department"},{sTitle:"Gender"},{sTitle:"Supervisor"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["employee_id",{label:"Employee Number",type:"text",validation:""}],["first_name",{label:"First Name",type:"text",validation:""}],["middle_name",{label:"Middle Name",type:"text",validation:"none"}],["last_name",{label:"Last Name",type:"text",validation:""}],["nationality",{label:"Nationality",type:"select2","remote-source":["Nationality","id","name"]}],["birthday",{label:"Date of Birth",type:"date",validation:""}],["gender",{label:"Gender",type:"select",source:[["Male","Male"],["Female","Female"],["Divers","Divers"]]}],["marital_status",{label:"Marital Status",type:"select",source:[["Married","Married"],["Single","Single"],["Divorced","Divorced"],["Widowed","Widowed"],["Other","Other"]]}],["ssn_num",{label:"SSN/NRIC",type:"text",validation:"none"}],["nic_num",{label:"NIC",type:"text",validation:"none"}],["other_id",{label:"Other ID",type:"text",validation:"none"}],["driving_license",{label:"Driving License No",type:"text",validation:"none"}],["employment_status",{label:"Employment Status",type:"select2","remote-source":["EmploymentStatus","id","name"]}],["job_title",{label:"Job Title",type:"select2","remote-source":["JobTitle","id","name"]}],["pay_grade",{label:"Pay Grade",type:"select2","allow-null":!0,"remote-source":["PayGrade","id","name"]}],["work_station_id",{label:"Work Station Id",type:"text",validation:"none"}],["address1",{label:"Address Line 1",type:"text",validation:"none"}],["address2",{label:"Address Line 2",type:"text",validation:"none"}],["city",{label:"City",type:"text",validation:"none"}],["country",{label:"Country",type:"select2","remote-source":["Country","code","name"]}],["province",{label:"Province",type:"select2","allow-null":!0,"remote-source":["Province","id","name"]}],["postal_code",{label:"Postal/Zip Code",type:"text",validation:"none"}],["home_phone",{label:"Home Phone",type:"text",validation:"none"}],["mobile_phone",{label:"Mobile Phone",type:"text",validation:"none"}],["work_phone",{label:"Work Phone",type:"text",validation:"none"}],["work_email",{label:"Work Email",type:"text",validation:"emailOrEmpty"}],["private_email",{label:"Private Email",type:"text",validation:"emailOrEmpty"}],["joined_date",{label:"Joined Date",type:"date",validation:""}],["confirmation_date",{label:"Confirmation Date",type:"date",validation:"none"}],["termination_date",{label:"Termination Date",type:"date",validation:"none"}],["department",{label:"Department",type:"select2","remote-source":["CompanyStructure","id","title"]}],["supervisor",{label:"Supervisor",type:"select2","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}],["notes",{label:"Notes",type:"datagroup",form:[["note",{label:"Note",type:"textarea",validation:""}]],html:'<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">Date: #_date_#</span><hr/>#_note_#</div></div>',validation:"none","sort-function":function(e,t){return Date.parse(e.date).getTime()<Date.parse(t.date).getTime()},"custom-validate-function":function(e){var t={valid:!0};return e.date=(new Date).toString("d-MMM-yyyy hh:mm tt"),t.params=e,t}}]]}},{key:"getFilters",value:function(){return[["job_title",{label:"Job Title",type:"select2","allow-null":!0,"null-label":"All Job Titles","remote-source":["JobTitle","id","name"]}],["department",{label:"Department",type:"select2","allow-null":!0,"null-label":"All Departments","remote-source":["CompanyStructure","id","title"]}],["supervisor",{label:"Supervisor",type:"select2","allow-null":!0,"null-label":"Anyone","remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"getActionButtonsHtml",value:function(e){var t='<div style="width:130px;">\n<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>\n<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Archive Employee" onclick="modJs.deleteEmployee(_id_);return false;"></img>\n<img class="tableActionButton" src="_BASE_images/redo.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Restore Employee" onclick="modJs.activateEmployee(_id_);return false;"></img>\n</div>';return t=(t=t.replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"download",value:function(e){var t={t:"ArchivedEmployee",sa:"downloadArchivedEmployee",mod:"admin=employees"};t.req=JSON.stringify({id:e});var a=modJs.getCustomActionUrl("ca",t);window.open(a,"_blank")}}]),a}(w),T=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee_id","first_name","last_name","work_email","department","gender","supervisor"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID"},{sTitle:"Employee Number"},{sTitle:"First Name"},{sTitle:"Last Name"},{sTitle:"Work Email"},{sTitle:"Department"},{sTitle:"Gender"},{sTitle:"Supervisor"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["employee_id",{label:"Employee Number",type:"text",validation:""}],["first_name",{label:"First Name",type:"text",validation:""}],["middle_name",{label:"Middle Name",type:"text",validation:"none"}],["last_name",{label:"Last Name",type:"text",validation:""}],["gender",{label:"Gender",type:"select",source:[["Male","Male"],["Female","Female"],["Divers","Divers"]]}],["ssn_num",{label:"SSN/NRIC",type:"text",validation:"none"}],["nic_num",{label:"NIC",type:"text",validation:"none"}],["other_id",{label:"Other ID",type:"text",validation:"none"}],["driving_license",{label:"Driving License No",type:"text",validation:"none"}],["department",{label:"Department",type:"select2","remote-source":["CompanyStructure","id","title"]}],["supervisor",{label:"Supervisor",type:"select2","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"getFilters",value:function(){return[["job_title",{label:"Job Title",type:"select2","allow-null":!0,"null-label":"All Job Titles","remote-source":["JobTitle","id","name"]}],["department",{label:"Department",type:"select2","allow-null":!0,"null-label":"All Departments","remote-source":["CompanyStructure","id","title"]}],["supervisor",{label:"Supervisor",type:"select2","allow-null":!0,"null-label":"Anyone","remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"getActionButtonsHtml",value:function(e){var t='<div style="width:130px;"><img class="tableActionButton" src="_BASE_images/download.png" style="cursor:pointer;" rel="tooltip" title="Download Archived Data" onclick="modJs.download(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Remove Archived Data" onclick="modJs.deleteRow(_id_);return false;"></img></div>';return t=(t=t.replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"download",value:function(e){var t={t:"ArchivedEmployee",sa:"downloadArchivedEmployee",mod:"admin=employees"};t.req=JSON.stringify({id:e});var a=modJs.getCustomActionUrl("ca",t);window.open(a,"_blank")}}]),a}(S),D=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","skill_id","details"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Skill"},{sTitle:"Details"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["skill_id",{label:"Skill",type:"select2","allow-null":!0,"remote-source":["Skill","id","name"]}],["details",{label:"Details",type:"textarea",validation:""}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["skill_id",{label:"Skill",type:"select2","allow-null":!0,"null-label":"All Skills","remote-source":["Skill","id","name"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),F=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","education_id","institute","date_start","date_end"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Qualification"},{sTitle:"Institute"},{sTitle:"Start Date"},{sTitle:"Completed On"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["education_id",{label:"Qualification",type:"select2","allow-null":!1,"remote-source":["Education","id","name"]}],["institute",{label:"Institute",type:"text",validation:""}],["date_start",{label:"Start Date",type:"date",validation:"none"}],["date_end",{label:"Completed On",type:"date",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["education_id",{label:"Qualification",type:"select2","allow-null":!0,"null-label":"All Qualifications","remote-source":["Education","id","name"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),M=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","certification_id","institute","date_start","date_end"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Certification"},{sTitle:"Institute"},{sTitle:"Granted On"},{sTitle:"Valid Thru"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["certification_id",{label:"Certification",type:"select2","allow-null":!1,"remote-source":["Certification","id","name"]}],["institute",{label:"Institute",type:"text",validation:""}],["date_start",{label:"Granted On",type:"date",validation:"none"}],["date_end",{label:"Valid Thru",type:"date",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["certification_id",{label:"Certification",type:"select2","allow-null":!0,"null-label":"All Certifications","remote-source":["Certification","id","name"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),A=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","language_id","reading","speaking","writing","understanding"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Language"},{sTitle:"Reading"},{sTitle:"Speaking"},{sTitle:"Writing"},{sTitle:"Understanding"}]}},{key:"getFormFields",value:function(){var e=[["Elementary Proficiency","Elementary Proficiency"],["Limited Working Proficiency","Limited Working Proficiency"],["Professional Working Proficiency","Professional Working Proficiency"],["Full Professional Proficiency","Full Professional Proficiency"],["Native or Bilingual Proficiency","Native or Bilingual Proficiency"]];return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["language_id",{label:"Language",type:"select2","allow-null":!1,"remote-source":["Language","id","name"]}],["reading",{label:"Reading",type:"select",source:e}],["speaking",{label:"Speaking",type:"select",source:e}],["writing",{label:"Writing",type:"select",source:e}],["understanding",{label:"Understanding",type:"select",source:e}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["language_id",{label:"Language",type:"select2","allow-null":!0,"null-label":"All Languages","remote-source":["Language","id","name"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),C=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","name","relationship","dob","id_number"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Name"},{sTitle:"Relationship"},{sTitle:"Date of Birth"},{sTitle:"Id Number"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["name",{label:"Name",type:"text",validation:""}],["relationship",{label:"Relationship",type:"select",source:[["Child","Child"],["Spouse","Spouse"],["Parent","Parent"],["Other","Other"]]}],["dob",{label:"Date of Birth",type:"date",validation:""}],["id_number",{label:"Id Number",type:"text",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),J=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","name","relationship","home_phone","work_phone","mobile_phone"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Name"},{sTitle:"Relationship"},{sTitle:"Home Phone"},{sTitle:"Work Phone"},{sTitle:"Mobile Phone"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["name",{label:"Name",type:"text",validation:""}],["relationship",{label:"Relationship",type:"text",validation:"none"}],["home_phone",{label:"Home Phone",type:"text",validation:"none"}],["work_phone",{label:"Work Phone",type:"text",validation:"none"}],["mobile_phone",{label:"Mobile Phone",type:"text",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),N=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","document","doc_number","issued","expiry","status","details"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Document",sClass:"columnMain"},{sTitle:"Number"},{sTitle:"Issued Date"},{sTitle:"Expiry Date"},{sTitle:"Status"},{sTitle:"Details"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["document",{label:"Document",type:"select2",source:[["Passport","Passport"],["Visa","Visa"]]}],["doc_number",{label:"Number",type:"text",validation:""}],["issued",{label:"Issued Date",type:"date",validation:""}],["expiry",{label:"Expiry Date",type:"date",validation:""}],["status",{label:"Status",type:"text",validation:"none"}],["details",{label:"Details",type:"textarea",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2","remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(S),B=function(e){u(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return c(a,[{key:"getDataMapping",value:function(){return["id","employee","document","details","date_added","status","attachment"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Document"},{sTitle:"Details"},{sTitle:"Date Added"},{sTitle:"Status"},{sTitle:"Attachment",bVisible:!1}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["employee",{label:"Employee",type:"select2",sort:"none","allow-null":!1,"remote-source":["Employee","id","first_name+last_name","getActiveSubordinateEmployees"]}],["document",{label:"Document",type:"select2","remote-source":["Document","id","name"]}],["date_added",{label:"Date Added",type:"date",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"}],["attachment",{label:"Attachment",type:"fileupload",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2","remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"getActionButtonsHtml",value:function(e,t){var a='<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/download.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Download Document" onclick="download(\'_attachment_\');return false;"></img><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></div>';return a=(a=(a=a.replace(/_id_/g,e)).replace(/_attachment_/g,t[6])).replace(/_BASE_/g,this.baseUrl)}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level&&"Restricted Admin"!==this.user.user_level}}]),a}(l.default);t.exports={EmployeeAdapter:w,TerminatedEmployeeAdapter:E,ArchivedEmployeeAdapter:T,EmployeeSkillAdapter:D,EmployeeEducationAdapter:F,EmployeeCertificationAdapter:M,EmployeeLanguageAdapter:A,EmployeeDependentAdapter:C,EmergencyContactAdapter:J,EmployeeImmigrationAdapter:N,EmployeeSubSkillsAdapter:h,EmployeeSubEducationAdapter:y,EmployeeSubCertificationAdapter:b,EmployeeSubLanguageAdapter:v,EmployeeSubDependentAdapter:g,EmployeeSubEmergencyContactAdapter:_,EmployeeSubDocumentAdapter:k,EmployeeDocumentAdapter:B}},{"../../../api/AdapterBase":4,"../../../api/SubAdapterBase":7}],3:[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 i=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,i;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),i&&l(t,i),e}();a.default=i},{}],4:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l=n(e("./ModuleBase")),i=n(e("../api-common/RequestCache"));function n(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 s(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 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 i=d(this).constructor;a=Reflect.construct(l,arguments,i)}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 p=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)}(o,e);var t,a,l,n=c(o);function o(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,o),(i=n.call(this)).moduleRelativeURL=null,i.tableData=[],i.sourceData=[],i.filter=null,i.origFilter=null,i.orderBy=null,i.currentElement=null,i.initAdapter(e,t,a,l),i}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 i.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 i=this;null==a&&(a=!0),$(e).attr("a","add"),$(e).attr("t",this.table),i.showLoader(),this.requestCache.invalidateTable(this.table),$.post(this.moduleRelativeURL,e,(function(e){"SUCCESS"===e.status?i.addSuccessCallBack(t,e.object,a,l,i):i.addFailCallBack(t,e.object)}),"json").always((function(){i.hideLoader()})),this.trackEvent("add",this.tab,this.table)}},{key:"addSuccessCallBack",value:function(e,t,a,l,i){a&&this.get(e),this.initFieldMasterData(),null!=l&&l.apply(i,[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 i="";null!==this.getOrderBy()&&(i=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:i},(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 i="";null!==this.getOrderBy()&&(i=this.getOrderBy());var n=this.moduleRelativeURL.replace("service.php","data.php");return n="".concat(n,"?t=").concat(this.table),n="".concat(n,"&sm=").concat(this.fixJSON(t)),n="".concat(n,"&cl=").concat(this.fixJSON(a)),n="".concat(n,"&ft=").concat(this.fixJSON(l)),n="".concat(n,"&ob=").concat(i),this.isSubProfileTable()&&(n="".concat(n,"&type=sub")),this.remoteTableSkipProfileRestriction()&&(n="".concat(n,"&skip=1")),n}},{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(),i=0;i<t.length;i++){for(var n=[],o=0;o<l.length;o++)n[o]=t[i][l[o]];a.push(this.preProcessTableData(n))}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,i=JSON.stringify(this.getSourceMapping());i=this.fixJSON(i),l.showLoader(),$.post(this.moduleRelativeURL,{t:this.table,a:"getElement",id:e,sm:i},(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="",i="";void 0!==e[3]&&null!==e[3]&&(l=e[3]),void 0!==e[4]&&null!==e[4]&&(i=JSON.stringify(e[4]));var n=this.requestCache.getKey(this.moduleRelativeURL,{t:e[0],key:e[1],value:e[2],method:l,methodParams:i,a:"getFieldValues"}),o=this.requestCache.getData(n);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 s=function e(l){if("SUCCESS"===l.status){a.requestCache.setData(this.success.key,l);var i=t;i.callBackData=[t.callBackData[0]],i.callBackData.push(l.data),null!==i.callBackSuccess&&void 0!==i.callBackSuccess&&i.callBackData.push(t.callBackSuccess),a.callFunction(i.callBack,i.callBackData)}else"Access violation"===l.message&&alert("Error : ".concat(e.table," ").concat(l.message))};s.key=n,s.table=e[0],$.post(this.moduleRelativeURL,{t:e[0],key:e[1],value:e[2],method:l,methodParams:i,a:"getFieldValues"},s,"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,i){var n=this;a=this.fixJSON(a),i?$.post(this.moduleRelativeURL,{t:this.table,a:"ca",sa:e,mod:t,req:a},(function(e){"SUCCESS"===e.status?(l.callBackData.push(e.data),n.callFunction(l.callBackSuccess,l.callBackData)):(l.callBackData.push(e.data),n.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),n.callFunction(l.callBackSuccess,l.callBackData)):(l.callBackData.push(e.data),n.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)}}])&&s(t.prototype,a),l&&s(t,l),o}(l.default);a.default=p},{"../api-common/RequestCache":3,"./ModuleBase":6}],5:[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 i={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}},n=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=i}var t,a,n;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"),i=e.attr("validation");$("#".concat(this.formId," #field_").concat(a)).addClass("error"),void 0===i||null==i||""===i?$("#".concat(this.formId," #help_err_").concat(a)).html(i):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 i=e.attr("id"),n=e.attr("type");if(e.hasClass("select2-focusser")||e.hasClass("select2-input"))return!0;if(jQuery.inArray(n,t.inputTypes)>=0){if(e.hasClass("uploadInput"))a=e.attr("val");else if("radio"===n||"checkbox"===n)a=$("input[name='".concat(l,"']:checked")).val();else if(e.hasClass("select2Field"))a=null!=$("#".concat(t.formId," #").concat(i)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(i)).select2("data")?$("#".concat(t.formId," #").concat(i)).select2("data").id:"";else if(e.hasClass("select2Multi"))if(null!=$("#".concat(t.formId," #").concat(i)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(i)).select2("data")){var o=$("#".concat(t.formId," #").concat(i)).select2("data");a=[];for(var s=0;s<o.length;s++)a.push(o[s].id);a=JSON.stringify(a)}else a="";else a=e.hasClass("signatureField")?$("#".concat(t.formId," #").concat(i)).data("signaturePad").isEmpty()?"":$("#".concat(i)).data("signaturePad").toDataURL():e.hasClass("simplemde")?$("#".concat(t.formId," #").concat(i)).data("simplemde").value():e.hasClass("code")?$("#".concat(t.formId," #").concat(i)).data("codemirror").getValue():e.hasClass("tinymce")?tinyMCE.get(i).getContent({format:"raw"}):e.val();var r=e.attr("validation"),c=!1;void 0!==r&&null!=r&&void 0!==t.validator[r]&&null!=t.validator[r]?c=t.validator[r](a):(c=!t.validateAll||void 0!==r&&null!=r&&"none"===r||t.validator.input(a),t.formObject[i]=a),c?(t.clearError(e,null),t.formObject[i]=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)}))}],n=[{key:"getValidationRules",value:function(){return i}}],a&&l(t.prototype,a),n&&l(t,n),e}();a.default=n},{}],6:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l,i=(l=e("./FormValidation"))&&l.__esModule?l:{default:l};function n(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 i=this.getFormFields(),n=this.getFilters();if(null!=n)for(var o=0;o<n.length;o++)(null==(l=this.getMetaFieldValues(n[o][0],i))||"select"!==l.type&&"select2"!==l.type&&"select2multi"!==l.type)&&i.push(n[o]);for(var s=[],r=[],c=null,u=null,d=0;d<i.length;d++)if(void 0!==(c=i[d])[1]["remote-source"]&&null!==c[1]["remote-source"]){var p="".concat(c[1]["remote-source"][0],"_").concat(c[1]["remote-source"][1],"_").concat(c[1]["remote-source"][2]);s.push(c),r.push(p)}else if(void 0!==c[1].form&&null!==c[1].form)for(var m=0;m<c[1].form.length;m++)if(void 0!==(u=c[1].form[m])[1]["remote-source"]&&null!==u[1]["remote-source"]){var f="".concat(u[1]["remote-source"][0],"_").concat(u[1]["remote-source"][1],"_").concat(u[1]["remote-source"][2]);r.indexOf(f)<0&&(s.push(u),r.push(f))}for(var h=0;h<s.length;h++){var y=s[h];if(void 0!==y[1]["remote-source"]&&null!=y[1]["remote-source"]){var b="".concat(y[1]["remote-source"][0],"_").concat(y[1]["remote-source"][1],"_").concat(y[1]["remote-source"][2]);this.fieldMasterDataKeys[b]=!1,this.sourceMapping[y[0]]=y[1]["remote-source"];var v={callBack:"initFieldMasterDataResponse"};v.callBackData=[b],null!=e&&(v.callBackSuccess=e),this.getFieldValues(y[1]["remote-source"],v)}}}},{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,i=this.getTableData();if(this.showActionButtons()&&t.push(this.getActionButtonHeader()),this.showActionButtons())for(var n=0;n<i.length;n++)i[n].push(this.getActionButtonsHtml(i[n][0],i[n]));l=this.getTableTopButtonHtml()+this.getTableHTMLTemplate();var o=$("#".concat(e," .dataTables_paginate .active a")).html(),s=0;void 0!==o&&null!=o&&(s=15*parseInt(o,10)-15),$("#".concat(e)).html(l);var r={oLanguage:{sLengthMenu:"_MENU_ records per page"},aaData:i,aoColumns:t,bSort:this.isSortable(),iDisplayLength:15,iDisplayStart:s},c=this.getCustomTableParams();$.extend(r,c),$("#".concat(e," #grid")).dataTable(r),$(".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 i=$("#".concat(e," .dataTables_paginate .active a")).html(),n=0;void 0!==i&&null!=i&&(n=15*parseInt(i,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:n};this.showActionButtons()&&(o.aoColumnDefs=[{fnRender:this.getActionButtons,aTargets:[this.getDataMapping().length]}]);var s=this.getCustomTableParams();$.extend(o,s),$("#".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,i,n){var o=this,s="#yesnoModel";void 0!==t&&null!=t||(t=""),$("".concat(s,"Label")).html(e),$("".concat(s,"Body")).html(t),null!=a&&$("".concat(s,"YesBtn")).html(a),null!=l&&$("".concat(s,"NoBtn")).html(l),$("".concat(s,"YesBtn")).off().on("click",(function(){void 0!==i&&null!=i&&(i.apply(o,n),o.cancelYesno())})),$(s).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,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=this,o="";o=i?"#plainMessageModel":"#messageModel",$(o).off(),i?this.renderModel("plainMessage",e,t):this.renderModel("message",e,t),null!=a?($(o).modal({show:!0}),$(o).on("hidden.bs.modal",(function(){a.apply(n,l),$(".modal-backdrop").remove()}))):$(o).modal({backdrop:"static"})}},{key:"showDomElement",value:function(e,t,a,l,i){var n=this,o="";o=i?"#dataMessageModel":"#messageModel",$(o).unbind("hide"),i?this.renderModelFromDom("dataMessage",e,t):this.renderModelFromDom("message",e,t),null!=a?($(o).modal({show:!0}),$(o).on("hidden.bs.modal",(function(){a.apply(n,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 i.default("".concat(this.getTableName(),"_submit"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(a.checkValues()){var l=a.getFormParameters();l=this.forceInjectValuesBeforeSave(l);var n=this.doCustomValidation(l);if(null==n){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(n),$("#".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 i.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,i,n,o,s="",r=this.getFilters();for(var c in null==l&&(l=[]),e)if(e.hasOwnProperty(c)){if(n="",o=null,"select"===(l=this.getMetaFieldValues(c,r)).type||"select2"===l.type){if(void 0!==l["remote-source"]&&null!=l["remote-source"])t=l["remote-source"],"NULL"===e[c]?n=void 0!==l["null-label"]&&null!=l["null-label"]?l["null-label"]:"Not Selected":o=n=this.fieldMasterData["".concat(t[0],"_").concat(t[1],"_").concat(t[2])][e[c]];else if(a=l.source[0],"NULL"===e[c])n=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=n=l.source[u][1];break}}else if("select2multi"===l.type){i=[];try{i=JSON.parse(e[c])}catch(e){}""!==(n=i.join(","))&&(o=n)}else""!==(n=e[c])&&(o=n);null!=o&&(""!==s&&(s+=" | "),s+="".concat(l.label," = ").concat(n))}return s}},{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(),i=0;i<l.length;i++){var n=this.getMetaFieldForRendering(l[i][0]);if(""===n||void 0===n)a+=this.renderFormField(l[i]);else{var o=e[n];""!==o&&null!=o&&void 0!==o&&""!==o.trim()?a+=this.renderFormField(JSON.parse(o)):a+=this.renderFormField(l[i])}}t=(t=t.replace(/_id_/g,"".concat(this.getTableName(),"_filter"))).replace(/_fields_/g,a);var s=this.generateRandom(14),r=$('<div class="reviewBlock popupForm" data-content="Form"></div>');r.attr("id",s),r.html(t),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.showDomElement("Edit",r,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,i="",n=this.getFormFields(),o=0;o<n.length;o++){var s=this.getMetaFieldForRendering(n[o][0]);if(""===s||void 0===s)i+=this.renderFormField(n[o]);else{var r=e[s];""!==r&&null!=r&&void 0!==r&&""!==r.trim()?i+=this.renderFormField(JSON.parse(r)):i+=this.renderFormField(n[o])}}l=(l=l.replace(/_id_/g,"".concat(this.getTableName(),"_submit"))).replace(/_fields_/g,i);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<n.length;d++)"datagroup"===n[d][1].type&&a.find("#".concat(n[d][0])).data("field",n[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 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,"#".concat(c)):this.setDefaultValues("#".concat(c))}else{$("#".concat(this.getTableName(),"Form")).show(),$("#".concat(this.getTableName())).hide();for(var m=0;m<t.length;m++)$("#".concat(t[m])).data("signaturePad",new SignaturePad(document.getElementById(t[m])));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,i,n,o=JSON.parse(e),s=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 r=$('<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=s).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!==(n=l[u])&&null!=n&&"string"==typeof n&&(n=n.replace(/(?:\r\n|\r|\n)/g,"<br />")),a=a.replace("#_".concat(u,"_#"),n);void 0!==t[1].render&&null!=t[1].render&&(a=a.replace("#_renderFunction_#",t[1].render(l))),(i=$(a)).attr("fieldId","".concat(t[0],"_div")),r.append(i)}return r}},{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="",i=e[1].form;void 0!==t&&null!=t&&void 0!==t.id?this.currentDataGroupItemId=t.id:this.currentDataGroupItemId=null;for(var n=0;n<i.length;n++)l+=this.renderFormField(i[n]);a=(a=a.replace(/_id_/g,"".concat(this.getTableName(),"_field_").concat(e[0]))).replace(/_fields_/g,l);var o=this.generateRandom(14),s=$('<div class="reviewBlock popupForm" data-content="Form"></div>');s.attr("id",o),s.html(a),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.currentDataGroupField=e,this.showDomElement("Add ".concat(e[1].label),s,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 i.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 n=$("#".concat(t[0])).val();""===n&&(n="[]");var o=JSON.parse(n);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"]),n=JSON.stringify(o);var s=this.dataGroupToHtml(n,t);$("#".concat(t[0],"_div")).html(""),$("#".concat(t[0],"_div")).append(s),this.makeDataGroupSortable(t,$("#".concat(t[0],"_div_inner"))),$("#".concat(t[0])).val(n),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(" "),i=0,n=0;n<l.length;n++)(i+=l[n].length+1)>t?(a+="".concat(l[n],"<br/>"),i=0):a+="".concat(l[n]," ")}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']")),i=$("#".concat(e[0])).val();""===i&&(i="[]");var n=JSON.parse(i);l.each((function(){for(var e in t=$(this).attr("id"),n)if(n[e].id===t){a.push(n[e]);break}})),$("#".concat(e[0])).val(JSON.stringify(a))}},{key:"editDataGroup",value:function(){var e=this.currentDataGroupField,t=this.currentDataGroupItemId,a=new i.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 n=e[1]["custom-validate-function"].apply(this,[l]);if(!n.valid)return $("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).html(n.message),$("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).show(),!1;l=n.params}if(this.doCustomFilterValidation(l)){var o=$("#".concat(e[0])).val();""===o&&(o="[]");for(var s=JSON.parse(o),r={},c=-1,u=[],d=0;d<s.length;d++){var p=s[d];p.id===t&&(r=p,c=d),u.push(p)}l.id=r.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 m=this.dataGroupToHtml(o,e);this.orderDataGroup(e),$("#".concat(e[0],"_div")).html(""),$("#".concat(e[0],"_div")).append(m),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),i={},n=0;n<l.length;n++){var o=l[n];o.id===e&&(i=o)}this.showDataGroup($("#".concat(t)).data("field"),i)}},{key:"dataGroupGetNextAutoIncrementId",value:function(e){for(var t,a=1,l=0;l<e.length;l++){var i=e[l];void 0!==i.id&&null!=i.id||(i.id=1),(t=i.id.substring(i.id.lastIndexOf("_")+1,i.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),i=[],n=0;n<l.length;n++){var o=l[n];o.id!==e&&i.push(o)}$("#".concat(t)).val(JSON.stringify(i)),$("#".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 i=0;i<a.length;i++)if("date"===a[i][1].type)"0000-00-00"!==e[a[i][0]]&&""!==e[a[i][0]]&&null!=e[a[i][0]]&&void 0!==e[a[i][0]]&&$("".concat(t," #").concat(a[i][0],"_date")).datepicker("setValue",e[a[i][0]]);else if("colorpick"===a[i][1].type)null!=e[a[i][0]]&&void 0!==e[a[i][0]]&&($("".concat(t," #").concat(a[i][0],"_colorpick")).colorpicker("setValue",e[a[i][0]]),$("".concat(t," #").concat(a[i][0])).val(e[a[i][0]]));else if("datetime"===a[i][1].type||"time"===a[i][1].type){if("0000-00-00 00:00:00"!==e[a[i][0]]&&""!==e[a[i][0]]&&null!=e[a[i][0]]&&void 0!==e[a[i][0]]){var n=e[a[i][0]].split(" "),o=n[0].split("-"),s=n[1].split(":");$("".concat(t," #").concat(a[i][0],"_datetime")).data("datetimepicker").setLocalDate(new Date(o[0],parseInt(o[1],10)-1,o[2],s[0],s[1],s[2]))}}else if("label"===a[i][1].type)$("".concat(t," #").concat(a[i][0])).html(e[a[i][0]]);else if("placeholder"===a[i][1].type){if(void 0!==a[i][1]["remote-source"]&&null!=a[i][1]["remote-source"]){var r="".concat(a[i][1]["remote-source"][0],"_").concat(a[i][1]["remote-source"][1],"_").concat(a[i][1]["remote-source"][2]);l=this.fieldMasterData[r][e[a[i][0]]]}else l=e[a[i][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[i][1].formatter&&a[i][1].formatter&&$.isFunction(a[i][1].formatter))try{l=a[i][1].formatter(l)}catch(e){}$("".concat(t," #").concat(a[i][0])).html(l)}else if("fileupload"===a[i][1].type)null!=e[a[i][0]]&&void 0!==e[a[i][0]]&&""!==e[a[i][0]]&&($("".concat(t," #").concat(a[i][0])).html(e[a[i][0]]),$("".concat(t," #").concat(a[i][0])).attr("val",e[a[i][0]]),$("".concat(t," #").concat(a[i][0])).show(),$("".concat(t," #").concat(a[i][0],"_download")).show(),$("".concat(t," #").concat(a[i][0],"_remove")).show()),!0===a[i][1].readonly&&$("".concat(t," #").concat(a[i][0],"_upload")).remove();else if("select"===a[i][1].type)void 0!==e[a[i][0]]&&null!=e[a[i][0]]&&""!==e[a[i][0]]||(e[a[i][0]]="NULL"),$("".concat(t," #").concat(a[i][0])).val(e[a[i][0]]);else if("select2"===a[i][1].type)void 0!==e[a[i][0]]&&null!=e[a[i][0]]&&""!==e[a[i][0]]||(e[a[i][0]]="NULL"),$("".concat(t," #").concat(a[i][0])).select2("val",e[a[i][0]]);else if("select2multi"===a[i][1].type){void 0!==e[a[i][0]]&&null!=e[a[i][0]]&&""!==e[a[i][0]]||(e[a[i][0]]="NULL");var c=[];if(void 0!==e[a[i][0]]&&null!=e[a[i][0]]&&""!==e[a[i][0]])try{c=JSON.parse(e[a[i][0]])}catch(e){}$("".concat(t," #").concat(a[i][0])).select2("val",c);var u=$("".concat(t," #").concat(a[i][0])).find(".select2-choices").height();$("".concat(t," #").concat(a[i][0])).find(".controls").css("min-height","".concat(u,"px")),$("".concat(t," #").concat(a[i][0])).css("min-height","".concat(u,"px"))}else if("datagroup"===a[i][1].type)try{var d=this.dataGroupToHtml(e[a[i][0]],a[i]);$("".concat(t," #").concat(a[i][0])).val(e[a[i][0]]),$("".concat(t," #").concat(a[i][0],"_div")).html(""),$("".concat(t," #").concat(a[i][0],"_div")).append(d),this.makeDataGroupSortable(a[i],$("".concat(t," #").concat(a[i][0],"_div_inner")))}catch(e){}else if("signature"===a[i][1].type)""===e[a[i][0]]&&void 0===e[a[i][0]]&&null==e[a[i][0]]||$("".concat(t," #").concat(a[i][0])).data("signaturePad").fromDataURL(e[a[i][0]]);else if("simplemde"===a[i][1].type)$("".concat(t," #").concat(a[i][0])).data("simplemde").value(e[a[i][0]]);else if("code"===a[i][1].type){var p=$("".concat(t," #").concat(a[i][0])).data("codemirror");p&&p.getDoc().setValue(e[a[i][0]])}else $("".concat(t," #").concat(a[i][0])).val(e[a[i][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 i=this.getCurrentProfile();t=null!=i&&void 0!==i?i.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 i in e)l.push(e[i]);!0===t[1].sort&&l.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var n=0;n<l.length;n++){var o=l[n][0],s=l[n][1],r='<option value="_id_">_val_</option>';a+=r=(r=r.replace("_id_",o)).replace("_val_",this.gt(s))}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 i in e)l.push([i,e[i]]);"true"===t[1].sort&&l.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var n=0;n<l.length;n++){var o=l[n][0],s=l[n][1],r='<option value="_id_">_val_</option>';a+=r=(r=r.replace("_id_",o)).replace("_val_",this.gt(s))}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="",i=e;i>0;--i)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}}])&&n(t.prototype,a),l&&n(t,l),e}();a.default=o},{"./FormValidation":5}],7:[function(e,t,a){"use strict";var l;function i(e){return(i="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 n(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 s(e,t){return(s=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=u(e);if(t){var i=u(this).constructor;a=Reflect.construct(l,arguments,i)}else a=l.apply(this,arguments);return c(this,a)}}function c(e,t){return!t||"object"!==i(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&&s(e,t)}(c,e);var t,a,l,i=r(c);function c(){return n(this,c),i.apply(this,arguments)}return t=c,(a=[{key:"deleteRow",value:function(e){this.deleteParams.id=e,this.confirmDelete()}},{key:"createTable",value:function(e){var t,a,l,i,n=this.getTableData(),o='<button id="#_id_#_delete" onclick="modJs.subModJsList[\'tab'.concat(e,'\'].deleteRow(\'_id_\');return false;" type="button" style="position: absolute;bottom: 5px;right: 5px;font-size: 13px;" tooltip="Delete"><li class="fa fa-times"></li></button>'),s='<button id="#_id_#_edit" onclick="modJs.subModJsList[\'tab'.concat(e,'\'].edit(\'_id_\');return false;" type="button" style="position: absolute;bottom: 5px;right: 35px;font-size: 13px;" tooltip="Edit"><li class="fa fa-edit"></li></button>'),r=$('<div class="list-group"></div>'),c=this.getSubHeader();if(r.append(c),0===n.length)r.append('<a href="#" class="list-group-item">'.concat(this.getNoDataMessage(),"</a>"));else for(var u=0;u<n.length;u++)t=n[u],l=o.replace(/_id_/g,t[0]),i=s.replace(/_id_/g,t[0]),a=this.getSubItemHtml(t,l,i),r.append(a);$("#".concat(e)).html(""),$("#".concat(e)).append(r),$("#plainMessageModel").modal("hide")}},{key:"getNoDataMessage",value:function(){return"No data found"}},{key:"getSubHeader",value:function(){return $('<a href="#" onclick="return false;" class="list-group-item" style="background:#eee;"><h4 class="list-group-item-heading">'.concat(this.getSubHeaderTitle(),"</h4></a>"))}}])&&o(t.prototype,a),l&&o(t,l),c}(((l=e("./AdapterBase"))&&l.__esModule?l:{default:l}).default);a.default=d},{"./AdapterBase":4}]},{},[1]);
|
|
//# sourceMappingURL=employees.js.map
|