diff options
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/edit/access_user.html | 2 | ||||
| -rw-r--r-- | httemplate/edit/process/access_user.html | 1 | ||||
| -rw-r--r-- | httemplate/edit/process/elements/process.html | 9 | 
3 files changed, 11 insertions, 1 deletions
| diff --git a/httemplate/edit/access_user.html b/httemplate/edit/access_user.html index a8cb341e6..065e60c4b 100644 --- a/httemplate/edit/access_user.html +++ b/httemplate/edit/access_user.html @@ -19,7 +19,7 @@                                 'disabled'  => 'Disable employee',                               },                   'edit_callback' => sub { my( $c, $o ) = @_;  -                                          $o->set('_password2', $o->_password); +                                          $o->set('_password', '');                                          },                   'viewall_dir' => 'browse',                   'html_bottom' => diff --git a/httemplate/edit/process/access_user.html b/httemplate/edit/process/access_user.html index ebbcdca17..7aab79954 100644 --- a/httemplate/edit/process/access_user.html +++ b/httemplate/edit/process/access_user.html @@ -5,6 +5,7 @@  <%   include( 'elements/process.html',                   'table'       => 'access_user',                   'viewall_dir' => 'browse', +                 'copy_on_empty' => [ '_password' ],                   'process_m2m' => { 'link_table'   => 'access_usergroup',                                      'target_table' => 'access_group',                                    }, diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 4b1d2c840..5d40bba50 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -24,6 +24,8 @@  %  # 'edit_ext' => 'html', #defaults to 'html', you might want 'cgi' while the  %  #                       #naming is still inconsistent  %  #  +%  # 'copy_on_empty' => [ old_field_name, another_old_field, ... ], +%  #   %  # 'process_m2m' => { 'link_table'   => 'link_table_name',  %  #                    'target_table' => 'target_table_name',  %  #                  }, @@ -55,6 +57,13 @@  %    } @$fields  %  } );  % +%  if ($old && scalar($opt{'copy_on_empty'})) { +%    foreach my $field (@{$opt{'copy_on_empty'}}) { +%      $new->set($field, $old->get($field)) +%        unless scalar($cgi->param($field)); +%    } +%  } +%  %  my $error;  %  if ( $pkeyvalue ) {  %    $error = $new->replace($old); | 
