From: Gustavo Martin Morcuende Date: Tue, 11 Dec 2012 02:40:04 +0000 (+0100) Subject: Fixed error, CompanyCategory index web page. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=c78aedfa3cbfcebf22430af3d7bea2e34fab4638;p=mobi%2F.git Fixed error, CompanyCategory index web page. --- diff --git a/apps/companyfront/modules/category/templates/_list.php b/apps/companyfront/modules/category/templates/_list.php index a54fef0..59e05c8 100644 --- a/apps/companyfront/modules/category/templates/_list.php +++ b/apps/companyfront/modules/category/templates/_list.php @@ -34,7 +34,7 @@ - getId() != 1): ?> + getLevel() != 0): ?> @@ -42,7 +42,7 @@ - getId() != 1): ?> + getLevel() != 0): ?> ', 'category/delete?id='.$company_category->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?> diff --git a/lib/model/doctrine/CompanyCategoryTable.class.php b/lib/model/doctrine/CompanyCategoryTable.class.php index ca668d9..69c4b1d 100644 --- a/lib/model/doctrine/CompanyCategoryTable.class.php +++ b/lib/model/doctrine/CompanyCategoryTable.class.php @@ -29,13 +29,13 @@ class CompanyCategoryTable extends Doctrine_Table { return $this->createQuery('cc')->where('cc.company_id = ?', $companyId) ->andWhere('cc.id != ?', $currentCategory) - ->orWhere('cc.id = ?', '1') + ->orWhere('cc.level = ?', '0') ->orderBy('cc.lft'); } else { return $this->createQuery('cc')->where('cc.company_id = ?', $companyId) - ->orWhere('cc.id = ?', '1') + ->orWhere('cc.level = ?', '0') ->orderBy('cc.lft'); } }