Uploaded image for project: 'CiviHR'
  1. CiviHR
  2. HR-226 Implement employee-absence widget
  3. HR-268

Activity.getAbsences API should use period_id based on absence-dates

    Details

    • Type: Sub-task
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: HR-1.2
    • Fix Version/s: HR-1.2
    • Component/s: Absence
    • Labels:
      None
    • Sprint:
      Sprint 1, Sprint 12b

      Description

      When fetching a list of absence-requests by period-id, the the period-id is determined by the request-date. It would be more sensible to base it on the start-date. See also comments from:

      http://issues.civicrm.org/jira/browse/HR-239
      http://issues.civicrm.org/jira/browse/HR-240

      One approach is to reimplement the API so that a typical request uses SQL more like:

      ----- BEGIN -----
      SELECT request.*
      FROM civicrm_activity request
      INNER JOIN civicrm_activity absence
      ON request.id = absence.source_record_id
      AND absence.activity_type_id = 123
      INNER JOIN civicrm_activity_contact ac
      ON request.id = ac.activity_id
      AND ac.type = 'target'
      WHERE
      request.activity_type_id in (:list)
      AND absence.activity_date_time BETWEEN :periodStart AND :periodEnd
      GROUP BY request.id
      ----- END ------

        Attachments

          Activity

            People

            • Assignee:
              nishant.bhorodia Nishant Bhorodia
              Reporter:
              timotten Tim Otten
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: