Changeset 1016 for WAeUP_SRP/trunk
- Timestamp:
- 8 Dec 2006, 19:38:39 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r997 r1016 458 458 def validate(self, datastructure, **kw): 459 459 """Validate datastructure and update datamodel.""" 460 s_logger = logging.getLogger(' students_pin_usage')460 s_logger = logging.getLogger('Student.Pin') 461 461 widget_id = self.getWidgetId() 462 462 v = datastructure[widget_id] … … 498 498 if self.reference == "jamb_reg_no": 499 499 err = "You are already logged in." 500 s_logger.info( "Student %s logged in used Pin %s"% (ref,pin))500 s_logger.info('"%s", "logged in", "%s"' % (ref,pin)) 501 501 break 502 s_logger.info( "Student %s used Pin %s" % (s_id,pin))502 s_logger.info('"%s", "used", "%s"' % (ref,pin)) 503 503 break 504 504 else: 505 505 student = getStudentByRegNo(self,ref) 506 s_logger.info( "Student RegNo %s used Pin %s"% (ref,pin))506 s_logger.info('"jamb_reg_no:%s","used","%s"' % (ref,pin)) 507 507 if student is None: 508 508 err = "Student not found." … … 513 513 if hasattr(self.portal_directories.students,s_id): 514 514 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 515 s_logger.info( "Student %s double used Pin %s"% (s_id,pin))515 s_logger.info('"%s", "double used", "%s"' % (s_id,pin)) 516 516 break 517 517 else: 518 s_logger.info( "Student not Member %s double used Pin %s"% (s_id,pin))518 s_logger.info('"%s","notmember double used", "%s"' % (s_id,pin)) 519 519 else: 520 520 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 521 s_logger.info( "Student %s double used Pin %s"% (s_id,pin))521 s_logger.info('"%s", "double used", "%s"' % (s_id,pin)) 522 522 break 523 523 ## if self.reference == "jamb_reg_no": … … 529 529 try: 530 530 student.getContent().makeStudentMember(s_id,password=pin[4:]) 531 s_logger.info( "Student %s created using Pin %s"% (s_id,pin))531 s_logger.info('"%s", "created using", "%s"' % (s_id,pin)) 532 532 except: 533 533 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 534 s_logger.info( "Student %s double creation with Pin %s"% (s_id,ref))534 s_logger.info('"%s", "double creation", "%s"' % (s_id,ref)) 535 535 break 536 536 break -
WAeUP_SRP/trunk/profiles/default/layouts/student_clearance.xml
r985 r1016 70 70 </property> 71 71 <property name="hidden_readonly_layout_modes"/> 72 <property name="view_format">iso8601_medium_easy</property> 72 73 </widget> 73 74 <widget name="alr_fname" meta_type="String Widget"> … … 159 160 </property> 160 161 <property name="hidden_readonly_layout_modes"/> 162 <property name="view_format">iso8601_medium_easy</property> 161 163 </widget> 162 164 <widget name="cert" meta_type="Image Widget"> … … 232 234 <property name="label_edit">Entry Date</property> 233 235 <property name="readonly_layout_modes"> 234 </property> 235 <property name="hidden_layout_modes"> 236 <element value="create"/> 237 </property> 238 <property name="hidden_readonly_layout_modes"/> 236 <element value="edit"/> 237 </property> 238 <property name="hidden_layout_modes"> 239 <element value="create"/> 240 </property> 241 <property name="hidden_readonly_layout_modes"/> 242 <property name="view_format">iso8601_medium_easy</property> 243 </widget> 244 <widget name="request_date" meta_type="Date Widget"> 245 <property name="title">Request Date</property> 246 <property name="fields"> 247 <element value="request_date"/> 248 </property> 249 <property name="label">Request Date</property> 250 <property name="label_edit">Request Date</property> 251 <property name="readonly_layout_modes"> 252 <element value="edit"/> 253 </property> 254 <property name="hidden_layout_modes"> 255 <element value="create"/> 256 </property> 257 <property name="hidden_readonly_layout_modes"/> 258 <property name="view_format">iso8601_medium_easy</property> 259 </widget> 260 <widget name="cleared_date" meta_type="Date Widget"> 261 <property name="title">cleared Date</property> 262 <property name="fields"> 263 <element value="cleared_date"/> 264 </property> 265 <property name="label">Cleared Date</property> 266 <property name="label_edit">Cleared Date</property> 267 <property name="readonly_layout_modes"> 268 <element value="edit"/> 269 </property> 270 <property name="hidden_layout_modes"> 271 <element value="create"/> 272 </property> 273 <property name="hidden_readonly_layout_modes"/> 274 <property name="view_format">iso8601_medium_easy</property> 239 275 </widget> 240 276 <widget name="entry_session" meta_type="String Widget"> … … 294 330 </property> 295 331 <property name="hidden_readonly_layout_modes"/> 332 <property name="view_format">iso8601_medium_easy</property> 296 333 </widget> 297 334 <widget name="fst_sit_fname" meta_type="String Widget"> … … 607 644 </property> 608 645 <property name="hidden_readonly_layout_modes"/> 646 <property name="view_format">iso8601_medium_easy</property> 609 647 </widget> 610 648 <widget name="scd_sit_fname" meta_type="String Widget"> … … 726 764 </row> 727 765 <row> 766 <cell name="request_date"/> 767 </row> 768 <row> 769 <cell name="cleared_date"/> 770 </row> 771 <row> 728 772 <cell name="birthday"/> 729 773 </row> -
WAeUP_SRP/trunk/profiles/default/layouts/student_clearance_fe.xml
r985 r1016 70 70 </property> 71 71 <property name="hidden_readonly_layout_modes"/> 72 <property name="view_format">iso8601_medium_easy</property> 72 73 </widget> 73 74 <widget name="alr_fname" meta_type="String Widget"> … … 159 160 </property> 160 161 <property name="hidden_readonly_layout_modes"/> 162 <property name="view_format">iso8601_medium_easy</property> 161 163 </widget> 162 164 <widget name="cert" meta_type="Image Widget"> … … 238 240 </property> 239 241 <property name="hidden_readonly_layout_modes"/> 242 <property name="view_format">iso8601_medium_easy</property> 243 </widget> 244 <widget name="request_date" meta_type="Date Widget"> 245 <property name="title">Request Date</property> 246 <property name="fields"> 247 <element value="request_date"/> 248 </property> 249 <property name="label">Request Date</property> 250 <property name="label_edit">Request Date</property> 251 <property name="readonly_layout_modes"> 252 <element value="edit"/> 253 </property> 254 <property name="hidden_layout_modes"> 255 <element value="create"/> 256 </property> 257 <property name="hidden_readonly_layout_modes"/> 258 <property name="view_format">iso8601_medium_easy</property> 259 </widget> 260 <widget name="cleared_date" meta_type="Date Widget"> 261 <property name="title">Cleared Date</property> 262 <property name="fields"> 263 <element value="cleared_date"/> 264 </property> 265 <property name="label">Cleared Date</property> 266 <property name="label_edit">Cleared Date</property> 267 <property name="readonly_layout_modes"> 268 <element value="edit"/> 269 </property> 270 <property name="hidden_layout_modes"> 271 <element value="create"/> 272 </property> 273 <property name="hidden_readonly_layout_modes"/> 274 <property name="view_format">iso8601_medium_easy</property> 240 275 </widget> 241 276 <widget name="entry_session" meta_type="String Widget"> … … 296 331 </property> 297 332 <property name="hidden_readonly_layout_modes"/> 333 <property name="view_format">iso8601_medium_easy</property> 298 334 </widget> 299 335 <widget name="fst_sit_fname" meta_type="String Widget"> … … 509 545 <property name="label">Local Government Area</property> 510 546 <property name="label_edit">Local Government Area</property> 511 <property name="readonly_layout_modes"/> 547 <property name="readonly_layout_modes"> 548 </property> 512 549 <property name="hidden_layout_modes"> 513 550 <element value="create"/> … … 557 594 <property name="label">Nationality</property> 558 595 <property name="label_edit">Nationality</property> 559 <property name="readonly_layout_modes"/> 596 <property name="readonly_layout_modes"> 597 </property> 560 598 <property name="hidden_layout_modes"> 561 599 <element value="create"/> … … 610 648 </property> 611 649 <property name="hidden_readonly_layout_modes"/> 650 <property name="view_format">iso8601_medium_easy</property> 612 651 </widget> 613 652 <widget name="scd_sit_fname" meta_type="String Widget"> … … 729 768 </row> 730 769 <row> 770 <cell name="request_date"/> 771 </row> 772 <row> 773 <cell name="cleared_date"/> 774 </row> 775 <row> 731 776 <cell name="birthday"/> 732 777 </row> -
WAeUP_SRP/trunk/profiles/default/schemas/student_clearance.xml
r852 r1016 11 11 12 12 <field name="entry_date" meta_type="CPS DateTime Field"/> 13 <field name="request_date" meta_type="CPS DateTime Field"/> 14 <field name="cleared_date" meta_type="CPS DateTime Field"/> 13 15 <field name="entry_session" meta_type="CPS String Field"/> 14 16 -
WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
r1009 r1016 16 16 current = DateTime.DateTime() 17 17 import logging 18 logger = logging.getLogger(' student_login')18 logger = logging.getLogger('Student.Login') 19 19 20 20 … … 60 60 s_review_state = wftool.getInfoFor(student,'review_state',None) 61 61 a_review_state = wftool.getInfoFor(student_app,'review_state',None) 62 logger.info(' %s review_state %s' % (member,s_review_state))62 logger.info('"%s", "logged in", "review_state %s"' % (member,s_review_state)) 63 63 app_doc = student_app.getContent() 64 64 #from Products.zdb import set_trace -
WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
r892 r1016 15 15 import DateTime 16 16 current = DateTime.DateTime() 17 import logging 18 logger = logging.getLogger('Student.Application.Edit') 17 19 18 20 # Until ajax posts directly to its own script... … … 27 29 info = context.getStudentInfo() 28 30 31 if info is None: 32 logger.info('"anonymous access","%s"' % request.get('URL0')) 33 REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) 34 29 35 student = info['student'] 30 36 app = info['app'] … … 50 56 elif cpsdocument_edit_and_view_button: 51 57 if app_doc.passport is not None: 58 logger.info('"%s", "continue' % (info['id'])) 52 59 action = "/start_clearance" 53 60 base_url = student.absolute_url() -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py
r942 r1016 15 15 import DateTime 16 16 current = DateTime.DateTime() 17 import logging 18 logger = logging.getLogger('Student.Clearance') 17 19 18 20 cpsdocument_edit_button = REQUEST.has_key('cpsdocument_edit_button') … … 35 37 clear = info['clear'] 36 38 clear_doc = info['clear_doc'] 39 student_id = info['id'] 40 member_id = str(context.portal_membership.getAuthenticatedMember()) 37 41 38 42 is_valid, ds = clear_doc.validate(request=REQUEST, … … 51 55 action = "/clearance_edit_form" 52 56 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,}) 54 60 wftool.doActionFor(info['clear'],'close') 55 61 wftool.doActionFor(info['student'],'request_clearance',dest_container=1) … … 57 63 if context.isStudent(): 58 64 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" 59 70 else: 60 71 psm = "You must tick the acknowledgement check box before submission!" 61 72 if context.isStudent(): 62 73 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 )) 64 76 wftool.doActionFor(info['student'],'clear_and_validate') 77 info['clear_doc'].edit(mapping = {'cleared_date': current,}) 65 78 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!" 66 81 elif reject_clearance_button: 82 logger.info('"%s","rejected clearance for","%s"' % (member_id,student_id )) 67 83 wftool.doActionFor(info['clear'],'open') 68 84 wftool.doActionFor(info['student'],'reject_clearance') -
WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
r1007 r1016 34 34 try: 35 35 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): 40 37 student_id = member_id 41 38 break -
WAeUP_SRP/trunk/skins/waeup_student/start_clearance.py
r892 r1016 7 7 current = DateTime.DateTime() 8 8 pr = context.portal_registration 9 import logging 10 logger = logging.getLogger('Student.Clearance.Start') 9 11 10 12 type_name = 'Student' … … 18 20 pr = context.portal_registration 19 21 22 info = context.getStudentInfo() 23 app_doc = info['app_doc'] 24 review_state = info['review_state'] 25 20 26 res,psm,ds = lt.renderLayout(layout_id='student_clearance', 21 27 schema_id= 'student_clearance', … … 27 33 button = "Start", 28 34 ) 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 == '': 35 if psm == '': 50 36 return context.clearance_pin_form(rendered = res, 51 37 psm = None, … … 54 40 ds = ds, 55 41 ) 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) 42 error = False 43 if app_doc.passport is None: 44 psm = "You must upload your passport picture before you can start the registration process!" 45 error = True 46 elif review_state == "clearance_pin_entered": 47 psm = "You have already entered a clearance pin" 48 error = True 49 elif psm == 'invalid': 50 psm = "Please correct your input!", 51 error = True 52 if error: 53 return context.clearance_pin_form(rendered = res, 54 psm = psm, 55 firstlayout = True, 56 lastlayout = True, 57 ds = ds, 58 ) 59 pin = str(ds.get('clr_ac_pin')) 60 logger.info('"%s", "%s"' % (info['id'],pin)) 61 wf.doActionFor(info['student'],'enter_clearance_pin') 62 wf.doActionFor(info['clear'],'open') 63 dc = {} 64 app_doc = info['app_doc'] 65 dc['lga_ident'] = app_doc.get('jamb_lga') 66 dc['lga'] = app_doc.get('jamb_state','no state') + ' / ' + app_doc.get('jamb_lga','no lga') 67 dc['clr_ac_date'] = current 68 dc['entry_date'] = current 69 dc['entry_session'] = "2006/2007" 70 wf.doActionFor(info['app'],'close') 71 info['clear_doc'].edit(mapping = dc) 69 72 return redirect("%s/clearance_edit_form" % info['clear'].absolute_url())
Note: See TracChangeset for help on using the changeset viewer.