From 0546ad4001e3a72eb1a8d2aef39846b7cb9caa0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 14 Jul 2021 11:04:46 +0200 Subject: [PATCH] =?utf8?q?Sortimentsbestandteile=20=C3=A4ndern=20k=C3=B6nn?= =?utf8?q?en,=20auch=20nachdem=20das=20Sortiemnt=20verwendet=20wurde?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gekoppelt an ein neues Recht --- locale/de/all | 1 + locale/en/all | 1 + sql/Pg-upgrade2-auth/right_assortment_edit.sql | 15 +++++++++++++++ templates/webpages/part/_assortment.html | 8 ++++---- templates/webpages/part/_assortment_row.html | 12 ++++++------ 5 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 sql/Pg-upgrade2-auth/right_assortment_edit.sql 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 %] -- 2.20.1