Upgrades from IceHrm Pro v24

This commit is contained in:
gamonoid
2018-07-03 03:10:32 +02:00
parent 8b276d54e6
commit 9cee4e91df
8253 changed files with 659182 additions and 47489 deletions

View File

@@ -374,10 +374,12 @@ AdapterBase.method('getFieldValues', function(fieldMaster,callBackData) {
that.requestCache.setData(this.success.key, data);
callBackData['callBackData'].push(data.data);
if(callBackData['callBackSuccess'] != null && callBackData['callBackSuccess'] != undefined){
if(callBackData['callBackSuccess'] != null && callBackData['callBackSuccess'] != undefined) {
callBackData['callBackData'].push(callBackData['callBackSuccess']);
}
that.callFunction(callBackData['callBack'],callBackData['callBackData']);
} else if (data.message === 'Access violation') {
alert('Error : ' + callbackWraper.table + ' ' + data.message);
}
};
@@ -797,12 +799,13 @@ ApproveModuleAdapter.method('getActionButtonsHtml', function(id,data) {
html = html.replace('_logs_',viewLogsButton);
if(this.showDelete){
if(data[7] == "Approved"){
if (data[7] === "Approved") {
html = html.replace('_delete_',requestCancellationButton);
}else{
} else if(data[7] === "Pending" || this.user.user_level === "Admin") {
html = html.replace('_delete_',deleteButton);
} else {
html = html.replace('_delete_','');
}
}else{
html = html.replace('_delete_','');
}
@@ -1090,6 +1093,12 @@ TableEditAdapter.method('createTable', function(elementId) {
return modJs.validateCellValue($(this), evt, newValue);
});
this.afterCreateTable(elementId);
});
TableEditAdapter.method('afterCreateTable', function(elementId) {
});
TableEditAdapter.method('addCellDataUpdate' , function(colId, rowId, data) {

View File

@@ -42,6 +42,7 @@ function IceHRMBase() {
this.settings = {};
this.translations = {};
this.customFields = [];
this.csrfRequired = false;
}
this.fieldTemplates = null;
@@ -115,6 +116,10 @@ IceHRMBase.method('setInstanceId' , function(id) {
this.instanceId = id;
});
IceHRMBase.method('setCSRFRequired' , function(val) {
this.csrfRequired = val;
});
IceHRMBase.method('setGoogleAnalytics' , function(ga) {
this.ga = ga;
});
@@ -1019,9 +1024,12 @@ IceHRMBase.method('save', function(callGetFunction, successCallback) {
params = this.forceInjectValuesBeforeSave(params);
var msg = this.doCustomValidation(params);
if(msg == null){
if (this.csrfRequired) {
params['csrf'] = $('#'+this.getTableName()+'Form').data('csrf');
}
var id = $('#'+this.getTableName()+"_submit #id").val();
if(id != null && id != undefined && id != ""){
$(params).attr('id',id);
params['id'] = id;
}
params = this.makeEmptyDateFieldsNull(params);
this.add(params,[],callGetFunction, successCallback);