dbms_init...1

This commit is contained in:
choi.jh 2025-06-09 17:18:51 +09:00
parent 6dcbc493f3
commit e1e5faeeae
2 changed files with 18 additions and 11 deletions

View File

@ -303,7 +303,7 @@ abstract class CommonController extends BaseController
//입력값정의
$formDatas = [];
foreach ($this->getFormFields() as $field) {
$formDatas[$field] = $this->request->getVar($field);
$formDatas[$field] = $this->request->getPost($field);
}
// dd($formDatas);
$this->entity = $this->create_process($formDatas);
@ -374,8 +374,9 @@ abstract class CommonController extends BaseController
//입력값정의
$formDatas = [];
foreach ($this->getFormFields() as $field) {
$formDatas[$field] = $this->request->getVar($field);
$formDatas[$field] = $this->request->getPost($field);
}
// dd($formDatas);
$this->entity = $this->modify_process($entity, $formDatas);
$this->getService()->getModel()->transCommit();
return $this->getResultSuccess();

View File

@ -254,30 +254,36 @@ class CommonHelper
$form = form_textarea($field, $value ?? "", ['id' => $field, 'class' => $extra_class, ...array_diff_key($extras, ['class' => ''])]);
break;
case 'status':
if (in_array($viewDatas['control']['action'], ['create', 'modify', 'create_form', 'modify_form'])) {
$forms = [];
foreach ($viewDatas['control']['filter_optons'][$field] as $key => $label) {
$forms[] = form_radio($label, $key, $key == $value) . $label;
}
$form = implode(" ", $forms);
} else {
$formOptions = ["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택'];
foreach ($viewDatas['control']['filter_optons'][$field] as $key => $label) {
$formOptions[$key] = $label;
}
$form = form_dropdown($field, $formOptions, $value, $extras);
}
break;
default:
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (!is_array($viewDatas['control']['filter_optons'][$field])) {
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
}
//codeigniter 함수사용시
$formOptions = ["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택'];
foreach ($viewDatas['control']['filter_optons'][$field] as $key => $label) {
$formOptions[$key] = $label;
}
$form = form_dropdown($field, $formOptions, $value, $extras);
//* $form = form_dropdown($field, $formOptions, $value, $extras); --> form_dropdown사용시 form_dropdown() 함수 내부에서 htmlspecialchars()가 실행되어 javascript에서는 "로 바뀌어 javascript가 실행되 않는 문제발생
//직접작성 함수사용시
// $onChange= isset($extras["onChange"]) ? " onChange=\"{$extras["onChange"]}\"":"";
// $forms = [
// "<select name=\"{$field}\"{$onChange}>",
// "<option value=\"\">". lang($viewDatas['class_path'] . '.label.' . $field) . " 선택</option>"
// ];
// foreach ($viewDatas['control']['filter_optons'][$field] as $key => $label) {
// $isSelected = ($key == $value) ? ' selected="selected"' : '';
// $forms[] = "<option value=\"{$key}\"{$isSelected}>{$label}</option>";
// }
// $forms[]="</select>";
// $form = implode("",$forms);
} else {
$form = form_input($field, $value ?? "", ["autocomplete" => $field, ...$extras]);
}
@ -311,7 +317,7 @@ class CommonHelper
default:
if (in_array($field, $viewDatas['control']['filter_fields'])) {
$extras["onChange"] = sprintf(
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
"location.href='%s/toggle/%s/%s?%s='+this.options[this.selectedIndex].value",
current_url(),
$viewDatas['entity']->getPK(),
$field,