Revision d6b56cbd
Von Bernd Bleßmann vor fast 5 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
}
|
||
|
||
# open the email dialog
|
||
sub action_show_email_dialog {
|
||
sub action_save_and_show_email_dialog {
|
||
my ($self) = @_;
|
||
|
||
my $errors = $self->save();
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and E-mail'),
|
||
call => [ 'kivi.Order.email', $::instance_conf->get_order_warn_duplicate_parts ],
|
||
call => [ 'kivi.Order.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts ],
|
||
],
|
||
action => [
|
||
t8('Download attachments of all parts'),
|
js/kivi.Order.js | ||
---|---|---|
}
|
||
|
||
if (pos.length > 0) {
|
||
question = question || kivi.t8("Do you really want to save?");
|
||
question = question || kivi.t8("Do you really want to continue?");
|
||
return confirm(kivi.t8("There are duplicate parts at positions") + "\n"
|
||
+ pos.join(', ') + "\n"
|
||
+ question);
|
||
... | ... | |
$.post("controller.pl", data, kivi.eval_json_result);
|
||
};
|
||
|
||
ns.email = function(warn_on_duplicates) {
|
||
if (warn_on_duplicates && !ns.check_duplicate_parts(kivi.t8("Do you really want to send by mail?"))) return;
|
||
if (!ns.check_cv()) return;
|
||
|
||
var data = $('#order_form').serializeArray();
|
||
data.push({ name: 'order.language_id', value: $('#language_id').val() }); // language from print options
|
||
data.push({ name: 'action', value: 'Order/show_email_dialog' });
|
||
|
||
$.post("controller.pl", data, kivi.eval_json_result);
|
||
};
|
||
|
||
var email_dialog;
|
||
|
||
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.