Changeset 446 for WAeUP_SRP/trunk


Ignore:
Timestamp:
29 Aug 2006, 17:43:05 (18 years ago)
Author:
joachim
Message:

removed old actions from Student.xml

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r441 r446  
    103103                s = getattr(self,sid)
    104104                s.invokeFactory('StudentAdmission','admission')
    105                 s.admission.getContent().edit(mapping={'Title': 'Admission Data'})
     105                da = {'Title': 'Admission Data'}
    106106                s.invokeFactory('StudentPersonal','personal')
     107                da['jamb_reg_no'] = student.get('EntryRegNo')
    107108                sp = s.personal
    108109                d = {'Title': 'Personal Data'}
     
    111112                dc = {'Title': 'Clearance Data'}
    112113                dc['matric_no'] = matric_no
    113                 dc['jamb_reg_no'] = student.get('EntryRegNo')
    114114                lga = student.get('State') + ' / ' + student.get('LGA')               
    115115                dc['lga'] = lga
     
    125125                d['campus_address'] = student.get('CampusAddress')
    126126                d['phone'] = student.get('PhoneNumber')
     127                s.admission.getContent().edit(mapping=da)
    127128                sp.getContent().edit(mapping=d)
    128129                sc.getContent().edit(mapping=dc)
     
    298299        reg_nr = self.getId()[1:]
    299300        data = getattr(self,'personal',None)
    300         if data is None:
    301             data = getattr(self,'jamb',None)
    302301        if data:
    303302            content = data.getContent()
     
    305304        return self.title
    306305
    307     def Description(self):
    308         """compose description"""
    309         data = getattr(self,'PERSONAL',None)
    310         if data is None:
    311             return "none"
    312         if data:
    313             content = data.getContent()
    314             return "%s" % (content.description)
    315         return self.description
    316 
    317     security.declareProtected(View,"setScratchCardData")
    318     def setScratchCardData(self,ident,ds):
    319         """set this data """
    320         dict = {'%s_sc_pin' % ident : ds.get('sc_pin'),
    321                 '%s_sc_id' % ident : ds.get('sc_id'),
    322                 '%s_sc_value' % ident : ds.get('sc_value'),
    323                 '%s_date' % ident : ds.get('sc_date'),
    324                 }
    325 
    326         old_user = self.portal_membership.getAuthenticatedMember()
    327         if self.portal_membership.isAnonymousUser():
    328             tmp_user = CPSUnrestrictedUser('s%(jamb_id)s' % ds, '',
    329                                        ['StudentManager'], '')
    330             tmp_user = tmp_user.__of__(self.acl_users)
    331             newSecurityManager(None, tmp_user)
    332         #print str(dict)
    333         self.edit(mapping=dict)
    334         newSecurityManager(None, old_user)
    335 
    336     security.declareProtected(View,"memberIsOwner")
    337     def memberIsOwner(self):
    338         """is the current user the owner"""
    339         member = self.portal_membership.getAuthenticatedMember()
    340         #print member, self.getId(),self.aq_parent.getId()
    341         if self.aq_parent.getId() == str(member):
    342             return True
    343         return False
    344 
    345     security.declareProtected(View,"accommodationIsBooked")
    346     def accommodationIsBooked(self):
    347         """is the accommodation booked"""
    348         if self.accommodation_sc_pin != '':
    349             return True
    350         return False
    351 
    352     security.declareProtected(View,"accommodationIsPayed")
    353     def accommodationIsPayed(self):
    354         """is the accommodation payed"""
    355         if self.hostel_fee_sc_pin != '':
    356             return True
    357         return False
    358 
    359     security.declareProtected(View,"isRegisteredForCurrentLevel")
    360     def isRegisteredForCurrentLevel(self):
    361         """is the student registered for the current level"""
    362         for l in  self.aq_parent.objectValues():
    363             if l.portal_type == 'StudyLevel':
    364                 return True
    365         return False
    366306
    367307InitializeClass(Student)
  • WAeUP_SRP/trunk/profiles/default/types/Student.xml

    r435 r446  
    1212 <property name="filter_content_types">True</property>
    1313 <property name="allowed_content_types">
    14   <element value="Jamb"/>
    1514  <element value="StudentDocuments"/>
    1615  <element value="StudentPersonal"/>
    1716  <element value="StudentStudyCourse"/>
    18   <element value="StudyLevel"/>
    1917 </property>
    2018 <property name="allow_discussion">False</property>
     
    3634 <alias from="(Default)" to="academics_contents"/>
    3735 <alias from="view" to="academics_contents"/>
    38  <action title="Standard View" action_id="view" category="object"
    39     condition_expr="python:object.getContent().memberIsOwner() or (member and 'SectionManager'in member.getRoles())"
     36 <action title="View" action_id="view" category="object"
     37    condition_expr=""
    4038    url_expr="string:${object_url}/academics_contents" visible="True">
    4139  <permission value="View"/>
    4240 </action>
    43  <action title="action_metadata" action_id="metadata" category="object"
    44     condition_expr="python:member and 'Manager' in member.getRoles()"
    45     url_expr="string:${object_url}/cpsdocument_metadata" visible="False">
    46   <permission value="University Manage"/>
    47  </action>
    48  <action title="Delegate" action_id="localroles" category="object"
    49     condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    50     visible="False">
    51   <permission value="Modify portal content"/>
    52  </action>
    53  <action title="Personal Data" action_id="PERSONAL" category="object"
    54     condition_expr="python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)"
    55     url_expr="string:${object/absolute_url}/PERSONAL" visible="True">
    56   <permission value="Modify portal content"/>
    57  </action>
    5841</object>
Note: See TracChangeset for help on using the changeset viewer.