// Add custom field.
$include_cf_1 = $options['show_custom_field_1'] || $grouping_by_cf_1;
if ($include_cf_1) {
- $custom_fields = new CustomFields($user->group_id);
+ $custom_fields = new CustomFields($user->getActiveGroup());
$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
array_push($fields, 'cfl.value as cf_1');
// Use custom fields plugin if it is enabled.
if ($user->isPluginEnabled('cf'))
- $custom_fields = new CustomFields($user->group_id);
+ $custom_fields = new CustomFields($user->getActiveGroup());
// Define some styles to use in email.
$style_title = 'text-align: center; font-size: 15pt; font-family: Arial, Helvetica, sans-serif;';
$join .= ' left join tt_tasks t on (l.task_id = t.id)';
}
if (ttReportHelper::groupingBy('cf_1', $options)) {
- $custom_fields = new CustomFields($user->group_id);
+ $custom_fields = new CustomFields($user->getActiveGroup());
if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT)
$join .= ' left join tt_custom_field_log cfl on (l.id = cfl.log_id and cfl.status = 1) left join tt_custom_field_options cfo on (cfl.value = cfo.id)';
elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)
$mdb2 = getConnection();
$sql = "select id, name, description, rank, rights, status from tt_roles
- where id = $id and group_id = $user->group_id and (status = 0 or status = 1)";
+ where id = $id and group_id = ".$user->getActiveGroup()." and (status = 0 or status = 1)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
$mdb2 = getConnection();
global $user;
- $sql = "select id from tt_roles where group_id = $user->group_id and name = ".
- $mdb2->quote($role_name)." and (status = 1 or status = 0)";
+ $sql = "select id from tt_roles where group_id = ".$user->getActiveGroup().
+ " and name = ".$mdb2->quote($role_name)." and (status = 1 or status = 0)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
global $user;
$mdb2 = getConnection();
- $sql = "select rights from tt_roles where group_id = $user->group_id and id = $role_id";
+ $sql = "select rights from tt_roles where group_id = ".$user->getActiveGroup()." and id = $role_id";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.08.4378 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.08.4379 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($cl_rank >= $user->rank || $cl_rank < 0) $err->add($i18n->get('error.field'), $i18n->get('form.roles.rank'));
+ if ($err->no() && ttRoleHelper::getRoleByName($cl_name)) $err->add($i18n->get('error.object_exists'));
if ($err->no()) {
$existing_role = ttRoleHelper::getRoleByRank($cl_rank, $user->group_id);