Changeset 103 for waeup_product/trunk/skins/waeup_default
- Timestamp:
- 27 Oct 2005, 16:06:03 (19 years ago)
- Location:
- waeup_product/trunk/skins/waeup_default
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/skins/waeup_default/create_common.py
r96 r103 39 39 context.invokeFactory(type_name,oid) 40 40 object = getattr(context,oid) 41 okw = {'Title': ds.get('Title'),42 'Description': ds.get('Description')43 }44 41 object.getContent().edit(mapping=ds) 42 context.notifyCPSDocumentCreation(ob=object) 45 43 psm = 'new %s created' % oid 46 44 context_ti = context.portal_types[context.portal_type] 47 45 index = context_ti.getActionById('view','university_view') 48 46 return getattr(context,index)(psm=psm) 49 name = ds.get('name')50 student = getattr(context,s_id)51 student.edit(mapping=skw)52 context.notifyCPSDocumentCreation(ob=student)53 jamb_id = 'JAMB'54 student.invokeFactory('Jamb',jamb_id)55 jamb = getattr(student,jamb_id)56 ds.set('title', name)57 jamb.edit(mapping=ds)58 context.notifyCPSDocumentCreation(ob=jamb)59 psm = 'Student created'60 noCPSMember = False61 try:62 pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember','Student'))63 except:64 noCPSMember = True65 if noCPSMember:66 pr.addMember(s_id, 'UnSeT',roles=('Member',))67 ## groups = context.portal_directories.groups68 ## gm = list(groups.getEntry('Students')['members'])69 ## gm.extend((s_id,))70 ## groups.editEntry({'group': 'Students',71 ## 'members': gm})72 ## return context.create_jamb_form(rendered = res,73 ## psm = psm,74 ## ds = ds,75 ## )76 77 return res,psm,ds78 47 -
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r101 r103 826 826 course = { ###( 827 827 'widgets': { 828 'heading': Heading, 828 'heading': { 829 'type': 'Heading Widget', 830 'data': { 831 'fields': ['heading'], 832 'level': 1, 833 'is_i18n': 0, 834 'is_required': 1, 835 'label_edit': 'Title', 836 'help': 'Course Title', 837 'display_width': 40, 838 'size_max': 40, 839 }, 840 }, 829 841 'text': Text, 830 842 'level': { 831 'type': 'S tringWidget',843 'type': 'Select Widget', 832 844 'data': { 833 845 'title': '', … … 839 851 'help': '', 840 852 'is_i18n': False, 841 'display_width': 10, 842 'size_max': 0, 853 'vocabulary': 'courselevel', 843 854 }, 844 855 }, … … 925 936 ###) 926 937 927 accom odation = { ###(938 accommodation = { ###( 928 939 'widgets': { 929 'heading': Heading, 940 'heading': { 941 'type': 'Heading Widget', 942 'data': { 943 'fields': ['heading'], 944 'level': 1, 945 'is_i18n': 0, 946 'is_required': 1, 947 'label_edit': 'Hallname', 948 'help': '', 949 'display_width': 40, 950 'size_max': 40, 951 }, 952 }, 930 953 'text': Text, 931 '': { 932 'type': 'String Widget', 933 'data': { 934 'title': '', 935 'fields': ('level',), 936 'is_required': True, 937 'label': 'Level', 938 'label_edit': 'Level', 939 'description': '', 940 'help': '', 941 'is_i18n': False, 942 'display_width': 10, 943 'size_max': 0, 944 }, 945 }, 946 'code': { 947 'type': 'String Widget', 948 'data': { 949 'title': 'Code', 950 'fields': ('code',), 951 'is_required': True, 952 'label': 'Code', 953 'label_edit': 'Code', 954 'description': '', 955 'help': '', 956 'is_i18n': False, 957 'display_width': 10, 958 'size_max': 0, 959 }, 960 }, 961 'semester': { 954 'which_sex': { 962 955 'type': 'Boolean Widget', 963 956 'data': { 964 957 'title': '', 965 'fields': ('semester',), 966 'is_required': True, 967 'label': 'Semester', 968 'label_edit': 'Semester', 969 'label_false': 'Second Semester', 970 'label_true': 'First Semester', 971 'description': '', 972 'help': '', 973 'is_i18n': False, 974 'display_width': 10, 975 'size_max': 0, 976 }, 977 }, 978 'credit': { 979 'type': 'Int Widget', 980 'data': { 981 'title': '', 982 'fields': ('credit',), 983 'is_required': True, 984 'label': 'Credit', 985 'label_edit': 'Credit', 986 'description': '', 987 'help': '', 988 'is_i18n': False, 989 'display_width': 2, 990 'size_max': 0, 991 }, 992 }, 993 'core_elective': { 994 'type': 'Boolean Widget', 995 'data': { 996 'title': '', 997 'fields': ('core_elective',), 998 'is_required': True, 999 'label': 'Core or elective', 1000 'label_edit': 'Core or elective', 1001 'label_true': 'Core Course', 1002 'label_false': 'Elective Course', 1003 'description': '', 1004 'help': '', 1005 'is_i18n': False, 1006 'display_width': 10, 1007 'size_max': 0, 958 'fields': ('which_sex',), 959 'is_required': False, 960 'label': 'sex', 961 'label_edit': 'sex', 962 'label_false': 'male', 963 'label_true': 'female', 964 'description': '', 965 'help': '', 966 'is_i18n': False, 967 }, 968 }, 969 'nr_of_blocks': { 970 'type': 'Select Widget', 971 'data': { 972 'title': '', 973 'fields': ('nr_of_blocks',), 974 'is_required': True, 975 'label': 'Nr of Blocks', 976 'label_edit': 'Nr of Blocks', 977 'description': '', 978 'help': 'Number of Blocks this Hall has', 979 'is_i18n': False, 980 'vocabulary': 'range10', 981 }, 982 }, 983 'nr_of_floors': { 984 'type': 'Select Widget', 985 'data': { 986 'title': '', 987 'fields': ('nr_of_floors',), 988 'is_required': True, 989 'label': 'Nr of Floors ', 990 'label_edit': 'Nr of Floors', 991 'description': '', 992 'help': 'Number of Floors per Block this Hall has', 993 'is_i18n': False, 994 'vocabulary': 'range5', 995 }, 996 }, 997 'rooms_per_floor': { 998 'type': 'Select Widget', 999 'data': { 1000 'title': '', 1001 'fields': ('rooms_per_floor',), 1002 'is_required': True, 1003 'label': 'Rooms per Floor', 1004 'label_edit': 'Rooms per Floor', 1005 'description': '', 1006 'help': 'Number of Rooms per Floor this Hall has', 1007 'is_i18n': False, 1008 'vocabulary': 'range50', 1009 }, 1010 }, 1011 'beds_per_room': { 1012 'type': 'Select Widget', 1013 'data': { 1014 'title': '', 1015 'fields': ('beds_per_room',), 1016 'is_required': True, 1017 'label': 'Beds per Room', 1018 'label_edit': 'Beds per Room', 1019 'description': '', 1020 'help': 'Number of Beds per Room this Hall has', 1021 'is_i18n': False, 1022 'vocabulary': 'range10', 1008 1023 }, 1009 1024 }, … … 1016 1031 [{'widget_id': 'heading', 'ncols': 1},], 1017 1032 [{'widget_id': 'text', 'ncols': 1},], 1018 [{'widget_id': ' level', 'ncols': 1},],1019 [{'widget_id': ' code', 'ncols': 1},],1020 [{'widget_id': ' semester', 'ncols': 1},],1021 [{'widget_id': ' credit', 'ncols': 1},],1022 [{'widget_id': ' core_elective', 'ncols': 1},],1033 [{'widget_id': 'which_sex', 'ncols': 1},], 1034 [{'widget_id': 'nr_of_blocks', 'ncols': 1},], 1035 [{'widget_id': 'nr_of_floors', 'ncols': 1},], 1036 [{'widget_id': 'rooms_per_floor', 'ncols': 1},], 1037 [{'widget_id': 'beds_per_room', 'ncols': 1},], 1023 1038 ] 1024 1039 }, … … 1031 1046 layouts['student'] = student_layout 1032 1047 layouts['student_personal'] = student_personal_layout 1048 layouts['accommodation'] = accommodation 1033 1049 layouts['scratch_card'] = scratch_card 1034 1050 layouts['admission'] = admission -
waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
r101 r103 290 290 }###) 291 291 292 accom odation_schema= { ###(292 accommodation = { ###( 293 293 'heading': { 294 294 'type': 'CPS String Field', … … 305 305 }, 306 306 }, 307 ' ': {308 'type': 'CPS StringField',309 'data': { 310 'default_expr': 'string:', 311 'is_searchabletext': True, 312 }, 313 }, 314 ' code': {315 'type': 'CPS StringField',316 'data': { 317 'default_expr': 'string:', 318 'is_searchabletext': True,319 }, 320 }, 321 ' semester': {322 'type': 'CPS BooleanField',323 'data': { 324 'default_expr': ' python:True',325 'is_searchabletext': False, 326 }, 327 }, 328 ' credit': {329 'type': 'CPS Int Field', 330 'data': { 331 'default_expr': 'string:', 332 'is_searchabletext': False, 333 }, 334 }, 335 ' core_elective': {336 'type': 'CPS BooleanField',337 'data': { 338 'default_expr': ' python:True',307 'which_sex': { 308 'type': 'CPS Boolean Field', 309 'data': { 310 'default_expr': 'string:', 311 'is_searchabletext': True, 312 }, 313 }, 314 'nr_of_blocks': { 315 'type': 'CPS Int Field', 316 'data': { 317 'default_expr': 'string:', 318 'is_searchabletext': False, 319 }, 320 }, 321 'nr_of_floors': { 322 'type': 'CPS Int Field', 323 'data': { 324 'default_expr': 'string:', 325 'is_searchabletext': False, 326 }, 327 }, 328 'rooms_per_floor': { 329 'type': 'CPS Int Field', 330 'data': { 331 'default_expr': 'string:', 332 'is_searchabletext': False, 333 }, 334 }, 335 'beds_per_room': { 336 'type': 'CPS Int Field', 337 'data': { 338 'default_expr': 'string:', 339 339 'is_searchabletext': False, 340 340 }, … … 394 394 schemas['student'] = student_schema 395 395 schemas['student_personal'] = student_personal_schema 396 schemas['accommodation'] = accommodation 396 397 schemas['jamb'] = jamb_schema 397 398 #schemas['scratch_card'] = scratch_card -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r102 r103 20 20 'global_allow': 1, 21 21 'filter_content_types': 1, 22 'allowed_content_types': ('StudentsFolder','Faculty' ),22 'allowed_content_types': ('StudentsFolder','Faculty','AccoFolder'), 23 23 'allow_discussion': 0, 24 24 'cps_is_searchable': 1, … … 37 37 'name': 'Add a Faculty', 38 38 'action' : 'string:${object/absolute_url}/create_common?type_name=Faculty', 39 #'action': 'folder_factories', 40 'permissions': (ModifyPortalContent,UniversityManage,)}, 41 {'id': 'add_accommodation', 42 'name': 'Add an Accomodation Hall', 43 'action' : 'string:${object/absolute_url}/add_accommodation', 39 44 #'action': 'folder_factories', 40 45 'permissions': (ModifyPortalContent,UniversityManage,)}, … … 54 59 'condition': "python:member and 'Manager' in member.getRoles()", 55 60 'permissions': (ModifyPortalContent,)}, 56 57 'name': 'action_local_roles',58 59 'condition': 'python:0',60 'permissions': (ModifyPortalContent,)},61 {'id': 'localroles', 62 'name': 'delegate', 63 'action': 'folder_localrole_form', 64 'permissions': (UniversityManage,) 65 }, 61 66 ) 62 67 } … … 99 104 'action' : 'string:${object/absolute_url}/create_jamb', 100 105 'permissions': (UniversityManage,StudentManage)}, 106 {'id': 'localroles', 107 'name': 'delegate', 108 'action': 'folder_localrole_form', 109 'permissions': (UniversityManage,) 110 }, 101 111 ## {'id': 'contents', 102 112 ## 'name': 'action_folder_contents', … … 154 164 'condition': "python:member and 'Manager' in member.getRoles()", 155 165 'permissions': (UniversityManage,)}, 166 {'id': 'localroles', 167 'name': 'delegate', 168 'action': 'folder_localrole_form', 169 'permissions': (UniversityManage,) 170 }, 156 171 ) 157 172 } … … 247 262 'permission': (ModifyPortalContent,StudentManage), 248 263 }, 264 {'id': 'localroles', 265 'name': 'delegate', 266 'action': 'folder_localrole_form', 267 'permissions': (UniversityManage,) 268 }, 249 269 { 250 270 'id' : 'add_content', … … 364 384 'permissions': (ModifyPortalContent,)}, 365 385 {'id': 'localroles', 366 'name': ' action_local_roles',367 'action': 'folder_localrole_form', 368 ' condition': 'python:0',369 'permissions': (ModifyPortalContent,)},386 'name': 'delegate', 387 'action': 'folder_localrole_form', 388 'permissions': (UniversityManage,) 389 }, 370 390 ) 371 391 } … … 426 446 'permissions': (ModifyPortalContent,)}, 427 447 {'id': 'localroles', 428 'name': ' action_local_roles',429 'action': 'folder_localrole_form', 430 ' condition': 'python:0',431 'permissions': (ModifyPortalContent,)},448 'name': 'delegate', 449 'action': 'folder_localrole_form', 450 'permissions': (UniversityManage,) 451 }, 432 452 ) 433 453 } … … 452 472 'layouts': ['course',], 453 473 'flexible_layouts': (), 454 'layout_clusters': ['metadata:metadata', 'coursetotal:metadata,course'],474 'layout_clusters': ['metadata:metadata',], 455 475 'cps_section_wf': 'waeup_section_wf', 456 476 'use_content_status_history': 0, … … 486 506 'permissions': (ModifyPortalContent,)}, 487 507 {'id': 'localroles', 488 'name': 'action_local_roles', 489 'action': 'folder_localrole_form', 490 'condition': 'python:0', 508 'name': 'delegate', 509 'action': 'folder_localrole_form', 510 'permissions': (UniversityManage,) 511 }, 512 ) 513 } 514 ###) 515 516 acco_folder = { ###( 517 'title': 'WAeUP Accommodation Folder', 518 'description': '', 519 'content_icon': '', 520 'content_meta_type': 'AccoFolder', 521 'product': 'WAeUP', 522 'factory': 'addAccoFolder', 523 'immediate_view': 'folder_view', 524 'global_allow': True, 525 'filter_content_types': True, 526 'allowed_content_types': ('Accommodation',), 527 'allow_discussion': False, 528 'cps_is_searchable': True, 529 'cps_proxy_type': 'cpsdocument', 530 'cps_display_as_document_in_listing': True, 531 'schemas': ['metadata','common',], 532 'layouts': ['waeup_common',], 533 'flexible_layouts': (), 534 'layout_clusters': ['metadata:metadata'], 535 'cps_section_wf': 'waeup_section_wf', 536 'use_content_status_history': 0, 537 'actions': ( 538 {'id': 'view', 539 'name': 'action_view', 540 'action': 'string:${portal_url}/sections/waeup/Accomodation/accommodation_index_html', 541 'condition': '', 542 'permission': (View,), 543 'category': 'object', 544 'visible': True,}, 545 {'id': 'metadata', 546 'name': 'action_metadata', 547 'action': 'cpsdocument_metadata', 548 'condition': "python:member and 'Manager' in member.getRoles()", 549 'permissions': (UniversityManage,)}, 550 {'id': 'localroles', 551 'name': 'delegate', 552 'action': 'folder_localrole_form', 553 'permissions': (UniversityManage,), 554 'visible': 0, 555 }, 556 ) 557 } 558 ###) 559 560 accommodation = { ###( 561 'title': 'WAeUP Accommodation', 562 'description': '', 563 'content_icon': 'student.gif', 564 'content_meta_type': 'Accommodation', 565 'product': 'WAeUP', 566 'factory': 'addAccommodation', 567 'immediate_view': 'cpsdocument_view', 568 'global_allow': True, 569 'filter_content_types': True, 570 'allowed_content_types': (), 571 'allow_discussion': False, 572 'cps_is_searchable': True, 573 'cps_proxy_type': 'document', 574 'cps_display_as_document_in_listing': True, 575 'schemas': ['metadata','common','accommodation'], 576 'layouts': ['accommodation',], 577 'flexible_layouts': (), 578 'layout_clusters': ['metadata:metadata',], 579 'cps_section_wf': 'waeup_section_wf', 580 'use_content_status_history': 0, 581 'actions': ( 582 {'id': 'view', 583 'name': 'action_view', 584 'action': 'string:${object_url}/accommodation_index_html', 585 'condition': '', 586 'permission': ('View',), 587 'category': 'object', 588 'visible': True,}, 589 {'id': 'edit', 590 'name': 'edit', 591 'action': 'string:${object_url}/waeup_edit_form', 592 'permission': (UniversityManage,StudentManage), 593 'category': 'object', 594 'visible': True,}, 595 {'id': 'metadata', 596 'name': 'action_metadata', 597 'action': 'cpsdocument_metadata', 598 'condition': "python:member and 'Manager' in member.getRoles()", 491 599 'permissions': (ModifyPortalContent,)}, 600 {'id': 'localroles', 601 'name': 'delegate', 602 'action': 'folder_localrole_form', 603 'permissions': (UniversityManage,), 604 'visible' : 0, 605 }, 492 606 ) 493 607 } … … 499 613 types['Student'] = student_type 500 614 types['StudentPersonal'] = student_personal_type 615 types['AccoFolder'] = acco_folder 616 types['Accommodation'] = accommodation 501 617 types['ScratchCard'] = scratch_card 502 618 types['Jamb'] = jamb_type -
waeup_product/trunk/skins/waeup_default/getWAeUPVocabularies.py
r57 r103 72 72 )}, 73 73 } 74 vocabularies['faculties'] = faculties_voc 75 level_voc = { 76 'type': 'CPS Vocabulary', 77 'data': {'tuples': ( 78 ('100', "Year 1 (100 Level)", ''), 79 ('200', "Year 2 (200 Level)", ''), 80 ('300', "Year 3 (300 Level)", ''), 81 ('400', "Year 4 (100 Level)", ''), 82 )}, 83 } 84 vocabularies['courselevel'] = level_voc 74 85 75 vocabularies['faculties'] = faculties_voc 86 vocabularies['range5'] = {'type': 'CPS Vocabulary', 87 'data': {'tuples': ([('%d' % i,i,'') for i in range(1,6)])}, 88 } 89 vocabularies['range10'] = {'type': 'CPS Vocabulary', 90 'data': {'tuples': ([('%d' % i,i,'') for i in range(1,11)])}, 91 } 92 vocabularies['range20'] = {'type': 'CPS Vocabulary', 93 'data': {'tuples': ([('%d' % i,i,'') for i in range(1,21)])}, 94 } 95 vocabularies['range50'] = {'type': 'CPS Vocabulary', 96 'data': {'tuples': ([('%d' % i,i,'') for i in range(1,51)])}, 97 } 98 ##'xxx_voc': { 99 ## 'type': 'CPS Vocabulary', 100 ## 'data': {'tuples': ( 101 ## ('', "", ''), 102 ## )}, 103 ## }, 104 76 105 77 106 return vocabularies
Note: See TracChangeset for help on using the changeset viewer.