Revision c77287d8
Von Sven Schöling vor fast 11 Jahren hinzugefügt
SL/Controller/Project.pm | ||
---|---|---|
126 | 126 |
$params{ALL_CUSTOMERS} = SL::DB::Manager::Customer->get_all_sorted(where => [ or => [ obsolete => 0, obsolete => undef, id => $self->project->customer_id ]]); |
127 | 127 |
$params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted; |
128 | 128 |
$params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'Projects', trans_id => $self->project->id); |
129 |
|
|
130 |
if ($params{keep_cvars}) { |
|
131 |
for my $cvar (@{ $params{CUSTOM_VARIABLES} }) { |
|
132 |
$cvar->{value} = $::form->{"cvar_$cvar->{name}"} if $::form->{"cvar_$cvar->{name}"}; |
|
133 |
} |
|
134 |
} |
|
135 |
|
|
129 | 136 |
CVar->render_inputs(variables => $params{CUSTOM_VARIABLES}) if @{ $params{CUSTOM_VARIABLES} }; |
130 | 137 |
|
131 | 138 |
$self->render('project/form', %params); |
... | ... | |
144 | 151 |
if (@errors) { |
145 | 152 |
flash('error', @errors); |
146 | 153 |
$self->display_form(title => $is_new ? $::locale->text('Create a new project') : $::locale->text('Edit project'), |
147 |
callback => $::form->{callback}); |
|
154 |
callback => $::form->{callback}, |
|
155 |
keep_cvars => 1); |
|
148 | 156 |
return; |
149 | 157 |
} |
150 | 158 |
|
Auch abrufbar als: Unified diff
Projekte: CustomVariablen bei error nicht verlieren
behebt #2421