!function(){return function e(t,l,a){function i(n,s){if(!l[n]){if(!t[n]){var r="function"==typeof require&&require;if(!s&&r)return r(n,!0);if(o)return o(n,!0);var u=new Error("Cannot find module '"+n+"'");throw u.code="MODULE_NOT_FOUND",u}var d=l[n]={exports:{}};t[n][0].call(d.exports,function(e){return i(t[n][1][e]||e)},d,d.exports,e,t,l,a)}return l[n].exports}for(var o="function"==typeof require&&require,n=0;n'+this.gt("Skills")}},{key:"getSubItemHtml",value:function(e,t,l){return $('
'+e[2]+t+l+'

'+nl2br(e[3])+"

")}}]),t}(),c=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,o.default),a(t,[{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''+this.gt("Education")}},{key:"getSubItemHtml",value:function(e,t,l){var a="";try{a=Date.parse(e[4]).toString("MMM d, yyyy")}catch(e){console.log("Error:"+e.message)}var i="";try{i=Date.parse(e[5]).toString("MMM d, yyyy")}catch(e){console.log("Error:"+e.message)}return $('
'+e[2]+t+l+'

Start: '+a+'

Completed: '+i+'

Institute: '+e[3]+"

")}}]),t}(),p=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,o.default),a(t,[{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''+this.gt("Certifications")}},{key:"getSubItemHtml",value:function(e,t,l){var a="";try{a=Date.parse(e[4]).toString("MMM d, yyyy")}catch(e){console.log("Error:"+e.message)}var i="";try{i=Date.parse(e[5]).toString("MMM d, yyyy")}catch(e){console.log("Error:"+e.message)}return $('
'+e[2]+t+l+'

Granted On: '+a+'

Valid Thru: '+i+'

Institute: '+e[3]+"

")}}]),t}(),m=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,o.default),a(t,[{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''+this.gt("Languages")}},{key:"getSubItemHtml",value:function(e,t,l){return $('
'+e[2]+t+l+'

Reading: '+e[3]+'

Speaking: '+e[4]+'

Writing: '+e[5]+'

Understanding: '+e[6]+"

")}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level}}]),t}(),h=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,o.default),a(t,[{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''+this.gt("Dependents")}},{key:"getSubItemHtml",value:function(e,t,l){return $('
'+e[2]+t+l+'

Relationship: '+e[3]+'

Name: '+e[2]+"

")}}]),t}(),f=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,o.default),a(t,[{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''+this.gt("Emergency Contacts")}},{key:"getSubItemHtml",value:function(e,t,l){return $('
'+e[2]+t+l+'

Relationship: '+e[3]+'

Name: '+e[2]+'

Home Phone: '+e[4]+'

Mobile Phone: '+e[6]+"

")}}]),t}(),y=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,o.default),a(t,[{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''+this.gt("Documents")}},{key:"getSubItemHtml",value:function(e,t,l){var a="";try{a=Date.parse(e[5]).toString("MMM d, yyyy")}catch(e){console.log(e.message)}var i='';return $('
'+e[2]+i+t+l+'

'+nl2br(e[3])+'

Expire On: '+a+"

")}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level}}]),t}(),b=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,i.default),a(t,[{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level}}]),t}(),v=function(e){function t(e,l,a,i){s(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l,a,i));return o.fieldNameMap={},o.hiddenFields={},o.tableFields={},o.formOnlyFields={},o}return u(t,b),a(t,[{key:"setFieldNameMap",value:function(e){for(var t=void 0,l=0;l'.replace("_img_",t)}return t}},{key:"getTableHTMLTemplate",value:function(){return'
'}},{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=[],l=0;l
#_delete_##_edit_#Date: #_date_#
#_note_#
',validation:"none","sort-function":function(e,t){return Date.parse(e.date).getTime()";return l=(l=l.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="+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 l=JSON.stringify(t),a=[];a.callBackData=[],a.callBackSuccess="terminateEmployeeSuccessCallback",a.callBackFail="terminateEmployeeFailCallback",this.customAction("terminateEmployee","admin=employees",l,a)}}},{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 l=JSON.stringify(t),a=[];a.callBackData=[],a.callBackSuccess="activateEmployeeSuccessCallback",a.callBackFail="activateEmployeeFailCallback",this.customAction("activateEmployee","admin=employees",l,a)}}},{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())},l=JSON.stringify(t),a=[];a.callBackData=[],a.callBackSuccess="renderEmployee",a.callBackFail="viewFailCallBack",this.customAction("get","modules=employees",l,a)}},{key:"viewFailCallBack",value:function(e){this.showMessage("Error","Error Occured while retriving candidate")}},{key:"renderEmployee",value:function(e){var t=void 0,l=this.getFormFields();e[1],e[1],e[2];e=e[0],this.currentEmployee=e;for(var a=this.getCustomTemplate("myDetails.html"),i=0;i";if($("#"+this.getTableName()+" #subordinates").html(n),$("#"+this.getTableName()+" #name").html(e.first_name+" "+e.last_name),this.currentUserId=e.id,$("#"+this.getTableName()+" #profile_image_"+e.id).attr("src",e.image),void 0!==e.customFields&&null!==e.customFields&&Object.keys(e.customFields).length>0){var r=void 0;for(var u in e.customFields){e.customFields[u][1]||(e.customFields[u][1]=this.gt("Other Details"));var b=e.customFields[u][1].toLocaleLowerCase();if(b=b.replace(" ","_"),$("#cont_"+b).length<=0){var v='

#_section.name_#

';v=(v=v.replace("#_section_#",b)).replace("#_section.name_#",e.customFields[u][1]),$("#customFieldsCont").append($(v))}r=(r='
').replace("#_label_#",u),r="fileupload"===e.customFields[u][2]?r.replace("#_value_#",""):r.replace("#_value_#",e.customFields[u][0]),$("#cont_"+b).append($(r))}}else $("#customFieldsCont").remove();for(var g in this.cancel(),this.isModuleInstalled("admin","documents")||$("#tabDocuments").remove(),window.modJs=this,modJs.subModJsList=[],modJs.subModJsList.tabEmployeeSkillSubTab=new d("EmployeeSkill","EmployeeSkillSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeSkillSubTab.parent=this,modJs.subModJsList.tabEmployeeEducationSubTab=new c("EmployeeEducation","EmployeeEducationSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeEducationSubTab.parent=this,modJs.subModJsList.tabEmployeeCertificationSubTab=new p("EmployeeCertification","EmployeeCertificationSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeCertificationSubTab.parent=this,modJs.subModJsList.tabEmployeeLanguageSubTab=new m("EmployeeLanguage","EmployeeLanguageSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeLanguageSubTab.parent=this,modJs.subModJsList.tabEmployeeDependentSubTab=new h("EmployeeDependent","EmployeeDependentSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeDependentSubTab.parent=this,modJs.subModJsList.tabEmployeeEmergencyContactSubTab=new f("EmergencyContact","EmployeeEmergencyContactSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeEmergencyContactSubTab.parent=this,this.isModuleInstalled("admin","documents")&&(modJs.subModJsList.tabEmployeeDocumentSubTab=new y("EmployeeDocument","EmployeeDocumentSubTab",{employee:e.id}),modJs.subModJsList.tabEmployeeDocumentSubTab.parent=this),modJs.subModJsList)modJs.subModJsList.hasOwnProperty(g)&&(modJs.subModJsList[g].setTranslationsSubModules(this.translations),modJs.subModJsList[g].setPermissions(this.permissions),modJs.subModJsList[g].setFieldTemplates(this.fieldTemplates),modJs.subModJsList[g].setTemplates(this.templates),modJs.subModJsList[g].setCustomTemplates(this.customTemplates),modJs.subModJsList[g].setEmailTemplates(this.emailTemplates),modJs.subModJsList[g].setUser(this.user),modJs.subModJsList[g].initFieldMasterData(),modJs.subModJsList[g].setBaseUrl(this.baseUrl),modJs.subModJsList[g].setCurrentProfile(this.currentProfile),modJs.subModJsList[g].setInstanceId(this.instanceId),modJs.subModJsList[g].setGoogleAnalytics(ga),modJs.subModJsList[g].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},l=JSON.stringify(t),a=[];a.callBackData=[],a.callBackSuccess="modEmployeeDeleteProfileImageCallBack",a.callBackFail="modEmployeeDeleteProfileImageCallBack",this.customAction("deleteProfileImage","modules=employees",l,a)}},{key:"modEmployeeDeleteProfileImageCallBack",value:function(e){}}]),t}(),g=function(e){function t(){return s(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,v),a(t,[{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"]]}],["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:'
#_delete_##_edit_#Date: #_date_#
#_note_#
',validation:"none","sort-function":function(e,t){return Date.parse(e.date).getTime()';return l=(l=(l=l.replace(/_id_/g,e)).replace(/_attachment_/g,t[6])).replace(/_BASE_/g,this.baseUrl)}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level}}]),t}();t.exports={EmployeeAdapter:v,TerminatedEmployeeAdapter:g,ArchivedEmployeeAdapter:_,EmployeeSkillAdapter:k,EmployeeEducationAdapter:S,EmployeeCertificationAdapter:E,EmployeeLanguageAdapter:w,EmployeeDependentAdapter:T,EmergencyContactAdapter:D,EmployeeImmigrationAdapter:F,EmployeeSubSkillsAdapter:d,EmployeeSubEducationAdapter:c,EmployeeSubCertificationAdapter:p,EmployeeSubLanguageAdapter:m,EmployeeSubDependentAdapter:h,EmployeeSubEmergencyContactAdapter:f,EmployeeSubDocumentAdapter:y,EmployeeDocumentAdapter:M}},{"../../../api/AdapterBase":4,"../../../api/SubAdapterBase":7}],3:[function(e,t,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var a=function(){function e(e,t){for(var l=0;l0&&localStorage.removeItem(t)}},{key:"getData",value:function(e){var t=void 0;if("undefined"==typeof Storage)return null;var l=localStorage.getItem(e);return void 0!==l&&null!=l&&""!==l?void 0===(t=JSON.parse(l))||null==t?null: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 l=JSON.stringify(t);return localStorage.setItem(e,l),l}}]),e}();l.default=i},{}],4:[function(e,t,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var a=function(){function e(e,t){for(var l=0;l0}},o=function(){function e(t,l,a){!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=l,this.errorMap=[],this.settings={thirdPartyPopup:null,LabelErrorClass:!1,ShowPopup:!0},this.settings=jQuery.extend(this.settings,a),this.inputTypes=["text","radio","checkbox","file","password","select-one","select-multi","textarea","fileupload","signature"],this.validator=i}return a(e,[{key:"clearError",value:function(e,t){var l=e.attr("id");$("#"+this.formId+" #field_"+l).removeClass("error"),$("#"+this.formId+" #help_"+l).html("")}},{key:"addError",value:function(e,t){this.formError=!0,null!=e.attr("message")?(this.errorMessages+=e.attr("message")+"\n",this.errorMap[e.attr("name")]=e.attr("message")):this.errorMap[e.attr("name")]="";var l=e.attr("id"),a=e.attr("validation"),i=e.attr("validation");$("#"+this.formId+" #field_"+l).addClass("error"),void 0===i||null==i||""===i?$("#"+this.formId+" #help_err_"+l).html(i):void 0===a||null==a||""===a?$("#"+this.formId+" #help_err_"+l).html("Required"):"float"===a||"number"===a?$("#"+this.formId+" #help_err_"+l).html("Number required"):"email"===a?$("#"+this.formId+" #help_err_"+l).html("Email required"):$("#"+this.formId+" #help_err_"+l).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 l=function(e){var l=null,a=e.attr("name");!1!==t.settings.LabelErrorClass&&$("label[for='"+a+"']").removeClass(t.settings.LabelErrorClass);var i=e.attr("id"),o=e.attr("type");if(e.hasClass("select2-focusser")||e.hasClass("select2-input"))return!0;if(jQuery.inArray(o,t.inputTypes)>=0){if(e.hasClass("uploadInput"))l=e.attr("val");else if("radio"===o||"checkbox"===o)l=$("input[name='"+a+"']:checked").val();else if(e.hasClass("select2Field"))l=null!=$("#"+t.formId+" #"+i).select2("data")&&void 0!==$("#"+t.formId+" #"+i).select2("data")?$("#"+t.formId+" #"+i).select2("data").id:"";else if(e.hasClass("select2Multi"))if(null!=$("#"+t.formId+" #"+i).select2("data")&&void 0!==$("#"+t.formId+" #"+i).select2("data")){var n=$("#"+t.formId+" #"+i).select2("data");l=[];for(var s=0;s'),null!=this.getFilters()&&(""!==e&&(e+="  "),e+='',e+="  ",this.filtersAlreadySet?e+='':e+=''),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='
'+e+"
"),e}},{key:"getActionButtonHeader",value:function(){return{sTitle:"",sClass:"center"}}},{key:"getTableHTMLTemplate",value:function(){return'
'}},{key:"isSortable",value:function(){return!0}},{key:"createTable",value:function(e){if(this.getRemoteTable())this.createTableServer(e);else{var t=this.getHeaders();for(var l in t)t[l].sTitle=this.gt(t[l].sTitle);var a=this.getTableData();if(this.showActionButtons()&&t.push(this.getActionButtonHeader()),this.showActionButtons())for(var i=0;i")),$("#"+e+"ModelLabel").html(t),$("#"+e+"ModelBody").html(""),$("#"+e+"ModelBody").append(l)}},{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 l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this,n="";n=i?"#plainMessageModel":"#messageModel",$(n).off(),i?this.renderModel("plainMessage",e,t):this.renderModel("message",e,t),null!=l?($(n).modal({show:!0}),$(n).on("hidden.bs.modal",function(){l.apply(o,a),$(".modal-backdrop").remove()})):$(n).modal({backdrop:"static"})}},{key:"showDomElement",value:function(e,t,l,a,i){var o=this,n="";n=i?"#dataMessageModel":"#messageModel",$(n).unbind("hide"),i?this.renderModelFromDom("dataMessage",e,t):this.renderModelFromDom("message",e,t),null!=l?($(n).modal({show:!0}),$(n).on("hidden.bs.modal",function(){l.apply(o,a),$(".modal-backdrop").remove()})):$(n).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 l=new n.default(this.getTableName()+"_submit",!0,{ShowPopup:!1,LabelErrorClass:"error"});if(l.checkValues()){var a=l.getFormParameters();a=this.forceInjectValuesBeforeSave(a);var i=this.doCustomValidation(a);if(null==i){this.csrfRequired&&(a.csrf=$("#"+this.getTableName()+"Form").data("csrf"));var o=$("#"+this.getTableName()+"_submit #id").val();null!=o&&void 0!==o&&""!==o&&(a.id=o),a=this.makeEmptyDateFieldsNull(a),this.add(a,[],e,t)}else $("#"+this.getTableName()+"Form .label").html(i),$("#"+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:"forceInjectValuesBeforeSave",value:function(e){return e}},{key:"doCustomValidation",value:function(e){return null}},{key:"filterQuery",value:function(){var e=new n.default(this.getTableName()+"_filter",!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters();if(this.doCustomFilterValidation(t)){for(var l in t)t.hasOwnProperty(l)&&"NULL"===t[l]&&delete t[l];this.setFilter(t),this.filtersAlreadySet=!0,$("#"+this.getTableName()+"_resetFilters").show(),this.currentFilterString=this.getFilterString(t),this.get([]),this.closePlainMessage()}}}},{key:"getFilterString",value:function(e){var t="",l=void 0,a=void 0,i=void 0,o=void 0,n=void 0,s=void 0,r=this.getFilters();for(var u in null==i&&(i=[]),e)if(e.hasOwnProperty(u)){if(n="",s=null,"select"===(i=this.getMetaFieldValues(u,r)).type||"select2"===i.type){if(void 0!==i["remote-source"]&&null!=i["remote-source"])l=i["remote-source"],"NULL"===e[u]?n=void 0!==i["null-label"]&&null!=i["null-label"]?i["null-label"]:"Not Selected":s=n=this.fieldMasterData[l[0]+"_"+l[1]+"_"+l[2]][e[u]];else if(a=i.source[0],"NULL"===e[u])n=void 0!==i["null-label"]&&null!=i["null-label"]?i["null-label"]:"Not Selected";else for(var d=0;d');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:"#"+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"),l=t.find(".select2-choices").height();t.height(parseInt(l,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,"#"+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 l=this.templates.formTemplate,a="",i=this.getFormFields(),o=0;o')).attr("id",u):r=$("#"+this.getTableName()+"Form"),r.html(l),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:"#"+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"),l=t.find(".select2-choices").height();t.height(parseInt(l,10))})}),r.find(".signatureField").each(function(){t.push($(this).attr("id"))});for(var d=0;d'),u=0;u
  • ')).replace("#_edit_#",'
  • ')).replace(/#_id_#/g,i.id),i)void 0!==(n=i[d])&&null!=n&&"string"==typeof n&&(n=n.replace(/(?:\r\n|\r|\n)/g,"
    ")),a=a.replace("#_"+d+"_#",n);void 0!==t[1].render&&null!=t[1].render&&(a=a.replace("#_renderFunction_#",t[1].render(i))),(o=$(a)).attr("fieldId",t[0]+"_div"),r.append(o)}return r}},{key:"resetDataGroup",value:function(e){$("#"+e[0]).val(""),$("#"+e[0]+"_div").html("")}},{key:"showDataGroup",value:function(e,t){var l=this.templates.datagroupTemplate,a="",i=e[1].form;void 0!==t&&null!=t&&void 0!==t.id?this.currentDataGroupItemId=t.id:this.currentDataGroupItemId=null;for(var o=0;o');s.attr("id",n),s.html(l),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:"#"+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"),l=t.find(".select2-choices").height();t.height(parseInt(l,10))})}),this.currentDataGroupField=e,this.showDomElement("Add "+e[1].label,s,null,null,!0),void 0!==t&&null!=t?this.fillForm(t,"#"+this.getTableName()+"_field_"+e[0],e[1].form):this.setDefaultValues("#"+this.getTableName()+"_field_"+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: "+e.message)}return!1}):$(".groupAddBtn").on("click",function(e){e.preventDefault(),e.stopPropagation();try{modJs.addDataGroup()}catch(e){console.log("Error adding data group: "+e.message)}return!1})}},{key:"addDataGroup",value:function(){var e=this.currentDataGroupField,t=void 0;$("#"+this.getTableName()+"_field_"+e[0]+"_error").html(""),$("#"+this.getTableName()+"_field_"+e[0]+"_error").hide();var l=new n.default(this.getTableName()+"_field_"+e[0],!0,{ShowPopup:!1,LabelErrorClass:"error"});if(l.checkValues()){var a=l.getFormParameters();if(void 0!==e[1]["custom-validate-function"]&&null!=e[1]["custom-validate-function"]){if(!(t=e[1]["custom-validate-function"].apply(this,[a])).valid)return $("#"+this.getTableName()+"_field_"+e[0]+"_error").html(t.message),$("#"+this.getTableName()+"_field_"+e[0]+"_error").show(),!1;a=t.params}var i=$("#"+e[0]).val();""===i&&(i="[]");var o=JSON.parse(i);a.id=e[0]+"_"+this.dataGroupGetNextAutoIncrementId(o),o.push(a),void 0!==e[1]["sort-function"]&&null!=e[1]["sort-function"]&&o.sort(e[1]["sort-function"]),i=JSON.stringify(o);var s=this.dataGroupToHtml(i,e);$("#"+e[0]+"_div").html(""),$("#"+e[0]+"_div").append(s),this.makeDataGroupSortable(e,$("#"+e[0]+"_div_inner")),$("#"+e[0]).val(i),this.orderDataGroup(e),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 l="";try{for(var a=e.split(" "),i=0,o=0;ot?(l+=a[o]+"
    ",i=0):l+=a[o]+" "}catch(e){}return l}},{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 l=$(e.target);if(!/html|body/i.test(l.offsetParent()[0].tagName)){var a=e.pageY-l.offsetParent().offset().top-t.helper.outerHeight(!0)/2;t.helper.css({top:a+"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=[],l=void 0,a=$("#"+e[0]+"_div_inner [fieldid='"+e[0]+"_div']"),i=$("#"+e[0]).val();""===i&&(i="[]");var o=JSON.parse(i);a.each(function(){for(var e in l=$(this).attr("id"),o)if(o[e].id===l){t.push(o[e]);break}}),$("#"+e[0]).val(JSON.stringify(t))}},{key:"editDataGroup",value:function(){var e=this.currentDataGroupField,t=this.currentDataGroupItemId,l=new n.default(this.getTableName()+"_field_"+e[0],!0,{ShowPopup:!1,LabelErrorClass:"error"});if(l.checkValues()){var a=l.getFormParameters();if(void 0!==e[1]["custom-validate-function"]&&null!=e[1]["custom-validate-function"]){var i=e[1]["custom-validate-function"].apply(this,[a]);if(!i.valid)return $("#"+this.getTableName()+"_field_"+e[0]+"_error").html(i.message),$("#"+this.getTableName()+"_field_"+e[0]+"_error").show(),!1;a=i.params}if(this.doCustomFilterValidation(a)){var o=$("#"+e[0]).val();""===o&&(o="[]");for(var s=JSON.parse(o),r={},u=-1,d=[],c=0;c=t&&(t=parseInt(l,10)+1)}return t}},{key:"deleteDataGroupItem",value:function(e){for(var t=e.substring(0,e.lastIndexOf("_")),l=$("#"+t).val(),a=JSON.parse(l),i=[],o=0;o")}catch(e){}if(void 0!==l[i][1].formatter&&l[i][1].formatter&&$.isFunction(l[i][1].formatter))try{a=l[i][1].formatter(a)}catch(e){}$(t+" #"+l[i][0]).html(a)}else if("fileupload"===l[i][1].type)null!=e[l[i][0]]&&void 0!==e[l[i][0]]&&""!==e[l[i][0]]&&($(t+" #"+l[i][0]).html(e[l[i][0]]),$(t+" #"+l[i][0]).attr("val",e[l[i][0]]),$(t+" #"+l[i][0]).show(),$(t+" #"+l[i][0]+"_download").show(),$(t+" #"+l[i][0]+"_remove").show()),!0===l[i][1].readonly&&$(t+" #"+l[i][0]+"_upload").remove();else if("select"===l[i][1].type)void 0!==e[l[i][0]]&&null!=e[l[i][0]]&&""!==e[l[i][0]]||(e[l[i][0]]="NULL"),$(t+" #"+l[i][0]).val(e[l[i][0]]);else if("select2"===l[i][1].type)void 0!==e[l[i][0]]&&null!=e[l[i][0]]&&""!==e[l[i][0]]||(e[l[i][0]]="NULL"),$(t+" #"+l[i][0]).select2("val",e[l[i][0]]);else if("select2multi"===l[i][1].type){void 0!==e[l[i][0]]&&null!=e[l[i][0]]&&""!==e[l[i][0]]||(e[l[i][0]]="NULL");var u=[];if(void 0!==e[l[i][0]]&&null!=e[l[i][0]]&&""!==e[l[i][0]])try{u=JSON.parse(e[l[i][0]])}catch(e){}$(t+" #"+l[i][0]).select2("val",u);var d=$(t+" #"+l[i][0]).find(".select2-choices").height();$(t+" #"+l[i][0]).find(".controls").css("min-height",d+"px"),$(t+" #"+l[i][0]).css("min-height",d+"px")}else if("datagroup"===l[i][1].type)try{var c=this.dataGroupToHtml(e[l[i][0]],l[i]);$(t+" #"+l[i][0]).val(e[l[i][0]]),$(t+" #"+l[i][0]+"_div").html(""),$(t+" #"+l[i][0]+"_div").append(c),this.makeDataGroupSortable(l[i],$(t+" #"+l[i][0]+"_div_inner"))}catch(e){}else"signature"===l[i][1].type?""===e[l[i][0]]&&void 0===e[l[i][0]]&&null==e[l[i][0]]||$(t+" #"+l[i][0]).data("signaturePad").fromDataURL(e[l[i][0]]):"simplemde"===l[i][1].type?$(t+" #"+l[i][0]).data("simplemde").value(e[l[i][0]]):$(t+" #"+l[i][0]).val(e[l[i][0]])}},{key:"cancel",value:function(){$("#"+this.getTableName()+"Form").hide(),$("#"+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 l=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=e[1].label+'*')}if("text"===e[1].type||"textarea"===e[1].type||"hidden"===e[1].type||"label"===e[1].type||"placeholder"===e[1].type)l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("select"===e[1].type||"select2"===e[1].type||"select2multi"===e[1].type){if(l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label),void 0!==e[1].source&&null!=e[1].source)l=l.replace("_options_",this.renderFormSelectOptions(e[1].source,e));else if(void 0!==e[1]["remote-source"]&&null!=e[1]["remote-source"]){var a=e[1]["remote-source"][0]+"_"+e[1]["remote-source"][1]+"_"+e[1]["remote-source"][2];l=l.replace("_options_",this.renderFormSelectOptionsRemote(this.fieldMasterData[a],e))}}else if("colorpick"===e[1].type)l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("date"===e[1].type)l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("datetime"===e[1].type)l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("time"===e[1].type)l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("fileupload"===e[1].type){l=(l=l.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,l=(l=l.replace(/_userId_/g,t)).replace(/_group_/g,this.tab),l=(l=void 0!==e[1].filetypes&&null!=e[1].filetypes?l.replace(/_filetypes_/g,e[1].filetypes):l.replace(/_filetypes_/g,"all")).replace(/_rand_/g,this.generateRandom(14))}else"datagroup"===e[1].type?l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label):"signature"===e[1].type?l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label):"tinymce"!==e[1].type&&"simplemde"!==e[1].type||(l=(l=l.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label));return l=void 0!==e[1].validation&&null!=e[1].validation&&""!==e[1].validation?l.replace(/_validation_/g,'validation="'+e[1].validation+'"'):l.replace(/_validation_/g,""),l=void 0!==e[1].help&&null!==e[1].help?(l=l.replace(/_helpline_/g,e[1].help)).replace(/_hidden_class_help_/g,""):(l=l.replace(/_helpline_/g,"")).replace(/_hidden_class_help_/g,"hide"),l=void 0!==e[1].placeholder&&null!==e[1].placeholder?l.replace(/_placeholder_/g,'placeholder="'+e[1].placeholder+'"'):l.replace(/_placeholder_/g,""),l=void 0!==e[1].mask&&null!==e[1].mask?l.replace(/_mask_/g,'mask="'+e[1].mask+'"'):l.replace(/_mask_/g,"")}},{key:"renderFormSelectOptions",value:function(e,t){var l="";null!=t&&void 0!==t&&!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?l+='":l+='');var a=[];for(var i in e)a.push(e[i]);!0===t[1].sort&&a.sort(function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0});for(var o=0;o_val_';l+=r=(r=r.replace("_id_",n)).replace("_val_",this.gt(s))}return l}},{key:"renderFormSelectOptionsRemote",value:function(e,t){var l="";!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?l+='":l+='');var a=[];for(var i in e)a.push([i,e[i]]);"true"===t[1].sort&&a.sort(function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0});for(var o=0;o_val_';l+=r=(r=r.replace("_id_",n)).replace("_val_",this.gt(s))}return l}},{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 l='
    _edit__delete__clone_
    ';return l=this.showAddNew?l.replace("_clone_",''):l.replace("_clone_",""),l=this.showDelete?l.replace("_delete_",''):l.replace("_delete_",""),l=(l=(l=this.showEdit?l.replace("_edit_",''):l.replace("_edit_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"generateRandom",value:function(e){for(var t=new Date,l="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a="",i=e;i>0;--i)a+=l[Math.round(Math.random()*(l.length-1))];return a+t.getTime()}},{key:"checkFileType",value:function(e,t){var l=document.getElementById(e),a="";return l.value.lastIndexOf(".")>0&&(a=l.value.substring(l.value.lastIndexOf(".")+1,l.value.length)),a=a.toLowerCase(),!(t.split(",").indexOf(a)<0)||(l.value="",this.showMessage("File Type Error","Selected file type is not supported"),this.clearFileElement(e),!1)}},{key:"clearFileElement",value:function(e){var t=$("#"+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),l=t.toGMTString();return(t-new Date(l.substring(0,l.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 l in e)t+=''.replace("__val__",l).replace("__text__",e[l]);return t}},{key:"isModuleInstalled",value:function(e,t){return void 0!==modulesInstalled&&null!==modulesInstalled&&1===modulesInstalled[e+"_"+t]}},{key:"setCustomFields",value:function(e){for(var t=void 0,l=void 0,a=0;a
  • ',s='',r=$('
    '),u=this.getSubHeader();if(r.append(u),0===o.length)r.append(''+this.getNoDataMessage()+"");else for(var d=0;d

    '+this.getSubHeaderTitle()+"

    ")}}]),t}();l.default=s},{"./AdapterBase":4}]},{},[1]); //# sourceMappingURL=employees.js.map