Changeset 9486 for main/waeup.kofa/trunk/src
- Timestamp:
- 31 Oct 2012, 16:30:02 (12 years ago)
- 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 587 587 form_fields = grok.AutoFields( 588 588 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 = BytesDisplayWidget589 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 593 593 return form_fields 594 594 … … 615 615 form_fields = grok.AutoFields( 616 616 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') 619 619 return form_fields 620 620 … … 709 709 grok.require('waeup.clearStudent') 710 710 form_fields = grok.AutoFields( 711 IUGStudentClearance).select(' clearance_comment')711 IUGStudentClearance).select('officer_comment') 712 712 713 713 @action(_('Save comment and reject clearance now'), style='primary') … … 726 726 return 727 727 self.applyData(self.context, **data) 728 comment = data[' clearance_comment']728 comment = data['officer_comment'] 729 729 self.context.writeLogMessage( 730 730 self, 'comment: %s' % comment.replace('\n', '<br>')) … … 1953 1953 if self.context.is_postgrad: 1954 1954 form_fields = grok.AutoFields(IPGStudentClearance).omit( 1955 'clearance_locked', 'clr_code', ' clearance_comment')1955 'clearance_locked', 'clr_code', 'officer_comment') 1956 1956 else: 1957 1957 form_fields = grok.AutoFields(IUGStudentClearance).omit( 1958 'clearance_locked', 'clr_code', ' clearance_comment')1958 'clearance_locked', 'clr_code', 'officer_comment') 1959 1959 return form_fields 1960 1960 -
main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py
r9485 r9486 71 71 self.current_session = current_session 72 72 self.certificate = context['studycourse'].certificate 73 self.comment = getattr(context, ' clearance_comment', None)73 self.comment = getattr(context, 'officer_comment', None) 74 74 75 75 def search(query=None, searchtype=None, view=None): -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r9484 r9486 274 274 ) 275 275 276 clearance_comment = schema.Text(276 officer_comment = schema.Text( 277 277 title = _(u"Officer's Comment"), 278 278 required = False, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9485 r9486 1212 1212 self.browser.url, self.student_path + '/reject_clearance') 1213 1213 # 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, 1215 1215 You did not fill properly. 1216 1216 """ … … 1231 1231 self.assertTrue('Your message has been sent' in self.browser.contents) 1232 1232 # The comment has been stored ... 1233 self.assertEqual(self.student. clearance_comment,1233 self.assertEqual(self.student.officer_comment, 1234 1234 u'Dear Student,\nYou did not fill properly.\n') 1235 1235 # ... and logged … … 1267 1267 IWorkflowInfo(self.student).fireTransition('request_clearance') 1268 1268 IWorkflowInfo(self.student).fireTransition('clear') 1269 self.assertEqual(self.student. clearance_comment, None)1269 self.assertEqual(self.student.officer_comment, None) 1270 1270 1271 1271 def test_handle_courses_by_ca(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r9484 r9486 43 43 result = open(self.outfile, 'rb').read() 44 44 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,' 48 47 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 49 48 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 50 49 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",' 53 52 '+234-123-12345#,123,f,A111111,0,,created' 54 53 in result … … 64 63 result = open(self.outfile, 'rb').read() 65 64 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,' 69 67 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 70 68 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 71 69 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",' 74 72 '+234-123-12345#,123,f,A111111,0,,created' 75 73 in result … … 84 82 result = open(self.outfile, 'rb').read() 85 83 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,' 89 86 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 90 87 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 91 88 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",' 94 91 '+234-123-12345#,123,f,A111111,0,,created' 95 92 in result -
main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py
r9484 r9486 257 257 level_object.validation_date = datetime.utcnow() 258 258 elif event.transition.transition_id == 'clear': 259 obj. clearance_comment = None259 obj.officer_comment = None 260 260 elif event.transition.transition_id == 'reset8': 261 261 current_level = obj['studycourse'].current_level
Note: See TracChangeset for help on using the changeset viewer.