Changeset 2609
- Timestamp:
- 9 Nov 2007, 15:38:22 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Academics.py
r2291 r2609 762 762 def Title(self): 763 763 """compose title""" 764 try: 765 return "Level %s" % self.aq_parent.getId() 766 except: 767 return "no Title for %s" % self.getId() 764 return self.portal_vocabularies.levels.get(self.aq_parent.getId()) 765 # try: 766 # #return "Level %s" % self.aq_parent.getId() 767 # except: 768 # return "no Title for %s" % self.getId() 768 769 769 770 -
WAeUP_SRP/base/skins/waeup_academics/getLevelInfo.py
r2281 r2609 32 32 info['choosen_ids'] = request.get('ids',[]) 33 33 info['doc'] = context.getContent() 34 brain = context.portal_catalog(meta_type="Certificate",id = cert_id)[-1]35 cp = brain.getPath()36 info['container_path'] = cp34 # brain = context.portal_catalog(meta_type="Certificate",id = cert_id)[-1] 35 # cp = brain.getPath() 36 # info['container_path'] = cp 37 37 info['dep_id'] = dep_id 38 38 info['cert_id'] = cert_id 39 39 40 res = context.portal_catalog(meta_type="CertificateCourse", container_path="%s/%s" % (cp,level_id)) 40 # res = context.portal_catalog(meta_type="CertificateCourse", container_path="%s/%s" % (cp,level_id)) 41 # first = [] 42 # second = [] 43 # for r in res: 44 # row = {} 45 # ro = r.getObject() 46 # rd = ro.getContent() 47 # course_id = r.getId 48 # row = context.getCourseInfo(course_id) 49 # row['id'] = course_id 50 # # row['title'] = rd.Title() 51 # # row['semester'] = rd.semester 52 # row['core'] = rd.core_or_elective 53 # row['url'] = ro.absolute_url() 54 # row['review_state'] = wf.getInfoFor(ro,'review_state','None') 55 # editable = row['is_editable'] = mtool.checkPermission('Modify portal content', ro) 56 # if editable: 57 # row['real_course_path'] = "%s/%s/%s/courses/%s" % (academics_path, 58 # row['faculty'], 59 # row['department'], 60 # course_id) 61 # if row['semester'] == 1: 62 # first.append(row) 63 # else: 64 # second.append(row) 41 65 first = [] 42 66 second = [] 43 for r in res:67 for course_id,course in context.objectItems(): 44 68 row = {} 45 ro = r.getObject()46 rd = ro.getContent()47 course_id = r.getId69 # ro = r.getObject() 70 course_doc = course.getContent() 71 # course_id = r.getId 48 72 row = context.getCourseInfo(course_id) 49 73 row['id'] = course_id 50 # row['title'] = rd.Title()51 # row['semester'] = rd.semester52 row['core'] = rd.core_or_elective53 row['url'] = ro.absolute_url()54 row['review_state'] = wf.getInfoFor( ro,'review_state','None')55 editable = row['is_editable'] = mtool.checkPermission('Modify portal content', ro)74 # row['title'] = course_doc.Title() 75 # row['semester'] = course_doc.semester 76 row['core'] = course_doc.core_or_elective 77 row['url'] = course.absolute_url() 78 row['review_state'] = wf.getInfoFor(course,'review_state','None') 79 editable = row['is_editable'] = mtool.checkPermission('Modify portal content', course) 56 80 if editable: 57 81 row['real_course_path'] = "%s/%s/%s/courses/%s" % (academics_path, -
WAeUP_SRP/base/skins/waeup_utilities/ti_391_resolve.py
r2605 r2609 28 28 from Products.AdvancedQuery import Eq, Between, Le,In 29 29 aq_portal = context.portal_catalog_real.evalAdvancedQuery 30 students_folder = context.portal_url.getPortalObject().campus.students 30 31 31 32 request = context.REQUEST … … 39 40 #logger.info('') 40 41 41 query = Eq('portal_type','StudentPersonal')42 #brains = context.students_catalog()43 brains = aq_portal(query)42 #query = Eq('portal_type','StudentPersonal') 43 #brains = aq_portal(query) 44 brains = context.students_catalog() 44 45 total = len(brains) 45 46 #rwrite("found %d " % total) … … 47 48 edited = 0 48 49 count = 0 50 commit_after = 50 49 51 logger.info('started for %d' % total) 50 52 for brain in brains: 51 53 count += 1 52 doc = brain.getObject().getContent() 53 if doc.email and doc.email.find('@') < 0: 54 if no_email and not no_email % commit_after: 55 context.waeup_tool.doCommit() 56 logger.info("Committing %s transactions, total %s" % (commit_after,count)) 57 if not brain.email or brain.email.find('@') < 0: 54 58 no_email += 1 55 #rwrite ("%s email = %s" % (brain.getId,doc.email))56 59 try: 57 app_doc = getattr(brain.getObject().aq_parent,'application').getContent() 58 logger.info("setting email of %s from %s to %s" % (brain.getPath().split('/')[-2], 59 doc.email, 60 app_doc.app_email)) 61 doc.edit(mapping={'email': app_doc.app_email}) 62 edited += 1 60 app_doc = getattr(getattr(students_folder,brain.id),'application').getContent() 61 #rwrite ("%s email = %s" % (brain.getId,doc.email)) 63 62 except: 64 logger.info("failed to set email of %s from %s" % (brain.getPath().split('/')[-2], 65 doc.email, 66 )) 67 pass 63 logger.info("failed to get application object of %s" % (brain.id,)) 64 continue 65 if not app_doc.app_email or app_doc.app_email.find('@') < 0: 66 logger.info("%s both emails %s/%s are invalid" % (brain.id, 67 app_doc.app_email, 68 brain.email)) 69 continue 70 try: 71 per_doc = getattr(getattr(students_folder,brain.id),'personal').getContent() 72 #rwrite ("%s email = %s" % (brain.getId,doc.email)) 73 except: 74 logger.info("failed to get personal object of %s" % (brain.id,)) 75 continue 76 logger.info("setting email of %s from %s to %s" % (brain.id, 77 per_doc.email, 78 app_doc.app_email)) 79 per_doc.edit(mapping={'email': app_doc.app_email}) 80 edited += 1 68 81 else: 69 82 #rwrite ("%s email = %s" % (brain.getPath(),doc.email)) -
WAeUP_SRP/uniben/profiles/default/layouts/study_level.xml
r1449 r2609 8 8 <property name="flexible_widgets"/> 9 9 <property name="validate_values_expr"></property> 10 <widget name="code" meta_type="S tringWidget">10 <widget name="code" meta_type="Select Widget"> 11 11 <property name="title">Level No</property> 12 12 <property name="fields"> … … 17 17 <property name="label_edit">Level No</property> 18 18 <property name="readonly_layout_modes"/> 19 <property name="vocabulary">levels</property> 19 20 <property name="hidden_layout_modes"> 20 21 <element value="edit"/>
Note: See TracChangeset for help on using the changeset viewer.