From 3c2de0d3a654c33e297faed1185f72d332493a98 Mon Sep 17 00:00:00 2001 From: lixiaoyu Date: Wed, 23 Oct 2024 10:57:11 +0800 Subject: [PATCH] *[task#130841,doing,2h,4h] modify the code of branch name validation information. --- module/branch/test/lib/batcheditbranch.ui.class.php | 3 ++- module/branch/test/lib/createbranch.ui.class.php | 6 ++++-- module/branch/test/lib/editbranch.ui.class.php | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/module/branch/test/lib/batcheditbranch.ui.class.php b/module/branch/test/lib/batcheditbranch.ui.class.php index 84eac375d8..14424520d0 100644 --- a/module/branch/test/lib/batcheditbranch.ui.class.php +++ b/module/branch/test/lib/batcheditbranch.ui.class.php @@ -31,7 +31,8 @@ class batchEditBranchTester extends tester if ($form->dom->allTab === false) { $nameTip = $form->dom->$tipDom->getText(); - $nameEmptyTip = sprintf($this->lang->error->notempty, $this->lang->branch->name); + $branchName = sprintf($this->lang->branch->name, $this->lang->branch->common); + $nameEmptyTip = sprintf($this->lang->error->notempty, $branchName); if ($nameTip === $nameEmptyTip) return $this->success('分支名称必填提示信息正确'); if ($editBranch->name != '' && $form->dom->$tipDom) { diff --git a/module/branch/test/lib/createbranch.ui.class.php b/module/branch/test/lib/createbranch.ui.class.php index c734897fd2..401ce47f9c 100755 --- a/module/branch/test/lib/createbranch.ui.class.php +++ b/module/branch/test/lib/createbranch.ui.class.php @@ -23,10 +23,12 @@ class createBranchTester extends tester $form->wait(2); if ($form->dom->createBranchForm) { - if ($this->checkFormTips('branch')) return $this->success('分支名称必填提示信息正确'); + $nameTip = $form->dom->nameTip->getText(); + $branchName = sprintf($this->lang->branch->name, $this->lang->branch->common); + $nameEmptyTip = sprintf($this->lang->error->notempty, $branchName); + if ($nameTip == $nameEmptyTip) return $this->success('分支名称必填提示信息正确'); if ($branch->name != '' && $form->dom->nameTip) { - //分支已存在 $nameTip = str_replace('@branch@', $this->lang->branch->common, $this->lang->branch->existName); return ($form->dom->nameTip->getText() == $nameTip) ? $this->success('分支已存在提示信息正确') diff --git a/module/branch/test/lib/editbranch.ui.class.php b/module/branch/test/lib/editbranch.ui.class.php index cc03edd72b..63b837d9a6 100644 --- a/module/branch/test/lib/editbranch.ui.class.php +++ b/module/branch/test/lib/editbranch.ui.class.php @@ -23,8 +23,11 @@ class editBranchTester extends tester $form->wait(2); if ($form->dom->zin_branch_edit_1_form) { - if ($this->checkFormTips('branch')) return $this->success('分支名称必填提示信息正确'); - if (isset($editBranch->name) && ($form->dom->nameTip)) + $nameTip = $form->dom->nameTip->getText(); + $branchName = sprintf($this->lang->branch->name, $this->lang->branch->common); + $nameEmptyTip = sprintf($this->lang->error->notempty, $branchName); + if ($nameTip == $nameEmptyTip) return $this->success('分支名称必填提示信息正确'); + if ($editBranch->name != '' && $form->dom->nameTip) { //分支已存在 $nameTip = str_replace('@branch@', $this->lang->branch->common, $this->lang->branch->existName);