Ignore:
Timestamp:
27 Oct 2005, 23:58:38 (19 years ago)
Author:
joachim
Message:

=student accomodation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/skins/waeup_student/create_jamb.py

    r106 r107  
    1 ##parameters=REQUEST=None
     1#-*- mode: python; mode: fold -*-
    22# $Id$
    3 """
    4 Create an the Jamb-Record for a Student
    5 
    6 """
    7 
    8 type_name = 'Jamb'
    9 ti = context.portal_types[type_name]
    10 pr = context.portal_registration
    11 pm = context.portal_membership
    12 
    13 REQUEST.set('type_name',type_name)
    14 
    15 validate = REQUEST.has_key("cpsdocument_edit_button")
    16 
    17 lt = context.portal_layouts
    18 
    19 res,psm,ds = lt.renderLayout(layout_id= 'jambcreate',
    20                       schema_id= 'jamb',
    21                       context=context,
    22                       mapping=validate and REQUEST,
    23                       ob={},
    24                       layout_mode='create',
    25                       )
    26 if psm == 'invalid':
    27     return context.create_jamb_form(rendered = res,
    28                                  psm = 'Please correct your errors',
    29                                  ds = ds,
    30                                  )
    31 elif psm == '':
    32     return context.create_jamb_form(rendered = res,
    33                                  psm = psm,
    34                                  ds = ds,
    35                                  )
    36    
    37 elif psm == 'valid':
    38     s_id = "s%s" % ds.get('reg_nr')
    39     name = ds.get('name')
    40     skw = {'title': name}
    41     context.invokeFactory('Student',s_id)
    42     student = getattr(context,s_id)   
    43     student.getContent().edit(mapping=skw)
    44     context.notifyCPSDocumentCreation(ob=student)
    45     jamb_id = 'JAMB'
    46     student.invokeFactory('Jamb',jamb_id)
    47     jamb = getattr(student,jamb_id)   
    48     ds.set('title', name)
    49     jamb.getContent().edit(mapping=ds)
    50     context.notifyCPSDocumentCreation(ob=jamb)
    51     psm = 'Student created'
    52     noCPSMember = False
    53     try:
    54         pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember','Student','Contributor'))
    55     except:
    56         noCPSMember = True
    57     if noCPSMember:
    58         pr.addMember(s_id, 'UnSeT',roles=('Member','Student','Contributor'))
    59 ##    groups = context.portal_directories.groups
    60 ##    gm = list(groups.getEntry('Students')['members'])
    61 ##    gm.extend((s_id,))
    62 ##    groups.editEntry({'group': 'Students',
    63 ##                      'members': gm}) 
    64     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,ds
    71 
     3"""Return custom document types."""
     4# permissions
     5from Products.CMFCore.permissions import View
     6from Products.CMFCore.permissions import ModifyPortalContent
     7from Products.CMFCore.permissions import AddPortalContent
     8from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\
     9                                            DepartmentManage,CourseManage
     10ChangePermissions = 'Change permissions'
     11
     12university_type = { ###(
     13    'title': 'WAeUP Base Folder',
     14    'description': 'The WAeUP Container',
     15    'content_icon': 'students_folder.gif',
     16    'content_meta_type': 'University',
     17    'product': 'WAeUP',
     18    'factory': 'addUniversity',
     19    'immediate_view': 'university_view',
     20    'global_allow': 1,
     21    'filter_content_types': 1,
     22    'allowed_content_types': ('StudentsFolder','Faculty','AccoFolder'),
     23    'allow_discussion': 0,
     24    'cps_is_searchable': 1,
     25    'cps_display_as_document_in_listing': 1,
     26    'cps_proxy_type': 'folder',
     27    'schemas': ['metadata', 'common', 'folder'],
     28    'layouts': ['common', 'university'],
     29    'layout_clusters': ['metadata:metadata'],
     30    'cps_section_wf': 'waeup_section_wf',
     31    'actions': ({'id': 'view',
     32                 'name': 'action_view',
     33                 'action': 'university_view',
     34                 'condition': "python:member and 'Manager' in member.getRoles()",
     35                 'permissions': (View,)},
     36                {'id': 'add_faculty',
     37                 'name': 'Add a Faculty',
     38                 'condition': "python:member and not 'Student'in member.getRoles()",
     39                 'action'    : 'string:${object/absolute_url}/create_common?type_name=Faculty',
     40                 #'action': 'folder_factories',
     41                 'permissions': (UniversityManage,)},
     42                {'id': 'add_accommodation',
     43                 'name': 'Add an Accommodation Hall',
     44                 'condition': "python:member and not 'Student'in member.getRoles()",
     45                 'action'    : 'string:${object/absolute_url}/add_accommodation',
     46                 #'action': 'folder_factories',
     47                 'permissions': (UniversityManage,)},
     48                {'id': 'contents',
     49                 'name': 'action_folder_contents',
     50                 'action': 'folder_contents',
     51                 'condition': "python:member and 'Manager' in member.getRoles()",
     52                 'permissions': (ModifyPortalContent,UniversityManage,)},
     53                {'id': 'edit',
     54                 'name': 'action_edit',
     55                 'action': 'cpsdocument_edit_form',
     56                 'condition': "python:member and 'Manager' in member.getRoles()",
     57                 'permissions': (ModifyPortalContent,UniversityManage,)},
     58                {'id': 'metadata',
     59                 'name': 'action_metadata',
     60                 'action': 'cpsdocument_metadata',
     61                 'condition': "python:member and 'Manager' in member.getRoles()",
     62                 'permissions': (ModifyPortalContent,)},
     63          {'id': 'localroles',
     64          'name': 'delegate',
     65          'action': 'folder_localrole_form',
     66          'permissions': (UniversityManage,StudentManage)
     67          },
     68                 )
     69        }
     70###)
     71
     72students_folder_type = { ###(
     73    'title': 'WAeUP Student Folder',
     74    'description': 'The WAeUP Student Folder',
     75    'content_icon': 'students_folder.gif',
     76    'content_meta_type': 'StudentsFolder',
     77    'product': 'CPSDefault',
     78    'factory': 'addFolder',
     79    'immediate_view': 'folder_view',
     80    'global_allow': 1,
     81    'filter_content_types': 1,
     82    'allowed_content_types': ('Student'),
     83    #'allowed_content_types': ('Student','ScratchCard'),
     84    'allow_discussion': 0,
     85    'cps_is_searchable': 1,
     86    'cps_display_as_document_in_listing': 1,
     87    'cps_proxy_type': 'folder',
     88    'schemas': ['metadata', 'common', 'folder'],
     89    'layouts': ['waeup_common','folder'],
     90    'layout_clusters': ['metadata:metadata'],
     91    'cps_section_wf': 'waeup_section_wf',
     92    'actions': ({'id': 'view',
     93                 'name': 'Students',
     94                 'action': 'students_folder_view',
     95                 'condition': "python:member and 'Manager' in member.getRoles()",
     96                 'permissions': (View,)},
     97##                {
     98##                'id'        : 'add_content',
     99##                'name'      : 'Add Content',
     100##                'action'    : 'string:${object/absolute_url}/folder_factories',
     101##                'condition': "python:member and 'Manager' in member.getRoles()",
     102##                'permissions': (StudentManage,)},
     103                {
     104                'id'        : 'add_jamb',
     105                'name'      : 'Add Student JAMB',
     106                'action'    : 'string:${object/absolute_url}/create_jamb',
     107                'permissions': (UniversityManage,StudentManage)},
     108          {'id': 'localroles',
     109          'name': 'delegate',
     110          'action': 'folder_localrole_form',
     111          'permissions': (UniversityManage,)
     112          },
     113##                {'id': 'contents',
     114##                 'name': 'action_folder_contents',
     115##                 'action': 'folder_contents',
     116##                 'permissions': (UniversityManage,)},
     117##                {'id': 'edit',
     118##                 'name': 'action_edit',
     119##                 'action': 'cpsdocument_edit_form',
     120##                 'permissions': (UniversityManage,)},
     121##                {'id': 'metadata',
     122##                 'name': 'action_metadata',
     123##                 'action': 'cpsdocument_metadata',
     124##                 'permissions': (UniversityManage,)},
     125##                {'id': 'localroles',
     126##                 'name': 'action_local_roles',
     127##                 'action': 'folder_localrole_form',
     128##                 'permissions': (UniversityManage,)},
     129    )
     130}
     131###)
     132
     133student_type = { ###(
     134    'title': 'WAeUP Student',
     135    'description': '',
     136    'content_icon': 'student.gif',
     137    'content_meta_type': 'Student',
     138    'product': 'WAeUP',
     139    'factory': 'addStudent',
     140    'immediate_view': 'cpsdocument_view',
     141    'global_allow': True,
     142    'filter_content_types': True,
     143    'allowed_content_types': ('Jamb','StudentPersonal'),
     144    'allow_discussion': False,
     145    'cps_is_searchable': True,
     146    'cps_proxy_type': 'document',
     147    'cps_display_as_document_in_listing': True,
     148    'schemas': ['metadata','common','student'],
     149    'layouts': ['waeup_common','student'],
     150    'flexible_layouts': (),
     151    'layout_clusters': ['metadata:metadata'],
     152    'cps_section_wf': 'waeup_section_wf',
     153    'use_content_status_history': 0,
     154    'actions': (
     155         {'id': 'view',
     156          'name': 'action_view',
     157          'action': 'string:${object_url}/student_index_html',
     158          #'action': 'string:${object_url}/cpsdocument_view',
     159          'condition': '',
     160          'permission': (View,),
     161          'category': 'object',
     162          'visible': True,},
     163         {'id': 'metadata',
     164          'name': 'action_metadata',
     165          'action': 'cpsdocument_metadata',
     166          'condition': "python:member and 'Manager' in member.getRoles()",
     167          'permissions': (UniversityManage,)},
     168          {'id': 'localroles',
     169          'name': 'delegate',
     170          'action': 'folder_localrole_form',
     171          'permissions': (UniversityManage,)
     172          },
     173          )
     174}
     175###)
     176
     177scratch_card = { ###(
     178    'title': 'WAeUP Scratchcard',
     179    'description': '',
     180    'content_icon': 'student.gif',
     181    'content_meta_type': 'Scratch Card',
     182    'product': 'CPSDocument',
     183    'factory': 'addCPSDocument',
     184    'immediate_view': 'cpsdocument_view',
     185    'global_allow': True,
     186    'filter_content_types': True,
     187    'allowed_content_types': (),
     188    'allow_discussion': False,
     189    'cps_is_searchable': True,
     190    'cps_proxy_type': 'document',
     191    'cps_display_as_document_in_listing': True,
     192    'schemas': ('scratch_card'),
     193    'layouts': ('scratch_card'),
     194    'cps_workspace_wf': 'waeup_workspace_wf',
     195    'cps_section_wf': 'waeup_section_wf',
     196##    'actions': (
     197##         {'id': 'view',
     198##          'name': 'action_view',
     199##          'action': 'string:${object_url}/document_view',
     200##          'condition': '',
     201##          'permission': ('View',),
     202##          'category': 'object',
     203##          'visible': True,},
     204##         {'id': 'new_content',
     205##          'name': 'Add a scratch card',
     206##          'action': 'string:${object_url}/folder_factories',
     207##          'condition': "python:len(object.contentItems()) == 0 ",
     208##          'permission': ('Modify portal content',),
     209##          'category': 'object',
     210##          'visible': True,},
     211##         {'id': 'contents',
     212##          'name': 'action_folder_contents',
     213##          'action': 'string:${object_url}/folder_contents',
     214##          'condition': "python:object.getTypeInfo().cps_proxy_type != 'document'",
     215##          'permission': ('Modify portal content',),
     216##          'category': 'object',
     217##          'visible': True,},
     218##         {'id': 'edit',
     219##          'name': 'action_edit',
     220##          'action': 'string:${object_url}/cpsdocument_edit_form',
     221##          'condition': '',
     222##          'permission': ('Modify portal content',),
     223##          'category': 'object',
     224##          'visible': True,},
     225##    )
     226}
     227#
     228###)
     229
     230jamb_type = { ###(
     231    'title': "JAMB data",
     232    'description': 'The data from JAMB',
     233    'content_icon': '',
     234    'content_meta_type': 'CPS Document',
     235    'product': 'CPSDocument',
     236    'factory': 'addCPSDocument',
     237    'immediate_view': 'cpsdocument_view',
     238    'global_allow': True,
     239    'filter_content_types': True,
     240    'allowed_content_types': (),
     241    'allow_discussion': False,
     242    'cps_is_searchable': True,
     243    'cps_proxy_type': 'document',
     244    'cps_display_as_document_in_listing': True,
     245    'cps_is_portalbox': False,
     246    #'schemas': ['common','metadata','jamb'],
     247    'schemas': ['jamb'],
     248    'layouts': ['jamb'],
     249    'flexible_layouts': (),
     250    'storage_methods': ('admitted:store_admission_pin'),
     251    'cps_workspace_wf': 'workspace_content_wf',
     252    'cps_section_wf': 'section_content_wf',
     253    'actions': (
     254         {'id': 'view',
     255          'name': 'action_view',
     256          'action': 'string:${object_url}/jamb_index_html',
     257          'condition': '',
     258          'permission': (View,),
     259          'visible': True,},
     260         {'id': 'edit',
     261          'name': 'action_edit',
     262          'action': 'string:${object_url}/waeup_edit_form',
     263          'condition': '',
     264          'permission': (ModifyPortalContent,StudentManage),
     265          },
     266          {'id': 'localroles',
     267          'name': 'delegate',
     268          'action': 'folder_localrole_form',
     269          'permissions': (UniversityManage,)
     270          },
     271          {
     272          'id'        : 'add_content',
     273          'name'      : 'Add Content',
     274          'action'    : 'string:${object/absolute_url}/folder_factories',
     275          'condition': "python:member and 'Manager' in member.getRoles()",
     276          'permissions': (StudentManage,)},
     277         {'id': 'metadata',
     278          'name': 'action_metadata',
     279          'action': 'cpsdocument_metadata',
     280          'condition': "python:'Manager' in member.getRoles()",
     281          'permissions': (UniversityManage,)},
     282          )
     283}
     284###)
     285
     286student_personal_type = { ###(
     287    'title': "Student personal data",
     288    'description': '',
     289    'content_icon': '',
     290    'content_meta_type': 'StudentPersonal',
     291    'product': 'WAeUP',
     292    'factory': 'addStudentPersonal',
     293    'immediate_view': 'student_personal_index_html',
     294    'global_allow': True,
     295    'filter_content_types': True,
     296    'allowed_content_types': (),
     297    'allow_discussion': False,
     298    'cps_is_searchable': True,
     299    'cps_proxy_type': 'document',
     300    'cps_display_as_document_in_listing': True,
     301    'cps_is_portalbox': False,
     302    'schemas': ['student_personal'],
     303    'layouts': ['student_personal'],
     304    'flexible_layouts': (),
     305    'storage_methods': (),
     306    'cps_workspace_wf': 'workspace_content_wf',
     307    'cps_section_wf': 'section_content_wf',
     308    'actions': (
     309         {'id': 'view',
     310          'name': 'action_view',
     311          'action': 'string:${object_url}/student_personal_index_html',
     312          #'action': 'string:${object_url}/cpsdocument_view',
     313          'permission': ('View',),
     314          'category': 'object',
     315          'visible': True,},
     316         {'id': 'edit',
     317          'name': 'action_edit',
     318          'action': 'string:${object_url}/student_personal_edit_form',
     319          'condition': '',
     320          'permission': ('View',),
     321          'category': 'object',
     322          'visible': True,},
     323         {'id': 'metadata',
     324          'name': 'action_metadata',
     325          'action': 'cpsdocument_metadata',
     326          'condition': "python:member and 'Manager' in member.getRoles()",
     327          'permissions': (UniversityManage,)},
     328          )
     329}
     330###)
     331
     332faculty_type = { ###(
     333    'title': 'WAeUP Faculty',
     334    'description': '',
     335    'content_icon': '',
     336    'content_meta_type': 'Faculty',
     337    'product': 'WAeUP',
     338    'factory': 'addFaculty',
     339    'immediate_view': 'folder_view',
     340    'global_allow': True,
     341    'filter_content_types': True,
     342    'allowed_content_types': ('Department'),
     343    'allow_discussion': 0,
     344    'cps_is_searchable': True,
     345    'cps_proxy_type': 'folder',
     346    'cps_display_as_document_in_listing': True,
     347    'schemas': ['metadata','common','faculty'],
     348    'layouts': ['faculty'],
     349    'flexible_layouts': (),
     350    'layout_clusters': ['metadata:metadata',],
     351    'cps_section_wf': 'waeup_section_wf',
     352    'use_content_status_history': 0,
     353    'actions': (
     354         {'id': 'view',
     355          'name': 'action_view',
     356          'action': 'string:${object_url}/faculty_index_html',
     357          'condition': '',
     358          'permission': (View,),
     359          'visible': True,},
     360         {'id': 'edit',
     361          'name': 'action_edit',
     362          'action': 'string:${object_url}/waeup_edit_form',
     363          'condition': '',
     364          'permission': (UniversityManage,),
     365          'visible': True,},
     366          {'id': 'add_department',
     367          'name': 'Add a Department',
     368          'action'    : 'string:${object/absolute_url}/create_common?type_name=Department',
     369          'permissions': (ModifyPortalContent,UniversityManage,)},
     370          {'id': 'contents',
     371          'name': 'action_folder_contents',
     372          'action': 'folder_contents',
     373          'condition': "python:member and 'Manager' in member.getRoles()",
     374          'permissions': (ModifyPortalContent,UniversityManage,)},
     375          {'id': 'edit',
     376          'name': 'action_edit',
     377          'action': 'cpsdocument_edit_form',
     378          'condition': "python:member and 'Manager' in member.getRoles()",
     379          'permissions': (ModifyPortalContent,UniversityManage,)},
     380          {'id': 'metadata',
     381          'name': 'action_metadata',
     382          'action': 'cpsdocument_metadata',
     383          'condition': "python:member and 'Manager' in member.getRoles()",
     384          'permissions': (ModifyPortalContent,)},
     385          {'id': 'localroles',
     386          'name': 'delegate',
     387          'action': 'folder_localrole_form',
     388          'permissions': (UniversityManage,)
     389          },
     390          )
     391}
     392###)
     393
     394department_type = { ###(
     395    'title': 'WAeUP Department',
     396    'description': '',
     397    'content_icon': '',
     398    'content_meta_type': 'Department',
     399    'product': 'WAeUP',
     400    'factory': 'addDepartment',
     401    'immediate_view': 'folder_view',
     402    'global_allow': True,
     403    'filter_content_types': True,
     404    'allowed_content_types': ('Student','Course'),
     405    'allow_discussion': False,
     406    'cps_is_searchable': True,
     407    'cps_proxy_type': 'folder',
     408    'cps_display_as_document_in_listing': True,
     409    'schemas': ['metadata','common','department'],
     410    'layouts': ['department',],
     411    'flexible_layouts': (),
     412    'layout_clusters': ['metadata:metadata',],
     413    'cps_section_wf': 'waeup_section_wf',
     414    'use_content_status_history': 0,
     415    'actions': (
     416         {'id': 'view',
     417          'name': 'action_view',
     418          'action': 'string:${object_url}/department_index_html',
     419          'condition': '',
     420          'permission': ('View',),
     421          'visible': True,},
     422         {'id': 'edit',
     423          'name': 'action_edit',
     424          'action': 'string:${object_url}/waeup_edit_form',
     425          'condition': '',
     426          'permission': (FacultyManage,),
     427          'visible': True,},
     428          {'id': 'create_course',
     429          'name': 'Add a Course',
     430          'action'    : 'string:${object/absolute_url}/create_course',
     431          'permissions': (ModifyPortalContent,UniversityManage,)},
     432          {'id': 'contents',
     433          'name': 'action_folder_contents',
     434          'action': 'folder_contents',
     435          'condition': "python:member and 'Manager' in member.getRoles()",
     436          'permissions': (ModifyPortalContent,UniversityManage,)},
     437          {'id': 'edit',
     438          'name': 'action_edit',
     439          'action': 'cpsdocument_edit_form',
     440          'condition': "python:member and 'Manager' in member.getRoles()",
     441          'permissions': (ModifyPortalContent,UniversityManage,)},
     442          {'id': 'metadata',
     443          'name': 'action_metadata',
     444          'action': 'cpsdocument_metadata',
     445          'condition': "python:member and 'Manager' in member.getRoles()",
     446          'permissions': (ModifyPortalContent,)},
     447          {'id': 'localroles',
     448          'name': 'delegate',
     449          'action': 'folder_localrole_form',
     450          'permissions': (UniversityManage,)
     451          },
     452          )
     453}
     454###)
     455
     456course_type = { ###( 
     457    'title': 'WAeUP Course',
     458    'description': '',
     459    'content_icon': 'student.gif',
     460    'content_meta_type': 'Course',
     461    'product': 'WAeUP',
     462    'factory': 'addCourse',
     463    'immediate_view': 'cpsdocument_view',
     464    'global_allow': True,
     465    'filter_content_types': True,
     466    'allowed_content_types': (),
     467    'allow_discussion': False,
     468    'cps_is_searchable': True,
     469    'cps_proxy_type': 'document',
     470    'cps_display_as_document_in_listing': True,
     471    'schemas': ['metadata','common','course'],
     472    'layouts': ['course',],
     473    'flexible_layouts': (),
     474    'layout_clusters': ['metadata:metadata',],
     475    'cps_section_wf': 'waeup_section_wf',
     476    'use_content_status_history': 0,
     477    'actions': (
     478         {'id': 'view',
     479          'name': 'action_view',
     480          'action': 'string:${object_url}/course_index_html',
     481          'condition': '',
     482          'permission': ('View',),
     483          'category': 'object',
     484          'visible': True,},
     485         {'id': 'edit',
     486          'name': 'action_edit',
     487          'action': 'string:${object_url}/waeup_edit_form',
     488          'condition': '',
     489          'permission': (CourseManage,),
     490          'category': 'object',
     491          'visible': True,},
     492          {'id': 'contents',
     493          'name': 'action_folder_contents',
     494          'action': 'folder_contents',
     495          'condition': "python:member and 'Manager' in member.getRoles()",
     496          'permissions': (ModifyPortalContent,UniversityManage,)},
     497          {'id': 'edit',
     498          'name': 'action_edit',
     499          'action': 'cpsdocument_edit_form',
     500          'condition': "python:member and 'Manager' in member.getRoles()",
     501          'permissions': (ModifyPortalContent,UniversityManage,)},
     502          {'id': 'metadata',
     503          'name': 'action_metadata',
     504          'action': 'cpsdocument_metadata',
     505          'condition': "python:member and 'Manager' in member.getRoles()",
     506          'permissions': (ModifyPortalContent,)},
     507          {'id': 'localroles',
     508          'name': 'delegate',
     509          'action': 'folder_localrole_form',
     510          'permissions': (UniversityManage,)
     511          },
     512          )
     513    }
     514###)
     515
     516acco_folder = { ###(
     517    'title': 'WAeUP Accommodation Folder',
     518    'description': '',
     519    'content_icon': '',
     520    'content_meta_type': 'AccoFolder',
     521    'product': 'WAeUP',
     522    'factory': 'addAccoFolder',
     523    'immediate_view': 'folder_view',
     524    'global_allow': True,
     525    'filter_content_types': True,
     526    'allowed_content_types': ('Accommodation',),
     527    'allow_discussion': False,
     528    'cps_is_searchable': True,
     529    'cps_proxy_type': 'cpsdocument',
     530    'cps_display_as_document_in_listing': True,
     531    'schemas': ['metadata','common',],
     532    'layouts': ['waeup_common',],
     533    'flexible_layouts': (),
     534    'layout_clusters': ['metadata:metadata'],
     535    'cps_section_wf': 'waeup_section_wf',
     536    'use_content_status_history': 0,
     537    'actions': (
     538         {'id': 'view',
     539          'name': 'action_view',
     540          'action': 'string:${portal_url}/sections/waeup/Accomodation/accommodation_index_html',
     541          'condition': '',
     542          'permission': (View,),
     543          'category': 'object',
     544          'visible': True,},
     545         {'id': 'metadata',
     546          'name': 'action_metadata',
     547          'action': 'cpsdocument_metadata',
     548          'condition': "python:member and 'Manager' in member.getRoles()",
     549          'permissions': (UniversityManage,)},
     550          {'id': 'localroles',
     551          'name': 'delegate',
     552          'action': 'folder_localrole_form',
     553          'permissions': (UniversityManage,),
     554          'visible': 0,
     555          },
     556          )
     557}
     558###)
     559
     560accommodation = { ###( 
     561    'title': 'WAeUP Accommodation',
     562    'description': '',
     563    'content_icon': 'student.gif',
     564    'content_meta_type': 'Accommodation',
     565    'product': 'WAeUP',
     566    'factory': 'addAccommodation',
     567    'immediate_view': 'cpsdocument_view',
     568    'global_allow': True,
     569    'filter_content_types': True,
     570    'allowed_content_types': (),
     571    'allow_discussion': False,
     572    'cps_is_searchable': True,
     573    'cps_proxy_type': 'document',
     574    'cps_display_as_document_in_listing': True,
     575    'schemas': ['metadata','common','accommodation'],
     576    'layouts': ['accommodation',],
     577    'flexible_layouts': (),
     578    'layout_clusters': ['metadata:metadata',],
     579    'cps_section_wf': 'waeup_section_wf',
     580    'use_content_status_history': 0,
     581    'actions': (
     582         {'id': 'view',
     583          'name': 'action_view',
     584          'action': 'string:${object_url}/accommodation_index_html',
     585          'condition': '',
     586          'permission': ('View',),
     587          'category': 'object',
     588          'visible': True,},
     589         {'id': 'edit',
     590          'name': 'edit',
     591          'action': 'string:${object_url}/waeup_edit_form',
     592          'permission': (UniversityManage,StudentManage),
     593          'category': 'object',
     594          'visible': True,},
     595          {'id': 'metadata',
     596          'name': 'action_metadata',
     597          'action': 'cpsdocument_metadata',
     598          'condition': "python:member and 'Manager' in member.getRoles()",
     599          'permissions': (ModifyPortalContent,)},
     600          {'id': 'localroles',
     601          'name': 'delegate',
     602          'action': 'folder_localrole_form',
     603          'permissions': (UniversityManage,),
     604          'visible' : 0,
     605          },
     606          )
     607}
     608###)
     609
     610types = {}
     611types['University'] = university_type
     612types['StudentsFolder'] = students_folder_type
     613types['Student'] = student_type
     614types['StudentPersonal'] = student_personal_type
     615types['AccoFolder'] = acco_folder
     616types['Accommodation'] = accommodation
     617types['ScratchCard'] = scratch_card
     618types['Jamb'] = jamb_type
     619types['Faculty'] = faculty_type
     620types['Department'] = department_type
     621types['Course'] = course_type
     622
     623return types
     624
Note: See TracChangeset for help on using the changeset viewer.