Installing the orangehrmAdvancedLeavePlugin -------------------------------------------- 1. Checkout to symfony/plugins * cd symfony/plugins * git clone http://orangehrm.com/repos/plugins/orangehrmAdvancedLeavePlugin/trunk orangehrmAdvancedLeavePlugin 2. Enable plugin * Edit config/ProjectConfiguration.class.php add orangehrmAdvancedLeavePlugin to enabled modules list before the orangehrmCoreLeavePlugin. 3. Publish plugin assets: * symfony orangehrm:publish-assets 4. Clear symfony cache: * symfony cc 5. Build model classes: * symfony doctrine:build-model 6. Add leave_type_rules to hs_hr_leavetype table if not already there. This would be something that can be handled by the installer (or plugin installer) at a later time. * alter table hs_hr_leavetype add column leave_rules text default null; 7. Create Leave Accrual table so that we can execute cron schedular CREATE TABLE `hs_hr_emp_leave_accrual` ( `acc_id` int(11) not null auto_increment, `leave_type_id` varchar(13) NOT NULL, `leave_period_id` int(7) NOT NULL, `employee_id` int(7) NOT NULL, `acc_time` date NOT NULL, `accrual_amount` decimal(4,2) default NULL, PRIMARY KEY (`acc_id`), key `leave_period_id` (`leave_period_id`), key `employee_id` (`employee_id`), key `leave_type_id` (`leave_type_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; alter table `hs_hr_emp_leave_accrual` add constraint foreign key (employee_id) references `hs_hr_employee` (`emp_number`) on delete cascade; alter table `hs_hr_emp_leave_accrual` add constraint foreign key (`leave_period_id`) references `hs_hr_leave_period` (`leave_period_id`) on delete cascade; alter table `hs_hr_emp_leave_accrual` add constraint foreign key (`leave_type_id`) references `hs_hr_leavetype` (`leave_type_id`) on delete cascade; 8. Running the Cron you have to run the symfony task everyday For leave accrual and leave carry forward to work properly set up a cron job to run the following command everyday symfony>php symfony LeaveAccrualAndCarryForward Uninstalling the orangehrmAdvancedLeavePlugin --------------------------------------------- 1. Disable the plugin * Edit config/ProjectConfiguration.class.php remove orangehrmAdvancedLeavePlugin from the enabled modules list. 2. Clear symfony cache: * symfony cc 3. (Optional) Completely remove orangehrmAdvancedLeavePlugin * Rebuild model: symfony doctrine:build-model * Remove plugin/orangehrmAdvancedLeavePlugin directory * Remove lib/model/doctrine/orangehrmAdvancedLeavePlugin * Remove web/doctrine/orangehrmAdvancedLeavePlugin This still leaves the extra fields in the database. The core models have not problems with this. If needed the extra fields can be dropped. NOTES: * After installing the advanced leave module, if you edit a leave type created before installing the advanced leave module, you will get an error.