Changeset 256 for waeup_product


Ignore:
Timestamp:
20 Jun 2006, 10:44:04 (18 years ago)
Author:
joachim
Message:

=import from csv

Location:
waeup_product/trunk
Files:
8 added
17 edited
1 copied
3 moved

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/Academics.py

    r238 r256  
    1717#registerDirectory('skins/waeup_faculty', globals())
    1818
    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
     44class Certificate(CPSDocument): ###(
    2045    """
    21     WAeUP StudyCourseFolder containing StudyCourses
     46    WAeUP Certificate
    2247    """
    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'
    4949    portal_type = meta_type
    5050    security = ClassSecurityInfo()
     
    5656##    def Title(self):
    5757##        """compose title"""
    58 ##        return "StudyCourse of %s" % (self.title)
     58##        return "Certificate of %s" % (self.title)
    5959
    60 InitializeClass(StudyCourse)
     60InitializeClass(Certificate)
    6161
    62 def addStudyCourse(container, id, REQUEST=None, **kw):
    63     """Add a StudyCourse."""
    64     ob = StudyCourse(id, **kw)
     62def addCertificate(container, id, REQUEST=None, **kw):
     63    """Add a Certificate."""
     64    ob = Certificate(id, **kw)
    6565    return CPSBase_adder(container, ob, REQUEST=REQUEST)
    6666
     67###)
     68
     69class 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
     88InitializeClass(CertificateCourse)
     89
     90def addCertificateCourse(container, id, REQUEST=None, **kw):
     91    """Add a CertificateCourse."""
     92    ob = CertificateCourse(id, **kw)
     93    return CPSBase_adder(container, ob, REQUEST=REQUEST)
    6794###)
    6895
     
    150177    return CPSBase_adder(container, ob, REQUEST=REQUEST)
    151178###)
     179
  • waeup_product/trunk/WAeUPPermissions.py

    r167 r256  
    2020__author__ = "Joachim Schmitz <js@aixtraware.de>"
    2121
    22 """WAeUP Student Permissions
     22"""WAeUP Permissions
    2323"""
    2424
    25 from AccessControl import ModuleSecurityInfo
     25#from AccessControl import ModuleSecurityInfo
    2626from Products.CMFCore.permissions import setDefaultRoles
    27 security = ModuleSecurityInfo('Products.WAeUP.WAeUPPermissions')
     27#security = ModuleSecurityInfo('Products.WAeUP.WAeUPPermissions')
    2828
    29 #  - 'University Manage' : Permission you need to manage a University
     29#  - 'Certificat Course delete' : Permission you need to ..
    3030#
    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',
     31CertificateCourseDelete = "Certificate Course Delete"
     32setDefaultRoles(CertificateCourseDelete, ('Manager',
     33                               'CourseAdvisor',
    7034                               ))
    7135
  • waeup_product/trunk/__init__.py

    r238 r256  
    1111from Products.CPSCore.interfaces import ICPSSite
    1212
     13import Products.WAeUP.WAeUPPermissions
    1314from Products.WAeUP.University import University, addUniversity
    1415from Products.WAeUP.Accommodation import AccoFolder, addAccoFolder
    1516from 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
     18from Products.WAeUP.Academics import Certificate, addCertificate
     19from Products.WAeUP.Academics import CertificateCourse, addCertificateCourse
    1820from Products.WAeUP.Academics import Faculty, addFaculty
    1921from Products.WAeUP.Academics import Department, addDepartment
    2022from Products.WAeUP.Academics import Course, addCourse
    2123from Products.WAeUP.Academics import CourseTicket, addCourseTicket
     24from Products.WAeUP.Academics import CertificateCourse, addCertificateCourse
    2225from Products.WAeUP.Students import Student, addStudent
    2326from Products.WAeUP.Students import StudentPersonal, addStudentPersonal
     
    3336contentClasses = (
    3437    University,
    35     SCFolder,
    36     StudyCourse,
     38    #SCFolder,
     39    Certificate,
     40    CertificateCourse,
    3741    Faculty,
    3842    Department,
    3943    Course,
    4044    CourseTicket,
     45    CertificateCourse,
    4146    AccoFolder,
    4247    Accommodation,
     
    5257contentConstructors = (
    5358    addUniversity,
    54     addSCFolder,
    55     addStudyCourse,
     59    #addSCFolder,
     60    addCertificate,
     61    addCertificateCourse,
    5662    addFaculty,
    5763    addDepartment,
    5864    addCourse,
    5965    addCourseTicket,
     66    addCertificateCourse,
    6067    addAccoFolder,
    6168    addAccommodation,
     
    7178fti = (
    7279    {}, # University
    73     {}, #SCFolder
    74     {}, #StudyCourse
     80    #{}, #SCFolder
     81    {}, #Certificate
     82    {}, #CertificateCourse
    7583    {}, # Faculty
    7684    {}, # Department
    7785    {}, # Course
    7886    {}, # CourseTicket
     87    {}, # CertificateCourse
    7988    {}, # AccoFolder
    8089    {}, # Accommodation
  • waeup_product/trunk/exportimport.py

    r251 r256  
    132132def loadFacultiesFromCSV(academics,site,context): ###(
    133133    """install Universityspecific Faculies from CSV values"""
     134    #return
    134135    logger = context.getLogger('loadfaculties')
     136    logger.info('Start loading Faculties')
    135137    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()
    136142    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)
    139146        if f is None:
    140147            #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)
    142149            academics.invokeFactory('Faculty', fid)
    143150            f = getattr(academics,fid)
    144             d = {'Title': faculty['Description']}
    145             f.getContent().edit(mapping=d)
     151        d = {'Title': faculty['Description']}
     152        f.getContent().edit(mapping=d)
    146153###)
    147154
    148155def loadDepartmentsFromCSV(academics,site,context): ###(
    149156    """install Universityspecific Faculies from CSV values"""
     157    #return
    150158    logger = context.getLogger('loaddepartments')
    151159    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()
    152164    for dep in deps:
     165        logger.info('Processing %(Session)s %(DeptCode)s %(Description)s %(FacultyCode)s' % dep)
    153166        fid = dep['FacultyCode']
    154         f = getattr(academics,fid,None)
     167        f = facs.get(fid,None)
    155168        if f is None:
    156169            logger.info( "No Faculty with ID: %s" % fid)
     
    158171            did = dep.get('DeptCode')
    159172            d = getattr(f,did,None)
    160             if d is None:
     173            if d is None or d.portal_type == "Faculty":
    161174                #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
    162175                logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep)
    163176                f.invokeFactory('Department', did)
    164177                d = getattr(f,did)
    165                 dict = {'Title': dep['Description']}
    166                 d.getContent().edit(mapping=dict)
     178            dict = {'Title': dep['Description']}
     179            d.getContent().edit(mapping=dict)
    167180###)
    168181
    169182def loadCoursesFromCSV(academics,site,context): ###(
    170     """install Universityspecific Faculies from CSV values"""
     183    """install Universityspecific Courses from CSV values"""
     184    #return
    171185    logger = context.getLogger('loadcourses')
    172186    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]
    173197    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
    182209        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:
    184213            logger.info("invalid course_code %(CourseCode)s" % course)
    185214            #print course_id,course.get('CourseCode'),course.get('Description')
    186215            continue
     216##        if course_id in course_list:
     217##            continue
    187218        c = getattr(dept,course_id,None)
    188219        if c is None:
     
    193224        dict = {'Title': course['Description']}
    194225        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')
    199231        dict['passmark'] = course.get('PassMark')
    200232        c.getContent().edit(mapping=dict)
     233###)
     234
     235def 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
     293def 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
     344def 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
     410def 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)
    201473###)
    202474
     
    221493    loadDepartmentsFromCSV(academics,site,context)
    222494    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)
    229502    if not hasattr(portal,'accommodation'):
    230503        portal.invokeFactory('AccoFolder','accommodation')
  • waeup_product/trunk/profiles/default/layouts.xml

    r238 r256  
    88 <object name="admission_slip" meta_type="CPS Layout"/>
    99 <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"/>
    1012 <object name="clearance" meta_type="CPS Layout"/>
    1113 <object name="clearence" meta_type="CPS Layout"/>
     
    2426 <object name="student_semester" meta_type="CPS Layout"/>
    2527 <object name="study_level" meta_type="CPS Layout"/>
    26  <object name="studycourse" meta_type="CPS Layout"/>
    2728 <object name="university" meta_type="CPS Layout"/>
    2829 <object name="waeup_common" meta_type="CPS Layout"/>
  • waeup_product/trunk/profiles/default/layouts/certificate.xml

    r250 r256  
    11<?xml version="1.0"?>
    2 <object name="studycourse" meta_type="CPS Layout">
     2<object name="certificate" meta_type="CPS Layout">
    33 <property name="layout_create_method"></property>
    44 <property name="layout_edit_method"></property>
     
    77 <property name="flexible_widgets"/>
    88 <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>
    931 <widget name="code" meta_type="String Widget">
    1032  <property name="title">Code</property>
     
    1840  <property name="hidden_layout_modes"/>
    1941  <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>
    2243 </widget>
    2344 <widget name="department" meta_type="Select Widget">
     
    3253  <property name="hidden_layout_modes"/>
    3354  <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>
    3468 </widget>
    3569 <widget name="faculty" meta_type="Select Widget">
     
    4478  <property name="hidden_layout_modes"/>
    4579  <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"/>
    46103 </widget>
    47104 <widget name="max_load" meta_type="Int Widget">
     
    69126  <property name="hidden_readonly_layout_modes"/>
    70127 </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>
    82183 </widget>
    83184 <table>
     
    92193  </row>
    93194  <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"/>
    98199  </row>
    99200  <row>
    100201   <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"/>
    101223  </row>
    102224 </table>
  • waeup_product/trunk/profiles/default/layouts/course.xml

    r238 r256  
    77 <property name="flexible_widgets"/>
    88 <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>
    920 <widget name="code" meta_type="String Widget">
    1021  <property name="title">Code</property>
     
    1728  <property name="display_width">10</property>
    1829 </widget>
    19  <widget name="core_elective" meta_type="Boolean Widget">
     30 <widget name="credits" meta_type="Int Widget">
     31  <property name="title">Credits</property>
    2032  <property name="fields">
    21    <element value="core_elective"/>
     33   <element value="credits"/>
    2234  </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"/>
    2840 </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>
    3043  <property name="fields">
    31    <element value="credit"/>
     44   <element value="org_code"/>
    3245  </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"/>
    4551 </widget>
    4652 <widget name="passmark" meta_type="Int Widget">
     53  <property name="title">Passmark</property>
    4754  <property name="fields">
    4855   <element value="passmark"/>
     
    5562  <property name="hidden_readonly_layout_modes"/>
    5663 </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>
    5966  <property name="fields">
    6067   <element value="semester"/>
    6168  </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>
    6471  <property name="readonly_layout_modes"/>
    6572  <property name="hidden_layout_modes"/>
    6673  <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>
    8074 </widget>
    8175 <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>
    9176  <row>
    9277   <cell name="code"/>
    9378  </row>
    9479  <row>
    95    <cell name="semester"/>
     80   <cell name="org_code"/>
    9681  </row>
    9782  <row>
    98    <cell name="credit"/>
     83   <cell name="category"/>
    9984  </row>
    10085  <row>
    101    <cell name="core_elective"/>
     86   <cell name="credits"/>
     87  </row>
     88  <row>
     89   <cell name="semester"/>
    10290  </row>
    10391  <row>
  • waeup_product/trunk/profiles/default/rolemap.xml

    r199 r256  
    22<rolemap>
    33  <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"/>
    296    <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"/>
    367  </roles>
    378  <permissions>
    38     <permission name="Access future portal content"
     9    <permission name="Certificate Course Delete"
    3910                acquire="True">
    40       <role name="Reviewer"/>
     11      <role name="Owner"/>
    4112      <role name="Manager"/>
     13      <role name="SectionManager"/>
     14      <role name="CourseAdvisor"/>
    4215    </permission>
    4316    <permission name="Add portal content" acquire="True">
    4417      <role name="Owner"/>
    4518      <role name="Manager"/>
     19      <role name="Student"/>
    4620    </permission>
    4721    <permission name="Add portal folders" acquire="True">
    4822      <role name="Owner"/>
    4923      <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"/>
    7825    </permission>
    7926    <permission name="Delete objects" acquire="True">
     
    8128      <role name="Manager"/>
    8229    </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>
    19630  </permissions>
    19731</rolemap>
  • waeup_product/trunk/profiles/default/schemas.xml

    r238 r256  
    44 <object name="academics" meta_type="CPS Schema"/>
    55 <object name="accommodation" meta_type="CPS Schema"/>
     6 <object name="certificate" meta_type="CPS Schema"/>
     7 <object name="certificate_course" meta_type="CPS Schema"/>
    68 <object name="course" meta_type="CPS Schema"/>
    79 <object name="course_results" meta_type="CPS Schema"/>
     
    2123 <object name="student_schoolresults" meta_type="CPS Schema"/>
    2224 <object name="students" meta_type="CPS Schema"/>
    23  <object name="studycourse" meta_type="CPS Schema"/>
    2425 <object name="study_level" meta_type="CPS Schema"/>
    2526 <object name="university" meta_type="CPS Schema"/>
  • waeup_product/trunk/profiles/default/schemas/certificate.xml

    r250 r256  
    11<?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"/>
    35 <field name="code" meta_type="CPS String Field">
    46  <property name="is_searchabletext">True</property>
    57 </field>
    68 <field name="department" meta_type="CPS String Field"/>
     9 <field name="end_level" meta_type="CPS String Field"/>
    710 <field name="faculty" meta_type="CPS String Field"/>
    811 <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"/>
    1014 <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"/>
    1220</object>
  • waeup_product/trunk/profiles/default/schemas/course.xml

    r238 r256  
    11<?xml version="1.0"?>
    22<object name="course" meta_type="CPS Schema">
     3 <field name="category" meta_type="CPS String Field"/>
    34 <field name="code" meta_type="CPS String Field">
    45  <property name="is_searchabletext">True</property>
    56 </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">
    139  <property name="is_searchabletext">True</property>
    1410 </field>
     
    1612  <property name="default_expr">python:40</property>
    1713 </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"/>
    2216</object>
    23 
  • waeup_product/trunk/profiles/default/types.xml

    r238 r256  
    55 <object name="AccoFolder" meta_type="CPS Flexible Type Information"/>
    66 <object name="Accommodation" meta_type="CPS Flexible Type Information"/>
     7 <object name="Certificate" meta_type="CPS Flexible Type Information"/>
    78 <object name="Course" meta_type="CPS Flexible Type Information"/>
     9 <object name="CertificateCourse" meta_type="CPS Flexible Type Information"/>
    810 <object name="CourseTicket" meta_type="CPS Flexible Type Information"/>
    911 <object name="Department" meta_type="CPS Flexible Type Information"/>
     
    1315 <object name="Semester" meta_type="CPS Flexible Type Information"/>
    1416 <object name="SCFolder" meta_type="CPS Flexible Type Information"/>
    15  <object name="StudyCourse" meta_type="CPS Flexible Type Information"/>
    1617 <object name="Student" meta_type="CPS Flexible Type Information"/>
    1718 <object name="StudentDocuments" meta_type="CPS Flexible Type Information"/>
  • waeup_product/trunk/profiles/default/types/Certificate.xml

    r250 r256  
    11<?xml version="1.0"?>
    2 <object name="StudyCourse" meta_type="CPS Flexible Type Information"
     2<object name="Certificate" meta_type="CPS Flexible Type Information"
    33   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
    4  <property name="title">WAeUP StudyCourse</property>
     4 <property name="title">WAeUP Certificate</property>
    55 <property name="description"></property>
    66 <property name="content_icon"></property>
    7  <property name="content_meta_type">StudyCourse</property>
     7 <property name="content_meta_type">Certificate</property>
    88 <property name="product">WAeUP</property>
    9  <property name="factory">addStudyCourse</property>
     9 <property name="factory">addCertificate</property>
    1010 <property name="immediate_view">folder_view</property>
    1111 <property name="global_allow">True</property>
    1212 <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>
    1318 <property name="allow_discussion">False</property>
    1419 <property name="cps_is_searchable">True</property>
     
    1823  <element value="metadata"/>
    1924  <element value="common"/>
    20   <element value="studycourse"/>
     25  <element value="certificate"/>
    2126 </property>
    2227 <property name="layouts">
    23   <element value="studycourse"/>
     28  <element value="certificate"/>
    2429 </property>
    2530 <property name="layout_clusters">
     
    4348 <action title="action_metadata" action_id="metadata" category="object"
    4449    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">
    4651  <permission value="Modify portal content"/>
    4752 </action>
    4853 <action title="delegate" action_id="localroles" category="object"
    4954    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    50     visible="False">
     55    visible="True">
    5156  <permission value="Modify portal content"/>
    5257 </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"/>
    5361</object>
  • waeup_product/trunk/profiles/default/types/Department.xml

    r238 r256  
    1212 <property name="filter_content_types">True</property>
    1313 <property name="allowed_content_types">
     14  <element value="Certificate"/>
    1415  <element value="Course"/>
    15   <element value="Student"/>
    1616 </property>
    1717 <property name="allow_discussion">False</property>
  • waeup_product/trunk/profiles/default/types/SCFolder.xml

    r238 r256  
    1212 <property name="filter_content_types">True</property>
    1313 <property name="allowed_content_types">
    14   <element value="StudyCourse"/>
     14  <element value="Certificate"/>
    1515 </property>
    1616 <property name="allow_discussion">False</property>
     
    4040  <permission value="View"/>
    4141 </action>
    42  <action title="Add StudyCourse" action_id="add_studycourse" category="object"
     42 <action title="Add Certificate" action_id="add_certificate" category="object"
    4343    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"/>
    4846 <action title="action_folder_contents" action_id="contents" category="object"
    4947    condition_expr="" url_expr="string:${object/absolute_url}/folder_contents"
    50     visible="True">
    51   <permission value="University Manage"/>
    52  </action>
     48    visible="True"/>
    5349 <action title="delegate" action_id="localroles" category="object"
    5450    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    55     visible="False">
    56   <permission value="University Manage"/>
    57  </action>
     51    visible="False"/>
    5852</object>
  • waeup_product/trunk/profiles/default/types/Semester.xml

    r199 r256  
    2323 </property>
    2424 <property name="layouts">
    25   <element value="student_semester"/>
     25  <element value="waeup_common"/>
    2626 </property>
    2727 <property name="layout_clusters">
  • waeup_product/trunk/profiles/default/types/StudyLevel.xml

    r199 r256  
    3434 <alias from="view" to="temporary_view_all"/>
    3535 <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"
    3737    visible="True">
    3838  <permission value="View"/>
     
    4141    category="object"
    4242    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"/>
    4644 <action title="action_metadata" action_id="metadata" category="object"
    4745    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"/>
    5147 <action title="delegate" action_id="localroles" category="object"
    5248    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    53     visible="False">
    54   <permission value="University Manage"/>
    55  </action>
     49    visible="False"/>
    5650</object>
  • waeup_product/trunk/profiles/default/workflows.xml

    r240 r256  
    1818 <object name="waeup_accommodation_wf" meta_type="CPS Workflow"/>
    1919 <object name="waeup_base_wf" meta_type="CPS Workflow"/>
     20 <object name="waeup_certificate_wf" meta_type="CPS Workflow"/>
    2021 <object name="waeup_course_wf" meta_type="CPS Workflow"/>
    2122 <object name="waeup_department_wf" meta_type="CPS Workflow"/>
     
    2324 <object name="waeup_section_wf" meta_type="CPS Workflow"/>
    2425 <object name="waeup_student_wf" meta_type="CPS Workflow"/>
    25  <object name="waeup_studycourse_wf" meta_type="CPS Workflow"/>
    2626 <object name="waeup_workspace_wf" meta_type="CPS Workflow"/>
    2727 <object name="workspace_calendar_wf" meta_type="CPS Workflow"/>
     
    4141  <type type_id="Accommodation">
    4242   <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"/>
    4349  </type>
    4450  <type type_id="CPS Calendar">
     
    9096   <bound-workflow workflow_id="section_folder_wf"/>
    9197  </type>
    92   <type type_id="StudyCourse">
    93    <bound-workflow workflow_id="waeup_studycourse_wf"/>
    94   </type>
    9598  <type type_id="StudyLevel">
    9699   <bound-workflow workflow_id="waeup_base_wf"/>
  • waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt

    r238 r256  
    4242                <a href="xxx" 
    4343                   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="" />
    4545              </i>
    4646            </td>
  • waeup_product/trunk/skins/waeup_faculty/create_certificate.py

    r250 r256  
    55
    66"""
    7 type_name = 'StudyCourse'
     7type_name = 'Certificate'
    88REQUEST.set('type_name',type_name)
    99
     
    1616lt = context.portal_layouts
    1717
    18 res,psm,ds = lt.renderLayout(layout_id= 'studycourse',
    19                       schema_id = 'studycourse',
     18res,psm,ds = lt.renderLayout(layout_id= 'certificate',
     19                      schema_id = 'certificate',
    2020                      context=context,
    2121                      mapping=validate and REQUEST,
    2222                      ob={},
    2323                      layout_mode='create',
    24                       create_action = 'create_studycourse',
     24                      create_action = 'create_certificate',
    2525                      )
    2626if  psm == 'invalid':
  • waeup_product/trunk/skins/waeup_faculty/get_departments_voc.py

    r182 r256  
    66"""
    77#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']
    1010
    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]
     13if key is None:
     14    res = context.portal_catalog({'meta_type': "Department"})   
     15    return [(d.getId,d.Title,) for d in res]
     16res = context.portal_catalog({'meta_type': "Department", 'id': key})
     17return res[-1].Title
     18return [(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.