'Check the check-in/out status for a person at this site,
invokes the check_in_status hook for the site resource
to obtain current status information.
@param r: the S3Request
@param site_id: the site ID
@param person: the person record
@return: a dict like:
{valid: True|False, whether the person record is valid
for check-in/out at this site
status: 1 = currently checked-in at this site
2 = currently checked-out from this site
None = no previous status available
info: string or XML to render in info-field
check_in_allowed: True|False
check_out_allowed: True|False
error: error message to display in check-in form'

@staticmethod
def status(r, person):

    result = {'valid': True, 'status': None, 'info': None, 'check_in_allowed': True, 'check_out_allowed': True, 'error': None}
    check_in_status = current.s3db.get_config(r.tablename, 'check_in_status')
    if check_in_status:
        status = check_in_status(r.record, person)
    else:
        status = None
    if isinstance(status, dict):
        result.update(status)
    else:
        result['status'] = status
    return result
