'Custom Modules Menu'

@classmethod
def menu_modules(cls):

    T = current.T
    auth = current.auth
    settings = current.deployment_settings
    has_role = auth.s3_has_role
    root_org = auth.root_org_name()
    system_roles = current.session.s3.system_roles
    ADMIN = system_roles.ADMIN
    ORG_ADMIN = system_roles.ORG_ADMIN
    s3db = current.s3db
    s3db.inv_recv_crud_strings()
    inv_recv_list = current.response.s3.crud_strings.inv_recv.title_list
    vol_activities = (lambda i: (True if (root_org == CRMADA) else False))
    use_certs = (lambda i: settings.get_hrm_use_certificates())
    vol_programmes = (lambda i: (settings.get_hrm_vol_experience() in ('programme', 'both')))
    def outreach(item):
        return ((root_org == NZRC) or ((root_org is None) and has_role(ADMIN)))
    def vol_roles(item):
        return (root_org != IRCS)
    def vol_teams(item):
        return (root_org != IRCS)
    return [homepage('gis')(), homepage('hrm', 'org', name=T('Staff'), vars=dict(group='staff'))(MM('Staff', c='hrm', f='staff', m='summary'), MM('Teams', c='hrm', f='group'), MM('National    Societies', c='org', f='organisation', vars=red_cross_filter), MM('Offices', c='org', f='office'), MM('Job    Titles', c='hrm', f='job_title'), MM('Training    Events', c='hrm', f='training_event'), MM('Training    Courses', c='hrm', f='course'), MM('Certificate    List', c='hrm', f='certificate', check=use_certs)), homepage('vol', name=T('Volunteers'))(MM('Volunteers', c='vol', f='volunteer', m='summary'), MM('Teams', c='vol', f='group', check=vol_teams), MM('Volunteer    Roles', c='vol', f='job_title', check=vol_roles), MM('Activities', c='vol', f='activity', check=vol_activities), MM('Programs', c='vol', f='programme', check=vol_programmes), MM('Training    Events', c='vol', f='training_event'), MM('Training    Courses', c='vol', f='course'), MM('Certificate    List', c='vol', f='certificate', check=use_certs)), homepage('member')(MM('Members', c='member', f='membership', m='summary')), homepage('inv', 'supply', 'req')(MM('Warehouses', c='inv', f='warehouse', m='summary'), MM(inv_recv_list, c='inv', f='recv'), MM('Sent    Shipments', c='inv', f='send'), MM('Items', c='supply', f='item'), MM('Catalogs', c='supply', f='catalog'), M('Suppliers', c='inv', f='supplier')(), M('Facilities', c='inv', f='facility')(), M('Requests', c='req', f='req')()), homepage('asset')(MM('Assets', c='asset', f='asset', m='summary'), MM('Items', c='asset', f='item', m='summary')), homepage('survey')(MM('Assessment    Templates', c='survey', f='template'), MM('Disaster    Assessments', c='survey', f='series')), homepage('project')(MM('Projects', c='project', f='project', m='summary'), MM('Communities', c='project', f='location'), MM('Outreach', c='po', f='index', check=outreach)), homepage('vulnerability')(MM('Map', c='vulnerability', f='index')), homepage('event')(MM('Events', c='event', f='event', m='summary'), MM('Incident    Reports', c='event', f='incident_report', m='summary')), homepage('deploy', name='RDRT', f='mission', m='summary', vars={'~.status__belongs': '2'})(MM('Missions', c='deploy', f='mission', m='summary'), MM('Members', c='deploy', f='human_resource', m='summary'))]
