return true;
}
- // The getTeamDetails function returns team details.
- static function getTeamDetails($group_id) {
- $result = array();
- $mdb2 = getConnection();
-
- $sql = "select t.name as team_name, u.id as manager_id, u.name as manager_name, u.login as manager_login, u.email as manager_email
- from tt_groups t
- inner join tt_users u on (u.group_id = t.id)
- inner join tt_roles r on (r.id = u.role_id and r.rank = 512)
- where t.id = $group_id";
-
- $res = $mdb2->query($sql);
- if (!is_a($res, 'PEAR_Error')) {
- $val = $res->fetchRow();
- return $val;
- }
-
- return false;
- }
-
// The insert function creates a new team.
static function insert($fields) {
$task_required_part = ' , task_required = '.(int) $fields['task_required'];
$record_type_part = '';
$bcc_email_part = '';
+ $allow_ip = '';
$plugins_part = '';
$config_part = '';
$lock_spec_part = '';
if (isset($fields['tracking_mode'])) $tracking_mode_part = ', tracking_mode = '.(int) $fields['tracking_mode'];
if (isset($fields['record_type'])) $record_type_part = ', record_type = '.(int) $fields['record_type'];
if (isset($fields['bcc_email'])) $bcc_email_part = ', bcc_email = '.$mdb2->quote($fields['bcc_email']);
+ if (isset($fields['allow_ip'])) $allow_ip_part = ', allow_ip = '.$mdb2->quote($fields['allow_ip']);
if (isset($fields['plugins'])) $plugins_part = ', plugins = '.$mdb2->quote($fields['plugins']);
if (isset($fields['config'])) $config_part = ', config = '.$mdb2->quote($fields['config']);
if (isset($fields['lock_spec'])) $lock_spec_part = ', lock_spec = '.$mdb2->quote($fields['lock_spec']);
$sql = "update tt_groups set $name_part $currency_part $lang_part $decimal_mark_part
$date_format_part $time_format_part $week_start_part $tracking_mode_part $task_required_part $record_type_part
- $bcc_email_part $plugins_part $config_part $lock_spec_part $workday_minutes_part $modified_part where id = $group_id";
+ $bcc_email_part $allow_ip_part $plugins_part $config_part $lock_spec_part $workday_minutes_part $modified_part where id = $group_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
$plugins = implode(',', $plugin_array);
if ($plugins != $user->plugins) {
- if (!ttTeamHelper::update($user->group_id, array('name' => $user->team,'plugins' => $plugins)))
+ if (!ttTeamHelper::update($user->group_id, array('name' => $user->group,'plugins' => $plugins)))
return false;
$user->plugins = $plugins;
}