cfmgr4 init...4
This commit is contained in:
parent
86531c9ecf
commit
54e067a1c4
@ -70,10 +70,10 @@ class UserController extends AdminController
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'role':
|
case 'role':
|
||||||
//아래 Rule Array는 필드명.* checkbox를 사용
|
//아래 Rule Array는 필드명.* checkbox를 사용
|
||||||
$this->validation->setRule($field . "*", $field, $this->getModel()->getRule($action, $field));
|
$this->validation->setRule($field . "*", $field, $this->getModel()->getFieldRule($action, $field));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->validation->setRule($field, $field, $this->getModel()->getRule($action, $field));
|
$this->validation->setRule($field, $field, $this->getModel()->getFieldRule($action, $field));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,10 +103,10 @@ class UserController extends AdminController
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'role':
|
case 'role':
|
||||||
//아래 Rule Array는 필드명.* checkbox를 사용
|
//아래 Rule Array는 필드명.* checkbox를 사용
|
||||||
$this->validation->setRule($field . "*", $field, $this->getModel()->getRule($action, $field));
|
$this->validation->setRule($field . "*", $field, $this->getModel()->getFieldRule($action, $field));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->validation->setRule($field, $field, $this->getModel()->getRule($action, $field));
|
$this->validation->setRule($field, $field, $this->getModel()->getFieldRule($action, $field));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,9 +102,9 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->create_process();
|
$this->create_process();
|
||||||
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
||||||
$this->getModel()->transCommit();
|
|
||||||
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//Transaction Rollback
|
//Transaction Rollback
|
||||||
@ -153,6 +153,7 @@ abstract class MVController extends CommonController
|
|||||||
}
|
}
|
||||||
protected function modify_process(string $uid): void
|
protected function modify_process(string $uid): void
|
||||||
{
|
{
|
||||||
|
// dd($this->fields);
|
||||||
$this->modify_validate($this->action, $this->fields);
|
$this->modify_validate($this->action, $this->fields);
|
||||||
$this->formDatas = $this->getFormDatas();
|
$this->formDatas = $this->getFormDatas();
|
||||||
$this->entity = $this->getModel()->getEntityByPK(intval($uid));
|
$this->entity = $this->getModel()->getEntityByPK(intval($uid));
|
||||||
@ -167,9 +168,9 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->modify_process($uid);
|
$this->modify_process($uid);
|
||||||
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
||||||
$this->getModel()->transCommit();
|
|
||||||
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//Transaction Rollback
|
//Transaction Rollback
|
||||||
@ -181,10 +182,10 @@ abstract class MVController extends CommonController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//단일필드작업
|
//단일필드작업
|
||||||
final public function toggle(string $field, string $uid): RedirectResponse
|
final public function toggle(string $uid, string $field): RedirectResponse
|
||||||
{
|
{
|
||||||
$this->action = __FUNCTION__;
|
$this->action = __FUNCTION__;
|
||||||
$this->field = [$field];
|
$this->fields = [$field];
|
||||||
return $this->modify_procedure($uid);
|
return $this->modify_procedure($uid);
|
||||||
}
|
}
|
||||||
//일괄처리작업
|
//일괄처리작업
|
||||||
@ -207,9 +208,9 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->batcjob_process();
|
$this->batcjob_process();
|
||||||
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
||||||
$this->getModel()->transCommit();
|
|
||||||
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//Transaction Rollback
|
//Transaction Rollback
|
||||||
@ -235,9 +236,9 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->delete_process($uid);
|
$this->delete_process($uid);
|
||||||
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
log_message("notice", __FUNCTION__ . "=> 작업을 완료하였습니다.");
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " => 작업을 완료하였습니다.\n");
|
||||||
$this->getModel()->transCommit();
|
|
||||||
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//Transaction Rollback
|
//Transaction Rollback
|
||||||
|
|||||||
@ -26,8 +26,9 @@ function getFieldForm_UserHelper(string $field, mixed $value, array $viewDatas,
|
|||||||
if (in_array($viewDatas['action'], ['create', 'modify'])) {
|
if (in_array($viewDatas['action'], ['create', 'modify'])) {
|
||||||
$forms = [];
|
$forms = [];
|
||||||
foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
||||||
$roles = explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
log_message("debug", var_export($value, true));
|
||||||
$forms[] = form_checkbox("{$field}[]", $value, in_array($key, $roles)) . $label;
|
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
||||||
|
$forms[] = form_checkbox($field, $key, in_array($key, $values)) . $label;
|
||||||
}
|
}
|
||||||
$form = implode(" ", $forms);
|
$form = implode(" ", $forms);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<div>
|
<div>
|
||||||
<?= $viewDatas['session']->getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?>
|
<?= $viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG']) ? alert_CommonHelper($viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG'])) : "" ?>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user