Changeset 1177 for WAeUP_SRP


Ignore:
Timestamp:
2 Jan 2007, 15:02:02 (18 years ago)
Author:
joachim
Message:

check acknowledge box,
add logging messages.

Location:
WAeUP_SRP/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r1175 r1177  
    384384        value = datastructure[widget_id].upper()
    385385        err = 0
     386        record = datastructure[self.reference]
    386387        if not valid:
    387388            err = 'Invalid String'
     389        elif not record:
     390            err = 0
    388391        else:
    389392            #import pdb;pdb.set_trace()
    390             record = datastructure[self.reference]
    391393            found = False
    392394            cvs = []
     
    429431        if not valid:
    430432            err = 'Invalid MatricNo %s.' % (value)
     433            logger.info('"%s","invalid MatricNo"' % value)
    431434        else:
    432435            widget_id = self.getWidgetId()
    433436            value = datastructure[widget_id].upper()
    434             #s = getStudentByRegNo(self,value)
     437            datastructure['student'] = None
    435438            while not err:
    436439                res = returning(matric_no = value)
    437440                if len(res) < 1:
     441                    logger.info('"%s","MatricNo not found."' % value)
    438442                    err = 'No Student with MatricNo %s.' % (value)
    439443                    continue
  • WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml

    r1175 r1177  
    3838  </property>
    3939  <property name="reference">student</property>
    40   <property name="display_width">10</property>
    41   <property name="size_max">10</property>
     40  <property name="display_width">20</property>
     41  <property name="size_max">40</property>
    4242 </widget>
    4343 <widget name="jamb_reg_no" meta_type="JambRegNo Widget">
  • WAeUP_SRP/trunk/skins/waeup_student/display_session_results.py

    r1175 r1177  
    7070    if student_obj and hasattr(student_obj,'application'):
    7171        registered = student_id
    72    
     72else:
     73    registered = "no_student_object"
    7374return context.session_results_anon_view(student=student_rec,
    7475                                           results=results,
     76                                           name = "%(Firstname)s %(Middlename)s %(Lastname)s" % student_rec,
    7577                                           registered = registered)
    7678
  • WAeUP_SRP/trunk/skins/waeup_student/layout_search_session_edit.pt

    r1176 r1177  
    1010  formaction options/formaction;
    1111  matric_no options/matric_no|nothing;
     12  name options/name|nothing;
    1213  creation creation|nothing;
    1314  cpsmcat nocall:here/translation_service;
     
    1819        >
    1920 
     21<input type="hidden" name="name" tal:attributes="value name"/>
    2022<input type="hidden" name="matric_no" tal:attributes="value matric_no"/>
    2123  <table class="layoutDefault" summary="Form layout"
  • WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt

    r1175 r1177  
    5353      </table>
    5454      <br />
    55       <div tal:condition="registered">You have already set your Password, please
    56         <a href="" tal:attributes="href string:${context/portal_url}/login_student">login</a>
    57         with your UserId <span tal:replace="registered" />
     55      <div tal:condition="registered">
     56        <span tal:condition="python: registered == 'no_student_object'">
     57          Your Datafiles have not yet been created, please check again later.
     58        </span>
     59        <span tal:condition="python: registered != 'no_student_object'">
     60          You have already set your Password, please
     61          <a href="" tal:attributes="href string:${context/portal_url}/login_student">login</a>
     62          with your UserId <span tal:replace="registered" />
     63        </span>
    5864      </div>
    5965      <form tal:condition="not: registered" action="" method="post"
    6066            tal:attributes="action string:${context/portal_url}/set_access_data">
     67        <input type="hidden" name="name" tal:attributes="value options/name" />
    6168        <input type="hidden" name="matric_no" tal:attributes="value student/matric_no" />
    62         <input type="hidden" name="jamb_reg_no" tal:attributes="value student/Entryregno" />
    6369        <input type="submit"
    6470               class="standalone"
  • WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py

    r1169 r1177  
    55return html renderer + psm
    66"""
    7 import DateTime
     7import DateTime,logging
    88current = DateTime.DateTime()
    99pr = context.portal_registration
    10 
     10logger = logging.getLogger('Returning')
    1111validate = REQUEST.has_key("cpsdocument_edit_button")
    1212
     
    1414#pr = context.portal_registration
    1515default = {'matric_no':matric_no}
     16st_res = context.students_catalog(matric_no = matric_no)
     17if st_res:
     18    sid = st_res[0].id
     19else:
     20    logger.info('"%s","Studentobject does not exist"' % matric_no)
    1621res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
    1722                      schema_id= 'student_returning',
     
    2530                      commit = False,
    2631                      )
    27 if psm == 'invalid':
    28     return context.set_access_data_form(rendered = res,
    29                                  psm = "Please correct your input!",
    30                                  #psm = "%s, %s" % (psm,ds),
    31                                  firstlayout = True,
    32                                  lastlayout = True,
    33                                  ds = ds,
    34                                  )
    35 elif psm == '':
     32if psm == '':
    3633    return context.set_access_data_form(rendered = res,
    3734                                 psm = None,
     
    3936                                 lastlayout = True,
    4037                                 ds = ds,
     38                                 name = "%(name)s" % REQUEST.form
    4139                                 )
    42 elif psm == 'valid':
    43     pass
    44 ##    jamb_reg_no = ds.get('jamb_reg_no')
    45 ##    r = context.returning_import(matric_no = matric_no)
    46 ##    if r and r[0].Entryregno != jamb_reg_no or not r:
    47 ##        psm = "Your Jamb Registration Nr is wrong"
    48 ##        return context.set_access_data_form(rendered = res,
    49 ##                                 psm = psm,
    50 ##                                 firstlayout = True,
    51 ##                                 lastlayout = True,
    52 ##                                 ds = ds,
    53 ##                                 )
    54 ## from Products.zdb import set_trace;set_trace()
     40elif psm == 'invalid':
     41    psm = "Please correct your input!"
     42elif psm == 'valid' and not REQUEST.form.has_key('acknowledge'):
     43    psm = "You did not check the ackkowledge box !"
     44else:
     45    psm = ''
     46if psm != '':
     47    return context.set_access_data_form(rendered = res,
     48                                 #psm = "%s, %s" % (psm,ds),
     49                                 psm = psm,
     50                                 firstlayout = True,
     51                                 lastlayout = True,
     52                                 ds = ds,
     53                                 name = "%(name)s" % REQUEST.form
     54                                 )
    5555password = REQUEST.get('widget__password')
    5656email = ds.get('email')
    57 st_res = context.students_catalog(matric_no = matric_no)
    58 if st_res:
    59     sid = st_res[0].id
    6057context.waeup_tool.makeStudentMember(sid,password=password)
    6158args = {}
  • WAeUP_SRP/trunk/skins/waeup_student/set_access_data_form.pt

    r1163 r1177  
    1313      </metal:block>
    1414      <metal:block fill-slot="main">
     15        <h3><span tal:replace="options/name"/></h3>
    1516        <h3>Enter Your Authentication Details and Choose a Password!</h3>
    1617        <br />
Note: See TracChangeset for help on using the changeset viewer.