dbmsv4 init...1
This commit is contained in:
parent
a7caf53c86
commit
92caea4ba8
@ -34,8 +34,9 @@ abstract class AbstractCRUDController extends AbstractWebController
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$action = __FUNCTION__;
|
$action = __FUNCTION__;
|
||||||
$this->action_init_process($action);
|
$formDatas = $this->create_form_process();
|
||||||
$this->addViewDatas('formDatas', $this->create_form_process());
|
$this->action_init_process($action, $formDatas);
|
||||||
|
$this->addViewDatas('formDatas', $formDatas);
|
||||||
return $this->create_form_result_process($action);
|
return $this->create_form_result_process($action);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->action_redirect_process('error', "{$this->getTitle()}에서 생성폼 오류:" . $e->getMessage());
|
return $this->action_redirect_process('error', "{$this->getTitle()}에서 생성폼 오류:" . $e->getMessage());
|
||||||
@ -103,7 +104,7 @@ abstract class AbstractCRUDController extends AbstractWebController
|
|||||||
}
|
}
|
||||||
$this->addViewDatas('entity', $entity);
|
$this->addViewDatas('entity', $entity);
|
||||||
$action = __FUNCTION__;
|
$action = __FUNCTION__;
|
||||||
$this->action_init_process($action, $entity);
|
$this->action_init_process($action, [], $entity);
|
||||||
return $this->modify_form_result_process($action);
|
return $this->modify_form_result_process($action);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->action_redirect_process('error', "{$this->getTitle()}에서 {$uid} 수정폼 오류:" . $e->getMessage());
|
return $this->action_redirect_process('error', "{$this->getTitle()}에서 {$uid} 수정폼 오류:" . $e->getMessage());
|
||||||
|
|||||||
@ -76,11 +76,10 @@ abstract class AbstractWebController extends Controller
|
|||||||
/**
|
/**
|
||||||
* 모든 액션 실행 전 공통 초기화 작업
|
* 모든 액션 실행 전 공통 초기화 작업
|
||||||
*/
|
*/
|
||||||
protected function action_init_process(string $action, ?object $entity = null): void
|
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$this->addViewDatas('action', $action);
|
$this->addViewDatas('action', $action);
|
||||||
$this->addViewDatas('authContext', $this->getAuthContext());
|
$this->addViewDatas('authContext', $this->getAuthContext());
|
||||||
// $this->service가 하위 클래스에서 설정되었다고 가정
|
|
||||||
$this->addViewDatas('classPath', $this->service->getClassPaths(false));
|
$this->addViewDatas('classPath', $this->service->getClassPaths(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,10 @@ abstract class AdminController extends CommonController
|
|||||||
$this->addActionPaths($this->_layout);
|
$this->addActionPaths($this->_layout);
|
||||||
$this->layouts = LAYOUTS[$this->_layout];
|
$this->layouts = LAYOUTS[$this->_layout];
|
||||||
}
|
}
|
||||||
protected function action_init_process(string $action, ?object $entity = null): void
|
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$this->service->action_init_process($action, $entity);
|
$this->service->action_init_process($action, $formDatas, $entity);
|
||||||
parent::action_init_process($action, $entity);
|
parent::action_init_process($action, $formDatas, $entity);
|
||||||
$this->addViewDatas('layout', $this->layouts);
|
$this->addViewDatas('layout', $this->layouts);
|
||||||
$this->addViewDatas('title', $this->getTitle());
|
$this->addViewDatas('title', $this->getTitle());
|
||||||
$this->addViewDatas('helper', $this->service->getHelper());
|
$this->addViewDatas('helper', $this->service->getHelper());
|
||||||
|
|||||||
@ -16,17 +16,13 @@ class ServiceController extends CustomerController
|
|||||||
$this->service = service('customer_serviceservice');
|
$this->service = service('customer_serviceservice');
|
||||||
}
|
}
|
||||||
$this->addActionPaths('service');
|
$this->addActionPaths('service');
|
||||||
|
$this->layouts['javascripts'][] = '<script src="/js/admin/clipboard.js"></script>';
|
||||||
}
|
}
|
||||||
protected function getEntityClass(): string
|
protected function getEntityClass(): string
|
||||||
{
|
{
|
||||||
return ServiceEntity::class;
|
return ServiceEntity::class;
|
||||||
}
|
}
|
||||||
//기본 함수 작업
|
//기본 함수 작업
|
||||||
protected function action_init_process(string $action, ?object $entity = null): void
|
|
||||||
{
|
|
||||||
$this->layouts['javascripts'][] = '<script src="/js/admin/clipboard.js"></script>';
|
|
||||||
parent::action_init_process($action, $entity);
|
|
||||||
}
|
|
||||||
//Custom 추가 함수
|
//Custom 추가 함수
|
||||||
public function create_form_process(array $formDatas = []): array
|
public function create_form_process(array $formDatas = []): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class ServerController extends EquipmentController
|
|||||||
$this->service = service('equipment_serverservice');
|
$this->service = service('equipment_serverservice');
|
||||||
}
|
}
|
||||||
$this->addActionPaths('server');
|
$this->addActionPaths('server');
|
||||||
|
$this->layouts['javascripts'][] = '<script src="/js/admin/clipboard.js"></script>';
|
||||||
}
|
}
|
||||||
protected function getEntityClass(): string
|
protected function getEntityClass(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,10 +17,10 @@ class Home extends AbstractWebController
|
|||||||
}
|
}
|
||||||
$this->addActionPaths('home');
|
$this->addActionPaths('home');
|
||||||
}
|
}
|
||||||
protected function action_init_process(string $action, ?object $entity = null): void
|
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
// $this->service->action_init_process($action, $entity);
|
// $this->service->action_init_process($action, $entity);
|
||||||
parent::action_init_process($action, $entity);
|
parent::action_init_process($action, $formDatas, $entity);
|
||||||
$this->addViewDatas('layout', LAYOUTS['admin']);
|
$this->addViewDatas('layout', LAYOUTS['admin']);
|
||||||
}
|
}
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class ServerEntity extends EquipmentEntity
|
|||||||
//기본기능용
|
//기본기능용
|
||||||
public function getCustomTitle(mixed $title = null): string
|
public function getCustomTitle(mixed $title = null): string
|
||||||
{
|
{
|
||||||
return sprintf("[%s]%s / %s", $this->getCode(), $title ? $title : $this->getIP(), $this->getOS());
|
return sprintf("[%s]%s", $this->getCode(), $title ? $title : $this->getIP());
|
||||||
}
|
}
|
||||||
final public function getCode(): string
|
final public function getCode(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,19 +44,19 @@ class BoardForm extends CommonForm
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'worker_uid':
|
case 'worker_uid':
|
||||||
foreach ($this->getFormOption_process(service('userservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('userservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -8,6 +8,7 @@ use RuntimeException;
|
|||||||
abstract class CommonForm
|
abstract class CommonForm
|
||||||
{
|
{
|
||||||
private array $_attributes = [];
|
private array $_attributes = [];
|
||||||
|
private array $_formDatas = [];
|
||||||
private array $_formFields = [];
|
private array $_formFields = [];
|
||||||
private array $_formRules = [];
|
private array $_formRules = [];
|
||||||
private array $_formFilters = [];
|
private array $_formFilters = [];
|
||||||
@ -28,6 +29,19 @@ abstract class CommonForm
|
|||||||
}
|
}
|
||||||
return $this->_attributes[$key];
|
return $this->_attributes[$key];
|
||||||
}
|
}
|
||||||
|
final public function setFormDatas(array $formDatas): void
|
||||||
|
{
|
||||||
|
$this->_formDatas = $formDatas;
|
||||||
|
}
|
||||||
|
//$fields 매치된것만 반환, []->전체
|
||||||
|
final public function getFormDatas(array $fields = []): array
|
||||||
|
{
|
||||||
|
if (empty($fields)) {
|
||||||
|
return $this->_formDatas;
|
||||||
|
}
|
||||||
|
// _formDatas 키를 비교하여 교집합을 반환합니다. $fields에 지정된 필드 정의만 추출됩니다.
|
||||||
|
return array_intersect_key($this->_formDatas, array_flip($fields));
|
||||||
|
}
|
||||||
final public function setFormFields(array $fields): void
|
final public function setFormFields(array $fields): void
|
||||||
{
|
{
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
@ -57,10 +71,10 @@ abstract class CommonForm
|
|||||||
}
|
}
|
||||||
return array_intersect_key($this->_formRules, array_flip($fields));
|
return array_intersect_key($this->_formRules, array_flip($fields));
|
||||||
}
|
}
|
||||||
final public function setFormOptions(string $action, array $fields, ?object $entity = null, $formOptions = []): void
|
final public function setFormOptions(string $action, array $fields, array $formDatas = [], $formOptions = []): void
|
||||||
{
|
{
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$formOptions[$field] = $formOptions[$field] ?? $this->getFormOption($action, $field, $entity);
|
$formOptions[$field] = $formOptions[$field] ?? $this->getFormOption($action, $field, $formDatas);
|
||||||
}
|
}
|
||||||
$this->_formOptions = $formOptions;
|
$this->_formOptions = $formOptions;
|
||||||
}
|
}
|
||||||
@ -183,37 +197,35 @@ abstract class CommonForm
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
protected function getFormOption_process($service, string $action, string $field, ?object $entity = null): array
|
protected function getFormOption_process($service, string $action, string $field, array $formDatas = []): array
|
||||||
{
|
{
|
||||||
$entities = [];
|
$entities = [];
|
||||||
switch ($action) {
|
switch ($field) {
|
||||||
case 'create_form':
|
|
||||||
$entities = $service->getEntities(['status' => STATUS['AVAILABLE']]);
|
|
||||||
break;
|
|
||||||
case 'modify_form':
|
|
||||||
$where = sprintf("status = '%s' OR %s='%s'", STATUS['AVAILABLE'], $this->getAttribute('pk_field'), $entity->$field);
|
|
||||||
$entities = $service->getEntities([$where => null]);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$entities = $service->getEntities();
|
if (array_key_exists($field, $formDatas)) {
|
||||||
|
$where = sprintf("status = '%s' OR %s='%s'", STATUS['AVAILABLE'], $this->getAttribute('pk_field'), $formDatas[$field]);
|
||||||
|
$entities = $service->getEntities([$where => null]);
|
||||||
|
} else {
|
||||||
|
$entities = $service->getEntities();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $entities;
|
return $entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
foreach ($this->getFormOption_process(service('userservice'), $action, $field, $entity) as $entity) {
|
foreach ($this->getFormOption_process(service('userservice'), $action, $field, $formDatas) as $entity) {
|
||||||
$tempOptions[$entity->getPK()] = $entity->getTitle();
|
$tempOptions[$entity->getPK()] = $entity->getTitle();
|
||||||
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
|
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
case 'clientinfo_uid':
|
case 'clientinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $entity) as $entity) {
|
foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $formDatas) as $entity) {
|
||||||
$tempOptions[$entity->getPK()] = $entity->getTitle();
|
$tempOptions[$entity->getPK()] = $entity->getTitle();
|
||||||
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
|
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,19 +46,19 @@ class ServiceForm extends CustomerForm
|
|||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getCustomTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getCustomTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -46,38 +46,38 @@ class ServerForm extends EquipmentForm
|
|||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getFormOption_process($service, string $action, string $field, ?object $entity = null): array
|
protected function getFormOption_process($service, string $action, string $field, array $formDatas = []): array
|
||||||
{
|
{
|
||||||
$entities = [];
|
$entities = [];
|
||||||
switch ($action) {
|
switch ($field) {
|
||||||
case 'modify_form':
|
case 'ip':
|
||||||
if ($field === 'ip') {
|
if (array_key_exists($field, $formDatas)) {
|
||||||
$where = sprintf("status = '%s' OR %s='%s'", STATUS['AVAILABLE'], "ip", $entity->$field);
|
$where = sprintf("status = '%s' OR %s='%s'", STATUS['AVAILABLE'], $field, $formDatas[$field]);
|
||||||
$entities = $service->getEntities([$where => null]);
|
$entities = $service->getEntities([$where => null]);
|
||||||
} else {
|
} else {
|
||||||
$entities = parent::getFormOption_process($service, $action, $field, $entity);
|
$entities = parent::getFormOption_process($service, $action, $field, $formDatas);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$entities = parent::getFormOption_process($service, $action, $field, $entity);
|
$entities = parent::getFormOption_process($service, $action, $field, $formDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $entities;
|
return $entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('customer_serviceservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('customer_serviceservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
case 'switchinfo_uid':
|
case 'switchinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('part_switchservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('part_switchservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
@ -85,14 +85,14 @@ class ServerForm extends EquipmentForm
|
|||||||
// dd($options);
|
// dd($options);
|
||||||
break;
|
break;
|
||||||
case 'ip': //key=value이 같음주의
|
case 'ip': //key=value이 같음주의
|
||||||
foreach ($this->getFormOption_process(service('part_ipservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('part_ipservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getTitle()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getTitle()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class ServerPartForm extends EquipmentForm
|
|||||||
{
|
{
|
||||||
return service('part_' . strtolower($type) . 'service');
|
return service('part_' . strtolower($type) . 'service');
|
||||||
}
|
}
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
@ -58,21 +58,21 @@ class ServerPartForm extends EquipmentForm
|
|||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -27,19 +27,19 @@ class IPForm extends PartForm
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'lineinfo_uid':
|
case 'lineinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('equipment_lineservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('equipment_lineservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
case 'old_clientinfo_uid':
|
case 'old_clientinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ class IPForm extends PartForm
|
|||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -35,26 +35,26 @@ abstract class PartForm extends CommonForm
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('customer_serviceservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('customer_serviceservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -41,19 +41,19 @@ class PaymentForm extends CommonForm
|
|||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
{
|
{
|
||||||
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
foreach ($this->getFormOption_process(service('customer_serviceservice'), $action, $field, $entity) as $tempEntity) {
|
foreach ($this->getFormOption_process(service('customer_serviceservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||||
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
|
||||||
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())];
|
||||||
}
|
}
|
||||||
$options['options'] = $tempOptions;
|
$options['options'] = $tempOptions;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormOption($action, $field, $entity, $options);
|
$options = parent::getFormOption($action, $field, $formDatas, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -37,8 +37,12 @@ class ServiceHelper extends CustomerHelper
|
|||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
$value = $viewDatas['formOptions'][$field]['options'][$value];
|
$value = view_cell("\App\Cells\Equipment\ServerCell::detail", [
|
||||||
$value = "<span class=\"serverparts\" style=\"cursor:pointer;\" onClick=\"copyServerPartToClipboard('{$value}')\" text-data=\"{$value}\">📋</span>{$value}";
|
'serviceEntity' => $viewDatas['entity'],
|
||||||
|
'template' => 'servicelist',
|
||||||
|
]);
|
||||||
|
// $value = $viewDatas['formOptions'][$field]['options'][$value];
|
||||||
|
// $value = "<span class=\"serverparts\" style=\"cursor:pointer;\" onClick=\"copyServerPartToClipboard('{$value}')\" text-data=\"{$value}\">📋</span>{$value}";
|
||||||
break;
|
break;
|
||||||
case 'amount':
|
case 'amount':
|
||||||
case 'sale':
|
case 'sale':
|
||||||
|
|||||||
@ -48,6 +48,13 @@ class ServerHelper extends EquipmentHelper
|
|||||||
case 'format_at':
|
case 'format_at':
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
||||||
break;
|
break;
|
||||||
|
case 'part':
|
||||||
|
$value = view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||||
|
'serverinfo_uid' => $viewDatas['entity']->getPK(),
|
||||||
|
'types' => SERVERPART['SERVER_PARTTYPES'],
|
||||||
|
'template' => 'serverlist',
|
||||||
|
]);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
@ -69,6 +76,19 @@ class ServerHelper extends EquipmentHelper
|
|||||||
}
|
}
|
||||||
return $filter;
|
return $filter;
|
||||||
}
|
}
|
||||||
|
public function getListLabel(string $field, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
case 'part':
|
||||||
|
$label = parent::getListLabel($field, $label, $viewDatas, $extras);
|
||||||
|
$label .= "<span class=\"float-start rounded border border-primary\" style=\"cursor:pointer;\" onclick=\"copyServerPartsToClipboard()\">ALL 📋</span>";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = parent::getListLabel($field, $label, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ return [
|
|||||||
'switchinfo_uid' => "스위치",
|
'switchinfo_uid' => "스위치",
|
||||||
'ip' => "IP",
|
'ip' => "IP",
|
||||||
'os' => "OS",
|
'os' => "OS",
|
||||||
|
'part' => "부품",
|
||||||
'title' => "모델명",
|
'title' => "모델명",
|
||||||
'price' => "기본가",
|
'price' => "기본가",
|
||||||
'manufactur_at' => "입고일",
|
'manufactur_at' => "입고일",
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class BoardService extends CommonService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'category',
|
'category',
|
||||||
@ -108,6 +108,7 @@ class BoardService extends CommonService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -30,7 +30,7 @@ abstract class CommonService
|
|||||||
{
|
{
|
||||||
return $isArray ? $this->_classPaths : implode($delimeter, $this->_classPaths);
|
return $isArray ? $this->_classPaths : implode($delimeter, $this->_classPaths);
|
||||||
}
|
}
|
||||||
abstract public function action_init_process(string $action, ?object $entity = null): void;
|
abstract public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void;
|
||||||
/**
|
/**
|
||||||
* 단일 엔티티를 조회합니다.
|
* 단일 엔티티를 조회합니다.
|
||||||
* @return CommonEntity|null CommonEntity 인스턴스 또는 찾지 못했을 경우 null
|
* @return CommonEntity|null CommonEntity 인스턴스 또는 찾지 못했을 경우 null
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class AccountService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
@ -89,6 +89,7 @@ class AccountService extends CustomerService
|
|||||||
$fields = [...$fields, 'created_at'];
|
$fields = [...$fields, 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class ClientService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'site',
|
'site',
|
||||||
@ -98,6 +98,7 @@ class ClientService extends CustomerService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class CouponService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
@ -83,6 +83,7 @@ class CouponService extends CustomerService
|
|||||||
$fields = [...$fields, 'created_at'];
|
$fields = [...$fields, 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class PointService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
@ -83,6 +83,7 @@ class PointService extends CustomerService
|
|||||||
$fields = [...$fields, 'created_at'];
|
$fields = [...$fields, 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class ServiceService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"site",
|
"site",
|
||||||
@ -115,6 +115,7 @@ class ServiceService extends CustomerService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class LineService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"type",
|
"type",
|
||||||
@ -84,6 +84,7 @@ class LineService extends EquipmentService
|
|||||||
$fields = [...$fields, 'status', 'created_at'];
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class ServerPartService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"serverinfo_uid",
|
"serverinfo_uid",
|
||||||
@ -93,6 +93,7 @@ class ServerPartService extends EquipmentService
|
|||||||
$fields = [...$fields, 'created_at'];
|
$fields = [...$fields, 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class ServerService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"code",
|
"code",
|
||||||
@ -90,9 +90,23 @@ class ServerService extends EquipmentService
|
|||||||
break;
|
break;
|
||||||
case 'index':
|
case 'index':
|
||||||
case 'download':
|
case 'download':
|
||||||
$fields = ['clientinfo_uid', ...$fields, 'status', 'created_at'];
|
$fields = [
|
||||||
|
'clientinfo_uid',
|
||||||
|
"code",
|
||||||
|
"type",
|
||||||
|
"switchinfo_uid",
|
||||||
|
"ip",
|
||||||
|
"title",
|
||||||
|
"os",
|
||||||
|
"part",
|
||||||
|
"price",
|
||||||
|
"manufactur_at",
|
||||||
|
"format_at",
|
||||||
|
'status',
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class MylogService extends CommonService implements PipelineStepInterface
|
|||||||
}
|
}
|
||||||
return $this->_form;
|
return $this->_form;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = ['title', 'content'];
|
$fields = ['title', 'content'];
|
||||||
$filters = [];
|
$filters = [];
|
||||||
@ -62,6 +62,7 @@ class MylogService extends CommonService implements PipelineStepInterface
|
|||||||
$fields = [...$fields, 'status', 'created_at'];
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class CPUService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"title",
|
"title",
|
||||||
@ -81,6 +81,7 @@ class CPUService extends PartService
|
|||||||
$fields = [...$fields, 'status', 'created_at'];
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class CSService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"type",
|
"type",
|
||||||
@ -108,6 +108,7 @@ class CSService extends PartService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class DISKService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"title",
|
"title",
|
||||||
@ -82,6 +82,7 @@ class DISKService extends PartService
|
|||||||
$fields = [...$fields, "format", 'status', 'created_at'];
|
$fields = [...$fields, "format", 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class IPService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"lineinfo_uid",
|
"lineinfo_uid",
|
||||||
@ -99,6 +99,7 @@ class IPService extends PartService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class RAMService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"title",
|
"title",
|
||||||
@ -81,6 +81,7 @@ class RAMService extends PartService
|
|||||||
$fields = [...$fields, 'status', 'created_at'];
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class SOFTWAREService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_form;
|
return $this->_form;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"title",
|
"title",
|
||||||
@ -67,6 +67,7 @@ class SOFTWAREService extends PartService
|
|||||||
$fields = [...$fields, 'status', 'created_at'];
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class SWITCHService extends PartService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"code",
|
"code",
|
||||||
@ -100,6 +100,7 @@ class SWITCHService extends PartService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class PaymentService extends CommonService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
"serviceinfo_uid",
|
"serviceinfo_uid",
|
||||||
@ -119,6 +119,7 @@ class PaymentService extends CommonService
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class UserService extends CommonService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, ?object $entity = null): void
|
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'id',
|
'id',
|
||||||
@ -84,6 +84,7 @@ class UserService extends CommonService
|
|||||||
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->getFormService()->setFormDatas($formDatas);
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->setFormFields($fields);
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
$this->getFormService()->setFormRules($action, $fields);
|
||||||
$this->getFormService()->setFormFilters($filters);
|
$this->getFormService()->setFormFilters($filters);
|
||||||
|
|||||||
13
app/Views/cells/server/servicelist.php
Normal file
13
app/Views/cells/server/servicelist.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php $temps = []; ?>
|
||||||
|
<?php foreach ($serverCellDatas['entities'] as $entity): ?>
|
||||||
|
<?php $serverCellDatas['entity'] = $entity ?>
|
||||||
|
<?php $value = sprintf(
|
||||||
|
"%s / %s / %s / %s",
|
||||||
|
$entity->getCustomTitle(),
|
||||||
|
$serverCellDatas['helper']->getFieldView('switchinfo_uid', $entity->getSwitchInfoUID(), $serverCellDatas),
|
||||||
|
$entity->getIP(),
|
||||||
|
$entity->getOS()
|
||||||
|
) ?>
|
||||||
|
<?php $temps[] = "<span class=\"serverparts\" style=\"cursor:pointer;\" onClick=\"copyServerPartToClipboard('{$value}')\" text-data=\"{$value}\">📋</span>{$value}" ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?= implode("<BR>", $temps) ?>
|
||||||
@ -1,31 +0,0 @@
|
|||||||
<?php $htmls = $texts = [] ?>
|
|
||||||
<?php foreach ($serverPartCellDatas['types'] as $type): ?>
|
|
||||||
<?php $htmls[$type] = [] ?>
|
|
||||||
<?php $texts[$type] = []; ?>
|
|
||||||
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
|
||||||
<?php foreach ($entities as $entity): ?>
|
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
|
||||||
<?php $htmls[$type][] = $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
|
|
||||||
<?php $texts[$type][] = $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<?php $view_htmls = [
|
|
||||||
$serverPartCellDatas['helper']->getFieldView('SERVER', "", $serverPartCellDatas),
|
|
||||||
$serverPartCellDatas['serverEntity']->getIP(),
|
|
||||||
$serverPartCellDatas['serverEntity']->getSwitch(),
|
|
||||||
$serverPartCellDatas['serverEntity']->getOS()
|
|
||||||
] ?>
|
|
||||||
<?php foreach ($htmls as $type => $datas): ?><?php $view_htmls[] = implode(",", $datas) ?><?php endforeach ?>
|
|
||||||
<?php $view_texts = [
|
|
||||||
$serverPartCellDatas['serverEntity']->getCode(),
|
|
||||||
$serverPartCellDatas['serverEntity']->getIP(),
|
|
||||||
$serverPartCellDatas['serverEntity']->getSwitch(),
|
|
||||||
$serverPartCellDatas['serverEntity']->getOS()
|
|
||||||
] ?>
|
|
||||||
<?php foreach ($texts as $type => $datas): ?><?php $view_texts[] = implode(',', $datas) ?><?php endforeach ?>
|
|
||||||
<?php $text = implode("/", $view_texts) ?>
|
|
||||||
<div class="text-nowrap" style="font-size: 0.9em;">
|
|
||||||
<span class="serverparts" style="cursor:pointer;" onClick="copyServerPartToClipboard('<?= $text ?>')" text-data="<?= $text ?>">📋</span>
|
|
||||||
<?= implode("/", $view_htmls) ?>
|
|
||||||
</div>
|
|
||||||
Loading…
Reference in New Issue
Block a user