v26.6.0 updates

This commit is contained in:
Thilina Hasantha committed 2019-07-26 03:53:24 +02:00
1 parent c3344b99fa
commit fd99ea299e
195 files changed
+18838 -2639

No files matched your search

+1 -1
View File
@@ -1,2 +1,2 @@
!function(){return function e(t,a,l){function i(n,s){if(!a[n]){if(!t[n]){var o="function"==typeof require&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);var u=new Error("Cannot find module '"+n+"'");throw u.code="MODULE_NOT_FOUND",u}var c=a[n]={exports:{}};t[n][0].call(c.exports,function(e){return i(t[n][1][e]||e)},c,c.exports,e,t,a,l)}return a[n].exports}for(var r="function"==typeof require&&require,n=0;n<l.length;n++)i(l[n]);return i}}()({1:[function(e,t,a){"use strict";var l=e("./lib");window.AttendanceAdapter=l.AttendanceAdapter,window.AttendanceStatusAdapter=l.AttendanceStatusAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),i=n(e("../../../api/AdapterBase")),r=n(e("../../../api/FormValidation"));function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(e,a,l,i){s(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a,l,i));return r.photoAttendance=!1,r}return u(t,i.default),l(t,[{key:"getDataMapping",value:function(){return["id","employee","in_time","out_time","note"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Time-In"},{sTitle:"Time-Out"},{sTitle:"Note"}]}},{key:"getFormFields",value:function(){return[["employee",{label:"Employee",type:"select2","allow-null":!1,"remote-source":["Employee","id","first_name+last_name"]}],["id",{label:"ID",type:"hidden"}],["in_time",{label:"Time-In",type:"datetime"}],["out_time",{label:"Time-Out",type:"datetime",validation:"none"}],["note",{label:"Note",type:"textarea",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2","allow-null":!1,"remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"setPhotoAttendance",value:function(e){this.photoAttendance=parseInt(e,10)}},{key:"getCustomTableParams",value:function(){var e=this;return{aoColumnDefs:[{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,2)},aTargets:[2]},{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,3)},aTargets:[3]},{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,4)},aTargets:[4]},{fnRender:e.getActionButtons,aTargets:[e.getDataMapping().length]}]}}},{key:"preProcessRemoteTableData",value:function(e,t,a){return 2===a?"0000-00-00 00:00:00"===t||""===t||void 0===t||null==t?"":Date.parse(t).toString("yyyy MMM d <b>HH:mm</b>"):3===a?"0000-00-00 00:00:00"===t||""===t||void 0===t||null==t?"":Date.parse(t).toString("MMM d <b>HH:mm</b>"):4===a?null!=t&&t.length>10?t.substring(0,10)+"..":t:void 0}},{key:"save",value:function(){var e=new r.default(this.getTableName()+"_submit",!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters(),a=this.doCustomValidation(t);if(null==a){var l=$("#"+this.getTableName()+"_submit #id").val();null!=l&&void 0!==l&&""!==l&&(t.id=l);var i=JSON.stringify(t),n=[];n.callBackData=[],n.callBackSuccess="saveSuccessCallback",n.callBackFail="saveFailCallback",this.customAction("savePunch","admin=attendance",i,n)}else{var s=$("#"+this.getTableName()+"Form .label");s.html(a),s.show()}}}},{key:"saveSuccessCallback",value:function(e){this.get(e)}},{key:"saveFailCallback",value:function(e){this.showMessage("Error saving attendance entry",e)}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level}},{key:"showPunchImages",value:function(e){var t=JSON.stringify({id:e}),a=[];a.callBackData=[],a.callBackSuccess="getImagesSuccessCallback",a.callBackFail="getImagesFailCallback",this.customAction("getImages","admin=attendance",t,a)}},{key:"getImagesSuccessCallback",value:function(e){if($("#attendancePhotoModel").modal("show"),$("#attendnaceCanvasEmp").html(e.employee_Name),e.in_time&&$("#attendnaceCanvasPunchInTime").html(Date.parse(e.in_time).toString("yyyy MMM d <b>HH:mm</b>")),e.image_in){var t=document.getElementById("attendnaceCanvasIn").getContext("2d"),a=new Image;a.onload=function(){t.drawImage(a,0,0)},a.src=e.image_in}if(e.out_time&&$("#attendnaceCanvasPunchOutTime").html(Date.parse(e.out_time).toString("yyyy MMM d <b>HH:mm</b>")),e.image_out){var l=document.getElementById("attendnaceCanvasOut").getContext("2d"),i=new ImaLine truncated
!function(){return function e(t,a,l){function i(r,s){if(!a[r]){if(!t[r]){var o="function"==typeof require&&require;if(!s&&o)return o(r,!0);if(n)return n(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var c=a[r]={exports:{}};t[r][0].call(c.exports,function(e){return i(t[r][1][e]||e)},c,c.exports,e,t,a,l)}return a[r].exports}for(var n="function"==typeof require&&require,r=0;r<l.length;r++)i(l[r]);return i}}()({1:[function(e,t,a){"use strict";var l=e("./lib");window.AttendanceAdapter=l.AttendanceAdapter,window.AttendanceStatusAdapter=l.AttendanceStatusAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),i=r(e("../../../api/AdapterBase")),n=r(e("../../../api/FormValidation"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(e,a,l,i){s(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a,l,i));return n.photoAttendance=!1,n}return u(t,i.default),l(t,[{key:"getDataMapping",value:function(){return["id","employee","in_time","out_time","note"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Employee"},{sTitle:"Time-In"},{sTitle:"Time-Out"},{sTitle:"Note"}]}},{key:"getFormFields",value:function(){return[["employee",{label:"Employee",type:"select2","allow-null":!1,"remote-source":["Employee","id","first_name+last_name"]}],["id",{label:"ID",type:"hidden"}],["in_time",{label:"Time-In",type:"datetime"}],["out_time",{label:"Time-Out",type:"datetime",validation:"none"}],["note",{label:"Note",type:"textarea",validation:"none"}]]}},{key:"getFilters",value:function(){return[["employee",{label:"Employee",type:"select2","allow-null":!1,"remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"setPhotoAttendance",value:function(e){this.photoAttendance=parseInt(e,10)}},{key:"getCustomTableParams",value:function(){var e=this;return{aoColumnDefs:[{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,2)},aTargets:[2]},{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,3)},aTargets:[3]},{fnRender:function(t,a){return e.preProcessRemoteTableData(t,a,4)},aTargets:[4]},{fnRender:e.getActionButtons,aTargets:[e.getDataMapping().length]}]}}},{key:"preProcessRemoteTableData",value:function(e,t,a){return 2===a?"0000-00-00 00:00:00"===t||""===t||void 0===t||null==t?"":Date.parse(t).toString("yyyy MMM d <b>HH:mm</b>"):3===a?"0000-00-00 00:00:00"===t||""===t||void 0===t||null==t?"":Date.parse(t).toString("MMM d <b>HH:mm</b>"):4===a?null!=t&&t.length>10?t.substring(0,10)+"..":t:void 0}},{key:"save",value:function(){var e=new n.default(this.getTableName()+"_submit",!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters(),a=this.doCustomValidation(t);if(null==a){var l=$("#"+this.getTableName()+"_submit #id").val();null!=l&&void 0!==l&&""!==l&&(t.id=l);var i=JSON.stringify(t),r=[];r.callBackData=[],r.callBackSuccess="saveSuccessCallback",r.callBackFail="saveFailCallback",this.customAction("savePunch","admin=attendance",i,r)}else{var s=$("#"+this.getTableName()+"Form .label");s.html(a),s.show()}}}},{key:"saveSuccessCallback",value:function(e){this.get(e)}},{key:"saveFailCallback",value:function(e){this.showMessage("Error saving attendance entry",e)}},{key:"isSubProfileTable",value:function(){return"Admin"!==this.user.user_level}},{key:"showPunchImages",value:function(e){var t=JSON.stringify({id:e}),a=[];a.callBackData=[],a.callBackSuccess="getImagesSuccessCallback",a.callBackFail="getImagesFailCallback",this.customAction("getImages","admin=attendance",t,a)}},{key:"getImagesSuccessCallback",value:function(e){if($("#attendnaceMapCanvasIn").remove(),$("#attendnaceCanvasInWrapper").html('<canvas id="attendnaceCanvasIn" height="156" width="208" style="border: 1px #222 dotted;"></canvas>'),$("#attendnaceCanvasOut").remove(),$("#attendnaceCanvasOutWrapper").html('<canvas id="attendnaceCanvasOut" height="156" width="208" style="border: 1px #222 dotted;"></canvas>'),$("#attendnaceCanvasPunchInTime").html(""),$("#attendnaceCanvasPunchOutTime").html(""),$("#punchInLocation").html(""),$("#punchOutLocation").html(""),$("#punchInIp").html(""),$("#punchOutIp").html(""),$(Line truncated
//# sourceMappingURL=attendance.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
!function(){return function e(t,a,l){function i(n,o){if(!a[n]){if(!t[n]){var s="function"==typeof require&&require;if(!o&&s)return s(n,!0);if(r)return r(n,!0);var u=new Error("Cannot find module '"+n+"'");throw u.code="MODULE_NOT_FOUND",u}var c=a[n]={exports:{}};t[n][0].call(c.exports,function(e){return i(t[n][1][e]||e)},c,c.exports,e,t,a,l)}return a[n].exports}for(var r="function"==typeof require&&require,n=0;n<l.length;n++)i(l[n]);return i}}()({1:[function(e,t,a){"use strict";var l=e("./lib");window.CompanyStructureAdapter=l.CompanyStructureAdapter,window.CompanyGraphAdapter=l.CompanyGraphAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l,i=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),r=e("../../../api/AdapterBase"),n=(l=r)&&l.__esModule?l:{default:l};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,n.default),i(t,[{key:"getDataMapping",value:function(){return["id","title","address","type","country","timezone","parent"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Address",bSortable:!1},{sTitle:"Type"},{sTitle:"Country",sClass:"center"},{sTitle:"Time Zone"},{sTitle:"Parent Structure"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["title",{label:"Name",type:"text",validation:""}],["description",{label:"Details",type:"textarea",validation:""}],["address",{label:"Address",type:"textarea",validation:"none"}],["type",{label:"Type",type:"select",source:[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],["country",{label:"Country",type:"select2","remote-source":["Country","code","name"]}],["timezone",{label:"Time Zone",type:"select2","allow-null":!1,"remote-source":["Timezone","name","details"]}],["parent",{label:"Parent Structure",type:"select","allow-null":!0,"remote-source":["CompanyStructure","id","title"]}],["heads",{label:"Heads",type:"select2multi","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&null!==e.id&&void 0!==e.id&&""!==e.id||t.find("#field_heads").hide()}}]),t}(),d=function(e){function t(e,a,l,i){o(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a,l,i));return r.nodeIdCounter=0,r}return u(t,c),i(t,[{key:"convertToTree",value:function(e){for(var t={id:-1,title:"",name:"",children:[]},a=null,l=0;l<e.length;l++)e[l].name=e[l].title,null!=e[l].parent&&void 0!==e[l].parent&&null!=(a=this.findParent(e,e[l].parent))&&(void 0!==a.children&&null!=a.children||(a.children=[]),a.children.push(e[l]));for(var i=0;i<e.length;i++)null!=e[i].parent&&void 0!==e[i].parent||t.children.push(e[i]);return t}},{key:"findParent",value:function(e,t){for(var a=0;a<e.length;a++)if(e[a].title===t||e[a].title===t)return e[a];return null}},{key:"createTable",value:function(e){$("#tabPageCompanyGraph").html("");var t=this.sourceData,a=this.convertToTree(t),l=[20,120,20,120],i=5e3-l[1]-l[3],r=1e3-l[0]-l[2],n=d3.layout.tree().size([r,i]);this.diagonal=d3.svg.diagonal().projection(function(e){return[e.y,e.x]}),this.vis=d3.select("#tabPageCompanyGraph").append("svg:svg").attr("width",i+l[1]+l[3]).attr("height",r+l[0]+l[2]).append("svg:g").attr("transform","translate("+l[3]+","+l[0]+")");var o=a;o.x0=r/2,o.y0=0,this.update(o,n,o)}},{key:"update",value:function(e,t,a){var l=this,i=d3.event&&d3.event.altKey?5e3:500,r=t.nodes(a).reverse();r.forEach(function(e){e.y=180*e.depth});var n=l.vis.selectAll("g.node").data(r,function(e){return e.id||(e.id=++l.nodeIdCounter)}),o=n.enter().append("svg:g").attr("class","node").attr("transform",function(t){return"translate("+e.y0+","+e.x0+")"}).on("click",function(e){l.toggle(e),l.update(e,t,a)});o.append("svg:circle").attr("r",1e-6).style("fill",function(e){return e._children?"lightsteelblue":"#fff"}),o.append("svg:text").attr("x",function(e){return e.children||e._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(e){return e.children||e._children?"end":"start"}).text(function(e){return e.name}).style("fill-opaLine truncated
!function(){return function e(t,a,l){function i(n,o){if(!a[n]){if(!t[n]){var s="function"==typeof require&&require;if(!o&&s)return s(n,!0);if(r)return r(n,!0);var u=new Error("Cannot find module '"+n+"'");throw u.code="MODULE_NOT_FOUND",u}var c=a[n]={exports:{}};t[n][0].call(c.exports,function(e){return i(t[n][1][e]||e)},c,c.exports,e,t,a,l)}return a[n].exports}for(var r="function"==typeof require&&require,n=0;n<l.length;n++)i(l[n]);return i}}()({1:[function(e,t,a){"use strict";var l=e("./lib");window.CompanyStructureAdapter=l.CompanyStructureAdapter,window.CompanyGraphAdapter=l.CompanyGraphAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l,i=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),r=e("../../../api/AdapterBase"),n=(l=r)&&l.__esModule?l:{default:l};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,n.default),i(t,[{key:"getDataMapping",value:function(){return["id","title","address","type","country","timezone","parent"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Address",bSortable:!1},{sTitle:"Type"},{sTitle:"Country",sClass:"center"},{sTitle:"Time Zone"},{sTitle:"Parent Structure"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["title",{label:"Name",type:"text",validation:""}],["description",{label:"Details",type:"textarea",validation:""}],["address",{label:"Address",type:"textarea",validation:"none"}],["type",{label:"Type",type:"select",source:[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],["country",{label:"Country",type:"select2","remote-source":["Country","code","name"]}],["timezone",{label:"Time Zone",type:"select2","allow-null":!1,"remote-source":["Timezone","name","details","getTimezonesWithOffset"]}],["parent",{label:"Parent Structure",type:"select","allow-null":!0,"remote-source":["CompanyStructure","id","title"]}],["heads",{label:"Heads",type:"select2multi","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&null!==e.id&&void 0!==e.id&&""!==e.id||t.find("#field_heads").hide()}}]),t}(),d=function(e){function t(e,a,l,i){o(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a,l,i));return r.nodeIdCounter=0,r}return u(t,c),i(t,[{key:"convertToTree",value:function(e){for(var t={id:-1,title:"",name:"",children:[]},a=null,l=0;l<e.length;l++)e[l].name=e[l].title,null!=e[l].parent&&void 0!==e[l].parent&&null!=(a=this.findParent(e,e[l].parent))&&(void 0!==a.children&&null!=a.children||(a.children=[]),a.children.push(e[l]));for(var i=0;i<e.length;i++)null!=e[i].parent&&void 0!==e[i].parent||t.children.push(e[i]);return t}},{key:"findParent",value:function(e,t){for(var a=0;a<e.length;a++)if(e[a].title===t||e[a].title===t)return e[a];return null}},{key:"createTable",value:function(e){$("#tabPageCompanyGraph").html("");var t=this.sourceData,a=this.convertToTree(t),l=[20,120,20,120],i=5e3-l[1]-l[3],r=1e3-l[0]-l[2],n=d3.layout.tree().size([r,i]);this.diagonal=d3.svg.diagonal().projection(function(e){return[e.y,e.x]}),this.vis=d3.select("#tabPageCompanyGraph").append("svg:svg").attr("width",i+l[1]+l[3]).attr("height",r+l[0]+l[2]).append("svg:g").attr("transform","translate("+l[3]+","+l[0]+")");var o=a;o.x0=r/2,o.y0=0,this.update(o,n,o)}},{key:"update",value:function(e,t,a){var l=this,i=d3.event&&d3.event.altKey?5e3:500,r=t.nodes(a).reverse();r.forEach(function(e){e.y=180*e.depth});var n=l.vis.selectAll("g.node").data(r,function(e){return e.id||(e.id=++l.nodeIdCounter)}),o=n.enter().append("svg:g").attr("class","node").attr("transform",function(t){return"translate("+e.y0+","+e.x0+")"}).on("click",function(e){l.toggle(e),l.update(e,t,a)});o.append("svg:circle").attr("r",1e-6).style("fill",function(e){return e._children?"lightsteelblue":"#fff"}),o.append("svg:text").attr("x",function(e){return e.children||e._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(e){return e.children||e._children?"end":"start"}).text(function(e){returnLine truncated
//# sourceMappingURL=company_structure.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
!function(){return function e(t,a,l){function i(o,r){if(!a[o]){if(!t[o]){var s="function"==typeof require&&require;if(!r&&s)return s(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=a[o]={exports:{}};t[o][0].call(d.exports,function(e){return i(t[o][1][e]||e)},d,d.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.PaydayAdapter=l.PaydayAdapter,window.PayrollAdapter=l.PayrollAdapter,window.PayrollDataAdapter=l.PayrollDataAdapter,window.PayrollColumnAdapter=l.PayrollColumnAdapter,window.PayrollColumnTemplateAdapter=l.PayrollColumnTemplateAdapter,window.PayrollEmployeeAdapter=l.PayrollEmployeeAdapter,window.DeductionAdapter=l.DeductionAdapter,window.DeductionGroupAdapter=l.DeductionGroupAdapter,window.PayslipTemplateAdapter=l.PayslipTemplateAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),i=function e(t,a,l){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,a);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:e(n,a,l)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(l):void 0},n=r(e("../../../api/AdapterBase")),o=r(e("../../../api/TableEditAdapter"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,n.default),l(t,[{key:"getDataMapping",value:function(){return["id","name"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Select Pay Frequency"}]}},{key:"getFormFields",value:function(){return[["name",{label:"Name",type:"text",validation:""}]]}},{key:"getAddNewLabel",value:function(){return"Run Payroll"}},{key:"createTable",value:function(e){$("#payday_all").off(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"createTable",this).call(this,e),$("#payday_all").off().on("click",function(){$(this).is(":checked")?$(".paydayCheck").prop("checked",!0):$(".paydayCheck").prop("checked",!1)})}},{key:"getActionButtonsHtml",value:function(e,t){var a='<div style="width:120px;">_edit_</div>';return a=(a=(a=a.replace("_edit_",'<input type="checkbox" class="paydayCheck" id="payday__id_" name="payday__id_" value="checkbox_payday__id_"/>')).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"getActionButtonHeader",value:function(){return{sTitle:'<input type="checkbox" id="payday_all" name="payday_all" value="checkbox_payday_all"/>',sClass:"center"}}}]),t}(),p=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,n.default),l(t,[{key:"getDataMapping",value:function(){return["id","name","pay_period","department","date_start","date_end","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Pay Frequency"},{sTitle:"Department"},{sTitle:"Date Start"},{sTitle:"Date End"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text"}],["pay_period",{label:"Pay Frequency",type:"select","remote-source":["PayFrequency","id","name"],sort:"none"}],["deduction_group",{label:"Calculation Group",type:"select","remote-source":["DeductionGroup","id","name"],sort:"none"}],["payslipTemplate",{label:"Payslip Template",type:"select","remote-source":["PayslipTemplate","id","name"]}],["department",{label:"Department",type:"select2","remote-source":["CompanyStructure","id","title"],sort:"none"}],["date_start",{label:"Start Date",type:"date",validation:""}],["date_end",{label:"End Date",type:"date",validation:""}],["columns",{label:"Payroll Columns",type:"select2multi","remote-source":["PayrollColumn","id","name"]}],["status",{label:"Status",type:"select",source:[["Draft","Draft"],["Completed","Completed"]],sort:"none"}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&void 0!==e&&void 0!==e.id&&null!=e.id&&(t.find("#pay_period").attr("disabled","disabled"),t.find("#department").attr("disabled","disabled"))}},{key:"process",vaLine truncated
!function(){return function e(t,a,l){function i(o,r){if(!a[o]){if(!t[o]){var s="function"==typeof require&&require;if(!r&&s)return s(o,!0);if(n)return n(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=a[o]={exports:{}};t[o][0].call(d.exports,function(e){return i(t[o][1][e]||e)},d,d.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.PaydayAdapter=l.PaydayAdapter,window.PayrollAdapter=l.PayrollAdapter,window.PayrollDataAdapter=l.PayrollDataAdapter,window.PayrollColumnAdapter=l.PayrollColumnAdapter,window.PayrollColumnTemplateAdapter=l.PayrollColumnTemplateAdapter,window.PayrollEmployeeAdapter=l.PayrollEmployeeAdapter,window.DeductionAdapter=l.DeductionAdapter,window.DeductionGroupAdapter=l.DeductionGroupAdapter,window.PayslipTemplateAdapter=l.PayslipTemplateAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),i=function e(t,a,l){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,a);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:e(n,a,l)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(l):void 0},n=r(e("../../../api/AdapterBase")),o=r(e("../../../api/TableEditAdapter"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,n.default),l(t,[{key:"getDataMapping",value:function(){return["id","name"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Select Pay Frequency"}]}},{key:"getFormFields",value:function(){return[["name",{label:"Name",type:"text",validation:""}]]}},{key:"getAddNewLabel",value:function(){return"Run Payroll"}},{key:"createTable",value:function(e){$("#payday_all").off(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"createTable",this).call(this,e),$("#payday_all").off().on("click",function(){$(this).is(":checked")?$(".paydayCheck").prop("checked",!0):$(".paydayCheck").prop("checked",!1)})}},{key:"getActionButtonsHtml",value:function(e,t){var a='<div style="width:120px;">_edit_</div>';return a=(a=(a=a.replace("_edit_",'<input type="checkbox" class="paydayCheck" id="payday__id_" name="payday__id_" value="checkbox_payday__id_"/>')).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"getActionButtonHeader",value:function(){return{sTitle:'<input type="checkbox" id="payday_all" name="payday_all" value="checkbox_payday_all"/>',sClass:"center"}}}]),t}(),p=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,n.default),l(t,[{key:"getDataMapping",value:function(){return["id","name","pay_period","department","date_start","date_end","status"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Pay Frequency"},{sTitle:"Department"},{sTitle:"Date Start"},{sTitle:"Date End"},{sTitle:"Status"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden"}],["name",{label:"Name",type:"text"}],["pay_period",{label:"Pay Frequency",type:"select","remote-source":["PayFrequency","id","name"],sort:"none"}],["deduction_group",{label:"Calculation Group",type:"select","remote-source":["DeductionGroup","id","name"],sort:"none"}],["payslipTemplate",{label:"Payslip Template",type:"select","remote-source":["PayslipTemplate","id","name"]}],["department",{label:"Department",type:"select2","remote-source":["CompanyStructure","id","title"],sort:"none"}],["date_start",{label:"Start Date",type:"date",validation:""}],["date_end",{label:"End Date",type:"date",validation:""}],["columns",{label:"Payroll Columns",type:"select2multi","remote-source":["PayrollColumn","id","name"]}],["status",{label:"Status",type:"select",source:[["Draft","Draft"],["Completed","Completed"]],sort:"none"}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&void 0!==e&&void 0!==e.id&&null!=e.id&&(t.find("#pay_period").attr("disabled","disabled"),t.find("#department").attr("disabled","disabled"))}},{key:"process",vaLine truncated
//# sourceMappingURL=payroll.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
!function(){return function e(t,a,l){function i(s,n){if(!a[s]){if(!t[s]){var o="function"==typeof require&&require;if(!n&&o)return o(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=a[s]={exports:{}};t[s][0].call(c.exports,function(e){return i(t[s][1][e]||e)},c,c.exports,e,t,a,l)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<l.length;s++)i(l[s]);return i}}()({1:[function(e,t,a){"use strict";var l=e("./lib");window.UserAdapter=l.UserAdapter,window.UserRoleAdapter=l.UserRoleAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),i=s(e("../../../api/FormValidation")),r=s(e("../../../api/AdapterBase"));function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,r.default),l(t,[{key:"getDataMapping",value:function(){return["id","username","email","employee","user_level"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID"},{sTitle:"User Name"},{sTitle:"Authentication Email"},{sTitle:"Employee"},{sTitle:"User Level"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["username",{label:"User Name",type:"text",validation:"username"}],["email",{label:"Email",type:"text",validation:"email"}],["employee",{label:"Employee",type:"select2","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}],["user_level",{label:"User Level",type:"select",source:[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],["user_roles",{label:"User Roles",type:"select2multi","remote-source":["UserRole","id","name"]}],["lang",{label:"Language",type:"select2","allow-null":!0,"remote-source":["SupportedLanguage","id","description"]}],["default_module",{label:"Default Module",type:"select2","null-label":"No Default Module","allow-null":!0,"remote-source":["Module","id","menu+label"]}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&void 0!==e||t.find("#changePasswordBtn").remove()}},{key:"changePassword",value:function(){$("#adminUsersModel").modal("show"),$("#adminUsersChangePwd #newpwd").val(""),$("#adminUsersChangePwd #conpwd").val("")}},{key:"saveUserSuccessCallBack",value:function(e,t){var a=e[0];e[1]?this.showMessage("Create User","An email has been sent to "+a.email+" with a temporary password to login to IceHrm."):this.showMessage("Create User","User created successfully. But there was a problem sending welcome email."),this.get([])}},{key:"saveUserFailCallBack",value:function(e,t){this.showMessage("Error",e)}},{key:"doCustomValidation",value:function(e){var t=null;return"Admin"!==e.user_level&&"Other"!==e.user_level&&"NULL"===e.employee&&(t="For this user type, you have to assign an employee when adding or editing the user.<br/>",t+=" You may create a new employee through 'Admin'->'Employees' menu"),t}},{key:"save",value:function(){var e=new i.default(this.getTableName()+"_submit",!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters(),a=this.doCustomValidation(t);if(null==a){var l=$("#"+this.getTableName()+"_submit #id").val();if(t.csrf=$("#"+this.getTableName()+"Form").data("csrf"),null!=l&&void 0!==l&&""!==l)t.id=l,this.add(t,[]);else{var r=JSON.stringify(t),s=[];s.callBackData=[],s.callBackSuccess="saveUserSuccessCallBack",s.callBackFail="saveUserFailCallBack",this.customAction("saveUser","admin=users",r,s)}}else this.showMessage("Error Saving User",a)}}},{key:"changePasswordConfirm",value:function(){$("#adminUsersChangePwd_error").hide();var e=$("#adminUsersChangePwd #newpwd").val();if(!(e.length>7))return $("#adminUsersChangePwd_error").html("Password should be longer than 7 characters"),void $("#adminUsersChangePwd_error").show();var t=$("#adminUsersChangePwd #conpwd").val();if(t!==e)return $("#adminUsersChangePwd_error").html("Passwords don't match"),void $("#adminUsersChangePwd_error").show();var a={id:this.currentId,pwd:t},l=JSON.stringify(a),i=[];i.callBackData=[],i.callBackSuccess="changePasswordSuccessCallBack",i.callBackFail="changePasswordFailCallBack",this.customAction("cLine truncated
!function(){return function e(t,a,l){function i(s,n){if(!a[s]){if(!t[s]){var o="function"==typeof require&&require;if(!n&&o)return o(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=a[s]={exports:{}};t[s][0].call(c.exports,function(e){return i(t[s][1][e]||e)},c,c.exports,e,t,a,l)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<l.length;s++)i(l[s]);return i}}()({1:[function(e,t,a){"use strict";var l=e("./lib");window.UserAdapter=l.UserAdapter,window.UserRoleAdapter=l.UserRoleAdapter},{"./lib":2}],2:[function(e,t,a){"use strict";var l=function(){function e(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)}}return function(t,a,l){return a&&e(t.prototype,a),l&&e(t,l),t}}(),i=s(e("../../../api/FormValidation")),r=s(e("../../../api/AdapterBase"));function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,r.default),l(t,[{key:"getDataMapping",value:function(){return["id","username","email","employee","user_level"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID"},{sTitle:"User Name"},{sTitle:"Authentication Email"},{sTitle:"Employee"},{sTitle:"User Level"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["username",{label:"User Name",type:"text",validation:"username"}],["email",{label:"Email",type:"text",validation:"email"}],["employee",{label:"Employee",type:"select2","allow-null":!0,"remote-source":["Employee","id","first_name+last_name"]}],["user_level",{label:"User Level",type:"select",source:[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],["lang",{label:"Language",type:"select2","allow-null":!0,"remote-source":["SupportedLanguage","id","description"]}]]}},{key:"postRenderForm",value:function(e,t){null!=e&&void 0!==e||t.find("#changePasswordBtn").remove()}},{key:"changePassword",value:function(){$("#adminUsersModel").modal("show"),$("#adminUsersChangePwd #newpwd").val(""),$("#adminUsersChangePwd #conpwd").val("")}},{key:"saveUserSuccessCallBack",value:function(e,t){var a=e[0];e[1]?this.showMessage("Create User","An email has been sent to "+a.email+" with a temporary password to login to IceHrm."):this.showMessage("Create User","User created successfully. But there was a problem sending welcome email."),this.get([])}},{key:"saveUserFailCallBack",value:function(e,t){this.showMessage("Error",e)}},{key:"doCustomValidation",value:function(e){var t=null;return"Admin"!==e.user_level&&"Other"!==e.user_level&&"NULL"===e.employee&&(t="For this user type, you have to assign an employee when adding or editing the user.<br/>",t+=" You may create a new employee through 'Admin'->'Employees' menu"),t}},{key:"save",value:function(){var e=new i.default(this.getTableName()+"_submit",!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters(),a=this.doCustomValidation(t);if(null==a){var l=$("#"+this.getTableName()+"_submit #id").val();if(t.csrf=$("#"+this.getTableName()+"Form").data("csrf"),null!=l&&void 0!==l&&""!==l)t.id=l,this.add(t,[]);else{var r=JSON.stringify(t),s=[];s.callBackData=[],s.callBackSuccess="saveUserSuccessCallBack",s.callBackFail="saveUserFailCallBack",this.customAction("saveUser","admin=users",r,s)}}else this.showMessage("Error Saving User",a)}}},{key:"changePasswordConfirm",value:function(){$("#adminUsersChangePwd_error").hide();var e=$("#adminUsersChangePwd #newpwd").val();if(!(e.length>7))return $("#adminUsersChangePwd_error").html("Password should be longer than 7 characters"),void $("#adminUsersChangePwd_error").show();var t=$("#adminUsersChangePwd #conpwd").val();if(t!==e)return $("#adminUsersChangePwd_error").html("Passwords don't match"),void $("#adminUsersChangePwd_error").show();var a={id:this.currentId,pwd:t},l=JSON.stringify(a),i=[];i.callBackData=[],i.callBackSuccess="changePasswordSuccessCallBack",i.callBackFail="changePasswordFailCallBack",this.customAction("changePassword","admin=users",l,i)}},{key:"closeChangePassword",value:function(){$("#adminUsersModel").modal("hide")}},{key:"changePasswordSuccessCallBack",value:function(e,t){this.closeChangePassword(),this.showMessage("Password Change","Password chaLine truncated
//# sourceMappingURL=users.js.map