Changeset 173 for waeup_product
- Timestamp:
- 15 Nov 2005, 16:28:29 (19 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 2 added
- 1 deleted
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r170 r173 210 210 'visible' : 1, 211 211 }, 212 ## { 'tool' : 'portal_actions', 212 ## { 'tool' : 'portal_actions', ###( 213 213 ## 'id' : 'add_jamb', 214 214 ## 'name' : 'Add Student JAMB', … … 264 264 ## 'visible' : 1, 265 265 ## }, 266 ###) 267 266 268 ) 269 self.deleteActions({'portal_actions': [action['id'] for action in actions]}) 267 270 self.verifyActions(actions) 268 271 ########################################## … … 403 406 returned.append(portlet_id) 404 407 return returned 405 406 ###) 408 ###) 407 409 408 410 def installCustomWorkflows(self): ###( … … 448 450 se_chains, 449 451 destructive=1) 450 451 ###) 452 ###) 453 454 def verifyFaculties(self, academics): ###( 455 """install Universityspecific Faculies with Departments""" 456 faculties = [ 457 ## {'id': 'agri', ###( 458 ## 'Title': 'Agriculture', 459 ## 'departments': [ 460 ## { 'id': 'dep1', ###( 461 ## 'Title': 'One', 462 ## }, 463 ## ], 464 ## },###) 465 { 'id': 'science', 466 'Title': 'Science', 467 'departments': [ 468 { 'id': 'bio', ###( 469 'Title': 'Biochemistry', 470 }, 471 { 'id': 'bot', 472 'Title': 'Botany', 473 }, 474 { 'id': 'che', 475 'Title': 'Chemistry', 476 }, 477 { 'id': 'com', 478 'Title': 'Computer Science', 479 }, 480 { 'id': 'geo', 481 'Title': 'Geologie', 482 }, 483 { 'id': 'mat', 484 'Title': 'Mathematics', 485 }, 486 { 'id': 'mic', 487 'Title': 'Microbiology', 488 }, 489 { 'id': 'opt', 490 'Title': 'Optometry', 491 }, 492 { 'id': 'phy', 493 'Title': 'Physics', 494 }, 495 { 'id': 'zoo', 496 'Title': 'Zoology', 497 }, 498 ], 499 },###) 500 ]###) 501 self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1)) 502 for faculty in faculties: 503 fid = faculty['id'] 504 f = getattr(academics,fid,None) 505 self.log('Checking Faculty %(id)s = %(Title)s' % faculty) 506 if f is None: 507 self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 508 academics.invokeFactory('Faculty', fid) 509 f = getattr(academics,fid) 510 f.getContent().edit(mapping=faculty) 511 for department in faculty['departments']: 512 self.log('Checking Department %(id)s = %(Title)s' % department) 513 did = department['id'] 514 d = getattr(f,did,None) 515 if d is None: 516 self.log('Creating Department %(id)s = %(Title)s' % department) 517 f.invokeFactory('Department', did) 518 d = getattr(f,did) 519 d.getContent().edit(mapping=department) 520 ###) 521 452 522 453 523 … … 492 562 accommodation = getattr(waeup,'accommodation').getContent() 493 563 accommodation.edit(mapping={'Title':'Accommodation'}) 494 if not hasattr(waeup,'academics'): 564 academics = getattr(waeup,'academics',None) 565 if academics is None: 495 566 waeup.invokeFactory('AcademicsFolder','academics') 496 academics = getattr(waeup,'academics').getContent() 497 academics.edit(mapping={'Title':'Academics'}) 567 academics = getattr(waeup,'academics') 568 academics.getContent().edit(mapping={'Title':'Academics'}) 569 installer.verifyFaculties(academics) 498 570 if not hasattr(waeup,'accommodation'): 499 571 waeup.invokeFactory('AccoFolder','accommodation') -
waeup_product/trunk/Faculty.py
r152 r173 9 9 #from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 10 10 from Products.CPSDocument.CPSDocument import CPSDocument 11 from Products.CPSSchemas.CPSDocument import CPSDocument 11 12 from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 12 13 … … 82 83 security = ClassSecurityInfo() 83 84 85 security.declareProtected(View,"Title") 86 def Title(self): 87 """compose title""" 88 reg_nr = self.getId()[1:] 89 return "Faculty of %s" % (self.title) 90 84 91 InitializeClass(Faculty) 85 92 … … 111 118 portal_type = meta_type 112 119 security = ClassSecurityInfo() 113 120 121 security.declareProtected(View,"Title") 122 def Title(self): 123 """compose title""" 124 reg_nr = self.getId()[1:] 125 return "Department of %s" % (self.title) 126 114 127 InitializeClass(Department) 115 128 -
waeup_product/trunk/Students.py
r170 r173 85 85 } 86 86 87 old_user = self.portal_membership.getAuthenticatedMember() 87 88 if self.portal_membership.isAnonymousUser(): 88 89 tmp_user = CPSUnrestrictedUser('s%(jamb_id)s' % ds, '', … … 92 93 #print str(dict) 93 94 self.edit(mapping=dict) 95 newSecurityManager(None, old_user) 94 96 95 97 security.declareProtected(View,"memberIsOwner") -
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r171 r173 365 365 }, 366 366 } 367 username_hidden = { ###( 368 'type': 'String Widget', 369 'data': { 370 'title': 'Username', 371 'fields': ('username',), 372 'hidden_layout_modes': ['create',], 373 }, 374 } 367 375 368 376 ###) … … 882 890 'javascript_expr': '', 883 891 'deletable': True, 884 'size_max': 40960,892 'size_max': 204800, 885 893 'display_width': 90, 886 894 'display_height': 180, … … 912 920 'javascript_expr': '', 913 921 'deletable': True, 914 'size_max': 40960,922 'size_max': 204800, 915 923 'display_width': 300, 916 924 'display_height':600, … … 939 947 'javascript_expr': '', 940 948 'deletable': True, 941 'size_max': 40960,949 'size_max': 204800, 942 950 'display_width': 300, 943 951 'display_height':600, … … 966 974 'javascript_expr': '', 967 975 'deletable': True, 968 'size_max': 40960,976 'size_max': 204800, 969 977 'display_width': 300, 970 978 'display_height':600, … … 1023 1031 'sex': sex, 1024 1032 'email': email, 1033 'username': username_hidden, 1025 1034 'pw': pw, 1026 1035 'rpw': rpw, … … 1034 1043 #[{'widget_id': 'middlename', 'ncols': 1},], 1035 1044 #[{'widget_id': 'lastname', 'ncols': 1},], 1036 #[{'widget_id': ' sex', 'ncols': 1},],1045 #[{'widget_id': 'username', 'ncols': 1},], 1037 1046 [{'widget_id': 'email', 'ncols': 1},], 1038 [{'widget_id': 'pw', 'ncols': 1},],1039 [{'widget_id': 'rpw', 'ncols': 1},],1047 #[{'widget_id': 'pw', 'ncols': 1},], 1048 #[{'widget_id': 'rpw', 'ncols': 1},], 1040 1049 ] 1041 1050 }, … … 1457 1466 'help': '', 1458 1467 'is_i18n': False, 1459 'vocabulary': ' faculties',1468 'vocabulary': 'get_faculties_voc', 1460 1469 }, 1461 1470 }, 1462 1471 'course': { 1463 'type': 'S tringWidget',1472 'type': 'Select Widget', 1464 1473 'data': { 1465 1474 'title': 'Study Course', … … 1470 1479 'description': '', 1471 1480 'help': 'The course to study', 1481 'vocabulary': 'get_departments_voc', 1472 1482 'is_i18n': False, 1473 1483 }, -
waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
r166 r173 488 488 'data': { 489 489 'is_searchabletext': 1, 490 }, 491 }, 492 'username': { 493 'type': 'CPS String Field', 494 'data': { 495 'is_searchabletext': 0, 490 496 }, 491 497 }, -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r170 r173 73 73 ###) 74 74 75 academics_folder_type = { ###( 76 'title': 'WAeUP Academics Folder', 77 'description': 'The WAeUP Academics Folder', 78 'content_icon': '', 79 'content_meta_type': 'AcademicsFolder', 80 'product': 'CPSDefault', 81 'factory': 'addFolder', 82 'immediate_view': 'folder_view', 83 'global_allow': 1, 84 'filter_content_types': 1, 85 'allowed_content_types': ('Faculty',), 86 'allow_discussion': 0, 87 'cps_is_searchable': 1, 88 'cps_display_as_document_in_listing': 1, 89 'cps_proxy_type': 'folder', 90 'schemas': ['metadata', 'common', 'folder'], 91 'layouts': ['waeup_common','folder'], 92 'layout_clusters': ['metadata:metadata'], 93 'cps_section_wf': 'waeup_section_wf', 94 'actions': ({'id': 'view', 95 'name': 'Standard View', 96 #'action': 'academics_view', 97 'action': 'temporary_view_all', 98 'condition': "", 99 'permissions': (View,)}, 100 {'id': 'add_faculty', 101 'name': 'Add Faculty', 102 'condition': "python:member and 'UniversityManager'in member.getRoles()", 103 'action' : 'string:${object/absolute_url}/create_common?type_name=Faculty', 104 'permissions': (UniversityManage,)}, 105 {'id': 'localroles', 106 'name': 'delegate', 107 'action': 'folder_localrole_form', 108 'permissions': (UniversityManage,), 109 'visible': False, 110 }, 111 ) 112 } 113 ###) 114 115 scratch_card = { ###( 116 'title': 'WAeUP Scratchcard', 117 'description': '', 118 'content_icon': 'student.gif', 119 'content_meta_type': 'Scratch Card', 120 'product': 'CPSDocument', 121 'factory': 'addCPSDocument', 122 'immediate_view': 'cpsdocument_view', 123 'global_allow': True, 124 'filter_content_types': True, 125 'allowed_content_types': (), 126 'allow_discussion': False, 127 'cps_is_searchable': True, 128 'cps_proxy_type': 'document', 129 'cps_display_as_document_in_listing': True, 130 'schemas': ('scratch_card'), 131 'layouts': ('scratch_card'), 132 'cps_workspace_wf': 'waeup_workspace_wf', 133 'cps_section_wf': 'waeup_section_wf', 134 ## 'actions': ( 135 ## {'id': 'view', 136 ## 'name': 'Standard View', 137 ## 'action': 'string:${object_url}/document_view', 138 ## 'condition': '', 139 ## 'permission': ('View',), 140 ## 'category': 'object', 141 ## 'visible': True,}, 142 ## {'id': 'new_content', 143 ## 'name': 'Add a scratch card', 144 ## 'action': 'string:${object_url}/folder_factories', 145 ## 'condition': "python:len(object.contentItems()) == 0 ", 146 ## 'permission': ('Modify portal content',), 147 ## 'category': 'object', 148 ## 'visible': True,}, 149 ## {'id': 'contents', 150 ## 'name': 'action_folder_contents', 151 ## 'action': 'string:${object_url}/folder_contents', 152 ## 'condition': "python:object.getTypeInfo().cps_proxy_type != 'document'", 153 ## 'permission': ('Modify portal content',), 154 ## 'category': 'object', 155 ## 'visible': True,}, 156 ## {'id': 'edit', 157 ## 'name': 'action_edit', 158 ## 'action': 'string:${object_url}/cpsdocument_edit_form', 159 ## 'condition': '', 160 ## 'permission': ('Modify portal content',), 161 ## 'category': 'object', 162 ## 'visible': True,}, 163 ## ) 164 } 165 # 166 ###) 167 75 168 students_folder_type = { ###( 76 169 'title': 'WAeUP Student Folder', … … 116 209 { 117 210 'id' : 'admission_list', 118 'name' : 'Clear ence Elegibility Process',119 'action' : 'string:${object/absolute_url}/clear ence',211 'name' : 'Clearance Eligibility Process', 212 'action' : 'string:${object/absolute_url}/clearance', 120 213 'condition': 'object/portal_membership/isAnonymousUser', 121 214 'permission': (View,)}, … … 152 245 ###) 153 246 154 academics_folder_type = { ###(155 'title': 'WAeUP Academics Folder',156 'description': 'The WAeUP Academics Folder',157 'content_icon': '',158 'content_meta_type': 'AcademicsFolder',159 'product': 'CPSDefault',160 'factory': 'addFolder',161 'immediate_view': 'folder_view',162 'global_allow': 1,163 'filter_content_types': 1,164 'allowed_content_types': ('Faculty',),165 'allow_discussion': 0,166 'cps_is_searchable': 1,167 'cps_display_as_document_in_listing': 1,168 'cps_proxy_type': 'folder',169 'schemas': ['metadata', 'common', 'folder'],170 'layouts': ['waeup_common','folder'],171 'layout_clusters': ['metadata:metadata'],172 'cps_section_wf': 'waeup_section_wf',173 'actions': ({'id': 'view',174 'name': 'Standard View',175 #'action': 'academics_view',176 'action': 'temporary_view_all',177 'condition': "",178 'permissions': (View,)},179 {'id': 'add_faculty',180 'name': 'Add Faculty',181 'condition': "python:member and 'UniversityManager'in member.getRoles()",182 'action' : 'string:${object/absolute_url}/create_common?type_name=Faculty',183 'permissions': (UniversityManage,)},184 {'id': 'localroles',185 'name': 'delegate',186 'action': 'folder_localrole_form',187 'permissions': (UniversityManage,),188 'visible': False,189 },190 )191 }192 ###)193 194 scratch_card = { ###(195 'title': 'WAeUP Scratchcard',196 'description': '',197 'content_icon': 'student.gif',198 'content_meta_type': 'Scratch Card',199 'product': 'CPSDocument',200 'factory': 'addCPSDocument',201 'immediate_view': 'cpsdocument_view',202 'global_allow': True,203 'filter_content_types': True,204 'allowed_content_types': (),205 'allow_discussion': False,206 'cps_is_searchable': True,207 'cps_proxy_type': 'document',208 'cps_display_as_document_in_listing': True,209 'schemas': ('scratch_card'),210 'layouts': ('scratch_card'),211 'cps_workspace_wf': 'waeup_workspace_wf',212 'cps_section_wf': 'waeup_section_wf',213 ## 'actions': (214 ## {'id': 'view',215 ## 'name': 'Standard View',216 ## 'action': 'string:${object_url}/document_view',217 ## 'condition': '',218 ## 'permission': ('View',),219 ## 'category': 'object',220 ## 'visible': True,},221 ## {'id': 'new_content',222 ## 'name': 'Add a scratch card',223 ## 'action': 'string:${object_url}/folder_factories',224 ## 'condition': "python:len(object.contentItems()) == 0 ",225 ## 'permission': ('Modify portal content',),226 ## 'category': 'object',227 ## 'visible': True,},228 ## {'id': 'contents',229 ## 'name': 'action_folder_contents',230 ## 'action': 'string:${object_url}/folder_contents',231 ## 'condition': "python:object.getTypeInfo().cps_proxy_type != 'document'",232 ## 'permission': ('Modify portal content',),233 ## 'category': 'object',234 ## 'visible': True,},235 ## {'id': 'edit',236 ## 'name': 'action_edit',237 ## 'action': 'string:${object_url}/cpsdocument_edit_form',238 ## 'condition': '',239 ## 'permission': ('Modify portal content',),240 ## 'category': 'object',241 ## 'visible': True,},242 ## )243 }244 #245 ###)246 247 247 student_type = { ###( 248 248 'title': 'WAeUP Student', … … 271 271 #'action': 'string:${object_url}/student_index_html', 272 272 'action': 'string:${object_url}/temporary_view_all', 273 'condition': "python:object.getContent().memberIsOwner() or 'UniversityManager'in member.getRoles()",273 'condition': "python:object.getContent().memberIsOwner() or (member and 'UniversityManager'in member.getRoles())", 274 274 'permission': (View,), 275 275 'category': 'object', -
waeup_product/trunk/skins/waeup_default/getWAeUPVocabularies.py
r164 r173 76 76 vocabularies['faculties'] = faculties 77 77 ###) 78 get_faculties_voc = { ###( 79 'type': 'CPS Method Vocabulary', 80 'data': {'get_vocabulary_method': 'get_faculties_voc',} 81 } 82 vocabularies['get_faculties_voc'] = get_faculties_voc 83 ###) 84 get_departments_voc = { ###( 85 'type': 'CPS Method Vocabulary', 86 'data': {'get_vocabulary_method': 'get_departments_voc',} 87 } 88 vocabularies['get_departments_voc'] = get_departments_voc 89 ###) 78 90 79 91 level = { ###( -
waeup_product/trunk/skins/waeup_student/check_admission.py
r166 r173 60 60 schema_id = 'jamb') 61 61 62 return jamb.admission_slip_form(rendered = res, dict = ds)62 return context.admission_slip_form(rendered = res, dict = ds) 63 63 -
waeup_product/trunk/skins/waeup_student/clearance.py
r172 r173 26 26 ob={}, 27 27 layout_mode='create', 28 action = "clear ence",28 action = "clearance", 29 29 submit = "submit", 30 30 ) 31 31 32 32 if psm == 'invalid': 33 return context.clear ence_form(rendered = res,33 return context.clearance_form(rendered = res, 34 34 psm = "Please correct your input", 35 35 ds = ds, 36 36 ) 37 37 elif psm == '': 38 return context.clear ence_form(rendered = res,38 return context.clearance_form(rendered = res, 39 39 psm = None, 40 40 ds = ds, … … 46 46 if len(search) < 1: 47 47 psm = "Your not admitted" 48 return context.clear ence_form(rendered = res,48 return context.clearance_form(rendered = res, 49 49 psm = psm, 50 50 ds = ds, … … 53 53 if sf and getattr(sf,'PERSONAL',None): 54 54 psm = "Your already admitted, please login" 55 return context.clear ence_form(rendered = res,55 return context.clearance_form(rendered = res, 56 56 psm = psm, 57 57 ds = ds, … … 60 60 student = getattr(context,s_id) 61 61 ds.set('sc_date',current) 62 student.getContent().setScratchCardData('clear ence',ds)62 student.getContent().setScratchCardData('clearance',ds) 63 63 sc_pin = ds.get('sc_pin') 64 return REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=UnSeT&sc_pin=%s" 64 #return REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=UnSeT&sc_pin=%s" 65 return REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=123456&sc_pin=%s" 65 66 % (context.absolute_url(),s_id,sc_pin)) -
waeup_product/trunk/skins/waeup_student/clearance_form.pt
r172 r173 14 14 </metal:block> 15 15 <metal:block fill-slot="main"> 16 <h1>Clear ence and Eligibility Processing </h1>16 <h1>Clearance and Eligibility Processing </h1> 17 17 <div tal:replace="structure rendered_main" /> 18 18 Instructions :<br /> -
waeup_product/trunk/skins/waeup_student/create_jamb.py
r152 r173 51 51 noCPSMember = False 52 52 try: 53 pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember','Student','Contributor')) 53 #pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember','Student','Contributor')) 54 pr.addMember(s_id, '123456',roles=('Member','CPSMember','Student','Contributor')) 54 55 except: 55 56 noCPSMember = True 56 57 if noCPSMember: 57 pr.addMember(s_id, 'UnSeT',roles=('Member','Student','Contributor')) 58 #pr.addMember(s_id, 'UnSeT',roles=('Member','Student','Contributor')) 59 pr.addMember(s_id, '123456',roles=('Member','Student','Contributor')) 58 60 student.manage_setLocalRoles(s_id, ['Owner']) 59 61 jamb.manage_setLocalRoles(s_id, ['Owner']) -
waeup_product/trunk/skins/waeup_student/eligibility.py
r164 r173 44 44 s_personal = context.PERSONAL.getContent() 45 45 s_personal.edit(mapping={'email': ds.get('email')}) 46 pm.setPassword(REQUEST.get("widget__pw")) 47 46 #pw = REQUEST.get("widget__pw") 47 #pm.setPassword(pw) 48 psm = 'Email hay been successfully set.' 49 #psm += 'please <a href="login_form">Login</a> with username %s and password %s' % (context.getId(),pw) 48 50 return context.eligibility_form(rendered = res, 49 psm = 'Password and Email have been successfully set',51 psm = psm, 50 52 ds = ds, 51 53 )
Note: See TracChangeset for help on using the changeset viewer.