cfmgrv4 init...3

This commit is contained in:
최준흠 2024-10-17 10:08:30 +09:00
parent fc4e3d6668
commit e318f06a0e
3 changed files with 8 additions and 5 deletions

View File

@ -167,7 +167,7 @@ class RecordController extends CloudflareController
$this->action = __FUNCTION__; $this->action = __FUNCTION__;
//데이터가 있는경우 Field만 처리하기위해 //데이터가 있는경우 Field만 처리하기위해
$fields = []; $fields = [];
foreach (['content', 'proxied'] as $field) { foreach (['type', 'content', 'proxied'] as $field) {
if ($this->request->getVar($field)) { if ($this->request->getVar($field)) {
$fields[$field] = $field; $fields[$field] = $field;
} }
@ -252,7 +252,7 @@ class RecordController extends CloudflareController
$this->field_rules = $this->getModel()->getFieldRules($this->action, $this->fields); $this->field_rules = $this->getModel()->getFieldRules($this->action, $this->fields);
$this->filter_fields = [$this->getModel()::PARENT, 'type', 'proxied', 'fixed']; $this->filter_fields = [$this->getModel()::PARENT, 'type', 'proxied', 'fixed'];
$this->field_options = $this->getFormFieldOptions($this->filter_fields); $this->field_options = $this->getFormFieldOptions($this->filter_fields);
$this->batchjob_fields = ['content', 'proxied']; $this->batchjob_fields = ['type', 'content', 'proxied'];
return $this->list_procedure(); return $this->list_procedure();
} }
// Download // Download

View File

@ -98,6 +98,9 @@ class RecordHelper extends CommonHelper
$value .= '<script>var tooltipTriggerList = [].slice.call(document.querySelectorAll(\'[data-bs-toggle="tooltip"]\'));var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {return new bootstrap.Tooltip(tooltipTriggerEl);});</script>'; $value .= '<script>var tooltipTriggerList = [].slice.call(document.querySelectorAll(\'[data-bs-toggle="tooltip"]\'));var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {return new bootstrap.Tooltip(tooltipTriggerEl);});</script>';
} }
break; break;
case 'type':
$value = $value === 'A' ? parent::getFieldView($field, $viewDatas, $extras) : $viewDatas['field_options'][$field][$value];
break;
default: default:
$value = parent::getFieldView($field, $viewDatas, $extras); $value = parent::getFieldView($field, $viewDatas, $extras);
break; break;
@ -127,7 +130,7 @@ class RecordHelper extends CommonHelper
switch ($action) { switch ($action) {
case 'modify': case 'modify':
$checkbox = ""; $checkbox = "";
if ($viewDatas['entity']->type == 'A' && $viewDatas['entity']->fixed != 'on') { if ($viewDatas['entity']->fixed != 'on') {
$pk = $viewDatas['entity']->getPK(); $pk = $viewDatas['entity']->getPK();
$oldBatchJobUids = old("batchjob_uids") ?? []; $oldBatchJobUids = old("batchjob_uids") ?? [];
$oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids]; $oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids];

View File

@ -207,10 +207,10 @@ class CommonHelper
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"]; $label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
} }
$query = $viewDatas['uri']->getQuery(['except' => ['order_field', 'order_value']]); $query = $viewDatas['uri']->getQuery(['except' => ['order_field', 'order_value']]);
$query .= empty($query) ? "?" : "&"; $query .= empty($query) ? "" : "&";
$query .= "order_field={$field}&order_value="; $query .= "order_field={$field}&order_value=";
$query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC"; $query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$label = anchor(current_url() . $query, $label); $label = anchor(current_url() . "?" . $query, $label);
break; break;
} }
return $label; return $label;