Files
opensourcepos/app/Language/lo/Employees.php
T
objecttothis c701d21886 fix(sales): gate per-record endpoints behind reports_sales grant (#4627)
fix(sales): gate per-record endpoints behind reports_sales grant (REDACTED)

Cashiers holding only the base `sales` grant could reach per-sale endpoints
(getRow, getEdit, postSave, getReceipt, getInvoice, getSendPdf, getSendReceipt)
that require `reports_sales`. getManage() enforced this at the list level, but
individual endpoints did not re-check. Regression tests added.

Auth:
- Introduce `IsLoggedIn` filter to centralize login checks across controllers
- Replace custom `AccessDeniedRedirectException` with built-in `RedirectException`

Employees:
- Add `DISALLOW_PASSWORD_CHANGE` and `DISALLOW_GRANT_CHANGE` env vars to restrict
  credential and permission changes in locked-down environments
- Extract `hasGrantsChanged()` to streamline `postSave`

Refactor:
- Rename snake_case variables to camelCase in Sales, Items, and Employees
  controllers for PSR-12 compliance
- Use explicit `db_connect()` for transaction clarity in Items controller

Fixes:
- SMTP config entries fall back to defaults via null coalescing
- Migration uses `DROP FOREIGN KEY` instead of `DROP CONSTRAINT`
- Password hash upgrade only sets session on successful `hash_version` update
- Correct lang key for unknown error in Module model

Language:
- Translate `error_grant_change_disallowed` / `error_password_change_disallowed`
  across all 44 supported locales with => alignment matching en reference
- Fix "cannot be deleted" messages and misc typos across ~15 language files

Tests:
- Bootstrap seeder only once in ItemsCsvImportTest; close connection after
- Restore `DISALLOW_GRANT_CHANGE` in teardown to prevent side effects
- Use `uniqid()` for test user data to avoid collisions

Signed-off-by: 17935339+objecttothis@users.noreply.github.com
2026-08-23 17:40:06 +04:00

50 lines
4.4 KiB
PHP

<?php
return [
'administrator' => '',
'basic_information' => 'ຂໍ້ມູນ',
'cannot_be_deleted' => 'ບໍ່ສາມາດລຶບພະນັກງານທີ່ເລືອກໄດ້, ຢ່າງໜ້ອຍມີ 1 ລາຍການຫຼືຫຼາຍກວ່ານັ້ນ ຍັງມີການຊື້ຂາຍກັນຢູ່ ຫຼື ທ່ານກຳລັງພະຍາຍາມລຶບບັນຊີຂອງຕົວເອງ.',
'change_employee' => '',
'change_password' => 'ປ່ຽນ Password',
'clerk' => '',
'commission' => '',
'confirm_delete' => 'ທ່ານຈະລຶບພະນັກງານທີ່ເລືອກແທ້ບໍ່ ?',
'confirm_restore' => '',
'current_password' => 'Password ປັດຈຸບັນ',
'current_password_invalid' => 'Password ປັດຈຸບັນບໍ່ຖືກຕ້ອງ.',
'employee' => 'ພະນັກງານ',
'error_adding_updating' => 'ເພີ່ມ ຫຼື ແກ້ໄຂ ພະນັກງານ ບໍ່ສຳເລັດ.',
'error_deleting_admin' => '',
'error_deleting_demo_admin' => 'ທ່ານບໍ່ສາມາດລຶບບັນຊີທົດລອງຜູ້ດູແລລະບົບໄດ້.',
'error_grant_change_disallowed' => 'ການປ່ຽນແປງສິດທິໄດ້ຖືກປິດໃນ demo ນີ້.',
'error_password_change_disallowed' => 'ການປ່ຽນແປງລະຫັດຜ່ານໄດ້ຖືກປິດໃນ demo ນີ້.',
'error_updating_admin' => '',
'error_updating_demo_admin' => 'ທ່ານບໍ່ສາມາດປ່ຽນແປງບັນຊີທົດລອງຜູ້ດູແລລະບົບໄດ້.',
'language' => 'ພາສາ',
'login_info' => 'ເຂົ້າລະບົບ',
'manager' => '',
'new' => 'ພະນັກງານໃໝ່',
'none_selected' => 'ທ່ານຍັງບໍ່ໄດ້ເລືອກພະນັກງານໃດເລີຍເພື່ອລຶບ.',
'one_or_multiple' => 'ພະນັກງານ',
'password' => 'Password',
'password_minlength' => 'Password ຄວນໃສ່ຢ່າງໜ້ອຍ 8 ຕົວອັກສອນ.',
'password_must_match' => 'Password ບໍ່ຄືກັນ.',
'password_not_must_match' => 'Password ປັດຈຸບັນ ແລະ Password ໃໝ່ ຈະຕ້ອງບໍ່ຄືກັນ.',
'password_required' => 'Password ຈຳເປັນຕ້ອງໃສ່.',
'permission_desc' => 'ຕິກຂໍ້ມູນດ້ານລຸ່ມເພື່ອໃຫ້ສາມາດນຳໃຊ້ Modules ຕ່າງໆໄດ້.',
'permission_info' => 'ສິດ',
'repeat_password' => 'ລະຫັດຜ່ານອີກຄັ້ງ',
'subpermission_required' => 'Add at least one grant for each module.',
'successful_adding' => 'ເພີ່ມພະນັກງານສຳເລັດ.',
'successful_change_password' => 'ປ່ຽນລະຫັດຜ່ານສຳເລັດ.',
'successful_deleted' => 'ທ່ານລຶບສຳເລັດແລ້ວ',
'successful_updating' => 'ທ່ານແກ້ໄຂພະນັກງານສຳເລັດ',
'system_language' => 'ພາສາຂອງລະບົບ',
'unsuccessful_change_password' => 'ປ່ຽນລະຫັດຜ່ານບໍ່ສຳເລັດ.',
'update' => 'ແກ້ໄຂພະນັກງານ',
'username' => 'ຊື່ຜູ້ໃຊ້',
'username_duplicate' => '',
'username_minlength' => 'Username ຕ້ອງໃສ່ຢ່າງໜ້ອຍ 5 ຕົວອັກສອນ.',
'username_required' => 'Username ຈຳເປັນຕ້ອງໃສ່.',
];