Ignore:
Timestamp:
21 Sep 2018, 09:32:42 (6 years ago)
Author:
Henrik Bettermann
Message:

Remove manageStudent permission.
Show tables on landing pages.
Adjust tests.

Location:
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/browser/templates/mytranscriptrequests.pt

    r15160 r15162  
    22  Transcripts to be validated
    33</h3>
    4 <div tal:repeat="student python:view.getStudents[0]">
    5   <a tal:attributes="href python:student.url + '/studycourse/transcript'">
    6     <span tal:content="student/display_fullname">FULLNAME</span>
    7   </a>
    8 </div>
     4
     5<table class="kofa-data-table dataTable" tal:condition="python:view.getStudents[0]">
     6  <thead>
     7  <tr>
     8    <th i18n:translate="">Matric No.</th>
     9    <th i18n:translate="">Student Id</th>
     10    <th i18n:translate="">Fullname</th>
     11    <th i18n:translate="">Faculty</th>
     12    <th i18n:translate="">Department</th>
     13    <th i18n:translate="">Course of Studies</th>
     14  </tr>
     15  </thead>
     16  <tbody>
     17  <tr tal:repeat="student python:view.getStudents[0]">
     18    <td tal:content="student/context/matric_number">MATRICNUMBER</td>
     19    <td>
     20      <a tal:attributes="href python:student.url + '/studycourse/transcript'">
     21      <span tal:content="student/student_id">STUDENTID</span>
     22      </a>
     23    </td>
     24    <td tal:content="student/context/display_fullname">FULLNAME</td>
     25    <td tal:content="student/context/faccode">FACCODE</td>
     26    <td tal:content="student/context/depcode">DEPCODE</td>
     27    <td tal:content="student/context/certcode">CERTCODE</td>
     28  </tr>
     29  </tbody>
     30</table>
     31
    932<h3 i18n:domain="waeup.kofa" i18n:translate="" tal:condition="python:view.getStudents[1]">
    1033  Transcripts to be signed and released
    1134</h3>
    12 <div tal:repeat="student python:view.getStudents[1]">
    13   <a tal:attributes="href python:student.url + '/studycourse/transcript'">
    14     <span tal:content="student/display_fullname">FULLNAME</span>
    15     (<span tal:content="student/student_id">ID</span> -
    16     <span tal:content="student/matric_number">MATRICNUMBER</span>)
    17   </a>,
    18   <span tal:content="student/context/faccode">FACCODE</span> /
    19   <span tal:content="student/context/depcode">DEPCODE</span> /
    20   <span tal:content="student/context/certcode">CERTCODE</span>
    21 </div>
    2235
     36<table class="kofa-data-table dataTable" tal:condition="python:view.getStudents[1]">
     37  <thead>
     38  <tr>
     39    <th i18n:translate="">Matric No.</th>
     40    <th i18n:translate="">Student Id</th>
     41    <th i18n:translate="">Fullname</th>
     42    <th i18n:translate="">Faculty</th>
     43    <th i18n:translate="">Department</th>
     44    <th i18n:translate="">Course of Studies</th>
     45  </tr>
     46  </thead>
     47  <tbody>
     48  <tr tal:repeat="student python:view.getStudents[1]">
     49    <td tal:content="student/context/matric_number">MATRICNUMBER</td>
     50    <td>
     51      <a tal:attributes="href python:student.url + '/studycourse/transcript'">
     52      <span tal:content="student/student_id">STUDENTID</span>
     53      </a>
     54    </td>
     55    <td tal:content="student/context/display_fullname">FULLNAME</td>
     56    <td tal:content="student/context/faccode">FACCODE</td>
     57    <td tal:content="student/context/depcode">DEPCODE</td>
     58    <td tal:content="student/context/certcode">CERTCODE</td>
     59  </tr>
     60  </tbody>
     61</table>
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/permissions.py

    r15155 r15162  
    158158class TranscriptOfficer(grok.Role):
    159159    """The Transcript Officer is allowed to view, to validate and to
    160     release student transcripts. The officer is also allowed to
     160    release student transcripts. The officer is not allowed to
    161161    manage student data.
    162162    """
     
    168168                     'waeup.viewStudent',
    169169                     'waeup.viewStudentsContainer',
    170                      'waeup.manageStudent',
    171170                     )
    172171
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/tests/test_browser.py

    r15159 r15162  
    21272127            'Comment line2\n\nDispatch Address:\nAddress line 1 \n'
    21282128            'Address line2\n\n')
    2129         # Create transcript officer
     2129        # Create officer with both roles
    21302130        self.app['users'].addUser('mrtranscript', 'mrtranscriptsecret')
    21312131        self.app['users']['mrtranscript'].email = 'mrtranscript@foo.ng'
     
    21332133        prmglobal = IPrincipalRoleManager(self.app)
    21342134        prmglobal.assignRoleToPrincipal('waeup.TranscriptOfficer', 'mrtranscript')
    2135         # Login as transcript officer
     2135        prmglobal.assignRoleToPrincipal('waeup.StudentsManager', 'mrtranscript')
     2136        prmglobal.assignRoleToPrincipal('waeup.TranscriptSignee', 'mrtranscript')
     2137        # Login
    21362138        self.browser.open(self.login_path)
    21372139        self.browser.getControl(name="form.login").value = 'mrtranscript'
     
    21862188        self.browser.open(self.studycourse_path + '/100/COURSE1/manage')
    21872189        self.assertTrue('The requested form is locked' in self.browser.contents)
     2190
    21882191        # Transcript can be signed if officer has the permission to sign
    2189         self.browser.open(self.studycourse_path + '/transcript')
    2190         self.assertFalse('Sign transcript' in self.browser.contents)
    2191         prmglobal = IPrincipalRoleManager(self.app)
    2192         prmglobal.assignRoleToPrincipal('waeup.TranscriptSignee', 'mrtranscript')
     2192        #self.browser.open(self.studycourse_path + '/transcript')
     2193        #self.assertFalse('Sign transcript' in self.browser.contents)
     2194        #prmglobal = IPrincipalRoleManager(self.app)
     2195        #prmglobal.assignRoleToPrincipal('waeup.TranscriptSignee', 'mrtranscript')
     2196
    21932197        self.browser.open(self.studycourse_path + '/transcript')
    21942198        self.browser.getLink("Sign transcript electronically").click()
     
    22492253        self.assertEqual(self.browser.headers['Content-Type'],
    22502254                         'application/pdf')
    2251         # Transcript views are no longer accesssible
     2255        # Transcript views are no longer accessible
    22522256        self.browser.open(self.studycourse_path)
    22532257        self.assertFalse('studycourse/transcript' in self.browser.contents)
     
    22892293            'http://localhost/app/students/K1000000/studycourse/transcript'
    22902294            in self.browser.contents)
    2291         self.browser.getLink("Anna Tester").click()
     2295        self.browser.getLink("K1000000").click()
    22922296        self.assertTrue(
    22932297            'Anna Tester: Transcript Data' in self.browser.contents)
     
    23292333            'http://localhost/app/students/K1000000/studycourse/transcript'
    23302334            in self.browser.contents)
    2331         self.browser.getLink("Anna Tester").click()
     2335        self.browser.getLink("K1000000").click()
    23322336        self.assertTrue(
    23332337            'Anna Tester: Transcript Data' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.