Changeset 57 for waeup_product/trunk


Ignore:
Timestamp:
19 Oct 2005, 09:42:03 (19 years ago)
Author:
joachim
Message:

=more

Location:
waeup_product/trunk
Files:
11 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/Extensions/install.py

    r49 r57  
    5252                      'category' : 'object',
    5353                      }
    54             self.deleteActions({'portal_discussion': ['activate_comments',]})
     54            self.deleteActions({'portal_subscriptions': ['activate_comments',]})
    5555            self.verifyAction('portal_subscriptions', **action)
     56            # now portal_discussion
     57            self.deleteActions({'portal_discussion': ['comment',
     58                                                      'activate_comments',
     59                                                      'deactivate_comments',
     60                                                      'manage_comments']})
     61            action = {'id' : 'comment',
     62                      'name': 'action_comment',
     63                      'action': "string:${object/absolute_url}/post_comment",
     64                      'condition' : "python:getattr(object.getContent(), 'allow_discussion' , None) and object.hasCommentAction()",
     65                      'permission': (View,),
     66                      'category' : 'object',
     67                      }
     68            self.verifyAction('portal_discussion', **action)
     69            action = {'id' : 'activate_comments',
     70                      'name': 'action_activate_comments',
     71                      'action': "string:${object/absolute_url}/set_comment_mode?mode=1",
     72                      'condition' : "python:getattr(object.getTypeInfo(),'cps_proxy_type','') in ('document', 'folderishdocument') and getattr(object.getContent(), 'allow_discussion' , None) == 1",
     73                      'permission': (ForumManageComments,),
     74                      'category' : 'object',
     75                      }
     76            self.verifyAction('portal_discussion', **action)
     77            action = {'id' : 'deactivate_comments',
     78                      'name': 'action_deactivate_comments',
     79                      'action': "string:${object/absolute_url}/set_comment_mode?mode=0",
     80                      'condition' : "python:getattr(object.getTypeInfo(),'cps_proxy_type','') in ('document', 'folderishdocument') and getattr(object.getContent(), 'allow_discussion' , None) == 1",
     81                      'permission': (ForumManageComments,),
     82                      'category' : 'object',
     83                      }
     84            self.verifyAction('portal_discussion', **action)
     85            action = {'id' : 'manage_comments',
     86                      'name': 'action_manage_comments',
     87                      'action': "string:${object/absolute_url}/manage_comment",
     88                      'condition' : "python:getattr(object.getTypeInfo(),'cps_proxy_type','') in ('document', 'folderishdocument') and getattr(object.getContent(), 'allow_discussion' , None) == 1",
     89                      'permission': (ForumManageComments,),
     90                      'category' : 'object',
     91                      }
     92            self.verifyAction('portal_discussion', **action)
    5693       
    5794        ##########################################
     
    129166        self.verifyFlexibleTypes(dtypes)
    130167        self.allowContentTypes('University', ('Workspace','Section',))
    131         #self.allowContentTypes('Student', ('Workspace', 'Section'))
    132 ##        ptypes = {
    133 ##                  'University' : {
    134 ##                  'allowed_content_types': ('StudentsFolder',),
    135 ##                  'typeinfo_name': 'University',
    136 ##                  'add_meta_type': 'Factory-based Type Information',
    137 ##                  },
    138 ##                  'StudentsFolder' : {
    139 ##                  'allowed_content_types': ('Student',),
    140 ##                  'typeinfo_name': 'StudentFolder',
    141 ##                  'add_meta_type': 'Factory-based Type Information',
    142 ##                  },
    143 ##                  'Student' : {
    144 ##                  'allowed_content_types': ('Jamb',),
    145 ##                  'typeinfo_name': 'Student',
    146 ##                  'add_meta_type': 'Factory-based Type Information',
    147 ##                  },
    148 ##                 }
    149 ##        self.verifyContentTypes(ptypes)
    150168        ##########################################
    151169        # Schemas
  • waeup_product/trunk/Students.py

    r47 r57  
     1#-*- mode: python; mode: fold -*-
    12from Globals import InitializeClass
    23from AccessControl import ClassSecurityInfo
     
    1011from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder
    1112
    12 #
    13 # The StudentsFolder
    14 #
    15 class StudentsFolder(BaseBTreeFolder):
     13class StudentsFolder(BaseBTreeFolder): ###(
    1614    """
    1715    WAeUP container for the various WAeUP containers data
     
    5856    return CPSBase_adder(container, ob, REQUEST=REQUEST)
    5957###
    60 ### The Student
    61 ###
    62 ##class Student(CPSDocument):
    63 ##    """
    64 ##    WAeUP Student container for the various student data
    65 ##    """
    66 ####    meta_type = 'Student'
    67 ####    portal_type = meta_type
    68 ##    security = ClassSecurityInfo()
    69 ##   
    70 ##    security.declarePublic("test")
    71 ##    def test(self):
    72 ##        """test"""
    73 ##        return self.REQUEST
    74 ##   
    75 ##InitializeClass(Student)
    76 #
    77 ##def addStudent(container, id, REQUEST=None, **kw):
    78 ##    """Add a Student."""
    79 ##    ob = Student(id, **kw)
    80 ##    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     58###)
     59
     60
     61student_fti = { ###(
     62    'title': 'WAeUP Student',
     63    'description': '',
     64    'content_icon': 'student.gif',
     65    'content_meta_type': 'Student',
     66    'factory': 'addStudent',
     67    'immediate_view': 'cpsdocument_view',
     68    'global_allow': True,
     69    'filter_content_types': True,
     70    'allowed_content_types': ('Jamb','StudentPersonal'),
     71    'allow_discussion': False,
     72    'actions': (
     73         {'id': 'view',
     74          'name': 'action_view',
     75          'action': 'string:${object_url}/student_index_html',
     76          #'action': 'string:${object_url}/cpsdocument_view',
     77          'condition': '',
     78          'permission': ('View',),
     79          'category': 'object',
     80          'visible': True,},
     81         {'id': 'new_content',
     82          'name': 'Add Data',
     83          'action': 'string:${object_url}/folder_factories',
     84          'condition': "python:1 or len(object.contentItems()) == 0 ",
     85          'permission': ('Modify portal content',),
     86          'category': 'object',
     87          'visible': True,},
     88         {'id': 'contents',
     89          'name': 'action_folder_contents',
     90          'action': 'string:${object_url}/folder_contents',
     91          'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",
     92          'permission': ('Modify portal content',),
     93          'category': 'object',
     94          'visible': True,},
     95         {'id': 'edit',
     96          'name': 'action_edit',
     97          'action': 'string:${object_url}/cpsdocument_edit_form',
     98          'condition': '',
     99          'permission': ('Modify portal content',),
     100          'category': 'object',
     101          'visible': True,},
     102    )
     103}
     104
     105###)
     106
     107class Student(CPSDocument): ###(
     108    """
     109    WAeUP Student container for the various student data
     110    """
     111    meta_type = 'Student'
     112    portal_type = meta_type
     113    security = ClassSecurityInfo()
     114   
     115    security.declarePublic("test")
     116    def test(self):
     117        """test"""
     118        return self.REQUEST
     119   
     120InitializeClass(Student)
     121
     122def addStudent(container, id, REQUEST=None, **kw):
     123    """Add a Student."""
     124    ob = Student(id, **kw)
     125    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     126
     127###)
  • waeup_product/trunk/Widgets.py

    r47 r57  
    1515    """ StudentId Widget"""
    1616    meta_type = "StudentId Widget"
     17    digits = 8
     18    digits_str = "N"*digits
     19    letters = 2
     20    letters_str = "L"*letters
    1721   
    1822    def validate(self, datastructure, **kw):
     
    2024       
    2125        valid = CPSStringWidget.validate(self, datastructure, **kw)
    22         print "studentw",valid
    2326        if not valid:
    2427            return 0
     
    2730            value = datastructure[widget_id]
    2831            err = 0
    29             if not (len(value) == 8 and value[:6].isdigit() and value[6:].isalpha()):
    30                 err = 'invalid Student Id'
    31 
     32            if not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()):
     33                err = 'invalid Student Id in the format: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str)
    3234            if err:
    3335                datastructure.setError(widget_id, err)
     
    6062       
    6163        valid = CPSStringWidget.validate(self, datastructure, **kw)
    62         print "sc_pinw",valid
    6364        if not valid:
    6465            return 0
     
    6768            value = datastructure[widget_id]
    6869            err = 0
    69             print value
    70             if not value in valid_pins:
     70            if not value in self.valid_pins:
    7171                err = 'invalid Pin'
    7272            if err:
  • waeup_product/trunk/__init__.py

    r45 r57  
    88import Students
    99
    10 fti = ()
     10fti = (Students.student_fti,
     11)
    1112contentClasses = (University.University,
    1213                  Students.StudentsFolder,
    13                   #Students.Student,
     14                  Students.Student,
    1415                 )
    1516
    1617contentConstructors = (University.addUniversity,
    1718                       Students.addStudentsFolder,
    18                        #Students.addStudent,
     19                       Students.addStudent,
    1920                       )
    2021
  • waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py

    r49 r57  
    419419        },
    420420        'sc_pin': {
    421             'type': 'String Widget',
     421            'type': 'Scratchcard Pin Widget',
    422422            'data': {
    423423                'title': 'SC Pin',
     
    477477###)
    478478
    479 jamb_layoutcreate = { ###(
    480     'widgets': {
     479jamb_widgets = { ###(
    481480        'reg_nr': {
    482481            'type': 'StudentId Widget',
     
    490489                'help': 'The Student ID from JAMB',
    491490                'is_i18n': False,
    492                 'readonly_layout_modes': (),
    493                 'hidden_layout_modes': (),
    494                 'hidden_readonly_layout_modes': (),
    495                 'hidden_empty': False,
    496                 'hidden_if_expr': '',
    497                 'css_class': '',
    498                 'widget_mode_expr': '',
    499                 'display_width': 8,
    500                 'size_max': 8,
    501             },
    502         },
    503         'name': {
    504             'type': 'String Widget',
    505             'data': {
    506                 'title': '',
    507                 'fields': ('name',),
    508                 'is_required': False,
    509                 'label': 'Name',
    510                 'label_edit': 'Name',
    511                 'description': '',
    512                 'help': 'Please enter your full name.',
     491                'display_width': 10,
     492                'size_max': 10,
     493            },
     494        },
     495        'firstname': {
     496            'type': 'String Widget',
     497            'data': {
     498                'title': 'First Name',
     499                'fields': ('firstname',),
     500                'is_required': False,
     501                'label': 'First Name',
     502                'label_edit': 'First Name',
     503                'description': 'First Name',
     504                'help': 'First name',
     505                'is_i18n': False,
     506                'display_width': 40,
     507            },
     508        },
     509        'middlename': {
     510            'type': 'String Widget',
     511            'data': {
     512                'title': '',
     513                'fields': ('middlename',),
     514                'is_required': False,
     515                'label': 'Middle Name',
     516                'label_edit': 'Middle Name',
     517                'description': '',
     518                'help': 'Middle name',
     519                'is_i18n': False,
     520                'readonly_layout_modes': (),
     521                'hidden_layout_modes': (),
     522                'hidden_readonly_layout_modes': (),
     523                'hidden_empty': False,
     524                'hidden_if_expr': '',
     525                'css_class': '',
     526                'widget_mode_expr': '',
     527                'display_width': 40,
     528                'size_max': 0,
     529            },
     530        },
     531        'lastname': {
     532            'type': 'String Widget',
     533            'data': {
     534                'title': '',
     535                'fields': ('lastname',),
     536                'is_required': False,
     537                'label': 'Surname',
     538                'label_edit': 'Surname',
     539                'description': '',
     540                'help': 'Surname',
    513541                'is_i18n': False,
    514542                'readonly_layout_modes': (),
     
    570598        },
    571599        'state': {
    572             'type': 'String Widget',
    573             'data': {
    574                 'title': '',
    575                 'fields': ('state_of_origin',),
     600            'type': 'Select Widget',
     601            'data': {
     602                'title': '',
     603                'fields': ('state',),
    576604                'is_required': False,
    577605                'label': 'State',
     
    580608                'help': '',
    581609                'is_i18n': False,
    582                 'readonly_layout_modes': (),
    583                 'hidden_layout_modes': (),
    584                 'hidden_readonly_layout_modes': (),
    585                 'hidden_empty': False,
    586                 'hidden_if_expr': '',
    587                 'css_class': '',
    588                 'widget_mode_expr': '',
    589                 'display_width': 20,
    590                 'size_max': 0,
     610                'vocabulary': 'nigerian_states',
    591611            },
    592612        },
     
    614634        },
    615635        'aggregate': {
    616             'type': 'String Widget',
     636            'type': 'Int Widget',
    617637            'data': {
    618638                'title': 'Agregate',
    619639                'fields': ('aggregate',),
    620640                'is_required': False,
    621                 'label': 'Aggregate',
    622                 'label_edit': 'Aggregate',
     641                'label': 'Score',
     642                'label_edit': 'Score',
     643                'description': '',
     644                'help': '',
     645                'is_i18n': False,
     646            },
     647        },
     648        'faculty': {
     649            'type': 'Select Widget',
     650            'data': {
     651                'title': 'Faculty',
     652                'fields': ('faculty',),
     653                'is_required': False,
     654                'label': 'Faculty',
     655                'label_edit': 'Faculty',
     656                'description': '',
     657                'help': '',
     658                'is_i18n': False,
     659                'vocabulary': 'faculties',
     660            },
     661        },
     662        'listing_date': {
     663            'type': 'Date Widget',
     664            'data': {
     665                'title': 'Listing Date',
     666                'fields': ('listing_date',),
     667                'is_required': False,
     668                'label': 'Listing Date',
     669                'label_edit': 'Listing Date',
    623670                'description': '',
    624671                'help': '',
     
    635682            },
    636683        },
    637         '2nd_choice': {
    638             'type': 'String Widget',
    639             'data': {
    640                 'title': 'Second choice',
    641                 'fields': ('2nd_choice',),
    642                 'is_required': False,
    643                 'label': 'Second choice',
    644                 'label_edit': 'Second choice',
    645                 'description': '',
    646                 'help': 'second_choice',
    647                 'is_i18n': False,
    648                 'readonly_layout_modes': (),
    649                 'hidden_layout_modes': (),
    650                 'hidden_readonly_layout_modes': (),
    651                 'hidden_empty': False,
    652                 'hidden_if_expr': '',
    653                 'css_class': '',
    654                 'widget_mode_expr': '',
    655                 'display_width': 20,
    656                 'size_max': 0,
    657             },
    658         },
    659         '3rd_choice': {
    660             'type': 'String Widget',
    661             'data': {
    662                 'title': 'Third_choice',
    663                 'fields': ('3rd_choice',),
    664                 'is_required': False,
    665                 'label': 'Third choice',
    666                 'label_edit': 'Third choice',
    667                 'description': 'third_choice',
    668                 'help': 'third_choice',
    669                 'is_i18n': False,
    670                 'readonly_layout_modes': (),
    671                 'hidden_layout_modes': (),
    672                 'hidden_readonly_layout_modes': (),
    673                 'hidden_empty': False,
    674                 'hidden_if_expr': '',
    675                 'css_class': '',
    676                 'widget_mode_expr': '',
    677                 'display_width': 20,
    678                 'size_max': 0,
    679             },
    680         },
     684##        '2nd_choice': { ###(
     685##            'type': 'String Widget',
     686##            'data': {
     687##                'title': 'Second choice',
     688##                'fields': ('2nd_choice',),
     689##                'is_required': False,
     690##                'label': 'Second choice',
     691##                'label_edit': 'Second choice',
     692##                'description': '',
     693##                'help': 'second_choice',
     694##                'is_i18n': False,
     695##                'readonly_layout_modes': (),
     696##                'hidden_layout_modes': (),
     697##                'hidden_readonly_layout_modes': (),
     698##                'hidden_empty': False,
     699##                'hidden_if_expr': '',
     700##                'css_class': '',
     701##                'widget_mode_expr': '',
     702##                'display_width': 20,
     703##                'size_max': 0,
     704##            },
     705##        },
     706##       
     707##        '3rd_choice': {
     708##            'type': 'String Widget',
     709##            'data': {
     710##                'title': 'Third_choice',
     711##                'fields': ('3rd_choice',),
     712##                'is_required': False,
     713##                'label': 'Third choice',
     714##                'label_edit': 'Third choice',
     715##                'description': 'third_choice',
     716##                'help': 'third_choice',
     717##                'is_i18n': False,
     718##                'readonly_layout_modes': (),
     719##                'hidden_layout_modes': (),
     720##                'hidden_readonly_layout_modes': (),
     721##                'hidden_empty': False,
     722##                'hidden_if_expr': '',
     723##                'css_class': '',
     724##                'widget_mode_expr': '',
     725##                'display_width': 20,
     726##                'size_max': 0,
     727##            },
     728##        },
     729###)
     730
    681731        'sc_id': {
    682732            'type': 'String Widget',
     
    723773            },
    724774        },
    725     },
     775    }
     776###)
     777
     778jamb_layoutcreate = { ###(
     779    'widgets': jamb_widgets,
    726780    'layout': {
    727781        'style_prefix': 'layout_jambcreate_',
     
    730784        'rows': [
    731785            [{'widget_id': 'reg_nr', 'ncols': 1},],
    732             [{'widget_id': 'name', 'ncols': 1},],
     786            [{'widget_id': 'firstname', 'ncols': 1},],
     787            [{'widget_id': 'middlename', 'ncols': 1},],
     788            [{'widget_id': 'lastname', 'ncols': 1},],
    733789            #[{'widget_id': 'sc_id', 'ncols': 1},],
    734790            #[{'widget_id': 'sc_pin', 'ncols': 1},],
     
    736792            [{'widget_id': 'sex', 'ncols': 1},],
    737793            [{'widget_id': 'state', 'ncols': 1},],
    738             [{'widget_id': 'exam_results', 'ncols': 1},],
     794            #[{'widget_id': 'exam_results', 'ncols': 1},],
    739795            [{'widget_id': 'aggregate', 'ncols': 1},],
    740             [{'widget_id': '2nd_choice', 'ncols': 1},],
    741             [{'widget_id': '3rd_choice', 'ncols': 1},],
     796            [{'widget_id': 'faculty', 'ncols': 1},],
     797            [{'widget_id': 'listing_date', 'ncols': 1},],
     798            #[{'widget_id': '2nd_choice', 'ncols': 1},],
     799            #[{'widget_id': '3rd_choice', 'ncols': 1},],
    742800        ]
    743801    },
     
    746804
    747805jamb_layout = { ###(
    748     'widgets': {
    749         'reg_nr': {
    750             'type': 'StudentId Widget',
    751             'data': {
    752                 'title': 'Student ID',
    753                 'fields': ('reg_nr',),
    754                 'is_required': True,
    755                 'label': 'Student ID',
    756                 'label_edit': 'Student ID',
    757                 'description': 'The Student ID from JAMB',
    758                 'help': 'The Student ID from JAMB',
    759                 'is_i18n': False,
    760                 'readonly_layout_modes': (),
    761                 'hidden_layout_modes': (),
    762                 'hidden_readonly_layout_modes': (),
    763                 'hidden_empty': False,
    764                 'hidden_if_expr': '',
    765                 'css_class': '',
    766                 'widget_mode_expr': '',
    767                 'display_width': 8,
    768                 'size_max': 8,
    769             },
    770         },
    771         'name': {
    772             'type': 'String Widget',
    773             'data': {
    774                 'title': '',
    775                 'fields': ('name',),
    776                 'is_required': False,
    777                 'label': 'Name',
    778                 'label_edit': 'Name',
    779                 'description': '',
    780                 'help': 'Please enter your full name.',
    781                 'is_i18n': False,
    782                 'readonly_layout_modes': (),
    783                 'hidden_layout_modes': (),
    784                 'hidden_readonly_layout_modes': (),
    785                 'hidden_empty': False,
    786                 'hidden_if_expr': '',
    787                 'css_class': '',
    788                 'widget_mode_expr': '',
    789                 'display_width': 40,
    790                 'size_max': 0,
    791             },
    792         },
    793         'age': {
    794             'type': 'Int Widget',
    795             'data': {
    796                 'title': '',
    797                 'fields': ('age',),
    798                 'is_required': False,
    799                 'label': 'Age',
    800                 'label_edit': 'Age',
    801                 'description': '',
    802                 'help': '',
    803                 'is_i18n': False,
    804                 'readonly_layout_modes': (),
    805                 'hidden_layout_modes': (),
    806                 'hidden_readonly_layout_modes': (),
    807                 'hidden_empty': False,
    808                 'hidden_if_expr': '',
    809                 'css_class': '',
    810                 'widget_mode_expr': '',
    811                 'display_width': 2,
    812                 'size_max': 2,
    813             },
    814         },
    815         'sex': {
    816             'type': 'Boolean Widget',
    817             'data': {
    818                 'title': '',
    819                 'fields': ('sex',),
    820                 'is_required': False,
    821                 'label': 'sex',
    822                 'label_edit': 'sex',
    823                 'label_false': 'male',
    824                 'label_true': 'female',
    825                 'description': '',
    826                 'help': '',
    827                 'is_i18n': False,
    828                 'readonly_layout_modes': (),
    829                 'hidden_layout_modes': (),
    830                 'hidden_readonly_layout_modes': (),
    831                 'hidden_empty': False,
    832                 'hidden_if_expr': '',
    833                 'css_class': '',
    834                 'widget_mode_expr': '',
    835                 'display_width': 20,
    836                 'size_max': 0,
    837             },
    838         },
    839         'state': {
    840             'type': 'String Widget',
    841             'data': {
    842                 'title': '',
    843                 'fields': ('state_of_origin',),
    844                 'is_required': False,
    845                 'label': 'State',
    846                 'label_edit': 'State',
    847                 'description': '',
    848                 'help': '',
    849                 'is_i18n': False,
    850                 'readonly_layout_modes': (),
    851                 'hidden_layout_modes': (),
    852                 'hidden_readonly_layout_modes': (),
    853                 'hidden_empty': False,
    854                 'hidden_if_expr': '',
    855                 'css_class': '',
    856                 'widget_mode_expr': '',
    857                 'display_width': 20,
    858                 'size_max': 0,
    859             },
    860         },
    861         'exam_results': {
    862             'type': 'String Widget',
    863             'data': {
    864                 'title': '',
    865                 'fields': ('exam_results',),
    866                 'is_required': False,
    867                 'label': 'Jamb Results',
    868                 'label_edit': 'Jamb Results',
    869                 'description': '',
    870                 'help': '',
    871                 'is_i18n': False,
    872                 'readonly_layout_modes': (),
    873                 'hidden_layout_modes': (),
    874                 'hidden_readonly_layout_modes': (),
    875                 'hidden_empty': False,
    876                 'hidden_if_expr': '',
    877                 'css_class': '',
    878                 'widget_mode_expr': '',
    879                 'display_width': 20,
    880                 'size_max': 0,
    881             },
    882         },
    883         'aggregate': {
    884             'type': 'String Widget',
    885             'data': {
    886                 'title': 'Agregate',
    887                 'fields': ('aggregate',),
    888                 'is_required': False,
    889                 'label': 'Aggregate',
    890                 'label_edit': 'Aggregate',
    891                 'description': '',
    892                 'help': '',
    893                 'is_i18n': False,
    894                 'readonly_layout_modes': (),
    895                 'hidden_layout_modes': (),
    896                 'hidden_readonly_layout_modes': (),
    897                 'hidden_empty': False,
    898                 'hidden_if_expr': '',
    899                 'css_class': '',
    900                 'widget_mode_expr': '',
    901                 'display_width': 3,
    902                 'size_max': 0,
    903             },
    904         },
    905         '2nd_choice': {
    906             'type': 'String Widget',
    907             'data': {
    908                 'title': 'Second choice',
    909                 'fields': ('2nd_choice',),
    910                 'is_required': False,
    911                 'label': 'Second choice',
    912                 'label_edit': 'Second choice',
    913                 'description': '',
    914                 'help': 'second_choice',
    915                 'is_i18n': False,
    916                 'readonly_layout_modes': (),
    917                 'hidden_layout_modes': (),
    918                 'hidden_readonly_layout_modes': (),
    919                 'hidden_empty': False,
    920                 'hidden_if_expr': '',
    921                 'css_class': '',
    922                 'widget_mode_expr': '',
    923                 'display_width': 20,
    924                 'size_max': 0,
    925             },
    926         },
    927         '3rd_choice': {
    928             'type': 'String Widget',
    929             'data': {
    930                 'title': 'Third_choice',
    931                 'fields': ('3rd_choice',),
    932                 'is_required': False,
    933                 'label': 'Third choice',
    934                 'label_edit': 'Third choice',
    935                 'description': 'third_choice',
    936                 'help': 'third_choice',
    937                 'is_i18n': False,
    938                 'readonly_layout_modes': (),
    939                 'hidden_layout_modes': (),
    940                 'hidden_readonly_layout_modes': (),
    941                 'hidden_empty': False,
    942                 'hidden_if_expr': '',
    943                 'css_class': '',
    944                 'widget_mode_expr': '',
    945                 'display_width': 20,
    946                 'size_max': 0,
    947             },
    948         },
    949         'sc_id': {
    950             'type': 'String Widget',
    951             'data': {
    952                 'title': '',
    953                 'fields': ('admission_sc_id',),
    954                 'is_required': False,
    955                 'label': 'Scratch card ID used',
    956                 'label_edit': 'Scratch card ID used',
    957                 'description': '',
    958                 'help': '',
    959                 'is_i18n': False,
    960                 'readonly_layout_modes': (),
    961                 'hidden_layout_modes': (),
    962                 'hidden_readonly_layout_modes': (),
    963                 'hidden_empty': False,
    964                 'hidden_if_expr': '',
    965                 'css_class': '',
    966                 'widget_mode_expr': '',
    967                 'display_width': 20,
    968                 'size_max': 0,
    969             },
    970         },
    971         'sc_pin': {
    972             'type': 'String Widget',
    973             'data': {
    974                 'title': '',
    975                 'fields': ('admission_sc_pin',),
    976                 'is_required': False,
    977                 'label': 'Scratch card PIN used',
    978                 'label_edit': 'Scratch card PIN used',
    979                 'description': '',
    980                 'help': '',
    981                 'is_i18n': False,
    982                 'readonly_layout_modes': (),
    983                 'hidden_layout_modes': (),
    984                 'hidden_readonly_layout_modes': (),
    985                 'hidden_empty': False,
    986                 'hidden_if_expr': '',
    987                 'css_class': '',
    988                 'widget_mode_expr': '',
    989                 'display_width': 20,
    990                 'size_max': 0,
    991             },
    992         },
    993     },
     806    'widgets': jamb_widgets,
    994807    'layout': {
    995808        'style_prefix': 'layout_default_',
     
    998811        'rows': [
    999812            [{'widget_id': 'reg_nr', 'ncols': 1},],
    1000             [{'widget_id': 'name', 'ncols': 1},],
    1001             [{'widget_id': 'sc_id', 'ncols': 1},],
    1002             [{'widget_id': 'sc_pin', 'ncols': 1},],
     813            [{'widget_id': 'firstname', 'ncols': 1},],
     814            [{'widget_id': 'middlename', 'ncols': 1},],
     815            [{'widget_id': 'lastname', 'ncols': 1},],
     816            #[{'widget_id': 'sc_id', 'ncols': 1},],
     817            #[{'widget_id': 'sc_pin', 'ncols': 1},],
    1003818            [{'widget_id': 'age', 'ncols': 1},],
    1004819            [{'widget_id': 'sex', 'ncols': 1},],
    1005820            [{'widget_id': 'state', 'ncols': 1},],
    1006             [{'widget_id': 'exam_results', 'ncols': 1},],
     821            #[{'widget_id': 'exam_results', 'ncols': 1},],
    1007822            [{'widget_id': 'aggregate', 'ncols': 1},],
    1008             [{'widget_id': '2nd_choice', 'ncols': 1},],
    1009             [{'widget_id': '3rd_choice', 'ncols': 1},],
     823            [{'widget_id': 'faculty', 'ncols': 1},],
     824            [{'widget_id': 'listing_date', 'ncols': 1},],
     825            #[{'widget_id': '2nd_choice', 'ncols': 1},],
     826            #[{'widget_id': '3rd_choice', 'ncols': 1},],
    1010827        ]
    1011828    },
  • waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py

    r49 r57  
    33
    44university_schema = { ###(
    5    'allow_discussion': {
    6         'type': 'CPS Int Field',
    7         'data': {
    8             'default_expr': 'python:0',
    9             'is_searchabletext': 0,
    10         },
    11     },
     5##   'allow_discussion': {
     6##        'type': 'CPS Int Field',
     7##        'data': {
     8##            'default_expr': 'python:0',
     9##            'is_searchabletext': 0,
     10##        },
     11##    },
    1212}
    1313
     
    1515
    1616students_folder_schema = { ###(
    17    'allow_discussion': {
    18         'type': 'CPS Int Field',
    19         'data': {
    20             'default_expr': 'python:0',
    21             'is_searchabletext': 0,
    22         },
    23     },
     17##   'allow_discussion': {
     18##        'type': 'CPS Int Field',
     19##        'data': {
     20##            'default_expr': 'python:0',
     21##            'is_searchabletext': 0,
     22##        },
     23##    },
    2424}
    2525
     
    2727
    2828student_schema = { ###(
    29    'allow_discussion': {
    30         'type': 'CPS Int Field',
    31         'data': {
    32             'default_expr': 'python:0',
    33             'is_searchabletext': 0,
    34             },
    35         },
     29##   'allow_discussion': {
     30##        'type': 'CPS Int Field',
     31##        'data': {
     32##            'default_expr': 'python:0',
     33##            'is_searchabletext': 0,
     34##            },
     35##        },
    3636     'jamb_is_admitted': {
    3737        'type': 'CPS Boolean Field',
     
    5252        },
    5353    },
    54 ##    'jamb_where_admitted': {
     54    'faculty': {
     55        'type': 'CPS String Field',
     56        'data': {
     57            'default_expr': 'string:',
     58            'is_searchabletext': True,
     59            'acl_read_permissions': '',
     60            'acl_read_roles': '',
     61            'acl_read_expr': '',
     62            'acl_write_permissions': '',
     63            'acl_write_roles': '',
     64            'acl_write_expr': '',
     65            'read_ignore_storage': False,
     66            'read_process_expr': '',
     67            'read_process_dependent_fields': (),
     68            'write_ignore_storage': False,
     69            'write_process_expr': '',
     70        },
     71    },
     72}
     73#
     74###)
     75
     76student_personal_schema = { ###(
     77##   'allow_discussion': {
     78##        'type': 'CPS Int Field',
     79##        'data': {
     80##            'default_expr': 'python:0',
     81##            'is_searchabletext': 0,
     82##            },
     83##        },
     84     'firstname': {
     85        'type': 'CPS String Field',
     86        'data': {
     87            'is_searchabletext': 1,
     88        },
     89    },
     90    'middlename': {
     91        'type': 'CPS String Field',
     92        'data': {
     93            'is_searchabletext': 1,
     94        },
     95    },
     96     'lastname': {
     97        'type': 'CPS String Field',
     98        'data': {
     99            'is_searchabletext': 1,
     100        },
     101    },
     102     'sex': {
     103        'type': 'CPS Boolean Field',
     104        'data': {
     105            'is_searchabletext': 1,
     106        },
     107    },
     108     'birthday': {
     109        'type': 'CPS DateTime Field',
     110        'data': {
     111            'is_searchabletext': 1,
     112        },
     113    },
     114     'age': {
     115        'type': 'CPS DateTime Field',
     116        'data': {
     117            'is_searchabletext': 1,
     118        },
     119    },
     120     'state': {
     121        'type': 'CPS DateTime Field',
     122        'data': {
     123            'is_searchabletext': 1,
     124        },
     125    },
     126}
     127###)
     128
     129jamb_schema = { ###(
     130   'allow_discussion': {
     131        'type': 'CPS Int Field',
     132        'data': {
     133            'default_expr': 'python:0',
     134            'is_searchabletext': 0,
     135            },
     136        },
     137    'reg_nr': {
     138        'type': 'CPS String Field',
     139        'data': {
     140            'default_expr': 'string:',
     141            'is_searchabletext': True,
     142        },
     143    },
     144    'admission_sc_id': {
     145        'type': 'CPS String Field',
     146        'data': {
     147            'is_searchabletext': True,
     148        },
     149    },
     150    'admission_sc_pin': {
     151        'type': 'CPS String Field',
     152        'data': {
     153            'is_searchabletext': True,
     154        },
     155    },
     156    'admission_sc_pin_usage': {
     157        'type': 'CPS Int Field',
     158        'data': {
     159            'default_expr': 'python:0',
     160            'is_searchabletext': False,
     161            },
     162    },
     163     'firstname': {
     164        'type': 'CPS String Field',
     165        'data': {
     166            'is_searchabletext': 1,
     167        },
     168    },
     169    'middlename': {
     170        'type': 'CPS String Field',
     171        'data': {
     172            'is_searchabletext': 1,
     173        },
     174    },
     175     'lastname': {
     176        'type': 'CPS String Field',
     177        'data': {
     178            'is_searchabletext': 1,
     179        },
     180    },
     181    'age': {
     182        'type': 'CPS Int Field',
     183        'data': {
     184            'default_expr': 'python:20',
     185            'is_searchabletext': False,
     186        },
     187    },
     188    'sex': {
     189        'type': 'CPS Boolean Field',
     190        'data': {
     191            'default_expr': 'python:0',
     192            'is_searchabletext': False,
     193        },
     194    },
     195    'state': {
     196        'type': 'CPS String Field',
     197        'data': {
     198            'default_expr': 'string:',
     199            'is_searchabletext': False,
     200        },
     201    },
     202    'exam_results': {
     203        'type': 'CPS String Field',
     204        'data': {
     205            'default_expr': 'string:',
     206        },
     207    },
     208    'aggregate': {
     209        'type': 'CPS String Field',
     210        'data': {
     211            'default_expr': 'string:',
     212            'is_searchabletext': False,
     213        },
     214    },
     215    'faculty': {
     216        'type': 'CPS String Field',
     217        'data': {
     218            'default_expr': 'string:',
     219            'is_searchabletext': False,
     220        },
     221    },
     222    'listing_date': {
     223        'type': 'CPS DateTime Field',
     224        'data': {
     225            'is_searchabletext': False,
     226        },
     227    },
     228##    '2nd_choice': { ###(
    55229##        'type': 'CPS String Field',
    56230##        'data': {
    57 ##            'default_expr': 'string:Lagos',
     231##            'default_expr': 'string:',
     232##            'is_searchabletext': False,
     233##            'acl_read_permissions': '',
     234##            'acl_read_roles': '',
     235##            'acl_read_expr': '',
     236##            'acl_write_permissions': '',
     237##            'acl_write_roles': '',
     238##            'acl_write_expr': '',
     239##            'read_ignore_storage': False,
     240##            'read_process_expr': '',
     241##            'read_process_dependent_fields': (),
     242##            'write_ignore_storage': False,
     243##            'write_process_expr': '',
     244##        },
     245##    },
     246##    '3rd_choice': {
     247##        'type': 'CPS String Field',
     248##        'data': {
     249##            'default_expr': 'string:',
    58250##            'is_searchabletext': True,
    59251##            'acl_read_permissions': '',
     
    70262##        },
    71263##    },
    72     'faculty': {
    73         'type': 'CPS String Field',
    74         'data': {
    75             'default_expr': 'string:',
    76             'is_searchabletext': True,
    77             'acl_read_permissions': '',
    78             'acl_read_roles': '',
    79             'acl_read_expr': '',
    80             'acl_write_permissions': '',
    81             'acl_write_roles': '',
    82             'acl_write_expr': '',
    83             'read_ignore_storage': False,
    84             'read_process_expr': '',
    85             'read_process_dependent_fields': (),
    86             'write_ignore_storage': False,
    87             'write_process_expr': '',
    88         },
    89     },
    90 }
    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 }
    133 #
    134 ###)
    135 
    136 jamb_schema = { ###(
    137    'allow_discussion': {
    138         'type': 'CPS Int Field',
    139         'data': {
    140             'default_expr': 'python:0',
    141             'is_searchabletext': 0,
    142             },
    143         },
    144     'reg_nr': {
    145         'type': 'CPS String Field',
    146         'data': {
    147             'default_expr': 'string:',
    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             'is_searchabletext': True,
    166             'acl_read_permissions': '',
    167             'acl_read_roles': '',
    168             'acl_read_expr': '',
    169             'acl_write_permissions': '',
    170             'acl_write_roles': '',
    171             'acl_write_expr': '',
    172             'read_ignore_storage': False,
    173             'read_process_expr': '',
    174             'read_process_dependent_fields': (),
    175             'write_ignore_storage': False,
    176             'write_process_expr': '',
    177         },
    178     },
    179     'admission_sc_pin': {
    180         'type': 'CPS String Field',
    181         'data': {
    182             'is_searchabletext': True,
    183             'acl_read_permissions': '',
    184             'acl_read_roles': '',
    185             'acl_read_expr': '',
    186             'acl_write_permissions': '',
    187             'acl_write_roles': '',
    188             'acl_write_expr': '',
    189             'read_ignore_storage': False,
    190             'read_process_expr': '',
    191             'read_process_dependent_fields': (),
    192             'write_ignore_storage': False,
    193             'write_process_expr': '',
    194         },
    195     },
    196     'admission_sc_pin_usage': {
    197         'type': 'CPS Int Field',
    198         'data': {
    199             'default_expr': 'python:0',
    200             'is_searchabletext': False,
    201             'acl_read_permissions': '',
    202             'acl_read_roles': '',
    203             'acl_read_expr': '',
    204             'acl_write_permissions': '',
    205             'acl_write_roles': '',
    206             'acl_write_expr': '',
    207             'read_ignore_storage': False,
    208             'read_process_expr': '',
    209             'read_process_dependent_fields': (),
    210             'write_ignore_storage': False,
    211             'write_process_expr': '',
    212         },
    213     },
    214     'name': {
    215         'type': 'CPS String Field',
    216         'data': {
    217             'default_expr': 'string:',
    218             'is_searchabletext': True,
    219             'acl_read_permissions': '',
    220             'acl_read_roles': '',
    221             'acl_read_expr': '',
    222             'acl_write_permissions': '',
    223             'acl_write_roles': '',
    224             'acl_write_expr': '',
    225             'read_ignore_storage': False,
    226             'read_process_expr': '',
    227             'read_process_dependent_fields': (),
    228             'write_ignore_storage': False,
    229             'write_process_expr': '',
    230         },
    231     },
    232     'age': {
    233         'type': 'CPS Int Field',
    234         'data': {
    235             'default_expr': 'python:20',
    236             'is_searchabletext': False,
    237             'acl_read_permissions': '',
    238             'acl_read_roles': '',
    239             'acl_read_expr': '',
    240             'acl_write_permissions': '',
    241             'acl_write_roles': '',
    242             'acl_write_expr': '',
    243             'read_ignore_storage': False,
    244             'read_process_expr': '',
    245             'read_process_dependent_fields': (),
    246             'write_ignore_storage': False,
    247             'write_process_expr': '',
    248         },
    249     },
    250     'sex': {
    251         'type': 'CPS Boolean Field',
    252         'data': {
    253             'default_expr': 'python:0',
    254             'is_searchabletext': False,
    255             'acl_read_permissions': '',
    256             'acl_read_roles': '',
    257             'acl_read_expr': '',
    258             'acl_write_permissions': '',
    259             'acl_write_roles': '',
    260             'acl_write_expr': '',
    261             'read_ignore_storage': False,
    262             'read_process_expr': '',
    263             'read_process_dependent_fields': (),
    264             'write_ignore_storage': False,
    265             'write_process_expr': '',
    266         },
    267     },
    268     'state_of_origin': {
    269         'type': 'CPS String Field',
    270         'data': {
    271             'default_expr': 'string:',
    272             'is_searchabletext': True,
    273             'acl_read_permissions': '',
    274             'acl_read_roles': '',
    275             'acl_read_expr': '',
    276             'acl_write_permissions': '',
    277             'acl_write_roles': '',
    278             'acl_write_expr': '',
    279             'read_ignore_storage': False,
    280             'read_process_expr': '',
    281             'read_process_dependent_fields': (),
    282             'write_ignore_storage': False,
    283             'write_process_expr': '',
    284         },
    285     },
    286     'exam_results': {
    287         'type': 'CPS String Field',
    288         'data': {
    289             'default_expr': 'string:',
    290             'is_searchabletext': True,
    291             'acl_read_permissions': '',
    292             'acl_read_roles': '',
    293             'acl_read_expr': '',
    294             'acl_write_permissions': '',
    295             'acl_write_roles': '',
    296             'acl_write_expr': '',
    297             'read_ignore_storage': False,
    298             'read_process_expr': '',
    299             'read_process_dependent_fields': (),
    300             'write_ignore_storage': False,
    301             'write_process_expr': '',
    302         },
    303     },
    304     'aggregate': {
    305         'type': 'CPS String Field',
    306         'data': {
    307             'default_expr': 'string:',
    308             'is_searchabletext': False,
    309             'acl_read_permissions': '',
    310             'acl_read_roles': '',
    311             'acl_read_expr': '',
    312             'acl_write_permissions': '',
    313             'acl_write_roles': '',
    314             'acl_write_expr': '',
    315             'read_ignore_storage': False,
    316             'read_process_expr': '',
    317             'read_process_dependent_fields': (),
    318             'write_ignore_storage': False,
    319             'write_process_expr': '',
    320         },
    321     },
    322     '2nd_choice': {
    323         'type': 'CPS String Field',
    324         'data': {
    325             'default_expr': 'string:',
    326             'is_searchabletext': False,
    327             'acl_read_permissions': '',
    328             'acl_read_roles': '',
    329             'acl_read_expr': '',
    330             'acl_write_permissions': '',
    331             'acl_write_roles': '',
    332             'acl_write_expr': '',
    333             'read_ignore_storage': False,
    334             'read_process_expr': '',
    335             'read_process_dependent_fields': (),
    336             'write_ignore_storage': False,
    337             'write_process_expr': '',
    338         },
    339     },
    340     '3rd_choice': {
    341         'type': 'CPS String Field',
    342         'data': {
    343             'default_expr': 'string:',
    344             'is_searchabletext': True,
    345             'acl_read_permissions': '',
    346             'acl_read_roles': '',
    347             'acl_read_expr': '',
    348             'acl_write_permissions': '',
    349             'acl_write_roles': '',
    350             'acl_write_expr': '',
    351             'read_ignore_storage': False,
    352             'read_process_expr': '',
    353             'read_process_dependent_fields': (),
    354             'write_ignore_storage': False,
    355             'write_process_expr': '',
    356         },
    357     },
    358 }
     264###)
     265}
     266
    359267
    360268###)
  • waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py

    r49 r57  
    5353                 'action': 'folder_localrole_form',
    5454                 'permissions': (ChangePermissions,)},
    55     )
    56 }
    57 
     55                 )
     56        }
    5857###)
    5958
     
    6362    'content_icon': 'students_folder.gif',
    6463    'content_meta_type': 'StudentsFolder',
    65     'product': 'WAeUP',
    66     'factory': 'addStudentsFolder',
     64    'product': 'CPSDefault',
     65    'factory': 'addFolder',
    6766    'immediate_view': 'folder_view',
    6867    'global_allow': 1,
     
    7978    'cps_section_wf': 'waeup_section_wf',
    8079    'actions': ({'id': 'view',
    81                  'name': 'action_view',
    82                  'action': 'student_folder_view',
    83                  'permissions': (View,)},
    84                 {'id': 'new_content',
    85                  'name': 'action_new_content',
    86                  'action': 'folder_factories',
    87                  'permissions': (AddPortalContent,)},
     80                 'name': 'Students',
     81                 'action': 'students_folder_view',
     82                 'permissions': (View,)},
     83                {
     84                'id'        : 'add_content',
     85                'name'      : 'Add Content',
     86                'action'    : 'string:${object/absolute_url}/folder_factories',
     87                'condition' : 'python: member and "Manager" in member.getRoles()',
     88                'permissions': (AddPortalContent,)},
     89                {
     90                'id'        : 'add_jamb',
     91                'name'      : 'Add Student JAMB',
     92                'action'    : 'string:${object/absolute_url}/create_jamb',
     93                'condition' : 'python: member and "StudentManager" in member.getGroups()',
     94                'permissions': (AddPortalContent,)},
    8895                {'id': 'contents',
    8996                 'name': 'action_folder_contents',
     
    97104                 'name': 'action_metadata',
    98105                 'action': 'cpsdocument_metadata',
    99                  'condition': 'not:portal/portal_membership/isAnonymousUser',
    100                  'permissions': (View,)},
     106                 'permissions': (ModifyPortalContent,)},
    101107                {'id': 'localroles',
    102108                 'name': 'action_local_roles',
     
    113119    'content_icon': 'student.gif',
    114120    'content_meta_type': 'Student',
    115     'product': 'CPSDocument',
    116     'factory': 'addCPSDocument',
     121    'product': 'WAeUP',
     122    'factory': 'addStudent',
    117123    'immediate_view': 'cpsdocument_view',
    118     #'product': 'WAeUP',
    119     #'factory': 'addStudent',
    120     #'immediate_view': 'student_view',
    121124    'global_allow': True,
    122125    'filter_content_types': True,
     
    130133    'flexible_layouts': (),
    131134    'layout_clusters': ['metadata:metadata'],
    132     'cps_workspace_wf': 'waeup_workspace_wf',
    133     'cps_section_wf': 'waeup_section_wf',
    134     'actions': (
     135    'cps_section_wf': 'waeup_section_wf',
     136    'use_content_status_history': 0,
     137    'actions_add': (
    135138         {'id': 'view',
    136139          'name': 'action_view',
     
    141144          'category': 'object',
    142145          'visible': True,},
    143          {'id': 'new_content',
    144           'name': 'Add Data',
    145           'action': 'string:${object_url}/folder_factories',
    146           'condition': "python:1 or len(object.contentItems()) == 0 ",
    147           'permission': ('Modify portal content',),
    148           'category': 'object',
    149           'visible': True,},
    150          {'id': 'contents',
    151           'name': 'action_folder_contents',
    152           'action': 'string:${object_url}/folder_contents',
    153           'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",
    154           'permission': ('Modify portal content',),
    155           'category': 'object',
    156           'visible': True,},
    157          {'id': 'edit',
    158           'name': 'action_edit',
    159           'action': 'string:${object_url}/cpsdocument_edit_form',
    160           'condition': '',
    161           'permission': ('Modify portal content',),
    162           'category': 'object',
    163           'visible': True,},
    164     )
     146          )
    165147}
    166148
     
    273255###)
    274256
     257faculty_folder_type = { ###(
     258    'title': 'WAeUP Folder for faculties',
     259    'description': 'The WAeUP Faculties Folder',
     260    'content_icon': '',
     261    'content_meta_type': 'FacultiesFolder',
     262    'product': 'CPSDefault',
     263    'factory': 'addFolder',
     264    'immediate_view': 'folder_view',
     265    'global_allow': 1,
     266    'filter_content_types': 1,
     267    'allowed_content_types': ('Faculty'),
     268    'allow_discussion': 0,
     269    'cps_is_searchable': 1,
     270    'cps_display_as_document_in_listing': 1,
     271    'cps_proxy_type': 'folder',
     272    'schemas': ['metadata', 'common', 'folder'],
     273    'layouts': ['waeup_common','folder'],
     274    'layout_clusters': ['metadata:metadata'],
     275    'cps_section_wf': 'waeup_section_wf',
     276    'actions': ({'id': 'view',
     277                 'name': 'action_view',
     278                 'action': 'folder_view',
     279                 'permissions': (View,)},
     280                {'id': 'new_content',
     281                 'name': 'action_new_content',
     282                 'action': 'folder_factories',
     283                 'permissions': (AddPortalContent,)},
     284                {'id': 'contents',
     285                 'name': 'action_folder_contents',
     286                 'action': 'folder_contents',
     287                 'permissions': (ModifyPortalContent,)},
     288                {'id': 'edit',
     289                 'name': 'action_edit',
     290                 'action': 'cpsdocument_edit_form',
     291                 'permissions': (ModifyPortalContent,)},
     292                {'id': 'metadata',
     293                 'name': 'action_metadata',
     294                 'action': 'cpsdocument_metadata',
     295                 'condition': 'not:portal/portal_membership/isAnonymousUser',
     296                 'permissions': (View,)},
     297                {'id': 'localroles',
     298                 'name': 'action_local_roles',
     299                 'action': 'folder_localrole_form',
     300                 'permissions': (ChangePermissions,)},
     301                 )
     302}
     303###)
     304
    275305types = {}
    276306types['University'] = university_type
  • waeup_product/trunk/skins/waeup_default/getWAeUPVocabularies.py

    r19 r57  
    22# $Id$
    33"""Return custom vocabularies."""
     4##'xxx_voc': {
     5##        'type': 'CPS Vocabulary',
     6##        'data': {'tuples': (
     7##            ('', "", ''),
     8##            )},
     9##        },
     10##vocabluaries['xxx'] = xxx_voc
    411
    512vocabularies = {}
    613
     14nigerian_states_voc = {
     15        'type': 'CPS Vocabulary',
     16        'data': {'tuples': (
     17            ('abia', "Abia", ''),
     18            ('adam', "Adamawa", ''),
     19            ('akwa', "Akwa Ibom", ''),
     20            ('anam', "Anambra", ''),
     21            ('bauchi', "Bauchi", ''),
     22            ('baye', "Bayelsa", ''),
     23            ('benu', "Benue", ''),
     24            ('born', "Borno", ''),
     25            ('cro', "Cross River", ''),
     26            ('delt', "Delta", ''),
     27            ('ebon', "Ebonyi", ''),
     28            ('edo', "edo", ''),
     29            ('ekit', "Ekiti", ''),
     30            ('enug', "Enugu", ''),
     31            ('gomb', "Gombe", ''),
     32            ('imo', "Imo", ''),
     33            ('jiga', "Jigawa", ''),
     34            ('kad', "Kaduna", ''),
     35            ('kano', "Kano", ''),
     36            ('kats', "Katsina", ''),
     37            ('keb', "Kebbi", ''),
     38            ('kogi', "Kogi", ''),
     39            ('kwar', "Kwara", ''),
     40            ('lag', "Lagos", ''),
     41            ('nasa', "Nasawara", ''),
     42            ('nige', "Niger", ''),
     43            ('ogun', "Ogun", ''),
     44            ('ondo', "Ondo", ''),
     45            ('osun', "Osun", ''),
     46            ('oyo', "oyo", ''),
     47            ('plat', "Plateau", ''),
     48            ('riv', "Rivers", ''),
     49            ('sok', "Sokoto", ''),
     50            ('tar', "Taraba", ''),
     51            ('yobe', "Yobe", ''),
     52            ('zam', "Zamfara", ''),
     53            ('fct', "FCT", ''),
     54            )},
     55        }
     56vocabularies['nigerian_states'] = nigerian_states_voc
     57
     58faculties_voc = {
     59        'type': 'CPS Vocabulary',
     60        'data': {'tuples': (
     61            ('agri', "Agriculture", ''),
     62            ('arts', "Arts", ''),
     63            ('bmed', "Basic Med Sciences", ''),
     64            ('edu', "Education", ''),
     65            ('eng', "Engeneering", ''),
     66            ('law', "Law", ''),
     67            ('phar', "Pharmacy", ''),
     68            ('sod', "School of Denistry", ''),
     69            ('som', "School of Medicine", ''),
     70            ('sci', "Science", ''),
     71            ('soc', "Social Science", ''),
     72            )},
     73        }
     74
     75vocabularies['faculties'] = faculties_voc
     76
    777return vocabularies
  • waeup_product/trunk/skins/waeup_default/getWAeUPWidgets.py

    r20 r57  
    55            },
    66        'Scratchcard Pin Widget': {
    7             'type': 'StudentId Widget Type',
     7            'type': 'Scratchcard Pin Widget Type',
    88            'data': {},
    99            },
  • waeup_product/trunk/skins/waeup_student/create_jamb.py

    r53 r57  
    5050    context.notifyCPSDocumentCreation(ob=jamb)
    5151    psm = 'Student created'
    52     pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember'))
     52    noCPSMember = False
     53    try:
     54        pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember'))
     55    except:
     56        noCPSMember = True
     57    if noCPSMember:
     58        pr.addMember(s_id, 'UnSeT',roles=('Member',))
    5359    groups = context.portal_directories.groups
    5460    gm = list(groups.getEntry('Students')['members'])
     
    5662    groups.editEntry({'group': 'Students',
    5763                      'members': gm}) 
    58     return context.student_folder_view(psm=psm)
     64    return context.students_folder_view_manager(psm=psm)
    5965##    return context.create_jamb_form(rendered = res,
    6066##                                 psm = psm,
  • waeup_product/trunk/skins/waeup_student/process_waeup_login.py

    r54 r57  
    2727pkw = {}
    2828pkw['sex'] = getattr(jamb,'sex')
    29 pkw['lastname'] = getattr(jamb,'name')
     29pkw['firstname'] = getattr(jamb,'firstname')
     30pkw['middlename'] = getattr(jamb,'middlename')
     31pkw['lastname'] = getattr(jamb,'lastname')
     32pkw['aggregate'] = getattr(jamb,'aggregate')
     33pkw['faculty'] = getattr(jamb,'faculty')
     34pkw['age'] = getattr(jamb,'age')
     35pkw['state'] = getattr(jamb,'state')
     36
    3037pd.edit(mapping=pkw)
    3138context.notifyCPSDocumentCreation(ob=pd)
  • waeup_product/trunk/skins/waeup_student/students_folder_view.py

    r48 r57  
    66will be displayed, otherwise first post will be displayed."""
    77
    8 admin = "SectionManager" in context.portal_membership.getAuthenticatedMember().getRolesInContext(context)
    98
    10 return context.student_folder_view_main(admin = admin,psm=psm,groups=groups)
     9member = context.portal_membership.getAuthenticatedMember()
     10if member:
     11    if 'Student' in member.getGroups():
     12        return context.students_folder_view_students(psm=psm,groups=groups)
     13    if 'StudentsManager' in member.getGroups():
     14        return context.students_folder_view_manager(psm=psm,groups=groups)
     15return context.students_folder_view_anon(psm=psm,groups=groups)
Note: See TracChangeset for help on using the changeset viewer.