Resolution: Won't Do
Affects Version/s: HR-1.1
Fix Version/s: HR-1.1
== Original Description ==
If the "Is Visa Required" field is checked and no record is entered, then it should a notification whenever the contact page has been visited. Need to add an Activity Notification to the Dashboard, and to periodically email a reminder.
== Updated Description ==
- Create activity types, "Visa Expiration"
- Implement a helper function, CRM_HRVisa_Activity::sync($contactID) to:
- Determine if "Is Visa Required" is true or false
- Find the latest visa
- Find/update or create an activity of type "Visa Expiration" (given the $contactID). There should be 0-1 records. If multiple exist, take the last (chronologically) and log an error.
- Set the activity_date_time to the expiration date of the latest visa
- Set status to "Cancelled" if an activity is found but not required
- Set status to "Scheduled" otherwise
- Add hook_civicrm_custom to call CRM_HRVisa_Activity::sync($contactID)
- During hook_install/enable/disable/uninstall, setup a weekly scheduled reminder for activities of type "Visa Expiration"
- Upgrade: Find all contacts who require visas and run CRM_HRVisa_Activity::sync($contactID)
- Add unit-test