Changeset 780


Ignore:
Timestamp:
2 Nov 2006, 10:56:46 (18 years ago)
Author:
joachim
Message:

view PUME result finalized,
export of PINs started

Location:
WAeUP_SRP/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r775 r780  
    334334            app.getContent().edit(mapping=da)
    335335            app.manage_setLocalRoles(sid, ['Owner',])
     336            #wftool.doActionFor(app,'close')
    336337            dp_fields = (
    337338                         'pume_eng_score',
     
    343344            pume = student.pume
    344345            pume.getContent().edit(mapping=dp)
    345             wftool.doActionFor(pume,'close',dest_container=app)
     346            #wftool.doActionFor(pume,'close')
    346347            pume.manage_setLocalRoles(sid, ['Owner',])
    347348            student.getContent().createSubObjects()
    348349            if dp['pume_tot_score']>49:
    349                 wftool.doActionFor(student,'pume_pass',dest_container=student)
     350                wftool.doActionFor(student,'pume_pass')
    350351            else:
    351                 wftool.doActionFor(student,'pume_fail',dest_container=student)
     352                wftool.doActionFor(student,'pume_fail')
    352353            if len(no_import) > 1:
    353354                open("%s/import/%s_not_imported.csv" % (i_home,name),"w").write(
  • WAeUP_SRP/trunk/WAeUPTables.py

    r710 r780  
    2121from Globals import InitializeClass
    2222from Products.ZCatalog.ZCatalog import ZCatalog
     23from AccessControl import ClassSecurityInfo
     24from Products.CMFCore.permissions import ModifyPortalContent
     25
     26import DateTime
     27import csv,re
     28import logging
     29import Globals
     30p_home = Globals.package_home(globals())
     31i_home = Globals.INSTANCE_HOME
    2332
    2433from interfaces import IWAeUPTable
     
    3746   
    3847    implements(IWAeUPTable)
     48    security = ClassSecurityInfo()
    3949       
    4050    def addRecord(self, **data):
     
    7181        self.catalog_object(dict2ob(record_data), uid)
    7282
     83    security.declareProtected(ModifyPortalContent,"exportAllRecords")
     84    def exportAllRecords(self):
     85        "export a WAeUPTable"
     86        #import pdb;pdb.set_trace()
     87        fields = [field for field in self.schema()]
     88        format = ','.join(['"%%(%s)s"' % fn for fn in fields])
     89        csv = []
     90        csv.append(','.join(['"%s"' % fn for fn in fields]))
     91        for uid in self._catalog.uids:
     92            records = self.searchResults({"%s" % self.key : uid})
     93            if len(records) > 1:
     94                # Can not happen, but anyway...
     95                raise ValueError("More than one record with uid %s" % uid)
     96            if len(records) == 0:
     97                raise KeyError("No record for uid %s" % uid)
     98            rec = records[0]
     99            csv.append(format % rec)
     100        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
     101        open("%s/import/%s-%s.csv" % (i_home,self.getId(),current),"w+").write('\n'.join(csv))
     102       
     103           
    73104class AccommodationTable(WAeUPTable):
    74105   
  • WAeUP_SRP/trunk/Widgets.py

    r777 r780  
    304304                if s is None:
    305305                    err = 'No Student with JAMB-Reg-No %s' % (value)
    306                 s_id = s.getId()
    307                 datastructure['s_id'] = s_id
     306                else:
     307                    s_id = s.getId()
     308                    datastructure['s_id'] = s_id
    308309            if err:
    309310                datastructure.setError(widget_id, err)
  • WAeUP_SRP/trunk/profiles/default/actionicons.xml

    r766 r780  
    238238              title="Logout" priority="1"
    239239              icon_expr="actionicon_logout.png"/>
    240  <action-icon category="student" action_id="apply_admission"
    241               title="Apply for PUME" priority="2"
     240 <action-icon category="student" action_id="display_pume_result"
     241              title="Display PUME Result" priority="2"
    242242              icon_expr="bell.png"/>
    243243 <action-icon category="student" action_id="request_clearance"
  • WAeUP_SRP/trunk/profiles/default/actions.xml

    r766 r780  
    132132  <action title="  " action_id="dummy2" category="object" condition_expr=""
    133133     url_expr="" visible="True"/>
    134   <action title="Apply for PUME" action_id="apply_admission"
     134  <action title="View PUME-Results" action_id="display_pume_result"
    135135     category="student" condition_expr="not:member"
    136      url_expr="string:${portal_url}/apply_admission"
     136     url_expr="string:${portal_url}/display_pume_result"
    137137     visible="True">
    138138   <permission>View</permission>
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml

    r770 r780  
    3333  </permission-map>
    3434  <permission-map name="View" acquired="True">
     35   <permission-role>Anonymous</permission-role>
    3536  </permission-map>
    3637  <permission-map name="WAeUPModify own content"
  • WAeUP_SRP/trunk/skins/waeup_student/pume_anon_slip.pt

    r779 r780  
    33  <metal:body use-macro="here/main_template/macros/master">
    44    <metal:main fill-slot="main">
    5       <h3>PUME Result Slip</h3>
     5      <h3>PUME Results of <span tal:content="app_doc/jamb_firstname" />
     6                            <span tal:content="app_doc/jamb_lastname" /></h3>
     7
    68      <br />
    79      <span tal:omit-tag=""
Note: See TracChangeset for help on using the changeset viewer.