Fixed some inconsistencies in the interface (thanks Luigi).

This commit is contained in:
Loic d'Anterroches
2008-08-08 20:34:40 +02:00
parent 6360ea93be
commit bd0209a28e
7 changed files with 824 additions and 136 deletions

View File

@@ -266,16 +266,20 @@ class IDF_Project extends Pluf_Model
* project. For issues, only open issues are used to generate the
* cloud.
*
* @param string ('issues') or 'downloads'
* @param string ('issues') 'closed_issues' or 'downloads'
* @return ArrayObject of IDF_Tag
*/
public function getTagCloud($what='issues')
{
$tag_t = Pluf::factory('IDF_Tag')->getSqlTable();
if ($what == 'issues') {
if ($what == 'issues' or $what == 'closed_issues') {
$what_t = Pluf::factory('IDF_Issue')->getSqlTable();
$asso_t = $this->_con->pfx.'idf_issue_idf_tag_assoc';
$ostatus = $this->getTagIdsByStatus('open');
if ($what == 'issues') {
$ostatus = $this->getTagIdsByStatus('open');
} else {
$ostatus = $this->getTagIdsByStatus('closed');
}
if (count($ostatus) == 0) $ostatus[] = 0;
$sql = sprintf('SELECT '.$tag_t.'.id AS id, COUNT(*) AS nb_use FROM '.$tag_t.' '."\n".
'LEFT JOIN '.$asso_t.' ON idf_tag_id='.$tag_t.'.id '."\n".