Changeset 598


Ignore:
Timestamp:
29 Sep 2006, 16:16:02 (18 years ago)
Author:
joachim
Message:

added is_editable for showing the edit link and the review_state

Location:
WAeUP_SRP/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r595 r598  
    802802        for obj in objects:
    803803            lr = pm.getMergedLocalRoles(obj)
     804            #lr = pm.getCPSCandidateLocalRoles(obj)
    804805            logger.info('exporting %s %s ' % (obj.id, lr))
    805806            export.append('"%s","%s"' % (obj.getId(),lr))
  • WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py

    r556 r598  
    2222campus = context.portal_catalog(meta_type = "University")[-1].getObject()
    2323member = pm.getAuthenticatedMember()
    24 roles = member.getRoles()
     24roles = member.getRolesInContext(context)
    2525isManager = "Manager" in roles or "SectionManager" in roles
    2626isStudent = "Student" in roles
     27isStaff = "Staff" in roles
    2728
    28 if isManager:
     29if isStaff or isManager:
    2930    if context.portal_type == 'AcademicsFolder':
    3031        return context.academics.academics_index_view()
  • WAeUP_SRP/trunk/skins/waeup_academics/courses_index_view.pt

    r571 r598  
    6565                    <strong tal:content="row/title" /></a> </td>
    6666                <td tal:content="row/id"> </td>
    67                 <td tal:content="row/review_state"> </td>
    68                 <td><a href="edit" tal:attributes="href string:${row/url}/cpsdocument_edit_form">[edit]</a></td>
     67                <td tal:condition="row/is_editable" tal:content="row/review_state"> </td>
     68                <td tal:condition="row/is_editable"><a href="edit" tal:attributes="href string:${row/url}/cpsdocument_edit_form">[edit]</a></td>
    6969              </tr>
    7070            </span>
  • WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_view.pt

    r597 r598  
    3939
    4040            <td>
     41<<<<<<< .mine
     42            <a tal:condition="row/is_editable"
     43=======
    4144            <a tal:condition="row/is_edit_allowed"
     45>>>>>>> .r597
    4246                href="edit" tal:attributes="href string:${row/url}/external_edit_form"
    4347                target="edit"
  • WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py

    r573 r598  
    4848    row['url'] = ro.absolute_url()
    4949    row['review_state'] = wf.getInfoFor(ro,'review_state','None')
     50    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
    5051    items.append(row)
    5152info['courses'] = items
  • WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py

    r597 r598  
    2121info = {}
    2222member_id = str(member)
    23 roles = member.getRoles()
     23roles = member.getRolesInContext(context)
    2424info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
    2525info['is_student'] = 'Student' in roles
     
    3939    row['title'] = rd.LongTitle()
    4040    row['url'] = ro.absolute_url()
    41     row['is_edit_allowed'] = mtool.checkPermission('Modify portal content', ro)
     41    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
    4242    items.append(row)
    4343info['items'] = items
  • WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py

    r573 r598  
    5555    row['url'] = ro.absolute_url()
    5656    row['review_state'] = wf.getInfoFor(ro,'review_state','None')
     57    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
    5758    if rd.semester == 'first':
    5859        first.append(row)
  • WAeUP_SRP/trunk/skins/waeup_academics/level_index_view.pt

    r573 r598  
    4040                <td tal:content="row/id"></td>
    4141                <td tal:content="python: test(row['core'],'core','elective')"></td>
    42                 <td tal:content="row/review_state"> </td>
    43                 <td><a href="edit" tal:attributes="href string:${row/url}/cpsdocument_edit_form">[edit]</a></td>
     42                <td tal:condition="row/is_editable" tal:content="row/review_state"> </td>
     43                <td tal:condition="row/is_editable" ><a href="edit" tal:attributes="href string:${row/url}/cpsdocument_edit_form">[edit]</a></td>
    4444              </tr>
    4545            </span>
Note: See TracChangeset for help on using the changeset viewer.