X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/3c22e5f4b953f463a33b722d6f4f122e4a20c99a..078bb016bca38979f722bf94b8a4d006f5b57077:/js/kivi.TimeRecording.js diff --git a/js/kivi.TimeRecording.js b/js/kivi.TimeRecording.js index cf5014905..f5cf3c841 100644 --- a/js/kivi.TimeRecording.js +++ b/js/kivi.TimeRecording.js @@ -19,4 +19,22 @@ namespace('kivi.TimeRecording', function(ns) { $time.val(kivi.format_time(date)); }; + ns.order_changed = function(value) { + if (!value) { + $('#time_recording_customer_id').data('customer_vendor_picker').set_item({}); + $('#time_recording_customer_id_name').prop('disabled', false); + $('#time_recording_project_id').data('project_picker').set_item({}); + $('#time_recording_project_id_name').prop('disabled', false); + return; + } + + var url = 'controller.pl?action=TimeRecording/ajaj_get_order_info&id='+ value; + $.getJSON(url, function(data) { + $('#time_recording_customer_id').data('customer_vendor_picker').set_item(data.customer); + $('#time_recording_customer_id_name').prop('disabled', true); + $('#time_recording_project_id').data('project_picker').set_item(data.project); + $('#time_recording_project_id_name').prop('disabled', true); + }); + }; + });