Changeset 502 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
11 Sep 2006, 10:39:59 (18 years ago)
Author:
joachim
Message:

Scratchcard Pin Generation
basic login in apply_admission

Location:
WAeUP_SRP/trunk/skins
Files:
1 added
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_academics/academics_contents.pt

    r486 r502  
    4343  </div>
    4444    <span tal:omit-tag="" tal:condition="python:display_buttons or context.display_content()"
    45           tal:content="structure doc/render" />
     45          tal:content="structure python: doc.render(proxy=here,layout_mode='view')" />
    4646
    4747  <form action="" method="post" class="group"
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.pt

    r486 r502  
    3838                   dum_home mtool/createMemberArea"
    3939                   >
    40           <span tal:condition="nothing"
     40          <span tal:condition="python:1"
    4141              tal:define="dummy python: context.process_waeup_login(member=member,sc_pin=request.get('sc_pin',None))" />
    4242          <tal:block condition="first_time">
  • WAeUP_SRP/trunk/skins/waeup_default/process_waeup_login.py

    r472 r502  
    77request = context.REQUEST
    88response=request.response
    9 return
    10 ##
    11 ##if request.form.get('submit') == 'Login':
    12 ##    #waeup = context.portal_catalog(id = 'demouni')[0]
    13 ##    #waeup = context.portal_catalog(portal_type = 'University')[0]
    14 ##    if 1 or "Manager" in member.getRoles():
    15 ##        return
    16 ###return
    17 ##member_id = str(member)
     9import DateTime
     10current = DateTime.DateTime()
     11#
     12if request.form.get('submit') == 'Login':
     13    if "Manager" in member.getRoles():
     14        return
     15member_id = str(member)
     16student = getattr(context.students,member_id)
     17application = student.application
     18#student.invokeFactory('StudentPersonal','personal')
     19apdoc = application.getContent()
     20names = apdoc.jamb_lastname.split()
     21dp = {}
     22if len(names) == 3:
     23    dp['firstname'] = names[0].capitalize()
     24    dp['middlename'] = names[1].capitalize()
     25    dp['lastname'] = names[2].capitalize()
     26elif len(names) == 2:
     27    dp['firstname'] = names[0].capitalize()
     28    dp['lastname'] = names[1].capitalize()
     29else:
     30    dp['lastname'] = apdoc.jamb_lastname
     31    dp['sex'] = apdoc.jamb_sex == 'F'
     32    dp['lga'] = "%s/%s" % (apdoc.jamb_state,apdoc.jamb_lga )
     33student.personal.getContent().edit(mapping = dp)
     34##student.content_status_modify(workflow_action="enter_application_pin")
     35
     36da = {}
     37da['app_ac_pin'] = request.get('pin')
     38da['app_ac_date'] = current
     39apdoc.edit(mapping = da)
     40
     41return response.redirect("%s/application_form" % student.application.absolute_url())
     42
    1843##ma = getattr(context,member_id)
    1944##jkw = {'application_sc_pin': sc_pin}
     
    5378##context.notifyCPSDocumentCreation(ob=pd)
    5479##
    55 ##return response.redirect("%s" % ma.absolute_url())
    5680###return ma.personal_addon(REQUEST=context.REQUEST)
    5781
  • WAeUP_SRP/trunk/skins/waeup_pins/scratch_card_batch_create_do.py

    r501 r502  
    3333ob.getContent().edit(mapping=datamodel)
    3434
    35 context.notifyCPSDocumentCreation(ob=ob) # BBB obsolete in CPS 3.5.0
     35#context.notifyCPSDocumentCreation(ob=ob) # BBB obsolete in CPS 3.5.0
    3636
    3737return ob
  • WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py

    r488 r502  
    77import DateTime
    88current = DateTime.DateTime()
     9pr = context.portal_registration
    910
    1011
     
    2526                      layout_mode='create',
    2627                      formaction = "apply_admission",
    27                       submit = "check",
     28                      button = "Open JAMB Record",
    2829                      )
    2930if psm == 'invalid':
     
    4344                                 )
    4445elif psm == 'valid':
    45     jamb_id = ds.get('jamb_reg_no')
    46     student = context.getContent().getStudentByRegNo(jamb_id)
    47     if student is None:
    48         psm = "JAMB record %s not accessible." % (jamb_id)
    49         return context.application_pin_form(rendered = res,
    50                                  psm = psm,
    51                                  #psm = "%s, %s" % (psm,ds),
    52                                  ds = ds,
    53                                  )
    54 application = student.application
    55 if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
    56     #student.invokeFactory('StudentClearance','clearance')
    57     student.invokeFactory('StudentPersonal','personal')
    58     student.content_status_modify(workflow_action="enter_application_pin")
     46    s_id = ds.get('s_id')
     47    return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
     48          % (context.absolute_url(),s_id,'uNsEt',ds.get('app_ac_pin')))
     49   
     50##    jamb_id = ds.get('jamb_reg_no')
     51##    student = context.getContent().getStudentByRegNo(jamb_id)
     52##    if student is None:
     53##        psm = "JAMB record %s not accessible." % (jamb_id)
     54##        return context.application_pin_form(rendered = res,
     55##                                 psm = psm,
     56##                                 #psm = "%s, %s" % (psm,ds),
     57##                                 ds = ds,
     58##                                 )
     59##if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
     60##    #student.invokeFactory('StudentClearance','clearance')
     61##da = {}
     62##pin = str(ds.get('app_ac_pin'))
     63##da['app_ac_pin'] = pin
     64##da['app_ac_date'] = current
     65##apdoc.edit(mapping = da)
    5966
    6067
    61 apdoc = application.getContent()
    62 names = apdoc.jamb_lastname.split()
    63 dp = {}
    64 if len(names) == 3:
    65     dp['firstname'] = names[0].capitalize()
    66     dp['middlename'] = names[1].capitalize()
    67     dp['lastname'] = names[2].capitalize()
    68 elif len(names) == 2:
    69     dp['firstname'] = names[0].capitalize()
    70     dp['lastname'] = names[1].capitalize()
    71 else:
    72     dp['lastname'] = apdoc.jamb_lastname
    73 dp['sex'] = apdoc.jamb_sex == 'F'
    74 dp['lga'] = "%s/%s" % (apdoc.jamb_state,apdoc.jamb_lga )
    75 student.personal.getContent().edit(mapping = dp)
    76 da = {}
    77 da['app_ac_pin'] = ds.get('app_ac_pin')
    78 da['app_ac_date'] = current
    79 apdoc.edit(mapping = da)
    8068# now display the passport form with jamb-data readonly
    8169return context.REQUEST.RESPONSE.redirect("%s/application_form" % (student.application.absolute_url()))
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt

    r493 r502  
    8181         class="standalone"
    8282         name="cpsdocument_create_button"
    83          value="apply"
    84          i18n:attributes="value" tal:condition="creation" />
     83         value="apply"
     84         tal:attributes="value options/button"
     85         tal:condition="creation" />
    8586
    8687</form>
    87 
    88                          
    8988</metal:block>
    9089
Note: See TracChangeset for help on using the changeset viewer.