Ignore:
Timestamp:
10 Mar 2008, 19:12:40 (17 years ago)
Author:
joachim
Message:

show all fields for editing with value from first record,
show one line per field for better readability
add edit again button for importable files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_upload/uploads_index.py

    r3313 r3314  
    2929
    3030path_info = request.get('PATH_INFO').split('/')
    31 NO_KEY = '----'
    3231info = {}
    3332info['action'] = "%s" % context.absolute_url()
     
    4746        msg, invalid_keys = doc['checkKeys']()
    4847        new_keys = []
    49         for key in invalid_keys:
    50             id_key = "%s|%s" % (short_id,key)
     48        for old_key,previous,value in invalid_keys:
     49            id_key = "%s|%s" % (short_id,old_key)
    5150            if request.form.has_key(id_key):
    5251                new_key = request.form.get(id_key)['valid_key']
    53                 if new_key != NO_KEY:
    54                     new_keys += (key,new_key),
     52                if new_key != old_key and new_key != doc.NO_KEY:
     53                    new_keys += (old_key,new_key),
    5554        if new_keys:
    5655            doc.editHeadline(new_keys)
    5756            for key in new_keys:
    5857                logger.info('%s changed column heading in file %s from %s to %s' % (member,long_id,key[0],key[1]))
     58    return request.RESPONSE.redirect(context.absolute_url())
    5959
    6060wrong = []
     
    6666    doc = upload.getContent()
    6767    row['valid_keys'] = doc['getKeys']()
    68     row['valid_keys'][0] = NO_KEY
     68    row['valid_keys'][0:0] = doc.NO_KEY,
    6969    row['id'] = id.replace('.csv','')
    7070    row['title'] = doc.filename
     
    7575    if import_message:
    7676        row['imported'] = True
     77        row['imported_by'] = getattr('doc','imported_by','')
    7778        row['msg'] = import_message
    7879        if getattr(doc,'import_date',''):
     
    8384    else:
    8485        row['msg'],row['invalid_keys'] = doc['checkKeys']()
    85         if not row['msg'] and not row['invalid_keys']:
     86        if not (request.has_key('goto_edit') and id in ids) and not row['msg']:
    8687            add_to = importable
    8788    row['filename'] = doc.filename
    8889    row['import_layout'] = doc.import_layout
     90    row['uploaded_by'] =  doc.uploaded_by
    8991    row['upload_date'] =  doc.upload_date.strftime("%d/%m/%y %H:%M:%S")
    90     row['uploaded_by'] = doc.uploaded_by
    9192    row['imported_by'] = doc.imported_by
    9293    add_to.append(row)
Note: See TracChangeset for help on using the changeset viewer.