diff --git a/app/Helpers/Customer/Wallet/AccountHelper.php b/app/Helpers/Customer/Wallet/AccountHelper.php index d6dc8cd..05bf478 100644 --- a/app/Helpers/Customer/Wallet/AccountHelper.php +++ b/app/Helpers/Customer/Wallet/AccountHelper.php @@ -56,4 +56,30 @@ class AccountHelper extends WalletHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + //역활이 보안관리자가 아니면 수정불가 + if ($this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']])) { + $action = parent::getListButton($action, $label, $viewDatas, $extras); + } else { + $oldBatchJobUids = old("batchjob_uids", null); + $oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids]; + $action = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs", + "checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids) + ]); + $action .= $label; + } + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Customer/Wallet/CouponHelper.php b/app/Helpers/Customer/Wallet/CouponHelper.php index a7933c2..8e19ded 100644 --- a/app/Helpers/Customer/Wallet/CouponHelper.php +++ b/app/Helpers/Customer/Wallet/CouponHelper.php @@ -25,4 +25,30 @@ class CouponHelper extends WalletHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + //역활이 보안관리자가 아니면 수정불가 + if ($this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']])) { + $action = parent::getListButton($action, $label, $viewDatas, $extras); + } else { + $oldBatchJobUids = old("batchjob_uids", null); + $oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids]; + $action = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs", + "checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids) + ]); + $action .= $label; + } + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Customer/Wallet/PointHelper.php b/app/Helpers/Customer/Wallet/PointHelper.php index 9d43a5d..8b0b202 100644 --- a/app/Helpers/Customer/Wallet/PointHelper.php +++ b/app/Helpers/Customer/Wallet/PointHelper.php @@ -25,4 +25,30 @@ class PointHelper extends WalletHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + //역활이 보안관리자가 아니면 수정불가 + if ($this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']])) { + $action = parent::getListButton($action, $label, $viewDatas, $extras); + } else { + $oldBatchJobUids = old("batchjob_uids", null); + $oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids]; + $action = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs", + "checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids) + ]); + $action .= $label; + } + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } }