Revision abafb475
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
197 | 197 |
: ''; |
198 | 198 |
flash_later('info', $text); |
199 | 199 |
|
200 |
my @redirect_params = ( |
|
201 |
action => 'edit', |
|
202 |
type => $self->type, |
|
203 |
id => $self->order->id, |
|
204 |
); |
|
200 |
my @redirect_params; |
|
201 |
if ($::form->{back_to_caller}) { |
|
202 |
@redirect_params = $::form->{callback} ? ($::form->{callback}) |
|
203 |
: (controller => 'LoginScreen', action => 'user_login'); |
|
204 |
|
|
205 |
} else { |
|
206 |
@redirect_params = ( |
|
207 |
action => 'edit', |
|
208 |
type => $self->type, |
|
209 |
id => $self->order->id, |
|
210 |
callback => $::form->{callback}, |
|
211 |
); |
|
212 |
} |
|
205 | 213 |
|
206 | 214 |
$self->redirect_to(@redirect_params); |
207 | 215 |
} |
... | ... | |
2055 | 2063 |
], |
2056 | 2064 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
2057 | 2065 |
], |
2066 |
action => [ |
|
2067 |
t8('Save and Close'), |
|
2068 |
call => [ 'kivi.Order.save', 'save', $::instance_conf->get_order_warn_duplicate_parts, |
|
2069 |
$::instance_conf->get_order_warn_no_deliverydate, |
|
2070 |
1 |
|
2071 |
], |
|
2072 |
checks => [ 'kivi.Order.check_save_active_periodic_invoices', ['kivi.validate_form','#order_form'], |
|
2073 |
@req_trans_cost_art, @req_cusordnumber, |
|
2074 |
], |
|
2075 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
|
2076 |
], |
|
2058 | 2077 |
action => [ |
2059 | 2078 |
t8('Save as new'), |
2060 | 2079 |
call => [ 'kivi.Order.save', 'save_as_new', $::instance_conf->get_order_warn_duplicate_parts ], |
js/kivi.Order.js | ||
---|---|---|
45 | 45 |
} |
46 | 46 |
}; |
47 | 47 |
|
48 |
ns.save = function(action, warn_on_duplicates, warn_on_reqdate) { |
|
48 |
ns.save = function(action, warn_on_duplicates, warn_on_reqdate, back_to_caller) {
|
|
49 | 49 |
if (!ns.check_cv()) return; |
50 | 50 |
if (warn_on_duplicates && !ns.check_duplicate_parts()) return; |
51 | 51 |
if (warn_on_reqdate && !ns.check_valid_reqdate()) return; |
... | ... | |
53 | 53 |
var data = $('#order_form').serializeArray(); |
54 | 54 |
data.push({ name: 'action', value: 'Order/' + action }); |
55 | 55 |
|
56 |
if (back_to_caller) data.push({ name: 'back_to_caller', value: '1' }); |
|
57 |
|
|
56 | 58 |
$.post("controller.pl", data, kivi.eval_json_result); |
57 | 59 |
}; |
58 | 60 |
|
Auch abrufbar als: Unified diff
Auftrags-Controller: Speichern und schließen, …
… was einen zurück zur voherigen Ansicht bringt