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 @@