Changeset 389 for WAeUP_SRP


Ignore:
Timestamp:
18 Aug 2006, 06:49:13 (18 years ago)
Author:
joachim
Message:

added title_prefix to department and renamed institution_type to title_prefix
for faculty.

Location:
WAeUP_SRP/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r382 r389  
    528528        return "%s" % (self.title)
    529529
     530
    530531    security.declareProtected(View,"LongTitle")
    531532    def LongTitle(self):
    532533        """compose long_title"""
    533         itype = self.portal_vocabularies.institution_types_voc.get(self.institution_type,default="Faculty of")
    534 
     534        prefix = getattr(self,'title_prefix',None)
     535        if prefix is None:
     536            prefix = getattr(self,'institution_type','faculty')
     537            self.getContent().edit(mapping = {'title_prefix': prefix})
     538        itype = self.portal_vocabularies.institution_types_voc.get(prefix,default="Faculty of")
    535539        return "%s %s" % (itype,self.title)
    536540
     
    552556    security = ClassSecurityInfo()
    553557
    554 ##    security.declareProtected(View,"Title")
    555 ##    def Title(self):
    556 ##        """compose title"""
    557 ##        reg_nr = self.getId()[1:]
    558 ##        return "Department of %s" % (self.title)
    559 
    560558    security.declareProtected(View,"LongTitle")
    561559    def LongTitle(self):
    562560        """compose long_title"""
    563         if not hasattr(self,'institution_type'):
    564             self.institution_type = "department"
    565         itype = self.portal_vocabularies.institution_types_voc.get(self.institution_type,default="Department of")
    566 
     561        prefix = getattr(self,'title_prefix',None)
     562        if prefix is None:
     563            prefix = getattr(self,'institution_type','department')
     564            self.getContent().edit(mapping = {'title_prefix': prefix})
     565        itype = self.portal_vocabularies.institution_types_voc.get(prefix,default="Department of")
    567566        return "%s %s" % (itype,self.title)
    568567
  • WAeUP_SRP/trunk/profiles/default/layouts/department.xml

    r388 r389  
    3636  <property name="label_edit">Object ID</property>
    3737  <property name="readonly_layout_modes"/>
    38   <property name="hidden_layout_modes"/>
     38  <property name="hidden_layout_modes">
     39   <element value="view"/>
     40   <element value="edit"/>
     41  </property>
    3942  <property name="hidden_readonly_layout_modes"/>
    4043 </widget>
     
    5356  <property name="hidden_readonly_layout_modes"/>
    5457 </widget>
     58 <widget name="title_prefix" meta_type="Select Widget">
     59  <property name="title">Title Prefix</property>
     60  <property name="fields">
     61   <element value="title_prefix"/>
     62  </property>
     63  <property name="label">Title Prefix</property>
     64  <property name="label_edit">Title Prefix</property>
     65  <property name="readonly_layout_modes"/>
     66  <property name="hidden_layout_modes"/>
     67  <property name="hidden_readonly_layout_modes"/>
     68  <property name="vocabulary">institution_types_voc</property>
     69 </widget>
    5570 <table>
    5671  <row>
    5772   <cell name="code"/>
     73  </row>
     74  <row>
     75   <cell name="title_prefix"/>
    5876  </row>
    5977  <row>
  • WAeUP_SRP/trunk/profiles/default/layouts/faculty.xml

    r379 r389  
    6161  <property name="hidden_readonly_layout_modes"/>
    6262 </widget>
    63  <widget name="institution_type" meta_type="Select Widget">
    64   <property name="title">Type of Institution</property>
     63 <widget name="title_prefix" meta_type="Select Widget">
     64  <property name="title">Title Prefix</property>
    6565  <property name="fields">
    66    <element value="institution_type"/>
     66   <element value="title_prefix"/>
    6767  </property>
    68   <property name="label">Type of Institution</property>
    69   <property name="label_edit">Type of Institution</property>
     68  <property name="label">Title Prefix</property>
     69  <property name="label_edit">Title Prefix</property>
    7070  <property name="readonly_layout_modes"/>
    7171  <property name="hidden_layout_modes"/>
     
    7575 <table>
    7676  <row>
    77    <cell name="institution_type"/>
     77   <cell name="title_prefix"/>
    7878  </row>
    7979  <row>
  • WAeUP_SRP/trunk/profiles/default/layouts/waeup_common.xml

    r388 r389  
    2929  <property name="label_edit">Object ID</property>
    3030  <property name="readonly_layout_modes"/>
    31   <property name="hidden_layout_modes"/>
    32   <property name="hidden_readonly_layout_modes"/>
    33  </widget>
    34  <widget name="code_alt" meta_type="String Widget">
    35   <property name="title">Object ID</property>
    36   <property name="fields">
    37    <element value="code"/>
    38   </property>
    39   <property name="is_required">True</property>
    40   <property name="label">Object ID</property>
    41   <property name="label_edit">Object ID</property>
    42   <property name="readonly_layout_modes"/>
    4331  <property name="hidden_layout_modes">
     32   <element value="view"/>
    4433   <element value="edit"/>
    45    <element value="view"/>
    4634  </property>
    4735  <property name="hidden_readonly_layout_modes"/>
  • WAeUP_SRP/trunk/profiles/default/schemas/department.xml

    r371 r389  
    22<object name="department" meta_type="CPS Schema">
    33 <field name="code" meta_type="CPS String Field"/>
     4 <field name="title_prefix" meta_type="CPS String Field"/>
    45</object>
  • WAeUP_SRP/trunk/profiles/default/schemas/faculty.xml

    r379 r389  
    55 <field name="college_code" meta_type="CPS String Field"/>
    66 <field name="degree_grade" meta_type="CPS String Field"/>
    7  <field name="institution_type" meta_type="CPS String Field"/>
     7 <field name="title_prefix" meta_type="CPS String Field"/>
    88</object>
  • WAeUP_SRP/trunk/skins/waeup_academics/get_departments_voc.py

    r313 r389  
    77if key is None:
    88    res = context.portal_catalog.search({'meta_type': "Department"})   
    9     return [(d.getId,d.Title,) for d in res]
     9    return [(d.getId(),d.Title,) for d in res]
    1010res = context.portal_catalog.search({'meta_type': "Department", 'id': key})
    1111if res:
Note: See TracChangeset for help on using the changeset viewer.