Ignore:
Timestamp:
4 Apr 2007, 06:31:52 (18 years ago)
Author:
joachim
Message:

merged up to 1664

Location:
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getCertificateInfo.py

    r913 r1669  
    1212return Info about a Certificate
    1313"""
     14def cmp_id(a,b):
     15    s1 = "%(id)s" % a
     16    s2 = "%(id)s" % b
     17    if s1 == s2:
     18        return 0
     19    if s1 > s2:
     20        return 1
     21    return -1
     22
    1423request = context.REQUEST
    1524
     
    1827
    1928info = {}
    20 info['action'] = "%s" % context.campus.absolute_url()
     29info['action'] = "%s" % context.absolute_url()
    2130info['choosen_ids'] = request.get('ids',[])
    2231info['doc'] = context.getContent()
     
    3342    row['url'] = l.absolute_url()
    3443    items.append(row)
     44items.sort(cmp_id)
    3545info['items'] = items
    3646return info
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getLevelInfo.py

    r1514 r1669  
    1616wf = context.portal_workflow
    1717mtool = context.portal_membership
     18academics_path = "%s/campus/academics" % context.portal_url()
    1819path_info = request.get('PATH_INFO').split('/')
    1920try:
     
    4445    ro = r.getObject()
    4546    rd = ro.getContent()
    46     row['id'] = r.getId
     47    course_id = row['id'] = r.getId
    4748    row['title'] = rd.Title()
    4849    row['core'] = rd.core_or_elective
     
    5051    row['url'] = ro.absolute_url()
    5152    row['review_state'] = wf.getInfoFor(ro,'review_state','None')
    52     row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
     53    editable = row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
     54    if editable:
     55        course_res = context.courses_catalog(code=course_id)
     56        if course_res:
     57            rc = course_res[0]
     58            row['real_course_path'] = "%s/%s/%s/courses/%s" % (academics_path,rc.faculty,rc.department,course_id)
    5359    if rd.semester == 'first':
    5460        first.append(row)
  • WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/level_view.pt

    r1511 r1669  
    4848                    [edit]
    4949                    </a>
     50                <a tal:condition="row/real_course_path|nothing"
     51                   href="edit" tal:attributes="href string:${row/real_course_path}">
     52                    [goto course]
     53                    </a>
    5054                </td>
    5155              </tr>
Note: See TracChangeset for help on using the changeset viewer.