Revision 454d4b8f
Von Bernd Bleßmann vor etwa 9 Jahren hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
113 | 113 |
sub _save { |
114 | 114 |
my ($self) = @_; |
115 | 115 |
|
116 |
my @errors = $self->{cv}->validate; |
|
117 |
if (@errors) { |
|
118 |
flash('error', @errors); |
|
119 |
$self->_pre_render(); |
|
120 |
$self->render( |
|
121 |
'customer_vendor/form', |
|
122 |
title => ($self->is_vendor() ? t8('Edit Vendor') : t8('Edit Customer')), |
|
123 |
%{$self->{template_args}} |
|
124 |
); |
|
125 |
::end_of_request(); |
|
126 |
} |
|
127 |
|
|
116 | 128 |
my $db = $self->{cv}->db; |
117 | 129 |
|
118 | 130 |
$db->do_transaction(sub { |
... | ... | |
193 | 205 |
sub action_save { |
194 | 206 |
my ($self) = @_; |
195 | 207 |
|
196 |
if (!$self->{cv}->name) { |
|
197 |
flash('error', t8('Customer missing!')); |
|
198 |
$self->_pre_render(); |
|
199 |
$self->render( |
|
200 |
'customer_vendor/form', |
|
201 |
title => ($self->is_vendor() ? t8('Edit Vendor') : t8('Edit Customer')), |
|
202 |
%{$self->{template_args}} |
|
203 |
); |
|
204 |
} else { |
|
205 |
|
|
206 |
$self->_save(); |
|
207 |
|
|
208 |
my @redirect_params = ( |
|
209 |
action => 'edit', |
|
210 |
id => $self->{cv}->id, |
|
211 |
db => ($self->is_vendor() ? 'vendor' : 'customer'), |
|
212 |
); |
|
208 |
$self->_save(); |
|
213 | 209 |
|
214 |
if ( $self->{contact}->cp_id ) { |
|
215 |
push(@redirect_params, contact_id => $self->{contact}->cp_id); |
|
216 |
} |
|
210 |
my @redirect_params = ( |
|
211 |
action => 'edit', |
|
212 |
id => $self->{cv}->id, |
|
213 |
db => ($self->is_vendor() ? 'vendor' : 'customer'), |
|
214 |
); |
|
217 | 215 |
|
218 |
if ( $self->{shipto}->shipto_id ) {
|
|
219 |
push(@redirect_params, shipto_id => $self->{shipto}->shipto_id);
|
|
220 |
}
|
|
216 |
if ( $self->{contact}->cp_id ) {
|
|
217 |
push(@redirect_params, contact_id => $self->{contact}->cp_id);
|
|
218 |
} |
|
221 | 219 |
|
222 |
$self->redirect_to(@redirect_params); |
|
220 |
if ( $self->{shipto}->shipto_id ) { |
|
221 |
push(@redirect_params, shipto_id => $self->{shipto}->shipto_id); |
|
223 | 222 |
} |
223 |
|
|
224 |
$self->redirect_to(@redirect_params); |
|
224 | 225 |
} |
225 | 226 |
|
226 | 227 |
sub action_save_and_close { |
SL/DB/Customer.pm | ||
---|---|---|
41 | 41 |
return 1; |
42 | 42 |
} |
43 | 43 |
|
44 |
sub validate { |
|
45 |
my ($self) = @_; |
|
46 |
|
|
47 |
my @errors; |
|
48 |
push @errors, $::locale->text('The customer name is missing.') if !$self->name; |
|
49 |
|
|
50 |
return @errors; |
|
51 |
} |
|
52 |
|
|
44 | 53 |
sub short_address { |
45 | 54 |
my ($self) = @_; |
46 | 55 |
|
SL/DB/Vendor.pm | ||
---|---|---|
41 | 41 |
return 1; |
42 | 42 |
} |
43 | 43 |
|
44 |
sub validate { |
|
45 |
my ($self) = @_; |
|
46 |
|
|
47 |
my @errors; |
|
48 |
push @errors, $::locale->text('The vendor name is missing.') if !$self->name; |
|
49 |
|
|
50 |
return @errors; |
|
51 |
} |
|
52 |
|
|
44 | 53 |
sub displayable_name { |
45 | 54 |
my $self = shift; |
46 | 55 |
|
locale/de/all | ||
---|---|---|
2702 | 2702 |
'The custom variable has been deleted.' => 'Die benutzerdefinierte Variable wurde gelöscht.', |
2703 | 2703 |
'The custom variable has been saved.' => 'Die benutzerdefinierte Variable wurde gespeichert.', |
2704 | 2704 |
'The custom variable is in use and cannot be deleted.' => 'Die benutzerdefinierte Variable ist in Benutzung und kann nicht gelöscht werden.', |
2705 |
'The customer name is missing.' => 'Der Kundenname fehlt.', |
|
2705 | 2706 |
'The database for user management and authentication does not exist. You can create let kivitendo create it with the following parameters:' => 'Die Datenbank für die Benutzeranmeldung existiert nicht. Sie können Sie von kivitendo automatisch mit den folgenden Parametern anlegen lassen:', |
2706 | 2707 |
'The database host is missing.' => 'Der Datenbankhost fehlt.', |
2707 | 2708 |
'The database name is missing.' => 'Der Datenbankname fehlt.', |
... | ... | |
2896 | 2897 |
'The user has been deleted.' => 'Der Benutzer wurde gelöscht.', |
2897 | 2898 |
'The user has been saved.' => 'Der Benutzer wurde gespeichert.', |
2898 | 2899 |
'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' => 'Der Variablenname darf nur aus Zeichen (keine Umlaute), Ziffern und Unterstrichen bestehen. Er muss mit einem Buchstaben beginnen. Beispiel: weihnachtsgruss_verschicken', |
2900 |
'The vendor name is missing.' => 'Der Liefeantenname fehlt.', |
|
2899 | 2901 |
'The version number is missing.' => 'Die Versionsnummer fehlt.', |
2900 | 2902 |
'The warehouse could not be deleted because it has already been used.' => 'Das Lager konnte nicht gelöscht werden, da es bereits in Benutzung war.', |
2901 | 2903 |
'The warehouse does not contain any bins.' => 'Das Lager enthält keine Lagerplätze.', |
locale/en/all | ||
---|---|---|
2135 | 2135 |
'The custom variable has been deleted.' => '', |
2136 | 2136 |
'The custom variable has been saved.' => '', |
2137 | 2137 |
'The custom variable is in use and cannot be deleted.' => '', |
2138 |
'The customer name is missing.' => '', |
|
2138 | 2139 |
'The database for user management and authentication does not exist. You can create let kivitendo create it with the following parameters:' => '', |
2139 | 2140 |
'The database host is missing.' => '', |
2140 | 2141 |
'The database name is missing.' => '', |
... | ... | |
2271 | 2272 |
'The user has been deleted.' => '', |
2272 | 2273 |
'The user has been saved.' => '', |
2273 | 2274 |
'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' => '', |
2275 |
'The vendor name is missing.' => '', |
|
2274 | 2276 |
'The warehouse could not be deleted because it has already been used.' => '', |
2275 | 2277 |
'The warehouse does not contain any bins.' => '', |
2276 | 2278 |
'The warehouse or the bin is missing.' => '', |
Auch abrufbar als: Unified diff
Beim jedem Speichern von Kunden/Lieferanten prüfen, ob der Name angegeben ist.
Vorher wurde das nur beim reinen Speichern geprüft, nicht beim Speichern und
Schließen oder Fortfahren mit einem Beleg.
Behebt #84 (redmine).