Planning::showAddUserForm PHP Method

showAddUserForm() static public method

Actually called by ajax/planning.php
static public showAddUserForm ( ) : Nothing
return Nothing (display function)
    static function showAddUserForm()
    {
        global $CFG_GLPI;
        $rand = mt_rand();
        $used = array();
        foreach (array_keys($_SESSION['glpi_plannings']) as $actor) {
            $actor = explode("_", $actor);
            if ($actor[0] == "user") {
                $used[] = $actor[1];
            }
        }
        echo __("User") . " :<br>";
        // show only users with right to add planning events
        $rights = array('change', 'problem', 'reminder', 'task', 'projecttask');
        // Can we see only personnal planning ?
        if (!Session::haveRightsOr('planning', array(self::READALL, self::READGROUP))) {
            $rights = 'id';
        }
        // Can we see user of my groups ?
        if (Session::haveRight('planning', self::READGROUP) && !Session::haveRight('planning', self::READALL)) {
            $rights = 'groups';
        }
        User::dropdown(array('entity' => $_SESSION['glpiactive_entity'], 'entity_sons' => $_SESSION['glpiactive_entity_recursive'], 'right' => $rights, 'used' => $used));
        echo "<br /><br />";
        echo Html::hidden('action', array('value' => 'send_add_user_form'));
        echo Html::submit(_sx('button', 'Add'));
    }

Usage Example

Ejemplo n.º 1
0
    echo Planning::updateEventTimes($_REQUEST);
    exit;
}
Html::header_nocache();
header("Content-Type: text/html; charset=UTF-8");
if ($_REQUEST["action"] == "add_event_fromselect") {
    Planning::showAddEventForm($_REQUEST);
}
if ($_REQUEST["action"] == "add_event_sub_form") {
    Planning::showAddEventSubForm($_REQUEST);
}
if ($_REQUEST["action"] == "add_planning_form") {
    Planning::showAddPlanningForm();
}
if ($_REQUEST["action"] == "add_user_form") {
    Planning::showAddUserForm();
}
if ($_REQUEST["action"] == "add_group_users_form") {
    Planning::showAddGroupUsersForm();
}
if ($_REQUEST["action"] == "add_group_form") {
    Planning::showAddGroupForm();
}
if ($_REQUEST["action"] == "add_event_classic_form") {
    Planning::showAddEventClassicForm($_REQUEST);
}
if ($_REQUEST["action"] == "edit_event_form") {
    Planning::editEventForm($_REQUEST);
}
if ($_REQUEST["action"] == "get_filters_form") {
    Planning::showPlanningFilter();