🧲 New features Custom user role permissions Employee edit form updated Employee daily task list Attendance and employee distribution charts on dashboard Improvements to company structure and company assets module Improved tables for displaying data in several modules Faster data loading (specially for employee module) Initials based profile pictures Re-designed login page Re-designed user profile page Improvements to filtering New REST endpoints for employee qualifications 🐛 Bug fixes Fixed, issue with managers being able to create performance reviews for employees who are not their direct reports Fixed, issues related to using full profile image instead of using smaller version of profile image Changing third gender to other Improvements and fixes for internal frontend data caching
82 lines
1.9 KiB
JavaScript
82 lines
1.9 KiB
JavaScript
$(document).ready(() => {
|
|
$(window).keydown((event) => {
|
|
if (event.keyCode == 13) {
|
|
event.preventDefault();
|
|
return false;
|
|
}
|
|
});
|
|
|
|
$('#password').keydown((event) => {
|
|
if (event.keyCode == 13) {
|
|
submitLogin();
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
|
|
window.showForgotPassword = () => {
|
|
$('#loginForm').hide();
|
|
$('#requestPasswordChangeForm').show();
|
|
};
|
|
|
|
window.requestPasswordChange = () => {
|
|
$('#requestPasswordChangeFormAlert').hide();
|
|
const id = $('#usernameChange').val();
|
|
if (id === '') {
|
|
return false;
|
|
}
|
|
$.post('service.php', { a: 'rpc', id }, (data) => {
|
|
if (data.status == 'SUCCESS') {
|
|
$('#requestPasswordChangeFormAlert').show();
|
|
$('#requestPasswordChangeFormAlert').html(data.message);
|
|
} else {
|
|
$('#requestPasswordChangeFormAlert').show();
|
|
$('#requestPasswordChangeFormAlert').html(data.message);
|
|
}
|
|
}, 'json');
|
|
};
|
|
|
|
window.changePassword = (key) => {
|
|
$('#newPasswordFormAlert').hide();
|
|
const password = $('#password').val();
|
|
|
|
const passwordValidation = function (str) {
|
|
return str.length > 7;
|
|
};
|
|
|
|
|
|
if (!passwordValidation(password)) {
|
|
$('#newPasswordFormAlert').show();
|
|
$('#newPasswordFormAlert').html('Password should be longer than 7 characters');
|
|
return;
|
|
}
|
|
|
|
|
|
$.post('service.php', {
|
|
a: 'rsp', key, pwd: password, now: '1',
|
|
}, (data) => {
|
|
if (data.status == 'SUCCESS') {
|
|
top.location.href = 'login.php?c=1';
|
|
} else {
|
|
$('#newPasswordFormAlert').show();
|
|
$('#newPasswordFormAlert').html(data.message);
|
|
}
|
|
}, 'json');
|
|
};
|
|
|
|
window.submitLogin = () => {
|
|
const username = $('#username').val();
|
|
const password = $('#password').val();
|
|
if (username === '' || password === '') {
|
|
return false;
|
|
}
|
|
try {
|
|
localStorage.clear();
|
|
} catch (e) {}
|
|
$('#loginForm').submit();
|
|
};
|
|
|
|
window.authGoogle = () => {
|
|
window.location.href = `${window.location.href.split('login.php')[0]}login.php?google=1`;
|
|
};
|