From 696aad9cd711ed3a92721db045ad0b7067bb1a17 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 20 Mar 2008 09:42:56 +0000 Subject: [PATCH] =?utf8?q?Die=20Tabelle=20"warehouse=5Faccess"=20gibt=20es?= =?utf8?q?=20in=20der=20offiziellen=20Version=20nicht.=20Fix=20f=C3=BCr=20?= =?utf8?q?Bug=20820.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AM.pm | 5 ++--- SL/Form.pm | 25 +++---------------------- bin/mozilla/do.pl | 5 +---- 3 files changed, 6 insertions(+), 29 deletions(-) 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}); -- 2.20.1