Changeset 256 for waeup_product
- Timestamp:
- 20 Jun 2006, 10:44:04 (18 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 8 added
- 17 edited
- 1 copied
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Academics.py
r238 r256 17 17 #registerDirectory('skins/waeup_faculty', globals()) 18 18 19 class SCFolder(CPSDocument): ###( 19 ##class SCFolder(CPSDocument): ###( 20 ## """ 21 ## WAeUP StudyCourseFolder containing StudyCourses 22 ## """ 23 ## meta_type = 'SCFolder' 24 ## portal_type = meta_type 25 ## security = ClassSecurityInfo() 26 ## 27 ## def __init__(self, id, **kw): 28 ## CPSDocument.__init__(self, id, **kw) 29 ## 30 ## security.declareProtected(View,"Title") 31 ## def Title(self): 32 ## """compose title""" 33 ## return "SCFolder of %s" % (self.title) 34 ## 35 ##InitializeClass(SCFolder) 36 ## 37 ##def addSCFolder(container, id, REQUEST=None, **kw): 38 ## """Add a SCFolder.""" 39 ## ob = SCFolder(id, **kw) 40 ## return CPSBase_adder(container, ob, REQUEST=REQUEST) 41 ## 42 #####) 43 44 class Certificate(CPSDocument): ###( 20 45 """ 21 WAeUP StudyCourseFolder containing StudyCourses46 WAeUP Certificate 22 47 """ 23 meta_type = 'SCFolder' 24 portal_type = meta_type 25 security = ClassSecurityInfo() 26 27 def __init__(self, id, **kw): 28 CPSDocument.__init__(self, id, **kw) 29 30 security.declareProtected(View,"Title") 31 def Title(self): 32 """compose title""" 33 return "SCFolder of %s" % (self.title) 34 35 InitializeClass(SCFolder) 36 37 def addSCFolder(container, id, REQUEST=None, **kw): 38 """Add a SCFolder.""" 39 ob = SCFolder(id, **kw) 40 return CPSBase_adder(container, ob, REQUEST=REQUEST) 41 42 ###) 43 44 class StudyCourse(CPSDocument): ###( 45 """ 46 WAeUP StudyCourse 47 """ 48 meta_type = 'StudyCourse' 48 meta_type = 'Certificate' 49 49 portal_type = meta_type 50 50 security = ClassSecurityInfo() … … 56 56 ## def Title(self): 57 57 ## """compose title""" 58 ## return " StudyCourse of %s" % (self.title)58 ## return "Certificate of %s" % (self.title) 59 59 60 InitializeClass( StudyCourse)60 InitializeClass(Certificate) 61 61 62 def add StudyCourse(container, id, REQUEST=None, **kw):63 """Add a StudyCourse."""64 ob = StudyCourse(id, **kw)62 def addCertificate(container, id, REQUEST=None, **kw): 63 """Add a Certificate.""" 64 ob = Certificate(id, **kw) 65 65 return CPSBase_adder(container, ob, REQUEST=REQUEST) 66 66 67 ###) 68 69 class CertificateCourse(CPSDocument): ###( 70 """ 71 WAeUP CertificateCourse 72 """ 73 meta_type = 'CertificateCourse' 74 portal_type = meta_type 75 security = ClassSecurityInfo() 76 77 security.declareProtected(View,"Title") 78 def Title(self): 79 """compose title""" 80 res = self.portal_catalog({'meta_type': "Course", 81 'id': self.id}) 82 if res: 83 course = res[-1].getObject() 84 else: 85 return "No course for %s" % self.id 86 return "%s" % (course.title) 87 88 InitializeClass(CertificateCourse) 89 90 def addCertificateCourse(container, id, REQUEST=None, **kw): 91 """Add a CertificateCourse.""" 92 ob = CertificateCourse(id, **kw) 93 return CPSBase_adder(container, ob, REQUEST=REQUEST) 67 94 ###) 68 95 … … 150 177 return CPSBase_adder(container, ob, REQUEST=REQUEST) 151 178 ###) 179 -
waeup_product/trunk/WAeUPPermissions.py
r167 r256 20 20 __author__ = "Joachim Schmitz <js@aixtraware.de>" 21 21 22 """WAeUP StudentPermissions22 """WAeUP Permissions 23 23 """ 24 24 25 from AccessControl import ModuleSecurityInfo25 #from AccessControl import ModuleSecurityInfo 26 26 from Products.CMFCore.permissions import setDefaultRoles 27 security = ModuleSecurityInfo('Products.WAeUP.WAeUPPermissions')27 #security = ModuleSecurityInfo('Products.WAeUP.WAeUPPermissions') 28 28 29 # - ' University Manage' : Permission you need to manage a University29 # - 'Certificat Course delete' : Permission you need to .. 30 30 # 31 security.declarePublic('UniversityManage') 32 UniversityManage = "University Manage" 33 setDefaultRoles(UniversityManage, ('Manager', 34 )) 35 # - 'Student Manage' : Permission you need to manage Students 36 # 37 security.declarePublic('StudentManage') 38 StudentManage = "Student Manage" 39 setDefaultRoles(StudentManage, ('Manager', 40 'UniversityManager', 41 'StudentManager', 42 'FacultyManager', 43 'Owner',)) 44 # - 'Faculty Manage' : Permission you need to manage a Faculty 45 # 46 security.declarePublic('FacultyManage') 47 FacultyManage = "Faculty Manage" 48 setDefaultRoles(FacultyManage, ('Manager', 49 'UniversityManager', 50 'FacultyManager', 51 )) 52 # - 'Department Manage' : Permission you need to manage a Department 53 # 54 security.declarePublic('DepartmentManage') 55 DepartmentManage = "Department Manage" 56 setDefaultRoles(DepartmentManage, ('Manager', 57 'UniversityManager', 58 'FacultyManager', 59 'DepartmentManager', 60 )) 61 # - 'Course Manage' : Permission you need to manage a Department 62 # 63 security.declarePublic('CourseManage') 64 CourseManage = "Course Manage" 65 setDefaultRoles(CourseManage, ('Manager', 66 'UniversityManager', 67 'FacultyManager', 68 'DepartmentManager', 69 'CourseManager', 31 CertificateCourseDelete = "Certificate Course Delete" 32 setDefaultRoles(CertificateCourseDelete, ('Manager', 33 'CourseAdvisor', 70 34 )) 71 35 -
waeup_product/trunk/__init__.py
r238 r256 11 11 from Products.CPSCore.interfaces import ICPSSite 12 12 13 import Products.WAeUP.WAeUPPermissions 13 14 from Products.WAeUP.University import University, addUniversity 14 15 from Products.WAeUP.Accommodation import AccoFolder, addAccoFolder 15 16 from Products.WAeUP.Accommodation import Accommodation, addAccommodation 16 from Products.WAeUP.Academics import SCFolder, addSCFolder 17 from Products.WAeUP.Academics import StudyCourse, addStudyCourse 17 #from Products.WAeUP.Academics import SCFolder, addSCFolder 18 from Products.WAeUP.Academics import Certificate, addCertificate 19 from Products.WAeUP.Academics import CertificateCourse, addCertificateCourse 18 20 from Products.WAeUP.Academics import Faculty, addFaculty 19 21 from Products.WAeUP.Academics import Department, addDepartment 20 22 from Products.WAeUP.Academics import Course, addCourse 21 23 from Products.WAeUP.Academics import CourseTicket, addCourseTicket 24 from Products.WAeUP.Academics import CertificateCourse, addCertificateCourse 22 25 from Products.WAeUP.Students import Student, addStudent 23 26 from Products.WAeUP.Students import StudentPersonal, addStudentPersonal … … 33 36 contentClasses = ( 34 37 University, 35 SCFolder, 36 StudyCourse, 38 #SCFolder, 39 Certificate, 40 CertificateCourse, 37 41 Faculty, 38 42 Department, 39 43 Course, 40 44 CourseTicket, 45 CertificateCourse, 41 46 AccoFolder, 42 47 Accommodation, … … 52 57 contentConstructors = ( 53 58 addUniversity, 54 addSCFolder, 55 addStudyCourse, 59 #addSCFolder, 60 addCertificate, 61 addCertificateCourse, 56 62 addFaculty, 57 63 addDepartment, 58 64 addCourse, 59 65 addCourseTicket, 66 addCertificateCourse, 60 67 addAccoFolder, 61 68 addAccommodation, … … 71 78 fti = ( 72 79 {}, # University 73 {}, #SCFolder 74 {}, #StudyCourse 80 #{}, #SCFolder 81 {}, #Certificate 82 {}, #CertificateCourse 75 83 {}, # Faculty 76 84 {}, # Department 77 85 {}, # Course 78 86 {}, # CourseTicket 87 {}, # CertificateCourse 79 88 {}, # AccoFolder 80 89 {}, # Accommodation -
waeup_product/trunk/exportimport.py
r251 r256 132 132 def loadFacultiesFromCSV(academics,site,context): ###( 133 133 """install Universityspecific Faculies from CSV values""" 134 #return 134 135 logger = context.getLogger('loadfaculties') 136 logger.info('Start loading Faculties') 135 137 faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb")) 138 l = site.portal_catalog({'meta_type': "Faculty"}) 139 facs = {} 140 for f in l: 141 facs[f.id] = f.getObject() 136 142 for faculty in faculties: 137 fid = faculty['FacultyKey'] 138 f = getattr(academics,fid,None) 143 logger.info('processing %(Session)s %(FacultyCode)s %(Description)s %(CollegeCode)s %(FacultyKey)s %(Status)s %(degree_grade)s %(Bankcode)s' % faculty) 144 fid = faculty['FacultyCode'] 145 f = facs.get(fid,None) 139 146 if f is None: 140 147 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 141 logger.info('Creating Faculty %(FacultyKey)s =%(Description)s' % faculty)148 logger.info('Creating Faculty with ID %(FacultyCode)s %(Description)s' % faculty) 142 149 academics.invokeFactory('Faculty', fid) 143 150 f = getattr(academics,fid) 144 145 151 d = {'Title': faculty['Description']} 152 f.getContent().edit(mapping=d) 146 153 ###) 147 154 148 155 def loadDepartmentsFromCSV(academics,site,context): ###( 149 156 """install Universityspecific Faculies from CSV values""" 157 #return 150 158 logger = context.getLogger('loaddepartments') 151 159 deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb")) 160 l = site.portal_catalog({'meta_type': "Faculty"}) 161 facs = {} 162 for f in l: 163 facs[f.id] = f.getObject() 152 164 for dep in deps: 165 logger.info('Processing %(Session)s %(DeptCode)s %(Description)s %(FacultyCode)s' % dep) 153 166 fid = dep['FacultyCode'] 154 f = getattr(academics,fid,None)167 f = facs.get(fid,None) 155 168 if f is None: 156 169 logger.info( "No Faculty with ID: %s" % fid) … … 158 171 did = dep.get('DeptCode') 159 172 d = getattr(f,did,None) 160 if d is None :173 if d is None or d.portal_type == "Faculty": 161 174 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 162 175 logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep) 163 176 f.invokeFactory('Department', did) 164 177 d = getattr(f,did) 165 166 178 dict = {'Title': dep['Description']} 179 d.getContent().edit(mapping=dict) 167 180 ###) 168 181 169 182 def loadCoursesFromCSV(academics,site,context): ###( 170 """install Universityspecific Faculies from CSV values""" 183 """install Universityspecific Courses from CSV values""" 184 #return 171 185 logger = context.getLogger('loadcourses') 172 186 courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb")) 187 l = site.portal_catalog({'meta_type': "Faculty"}) 188 facs = {} 189 for f in l: 190 facs[f.id] = f.getObject() 191 dl = site.portal_catalog({'meta_type': "Department"}) 192 deps = {} 193 for d in dl: 194 deps[d.id] = d.getObject() 195 cl = site.portal_catalog({'meta_type': "Course"}) 196 course_list = [ c.id for c in cl] 173 197 for course in courses: 174 if course.get("FORMERCODE") != '': 175 continue 176 depid = course['Dept'] 177 res = site.portal_catalog({'meta_type': "Department", 178 'id': depid}) 179 if not res: 180 continue 181 dept=res[0].getObject() 198 logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(CourseKey)s %(Category)s %(AdmStatus)s %(FORMERCODE)s' % course) 199 if course.get("FORMERCODE").endswith('BITS'): 200 continue 201 depid = course.get('Dept').upper() 202 if depid in deps.keys(): 203 dept= deps.get(depid) 204 elif depid in facs.keys(): 205 dept= facs.get(depid) 206 else: 207 logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course) 208 continue 182 209 course_id = ''.join(re.split('\W+',course.get('CourseCode'))) 183 if len(course_id) != 6: 210 if len(course_id) == 3: 211 course_id = "%s000" % course_id 212 elif len(course_id) != 6: 184 213 logger.info("invalid course_code %(CourseCode)s" % course) 185 214 #print course_id,course.get('CourseCode'),course.get('Description') 186 215 continue 216 ## if course_id in course_list: 217 ## continue 187 218 c = getattr(dept,course_id,None) 188 219 if c is None: … … 193 224 dict = {'Title': course['Description']} 194 225 dict['code'] = course_id 195 dict['credit'] = course.get('Credits') 196 #dict['level'] = course.get('CourseCode').split()[1][0] 197 dict['level'] = "%c00" % course_id[3] 198 dict['semester'] = "%(Semester)s" % course 226 dict['org_code'] = course.get('CourseCode') 227 dict['credits'] = course.get('Credits') 228 dict['semester'] = course.get('Semester') 229 dict['session'] = course.get('Session') 230 dict['category'] = course.get('Category') 199 231 dict['passmark'] = course.get('PassMark') 200 232 c.getContent().edit(mapping=dict) 233 ###) 234 235 def loadCertificatesFromCSV(site,context): ###( 236 """install Universityspecific Certificates from CSV values""" 237 #return 238 logger = context.getLogger('loadcertificates') 239 certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb")) 240 f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})] 241 #d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 242 dl = site.portal_catalog({'meta_type': "Department"}) 243 deps = {} 244 for d in dl: 245 deps[d.id] = d.getObject() 246 for certificate in certificates: 247 logger.info('Processing %(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' % certificate) 248 depid = certificate.get('Dept') 249 facid = certificate.get('Faculty') 250 if facid not in f_ids: 251 logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate) 252 continue 253 if not deps.has_key(depid): 254 logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate) 255 continue 256 certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate 257 dep = deps[depid] 258 c = getattr(dep,certificate_id,None) 259 if c is None: 260 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 261 logger.info('Creating certificate %(CertCode)s %(Description)s in Department %(Dept)s' % certificate) 262 dep.invokeFactory('Certificate', certificate_id) 263 c = getattr(dep,certificate_id) 264 dict = {'Title': certificate['Description']} 265 code = certificate.get('CertCode') 266 code = code.replace('.','') 267 code = code.replace('(','') 268 code = code.replace(')','') 269 code = code.replace('/','') 270 code = code.replace(' ','') 271 code = code.replace('_','') 272 dict['code'] = code 273 dict['faculty'] = certificate.get('Faculty') 274 dict['department'] = certificate.get('Dept') 275 dict['max_pass'] = certificate.get('MaxPass') 276 dict['max_load'] = certificate.get('MaxLoad') 277 dict['admin_status'] = certificate.get('Admstatus') 278 dict['category'] = certificate.get('category') 279 dict['m_prefix'] = certificate.get('MPREFIX') 280 dict['nr_years'] = int(certificate.get('Nyears')) 281 nc = certificate.get('Ncore','1') 282 try: 283 dict['n_core'] = int(nc) 284 except: 285 dict['n_core'] = 1 286 dict['start_level'] = certificate.get('StartLevel') 287 dict['end_level'] = certificate.get('endLevel') 288 dict['promotion_credits'] = certificate.get('PromotionCredits') 289 dict['probation_credits'] = certificate.get('ProbationCredits') 290 c.getContent().edit(mapping=dict) 291 ###) 292 293 def oldloadCertificatesFromCSV(certfolder,site,context): ###( 294 """install Universityspecific Certificates from CSV values""" 295 logger = context.getLogger('loadcertificates') 296 certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb")) 297 f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})] 298 d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 299 for certificate in certificates: 300 depid = certificate.get('Dept') 301 facid = certificate.get('Faculty') 302 if facid not in f_ids: 303 logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate) 304 continue 305 if depid not in d_ids: 306 logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate) 307 continue 308 certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate 309 c = getattr(certfolder,certificate_id,None) 310 if c is None: 311 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 312 logger.info('Creating certificate %(CertCode)s %(Description)s in Department %(Dept)s' % certificate) 313 certfolder.invokeFactory('Certificate', certificate_id) 314 c = getattr(certfolder,certificate_id) 315 dict = {'Title': certificate['Description']} 316 code = certificate.get('CertCode') 317 code = code.replace('.','') 318 code = code.replace('(','') 319 code = code.replace(')','') 320 code = code.replace('/','') 321 code = code.replace(' ','') 322 code = code.replace('_','') 323 dict['code'] = code 324 dict['faculty'] = certificate.get('Faculty') 325 dict['department'] = certificate.get('Dept') 326 dict['max_pass'] = certificate.get('MaxPass') 327 dict['max_load'] = certificate.get('MaxLoad') 328 dict['admin_status'] = certificate.get('Admstatus') 329 dict['category'] = certificate.get('category') 330 dict['m_prefix'] = certificate.get('MPREFIX') 331 dict['nr_years'] = int(certificate.get('Nyears')) 332 nc = certificate.get('Ncore','1') 333 try: 334 dict['n_core'] = int(nc) 335 except: 336 dict['n_core'] = 1 337 dict['start_level'] = certificate.get('StartLevel') 338 dict['end_level'] = certificate.get('endLevel') 339 dict['promotion_credits'] = certificate.get('PromotionCredits') 340 dict['probation_credits'] = certificate.get('ProbationCredits') 341 c.getContent().edit(mapping=dict) 342 ###) 343 344 def loadCertificateCoursesFromCSV(site,context): ###( 345 """install Certificate Courses from CSV values""" 346 return 347 logger = context.getLogger('loadcertificatecourses') 348 cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb")) 349 d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 350 for cert_course in cert_courses: 351 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) 352 depid = cert_course.get('Dept') 353 code = cert_course.get('CertCode') 354 code = code.replace('.','') 355 code = code.replace('(','') 356 code = code.replace(')','') 357 code = code.replace('/','') 358 code = code.replace(' ','') 359 code = code.replace('_','') 360 if cert_course.get('Session') != '2002/2003': 361 continue 362 certificate = site.portal_catalog({'meta_type': "Certificate", 363 'SearchableText': code}) 364 if not certificate: 365 print code 366 logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course) 367 continue 368 certificate = certificate[-1].getObject() 369 certificate_code = certificate.getId() 370 if depid not in d_ids: 371 logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course) 372 continue 373 course_code = cert_course.get('CosCode') 374 level = cert_course.get('Level') 375 l = getattr(certificate,level,None) 376 if l is None: 377 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 378 logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course) 379 certificate.invokeFactory('StudyLevel', level) 380 l = getattr(certificate, level) 381 l.invokeFactory('Semester','first') 382 l.invokeFactory('Semester','second') 383 first_s = getattr(l,'first') 384 second_s = getattr(l,'second') 385 if cert_course.get('Semester') == '1': 386 semester = first_s 387 else: 388 semester = second_s 389 if hasattr(semester,course_code): 390 logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 391 continue 392 393 semester.invokeFactory('CertificateCourse',course_code) 394 cc = getattr(semester,course_code) 395 dict = {} 396 dict['code'] = cert_course.get('CosCode') 397 dict['certificate_code'] = code 398 dict['certificate_code_org'] = cert_course.get('CertCode') 399 dict['department'] = cert_course.get('Dept') 400 dict['admin_status'] = cert_course.get('Admstatus') 401 dict['session'] = cert_course.get('Session') 402 if cert_course.get('Core') != '': 403 dict['core_or_elective'] = True 404 else: 405 dict['core_or_elective'] = False 406 dict['level'] = cert_course.get('Level') 407 cc.getContent().edit(mapping=dict) 408 ###) 409 410 def old_loadCertificateCoursesFromCSV(certfolder,site,context): ###( 411 """install Certificate Courses from CSV values""" 412 return 413 logger = context.getLogger('loadcertificatecourses') 414 cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb")) 415 d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 416 for cert_course in cert_courses: 417 depid = cert_course.get('Dept') 418 code = cert_course.get('CertCode') 419 code = code.replace('.','') 420 code = code.replace('(','') 421 code = code.replace(')','') 422 code = code.replace('/','') 423 code = code.replace(' ','') 424 code = code.replace('_','') 425 if cert_course.get('Session') != '2002/2003': 426 continue 427 certificate = site.portal_catalog({'meta_type': "Certificate", 428 'SearchableText': code}) 429 if not certificate: 430 print code 431 logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course) 432 continue 433 certificate = certificate[-1].getObject() 434 certificate_code = certificate.getId() 435 if depid not in d_ids: 436 logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course) 437 continue 438 course_code = cert_course.get('CosCode') 439 level = cert_course.get('Level') 440 l = getattr(certificate,level,None) 441 if l is None: 442 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 443 logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course) 444 certificate.invokeFactory('StudyLevel', level) 445 l = getattr(certificate, level) 446 l.invokeFactory('Semester','first') 447 l.invokeFactory('Semester','second') 448 first_s = getattr(l,'first') 449 second_s = getattr(l,'second') 450 if cert_course.get('Semester') == '1': 451 semester = first_s 452 else: 453 semester = second_s 454 if hasattr(semester,course_code): 455 logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 456 continue 457 458 semester.invokeFactory('CertificateCourse',course_code) 459 cc = getattr(semester,course_code) 460 dict = {} 461 dict['code'] = cert_course.get('CosCode') 462 dict['certificate_code'] = code 463 dict['certificate_code_org'] = cert_course.get('CertCode') 464 dict['department'] = cert_course.get('Dept') 465 dict['admin_status'] = cert_course.get('Admstatus') 466 dict['session'] = cert_course.get('Session') 467 if cert_course.get('Core') != '': 468 dict['core_or_elective'] = True 469 else: 470 dict['core_or_elective'] = False 471 dict['level'] = cert_course.get('Level') 472 cc.getContent().edit(mapping=dict) 201 473 ###) 202 474 … … 221 493 loadDepartmentsFromCSV(academics,site,context) 222 494 loadCoursesFromCSV(academics,site,context) 223 studycourses = getattr(academics,'studycourses',None) 224 if studycourses is None: 225 academics.invokeFactory('SCFolder','studycourses') 226 studycourses = getattr(academics,'studycourses') 227 studycourses.getContent().edit(mapping={'Title':'Studycourses'}) 228 installFaculties(academics) 495 ## certificates = getattr(academics,'certificates',None) 496 ## if certificates is None: 497 ## academics.invokeFactory('SCFolder','certificates') 498 ## certificates = getattr(academics,'certificates') 499 ## certificates.getContent().edit(mapping={'Title':'Certificates'}) 500 loadCertificatesFromCSV(site,context) 501 loadCertificateCoursesFromCSV(site,context) 229 502 if not hasattr(portal,'accommodation'): 230 503 portal.invokeFactory('AccoFolder','accommodation') -
waeup_product/trunk/profiles/default/layouts.xml
r238 r256 8 8 <object name="admission_slip" meta_type="CPS Layout"/> 9 9 <object name="admission_status" meta_type="CPS Layout"/> 10 <object name="certificate" meta_type="CPS Layout"/> 11 <object name="certificate_course" meta_type="CPS Layout"/> 10 12 <object name="clearance" meta_type="CPS Layout"/> 11 13 <object name="clearence" meta_type="CPS Layout"/> … … 24 26 <object name="student_semester" meta_type="CPS Layout"/> 25 27 <object name="study_level" meta_type="CPS Layout"/> 26 <object name="studycourse" meta_type="CPS Layout"/>27 28 <object name="university" meta_type="CPS Layout"/> 28 29 <object name="waeup_common" meta_type="CPS Layout"/> -
waeup_product/trunk/profiles/default/layouts/certificate.xml
r250 r256 1 1 <?xml version="1.0"?> 2 <object name=" studycourse" meta_type="CPS Layout">2 <object name="certificate" meta_type="CPS Layout"> 3 3 <property name="layout_create_method"></property> 4 4 <property name="layout_edit_method"></property> … … 7 7 <property name="flexible_widgets"/> 8 8 <property name="validate_values_expr"></property> 9 <widget name="admin_status" meta_type="String Widget"> 10 <property name="title">Admin Status</property> 11 <property name="fields"> 12 <element value="admin_status"/> 13 </property> 14 <property name="label">Admin Status</property> 15 <property name="label_edit">Admin Status</property> 16 <property name="readonly_layout_modes"/> 17 <property name="hidden_layout_modes"/> 18 <property name="hidden_readonly_layout_modes"/> 19 </widget> 20 <widget name="category" meta_type="String Widget"> 21 <property name="title">Category</property> 22 <property name="fields"> 23 <element value="category"/> 24 </property> 25 <property name="label">Category</property> 26 <property name="label_edit">Category</property> 27 <property name="readonly_layout_modes"/> 28 <property name="hidden_layout_modes"/> 29 <property name="hidden_readonly_layout_modes"/> 30 </widget> 9 31 <widget name="code" meta_type="String Widget"> 10 32 <property name="title">Code</property> … … 18 40 <property name="hidden_layout_modes"/> 19 41 <property name="hidden_readonly_layout_modes"/> 20 <property name="display_width">6</property> 21 <property name="size_max">6</property> 42 <property name="size_max">20</property> 22 43 </widget> 23 44 <widget name="department" meta_type="Select Widget"> … … 32 53 <property name="hidden_layout_modes"/> 33 54 <property name="hidden_readonly_layout_modes"/> 55 <property name="vocabulary">get_departments_voc</property> 56 </widget> 57 <widget name="end_level" meta_type="Select Widget"> 58 <property name="title">End Level</property> 59 <property name="fields"> 60 <element value="end_level"/> 61 </property> 62 <property name="label">End Level</property> 63 <property name="label_edit">End Level</property> 64 <property name="readonly_layout_modes"/> 65 <property name="hidden_layout_modes"/> 66 <property name="hidden_readonly_layout_modes"/> 67 <property name="vocabulary">courselevel</property> 34 68 </widget> 35 69 <widget name="faculty" meta_type="Select Widget"> … … 44 78 <property name="hidden_layout_modes"/> 45 79 <property name="hidden_readonly_layout_modes"/> 80 <property name="vocabulary">get_faculties_voc</property> 81 </widget> 82 <widget name="heading" meta_type="String Widget"> 83 <property name="title">Heading</property> 84 <property name="fields"> 85 <element value="heading"/> 86 </property> 87 <property name="label">Title</property> 88 <property name="label_edit">Title</property> 89 <property name="readonly_layout_modes"/> 90 <property name="hidden_layout_modes"/> 91 <property name="hidden_readonly_layout_modes"/> 92 </widget> 93 <widget name="m_prefix" meta_type="String Widget"> 94 <property name="title">MPrefix</property> 95 <property name="fields"> 96 <element value="m_prefix"/> 97 </property> 98 <property name="label">MPrefix</property> 99 <property name="label_edit">MPrefix</property> 100 <property name="readonly_layout_modes"/> 101 <property name="hidden_layout_modes"/> 102 <property name="hidden_readonly_layout_modes"/> 46 103 </widget> 47 104 <widget name="max_load" meta_type="Int Widget"> … … 69 126 <property name="hidden_readonly_layout_modes"/> 70 127 </widget> 71 <widget name="nr_of_levels" meta_type="Int Widget"> 72 <property name="title">Nr of Levels</property> 73 <property name="fields"> 74 <element value="nr_of_levels"/> 75 </property> 76 <property name="is_required">True</property> 77 <property name="label">Nr of Levels</property> 78 <property name="label_edit">Nr of Levels</property> 79 <property name="readonly_layout_modes"/> 80 <property name="hidden_layout_modes"/> 81 <property name="hidden_readonly_layout_modes"/> 128 <widget name="n_core" meta_type="Int Widget"> 129 <property name="title">NCore</property> 130 <property name="fields"> 131 <element value="n_core"/> 132 </property> 133 <property name="label">NCore</property> 134 <property name="label_edit">NCore</property> 135 <property name="readonly_layout_modes"/> 136 <property name="hidden_layout_modes"/> 137 <property name="hidden_readonly_layout_modes"/> 138 </widget> 139 <widget name="nr_years" meta_type="Int Widget"> 140 <property name="title">Nr of Years</property> 141 <property name="fields"> 142 <element value="nr_years"/> 143 </property> 144 <property name="label">Nr of Years</property> 145 <property name="label_edit">Nr of Years</property> 146 <property name="readonly_layout_modes"/> 147 <property name="hidden_layout_modes"/> 148 <property name="hidden_readonly_layout_modes"/> 149 </widget> 150 <widget name="probation_credits" meta_type="Int Widget"> 151 <property name="title">Probation Credits</property> 152 <property name="fields"> 153 <element value="probation_credits"/> 154 </property> 155 <property name="label">Probation Credits</property> 156 <property name="label_edit">Probation Credits</property> 157 <property name="readonly_layout_modes"/> 158 <property name="hidden_layout_modes"/> 159 <property name="hidden_readonly_layout_modes"/> 160 </widget> 161 <widget name="promotion_credits" meta_type="Int Widget"> 162 <property name="title">Promotion Credits</property> 163 <property name="fields"> 164 <element value="promotion_credits"/> 165 </property> 166 <property name="label">Promotion Credits</property> 167 <property name="label_edit">Promotion Credits</property> 168 <property name="readonly_layout_modes"/> 169 <property name="hidden_layout_modes"/> 170 <property name="hidden_readonly_layout_modes"/> 171 </widget> 172 <widget name="start_level" meta_type="Select Widget"> 173 <property name="title">Start Level</property> 174 <property name="fields"> 175 <element value="start_level"/> 176 </property> 177 <property name="label">Start Level</property> 178 <property name="label_edit">Start Level</property> 179 <property name="readonly_layout_modes"/> 180 <property name="hidden_layout_modes"/> 181 <property name="hidden_readonly_layout_modes"/> 182 <property name="vocabulary">courselevel</property> 82 183 </widget> 83 184 <table> … … 92 193 </row> 93 194 <row> 94 <cell name=" nr_of_levels"/>95 </row> 96 <row> 97 <cell name=" max_load"/>195 <cell name="start_level"/> 196 </row> 197 <row> 198 <cell name="end_level"/> 98 199 </row> 99 200 <row> 100 201 <cell name="max_pass"/> 202 </row> 203 <row> 204 <cell name="promotion_credits"/> 205 </row> 206 <row> 207 <cell name="probation_credits"/> 208 </row> 209 <row> 210 <cell name="admin_status"/> 211 </row> 212 <row> 213 <cell name="category"/> 214 </row> 215 <row> 216 <cell name="m_prefix"/> 217 </row> 218 <row> 219 <cell name="nr_years"/> 220 </row> 221 <row> 222 <cell name="n_core"/> 101 223 </row> 102 224 </table> -
waeup_product/trunk/profiles/default/layouts/course.xml
r238 r256 7 7 <property name="flexible_widgets"/> 8 8 <property name="validate_values_expr"></property> 9 <widget name="category" meta_type="String Widget"> 10 <property name="title">Category</property> 11 <property name="fields"> 12 <element value="category"/> 13 </property> 14 <property name="label">Category</property> 15 <property name="label_edit">Category</property> 16 <property name="readonly_layout_modes"/> 17 <property name="hidden_layout_modes"/> 18 <property name="hidden_readonly_layout_modes"/> 19 </widget> 9 20 <widget name="code" meta_type="String Widget"> 10 21 <property name="title">Code</property> … … 17 28 <property name="display_width">10</property> 18 29 </widget> 19 <widget name="core_elective" meta_type="Boolean Widget"> 30 <widget name="credits" meta_type="Int Widget"> 31 <property name="title">Credits</property> 20 32 <property name="fields"> 21 <element value="c ore_elective"/>33 <element value="credits"/> 22 34 </property> 23 <property name=" is_required">True</property>24 <property name="label ">Core or elective</property>25 <property name=" label_edit">Core or elective</property>26 <property name=" label_false">Elective Course</property>27 <property name=" label_true">Core Course</property>35 <property name="label">Credits</property> 36 <property name="label_edit">Credits</property> 37 <property name="readonly_layout_modes"/> 38 <property name="hidden_layout_modes"/> 39 <property name="hidden_readonly_layout_modes"/> 28 40 </widget> 29 <widget name="credit" meta_type="Int Widget"> 41 <widget name="org_code" meta_type="String Widget"> 42 <property name="title">Original Code</property> 30 43 <property name="fields"> 31 <element value=" credit"/>44 <element value="org_code"/> 32 45 </property> 33 <property name="is_required">True</property> 34 <property name="label">Credit</property> 35 <property name="label_edit">Credit</property> 36 </widget> 37 <widget name="level" meta_type="Select Widget"> 38 <property name="fields"> 39 <element value="level"/> 40 </property> 41 <property name="is_required">True</property> 42 <property name="label">Level</property> 43 <property name="label_edit">Level</property> 44 <property name="vocabulary">courselevel</property> 46 <property name="label">Original Code</property> 47 <property name="label_edit">Original Code</property> 48 <property name="readonly_layout_modes"/> 49 <property name="hidden_layout_modes"/> 50 <property name="hidden_readonly_layout_modes"/> 45 51 </widget> 46 52 <widget name="passmark" meta_type="Int Widget"> 53 <property name="title">Passmark</property> 47 54 <property name="fields"> 48 55 <element value="passmark"/> … … 55 62 <property name="hidden_readonly_layout_modes"/> 56 63 </widget> 57 <widget name="semester" meta_type=" Select Widget">58 <property name="title"> Semester</property>64 <widget name="semester" meta_type="Int Widget"> 65 <property name="title">Nr of semesters</property> 59 66 <property name="fields"> 60 67 <element value="semester"/> 61 68 </property> 62 <property name="label"> Semester</property>63 <property name="label_edit"> Semester</property>69 <property name="label">Nr of semesters</property> 70 <property name="label_edit">Nr of semesters</property> 64 71 <property name="readonly_layout_modes"/> 65 72 <property name="hidden_layout_modes"/> 66 73 <property name="hidden_readonly_layout_modes"/> 67 <property name="vocabulary">semester_voc</property>68 </widget>69 <widget name="text" meta_type="Text Widget">70 <property name="fields">71 <element value="text"/>72 </property>73 <property name="label">Text</property>74 <property name="label_edit">Text</property>75 <property name="help">Short Description</property>76 <property name="is_i18n">True</property>77 <property name="hidden_layout_modes"/>78 <property name="css_class">description</property>79 <property name="width">72</property>80 74 </widget> 81 75 <table> 82 <row>83 <cell name="heading"/>84 </row>85 <row>86 <cell name="text"/>87 </row>88 <row>89 <cell name="level"/>90 </row>91 76 <row> 92 77 <cell name="code"/> 93 78 </row> 94 79 <row> 95 <cell name=" semester"/>80 <cell name="org_code"/> 96 81 </row> 97 82 <row> 98 <cell name="c redit"/>83 <cell name="category"/> 99 84 </row> 100 85 <row> 101 <cell name="core_elective"/> 86 <cell name="credits"/> 87 </row> 88 <row> 89 <cell name="semester"/> 102 90 </row> 103 91 <row> -
waeup_product/trunk/profiles/default/rolemap.xml
r199 r256 2 2 <rolemap> 3 3 <roles> 4 <role name="Anonymous"/> 5 <role name="AttendeeManager"/> 6 <role name="AttendeeReader"/> 7 <role name="Authenticated"/> 8 <role name="ChatGuest"/> 9 <role name="ChatModerator"/> 10 <role name="ChatPoster"/> 11 <role name="Contributor"/> 12 <role name="CourseManager"/> 13 <role name="DepartmentManager"/> 14 <role name="EventOrganizer"/> 15 <role name="EventParticipant"/> 16 <role name="EventReader"/> 17 <role name="FacultyManager"/> 18 <role name="ForumModerator"/> 19 <role name="ForumPoster"/> 20 <role name="Manager"/> 21 <role name="Member"/> 22 <role name="Owner"/> 23 <role name="Reader"/> 24 <role name="Reviewer"/> 25 <role name="SectionIntermediateReviewer"/> 26 <role name="SectionManager"/> 27 <role name="SectionReader"/> 28 <role name="SectionReviewer"/> 4 <role name="CourseAdvisor"/> 5 <role name="Lecturer"/> 29 6 <role name="Student"/> 30 <role name="StudentManager"/>31 <role name="ThemeManager"/>32 <role name="UniversityManager"/>33 <role name="WorkspaceManager"/>34 <role name="WorkspaceMember"/>35 <role name="WorkspaceReader"/>36 7 </roles> 37 8 <permissions> 38 <permission name=" Access future portal content"9 <permission name="Certificate Course Delete" 39 10 acquire="True"> 40 <role name=" Reviewer"/>11 <role name="Owner"/> 41 12 <role name="Manager"/> 13 <role name="SectionManager"/> 14 <role name="CourseAdvisor"/> 42 15 </permission> 43 16 <permission name="Add portal content" acquire="True"> 44 17 <role name="Owner"/> 45 18 <role name="Manager"/> 19 <role name="Student"/> 46 20 </permission> 47 21 <permission name="Add portal folders" acquire="True"> 48 22 <role name="Owner"/> 49 23 <role name="Manager"/> 50 </permission> 51 <permission name="Can subscribe" acquire="False"> 52 <role name="Manager"/> 53 </permission> 54 <permission name="Chat Moderate" acquire="False"> 55 <role name="Manager"/> 56 <role name="WorkspaceManager"/> 57 <role name="SectionManager"/> 58 <role name="ChatModerator"/> 59 </permission> 60 <permission name="Chat Post" acquire="False"> 61 <role name="Manager"/> 62 <role name="WorkspaceManager"/> 63 <role name="SectionManager"/> 64 <role name="ChatPoster"/> 65 </permission> 66 <permission name="Chat Reply" acquire="False"> 67 <role name="Manager"/> 68 <role name="WorkspaceManager"/> 69 <role name="SectionManager"/> 70 <role name="ChatModerator"/> 71 <role name="ChatGuest"/> 72 </permission> 73 <permission name="Create events" acquire="True"> 74 <role name="AttendeeManager"/> 75 <role name="Manager"/> 76 <role name="Owner"/> 77 <role name="WorkspaceManager"/> 24 <role name="Student"/> 78 25 </permission> 79 26 <permission name="Delete objects" acquire="True"> … … 81 28 <role name="Manager"/> 82 29 </permission> 83 <permission name="Edit calendar" acquire="True">84 <role name="AttendeeManager"/>85 <role name="Manager"/>86 <role name="Owner"/>87 <role name="WorkspaceManager"/>88 </permission>89 <permission name="FTP access" acquire="True">90 <role name="Owner"/>91 <role name="Manager"/>92 </permission>93 <permission name="Forum Moderate" acquire="False">94 <role name="Manager"/>95 <role name="Owner"/>96 <role name="WorkspaceManager"/>97 <role name="ForumModerator"/>98 <role name="SectionManager"/>99 <role name="SectionReviewer"/>100 </permission>101 <permission name="Forum Post" acquire="False">102 <role name="Manager"/>103 <role name="Owner"/>104 <role name="Member"/>105 <role name="WorkspaceManager"/>106 <role name="WorkspaceMember"/>107 <role name="WorkspaceReader"/>108 <role name="ForumPoster"/>109 <role name="SectionManager"/>110 <role name="SectionReviewer"/>111 <role name="SectionReader"/>112 </permission>113 <permission name="Forum manage comments" acquire="False">114 <role name="Manager"/>115 <role name="Owner"/>116 <role name="WorkspaceManager"/>117 <role name="SectionManager"/>118 <role name="SectionReviewer"/>119 </permission>120 <permission name="Invite attendees" acquire="True">121 <role name="EventOrganizer"/>122 <role name="EventParticipant"/>123 <role name="Manager"/>124 </permission>125 <permission name="List portal members" acquire="True">126 <role name="Member"/>127 <role name="Manager"/>128 </permission>129 <permission name="List undoable changes" acquire="True">130 <role name="Member"/>131 <role name="Manager"/>132 </permission>133 <permission name="Manage Portlets" acquire="False">134 <role name="Manager"/>135 <role name="Owner"/>136 </permission>137 <permission name="Manage Subscriptions" acquire="False">138 <role name="Manager"/>139 </permission>140 <permission name="Manage participation status"141 acquire="True">142 <role name="AttendeeManager"/>143 <role name="Manager"/>144 <role name="Owner"/>145 <role name="WorkspaceManager"/>146 </permission>147 <permission name="Manage properties" acquire="True">148 <role name="Owner"/>149 <role name="Manager"/>150 </permission>151 <permission name="Modify event" acquire="True">152 <role name="EventOrganizer"/>153 <role name="Manager"/>154 </permission>155 <permission name="Reply to item" acquire="True">156 <role name="Member"/>157 <role name="Manager"/>158 </permission>159 <permission name="Review portal content" acquire="True">160 <role name="Reviewer"/>161 <role name="Manager"/>162 </permission>163 <permission name="Set own password" acquire="True">164 <role name="Member"/>165 <role name="Manager"/>166 </permission>167 <permission name="Set own properties" acquire="True">168 <role name="Member"/>169 <role name="Manager"/>170 </permission>171 <permission name="Undo changes" acquire="True">172 <role name="Owner"/>173 <role name="Manager"/>174 </permission>175 <permission name="Use external editor" acquire="False">176 <role name="Manager"/>177 <role name="Member"/>178 </permission>179 <permission name="View My Subscriptions" acquire="False">180 <role name="Manager"/>181 <role name="Member"/>182 </permission>183 <permission name="View calendar" acquire="True">184 <role name="AttendeeManager"/>185 <role name="AttendeeReader"/>186 <role name="Manager"/>187 <role name="Owner"/>188 <role name="WorkspaceReader"/>189 <role name="WorkspaceManager"/>190 </permission>191 <permission name="View management screens"192 acquire="True">193 <role name="Owner"/>194 <role name="Manager"/>195 </permission>196 30 </permissions> 197 31 </rolemap> -
waeup_product/trunk/profiles/default/schemas.xml
r238 r256 4 4 <object name="academics" meta_type="CPS Schema"/> 5 5 <object name="accommodation" meta_type="CPS Schema"/> 6 <object name="certificate" meta_type="CPS Schema"/> 7 <object name="certificate_course" meta_type="CPS Schema"/> 6 8 <object name="course" meta_type="CPS Schema"/> 7 9 <object name="course_results" meta_type="CPS Schema"/> … … 21 23 <object name="student_schoolresults" meta_type="CPS Schema"/> 22 24 <object name="students" meta_type="CPS Schema"/> 23 <object name="studycourse" meta_type="CPS Schema"/>24 25 <object name="study_level" meta_type="CPS Schema"/> 25 26 <object name="university" meta_type="CPS Schema"/> -
waeup_product/trunk/profiles/default/schemas/certificate.xml
r250 r256 1 1 <?xml version="1.0"?> 2 <object name="studycourse" meta_type="CPS Schema"> 2 <object name="certificate" meta_type="CPS Schema"> 3 <field name="admin_status" meta_type="CPS String Field"/> 4 <field name="category" meta_type="CPS String Field"/> 3 5 <field name="code" meta_type="CPS String Field"> 4 6 <property name="is_searchabletext">True</property> 5 7 </field> 6 8 <field name="department" meta_type="CPS String Field"/> 9 <field name="end_level" meta_type="CPS String Field"/> 7 10 <field name="faculty" meta_type="CPS String Field"/> 8 11 <field name="heading" meta_type="CPS String Field"/> 9 <field name="max_load" meta_type="CPS Int Field"/> 12 <field name="m_prefix" meta_type="CPS String Field"/> 13 <field name="max_load" meta_type="CPS Int Field"/> 10 14 <field name="max_pass" meta_type="CPS Int Field"/> 11 <field name="nr_of_levels" meta_type="CPS Int Field"/> 15 <field name="n_core" meta_type="CPS Int Field"/> 16 <field name="nr_years" meta_type="CPS Int Field"/> 17 <field name="probation_credits" meta_type="CPS Int Field"/> 18 <field name="promotion_credits" meta_type="CPS Int Field"/> 19 <field name="start_level" meta_type="CPS String Field"/> 12 20 </object> -
waeup_product/trunk/profiles/default/schemas/course.xml
r238 r256 1 1 <?xml version="1.0"?> 2 2 <object name="course" meta_type="CPS Schema"> 3 <field name="category" meta_type="CPS String Field"/> 3 4 <field name="code" meta_type="CPS String Field"> 4 5 <property name="is_searchabletext">True</property> 5 6 </field> 6 <field name="core_elective" meta_type="CPS Boolean Field"> 7 <property name="default_expr">python:True</property> 8 </field> 9 <field name="credit" meta_type="CPS Int Field"> 10 <property name="default_expr">string:</property> 11 </field> 12 <field name="level" meta_type="CPS String Field"> 7 <field name="credits" meta_type="CPS Int Field"/> 8 <field name="org_code" meta_type="CPS String Field"> 13 9 <property name="is_searchabletext">True</property> 14 10 </field> … … 16 12 <property name="default_expr">python:40</property> 17 13 </field> 18 <field name="semester" meta_type="CPS String Field"/> 19 <field name="text" meta_type="CPS String Field"> 20 <property name="is_searchabletext">True</property> 21 </field> 14 <field name="semester" meta_type="CPS Int Field"/> 15 <field name="session" meta_type="CPS String Field"/> 22 16 </object> 23 -
waeup_product/trunk/profiles/default/types.xml
r238 r256 5 5 <object name="AccoFolder" meta_type="CPS Flexible Type Information"/> 6 6 <object name="Accommodation" meta_type="CPS Flexible Type Information"/> 7 <object name="Certificate" meta_type="CPS Flexible Type Information"/> 7 8 <object name="Course" meta_type="CPS Flexible Type Information"/> 9 <object name="CertificateCourse" meta_type="CPS Flexible Type Information"/> 8 10 <object name="CourseTicket" meta_type="CPS Flexible Type Information"/> 9 11 <object name="Department" meta_type="CPS Flexible Type Information"/> … … 13 15 <object name="Semester" meta_type="CPS Flexible Type Information"/> 14 16 <object name="SCFolder" meta_type="CPS Flexible Type Information"/> 15 <object name="StudyCourse" meta_type="CPS Flexible Type Information"/>16 17 <object name="Student" meta_type="CPS Flexible Type Information"/> 17 18 <object name="StudentDocuments" meta_type="CPS Flexible Type Information"/> -
waeup_product/trunk/profiles/default/types/Certificate.xml
r250 r256 1 1 <?xml version="1.0"?> 2 <object name=" StudyCourse" meta_type="CPS Flexible Type Information"2 <object name="Certificate" meta_type="CPS Flexible Type Information" 3 3 xmlns:i18n="http://xml.zope.org/namespaces/i18n"> 4 <property name="title">WAeUP StudyCourse</property>4 <property name="title">WAeUP Certificate</property> 5 5 <property name="description"></property> 6 6 <property name="content_icon"></property> 7 <property name="content_meta_type"> StudyCourse</property>7 <property name="content_meta_type">Certificate</property> 8 8 <property name="product">WAeUP</property> 9 <property name="factory">add StudyCourse</property>9 <property name="factory">addCertificate</property> 10 10 <property name="immediate_view">folder_view</property> 11 11 <property name="global_allow">True</property> 12 12 <property name="filter_content_types">True</property> 13 <property name="allowed_content_types"> 14 <element value="CertificateCourse"/> 15 <element value="Semester"/> 16 <element value="StudyLevel"/> 17 </property> 13 18 <property name="allow_discussion">False</property> 14 19 <property name="cps_is_searchable">True</property> … … 18 23 <element value="metadata"/> 19 24 <element value="common"/> 20 <element value=" studycourse"/>25 <element value="certificate"/> 21 26 </property> 22 27 <property name="layouts"> 23 <element value=" studycourse"/>28 <element value="certificate"/> 24 29 </property> 25 30 <property name="layout_clusters"> … … 43 48 <action title="action_metadata" action_id="metadata" category="object" 44 49 condition_expr="python:member and 'Manager' in member.getRoles()" 45 url_expr="string:${object_url}/cpsdocument_metadata" visible=" True">50 url_expr="string:${object_url}/cpsdocument_metadata" visible="False"> 46 51 <permission value="Modify portal content"/> 47 52 </action> 48 53 <action title="delegate" action_id="localroles" category="object" 49 54 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 50 visible=" False">55 visible="True"> 51 56 <permission value="Modify portal content"/> 52 57 </action> 58 <action title="action_folder_contents" action_id="contents" category="object" 59 condition_expr="" url_expr="string:${object/absolute_url}/folder_contents" 60 visible="True"/> 53 61 </object> -
waeup_product/trunk/profiles/default/types/Department.xml
r238 r256 12 12 <property name="filter_content_types">True</property> 13 13 <property name="allowed_content_types"> 14 <element value="Certificate"/> 14 15 <element value="Course"/> 15 <element value="Student"/>16 16 </property> 17 17 <property name="allow_discussion">False</property> -
waeup_product/trunk/profiles/default/types/SCFolder.xml
r238 r256 12 12 <property name="filter_content_types">True</property> 13 13 <property name="allowed_content_types"> 14 <element value=" StudyCourse"/>14 <element value="Certificate"/> 15 15 </property> 16 16 <property name="allow_discussion">False</property> … … 40 40 <permission value="View"/> 41 41 </action> 42 <action title="Add StudyCourse" action_id="add_studycourse" category="object"42 <action title="Add Certificate" action_id="add_certificate" category="object" 43 43 condition_expr="python:True or member and 'UniversityManager'in member.getRoles()" 44 url_expr="string:${object/absolute_url}/create_studycourse" 45 visible="True"> 46 <permission value="University Manage"/> 47 </action> 44 url_expr="string:${object/absolute_url}/create_certificate" 45 visible="True"/> 48 46 <action title="action_folder_contents" action_id="contents" category="object" 49 47 condition_expr="" url_expr="string:${object/absolute_url}/folder_contents" 50 visible="True"> 51 <permission value="University Manage"/> 52 </action> 48 visible="True"/> 53 49 <action title="delegate" action_id="localroles" category="object" 54 50 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 55 visible="False"> 56 <permission value="University Manage"/> 57 </action> 51 visible="False"/> 58 52 </object> -
waeup_product/trunk/profiles/default/types/Semester.xml
r199 r256 23 23 </property> 24 24 <property name="layouts"> 25 <element value=" student_semester"/>25 <element value="waeup_common"/> 26 26 </property> 27 27 <property name="layout_clusters"> -
waeup_product/trunk/profiles/default/types/StudyLevel.xml
r199 r256 34 34 <alias from="view" to="temporary_view_all"/> 35 35 <action title="Standard View" action_id="view" category="object" 36 condition_expr="" url_expr="string:${object_url}/ temporary_view_all"36 condition_expr="" url_expr="string:${object_url}/level_view" 37 37 visible="True"> 38 38 <permission value="View"/> … … 41 41 category="object" 42 42 condition_expr="python:member and 'Student'in member.getRoles()" 43 url_expr="string:${object_url}/register_level" visible="True"> 44 <permission value="Student Manage"/> 45 </action> 43 url_expr="string:${object_url}/register_level" visible="True"/> 46 44 <action title="action_metadata" action_id="metadata" category="object" 47 45 condition_expr="python:member and 'Manager' in member.getRoles()" 48 url_expr="string:${object_url}/cpsdocument_metadata" visible="True"> 49 <permission value="University Manage"/> 50 </action> 46 url_expr="string:${object_url}/cpsdocument_metadata" visible="True"/> 51 47 <action title="delegate" action_id="localroles" category="object" 52 48 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 53 visible="False"> 54 <permission value="University Manage"/> 55 </action> 49 visible="False"/> 56 50 </object> -
waeup_product/trunk/profiles/default/workflows.xml
r240 r256 18 18 <object name="waeup_accommodation_wf" meta_type="CPS Workflow"/> 19 19 <object name="waeup_base_wf" meta_type="CPS Workflow"/> 20 <object name="waeup_certificate_wf" meta_type="CPS Workflow"/> 20 21 <object name="waeup_course_wf" meta_type="CPS Workflow"/> 21 22 <object name="waeup_department_wf" meta_type="CPS Workflow"/> … … 23 24 <object name="waeup_section_wf" meta_type="CPS Workflow"/> 24 25 <object name="waeup_student_wf" meta_type="CPS Workflow"/> 25 <object name="waeup_studycourse_wf" meta_type="CPS Workflow"/>26 26 <object name="waeup_workspace_wf" meta_type="CPS Workflow"/> 27 27 <object name="workspace_calendar_wf" meta_type="CPS Workflow"/> … … 41 41 <type type_id="Accommodation"> 42 42 <bound-workflow workflow_id="waeup_accommodation_wf"/> 43 </type> 44 <type type_id="Certificate"> 45 <bound-workflow workflow_id="waeup_certificate_wf"/> 46 </type> 47 <type type_id="CertificateCourse"> 48 <bound-workflow workflow_id="waeup_certificate_wf"/> 43 49 </type> 44 50 <type type_id="CPS Calendar"> … … 90 96 <bound-workflow workflow_id="section_folder_wf"/> 91 97 </type> 92 <type type_id="StudyCourse">93 <bound-workflow workflow_id="waeup_studycourse_wf"/>94 </type>95 98 <type type_id="StudyLevel"> 96 99 <bound-workflow workflow_id="waeup_base_wf"/> -
waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt
r238 r256 42 42 <a href="xxx" 43 43 tal:attributes="href item/absolute_url" 44 tal:content="item/ title_or_id"></a>44 tal:content="item/id"></a> <span tal:content="item/title_or_id" tal:omit-tag="" /> 45 45 </i> 46 46 </td> -
waeup_product/trunk/skins/waeup_faculty/create_certificate.py
r250 r256 5 5 6 6 """ 7 type_name = ' StudyCourse'7 type_name = 'Certificate' 8 8 REQUEST.set('type_name',type_name) 9 9 … … 16 16 lt = context.portal_layouts 17 17 18 res,psm,ds = lt.renderLayout(layout_id= ' studycourse',19 schema_id = ' studycourse',18 res,psm,ds = lt.renderLayout(layout_id= 'certificate', 19 schema_id = 'certificate', 20 20 context=context, 21 21 mapping=validate and REQUEST, 22 22 ob={}, 23 23 layout_mode='create', 24 create_action = 'create_ studycourse',24 create_action = 'create_certificate', 25 25 ) 26 26 if psm == 'invalid': -
waeup_product/trunk/skins/waeup_faculty/get_departments_voc.py
r182 r256 6 6 """ 7 7 #academics = context.sections.portal.academics 8 academics = context.portal_catalog(id = 'academics')[0].getObject()9 faculties = [f for f in context.filterContents(items=academics.contentValues()) if f.portal_type == 'Faculty']8 #academics = context.portal_catalog(id = 'academics')[0].getObject() 9 #faculties = [f for f in context.filterContents(items=academics.contentValues()) if f.portal_type == 'Faculty'] 10 10 11 deplist = [] 12 for faculty in faculties: 13 departments = [d for d in context.filterContents(items=faculty.contentValues()) if d.portal_type == 'Department'] 14 deplist.extend(departments) 15 if not key: 16 return [(d.getId(),d.title_or_id(),) for d in deplist] 17 return [d.title_or_id() for d in deplist if d.getId() == key][0] 18 return [(d.getId(),d.title_or_id()) for d in deplist if d.getId() == key] 11 #return res 12 #return [(d.id,d.Title,) for d in res] 13 if key is None: 14 res = context.portal_catalog({'meta_type': "Department"}) 15 return [(d.getId,d.Title,) for d in res] 16 res = context.portal_catalog({'meta_type': "Department", 'id': key}) 17 return res[-1].Title 18 return [(d.getId,d.title_or_id(),) for d in res][-1] 19 20 #return [d.title_or_id() for d in deplist if d.getId() == key][0] 21 #return [(d.getId(),d.title_or_id()) for d in deplist if d.getId() == key]
Note: See TracChangeset for help on using the changeset viewer.