'REQ / Request Management'

@staticmethod
def req():

    ADMIN = current.session.s3.system_roles.ADMIN
    settings = current.deployment_settings
    types = settings.get_req_req_type()
    if (len(types) == 1):
        t = types[0]
        if (t == 'Stock'):
            create_menu = M('Create', m='create', vars={'type': 1})
        elif (t == 'People'):
            create_menu = M('Create', m='create', vars={'type': 3})
        else:
            create_menu = M('Create', m='create')
    else:
        create_menu = M('Create', m='create')
    recurring = (lambda i: settings.get_req_recurring())
    use_commit = (lambda i: settings.get_req_use_commit())
    req_items = (lambda i: ('Stock' in types))
    req_skills = (lambda i: ('People' in types))
    return M(c='req')(M('Requests', f='req')(create_menu, M('List    Recurring    Requests', f='req_template', check=recurring), M('Map', m='map'), M('Report', m='report'), M('Search    All    Requested    Items', f='req_item', check=req_items), M('Search    All    Requested    Skills', f='req_skill', check=req_skills)), M('Commitments', f='commit', check=use_commit)(), M('Items', c='supply', f='item')(M('Create', m='create'), M('Report', m='report'), M('Import', m='import', p='create')), M('Catalogs', c='supply', f='catalog')(M('Create', m='create')), M('Item    Categories', c='supply', f='item_category', restrict=[ADMIN])(M('Create', m='create')))
