X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5f810b4b61f933cfe253bf6113283c4a264768b0..c381d6c41b2c6a0da6811525fb5a0fc5ea716975:/SL/Controller/TimeRecording.pm diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index db8d22646..e97c3c1d8 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -13,6 +13,7 @@ use SL::DB::Customer; use SL::DB::Employee; use SL::DB::Order; use SL::DB::Part; +use SL::DB::Project; use SL::DB::TimeRecording; use SL::DB::TimeRecordingArticle; use SL::Helper::Flash qw(flash); @@ -137,6 +138,22 @@ sub action_ajaj_get_order_info { $_[0]->render(\SL::JSON::to_json($data), { type => 'json', process => 0 }); } +sub action_ajaj_get_project_info { + + my $project = SL::DB::Project->new(id => $::form->{id})->load; + + my $data; + if ($project->customer_id) { + $data = { customer => { id => $project->customer_id, + value => $project->customer->displayable_name, + type => 'customer' + }, + }; + } + + $_[0]->render(\SL::JSON::to_json($data), { type => 'json', process => 0 }); +} + sub init_time_recording { my ($self) = @_;