From: Bernd Bleßmann Date: Wed, 14 Jul 2021 09:04:46 +0000 (+0200) Subject: Sortimentsbestandteile ändern können, auch nachdem das Sortiemnt verwendet wurde X-Git-Tag: kivitendo-mebil_0.1-0~9^2~32 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0546ad4001e3a72eb1a8d2aef39846b7cb9caa0f;p=kivitendo-erp.git Sortimentsbestandteile ändern können, auch nachdem das Sortiemnt verwendet wurde Gekoppelt an ein neues Recht --- diff --git a/locale/de/all b/locale/de/all index 7507bc238..cb95769f5 100755 --- a/locale/de/all +++ b/locale/de/all @@ -294,6 +294,7 @@ $self->{texts} = { 'Already counted' => 'Bereits erfasst', 'Already imported entries (duplicates)' => 'Bereits importierte Einträge (Duplikate)', 'Always edit assembly items (user can change/delete items even if assemblies are already produced)' => 'Erzeugnisbestandteile verändern (Löschen/Umsortieren) auch nachdem dieses Erzeugnis schon produziert wurde.', + 'Always edit assortment items (user can change/delete items even if assortments are already used)' => 'Sortimentsbestandteile verändern (Löschen/Umsortieren), auch nachdem dieses Sortiment schon verwendet wurde.', 'Always save orders with a projectnumber (create new projects)' => 'Aufträge immer mit Projektnummer speichern (neue Projekte erstellen)', 'Amended Advance Turnover Tax Return' => 'Berichtigte Anmeldung', 'Amount' => 'Betrag', diff --git a/locale/en/all b/locale/en/all index 65d94870e..4d3f679cd 100644 --- a/locale/en/all +++ b/locale/en/all @@ -294,6 +294,7 @@ $self->{texts} = { 'Already counted' => '', 'Already imported entries (duplicates)' => '', 'Always edit assembly items (user can change/delete items even if assemblies are already produced)' => '', + 'Always edit assortment items (user can change/delete items even if assortments are already used)' => '', 'Always save orders with a projectnumber (create new projects)' => '', 'Amended Advance Turnover Tax Return' => '', 'Amount' => '', diff --git a/sql/Pg-upgrade2-auth/right_assortment_edit.sql b/sql/Pg-upgrade2-auth/right_assortment_edit.sql new file mode 100644 index 000000000..d0a6e0745 --- /dev/null +++ b/sql/Pg-upgrade2-auth/right_assortment_edit.sql @@ -0,0 +1,15 @@ +-- @tag: right_assortment_edit +-- @description: Recht zum Ändern von Sortimentsbestandteilen auch nach Verwendeung +-- @depends: release_3_5_7 move_shop_part_edit_right +-- @locales: Always edit assortment items (user can change/delete items even if assortments are already used) + +INSERT INTO auth.master_rights (position, name, description, category) + VALUES ((SELECT position + 10 FROM auth.master_rights WHERE name = 'assembly_edit'), + 'assortment_edit', + 'Always edit assortment items (user can change/delete items even if assortments are already used)', + FALSE); + +INSERT INTO auth.group_rights (group_id, "right", granted) + SELECT id, 'assortment_edit', true + FROM auth.group + WHERE name = 'Vollzugriff'; diff --git a/templates/webpages/part/_assortment.html b/templates/webpages/part/_assortment.html index 55b04e83f..db4330549 100644 --- a/templates/webpages/part/_assortment.html +++ b/templates/webpages/part/_assortment.html @@ -14,11 +14,11 @@ - [% IF SELF.orphaned %] + [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %] [%- LxERP.t8('delete item') %] [% END %] [%- 'position' | $T8 %] - [% IF SELF.orphaned %] + [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %] [%- LxERP.t8('reorder item') %] [% END %] [%- 'Partnumber' | $T8 %] @@ -37,7 +37,7 @@ - [% IF SELF.orphaned %] + [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %] [% 'Part' | $T8 %]: @@ -60,7 +60,7 @@ [%- LxERP.format_amount(items_sum_diff, 2, 0) %] - [% IF SELF.orphaned %] + [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %] [% END %] diff --git a/templates/webpages/part/_assortment_row.html b/templates/webpages/part/_assortment_row.html index fcd88fd8f..6edd9bb75 100644 --- a/templates/webpages/part/_assortment_row.html +++ b/templates/webpages/part/_assortment_row.html @@ -5,11 +5,11 @@ [%- USE P %] - [% IF orphaned %] + [% IF orphaned || AUTH.assert('assortment_edit', 1) %] [% L.hidden_tag("assortment_items[+].parts_id", ITEM.part.id) %] [% END %] - + [%- L.button_tag("kivi.Part.delete_item_row(this)", LxERP.t8("X")) %] [% # , confirm=LxERP.t8("Are you sure?")) %] @@ -18,7 +18,7 @@ [% HTML.escape(position) or HTML.escape(ITEM.position) %] - + [%- LxERP.t8('reorder item') %] @@ -28,7 +28,7 @@ [% HTML.escape(ITEM.part.description) %] - [% IF orphaned %] + [% IF orphaned || AUTH.assert('assortment_edit', 1) %] [%- L.input_tag("assortment_items[].qty_as_number", ITEM.qty_as_number, size = 10, @@ -38,7 +38,7 @@ [% END %] - [% IF orphaned %] + [% IF orphaned || AUTH.assert('assortment_edit', 1) %] [%- L.select_tag("assortment_items[].unit", ITEM.part.available_units, default = ITEM.part.unit, @@ -50,7 +50,7 @@ [% END %] - [% IF orphaned %] + [% IF orphaned || AUTH.assert('assortment_edit', 1) %] [% L.checkbox_tag('assortment_items[].charge', checked => ITEM.charge, class => 'checkbox', for_submit=1) %] [% ELSE %] [% IF ITEM.charge %][% 'Yes' | $T8 %][%- ELSE %][% 'No' | $T8 %][%- END %]