}
$this->masterTemplate = 'project.html';
- $p = DB_DataObject::factory('Projects');
+ $p = DB_DataObject::factory('core_project');
$p->get( $this->currentProject());
$this->project = $p;
}
///DB_DataObject::debugLevel(1);
// fetch permissions.
- $gr = DB_DataObject::factory('Group_Rights');
+ $gr = DB_DataObject::factory('core_group_right');
$ar = $gr->defaultPermData();
//echo '<PRE>';print_r($ar);
$perms = array();
$perms[] = $nm;
}
- $gr = DB_DataObject::factory('Group_Rights');
+ $gr = DB_DataObject::factory('core_group_right');
$gr->whereAddIn('rightname', $perms, 'string');
$gr->selectAdd();
$gids = $gr->fetchAll('group_id');
//print_R($gids);
- $g = DB_DataObject::Factory('groups');
+ $g = DB_DataObject::factory('core_group');
$g->whereAddIn('id',$gids, 'int');
$this->groups = $g->fetchAll( );
if ($this->authUser->company()->comptype !='OWNER') {
$pr->whereAdd("role=''");
}
+ $pr->orderBY('role DESC');
$ar = $pr->fetchAll();
$pd->person = $pd->person();
$pd->person->perms = $pd->person->getPerms();
- $g = DB_DataObject::Factory('Group_Members');
+ $g = DB_DataObject::factory('core_group_member');
$pd->person->groups = $g->listGroupMembership($pd->person);
$str = '<input class="mtrack-perm" type="checkbox" name="'. $p->id . '_'. $g->id. '" value="1"';
- if (in_array($g->id, $p->person->groups)) {
+ if (in_array($g->id, $p->groups)) {
$str .= ' checked="checked"';
}
return $str. '>';
switch ($_POST['action']) {
case 'perm':
- DB_DataObject::debugLevel(1);
+ //DB_DataObject::debugLevel(1);
if ($this->authUser->company()->comptype != 'OWNER') {
$this->jerr("Owner company only");
}
$this->jerr("permission denied");
}
- $p = DB_DataObject::factory('Person');
+ $p = DB_DataObject::factory('core_person');
if (empty($_POST['uid']) || !$p->get($_POST['uid'])) {
$this->jerr("invalid user");
}
- $g = DB_DataObject::factory('Groups');
+ $g = DB_DataObject::factory('core_group');
if (empty($_POST['gid']) || !$g->get($_POST['gid'])) {
$this->jerr("invalid group");
}
$state = empty($_POST['value']) ? 0 : 1;
- $gm = DB_DataObject::factory('Group_Members');
+ $gm = DB_DataObject::factory('core_group_member');
$gm->change($p, $g, $state);
$this->jok("updated");
+ case 'role':
+ //DB_DataObject::debugLevel(1);
+ if ($this->authUser->company()->comptype != 'OWNER') {
+ $this->jerr("Owner company only");
+ }
+ // which role ... this is not really correct.
+ if (!$this->hasPerm('Core.Groups', 'E')) {
+ $this->jerr("permission denied");
+ }
+
+ $pd = DB_DataObject::factory('ProjectDirectory');
+ if (empty($_POST['pdid']) || !$pd->get($_POST['pdid'])) {
+ $this->jerr("invalid line");
+ }
+ $pd->role = $_POST['value'];
+ $pd->update();
+
+
+
+
+
default:
$this->jerr("invalid action");