Changeset 1653 for WAeUP_SRP/branches/uli/skins/waeup_student
- Timestamp:
- 28 Mar 2007, 02:35:25 (18 years ago)
- Location:
- WAeUP_SRP/branches/uli/skins/waeup_student
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/branches/uli/skins/waeup_student/add_course_result.py
r1593 r1653 38 38 if d['title'] == 'unknown': 39 39 err = "No such course!" 40 logger.info('%s tried to add StudentCourseResult object %s for non-existing course' % (member,course_id))40 #logger.info('%s tried to add StudentCourseResult object %s for non-existing course' % (member,course_id)) 41 41 break 42 42 if context.hasObject(course_id): 43 43 err = "Course already exists!" 44 logger.info('%s tried to add StudentCourseResult object %s which is already in course list' % (member,course_id))44 #logger.info('%s tried to add StudentCourseResult object %s which is already in course list' % (member,course_id)) 45 45 break 46 46 if context.hasObject("%s_co" % course_id): 47 47 err = "Course already exists as carryover course!" 48 logger.info('%s tried to add StudentCourseResult object %s which already exists as carryover course' % (member,course_id))48 #logger.info('%s tried to add StudentCourseResult object %s which already exists as carryover course' % (member,course_id)) 49 49 break 50 50 break … … 54 54 #args['error'] = err 55 55 args['portal_status_message'] = err 56 url = "%s?%s" % (context.absolute_url(),urlencode(args))56 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 57 57 return request.RESPONSE.redirect(url) 58 58 … … 66 66 args['course_id'] = course_id 67 67 68 logger.info('%s added StudentCourseResult object %s ' % (member,course_id))68 logger.info('%s added StudentCourseResult object %s for %s' % (member,course_id,context.getStudentId())) 69 69 70 args = {}71 70 psm = "You successfully added course %s!" % course_id 72 71 args['portal_status_message'] = psm 73 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 72 if action_after_validate: 73 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 74 else: 75 url = context.absolute_url() + '?' + urlencode(args) 74 76 return REQUEST.RESPONSE.redirect(url) 75 77 -
WAeUP_SRP/branches/uli/skins/waeup_student/change_password.py
r1593 r1653 4 4 5 5 """ 6 7 return 8 9 10 11 12 13 14 15 6 16 request = context.REQUEST 7 17 import DateTime,logging -
WAeUP_SRP/branches/uli/skins/waeup_student/clearance_edit.py
r1593 r1653 120 120 wftool.doActionFor(info['clear'],'open') 121 121 wftool.doActionFor(info['student'],'reject_clearance') 122 action = "/ contact_student_form"122 action = "/external_contact_student_form" 123 123 psm = "Student's clearance request has been rejected! Please fill and submit the form below!" 124 124 subject = "Clearance request rejected" -
WAeUP_SRP/branches/uli/skins/waeup_student/contact_student_form.pt
r1593 r1653 28 28 <input type="hidden" name="probtype" type="text" id="probtype" 29 29 tal:attributes="value subject"/> 30 <input type="hidden" name="action" type="text" id="action" 31 tal:attributes="value continue"/> 30 32 31 33 <table width="100%" border="0" cellspacing="5" cellpadding="0"> -
WAeUP_SRP/branches/uli/skins/waeup_student/course_registration_slip.pt
r1593 r1653 19 19 20 20 <div tal:condition="validated"> 21 - validated by Course Adviser - 21 - validated by Course Adviser - 22 <span tal:condition="info/doc/validated_by|nothing" tal:omit-tag=""> 23 <span tal:replace="info/doc/validated_by" /> on <span tal:replace="info/doc/validation_date" /> 24 </span> 22 25 </div> 23 26 <div tal:condition="not: validated"> -
WAeUP_SRP/branches/uli/skins/waeup_student/create_level.py
r1593 r1653 31 31 current_level = student.level 32 32 in_progress = request.get('in_progress','not started') 33 level_created = request.get('level_created','xxx') 34 create_level = request.get('create_level',None) 33 35 34 if context.hasObject(current_level) :35 response.redirect("%s/%s" % (context.absolute_url(),current_level))36 if context.hasObject(current_level) and create_level : 37 logger.info('%s", level %s already exists' % (student.id,current_level)) 36 38 return 37 39 38 if in_progress in ('not started','started'):39 session.set('in_progress','started')40 view = context.in_progress_view(refresh=3,page='create_level?in_progress=started')41 response.setHeader('Content-type','text/html; charset=ISO-8859-15')42 response.setHeader('Content-length','%d' % (len(view)))43 response.setStatus('OK')44 response.write(view)45 response.write('')46 if in_progress == 'started':47 return40 ##if in_progress in ('not started','started'): 41 ## session.set('in_progress','started') 42 ## view = context.in_progress_view(refresh=20,page='create_level?in_progress=started') 43 ## response.setHeader('Content-type','text/html; charset=ISO-8859-15') 44 ## response.setHeader('Content-length','%d' % (len(view))) 45 ## response.setStatus('OK') 46 ## response.write(view) 47 ## response.write('') 48 ## if in_progress == 'started': 49 ## return 48 50 49 50 context.invokeFactory('StudentStudyLevel',"%s" % current_level) 51 level = getattr(context,"%s" % current_level) 52 context.portal_workflow.doActionFor(level,'open') 53 study_session = context.getSessionString() 54 level.getContent().edit(mapping={'session': study_session}) 55 context.portal_workflow.doActionFor(level,'close_for_edit') 51 if level_created == current_level: 52 level = getattr(context,"%s" % current_level) 53 else: 54 context.invokeFactory('StudentStudyLevel',"%s" % current_level) 55 level = getattr(context,"%s" % current_level) 56 context.portal_workflow.doActionFor(level,'open') 57 study_session = context.getSessionString() 58 level.getContent().edit(mapping={'session': study_session}) 59 context.portal_workflow.doActionFor(level,'close_for_edit') 60 response.redirect("%s?level_created=%s" % (context.absolute_url(),current_level)) 56 61 results = context.results_import(matric_no = student.matric_no) 57 62 if results: … … 90 95 context.portal_workflow.doActionFor(course_result,'open') 91 96 course_result.getContent().edit(mapping=d) 92 res = context.portal_catalog(portal_type="Certificate", id = cert_id) 93 l = [] 94 if res: 95 cert = res[0] 96 path = cert.getPath() 97 query = Eq("path",path) &\ 98 Eq('portal_type','CertificateCourse') &\ 99 Eq('SearchableText', "%s" % student.level) 100 courses = aq_portal(query) 101 for c in courses: 102 d = context.getCourseInfo(c.getId) 103 cr_id = level.invokeFactory('StudentCourseResult',c.getId) 104 course_result = getattr(level,cr_id) 105 context.portal_workflow.doActionFor(course_result,'open') 106 d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective') 107 course_result.getContent().edit(mapping=d) 108 return 97 level['create_course_results'](cert_id,current_level) 98 ##res = context.portal_catalog(portal_type="Certificate", id = cert_id) 99 ##l = [] 100 ##if res: 101 ## cert = res[0] 102 ## path = cert.getPath() 103 ## #set_trace() 104 ## query = Eq("path","%s/%s" % (path,current_level)) &\ 105 ## Eq('portal_type','CertificateCourse') 106 ## courses = aq_portal(query) 107 ## for c in courses: 108 ## d = context.getCourseInfo(c.getId) 109 ## cr_id = level.invokeFactory('StudentCourseResult',c.getId) 110 ## course_result = getattr(level,cr_id) 111 ## context.portal_workflow.doActionFor(course_result,'open') 112 ## d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective') 113 ## course_result.getContent().edit(mapping=d) 114 115 return response.redirect("%s/%s" % (context.absolute_url(),current_level)) 116 -
WAeUP_SRP/branches/uli/skins/waeup_student/delete_course_result.py
r1593 r1653 14 14 15 15 from Products.CMFCore.utils import getToolByName 16 from AccessControl import Unauthorized 17 16 18 here = context 17 19 from urllib import urlencode … … 30 32 real_ids.append(id) 31 33 if real_ids: 32 context.manage_delObjects(real_ids) 33 logger.info('%s deleted StudentCourseResult object %s' % (member,id)) 34 message = 'psm_item(s)_deleted' 34 try: 35 context.manage_delObjects(real_ids) 36 logger.info('%s deleted StudentCourseResult object %s for %s' % (member,id,context.getStudentId())) 37 message = 'psm_item(s)_deleted' 38 except Unauthorized: 39 logger.info('%s has no permission to delete StudentCourseResult objects for %s' % (member,context.getStudentId())) 40 message = 'no item(s) deleted' 35 41 else: 36 42 message = 'psm_select_at_least_one_document' 37 43 38 44 args = {} 39 45 args['portal_status_message'] = message 40 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 46 47 if action_after_validate: 48 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 49 else: 50 url = context.absolute_url() + '?' + urlencode(args) 41 51 if REQUEST is not None: 42 return REQUEST.RESPONSE.redirect(url) 52 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/uli/skins/waeup_student/getSessionResults.py
r1593 r1653 101 101 #set_trace() 102 102 verdict_voc = context.portal_vocabularies.verdicts 103 verdict_code = student_from_cat. get('verdict',None)103 verdict_code = student_from_cat.verdict 104 104 if verdict_code: 105 105 info['verdict'] = verdict = verdict_voc.get(verdict_code,'N/A').upper() -
WAeUP_SRP/branches/uli/skins/waeup_student/getStudyCourseInfo.py
r1593 r1653 25 25 info = {} 26 26 info['is_so'] = context.isSectionOfficer() 27 info['action'] = "%s" % context. campus.absolute_url()27 info['action'] = "%s" % context.absolute_url() 28 28 info['choosen_ids'] = request.get('ids',[]) 29 29 course = info['doc'] = context.getContent() … … 57 57 may_register = (student_review_state in ('school_fee_paid',)) and\ 58 58 current_level not in levels and\ 59 (sbrain.verdict in ('A','B' ) or sbrain.jamb_reg_no.startswith('6'))59 (sbrain.verdict in ('A','B','C') or sbrain.jamb_reg_no.startswith('6')) 60 60 61 61 levels.sort() -
WAeUP_SRP/branches/uli/skins/waeup_student/getStudyLevelInfo.py
r1593 r1653 40 40 return 0.0 41 41 42 def cmp_semester(a,b): 43 if a['semester'] == b['semester']: 42 def cmp_semester_id(a,b): 43 s1 = "%(semester)s%(id)s" % a 44 s2 = "%(semester)s%(id)s" % b 45 if s1 == s2: 44 46 return 0 45 if a['semester'] > b['semester']:47 if s1 > s2: 46 48 return 1 47 49 return -1 … … 104 106 normal.append(d) 105 107 info['credits_total'] = credits_total 106 carry_overs.sort(cmp_semester )108 carry_overs.sort(cmp_semester_id) 107 109 info['carry_overs'] = carry_overs 108 normal.sort(cmp_semester )110 normal.sort(cmp_semester_id) 109 111 info['normal'] = normal 110 112 -
WAeUP_SRP/branches/uli/skins/waeup_student/layout_personal_view.pt
r1201 r1653 9 9 <td><span class="dlabel">Student ID</span>: 10 10 </td> 11 <td tal:condition="nothing">11 <td> 12 12 <span tal:replace="context/getStudentId" /> 13 13 </td> -
WAeUP_SRP/branches/uli/skins/waeup_student/mail2student.py
r1593 r1653 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None 7 ##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None, action=None 8 8 ##title= 9 9 ## 10 10 # $Id: mail2admin.py 869 2006-11-15 13:46:49Z henrik $ 11 12 from urllib import urlencode 11 13 12 14 mhost = context.MailHost … … 27 29 #prop.email_from_address should be used for To: 28 30 REQUEST = context.REQUEST 29 url_tuple = REQUEST.HTTP_REFERER.split('?') 30 if len(url_tuple) == 2: 31 url_tuple[1] ='portal_status_message=Your message has been sent!' 32 else: 33 url_tuple.append('portal_status_message=Your message has been sent!') 34 redirect_url = "?".join(url_tuple) 35 REQUEST.set('rurl', redirect_url) # to see the result in the error log 31 32 #url_tuple = REQUEST.HTTP_REFERER.split('?') 33 #if len(url_tuple) == 2: 34 # url_tuple[1] ='portal_status_message=Your message has been sent!' 35 #else: 36 # url_tuple.append('portal_status_message=Your message has been sent!') 37 #redirect_url = "?".join(url_tuple) 38 #REQUEST.set('rurl', redirect_url) # to see the result in the error log 39 36 40 msg = message % ( 37 41 co_name, … … 39 43 student_email, 40 44 co_email, 41 ' henrik@waeup.org',45 'waeup@saoas.org', 42 46 # 'js@aixtraware.de', 43 47 co_email, … … 47 51 mhost.send(msg) 48 52 49 REQUEST = context.REQUEST50 RESPONSE = REQUEST.RESPONSE51 53 52 RESPONSE.redirect(redirect_url) 54 #REQUEST = context.REQUEST 55 #RESPONSE = REQUEST.RESPONSE 56 #RESPONSE.redirect(redirect_url) 57 58 args = {} 59 psm = "Your message has been sent!" 60 args['portal_status_message'] = psm 61 if action: 62 url = context.absolute_url() + '/' + action + '?' + urlencode(args) 63 else: 64 url = context.absolute_url() +'?' + urlencode(args) 65 return REQUEST.RESPONSE.redirect(url) 66 67 68 -
WAeUP_SRP/branches/uli/skins/waeup_student/refresh_level.py
r1593 r1653 112 112 psm = "Course list updated!" 113 113 args['portal_status_message'] = psm 114 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 114 if action_after_validate: 115 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 116 else: 117 url = context.absolute_url() + '?' + urlencode(args) 115 118 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/uli/skins/waeup_student/register_courses.py
r1593 r1653 19 19 pass 20 20 21 from urllib import urlencode 21 from urllib import urlencode 22 22 23 23 request = context.REQUEST … … 47 47 psm = "You successfully submitted your course list!" 48 48 args['portal_status_message'] = psm 49 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 49 if action_after_validate: 50 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 51 else: 52 url = context.absolute_url() + '?' + urlencode(args) 50 53 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/uli/skins/waeup_student/reject_courses.py
r1593 r1653 46 46 args['continue'] = action_after_validate 47 47 args['portal_status_message'] = psm 48 url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args) 48 if action_after_reject: 49 url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args) 50 else: 51 url = context.absolute_url() + '?' + urlencode(args) 49 52 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/uli/skins/waeup_student/statistics_new_view.pt
r1532 r1653 33 33 <th align="right">CR</th> 34 34 <th align="right">VC</th> 35 <th align="right">SFP </th>35 <th align="right">SFP+</th> 36 36 </tr> 37 37 <tr tal:repeat="d departments" … … 74 74 <tr><td>CR: </td> <td>Clearance requested</td></tr> 75 75 <tr><td>VC: </td> <td>Validated and cleared</td></tr> 76 <tr><td>SFP : </td> <td>School fee paid</td></tr>76 <tr><td>SFP+: </td> <td>School fee paid and further</td></tr> 77 77 </table> 78 78 </span> -
WAeUP_SRP/branches/uli/skins/waeup_student/statistics_ret_view.pt
r1593 r1653 34 34 <th >Faculty</th> 35 35 <th align="right">RET</th> 36 <th align="right">SFP </th>36 <th align="right">SFP+</th> 37 37 </tr> 38 38 <tr tal:define="d python:departments[0]" … … 60 60 <table> 61 61 <tr><td>RET:</td> <td>Returning students who have logged in</td></tr> 62 <tr><td>SFP:</td> <td>Returning students who alreadypaid their school fee</td></tr>62 <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr> 63 63 </table> 64 64 </span> -
WAeUP_SRP/branches/uli/skins/waeup_student/study_course_view.pt
r1518 r1653 66 66 tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')"> 67 67 <td align="left" valign="middle" style="width: 5px;" 68 tal:condition="python: 0 andis_so">68 tal:condition="python:is_so"> 69 69 <input type="checkbox" name="ids:list" value="" id="" class="noborder" 70 70 tal:condition="is_so" … … 84 84 summary="contents of the folder" 85 85 class="folderButtons"> 86 <tr >86 <tr tal:condition="python: is_so and info['items']"> 87 87 <td align="left" valign="top" rowspan="3"></td> 88 88 <td align="left" valign="top"> 89 <span tal:condition="python:0 and is_so"> 90 <input type="button" value="button_select_all" class="context" 89 <input type="button" value="button_select_all" class="context" 91 90 onclick="someJavaScriptFunctionThatWillBeReplaced" 92 91 i18n:attributes="value" … … 94 93 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))" 95 94 /> 96 <input type="submit" name="folder_delete:method" value="button_delete" 97 class="destructive" i18n:attributes="value" 98 tal:attributes="onclick python:'return window.confirm(\'%s\')' % 99 (cpsmcat('description_confirm_delete'), )" 100 /> 101 </span> 95 <input type="submit" name="folder_delete:method" value="button_delete" 96 class="destructive" i18n:attributes="value" 97 tal:attributes="onclick python:'return window.confirm(\'%s\')' % 98 (cpsmcat('description_confirm_delete'), )" 99 /> 102 100 </td> 103 101 </tr> -
WAeUP_SRP/branches/uli/skins/waeup_student/study_level_view.pt
r1593 r1653 64 64 <br /> 65 65 <div class="" tal:condition="not: info/normal"> 66 Your faculty has not yet provided the list of courses for your certificate. Please contact your faculty! 66 <font color="red">Your faculty has not yet provided the list of courses for your certificate. Please contact your faculty!</font> 67 <br /><br /> 67 68 </div> 68 69 <table class="contentListing" width="100%" id="folder_content" … … 109 110 class="context" value="Update" 110 111 /> 112 113 111 114 <br /><br /> 112 115 <input tal:condition="info/normal" 113 116 type="submit" name="register_courses:method" 114 117 class="context" value="Submit" /> 118 119 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 120 tal:attributes="value string:study_level_view"/> 121 122 <br /><br /> 123 124 <strong>Note:</strong> 'Update' checks for all courses in your certificate and will add them to your course list irrespective of 125 prior deletion, i.e. already deleted courses will show up again. 126 127 Please use this function only if you are sure that your faculty has added courses which are not yet on your course list. 128 115 129 </td> 116 130 </tr> … … 142 156 <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method" 143 157 class="context" value="Reject" /> 158 159 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 160 tal:attributes="value string:study_level_view"/> 161 <input type="hidden" name="action_after_reject" type="text" id="action_after_reject" 162 tal:attributes="value string:contact_student_form"/> 144 163 145 164 </td> … … 176 195 177 196 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 178 tal:attributes="value string: /study_level_view"/>197 tal:attributes="value string:study_level_view"/> 179 198 <input type="hidden" name="action_after_reject" type="text" id="action_after_reject" 180 tal:attributes="value string: /contact_student_form"/>199 tal:attributes="value string:contact_student_form"/> 181 200 182 201 … … 199 218 /> 200 219 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 201 tal:attributes="value string: /study_level_view"/>220 tal:attributes="value string:study_level_view"/> 202 221 </td> 203 222 </table> -
WAeUP_SRP/branches/uli/skins/waeup_student/validate_courses.py
r1593 r1653 13 13 """ 14 14 from Products.CMFCore.WorkflowCore import WorkflowException 15 import DateTime 16 current = DateTime.DateTime() 15 17 try: 16 18 from Products.zdb import set_trace … … 30 32 student_id = context.getStudentId() 31 33 student = getattr(students_folder,student_id) 34 level_doc = context.getContent() 35 if level_doc.portal_type == 'StudentStudyLevel': 36 level_doc.edit(mapping={'validated_by': member_id, 37 'validation_date': current,}) 32 38 try: 33 39 wftool.doActionFor(student,'validate_courses')
Note: See TracChangeset for help on using the changeset viewer.