From b4aee10c9a8a866241fafcb29757145da596da9d Mon Sep 17 00:00:00 2001 From: Gusa Date: Sat, 15 Dec 2012 04:10:20 +0100 Subject: [PATCH] Company categ may not link to main general categ. --- lib/form/doctrine/CompanyCategoryForm.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/form/doctrine/CompanyCategoryForm.class.php b/lib/form/doctrine/CompanyCategoryForm.class.php index 2fee475..f530850 100644 --- a/lib/form/doctrine/CompanyCategoryForm.class.php +++ b/lib/form/doctrine/CompanyCategoryForm.class.php @@ -28,12 +28,22 @@ class CompanyCategoryForm extends BaseCompanyCategoryForm 'add_empty' => false, 'query' => $companyCategs)); + $this->widgetSchema['general_categ_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GeneralCategory'), + 'add_empty' => true, + 'query' => GeneralCategoryTable::getInstance()->getGeneralCategoriesByLftQuery())); + + $this->widgetSchema['company_categ_description'] = new sfWidgetFormTextarea(); $this->validatorSchema['parent_category'] = new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'required' => true, 'query' => $companyCategs)); + $this->validatorSchema['general_categ_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GeneralCategory'), + 'required' => false, + 'query' => GeneralCategoryTable::getInstance()->getGeneralCategoriesByLftQuery())); + + $this->widgetSchema->setLabels(array('parent_category' => 'Parent Company Category')); $this->widgetSchema->setLabels(array('general_categ_id' => 'General Category')); -- 2.1.4