Ignore:
Timestamp:
31 Oct 2012, 16:30:02 (12 years ago)
Author:
Henrik Bettermann
Message:

Rename clearance_comment to officer_comment. That's more appropriate since the comment can also be used by other officers.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9484 r9486  
    587587            form_fields = grok.AutoFields(
    588588                IUGStudentClearance).omit('clearance_locked')
    589         if not getattr(self.context, 'clearance_comment'):
    590             form_fields = form_fields.omit('clearance_comment')
    591         else:
    592             form_fields['clearance_comment'].custom_widget = BytesDisplayWidget
     589        if not getattr(self.context, 'officer_comment'):
     590            form_fields = form_fields.omit('officer_comment')
     591        else:
     592            form_fields['officer_comment'].custom_widget = BytesDisplayWidget
    593593        return form_fields
    594594
     
    615615            form_fields = grok.AutoFields(
    616616                IUGStudentClearance).omit('clearance_locked')
    617         if not getattr(self.context, 'clearance_comment'):
    618             form_fields = form_fields.omit('clearance_comment')
     617        if not getattr(self.context, 'officer_comment'):
     618            form_fields = form_fields.omit('officer_comment')
    619619        return form_fields
    620620
     
    709709    grok.require('waeup.clearStudent')
    710710    form_fields = grok.AutoFields(
    711         IUGStudentClearance).select('clearance_comment')
     711        IUGStudentClearance).select('officer_comment')
    712712
    713713    @action(_('Save comment and reject clearance now'), style='primary')
     
    726726            return
    727727        self.applyData(self.context, **data)
    728         comment = data['clearance_comment']
     728        comment = data['officer_comment']
    729729        self.context.writeLogMessage(
    730730            self, 'comment: %s' % comment.replace('\n', '<br>'))
     
    19531953        if self.context.is_postgrad:
    19541954            form_fields = grok.AutoFields(IPGStudentClearance).omit(
    1955                 'clearance_locked', 'clr_code', 'clearance_comment')
     1955                'clearance_locked', 'clr_code', 'officer_comment')
    19561956        else:
    19571957            form_fields = grok.AutoFields(IUGStudentClearance).omit(
    1958                 'clearance_locked', 'clr_code', 'clearance_comment')
     1958                'clearance_locked', 'clr_code', 'officer_comment')
    19591959        return form_fields
    19601960
  • main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py

    r9485 r9486  
    7171        self.current_session = current_session
    7272        self.certificate = context['studycourse'].certificate
    73         self.comment = getattr(context, 'clearance_comment', None)
     73        self.comment = getattr(context, 'officer_comment', None)
    7474
    7575def search(query=None, searchtype=None, view=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9484 r9486  
    274274        )
    275275
    276     clearance_comment = schema.Text(
     276    officer_comment = schema.Text(
    277277        title = _(u"Officer's Comment"),
    278278        required = False,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9485 r9486  
    12121212            self.browser.url, self.student_path + '/reject_clearance')
    12131213        # Type comment why
    1214         self.browser.getControl(name="form.clearance_comment").value = """Dear Student,
     1214        self.browser.getControl(name="form.officer_comment").value = """Dear Student,
    12151215You did not fill properly.
    12161216"""
     
    12311231        self.assertTrue('Your message has been sent' in self.browser.contents)
    12321232        # The comment has been stored ...
    1233         self.assertEqual(self.student.clearance_comment,
     1233        self.assertEqual(self.student.officer_comment,
    12341234            u'Dear Student,\nYou did not fill properly.\n')
    12351235        # ... and logged
     
    12671267        IWorkflowInfo(self.student).fireTransition('request_clearance')
    12681268        IWorkflowInfo(self.student).fireTransition('clear')
    1269         self.assertEqual(self.student.clearance_comment, None)
     1269        self.assertEqual(self.student.officer_comment, None)
    12701270
    12711271    def test_handle_courses_by_ca(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r9484 r9486  
    4343        result = open(self.outfile, 'rb').read()
    4444        self.assertTrue(
    45             'adm_code,clearance_comment,clearance_locked,clr_code,'
    46             'date_of_birth,email,employer,'
    47             'firstname,lastname,matric_number,middlename,nationality,'
     45            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
     46            'firstname,lastname,matric_number,middlename,nationality,officer_comment,'
    4847            'perm_address,phone,reg_number,sex,student_id,suspended,password,'
    4948            'state,history,certcode,is_postgrad,current_level,current_session\r\n'
    5049
    51             'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,'
    52             'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",'
     50            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
     51            'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",'
    5352            '+234-123-12345#,123,f,A111111,0,,created'
    5453            in result
     
    6463        result = open(self.outfile, 'rb').read()
    6564        self.assertTrue(
    66             'adm_code,clearance_comment,clearance_locked,clr_code,'
    67             'date_of_birth,email,employer,'
    68             'firstname,lastname,matric_number,middlename,nationality,'
     65            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
     66            'firstname,lastname,matric_number,middlename,nationality,officer_comment,'
    6967            'perm_address,phone,reg_number,sex,student_id,suspended,password,'
    7068            'state,history,certcode,is_postgrad,current_level,current_session\r\n'
    7169
    72             'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,'
    73             'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",'
     70            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
     71            'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",'
    7472            '+234-123-12345#,123,f,A111111,0,,created'
    7573            in result
     
    8482        result = open(self.outfile, 'rb').read()
    8583        self.assertTrue(
    86             'adm_code,clearance_comment,clearance_locked,clr_code,'
    87             'date_of_birth,email,employer,'
    88             'firstname,lastname,matric_number,middlename,nationality,'
     84            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
     85            'firstname,lastname,matric_number,middlename,nationality,officer_comment,'
    8986            'perm_address,phone,reg_number,sex,student_id,suspended,password,'
    9087            'state,history,certcode,is_postgrad,current_level,current_session\r\n'
    9188
    92             'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,'
    93             'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",'
     89            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
     90            'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",'
    9491            '+234-123-12345#,123,f,A111111,0,,created'
    9592            in result
  • main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py

    r9484 r9486  
    257257            level_object.validation_date = datetime.utcnow()
    258258    elif event.transition.transition_id == 'clear':
    259         obj.clearance_comment = None
     259        obj.officer_comment = None
    260260    elif event.transition.transition_id == 'reset8':
    261261        current_level = obj['studycourse'].current_level
Note: See TracChangeset for help on using the changeset viewer.