diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index ae30b49..5801a13 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -80,7 +80,7 @@ class ServiceHelper extends CustomerHelper public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string { switch ($action) { - case 'modify': + case 'detail': $action = form_label( $label, 'modify_service', diff --git a/app/Helpers/Equipment/CHASSISHelper.php b/app/Helpers/Equipment/CHASSISHelper.php index 5dfa66a..072e8bb 100644 --- a/app/Helpers/Equipment/CHASSISHelper.php +++ b/app/Helpers/Equipment/CHASSISHelper.php @@ -25,4 +25,26 @@ class CHASSISHelper extends EquipmentHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'stock': + $action = form_label( + $label ? $label : ICONS["SERVER_ITEM_{$action}"], + $action, + [ + "data-src" => "/admin/equipment/chassis/modify/{$viewDatas['entity']->getPK()}?ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm form-label-sm text-primary", + ...$extras, + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Part/PartHelper.php b/app/Helpers/Part/PartHelper.php index 7b1f149..004b292 100644 --- a/app/Helpers/Part/PartHelper.php +++ b/app/Helpers/Part/PartHelper.php @@ -27,4 +27,31 @@ abstract class PartHelper extends CommonHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'ip': + case 'cs': + case 'cpu': + case 'ram': + case 'disk': + case 'software': + $action = form_label( + $label ? $label : ICONS["SERVER_ITEM_{$action}"], + $action, + [ + "data-src" => "/admin/part/{$action}/modify/{$viewDatas['entity']->getPK()}?ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm form-label-sm text-primary", + ...$extras, + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Views/cells/chassis/stock.php b/app/Views/cells/chassis/stock.php index 4ee2bd3..124c6fe 100644 --- a/app/Views/cells/chassis/stock.php +++ b/app/Views/cells/chassis/stock.php @@ -8,7 +8,7 @@