Changeset 1597 for WAeUP_SRP/branches/joachim-event-branch/skins
- Timestamp:
- 19 Mar 2007, 21:59:41 (18 years ago)
- Location:
- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py
r1596 r1597 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters= 7 ##parameters=REQUEST=None, action_after_validate=None 8 8 ##title= 9 9 ## … … 57 57 return request.RESPONSE.redirect(url) 58 58 59 59 60 60 cr_id = context.invokeFactory('StudentCourseResult',course_id) 61 61 #set_trace() … … 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' % (member,course_id)) 69 69 70 from urllib import urlencode 71 url = "%s?%s" % (context.absolute_url(),urlencode(args)) 72 return request.RESPONSE.redirect(url) 70 args = {} 71 psm = "You successfully added course %s!" % course_id 72 args['portal_status_message'] = psm 73 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 74 return REQUEST.RESPONSE.redirect(url) 73 75 -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt
r1596 r1597 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/joachim-event-branch/skins/waeup_student/delete_course_result.py
r1596 r1597 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=ids=[], REQUEST=None 7 ##parameters=ids=[], REQUEST=None, action_after_reject=None, action_after_validate=None 8 8 ##title= 9 9 ## … … 15 15 from Products.CMFCore.utils import getToolByName 16 16 here = context 17 17 from urllib import urlencode 18 18 import logging 19 19 logger = logging.getLogger('Skins.delete_course_result') … … 32 32 context.manage_delObjects(real_ids) 33 33 logger.info('%s deleted StudentCourseResult object %s' % (member,id)) 34 message = 'p ortal_status_message=psm_item(s)_deleted'34 message = 'psm_item(s)_deleted' 35 35 else: 36 message = 'portal_status_message=psm_select_at_least_one_document' 37 36 message = 'psm_select_at_least_one_document' 37 38 args = {} 39 args['portal_status_message'] = message 40 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 38 41 if REQUEST is not None: 39 return REQUEST.RESPONSE.redirect( ret_url + '?' + message)42 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt
r1596 r1597 191 191 class="context" value="Add Course" 192 192 /> 193 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 194 tal:attributes="value string:external_study_level_view"/> 193 195 </td> 194 196 </table> -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py
r1596 r1597 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 ## … … 27 27 #prop.email_from_address should be used for To: 28 28 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 29 30 #url_tuple = REQUEST.HTTP_REFERER.split('?') 31 #if len(url_tuple) == 2: 32 # url_tuple[1] ='portal_status_message=Your message has been sent!' 33 #else: 34 # url_tuple.append('portal_status_message=Your message has been sent!') 35 #redirect_url = "?".join(url_tuple) 36 #REQUEST.set('rurl', redirect_url) # to see the result in the error log 37 36 38 msg = message % ( 37 39 co_name, … … 47 49 mhost.send(msg) 48 50 49 REQUEST = context.REQUEST50 RESPONSE = REQUEST.RESPONSE51 51 52 RESPONSE.redirect(redirect_url) 52 #REQUEST = context.REQUEST 53 #RESPONSE = REQUEST.RESPONSE 54 #RESPONSE.redirect(redirect_url) 55 56 args = {} 57 psm = "Your message has been sent!" 58 args['portal_status_message'] = psm 59 url = context.absolute_url() + '/' + action + '?' + urlencode(args) 60 return REQUEST.RESPONSE.redirect(url) 61 62 63 64 -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py
r1596 r1597 1 ##parameters= 1 ## Script (Python) "refresh_level" 2 ##bind container=container 3 ##bind context=context 4 ##bind namespace= 5 ##bind script=script 6 ##bind subpath=traverse_subpath 7 ##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None 2 8 # $Id$ 3 9 """ … … 19 25 logger = logging.getLogger('Skins.refresh_level') 20 26 27 from urllib import urlencode 28 21 29 current = DateTime.DateTime() 22 30 request = context.REQUEST … … 35 43 if in_progress == 'finished': 36 44 session.set('in_progress','started') 37 view = context.in_progress_view(refresh=3,page= 'study_level_view')45 view = context.in_progress_view(refresh=3,page=action_after_validate) 38 46 response.setHeader('Content-type','text/html; charset=ISO-8859-15') 39 47 response.setHeader('Content-length','%d' % (len(view))) … … 100 108 session.set('in_progress','finished') 101 109 logger.info('%s updated course list' % member) 102 return 103 return response.redirect("%s" % level.absolute_url()) 110 111 args = {} 112 psm = "Course list updated!" 113 args['portal_status_message'] = psm 114 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 115 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py
r1596 r1597 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters= student=None7 ##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None 8 8 ##title= 9 9 ## … … 18 18 def set_trace(): 19 19 pass 20 21 from urllib import urlencode 20 22 21 23 request = context.REQUEST … … 40 42 logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id)) 41 43 return request.RESPONSE.redirect("%s" % context.absolute_url()) 42 logger.info('%s registered course list for %s' % (member_id,student_id)) 43 return request.RESPONSE.redirect("%s" % context.absolute_url()) 44 logger.info('%s registered course list of %s' % (member_id,student_id)) 45 46 args = {} 47 psm = "You successfully submitted your course list!" 48 args['portal_status_message'] = psm 49 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args) 50 return REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py
r1596 r1597 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=REQUEST , student=None, action_after_reject=None, action_after_validate=None7 ##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None 8 8 ##title= 9 9 ## … … 12 12 close the Students StudyLevel 13 13 """ 14 from Products.CMFCore.WorkflowCore import WorkflowException 14 15 try: 15 16 from Products.zdb import set_trace … … 29 30 wftool.doActionFor(context,'close_for_edit') 30 31 students_folder = context.portal_url.getPortalObject().campus.students 31 student = getattr(students_folder,context.getStudentId()) 32 wftool.doActionFor(student,'reject_courses') 33 logger.info('%s rejected course list of %s' % (member,student.getId())) 32 student_id = context.getStudentId() 33 student = getattr(students_folder,student_id) 34 try: 35 wftool.doActionFor(student,'reject_courses') 36 except WorkflowException,E: 37 logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id)) 38 return request.RESPONSE.redirect("%s" % context.absolute_url()) 39 logger.info('%s rejected course list of %s' % (member_id,student_id)) 34 40 35 41 args = {} … … 42 48 url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args) 43 49 return REQUEST.RESPONSE.redirect(url) 44 45 #return request.RESPONSE.redirect("%s" % context.absolute_url()) -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt
r1596 r1597 142 142 <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method" 143 143 class="context" value="Reject" /> 144 145 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 146 tal:attributes="value string:/study_level_view"/> 147 <input type="hidden" name="action_after_reject" type="text" id="action_after_reject" 148 tal:attributes="value string:/contact_student_form"/> 144 149 145 150 </td> … … 198 203 class="context" value="Add Course" 199 204 /> 205 <input type="hidden" name="action_after_validate" type="text" id="action_after_validate" 206 tal:attributes="value string:/study_level_view"/> 200 207 </td> 201 208 </table> -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py
r1596 r1597 12 12 close the Students StudyLevel 13 13 """ 14 from Products.CMFCore.WorkflowCore import WorkflowException 14 15 try: 15 16 from Products.zdb import set_trace … … 27 28 wftool = context.portal_workflow 28 29 students_folder = context.portal_url.getPortalObject().campus.students 29 student = getattr(students_folder,context.getStudentId()) 30 wftool.doActionFor(student,'validate_courses') 31 logger.info('%s validated course list of %s' % (member,student.getId())) 30 student_id = context.getStudentId() 31 student = getattr(students_folder,student_id) 32 try: 33 wftool.doActionFor(student,'validate_courses') 34 except WorkflowException,E: 35 logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id)) 36 return request.RESPONSE.redirect("%s" % context.absolute_url()) 37 logger.info('%s validated course list of %s' % (member_id,student_id)) 32 38 33 39 psm = 'portal_status_message=Course list validated!' 34 40 url = context.absolute_url() + '/' + action_after_validate + '?' + psm 35 41 return request.RESPONSE.redirect(url) 36 37
Note: See TracChangeset for help on using the changeset viewer.