Ignore:
Timestamp:
4 Nov 2005, 17:07:18 (19 years ago)
Author:
joachim
Message:

=studylevel + Title

Location:
waeup_product/trunk/skins
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py

    r151 r152  
    10211021        'rows': [
    10221022            [{'widget_id': 'Title', 'ncols': 1},],
     1023            #[{'widget_id': 'Year', 'ncols': 1},],
    10231024        ]
    10241025    },
  • waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py

    r144 r152  
    105105        },
    106106    },
     107}
     108#
     109###)
     110
     111studylevel = { ###(
    107112}
    108113#
     
    486491schemas['students'] = students_folder_schema
    487492schemas['student'] = student_schema
     493schemas['studylevel'] = studylevel
    488494schemas['course_results'] = course_results_schema
    489495schemas['student_personal'] = student_personal_schema
  • waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py

    r139 r152  
    131131                 'name': 'delegate',
    132132                 'action': 'folder_localrole_form',
    133                  'permissions': (ModifyPortalContent),
    134                  'visible' : 0,
     133                 'permissions': (ModifyPortalContent,UniversityManage),
     134                 'visible' : 1,
    135135                },
    136136##                {'id': 'contents',
     
    319319    'description': 'The data from JAMB',
    320320    'content_icon': '',
    321     'content_meta_type': 'CPS Document',
    322     'product': 'CPSDocument',
    323     'factory': 'addCPSDocument',
     321    'content_meta_type': 'Jamb',
     322    'product': 'WAeUP',
     323    'factory': 'addJamb',
    324324    'immediate_view': 'cpsdocument_view',
    325325    'global_allow': True,
     
    426426    'content_meta_type': 'Level',
    427427    'product': 'WAeUP',
    428     'factory': 'addLevelFolder',
     428    'factory': 'addStudyLevel',
    429429    'immediate_view': 'folder_view',
    430430    'global_allow': True,
     
    477477    'content_meta_type': 'Semester',
    478478    'product': 'WAeUP',
    479     'factory': 'addLevelFolder',
     479    'factory': 'addSemester',
    480480    'immediate_view': 'folder_view',
    481481    'global_allow': True,
     
    505505          {'id': 'add_course_ticket',
    506506          'name': 'Add Course Ticket',
    507           'condition': "python:member and 'Student'in member.getRoles()",
    508507          'action'    : 'add_course_ticket',
    509508          #'action': 'folder_factories',
    510           'permissions': (StudentManage,)},
     509          'permissions': (ModifyPortalContent,UniversityManage,StudentManage)},
    511510         {'id': 'metadata',
    512511          'name': 'action_metadata',
    513512          'action': 'cpsdocument_metadata',
    514           'condition': "python:member and 'Manager' in member.getRoles()",
    515           'permissions': (UniversityManage,)},
     513          'permissions': (ModifyPortalContent,UniversityManage,)},
    516514          {'id': 'localroles',
    517515          'name': 'delegate',
    518516          'action': 'folder_localrole_form',
    519           'permissions': (UniversityManage,),
     517          'permissions': (ModifyPortalContent,UniversityManage,StudentManage),
    520518          'visible': 0,
    521519          },
     
    531529    'product': 'WAeUP',
    532530    'factory': 'addCourseTicket',
    533     'immediate_view': 'folder_view',
     531    'immediate_view': 'cpsdocument_view',
    534532    'global_allow': True,
    535533    'filter_content_types': True,
     
    791789          {'id': 'add_accommodation',
    792790          'name': 'Add Accommodation Hall',
    793           'condition': "python:member and 'UniversityManager'in member.getRoles()",
     791          #'condition': "python:member and 'UniversityManager'in member.getRoles()",
    794792          'action'    : 'add_accommodation',
    795793          #'action': 'folder_factories',
  • waeup_product/trunk/skins/waeup_student/create_jamb.py

    r112 r152  
    3737elif psm == 'valid':
    3838    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}
    4140    context.invokeFactory('Student',s_id)
    4241    student = getattr(context,s_id)   
     
    4645    student.invokeFactory('Jamb',jamb_id)
    4746    jamb = getattr(student,jamb_id)   
    48     ds.set('title', name)
     47    ds.set('title', "%(reg_nr)s (%(lastname)s)" % ds)
    4948    jamb.getContent().edit(mapping=ds)
    5049    context.notifyCPSDocumentCreation(ob=jamb)
     
    5756    if noCPSMember:
    5857        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)
    5962##    groups = context.portal_directories.groups
    6063##    gm = list(groups.getEntry('Students')['members'])
     
    6366##                      'members': gm}) 
    6467    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
    7168
  • waeup_product/trunk/skins/waeup_student/process_waeup_login.py

    r137 r152  
    2525pd = getattr(ma,pdid)
    2626pkw = {}
    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')
     27jc = jamb.getContent()
     28pkw['sex'] = getattr(jc,'sex')
     29pkw['firstname'] = getattr(jc,'firstname')
     30pkw['middlename'] = getattr(jc,'middlename')
     31pkw['lastname'] = getattr(jc,'lastname')
     32pkw['aggregate'] = getattr(jc,'aggregate')
     33pkw['faculty'] = getattr(jc,'faculty')
     34pkw['age'] = getattr(jc,'age')
     35pkw['state'] = getattr(jc,'state')
    3536
    36 pd.edit(mapping=pkw)
     37pd.getContent().edit(mapping=pkw)
    3738context.notifyCPSDocumentCreation(ob=pd)
    3839return response.redirect(ma.absolute_url())
  • waeup_product/trunk/skins/waeup_student/register_level.py

    r142 r152  
    2828                                 create = 1,
    2929                                 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',
    3232                                 )
    3333elif psm == '':
     
    4242    psm = (ds)
    4343    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,
    4546                                 create = 1,
    4647                                 type_name = type_name,
    47                                  psm = 'Not yet active',
    48                                  #psm = 'Please correct your errors',
     48                                 psm = 'You already registered for that level',
    4949                                 )
    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.