Ignore:
Timestamp:
10 Dec 2006, 18:39:15 (18 years ago)
Author:
joachim
Message:

Removed all fields except study_course from student_study_course
adde StudyCourse? Widget
M profiles/default/layouts/student_study_course.xml
M skins/waeup_default/waeup_edit.py
M Widgets.py
catch unauthorised errors
M skins/waeup_student/application_edit_form.pt
M skins/waeup_student/getStudentInfo.py
M skins/waeup_student/study_course_view.pt
AM skins/waeup_student/getStudentId.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py

    r859 r1025  
    2323# (We don't call getEditableContent here, validate does it when needed.)
    2424doc = context.getContent()
     25if context.portal_type == "StudentStudyCourse":
     26    if len(context.objectIds()) > 0:
     27        psm = 'Edit of StudyCourse is only possible if there are no levels'
     28        args = getFormUidUrlArg(REQUEST)
     29        args['portal_status_message'] = psm
     30        url = context.absolute_url() + '?' + urlencode(args)
     31        REQUEST.RESPONSE.redirect(url)
     32       
    2533is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
    2634                            use_session=True)
     
    3644    comments = REQUEST.get('comments')
    3745    context.cpsdocument_notify_modification(comments=comments)
     46    if context.portal_type == "StudentStudyCourse":
     47        course = ds.get('study_course')
     48        student_id = context.getStudentId()
     49        res = context.portal_catalog(portal_type='Certificate',id = course)
     50        if res:
     51            c_brain = res[0]
     52            c_path = c_brain.getPath().split('/')
     53            student_id = context.getStudentId()
     54            context.students_catalog.modifyRecord(id = student_id,
     55                                                  course = course,
     56                                                  faculty = c_path[-4],
     57                                                  department = c_path[-3],
     58                                                  )
    3859    if cpsdocument_edit_and_view_button is not None:
    3960        action = ''
Note: See TracChangeset for help on using the changeset viewer.