return false;
}
+ $this->removeObsoleteSettings () ;
+
return true ;
}
}
}
+ function removeObsoleteSettings () {
+ db_begin () ;
+
+ // Remove obsolete project-wide settings
+ $sections = array ('project_read', 'project_admin', 'frs', 'scm', 'docman', 'tracker_admin', 'new_tracker', 'forum_admin', 'new_forum', 'pm_admin', 'new_pm', 'webcal') ;
+ db_query_params ('DELETE FROM pfo_role_setting where role_id=$1 AND section_name=ANY($2) and ref_id NOT IN (SELECT home_group_id FROM pfo_role WHERE role_id=$1 UNION SELECT group_id from role_project_refs WHERE role_id=$1)',
+ array ($this->getID(),
+ db_string_array_to_any_clause($sections))) ;
+
+
+ // Remove obsolete settings for multiple-instance tools
+ db_query_params ('DELETE FROM pfo_role_setting where role_id=$1 AND section_name=$2 and ref_id NOT IN (SELECT group_artifact_id FROM artifact_group_list WHERE group_id IN (SELECT home_group_id FROM pfo_role WHERE role_id=$1 UNION SELECT group_id from role_project_refs WHERE role_id=$1))',
+ array ($this->getID(),
+ 'tracker')) ;
+ db_query_params ('DELETE FROM pfo_role_setting where role_id=$1 AND section_name=$2 and ref_id NOT IN (SELECT group_project_id FROM project_group_list WHERE group_id IN (SELECT home_group_id FROM pfo_role WHERE role_id=$1 UNION SELECT group_id from role_project_refs WHERE role_id=$1))',
+ array ($this->getID(),
+ 'pm')) ;
+ db_query_params ('DELETE FROM pfo_role_setting where role_id=$1 AND section_name=$2 and ref_id NOT IN (SELECT group_forum_id FROM forum_group_list WHERE group_id IN (SELECT home_group_id FROM pfo_role WHERE role_id=$1 UNION SELECT group_id from role_project_refs WHERE role_id=$1))',
+ array ($this->getID(),
+ 'forum')) ;
+ db_commit () ;
+ return true ;
+ }
}
// Actual classes
}
function normalizeData () { // From the PFO spec
+ $this->removeObsoleteSettings () ;
+
$this->fetchData ($this->getID()) ;
$projects = $this->getLinkedProjects() ;