}
$atf = new ArtifactTypeFactory ($project) ;
- $tids = $atf->getAllArtifactTypeIds () ;
- foreach ($tids as $tid) {
- $result['tracker'][$tid] = $this->getVal ('tracker', $tid) ;
+ if (!$atf->isError()) {
+ $tids = $atf->getAllArtifactTypeIds () ;
+ foreach ($tids as $tid) {
+ $result['tracker'][$tid] = $this->getVal ('tracker', $tid) ;
+ }
}
array_push ($sections,'tracker');
$sections = array_merge($sections, $sections_forum);
$ff = new ForumFactory ($project) ;
- $fids = $ff->getAllForumIds () ;
- foreach ($fids as $fid) {
- $result['forum'][$fid] = $this->getVal ('forum', $fid) ;
+ if (!$ff->isError()) {
+ $fids = $ff->getAllForumIdsWithNews () ;
+ foreach ($fids as $fid) {
+ $result['forum'][$fid] = $this->getVal ('forum', $fid) ;
+ }
}
array_push ($sections,'forum');
$result[$section_pm][$group_id] = $this->getVal ($section_pm, $group_id) ;
}
$sections = array_merge($sections, $sections_pm);
+
$pgf = new ProjectGroupFactory ($project) ;
- $pgids = $pgf->getAllProjectGroupIds () ;
- foreach ($pgids as $pgid) {
- $result['pm'][$pgid] = $this->getVal ('pm', $pgid) ;
+ if (!$pgf->isError()) {
+ $pgids = $pgf->getAllProjectGroupIds () ;
+ foreach ($pgids as $pgid) {
+ $result['pm'][$pgid] = $this->getVal ('pm', $pgid) ;
+ }
}
array_push ($sections,'pm') ;
$new_pa['tracker'] = array () ;
foreach ($projects as $p) {
$atf = new ArtifactTypeFactory ($p) ;
- $trackerids = $atf->getAllArtifactTypeIds () ;
- foreach ($trackerids as $tid) {
- if (array_key_exists ('tracker', $this->perms_array)
- && array_key_exists ($tid, $this->perms_array['tracker']) ) {
- $new_pa['tracker'][$tid] = $this->perms_array['tracker'][$tid] ;
- } elseif (array_key_exists ('new_tracker', $this->perms_array)
- && array_key_exists ($p->getID(), $this->perms_array['new_tracker']) ) {
- $new_pa['tracker'][$tid] = $new_pa['new_tracker'][$p->getID()] ;
+ if (!$atf->isError()) {
+ $trackerids = $atf->getAllArtifactTypeIds () ;
+ foreach ($trackerids as $tid) {
+ if (array_key_exists ('tracker', $this->perms_array)
+ && array_key_exists ($tid, $this->perms_array['tracker']) ) {
+ $new_pa['tracker'][$tid] = $this->perms_array['tracker'][$tid] ;
+ } elseif (array_key_exists ('new_tracker', $this->perms_array)
+ && array_key_exists ($p->getID(), $this->perms_array['new_tracker']) ) {
+ $new_pa['tracker'][$tid] = $new_pa['new_tracker'][$p->getID()] ;
+ }
}
}
}
$new_sa['forum'] = array () ;
$new_pa['forum'] = array () ;
foreach ($projects as $p) {
+ if (!$p->usesForum()) {
+ continue;
+ }
$ff = new ForumFactory ($p) ;
- $fids = $ff->getAllForumIds () ;
+ $fids = $ff->getAllForumIdsWithNews () ;
foreach ($fids as $fid) {
if (array_key_exists ('forum', $this->perms_array)
&& array_key_exists ($fid, $this->perms_array['forum']) ) {