From 38c3d54c4f1f87eb9226400b845b2aa0124f36fd Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Wed, 16 May 2012 03:54:22 +0200 Subject: [PATCH] Language Company Category fields. Using the user's language to show the name of the company category fields related to one ad. --- .../modules/ad/actions/actions.class.php | 1 + apps/companyfront/modules/ad/templates/_list.php | 3 ++- .../modules/ad/templates/indexSuccess.php | 2 +- lib/form/doctrine/AdDescriptionForm.class.php | 1 - .../CompanyCategoryDescriptionTable.class.php | 20 +++++++++++++++++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apps/companyfront/modules/ad/actions/actions.class.php b/apps/companyfront/modules/ad/actions/actions.class.php index 8e78acd..dddc753 100644 --- a/apps/companyfront/modules/ad/actions/actions.class.php +++ b/apps/companyfront/modules/ad/actions/actions.class.php @@ -51,6 +51,7 @@ class adActions extends sfActions $this->pager->init(); + $this->userLanguageId = $this->getUser()->getGuardUser()->getLanguage()->getId(); $this->languageCode = $language->getCode(); } diff --git a/apps/companyfront/modules/ad/templates/_list.php b/apps/companyfront/modules/ad/templates/_list.php index 09e66bd..bad7921 100644 --- a/apps/companyfront/modules/ad/templates/_list.php +++ b/apps/companyfront/modules/ad/templates/_list.php @@ -18,7 +18,8 @@ <?php echo $ad->getAdName() ?> - getAd()->getCompanyCategId() ?> + getCategGeneralFromIdDAOImpl($userLanguageId, $ad->getAd()->getCompanyCategId())->get(0)->company_categ_name?> + getAdName() ?> ', 'ad/delete?id='.$ad->getAd()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?> diff --git a/apps/companyfront/modules/ad/templates/indexSuccess.php b/apps/companyfront/modules/ad/templates/indexSuccess.php index 5c2dfd1..810802e 100644 --- a/apps/companyfront/modules/ad/templates/indexSuccess.php +++ b/apps/companyfront/modules/ad/templates/indexSuccess.php @@ -12,7 +12,7 @@ - $pager->getResults())) ?> + $pager->getResults(), 'userLanguageId' => $userLanguageId)) ?> haveToPaginate()): ?>