$this->pager->init();
+ $this->userLanguageId = $this->getUser()->getGuardUser()->getLanguage()->getId();
$this->languageCode = $language->getCode();
}
<?php foreach ($ads as $ad): ?>
<tr>
<td><img src="<?php echo $ad->getAd()->getAdMobileImageLink() ?>" alt="<?php echo $ad->getAdName() ?>"/></td>
- <td><?php echo $ad->getAd()->getCompanyCategId() ?></td>
+ <td><?php echo CompanyCategoryDescriptionTable::getInstance()->getCategGeneralFromIdDAOImpl($userLanguageId, $ad->getAd()->getCompanyCategId())->get(0)->company_categ_name?></td>
+
<td><?php echo $ad->getAdName() ?></td>
<td><a href="<?php echo url_for('ad/edit?id='.$ad->getAd()->getId()) ?>"><img src="/images/pencil_add.png" alt="" title="" border="0" /></a></td>
<td><?php echo link_to('<img src="/images/inadminpanel/images/trash.png" alt="" title="" border="0" />', 'ad/delete?id='.$ad->getAd()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?></td>
</table>
</form>
-<?php include_partial('ad/list', array('ads' => $pager->getResults())) ?>
+<?php include_partial('ad/list', array('ads' => $pager->getResults(), 'userLanguageId' => $userLanguageId)) ?>
<?php if ($pager->haveToPaginate()): ?>
<div class="pagination">
{
public function configure()
{
- //$this->useFields(array('language_id', 'ad_id', 'ad_name', 'ad_description', 'ad_mobile_text', 'ad_link'));
unset($this['ad_id']);
if ($this->object->exists())
{
return Doctrine_Core::getTable('CompanyCategoryDescription');
}
-}
\ No newline at end of file
+
+
+ /**
+ * Return
+ *
+ * @return Doctrine Collection
+ */
+ public function getCategGeneralFromIdDAOImpl($languageId, $companyCategId)
+ {
+ $q = Doctrine_Query::create()
+ ->from('CompanyCategoryDescription cgd')
+ ->where('cgd.company_categ_id = ?', $companyCategId)
+ ->andWhere('cgd.language_id = ?', $languageId);
+
+ $doccollect=$q->execute();
+
+ return $doccollect;
+ }
+}