Changeset 47 for waeup_product


Ignore:
Timestamp:
14 Oct 2005, 13:01:35 (19 years ago)
Author:
joachim
Message:

=weitere

Location:
waeup_product/trunk
Files:
2 added
10 edited
2 moved

Legend:

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

    r46 r47  
    6161                        'id'        : 'checkadmission',
    6262                        'name'      : 'Check Admission',
    63                         'action'    : 'string:${object/absolute_url}/check_admission_form',
     63                        'action'    : 'string:${object/absolute_url}/check_admission',
    6464                        'permission': (View, ),
    65                         'condition' : 'not:member',
     65                        'condition' : 'member',
    6666                        'category'  : 'student',
    6767                        'visible'   : 1,
     
    8181                        'action'    : 'cpsdocument_edit_form',
    8282                        'permission': ( ),
    83                         'condition' : 'python: here.portal_type == "Student"',
     83                        'condition' : 'python: member and  here.portal_type == "Student"',
    8484                        'category'  : 'student',
    8585                        'visible'   : 1,
     
    9191                        'permission': (),
    9292                        '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")',
    93102                        'category'  : 'student',
    94103                        'visible'   : 1,
     
    187196                      'StudentsFolder': 'waeup_section_wf',
    188197                      'Student': 'waeup_section_wf',
     198                      'StudentPersonal': 'waeup_section_wf',
    189199                      'Jamb': 'waeup_section_wf',
    190200                      'ScratchCard': 'waeup_section_wf',
  • waeup_product/trunk/Students.py

    r45 r47  
    22from AccessControl import ClassSecurityInfo
    33
    4 from Products.CMFCore.utils import getToolByName
     4from Products.CMFCore.utils import UniqueObject, getToolByName
    55from Products.CMFCore.permissions import View
    66from Products.CMFCore.permissions import ModifyPortalContent
    77from 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
     9from Products.CPSDocument.CPSDocument import CPSDocument
    910from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder
    1011
     
    2021    security = ClassSecurityInfo()
    2122   
     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       
    2253InitializeClass(StudentsFolder)
    2354
    2455def addStudentsFolder(container, id, REQUEST=None, **kw):
    2556    """Add a Student."""
    26     print id
    2757    ob = StudentsFolder(id, **kw)
    2858    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     
    3060### The Student
    3161###
    32 ##class Student(BaseDocument):
     62##class Student(CPSDocument):
    3363##    """
    3464##    WAeUP Student container for the various student data
    3565##    """
    36 ##    meta_type = 'Student'
    37 ##    portal_type = meta_type
     66####    meta_type = 'Student'
     67####    portal_type = meta_type
    3868##    security = ClassSecurityInfo()
    3969##   
     70##    security.declarePublic("test")
     71##    def test(self):
     72##        """test"""
     73##        return self.REQUEST
     74##   
    4075##InitializeClass(Student)
    41 ##
     76#
    4277##def addStudent(container, id, REQUEST=None, **kw):
    4378##    """Add a Student."""
    44 ##    print id
    4579##    ob = Student(id, **kw)
    4680##    return CPSBase_adder(container, ob, REQUEST=REQUEST)
  • waeup_product/trunk/Widgets.py

    r22 r47  
     1#-*- mode: python; mode: fold -*-
    12from Globals import InitializeClass
    23from Products.CPSSchemas.Widget import CPSWidgetType
     
    1112from zLOG import LOG, DEBUG
    1213
    13 class StudentIdWidget(CPSStringWidget):
     14class StudentIdWidget(CPSStringWidget): ###(
    1415    """ StudentId Widget"""
    1516    meta_type = "StudentId Widget"
     
    1920       
    2021        valid = CPSStringWidget.validate(self, datastructure, **kw)
     22        print "studentw",valid
    2123        if not valid:
    2224            return 0
     
    4345    cls = StudentIdWidget
    4446
    45 class ScratchcardPinWidget(CPSStringWidget):
     47###)
     48
     49class ScratchcardPinWidget(CPSStringWidget): ###(
    4650    """ ScratchcardPin Widget"""
    4751    meta_type = "ScratchcardPin Widget"
     
    5660       
    5761        valid = CPSStringWidget.validate(self, datastructure, **kw)
     62        print "sc_pinw",valid
    5863        if not valid:
    5964            return 0
     
    6267            value = datastructure[widget_id]
    6368            err = 0
     69            print value
    6470            if not value in valid_pins:
    6571                err = 'invalid Pin'
     
    7480
    7581class ScratchcardPinWidgetType(CPSWidgetType):
    76     """Student Id String widget type."""
     82    """Scratchcard Pin widget type."""
    7783    meta_type = "Scratchcard Pin  Widget Type"
    7884    cls = ScratchcardPinWidget
     85
     86###)
     87
    7988###########
    8089
     
    8291WidgetTypeRegistry.register(ScratchcardPinWidgetType)
    8392
    84 ##class MyProjectWeekDateTimeWidget(CPSDateTimeWidget):
     93##class MyProjectWeekDateTimeWidget(CPSDateTimeWidget): ###(
    8594##    """ """
    8695##    meta_type = "MyProject Week Date Time Widget"
     
    226235##WidgetTypeRegistry.register(MyProjectVisitTitleWidgetType)
    227236##
     237
     238###)
  • waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py

    r45 r47  
     1#-*- mode: python; mode: fold -*-
    12##parameters=
    23# $Id$
    34"""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
     31common_layout = {###(
    832    'widgets': {
    933        'LanguageSelector': {
     
    7094        },
    7195    }
    72 layouts['waeup_common'] = common_layout
    7396#
    74 #
    75 student_layout = {
     97###)
     98
     99student_layout = { ###(
    76100    'widgets': {
    77101        'jamb_is_admitted': {
     
    119143            },
    120144        },
    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##        },
    143167        'faculty': {
    144168            'type': 'String Widget',
     
    171195            [{'widget_id': 'jamb_is_admitted', 'ncols': 1},],
    172196            [{'widget_id': 'jamb_where_admitted', 'ncols': 1},],
    173             [{'widget_id': 'jamb_pin_usage', 'ncols': 1},],
     197            #[{'widget_id': 'jamb_pin_usage', 'ncols': 1},],
    174198            [{'widget_id': 'faculty', 'ncols': 1},],
    175199        ]
    176200    },
    177201}
    178 layouts['student'] = student_layout
    179 #
    180 #
    181 scratch_card = {
     202###)
     203
     204student_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
     335scratch_card = { ###(
    182336    'widgets': {
    183337        'sc_id': {
     
    237391}
    238392
    239 layouts['scratch_card'] = scratch_card
    240 
    241 jamb_layout = {
     393
     394###)
     395
     396admission = { ###(
     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
     479jamb_layout = { ###(
    242480    'widgets': {
    243481        'reg_nr': {
     
    459697    },
    460698}
    461 
     699###)
     700
     701layouts = {}
     702layouts['waeup_common'] = common_layout
     703layouts['student'] = student_layout
     704layouts['student_personal'] = student_personal_layout
     705layouts['scratch_card'] = scratch_card
     706layouts['admission'] = admission
    462707layouts['jamb'] = jamb_layout
    463 
    464708return layouts
  • waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py

    r45 r47  
    1 university_schema = {
     1#-*- mode: python; mode: fold -*-
     2# $Id$
     3
     4university_schema = { ###(
    25   'allow_discussion': {
    36        'type': 'CPS Int Field',
     
    912}
    1013
    11 students_folder_schema = {
     14###)
     15
     16students_folder_schema = { ###(
    1217   'allow_discussion': {
    1318        'type': 'CPS Int Field',
     
    1924}
    2025
    21 student_schema = {
     26###)
     27
     28student_schema = { ###(
    2229   'allow_discussion': {
    2330        'type': 'CPS Int Field',
     
    8188        },
    8289    },
    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     },
    10190}
    10291#
     92###)
     93
     94student_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}
    103133#
    104 jamb_schema = {
     134###)
     135
     136jamb_schema = { ###(
    105137   'allow_discussion': {
    106138        'type': 'CPS Int Field',
     
    115147            'default_expr': 'string:',
    116148            '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,
    117202            'acl_read_permissions': '',
    118203            'acl_read_roles': '',
     
    274359}
    275360
    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##}
    321408schemas = {}
     409###)
     410
    322411schemas['university'] = university_schema
    323412schemas['students'] = students_folder_schema
    324413schemas['student'] = student_schema
     414schemas['student_personal'] = student_personal_schema
    325415schemas['jamb'] = jamb_schema
    326 schemas['scratch_card'] = scratch_card
     416#schemas['scratch_card'] = scratch_card
    327417
    328418return schemas
  • waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py

    r45 r47  
     1#-*- mode: python; mode: fold -*-
    12##parameters=
    23# $Id$
     
    89ChangePermissions = 'Change permissions'
    910
    10 university_type = {
     11university_type = { ###(
    1112    'title': 'WAeUP Base Folder',
    1213    'description': 'The WAeUP Container',
     
    5556}
    5657
    57 students_folder_type = {
     58###)
     59
     60students_folder_type = { ###(
    5861    'title': 'WAeUP Student Folder',
    5962    'description': 'The WAeUP Student Folder',
     
    103106}
    104107
    105 student_type = {
     108###)
     109
     110student_type = { ###(
    106111    'title': 'WAeUP Student',
    107112    'description': '',
     
    116121    'global_allow': True,
    117122    'filter_content_types': True,
    118     'allowed_content_types': ('Jamb',),
     123    'allowed_content_types': ('Jamb','StudentPersonal'),
    119124    'allow_discussion': False,
    120125    'cps_is_searchable': True,
     
    130135         {'id': 'view',
    131136          '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',
    134139          'condition': '',
    135140          'permission': ('View',),
     
    137142          'visible': True,},
    138143         {'id': 'new_content',
    139           'name': 'Add Jamb Data',
     144          'name': 'Add Data',
    140145          'action': 'string:${object_url}/folder_factories',
    141           'condition': "python:len(object.contentItems()) == 0 ",
     146          'condition': "python:1 or len(object.contentItems()) == 0 ",
    142147          'permission': ('Modify portal content',),
    143148          'category': 'object',
     
    146151          'name': 'action_folder_contents',
    147152          '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'",
    149154          'permission': ('Modify portal content',),
    150155          'category': 'object',
     
    159164    )
    160165}
    161 scratch_card = {
     166
     167###)
     168
     169scratch_card = { ###(
    162170    'title': 'WAeUP Scratchcard',
    163171    'description': '',
     
    210218}
    211219#
    212 #
    213 jamb_type = {
     220###)
     221
     222jamb_type = { ###(
    214223    'title': "JAMB data",
    215224    'description': 'The data from JAMB',
     
    229238    #'schemas': ['common','metadata','jamb'],
    230239    '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
     249student_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'],
    232268    'flexible_layouts': (),
    233269    'storage_methods': (),
     
    235271    'cps_section_wf': 'section_content_wf',
    236272}
     273###)
    237274
    238275types = {}
     
    240277types['StudentsFolder'] = students_folder_type
    241278types['Student'] = student_type
     279types['StudentPersonal'] = student_personal_type
    242280types['ScratchCard'] = scratch_card
    243281types['Jamb'] = jamb_type
  • waeup_product/trunk/skins/waeup_default/portlet_studentnavigation.pt

    r46 r47  
    11<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:]"
    35                   >
    4   <tal:block condition="not:anonymous">
     6  <tal:block condition="python: not anonymous">
    57    <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>
    79  </tal:block>
    810  <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"""
     4process the Admission Form
    25
    3 # $Id$
     6return html renderer + psm
     7"""
     8type_name = 'Jamb'
     9ti = context.portal_types[type_name]
    410
    5 admin = "SectionManager" in context.portal_membership.getAuthenticatedMember().getRolesInContext(context)
     11REQUEST.set('type_name',type_name)
    612
    7 return context.student_admitted_form()
     13validate = REQUEST.has_key("cpsdocument_edit_button")
     14
     15#student = context.getContent()
     16student = context
     17
     18#jamb = getattr(student,'my-jamb').getContent()
     19jamb = 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
     28lt = context.portal_layouts
     29
     30res,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                      )
     37if psm == 'invalid':
     38    return context.check_admission_form(rendered = res,
     39                                 psm = psm,
     40                                 ds = ds,
     41                                 )
     42   
     43elif psm == 'valid':
     44    return context.student_admitted_form(rendered = res,
     45                                 psm = psm,
     46                                 student = student,
     47                                 jamb = jamb,
     48                                 )
     49   
     50return 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>
    214
    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" />
    4319    </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                   >
    17<metal:html use-macro="here/main_template/macros/master">
    2 
    38  <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  
    33# $Id$
    44
    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."""
    76
    87return context.student_view_main()
Note: See TracChangeset for help on using the changeset viewer.