'Check-in the person at this site, invokes the site_check_in
hook for the site resource
@param r: the S3Request
@param person: the person record'

def check_in(self, r, person):

    s3db = current.s3db
    ptable = s3db.pr_person
    from s3.s3track import S3Trackable
    person_id = person.id
    record = r.record
    tracker = S3Trackable(ptable, record_id=person_id)
    tracker.set_location(record.location_id)
    site_check_in = s3db.get_config(r.tablename, 'site_check_in')
    if site_check_in:
        site_check_in(record.site_id, person_id)
