Changeset 9804


Ignore:
Timestamp:
16 Dec 2012, 15:37:10 (12 years ago)
Author:
uli
Message:

Provide all student exporters in department-local exports.

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

Legend:

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

    r9803 r9804  
    6868    )
    6969from waeup.kofa.students.catalog import search, StudentsQuery
     70from waeup.kofa.students.export import EXPORTER_NAMES
    7071from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket
    7172from waeup.kofa.students.vocabularies import StudyLevelSource
     
    25362537            return
    25372538        if DISCARD and job_id:
    2538             print "DISCARD: ", job_id
    25392539            entry = self.context.entry_from_job_id(job_id)
    25402540            self.context.delete_export_entry(entry)
     
    25742574        return
    25752575
    2576     def update(self, START=None, session=None, level=None, mode=None):
     2576    def _set_exporter_values(self):
     2577        # We provide all student exporters, nothing else, yet.
     2578        exporters = []
     2579        for name in EXPORTER_NAMES:
     2580            util = getUtility(ICSVExporter, name=name)
     2581            exporters.append((util.title, name),)
     2582        self.exporters = exporters
     2583
     2584    def update(self, START=None, session=None, level=None, mode=None,
     2585               exporter=None):
    25772586        self._set_session_values()
    25782587        self._set_level_values()
    25792588        self._set_mode_values()
     2589        self._set_exporter_values()
    25802590        if START is None:
    25812591            return
     
    25872597            mode = None
    25882598        code = self.context.__parent__.code
    2589         self.context.start_export_job('students', self.request.principal.id,
     2599        self.context.start_export_job(exporter, self.request.principal.id,
    25902600                                      current_session=session,
    25912601                                      current_level=level,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportjobsjobconfig.pt

    r9803 r9804  
    3535  </select>
    3636  <br />
     37  <label for="mode" class="span2">
     38    Exporter
     39  </label>
     40  &nbsp;
     41  <select name="exporter">
     42    <option tal:repeat="item view/exporters"
     43            tal:attributes="value python:item[1]">
     44      <span tal:replace="python: item[0]">Students</span>
     45    </option>
     46  </select>
     47  <br />
    3748  <hr />
    3849  <input type="submit" name="START" value="Create"
Note: See TracChangeset for help on using the changeset viewer.