Ignore:
Timestamp:
20 Nov 2012, 09:08:13 (12 years ago)
Author:
Henrik Bettermann
Message:

We need to customize if students are allowed to remove mandatory course tickets. Therefore I added a property attribute removable_by_student.

Allow manager to edit the mandatory attribute.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9697 r9698  
    106106        value._p_activate()
    107107        value_dict = dict([i for i in value.__dict__.items()])
    108         value_dict['mandatory_bool'] = value.mandatory
     108        value_dict['removable_by_student'] = value.removable_by_student
    109109        value_dict['mandatory'] = translate(str(value.mandatory), 'zope',
    110110            target_language=lang)
     
    13061306    form_fields['passmark'].for_display = True
    13071307    form_fields['credits'].for_display = True
    1308     form_fields['mandatory'].for_display = True
     1308    form_fields['mandatory'].for_display = False
    13091309    form_fields['automatic'].for_display = True
    13101310    form_fields['carry_over'].for_display = True
     
    22272227        for id in child_id:
    22282228            # Students are not allowed to remove core tickets
    2229             if not self.context[id].mandatory:
     2229            if self.context[id].removable_by_student:
    22302230                del self.context[id]
    22312231                deleted.append(id)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studyleveleditpage.pt

    r9687 r9698  
    2727        <input type="checkbox" name="val_id"
    2828                  tal:attributes="value value/__name__"
    29         tal:condition="not: value/mandatory_bool" />
     29        tal:condition="value/removable_by_student" />
    3030      </td>
    3131      <td tal:content="value/semester">SEMESTER</td>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9690 r9698  
    535535    grade = Attribute('grade calculated from score')
    536536    weight = Attribute('weight calculated from score')
     537    removable_by_student = Attribute('Is student allowed to remove the ticket?')
    537538
    538539    title = schema.TextLine(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r9690 r9698  
    190190            return None
    191191
     192    @property
     193    def removable_by_student(self):
     194        return not self.mandatory
     195
    192196    def writeLogMessage(self, view, message):
    193197        return self.__parent__.__parent__.__parent__.writeLogMessage(view, message)
Note: See TracChangeset for help on using the changeset viewer.