Changeset 446 for WAeUP_SRP/trunk
- Timestamp:
- 29 Aug 2006, 17:43:05 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r441 r446 103 103 s = getattr(self,sid) 104 104 s.invokeFactory('StudentAdmission','admission') 105 s.admission.getContent().edit(mapping={'Title': 'Admission Data'})105 da = {'Title': 'Admission Data'} 106 106 s.invokeFactory('StudentPersonal','personal') 107 da['jamb_reg_no'] = student.get('EntryRegNo') 107 108 sp = s.personal 108 109 d = {'Title': 'Personal Data'} … … 111 112 dc = {'Title': 'Clearance Data'} 112 113 dc['matric_no'] = matric_no 113 dc['jamb_reg_no'] = student.get('EntryRegNo')114 114 lga = student.get('State') + ' / ' + student.get('LGA') 115 115 dc['lga'] = lga … … 125 125 d['campus_address'] = student.get('CampusAddress') 126 126 d['phone'] = student.get('PhoneNumber') 127 s.admission.getContent().edit(mapping=da) 127 128 sp.getContent().edit(mapping=d) 128 129 sc.getContent().edit(mapping=dc) … … 298 299 reg_nr = self.getId()[1:] 299 300 data = getattr(self,'personal',None) 300 if data is None:301 data = getattr(self,'jamb',None)302 301 if data: 303 302 content = data.getContent() … … 305 304 return self.title 306 305 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.description316 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 True343 return False344 345 security.declareProtected(View,"accommodationIsBooked")346 def accommodationIsBooked(self):347 """is the accommodation booked"""348 if self.accommodation_sc_pin != '':349 return True350 return False351 352 security.declareProtected(View,"accommodationIsPayed")353 def accommodationIsPayed(self):354 """is the accommodation payed"""355 if self.hostel_fee_sc_pin != '':356 return True357 return False358 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 True365 return False366 306 367 307 InitializeClass(Student) -
WAeUP_SRP/trunk/profiles/default/types/Student.xml
r435 r446 12 12 <property name="filter_content_types">True</property> 13 13 <property name="allowed_content_types"> 14 <element value="Jamb"/>15 14 <element value="StudentDocuments"/> 16 15 <element value="StudentPersonal"/> 17 16 <element value="StudentStudyCourse"/> 18 <element value="StudyLevel"/>19 17 </property> 20 18 <property name="allow_discussion">False</property> … … 36 34 <alias from="(Default)" to="academics_contents"/> 37 35 <alias from="view" to="academics_contents"/> 38 <action title=" StandardView" 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="" 40 38 url_expr="string:${object_url}/academics_contents" visible="True"> 41 39 <permission value="View"/> 42 40 </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>58 41 </object>
Note: See TracChangeset for help on using the changeset viewer.