Changeset 15333


Ignore:
Timestamp:
17 Feb 2019, 10:51:02 (6 years ago)
Author:
Henrik Bettermann
Message:

Add transcript_remark field to study levels. Add page to allow
transcript officers editing the field during transcript processing.

Tests will follow!

Location:
main/waeup.kofa/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r15286 r15333  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* Add `transcript_remark` field to study levels. Add page to allow
     8  transcript officers editing the field during transcript processing.
    69
    710* Increase password strength. Officers are now required
     
    7780  faculty_code *and* department_code in create mode.
    7881
    79 * Add 'Update all tickets' button to StudyLevelEditFormPage.
     82* Add 'Update all tickets' button to `StudyLevelEditFormPage`.
    8083
    8184* Do not allow to create more than 10 students with a single request to
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r15312 r15333  
    12031203    pnav = 4
    12041204
     1205    @property
     1206    def remarks(self):
     1207        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     1208        levelremarks = ''
     1209        studylevelsource = StudyLevelSource().factory
     1210        for studylevel in self.context.values():
     1211            leveltitle = studylevelsource.getTitle(
     1212                self.context, studylevel.level)
     1213            url = self.url(self.context) + '/%s/remark' % studylevel.level
     1214            button_title = translate(
     1215                _('Edit'), 'waeup.kofa', target_language=portal_language)
     1216            levelremarks += (
     1217                '<tr>'
     1218                '<td>%s:</td>'
     1219                '<td>%s</td> '
     1220                '<td><a class="btn btn-primary btn-xs" href="%s">%s</a></td>'
     1221                '</tr>'
     1222                ) % (
     1223                leveltitle, studylevel.transcript_remark, url, button_title)
     1224        return levelremarks
     1225
    12051226    def update(self, SUBMIT=None):
    12061227        super(StudentTranscriptValidateFormPage, self).update()
     
    12521273    buttonname = _('Save comment and release transcript')
    12531274    pnav = 4
     1275
     1276    @property
     1277    def remarks(self):
     1278        levelremarks = ''
     1279        studylevelsource = StudyLevelSource().factory
     1280        for studylevel in self.context.values():
     1281            leveltitle = studylevelsource.getTitle(
     1282                self.context, studylevel.level)
     1283            levelremarks += "%s: %s <br><br>" % (
     1284                leveltitle, studylevel.transcript_remark)
     1285        return levelremarks
    12541286
    12551287    def update(self, SUBMIT=None):
     
    16511683                (', '.join(deleted), self.context.level))
    16521684        self.redirect(self.url(self.context, u'@@manage')+'#tab2')
     1685        return
     1686
     1687class StudyLevelRemarkFormPage(KofaEditFormPage):
     1688    """ Page to edit the student study level transcript remark only
     1689    """
     1690    grok.context(IStudentStudyLevel)
     1691    grok.name('remark')
     1692    grok.require('waeup.processTranscript')
     1693    grok.template('studylevelremarkpage')
     1694    form_fields = grok.AutoFields(IStudentStudyLevel).omit('level')
     1695    form_fields['level_session'].for_display = True
     1696    form_fields['level_verdict'].for_display = True
     1697    form_fields['validation_date'].for_display = True
     1698    form_fields['validated_by'].for_display = True
     1699
     1700    def update(self, ADD=None, course=None):
     1701        if self.context.student.studycourse_locked:
     1702            emit_lock_message(self)
     1703            return
     1704        super(StudyLevelRemarkFormPage, self).update()
     1705
     1706    @property
     1707    def label(self):
     1708        lang = self.request.cookies.get('kofa.language')
     1709        level_title = translate(self.context.level_title, 'waeup.kofa',
     1710            target_language=lang)
     1711        return _('Edit transcript remark of level ${a}', mapping = {'a':level_title})
     1712
     1713    @property
     1714    def translated_values(self):
     1715        return translated_values(self)
     1716
     1717    @action(_('Save remark and go and back to transcript validation page'),
     1718        style='primary')
     1719    def save(self, **data):
     1720        msave(self, **data)
     1721        self.redirect(
     1722            self.url(self.context.student, 'studycourse/validate_transcript')
     1723            +'#tab4')
    16531724        return
    16541725
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/transcriptprocess.pt

    r15174 r15333  
    1515      <a href="#tab3" data-toggle="tab">
    1616        <span i18n:translate="">View signatures</span>
     17      </a>
     18    </li>
     19    <li>
     20      <a href="#tab4" data-toggle="tab">
     21        <span i18n:translate="">View remarks</span>
    1722      </a>
    1823    </li>
     
    5055      <br /><p tal:content="structure view/signees"></p>
    5156    </div>
     57
     58    <div id="tab4" class="tab-pane">
     59      <br />
     60      <table class="table-condensed">
     61        <tbody>
     62          <span tal:omit-tag="" tal:content="structure view/remarks"></span>
     63        </tbody>
     64      </table>
     65    </div>
    5266  </div>
    5367
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r15246 r15333  
    614614        )
    615615
     616    transcript_remark = schema.TextLine(
     617        title = _(u'Transcript Remark'),
     618        required = False,
     619        readonly = False,
     620        )
     621
    616622    def addCourseTicket(ticket, course):
    617623        """Add a course ticket object.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/permissions.py

    r15173 r15333  
    159159    """The Transcript Officer is allowed to view, to validate and to
    160160    release student transcripts. The officer is not allowed to
    161     manage student data.
     161    manage student data but to edit the transcript remark on a separate
     162    manage page.
    162163    """
    163164    grok.name('waeup.TranscriptOfficer')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r15285 r15333  
    490490            result,
    491491            'gpa,level,level_session,level_verdict,total_credits,'
    492             'validated_by,validation_date,'
     492            'transcript_remark,validated_by,validation_date,'
    493493            'student_id,number_of_tickets,certcode\r\n'
    494             '0.00,,,0,0,,,,0,\r\n'
     494            '0.00,,,0,0,,,,,0,\r\n'
    495495            )
    496496        return
     
    508508            result,
    509509            'gpa,level,level_session,level_verdict,total_credits,'
    510             'validated_by,validation_date,'
     510            'transcript_remark,validated_by,validation_date,'
    511511            'student_id,number_of_tickets,certcode\r\n'
    512             '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
     512            '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
    513513            )
    514514        return
     
    524524            result,
    525525            'gpa,level,level_session,level_verdict,total_credits,'
    526             'validated_by,validation_date,'
     526            'transcript_remark,validated_by,validation_date,'
    527527            'student_id,number_of_tickets,certcode\r\n'
    528             '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
     528            '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
    529529            )
    530530        return
     
    539539            result,
    540540            'gpa,level,level_session,level_verdict,total_credits,'
    541             'validated_by,validation_date,'
     541            'transcript_remark,validated_by,validation_date,'
    542542            'student_id,number_of_tickets,certcode\r\n'
    543             '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
     543            '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
    544544            )
    545545        return
     
    558558            result,
    559559            'gpa,level,level_session,level_verdict,total_credits,'
    560             'validated_by,validation_date,'
     560            'transcript_remark,validated_by,validation_date,'
    561561            'student_id,number_of_tickets,certcode\r\n'
    562             '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
     562            '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
    563563            )
    564564        return
     
    577577            result,
    578578            'gpa,level,level_session,level_verdict,total_credits,'
    579             'validated_by,validation_date,'
     579            'transcript_remark,validated_by,validation_date,'
    580580            'student_id,number_of_tickets,certcode\r\n'
    581             '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
     581            '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
    582582            )
    583583        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r15332 r15333  
    295295        #sgpa = '%s: %.2f' % (trans('Sessional GPA (rectified)', lang), level['sgpa'])
    296296        data.append(Paragraph(sgpa, style["Normal"]))
    297         if getattr(level_obj, 'remark', None):
     297        if getattr(level_obj, 'transcript_remark', None):
    298298            remark = '%s: %s' % (
    299                 trans('Remark', lang), getattr(level_obj, 'remark'))
     299                trans('Transcript Remark', lang),
     300                getattr(level_obj, 'transcript_remark'))
    300301            data.append(Paragraph(remark, style["Normal"]))
    301302    return data
Note: See TracChangeset for help on using the changeset viewer.