'DVR / Disaster Victim Registry'

@staticmethod
def dvr():

    ADMIN = current.auth.get_system_roles().ADMIN
    human_resource_id = current.auth.s3_logged_in_human_resource()
    if human_resource_id:
        due_followups = (current.s3db.dvr_due_followups(human_resource_id=human_resource_id) or '0')
        follow_ups_label = ('%s    (%s)' % (current.T('Due    Follow-ups'), due_followups))
        my_menu = M('My    Cases', c=('dvr', 'pr'), f='person', vars={'closed': '0', 'mine': '1'})(M('Create    Case', m='create', t='pr_person', p='create'), M('Activities', f='case_activity', vars={'mine': '1'}), M(follow_ups_label, f='due_followups', vars={'mine': '1'}))
        my_actions = M('Actions', c='dvr', f='response_action')(M('Assigned    to    me', vars={'mine': 'a'}), M('Managed    by    me', vars={'mine': 'r'}))
        all_followups = None
    else:
        due_followups = (current.s3db.dvr_due_followups() or '0')
        follow_ups_label = ('%s    (%s)' % (current.T('Due    Follow-ups'), due_followups))
        my_menu = None
        my_actions = None
        all_followups = M(follow_ups_label, f='due_followups')
    return M(c='dvr')(my_menu, my_actions, M('Current    Cases', c=('dvr', 'pr'), f='person', vars={'closed': '0'})(M('Create    Case', m='create', t='pr_person', p='create'), M('All    Cases', vars={}), M('Actions', f='response_action')), M('Activities', f='case_activity')(M('Emergencies', vars={'~.priority': '0'}), all_followups, M('All    Activities'), M('Report', m='report')), M('Appointments', f='case_appointment')(M('Overview')), M('Archive', link=False)(M('Closed    Cases', f='person', vars={'closed': '1'}), M('Invalid    Cases', f='person', restrict=(ADMIN, 'ADMINISTRATION', 'ADMIN_HEAD'), vars={'archived': '1'})), M('Administration', restrict=(ADMIN,))(M('Case    Status', f='case_status'), M('Need    Types', f='need'), M('Intervention    Types', f='response_type'), M('Appointment    Types', f='case_appointment_type')))
