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

=more enhancements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.