Ignore:
Timestamp:
8 Dec 2006, 19:38:39 (18 years ago)
Author:
joachim
Message:

M profiles/default/schemas/student_clearance.xml
M profiles/default/layouts/student_clearance_fe.xml
M profiles/default/layouts/student_clearance.xml
M skins/waeup_student/clearance_edit.py
added fields request_date, cleared_date

M skins/waeup_student/application_edit.py
M skins/waeup_student/getStudentInfo.py
M skins/waeup_custom/logged_in.py
M Widgets.py
cleaned up logging messages

M skins/waeup_student/start_clearance.py
added logging

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/application_edit.py

    r892 r1016  
    1515import DateTime
    1616current = DateTime.DateTime()
     17import logging
     18logger = logging.getLogger('Student.Application.Edit')
    1719
    1820# Until ajax posts directly to its own script...
     
    2729info = context.getStudentInfo()
    2830
     31if info is None:
     32    logger.info('"anonymous access","%s"' % request.get('URL0'))
     33    REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
     34   
    2935student = info['student']
    3036app = info['app']
     
    5056    elif cpsdocument_edit_and_view_button:
    5157        if app_doc.passport is not None:
     58            logger.info('"%s", "continue' % (info['id']))
    5259            action = "/start_clearance"
    5360            base_url = student.absolute_url()
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py

    r942 r1016  
    1515import DateTime
    1616current = DateTime.DateTime()
     17import logging
     18logger = logging.getLogger('Student.Clearance')
    1719
    1820cpsdocument_edit_button = REQUEST.has_key('cpsdocument_edit_button')
     
    3537clear = info['clear']
    3638clear_doc = info['clear_doc']
     39student_id = info['id']
     40member_id = str(context.portal_membership.getAuthenticatedMember())
    3741
    3842is_valid, ds = clear_doc.validate(request=REQUEST,
     
    5155           action = "/clearance_edit_form"       
    5256    elif cpsdocument_edit_and_view_button:
    53         if acknowledge:
     57        if acknowledge and info['review_state'] == "clearance_pin_entered":
     58            logger.info('"%s","requested clearance"' % (student_id))
     59            info['clear_doc'].edit(mapping = {'request_date': current,})
    5460            wftool.doActionFor(info['clear'],'close')
    5561            wftool.doActionFor(info['student'],'request_clearance',dest_container=1)
     
    5763            if context.isStudent():
    5864               action = "/clearance_view"
     65        elif acknowledge and info['review_state'] != "clearance_pin_entered":
     66            logger.info('"%s","double requested clearance"' % (student_id))
     67            psm = "You have already requested clearance"
     68            if context.isStudent():
     69               action = "/clearance_edit_form"
    5970        else:
    6071            psm = "You must tick the acknowledgement check box before submission!"
    6172            if context.isStudent():
    6273               action = "/clearance_edit_form"
    63     elif clear_and_validate_button:
     74    elif clear_and_validate_button and info['review_state'] == "clearance_requested":
     75        logger.info('"%s","cleared","%s"' % (member_id,student_id ))
    6476        wftool.doActionFor(info['student'],'clear_and_validate')
     77        info['clear_doc'].edit(mapping = {'cleared_date': current,})
    6578        psm = "Clearance and eligibility record is validated and and student is cleared!"
     79    elif clear_and_validate_button and info['review_state'] == "cleared_and_validated":
     80        psm = "This student is already cleared!"
    6681    elif reject_clearance_button:
     82        logger.info('"%s","rejected clearance for","%s"' % (member_id,student_id ))
    6783        wftool.doActionFor(info['clear'],'open')
    6884        wftool.doActionFor(info['student'],'reject_clearance')
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r1007 r1016  
    3434        try:
    3535            requested_id = path_info[path_info.index('students')+1]
    36         except ValueError:
    37             student_id = member_id
    38             break
    39         except IndexError:
     36        except (ValueError,IndexError):
    4037            student_id = member_id
    4138            break
  • WAeUP_SRP/trunk/skins/waeup_student/start_clearance.py

    r892 r1016  
    77current = DateTime.DateTime()
    88pr = context.portal_registration
     9import logging
     10logger = logging.getLogger('Student.Clearance.Start')
    911
    1012type_name = 'Student'
     
    1820pr = context.portal_registration
    1921
     22info = context.getStudentInfo()
     23app_doc = info['app_doc']
     24review_state = info['review_state']
     25
    2026res,psm,ds = lt.renderLayout(layout_id='student_clearance',
    2127                      schema_id= 'student_clearance',
     
    2733                      button = "Start",
    2834                      )
    29 
    30 info = context.getStudentInfo()
    31 app_doc = info['app_doc']
    32 if app_doc.passport is None:
    33     return context.clearance_pin_form(rendered = res,
    34                                  psm = "You must upload your passport picture before you can start the registration process!",
    35                                  #psm = "%s, %s" % (psm,ds),
    36                                  firstlayout = True,
    37                                  lastlayout = True,
    38                                  ds = ds,
    39                                  )
    40 
    41 if psm == 'invalid':
    42     return context.clearance_pin_form(rendered = res,
    43                                  psm = "Please correct your input!",
    44                                  #psm = "%s, %s" % (psm,ds),
    45                                  firstlayout = True,
    46                                  lastlayout = True,
    47                                  ds = ds,
    48                                  )
    49 elif psm == '':
     35if psm == '':
    5036    return context.clearance_pin_form(rendered = res,
    5137                                 psm = None,
     
    5440                                 ds = ds,
    5541                                 )
    56 elif psm == 'valid':
    57     info = context.getStudentInfo()
    58     review_state = info['review_state']
    59     wf.doActionFor(info['student'],'enter_clearance_pin')
    60     wf.doActionFor(info['app'],'close')
    61     wf.doActionFor(info['clear'],'open')
    62     pin = str(ds.get('clr_ac_pin'))
    63     dc = {}
    64     dc['clr_ac_pin'] = pin
    65     dc['clr_ac_date'] = current
    66     dc['entry_date'] = current
    67     dc['entry_session'] = "2006/2007"
    68     info['clear_doc'].edit(mapping = dc)
     42error = False
     43if app_doc.passport is None:
     44    psm = "You must upload your passport picture before you can start the registration process!"
     45    error = True
     46elif review_state == "clearance_pin_entered":
     47    psm = "You have already entered a clearance pin"
     48    error = True
     49elif psm == 'invalid':
     50    psm = "Please correct your input!",
     51    error = True
     52if error:
     53    return context.clearance_pin_form(rendered = res,
     54                                 psm = psm,
     55                                 firstlayout = True,
     56                                 lastlayout = True,
     57                                 ds = ds,
     58                                 )
     59pin = str(ds.get('clr_ac_pin'))
     60logger.info('"%s", "%s"' % (info['id'],pin))
     61wf.doActionFor(info['student'],'enter_clearance_pin')
     62wf.doActionFor(info['clear'],'open')
     63dc = {}
     64app_doc = info['app_doc']
     65dc['lga_ident'] = app_doc.get('jamb_lga')
     66dc['lga'] = app_doc.get('jamb_state','no state') + ' / ' + app_doc.get('jamb_lga','no lga')
     67dc['clr_ac_date'] = current
     68dc['entry_date'] = current
     69dc['entry_session'] = "2006/2007"
     70wf.doActionFor(info['app'],'close')
     71info['clear_doc'].edit(mapping = dc)
    6972return redirect("%s/clearance_edit_form" % info['clear'].absolute_url())
Note: See TracChangeset for help on using the changeset viewer.