## Script (Python) "cpsdocument_edit" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student=None ##title= ## # $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $ """ return Info about the current Student """ request = context.REQUEST form = request.form fget = form.get wf = context.portal_workflow mtool = context.portal_membership member = mtool.getAuthenticatedMember() path_info = request.get('PATH_INFO').split('/') roles = member.getRoles() info = {} info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles member_id = str(member) if student is None: students = getattr(context,'students',None) if students is None: students = getattr(context.campus,'students',None) student = getattr(students,member_id,None) if student is None: return None info['review_state'] = wf.getInfoFor(student,'review_state','keiner') #info['wf_state'] = 'keiner' info['student'] = student info['id'] = student.getId() info['student_doc'] = student.getContent() info['app'] = student.application info['app_doc'] = student.application.getContent() info['per'] = student.personal info['per_doc'] = student.personal.getContent() return info