Changeset 166 for waeup_product/trunk


Ignore:
Timestamp:
12 Nov 2005, 14:45:08 (19 years ago)
Author:
joachim
Message:

=more enhancements

Location:
waeup_product/trunk
Files:
2 deleted
13 edited
3 copied
3 moved

Legend:

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

    r162 r166  
    110110        waeup_ptypes = "'University','StudentsFolder','Student','Jamb','Faculty','Department','Course'"
    111111        waeup_ptypes += ",'AccoFolder','Accommodation','StudentPersonal','AcademicsFolder'"
    112         waeup_ptypes += ",'StudyLevel','Semester','CourseTicket'"
     112        waeup_ptypes += ",'StudyLevel','Semester','CourseTicket','StudentDocuments'"
    113113        if CPSSubscriptions: ###(
    114114
     
    429429                      'Student': 'waeup_student_wf',
    430430                      'StudentPersonal': 'waeup_student_wf',
     431                      'StudentDocuments': 'waeup_student_wf',
    431432                      'Jamb': 'waeup_section_wf',
    432433                      'ScratchCard': 'waeup_section_wf',
  • waeup_product/trunk/Students.py

    r164 r166  
    7878                '%s_sc_id' % ident : ds.get('sc_id'),
    7979                '%s_sc_value' % ident : ds.get('sc_value'),
     80                '%s_date' % ident : ds.get('sc_date'),
    8081                }
    81         tmp_user = CPSUnrestrictedUser('pseudo', '',
     82               
     83        if self.portal_membership.isAnonymousUser():
     84            tmp_user = CPSUnrestrictedUser('s%(jamb_id)s' % ds, '',
    8285                                       ['StudentManager'], '')
    83         tmp_user = tmp_user.__of__(self.acl_users)
    84         newSecurityManager(None, tmp_user)
     86            tmp_user = tmp_user.__of__(self.acl_users)
     87            newSecurityManager(None, tmp_user)
     88        #print str(dict)
    8589        self.edit(mapping=dict)
    8690
     
    9498        return False
    9599
     100    security.declareProtected(View,"accommodationIsBooked")
     101    def accommodationIsBooked(self):
     102        """is the accommodation booked"""
     103        if self.accommodation_sc_pin != '':
     104            return True
     105        return False
     106
     107    security.declareProtected(View,"accommodationIsPayed")
     108    def accommodationIsPayed(self):
     109        """is the accommodation payed"""
     110        if self.accommodation_sc_pin != '':
     111            return True
     112        return False
     113
     114    security.declareProtected(View,"isRegisteredForCurrentLevel")
     115    def isRegisteredForCurrentLevel(self):
     116        """is the student registered for the current level"""
     117        for l in  self.aq_parent.objectValues():
     118            if l.portal_type == 'StudyLevel':
     119                return True
     120        return False
     121
    96122InitializeClass(Student)
    97123
     
    138164    """Add a Students personal data."""
    139165    ob = StudentPersonal(id, **kw)
     166    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     167
     168###)
     169
     170studentdocuments_fti = { ###(
     171    'title': 'WAeUP StudentDocuments',
     172    'description': '',
     173    'content_icon': 'student.gif',
     174    'content_meta_type': 'StudentDocuments',
     175    'factory': 'addStudent',
     176    'immediate_view': 'temporary_view_all',
     177    'global_allow': True,
     178    'filter_content_types': True,
     179    'allowed_content_types': (),
     180    'allow_discussion': False,
     181}
     182
     183###)
     184
     185class StudentDocuments(CPSDocument): ###(
     186    """
     187    WAeUP Student container for the various student data
     188    """
     189    meta_type = 'StudentDocuments'
     190    portal_type = meta_type
     191    security = ClassSecurityInfo()
     192
     193    security.declareProtected(View,"Title")
     194    def Title(self):
     195        """compose title"""
     196        content = self.getContent()
     197        return "Scanned Documents"
     198
     199
     200InitializeClass(StudentDocuments)
     201
     202def addStudentDocuments(container, id, REQUEST=None, **kw):
     203    """Add a Students documents"""
     204    ob = StudentDocuments(id, **kw)
    140205    return CPSBase_adder(container, ob, REQUEST=REQUEST)
    141206
  • waeup_product/trunk/University.py

    r139 r166  
    2828        return self.REQUEST
    2929   
     30   
     31##    security.declarePublic('backEnd')
     32##    def backEnd(self):
     33##        """ are we in back-end mode"""
     34##        mtool = self.portal_membership
     35##        member = mtool.getAuthenticatedMember()
     36##        roles = member.getRoles()
     37##        if 'UniversityManager' in roles or 'StudentManager' in roles:
     38##            return True
     39##        return False
     40##
     41##    security.declarePublic('frontEnd')
     42##    def frontEnd(self):
     43##        """ are we in front-end mode"""
     44##        mtool = self.portal_membership
     45##        member = mtool.getAuthenticatedMember()
     46##        roles = member.getRoles()
     47##        if 'Student' in roles:
     48##            return True
     49##        return False
     50   
     51       
    3052InitializeClass(University)
    3153
  • waeup_product/trunk/__init__.py

    r139 r166  
    1313
    1414fti = (Students.student_fti,
     15       Students.studentdocuments_fti,
    1516       Students.studentpersonal_fti,
    1617       Students.jamb_fti,
     
    2829                  Students.StudentsFolder,
    2930                  Students.Student,
     31                  Students.StudentDocuments,
    3032                  Students.StudentPersonal,
    3133                  Students.Jamb,
     
    4345                       Students.addStudentsFolder,
    4446                       Students.addStudent,
     47                       Students.addStudentDocuments,
    4548                       Students.addStudentPersonal,
    4649                       Students.addJamb,
  • waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py

    r164 r166  
    202202###)
    203203
    204 student_layout = { ###(
    205     'widgets': {
    206         'jamb_is_admitted': {
    207             'type': 'Boolean Widget',
    208             'data': {
    209                 'title': 'JAMB Admission',
    210                 'fields': ('jamb_is_admitted',),
    211                 'is_required': False,
    212                 'label': 'JAMB Admission',
    213                 'label_edit': 'JAMB Admission',
    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 ##        'accommodation': {
    229 ##            'type': 'String Widget',
    230 ##            'data': {
    231 ##                'title': 'Accommodation',
    232 ##                'fields': ('accommodation',),
    233 ##                'is_required': False,
    234 ##                'label': 'Accommodation',
    235 ##                'label_edit': 'Accommodation',
    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 ##        'accommodation_sc_pin': {
    251 ##            'type': 'String Widget',
    252 ##            'data': {
    253 ##                'title': 'Accommodation SC Pin',
    254 ##                'fields': ('accommodation_sc_pin',),
    255 ##                'is_required': False,
    256 ##                'label': 'Accommodation SC Pin',
    257 ##                'label_edit': 'Accommodation SC Pin',
    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         'faculty': {
    273             'type': 'String Widget',
    274             'data': {
    275                 'title': 'Faculty',
    276                 'fields': ('faculty',),
    277                 'is_required': False,
    278                 'label': 'Faculty',
    279                 'label_edit': 'Faculty',
    280                 'description': '',
    281                 'help': '',
    282                 'is_i18n': False,
    283                 'readonly_layout_modes': (),
    284                 'hidden_layout_modes': (),
    285                 'hidden_readonly_layout_modes': (),
    286                 'hidden_empty': False,
    287                 'hidden_if_expr': '',
    288                 'css_class': '',
    289                 'widget_mode_expr': '',
    290                 'display_width': 10,
    291                 'size_max': 0,
    292             },
    293         },
    294     },
    295     'layout': {
    296         'style_prefix': 'layout_default_',
    297         'flexible_widgets': (),
    298         'ncols': 1,
    299         'rows': [
    300             #[{'widget_id': 'jamb_is_admitted', 'ncols': 1},],
    301             #[{'widget_id': 'accommodation', 'ncols': 1},],
    302             #[{'widget_id': 'accommodation_sc_pin', 'ncols': 1},],
    303             #[{'widget_id': 'faculty', 'ncols': 1},],
    304         ]
    305     },
    306 }
    307 ###)
    308 
    309204firstname = { ###(
    310205            'type': 'String Widget',
     
    473368###)
    474369
     370student_layout = { ###(
     371    'widgets': {
     372        'jamb_is_admitted': {
     373            'type': 'Boolean Widget',
     374            'data': {
     375                'title': 'JAMB Admission',
     376                'fields': ('jamb_is_admitted',),
     377                'is_required': False,
     378                'label': 'JAMB Admission',
     379                'label_edit': 'JAMB Admission',
     380                'description': '',
     381                'help': '',
     382                'is_i18n': False,
     383                'readonly_layout_modes': (),
     384                'hidden_layout_modes': (),
     385                'hidden_readonly_layout_modes': (),
     386                'hidden_empty': False,
     387                'hidden_if_expr': '',
     388                'css_class': '',
     389                'widget_mode_expr': '',
     390                'display_width': 10,
     391                'size_max': 0,
     392            },
     393        },
     394
     395        'faculty': {
     396            'type': 'String Widget',
     397            'data': {
     398                'title': 'Faculty',
     399                'fields': ('faculty',),
     400                'is_required': False,
     401                'label': 'Faculty',
     402                'label_edit': 'Faculty',
     403                'description': '',
     404                'help': '',
     405                'is_i18n': False,
     406                'readonly_layout_modes': (),
     407                'hidden_layout_modes': (),
     408                'hidden_readonly_layout_modes': (),
     409                'hidden_empty': False,
     410                'hidden_if_expr': '',
     411                'css_class': '',
     412                'widget_mode_expr': '',
     413                'display_width': 10,
     414                'size_max': 0,
     415            },
     416        },
     417        'accommodation': {
     418            'type': 'String Widget',
     419            'data': {
     420                'title': 'Accommodation',
     421                'fields': ('accommodation',),
     422                'is_required': False,
     423                'label': 'Accommodation',
     424                'label_edit': 'Accommodation',
     425                'description': '',
     426                'help': '',
     427                'is_i18n': False,
     428                'readonly_layout_modes': (),
     429                'hidden_layout_modes': (),
     430                'hidden_readonly_layout_modes': (),
     431                'hidden_empty': False,
     432                'hidden_if_expr': '',
     433                'css_class': '',
     434                'widget_mode_expr': '',
     435                'display_width': 10,
     436                'size_max': 0,
     437            },
     438        },
     439        'accommodation_sc_id': { ###(
     440            'type': 'String Widget',
     441            'data': {
     442                'title': 'Accommodation SC ID',
     443                'fields': ('accommodation_sc_id',),
     444                'is_required': False,
     445                'label': 'Accommodation SC ID',
     446                'label_edit': 'Accommodation SC ID',
     447                'description': '',
     448                'help': '',
     449                'is_i18n': False,
     450                'readonly_layout_modes': (),
     451                'hidden_layout_modes': (),
     452                'hidden_readonly_layout_modes': (),
     453                'hidden_empty': False,
     454                'hidden_if_expr': '',
     455                'css_class': '',
     456                'widget_mode_expr': '',
     457                'display_width': 10,
     458                'size_max': 0,
     459            },
     460        },###)
     461        'accommodation_sc_pin': { ###(
     462            'type': 'String Widget',
     463            'data': {
     464                'title': 'Accommodation SC Pin',
     465                'fields': ('accommodation_sc_pin',),
     466                'is_required': False,
     467                'label': 'Accommodation SC Pin',
     468                'label_edit': 'Accommodation SC Pin',
     469                'description': '',
     470                'help': '',
     471                'is_i18n': False,
     472                'readonly_layout_modes': (),
     473                'hidden_layout_modes': (),
     474                'hidden_readonly_layout_modes': (),
     475                'hidden_empty': False,
     476                'hidden_if_expr': '',
     477                'css_class': '',
     478                'widget_mode_expr': '',
     479                'display_width': 10,
     480                'size_max': 0,
     481            },
     482        },###)
     483        'accommodation_sc_value': { ###(
     484            'type': 'Float Widget',
     485            'data': {
     486                'title': 'Accommodation SC Value',
     487                'fields': ('accommodation_sc_value',),
     488                'is_required': False,
     489                'label': 'Accommodation SC Value',
     490                'label_edit': 'Accommodation SC Value',
     491                'description': '',
     492                'help': '',
     493                'is_i18n': False,
     494                'readonly_layout_modes': (),
     495                'hidden_layout_modes': (),
     496                'hidden_readonly_layout_modes': (),
     497                'hidden_empty': False,
     498                'hidden_if_expr': '',
     499                'css_class': '',
     500                'widget_mode_expr': '',
     501                'display_width': 10,
     502                'size_max': 0,
     503            },
     504        },###)
     505        'accommodation_date': { ###(
     506            'type': 'DateTime Widget',
     507            'data': {
     508                'title': 'Accommodation SC Pin',
     509                'fields': ('accommodation_date',),
     510                'is_required': False,
     511                'label': 'Accommodation SC Date',
     512                'label_edit': 'Accommodation SC Date',
     513                'description': '',
     514                'help': '',
     515                'is_i18n': False,
     516                'readonly_layout_modes': (),
     517                'hidden_layout_modes': (),
     518                'hidden_readonly_layout_modes': (),
     519                'hidden_empty': False,
     520                'hidden_if_expr': '',
     521                'css_class': '',
     522                'widget_mode_expr': '',
     523                'display_width': 10,
     524                'size_max': 0,
     525            },
     526        },###)
     527        'hostel_fee_sc_id': { ###(
     528            'type': 'String Widget',
     529            'data': {
     530                'title': 'hostel_fee SC ID',
     531                'fields': ('hostel_fee_sc_id',),
     532                'is_required': False,
     533                'label': 'Hostel Fee SC ID',
     534                'label_edit': 'Hostel Fee SC ID',
     535                'description': '',
     536                'help': '',
     537                'is_i18n': False,
     538                'readonly_layout_modes': (),
     539                'hidden_layout_modes': (),
     540                'hidden_readonly_layout_modes': (),
     541                'hidden_empty': False,
     542                'hidden_if_expr': '',
     543                'css_class': '',
     544                'widget_mode_expr': '',
     545                'display_width': 10,
     546                'size_max': 0,
     547            },
     548        },###)
     549        'hostel_fee_sc_pin': { ###(
     550            'type': 'String Widget',
     551            'data': {
     552                'title': 'hostel_fee SC Pin',
     553                'fields': ('hostel_fee_sc_pin',),
     554                'is_required': False,
     555                'label': 'Hostel Fee SC Pin',
     556                'label_edit': 'Hostel Fee SC Pin',
     557                'description': '',
     558                'help': '',
     559                'is_i18n': False,
     560                'readonly_layout_modes': (),
     561                'hidden_layout_modes': (),
     562                'hidden_readonly_layout_modes': (),
     563                'hidden_empty': False,
     564                'hidden_if_expr': '',
     565                'css_class': '',
     566                'widget_mode_expr': '',
     567                'display_width': 10,
     568                'size_max': 0,
     569            },
     570        },###)
     571        'hostel_fee_sc_value': { ###(
     572            'type': 'Float Widget',
     573            'data': {
     574                'title': 'hostel_fee SC Value',
     575                'fields': ('hostel_fee_sc_value',),
     576                'is_required': False,
     577                'label': 'Hostel Fee SC Value',
     578                'label_edit': 'Hostel Fee SC Value',
     579                'description': '',
     580                'help': '',
     581                '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': 10,
     590                'size_max': 0,
     591            },
     592        },###)
     593        'hostel_fee_date': { ###(
     594            'type': 'DateTime Widget',
     595            'data': {
     596                'title': 'hostel_fee SC Pin',
     597                'fields': ('hostel_fee_date',),
     598                'is_required': False,
     599                'label': 'Hostel Fee SC Date',
     600                'label_edit': 'Hostel Fee SC Date',
     601                'description': '',
     602                'help': '',
     603                'is_i18n': False,
     604                'readonly_layout_modes': (),
     605                'hidden_layout_modes': (),
     606                'hidden_readonly_layout_modes': (),
     607                'hidden_empty': False,
     608                'hidden_if_expr': '',
     609                'css_class': '',
     610                'widget_mode_expr': '',
     611                'display_width': 10,
     612                'size_max': 0,
     613            },
     614        },###)
     615        'adm_check_sc_id': { ###(
     616            'type': 'String Widget',
     617            'data': {
     618                'title': 'Admission check SC ID',
     619                'fields': ('adm_check_sc_id',),
     620                'is_required': False,
     621                'label': 'Admission check SC ID',
     622                'label_edit': 'Admission check SC ID',
     623                'description': '',
     624                'help': '',
     625                'is_i18n': False,
     626                'readonly_layout_modes': (),
     627                'hidden_layout_modes': (),
     628                'hidden_readonly_layout_modes': (),
     629                'hidden_empty': False,
     630                'hidden_if_expr': '',
     631                'css_class': '',
     632                'widget_mode_expr': '',
     633                'display_width': 10,
     634                'size_max': 0,
     635            },
     636        },###)
     637        'adm_check_sc_pin': { ###(
     638            'type': 'String Widget',
     639            'data': {
     640                'title': 'Admission check SC Pin',
     641                'fields': ('adm_check_sc_pin',),
     642                'is_required': False,
     643                'label': 'Admission check SC Pin',
     644                'label_edit': 'Admission check SC Pin',
     645                'description': '',
     646                'help': '',
     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': 10,
     656                'size_max': 0,
     657            },
     658        },###)
     659        'adm_check_sc_value': { ###(
     660            'type': 'Float Widget',
     661            'data': {
     662                'title': 'Admission check SC Value',
     663                'fields': ('adm_check_sc_value',),
     664                'is_required': False,
     665                'label': 'Admission check SC Value',
     666                'label_edit': 'Admission check SC Value',
     667                'description': '',
     668                'help': '',
     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': 10,
     678                'size_max': 0,
     679            },
     680        },###)
     681        'adm_check_date': { ###(
     682            'type': 'DateTime Widget',
     683            'data': {
     684                'title': 'Admission check SC Pin',
     685                'fields': ('adm_check_date',),
     686                'is_required': False,
     687                'label': 'Admission check SC Date',
     688                'label_edit': 'Admission check SC Date',
     689                'description': '',
     690                'help': '',
     691                'is_i18n': False,
     692                'readonly_layout_modes': (),
     693                'hidden_layout_modes': (),
     694                'hidden_readonly_layout_modes': (),
     695                'hidden_empty': False,
     696                'hidden_if_expr': '',
     697                'css_class': '',
     698                'widget_mode_expr': '',
     699                'display_width': 10,
     700                'size_max': 0,
     701            },
     702        },###)
     703        'clearence_sc_id': { ###(
     704            'type': 'String Widget',
     705            'data': {
     706                'title': 'Clearence SC ID',
     707                'fields': ('clearence_sc_id',),
     708                'is_required': False,
     709                'label': 'Clearence SC ID',
     710                'label_edit': 'Clearence SC ID',
     711                'description': '',
     712                'help': '',
     713                'is_i18n': False,
     714                'readonly_layout_modes': (),
     715                'hidden_layout_modes': (),
     716                'hidden_readonly_layout_modes': (),
     717                'hidden_empty': False,
     718                'hidden_if_expr': '',
     719                'css_class': '',
     720                'widget_mode_expr': '',
     721                'display_width': 10,
     722                'size_max': 0,
     723            },
     724        },###)
     725        'clearence_sc_pin': { ###(
     726            'type': 'String Widget',
     727            'data': {
     728                'title': 'clearence SC Pin',
     729                'fields': ('clearence_sc_pin',),
     730                'is_required': False,
     731                'label': 'Clearence SC Pin',
     732                'label_edit': 'Clearence SC Pin',
     733                'description': '',
     734                'help': '',
     735                'is_i18n': False,
     736                'readonly_layout_modes': (),
     737                'hidden_layout_modes': (),
     738                'hidden_readonly_layout_modes': (),
     739                'hidden_empty': False,
     740                'hidden_if_expr': '',
     741                'css_class': '',
     742                'widget_mode_expr': '',
     743                'display_width': 10,
     744                'size_max': 0,
     745            },
     746        },###)
     747        'clearence_sc_value': { ###(
     748            'type': 'Float Widget',
     749            'data': {
     750                'title': 'clearence SC Value',
     751                'fields': ('clearence_sc_value',),
     752                'is_required': False,
     753                'label': 'Clearence SC Value',
     754                'label_edit': 'Clearence SC Value',
     755                'description': '',
     756                'help': '',
     757                'is_i18n': False,
     758                'readonly_layout_modes': (),
     759                'hidden_layout_modes': (),
     760                'hidden_readonly_layout_modes': (),
     761                'hidden_empty': False,
     762                'hidden_if_expr': '',
     763                'css_class': '',
     764                'widget_mode_expr': '',
     765                'display_width': 10,
     766                'size_max': 0,
     767            },
     768        },###)
     769        'clearence_date': { ###(
     770            'type': 'DateTime Widget',
     771            'data': {
     772                'title': 'clearence SC Pin',
     773                'fields': ('clearence_date',),
     774                'is_required': False,
     775                'label': 'Clearence SC Date',
     776                'label_edit': 'Clearence SC Date',
     777                'description': '',
     778                'help': '',
     779                'is_i18n': False,
     780                'readonly_layout_modes': (),
     781                'hidden_layout_modes': (),
     782                'hidden_readonly_layout_modes': (),
     783                'hidden_empty': False,
     784                'hidden_if_expr': '',
     785                'css_class': '',
     786                'widget_mode_expr': '',
     787                'display_width': 10,
     788                'size_max': 0,
     789            },
     790        },###)
     791    },
     792    'layout': {
     793        'style_prefix': 'layout_default_',
     794        'flexible_widgets': (),
     795        'ncols': 1,
     796        'rows': [
     797            [{'widget_id': 'adm_check_sc_id', 'ncols': 1},],
     798            [{'widget_id': 'adm_check_sc_pin', 'ncols': 1},],
     799            [{'widget_id': 'adm_check_sc_value', 'ncols': 1},],
     800            [{'widget_id': 'adm_check_date', 'ncols': 1},],
     801            [{'widget_id': 'clearence_sc_id', 'ncols': 1},],
     802            [{'widget_id': 'clearence_sc_pin', 'ncols': 1},],
     803            [{'widget_id': 'clearence_sc_value', 'ncols': 1},],
     804            [{'widget_id': 'clearence_date', 'ncols': 1},],
     805            [{'widget_id': 'accommodation', 'ncols': 1},],
     806            [{'widget_id': 'accommodation_sc_id', 'ncols': 1},],
     807            [{'widget_id': 'accommodation_sc_pin', 'ncols': 1},],
     808            [{'widget_id': 'accommodation_sc_value', 'ncols': 1},],
     809            [{'widget_id': 'accommodation_date', 'ncols': 1},],
     810            [{'widget_id': 'hostel_fee_sc_id', 'ncols': 1},],
     811            [{'widget_id': 'hostel_fee_sc_pin', 'ncols': 1},],
     812            [{'widget_id': 'hostel_fee_sc_value', 'ncols': 1},],
     813            [{'widget_id': 'hostel_fee_date', 'ncols': 1},],
     814        ]
     815    },
     816}###)
     817
    475818student_personal_layout = { ###(
    476819    'widgets': {
     
    499842                'display_width': 10,
    500843                'size_max': 0,
    501             },
    502         },
    503         'photo': {
    504             'type': 'Photo Widget',
    505             'data': {
    506                 'title': '',
    507                 'fields': ('photo',),
    508                 'is_required': False,
    509                 'label': 'Personal Picture',
    510                 'label_edit': 'Personal Picture',
    511                 'description': '',
    512                 'help': '',
    513                 'is_i18n': False,
    514                 'readonly_layout_modes': (),
    515                 'hidden_layout_modes': (),
    516                 'hidden_readonly_layout_modes': (),
    517                 'hidden_empty': False,
    518                 'hidden_if_expr': '',
    519                 'widget_mode_expr': '',
    520                 'css_class': '',
    521                 'css_class_expr': '',
    522                 'javascript_expr': '',
    523                 'deletable': True,
    524                 'size_max': 4194304,
    525                 'display_width': 90,
    526                 'display_height': 180,
    527                 'allow_resize': True,
    528                 'render_position': 'left',
    529                 'configurable': 'nothing',
    530                 'keep_original': 1,
    531             },
    532         },
    533         'birth_certificate': {
    534             'type': 'Image Widget',
    535             'data': {
    536                 'title': '',
    537                 'fields': ('birth_certificate',),
    538                 'is_required': False,
    539                 'label': 'Birth Certificate',
    540                 'label_edit': 'Birth Certificate',
    541                 'description': '',
    542                 'help': '',
    543                 'is_i18n': False,
    544                 'readonly_layout_modes': (),
    545                 'hidden_layout_modes': (),
    546                 'hidden_readonly_layout_modes': (),
    547                 'hidden_empty': False,
    548                 'hidden_if_expr': '',
    549                 'widget_mode_expr': '',
    550                 'css_class': '',
    551                 'css_class_expr': '',
    552                 'javascript_expr': '',
    553                 'deletable': True,
    554                 'size_max': 4194304,
    555                 'display_width': 300,
    556                 'display_height':600,
    557                 'allow_resize': True,
    558844            },
    559845        },
     
    569855            [{'widget_id': 'sex', 'ncols': 1},],
    570856            [{'widget_id': 'birthday', 'ncols': 1},],
     857        ]
     858    },
     859}###)
     860
     861student_documents = { ###(
     862    'widgets': {
     863        'photo': { ###(
     864            'type': 'Photo Widget',
     865            'data': {
     866                'title': '',
     867                'fields': ('photo',),
     868                'is_required': True,
     869                'label': 'Personal Picture',
     870                'label_edit': 'Personal Picture',
     871                'description': '',
     872                'help': '',
     873                'is_i18n': False,
     874                'readonly_layout_modes': (),
     875                'hidden_layout_modes': (),
     876                'hidden_readonly_layout_modes': (),
     877                'hidden_empty': False,
     878                'hidden_if_expr': '',
     879                'widget_mode_expr': '',
     880                'css_class': '',
     881                'css_class_expr': '',
     882                'javascript_expr': '',
     883                'deletable': True,
     884                'size_max': 40960,
     885                'display_width': 90,
     886                'display_height': 180,
     887                'allow_resize': True,
     888                'render_position': 'left',
     889                'configurable': 'nothing',
     890                'keep_original': 1,
     891            },
     892        },###)
     893        'birth_certificate': { ###(
     894            'type': 'Image Widget',
     895            'data': {
     896                'title': '',
     897                'fields': ('birth_certificate',),
     898                'is_required': True,
     899                'label': 'Birth Certificate',
     900                'label_edit': 'Birth Certificate',
     901                'description': '',
     902                'help': '',
     903                'is_i18n': False,
     904                'readonly_layout_modes': (),
     905                'hidden_layout_modes': (),
     906                'hidden_readonly_layout_modes': (),
     907                'hidden_empty': False,
     908                'hidden_if_expr': '',
     909                'widget_mode_expr': '',
     910                'css_class': '',
     911                'css_class_expr': '',
     912                'javascript_expr': '',
     913                'deletable': True,
     914                'size_max': 40960,
     915                'display_width': 300,
     916                'display_height':600,
     917                'allow_resize': True,
     918            },
     919        },###)
     920        'passport': { ###(
     921            'type': 'Image Widget',
     922            'data': {
     923                'title': '',
     924                'fields': ('passport',),
     925                'is_required': True,
     926                'label': 'scanned Passport',
     927                'label_edit': 'scanned Passport',
     928                'description': '',
     929                'help': '',
     930                'is_i18n': False,
     931                'readonly_layout_modes': (),
     932                'hidden_layout_modes': (),
     933                'hidden_readonly_layout_modes': (),
     934                'hidden_empty': False,
     935                'hidden_if_expr': '',
     936                'widget_mode_expr': '',
     937                'css_class': '',
     938                'css_class_expr': '',
     939                'javascript_expr': '',
     940                'deletable': True,
     941                'size_max': 40960,
     942                'display_width': 300,
     943                'display_height':600,
     944                'allow_resize': True,
     945            },
     946        },###)
     947        'results_first': { ###(
     948            'type': 'Image Widget',
     949            'data': {
     950                'title': '',
     951                'fields': ('results_first',),
     952                'is_required': True,
     953                'label': '1st Sitting Results',
     954                'label_edit': '1st Sitting Results',
     955                'description': '',
     956                'help': '',
     957                'is_i18n': False,
     958                'readonly_layout_modes': (),
     959                'hidden_layout_modes': (),
     960                'hidden_readonly_layout_modes': (),
     961                'hidden_empty': False,
     962                'hidden_if_expr': '',
     963                'widget_mode_expr': '',
     964                'css_class': '',
     965                'css_class_expr': '',
     966                'javascript_expr': '',
     967                'deletable': True,
     968                'size_max': 40960,
     969                'display_width': 300,
     970                'display_height':600,
     971                'allow_resize': True,
     972            },
     973        },###)
     974        'results_second': { ###(
     975            'type': 'Image Widget',
     976            'data': {
     977                'title': '',
     978                'fields': ('results_second',),
     979                'is_required': False,
     980                'label': '2nd Sitting Results',
     981                'label_edit': '2nd Sitting Results',
     982                'description': '',
     983                'help': '',
     984                'is_i18n': False,
     985                'readonly_layout_modes': (),
     986                'hidden_layout_modes': (),
     987                'hidden_readonly_layout_modes': (),
     988                'hidden_empty': False,
     989                'hidden_if_expr': '',
     990                'widget_mode_expr': '',
     991                'css_class': '',
     992                'css_class_expr': '',
     993                'javascript_expr': '',
     994                'deletable': True,
     995                'size_max': 40960,
     996                'display_width': 300,
     997                'display_height':600,
     998                'allow_resize': True,
     999            },
     1000        },###)
     1001    },
     1002    'layout': {
     1003        'style_prefix': 'layout_personal_',
     1004        'flexible_widgets': (),
     1005        'ncols': 1,
     1006        'rows': [
    5711007            [{'widget_id': 'photo', 'ncols': 1},],
    5721008            [{'widget_id': 'birth_certificate', 'ncols': 1},],
     1009            [{'widget_id': 'passport', 'ncols': 1},],
     1010            [{'widget_id': 'results_first', 'ncols': 1},],
     1011            [{'widget_id': 'results_second', 'ncols': 1},],
    5731012        ]
    5741013    },
     
    7591198    },
    7601199   'layout': {
    761         'style_prefix': 'layout_admission_',
     1200        'style_prefix': 'layout_sc_',
    7621201        'flexible_widgets': (),
    7631202        'ncols': 1,
     
    8651304    },
    8661305   'layout': {
    867         'style_prefix': 'layout_clearence_',
     1306        'style_prefix': 'layout_sc_',
    8681307        'flexible_widgets': (),
    8691308        'ncols': 1,
     
    16142053        'data': {
    16152054                'title': 'SC ID',
    1616                 'fields': ('accommodation_sc_id'),
     2055                'fields': ('sc_id'),
    16172056                'is_required': False,
    16182057                'label': 'Card Serial Number ',
     
    16322071            }
    16332072        },###)
    1634         'sc_pin': { ###(
     2073    'sc_pin': { ###(
    16352074         'type': 'Scratchcard Pin Widget',
    16362075         'data': {
    16372076                'title': 'SC Pin',
    1638                 'fields': ('accommodation_sc_pin'),
     2077                'fields': ('sc_pin'),
    16392078                'is_required': True,
    16402079                'label': 'enter  PIN',
     
    16542093            },
    16552094        },###)
    1656         'sc_value': { ###(
     2095    'sc_value': { ###(
    16572096         'type': 'Float Widget',
    16582097         'data': {
    16592098                'title': 'Scratch card value',
    1660                 'fields': ('accommodation_sc_value',),
     2099                'fields': ('sc_value',),
    16612100                'is_required': False,
    16622101                'label': 'SC Value',
     
    16782117               },
    16792118   'layout': {
    1680         'style_prefix': 'layout_accobook_',
     2119        'style_prefix': 'layout_sc_',
    16812120        'flexible_widgets': (),
    16822121        'ncols': 1,
     
    16902129###)
    16912130
     2131accopay = { ###(
     2132    'widgets': {
     2133     'sc_id': { ###(
     2134        'type': 'String Widget',
     2135        'data': {
     2136                'title': 'SC ID',
     2137                'fields': ('sc_id'),
     2138                'is_required': False,
     2139                'label': 'Card Serial Number ',
     2140                'label_edit': 'Card Serial Number',
     2141                'description': 'Card Serial Number ',
     2142                'help': 'This can be found on the bottom right of the reverse side of your Scratch Card',
     2143                'is_i18n': False,
     2144                'readonly_layout_modes': (),
     2145                'hidden_layout_modes': (),
     2146                'hidden_readonly_layout_modes': (),
     2147                'hidden_empty': False,
     2148                'hidden_if_expr': 'python:1',
     2149                'css_class': '',
     2150                'widget_mode_expr': '',
     2151                'display_width': 10,
     2152                'size_max': 0,
     2153            }
     2154        },###)
     2155    'sc_pin': { ###(
     2156         'type': 'Scratchcard Pin Widget',
     2157         'data': {
     2158                'title': 'SC Pin',
     2159                'fields': ('sc_pin'),
     2160                'is_required': True,
     2161                'label': 'enter  PIN',
     2162                'label_edit': 'enter an Hostel payment PIN',
     2163                'description': '',
     2164                'help': 'Please enter a PIN valid for paying hostel fee',
     2165                'is_i18n': False,
     2166                'readonly_layout_modes': (),
     2167                'hidden_layout_modes': (),
     2168                'hidden_readonly_layout_modes': (),
     2169                'hidden_empty': False,
     2170                'hidden_if_expr': '',
     2171                'css_class': '',
     2172                'widget_mode_expr': '',
     2173                'display_width': 10,
     2174                'size_max': 10,
     2175            },
     2176        },###)
     2177    'sc_value': { ###(
     2178         'type': 'Float Widget',
     2179         'data': {
     2180                'title': 'Scratch card value',
     2181                'fields': ('sc_value',),
     2182                'is_required': False,
     2183                'label': 'SC Value',
     2184                'label_edit': 'Scratcard Value',
     2185                'description': '',
     2186                'help': '',
     2187                'is_i18n': False,
     2188                'readonly_layout_modes': ('create'),
     2189                'hidden_layout_modes': (),
     2190                'hidden_readonly_layout_modes': (),
     2191                'hidden_empty': False,
     2192                'hidden_if_expr': '',
     2193                'css_class': '',
     2194                'widget_mode_expr': '',
     2195                'display_width': 10,
     2196                'size_max': 10,
     2197            },
     2198        },###)
     2199               },
     2200   'layout': {
     2201        'style_prefix': 'layout_sc_',
     2202        'flexible_widgets': (),
     2203        'ncols': 1,
     2204        'rows': [
     2205            #[{'widget_id': 'sc_id', 'ncols': 1},],
     2206            [{'widget_id': 'sc_value', 'ncols': 1},],
     2207            [{'widget_id': 'sc_pin', 'ncols': 1},],
     2208        ]
     2209    },
     2210}###)
     2211
    16922212layouts = {}
    16932213layouts['university'] = common_layout
     
    16952215layouts['student'] = student_layout
    16962216layouts['study_level'] = study_level
     2217layouts['student_documents'] = student_documents
    16972218layouts['student_personal'] = student_personal_layout
    16982219layouts['student_eligibility'] = student_eligibility
    16992220layouts['accommodation'] = accommodation
    17002221layouts['accobook'] = accobook
     2222layouts['accopay'] = accopay
    17012223layouts['scratch_card'] = scratch_card
    17022224layouts['admission'] = admission
  • waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py

    r164 r166  
    4545sc_value = { ###(
    4646        'type': 'CPS Float Field',
     47        'data': {
     48            'default_expr': 'python:0.',
     49            'is_searchabletext': True,
     50            'acl_read_permissions': '',
     51            'acl_read_roles': '',
     52            'acl_read_expr': '',
     53            'acl_write_permissions': '',
     54            'acl_write_roles': '',
     55            'acl_write_expr': '',
     56            'read_ignore_storage': False,
     57            'read_process_expr': '',
     58            'read_process_dependent_fields': (),
     59            'write_ignore_storage': False,
     60            'write_process_expr': '',
     61            },
     62        }
     63###)
     64sc_date = { ###(
     65        'type': 'CPS DateTime Field',
    4766        'data': {
    4867            'default_expr': 'python:500.',
     
    137156        'data': {
    138157            'is_searchabletext': 0,
    139             'acl_write_roles': 'SectionReader',
    140158        },
    141159    },
     
    150168        },
    151169    },
     170    'accommodation' : { ###(
     171        'type': 'CPS String Field',
     172        'data': {
     173            'default_expr': 'string:',
     174            'is_searchabletext': True,
     175            'acl_read_permissions': '',
     176            'acl_read_roles': '',
     177            'acl_read_expr': '',
     178            'acl_write_permissions': '',
     179            'acl_write_roles': '',
     180            'acl_write_expr': '',
     181            'read_ignore_storage': False,
     182            'read_process_expr': '',
     183            'read_process_dependent_fields': (),
     184            'write_ignore_storage': False,
     185            'write_process_expr': '',
     186             },
     187        }, ###)
    152188    'accommodation_sc_id' : sc_id,
    153189    'accommodation_sc_pin' : sc_pin,
     
    160196        },
    161197    },
     198    'hostel_fee_sc_id' : sc_id,
     199    'hostel_fee_sc_pin' : sc_pin,
     200    'hostel_fee_sc_value' : sc_value,
     201    'hostel_fee_date' : {
     202        'type': 'CPS DateTime Field',
     203        'data': {
     204            'is_searchabletext': 0,
     205            'acl_write_roles': 'SectionReader',
     206        },
     207    },
    162208}
    163209###)
     
    205251###)
    206252
     253student_hostel_fee = { ###(
     254    'sc_id': sc_id,
     255    'sc_pin': sc_pin,
     256    'sc_value': { ###(
     257        'type': 'CPS Float Field',
     258        'data': {
     259            'default_expr': 'python:2500.',
     260            'is_searchabletext': True,
     261            'acl_read_permissions': '',
     262            'acl_read_roles': '',
     263            'acl_read_expr': '',
     264            'acl_write_permissions': '',
     265            'acl_write_roles': '',
     266            'acl_write_expr': '',
     267            'read_ignore_storage': False,
     268            'read_process_expr': '',
     269            'read_process_dependent_fields': (),
     270            'write_ignore_storage': False,
     271            'write_process_expr': '',
     272            },
     273        },###)
     274    'accommodation': {
     275        'type': 'CPS String Field',
     276        'data': {
     277            'default_expr': 'string:',
     278            'is_searchabletext': True,
     279            'acl_read_permissions': '',
     280            'acl_read_roles': '',
     281            'acl_read_expr': '',
     282            'acl_write_permissions': '',
     283            'acl_write_roles': '',
     284            'acl_write_expr': '',
     285            'read_ignore_storage': False,
     286            'read_process_expr': '',
     287            'read_process_dependent_fields': (),
     288            'write_ignore_storage': False,
     289            'write_process_expr': '',
     290             },
     291        },
     292}
     293###)
     294
    207295student_admission = { ###(
    208296    'sc_id': sc_id,
     
    346434        },
    347435    },
     436}
     437###)
     438
     439student_documents = { ###(
    348440     'photo': {
    349441        'type': 'CPS Image Field',
     
    353445    },
    354446     'birth_certificate': {
     447        'type': 'CPS Image Field',
     448        'data': {
     449            'is_searchabletext': 0,
     450        },
     451    },
     452     'passport': {
     453        'type': 'CPS Image Field',
     454        'data': {
     455            'is_searchabletext': 0,
     456        },
     457    },
     458     'results_first': {
     459        'type': 'CPS Image Field',
     460        'data': {
     461            'is_searchabletext': 0,
     462        },
     463    },
     464     'results_second': {
    355465        'type': 'CPS Image Field',
    356466        'data': {
     
    764874schemas['student_admission'] = student_admission
    765875schemas['student_clearence'] = student_clearence
     876schemas['student_documents'] = student_documents
    766877schemas['student_eligibility'] = student_eligibility
    767878schemas['student_accommodation'] = student_accommodation
     879schemas['student_hostel_fee'] = student_hostel_fee
    768880schemas['study_level'] = study_level
    769881schemas['course_results'] = course_results_schema
  • waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py

    r164 r166  
    154154###)
    155155
    156 student_type = { ###(
    157     'title': 'WAeUP Student',
    158     'description': '',
    159     'content_icon': 'student.gif',
    160     'content_meta_type': 'Student',
    161     'product': 'WAeUP',
    162     'factory': 'addStudent',
    163     'immediate_view': 'folder_view',
    164     'global_allow': True,
    165     'filter_content_types': True,
    166     'allowed_content_types': ('Jamb','StudentPersonal','StudyLevel'),
    167     'allow_discussion': False,
    168     'cps_is_searchable': True,
    169     'cps_proxy_type': 'folder',
    170     'cps_display_as_document_in_listing': True,
    171     'schemas': ['metadata','common','student'],
    172     'layouts': ['waeup_common','student'],
    173     'flexible_layouts': (),
    174     'layout_clusters': ['metadata:metadata'],
    175     'cps_section_wf': 'waeup_section_wf',
    176     'use_content_status_history': 0,
    177     'actions': (
    178          {'id': 'view',
    179           'name': 'Standard View',
    180           #'action': 'string:${object_url}/student_index_html',
    181           'action': 'temporary_view_all',
    182           'condition':  'object/memberIsOwner',
    183           'permission': (View,),
    184           'category': 'object',
    185           'visible': True,
    186           },
    187          {'id': 'metadata',
    188           'name': 'action_metadata',
    189           'action': 'cpsdocument_metadata',
    190           'condition': "python:member and 'Manager' in member.getRoles()",
    191           'permissions': (UniversityManage,)},
    192          {'id': 'localroles',
    193           'name': 'delegate',
    194           'action': 'folder_localrole_form',
    195           'permissions': (ModifyPortalContent),
    196           'visible' : 0,
    197           },
    198          {'id'        : 'eligibility',
    199           'name'      : 'eligibility',
    200           'action'    : 'eligibility',
    201           'condition':  'object/memberIsOwner',
    202           'permission': (ModifyPortalContent,),
    203           'visible': False,
    204           },
    205          {'id'        : 'JAMB',
    206           'name'      : 'JAMB Data',
    207           'action'    : 'string:${object/absolute_url}/JAMB',
    208           'condition':  'object/memberIsOwner',
    209           'permission': (ModifyPortalContent,)},
    210           {
    211           'id'        : 'PERSONAL',
    212           'name'      : 'Personal Data',
    213           'action'    : 'string:${object/absolute_url}/PERSONAL',
    214           'condition':  "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)",
    215           'permission': (ModifyPortalContent,)},
    216           {
    217           'id'        : 'study_level',
    218           'name'      : 'Register for next Level',
    219           'action'    : 'string:${object/absolute_url}/register_level',
    220           'condition':  'object/memberIsOwner',
    221           'permission': (ModifyPortalContent,)},
    222           {
    223           'id'        : 'book_accomodation',
    224           'name'      : 'Book Accomodation',
    225           'action'    : 'string:${object/absolute_url}/book_accommodation',
    226           'condition':  'object/memberIsOwner',
    227           'permission': (ModifyPortalContent,)},
    228           )
    229 }
    230 ###)
    231 
    232156academics_folder_type = { ###(
    233157    'title': 'WAeUP Academics Folder',
     
    323247###)
    324248
     249student_type = { ###(
     250    'title': 'WAeUP Student',
     251    'description': '',
     252    'content_icon': 'student.gif',
     253    'content_meta_type': 'Student',
     254    'product': 'WAeUP',
     255    'factory': 'addStudent',
     256    'immediate_view': 'folder_view',
     257    'global_allow': True,
     258    'filter_content_types': True,
     259    'allowed_content_types': ('Jamb','StudentDocuments','StudentPersonal','StudyLevel'),
     260    'allow_discussion': False,
     261    'cps_is_searchable': True,
     262    'cps_proxy_type': 'folder',
     263    'cps_display_as_document_in_listing': True,
     264    'schemas': ['metadata','common','student'],
     265    'layouts': ['waeup_common','student'],
     266    'flexible_layouts': (),
     267    'layout_clusters': ['metadata:metadata'],
     268    'cps_section_wf': 'waeup_section_wf',
     269    'use_content_status_history': 0,
     270    'actions': (
     271         {'id': 'view',
     272          'name': 'Standard View',
     273          #'action': 'string:${object_url}/student_index_html',
     274          'action': 'string:${object_url}/temporary_view_all',
     275          'condition':  'python:object.getContent().memberIsOwner()',
     276          'permission': (View,),
     277          'category': 'object',
     278          'visible': True,
     279          },
     280         {'id': 'metadata',
     281          'name': 'action_metadata',
     282          'action': 'cpsdocument_metadata',
     283          'condition': "python:member and 'Manager' in member.getRoles()",
     284          'permissions': (UniversityManage,),
     285          },
     286         {'id': 'localroles',
     287          'name': 'delegate',
     288          'action': 'folder_localrole_form',
     289          'permissions': (ModifyPortalContent),
     290          'visible' : 0,
     291          },
     292         {'id'        : 'eligibility',
     293          'name'      : 'eligibility',
     294          'action'    : 'eligibility',
     295          'condition':  'object/memberIsOwner',
     296          'permission': (ModifyPortalContent,),
     297          'visible': False,
     298          },
     299         {'id'        : 'JAMB',
     300          'name'      : 'JAMB Data',
     301          'action'    : 'string:${object/absolute_url}/JAMB',
     302          'condition':  'python:object.getContent().memberIsOwner()',
     303          'permission': (ModifyPortalContent,),
     304          'visible': False,
     305          },
     306          {
     307          'id'        : 'DOCUMENTS',
     308          'name'      : 'upload Documents',
     309          'action'    : 'string:${object/absolute_url}/DOCUMENTS',
     310          'condition':  "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)",
     311          'permission': (ModifyPortalContent,)},
     312          {
     313          'id'        : 'PERSONAL',
     314          'name'      : 'Personal Data',
     315          'action'    : 'string:${object/absolute_url}/PERSONAL',
     316          'condition':  "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)",
     317          'permission': (ModifyPortalContent,)},
     318          {
     319          'id'        : 'register_study_level',
     320          'name'      : 'Register for next Level',
     321          'action'    : 'string:${object/absolute_url}/register_level',
     322          'condition':  'python: object.getContent().memberIsOwner() and not object.getContent().isRegisteredForCurrentLevel()',
     323          'permission': (ModifyPortalContent,)},
     324          {
     325          'id'        : 'book_accomodation',
     326          'name'      : 'Book Accomodation',
     327          'action'    : 'string:${object/absolute_url}/book_accommodation',
     328          'condition':  'python: object.getContent().memberIsOwner() and not object.getContent().accommodationIsBooked()',
     329          'permission': (ModifyPortalContent,)},
     330          {
     331          'id'        : 'pay_hostel_fee',
     332          'name'      : 'Pay Hostel Fee',
     333          'action'    : 'string:${object/absolute_url}/pay_hostel_fee',
     334          'condition':  'python: object.getContent().memberIsOwner() and not object.getContent().accommodationIsPayed()',
     335          'permission': (ModifyPortalContent,)},
     336          )
     337}###)
     338
    325339jamb_type = { ###(
    326340    'title': "JAMB data",
     
    388402    'product': 'WAeUP',
    389403    'factory': 'addStudentPersonal',
    390     'immediate_view': 'student_personal_index_html',
     404    'immediate_view': 'temporary_view_all',
    391405    'global_allow': True,
    392406    'filter_content_types': True,
     
    406420         {'id': 'view',
    407421          'name': 'Standard View',
    408           #'action': 'string:${object_url}/student_personal_index_html',
    409           #'action': 'string:${object_url}/cpsdocument_view',
    410422          'action': 'temporary_view_all',
    411423          'permission': (View,),
     
    415427          'name': 'action_edit',
    416428          'action': 'string:${object_url}/student_personal_edit_form',
    417           'condition': '',
    418429          'permission': (ModifyPortalContent,),
    419430          'category': 'object',
    420431          'visible': True,},
     432         {'id': 'metadata',
     433          'name': 'action_metadata',
     434          'action': 'cpsdocument_metadata',
     435          'condition': "python:member and 'Manager' in member.getRoles()",
     436          'permissions': (UniversityManage,)},
     437          )
     438}
     439###)
     440
     441student_documents = { ###(
     442    'title': "Students documents data",
     443    'description': '',
     444    'content_icon': '',
     445    'content_meta_type': 'StudentDocuments',
     446    'product': 'WAeUP',
     447    'factory': 'addStudentDocuments',
     448    'immediate_view': 'temporary_view_all',
     449    'global_allow': True,
     450    'filter_content_types': True,
     451    'allowed_content_types': (),
     452    'allow_discussion': False,
     453    'cps_is_searchable': True,
     454    'cps_proxy_type': 'document',
     455    'cps_display_as_document_in_listing': True,
     456    'cps_is_portalbox': False,
     457    'schemas': ['student_documents'],
     458    'layouts': ['student_documents'],
     459    'flexible_layouts': (),
     460    'storage_methods': (),
     461    'cps_workspace_wf': 'workspace_content_wf',
     462    'cps_section_wf': 'section_content_wf',
     463    'actions': (
     464         {'id': 'view',
     465          'name': 'View',
     466          'action': 'string:${object_url}/temporary_view_all',
     467          'permission': (View),
     468          'category': 'object',
     469          'visible': True,
     470          },
     471         {'id': 'edit',
     472          'name': 'action_edit',
     473          'action': 'string:${object_url}/student_documents_edit_form',
     474          'permission': (ModifyPortalContent,),
     475          'category': 'object',
     476          'visible': True,
     477          },
    421478         {'id': 'metadata',
    422479          'name': 'action_metadata',
     
    432489    'description': '',
    433490    'content_icon': '',
    434     'content_meta_type': 'Level',
     491    'content_meta_type': 'StudyLevel',
    435492    'product': 'WAeUP',
    436493    'factory': 'addStudyLevel',
     
    453510          'name': 'Standard View',
    454511          #'action': 'accommodation_index_html',
    455           'action': 'temporary_view_all',
     512          'action': 'string:${object_url}/temporary_view_all',
    456513          'condition': '',
    457514          'permission': (View,),
     
    877934types['AcademicsFolder'] = academics_folder_type
    878935types['Student'] = student_type
     936types['StudentDocuments'] = student_documents
    879937types['StudentPersonal'] = student_personal_type
    880938types['StudyLevel'] = study_level_folder
  • waeup_product/trunk/skins/waeup_default/portlet_session_info.pt

    r155 r166  
    11<tal:block define="mtool here/portal_membership;
    2            anonymous mtool/isAnonymousUser;
    3            member mtool/getAuthenticatedMember"
     2           member mtool/getAuthenticatedMember;
     3           isAnon mtool/isAnonymousUser;
     4           roles member/getRoles;
     5           backend python:'UniversityManager' in roles or 'StudentManager' in roles;
     6           frontend python:'Student' in roles or isAnon;"
    47           >
    5   <tal:block condition="not:anonymous">
    6     <div i18n:translate="">You are currently logged in as
    7       <em i18n:name="member"
    8           tal:content="member" /><br />with Basic Roles <span tal:content="member/getRoles" /><br />
    9       <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" />
    10     </div>
     8  <tal:block condition="not:isAnon">
     9    <tal:block condition="backend">
     10      <em tal:content="member" /> is working in back-end mode<br />
     11      <span  tal:condition="python: 1" >
     12        with Basic Roles <span tal:content="member/getRoles" /><br />
     13        <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" />
     14      </span>
     15    </tal:block>
     16    <tal:block condition="not:backend">
     17      <em tal:content="member" /> is working in front-end mode<br />
     18      <span  tal:condition="python: 1" >
     19        with Basic Roles <span tal:content="member/getRoles" /><br />
     20        <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" />
     21      </span>
     22    </tal:block>
    1123    <br />
    1224    <a href="" tal:condition="python: 'Student' in member.getRoles() and not 'UniversityManager' in member.getRoles()"
    13                tal:attributes="href string:${context/portal_url}/students/${member}">
    14            Go to your personal area
     25       tal:attributes="href string:${context/portal_url}/students/${member}">
     26      Go to your personal area
    1527    </a>
    1628    <br />
    1729    <a href="" tal:condition="python: 0"
    18                tal:attributes="href string:${context/portal_url}/cpsdirectory_entry_view?dirname=members&id=${member}">       
    19           Edit your Preferences
     30       tal:attributes="href string:${context/portal_url}/cpsdirectory_entry_view?dirname=members&id=${member}">       
     31      Edit your Preferences
    2032    </a>
    2133    <br />
    2234    <a href="" i18n:translate=""
    23                tal:attributes="href string:logout">
    24           Log out
     35       tal:attributes="href string:logout">
     36      Log out
    2537    </a>
    26    
    2738  </tal:block>
    28   <tal:block condition="anonymous">
     39  <tal:block condition="isAnon">
    2940    <div>You are not logged in. </div>
    3041    <br />
     
    3243  </tal:block>
    3344</tal:block>
    34            
  • waeup_product/trunk/skins/waeup_default/temporary_view_all.py

    r160 r166  
    1 ##parameters=REQUEST=None,psm=None,groups=None
     1##parameters=psm=None
    22# $Id$
    33
     
    66
    77member = context.portal_membership.getAuthenticatedMember()
    8 
    9 if not context.portal_membership.isAnonymousUser():
    10     if 'UniversityManager' in member.getRoles():
    11         return context.folder_view()
    12 index = getattr(context,'documents',None)
    13 if index:
    14     fp = getattr(index,'frontpage',None)
    15     if fp:
    16         return fp()
    17 return context.university_view_all(psm=psm)
     8uname = str(member)
     9roles = member.getRoles()
     10cat = context.portal_catalog
     11request = context.REQUEST
     12url0 = request.get('URL0')
     13if context.portal_membership.isAnonymousUser():
     14    return context.temporary_view_all_form(psm=psm)
     15else:
     16    if url0.find(uname) > 0 or 'UniversityManager' in roles:
     17        return context.temporary_view_all_form(psm=psm)
     18    elif 'Student' in roles:
     19        res = cat(id=uname)
     20        if len(res) > 0:
     21            return res[0].getObject().temporary_view_all_form(psm=psm)
     22        return context.temporary_view_all_form(psm=psm)
  • waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt

    r161 r166  
    11<html metal:use-macro="here/content_lib_master/macros/master">
    2 
    32  <metal:block fill-slot="head_slot">
    43  </metal:block>
     
    1211
    1312  <metal:block fill-slot="main"
    14                tal:define="folder here/getContent;
     13               tal:define="roles member/getRoles;
     14               backend python:'UniversityManager' in roles or 'StudentManager' in roles;
     15               frontend python:'Student' in roles or isAnon;
     16               folder here/getContent;
    1517               items python:context.filterContents(items=context.contentValues());"
    1618               >
     
    2224 
    2325    <br />
    24    
    2526    <span  tal:condition="python:context.portal_type != 'University'"  tal:omit-tag="">
    2627      <p>Exemplary view of the <strong>object's data fields</strong>: </p>
    2728      <tal:block  tal:content="structure rendered_main|python:doc.render(proxy=here)" />
    28      
    29       <p tal:condition="python: 0">(data field listing  not yet implemented)</p>
    3029    </span>
    3130    <br />     
    3231    <p>Exemplary view of the <strong>list of items attached to (or contained in) the object</strong>: </p>
    33  
    34  
    35  
    3632    <tal:block condition="python: len(items)"> 
    37     <table>
    38     <span tal:repeat="item items">
    39     <tr>
    40      <td>
    41       <span tal:content="item/portal_type" />:
    42      </td>
    43      <td>
    44       <i>
    45       <a href="xxx" tal:condition="python: checkPerm('View',item)"
    46                tal:attributes="href item/absolute_url"
    47                tal:content="item/title_or_id"></a>
    48      <span tal:condition="python: not checkPerm('View',item)" tal:content="item/title_or_id"/>
    49      </i>
    50      </td>
    51      </tr>
    52     </span>
    53     </table>
     33      <table>
     34        <span tal:repeat="item items">
     35          <tr>
     36            <td>
     37              <span tal:content="item/portal_type" />:
     38            </td>
     39            <td>
     40              <i>
     41                <a href="xxx" tal:condition="backend"
     42                   tal:attributes="href item/absolute_url"
     43                   tal:content="item/title_or_id"></a>
     44                <span tal:condition="frontend" tal:content="item/title_or_id"/>
     45              </i>
     46            </td>
     47          </tr>
     48        </span>
     49      </table>
    5450    </tal:block>
    5551   
  • waeup_product/trunk/skins/waeup_student/book_accommodation.py

    r164 r166  
    44book an accomodation
    55"""
     6import DateTime
     7current = DateTime.DateTime()
     8
    69type_name = 'Student'
    710ti = context.portal_types[type_name]
     
    1619
    1720res,psm,ds = lt.renderLayout(layout_id= 'accobook',
    18                       schema_id= 'student',
     21                      schema_id= 'student_accommodation',
    1922                      context=context,
    2023                      mapping=validate and REQUEST,
    2124                      ob={},
    2225                      layout_mode='create',
    23                       create_action = 'book_accommodation',
     26                      submit = "book",
     27                      action = 'book_accommodation',
    2428                      )
    2529if psm == 'invalid':
     
    6569    #psm = "Your not admitted"
    6670    psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict
     71
     72    ds.set('sc_date',current)
     73    sf.setScratchCardData('accommodation',ds)
     74
    6775    return context.booked_accommodation(v=dict)
  • waeup_product/trunk/skins/waeup_student/booked_accommodation.pt

    r124 r166  
    88               >
    99    You have successfully booked bed nr <span tal:content="acco/beds_assigned" /> in <span tal:content="acco/heading" />.
     10    <br />Your next steps:
     11    <ul>
     12      <li>Buy a Hostel Scratch card</li>
     13      <li>Login with your user_id and password </li>
     14      <li>Klick on the pay Hostel Fee tab</li>
     15    </ul>
    1016  </metal:block>
    1117  <metal:block fill-slot="sub">
  • waeup_product/trunk/skins/waeup_student/check_admission.py

    r164 r166  
    55return html renderer + psm
    66"""
     7import DateTime
     8current = DateTime.DateTime()
     9
     10
    711type_name = 'Jamb'
    812ti = context.portal_types[type_name]
     
    2226                      ob={},
    2327                      layout_mode='create',
     28                      action = "check_admission",
     29                      submit = "check",
    2430                      )
    2531if psm == 'invalid':
     
    4551                                 ds = ds,
    4652                                 )
     53
     54ds.set('sc_date',current)
    4755student.getContent().setScratchCardData('adm_check',ds)
    4856
  • waeup_product/trunk/skins/waeup_student/clearence.py

    r164 r166  
    55return html renderer + psm
    66"""
     7import DateTime
     8current = DateTime.DateTime()
     9
     10
    711type_name = 'Jamb'
    812ti = context.portal_types[type_name]
     
    2226                      ob={},
    2327                      layout_mode='create',
     28                      action = "clearence",
     29                      submit = "submit",
    2430                      )
     31
    2532if psm == 'invalid':
    2633    return context.clearence_form(rendered = res,
     
    5259    rset = REQUEST.set
    5360    student = getattr(context,s_id)
     61    ds.set('sc_date',current)
    5462    student.getContent().setScratchCardData('clearence',ds)
    5563    sc_pin =  ds.get('sc_pin')
  • waeup_product/trunk/skins/waeup_student/layout_sc_create.pt

    r160 r166  
    1010             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
    1111             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
    12              formaction string:check_admission_form;
     12             formaction options/action;
     13             submittext options/submit;
    1314             first_layout options/first_layout|python:0;
    1415             last_layout options/last_layout|python:0;
     
    1718             "
    1819             >
    19   <form action='check_admission' method='post'
     20  <form action='check_admission' tal:attributes="action formaction" method='post'
    2021        enctype='multipart/form-data' class='workflow'>
    2122    <div class='group'>
     
    7677          </tr>
    7778        </table>
    78         <input type="submit" class="standalone" name="cpsdocument_edit_button" value="check" />
     79        <input type="submit" class="standalone" name="cpsdocument_edit_button"
     80               value="check" tal:attributes="value submittext"/>
    7981      </div>       
    8082    </div>
  • waeup_product/trunk/skins/waeup_student/pay_hostel_fee.py

    r164 r166  
    44book an accomodation
    55"""
     6import DateTime
     7current = DateTime.DateTime()
     8
    69type_name = 'Student'
    710ti = context.portal_types[type_name]
     
    1518pr = context.portal_registration
    1619
    17 res,psm,ds = lt.renderLayout(layout_id= 'accobook',
    18                       schema_id= 'student',
     20res,psm,ds = lt.renderLayout(layout_id= 'accopay',
     21                      schema_id= 'student_hostel_fee',
    1922                      context=context,
    2023                      mapping=validate and REQUEST,
    2124                      ob={},
    2225                      layout_mode='create',
    23                       create_action = 'book_accommodation',
     26                      submit = "pay",
     27                      action = 'pay_hostel_fee',
    2428                      )
    2529if psm == 'invalid':
     
    3539elif psm == 'valid':
    3640    sf = context.getContent()
    37     halls = getattr(context,'accommodation').contentValues()
    38     beds = []
    39     student = context.PERSONAL.getContent()
    40     sf = context.getContent()
    41     for hall in halls:
    42         h = hall.getContent()
    43         ba = int(getattr(h,'beds_assigned',0))
    44         bal = getattr(h,'beds_assigned_list',[])
    45         nr_of_beds = int(h.nr_of_blocks) * int(h.nr_of_floors) * int(h.rooms_per_floor) * int(h.beds_per_room)
    46         if h.which_sex == student.sex and nr_of_beds > len(bal):
    47             break
    48     dict = {'heading': h.heading,
    49             'text': h.text,
    50             'which_sex': h.which_sex,
    51             'nr_of_blocks': h.nr_of_blocks,
    52             'nr_of_floors': h.nr_of_floors,
    53             'rooms_per_floor': h.rooms_per_floor,
    54             'beds_per_room': h.beds_per_room,
    55             'nr_of_free': nr_of_beds,
    56             'beds_assigned': ba,
    57              }
    58     ba += 1
    59     dict['beds_assigned'] = ba
    60     bal.append(('%s:%d' % (pm.getAuthenticatedMember(),ba)))
    61     dict['beds_assigned_list'] = bal
    62     h.edit(mapping = dict)
    63     ds.set('accommodation', "Bed # %(beds_assigned)s in %(heading)s" % dict)
    64     sf.edit(mapping = ds)
    65     #psm = "Your not admitted"
    66     psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict
    67     return context.booked_accommodation(v=dict)
     41
     42    ds.set('sc_date',current)
     43    sf.setScratchCardData('hostel_fee',ds)
     44
     45    return context.payed_hostel_fee(dict=ds)
  • waeup_product/trunk/skins/waeup_student/payed_hostel_fee.pt

    r160 r166  
    55  </metal:block>
    66  <metal:block fill-slot="main"
    7                tal:define="acco options/v"
     7               tal:define="student context/getContent;
     8               dict options/dict"
    89               >
    9     You have successfully booked bed nr <span tal:content="acco/beds_assigned" /> in <span tal:content="acco/heading" />.
     10    You payed <span tal:content="student/accommodation" /><br />
     11    with Scratchcard PIN <span tal:content="dict/sc_pin" /> <br />
     12    on <span  tal:content="dict/sc_date"/>.
     13   
    1014  </metal:block>
    1115  <metal:block fill-slot="sub">
  • waeup_product/trunk/skins/waeup_student/process_waeup_login.py

    r164 r166  
    3838context.notifyCPSDocumentCreation(ob=pd)
    3939
     40pdid = 'DOCUMENTS'
     41ma.invokeFactory('StudentDocuments', pdid)
     42pd = getattr(ma,pdid)
     43context.notifyCPSDocumentCreation(ob=pd)
     44
    4045return response.redirect("%s/eligibility" % ma.absolute_url())
    4146return ma.eligibility(REQUEST=context.REQUEST)
Note: See TracChangeset for help on using the changeset viewer.