Changeset 279


Ignore:
Timestamp:
29 Jun 2006, 06:38:51 (18 years ago)
Author:
joachim
Message:

=modifications to level view

Location:
WAeUP_SRP/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r278 r279  
    1717#registerDirectory('skins/waeup_faculty', globals())
    1818
     19import csv,re
     20import logging
     21import Globals
     22p_home = Globals.package_home(globals())
     23i_home = Globals.INSTANCE_HOME
     24
    1925class AcademicsFolder(CPSDocument): ###(
    2026    """
     
    3036##        return "AcademicsFolder of %s" % (self.title)
    3137
    32     security.declareProtected(ModifyPortalContent,"loadFacultiesFromCSV")###(
     38    security.declareProtected(View,"loadFacultiesFromCSV")###(
    3339    def loadFacultiesFromCSV(self):
    3440        """install Universityspecific Faculies from CSV values"""
     
    7682           
    7783    ###)
    78 
    7984
    8085    security.declareProtected(ModifyPortalContent,"loadDepartmentsFromCSV")###(
     
    340345    security = ClassSecurityInfo()
    341346   
     347    def getCourseEntry(self,cid):
     348        res = self.portal_catalog({'meta_type': "Course",
     349                                           'id': cid})
     350        if res:
     351            return res[-1] 
     352        else:
     353            return None
     354       
    342355    security.declareProtected(View,"Title")
    343356    def Title(self):
    344357        """compose title"""
    345         res = self.portal_catalog({'meta_type': "Course",
    346                                            'id': self.id})
    347         if res:
    348             course = res[-1].getObject() 
    349         else:
    350             return "No course for %s" % self.id
    351         return "%s" % (course.title)
     358        ce = self.getCourseEntry(self.id)
     359        if ce:
     360            return "%s" % ce.Title
     361        return "No such course"
     362
     363    security.declareProtected(View,"credits")
     364    def credits(self):
     365        """credits from course"""
     366        ce = self.getCourseEntry(self.id)
     367        if ce:
     368            return "%s" % ce.credits
     369        return 0
     370   
     371    security.declareProtected(View,"passmark")
     372    def passmark(self):
     373        """passmark from course"""
     374        ce = self.getCourseEntry(self.id)
     375        if ce:
     376            return "%s" % ce.passmark
     377        return "No such course"
     378   
    352379
    353380InitializeClass(CertificateCourse)
  • WAeUP_SRP/trunk/__init__.py

    r278 r279  
    1919from Products.WAeUP_SRP.Accommodation import AccoFolder, addAccoFolder
    2020from Products.WAeUP_SRP.Accommodation import Accommodation, addAccommodation
    21 #from Products.WAeUP_SRP.Academics import SCFolder, addSCFolder
    2221from Products.WAeUP_SRP.Academics import Certificate, addCertificate
    2322from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse
  • WAeUP_SRP/trunk/profiles/default/types/AcademicsFolder.xml

    r278 r279  
    66 <property name="content_icon"></property>
    77 <property name="content_meta_type">AcademicsFolder</property>
    8  <property name="product">CPSDefault</property>
    9  <property name="factory">addFolder</property>
     8 <property name="product">WAeUP_SRP</property>
     9 <property name="factory">addAcademicsFolder</property>
    1010 <property name="immediate_view">folder_view</property>
    1111 <property name="global_allow">True</property>
     
    4444    condition_expr="python:True or member and 'UniversityManager'in member.getRoles()"
    4545    url_expr="string:${object/absolute_url}/create_common?type_name=Faculty"
    46     visible="True">
    47   <permission value="University Manage"/>
    48  </action>
     46    visible="True"/>
    4947 <action title="action_folder_contents" action_id="contents" category="object"
    5048    condition_expr="" url_expr="string:${object/absolute_url}/folder_contents"
    51     visible="True">
    52   <permission value="University Manage"/>
    53  </action>
     49    visible="True"/>
    5450 <action title="delegate" action_id="localroles" category="object"
    5551    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    56     visible="False">
    57   <permission value="University Manage"/>
    58  </action>
     52    visible="False"/>
    5953 <action title="IMPORT: Faculties" action_id="import_faculties"
    6054    category="object" condition_expr=""
    61     url_expr="string:${object_url}/loadFacultiesFromCSV" visible="True">
    62   <permission value="Modify portal content"/>
    63  </action>
     55    url_expr="string:${object_url}/loadFacultiesFromCSV" visible="True"/>
    6456 <action title="Departments" action_id="import_departments" category="object"
    6557    condition_expr="" url_expr="string:${object_url}/loadDepartmentsFromCSV"
  • WAeUP_SRP/trunk/profiles/default/types/StudyLevel.xml

    r274 r279  
    3131 <property name="storage_methods"/>
    3232 <property name="cps_is_portlet">False</property>
    33  <alias from="(Default)" to="temporary_view_all"/>
    34  <alias from="view" to="temporary_view_all"/>
     33 <alias from="(Default)" to="level_view"/>
     34 <alias from="view" to="level_view"/>
    3535 <action title="Standard View" action_id="view" category="object"
    3636    condition_expr="" url_expr="string:${object_url}/level_view"
  • WAeUP_SRP/trunk/skins/waeup_faculty/level_view_form.pt

    r256 r279  
    3131            <td tal:content="course/id">
    3232            </td>
    33             <td tal:content="course/Title">
    34             </td>
     33            <td tal:content="course/Title"></td>
     34            <td tal:content="course/credits"></td>
     35            <td tal:content="course/passmark"></td>
    3536          </tr>
    3637            <tr> <td></td></tr>
Note: See TracChangeset for help on using the changeset viewer.