Revision d6b56cbd
Von Bernd Bleßmann vor etwa 4 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
350 | 350 |
} |
351 | 351 |
|
352 | 352 |
# open the email dialog |
353 |
sub action_show_email_dialog { |
|
353 |
sub action_save_and_show_email_dialog {
|
|
354 | 354 |
my ($self) = @_; |
355 | 355 |
|
356 | 356 |
my $errors = $self->save(); |
... | ... | |
1884 | 1884 |
], |
1885 | 1885 |
action => [ |
1886 | 1886 |
t8('Save and E-mail'), |
1887 |
call => [ 'kivi.Order.email', $::instance_conf->get_order_warn_duplicate_parts ],
|
|
1887 |
call => [ 'kivi.Order.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts ],
|
|
1888 | 1888 |
], |
1889 | 1889 |
action => [ |
1890 | 1890 |
t8('Download attachments of all parts'), |
js/kivi.Order.js | ||
---|---|---|
28 | 28 |
} |
29 | 29 |
|
30 | 30 |
if (pos.length > 0) { |
31 |
question = question || kivi.t8("Do you really want to save?");
|
|
31 |
question = question || kivi.t8("Do you really want to continue?");
|
|
32 | 32 |
return confirm(kivi.t8("There are duplicate parts at positions") + "\n" |
33 | 33 |
+ pos.join(', ') + "\n" |
34 | 34 |
+ question); |
... | ... | |
89 | 89 |
$.post("controller.pl", data, kivi.eval_json_result); |
90 | 90 |
}; |
91 | 91 |
|
92 |
ns.email = function(warn_on_duplicates) { |
|
93 |
if (warn_on_duplicates && !ns.check_duplicate_parts(kivi.t8("Do you really want to send by mail?"))) return; |
|
94 |
if (!ns.check_cv()) return; |
|
95 |
|
|
96 |
var data = $('#order_form').serializeArray(); |
|
97 |
data.push({ name: 'order.language_id', value: $('#language_id').val() }); // language from print options |
|
98 |
data.push({ name: 'action', value: 'Order/show_email_dialog' }); |
|
99 |
|
|
100 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
101 |
}; |
|
102 |
|
|
103 | 92 |
var email_dialog; |
104 | 93 |
|
105 | 94 |
ns.setup_send_email_dialog = function() { |
Auch abrufbar als: Unified diff
Auftrags-Controller: Speichern und E-Mail-Dialog über vorhandene Funktion
Die js-Funktion email() tut praktisch das gleiche wie save(). Dann kann
auch diese benutzt werden.
Damit auch klar ist, dass vor dem Aufruf des E-Mail-Dialogs gespeichert
wird, ist die action im Controller umbenannt worden.