From: Moritz Bunkus Date: Thu, 20 Mar 2008 09:42:56 +0000 (+0000) Subject: Die Tabelle "warehouse_access" gibt es in der offiziellen Version nicht. Fix für... X-Git-Tag: release-2.6.0beta1~176 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=696aad9cd711ed3a92721db045ad0b7067bb1a17;p=kivitendo-erp.git Die Tabelle "warehouse_access" gibt es in der offiziellen Version nicht. Fix für Bug 820. --- diff --git a/SL/AM.pm b/SL/AM.pm index 3f34e18c7..22eab8bd0 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -2498,9 +2498,8 @@ sub delete_warehouse { return 0; } - do_query($form, $dbh, qq|DELETE FROM warehouse_access WHERE warehouse_id = ?|, conv_i($form->{id})); - do_query($form, $dbh, qq|DELETE FROM bin WHERE warehouse_id = ?|, conv_i($form->{id})); - do_query($form, $dbh, qq|DELETE FROM warehouse WHERE id = ?|, conv_i($form->{id})); + do_query($form, $dbh, qq|DELETE FROM bin WHERE warehouse_id = ?|, conv_i($form->{id})); + do_query($form, $dbh, qq|DELETE FROM warehouse WHERE id = ?|, conv_i($form->{id})); $dbh->commit(); diff --git a/SL/Form.pm b/SL/Form.pm index 65be2584c..9936630f3 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2167,41 +2167,22 @@ sub _get_warehouses { my ($self, $dbh, $param) = @_; - my ($key, $bins_key, $q_access, @values); + my ($key, $bins_key); if ('' eq ref $param) { $key = $param; + } else { $key = $param->{key}; $bins_key = $param->{bins}; - - if ($param->{access}) { - $q_access = - qq| AND EXISTS ( - SELECT wa.employee_id - FROM warehouse_access wa - WHERE (wa.employee_id = (SELECT id FROM employee WHERE login = ?)) - AND (wa.warehouse_id = w.id) - AND (wa.access IN ('ro', 'rw')))|; - push @values, $param->{access}; - } - - if ($param->{no_personal}) { - $q_access .= qq| AND (w.personal_warehouse_of IS NULL)|; - - } elsif ($param->{personal}) { - $q_access .= qq| AND (w.personal_warehouse_of = ?)|; - push @values, conv_i($param->{personal}); - } } my $query = qq|SELECT w.* FROM warehouse w WHERE (NOT w.invalid) AND ((SELECT COUNT(b.*) FROM bin b WHERE b.warehouse_id = w.id) > 0) - $q_access ORDER BY w.sortkey|; - $self->{$key} = selectall_hashref_query($self, $dbh, $query, @values); + $self->{$key} = selectall_hashref_query($self, $dbh, $query); if ($bins_key) { $query = qq|SELECT id, description FROM bin WHERE warehouse_id = ?|; diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 2117805dd..5baa36a0c 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -936,11 +936,8 @@ sub display_stock_in_form { my $units = AM->retrieve_units(\%myconfig, $form, "dimension"); my $units_data = AM->unit_select_data($units, undef, undef, $part_info->{unit}); - my $access = $auth->check_right($form->{login}, 'all_warehouses') ? undef : $form->{login}; - $form->get_lists('warehouses' => { 'key' => 'WAREHOUSES', - 'bins' => 'BINS', - 'access' => $access, }); + 'bins' => 'BINS' }); redo_stock_info('stock_info' => $stock_info, 'add_empty_row' => !$form->{closed});