Changeset 1494
- Timestamp:
- 26 Feb 2007, 09:16:06 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/create_level.py
r1492 r1494 12 12 def set_trace(): 13 13 pass 14 from Products.AdvancedQuery import Eq, Between, Le,In 15 aq_portal = context.portal_catalog.evalAdvancedQuery 14 16 15 17 current = DateTime.DateTime() … … 27 29 student = context.students_catalog(id=context.getStudentId())[0] 28 30 cert_id = student.course 31 current_level = student.level 29 32 in_progress = session.get('in_progress','finished') 30 33 if in_progress == 'finished': 31 34 session.set('in_progress','started') 32 view = context.in_progress_view(refresh=3,page=' study_level_view')35 view = context.in_progress_view(refresh=3,page='%s/study_level_view' % current_level) 33 36 response.setHeader('Content-type','text/html; charset=ISO-8859-15') 34 37 response.setHeader('Content-length','%d' % (len(view))) … … 40 43 context.invokeFactory('StudentStudyLevel',"%s" % current_level) 41 44 level = getattr(context,"%s" % current_level) 42 s ession = context.getSessionString()43 level.getContent().edit(mapping={'session': s ession})45 study_session = context.getSessionString() 46 level.getContent().edit(mapping={'session': study_session}) 44 47 context.portal_workflow.doActionFor(level,'open') 45 48 context.portal_workflow.doActionFor(level,'close_for_edit') … … 51 54 d['grade'] = co.GRADE 52 55 d['carry_level'] = co.CarryLevel 53 cr_id = context.invokeFactory('StudentCourseResult',"%s_co" % co.CosCode)54 getattr( context,cr_id).getContent().edit(mapping=d)56 cr_id = level.invokeFactory('StudentCourseResult',"%s_co" % co.CosCode) 57 getattr(level,cr_id).getContent().edit(mapping=d) 55 58 res = context.portal_catalog(portal_type="Certificate", id = cert_id) 56 59 l = [] … … 61 64 Eq('portal_type','CertificateCourse') &\ 62 65 Eq('SearchableText', "%s" % student.level) 63 courses = evalAdvancedQuery(query)66 courses = aq_portal(query) 64 67 for c in courses: 65 68 d = context.getCourseInfo(c.getId) 66 cr_id = context.invokeFactory('StudentCourseResult',c.getId)69 cr_id = level.invokeFactory('StudentCourseResult',c.getId) 67 70 d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective') 68 getattr( context,cr_id).getContent().edit(mapping=d)71 getattr(level,cr_id).getContent().edit(mapping=d) 69 72 session.set('in_progress','finished') 70 return "finished"73 return response.redirect("%s/study_level_view" % level.absolute_url()) -
WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py
r1493 r1494 12 12 return Info about the Students StudyCourse 13 13 """ 14 try: 15 from Products.zdb import set_trace 16 except: 17 def set_trace(): 18 pass 19 14 20 request = context.REQUEST 15 21 … … 49 55 wftool.doActionFor(context,'close_for_edit') 50 56 student_review_state = context.getStudentReviewState() 51 may_register = 0 #1 or student_review_state in ('shool_fee_payed',) 57 #may_register = 0 #1 or student_review_state in ('shool_fee_payed',) 58 may_register = (1 or student_review_state in ('shool_fee_payed',)) and\ 59 current_level not in levels 52 60 levels.sort() 53 61 info['create_level'] = None -
WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
r1482 r1494 12 12 return Info about the Studylevel 13 13 """ 14 try: 15 from Products.zdb import set_trace 16 except: 17 def set_trace(): 18 pass 14 19 from Products.AdvancedQuery import Eq, Between, Le,In 15 evalAdvancedQuery= context.portal_catalog.evalAdvancedQuery20 aq_portal = context.portal_catalog.evalAdvancedQuery 16 21 request = context.REQUEST 17 22 session = request.SESSION … … 66 71 if id.endswith('_co'): 67 72 d = context.getCourseInfo(id[:-3]) 73 d['id'] = id 68 74 d['grade'] = obj.getContent().grade 69 75 carry_overs.append(d) 70 76 else: 71 77 d = context.getCourseInfo(id) 78 d['id'] = id 72 79 coe = obj.getContent().core_or_elective 73 80 d['coe'] = 'Core' -
WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt
r1493 r1494 65 65 /> 66 66 </td> 67 <td><a href="view" tal:condition="python: 0"67 <td><a href="view" tal:condition="python: 1" 68 68 tal:attributes="href string:${row/url}"> 69 69 <strong tal:content="row/title" /></a> 70 <strong tal:condition="python: 1" tal:content="row/title" />70 <strong tal:condition="python: 0" tal:content="row/title" /> 71 71 </td> 72 72 </tr> … … 98 98 tal:attributes="action string:${context/absolute_url}/create_level" 99 99 tal:define="rows python: info['items'];" 100 tal:condition="create_level" 100 101 > 101 102 <table width="100%" cellspacing="0" cellpadding="2" … … 105 106 <td align="left" valign="top" rowspan="3"></td> 106 107 <td align="left" valign="top"> 107 <input type="submit" name="create_level" tal:condition="create_level"108 <input type="submit" name="create_level" 108 109 class="destructive" 109 tal:attributes="onclick python:'return window.confirm(\'Do you really want to register for Level %s \?')' % create_level;110 tal:attributes="onclick python:'return window.confirm(\'Do you really want to register for Level %s ?\')' % create_level; 110 111 value string: Register for Level ${create_level}" 111 112 /> -
WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt
r1482 r1494 46 46 <td align="left" valign="middle" style="width: 5px;"> 47 47 <input type="checkbox" name="ids:list" value="" id="" class="noborder" 48 tal:define="id row/ code"48 tal:define="id row/id" 49 49 tal:attributes="value id; 50 50 id python:'cb_' + id; … … 65 65 <td align="left" valign="middle" style="width: 5px;"> 66 66 <input type="checkbox" name="ids:list" value="" id="" class="noborder" 67 tal:define="id row/ code"67 tal:define="id row/id" 68 68 tal:attributes="value id; 69 69 id python:'cb_' + id;
Note: See TracChangeset for help on using the changeset viewer.