Ignore:
Timestamp:
18 Jul 2007, 07:51:47 (18 years ago)
Author:
Henrik Bettermann
Message:

enable registering courses for session 05

only drawback: level object for session 05 is not closed after submission (register_courses)

please check

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/course_registration_slip.pt

    r1897 r2031  
    1717          view_only info/view_only"
    1818          >
    19       <h3>Course Registration Slip</h3>
     19      <h3>Course Registration Slip for <span tal:content="here/title_or_id" /></h3>
    2020      <br />
    2121      <div tal:condition="validated">
  • WAeUP_SRP/trunk/skins/waeup_student/create_level.py

    r1986 r2031  
    3333cert_id = student.course
    3434current_level = student.level
     35current_session = student.session
    3536in_progress =  request.get('in_progress','not started')
    3637#level_created =  request.get('level_created','xxx')
     
    6061    level = getattr(context,"%s" % current_level)
    6162    context.portal_workflow.doActionFor(level,'open')
    62     study_session = context.getSessionString()
    63     level.getContent().edit(mapping={'session': study_session})
     63    #study_session = context.getSessionString()
     64    level.getContent().edit(mapping={'session': current_session})
    6465    context.portal_workflow.doActionFor(level,'close_for_edit')
    6566    context.waeup_tool.doCommit()
     
    133134        context.waeup_tool.doCommit()
    134135logger.info('%s finished to create level %s' % (student.id,current_level))
     136
     137if current_session == '05':
     138    next_session = '06'
     139    next_level = "%s" % (int(current_level) + 100)
     140    study_course = getattr(student,'study_course')
     141    context.portal_workflow.doActionFor(study_course,'open')
     142    study_course_doc = study_course.getContent()
     143    study_course_doc.edit(mapping= {'current_level': next_level,
     144                                    'current_session': next_session,})
     145    context.portal_workflow.doActionFor(study_course,'close_for_edit')
     146
    135147return response.redirect("%s/%s" % (context.absolute_url(),current_level))
    136148
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r2011 r2031  
    123123info['credits_total'] = credits_total
    124124info['credits_exceeded'] = credits_total > 51
     125session_of_level = context.getContent().session
     126info['submission_allowed']= not info['credits_exceeded'] and session_of_level == context.getSessionId()[-2:]
    125127carry_overs.sort(cmp_semester_id)
    126128info['carry_overs'] = carry_overs
  • WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt

    r1897 r2031  
    129129                     
    130130              <br /><br />
    131               <input tal:condition="not: info/credits_exceeded"
     131              <input tal:condition="info/submission_allowed"
    132132                     type="submit" name="register_courses:method"
    133                      class="context" value="Submit" />
     133                     class="context" value="Submit to Course Adviser"
     134                     tal:attributes="onclick python:'return window.confirm(\'%s\')' %
     135                     ('Do you really want to submit the course list?', )" />
    134136              <span tal:condition="info/credits_exceeded">
    135137                  <font color="red"> <strong>Your total credits exceed 50!</strong></font>
Note: See TracChangeset for help on using the changeset viewer.