'S3 framework function
Designed to be called when a user is created & approved through:
- prepop
- approved automatically during registration
- approved by admin
- added by admin
- updated by admin
Does the following:
- Calls s3_link_to_organisation:
Creates (if not existing) User\'s Organisation and links User
- Calls s3_link_to_person:
Creates (if not existing) User\'s Person Record and links User
- Calls s3_link_to_human_resource:
Creates (if not existing) User\'s Human Resource Record and links User
- Calls s3_link_to_member'

def s3_link_user(self, user):

    organisation_id = self.s3_link_to_organisation(user)
    person_id = self.s3_link_to_person(user, organisation_id)
    if user.org_group_id:
        self.s3_link_to_org_group(user, person_id)
    utable = self.settings.table_user
    link_user_to = (user.link_user_to or utable.link_user_to.default)
    if link_user_to:
        if ('staff' in link_user_to):
            human_resource_id = self.s3_link_to_human_resource(user, person_id, hr_type=1)
        if ('volunteer' in link_user_to):
            human_resource_id = self.s3_link_to_human_resource(user, person_id, hr_type=2)
        if ('member' in link_user_to):
            member_id = self.s3_link_to_member(user, person_id)
