Files
opensourcepos/app/Language/ckb/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' => 'ناتوانیت کارمەند(ەکان)ی هەڵبژێردراو بسڕیتەوە، یەکێک یان زیاتر لەوانە فرۆشتنی پرۆسێس کردووە یان تۆ هەوڵی سڕینەوەی هەژمارەکەت دەدەیت.',
'change_employee' => '',
'change_password' => 'وشەی نهێنی بگۆڕە',
'clerk' => '',
'commission' => '',
'confirm_delete' => '‌ئایا دڵنیای کە دەتەوێت کارمەند(ەکان)ی هەڵبژێردراو بسڕیتەوە؟',
'confirm_restore' => 'ئایا دڵنیای کە دەتەوێت کارمەند(ەکان)ی هەڵبژێردراو بگەڕێنیتەوە؟',
'current_password' => 'وشەی نهێنی ئێستا',
'current_password_invalid' => 'وشەی نهێنی ئێستا نادروستە.',
'employee' => 'فەرمانبەر',
'error_adding_updating' => 'زیادکردن یان نوێکردنەوەی کارمەند سەرکەوتوو نەبوو.',
'error_deleting_admin' => '',
'error_deleting_demo_admin' => 'ناتوانیت بەکارهێنەری ئەدمینی تاقیکردنەوەیی بسڕیتەوە.',
'error_grant_change_disallowed' => 'گۆڕینی دەستگەیشتن لە ئەم دیموێدا ناتوانی لێدرایت.',
'error_password_change_disallowed' => 'گۆڕینی وشەی نهێنی لە ئەم دیموێدا ناتوانی لێدرایت.',
'error_updating_admin' => '',
'error_updating_demo_admin' => 'ناتوانیت بەکارهێنەری ئەدمین تاقیکردنەوەیی بگۆڕیت.',
'language' => 'زمان',
'login_info' => 'چوونەژوورەوە',
'manager' => '',
'new' => 'فەرمانبەری نوێ',
'none_selected' => 'هیچ فەرمانبەرێک(کان)ت هەڵنەبژاردووە بۆ سڕینەوە.',
'one_or_multiple' => 'فەرمانبەر(ان)',
'password' => 'وشەی نهێنی',
'password_minlength' => 'وشەی نهێنی دەبێت بەلایەنی کەمەوە ٨ پیت بێت.',
'password_must_match' => 'وشەی نهێنییەکان هاوشێوە نین.',
'password_not_must_match' => 'وشەی نهێنی ئێستا و وشەی نهێنی نوێ دەبێت بێهاوتابن.',
'password_required' => 'وشەی نهێنی پێویستە.',
'permission_desc' => 'چوارگۆشەکانی خوارەوە دیاری بکە بۆ پێدانی دەستگەیشتن بە مۆدیولەکان.',
'permission_info' => 'ڕێپێدانەکان',
'repeat_password' => 'دووبارە وشەی نهێنی',
'subpermission_required' => 'بۆ هەر مۆدیولێک بەلایەنی کەمەوە یەک پێدان زیاد بکە.',
'successful_adding' => 'زیادکردنی فەرمانبەر سەرکەوتوو بوو.',
'successful_change_password' => 'گۆڕینی وشەی نهێنی سەرکەوتوو بوو.',
'successful_deleted' => 'بەسەرکەوتووی سڕیتەوە',
'successful_updating' => 'بەسەرکەوتوویی فەرمانبەرەکەت نوێ کردۆتەوە',
'system_language' => 'زمانی سیستەم',
'unsuccessful_change_password' => 'گۆڕینی وشەی نهێنی سەرکەوتوو نەبوو.',
'update' => 'فەرمانبەر نوێبکەوە',
'username' => 'ناوی بەکارهێنەر',
'username_duplicate' => 'ناوی بەکارهێنەری فەرمانبەر پێشتر بەکارهاتووە. تکایە یەکێکی تر هەڵبژێرە.',
'username_minlength' => 'ناوی بەکارهێنەر دەبێت لانیکەم ٥ پیت درێژ بێت.',
'username_required' => 'ناوی بەکارهێنەر خانەیەکی پێویستە.',
];