- Timestamp:
- 7 May 2007, 12:07:44 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py
r1724 r1744 49 49 comments = REQUEST.get('comments') 50 50 context.cpsdocument_notify_modification(comments=comments) 51 if context.portal_type == "StudentStudyCourse": 52 course = ds.get('study_course') 53 student_id = context.getStudentId() 54 res = context.portal_catalog(portal_type='Certificate',id = course) 55 if res: 56 c_brain = res[0] 57 c_path = c_brain.getPath().split('/') 51 if False: 52 if context.portal_type == "StudentStudyCourse": 53 course = ds.get('study_course') 54 student_id = context.getStudentId() 55 res = context.portal_catalog(portal_type='Certificate',id = course) 56 if res: 57 c_brain = res[0] 58 c_path = c_brain.getPath().split('/') 59 student_id = context.getStudentId() 60 context.students_catalog.modifyRecord(id = student_id, 61 course = course, 62 level = ds.get('current_level'), 63 verdict = ds.get('current_verdict'), 64 faculty = c_path[-4], 65 department = c_path[-3], 66 ) 67 logger.info('%s edited %s (%s) of %s' % (member,context.id,course,student_id)) 68 69 elif context.portal_type == "StudentApplication": # disabled 70 entry_mode = ds.get('entry_mode') 58 71 student_id = context.getStudentId() 59 72 context.students_catalog.modifyRecord(id = student_id, 60 course = course, 61 level = ds.get('current_level'), 62 verdict = ds.get('current_verdict'), 63 faculty = c_path[-4], 64 department = c_path[-3], 65 ) 66 logger.info('%s edited %s (%s) of %s' % (member,context.id,course,student_id)) 67 68 elif context.portal_type == "StudentApplication": 69 entry_mode = ds.get('entry_mode') 70 student_id = context.getStudentId() 71 context.students_catalog.modifyRecord(id = student_id, 72 entry_mode = entry_mode, 73 ) 74 logger.info('%s edited %s of %s' % (member,context.id,student_id)) 75 elif context.portal_type == "StudentClearance": 76 matric_no = ds.get('matric_no') 77 student_id = context.getStudentId() 78 context.students_catalog.modifyRecord(id = student_id, 79 matric_no = matric_no, 80 ) 81 logger.info('%s edited %s of %s' % (member,context.id,student_id)) 82 elif context.portal_type in ("StudentPersonal",): 83 name = "%(firstname)s %(middlename)s %(lastname)s" % ds 84 name = name.strip() 85 name = name.replace(' ',' ') 86 email = ds.get('email') 87 phone = ds.get('phone') 88 student_id = context.getStudentId() 89 #app_doc = context.application.getContent() 90 #jamb_sex = 'M' 91 #if ds.get('sex'): 92 # jamb_sex = 'F' 93 # originally imported data must be kept; app_doc should not be changed here 94 #app_doc.edit(mapping={'jamb_lastname': name, 95 # 'jamb_sex': jamb_sex 96 # }) 97 context.students_catalog.modifyRecord(id = student_id, 98 name = name, 99 email = email, 100 phone = phone, 101 sex = ds.get('sex'), 102 ) 103 logger.info('%s edited %s of %s' % (member,context.id,student_id)) 104 elif context.portal_type == "xxxxCourse": # disabled handled by events 105 dd = {} 106 dd.update(ds) # ds is not a real dictionary 107 try: 108 context.courses_catalog.modifyRecord(**dd) 109 except KeyError: 110 context.courses_catalog.addRecord(**dd) 73 entry_mode = entry_mode, 74 ) 75 logger.info('%s edited %s of %s' % (member,context.id,student_id)) 76 elif context.portal_type == "StudentClearance": 77 matric_no = ds.get('matric_no') 78 student_id = context.getStudentId() 79 context.students_catalog.modifyRecord(id = student_id, 80 matric_no = matric_no, 81 ) 82 logger.info('%s edited %s of %s' % (member,context.id,student_id)) 83 elif context.portal_type in ("StudentPersonal",): 84 name = "%(firstname)s %(middlename)s %(lastname)s" % ds 85 name = name.strip() 86 name = name.replace(' ',' ') 87 email = ds.get('email') 88 phone = ds.get('phone') 89 student_id = context.getStudentId() 90 #app_doc = context.application.getContent() 91 #jamb_sex = 'M' 92 #if ds.get('sex'): 93 # jamb_sex = 'F' 94 # originally imported data must be kept; app_doc should not be changed here 95 #app_doc.edit(mapping={'jamb_lastname': name, 96 # 'jamb_sex': jamb_sex 97 # }) 98 context.students_catalog.modifyRecord(id = student_id, 99 name = name, 100 email = email, 101 phone = phone, 102 sex = ds.get('sex'), 103 ) 104 logger.info('%s edited %s of %s' % (member,context.id,student_id)) 105 elif context.portal_type == "xxxxCourse": # disabled handled by events 106 dd = {} 107 dd.update(ds) # ds is not a real dictionary 108 try: 109 context.courses_catalog.modifyRecord(**dd) 110 except KeyError: 111 context.courses_catalog.addRecord(**dd) 111 112 if cpsdocument_edit_and_view_button is not None: 112 113 action = ''
Note: See TracChangeset for help on using the changeset viewer.