From c6a9013ae701554bf1e8d5edc82e61a68b5f7a1d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 21 Jun 2023 18:44:12 +0800 Subject: [PATCH] * Refactor holiday::edit. --- module/holiday/control.php | 2 +- module/holiday/ui/edit.html.php | 82 +++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 module/holiday/ui/edit.html.php diff --git a/module/holiday/control.php b/module/holiday/control.php index 38698b70d7..ca1c7a1543 100644 --- a/module/holiday/control.php +++ b/module/holiday/control.php @@ -86,7 +86,7 @@ class holiday extends control { $this->holiday->update($id); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'load' => true)); } $this->view->title = $this->lang->holiday->edit; diff --git a/module/holiday/ui/edit.html.php b/module/holiday/ui/edit.html.php new file mode 100644 index 0000000000..f4af724ac3 --- /dev/null +++ b/module/holiday/ui/edit.html.php @@ -0,0 +1,82 @@ + + * @package holiday + * @link https://www.zentao.net + */ +namespace zin; + +formPanel +( + set::title($lang->holiday->edit), + set::formClass('border-0'), + formRow + ( + formGroup + ( + set::width('1/2'), + set::label($lang->holiday->type), + radioList + ( + set::inline(true), + set::name('type'), + set::items($lang->holiday->typeList), + set::value($holiday->type), + ), + ), + ), + formRow + ( + formGroup + ( + set::width('1/2'), + set::label($lang->holiday->begin), + set::control('date'), + set::name('begin'), + set::value($holiday->begin), + ), + ), + formRow + ( + formGroup + ( + set::width('1/2'), + set::label($lang->holiday->end), + set::control('date'), + set::name('end'), + set::value($holiday->end), + ), + ), + formRow + ( + formGroup + ( + set::width('1/2'), + set::label($lang->holiday->name), + set::name('name'), + set::value($holiday->name), + ), + ), + formRow + ( + formGroup + ( + set::width('1/2'), + set::label($lang->holiday->desc), + editor + ( + set::name('desc'), + set::rows('2'), + set::value($holiday->desc), + ) + ), + ), +); + + +render(); +