Changeset 444 for WAeUP_SRP/trunk
- Timestamp:
- 29 Aug 2006, 16:17:25 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r440 r444 43 43 elif mode == 'edit': 44 44 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), 47 47 id=html_widget_id) 48 48 in_selection = 0 … … 94 94 kw = {'type': 'text', 95 95 '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), 97 97 'value': escape(value), 98 98 'size': self.display_width, … … 112 112 """ CertificateCourseId Widget""" 113 113 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 118 118 valid = CPSStringWidget.validate(self, datastructure, **kw) 119 119 if not valid: … … 125 125 c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})] 126 126 if hasattr(self.aq_parent,value): 127 err = 'Course %s already exists' % (value) 127 err = 'Course %s already exists' % (value) 128 128 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 136 136 return not err 137 137 … … 146 146 """ WAeUPId Widget""" 147 147 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 152 152 valid = CPSStringWidget.validate(self, datastructure, **kw) 153 153 id_pat_str = r"\S" … … 160 160 err = 0 161 161 if len(value.split()) > 1: 162 err = 'Invalid Id (Id contains space(s)' 162 err = 'Invalid Id (Id contains space(s)' 163 163 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 171 171 return not err 172 172 … … 185 185 letters = 2 186 186 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 191 191 valid = CPSStringWidget.validate(self, datastructure, **kw) 192 192 if not valid: … … 197 197 err = 0 198 198 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 206 206 return not err 207 207 … … 225 225 '45678901', 226 226 ] 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 231 231 valid = CPSStringWidget.validate(self, datastructure, **kw) 232 232 if not valid: … … 237 237 err = 0 238 238 #import pdb; pdb.set_trace() 239 if not value in self.valid_pins: 239 if not value in self.valid_pins: 240 240 err = 'invalid Pin' 241 241 if err: -
WAeUP_SRP/trunk/profiles/default/layouts.xml
r421 r444 16 16 <object name="student_study_course" meta_type="CPS Layout"/> 17 17 <object name="student_admission" meta_type="CPS Layout"/> 18 <object name="student_admission_fe" meta_type="CPS Layout"/> 18 19 <object name="student_clearance" meta_type="CPS Layout"/> 20 <object name="student_clearance_fe" meta_type="CPS Layout"/> 19 21 <object name="student_course_results" meta_type="CPS Layout"/> 20 22 <object name="student_personal" meta_type="CPS Layout"/> -
WAeUP_SRP/trunk/profiles/default/layouts/student_admission.xml
r434 r444 32 32 <element value="jamb_reg_no"/> 33 33 </property> 34 <property name="is_required"> True</property>34 <property name="is_required">False</property> 35 35 <property name="label">JAMB Registration Number</property> 36 36 <property name="label_edit">JAMB Registration Number</property> … … 47 47 <element value="jamb_firstname"/> 48 48 </property> 49 <property name="is_required"> True</property>49 <property name="is_required">False</property> 50 50 <property name="label">JAMB First Name</property> 51 51 <property name="label_edit">JAMB First Name</property> … … 259 259 </row> 260 260 <row> 261 <cell name="jamb_ id"/>261 <cell name="jamb_reg_no"/> 262 262 </row> 263 263 <row> -
WAeUP_SRP/trunk/profiles/default/layouts/student_admission_fe.xml
r434 r444 30 30 <element value="jamb_reg_no"/> 31 31 </property> 32 <property name="is_required"> True</property>32 <property name="is_required">False</property> 33 33 <property name="label">JAMB Registration Number</property> 34 34 <property name="label_edit">JAMB Registration Number</property> … … 47 47 <element value="jamb_firstname"/> 48 48 </property> 49 <property name="is_required"> True</property>49 <property name="is_required">False</property> 50 50 <property name="label">JAMB First Name</property> 51 51 <property name="label_edit">JAMB First Name</property> … … 293 293 </row> 294 294 <row> 295 <cell name="jamb_ id"/>295 <cell name="jamb_reg_no"/> 296 296 </row> 297 297 <row> -
WAeUP_SRP/trunk/profiles/default/schemas.xml
r421 r444 14 14 <object name="student" meta_type="CPS Schema"/> 15 15 <object name="student_study_course" meta_type="CPS Schema"/> 16 <object name="scratch_card_batch.xml" meta_type="CPS Schema"/> 16 17 <object name="student_accommodation" meta_type="CPS Schema"/> 17 18 <object name="student_admission" meta_type="CPS Schema"/> -
WAeUP_SRP/trunk/profiles/default/types.xml
r443 r444 13 13 <object name="Department" meta_type="CPS Flexible Type Information"/> 14 14 <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"/> 15 17 <object name="Semester" meta_type="CPS Flexible Type Information"/> 16 18 <object name="Student" meta_type="CPS Flexible Type Information"/> … … 18 20 <object name="StudentClearance" meta_type="CPS Flexible Type Information"/> 19 21 <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"/> 21 23 <object name="StudentsFolder" meta_type="CPS Flexible Type Information"/> 22 24 <object name="ScratchCardBatchesFolder" meta_type="CPS Flexible Type Information"/> -
WAeUP_SRP/trunk/profiles/default/types/StudentAdmission.xml
r435 r444 23 23 </property> 24 24 <property name="layout_clusters"> 25 <element value=" "/>25 <element value="front_end:student_admission_fe"/> 26 26 </property> 27 27 <property name="flexible_layouts"/> … … 30 30 <alias from="(Default)" to="academics_contents"/> 31 31 <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" 35 34 visible="True"> 36 35 <permission value="View"/> 37 36 </action> 38 37 <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" 41 39 visible="True"> 42 40 <permission value="Modify portal content"/> 43 41 </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> 44 47 </object>
Note: See TracChangeset for help on using the changeset viewer.