Project

General

Profile

Bug #16393 » tt_news_patch2_5_0.diff

Administrator Admin, 2007-06-14 11:54

View differences:

class.tx_ttnews_clean.php Mon Jun 11 18:19:41 2007
// overwrite the groupBy value for categories
if (!$this->catExclusive && $selectConf['groupBy'] == 'category') {
$selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
// NSA version category patch BEGIN
$selectConf['leftjoin'] = 'tt_news_cat_mm ON (tt_news.uid = tt_news_cat_mm.uid_local OR (SELECT t2.uid FROM tt_news AS t2 WHERE t2.t3ver_oid=tt_news.uid AND t2.t3ver_wsid="'.$GLOBALS['TSFE']->sys_page->versioningWorkspaceId.'" && t2.t3ver_wsid!="")=tt_news_cat_mm.uid_local)';
// NSA version category patch END
$selectConf['groupBy'] = 'tt_news_cat_mm.uid_foreign';
$selectConf['selectFields'] = 'DISTINCT tt_news.uid,tt_news.*';
}
......
if ($this->conf[$prefix_display.'.']['catOrderBy']) {
$this->config['catOrderBy'] = $this->conf[$prefix_display.'.']['catOrderBy'];
}
$this->categories[$row['uid']] = $this->getCategories($row['uid']);
// NSA PATCH BEGIN
if ($this->versioningEnabled && $row['_ORIG_uid']) {
$this->categories[$row['uid']] = $this->getCategories($row['_ORIG_uid']);
}else{
$this->categories[$row['uid']] = $this->getCategories($row['uid']);
}
// NSA PATCH END
if ($row['type'] == 1 || $row['type'] == 2) {
// News type article or external url
$this->local_cObj->setCurrentVal($row['type'] == 1 ? $row['page']:$row['ext_url']);
......
if ($this->config['categoryMode'] == 1 || $this->config['categoryMode'] == 2) {
// show items with selected categories
$tmpCatExclusive = ($this->config['categoryMode'] == 2 && !$this->conf['ignoreUseSubcategoriesForAndSelection'] ? $this->actuallySelectedCategories : $this->catExclusive);
$selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
// NSA PATCH BEGIN
$selectConf['leftjoin'] = 'tt_news_cat_mm ON (tt_news.uid = tt_news_cat_mm.uid_local OR (SELECT t2.uid FROM tt_news AS t2 WHERE t2.t3ver_oid=tt_news.uid AND t2.t3ver_wsid="'.$GLOBALS['TSFE']->sys_page->versioningWorkspaceId.'" && t2.t3ver_wsid!="")=tt_news_cat_mm.uid_local)';
// NSA PATCH END
$selectConf['where'] .= ' AND (IFNULL(tt_news_cat_mm.uid_foreign,0) IN (' . ($tmpCatExclusive ? $tmpCatExclusive : 0) . '))';
}
// de-select newsitems by their categories
if (($this->config['categoryMode'] == -1 || $this->config['categoryMode'] == -2)) {
// do not show items with selected categories
$selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
// NSA PATCH BEGIN
$selectConf['leftjoin'] = 'tt_news_cat_mm ON (tt_news.uid = tt_news_cat_mm.uid_local OR (SELECT t2.uid FROM tt_news AS t2 WHERE t2.t3ver_oid=tt_news.uid AND t2.t3ver_wsid="'.$GLOBALS['TSFE']->sys_page->versioningWorkspaceId.'" && t2.t3ver_wsid!="")=tt_news_cat_mm.uid_local)';
// NSA PATCH END
$selectConf['where'] .= ' AND (IFNULL(tt_news_cat_mm.uid_foreign,0) NOT IN (' . ($this->catExclusive?$this->catExclusive:0) . '))';
$selectConf['where'] .= ' AND (tt_news_cat_mm.uid_foreign)'; // filter out not categoized records
}
} elseif ($this->config['categoryMode']) {
// special case: if $this->catExclusive is not set but $this->config['categoryMode'] -> show only non-categized records
$selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
// NSA PATCH BEGIN
$selectConf['leftjoin'] = 'tt_news_cat_mm ON (tt_news.uid = tt_news_cat_mm.uid_local OR (SELECT t2.uid FROM tt_news AS t2 WHERE t2.t3ver_oid=tt_news.uid AND t2.t3ver_wsid="'.$GLOBALS['TSFE']->sys_page->versioningWorkspaceId.'" && t2.t3ver_wsid!="")=tt_news_cat_mm.uid_local)';
// NSA PATCH END
$selectConf['where'] .= ' AND (IFNULL(tt_news_cat_mm.uid_foreign,'.$GLOBALS['TYPO3_DB']->fullQuoteStr('nocat', 'tt_news').') ' . ($this->config['categoryMode'] > 0?'':'!') . '='.$GLOBALS['TYPO3_DB']->fullQuoteStr('nocat', 'tt_news').')';
}
(3-3/6)