Changeset 139 for waeup_product/trunk
- Timestamp:
- 2 Nov 2005, 14:40:07 (19 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r124 r139 1 1 #-*- mode: python; mode: fold -*- 2 2 # $Id$ 3 from Products.ExternalMethod.ExternalMethod import ExternalMethod 3 4 from Products.CPSInstaller.CPSInstaller import CPSInstaller 4 from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent 5 from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent,AccessContentsInformation 5 6 from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\ 6 7 DepartmentManage,CourseManage … … 18 19 from Products.WAeUP.Students import addStudentsFolder 19 20 21 SRPP_ID = "demouni" 22 SRPP_TITLE = "Demo University" 23 20 24 class WAeUPInstaller(CPSInstaller): 21 25 """ … … 26 30 def install(self,portal): 27 31 "install" 32 log = [] 33 prlog = log.append 34 35 def pr(msg, prlog=prlog): 36 prlog('%s<br>' % msg) 28 37 29 38 product_name = self.product_name 30 self.log("Starting %(product_name)s install" % vars() )39 pr("Starting %(product_name)s install" % vars() ) 31 40 32 41 # Roles and Permissions ###( … … 64 73 } 65 74 self.setupPortalPermissions(waeup_perms) 66 67 ###) 75 ###) 76 77 # external methods ###( 78 # 79 ext_methods = ( { 'id': 'waeup_migrate', 80 'title': 'WAeUP (migrate from an earlier version)', 81 'script': 'WAeUP.install', 82 'method': 'migrate', 83 'protected': 1, 84 }, 85 ) 86 portal_objectIds = portal.objectIds() 87 for meth in ext_methods: 88 method = meth['id'] 89 if method in portal_objectIds: 90 portal._delObject(method) 91 pr('Creating %s External Method' % method) 92 ext_method = ExternalMethod(method, 93 meth['title'], 94 meth['script'], 95 meth['method']) 96 portal._setObject(method, ext_method) 97 if method in portal_objectIds: 98 manage_perms = portal[method].manage_permission 99 if meth['protected']: 100 pr("Protecting %s" % method) 101 manage_perms(View, roles=['Manager'], acquire=0) 102 manage_perms(AccessContentsInformation, roles=['Manager'], acquire=0) 103 else: 104 manage_perms(View, roles=['Manager'], acquire=1) 105 ###) 68 106 69 107 ########################################## … … 142 180 # main_tab actions ###( 143 181 ########################################## 182 path = "/sections/%(SRPP_ID)s" % globals() 144 183 actions = ( { 'tool' : 'portal_actions', 145 184 'id' : 'student_administration', 146 185 'name' : 'Students', 147 'action' : 'string:$folder_url/students', 186 #'action' : 'string:$folder_url/students', 187 'action' : 'string:$portal_url%(path)s/students' % vars(), 148 188 'permission': (View, ), 149 189 'category' : 'main_tabs', … … 153 193 'id' : 'Academics', 154 194 'name' : 'Academics', 155 #'action' : 'string:${portal_url}/sections/waeup/academics/academics_view', 156 'action' : 'string:$folder_url/academics', 195 'action' : 'string:$portal_url%(path)s/academics' % vars(), 196 #'action' : 'string:${portal_url}/sections/unidemo', 197 #'action' : 'string:$folder_url/academics', 157 198 'permission': (View ), 158 199 'category' : 'main_tabs', … … 162 203 'id' : 'accomodation', 163 204 'name' : 'Accommodation', 205 'action' : 'string:$portal_url%(path)s/accommodation' % vars(), 164 206 #'action' : 'string:${portal_url}/sections/waeup/accommodation/accommodation_index_html', 165 'action' : 'string:$folder_url/accommodation',166 207 'permissions': (View), 167 208 #'permissions': (ModifyPortalContent,UniversityManage,StudentManage), … … 230 271 # skins 231 272 ########################################## 232 self.log("Verifying %(product_name)s skinss" % vars())273 pr("Verifying %(product_name)s skinss" % vars()) 233 274 wskins = { 'waeup_default' : 'Products/WAeUP/skins/waeup_default', 234 275 'waeup_faculty' : 'Products/WAeUP/skins/waeup_faculty', … … 238 279 self.resetSkinCache() 239 280 281 # Themes ###( 282 # 283 # Importing portal themes 284 ## theme_container = getattr(portal, 'portal_themes') 285 ## # the first theme in each category is the default theme. 286 ## themes_list = {'WAeUP': ({'id': 'waeup_plain_theme', 287 ## 'file': 'waeup_plain_theme.zexp', 288 ## }, 289 ## {'id': 'waeup_management_theme', 290 ## 'file': 'waeup_management_theme.zexp', 291 ## }, 292 ## ), 293 ## } 294 ## 295 ## 296 ## theme_ids = theme_container.objectIds() 297 ## theme_container.manage_delObjects(theme_ids) 298 ## target_themes = themes_list[Target] 299 ## for theme in target_themes: 300 ## pr(" Importing %s theme" % theme['id']) 301 ## zexppath = os.path.join(zexpdir, theme['file']) 302 ## try: 303 ## theme_container._importObjectFromFile(zexppath) 304 ## except: 305 ## pr(" Could not import theme %s" % theme['id']) 306 ## 307 ## # set the first theme in the list as the default one. 308 ## theme_container.setDefaultTheme(target_themes[0]['id']) 309 ###) 310 311 240 312 ########################################## 241 313 # portal types … … 247 319 # Schemas 248 320 ########################################## 249 self.log("Verifying %(product_name)s schemas" % vars())321 pr("Verifying %(product_name)s schemas" % vars()) 250 322 self.verifySchemas(portal.getWAeUPSchemas()) 251 323 ########################################## 252 324 # widgets 253 325 ########################################## 254 self.log("Verifying %(product_name)s widgets" % vars())326 pr("Verifying %(product_name)s widgets" % vars()) 255 327 self.verifyWidgets(portal.getWAeUPWidgets()) 256 328 ########################################## 257 329 # layouts 258 330 ########################################## 259 self.log("Verifying %(product_name)s layouts" % vars())331 pr("Verifying %(product_name)s layouts" % vars()) 260 332 self.verifyLayouts(portal.getWAeUPLayouts()) 261 333 ########################################## 262 334 # Vocabularies 263 335 ########################################## 264 self.log("Verifying %(product_name)s vocabularies" % vars())336 pr("Verifying %(product_name)s vocabularies" % vars()) 265 337 self.verifyVocabularies(portal.getWAeUPVocabularies()) 266 338 ########################################## … … 271 343 self.verifyWorkflowAssociation() 272 344 273 self.log("End of specific %(product_name)s install" % vars()) 345 pr("End of specific %(product_name)s install" % vars()) 346 #return '\n'.join(log) 274 347 self.finalize() 275 348 … … 329 402 #groups.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',)) 330 403 sections = getattr(self,'sections') 331 waeup = getattr(sections, 'waeup',None)404 waeup = getattr(sections,SRPP_ID,None) 332 405 if not waeup: 333 sections.content_create(type_name='University',title='waeup') 334 sections.waeup.folder_localrole_add(member_ids=('group:Students',), 406 sections.invokeFactory('University',SRPP_ID) 407 waeup = getattr(sections,SRPP_ID) 408 waeup.getContent().edit(mapping={'Title':SRPP_TITLE}) 409 waeup.folder_localrole_add(member_ids=('group:Students',), 335 410 member_role='SectionReviewer', 336 411 ) 337 sections.waeup.content_create(type_name='StudentsFolder',title='students') 338 sections.waeup.folder_localrole_add(member_ids=('group:Students',), 412 waeup.invokeFactory('StudentsFolder','students') 413 students = getattr(waeup,'students').getContent() 414 students.edit(mapping={'Title':'Students'}) 415 waeup.folder_localrole_add(member_ids=('group:Students',), 339 416 member_role='SectionReviewer', 340 417 ) 341 sections.waeup.content_create(type_name='AcademicsFolder',title='academics')418 ## waeup.content_create(type_name='AcademicsFolder',title='academics') 342 419 ## sections.waeup.folder_localrole_add(member_ids=('group:StudentManager',), 343 420 ## member_role='SectionManager', 344 421 ## ) 345 sections.waeup.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',)) 346 elif not hasattr(waeup,'academics'): 347 waeup.content_create(type_name='AcademicsFolder',title='academics') 348 sections.waeup.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',)) 422 waeup.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',)) 423 waeup.invokeFactory('AcademicsFolder','academics', title='Academics') 424 academics = getattr(waeup,'academics').getContent() 425 academics.edit(mapping={'Title':'Academics'}) 426 waeup.invokeFactory('AccoFolder','accommodation', title='Accommodation') 427 accommodation = getattr(waeup,'accommodation').getContent() 428 accommodation.edit(mapping={'Title':'Accommodation'}) 429 if not hasattr(waeup,'academics'): 430 waeup.invokeFactory('AcademicsFolder','academics') 431 academics = getattr(waeup,'academics').getContent() 432 academics.edit(mapping={'Title':'Academics'}) 433 if not hasattr(waeup,'accommodation'): 434 waeup.invokeFactory('AccoFolder','accommodation') 435 accommodation = getattr(waeup,'accommodation').getContent() 436 accommodation.edit(mapping={'Title':'Accommodation'}) 437 waeup.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',)) 349 438 # portlets ###( 350 439 # … … 395 484 396 485 return installer.logResult() 486 487 def migrate(self): 488 "update data" 489 log = [] 490 prlog = log.append 491 492 def pr(msg, prlog=prlog): 493 prlog('%s<br>' % msg) 494 495 sections = getattr(self,'sections') 496 waeup = getattr(sections,'waeup',None) 497 pr( "Start migrate") 498 pr("migrating courses") 499 for fac in [getattr(waeup,f.id) for f in waeup.contentValues(filter={'portal_type': ('Faculty',)})]: 500 pr("Faculty: %s" % fac.title_or_id()) 501 for dep in [getattr(fac,d.id) for d in fac.contentValues(filter={'portal_type': ('Department',)})]: 502 pr("Department: %s" % dep.title_or_id()) 503 for course in [getattr(dep,c.id) for c in dep.contentValues(filter={'portal_type': ('Course',)})]: 504 pr("Course: %s" % course.title_or_id()) 505 content = course.getContent() 506 heading = getattr(content,'heading',course.id) 507 pr("heading = %(heading)s" % vars()) 508 content.edit(mapping={'Title': heading}) 509 pr("migrating halls") 510 for ac in [getattr(waeup,a.id) for a in waeup.contentValues(filter={'portal_type': ('AccoFolder',)})]: 511 for hall in [getattr(ac,h.id) for h in ac.contentValues(filter={'portal_type': ('Accommodation',)})]: 512 pr("Hall: %s" % hall.title_or_id()) 513 content = hall.getContent() 514 heading = getattr(content,'heading',hall.id) 515 pr("heading = %(heading)s" % vars()) 516 content.edit(mapping={'Title': heading}) 517 return '\n'.join(log) 518 -
waeup_product/trunk/Faculty.py
r89 r139 101 101 'allowed_content_types': ('Course',), 102 102 'allow_discussion': False, 103 ## 'actions': (104 ## {'id': 'view',105 ## 'name': 'action_view',106 ## 'action': 'string:${object_url}/department_index_html',107 ## 'condition': '',108 ## 'permission': ('View',),109 ## 'category': 'object',110 ## 'visible': True,},111 ## {'id': 'new_content',112 ## 'name': 'Add Data',113 ## 'action': 'string:${object_url}/folder_factories',114 ## 'condition': "python:1 or len(object.contentItems()) == 0 ",115 ## 'permission': ('Modify portal content',),116 ## 'category': 'object',117 ## 'visible': True,},118 ## {'id': 'contents',119 ## 'name': 'action_folder_contents',120 ## 'action': 'string:${object_url}/folder_contents',121 ## 'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",122 ## 'permission': ('Modify portal content',),123 ## 'category': 'object',124 ## 'visible': True,},125 ## {'id': 'edit',126 ## 'name': 'action_edit',127 ## 'action': 'string:${object_url}/cpsdocument_edit_form',128 ## 'condition': '',129 ## 'permission': ('Modify portal content',),130 ## 'category': 'object',131 ## 'visible': True,},132 ## )133 103 } 134 104 ###) … … 161 131 'allowed_content_types': (), 162 132 'allow_discussion': False, 163 ## 'actions': (164 ## {'id': 'view',165 ## 'name': 'action_view',166 ## 'action': 'string:${object_url}/course_index_html',167 ## 'condition': '',168 ## 'permission': ('View',),169 ## 'category': 'object',170 ## 'visible': True,},171 ## {'id': 'new_content',172 ## 'name': 'Add Data',173 ## 'action': 'string:${object_url}/folder_factories',174 ## 'condition': "python:1 or len(object.contentItems()) == 0 ",175 ## 'permission': ('Modify portal content',),176 ## 'category': 'object',177 ## 'visible': True,},178 ## {'id': 'contents',179 ## 'name': 'action_folder_contents',180 ## 'action': 'string:${object_url}/folder_contents',181 ## 'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",182 ## 'permission': ('Modify portal content',),183 ## 'category': 'object',184 ## 'visible': True,},185 ## {'id': 'edit',186 ## 'name': 'action_edit',187 ## 'action': 'string:${object_url}/cpsdocument_edit_form',188 ## 'condition': '',189 ## 'permission': ('Modify portal content',),190 ## 'category': 'object',191 ## 'visible': True,},192 ## )193 133 } 194 134 ###) … … 209 149 return CPSBase_adder(container, ob, REQUEST=REQUEST) 210 150 ###) 151 152 course_ticket_fti = { ###( 153 'title': 'WAeUP CourseTicket', 154 'description': '', 155 'content_icon': '', 156 'content_meta_type': 'CourseTicket', 157 'factory': 'addCourseTicket', 158 'immediate_view': 'cpsdocument_view', 159 'global_allow': True, 160 'filter_content_types': True, 161 'allowed_content_types': (), 162 'allow_discussion': False, 163 } 164 ###) 165 166 class CourseTicket(CPSDocument): ###( 167 """ 168 WAeUP CourseTicket 169 """ 170 meta_type = 'CourseTicket' 171 portal_type = meta_type 172 security = ClassSecurityInfo() 173 174 InitializeClass(CourseTicket) 175 176 def addCourseTicket(container, id, REQUEST=None, **kw): 177 """Add a CourseTicket.""" 178 ob = CourseTicket(id, **kw) 179 return CPSBase_adder(container, ob, REQUEST=REQUEST) 180 ###) -
waeup_product/trunk/Students.py
r91 r139 39 39 'allowed_content_types': ('Jamb','StudentPersonal'), 40 40 'allow_discussion': False, 41 ## 'actions': (42 ## {'id': 'view',43 ## 'name': 'action_view',44 ## 'action': 'string:${object_url}/student_index_html',45 ## #'action': 'string:${object_url}/cpsdocument_view',46 ## 'condition': '',47 ## 'permission': ('View',),48 ## 'category': 'object',49 ## 'visible': True,},50 ## {'id': 'new_content',51 ## 'name': 'Add Data',52 ## 'action': 'string:${object_url}/folder_factories',53 ## 'condition': "python:1 or len(object.contentItems()) == 0 ",54 ## 'permission': ('Modify portal content',),55 ## 'category': 'object',56 ## 'visible': True,},57 ## {'id': 'contents',58 ## 'name': 'action_folder_contents',59 ## 'action': 'string:${object_url}/folder_contents',60 ## 'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",61 ## 'permission': ('Modify portal content',),62 ## 'category': 'object',63 ## 'visible': True,},64 ## {'id': 'edit',65 ## 'name': 'action_edit',66 ## 'action': 'string:${object_url}/cpsdocument_edit_form',67 ## 'condition': '',68 ## 'permission': ('Modify portal content',),69 ## 'category': 'object',70 ## 'visible': True,},71 ## )72 41 } 73 42 … … 82 51 security = ClassSecurityInfo() 83 52 53 security.declareProtected(View,"getTitle") 54 def getTitle(self): 55 """compose title""" 56 content = self.PERSONAL.getContent() 57 return "%s %s" % (content.firstname,content.lastname) 58 84 59 InitializeClass(Student) 85 60 … … 102 77 'allowed_content_types': (), 103 78 'allow_discussion': False, 104 ## 'actions': (105 ## {'id': 'view',106 ## 'name': 'action_view',107 ## 'action': 'string:${object_url}/student_index_html',108 ## #'action': 'string:${object_url}/cpsdocument_view',109 ## 'condition': '',110 ## 'permission': ('View',),111 ## 'category': 'object',112 ## 'visible': True,},113 ## {'id': 'new_content',114 ## 'name': 'Add Data',115 ## 'action': 'string:${object_url}/folder_factories',116 ## 'condition': "python:1 or len(object.contentItems()) == 0 ",117 ## 'permission': ('Modify portal content',),118 ## 'category': 'object',119 ## 'visible': True,},120 ## {'id': 'contents',121 ## 'name': 'action_folder_contents',122 ## 'action': 'string:${object_url}/folder_contents',123 ## 'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",124 ## 'permission': ('Modify portal content',),125 ## 'category': 'object',126 ## 'visible': True,},127 ## {'id': 'edit',128 ## 'name': 'action_edit',129 ## 'action': 'string:${object_url}/cpsdocument_edit_form',130 ## 'condition': '',131 ## 'permission': ('Modify portal content',),132 ## 'category': 'object',133 ## 'visible': True,},134 ## )135 79 } 136 80 … … 165 109 'allowed_content_types': ('Course',), 166 110 'allow_discussion': False, 167 ## 'actions': (168 ## {'id': 'view',169 ## 'name': 'action_view',170 ## 'action': 'string:${object_url}/jamb_index_html',171 ## 'condition': '',172 ## 'permission': ('View',),173 ## 'category': 'object',174 ## 'visible': True,},175 ## {'id': 'new_content',176 ## 'name': 'Add Data',177 ## 'action': 'string:${object_url}/folder_factories',178 ## 'condition': "python:1 or len(object.contentItems()) == 0 ",179 ## 'permission': ('Modify portal content',),180 ## 'category': 'object',181 ## 'visible': True,},182 ## {'id': 'contents',183 ## 'name': 'action_folder_contents',184 ## 'action': 'string:${object_url}/folder_contents',185 ## 'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",186 ## 'permission': ('Modify portal content',),187 ## 'category': 'object',188 ## 'visible': True,},189 ## {'id': 'edit',190 ## 'name': 'action_edit',191 ## 'action': 'string:${object_url}/cpsdocument_edit_form',192 ## 'condition': '',193 ## 'permission': ('Modify portal content',),194 ## 'category': 'object',195 ## 'visible': True,},196 ## )197 111 } 198 112 ###) … … 214 128 ###) 215 129 130 study_level_fti = { ###( 131 'title': 'WAeUP StudyLevel', 132 'description': '', 133 'content_icon': '', 134 'content_meta_type': 'StudyLevel', 135 'factory': 'addStudyLevel', 136 'immediate_view': 'cpsdocument_view', 137 'global_allow': True, 138 'filter_content_types': True, 139 'allowed_content_types': ('Course',), 140 'allow_discussion': False, 141 } 142 ###) 143 144 class StudyLevel(CPSDocument): ###( 145 """ 146 WAeUP StudyLevel containing the courses and students 147 """ 148 meta_type = 'StudyLevel' 149 portal_type = meta_type 150 security = ClassSecurityInfo() 151 152 InitializeClass(StudyLevel) 153 154 def addStudyLevel(container, id, REQUEST=None, **kw): 155 """Add a StudyLevel.""" 156 ob = StudyLevel(id, **kw) 157 return CPSBase_adder(container, ob, REQUEST=REQUEST) 158 ###) 159 160 semester_fti = { ###( 161 'title': 'WAeUP Semester', 162 'description': '', 163 'content_icon': '', 164 'content_meta_type': 'Semester', 165 'factory': 'addSemester', 166 'immediate_view': 'cpsdocument_view', 167 'global_allow': True, 168 'filter_content_types': True, 169 'allowed_content_types': ('Course',), 170 'allow_discussion': False, 171 } 172 ###) 173 174 class Semester(CPSDocument): ###( 175 """ 176 WAeUP Semester containing the courses and students 177 """ 178 meta_type = 'Semester' 179 portal_type = meta_type 180 security = ClassSecurityInfo() 181 182 InitializeClass(Semester) 183 184 def addSemester(container, id, REQUEST=None, **kw): 185 """Add a Semester.""" 186 ob = Semester(id, **kw) 187 return CPSBase_adder(container, ob, REQUEST=REQUEST) 188 ###) 189 -
waeup_product/trunk/University.py
r87 r139 14 14 # 15 15 16 class University( BaseBTreeFolder):16 class University(CPSDocument): 17 17 """ 18 18 Container for the various WAeUP containers … … 22 22 security = ClassSecurityInfo() 23 23 24 security.declarePublic('waeup_url') 25 def waeup_url(self): 26 """ return the base_url""" 27 return "%s/sections/waeup" % self.portal_url 28 return self.REQUEST 29 24 30 InitializeClass(University) 25 31 -
waeup_product/trunk/__init__.py
r103 r139 15 15 Students.studentpersonal_fti, 16 16 Students.jamb_fti, 17 Students.study_level_fti, 18 Students.semester_fti, 17 19 Accommodation.accofolder_fti, 18 20 Accommodation.accommodation_fti, … … 20 22 Faculty.department_fti, 21 23 Faculty.course_fti, 24 Faculty.course_ticket_fti, 22 25 ) 23 26 … … 27 30 Students.StudentPersonal, 28 31 Students.Jamb, 32 Students.StudyLevel, 33 Students.Semester, 29 34 Accommodation.AccoFolder, 30 35 Accommodation.Accommodation, … … 32 37 Faculty.Department, 33 38 Faculty.Course, 39 Faculty.CourseTicket, 34 40 ) 35 41 … … 38 44 Students.addStudent, 39 45 Students.addStudentPersonal, 46 Students.addJamb, 47 Students.addStudyLevel, 48 Students.addSemester, 40 49 Accommodation.addAccommodation, 41 50 Accommodation.addAccoFolder, 42 Students.addJamb,43 51 Faculty.addFaculty, 44 52 Faculty.addDepartment, 45 53 Faculty.addCourse, 54 Faculty.addCourseTicket, 46 55 ) 47 56 -
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r137 r139 178 178 ## }, 179 179 ## }, 180 ## 'jamb_pin_usage': {181 ## 'type': 'Int Widget',182 ## 'data': {183 ## 'title': 'Jamb Pin usage',184 ## 'fields': ('jamb_pin_usage',),185 ## 'is_required': False,186 ## 'label': 'Nr of Cardusage',187 ## 'label_edit': 'Nr of Cardusage',188 ## 'description': '',189 ## 'help': 'How many times has the scratchcard been used',190 ## 'is_i18n': False,191 ## 'readonly_layout_modes': (),192 ## 'hidden_layout_modes': (),193 ## 'hidden_readonly_layout_modes': (),194 ## 'hidden_empty': False,195 ## 'hidden_if_expr': '',196 ## 'css_class': '',197 ## 'widget_mode_expr': '',198 ## 'display_width': 2,199 ## 'size_max': 2,200 ## },201 ## },202 180 'faculty': { 203 181 'type': 'String Widget', … … 228 206 'ncols': 1, 229 207 'rows': [ 230 [{'widget_id': 'jamb_is_admitted', 'ncols': 1},],208 #[{'widget_id': 'jamb_is_admitted', 'ncols': 1},], 231 209 #[{'widget_id': 'jamb_where_admitted', 'ncols': 1},], 232 210 #[{'widget_id': 'jamb_pin_usage', 'ncols': 1},], 233 [{'widget_id': 'faculty', 'ncols': 1},],211 #[{'widget_id': 'faculty', 'ncols': 1},], 234 212 ] 235 213 }, … … 508 486 [{'widget_id': 'sc_pin', 'ncols': 1},], 509 487 [{'widget_id': 'jamb_id', 'ncols': 1},], 510 ]511 },512 }513 ###)514 515 accobook = { ###(516 'widgets': {517 'sc_id': {518 'type': 'String Widget',519 'data': {520 'title': 'SC ID',521 'fields': ('accommodation_sc_id',),522 'is_required': False,523 'label': 'Card Serial Number ',524 'label_edit': 'Card Serial Number',525 'description': 'Card Serial Number ',526 'help': 'This can be found on the bottom right of the reverse side of your Scratch Card',527 'is_i18n': False,528 'readonly_layout_modes': (),529 'hidden_layout_modes': (),530 'hidden_readonly_layout_modes': (),531 'hidden_empty': False,532 'hidden_if_expr': 'python:1',533 'css_class': '',534 'widget_mode_expr': '',535 'display_width': 10,536 'size_max': 0,537 },538 },539 'sc_pin': {540 'type': 'Scratchcard Pin Widget',541 'data': {542 'title': 'SC Pin',543 'fields': ('accommodation_sc_pin'),544 'is_required': True,545 'label': 'enter an Accommodation PIN',546 'label_edit': 'enter an Accommodation PIN',547 'description': '',548 'help': 'Please enter a PIN valid for Accomodation booking',549 'is_i18n': False,550 'readonly_layout_modes': (),551 'hidden_layout_modes': (),552 'hidden_readonly_layout_modes': (),553 'hidden_empty': False,554 'hidden_if_expr': '',555 'css_class': '',556 'widget_mode_expr': '',557 'display_width': 10,558 'size_max': 10,559 },560 },561 },562 'layout': {563 'style_prefix': 'layout_accobook_',564 'flexible_widgets': (),565 'ncols': 1,566 'rows': [567 #[{'widget_id': 'sc_id', 'ncols': 1},],568 [{'widget_id': 'sc_pin', 'ncols': 1},],569 488 ] 570 489 }, … … 905 824 'data': { 906 825 'fields': ['heading'], 907 'level': 1,826 'level': 2, 908 827 'is_i18n': 0, 909 828 'is_required': 1, 829 'label': 'Title', 910 830 'label_edit': 'Title', 911 831 'help': 'Course Title', … … 914 834 }, 915 835 }, 836 'title': Title, 916 837 'text': Text, 917 838 'level': { … … 1000 921 'rows': [ 1001 922 [{'widget_id': 'heading', 'ncols': 1},], 923 [{'widget_id': 'title', 'ncols': 1},], 1002 924 [{'widget_id': 'text', 'ncols': 1},], 1003 925 [{'widget_id': 'level', 'ncols': 1},], … … 1011 933 ###) 1012 934 935 course_results = { ###( 936 'widgets': { 937 'points': { 938 'type': 'Int Widget', 939 'data': { 940 'title': '', 941 'fields': ('points',), 942 'is_required': False, 943 'label': 'Points', 944 'label_edit': 'Points', 945 'description': '', 946 'help': '', 947 'is_i18n': False, 948 'readonly_layout_modes': (), 949 'hidden_layout_modes': (), 950 'hidden_readonly_layout_modes': (), 951 'hidden_empty': False, 952 'hidden_if_expr': '', 953 'css_class': '', 954 'widget_mode_expr': '', 955 'display_width': 3, 956 'size_max': 3, 957 }, 958 }, 959 'grade': { 960 'type': 'String Widget', 961 'data': { 962 'title': '', 963 'fields': ('grade'), 964 'is_required': False, 965 'label': 'Grade', 966 'label_edit': 'Grade', 967 'description': '', 968 'help': '', 969 'is_i18n': False, 970 'readonly_layout_modes': (), 971 'hidden_layout_modes': (), 972 'hidden_readonly_layout_modes': (), 973 'hidden_empty': False, 974 'hidden_if_expr': '', 975 'css_class': '', 976 'widget_mode_expr': '', 977 'display_width': 2, 978 'size_max': 1, 979 }, 980 }, 981 }, 982 'layout': { 983 'style_prefix': 'layout_default_', 984 'flexible_widgets': (), 985 'ncols': 1, 986 'rows': [ 987 [{'widget_id': 'points', 'ncols': 1},], 988 [{'widget_id': 'grade', 'ncols': 1},], 989 ] 990 }, 991 } 992 ###) 993 1013 994 accommodation = { ###( 1014 995 'widgets': { … … 1017 998 'data': { 1018 999 'fields': ['heading'], 1019 'level': 1,1000 'level': 2, 1020 1001 'is_i18n': 0, 1021 1002 'is_required': 1, 1003 'label': 'Hall Name', 1022 1004 'label_edit': 'Hall Name', 1023 1005 'help': '', … … 1026 1008 }, 1027 1009 }, 1010 'title': Title, 1028 1011 'text': Text, 1029 1012 'which_sex': { … … 1118 1101 'rows': [ 1119 1102 [{'widget_id': 'heading', 'ncols': 1},], 1103 [{'widget_id': 'title', 'ncols': 1},], 1120 1104 [{'widget_id': 'text', 'ncols': 1},], 1121 1105 [{'widget_id': 'which_sex', 'ncols': 1},], … … 1125 1109 [{'widget_id': 'beds_per_room', 'ncols': 1},], 1126 1110 [{'widget_id': 'beds_assigned', 'ncols': 1},], 1111 ] 1112 }, 1113 } 1114 ###) 1115 1116 accobook = { ###( 1117 'widgets': { 1118 'sc_id': { 1119 'type': 'String Widget', 1120 'data': { 1121 'title': 'SC ID', 1122 'fields': ('accommodation_sc_id',), 1123 'is_required': False, 1124 'label': 'Card Serial Number ', 1125 'label_edit': 'Card Serial Number', 1126 'description': 'Card Serial Number ', 1127 'help': 'This can be found on the bottom right of the reverse side of your Scratch Card', 1128 'is_i18n': False, 1129 'readonly_layout_modes': (), 1130 'hidden_layout_modes': (), 1131 'hidden_readonly_layout_modes': (), 1132 'hidden_empty': False, 1133 'hidden_if_expr': 'python:1', 1134 'css_class': '', 1135 'widget_mode_expr': '', 1136 'display_width': 10, 1137 'size_max': 0, 1138 }, 1139 }, 1140 'sc_pin': { 1141 'type': 'Scratchcard Pin Widget', 1142 'data': { 1143 'title': 'SC Pin', 1144 'fields': ('accommodation_sc_pin'), 1145 'is_required': True, 1146 'label': 'enter an Accommodation PIN', 1147 'label_edit': 'enter an Accommodation PIN', 1148 'description': '', 1149 'help': 'Please enter a PIN valid for Accomodation booking', 1150 'is_i18n': False, 1151 'readonly_layout_modes': (), 1152 'hidden_layout_modes': (), 1153 'hidden_readonly_layout_modes': (), 1154 'hidden_empty': False, 1155 'hidden_if_expr': '', 1156 'css_class': '', 1157 'widget_mode_expr': '', 1158 'display_width': 10, 1159 'size_max': 10, 1160 }, 1161 }, 1162 }, 1163 'layout': { 1164 'style_prefix': 'layout_accobook_', 1165 'flexible_widgets': (), 1166 'ncols': 1, 1167 'rows': [ 1168 #[{'widget_id': 'sc_id', 'ncols': 1},], 1169 [{'widget_id': 'sc_pin', 'ncols': 1},], 1127 1170 ] 1128 1171 }, -
waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
r113 r139 295 295 296 296 297 ###) 298 299 course_results_schema = { ###( 300 'points': { 301 'type': 'CPS Int Field', 302 'data': { 303 'is_searchabletext': 0, 304 }, 305 }, 306 'grade': { 307 'type': 'CPS String Field', 308 'data': { 309 'is_searchabletext': 0, 310 }, 311 }, 312 } 313 # 297 314 ###) 298 315 … … 464 481 schemas['students'] = students_folder_schema 465 482 schemas['student'] = student_schema 483 schemas['course_results'] = course_results_schema 466 484 schemas['student_personal'] = student_personal_schema 467 485 schemas['accommodation'] = accommodation -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r124 r139 26 26 'cps_proxy_type': 'folder', 27 27 'schemas': ['metadata', 'common', 'folder'], 28 'layouts': [' common', 'university'],28 'layouts': ['waeup_common'], 29 29 'layout_clusters': ['metadata:metadata'], 30 30 'cps_section_wf': 'waeup_section_wf', … … 90 90 'cps_proxy_type': 'folder', 91 91 'schemas': ['metadata', 'common', 'folder'], 92 'layouts': ['waeup_common', 'folder'],92 'layouts': ['waeup_common',], 93 93 'layout_clusters': ['metadata:metadata'], 94 94 'cps_section_wf': 'waeup_section_wf', … … 122 122 'condition': 'object/portal_membership/isAnonymousUser', 123 123 'permission': (View,)}, 124 {'id': 'edit', 125 'name': 'action_edit', 126 'action': 'cpsdocument_edit_form', 127 'condition': "python:member and 'Manager' in member.getRoles()", 128 'permissions': (ModifyPortalContent,UniversityManage,)}, 124 129 { 125 130 'id': 'localroles', … … 196 201 'product': 'WAeUP', 197 202 'factory': 'addStudent', 198 'immediate_view': ' cpsdocument_view',199 'global_allow': True, 200 'filter_content_types': True, 201 'allowed_content_types': ('Jamb','StudentPersonal' ),202 'allow_discussion': False, 203 'cps_is_searchable': True, 204 'cps_proxy_type': ' document',203 'immediate_view': 'folder_view', 204 'global_allow': True, 205 'filter_content_types': True, 206 'allowed_content_types': ('Jamb','StudentPersonal','StudyLevel'), 207 'allow_discussion': False, 208 'cps_is_searchable': True, 209 'cps_proxy_type': 'folder', 205 210 'cps_display_as_document_in_listing': True, 206 211 'schemas': ['metadata','common','student'], … … 239 244 'name' : 'Personal Data', 240 245 'action' : 'string:${object/absolute_url}/PERSONAL', 246 'condition': '', 247 'permission': (ModifyPortalContent,)}, 248 { 249 'id' : 'study_level', 250 'name' : 'Register for next Level', 251 'action' : 'string:${object/absolute_url}/register_level', 241 252 'condition': '', 242 253 'permission': (ModifyPortalContent,)}, … … 409 420 ###) 410 421 422 study_level_folder = { ###( 423 'title': 'WAeUP Study Level Folder', 424 'description': '', 425 'content_icon': '', 426 'content_meta_type': 'Level', 427 'product': 'WAeUP', 428 'factory': 'addLevelFolder', 429 'immediate_view': 'folder_view', 430 'global_allow': True, 431 'filter_content_types': True, 432 'allowed_content_types': ('Semester',), 433 'allow_discussion': False, 434 'cps_is_searchable': True, 435 'cps_proxy_type': 'folder', 436 'cps_display_as_document_in_listing': True, 437 'schemas': ['metadata','common',], 438 'layouts': ['waeup_common',], 439 'flexible_layouts': (), 440 'layout_clusters': ['metadata:metadata'], 441 'cps_section_wf': 'waeup_section_wf', 442 'use_content_status_history': 0, 443 'actions': ( 444 {'id': 'view', 445 'name': 'Standard View', 446 #'action': 'accommodation_index_html', 447 'action': 'temporary_view_all', 448 'condition': '', 449 'permission': (View,), 450 'category': 'object', 451 'visible': True,}, 452 {'id': 'add_level', 453 'name': 'Register for next year', 454 'condition': "python:member and 'Student'in member.getRoles()", 455 'action' : 'register_level', 456 #'action': 'folder_factories', 457 'permissions': (StudentManage,)}, 458 {'id': 'metadata', 459 'name': 'action_metadata', 460 'action': 'cpsdocument_metadata', 461 'condition': "python:member and 'Manager' in member.getRoles()", 462 'permissions': (UniversityManage,)}, 463 {'id': 'localroles', 464 'name': 'delegate', 465 'action': 'folder_localrole_form', 466 'permissions': (UniversityManage,), 467 'visible': 0, 468 }, 469 ) 470 } 471 ###) 472 473 semester_folder = { ###( 474 'title': 'WAeUP Semester Folder', 475 'description': '', 476 'content_icon': '', 477 'content_meta_type': 'Semester', 478 'product': 'WAeUP', 479 'factory': 'addLevelFolder', 480 'immediate_view': 'folder_view', 481 'global_allow': True, 482 'filter_content_types': True, 483 'allowed_content_types': ('CourseTicket',), 484 'allow_discussion': False, 485 'cps_is_searchable': True, 486 'cps_proxy_type': 'folder', 487 'cps_display_as_document_in_listing': True, 488 #'schemas': ['metadata','common','course','course_results'], 489 #'layouts': ['waeup_common','course','course_results'], 490 'schemas': ['metadata','common',], 491 'layouts': ['waeup_common',], 492 'flexible_layouts': (), 493 'layout_clusters': ['metadata:metadata'], 494 'cps_section_wf': 'waeup_section_wf', 495 'use_content_status_history': 0, 496 'actions': ( 497 {'id': 'view', 498 'name': 'Standard View', 499 #'action': 'accommodation_index_html', 500 'action': 'temporary_view_all', 501 'condition': '', 502 'permission': (View,), 503 'category': 'object', 504 'visible': True,}, 505 {'id': 'add_course_ticket', 506 'name': 'Add Course Ticket', 507 'condition': "python:member and 'Student'in member.getRoles()", 508 'action' : 'add_course_ticket', 509 #'action': 'folder_factories', 510 'permissions': (StudentManage,)}, 511 {'id': 'metadata', 512 'name': 'action_metadata', 513 'action': 'cpsdocument_metadata', 514 'condition': "python:member and 'Manager' in member.getRoles()", 515 'permissions': (UniversityManage,)}, 516 {'id': 'localroles', 517 'name': 'delegate', 518 'action': 'folder_localrole_form', 519 'permissions': (UniversityManage,), 520 'visible': 0, 521 }, 522 ) 523 } 524 ###) 525 526 course_ticket = { ###( 527 'title': 'WAeUP Course Ticket', 528 'description': '', 529 'content_icon': '', 530 'content_meta_type': 'CourseTicket', 531 'product': 'WAeUP', 532 'factory': 'addCourseTicket', 533 'immediate_view': 'folder_view', 534 'global_allow': True, 535 'filter_content_types': True, 536 'allowed_content_types': (), 537 'allow_discussion': False, 538 'cps_is_searchable': True, 539 'cps_proxy_type': 'cpsdocument', 540 'cps_display_as_document_in_listing': True, 541 'schemas': ['metadata','common','course','course_results'], 542 'layouts': ['waeup_common','course','course_results'], 543 'flexible_layouts': (), 544 'layout_clusters': ['metadata:metadata'], 545 'cps_section_wf': 'waeup_section_wf', 546 'use_content_status_history': 0, 547 'actions': ( 548 {'id': 'view', 549 'name': 'Standard View', 550 #'action': 'accommodation_index_html', 551 'action': 'temporary_view_all', 552 'condition': '', 553 'permission': (View,), 554 'category': 'object', 555 'visible': True,}, 556 {'id': 'metadata', 557 'name': 'action_metadata', 558 'action': 'cpsdocument_metadata', 559 'condition': "python:member and 'Manager' in member.getRoles()", 560 'permissions': (UniversityManage,)}, 561 {'id': 'localroles', 562 'name': 'delegate', 563 'action': 'folder_localrole_form', 564 'permissions': (UniversityManage,), 565 'visible': 0, 566 }, 567 ) 568 } 569 ###) 570 411 571 faculty_type = { ###( 412 572 'title': 'WAeUP Faculty', … … 612 772 'allow_discussion': False, 613 773 'cps_is_searchable': True, 614 'cps_proxy_type': ' cpsdocument',774 'cps_proxy_type': 'folder', 615 775 'cps_display_as_document_in_listing': True, 616 776 'schemas': ['metadata','common',], … … 640 800 'condition': "python:member and 'Manager' in member.getRoles()", 641 801 'permissions': (UniversityManage,)}, 802 {'id': 'edit', 803 'name': 'action_edit', 804 'action': 'cpsdocument_edit_form', 805 'condition': "python:member and 'Manager' in member.getRoles()", 806 'permissions': (ModifyPortalContent,UniversityManage,)}, 642 807 {'id': 'localroles', 643 808 'name': 'delegate', … … 663 828 'allow_discussion': False, 664 829 'cps_is_searchable': True, 665 'cps_proxy_type': ' document',830 'cps_proxy_type': 'cpsdocument', 666 831 'cps_display_as_document_in_listing': True, 667 832 'schemas': ['metadata','common','accommodation'], … … 707 872 types['Student'] = student_type 708 873 types['StudentPersonal'] = student_personal_type 874 types['StudyLevel'] = study_level_folder 875 types['Semester'] = semester_folder 876 types['CourseTicket'] = course_ticket 709 877 types['AccoFolder'] = acco_folder 710 878 types['Accommodation'] = accommodation -
waeup_product/trunk/skins/waeup_student/add_accommodation.py
r119 r139 37 37 ) 38 38 elif psm == 'valid': 39 oid = "%s" % ds.get(' heading').replace(' ','')39 oid = "%s" % ds.get('Title').replace(' ','') 40 40 context.invokeFactory(type_name,oid) 41 41 object = getattr(context,oid)
Note: See TracChangeset for help on using the changeset viewer.