X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FFU.pm;h=b1eaf005a65dde215dff337a510fbe7ce9a3657c;hb=a0b82b1e7a9fab32f162ebee5031913b2f44ed5a;hp=b98687f3e69c3096b32a557ead6f109dbf75f14e;hpb=9d17d16c39e6514243ee1ee71e9be8502331e0f2;p=kivitendo-erp.git diff --git a/SL/FU.pm b/SL/FU.pm index b98687f3e..b1eaf005a 100644 --- a/SL/FU.pm +++ b/SL/FU.pm @@ -81,7 +81,8 @@ sub finish { SL::DB->client->with_transaction(sub { do_query($form, SL::DB->client->dbh, qq|UPDATE follow_ups SET done = TRUE WHERE id = ?|, conv_i($params{id})); - }); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); } @@ -105,7 +106,8 @@ sub delete { do_query($form, $dbh, qq|DELETE FROM follow_up_links WHERE follow_up_id = ?|, $id); do_query($form, $dbh, qq|DELETE FROM follow_ups WHERE id = ?|, $id); do_query($form, $dbh, qq|DELETE FROM notes WHERE (trans_id = ?) AND (trans_module = 'fu')|, $id); - }); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); } @@ -244,6 +246,10 @@ sub follow_ups { $where .= qq| AND (date_trunc('DAY', fu.itime) <= ?)|; push @values, conv_date($params{itime_to}); } + if ($params{created_for}) { + $where .= qq| AND fu.created_for_user = ?|; + push @values, conv_i($params{created_for}); + } if ($params{all_users}) { $where_user = qq|OR (fu.created_by IN (SELECT DISTINCT what FROM follow_up_access WHERE who = ?))|; @@ -330,8 +336,14 @@ sub link_details { }; } elsif ($params{trans_type} eq 'sales_quotation') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental_order) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=sales_quotation&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=sales_quotation&id=' . $params{trans_id}, 'title' => $locale->text('Sales quotation') . " $params{trans_info}", }; @@ -350,8 +362,14 @@ sub link_details { }; } elsif ($params{trans_type} eq 'sales_order') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental_order) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=sales_order&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=sales_order&id=' . $params{trans_id}, 'title' => $locale->text('Sales Order') . " $params{trans_info}", }; @@ -361,6 +379,12 @@ sub link_details { 'title' => $locale->text('Sales Invoice') . " $params{trans_info}", }; + } elsif ($params{trans_type} eq 'purchase_invoice') { + $link = { + 'url' => 'ir.pl?action=edit&type=purchase_invoice&id=' . $params{trans_id}, + 'title' => $locale->text('Purchase Invoice') . " $params{trans_info}", + }; + } elsif ($params{trans_type} eq 'credit_note') { $link = { 'url' => 'is.pl?action=edit&type=credit_note&id=' . $params{trans_id}, @@ -374,14 +398,26 @@ sub link_details { }; } elsif ($params{trans_type} eq 'request_quotation') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental_order) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=request_quotation&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=request_quotation&id=' . $params{trans_id}, 'title' => $locale->text('Request quotation') . " $params{trans_info}", }; } elsif ($params{trans_type} eq 'purchase_order') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental_order) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=purchase_order&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=purchase_order&id=' . $params{trans_id}, 'title' => $locale->text('Purchase Order') . " $params{trans_info}", }; @@ -444,7 +480,8 @@ sub save_access_rights { } $sth->finish(); - }); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); }