Changeset 152 for waeup_product/trunk/skins
- Timestamp:
- 4 Nov 2005, 17:07:18 (19 years ago)
- Location:
- waeup_product/trunk/skins
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r151 r152 1021 1021 'rows': [ 1022 1022 [{'widget_id': 'Title', 'ncols': 1},], 1023 #[{'widget_id': 'Year', 'ncols': 1},], 1023 1024 ] 1024 1025 }, -
waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
r144 r152 105 105 }, 106 106 }, 107 } 108 # 109 ###) 110 111 studylevel = { ###( 107 112 } 108 113 # … … 486 491 schemas['students'] = students_folder_schema 487 492 schemas['student'] = student_schema 493 schemas['studylevel'] = studylevel 488 494 schemas['course_results'] = course_results_schema 489 495 schemas['student_personal'] = student_personal_schema -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r139 r152 131 131 'name': 'delegate', 132 132 'action': 'folder_localrole_form', 133 'permissions': (ModifyPortalContent ),134 'visible' : 0,133 'permissions': (ModifyPortalContent,UniversityManage), 134 'visible' : 1, 135 135 }, 136 136 ## {'id': 'contents', … … 319 319 'description': 'The data from JAMB', 320 320 'content_icon': '', 321 'content_meta_type': ' CPS Document',322 'product': ' CPSDocument',323 'factory': 'add CPSDocument',321 'content_meta_type': 'Jamb', 322 'product': 'WAeUP', 323 'factory': 'addJamb', 324 324 'immediate_view': 'cpsdocument_view', 325 325 'global_allow': True, … … 426 426 'content_meta_type': 'Level', 427 427 'product': 'WAeUP', 428 'factory': 'add LevelFolder',428 'factory': 'addStudyLevel', 429 429 'immediate_view': 'folder_view', 430 430 'global_allow': True, … … 477 477 'content_meta_type': 'Semester', 478 478 'product': 'WAeUP', 479 'factory': 'add LevelFolder',479 'factory': 'addSemester', 480 480 'immediate_view': 'folder_view', 481 481 'global_allow': True, … … 505 505 {'id': 'add_course_ticket', 506 506 'name': 'Add Course Ticket', 507 'condition': "python:member and 'Student'in member.getRoles()",508 507 'action' : 'add_course_ticket', 509 508 #'action': 'folder_factories', 510 'permissions': ( StudentManage,)},509 'permissions': (ModifyPortalContent,UniversityManage,StudentManage)}, 511 510 {'id': 'metadata', 512 511 'name': 'action_metadata', 513 512 'action': 'cpsdocument_metadata', 514 'condition': "python:member and 'Manager' in member.getRoles()", 515 'permissions': (UniversityManage,)}, 513 'permissions': (ModifyPortalContent,UniversityManage,)}, 516 514 {'id': 'localroles', 517 515 'name': 'delegate', 518 516 'action': 'folder_localrole_form', 519 'permissions': ( UniversityManage,),517 'permissions': (ModifyPortalContent,UniversityManage,StudentManage), 520 518 'visible': 0, 521 519 }, … … 531 529 'product': 'WAeUP', 532 530 'factory': 'addCourseTicket', 533 'immediate_view': ' folder_view',531 'immediate_view': 'cpsdocument_view', 534 532 'global_allow': True, 535 533 'filter_content_types': True, … … 791 789 {'id': 'add_accommodation', 792 790 'name': 'Add Accommodation Hall', 793 'condition': "python:member and 'UniversityManager'in member.getRoles()",791 #'condition': "python:member and 'UniversityManager'in member.getRoles()", 794 792 'action' : 'add_accommodation', 795 793 #'action': 'folder_factories', -
waeup_product/trunk/skins/waeup_student/create_jamb.py
r112 r152 37 37 elif psm == 'valid': 38 38 s_id = "s%s" % ds.get('reg_nr') 39 name = ds.get('name') 40 skw = {'title': name} 39 skw = {'title': "%(firstname)s %(lastname)s" % ds} 41 40 context.invokeFactory('Student',s_id) 42 41 student = getattr(context,s_id) … … 46 45 student.invokeFactory('Jamb',jamb_id) 47 46 jamb = getattr(student,jamb_id) 48 ds.set('title', name)47 ds.set('title', "%(reg_nr)s (%(lastname)s)" % ds) 49 48 jamb.getContent().edit(mapping=ds) 50 49 context.notifyCPSDocumentCreation(ob=jamb) … … 57 56 if noCPSMember: 58 57 pr.addMember(s_id, 'UnSeT',roles=('Member','Student','Contributor')) 58 student.manage_setLocalRoles(s_id, ['Owner']) 59 jamb.manage_setLocalRoles(s_id, ['Owner']) 60 ## student.getContent().setOwnership(s_id) 61 ## jamb.getContent().setOwnership(s_id) 59 62 ## groups = context.portal_directories.groups 60 63 ## gm = list(groups.getEntry('Students')['members']) … … 63 66 ## 'members': gm}) 64 67 return context.students_folder_view_manager(psm=psm) 65 ## return context.create_jamb_form(rendered = res,66 ## psm = psm,67 ## ds = ds,68 ## )69 70 return res,psm,ds71 68 -
waeup_product/trunk/skins/waeup_student/process_waeup_login.py
r137 r152 25 25 pd = getattr(ma,pdid) 26 26 pkw = {} 27 pkw['sex'] = getattr(jamb,'sex') 28 pkw['firstname'] = getattr(jamb,'firstname') 29 pkw['middlename'] = getattr(jamb,'middlename') 30 pkw['lastname'] = getattr(jamb,'lastname') 31 pkw['aggregate'] = getattr(jamb,'aggregate') 32 pkw['faculty'] = getattr(jamb,'faculty') 33 pkw['age'] = getattr(jamb,'age') 34 pkw['state'] = getattr(jamb,'state') 27 jc = jamb.getContent() 28 pkw['sex'] = getattr(jc,'sex') 29 pkw['firstname'] = getattr(jc,'firstname') 30 pkw['middlename'] = getattr(jc,'middlename') 31 pkw['lastname'] = getattr(jc,'lastname') 32 pkw['aggregate'] = getattr(jc,'aggregate') 33 pkw['faculty'] = getattr(jc,'faculty') 34 pkw['age'] = getattr(jc,'age') 35 pkw['state'] = getattr(jc,'state') 35 36 36 pd. edit(mapping=pkw)37 pd.getContent().edit(mapping=pkw) 37 38 context.notifyCPSDocumentCreation(ob=pd) 38 39 return response.redirect(ma.absolute_url()) -
waeup_product/trunk/skins/waeup_student/register_level.py
r142 r152 28 28 create = 1, 29 29 type_name = type_name, 30 psm = 'Not yet active',31 #psm = 'Please correct your errors',30 #psm = 'Not yet active', 31 psm = 'Please correct your errors', 32 32 ) 33 33 elif psm == '': … … 42 42 psm = (ds) 43 43 oid = ds.get('Title') 44 return context.common_edit_form(rendered = res, 44 if hasattr(context,oid): 45 return context.common_edit_form(rendered = res, 45 46 create = 1, 46 47 type_name = type_name, 47 psm = 'Not yet active', 48 #psm = 'Please correct your errors', 48 psm = 'You already registered for that level', 49 49 ) 50 51 halls = getattr(context,'accommodation').contentValues() 52 beds = [] 53 student = context.PERSONAL.getContent() 54 sf = context.getContent() 55 for hall in halls: 56 h = hall.getContent() 57 ba = int(getattr(h,'beds_assigned',0)) 58 bal = getattr(h,'beds_assigned_list',[]) 59 nr_of_beds = int(h.nr_of_blocks) * int(h.nr_of_floors) * int(h.rooms_per_floor) * int(h.beds_per_room) 60 if h.which_sex == student.sex and nr_of_beds > len(bal): 61 break 62 dict = {'heading': h.heading, 63 'text': h.text, 64 'which_sex': h.which_sex, 65 'nr_of_blocks': h.nr_of_blocks, 66 'nr_of_floors': h.nr_of_floors, 67 'rooms_per_floor': h.rooms_per_floor, 68 'beds_per_room': h.beds_per_room, 69 'nr_of_free': nr_of_beds, 70 'beds_assigned': ba, 71 } 72 ba += 1 73 dict['beds_assigned'] = ba 74 bal.append(('%s:%d' % (pm.getAuthenticatedMember(),ba))) 75 dict['beds_assigned_list'] = bal 76 psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict 77 sf.edit(mapping = ds) 78 h.edit(mapping = dict) 79 #psm = "Your not admitted" 80 return context.booked_accommodation(v=dict) 50 context.invokeFactory(type_name,oid) 51 object = getattr(context,oid) 52 voc = pv.courselevel 53 ds.set('Title',voc.get(oid)) 54 object.getContent().edit(mapping=ds,proxy=object) 55 context.notifyCPSDocumentCreation(ob=object) 56 psm = 'new %s created' % oid 57 semester_id = 'Semester_1_%s_%s' % (oid,context.getId()) 58 object.invokeFactory('Semester',semester_id) 59 semester = getattr(object,semester_id) 60 semester.getContent().edit(mapping={'Title': 'First Semester'}) 61 semester_id = 'Semester_2_%s_%s' % (oid,context.getId()) 62 object.invokeFactory('Semester',semester_id) 63 semester = getattr(object,semester_id) 64 semester.getContent().edit(mapping={'Title': 'Second Semester'}) 65 context_ti = context.portal_types[context.portal_type] 66 index = context_ti.getActionById('view','university_view') 67 return getattr(context,index)(psm=psm)
Note: See TracChangeset for help on using the changeset viewer.