コード例 #1
0
ファイル: base.php プロジェクト: pombredanne/ArcherSys
 /**
  * Return the id of a group to which users should be added, if they authenticated but are not known to Kimai.
  * The default implementation uses the first group it can find.
  *
  * @return integer id of the group to add the user to
  **/
 public function getDefaultGroupId()
 {
     $groups = get_arr_grp();
     return $groups[0]['grp_id'];
 }
コード例 #2
0
ファイル: init.php プロジェクト: pombredanne/ArcherSys
    foreach (evt_get_grps($evt_data['evt_ID']) as $grp_id) {
        $data = grp_get_data($grp_id);
        $grp_names[] = $data['grp_name'];
    }
    $arr_evt[$row]['groups'] = implode(", ", $grp_names);
}
if (count($arr_evt) > 0) {
    $tpl->assign('arr_evt', $arr_evt);
} else {
    $tpl->assign('arr_evt', '0');
}
$tpl->assign('evt_display', $tpl->fetch("evt.tpl"));
$tpl->assign('selected_evt_filter', -2);
$tpl->assign('curr_user', $kga['usr']['usr_name']);
if ($kga['usr']['usr_sts'] == 0) {
    $tpl->assign('arr_grp', get_arr_grp(get_cookie('ap_ext_show_deleted_groups', 0)));
} else {
    $tpl->assign('arr_grp', get_arr_grp_by_leader($kga['usr']['usr_ID'], get_cookie('ap_ext_show_deleted_groups', 0)));
}
if ($kga['usr']['usr_sts'] == 0) {
    $tpl->assign('arr_usr', get_arr_usr(get_cookie('ap_ext_show_deleted_users', 0)));
} else {
    $tpl->assign('arr_usr', get_arr_watchable_users($kga['usr']['usr_ID']));
}
$tpl->assign('showDeletedGroups', get_cookie('ap_ext_show_deleted_groups', 0));
$tpl->assign('showDeletedUsers', get_cookie('ap_ext_show_deleted_users', 0));
$tpl->assign('languages', langs());
$tpl->assign('timezones', timezoneList());
$admin['users'] = $tpl->fetch("users.tpl");
$admin['groups'] = $tpl->fetch("groups.tpl");
$admin['advanced'] = $tpl->fetch("advanced.tpl");
コード例 #3
0
ファイル: floaters.php プロジェクト: pombredanne/ArcherSys
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
// insert KSPI
$isCoreProcessor = 0;
$dir_templates = "templates/floaters/";
require "../../includes/kspi.php";
switch ($axAction) {
    case "editUsr":
        // =============================
        // = Builds edit-user dialogue =
        // =============================
        $usr_details = get_usr($id);
        $arr = get_arr_grp();
        $i = 0;
        foreach ($arr as $row) {
            $arr_grp_name[$i] = $row['grp_name'];
            $arr_grp_ID[$i] = $row['grp_ID'];
            $i++;
        }
        $tpl->assign('arr_grp_ID', $arr_grp_ID);
        $tpl->assign('arr_grp_name', $arr_grp_name);
        $tpl->assign('usr_details', $usr_details);
        $tpl->display("edituser.tpl");
        break;
    case "editGrp":
        // =============================
        // = Builds edit-group dialogue =
        // =============================
コード例 #4
0
ファイル: func.php プロジェクト: pombredanne/ArcherSys
/**
 * Returns array for smarty's html_options funtion.
 *
 * <pre>
 * returns:
 * [0] -> pct/evt names
 * [1] -> values as IDs
 * </pre>
 *
 * @param string either 'pct', 'evt', 'knd', 'grp'
 * @return array
 * @author th, sl, kp
 */
function makeSelectBox($subject, $user, $selection = null)
{
    global $kga;
    $sel = array();
    $sel[0] = array();
    $sel[1] = array();
    switch ($subject) {
        case 'pct':
            $arr_pct = get_arr_pct($user);
            $i = 0;
            foreach ($arr_pct as $pct) {
                if ($pct['pct_visible']) {
                    if ($kga['conf']['flip_pct_display']) {
                        $sel[0][$i] = $pct['knd_name'] . ": " . $pct['pct_name'];
                        if ($kga['conf']['pct_comment_flag']) {
                            $sel[0][$i] .= "(" . $pct['pct_comment'] . ")";
                        }
                    } else {
                        $sel[0][$i] = $pct['pct_name'] . " (" . $pct['knd_name'] . ")";
                        if ($kga['conf']['pct_comment_flag']) {
                            $sel[0][$i] .= "(" . $pct['pct_comment'] . ")";
                        }
                    }
                    $sel[1][$i] = $pct['pct_ID'];
                    $i++;
                }
            }
            break;
        case 'evt':
            $arr_evt = get_arr_evt($user);
            $i = 0;
            foreach ($arr_evt as $evt) {
                if ($evt['evt_visible']) {
                    $sel[0][$i] = $evt['evt_name'];
                    $sel[1][$i] = $evt['evt_ID'];
                    $i++;
                }
            }
            break;
        case 'knd':
            $arr_knd = get_arr_knd($user);
            $i = 0;
            $selectionFound = false;
            foreach ($arr_knd as $knd) {
                if ($knd['knd_visible']) {
                    $sel[0][$i] = $knd['knd_name'];
                    $sel[1][$i] = $knd['knd_ID'];
                    $i++;
                    if ($selection == $knd['knd_ID']) {
                        $selectionFound = true;
                    }
                }
            }
            if ($selection != null && !$selectionFound) {
                $data = knd_get_data($selection);
                $sel[0][$i] = $data['knd_name'];
                $sel[1][$i] = $data['knd_ID'];
            }
            break;
        case 'grp':
            $arr_grp = get_arr_grp();
            $i = 0;
            foreach ($arr_grp as $grp) {
                if (!$grp['grp_trash']) {
                    $sel[0][$i] = $grp['grp_name'];
                    $sel[1][$i] = $grp['grp_ID'];
                    $i++;
                }
            }
            break;
        default:
            // TODO leave default options empty ???
            break;
    }
    return $sel;
}