Files
ihrm/templates/settings.html

756 lines
27 KiB
HTML

{% extends 'index.html' %} {% block content %} {% load static %} {% load i18n %} {% load horillafilters %}
<style>
.settings-label {
font-weight: bold;
font-size: 15px;
}
.perm-count {
width: 100%;
display: flex;
padding: 0.5rem 0rem;
font-style: italic;
color: hsl(0deg, 0%, 37%);
width: 100%;
}
.oh-sticky-table{
max-height: 100vh;
}
.accordion--show{
display: block;
}
.oh-accordion:not(.accordion--show):last-child .oh-accordion-header {
border-bottom: none
}
.accordion--show .oh-accordion-header:after {
content: "";
width: 25px;
height: 25px;
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9IiMxZjFmMWYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJtNyAxNC41IDUtNSA1IDVIN1oiPjwvcGF0aD4KPC9zdmc+");
background-size: contain;
background-repeat: no-repeat;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
position: absolute;
right: 0;
top: 16px;
display: flex;
align-items: center;
justify-content: center
}
.accordion--show .oh-accordion-body {
display: block
}
</style>
<section class="oh-wrapper oh-main__topbar">
<div
class="oh-main__titlebar oh-main__titlebar--left oh-d-flex-column--resp oh-mb-3--small"
>
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Settings" %}</h1>
</div>
<div class="oh-main__titlebar oh-main__titlebar--right"></div>
</section>
<div class="oh-wrapper">
<div class="oh-card">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-3">
<button
class="oh-btn oh-btn--light oh-inner-sidebar-toggle w-100"
data-action="toggle"
data-target="#mobileMenu"
data-class="oh-resp-hidden--lg"
>
<ion-icon class="me-2" name="menu-outline"></ion-icon>{% trans "All Settings" %}
</button>
<div
class="oh-inner-sidebar oh-resp-hidden--lg"
style="font-weight: bold"
id="mobileMenu"
>
<ul class="oh-inner-sidebar__items">
{% comment %} {% if general_section or perms.auth.view_permission or perms.auth.view_permission or perms.auth.view_group or perms.base.view_company or perms.base.view_tags or perms.employee.view_emplyeetag or perms.horilla_audit.view_audittag or perms.base.view_dynamicemailconfiguration or perms.horilla_backup.view_googledrivebackup %} {% endcomment %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="settings-outline" class="me-2"></ion-icon>
{% trans "General" %}
</div>
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% comment %} {% if general_section %} {% endcomment %}
<a
id="generalSettings"
href="{% url 'general-settings' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "General Settings" %}
</a>
{% comment %} {% endif %} {% endcomment %}
</div>
<div class="oh-input-group">
{% if perms.auth.view_permission %}
<a
id="employeePermission"
href="{% url 'employee-permission-assign' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Employee Permission" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.auth.view_permission %}
<a
id="defaultAccessibility"
href="{% url 'user-accessibility' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Accessibility Restriction" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.auth.view_group %}
<a
id="userGroup"
href="{% url 'user-group-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "User Group" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_company %}
<a
id="date"
href="{% url 'date-settings' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Date & Time Format" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_tags or perms.employee.view_emplyeetag or perms.horilla_audit.view_audittag %}
<a
id="ticket_type"
href="{% url 'tag-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "History Tags" %}</a
>
{% endif %}
</div>
{% if perms.base.view_dynamicemailconfiguration and not "outlook_auth"|app_installed %}
<div class="oh-input-group">
<a
id="date"
href="{% url 'mail-server-conf' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Mail Server" %}</a
>
</div>
{% elif perms.base.view_dynamicemailconfiguration and "outlook_auth"|app_installed %}
<div class="oh-input-group">
<a
id="date"
href="{% url 'outlook_view_records' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Outlook Mail" %}</a
>
</div>
{% endif %}
<div class="oh-input-group">
{% if perms.horilla_backup.view_googledrivebackup %}
<a
id="date"
href="{% url 'gdrive' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Gdrive Backup" %}</a
>
{% endif %}
</div>
{% if "horilla_ldap"|app_installed %}
{% if perms.horilla_ldap.add_ldapsettings or perms.horilla_ldap.update_ldapsettings %}
<div class="oh-input-group">
<a
id="date"
href="{% url 'ldap-settings' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "LDAP Configuration" %}</a
>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
</li>
<hr>
{% comment %} {% endif %} {% endcomment %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.base.view_department or perms.base.view_jobposition or perms.base.view_jobrole or perms.base.view_company %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="apps" class="me-2"></ion-icon>
{% trans "Base" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.base.view_department %}
<a
id="department"
href="{% url 'department-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Department" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_jobposition %}
<a
id="jobPosition"
href="{% url 'job-position-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Job Positions" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_jobrole %}
<a
id="jobRole"
href="{% url 'job-role-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Job Role" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_company %}
<a
id="company"
href="{% url 'company-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Company" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
{% if perms.base.view_department or perms.base.view_jobposition or perms.base.view_jobrole or perms.base.view_company %}
<hr>
{% endif %}
{% if "recruitment"|app_installed %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.recruitment.view_recruitment or perms.recruitment.view_rejectreason or perms.recruitment.add_recruitment or perms.recruitment.add_linkedinaccount %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="clipboard-outline" class="me-2"></ion-icon>
{% trans "Recruitment" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.recruitment.view_recruitment %}
<div class="oh-input-group">
<a
id="skills"
href="{% url 'self-tracking-feature' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Candidate Self Tracking" %}</a
>
</div>
{% endif %}
{% if perms.recruitment.view_rejectreason %}
<a
id="candidateRejectReasons"
href="{% url 'candidate-reject-reasons' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Candidate Reject Reason" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.recruitment.add_recruitment %}
<a
id="skills"
href="{% url 'skills-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Skills" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.recruitment.add_linkedinaccount %}
<a
id="skills"
href="{% url 'linkedin-integration-setting' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Linkedin Integration" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
{% if perms.recruitment.view_recruitment or perms.recruitment.view_rejectreason or perms.recruitment.add_recruitment or perms.recruitment.add_linkedinaccount %}
<hr>
{% endif %}
{% endif %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="people" class="me-2"></ion-icon>
{% trans "Employee" %}
</div>
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.base.view_worktype %}
<a
id="workType"
href="{% url 'work-type-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Work Type" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_rotatingworktype %}
<a
id="rotatingWorkType"
href="{% url 'rotating-work-type-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Rotating Work Type" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_employeeshift %}
<a
id="employeeShift"
href="{% url 'employee-shift-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Employee Shift" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_rotatingshift %}
<a
id="rotatingShift"
href="{% url 'rotating-shift-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Rotating Shift" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_employeeshiftschedule %}
<a
id="employeeShiftSchedule"
href="{% url 'employee-shift-schedule-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Employee Shift Schedule" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.base.view_employeetype %}
<a
id="employeeType"
href="{% url 'employee-type-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Employee Type" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.employee.view_actiontype %}
<a
id="date"
href="{% url 'action-type' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Disciplinary Action Type" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.employee.view_employeetag %}
<a
id="ticket_type"
href="{% url 'employee-tag-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Employee Tags" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
<hr>
{% if "attendance"|app_installed %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.attendance.view_attendancevalidationcondition or perms.base.view_biometricattendance or perms.attendance.add_attendance or perms.geofencing.add_geofencing or perms.facedetection.add_facedetection %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="checkmark-done-circle-outline" class="me-2"></ion-icon>
{% trans "Attendance" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.attendance.view_attendancevalidationcondition %}
<a
id="trackLateComeEalryOut"
href="{% url 'track-late-come-early-out' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Track Late Come & Early Out" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.attendance.view_attendancevalidationcondition %}
<a
id="condition"
href="{% url 'attendance-settings-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Attendance Break Point" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.attendance.view_attendancevalidationcondition %}
<a
id="condition"
href="{% url 'check-in-check-out-setting' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Check In/Check Out" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.attendance.view_attendancevalidationcondition %}
<a
id="condition"
href="{% url 'grace-settings-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Grace Time" %}</a
>
{% endif %}
</div>
{% if biometric_app_exists %}
{% if perms.base.view_biometricattendance %}
<div class="oh-input-group">
<a
id="condition"
href="{% url 'enable-biometric-attendance' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Biometric Attendance" %}
</a>
</div>
{% endif %}
{% endif %}
{% if perms.attendance.add_attendance %}
<div class="oh-input-group">
<a
id="ip_resriction"
href="{% url "allowed-ips" %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "IP Restriction" %}
</a>
</div>
{% endif %}
{% if perms.geofencing.add_geofencing or perms.facedetection.add_facedetection %}
<div class="oh-input-group">
<a
id="geo_face_conf"
href="{% url "geo-face-config" %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Geo & Face Config" %}
</a>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</li>
{% if perms.attendance.view_attendancevalidationcondition or perms.base.view_biometricattendance or perms.attendance.add_attendance or perms.geofencing.add_geofencing or perms.facedetection.add_facedetection %}
<hr>
{% endif %}
{% endif %}
{% if "leave"|app_installed %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.leave.add_restrictleave or perms.attendance.view_attendancevalidationcondition %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="close-circle-outline" class="me-2"></ion-icon>
{% trans "Leave" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.leave.add_restrictleave %}
<a
id="condition"
href="{% url 'employee-past-leave-restriction' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Restrictions" %}</a
>
{% endif %}
</div>
</div>
{% if "attendance"|app_installed %}
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.attendance.view_attendancevalidationcondition %}
<a
id="condition"
href="{% url 'compensatory-leave-settings-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Compensatory Leave" %}</a
>
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
</li>
{% if perms.leave.add_restrictleave or perms.attendance.view_attendancevalidationcondition %}
<hr>
{% endif %}
{% endif %}
{% if "payroll"|app_installed %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.payroll.view_payslipautogenerate %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="wallet-outline" class="me-2"></ion-icon>
{% trans "Payroll" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.payroll.view_payslipautogenerate %}
<a
id="autoGeneratePayslip"
href="{% url 'auto-payslip-settings-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Payslip Auto Generation" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
{% if perms.payroll.view_payslipautogenerate %}
<hr>
{% endif %}
{% endif %}
{% if "pms"|app_installed %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.pms.add_bonuspointsetting %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="analytics-outline" class="me-2"></ion-icon>
{% trans "Performance" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.pms.add_bonuspointsetting %}
<a
id="autoGeneratePayslip"
href="{% url 'bonus-point-setting' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Bonus Point Setting" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
{% if perms.pms.add_bonuspointsetting %}
<hr>
{% endif %}
{% endif %}
{% if "helpdesk"|app_installed %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
{% if perms.helpdesk.view_departmentmanager or perms.helpdesk.view_tickettype or perms.employee.view_employeetag %}
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="headset" class="me-2"></ion-icon>
{% trans "Help Desk" %}
</div>
{% endif %}
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.helpdesk.view_departmentmanager %}
<a
id="ticket_type"
href="{% url 'department-manager-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Department Managers" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.helpdesk.view_tickettype %}
<a
id="ticket_type"
href="{% url 'ticket-type-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Ticket Type" %}</a
>
{% endif %}
</div>
<div class="oh-input-group">
{% if perms.employee.view_employeetag %}
<a
id="ticket_type"
href="{% url 'helpdesk-tag-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Helpdesk Tags" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
{% if perms.helpdesk.view_departmentmanager or perms.helpdesk.view_tickettype or perms.employee.view_employeetag %}
<hr>
{% endif %}
{% endif %}
{% if "whatsapp"|app_installed %}
{% if perms.whatsapp.view_whatsappcredentials %}
<li class="oh-inner-sidebar__item">
<div class="oh-accordion ms-2">
<div class="oh-accordion-header" style="font-size:16px;">
<ion-icon name="headset" class="me-2"></ion-icon>
{% trans "Whatsapp Configuration" %}
</div>
<div class="oh-accordion-body">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
{% if perms.whatsapp.add_whatsappcredentials %}
<a
id="whatsapp_credentials"
href="{% url 'whatsapp-credential-view' %}"
class="oh-inner-sidebar__link oh-dropdown__link"
>{% trans "Whatsapp Credentials" %}</a
>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</li>
<hr>
{% endif %}
{% endif %}
</ul>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-9">
{% block settings %} {% endblock settings %}
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$(".oh-accordion--show").removeClass("oh-accordion--show");
$('.oh-accordion-header').on("click", function (e) {
e.preventDefault();
$(this).parent().toggleClass("accordion--show");
setTimeout(() => {
$(".oh-accordion--show").removeClass("oh-accordion--show");
}, 100);
});
});
$(document).ready(function () {
var path = location.pathname;
var menu = $(`a[href="${path}"].oh-inner-sidebar__link.oh-dropdown__link`);
if (menu.length == 0) {
var path = localStorage.getItem("lastActiveTab");
menu = $(`a[href="${path}"].oh-inner-sidebar__link.oh-dropdown__link`);
}
menu.addClass("oh-inner-sidebar__link--active");
menu.attr("style", "border:2px solid #FF820D ; border-radius:15px;");
// Find the parent accordion element and show it
var parentAccordion = menu.closest('.oh-accordion');
parentAccordion.addClass('accordion--show');
menu[0].scrollIntoView({ behavior: "smooth", block: "center" });
if (menu.length != undefined) {
localStorage.setItem("lastActiveTab", path);
}
});
</script>
<script src="{% static 'build/js/settingsDriver.js' %}"></script>
{% if not request.user.driverviewed_set.first or "settings" not in request.user.driverviewed_set.first.user_viewed %}
<script>
runDriver()
</script>
{% endif %}
{% endblock content %}