'Function to be called from REST prep functions
- main module & components (sites & events)'

@staticmethod
def req_create_form_mods():

    T = current.T
    db = current.db
    s3 = current.response.s3
    settings = current.deployment_settings
    table = db.req_req
    table.req_ref.readable = False
    table.commit_status.readable = table.commit_status.writable = False
    table.transit_status.readable = table.transit_status.writable = False
    table.fulfil_status.readable = table.fulfil_status.writable = False
    table.cancel.readable = table.cancel.writable = False
    table.closed.readable = table.closed.writable = False
    table.date_recv.readable = table.date_recv.writable = False
    table.recv_by_id.readable = table.recv_by_id.writable = False
    if settings.get_req_requester_from_site():
        table.requester_id.widget = None
        table.requester_id.comment = S3PopupLink(c='pr', f='person', vars={'child': 'requester_id', 'parent': 'req'}, title=s3.crud_strings['pr_person'].label_create)
        s3.jquery_ready.append(("\n$.filterOptionsS3({\n    'trigger':'site_id',\n    'target':'requester_id',\n    'lookupResource':'staff',\n    'lookupURL':S3.Ap.concat('/hrm/staff_for_site/'),\n    'msgNoRecords':'%s',\n    'optional':true,\n})" % T('No    contacts    yet    defined    for    this    site')))
    req_types = settings.get_req_req_type()
    if ('People' in req_types):
        table.date_required_until.writable = True
    request = current.request
    if ('type' not in request.get_vars):
        req_helptext = ('\ni18n.req_purpose="%s"\ni18n.req_site_id="%s"\ni18n.req_request_for_id="%s"\ni18n.req_recv_by_id="%s"\ni18n.req_items_purpose="%s"\ni18n.req_items_site_id="%s"\ni18n.req_items_recv_by_id="%s"\ni18n.req_people_purpose="%s"\ni18n.req_people_site_id="%s"\ni18n.req_people_recv_by_id="%s"\ni18n.req_next_msg="%s"\ni18n.req_other_msg="%s"\ni18n.req_details_mandatory="%s"' % (table.purpose.label, table.site_id.label, table.request_for_id.label, table.recv_by_id.label, T('What    the    Items    will    be    used    for'), T('Deliver    To'), T('Delivered    To'), T('Task    Details'), T('Report    To'), T('Reported    To'), T('Please    enter    the    details    on    the    next    screen.'), T('Please    enter    request    details    here.'), T('Details    field    is    required!')))
        s3.js_global.append(req_helptext)
        s3.scripts.append(('/%s/static/scripts/S3/s3.req_create_variable.js' % request.application))
    else:
        s3.scripts.append(('/%s/static/scripts/S3/s3.req_create.js' % request.application))
