forked from notrinos/FrontHrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhooks.php
76 lines (60 loc) · 3.93 KB
/
hooks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*=======================================================\
| FrontHrm |
|--------------------------------------------------------|
| Creator: Phương |
| Date : 09-Jul-2017 |
| Description: Frontaccounting Payroll & Hrm Module |
| Free software under GNU GPL |
| |
\=======================================================*/
define ('SS_HRM', 251<<8);
class FrontHrm_app extends application {
function __construct() {
global $path_to_root;
parent::__construct('FrontHrm', _($this->help_context = 'Human Resource'));
$this->add_module(_('Transactions'));
$this->add_lapp_function(0, _('Attendance'), $path_to_root.'/modules/FrontHrm/manage/attendance.php?', 'SA_EMPL', MENU_TRANSACTION);
$this->add_lapp_function(0, _('Payslip Entry'), $path_to_root.'/modules/FrontHrm/manage/payslip.php?NewPayslip=Yes', 'SA_EMPL', MENU_TRANSACTION);
$this->add_rapp_function(0, _('Payment Advice'), $path_to_root.'/modules/FrontHrm/manage/pay_advice.php?NewPaymentAdvice=Yes', 'SA_EMPL', MENU_TRANSACTION);
$this->add_module(_('Inquiries and Reports'));
$this->add_lapp_function(1, _('Timesheet'), $path_to_root.'/modules/FrontHrm/inquiry/time_sheet.php?', 'SA_EMPL', MENU_INQUIRY);
$this->add_lapp_function(1, _('Employee Transaction Inquiry'), $path_to_root.'/modules/FrontHrm/inquiry/emp_inquiry.php?', 'SA_EMPL', MENU_INQUIRY);
$this->add_rapp_function(1, _("Employee &Reports"),
"reporting/reports_main.php?Class=8", 'SA_EMPL', MENU_REPORT);
$this->add_module(_('Maintenance'));
$this->add_lapp_function(2, _('Employees'), $path_to_root.'/modules/FrontHrm/manage/employee.php?', 'SA_EMPL', MENU_ENTRY);
$this->add_lapp_function(2, _('Departments'), $path_to_root.'/modules/FrontHrm/manage/department.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_lapp_function(2, _('Manage Overtime'), $path_to_root.'/modules/FrontHrm/manage/overtime.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_lapp_function(2, _('Default Settings'), $path_to_root.'/modules/FrontHrm/manage/default_setup.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Salary Scales'), $path_to_root.'/modules/FrontHrm/manage/salaryscale.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Allowance and Deduction Account'), $path_to_root.'/modules/FrontHrm/manage/accounts.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Allowance and Deduction Rules'), $path_to_root.'/modules/FrontHrm/manage/payroll_rules.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Salary Structure'), $path_to_root.'/modules/FrontHrm/manage/salary_structure.php?', 'SA_HRSETUP', MENU_MAINTENANCE);
$this->add_extensions();
}
}
class hooks_FrontHrm extends hooks {
function __construct() {
$this->module_name = 'FrontHrm';
}
function install_tabs($app) {
$app->add_application(new FrontHrm_app);
}
function install_access() {
$security_sections[SS_HRM] = _('Human Resource');
$security_areas['SA_EMPL'] = array(SS_HRM|1, _('Hrm entry'));
$security_areas['SA_HRSETUP'] = array(SS_HRM|1, _('Hrm setup'));
return array($security_areas, $security_sections);
}
function activate_extension($company, $check_only=true) {
global $db_connections;
$updates = array( 'update.sql' => array('fronthrm'));
return $this->update_databases($company, $updates, $check_only);
}
function deactivate_extension($company, $check_only=true) {
global $db_connections;
$updates = array('remove.sql' => array('fronthrm'));
return $this->update_databases($company, $updates, $check_only);
}
}