if (!$project_id) {
return false;
}
- $p = DB_DataObject::factory('Projects');
+ $p = DB_DataObject::factory('core_project');
$p->get($project_id);
if (!$this->authUser) {
if ($p->code != '*PUBLIC') {
$ar = $this->userProjects();
- //print_r($ar);
+
if (!isset($ar[$currentProject])) {
$currentProject = false;
$_SESSION[__CLASS__]['active_project_id'] = false;
if (empty($currentProject)) {
- //$p = DB_DataObject::factory('Projects');
+ //$p = DB_DataObject::factory('core_project');
//$p->get('code', '*PUBLIC');
$id = 0;
foreach($ar as $k=>$v) {
function userProjects()
{
- $p = DB_DataObject::factory('Projects');
+ $p = DB_DataObject::factory('core_project');
if (!$this->authUser) {
$p->code = '*PUBLIC';
$ar = $p->fetchAll('id', 'name');
} else {
- //DB_DAtaObject::debugLevel(1);
- $p->applyFilters(array(), $this->authUser);
+
+ // DB_DAtaObject::debugLevel(1);
+ $p->applyFilters(array(), $this->authUser, $this);
if (!$this->authUser->hasPerm('Core.Projects_All', 'S')) {
$p->whereAdd("Projects.id in (SELECT ProjectDirectory.project_id FROM ProjectDirectory WHERE
person_id = ". $this->authUser->id . " and role != '')");
}
+ /*
+ * SOME PROJECTS MIGHT NOT HAVE REPO's...
$p->whereAdd('id in (SELECT distinct(project_id) FROM mtrack_repos)');
+ */
// $pd->whereAdd("role != ''");
$p->orderBy('Projects.name ASC');
function getAuthUser()
{
- $u = DB_DataObject::factory('Person');
+ $u = DB_DataObject::factory('core_person');
if (!$u->isAuth()) {
return false;
}
//MTrackConfig::boot(); // eak.. .remove me...
- $this->authUser = DB_DataObject::factory('Person')->getAuthUser();
+ $this->authUser = DB_DataObject::factory('core_person')->getAuthUser();
$this->loadProjectList();
- $p = DB_DataObject::factory('Projects');
+ $p = DB_DataObject::factory('core_project');
$p->get($this->currentProject());
$this->currentProject = $p; /// mix up?
//
-
+ HTML_FlexyFramework::get()->generateDataobjectsCache();
+
if (!empty($loc)) {
die ("invalid location". htmlspecialchars($loc));