Changeset 785
- Timestamp:
- 6 Nov 2006, 14:22:15 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 6 added
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r780 r785 295 295 no_import.append(format % jamb) 296 296 continue 297 cert_id = jamb.get(csv_d['jamb_first_cos']).upper() 298 res = self.portal_catalog({'portal_type': "Certificate", 299 'id': cert_id }) 300 if len(res) < 1: 301 em = 'No Certificate with ID %s \n' % cert_id 302 logger.info(em) 303 no_import.append(em) 304 no_import.append(format % jamb) 305 continue 306 cert = res[0].getObject() 307 cert_path = res[0].getPath() 308 cert_doc = cert.getContent() 297 309 jamb_name = jamb.get(csv_d['jamb_lastname']) 298 310 jamb_name.replace('>','') … … 346 358 #wftool.doActionFor(pume,'close') 347 359 pume.manage_setLocalRoles(sid, ['Owner',]) 360 # 361 # Study Course 362 # 363 student.invokeFactory('StudentStudyCourse','study_course') 364 study_course = student.study_course 365 dsc = {} 366 from_certificate = ['title', 367 'max_elect', 368 'max_pass', 369 'n_core', 370 'nr_years', 371 'probation_credits', 372 'promotion_credits', 373 'start_level', 374 ] 375 for f in from_certificate: 376 dsc[f] = getattr(cert_doc,f) 377 cpl = cert_path.split('/') 378 dsc['faculty'] = cpl[-4] 379 dsc['department'] = cpl[-3] 380 dsc['study_course'] = cert_id 381 dsc['entry_session'] = jamb.get(csv_d['session']) 382 study_course.getContent().edit(mapping=dsc) 348 383 student.getContent().createSubObjects() 349 384 if dp['pume_tot_score']>49: 350 385 wftool.doActionFor(student,'pume_pass') 386 wftool.doActionFor(student,'admit') 351 387 else: 352 388 wftool.doActionFor(student,'pume_fail') 389 wftool.doActionFor(student,'finally_reject') 353 390 if len(no_import) > 1: 354 391 open("%s/import/%s_not_imported.csv" % (i_home,name),"w").write( -
WAeUP_SRP/trunk/profiles/default/actionicons.xml
r784 r785 241 241 title="Display PUME Result" priority="2" 242 242 icon_expr="zoom.png"/> 243 <action-icon category="student" action_id=" request_clearance"244 title=" Apply for PUME" priority="3"243 <action-icon category="student" action_id="check_admission" 244 title="Check if admitted" priority="3" 245 245 icon_expr="bell.png"/> 246 246 <action-icon category="student" action_id="reserve_accommodation" -
WAeUP_SRP/trunk/profiles/default/actions.xml
r781 r785 144 144 <permission>View</permission> 145 145 </action> 146 <action title=" Request Clearance" action_id="request_clearance"146 <action title="Check Admission" action_id="check_admission" 147 147 category="student" condition_expr="not:member" 148 url_expr="string:${portal_url}/ request_clearance"149 visible="True"> 150 <permission> False</permission>148 url_expr="string:${portal_url}/check_admission" 149 visible="True"> 150 <permission>View</permission> 151 151 </action> 152 152 <action title="Book Hostel" action_id="reserve_accommodation" -
WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml
r770 r785 35 35 <property name="reference">jamb_reg_no</property> 36 36 </widget> 37 <widget name="defer_date" meta_type="DateTime Widget"> 38 <property name="title">Defer Date</property> 39 <property name="fields"> 40 <element value="defer_date"/> 41 </property> 42 <property name="label">Defer Date</property> 43 <property name="label_edit">Defer Date</property> 44 <property name="readonly_layout_modes"> 45 <element value="edit"/> 46 </property> 47 <property name="hidden_layout_modes"> 48 <element value="create"/> 49 </property> 50 <property name="hidden_readonly_layout_modes"/> 51 <property name="view_format">iso8601_medium_easy</property> 52 </widget> 37 53 <widget name="entry_mode" meta_type="String Widget"> 38 54 <property name="title">Mode of Entry</property> -
WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml
r781 r785 39 39 <property name="reference">jamb_reg_no</property> 40 40 </widget> 41 <widget name="defer_date" meta_type="DateTime Widget"> 42 <property name="title">Defer Date</property> 43 <property name="fields"> 44 <element value="defer_date"/> 45 </property> 46 <property name="label">Defer Date</property> 47 <property name="label_edit">Defer Date</property> 48 <property name="readonly_layout_modes"> 49 <element value="edit"/> 50 </property> 51 <property name="hidden_layout_modes"> 52 <element value="create"/> 53 </property> 54 <property name="hidden_readonly_layout_modes"/> 55 <property name="view_format">iso8601_medium_easy</property> 56 </widget> 41 57 <widget name="entry_mode" meta_type="String Widget"> 42 58 <property name="title">Mode of Entry</property> -
WAeUP_SRP/trunk/profiles/default/schemas/student_application.xml
r770 r785 6 6 <field name="app_mobile" meta_type="CPS String Field"/> 7 7 <field name="entry_mode" meta_type="CPS String Field"/> 8 <field name="jamb_age" meta_type="CPS Int Field"/> 8 <field name="defer_date" meta_type="CPS DateTime Field"/> 9 <field name="jamb_age" meta_type="CPS Int Field"/> 9 10 <field name="jamb_first_cos" meta_type="CPS String Field"/> 10 11 <field name="jamb_first_uni" meta_type="CPS String Field"/> -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml
r781 r785 33 33 <permission-map name="View" acquired="True"> 34 34 <permission-role>Anonymous</permission-role> 35 <permission-role>Owner</permission-role> 35 36 </permission-map> 36 37 <permission-map name="WAeUPModify own content" -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
r776 r785 17 17 <exit-transition transition_id="defer"/> 18 18 <exit-transition transition_id="enter_clearance_pin"/> 19 <permission-map name="View" acquired="True"> 20 <permission-role>Owner</permission-role> 21 </permission-map> 19 22 </state> 20 23 <state state_id="application_pin_entered" title=""> … … 25 28 </permission-map> 26 29 <permission-map name="View" acquired="True"> 30 <permission-role>Owner</permission-role> 27 31 </permission-map> 28 32 </state> … … 35 39 <state state_id="cleared_and_validated" title=""> 36 40 <exit-transition transition_id="create_content"/> 41 <permission-map name="View" acquired="True"> 42 <permission-role>Owner</permission-role> 43 </permission-map> 37 44 </state> 38 45 <state state_id="clearance_requested" title=""> … … 45 52 <state state_id="deferred" title=""> 46 53 <exit-transition transition_id="enter_clearance_pin"/> 54 <permission-map name="View" acquired="True"> 55 <permission-role>Owner</permission-role> 56 </permission-map> 47 57 </state> 48 58 <state state_id="finally_rejected" title=""> 59 <permission-map name="View" acquired="True"> 60 <permission-role>Owner</permission-role> 61 </permission-map> 49 62 </state> 50 63 <state state_id="pume_failed" title=""> 51 64 <exit-transition transition_id="finally_reject"/> 65 <permission-map name="View" acquired="True"> 66 <permission-role>Owner</permission-role> 67 </permission-map> 52 68 </state> 53 69 <state state_id="pume_passed" title=""> 54 70 <exit-transition transition_id="admit"/> 55 71 <exit-transition transition_id="reject_admission"/> 72 <permission-map name="View" acquired="True"> 73 <permission-role>Owner</permission-role> 74 </permission-map> 56 75 </state> 57 76 <state state_id="student_created" title=""> … … 62 81 <exit-transition transition_id="pume_fail"/> 63 82 <exit-transition transition_id="pume_pass"/> 83 <permission-map name="View" acquired="True"> 84 <permission-role>Owner</permission-role> 85 </permission-map> 64 86 </state> 65 87 <transition transition_id="admit" title="" -
WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
r770 r785 60 60 da['app_ac_date'] = current 61 61 app_doc.edit(mapping = da) 62 dc = {}63 dc['clr_ac_pin'] = pin64 dc['entry_date'] = current65 dc['session'] = "%s" % current.year()66 dc['lga'] = app_doc.jamb_lga67 info['clear_doc'].edit(mapping = dc)62 ## dc = {} 63 ## dc['clr_ac_pin'] = pin 64 ## dc['entry_date'] = current 65 ## dc['session'] = "%s" % current.year() 66 ## dc['lga'] = app_doc.jamb_lga 67 ## info['clear_doc'].edit(mapping = dc) 68 68 elif "Manager" in member.getRoles(): 69 69 pass -
WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt
r774 r785 6 6 <tal:block condition="context/isStudent"> 7 7 <strong> 8 <span tal:condition="info/is_student " tal:content="python:info['student_doc'].Title()" />8 <span tal:condition="info/is_student|nothing" tal:content="python:info['student_doc'].Title()" /> 9 9 </strong> 10 10 </tal:block> -
WAeUP_SRP/trunk/skins/waeup_student/check_admission.py
r782 r785 12 12 ti = context.portal_types[type_name] 13 13 REQUEST.set('type_name',type_name) 14 14 redirect = REQUEST.RESPONSE.redirect 15 wf = context.portal_workflow 15 16 validate = REQUEST.has_key("cpsdocument_create_button") 16 17 … … 24 25 ob={}, 25 26 layout_mode='create', 26 formaction = " request_clearance",27 button = " Request Clearance",27 formaction = "check_admission", 28 button = "Check Admission", 28 29 ) 29 30 if psm == 'invalid': 30 return context.c learance_pin_form(rendered = res,31 return context.check_admission_pin_form(rendered = res, 31 32 psm = "Please correct your input.", 32 33 #psm = "%s, %s" % (psm,ds), … … 36 37 ) 37 38 elif psm == '': 38 return context.c learance_pin_form(rendered = res,39 return context.check_admission_pin_form(rendered = res, 39 40 psm = None, 40 41 firstlayout = True, … … 44 45 elif psm == 'valid': 45 46 s_id = ds.get('s_id') 47 student = getattr(context.campus.students, s_id) 48 review_state = wf.getInfoFor(student,'review_state',None) 49 if review_state == "finally_rejected": 50 url = "%s/campus/students/%s/pume/finally_rejected_view" % (context.portal_url(),s_id) 51 return redirect(url) 46 52 pin = str(ds.get('app_ac_pin')) 47 return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"53 return redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s" 48 54 % (context.absolute_url(),s_id,pin.split('-')[2],pin)) 49 55 return 50 51 -
WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
r770 r785 28 28 if context.isManager() and 'students' in path_info: 29 29 student_id = path_info[path_info.index('students')+1] 30 elif member_id == "Anonymous User": 31 return None 30 32 else: 31 33 student_id = member_id 32 34 else: 33 35 student_id = student.getId() 34 res = context.portal_catalog(id = student_id,portal_type='Student') 35 if not res:# or len(res) > 1: 36 student_path = "/srp/campus/students/%s" % student_id 37 student = context.restrictedTraverse(student_path,default=None) 38 if student is None or student.portal_type != 'Student': 36 39 return None 37 brain = res[-1] 38 student = brain.getObject() 39 student_path = brain.getPath() 40 ##res = context.portal_catalog(id = student_id,portal_type='Student') 41 ##if not res:# or len(res) > 1: 42 ## return None 43 ##brain = res[-1] 44 ##student = brain.getObject() 40 45 info['review_state'] = wf.getInfoFor(student,'review_state',None) 41 46 info['student'] = student … … 47 52 info['per'] = student.personal 48 53 info['per_doc'] = student.personal.getContent() 54 course = getattr(student,'study_course',None) 55 info['course'] = course 56 if course: 57 info['course_doc'] = student.study_course.getContent() 49 58 info['sex'] = 'male' 50 59 if info['per_doc'].sex: 51 60 info['sex'] = 'female' 52 res = context.portal_catalog(container_path=student_path, 53 portal_type='StudentAccommodation') 54 if res: 55 acco = res[0].getObject() 56 info['acco'] = acco 61 ##res = context.portal_catalog(container_path=student_path, 62 ## portal_type='StudentAccommodation') 63 ##if res: 64 ## acco = res[0].getObject() 65 acco = getattr(student,'accommodation',None) 66 if acco.portal_type != "StudentAccomodation": 67 acco = None 68 info['acco'] = acco 69 if acco is not None: 57 70 info['acco_doc'] = acco.getContent() 58 71 info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None) 59 else: 60 info['acco'] = None 61 res = context.portal_catalog(container_path=student_path, 62 portal_type='StudentClearance') 63 if res: 64 clear = res[0].getObject() 65 info['clear'] = clear 72 ##res = context.portal_catalog(container_path=student_path, 73 ## portal_type='StudentClearance') 74 ##if res: 75 ## clear = res[0].getObject() 76 ## info['clear'] = clear 77 clear = getattr(student,'clearance',None) 78 info['clear'] = clear 79 if clear is not None: 66 80 info['clear_doc'] = clear.getContent() 67 81 info['clear_review_state'] = wf.getInfoFor(clear,'review_state',None) 68 else:69 info['clear'] = None70 82 71 res = context.portal_catalog(container_path=student_path, 72 portal_type='StudentPume') 73 if res: 74 pume = res[0].getObject() 75 info['pume'] = clear 83 ##res = context.portal_catalog(container_path=student_path, 84 ## portal_type='StudentPume') 85 ##if res: 86 ## pume = res[0].getObject() 87 ## info['pume'] = clear 88 pume = getattr(student,'pume',None) 89 info['pume'] = pume 90 if pume is not None: 76 91 info['pume_doc'] = pume.getContent() 77 92 info['pume_review_state'] = wf.getInfoFor(pume,'review_state',None) -
WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt
r684 r785 11 11 12 12 13 <table class="registration" >13 <table class="registration" tal:condition="info|nothing"> 14 14 15 15 <span tal:condition="python:path('info/review_state')=='application_pin_entered'"> -
WAeUP_SRP/trunk/skins/waeup_student/student_index.py
r770 r785 32 32 if state == 'admission_applied': 33 33 return redirect("%s/application_view" % student.absolute_url()) 34 elif state in ('application_pin_entered', 'admitted'):34 elif state in ('application_pin_entered',): 35 35 return redirect("%s/application_edit" % student.absolute_url()) 36 elif state in ('admitted',): 37 return redirect("%s/defer_view" % student.absolute_url()) 36 38 elif state == 'clearance_pin_entered': 37 39 return redirect("%s/student_view" % info['clear'].absolute_url())
Note: See TracChangeset for help on using the changeset viewer.