2 require_once 'MTrackWeb.php';
4 class MTrackWeb_Project extends MTrackWeb
7 //function getAuth-- inherit
9 function get($code='') {
11 if (isset($_REQUEST['active_project_id'])) {
12 $this->currentProject($_REQUEST['active_project_id']);
13 return $this->jok($this->currentProject());
16 if (!isset($_REQUEST['ajax_body'])) {
19 $this->masterTemplate = 'project.html';
21 $p = DB_DataObject::factory('Projects');
22 $p->get( $this->currentProject());
27 $this->milestones = $this->project->milestones();
35 if (!$this->authUser) {
38 ///DB_DataObject::debugLevel(1);
40 $gr = DB_DataObject::factory('Group_Rights');
41 $ar = $gr->defaultPermData();
42 //echo '<PRE>';print_r($ar);
44 foreach($ar as $nm=>$data) {
45 if (!preg_match('/^MTrack\./', $nm)) {
51 $gr = DB_DataObject::factory('Group_Rights');
52 $gr->whereAddIn('rightname', $perms, 'string');
55 $gr->selectAdd('distinct(group_id) as group_id');
56 $gr->whereAdd("AccessMask != ''");
57 $gids = $gr->fetchAll('group_id');
60 $g = DB_DataObject::Factory('groups');
61 $g->whereAddIn('id',$gids, 'int');
62 $this->groups = $g->fetchAll( );
65 // find out which groups are using those perms... so that we can offer membership to people..
70 // members... (might be large one day)
71 $pr = DB_DataObject::Factory('ProjectDirectory');
72 $pr->project_id = $this->currentProject();
75 if ($this->authUser->company()->comptype !='OWNER') {
76 $pr->whereAdd("role=''");
78 $ar = $pr->fetchAll();
80 $pd->person = $pd->person();
81 $pd->person->perms = $pd->person->getPerms();
82 $pd->person->groups = $pd->person->groups();
83 $this->people[] = $pd;
90 function checkGroupPerson($g,$p)
92 if (in_array($g->id, $p->_groups)) {