From 7e66a87b5de4000fd6fdf0f5834adf128d5fa491 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 21 Nov 2023 08:48:41 +0000 Subject: [PATCH] * Adjust NEW_CHILD_COUNT to config. --- module/dept/config.php | 2 ++ module/dept/ui/browse.html.php | 2 +- module/dept/view/browse.html.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 module/dept/config.php diff --git a/module/dept/config.php b/module/dept/config.php new file mode 100644 index 0000000000..c977033212 --- /dev/null +++ b/module/dept/config.php @@ -0,0 +1,2 @@ +dept->newChildCount = 10; diff --git a/module/dept/ui/browse.html.php b/module/dept/ui/browse.html.php index 119c217e9e..ae1efbbe87 100644 --- a/module/dept/ui/browse.html.php +++ b/module/dept/ui/browse.html.php @@ -63,7 +63,7 @@ foreach($sons as $dept) } $emptyInputs = array(); -for($i = 0; $i < 10; $i ++) +for($i = 0; $i < $config->dept->newChildCount; $i ++) { $emptyInputs[] = formGroup ( diff --git a/module/dept/view/browse.html.php b/module/dept/view/browse.html.php index af037e0710..d5036c7aac 100644 --- a/module/dept/view/browse.html.php +++ b/module/dept/view/browse.html.php @@ -53,7 +53,7 @@ if($sonDept->order > $maxOrder) $maxOrder = $sonDept->order; echo html::input("depts[id$sonDept->id]", $sonDept->name, "class='form-control'"); } - for($i = 0; $i < 10; $i ++) echo html::input("depts[]", '', "class='form-control'"); + for($i = 0; $i < $config->dept->newChildCount; $i ++) echo html::input("depts[]", '', "class='form-control'"); ?>