Recurring Activities

Published
2014-11-03 23:10
Written by
If you have been using activities then at some point you might’ve felt to have a functionality that’d repeat your activity on certain days. For example repeating a follow-up phone call with client that happens on every friday of the week or any sprint meeting that happens every two weeks, on Monday. If that’s the answer you seek then here it is, you can now actually repeat your activities on hourly, daily, weekly, monthly and yearly basis.
 
After successful submission of recurring events and recurrsion engine, recurring activities was next to be taken up.
 

How we've achieved this?

To implement this we @ Veda Consulting, used core recursion engine built during recurring events, allowing the extensibility to be able to work with other entities, which is reusable/modular and can be used for any entity that needs recursion. Having done this we also improved the UI code flow in the process, to make it more generic for all entities in general.
 
Let’s get started and understand how we can set up repeat configuration for activities:
 
Step 1. Create an activity.
    
Step 2. Fill in other details and lets set repeat configuration for every week on monday and tuesday for next 5 weeks, excluding 4th November 2014 and 10th November 2014.
 
 
Step 3. Save the details and a pop up confirmation box will ask to confirm the dates according to the given criteria.
 
      
Noticeable thing here, is that we 4th/10th November are not shown in the list as they were added in the exclude date list and also they fall on tuesday and monday respectively.
 
Step 4. Upon confirm and save, activities are now created.
 
A. Activities on “Find Activity screen”: 
Current activity here becomes parent activity. Labels are added underneath records to signify recursion and respective parent/child relations, to let you know that repeat is configured.
 
Following is the screenshot of activities on the search screen.
 
B. Activities in activities tab of contact screen.
 
   
Step 5. You can re-create recursion either from parent or child, but this change will delete all the previous related activities and create new from where you configure recursion.
Let’s find out how changes affect other activities. We will now re-create recursion from 3rd November for next 3 weeks.
 
 
     
Step 6. Confirm the dates and save the changes. 
Current activity becomes parent, all other previous relations are deleted and a new set of child activities are created.
 
   
Step 7. This was about re-saving repeat configuration, lets understand how other activity information is updated across recurring set. For this, edit child activity (11th November 2014) and change subject to “Sprint Meeting 2014” and save. A pop up confirmation box will ask for preference of the change.
 
Only this entity: Applies the change only to the current activity
This and Following entities: Applies the changes to current and all other activities in series.
All the entities: Applies the changes to all the activities in series.
 
 
Step 8. Lets select “This and Following entities”. Changes should be applied to child activities having dates 11th, 17th and 18th November 2014.
 
Here is the result!
 
 

References

 
Technical Implementation details - https://civicrm.org/blogs/deepaksrivastava/core-recursion-recurring-events-engine
 
Submitted PR Link for this work - https://github.com/civicrm/civicrm-core/pull/4389
 
Codebase - https://github.com/priyankakaran26/civicrm-core/commits/recurring-activity-46
 
Test case - https://github.com/priyankakaran26/civicrm-core/blob/recurring-activity-46/CRM/Core/BAO/RecurringEntity.php
 
 
Filed under

Comments

All I can is EXCELLENT!!  Very nice job, opens up so much for the community.  Thank you bunches for all of your work.

This is a very nice feature. I can see the potential of it

This is an awesome feature.  

I'm having a little trouble with it for some users.What level of permissions are required for a user to access this feature?

when I try to save an activity, the confirmation window is blank and I get an Access Denied message.  If I click continue the events are saved. it seems like it is just the preview window that's an issue.