(app, lang)
return module, enroll.get_unique_id()
Creates Enrolment Module for Biometrics
Creates Enrolment Module for Biometrics
Creates Enrolment Module for Biometrics
def _init_biometrics_enroll_module(app, lang):
    """
    Creates Enrolment Module for Biometrics
    """
    module = app.add_module(Module.new_module(_("Registration"), lang))

    form_name = _("Enroll New Person")

    context = {
        'xmlns_uuid': generate_xmlns(),
        'form_name': form_name,
        'name_label': _("What is your name?"),
        'simprints_enrol_label': _("Scan Fingerprints"),
        'lang': lang,
    }
    context.update(app.biometric_context)
    attachment = render_to_string(
        "app_manager/simprints_enrolment_form.xml",
        context=context
    )

    enroll = app.new_form(module.id, form_name, lang, attachment=attachment)
    enroll.actions.open_case = OpenCaseAction(
        name_path="/data/name",
        condition=FormActionCondition(type='always'),
    )
    enroll.actions.update_case = UpdateCaseAction(
        update={
            'simprintsId': '/data/simprintsId',
            'rightIndex': '/data/rightIndex',
            'rightThumb': '/data/rightThumb',
            'leftIndex': '/data/leftIndex',
            'leftThumb': '/data/leftThumb',
        },
        condition=FormActionCondition(type='always'),
    )

    module.case_type = 'person'

    return module, enroll.get_unique_id()
def _init_biometrics_enroll_module ( app , lang ) : module = app . add_module ( Module . new_module ( _ ( "Registration" ) , lang ) ) form_name = _ ( "Enroll New Person" ) context = { 'xmlns_uuid' : generate_xmlns ( ) , 'form_name' : form_name , 'name_label' : _ ( "What is your name?" ) , 'simprints_enrol_label' : _ ( "Scan Fingerprints" ) , 'lang' : lang , } context . update ( app . biometric_context ) attachment = render_to_string ( "app_manager/simprints_enrolment_form.xml" , context = context ) enroll = app . new_form ( module . id , form_name , lang , attachment = attachment ) enroll . actions . open_case = OpenCaseAction ( name_path = "/data/name" , condition = FormActionCondition ( type = 'always' ) , ) enroll . actions . update_case = UpdateCaseAction ( update = { 'simprintsId' : '/data/simprintsId' , 'rightIndex' : '/data/rightIndex' , 'rightThumb' : '/data/rightThumb' , 'leftIndex' : '/data/leftIndex' , 'leftThumb' : '/data/leftThumb' , } , condition = FormActionCondition ( type = 'always' ) , ) module . case_type = 'person' return module , enroll . get_unique_id ( )