Changeset 4649 in subversion


Ignore:
Timestamp:
Apr 12, 2011 2:05:36 PM (2 years ago)
Author:
thomasb
Message:

Keep all submitted data if contact form validation fails (#1487865)

Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r4647 r4649  
    22=========================== 
    33 
     4- Keep all submitted data if contact form validation fails (#1487865) 
     5- Handle uncode strings in rcube_addressbook::normalize_string() (#1487866) 
    46- Fix bug where template name without plugin prefix was used in render_page hook 
    57- Fix handling of debug_level=4 in ajax requests (#1487831) 
  • trunk/roundcubemail/program/steps/addressbook/edit.inc

    r4499 r4649  
    3232 
    3333 
     34function rcmail_get_edit_record() 
     35{ 
     36    global $RCMAIL, $CONTACTS; 
     37 
     38     // check if we have a valid result 
     39     if ($GLOBALS['EDIT_RECORD']) { 
     40         $record = $GLOBALS['EDIT_RECORD']; 
     41     } 
     42     else if ($RCMAIL->action != 'add' 
     43         && !(($result = $CONTACTS->get_result()) && ($record = $result->first())) 
     44     ) { 
     45         $RCMAIL->output->show_message('contactnotfound'); 
     46         return false; 
     47     } 
     48      
     49     return $record; 
     50} 
     51 
    3452function rcmail_contact_edithead($attrib) 
    3553{ 
    36    global $RCMAIL, $CONTACTS; 
    37  
    3854    // check if we have a valid result 
    39     if ($RCMAIL->action != 'add' 
    40         && !(($result = $CONTACTS->get_result()) && ($record = $result->first())) 
    41     ) { 
    42         $RCMAIL->output->show_message('contactnotfound'); 
    43         return false; 
    44     } 
    45      
     55    $record = rcmail_get_edit_record(); 
    4656    $i_size = !empty($attrib['size']) ? $attrib['size'] : 20; 
    4757 
     
    7585function rcmail_contact_editform($attrib) 
    7686{ 
    77    global $RCMAIL, $CONTACTS, $CONTACT_COLTYPES; 
    78  
    79     // check if we have a valid result 
    80     if ($RCMAIL->action != 'add' 
    81         && !(($result = $CONTACTS->get_result()) && ($record = $result->first())) 
    82     ) { 
    83         $RCMAIL->output->show_message('contactnotfound'); 
    84         return false; 
    85     } 
     87    global $RCMAIL, $CONTACT_COLTYPES; 
     88 
     89    $record = rcmail_get_edit_record(); 
    8690 
    8791    // add some labels to client 
  • trunk/roundcubemail/program/steps/addressbook/save.inc

    r4604 r4649  
    140140    $err = (array)$CONTACTS->get_error() + array('message' => 'formincomplete', 'type' => 'warning'); 
    141141    $OUTPUT->show_message($err['message'], $err['type']); 
     142    $GLOBALS['EDIT_RECORD'] = $a_record;  // store submitted data to be used in edit form 
    142143    rcmail_overwrite_action($return_action); 
    143144    return; 
Note: See TracChangeset for help on using the changeset viewer.