Changeset 444


Ignore:
Timestamp:
29 Aug 2006, 16:17:25 (18 years ago)
Author:
Henrik Bettermann
Message:

layout, types and schema corrections

Location:
WAeUP_SRP/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r440 r444  
    4343        elif mode == 'edit':
    4444            html_widget_id = self.getHtmlWidgetId()
    45             res = renderHtmlTag('select', 
    46                                 name='%s.%s:records' % (self.record_id,html_widget_id), 
     45            res = renderHtmlTag('select',
     46                                name='%s.%s:records' % (self.record_id,html_widget_id),
    4747                                id=html_widget_id)
    4848            in_selection = 0
     
    9494            kw = {'type': 'text',
    9595                  'id'  : html_widget_id,
    96                   'name': '%s.%s:records' % (self.record_id,html_widget_id), 
     96                  'name': '%s.%s:records' % (self.record_id,html_widget_id),
    9797                  'value': escape(value),
    9898                  'size': self.display_width,
     
    112112    """ CertificateCourseId Widget"""
    113113    meta_type = "CertificateCourseId Widget"
    114    
    115     def validate(self, datastructure, **kw):
    116         """Validate datastructure and update datamodel."""
    117        
     114
     115    def validate(self, datastructure, **kw):
     116        """Validate datastructure and update datamodel."""
     117
    118118        valid = CPSStringWidget.validate(self, datastructure, **kw)
    119119        if not valid:
     
    125125            c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})]
    126126            if hasattr(self.aq_parent,value):
    127                 err = 'Course %s already exists' % (value) 
     127                err = 'Course %s already exists' % (value)
    128128            elif value not in c_ids:
    129                 err = 'Course %s does not exist' % (value) 
    130             if err:
    131                 datastructure.setError(widget_id, err)
    132             else:
    133                 datamodel = datastructure.getDataModel()
    134                 datamodel[self.fields[0]] = value
    135            
     129                err = 'Course %s does not exist' % (value)
     130            if err:
     131                datastructure.setError(widget_id, err)
     132            else:
     133                datamodel = datastructure.getDataModel()
     134                datamodel[self.fields[0]] = value
     135
    136136            return not err
    137137
     
    146146    """ WAeUPId Widget"""
    147147    meta_type = "WAeUPId Widget"
    148    
    149     def validate(self, datastructure, **kw):
    150         """Validate datastructure and update datamodel."""
    151        
     148
     149    def validate(self, datastructure, **kw):
     150        """Validate datastructure and update datamodel."""
     151
    152152        valid = CPSStringWidget.validate(self, datastructure, **kw)
    153153        id_pat_str = r"\S"
     
    160160            err = 0
    161161            if len(value.split()) > 1:
    162                 err = 'Invalid Id (Id contains space(s)' 
     162                err = 'Invalid Id (Id contains space(s)'
    163163            elif hasattr(self.aq_parent,value):
    164                 err = 'An object with the Id %s already exists in this context' % (value) 
    165             if err:
    166                 datastructure.setError(widget_id, err)
    167             else:
    168                 datamodel = datastructure.getDataModel()
    169                 datamodel[self.fields[0]] = value
    170            
     164                err = 'An object with the Id %s already exists in this context' % (value)
     165            if err:
     166                datastructure.setError(widget_id, err)
     167            else:
     168                datamodel = datastructure.getDataModel()
     169                datamodel[self.fields[0]] = value
     170
    171171            return not err
    172172
     
    185185    letters = 2
    186186    letters_str = "L"*letters
    187    
    188     def validate(self, datastructure, **kw):
    189         """Validate datastructure and update datamodel."""
    190        
     187
     188    def validate(self, datastructure, **kw):
     189        """Validate datastructure and update datamodel."""
     190
    191191        valid = CPSStringWidget.validate(self, datastructure, **kw)
    192192        if not valid:
     
    197197            err = 0
    198198            if not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()):
    199                 err = 'invalid Student Id in the format: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str)
    200             if err:
    201                 datastructure.setError(widget_id, err)
    202             else:
    203                 datamodel = datastructure.getDataModel()
    204                 datamodel[self.fields[0]] = value
    205            
     199                err = 'Invalid Registration Number in the format: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str)
     200            if err:
     201                datastructure.setError(widget_id, err)
     202            else:
     203                datamodel = datastructure.getDataModel()
     204                datamodel[self.fields[0]] = value
     205
    206206            return not err
    207207
     
    225225                  '45678901',
    226226                  ]
    227    
    228     def validate(self, datastructure, **kw):
    229         """Validate datastructure and update datamodel."""
    230        
     227
     228    def validate(self, datastructure, **kw):
     229        """Validate datastructure and update datamodel."""
     230
    231231        valid = CPSStringWidget.validate(self, datastructure, **kw)
    232232        if not valid:
     
    237237            err = 0
    238238            #import pdb; pdb.set_trace()
    239             if not value in self.valid_pins: 
     239            if not value in self.valid_pins:
    240240                err = 'invalid Pin'
    241241            if err:
  • WAeUP_SRP/trunk/profiles/default/layouts.xml

    r421 r444  
    1616 <object name="student_study_course" meta_type="CPS Layout"/>
    1717 <object name="student_admission" meta_type="CPS Layout"/>
     18 <object name="student_admission_fe" meta_type="CPS Layout"/>
    1819 <object name="student_clearance" meta_type="CPS Layout"/>
     20 <object name="student_clearance_fe" meta_type="CPS Layout"/>
    1921 <object name="student_course_results" meta_type="CPS Layout"/>
    2022 <object name="student_personal" meta_type="CPS Layout"/>
  • WAeUP_SRP/trunk/profiles/default/layouts/student_admission.xml

    r434 r444  
    3232   <element value="jamb_reg_no"/>
    3333  </property>
    34   <property name="is_required">True</property>
     34  <property name="is_required">False</property>
    3535  <property name="label">JAMB Registration Number</property>
    3636  <property name="label_edit">JAMB Registration Number</property>
     
    4747   <element value="jamb_firstname"/>
    4848  </property>
    49   <property name="is_required">True</property>
     49  <property name="is_required">False</property>
    5050  <property name="label">JAMB First Name</property>
    5151  <property name="label_edit">JAMB First Name</property>
     
    259259  </row>
    260260  <row>
    261    <cell name="jamb_id"/>
     261   <cell name="jamb_reg_no"/>
    262262  </row>
    263263  <row>
  • WAeUP_SRP/trunk/profiles/default/layouts/student_admission_fe.xml

    r434 r444  
    3030   <element value="jamb_reg_no"/>
    3131  </property>
    32   <property name="is_required">True</property>
     32  <property name="is_required">False</property>
    3333  <property name="label">JAMB Registration Number</property>
    3434  <property name="label_edit">JAMB Registration Number</property>
     
    4747   <element value="jamb_firstname"/>
    4848  </property>
    49   <property name="is_required">True</property>
     49  <property name="is_required">False</property>
    5050  <property name="label">JAMB First Name</property>
    5151  <property name="label_edit">JAMB First Name</property>
     
    293293  </row>
    294294  <row>
    295    <cell name="jamb_id"/>
     295   <cell name="jamb_reg_no"/>
    296296  </row>
    297297  <row>
  • WAeUP_SRP/trunk/profiles/default/schemas.xml

    r421 r444  
    1414 <object name="student" meta_type="CPS Schema"/>
    1515 <object name="student_study_course" meta_type="CPS Schema"/>
     16 <object name="scratch_card_batch.xml" meta_type="CPS Schema"/>
    1617 <object name="student_accommodation" meta_type="CPS Schema"/>
    1718 <object name="student_admission" meta_type="CPS Schema"/>
  • WAeUP_SRP/trunk/profiles/default/types.xml

    r443 r444  
    1313 <object name="Department" meta_type="CPS Flexible Type Information"/>
    1414 <object name="Faculty" meta_type="CPS Flexible Type Information"/>
     15 <object name="ScratchCardBatch" meta_type="CPS Flexible Type Information"/>
     16 <object name="ScratchCardBatchesFolder" meta_type="CPS Flexible Type Information"/>
    1517 <object name="Semester" meta_type="CPS Flexible Type Information"/>
    1618 <object name="Student" meta_type="CPS Flexible Type Information"/>
     
    1820 <object name="StudentClearance" meta_type="CPS Flexible Type Information"/>
    1921 <object name="StudentPersonal" meta_type="CPS Flexible Type Information"/>
    20  <object name="StudentAdmission" meta_type="CPS Flexible Type Information"/> 
     22 <object name="StudentAdmission" meta_type="CPS Flexible Type Information"/>
    2123 <object name="StudentsFolder" meta_type="CPS Flexible Type Information"/>
    2224 <object name="ScratchCardBatchesFolder" meta_type="CPS Flexible Type Information"/>
  • WAeUP_SRP/trunk/profiles/default/types/StudentAdmission.xml

    r435 r444  
    2323 </property>
    2424 <property name="layout_clusters">
    25   <element value=""/>
     25  <element value="front_end:student_admission_fe"/>
    2626 </property>
    2727 <property name="flexible_layouts"/>
     
    3030 <alias from="(Default)" to="academics_contents"/>
    3131 <alias from="view" to="academics_contents"/>
    32  <action title="Standard View" action_id="view" category="object"
    33     condition_expr=""
    34     url_expr="string:${object_url}/academics_contents"
     32 <action title="Standard View" action_id="view" category="object"
     33    condition_expr="" url_expr="string:${object_url}/academics_contents"
    3534    visible="True">
    3635  <permission value="View"/>
    3736 </action>
    3837 <action title="action_edit" action_id="edit" category="object"
    39     condition_expr=""
    40     url_expr="string:${object_url}/student_admission_edit_form"
     38    condition_expr="" url_expr="string:${object_url}/cpsdocument_edit"
    4139    visible="True">
    4240  <permission value="Modify portal content"/>
    4341 </action>
     42 <action title="action_metadata" action_id="metadata" category="object"
     43    condition_expr="python:member and 'Manager' in member.getRoles()"
     44    url_expr="string:${object_url}/cpsdocument_metadata" visible="False">
     45  <permission value="Modify portal content"/>
     46 </action>
    4447</object>
Note: See TracChangeset for help on using the changeset viewer.