Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9438

Create Change Membership Type and Change Membership Status activity types

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.8
    • Fix Version/s: 4.2.0
    • Component/s: CiviMember
    • Labels:
      None

      Description

      When a membership is edited and its type or status is changed, an Activity record should be created that records the change similar to Change Case Type and Change Case Status activities. This issue specifies the work to do this on the 3.4 and 4.1 branches.

      1. In appropriate file (whatever civicrm_data.mysql is generated from these days), create a new activity type in civicrm_option_value as follows (follow existing protocol in file for specifying the option_group_id and the value and weight):

        1. option_group_id=2
        2. label='Change Membership Status'
        3. name='Change Membership Status'
        4. value=23
        5. weight=23
        6. grouping=null
        7. filter=0
        8. is_default=0
        9. is_reserved=1
        10. is_active=1
        11. component_id=3
        12. domain_id=null
        13. visibility_id=null
      1. Create a second activity type as above with the following fields containing changes in their values:
        1. label='Change Membership Type'
        2. name='Change Membership Type'
        3. value=24
        4. weight=24

      2. Include INSERT statements for these records in CRM/Upgrade/Incremental/sql/3.4.x.mysql.tpl (NB: Consult with Kurund or Deepak on appropriate version file in this directory)

      3. When saving a membership after editing in the backend, eg at civicrm/contact/view/membership?reset=1&action=update&id=33&cid=119, if the status has changed then create a new activity of type Change Membership Status with the following values:

        1. subject: 'Membership Status changed from ' . $old_status_label . ' to ' . $new_status_label
        2. source_contact_id: current user's
        3. source_record_id: membership_id of relevant membership
        4. activity_type_id: 23 (from above)
        5. activity_date_time: now()
        6. duration, location, phone_number, details, medium_id, relationship_id, original_id: NULL
        7. status_id: 2 (ie Completed)
        8. priority_id: 2 (ie Normal)
        9. is_auto: 0
        10. is_current_revision: 1
        11. is_deleted: 0

      4. Insert a related record into civicrm_activity_target with activity_id of newly created activity and target_contact_id = civicrm_membership.contact_id

      5. Repeat 3 and 4 for membership type changes, modifying the subject and activity_type_id as appropriate.

      6. Create a webtest to verify the creation of a new activity for membership type and membership status changes separately, and a third that tests the creation of two activities when both are changed at the same time.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              joemurray Joe Murray
            • Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 3 hours
                3h