Changeset 296
- Timestamp:
- 14 Jul 2006, 13:52:50 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 5 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Academics.py
r295 r296 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.academics.temporary_view_all() 74 return self.getContent().temporary_view_all() 73 return self.academics.academics_contents() 75 74 ###) 76 75 … … 140 139 dict = {'Title': 'Certificates'} 141 140 certificates.getContent().edit(mapping=dict) 142 return self.academics.temporary_view_all() 143 return self.temporary_view_all() 141 return self.academics.academics_contents() 144 142 ###) 145 143 … … 167 165 course_list = [ c.id for c in cl] 168 166 for course in courses: 169 logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(C ourseKey)s %(Category)s %(AdmStatus)s' % course)167 logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(Category)s %(AdmStatus)s' % course) 170 168 ## if course.get("FORMERCODE").endswith('BITS'): 171 169 ## continue … … 179 177 if not no_import: 180 178 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 181 no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","C ourseKey","Category","AdmStatus"\n')179 no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","Category","AdmStatus"\n') 182 180 no_import.write("Dep %(Dept)s for Course %(CourseCode)s not found\n" % course) 183 no_import.write('"%(CourseCode)s","%(Description)s","%(Credits)s","%(Dept)s","%(Semester)s","%(Session)s","%(PassMark)s","%(C ourseKey)s","%(Category)s","%(AdmStatus)s"\n' % course)181 no_import.write('"%(CourseCode)s","%(Description)s","%(Credits)s","%(Dept)s","%(Semester)s","%(Session)s","%(PassMark)s","%(Category)s","%(AdmStatus)s"\n' % course) 184 182 continue 185 183 course_id = ''.join(re.split('\W+',course.get('CourseCode'))) … … 198 196 ## logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars()) 199 197 ## course_id = tid 200 elif len(course_id) > 7:198 elif len(course_id) > 10: 201 199 logger.info("invalid course_code %(CourseCode)s" % course) 202 200 if not no_import: 203 201 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 204 no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","C ourseKey","Category","AdmStatus"\n')202 no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","Category","AdmStatus"\n') 205 203 no_import.write("invalid course_code %(CourseCode)s\n" % course) 206 no_import.write('"%(CourseCode)s","%(Description)s","%(Credits)s","%(Dept)s","%(Semester)s","%(Session)s","%(PassMark)s","%(C ourseKey)s","%(Category)s","%(AdmStatus)s"\n' % course)204 no_import.write('"%(CourseCode)s","%(Description)s","%(Credits)s","%(Dept)s","%(Semester)s","%(Session)s","%(PassMark)s","%(Category)s","%(AdmStatus)s"\n' % course) 207 205 continue 208 206 courses = dept.Courses … … 229 227 dict['passmark'] = 0 230 228 c.getContent().edit(mapping=dict) 231 return self.academics.temporary_view_all() 232 return self.temporary_view_all() 229 return self.academics.academics_contents() 233 230 ###) 234 231 … … 272 269 no_import.write('"%(CertCode)s","%(Description)s","%(Faculty)s","%(MaxPass)s","%(MaxLoad)s","%(session)s","%(PromotionCredits)s","%(Probationcredits)s","%(StartLevel)s","%(endLevel)s","%(Nyears)s","%(Ncore)s","%(MaxElect)s","%(MPREFIX)s","%(Dept)s","%(Admstatus)s","%(category)s"\n' % certificate) 273 270 continue 274 certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate271 #certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate 275 272 dep = deps[depid] 276 273 certificates = dep.Certificates 274 code = certificate.get('CertCode') 275 code = code.replace('.','') 276 code = code.replace('(','') 277 code = code.replace(')','') 278 code = code.replace('/','') 279 code = code.replace(' ','') 280 code = code.replace('_','') 281 certificate_id = code 277 282 c = getattr(certificates,certificate_id,None) 278 283 if c is None: … … 282 287 c = getattr(certificates,certificate_id) 283 288 dict = {'Title': certificate['Description']} 284 code = certificate.get('CertCode')285 code = code.replace('.','')286 code = code.replace('(','')287 code = code.replace(')','')288 code = code.replace('/','')289 code = code.replace(' ','')290 code = code.replace('_','')291 289 dict['code'] = code 292 290 dict['faculty'] = certificate.get('Faculty') … … 308 306 dict['probation_credits'] = certificate.get('ProbationCredits') 309 307 c.getContent().edit(mapping=dict) 310 return self.academics.temporary_view_all() 311 return self.temporary_view_all() 308 return self.academics.academics_contents() 312 309 ###) 313 310 … … 326 323 d_ids = [d.id for d in self.portal_catalog({'meta_type': "Department"})] 327 324 c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})] 325 l = self.portal_catalog({'meta_type': "Certificate"}) 326 certs = {} 327 for f in l: 328 certs[f.id] = f.getObject() 328 329 for cert_course in cert_courses: 329 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)330 logger.info('Processing %(CosCode)s %(CertCode)s %(Session)s %(Level)s %(Core)s %(Elective)s %(Mandatory)s %(AdmStatus)s %(Dept)s %(Semester)s' % cert_course) 330 331 depid = cert_course.get('Dept') 331 332 course_code = cert_course.get('CosCode') … … 339 340 ## if cert_course.get('Session') != '2002/2003': 340 341 ## continue 341 certificate = self.portal_catalog({'meta_type': "Certificate", 342 'SearchableText': code}) 343 if not certificate: 342 ## certificate = self.portal_catalog({'meta_type': "Certificate", 343 ## 'SearchableText': code}) 344 ## if not certificate: 345 if not code in certs.keys(): 344 346 #print code 345 347 em = 'CertCode %(CertCode)s for %(CosCode)s not found\n' % cert_course … … 347 349 if not no_import: 348 350 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 349 no_import.write('"CosCode","CertCode"," CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')351 no_import.write('"CosCode","CertCode","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 350 352 no_import.write(em) 351 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 no_import.write('"%(CosCode)s","%(CertCode)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 352 354 continue 353 355 certificate = certificate[-1].getObject() … … 358 360 if not no_import: 359 361 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 360 no_import.write('"CosCode","CertCode"," CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')362 no_import.write('"CosCode","CertCode","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 361 363 no_import.write(em) 362 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)364 no_import.write('"%(CosCode)s","%(CertCode)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 363 365 continue 364 366 if depid not in d_ids: … … 367 369 if not no_import: 368 370 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 369 no_import.write('"CosCode","CertCode"," CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')371 no_import.write('"CosCode","CertCode","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 370 372 no_import.write(em) 371 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)373 no_import.write('"%(CosCode)s","%(CertCode)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 372 374 continue 373 375 level = cert_course.get('Level') … … 391 393 if not no_import: 392 394 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 393 no_import.write('"CosCode","CertCode"," CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')395 no_import.write('"CosCode","CertCode","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n') 394 396 ## no_import.write('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 395 ## 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)397 ## no_import.write('"%(CosCode)s","%(CertCode)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course) 396 398 continue 397 399 semester.invokeFactory('CertificateCourse',course_code) … … 410 412 dict['level'] = cert_course.get('Level') 411 413 cc.getContent().edit(mapping=dict) 412 return self.academics. temporary_view_all()414 return self.academics.academics_contents() 413 415 ###) 414 416 … … 483 485 """passmark from course""" 484 486 ce = self.getCourseEntry(self.id) 485 return ce.passmark 487 if ce is not None and hasattr(ce,"passmark"): 488 return ce.passmark 489 486 490 487 491 security.declareProtected(View,"coursepath") … … 517 521 """compose title""" 518 522 return "%s" % (self.title) 523 524 security.declareProtected(View,"LongTitle") 525 def LongTitle(self): 526 """compose long_title""" 527 itype = self.portal_vocabularies.institution_types_voc.get(self.institution_type,default="Faculty of") 528 529 return "%s %s" % (itype,self.title) 519 530 520 531 InitializeClass(Faculty) … … 541 552 ## return "Department of %s" % (self.title) 542 553 554 security.declareProtected(View,"LongTitle") 555 def LongTitle(self): 556 """compose long_title""" 557 if not hasattr(self,'institution_type'): 558 self.institution_type = "department" 559 itype = self.portal_vocabularies.institution_types_voc.get(self.institution_type,default="Department of") 560 561 return "%s %s" % (itype,self.title) 562 543 563 InitializeClass(Department) 544 564 545 565 def addDepartment(container, id, REQUEST=None, **kw): 546 566 """Add a Department.""" 547 ob = Department(id, **kw)567 object = Department(id, **kw) 548 568 id = object.getId() 549 569 container._setObject(id, object) 550 dep = getattr(container,id) 570 dep = getattr(container,id).getContent() 551 571 dep.invokeFactory('CoursesFolder','Courses') 572 o = getattr(dep,'Courses') 573 dict = {'Title': 'Courses'} 574 o.getContent().edit(mapping=dict) 552 575 dep.invokeFactory('CertificatesFolder','Certificates') 576 o = getattr(dep,'Certificates') 577 dict = {'Title': 'Certificates'} 578 o.getContent().edit(mapping=dict) 553 579 if REQUEST is not None: 554 580 url = container.absolute_url() -
WAeUP_SRP/trunk/profiles/default/schemas.xml
r256 r296 10 10 <object name="department" meta_type="CPS Schema"/> 11 11 <object name="faculty" meta_type="CPS Schema"/> 12 <object name="faculty_row" meta_type="CPS Schema"/> 12 13 <object name="jamb" meta_type="CPS Schema"/> 13 14 <object name="semester" meta_type="CPS Schema"/> -
WAeUP_SRP/trunk/profiles/default/types/AcademicsFolder.xml
r290 r296 8 8 <property name="product">WAeUP_SRP</property> 9 9 <property name="factory">addAcademicsFolder</property> 10 <property name="immediate_view"> folder_view</property>10 <property name="immediate_view">academics_contents</property> 11 11 <property name="global_allow">True</property> 12 12 <property name="filter_content_types">True</property> … … 34 34 <property name="storage_methods"/> 35 35 <property name="cps_is_portlet">False</property> 36 <alias from="(Default)" to=" temporary_view_all"/>37 <alias from="view" to=" temporary_view_all"/>38 <action title=" Standard View" action_id="view" category="object"39 condition_expr="" url_expr="string:${object_url}/ temporary_view_all"36 <alias from="(Default)" to="academics_contents"/> 37 <alias from="view" to="academics_contents"/> 38 <action title="View" action_id="academics_view" category="object" 39 condition_expr="" url_expr="string:${object_url}/academics_contents" 40 40 visible="True"> 41 41 <permission value="View"/> … … 47 47 <action title="action_folder_contents" action_id="contents" category="object" 48 48 condition_expr="" url_expr="string:${object/absolute_url}/folder_contents" 49 visible=" True"/>49 visible="False"/> 50 50 <action title="delegate" action_id="localroles" category="object" 51 51 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" -
WAeUP_SRP/trunk/profiles/default/types/Department.xml
r295 r296 8 8 <property name="product">WAeUP_SRP</property> 9 9 <property name="factory">addDepartment</property> 10 <property name="immediate_view"> folder_view</property>10 <property name="immediate_view">academics_contents</property> 11 11 <property name="global_allow">True</property> 12 12 <property name="filter_content_types">True</property> … … 33 33 <property name="storage_methods"/> 34 34 <property name="cps_is_portlet">False</property> 35 <alias from="(Default)" to="temporary_view_all"/> 36 <alias from="view" to="temporary_view_all"/> 37 <action title="Standard View" action_id="view" category="object" 38 condition_expr="" url_expr="string:${object_url}/temporary_view_all" 39 visible="True"> 35 <alias from="(Default)" to="academics_contents"/> 36 <alias from="view" to="academics_contents"/> 37 <action title="View" action_id="view" category="object" condition_expr="" 38 url_expr="string:${object_url}/academics_contents" visible="True"> 40 39 <permission value="View"/> 41 40 </action> … … 53 52 <action title="action_folder_contents" action_id="contents" category="object" 54 53 condition_expr="python:member and 'Manager' in member.getRoles()" 55 url_expr="string:${object_url}/folder_contents" visible=" True"/>54 url_expr="string:${object_url}/folder_contents" visible="False"/> 56 55 <action title="action_metadata" action_id="metadata" category="object" 57 56 condition_expr="python:member and 'Manager' in member.getRoles()" 58 url_expr="string:${object_url}/cpsdocument_metadata" visible=" True">57 url_expr="string:${object_url}/cpsdocument_metadata" visible="False"> 59 58 <permission value="Modify portal content"/> 60 59 </action> 61 60 <action title="delegate" action_id="localroles" category="object" 62 61 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 63 visible=" False">62 visible="True"> 64 63 <permission value="Modify portal content"/> 65 64 </action> -
WAeUP_SRP/trunk/profiles/default/types/Faculty.xml
r290 r296 1 <?xml version="1.0"?>2 <object name="Faculty" meta_type="CPS Flexible Type Information"3 xmlns:i18n="http://xml.zope.org/namespaces/i18n">4 <property name="title">WAeUP Faculty</property>5 <property name="description"></property>6 <property name="content_icon"></property>7 <property name="content_meta_type">Faculty</property>8 <property name="product">WAeUP_SRP</property>9 <property name="factory">addFaculty</property>10 <property name="immediate_view">folder_view</property>11 <property name="global_allow">True</property>12 <property name="filter_content_types">True</property>13 <property name="allowed_content_types">14 <element value="Department"/>15 </property>16 <property name="allow_discussion">False</property>17 <property name="cps_is_searchable">True</property>18 <property name="cps_proxy_type">btreefolderishdocument</property>19 <property name="cps_display_as_document_in_listing">True</property>20 <property name="schemas">21 <element value="metadata"/>22 <element value="common"/>23 <element value="faculty"/>24 </property>25 <property name="layouts">26 <element value="faculty"/>27 </property>28 <property name="layout_clusters">29 <element value="metadata:metadata"/>30 </property>31 <property name="flexible_layouts"/>32 <property name="storage_methods"/>33 <property name="cps_is_portlet">False</property>34 <alias from="(Default)" to="temporary_view_all"/>35 <alias from="view" to="temporary_view_all"/>36 <action title="Standard View" action_id="view" category="object"37 condition_expr="" url_expr="string:${object_url}/temporary_view_all"38 visible="True">39 <permission value="View"/>40 </action>41 <action title="action_edit" action_id="edit" category="object"42 condition_expr="python:member and 'Manager' in member.getRoles()"43 url_expr="string:${object_url}/cpsdocument_edit_form" visible="True">44 <permission value="Modify portal content"/>45 </action>46 <action title="Add Department" action_id="add_department" category="object"47 url_expr="string:${object/absolute_url}/content_create?type_name=Department"48 condition_expr=""49 visible="True">50 <permission value=""/>51 </action>52 <action title="action_folder_contents" action_id="contents" category="object"53 condition_expr="" url_expr="string:${object_url}/folder_contents"54 visible="False">55 <permission value=""/>56 </action>57 <action title="action_metadata" action_id="metadata" category="object"58 condition_expr="python:member and 'Manager' in member.getRoles()"59 url_expr="string:${object_url}/cpsdocument_metadata" visible="True">60 <permission value="Modify portal content"/>61 </action>62 <action title="delegate" action_id="localroles" category="object"63 condition_expr="" url_expr="string:${object_url}/folder_localrole_form"64 visible="False">65 <permission value="Modify portal content"/>66 </action>67 </object> -
WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml
r200 r296 6 6 <property name="content_icon">students_folder.gif</property> 7 7 <property name="content_meta_type">StudentsFolder</property> 8 <property name="product"> CPSDefault</property>9 <property name="factory">add Folder</property>8 <property name="product">WAeUP_SRP</property> 9 <property name="factory">addStudentsFolder</property> 10 10 <property name="immediate_view">folder_view</property> 11 11 <property name="global_allow">True</property> -
WAeUP_SRP/trunk/skins/waeup_academics/academics_view.py
r295 r296 28 28 #return res 29 29 30 if 1or psm == 'invalid':30 if True:# or psm == 'invalid': 31 31 return context.academics_view_form(rendered = res, 32 32 psm = 'Please correct your errors', -
WAeUP_SRP/trunk/skins/waeup_academics/academics_view_form.pt
r295 r296 12 12 <metal:block fill-slot="main" 13 13 tal:define="roles member/getRoles; 14 backend python:'UniversityManager' in roles or 'StudentManager' in roles;15 frontend python:'Student' in roles or isAnon;16 14 folder here/getContent; 17 15 items here/contentValues; 18 rend ered options;"16 rend options/rendered;" 19 17 > 20 18 <h1> <span tal:content="context/title_or_id" /></h1> … … 23 21 24 22 <p>The Faculties:</p> 25 <span tal:replace="structure rend ered" />23 <span tal:replace="structure rend" /> 26 24 </metal:block> 27 25 <metal:block fill-slot="sub"> -
WAeUP_SRP/trunk/skins/waeup_default/layout_row_edit.pt
r295 r296 28 28 <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"> 29 29 <tr tal:repeat="row layout/rows" valign="top"> 30 <td tal:repeat="cell row" 30 <td tal:repeat="cell row" 31 31 tal:attributes="colspan cell/ncols"> 32 32 <tal:block define="widget cell/widget;
Note: See TracChangeset for help on using the changeset viewer.