Changeset 3473
- Timestamp:
- 29 Apr 2008, 09:24:51 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 2 added
- 4 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Students.py
r3454 r3473 707 707 security = ClassSecurityInfo() 708 708 709 security.declareProtected(View,"Title")710 def Title(self):711 """compose title"""712 content = self.getContent()713 session_id = content.session714 try:715 y = int(session_id[-2:])716 except:717 return "Accommodation Data for Session %s" % session_id718 session_str = self.portal_vocabularies.sessions.get(y)719 #return "Accommodation Data for %s %s" % (content.firstname,content.lastname)720 return "Accommodation Data for Session %s" % session_str709 # security.declareProtected(View,"Title") 710 # def Title(self): 711 # """compose title""" 712 # content = self.getContent() 713 # session_id = content.session 714 # try: 715 # y = int(session_id[-2:]) 716 # except: 717 # return "Accommodation Data for Session %s" % session_id 718 # session_str = self.portal_vocabularies.sessions.get(y) 719 # #return "Accommodation Data for %s %s" % (content.firstname,content.lastname) 720 # return "Accommodation Data for Session %s" % session_str 721 721 722 722 … … 738 738 security = ClassSecurityInfo() 739 739 740 security.declareProtected(View,"Title")741 def Title(self):742 """compose title"""743 #content = self.getContent()744 #return "Personal Data for %s %s" % (content.firstname,content.lastname)745 return "Personal Data"740 # security.declareProtected(View,"Title") 741 # def Title(self): 742 # """compose title""" 743 # #content = self.getContent() 744 # #return "Personal Data for %s %s" % (content.firstname,content.lastname) 745 # return "Personal Data" 746 746 747 747 … … 763 763 security = ClassSecurityInfo() 764 764 765 security.declareProtected(View,"Title")766 def Title(self):767 """compose title"""768 #content = self.getContent()769 #return "Clearance/Eligibility Record for %s %s" % (content.firstname,content.lastname)770 return "Clearance/Eligibility Record"765 # security.declareProtected(View,"Title") 766 # def Title(self): 767 # """compose title""" 768 # #content = self.getContent() 769 # #return "Clearance/Eligibility Record for %s %s" % (content.firstname,content.lastname) 770 # return "Clearance/Eligibility Record" 771 771 772 772 … … 788 788 security = ClassSecurityInfo() 789 789 790 security.declareProtected(View,"Title")791 def Title(self):792 """compose title"""793 return self.portal_vocabularies.student_levels.get(self.aq_parent.getId())794 #return "Level %s" % self.aq_parent.getId()790 # security.declareProtected(View,"Title") 791 # def Title(self): 792 # """compose title""" 793 # return self.portal_vocabularies.student_levels.get(self.aq_parent.getId()) 794 # #return "Level %s" % self.aq_parent.getId() 795 795 796 796 def create_course_results(self,cert_id,current_level): ###( … … 835 835 security = ClassSecurityInfo() 836 836 837 security.declareProtected(View,"Title")838 def Title(self):839 """compose title"""840 #content = self.getContent()841 return "Study Course"837 # security.declareProtected(View,"Title") 838 # def Title(self): 839 # """compose title""" 840 # #content = self.getContent() 841 # return "Study Course" 842 842 843 843 … … 859 859 security = ClassSecurityInfo() 860 860 861 security.declareProtected(View,"Title")862 def Title(self):863 """compose title"""864 return "Application Data"861 # security.declareProtected(View,"Title") 862 # def Title(self): 863 # """compose title""" 864 # return "Application Data" 865 865 866 866 … … 890 890 return None 891 891 892 security.declareProtected(View,"Title")893 def Title(self):894 """compose title"""895 cid = self.aq_parent.getId()896 ce = self.getCourseEntry(cid)897 if ce:898 return "%s" % ce.Title899 return "No course with id %s" % cid900 892 # security.declareProtected(View,"Title") 893 # def Title(self): 894 # """compose title""" 895 # cid = self.aq_parent.getId() 896 # ce = self.getCourseEntry(cid) 897 # if ce: 898 # return "%s" % ce.Title 899 # return "No course with id %s" % cid 900 901 901 InitializeClass(StudentCourseResult) 902 902 … … 915 915 security = ClassSecurityInfo() 916 916 917 security.declareProtected(View,"Title")918 def Title(self):919 """compose title"""920 return "PUME Results"917 # security.declareProtected(View,"Title") 918 # def Title(self): 919 # """compose title""" 920 # return "PUME Results" 921 921 922 922 -
WAeUP_SRP/base/WAeUPTool.py
r3452 r3473 106 106 time.sleep(secs) 107 107 return 108 109 ###) 108 ###) 110 109 111 110 security.declareProtected(View,'updateRoleMappingsFor') ###( … … 189 188 if not is_student and requested_id: 190 189 student_id = requested_id 191 elif is_anonymous or member_id != requested_id:190 elif not is_staff and (is_anonymous or member_id != requested_id): 192 191 logger.info('%s tried to access %s of %s' % (member_id,context.portal_type,requested_id)) 193 192 else: … … 377 376 """write to the log file""" 378 377 logfile.write(s) 379 380 ###) 378 ###) 381 379 382 380 def generateStudentId(self,letter): ###( … … 388 386 sid = "%c%d" % (letter,r.randint(99999,1000000)) 389 387 students = self.portal_url.getPortalObject().campus.students 390 ##while hasattr(students, sid):391 ##sid = "%c%d" % (letter,r.randint(99999,1000000))388 # while hasattr(students, sid): 389 # sid = "%c%d" % (letter,r.randint(99999,1000000)) 392 390 while self.students_catalog(id = sid): 393 391 sid = "%c%d" % (letter,r.randint(99999,1000000)) … … 570 568 transaction.commit() 571 569 logger.info('finished removing %d unused docids ' % (to_delete)) 572 573 574 ###) 570 ###) 575 571 576 572 security.declareProtected(View,'getCredential') ###( … … 878 874 # Level 879 875 # 880 ##l = getattr(studycourse,level,None)881 ##if l is None:882 ##studycourse.invokeFactory('StudentStudyLevel', level)883 ##l = getattr(studycourse, level)884 ##self.portal_workflow.doActionFor(l,'open',dest_container=l)885 ##l.getContent().edit(mapping={'Title': "Level %s" % level})886 ###)876 # l = getattr(studycourse,level,None) 877 # if l is None: 878 # studycourse.invokeFactory('StudentStudyLevel', level) 879 # l = getattr(studycourse, level) 880 # self.portal_workflow.doActionFor(l,'open',dest_container=l) 881 # l.getContent().edit(mapping={'Title': "Level %s" % level}) 882 ###) 887 883 888 884 def init_timing(self): ###( … … 899 895 self.i_elapse = time.time() 900 896 self.c_elapse = time.clock() 901 902 ###) 897 ###) 903 898 904 899 def do_timing(self): ###( … … 927 922 self.timer_step +=1 928 923 self.i_elapse = time.time() 929 930 ###) 924 ###) 931 925 932 926 security.declareProtected(ModifyPortalContent,'print_timing') ###( ###( … … 949 943 out.write("\r\n".join(l)) 950 944 out.close() 951 952 ###) 945 ###) 953 946 954 947 security.declareProtected(ModifyPortalContent,'get_timing_data') ###( ###( -
WAeUP_SRP/base/skins/waeup_academics/academics_view.pt
r1783 r3473 1 <metal:html tal:define="info context/getF acultiesInfo;2 is_so context/isSectionOfficer;"1 <metal:html tal:define="info context/getFolderObjectsInfo; 2 is_so info/is_sectionofficer;" 3 3 > 4 4 <metal:body use-macro="here/main_template/macros/master"> -
WAeUP_SRP/base/skins/waeup_academics/courses_view.pt
r1783 r3473 10 10 Up one level 11 11 </a> 12 <h3 tal:content="here/title_or_id"> 13 Page Title 14 </h3> 12 <h3 tal:content="here/aq_parent/LongTitle|here/aq_parent/title_or_id" /> 13 <h4 tal:content="here/title_or_id" /> 15 14 <div tal:condition="python:0" tal:content="info/container_path"/> 16 15 <div tal:condition="python:0" tal:content="info/dep_id"/> -
WAeUP_SRP/base/skins/waeup_academics/department_view.pt
r1783 r3473 9 9 Up one level 10 10 </a> 11 <h3 tal:content="here/title_or_id" /> 12 <div tal:condition="nothing" tal:content="info/container_path"/> 11 <h3 tal:content="info/doc/LongTitle|here/title_or_id" /> 13 12 <br /> 14 13 </metal:block> -
WAeUP_SRP/base/skins/waeup_academics/faculty_view.pt
r1783 r3473 1 <metal:html tal:define="info context/get DepartmentsInfo;2 is_so context/isSectionOfficer;"1 <metal:html tal:define="info context/getFolderObjectsInfo; 2 is_so info/is_sectionofficer;" 3 3 > 4 4 <metal:body use-macro="here/main_template/macros/master"> … … 9 9 Up one level 10 10 </a> 11 <h3 tal:content="here/title_or_id" /> 12 <div tal:condition="python:0" tal:content="info/container_path"/> 11 <h3 tal:content="info/doc/LongTitle|here/title_or_id" /> 13 12 <br /> 14 13 </metal:block> -
WAeUP_SRP/base/skins/waeup_academics/getCoursesCertificatesInfo.py
r2273 r3473 10 10 # $Id$ 11 11 """ 12 return Info about the Faculties12 return Info about a Department 13 13 """ 14 14 request = context.REQUEST … … 17 17 path_info = request.get('PATH_INFO').split('/') 18 18 19 info = {} 19 #info = context.waeup_tool.getAccessInfo(context) 20 info = context.certificates.getFolderObjectsInfo() 20 21 info['action'] = "%s/faculty_view" % context.absolute_url() 21 22 info['choosen_ids'] = request.get('ids',[]) 22 23 info['doc'] = context.getContent() 23 brain = context.portal_catalog(meta_type="Department", id = context.getId())[-1] 24 cp = brain.getPath() 25 info['container_path'] = cp 26 #res = context.portal_catalog(container_path="%s/courses" % cp) 27 #items = [] 28 #for r in res: 29 # row = {} 30 # ro = r.getObject() 31 # rd = ro.getContent() 32 # row['id'] = r.getId 33 # row['title'] = rd.Title() 34 # row['url'] = ro.absolute_url() 35 # items.append(row) 36 #info['courses'] = items 37 res = context.portal_catalog(container_path="%s/certificates" % cp) 38 items = [] 39 for r in res: 40 row = {} 41 try: 42 ro = r.getObject() 43 rd = ro.getContent() 44 row['id'] = r.getId 45 row['title'] = rd.Title() 46 row['url'] = ro.absolute_url() 47 items.append(row) 48 except AttributeError: 49 continue 50 info['certificates'] = items 24 info['certificates'] = info['items'] 51 25 return info 52 26 -
WAeUP_SRP/base/skins/waeup_academics/getLevelInfo.py
r2614 r3473 10 10 # $Id$ 11 11 """ 12 return Info about the Faculties12 return Info about the Level 13 13 """ 14 try: 15 from Products.zdb import set_trace 16 except: 17 def set_trace(): 18 pass 14 19 request = context.REQUEST 15 20 … … 39 44 second = [] 40 45 combined = [] 46 set_trace() 41 47 for course_id,course in context.objectItems(): 42 48 row = {} -
WAeUP_SRP/base/skins/waeup_default/getDocumentInfo.py
r2013 r3473 10 10 # $Id:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $ 11 11 """ 12 return Info about the Faculties12 return Info about a document 13 13 """ 14 try: 15 from Products.zdb import set_trace 16 except: 17 def set_trace(): 18 pass 19 14 20 request = context.REQUEST 15 21 16 wf = context.portal_workflow17 path_info = request.get('PATH_INFO').split('/')22 #wf = context.portal_workflow 23 #path_info = request.get('PATH_INFO').split('/') 18 24 19 mtool = context.portal_membership 20 if mtool.isAnonymousUser(): 25 # mtool = context.portal_membership 26 # if mtool.isAnonymousUser(): 27 # return None 28 29 info = context.waeup_tool.getAccessInfo(context) 30 #set_trace() 31 32 student_id = info['student_id'] 33 if not info['is_staff'] and student_id is None: 21 34 return None 22 35 23 info = {} 36 titles = context.getStudentObjectTitles() 37 info['title'] = titles.get(context.portal_type,'') or context.title_or_id 24 38 try: 25 39 info['doc'] = context.getContent() -
WAeUP_SRP/base/skins/waeup_default/waeup_document_view.pt
r3294 r3473 3 3 tal:define="info context/getDocumentInfo; 4 4 s_name context/getStudentNameInContext; 5 is_so context/isSectionOfficer;">5 is_so info/is_sectionofficer;"> 6 6 7 7 <span tal:condition="not: info"> … … 10 10 <span tal:condition="info"> 11 11 12 <a href="" tal:attributes="href string:${here/a cademicsParent}">12 <a href="" tal:attributes="href string:${here/aq_parent/absolute_url}"> 13 13 <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/> 14 14 Up one level 15 15 </a> 16 16 17 <h3 tal:condition="here/title_or_id">17 <h3> 18 18 <span tal:condition="python:is_so and s_name"> 19 19 <span tal:content="s_name" />: 20 20 </span> 21 <span tal:content=" here/title_or_id" />21 <span tal:content="info/title" /> 22 22 </h3> 23 23 -
WAeUP_SRP/base/skins/waeup_documents/getDocumentsInfo.py
r2013 r3473 31 31 info['doc'] = context.getContent() 32 32 33 # items = [] 34 # facs = context.portal_catalog(portal_type='WAeUPDocument') 35 # for f in facs: 36 # row = {} 37 # fo = f.getObject() 38 # fd = fo.getContent() 39 # row['id'] = fo.getId() 40 # row['title'] = fd.Title() 41 # row['url'] = fo.absolute_url() 42 # row['is_editable'] = mtool.checkPermission('Modify portal content', fo) 43 # items.append(row) 44 # items.sort(cmp_id) 33 45 items = [] 34 facs = context.portal_catalog(portal_type='WAeUPDocument') 35 for f in facs: 46 for id, doc in context.objectItems(): 36 47 row = {} 37 fo = f.getObject() 38 fd = fo.getContent() 39 row['id'] = fo.getId() 40 row['title'] = fd.Title() 41 row['url'] = fo.absolute_url() 42 row['is_editable'] = mtool.checkPermission('Modify portal content', fo) 48 row['id'] = id 49 row['title'] = doc.getContent().Title() 50 row['url'] = doc.absolute_url() 51 row['is_editable'] = mtool.checkPermission('Modify portal content', doc) 43 52 items.append(row) 44 items.sort(cmp _id)53 items.sort(cmp=lambda x,y: cmp(x['id'].lower(), y['id'].lower())) 45 54 info['items'] = items 46 55 return info -
WAeUP_SRP/base/skins/waeup_student/clearance_view.pt
r3457 r3473 29 29 My 30 30 </span> 31 <span tal:content="context/title_or_id" />31 Clearance/Elegibility Record 32 32 </h3> 33 33 -
WAeUP_SRP/base/skins/waeup_student/getStudentFolderInfo.py
r3235 r3473 96 96 'PaymentsFolder': 'payments_view', 97 97 } 98 s_view_titles = context.getStudentObjectTitles() 98 99 99 100 student_obj = getattr(students_folder,student_id) … … 103 104 row = {} 104 105 row['id'] = subobject.getId() 105 row['title'] = subobject.Title() 106 if subobject.portal_type == 'StudentAccommodation': 107 row['title'] = s_view_titles.get(subobject.portal_type,'') %\ 108 context.portal_vocabularies.sessions.get(subobject.getContent().session) 109 else: 110 row['title'] = s_view_titles.get(subobject.portal_type,'') 106 111 url = row['url'] = subobject.absolute_url() 107 112 row['type'] = subobject.portal_type -
WAeUP_SRP/base/skins/waeup_student/study_course_view.pt
r2989 r3473 17 17 <span tal:content="info/student/name" />: 18 18 </span> 19 <span tal:content="here/title_or_id" />19 Study Course 20 20 </h3> 21 21 <br />
Note: See TracChangeset for help on using the changeset viewer.