From: Gusa Date: Sat, 15 Dec 2012 03:10:20 +0000 (+0100) Subject: Company categ may not link to main general categ. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=b4aee10c9a8a866241fafcb29757145da596da9d;p=mobi%2F.git Company categ may not link to main general categ. --- 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'));