From 63b6441608688fe8644c2dc0af4cf9ed7c30124f Mon Sep 17 00:00:00 2001 From: Alexei Bezborodov Date: Sat, 25 Nov 2023 16:44:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20"=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8=D1=82=D1=8C=20=D1=87=D0=B5?= =?UTF-8?q?=D0=BA=20=D0=BF=D0=BE=20=D0=BE=D0=BF=D0=BB=D0=B0=D1=82=D0=B5"?= =?UTF-8?q?=20=D1=81=D1=82=D0=B0=D0=BB=D0=B0=20=D0=BF=D0=BE=D1=8F=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D1=82=D1=8C=D1=81=D1=8F=D1=81=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=83=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20'=D0=97=D0=B0=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D1=8B'=20#20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot_modules/orders.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot_modules/orders.py b/bot_modules/orders.py index 43726d9..6458984 100644 --- a/bot_modules/orders.py +++ b/bot_modules/orders.py @@ -33,13 +33,15 @@ access_field = 'orderAccess' create_datetime_field = 'orderCreateDateTime' parent_id_field = 'catID' +pay_field = bd_table.TableField(photo_pay_field, bd_table.TableFieldDestiny.PHOTO_PAY, bd_table.TableFieldType.PHOTO) + table = bd_table.Table(table_name, [ bd_table.TableField(key_name, bd_table.TableFieldDestiny.KEY, bd_table.TableFieldType.INT), bd_table.TableField(user_id_field, bd_table.TableFieldDestiny.USER_ID, bd_table.TableFieldType.INT), bd_table.TableField(name_field, bd_table.TableFieldDestiny.NAME, bd_table.TableFieldType.STR), bd_table.TableField(desc_field, bd_table.TableFieldDestiny.DESC, bd_table.TableFieldType.STR), bd_table.TableField(photo_field, bd_table.TableFieldDestiny.PHOTO, bd_table.TableFieldType.PHOTO), - bd_table.TableField(photo_pay_field, bd_table.TableFieldDestiny.PHOTO_PAY, bd_table.TableFieldType.PHOTO), + pay_field, bd_table.TableField(status_field, bd_table.TableFieldDestiny.STATUS, bd_table.TableFieldType.ENUM, a_Enum = OrderStatus), bd_table.TableField(address_field, bd_table.TableFieldDestiny.ADDRESS, bd_table.TableFieldType.STR), bd_table.TableField(access_field, bd_table.TableFieldDestiny.ACCESS, bd_table.TableFieldType.STR), @@ -61,7 +63,7 @@ button_names = { ButtonNames.LIST_ALL: "πŸ“ƒ Бписок всСх ΠΌΠΎΠΈΡ… Π·Π°ΠΊΠ°Π·ΠΎΠ²", mod_table_operate.ButtonNames.ADD: "βœ… Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ Π·Π°ΠΊΠ°Π·", mod_table_operate.ButtonNames.EDIT: "πŸ›  Π Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ ΠΌΠΎΠΉ Π·Π°ΠΊΠ°Π·", - mod_table_operate.EditButton(bd_table.TableFieldDestiny.PHOTO_PAY): "☐ Π—Π°Π³Ρ€ΡƒΠ·ΠΈΡ‚ΡŒ Ρ‡Π΅ΠΊ ΠΏΠΎ ΠΎΠΏΠ»Π°Ρ‚Π΅ ΠΌΠΎΠ΅Π³ΠΎ Π·Π°ΠΊΠ°Π·Π°", + mod_table_operate.EditButton(bd_table.TableFieldDestiny.PHOTO_PAY): "🧾 Π—Π°Π³Ρ€ΡƒΠ·ΠΈΡ‚ΡŒ Ρ‡Π΅ΠΊ ΠΏΠΎ ΠΎΠΏΠ»Π°Ρ‚Π΅ ΠΌΠΎΠ΅Π³ΠΎ Π·Π°ΠΊΠ°Π·Π°", mod_table_operate.EditButton(bd_table.TableFieldDestiny.PHOTO): "☐ Π˜Π·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ Π² ΠΌΠΎΡ‘ΠΌ Π·Π°ΠΊΠ°Π·Π΅", mod_table_operate.EditButton(bd_table.TableFieldDestiny.NAME): "≂ Π˜Π·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Π² ΠΌΠΎΡ‘ΠΌ Π·Π°ΠΊΠ°Π·Π΅", mod_table_operate.EditButton(bd_table.TableFieldDestiny.DESC): "𝌴 Π˜Π·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ описаниС Π² ΠΌΠΎΡ‘ΠΌ Π·Π°ΠΊΠ°Π·Π΅", @@ -224,8 +226,10 @@ class ModuleOrders(mod_table_operate.TableOperateModule): return super().AddBDItemFunc(a_ItemData, a_UserID) def GetStartButtons(self, a_Message, a_UserGroups): + pay_access = self.GetAccessForEditKeyboardButtons(pay_field) return [ [mod_table_operate.ButtonNames.ADD, user_access.AccessMode.ADD], + [mod_table_operate.EditButton(pay_field.m_Destiny), pay_access], [mod_table_operate.ButtonNames.EDIT, user_access.AccessMode.EDIT], [mod_table_operate.ButtonNames.LIST, user_access.AccessMode.VIEW], [mod_table_operate.ButtonNames.DEL, user_access.AccessMode.DELETE],