Ignore:
Timestamp:
5 Jul 2012, 14:48:51 (13 years ago)
Author:
Henrik Bettermann
Message:

Rename course referrers to certificate courses (according to the discussion long time ago).

Edit some button labels and titles.

Move code from view to content components.

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

Legend:

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

    r8903 r8920  
    932932        ticket.automatic = False
    933933        ticket.carry_over = False
    934         ticket.code = course.code
    935         ticket.title = course.title
    936         ticket.fcode = course.__parent__.__parent__.__parent__.code
    937         ticket.dcode = course.__parent__.__parent__.code
    938         ticket.credits = course.credits
    939         ticket.passmark = course.passmark
    940         ticket.semester = course.semester
    941934        try:
    942             self.context.addCourseTicket(ticket)
     935            self.context.addCourseTicket(ticket, course)
    943936        except KeyError:
    944937            self.flash(_('The ticket exists.'))
     
    17841777        level_title = translate(self.context.level_title, 'waeup.kofa',
    17851778            target_language=lang)
    1786         return _('Add and remove course tickets of study level ${a}',
     1779        return _('Edit course list of ${a}',
    17871780            mapping = {'a':level_title})
    17881781
     
    18551848        ticket = createObject(u'waeup.CourseTicket')
    18561849        course = data['course']
    1857         for name in ['code', 'title', 'credits', 'passmark', 'semester']:
    1858             setattr(ticket, name, getattr(course, name))
    18591850        ticket.automatic = False
     1851        ticket.carry_over = False
    18601852        try:
    1861             self.context.addCourseTicket(ticket)
     1853            self.context.addCourseTicket(ticket, course)
    18621854        except KeyError:
    18631855            self.flash(_('The ticket exists.'))
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelpage.pt

    r8141 r8920  
    3434      <th i18n:translate="">Code</th>
    3535      <th i18n:translate="">Title</th>
    36       <th i18n:translate="">Dept.</th>
    37       <th i18n:translate="">Fact.</th>
     36      <th i18n:translate="">Dep.</th>
     37      <th i18n:translate="">Fac.</th>
    3838      <th i18n:translate="">Cred.</th>
    3939      <th i18n:translate="">Mand.</th>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r8854 r8920  
    402402        )
    403403
    404     def addCourseTicket(courseticket):
     404    def addCourseTicket(ticket, course):
    405405        """Add a course ticket object.
    406406        """
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r8736 r8920  
    5656        return studylevelsource.factory.getTitle(self.__parent__, self.level)
    5757
    58     def addCourseTicket(self, courseticket):
     58    def addCourseTicket(self, ticket, course):
    5959        """Add a course ticket object.
    6060        """
    61         if not ICourseTicket.providedBy(courseticket):
     61        if not ICourseTicket.providedBy(ticket):
    6262            raise TypeError(
    6363                'StudentStudyLeves contain only ICourseTicket instances')
    64         self[courseticket.code] = courseticket
     64        ticket.code = course.code
     65        ticket.title = course.title
     66        ticket.fcode = course.__parent__.__parent__.__parent__.code
     67        ticket.dcode = course.__parent__.__parent__.code
     68        ticket.credits = course.credits
     69        ticket.passmark = course.passmark
     70        ticket.semester = course.semester
     71        self[ticket.code] = ticket
    6572        return
    6673
     
    8794
    8895    A course ticket contains a copy of the original course and
    89     course referrer data. If the courses and/or their referrers are removed, the
    90     corresponding tickets remain unchanged. So we do not need any event
     96    certificate course data. If the courses and/or the referrin certificate
     97    courses are removed, the corresponding tickets remain unchanged.
     98    So we do not need any event
    9199    triggered actions on course tickets.
    92100    """
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r8888 r8920  
    218218        ticket.passmark = 100
    219219        ticket.semester = 2
    220         study_level.addCourseTicket(ticket)
     220        study_level[ticket.code] = ticket
    221221        self.add_payment(student)
    222222        return student
     
    688688        shutil.rmtree(os.path.dirname(fin_file))
    689689
    690         # Add course and course referrer
     690        # Add course and certificate course
    691691        self.course = createObject('waeup.Course')
    692692        self.course.code = 'COURSE1'
     
    696696        self.app['faculties']['fac1']['dep1'].courses.addCourse(
    697697            self.course)
    698         self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCourseRef(
     698        self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCertCourse(
    699699            self.course, level=100)
    700700
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8903 r8920  
    171171        self.app['faculties']['fac1']['dep1'].courses.addCourse(
    172172            self.course)
    173         self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCourseRef(
     173        self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCertCourse(
    174174            self.course, level=100)
    175175
     
    12401240        self.browser.getControl("Create course list now").click()
    12411241        self.browser.getLink("100").click()
    1242         self.browser.getLink("Add and remove courses").click()
     1242        self.browser.getLink("Edit course list").click()
    12431243        self.browser.getControl("Add course ticket").click()
    12441244        self.browser.getControl(name="form.course").value = ['COURSE1']
     
    12531253        self.browser.getControl("Create course list now").click()
    12541254        self.browser.getLink("200").click()
    1255         self.browser.getLink("Add and remove courses").click()
     1255        self.browser.getLink("Edit course list").click()
    12561256        self.browser.getControl("Add course ticket").click()
    12571257        self.browser.getControl(name="form.course").value = ['COURSE1']
     
    15211521        # The new SFE-0 pin can be used for starting new session
    15221522        self.browser.open(self.studycourse_path)
    1523         self.browser.getLink('Start session').click()
     1523        self.browser.getLink('Start new session').click()
    15241524        pin = self.app['accesscodes']['SFE-0'].keys()[0]
    15251525        parts = pin.split('-')[1:]
     
    15701570        # The new SFE-0 pin can be used for starting session
    15711571        self.browser.open(self.studycourse_path)
    1572         self.browser.getLink('Start session').click()
     1572        self.browser.getLink('Start new session').click()
    15731573        pin = self.app['accesscodes']['SFE-0'].keys()[0]
    15741574        parts = pin.split('-')[1:]
     
    16101610        # The new SFE-1 pin can be used for starting new session
    16111611        self.browser.open(self.studycourse_path)
    1612         self.browser.getLink('Start session').click()
     1612        self.browser.getLink('Start new session').click()
    16131613        self.browser.getControl(name="ac_series").value = sfeseries
    16141614        self.browser.getControl(name="ac_number").value = sfenumber
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py

    r8735 r8920  
    129129        studylevel = StudentStudyLevel()
    130130        self.assertRaises(
    131             TypeError, studylevel.addCourseTicket, department)
     131            TypeError, studylevel.addCourseTicket, department, department)
    132132
    133133    def test_booking_date(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r8903 r8920  
    445445    grok.require('waeup.handleStudent')
    446446    icon = 'actionicon_start.gif'
    447     text = _('Start session')
     447    text = _('Start new session')
    448448    target = 'start_session'
    449449
     
    477477    grok.view(StudyLevelDisplayFormPage)
    478478    grok.require('waeup.handleStudent')
    479     text = _('Add and remove courses')
     479    text = _('Edit course list')
    480480    target = 'edit'
    481481
Note: See TracChangeset for help on using the changeset viewer.