Changeset 1169
- Timestamp:
- 1 Jan 2007, 16:38:46 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTool.py
r1160 r1169 134 134 student_obj.invokeFactory('StudentApplication','application') 135 135 application = student_obj.application 136 self.portal_workflow.doActionFor(application,' close',dest_container=application)136 self.portal_workflow.doActionFor(application,'open',dest_container=application) 137 137 da = {'Title': 'Application Data'} 138 138 student_obj.invokeFactory('StudentPersonal','personal') … … 144 144 student_obj.invokeFactory('StudentClearance','clearance') 145 145 clearance = student_obj.clearance 146 self.portal_workflow.doActionFor(clearance,' close',dest_container=clearance)146 self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance) 147 147 dc = {'Title': 'Clearance/Eligibility Record'} 148 148 dc['matric_no'] = matric_no … … 162 162 dp['perm_address'] = student.Permanent_Address 163 163 application.getContent().edit(mapping=da) 164 self.portal_workflow.doActionFor(application,'close',dest_container=application) 164 165 personal.getContent().edit(mapping=dp) 165 166 clearance.getContent().edit(mapping=dc) 167 self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance) 166 168 catd = {} 167 169 catd['id'] = sid -
WAeUP_SRP/trunk/Widgets.py
r1155 r1169 317 317 """ JambRegNo Widget""" 318 318 meta_type = "JambRegNo Widget" 319 _properties = CPSStringWidget._properties + ( 320 {'id': 'catalog', 'type': 'string', 'mode': 'w', 321 'label': 'Catalog to search'}, 322 {'id': 'reference', 'type': 'string', 'mode': 'w', 323 'label': 'Reference Field'}, 324 ) 325 catalog = "portal_pumeresults" #the catalog to search for jamb_reg_no 326 reference = "" 319 327 digits = 8 320 328 digits_str = "N"*digits … … 323 331 def validate(self, datastructure, **kw): 324 332 """Validate datastructure and update datamodel.""" 325 326 333 valid = CPSStringWidget.validate(self, datastructure, **kw) 327 334 #import pdb;pdb.set_trace() 328 pumeresults = self.portal_pumeresults 329 if not valid: 330 return 0 331 else: 332 widget_id = self.getWidgetId() 333 value = datastructure[widget_id].upper() 334 err = 0 335 if not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()): 336 err = 'Invalid number, the expected format is: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str) 335 jamb_nr_catalog = getattr(self,self.catalog) 336 widget_id = self.getWidgetId() 337 value = datastructure[widget_id].upper() 338 err = 0 339 if not valid: #or not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()): 340 #err = 'Invalid number, the expected format is: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str) 341 err = 'Invalid number' 342 elif self.reference == '': 343 #s = getStudentByRegNo(self,value) 344 pume = jamb_nr_catalog(jamb_reg_no = value) 345 if len(pume) < 1: 346 err = 'No Student with JAMB RegNo %s.' % (value) 337 347 else: 338 #s = getStudentByRegNo(self,value) 339 pume = pumeresults(jamb_reg_no = value) 340 if len(pume) < 1: 341 err = 'No Student with JAMB RegNo %s.' % (value) 342 else: 343 datastructure['pume'] = pume[0] 344 if err: 345 datastructure.setError(widget_id, err) 346 else: 347 datamodel = datastructure.getDataModel() 348 datamodel[self.fields[0]] = value 349 return not err 348 datastructure['pume'] = pume[0] 349 else: 350 #import pdb;pdb.set_trace() 351 record = datastructure[self.reference] 352 #jamb_reg_no = getattr(record,widget_id) 353 jamb_reg_no = record.Entryregno 354 if jamb_reg_no != value: 355 err = 'Entry Registration Nr does not match.' 356 if err: 357 datastructure.setError(widget_id, err) 358 else: 359 datamodel = datastructure.getDataModel() 360 datamodel[self.fields[0]] = value 361 return not err 350 362 351 363 InitializeClass(JambRegNoWidget) … … 593 605 {'id': 'reference', 'type': 'string', 'mode': 'w', 594 606 'label': 'Reference Field'}, 595 596 607 ) 597 608 prefix = '' … … 626 637 ###) 627 638 628 def validate(self, datastructure, **kw): 639 def validate(self, datastructure, **kw): ###( 629 640 """Validate datastructure and update datamodel.""" 630 641 s_logger = logging.getLogger('Pin.Validate') … … 720 731 return not err 721 732 733 ###) 734 722 735 def render(self, mode, datastructure, **kw): ###( 723 736 """Render in mode from datastructure.""" … … 767 780 ###) 768 781 769 class WAeUPImageWidget(CPSImageWidget): 782 class WAeUPImageWidget(CPSImageWidget): ###( 770 783 """Photo widget.""" 771 784 meta_type = 'WAeUP Image Widget' … … 780 793 return meth(mode=mode, datastructure=datastructure, **img_info) 781 794 795 ###) 796 782 797 783 798 -
WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml
r1158 r1169 20 20 <property name="hidden_readonly_layout_modes"/> 21 21 </widget> 22 <widget name="jamb_reg_no" meta_type=" StringWidget">22 <widget name="jamb_reg_no" meta_type="JambRegNo Widget"> 23 23 <property name="title">JAMB Registration Number</property> 24 24 <property name="fields"> … … 29 29 <property name="readonly_layout_modes"/> 30 30 <property name="hidden_layout_modes"> 31 <element value=" create"/>31 <element value="edit"/> 32 32 </property> 33 33 <property name="hidden_readonly_layout_modes"/> 34 <property name="catalog">returning_import</property> 35 <property name="reference">student</property> 34 36 <property name="display_width">10</property> 35 37 <property name="size_max">10</property> -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
r1167 r1169 110 110 <exit-transition transition_id="notify_change_courses"/> 111 111 <exit-transition transition_id="validate_courses"/> 112 <permission-map name="View" acquired="True"> 113 <permission-role>Owner</permission-role> 114 <permission-role>SectionOfficer</permission-role> 115 </permission-map> 112 116 </state> 113 117 <state state_id="courses_validated" title=""> 118 <permission-map name="View" acquired="True"> 119 <permission-role>Owner</permission-role> 120 <permission-role>SectionOfficer</permission-role> 121 </permission-map> 114 122 </state> 115 123 <state state_id="deferred" title=""> … … 180 188 <exit-transition transition_id="create_content"/> 181 189 <exit-transition transition_id="enter_school_fee_pin"/> 190 <permission-map name="View" acquired="True"> 191 <permission-role>Owner</permission-role> 192 <permission-role>SectionOfficer</permission-role> 193 </permission-map> 182 194 </state> 183 195 <state state_id="school_fee_pin_entered" title=""> 184 196 <exit-transition transition_id="create_content"/> 185 197 <exit-transition transition_id="register_courses"/> 198 <permission-map name="View" acquired="True"> 199 <permission-role>Owner</permission-role> 200 <permission-role>SectionOfficer</permission-role> 201 </permission-map> 186 202 </state> 187 203 <state state_id="student_created" title=""> -
WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py
r1160 r1169 8 8 ##title= 9 9 ## 10 # $Id: create StudentFT.py 1151 2006-12-29 22:05:53Z joachim $11 ''' create the Studen base folder'''10 # $Id: createReturningStudent.py 1151 2006-12-29 22:05:53Z joachim $ 11 ''' create the Studentbase folder''' 12 12 13 13 … … 30 30 return "MatricNo %s not found in Returning Table" % matric_no 31 31 student_brain = res[0] 32 sid = context.waeup_tool.generateStudentId( student_brain.Firstname[0])32 sid = context.waeup_tool.generateStudentId('?') 33 33 students_folder.invokeFactory('Student', sid) 34 34 logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no)) 35 35 student = getattr(students_folder,sid) 36 wftool.doActionFor(student,' clear_and_validate')36 wftool.doActionFor(student,'return') 37 37 student.manage_setLocalRoles(sid, ['Owner',]) 38 jamb_reg_no = student_brain.Entryregno, 38 39 context.students_catalog.addRecord(id = sid, 39 40 matric_no = matric_no, 40 jamb_reg_no = student_brain.Entryregno,41 jamb_reg_no = jamb_reg_no, 41 42 sex = student_brain.Sex == "F", 42 43 name = "%s %s %s" % (student_brain.Firstname, … … 44 45 student_brain.Lastname) 45 46 ) 46 return "Student MatricNo %s and %s created" % (matric_no,sid)47 return "Student MatricNo %s, StudentId %s Jamb %s created" % (matric_no,sid,jamb_reg_no) 47 48 -
WAeUP_SRP/trunk/skins/waeup_student/entry_results_anon_view.pt
r1123 r1169 1 <metal:html tal:define="pume options/pume"> 1 <metal:html tal:define="pume options/pume; 2 result_type pume/result_type|string:PU"> 2 3 <metal:body use-macro="here/main_template/macros/master"> 3 4 <metal:main fill-slot="main"> 4 5 5 <span tal:condition="python: pume['result_type']!='DE'">6 <span tal:condition="python:result_type =='PU'"> 6 7 <div style="text-align: right"> 7 8 <a href="" target="slip" tal:attributes="href string:entry_results_anon_slip?nr=${pume/jamb_reg_no}" … … 14 15 </span> 15 16 16 <span tal:condition="python: pume['result_type']=='DE'">17 <span tal:condition="python:result_type == 'DE'"> 17 18 <div style="text-align: right"> 18 19 <a href="" target="slip" tal:attributes="href string:entry_results_anon_slip?nr=${pume/jamb_reg_no}" -
WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt
r1166 r1169 59 59 </table> 60 60 <br /> 61 <a href="" tal:attributes="href string:${context/absolute_url}/set_access_data?matric_no=${student/matric_no}"> 62 Continue to Login! 63 </a> 61 <form action="" method="post" 62 tal:attributes="action string:${context/portal_url}/set_access_data"> 63 <input type="hidden" name="matric_no" tal:attributes="value student/matric_no" /> 64 <input type="hidden" name="jamb_reg_no" tal:attributes="value student/Entryregno" /> 65 <input type="submit" 66 class="standalone" 67 value="Continue to Login!" 68 name="submit" /> 69 </form> 64 70 </metal:main> 65 71 </metal:body> -
WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py
r1158 r1169 42 42 elif psm == 'valid': 43 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 )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 54 ## from Products.zdb import set_trace;set_trace() 55 55 password = REQUEST.get('widget__password') … … 64 64 args['returning'] = '1' 65 65 args['email'] = email 66 args['phone_nr'] = ds.get('phone_nr') 66 67 from urllib import urlencode 67 68 url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
Note: See TracChangeset for help on using the changeset viewer.