Ignore:
Timestamp:
19 Mar 2007, 21:59:41 (18 years ago)
Author:
joachim
Message:

merged changes 1588:1596 from trunk to joachim-event-branch

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  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=
     7##parameters=REQUEST=None, action_after_validate=None
    88##title=
    99##
     
    5757    return request.RESPONSE.redirect(url)
    5858
    59    
     59
    6060cr_id = context.invokeFactory('StudentCourseResult',course_id)
    6161#set_trace()
     
    6666args['course_id'] = course_id
    6767
    68 logger.info('%s added StudentCourseResult object %s' % (member,course_id))   
     68logger.info('%s added StudentCourseResult object %s' % (member,course_id))
    6969
    70 from urllib import urlencode
    71 url = "%s?%s" % (context.absolute_url(),urlencode(args))
    72 return request.RESPONSE.redirect(url)
     70args = {}
     71psm = "You successfully added course %s!" % course_id
     72args['portal_status_message'] = psm
     73url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     74return REQUEST.RESPONSE.redirect(url)
    7375
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt

    r1596 r1597  
    2828      <input type="hidden" name="probtype" type="text" id="probtype"
    2929             tal:attributes="value subject"/>     
     30      <input type="hidden" name="action" type="text" id="action"
     31             tal:attributes="value continue"/> 
    3032             
    3133      <table width="100%" border="0" cellspacing="5" cellpadding="0">
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py

    r1596 r1597  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=ids=[], REQUEST=None
     7##parameters=ids=[], REQUEST=None, action_after_reject=None, action_after_validate=None
    88##title=
    99##
     
    1515from Products.CMFCore.utils import getToolByName
    1616here = context
    17 
     17from urllib import urlencode
    1818import logging
    1919logger = logging.getLogger('Skins.delete_course_result')
     
    3232        context.manage_delObjects(real_ids)
    3333        logger.info('%s deleted StudentCourseResult object %s' % (member,id))
    34         message = 'portal_status_message=psm_item(s)_deleted'
     34        message = 'psm_item(s)_deleted'
    3535else:
    36     message = 'portal_status_message=psm_select_at_least_one_document'
    37 
     36    message = 'psm_select_at_least_one_document'
     37   
     38args = {}
     39args['portal_status_message'] = message
     40url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
    3841if 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  
    191191                     class="context" value="Add Course"
    192192                     />
     193              <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
     194                       tal:attributes="value string:external_study_level_view"/>                     
    193195            </td>               
    194196        </table>
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py

    r1596 r1597  
    55##bind script=script
    66##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
    88##title=
    99##
     
    2727#prop.email_from_address should be used for To:
    2828REQUEST = 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
    3638msg = message % (
    3739     co_name,
     
    4749mhost.send(msg)
    4850
    49 REQUEST = context.REQUEST
    50 RESPONSE = REQUEST.RESPONSE
    5151
    52 RESPONSE.redirect(redirect_url)
     52#REQUEST = context.REQUEST
     53#RESPONSE = REQUEST.RESPONSE
     54#RESPONSE.redirect(redirect_url)
     55
     56args = {}
     57psm = "Your message has been sent!"
     58args['portal_status_message'] = psm
     59url = context.absolute_url() + '/' + action + '?' + urlencode(args)
     60return 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
    28# $Id$
    39"""
     
    1925logger = logging.getLogger('Skins.refresh_level')
    2026
     27from urllib import urlencode
     28
    2129current = DateTime.DateTime()
    2230request = context.REQUEST
     
    3543if in_progress == 'finished':
    3644    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)
    3846    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
    3947    response.setHeader('Content-length','%d' % (len(view)))
     
    100108session.set('in_progress','finished')
    101109logger.info('%s updated course list' % member)
    102 return
    103 return response.redirect("%s" % level.absolute_url())
     110
     111args = {}
     112psm = "Course list updated!"
     113args['portal_status_message'] = psm
     114url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     115return REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py

    r1596 r1597  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=student=None
     7##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None
    88##title=
    99##
     
    1818    def set_trace():
    1919        pass
     20
     21from urllib import urlencode       
    2022
    2123request = context.REQUEST
     
    4042    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
    4143    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())
     44logger.info('%s registered course list of %s' % (member_id,student_id))
     45
     46args = {}
     47psm = "You successfully submitted your course list!"
     48args['portal_status_message'] = psm
     49url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     50return REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py

    r1596 r1597  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=REQUEST, student=None, action_after_reject=None, action_after_validate=None
     7##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None
    88##title=
    99##
     
    1212close the Students StudyLevel
    1313"""
     14from Products.CMFCore.WorkflowCore import WorkflowException
    1415try:
    1516    from Products.zdb import set_trace
     
    2930wftool.doActionFor(context,'close_for_edit')
    3031students_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()))
     32student_id = context.getStudentId()
     33student = getattr(students_folder,student_id)
     34try:
     35    wftool.doActionFor(student,'reject_courses')
     36except WorkflowException,E:
     37    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     38    return request.RESPONSE.redirect("%s" % context.absolute_url())
     39logger.info('%s rejected course list of %s' % (member_id,student_id))
    3440
    3541args = {}
     
    4248url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
    4349return 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  
    142142                <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
    143143                       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"/>                         
    144149
    145150            </td>
     
    198203                     class="context" value="Add Course"
    199204                     />
     205              <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
     206                       tal:attributes="value string:/study_level_view"/>                       
    200207            </td>               
    201208        </table>
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py

    r1596 r1597  
    1212close the Students StudyLevel
    1313"""
     14from Products.CMFCore.WorkflowCore import WorkflowException
    1415try:
    1516    from Products.zdb import set_trace
     
    2728wftool = context.portal_workflow
    2829students_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()))
     30student_id = context.getStudentId()
     31student = getattr(students_folder,student_id)
     32try:
     33    wftool.doActionFor(student,'validate_courses')
     34except WorkflowException,E:
     35    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     36    return request.RESPONSE.redirect("%s" % context.absolute_url())
     37logger.info('%s validated course list of %s' % (member_id,student_id))
    3238
    3339psm = 'portal_status_message=Course list validated!'
    3440url = context.absolute_url() + '/' + action_after_validate +  '?' + psm
    3541return request.RESPONSE.redirect(url)
    36 
    37 
Note: See TracChangeset for help on using the changeset viewer.