Uploaded image for project: 'CiviHR'
  1. CiviHR
  2. HR-267

Migrate leave-types from OptionGroup to HRAbsenceType

    Details

    • Type: Task
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Do
    • Affects Version/s: HR-1.2
    • Fix Version/s: HR-1.2
    • Component/s: Absence, Jobs
    • Labels:
      None
    • Sprint:
      Sprint 12b, Sprint 12d

      Description

      In HR-1.0 and HR-1.1, there were three leave types defined in an OptionGroup:

      • Annual
      • Public
      • Sick

      In HR-1.2, there are many leave types defined with HRAbsenceType, eg

      • Sick
      • Vacation
      • Maternity
      • Paternity
      • TOIL
      • Other

      T1. In hrabsence, move the installation logic out of CRM/HRAbsence/HRAbsence.mgd.php and into CRM_HRAbsence_Upgrader::install()

      T2. In CRM_HRAbsence_Upgrader::install(), check to see if there's a pre-existing table ("civicrm_hrjob_leave") and pre-existing OptionGroup ("hrjob_leave_type") for the absence-types. If there is one, then skip creation of the default HRAbsenceTypes. Instead, convert each OptionValue to an HRAbsenceType, and update the data in civicrm_hrjob_leave.leave_type.

      T3. In hrjob, change the XML schema for HRJobLeave.leave_type. It's currently a pseudo-constant which references an option-group. It should be a reference to civicrm_absence_type. (For an example of referencing a table, see https://github.com/civicrm/civicrm-core/blob/4.4/xml/schema/Core/Email.xml#L34 )

      => Changing this should have the effect of changing how the UI lists out leave-types. For example, when viewing the "Jobs" tab, you can use the Firebug console to inspect CRM.FieldOptions.HRJobLeave.leave_type.
      => If you encounter issues with changing pseudo-constants, contact colemanw.

      T4. In hrjob, change the installation process so that it does not create the OptionGroup (hrjob_leave_type) on new installations.

      T5. Test upgrades from HR-1.1 to HR-1.2. You will probably want to install hrabsence before running the other DB upgrades. Modify doc/UPGRADE.md accordingly.

      T6. Test new-installation process.

        Attachments

          Activity

            People

            • Assignee:
              timotten Tim Otten
              Reporter:
              timotten Tim Otten
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days
                4d