Changeset 1025 for WAeUP_SRP/trunk/skins


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

Location:
WAeUP_SRP/trunk/skins
Files:
1 added
4 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 = ''
  • WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt

    r877 r1025  
    1 <metal:html tal:define="info context/getStudentInfo;
    2             rendered_main python:info['app_doc'].render(
     1<metal:html tal:define="info context/getStudentInfo">
     2  <span tal:condition="not: info">
     3    <metal:block use-macro="here/error_not_found/macros/not_found" />
     4  </span>
     5<metal:block tal:condition="info">
     6<metal:block tal:define="rendered_main python:info['app_doc'].render(
    37                      layout_mode='edit',
    48                      schema_id = 'student_application',
     
    5054    </metal:main>
    5155  </metal:body>
     56</metal:block>
     57</metal:block>
    5258</metal:html>
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r1017 r1025  
    4343            logger.info("student %s tried to access %s" % (member_id,requested_id))
    4444            student_id = member_id
    45             #mtool.assertViewable(context)
     45            mtool.assertViewable(context)
    4646            break
    4747        student_id = member_id
     
    7878        info['sex'] = 'female'
    7979course = getattr(student,'study_course',None)
    80 info['course'] = course
    8180if course:
    82     info['course_doc'] = student.study_course.getContent()
     81    cert_id = course.getContent().study_course
     82    res = context.portal_catalog(portal_type = "Certificate", id = cert_id)
     83    ci = {}
     84    if len(res) > 0:
     85        info['course'] = course
     86        brain = res[0]
     87        ci['study_course'] = brain.getId
     88        ci['title'] = brain.Title
     89        pl = brain.getPath().split('/')
     90        ci['faculty'] = pl[-4]
     91        ci['department'] = pl[-3]
     92        info['course_doc'] = ci
     93    else:
     94        info['course'] = None
    8395#
    8496acco = getattr(student,'accommodation_2006',None)
  • WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt

    r913 r1025  
    1919    </metal:block>
    2020    <metal:main fill-slot="main">
    21       <span tal:omit-tag=""  
     21      <span tal:omit-tag="" tal:condition="nothing"
    2222            tal:content="structure python: info['doc'].render(layout_mode='view')" />
     23      <table tal:define="sc python: s_info['course_doc']">
     24        <tr>
     25          <td width="180px">Certificate:</td>
     26          <td><span tal:content="sc/title" /></td>
     27        </tr>
     28        <tr>
     29          <td>Certificate ID:</td>
     30          <td tal:content="sc/study_course" />
     31        </tr>
     32          <span tal:define="f_id sc/faculty;
     33          d_id sc/department;
     34          f_title context/academics/?f_id/Title|string:Faculty not yet in Prospectus;
     35          d_title context/academics/?f_id/?d_id/Title|string:Department not yet in Prospectus"
     36          >
     37            <tr>
     38              <td>Faculty:</td>
     39              <td tal:content="f_title" />
     40            </tr>
     41            <tr>
     42              <td>Department:</td>
     43              <td><span tal:content="d_title" /></td>
     44            </tr>
     45          </span>
     46        </table>       
    2347     
    2448      <form action="" method="post" class="group"
Note: See TracChangeset for help on using the changeset viewer.