Changeset 319


Ignore:
Timestamp:
16 Jul 2006, 07:48:04 (18 years ago)
Author:
Henrik Bettermann
Message:
 
Location:
WAeUP_SRP/trunk
Files:
4 added
6 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r309 r319  
    66from Products.CMFCore.permissions import View
    77from Products.CMFCore.permissions import ModifyPortalContent
    8 from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder 
    9 #from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 
    10 from Products.CPSDocument.CPSDocument import CPSDocument 
    11 #from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 
    12 #from Products.CPSCore.CPSBase import CPSBaseBTreeDocument as BaseBTreeDocument 
     8from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder
     9#from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument
     10from Products.CPSDocument.CPSDocument import CPSDocument
     11#from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder
     12#from Products.CPSCore.CPSBase import CPSBaseBTreeDocument as BaseBTreeDocument
    1313#from Products.CMFCore.DirectoryView import registerDirectory
    1414
     
    2525class AcademicsFolder(CPSDocument): ###(
    2626    """
    27     WAeUP AcademicsFolder containing StudyCourses 
     27    WAeUP AcademicsFolder containing StudyCourses
    2828    """
    2929    meta_type = 'AcademicsFolder'
     
    3737
    3838    security.declareProtected(View,"loadFacultiesFromCSV")###(
    39     def loadFacultiesFromCSV(self): 
     39    def loadFacultiesFromCSV(self):
    4040        """install Universityspecific Faculies from CSV values"""
    4141        #return
     
    7575
    7676    security.declareProtected(ModifyPortalContent,"yamlDumpFaculties")###(
    77     def yamlDumpFaculties(self): 
     77    def yamlDumpFaculties(self):
    7878        """dump Faculies to Yaml"""
    7979        #return
     
    9292        return self.academics.temporary_view_all()
    9393        return self.temporary_view_all()
    94            
     94
    9595    ###)
    9696
     
    131131                    dict = {'Title': dep['Description']}
    132132                    d.getContent().edit(mapping=dict)
    133                     d.invokeFactory('CoursesFolder','Courses')
     133                    d.invokeFactory('CoursesFolder','courses')
    134134                    courses = getattr(d,'Courses')
    135135                    dict = {'Title': 'Courses'}
    136136                    courses.getContent().edit(mapping=dict)
    137                     d.invokeFactory('CertificatesFolder','Certificates')
     137                    d.invokeFactory('CertificatesFolder','certificates')
    138138                    certificates = getattr(d,'Certificates')
    139139                    dict = {'Title': 'Certificates'}
     
    141141        return self.academics.academics_contents()
    142142    ###)
    143    
     143
    144144    security.declareProtected(ModifyPortalContent,"loadCoursesFromCSV")###(
    145145    def loadCoursesFromCSV(self):
     
    212212            dict = {'Title': course['Description']}
    213213            dict['code'] = course_id
    214             dict['org_code'] = course.get('CourseCode') 
     214            dict['org_code'] = course.get('CourseCode')
    215215            dict['credits'] = course.get('Credits')
    216216            dict['semester'] = course.get('Semester')
     
    288288            dict = {'Title': certificate['Description']}
    289289            dict['code'] = code
    290             dict['faculty'] = certificate.get('Faculty') 
    291             dict['department'] = certificate.get('Dept') 
     290            dict['faculty'] = certificate.get('Faculty')
     291            dict['department'] = certificate.get('Dept')
    292292            dict['max_pass'] = certificate.get('MaxPass')
    293293            dict['max_load'] = certificate.get('MaxLoad')
     
    297297            dict['nr_years'] = int(certificate.get('Nyears'))
    298298            nc = certificate.get('Ncore','1')
    299             try: 
     299            try:
    300300                dict['n_core'] = int(nc)
    301301            except:
     
    402402            dict['code'] = cert_course.get('CosCode')
    403403            dict['certificate_code'] = code
    404             dict['certificate_code_org'] = cert_course.get('CertCode') 
    405             dict['department'] = cert_course.get('Dept') 
     404            dict['certificate_code_org'] = cert_course.get('CertCode')
     405            dict['department'] = cert_course.get('Dept')
    406406            dict['admin_status'] = cert_course.get('Admstatus')
    407407            dict['session'] = cert_course.get('Session')
     
    426426class Certificate(CPSDocument): ###(
    427427    """
    428     WAeUP Certificate 
     428    WAeUP Certificate
    429429    """
    430430    meta_type = 'Certificate'
    431431    portal_type = meta_type
    432432    security = ClassSecurityInfo()
    433    
     433
    434434    def __init__(self, id, **kw):
    435435        CPSDocument.__init__(self, id, **kw)
     
    451451class CertificateCourse(CPSDocument): ###(
    452452    """
    453     WAeUP CertificateCourse 
     453    WAeUP CertificateCourse
    454454    """
    455455    meta_type = 'CertificateCourse'
    456456    portal_type = meta_type
    457457    security = ClassSecurityInfo()
    458    
     458
    459459    def getCourseEntry(self,cid):
    460460        res = self.portal_catalog({'meta_type': "Course",
    461461                                           'id': cid})
    462462        if res:
    463             return res[-1] 
     463            return res[-1]
    464464        else:
    465465            return None
    466        
     466
    467467    security.declareProtected(View,"Title")
    468468    def Title(self):
     
    480480            return "%s" % ce.credits
    481481        return "0"
    482    
     482
    483483    security.declareProtected(View,"passmark")
    484484    def passmark(self):
     
    487487        if ce is not None and hasattr(ce,"passmark"):
    488488            return ce.passmark
    489        
    490    
     489
     490
    491491    security.declareProtected(View,"coursepath")
    492492    def coursepath(self):
     
    496496            return ce.getPath()
    497497        return "?"
    498    
     498
    499499
    500500InitializeClass(CertificateCourse)
     
    508508class Faculty(CPSDocument): ###(
    509509    """
    510     WAeUP Faculty containing Departments 
     510    WAeUP Faculty containing Departments
    511511    """
    512512    meta_type = 'Faculty'
    513513    portal_type = meta_type
    514514    security = ClassSecurityInfo()
    515    
     515
    516516##    def __init__(self, id, **kw):
    517517##        CPSDocument.__init__(self, id, **kw)
     
    521521        """compose title"""
    522522        return "%s" % (self.title)
    523    
     523
    524524    security.declareProtected(View,"LongTitle")
    525525    def LongTitle(self):
    526526        """compose long_title"""
    527527        itype = self.portal_vocabularies.institution_types_voc.get(self.institution_type,default="Faculty of")
    528        
     528
    529529        return "%s %s" % (itype,self.title)
    530530
     
    558558            self.institution_type = "department"
    559559        itype = self.portal_vocabularies.institution_types_voc.get(self.institution_type,default="Department of")
    560        
     560
    561561        return "%s %s" % (itype,self.title)
    562562
     
    567567    object = Department(id, **kw)
    568568    id = object.getId()
    569     container._setObject(id, object)   
     569    container._setObject(id, object)
    570570##    dep = getattr(container,id).getEditableContent()   #getContent()
    571571##    dep.invokeFactory('CoursesFolder','Courses')
     
    585585class Course(CPSDocument): ###(
    586586    """
    587     WAeUP Course 
     587    WAeUP Course
    588588    """
    589589    meta_type = 'Course'
     
    595595        """compose title"""
    596596        return self.title
    597    
     597
    598598InitializeClass(Course)
    599599
     
    606606class CourseTicket(CPSDocument): ###(
    607607    """
    608     WAeUP CourseTicket 
     608    WAeUP CourseTicket
    609609    """
    610610    meta_type = 'CourseTicket'
    611611    portal_type = meta_type
    612612    security = ClassSecurityInfo()
    613    
     613
    614614InitializeClass(CourseTicket)
    615615
  • WAeUP_SRP/trunk/profiles/default/cps_portlets/portlet_778397196.xml

    r315 r319  
    2424  <e v="view"/>
    2525  <e v="edit"/>
    26   <e v="delegate"/>
     26  <e v="localroles"/>
    2727  <e v="new_entry"/>
    2828  <e v="approve"/>
  • WAeUP_SRP/trunk/profiles/default/layouts/course.xml

    r256 r319  
    6363 </widget>
    6464 <widget name="semester" meta_type="Int Widget">
    65   <property name="title">Nr of semesters</property>
     65  <property name="title">Nr of Semester</property>
    6666  <property name="fields">
    6767   <element value="semester"/>
    6868  </property>
    6969  <property name="label">Nr of semesters</property>
    70   <property name="label_edit">Nr of semesters</property>
     70  <property name="label_edit">Nr of Semester</property>
    7171  <property name="readonly_layout_modes"/>
    7272  <property name="hidden_layout_modes"/>
  • WAeUP_SRP/trunk/profiles/default/types/AccoFolder.xml

    r308 r319  
    5454  <permission value="University Manage"/>
    5555 </action>
    56  <action title="delegate" action_id="localroles" category="object"
     56 <action title="Delegate" action_id="localroles" category="object"
    5757    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    5858    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/Accommodation.xml

    r308 r319  
    4848  <permission value="Modify portal content"/>
    4949 </action>
    50  <action title="delegate" action_id="localroles" category="object"
     50 <action title="Delegate" action_id="localroles" category="object"
    5151    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    5252    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/Certificate.xml

    r313 r319  
    4949  <permission value="Modify portal content"/>
    5050 </action>
    51  <action title="delegate" action_id="localroles" category="object"
     51 <action title="Delegate" action_id="localroles" category="object"
    5252    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    5353    visible="True">
  • WAeUP_SRP/trunk/profiles/default/types/CertificateCourse.xml

    r315 r319  
    4444    condition_expr="" url_expr="string:${object_url}/cpsdocument_metadata"
    4545    visible="False"/>
    46  <action title="delegate" action_id="localroles" category="object"
     46 <action title="Delegate" action_id="localroles" category="object"
    4747    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    4848    visible="True"/>
  • WAeUP_SRP/trunk/profiles/default/types/CertificatesFolder.xml

    r313 r319  
    3939  <permission value="View"/>
    4040 </action>
    41  <action title="delegate" action_id="localroles" category="object"
     41 <action title="Delegate" action_id="localroles" category="object"
    4242    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    4343    visible="True">
  • WAeUP_SRP/trunk/profiles/default/types/Course.xml

    r316 r319  
    4848  <permission value="Modify portal content"/>
    4949 </action>
    50  <action title="delegate" action_id="localroles" category="object"
     50 <action title="Delegate" action_id="localroles" category="object"
    5151    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    5252    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/CourseTicket.xml

    r308 r319  
    4545  <permission value="University Manage"/>
    4646 </action>
    47  <action title="delegate" action_id="localroles" category="object"
     47 <action title="Delegate" action_id="localroles" category="object"
    4848    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    4949    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/CoursesFolder.xml

    r311 r319  
    3030  <permission value="View archived revisions"/>
    3131 </action>
    32  <action title="delegate" action_id="localroles" category="object"
     32 <action title="Delegate" action_id="localroles" category="object"
    3333    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    3434    visible="False"/>
  • WAeUP_SRP/trunk/profiles/default/types/Jamb.xml

    r308 r319  
    3838    condition_expr="" url_expr="string:${object_url}/waeup_edit_form"
    3939    visible="True"/>
    40  <action title="delegate" action_id="localroles" category="object"
     40 <action title="Delegate" action_id="localroles" category="object"
    4141    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    4242    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/Semester.xml

    r316 r319  
    5050  <permission value="University Manage"/>
    5151 </action>
    52  <action title="delegate" action_id="localroles" category="object"
     52 <action title="Delegate" action_id="localroles" category="object"
    5353    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    5454    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/Student.xml

    r308 r319  
    4848  <permission value="University Manage"/>
    4949 </action>
    50  <action title="delegate" action_id="localroles" category="object"
     50 <action title="Delegate" action_id="localroles" category="object"
    5151    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    5252    visible="False">
  • WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml

    r308 r319  
    6161  <permission value="Modify portal content"/>
    6262 </action>
    63  <action title="delegate" action_id="localroles" category="object"
     63 <action title="Delegate" action_id="localroles" category="object"
    6464    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    6565    visible="True">
  • WAeUP_SRP/trunk/profiles/default/types/StudyLevel.xml

    r308 r319  
    4444    condition_expr="python:member and 'Manager' in member.getRoles()"
    4545    url_expr="string:${object_url}/cpsdocument_metadata" visible="False"/>
    46  <action title="delegate" action_id="localroles" category="object"
     46 <action title="Delegate" action_id="localroles" category="object"
    4747    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    4848    visible="False"/>
  • WAeUP_SRP/trunk/profiles/default/types/University.xml

    r315 r319  
    6464  <permission value="Modify portal content"/>
    6565 </action>
    66  <action title="delegate" action_id="localroles" category="object"
     66 <action title="Delegate" action_id="localroles" category="object"
    6767    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    6868    visible="True">
  • WAeUP_SRP/trunk/skins/waeup_academics/department_created.py

    r310 r319  
    2121else:
    2222    dep = context.getContent()
    23 dep.invokeFactory('CoursesFolder','Courses')
     23dep.invokeFactory('CoursesFolder','courses')
    2424o = getattr(dep,'Courses')
    2525dict = {'Title': 'Courses'}
    2626o.getContent().edit(mapping=dict)
    27 dep.invokeFactory('CertificatesFolder','Certificates')
     27dep.invokeFactory('CertificatesFolder','certificates')
    2828o = getattr(dep,'Certificates')
    2929dict = {'Title': 'Certificates'}
Note: See TracChangeset for help on using the changeset viewer.