From: Werner Hahn Date: Mon, 10 Sep 2018 16:06:02 +0000 (+0200) Subject: Kundenstatistik: Rechte X-Git-Tag: release-3.5.4~290 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=bec23a700e524b09e80fde2ec8178367aa3a16e2;p=kivitendo-erp.git Kundenstatistik: Rechte 1 Recht um den Tab Belege bei Kunden anzeigen zu lassen 1 Recht um den Tab Belege bei Lieferanten anzeigen zulassen --- diff --git a/SL/Controller/CustomerVendorTurnover.pm b/SL/Controller/CustomerVendorTurnover.pm index b0a7c6552..f81d0a2f2 100644 --- a/SL/Controller/CustomerVendorTurnover.pm +++ b/SL/Controller/CustomerVendorTurnover.pm @@ -9,7 +9,6 @@ use SL::DB::EmailJournal; use SL::DB::Letter; use SL::DB; -__PACKAGE__->run_before('check_auth'); sub action_list_turnover { my ($self) = @_; @@ -392,13 +391,6 @@ sub action_get_letters { $self->render('customer_vendor_turnover/letter_statistic', { layout => 0 }, letters => $letters); } -sub _list_articles_by_invoice { -} -sub _list_count_articles_by_year { -} -sub check_auth { - $::auth->assert('general_ledger'); -} 1; __END__ diff --git a/locale/de/all b/locale/de/all index 881b9b058..4811fdef0 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2891,6 +2891,8 @@ $self->{texts} = { 'Show parts' => 'Artikel anzeigen', 'Show parts longdescription (notes) in select list' => 'Langtext in Auswahlliste bei mehreren Treffern im Stammdaten-Bestand anzeigen', 'Show purchase letters report' => 'Einkaufsbriefe zeigen', + 'Show record tab in customer' => 'Zeige Tab Belege in den Kundenstammdaten', + 'Show record tab in vendor' => 'Zeige Tab Belege in den Lieferantenstammdaten', 'Show requirement spec' => 'Pflichtenheft anzeigen', 'Show requirement spec template' => 'Pflichtenheftvorlage anzeigen', 'Show sales letters report' => 'Verkaufsbrief anzeigen', diff --git a/sql/Pg-upgrade2-auth/customer_vendor_record_extra_tab_rights.pl b/sql/Pg-upgrade2-auth/customer_vendor_record_extra_tab_rights.pl new file mode 100644 index 000000000..4431a34fe --- /dev/null +++ b/sql/Pg-upgrade2-auth/customer_vendor_record_extra_tab_rights.pl @@ -0,0 +1,32 @@ +# @tag: customer_vendor_record_extra_tab_rights +# @description: Setzt Rechte um bei Kunden/Lieferanten einen Extratab anzeigen zu lassen, der Belege anzeigt per Default erlaubt +# @depends: release_3_5_2 +# @locales: Show record tab in customer +# @locales: Show record tab in vendor +package SL::DBUpgrade2::Auth::customer_vendor_record_extra_tab_rights; + +use strict; +use utf8; + +use parent qw(SL::DBUpgrade2::Base); + +use SL::DBUtils; + +sub run { + my ($self) = @_; + + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 610, 'show_extra_record_tab_customer', 'Show record tab in customer')"); + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 611, 'show_extra_record_tab_vendor', 'Show record tab in vendor')"); + + my $groups = $main::auth->read_groups(); + + foreach my $group (values %{$groups}) { + $group->{rights}->{show_extra_record_tab_customer} = 1; + $group->{rights}->{show_extra_record_tab_vendor} = 1; + $main::auth->save_group($group); + } + + return 1; +} # end run + +1; diff --git a/templates/webpages/customer_vendor/form.html b/templates/webpages/customer_vendor/form.html index fc709430e..a5c43fbf3 100644 --- a/templates/webpages/customer_vendor/form.html +++ b/templates/webpages/customer_vendor/form.html @@ -36,7 +36,20 @@ [% IF SELF.cv.id %]
  • [% 'Price Rules' | $T8 %]
  • [% END %] -
  • [% LxERP.t8('Records') %] [%- IF SELF.open_items > 0 %]  $[% END %] [%- IF SELF.open_orders > 0 %]  ![% END %]
  • + + [% IF SELF.cv.id %] + [% IF ( FORM.db == 'customer' && AUTH.assert('show_extra_record_tab_customer',1) ) %] +
  • [% LxERP.t8('Records') %] + [%- IF SELF.open_items > 0 %]  $[% END %] [%- IF SELF.open_orders > 0 %]  ![% END %] +
  • + [% END %] + [% IF ( FORM.db == 'vendor' && AUTH.assert('show_extra_record_tab_vendor',1) ) %] +
  • [% LxERP.t8('Records') %] + [%- IF SELF.open_items > 0 %]  $[% END %] [%- IF SELF.open_orders > 0 %]  ![% END %] +
  • + [% END %] + [% END %] + [% PROCESS "customer_vendor/tabs/billing.html" %]