## 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 Faculties """ request = context.REQUEST wf = context.portal_workflow mtool = context.portal_membership member = mtool.getAuthenticatedMember() path_info = request.get('PATH_INFO').split('/') info = {} member_id = str(member) pt = request.get('PATH_TRANSLATED').split('/') dep_id = pt[5] cert_id = pt[7] level_id = pt[8] roles = member.getRoles() info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles info['is_student'] = 'Student' in roles info['action'] = "%s/faculty_index_view" % context.absolute_url() info['choosen_ids'] = request.get('ids',[]) info['doc'] = context.getContent() brain = context.portal_catalog(meta_type="Certificate",id = cert_id)[-1] cp = brain.getPath() info['container_path'] = cp info['dep_id'] = dep_id info['cert_id'] = cert_id for sem in ('first','second'): res = context.portal_catalog(container_path="%s/%s/%s" % (cp,level_id,sem)) items = [] for r in res: row = {} ro = r.getObject() rd = ro.getContent() row['id'] = r.getId row['title'] = rd.Title() row['core'] = rd.core_or_elective row['semester'] = sem row['url'] = ro.absolute_url() items.append(row) info[sem] = items return info