civicrm/civihr — pull request #275 by vivekarora (2014-01-02 11:46:52+00:00)
Title: HR224 - HRAbsence

1. Create extension, org.civicrm.hrabsence with an upgrader
2. In Upgrader::install, register new activity type "Public Holiday" (unless it already exists)
3. In Upgrader::install, register new CiviCRM component, "Timesheet" (unless it already exists)
4. In Upgrader::install, register new activity type "Absence" (unless it already exists) and set its component to "Timesheet". Ensure that "Absence" doesn't appear as an option for creating new activities. (There may be an option you can set in the activity-type's OptionValue record.)
5. Create setup.sh process for DAOs/sql generation (similar to hrjob)
6. Create entity AbsenceType with DAO/BAO/SQL/API. (See schema in wiki)
- The BAO's create/update function should define special behavior.
- If the option "allow_debit" is set, then it auto-creates an activity-type with the same name as the absence-type. Retain the activity-type-id.
- If the option "allow_credit" is set, the nit auto-creates an activity-type. The name is based on the name of the absence-type -- ts('%1 (Credit)'). Retain the activity-type-id.
- Include API unit-tests to ensure that various combinations of allow_debit/allow_credit work as expected.
7. Create entity AbsencePeriod with DAO/BAO/SQL/API. (See schema in wiki)
8. Create entity AbsenceEntitlement with DAO/BAO/SQL/API. (See schema in wiki)
9. In hook_managed, declare all the AbsenceTypes.