From 4785c20062d8d014a7941477dc27dbfaee01c7d7 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 25 Mar 2010 12:38:03 +0000 Subject: [PATCH] + add the required fields for company module. --- trunk/module/company/config.php | 3 +++ trunk/module/company/model.php | 4 ++-- trunk/module/company/view/create.html.php | 16 ++++++++-------- trunk/module/company/view/edit.html.php | 18 +++++++++--------- 4 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 trunk/module/company/config.php diff --git a/trunk/module/company/config.php b/trunk/module/company/config.php new file mode 100644 index 0000000000..e4eed9c887 --- /dev/null +++ b/trunk/module/company/config.php @@ -0,0 +1,3 @@ +company->create->requiredFields = 'name,pms'; +$config->company->edit->requiredFields = 'name,pms'; diff --git a/trunk/module/company/model.php b/trunk/module/company/model.php index 498e43a36e..310a61afb2 100644 --- a/trunk/module/company/model.php +++ b/trunk/module/company/model.php @@ -69,7 +69,7 @@ class companyModel extends model $this->dao->insert(TABLE_COMPANY) ->data($company) ->autoCheck() - ->batchCheck('name, pms', 'notempty') + ->batchCheck($this->config->company->create->requiredFields, 'notempty') ->batchCheck('name,pms', 'unique') ->exec(); } @@ -81,7 +81,7 @@ class companyModel extends model $this->dao->update(TABLE_COMPANY) ->data($company) ->autoCheck() - ->batchCheck('name, pms', 'notempty') + ->batchCheck($this->config->company->edit->requiredFields, 'notempty') ->batchCheck('name,pms', 'unique', "id != '$companyID'") ->where('id')->eq($companyID) ->exec(); diff --git a/trunk/module/company/view/create.html.php b/trunk/module/company/view/create.html.php index 87bf983db5..0f2b95762b 100644 --- a/trunk/module/company/view/create.html.php +++ b/trunk/module/company/view/create.html.php @@ -29,35 +29,35 @@ company->create;?> company->name;?> - + company->phone;?> - + company->fax;?> - + company->address;?> - + company->zipcode;?> - + company->website;?> - + company->backyard;?> - + company->pms;?> - + company->guest;?> diff --git a/trunk/module/company/view/edit.html.php b/trunk/module/company/view/edit.html.php index 6beec9745b..33231f0bea 100644 --- a/trunk/module/company/view/edit.html.php +++ b/trunk/module/company/view/edit.html.php @@ -25,39 +25,39 @@
- +
- + - + - + - + - + - + - + - +
company->create;?>
company->name;?>name, "class='text-1'");?>
company->phone;?>phone, "class='text-1'");?>
company->fax;?>fax, "class='text-1'");?>
company->address;?>address, "class='text-1'");?>
company->zipcode;?>zipcode, "class='text-1'");?>
company->website;?>website, "class='text-1'");?>
company->backyard;?>backyard, "class='text-1'");?>
company->pms;?>pms, "class='text-1'");?>
company->guest;?>