Changeset 47 for waeup_product/trunk
- Timestamp:
- 14 Oct 2005, 13:01:35 (19 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 2 added
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r46 r47 61 61 'id' : 'checkadmission', 62 62 'name' : 'Check Admission', 63 'action' : 'string:${object/absolute_url}/check_admission _form',63 'action' : 'string:${object/absolute_url}/check_admission', 64 64 'permission': (View, ), 65 'condition' : ' not:member',65 'condition' : 'member', 66 66 'category' : 'student', 67 67 'visible' : 1, … … 81 81 'action' : 'cpsdocument_edit_form', 82 82 'permission': ( ), 83 'condition' : 'python: here.portal_type == "Student"',83 'condition' : 'python: member and here.portal_type == "Student"', 84 84 'category' : 'student', 85 85 'visible' : 1, … … 91 91 'permission': (), 92 92 'condition' : 'python:not here.portal_type in ("Jamb","StudentsFolder") and len(object.contentItems()) == 0', 93 'category' : 'student', 94 'visible' : 1, 95 }, 96 { 'tool' : 'portal_actions', 97 'id' : 'add_personal', 98 'name' : 'Add personal Data', 99 'action' : 'string:${object/absolute_url}/create_personal_form', 100 'permission': (), 101 'condition' : 'python:not here.portal_type in ("Jamb","StudentsFolder")', 93 102 'category' : 'student', 94 103 'visible' : 1, … … 187 196 'StudentsFolder': 'waeup_section_wf', 188 197 'Student': 'waeup_section_wf', 198 'StudentPersonal': 'waeup_section_wf', 189 199 'Jamb': 'waeup_section_wf', 190 200 'ScratchCard': 'waeup_section_wf', -
waeup_product/trunk/Students.py
r45 r47 2 2 from AccessControl import ClassSecurityInfo 3 3 4 from Products.CMFCore.utils import getToolByName4 from Products.CMFCore.utils import UniqueObject, getToolByName 5 5 from Products.CMFCore.permissions import View 6 6 from Products.CMFCore.permissions import ModifyPortalContent 7 7 from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder 8 from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 8 #from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 9 from Products.CPSDocument.CPSDocument import CPSDocument 9 10 from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 10 11 … … 20 21 security = ClassSecurityInfo() 21 22 23 security.declarePublic("doCheckAdmission") 24 def doCheckAdmission(self,type_name,datamodel): 25 "the admission callback" 26 ## class CPSUnrestrictedUser(UnrestrictedUser): 27 ## """Unrestricted user that still has an id. 28 ## 29 ## Taken from CPSMembershipTool 30 ## """ 31 ## 32 ## def getId(self): 33 ## """Return the ID of the user.""" 34 ## return self.getUserName() 35 print type_name 36 print datamodel 37 return self.REQUEST.RESPONSE.redirect("%s" % self.absolute_url()) 38 mtool = getToolByName(self, 'portal_membership') 39 username = "%s" % datamodel.get('reg_nr') 40 print username 41 member=mtool.getMemberById("S%s" % username) 42 print member 43 from AccessControl.SecurityManagement import newSecurityManager 44 newSecurityManager(None,member.__of__(mtool.acl_users)) 45 # datamodel is passed so that flexti can initialize the object. 46 #datamodel.set('lastname','Meier') 47 student = getattr(self,username) 48 student.invokeFactory('StudentPersonal', '%s' % username) 49 ob = getattr(student, id) 50 ##context.notifyCPSDocumentCreation(ob=ob) 51 return ob 52 22 53 InitializeClass(StudentsFolder) 23 54 24 55 def addStudentsFolder(container, id, REQUEST=None, **kw): 25 56 """Add a Student.""" 26 print id27 57 ob = StudentsFolder(id, **kw) 28 58 return CPSBase_adder(container, ob, REQUEST=REQUEST) … … 30 60 ### The Student 31 61 ### 32 ##class Student( BaseDocument):62 ##class Student(CPSDocument): 33 63 ## """ 34 64 ## WAeUP Student container for the various student data 35 65 ## """ 36 ## meta_type = 'Student'37 ## portal_type = meta_type66 #### meta_type = 'Student' 67 #### portal_type = meta_type 38 68 ## security = ClassSecurityInfo() 39 69 ## 70 ## security.declarePublic("test") 71 ## def test(self): 72 ## """test""" 73 ## return self.REQUEST 74 ## 40 75 ##InitializeClass(Student) 41 # #76 # 42 77 ##def addStudent(container, id, REQUEST=None, **kw): 43 78 ## """Add a Student.""" 44 ## print id45 79 ## ob = Student(id, **kw) 46 80 ## return CPSBase_adder(container, ob, REQUEST=REQUEST) -
waeup_product/trunk/Widgets.py
r22 r47 1 #-*- mode: python; mode: fold -*- 1 2 from Globals import InitializeClass 2 3 from Products.CPSSchemas.Widget import CPSWidgetType … … 11 12 from zLOG import LOG, DEBUG 12 13 13 class StudentIdWidget(CPSStringWidget): 14 class StudentIdWidget(CPSStringWidget): ###( 14 15 """ StudentId Widget""" 15 16 meta_type = "StudentId Widget" … … 19 20 20 21 valid = CPSStringWidget.validate(self, datastructure, **kw) 22 print "studentw",valid 21 23 if not valid: 22 24 return 0 … … 43 45 cls = StudentIdWidget 44 46 45 class ScratchcardPinWidget(CPSStringWidget): 47 ###) 48 49 class ScratchcardPinWidget(CPSStringWidget): ###( 46 50 """ ScratchcardPin Widget""" 47 51 meta_type = "ScratchcardPin Widget" … … 56 60 57 61 valid = CPSStringWidget.validate(self, datastructure, **kw) 62 print "sc_pinw",valid 58 63 if not valid: 59 64 return 0 … … 62 67 value = datastructure[widget_id] 63 68 err = 0 69 print value 64 70 if not value in valid_pins: 65 71 err = 'invalid Pin' … … 74 80 75 81 class ScratchcardPinWidgetType(CPSWidgetType): 76 """S tudent Id Stringwidget type."""82 """Scratchcard Pin widget type.""" 77 83 meta_type = "Scratchcard Pin Widget Type" 78 84 cls = ScratchcardPinWidget 85 86 ###) 87 79 88 ########### 80 89 … … 82 91 WidgetTypeRegistry.register(ScratchcardPinWidgetType) 83 92 84 ##class MyProjectWeekDateTimeWidget(CPSDateTimeWidget): 93 ##class MyProjectWeekDateTimeWidget(CPSDateTimeWidget): ###( 85 94 ## """ """ 86 95 ## meta_type = "MyProject Week Date Time Widget" … … 226 235 ##WidgetTypeRegistry.register(MyProjectVisitTitleWidgetType) 227 236 ## 237 238 ###) -
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r45 r47 1 #-*- mode: python; mode: fold -*- 1 2 ##parameters= 2 3 # $Id$ 3 4 """Return custom layouts types.""" 4 layouts = {} 5 6 # common header layout 7 common_layout = { 5 6 ## 'widgets': { ###( 7 ## '': { 8 ## 'type': 'String Widget', 9 ## 'data': { 10 ## 'title': '', 11 ## 'fields': ('',), 12 ## 'is_required': False, 13 ## 'label': '', 14 ## 'label_edit': '', 15 ## 'description': '', 16 ## 'help': '', 17 ## 'is_i18n': False, 18 ## 'readonly_layout_modes': (), 19 ## 'hidden_layout_modes': (), 20 ## 'hidden_readonly_layout_modes': (), 21 ## 'hidden_empty': False, 22 ## 'hidden_if_expr': '', 23 ## 'css_class': '', 24 ## 'widget_mode_expr': '', 25 ## 'display_width': 10, 26 ## 'size_max': 0, 27 ## }, 28 29 ###) 30 31 common_layout = {###( 8 32 'widgets': { 9 33 'LanguageSelector': { … … 70 94 }, 71 95 } 72 layouts['waeup_common'] = common_layout73 96 # 74 # 75 student_layout = { 97 ###) 98 99 student_layout = { ###( 76 100 'widgets': { 77 101 'jamb_is_admitted': { … … 119 143 }, 120 144 }, 121 'jamb_pin_usage': {122 'type': 'Int Widget',123 'data': {124 'title': 'Jamb Pin usage',125 'fields': ('jamb_pin_usage',),126 'is_required': False,127 'label': 'Nr of Cardusage',128 'label_edit': 'Nr of Cardusage',129 'description': '',130 'help': 'How many times has the scratchcard been used',131 'is_i18n': False,132 'readonly_layout_modes': (),133 'hidden_layout_modes': (),134 'hidden_readonly_layout_modes': (),135 'hidden_empty': False,136 'hidden_if_expr': '',137 'css_class': '',138 'widget_mode_expr': '',139 'display_width': 2,140 'size_max': 2,141 },142 },145 ## 'jamb_pin_usage': { 146 ## 'type': 'Int Widget', 147 ## 'data': { 148 ## 'title': 'Jamb Pin usage', 149 ## 'fields': ('jamb_pin_usage',), 150 ## 'is_required': False, 151 ## 'label': 'Nr of Cardusage', 152 ## 'label_edit': 'Nr of Cardusage', 153 ## 'description': '', 154 ## 'help': 'How many times has the scratchcard been used', 155 ## 'is_i18n': False, 156 ## 'readonly_layout_modes': (), 157 ## 'hidden_layout_modes': (), 158 ## 'hidden_readonly_layout_modes': (), 159 ## 'hidden_empty': False, 160 ## 'hidden_if_expr': '', 161 ## 'css_class': '', 162 ## 'widget_mode_expr': '', 163 ## 'display_width': 2, 164 ## 'size_max': 2, 165 ## }, 166 ## }, 143 167 'faculty': { 144 168 'type': 'String Widget', … … 171 195 [{'widget_id': 'jamb_is_admitted', 'ncols': 1},], 172 196 [{'widget_id': 'jamb_where_admitted', 'ncols': 1},], 173 [{'widget_id': 'jamb_pin_usage', 'ncols': 1},],197 #[{'widget_id': 'jamb_pin_usage', 'ncols': 1},], 174 198 [{'widget_id': 'faculty', 'ncols': 1},], 175 199 ] 176 200 }, 177 201 } 178 layouts['student'] = student_layout 179 # 180 # 181 scratch_card = { 202 ###) 203 204 student_personal_layout = { ###( 205 'widgets': { 206 'firstname': { 207 'type': 'String Widget', 208 'data': { 209 'title': '', 210 'fields': ('firstname',), 211 'is_required': False, 212 'label': 'First Name', 213 'label_edit': 'First Name', 214 'description': '', 215 'help': '', 216 'is_i18n': False, 217 'readonly_layout_modes': (), 218 'hidden_layout_modes': (), 219 'hidden_readonly_layout_modes': (), 220 'hidden_empty': False, 221 'hidden_if_expr': '', 222 'css_class': '', 223 'widget_mode_expr': '', 224 'display_width': 10, 225 'size_max': 0, 226 }, 227 }, 228 'middlename': { 229 'type': 'String Widget', 230 'data': { 231 'title': '', 232 'fields': ('middlename',), 233 'is_required': False, 234 'label': 'Middle Name', 235 'label_edit': 'Middle Name', 236 'description': '', 237 'help': '', 238 'is_i18n': False, 239 'readonly_layout_modes': (), 240 'hidden_layout_modes': (), 241 'hidden_readonly_layout_modes': (), 242 'hidden_empty': False, 243 'hidden_if_expr': '', 244 'css_class': '', 245 'widget_mode_expr': '', 246 'display_width': 10, 247 'size_max': 0, 248 }, 249 }, 250 'lastname': { 251 'type': 'String Widget', 252 'data': { 253 'title': '', 254 'fields': ('lastname',), 255 'is_required': False, 256 'label': 'Last Name', 257 'label_edit': 'Last Name', 258 'description': '', 259 'help': '', 260 'is_i18n': False, 261 'readonly_layout_modes': (), 262 'hidden_layout_modes': (), 263 'hidden_readonly_layout_modes': (), 264 'hidden_empty': False, 265 'hidden_if_expr': '', 266 'css_class': '', 267 'widget_mode_expr': '', 268 'display_width': 10, 269 'size_max': 0, 270 }, 271 }, 272 'sex': { 273 'type': 'Boolean Widget', 274 'data': { 275 'title': '', 276 'fields': ('sex',), 277 'is_required': False, 278 'label': 'Sex', 279 'label_edit': 'Sex', 280 'label_false': 'male', 281 'label_true': 'female', 282 'description': '', 283 'help': '', 284 'is_i18n': False, 285 'readonly_layout_modes': (), 286 'hidden_layout_modes': (), 287 'hidden_readonly_layout_modes': (), 288 'hidden_empty': False, 289 'hidden_if_expr': '', 290 'css_class': '', 291 'widget_mode_expr': '', 292 'display_width': 10, 293 'size_max': 0, 294 }, 295 }, 296 'birthday': { 297 'type': 'Date Widget', 298 'data': { 299 'title': '', 300 'fields': ('birthday',), 301 'is_required': False, 302 'label': '', 303 'label_edit': 'Day of birth', 304 'description': 'Day of birth', 305 'help': '', 306 'is_i18n': False, 307 'readonly_layout_modes': (), 308 'hidden_layout_modes': (), 309 'hidden_readonly_layout_modes': (), 310 'hidden_empty': False, 311 'hidden_if_expr': '', 312 'css_class': '', 313 'widget_mode_expr': '', 314 'display_width': 10, 315 'size_max': 0, 316 }, 317 }, 318 }, 319 'layout': { 320 'style_prefix': 'layout_default_', 321 'flexible_widgets': (), 322 'ncols': 1, 323 'rows': [ 324 [{'widget_id': 'firstname', 'ncols': 1},], 325 [{'widget_id': 'middlename', 'ncols': 1},], 326 [{'widget_id': 'lastname', 'ncols': 1},], 327 [{'widget_id': 'sex', 'ncols': 1},], 328 [{'widget_id': 'birthday', 'ncols': 1},], 329 ] 330 }, 331 } 332 333 ###) 334 335 scratch_card = { ###( 182 336 'widgets': { 183 337 'sc_id': { … … 237 391 } 238 392 239 layouts['scratch_card'] = scratch_card 240 241 jamb_layout = { 393 394 ###) 395 396 admission = { ###( 397 'widgets': { 398 'sc_id': { 399 'type': 'String Widget', 400 'data': { 401 'title': 'SC ID', 402 'fields': ('admission_sc_id',), 403 'is_required': False, 404 'label': 'Card Serial Number ', 405 'label_edit': 'Card Serial Number', 406 'description': 'Card Serial Number ', 407 'help': 'This can be found on the bottom right of the reverse side of your Scratch Card', 408 'is_i18n': False, 409 'readonly_layout_modes': (), 410 'hidden_layout_modes': (), 411 'hidden_readonly_layout_modes': (), 412 'hidden_empty': False, 413 'hidden_if_expr': 'python:1', 414 'css_class': '', 415 'widget_mode_expr': '', 416 'display_width': 10, 417 'size_max': 0, 418 }, 419 }, 420 'sc_pin': { 421 'type': 'String Widget', 422 'data': { 423 'title': 'SC Pin', 424 'fields': ('admission_sc_pin'), 425 'is_required': True, 426 'label': 'PIN', 427 'label_edit': 'PIN', 428 'description': '', 429 'help': 'PIN-(Personal Identification Number) is an 8 or 12 digit number on the reverse side of the scratch card which you can purchase from many Banks', 430 'is_i18n': False, 431 'readonly_layout_modes': (), 432 'hidden_layout_modes': (), 433 'hidden_readonly_layout_modes': (), 434 'hidden_empty': False, 435 'hidden_if_expr': '', 436 'css_class': '', 437 'widget_mode_expr': '', 438 'display_width': 10, 439 'size_max': 10, 440 }, 441 }, 442 'jamb_id': { 443 'type': 'StudentId Widget', 444 'data': { 445 'title': 'Registration Number', 446 'fields': ('reg_nr'), 447 'is_required': True, 448 'label': 'Registration Number', 449 'label_edit': 'Registration Number', 450 'description': '', 451 'help': 'This is the combination of 8 digits and 2 letters you are assigned when you purchase an examination form.', 452 'is_i18n': False, 453 'readonly_layout_modes': (), 454 'hidden_layout_modes': (), 455 'hidden_readonly_layout_modes': (), 456 'hidden_empty': False, 457 'hidden_if_expr': '', 458 'css_class': '', 459 'widget_mode_expr': '', 460 'display_width': 10, 461 'size_max': 10, 462 }, 463 }, 464 }, 465 'layout': { 466 'style_prefix': 'layout_admission_', 467 'flexible_widgets': (), 468 'ncols': 1, 469 'rows': [ 470 [{'widget_id': 'sc_id', 'ncols': 1},], 471 [{'widget_id': 'sc_pin', 'ncols': 1},], 472 [{'widget_id': 'jamb_id', 'ncols': 1},], 473 ] 474 }, 475 } 476 477 ###) 478 479 jamb_layout = { ###( 242 480 'widgets': { 243 481 'reg_nr': { … … 459 697 }, 460 698 } 461 699 ###) 700 701 layouts = {} 702 layouts['waeup_common'] = common_layout 703 layouts['student'] = student_layout 704 layouts['student_personal'] = student_personal_layout 705 layouts['scratch_card'] = scratch_card 706 layouts['admission'] = admission 462 707 layouts['jamb'] = jamb_layout 463 464 708 return layouts -
waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
r45 r47 1 university_schema = { 1 #-*- mode: python; mode: fold -*- 2 # $Id$ 3 4 university_schema = { ###( 2 5 'allow_discussion': { 3 6 'type': 'CPS Int Field', … … 9 12 } 10 13 11 students_folder_schema = { 14 ###) 15 16 students_folder_schema = { ###( 12 17 'allow_discussion': { 13 18 'type': 'CPS Int Field', … … 19 24 } 20 25 21 student_schema = { 26 ###) 27 28 student_schema = { ###( 22 29 'allow_discussion': { 23 30 'type': 'CPS Int Field', … … 81 88 }, 82 89 }, 83 'jamb_pin_usage': {84 'type': 'CPS Int Field',85 'data': {86 'default_expr': 'python:0',87 'is_searchabletext': False,88 'acl_read_permissions': '',89 'acl_read_roles': '',90 'acl_read_expr': '',91 'acl_write_permissions': '',92 'acl_write_roles': '',93 'acl_write_expr': '',94 'read_ignore_storage': False,95 'read_process_expr': '',96 'read_process_dependent_fields': (),97 'write_ignore_storage': False,98 'write_process_expr': '',99 },100 },101 90 } 102 91 # 92 ###) 93 94 student_personal_schema = { ###( 95 'allow_discussion': { 96 'type': 'CPS Int Field', 97 'data': { 98 'default_expr': 'python:0', 99 'is_searchabletext': 0, 100 }, 101 }, 102 'firstname': { 103 'type': 'CPS String Field', 104 'data': { 105 'is_searchabletext': 1, 106 }, 107 }, 108 'middlename': { 109 'type': 'CPS String Field', 110 'data': { 111 'is_searchabletext': 1, 112 }, 113 }, 114 'lastname': { 115 'type': 'CPS String Field', 116 'data': { 117 'is_searchabletext': 1, 118 }, 119 }, 120 'sex': { 121 'type': 'CPS Boolean Field', 122 'data': { 123 'is_searchabletext': 1, 124 }, 125 }, 126 'birthday': { 127 'type': 'CPS DateTime Field', 128 'data': { 129 'is_searchabletext': 1, 130 }, 131 }, 132 } 103 133 # 104 jamb_schema = { 134 ###) 135 136 jamb_schema = { ###( 105 137 'allow_discussion': { 106 138 'type': 'CPS Int Field', … … 115 147 'default_expr': 'string:', 116 148 'is_searchabletext': True, 149 'acl_read_permissions': '', 150 'acl_read_roles': '', 151 'acl_read_expr': '', 152 'acl_write_permissions': '', 153 'acl_write_roles': '', 154 'acl_write_expr': '', 155 'read_ignore_storage': False, 156 'read_process_expr': '', 157 'read_process_dependent_fields': (), 158 'write_ignore_storage': False, 159 'write_process_expr': '', 160 }, 161 }, 162 'admission_sc_id': { 163 'type': 'CPS String Field', 164 'data': { 165 'default_expr': '', 166 'is_searchabletext': True, 167 'acl_read_permissions': '', 168 'acl_read_roles': '', 169 'acl_read_expr': '', 170 'acl_write_permissions': '', 171 'acl_write_roles': '', 172 'acl_write_expr': '', 173 'read_ignore_storage': False, 174 'read_process_expr': '', 175 'read_process_dependent_fields': (), 176 'write_ignore_storage': False, 177 'write_process_expr': '', 178 }, 179 }, 180 'admission_sc_pin': { 181 'type': 'CPS String Field', 182 'data': { 183 'is_searchabletext': True, 184 'acl_read_permissions': '', 185 'acl_read_roles': '', 186 'acl_read_expr': '', 187 'acl_write_permissions': '', 188 'acl_write_roles': '', 189 'acl_write_expr': '', 190 'read_ignore_storage': False, 191 'read_process_expr': '', 192 'read_process_dependent_fields': (), 193 'write_ignore_storage': False, 194 'write_process_expr': '', 195 }, 196 }, 197 'admission_sc_pin_usage': { 198 'type': 'CPS Int Field', 199 'data': { 200 'default_expr': 'python:0', 201 'is_searchabletext': False, 117 202 'acl_read_permissions': '', 118 203 'acl_read_roles': '', … … 274 359 } 275 360 276 scratch_card = { 277 'allow_discussion': { 278 'type': 'CPS Int Field', 279 'data': { 280 'default_expr': 'python:0', 281 'is_searchabletext': 0, 282 }, 283 }, 284 'sc_id': { 285 'type': 'CPS String Field', 286 'data': { 287 'default_expr': '', 288 'is_searchabletext': 0, 289 'acl_read_permissions': '', 290 'acl_read_roles': '', 291 'acl_read_expr': '', 292 'acl_write_permissions': '', 293 'acl_write_roles': '', 294 'acl_write_expr': '', 295 'read_ignore_storage': False, 296 'read_process_expr': '', 297 'read_process_dependent_fields': (), 298 'write_ignore_storage': False, 299 'write_process_expr': '', 300 }, 301 }, 302 'sc_pin': { 303 'type': 'CPS String Field', 304 'data': { 305 'default_expr': '', 306 'is_searchabletext': 0, 307 'acl_read_permissions': '', 308 'acl_read_roles': '', 309 'acl_read_expr': '', 310 'acl_write_permissions': '', 311 'acl_write_roles': '', 312 'acl_write_expr': '', 313 'read_ignore_storage': False, 314 'read_process_expr': '', 315 'read_process_dependent_fields': (), 316 'write_ignore_storage': False, 317 'write_process_expr': '', 318 }, 319 }, 320 } 361 ###) 362 363 ##scratch_card = { ###( 364 #### 'allow_discussion': { 365 #### 'type': 'CPS Int Field', 366 #### 'data': { 367 #### 'default_expr': 'python:0', 368 #### 'is_searchabletext': 0, 369 #### }, 370 #### }, 371 ## 'sc_id': { 372 ## 'type': 'CPS String Field', 373 ## 'data': { 374 ## 'default_expr': '', 375 ## 'is_searchabletext': 0, 376 ## 'acl_read_permissions': '', 377 ## 'acl_read_roles': '', 378 ## 'acl_read_expr': '', 379 ## 'acl_write_permissions': '', 380 ## 'acl_write_roles': '', 381 ## 'acl_write_expr': '', 382 ## 'read_ignore_storage': False, 383 ## 'read_process_expr': '', 384 ## 'read_process_dependent_fields': (), 385 ## 'write_ignore_storage': False, 386 ## 'write_process_expr': '', 387 ## }, 388 ## }, 389 ## 'sc_pin': { 390 ## 'type': 'CPS String Field', 391 ## 'data': { 392 ## 'default_expr': '', 393 ## 'is_searchabletext': 0, 394 ## 'acl_read_permissions': '', 395 ## 'acl_read_roles': '', 396 ## 'acl_read_expr': '', 397 ## 'acl_write_permissions': '', 398 ## 'acl_write_roles': '', 399 ## 'acl_write_expr': '', 400 ## 'read_ignore_storage': False, 401 ## 'read_process_expr': '', 402 ## 'read_process_dependent_fields': (), 403 ## 'write_ignore_storage': False, 404 ## 'write_process_expr': '', 405 ## }, 406 ## }, 407 ##} 321 408 schemas = {} 409 ###) 410 322 411 schemas['university'] = university_schema 323 412 schemas['students'] = students_folder_schema 324 413 schemas['student'] = student_schema 414 schemas['student_personal'] = student_personal_schema 325 415 schemas['jamb'] = jamb_schema 326 schemas['scratch_card'] = scratch_card416 #schemas['scratch_card'] = scratch_card 327 417 328 418 return schemas -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r45 r47 1 #-*- mode: python; mode: fold -*- 1 2 ##parameters= 2 3 # $Id$ … … 8 9 ChangePermissions = 'Change permissions' 9 10 10 university_type = { 11 university_type = { ###( 11 12 'title': 'WAeUP Base Folder', 12 13 'description': 'The WAeUP Container', … … 55 56 } 56 57 57 students_folder_type = { 58 ###) 59 60 students_folder_type = { ###( 58 61 'title': 'WAeUP Student Folder', 59 62 'description': 'The WAeUP Student Folder', … … 103 106 } 104 107 105 student_type = { 108 ###) 109 110 student_type = { ###( 106 111 'title': 'WAeUP Student', 107 112 'description': '', … … 116 121 'global_allow': True, 117 122 'filter_content_types': True, 118 'allowed_content_types': ('Jamb', ),123 'allowed_content_types': ('Jamb','StudentPersonal'), 119 124 'allow_discussion': False, 120 125 'cps_is_searchable': True, … … 130 135 {'id': 'view', 131 136 'name': 'action_view', 132 #'action': 'string:${object_url}/student_view',133 'action': 'string:${object_url}/cpsdocument_view',137 'action': 'string:${object_url}/student_view', 138 #'action': 'string:${object_url}/cpsdocument_view', 134 139 'condition': '', 135 140 'permission': ('View',), … … 137 142 'visible': True,}, 138 143 {'id': 'new_content', 139 'name': 'Add JambData',144 'name': 'Add Data', 140 145 'action': 'string:${object_url}/folder_factories', 141 'condition': "python: len(object.contentItems()) == 0 ",146 'condition': "python:1 or len(object.contentItems()) == 0 ", 142 147 'permission': ('Modify portal content',), 143 148 'category': 'object', … … 146 151 'name': 'action_folder_contents', 147 152 'action': 'string:${object_url}/folder_contents', 148 'condition': "python: object.getTypeInfo().cps_proxy_type != 'document'",153 'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'", 149 154 'permission': ('Modify portal content',), 150 155 'category': 'object', … … 159 164 ) 160 165 } 161 scratch_card = { 166 167 ###) 168 169 scratch_card = { ###( 162 170 'title': 'WAeUP Scratchcard', 163 171 'description': '', … … 210 218 } 211 219 # 212 # 213 jamb_type = { 220 ###) 221 222 jamb_type = { ###( 214 223 'title': "JAMB data", 215 224 'description': 'The data from JAMB', … … 229 238 #'schemas': ['common','metadata','jamb'], 230 239 'schemas': ['jamb'], 231 'layouts': ['jamb',], 240 'layouts': ['jamb'], 241 'flexible_layouts': (), 242 'storage_methods': ('admitted:store_admission_pin'), 243 'cps_workspace_wf': 'workspace_content_wf', 244 'cps_section_wf': 'section_content_wf', 245 } 246 247 ###) 248 249 student_personal_type = { ###( 250 'title': "Student personal data", 251 'description': '', 252 'content_icon': '', 253 'content_meta_type': 'CPS Document', 254 'product': 'CPSDocument', 255 'factory': 'addCPSDocument', 256 'immediate_view': 'cpsdocument_view', 257 'global_allow': True, 258 'filter_content_types': True, 259 'allowed_content_types': (), 260 'allow_discussion': False, 261 'cps_is_searchable': True, 262 'cps_proxy_type': 'document', 263 'cps_display_as_document_in_listing': True, 264 'cps_is_portalbox': False, 265 #'schemas': ['common','metadata','jamb'], 266 'schemas': ['student_personal'], 267 'layouts': ['student_personal'], 232 268 'flexible_layouts': (), 233 269 'storage_methods': (), … … 235 271 'cps_section_wf': 'section_content_wf', 236 272 } 273 ###) 237 274 238 275 types = {} … … 240 277 types['StudentsFolder'] = students_folder_type 241 278 types['Student'] = student_type 279 types['StudentPersonal'] = student_personal_type 242 280 types['ScratchCard'] = scratch_card 243 281 types['Jamb'] = jamb_type -
waeup_product/trunk/skins/waeup_default/portlet_studentnavigation.pt
r46 r47 1 1 <tal:block define="mtool here/portal_membership; 2 anonymous mtool/isAnonymousUser" 2 anonymous mtool/isAnonymousUser; 3 user python: mtool.getAuthenticatedMember(); 4 folder_id python:str(user)[1:]" 3 5 > 4 <tal:block condition=" not:anonymous">6 <tal:block condition="python: not anonymous"> 5 7 <a href="" i18n:translate="" 6 tal:attributes="href string:${here/portal_url}/sections/unidemo/students ">Studentadministration</a>8 tal:attributes="href string:${here/portal_url}/sections/unidemo/students/${folder_id}">Studentadministration</a> 7 9 </tal:block> 8 10 <tal:block condition="anonymous"> -
waeup_product/trunk/skins/waeup_student/check_admission.py
r25 r47 1 ##parameters=REQUEST=None 1 ##parameters=REQUEST 2 # $Id$ 3 """ 4 process the Admission Form 2 5 3 # $Id$ 6 return html renderer + psm 7 """ 8 type_name = 'Jamb' 9 ti = context.portal_types[type_name] 4 10 5 admin = "SectionManager" in context.portal_membership.getAuthenticatedMember().getRolesInContext(context)11 REQUEST.set('type_name',type_name) 6 12 7 return context.student_admitted_form() 13 validate = REQUEST.has_key("cpsdocument_edit_button") 14 15 #student = context.getContent() 16 student = context 17 18 #jamb = getattr(student,'my-jamb').getContent() 19 jamb = getattr(student,'my-jamb') 20 21 ##res = jamb.validateStoreRender(request=REQUEST, 22 ## layout_mode='create', 23 ## layout_mode_ok='admitted', 24 ## layout_mode_err='create', 25 ## layout_id='admission', 26 ## ) 27 28 lt = context.portal_layouts 29 30 res,psm,ds = lt.renderLayout(layout_id= 'admission', 31 schema_id= 'jamb', 32 context=context, 33 mapping=validate and REQUEST, 34 ob={}, 35 layout_mode='create', 36 ) 37 if psm == 'invalid': 38 return context.check_admission_form(rendered = res, 39 psm = psm, 40 ds = ds, 41 ) 42 43 elif psm == 'valid': 44 return context.student_admitted_form(rendered = res, 45 psm = psm, 46 student = student, 47 jamb = jamb, 48 ) 49 50 return res,psm,ds 51 -
waeup_product/trunk/skins/waeup_student/check_admission_form.pt
r25 r47 1 <metal:html use-macro="here/main_template/macros/master"> 1 <tal:block define="rendered_main options/rendered; 2 portal_status_message options/psm; 3 data_storage options/ds; 4 edition python:1;" 5 > 6 <metal:block define-macro="edit_form"> 7 <metal:block use-macro="here/content_lib_master/macros/master"> 8 <metal:block fill-slot="header" 9 tal:define="creation creation|nothing; 10 edition edition|nothing; 11 metadata metadata|nothing" 12 > 13 </metal:block> 2 14 3 <metal:block fill-slot="header" /> 4 <metal:main fill-slot="main" tal:define="lotool here/portal_layouts"> 5 <metal:block tal:condition="python: 1" define-macro="default_view" 6 tal:define="layout python: lotool.checkadmission; 7 ldef python: lotool.checkadmission.getLayoutDefinition()" 8 > 9 <form action='check_admission' method='post' 10 enctype='multipart/form-data' class='workflow'> 11 <table tal:condition="python: 1" width="100%" cellpadding="2" cellspacing="2" border="0" 12 summary="layout"> 13 <tr valign="top"> 14 <td colspan="1"> 15 <div class=""> 16 <div class="label"> 17 <label>Student Id</label> 18 </div> 19 <div class="field"> 20 <input name="student Id" type="text" value="" size="10" /> 21 </div> 22 </div> 23 </td> 24 </tr> 25 <tr valign="top"> 26 <td colspan="1"> 27 <div class="label"> 28 <label>Scratch Card Pin</label> 29 </div> 30 <div class="field"> 31 <input name="sc_pin" type="text" value="" size="10" /> 32 </div> 33 </td> 34 </tr> 35 <tr valign="top"> 36 <td colspan="1"> 37 <input type="submit" class="standalone" 38 name="cpsdocument_create_button" value="check" /> 39 </td> 40 </tr> 41 </table> 42 </form> 15 <metal:block fill-slot="main"> 16 <span tal:content="structure data_storage" /> 17 <h1>check your admission to the UniDemo !</h1> 18 <div tal:replace="structure rendered_main" /> 43 19 </metal:block> 44 </metal:main> 45 </metal:html> 20 21 </metal:block> 22 </metal:block> 23 </tal:block> -
waeup_product/trunk/skins/waeup_student/student_admitted_form.pt
r29 r47 1 <tal:block define="rendered_main options/rendered; 2 portal_status_message options/psm; 3 jamb options/jamb/getContent; 4 student options/student/getContent; 5 edition python:1;" 6 > 1 7 <metal:html use-macro="here/main_template/macros/master"> 2 3 8 <metal:block fill-slot="header" /> 4 <metal:main fill-slot="main" tal:define="lotool here/portal_layouts"> 5 <metal:block tal:condition="python: 1" define-macro="default_view" 6 tal:define="layout python: lotool.checkadmission; 7 ldef python: lotool.checkadmission.getLayoutDefinition()" 8 > 9 <form action='check_addmission' method='post' 10 enctype='multipart/form-data' class='workflow'> 11 <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0"> 12 <TR> 13 <td colspan=""> 14 Disclaimer 15 </TD> 16 </TR> 17 <TR> 18 <td colspan=""> 19 <span>The result information given below is correct at the time of release of results by the Board. The board accepts no responsibility there after for any errors or omissions caused as a result of transmission via the internet or downloading or printing by the user. <p> Candidates are required to obtain their results slips from the Board as the result information contained herein does not constitute valid admission documentation and will therefore not be acceptable as such the institution applied to and/or the Board</p></span> 20 </TD> 21 </TR> 22 <TR> 23 <td colspan=""> 24 <span >Examination</span></TD> 25 <td colspan=""> 26 <span>UME 2005/2006</span></TD> 27 </TR> 28 <tr> 29 <td colspan="2"> 30 <span>Personal Information</span></TD> 31 </tr> 32 <tr> 33 <TD width="50%"> 34 Candidate Name</TD> 35 <TD> 36 <span>Olomide Kingshasa</span></TD> 37 </tr> 38 <tr> 39 <TD>Registration Number</TD> 40 <TD> 41 <span>1234567AC</span></TD> 42 </tr> 43 <tr> 44 <TD colspan="2"> 45 <span>Examination Information</span></TD> 46 </tr> 47 <tr> 48 <TD>Examination Number</TD> 49 <TD> 50 Examination Centre Name</TD> 51 </tr> 52 <tr> 53 <TD > 54 <span>4568</span> 55 <span>401</span></TD> 56 <TD> 57 <span>Imaguero College (Snr) Sapele Rd B/C</span></TD> 58 </tr> 59 <TR> 60 <TD colspan="2"> 61 <span>Subjects Information</span> 62 </TD> 63 </TR> 64 <TR> 65 <TD colspan="2"> 66 <table cellspacing="0" rules="all" border="0"> 67 <tr> 68 <td>Subject</td><td>Score</td> 69 </tr> 70 <tr> 71 <td>Use of English</td><td>32</td> 72 </tr> 73 <tr> 74 <td>Economics</td><td>34</td> 75 </tr> 76 <tr> 77 <td>Government</td><td>34</td> 78 </tr> 79 <tr> 80 <td>Mathematics</td><td>31</td> 81 </tr> 82 </table> 83 </TD> 84 </TR> 85 <TR> 86 <TD>Aggregate</TD> 87 <TD> 88 <span>131</span> 89 </TD> 90 </TR> 91 <tr> 92 <TD colspan="2"><span>Admission Information</span></TD> 93 </tr> 94 <tr> 95 <TD colspan="2" align="left"> 96 <span>NO ADMISSION OFFERED YET</span> 97 <HR width="100%" SIZE="1" /> 98 </TD> 99 </tr> 100 <TR> 101 <TD> 102 <span>Card Use</span> 103 </TD> 104 <TD> 105 <span>1 of 5</span> 106 </TD> 107 </TR> 108 </TABLE> 109 </form> 110 </metal:block> 111 </metal:main> 112 </metal:html> 9 <metal:main fill-slot="main"> 10 <span tal:condition="python: 1" tal:content="jamb/reg_nr" /> 11 <span tal:condition="python: 1" tal:content="jamb/admission_sc_pin" /> 12 <span tal:content="student/title_or_id" /> 13 </metal:main> 14 </metal:html> 15 </tal:block> -
waeup_product/trunk/skins/waeup_student/student_index_html.py
r44 r47 3 3 # $Id$ 4 4 5 """Default view for the forum. If post_id is not None, post with id = <post_id> 6 will be displayed, otherwise first post will be displayed.""" 5 """Default view for the Student.""" 7 6 8 7 return context.student_view_main()
Note: See TracChangeset for help on using the changeset viewer.