- Timestamp:
- 10 Jul 2006, 20:04:08 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Academics.py
r288 r290 71 71 logger.info('Faculty with ID %(FacultyCode)s %(Description)s already exists' % faculty) 72 72 no_import.write('"%(Session)s","%(FacultyCode)s","%(Description)s","%(CollegeCode)s","%(FacultyKey)s","%(Status)s","%(degree_grade)s","%(Bankcode)s"\n' % faculty) 73 return self.getContent().temporary_view_all() 73 74 ###) 74 75 … … 89 90 logger.info('dumping %s %s ' % (faculty.id, faculty.title)) 90 91 print yaml.dump(faculty) 92 return self.academics.temporary_view_all() 93 return self.temporary_view_all() 91 94 92 95 ###) … … 129 132 dict = {'Title': dep['Description']} 130 133 d.getContent().edit(mapping=dict) 134 return self.academics.temporary_view_all() 135 return self.temporary_view_all() 131 136 ###) 132 137 … … 215 220 dict['passmark'] = 0 216 221 c.getContent().edit(mapping=dict) 222 return self.academics.temporary_view_all() 223 return self.temporary_view_all() 217 224 ###) 218 225 219 226 security.declareProtected(ModifyPortalContent,"loadCertificatesFromCSV")###( 227 220 228 def loadCertificatesFromCSV(self): 221 229 """install Universityspecific Certificates from CSV values""" … … 290 298 dict['probation_credits'] = certificate.get('ProbationCredits') 291 299 c.getContent().edit(mapping=dict) 300 return self.academics.temporary_view_all() 301 return self.temporary_view_all() 292 302 ###) 293 303 … … 297 307 #return 298 308 logger = logging.getLogger('loadcertificatecourses') 309 name = 'certificate_courses' 310 no_import = False 299 311 try: 300 312 cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb")) … … 303 315 return 304 316 d_ids = [d.id for d in self.portal_catalog({'meta_type': "Department"})] 317 c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})] 305 318 for cert_course in cert_courses: 306 319 logger.info('Processing %(CosCode)s %(CertCode)s %(CoreKey)s %(Session)s %(Level)s %(Core)s %(Elective)s %(Mandatory)s %(AdmStatus)s %(Dept)s %(Semester)s' % cert_course) 307 320 depid = cert_course.get('Dept') 321 course_code = cert_course.get('CosCode') 308 322 code = cert_course.get('CertCode') 309 323 code = code.replace('.','') … … 313 327 code = code.replace(' ','') 314 328 code = code.replace('_','') 315 if cert_course.get('Session') != '2002/2003':316 continue329 ## if cert_course.get('Session') != '2002/2003': 330 ## continue 317 331 certificate = self.portal_catalog({'meta_type': "Certificate", 318 332 'SearchableText': code}) 319 333 if not certificate: 320 print code 321 logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course) 334 #print code 335 em = 'CertCode %(CertCode)s for %(CosCode)s not found\n' % cert_course 336 logger.info(em) 337 if not no_import: 338 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 339 no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 340 no_import.write(em) 341 no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 322 342 continue 323 343 certificate = certificate[-1].getObject() 324 344 certificate_code = certificate.getId() 345 if course_code not in c_ids: 346 em = 'CorseCode %(CosCode)s for %(CertCode)s not found in Courses\n' % cert_course 347 logger.info(em) 348 if not no_import: 349 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 350 no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 351 no_import.write(em) 352 no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 353 continue 325 354 if depid not in d_ids: 326 logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course) 327 continue 328 course_code = cert_course.get('CosCode') 355 em = 'Department %(Dept)s for %(CertCode)s not found\n' % cert_course 356 logger.info(em) 357 if not no_import: 358 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 359 no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 360 no_import.write(em) 361 no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 362 continue 329 363 level = cert_course.get('Level') 330 364 l = getattr(certificate,level,None) … … 336 370 l.invokeFactory('Semester','first') 337 371 l.invokeFactory('Semester','second') 372 certificate.orderObjects('id') 338 373 first_s = getattr(l,'first') 339 374 second_s = getattr(l,'second') … … 344 379 if hasattr(semester,course_code): 345 380 logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 346 continue 347 381 if not no_import: 382 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 383 no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 384 no_import.write('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 385 no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 386 continue 348 387 semester.invokeFactory('CertificateCourse',course_code) 349 388 cc = getattr(semester,course_code) … … 360 399 dict['core_or_elective'] = False 361 400 dict['level'] = cert_course.get('Level') 362 cc. getContent().edit(mapping=dict)401 cc.academics.edit(mapping=dict) 363 402 ###) 364 403 … … 433 472 """passmark from course""" 434 473 ce = self.getCourseEntry(self.id) 435 if ce: 436 return "%s" % ce.passmark.split(',')[0] 437 return "0" 438 474 return ce.passmark 475 439 476 security.declareProtected(View,"coursepath") 440 477 def coursepath(self): -
WAeUP_SRP/trunk/profiles/default/layouts/faculty.xml
r199 r290 28 28 <property name="size_max">200</property> 29 29 </widget> 30 <widget name="institution_type" meta_type="Select Widget"> 31 <property name="title">Type of Institution</property> 32 <property name="fields"> 33 <element value="institution_type"/> 34 </property> 35 <property name="label">Type of Institution</property> 36 <property name="label_edit">Type of Institution</property> 37 <property name="readonly_layout_modes"/> 38 <property name="hidden_layout_modes"/> 39 <property name="hidden_readonly_layout_modes"/> 40 <property name="vocabulary">institution_types_voc</property> 41 </widget> 30 42 <table> 31 43 <row> 32 44 <cell name="Title"/> 45 </row> 46 <row> 47 <cell name="institution_type"/> 33 48 </row> 34 49 <row> -
WAeUP_SRP/trunk/profiles/default/schemas/faculty.xml
r199 r290 1 1 <?xml version="1.0"?> 2 <object name="faculty" meta_type="CPS Schema"/> 2 <object name="faculty" meta_type="CPS Schema"> 3 <field name="institution_type" meta_type="CPS String Field"/> 4 </object> -
WAeUP_SRP/trunk/profiles/default/types/AcademicsFolder.xml
r279 r290 43 43 <action title="Add Faculty" action_id="add_faculty" category="object" 44 44 condition_expr="python:True or member and 'UniversityManager'in member.getRoles()" 45 url_expr="string:${object/absolute_url}/c reate_common?type_name=Faculty"45 url_expr="string:${object/absolute_url}/content_create?type_name=Faculty" 46 46 visible="True"/> 47 47 <action title="action_folder_contents" action_id="contents" category="object" -
WAeUP_SRP/trunk/profiles/default/types/Department.xml
r274 r290 43 43 condition_expr="python:member and 'Manager' in member.getRoles()" 44 44 url_expr="string:${object_url}/cpsdocument_edit_form" visible="True"> 45 <permission value=" Modify portal content"/>45 <permission value=""/> 46 46 </action> 47 47 <action title="Add Course" action_id="create_course" category="object" 48 condition_expr="" url_expr="string:${object/absolute_url}/c reate_course"48 condition_expr="" url_expr="string:${object/absolute_url}/content_create?type_name=Course" 49 49 visible="True"> 50 <permission value="University Manage"/> 50 <permission value=""/> 51 </action> 52 <action title="Add Certificate" action_id="create_certificate" category="object" 53 condition_expr="" url_expr="string:${object/absolute_url}/content_create?type_name=Certificate" 54 visible="True"> 51 55 </action> 52 56 <action title="action_folder_contents" action_id="contents" category="object" 53 57 condition_expr="python:member and 'Manager' in member.getRoles()" 54 58 url_expr="string:${object_url}/folder_contents" visible="True"> 55 <permission value=" Modify portal content"/>59 <permission value=""/> 56 60 </action> 57 61 <action title="action_metadata" action_id="metadata" category="object" -
WAeUP_SRP/trunk/profiles/default/types/Faculty.xml
r274 r290 45 45 </action> 46 46 <action title="Add Department" action_id="add_department" category="object" 47 url_expr="string:${object/absolute_url}/content_create?type_name=Department" 47 48 condition_expr="" 48 url_expr="string:${object/absolute_url}/create_common?type_name=Department"49 49 visible="True"> 50 <permission value=" University Manage"/>50 <permission value=""/> 51 51 </action> 52 52 <action title="action_folder_contents" action_id="contents" category="object" 53 53 condition_expr="" url_expr="string:${object_url}/folder_contents" 54 54 visible="False"> 55 <permission value=" University Manage"/>55 <permission value=""/> 56 56 </action> 57 57 <action title="action_metadata" action_id="metadata" category="object" … … 65 65 <permission value="Modify portal content"/> 66 66 </action> 67 <action title="Add Faculty" action_id="add_faculty" category="object"68 condition_expr="python:member and 'UniversityManager'in member.getRoles()"69 url_expr="string:${object/absolute_url}/create_common?type_name=Faculty"70 visible="True">71 <permission value="University Manage"/>72 </action>73 67 </object> -
WAeUP_SRP/trunk/profiles/default/vocabularies.xml
r238 r290 4 4 <object name="courselevel" meta_type="CPS Vocabulary"/> 5 5 <object name="faculties" meta_type="CPS Vocabulary"/> 6 <object name="institution_types_voc" meta_type="CPS Vocabulary"/> 6 7 <object name="get_departments_voc" meta_type="CPS Method Vocabulary"/> 7 8 <object name="get_faculties_voc" meta_type="CPS Method Vocabulary"/> -
WAeUP_SRP/trunk/profiles/default/workflows.xml
r282 r290 56 56 </type> 57 57 <type type_id="CourseTicket"> 58 <bound-workflow workflow_id="waeup_ student_wf"/>58 <bound-workflow workflow_id="waeup_base_wf"/> 59 59 </type> 60 60 <type type_id="Department"> … … 77 77 </type> 78 78 <type type_id="Semester"> 79 <bound-workflow workflow_id="waeup_ student_wf"/>79 <bound-workflow workflow_id="waeup_base_wf"/> 80 80 </type> 81 81 <type type_id="Student"> -
WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py
r280 r290 11 11 request = context.REQUEST 12 12 url0 = request.get('URL0') 13 cc = context.contentValues() 14 15 cc.sort() 16 return context.certificate_view_form(cc=cc) 13 return context.certificate_view_form() -
WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt
r280 r290 15 15 frontend python:'Student' in roles or isAnon; 16 16 folder here/getContent; 17 items options/cc;"17 items here/contentValues" 18 18 > 19 19 <h1> <span tal:content="context/title_or_id" /></h1> -
WAeUP_SRP/trunk/skins/waeup_default/create_common.py
r103 r290 16 16 17 17 res,psm,ds = lt.renderLayout(layout_id= type_name.lower(), 18 schema_id= 'metadata',18 schema_id= type_name.lower(), 19 19 context=context, 20 20 mapping=validate and REQUEST, -
WAeUP_SRP/trunk/skins/waeup_default/getCreatableItems.py
r288 r290 12 12 base_url = utool.getBaseUrl() 13 13 14 if context.getPortalTypeName() == 'Portal':15 return items14 ##if context.getPortalTypeName() == 'Portal': 15 ## return items 16 16 17 17 content_types = context.getSortedContentTypes(allowed=1) -
WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt
r96 r290 1 1 <tal:block define="global creation python:1" /> 2 <metal:block use-macro="here/ waeup_layout_lib/macros/common_edit" />2 <metal:block use-macro="here/layout_lib_default_edit/macros/default_edit" /> -
WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt
r86 r290 1 <metal:block use-macro="here/ waeup_layout_lib/macros/default_edit" />1 <metal:block use-macro="here/layout_lib_default_edit/macros/default_edit" /> -
WAeUP_SRP/trunk/skins/waeup_default/temporary_view_all.py
r289 r290 5 5 """ 6 6 7 member = context.portal_membership.getAuthenticatedMember() 8 uname = str(member) 9 roles = member.getRoles() 10 cat = context.portal_catalog 11 request = context.REQUEST 12 url0 = request.get('URL0') 13 #return context.temporary_view_all_form(psm=psm) 14 if context.portal_membership.isAnonymousUser(): 15 if not url0.endswith('chat'): 16 return context.students.student_view_all_form(psm=psm) 17 return context.Chat() 18 else: 19 return context.temporary_view_all_form(psm=psm) 20 if url0.find(uname) > 0 or 'DepartmentManager' in roles or 'Manager' in roles: 21 return context.temporary_view_all_form(psm=psm) 22 elif 'Student' in roles and 'StudentManager' not in roles: 23 res = cat(pathindex="/portal/sections/students/%s" % uname) 24 for r in res: 25 if r.getPath().endswith("students/%s" % uname): 26 return r.getObject().student_view_student_form(psm=psm) 27 return context.students.student_view_all_form(psm=psm) 7 return context.temporary_view_all_form(psm=psm) 8 ##member = context.portal_membership.getAuthenticatedMember() 9 ##uname = str(member) 10 ##roles = member.getRoles() 11 ##cat = context.portal_catalog 12 ##request = context.REQUEST 13 ##url0 = request.get('URL0') 14 ##if context.portal_membership.isAnonymousUser(): 15 ## if not url0.endswith('chat'): 16 ## return context.students.student_view_all_form(psm=psm) 17 ## return context.Chat() 18 ##else: 19 ## if url0.find(uname) > 0 or 'DepartmentManager' in roles or 'Manager' in roles: 20 ## return context.temporary_view_all_form(psm=psm) 21 ## elif 'Student' in roles and 'StudentManager' not in roles: 22 ## res = cat(pathindex="/portal/sections/students/%s" % uname) 23 ## for r in res: 24 ## if r.getPath().endswith("students/%s" % uname): 25 ## return r.getObject().student_view_student_form(psm=psm) 26 ## return context.students.student_view_all_form(psm=psm)
Note: See TracChangeset for help on using the changeset viewer.