Changeset 2119 for WAeUP_SRP


Ignore:
Timestamp:
18 Aug 2007, 17:23:25 (17 years ago)
Author:
Henrik Bettermann
Message:

add logging messages
change storage location of passport picture
and more

Location:
WAeUP_SRP/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r2114 r2119  
    213213                    t_max = t_per
    214214                if t_per > 0.0 and t_per < t_min:
    215                     t_min = t_per                   
     215                    t_min = t_per
    216216                itf = 0.0
    217217                if found:
     
    220220                if not_found :
    221221                    itnf = time_not_found / not_found
    222                 interval_time = time_found + time_not_found 
    223                 s = "%(c)d: %(found)d/%(not_found)d " % vars() 
     222                interval_time = time_found + time_not_found
     223                s = "%(c)d: %(found)d/%(not_found)d " % vars()
    224224                s += "%(interval_time)6.2f %(itf)6.4f/%(itnf)6.4f " % vars()
    225225                s += "%(t_min)6.4f/%(t_max)6.4f" %  vars()
     
    241241            itnf = t_time_not_found / t_not_found
    242242        #c_elapse = time.clock() - c_elapse
    243         s = "%(probe)d: %(t_found)d/%(t_not_found)d " % vars() 
     243        s = "%(probe)d: %(t_found)d/%(t_not_found)d " % vars()
    244244        s += "%(elapse)6.2f %(itf)6.4f/%(itnf)6.4f " % vars()
    245245        s += "%(t_min)6.4f/%(t_max)6.4f" %  vars()
     
    687687    def showFsPicture(self,path):
    688688        """return a picture from the filesystem"""
    689         picture_path = "%s/var/%s" % (i_home,path)
     689        picture_path = "%s/import/%s" % (i_home,path)
    690690        if os.path.exists(picture_path):
    691691            return open(picture_path).read()
    692        
     692
    693693    ###)
    694694
  • WAeUP_SRP/trunk/Widgets.py

    r2117 r2119  
    13891389                if self.isStudent():
    13901390                    err = "This is only for Pume application."
    1391                     s_logger.info('%s/%s applied for PUME with PIN %s' % (s_id,ref,pin_str))
     1391                    s_logger.info('%s/%s applied for screening test with PIN %s' % (s_id,ref,pin_str))
    13921392                    break
    13931393                else:
     
    14001400                        getattr(self,self.catalog).modifyRecord(**d)
    14011401                    elif applicant.pin != pin_str:
    1402                         s_logger.info('%s/%s repeatedly applied for PUME with different PIN %s' % (s_id,ref,pin_str))
     1402                        s_logger.info('%s/%s tried to enter application record with different PIN %s' % (s_id,ref,pin_str))
    14031403                    elif applicant.pin == pin_str:
    1404                         s_logger.info('%s/%s repeatedly applied for PUME with PIN %s' % (s_id,ref,pin_str))
     1404                        s_logger.info('%s/%s repeatedly entered application record with PIN %s' % (s_id,ref,pin_str))
    14051405            break
    14061406        if err:
     
    14911491    )
    14921492    path = "images"
    1493     storage_path = "%s/var/%s" % (i_home,path)
     1493    storage_path = "%s/import/%s" % (i_home,path)
    14941494    id_field = "reg_no"
    14951495
     
    15581558            mimetype = ''
    15591559            last_modified = ''
     1560            height = ''
     1561            width = ''
     1562           
    15601563        else:
    15611564            image = open(file_path)
     
    15701573            mimetype, width, height = gia(data)
    15711574            #import pdb;pdb.set_trace()
    1572            
     1575
    15731576            if width < 0:
    15741577                width = None
  • WAeUP_SRP/trunk/profiles/default/layouts/application.xml

    r2117 r2119  
    325325  </widget>
    326326  <widget name="passport" meta_type="No Zodb Image Widget">
    327     <property name="title">Passport</property>
     327    <property name="title">Passport Photograph</property>
    328328    <property name="fields">
    329329      <element value="passport"/>
    330330    </property>
    331331    <property name="is_required">False</property>
    332     <property name="label">Passport</property>
    333     <property name="label_edit">Passport</property>
    334     <property name="readonly_layout_modes"/>
    335     <property name="hidden_layout_modes">
    336       <element value="create"/>
    337     </property>
    338     <property name="hidden_readonly_layout_modes"/>
    339     <property name="size_max">50000</property>
     332    <property name="label">Passport Photograph</property>
     333    <property name="label_edit">Passport Photograph</property>
     334    <property name="readonly_layout_modes"/>
     335    <property name="hidden_layout_modes">
     336      <element value="create"/>
     337    </property>
     338    <property name="hidden_readonly_layout_modes"/>
     339    <property name="size_max">20000</property>
    340340    <property name="display_external_editor">False</property>
    341341    <property name="display_width">100</property>
    342     <property name="display_height">200</property>
     342    <property name="display_height">150</property>
    343343  </widget>
    344344  <widget name="phone" meta_type="String Widget">
  • WAeUP_SRP/trunk/skins/waeup_default/widget_passport_render.pt

    r2114 r2119  
    3636        <metal:block fill-slot="change_file">
    3737          <input type="file" name="." size="24"
    38                  tal:attributes="name name;
    39                  onclick string:document.getElementById('${radio_name}_change').checked='checked'"
    40                  />
     38                 tal:attributes="name name;"/>
    4139          <tal:block condition="python:1">
    4240            <input type="hidden" value="img_auto_size"
  • WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py

    r2114 r2119  
    1919
    2020import DateTime
     21import logging
     22logger = logging.getLogger('Skins.apply_pume')
     23
    2124current = DateTime.DateTime()
    2225pr = context.portal_registration
     
    5558            submitted = True
    5659        if not create and pin != object['pin']:
     60            logger.info('%s entered wrong pin %s' % (reg_no,pin))
    5761            return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    5862if slip:
    5963    mode = "view_slip"
     64    logger.info('%s views application slip' % (reg_no))
     65   
    6066res,psm,ds = lt.renderLayout(layout_id= 'application',
    6167                             schema_id= 'application',
     
    101107        mode = "view"
    102108        psm = "The form has already been submitted and you are not allowed to resubmit the data!"
     109        logger.info('%s tried to resubmit application record' % (reg_no))
    103110        res,psm_dummy,ds_dummy = lt.renderLayout(layout_id= 'application',
    104111                                schema_id= 'application',
     
    112119        mode = "edit"
    113120        psm = "Please confirm Passport Photograph!"
     121        logger.info('%s tried to submit without ticking confirmation check box' % (reg_no))
    114122    else:
    115123        mode = "view"
     
    118126        data['status'] = "submitted"
    119127        context.applicants_catalog.modifyRecord(**data)
     128        logger.info('%s modified and submitted application record' % (reg_no))
    120129        res,psm_dummy,ds = lt.renderLayout(layout_id= 'application',
    121130                                schema_id= 'application',
     
    129138    if submitted:
    130139        mode = "view"
     140        logger.info('%s views application record' % (reg_no))
    131141    else:
    132142        mode = "edit"
     143        logger.info('%s edits application process' % (reg_no))
    133144    psm = ""
    134145    #set_trace()
     
    147158        mode = "view"
    148159        psm = "The form has already been submitted and you are not allowed to modify the data!"
     160        logger.info('%s tried to edit submitted application record' % (reg_no))
    149161        res,psm_dummy,ds_dummy = lt.renderLayout(layout_id= 'application',
    150162                                schema_id= 'application',
     
    160172        data['status'] = "edited"
    161173        context.applicants_catalog.modifyRecord(**data)
     174        logger.info('%s modified application record' % (reg_no))
    162175
    163176
  • WAeUP_SRP/trunk/skins/waeup_student/apply_pume_slip.pt

    r2109 r2119  
    1313        <br />
    1414        <div tal:replace="structure rendered_main" />
    15         Please ensure that you come to the screening venus with a copy of this slip.
     15        Please check for your screening venue at any of the UNIBEN entry gates or
     16        at the Sports Complex and come to the screening venue with a copy of this slip. 
    1617      </metal:block>
    1718    </metal:block>
Note: See TracChangeset for help on using the changeset viewer.