Upgrades from IceHrm Pro v24
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user