X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttAdmin.class.php;h=30c78f94b8eb9b22b86d10a95b54045a1f3c5804;hb=15ae2165165da813912300d223c50b74f44cc1e0;hp=83b93a7676dd0791b534f2d455c005045317e374;hpb=45c855269d952873285f7a835e82fc2b3eff3971;p=timetracker.git diff --git a/WEB-INF/lib/ttAdmin.class.php b/WEB-INF/lib/ttAdmin.class.php index 83b93a76..30c78f94 100644 --- a/WEB-INF/lib/ttAdmin.class.php +++ b/WEB-INF/lib/ttAdmin.class.php @@ -168,7 +168,7 @@ class ttAdmin { // If we mark all of them deleted here, we can't recover nicely // as we'll lose track of what was deleted by user. // - // 2) DB maintenance script (Clean up DB from inactive teams) should + // 2) DB maintenance script (Clean up DB from inactive groups) should // get rid of these items permanently eventually. // Mark group deleted. @@ -189,7 +189,7 @@ class ttAdmin { $result = true; if (!ttValidString($fields['group_name'], true)) { - $this->err->add($i18n->get('error.field'), $i18n->get('label.team_name')); + $this->err->add($i18n->get('error.field'), $i18n->get('label.group_name')); $result = false; } if (!ttValidString($fields['user_name'])) { @@ -332,4 +332,24 @@ class ttAdmin { return true; } + + // getGroupDetails obtains group name and its top manager details. + function getGroupDetails($group_id) { + $result = array(); + $mdb2 = getConnection(); + + $sql = "select g.name as group_name, u.id as manager_id, u.name as manager_name, u.login as manager_login, u.email as manager_email". + " from tt_groups g". + " inner join tt_users u on (u.group_id = g.id)". + " inner join tt_roles r on (r.id = u.role_id and r.rank = 512)". + " where g.id = $group_id"; + + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + $val = $res->fetchRow(); + return $val; + } + + return false; + } }