本文整理汇总了PHP中Profile::dropdownUnder方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::dropdownUnder方法的具体用法?PHP Profile::dropdownUnder怎么用?PHP Profile::dropdownUnder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::dropdownUnder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSpecificMassiveActionsParameters
/**
* @see CommonDBTM::showSpecificMassiveActionsParameters()
**/
function showSpecificMassiveActionsParameters($input = array())
{
global $CFG_GLPI;
switch ($input['action']) {
case "change_authtype":
$rand = Auth::dropdown(array('name' => 'authtype'));
$paramsmassaction = array('authtype' => '__VALUE__');
Ajax::updateItemOnSelectEvent("dropdown_authtype{$rand}", "show_massiveaction_field", $CFG_GLPI["root_doc"] . "/ajax/dropdownMassiveActionAuthMethods.php", $paramsmassaction);
echo "<span id='show_massiveaction_field'><br><br>";
echo "<input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Post') . "'>";
echo "</span>\n";
return true;
case "add_user_group":
$gu = new Group_User();
return $gu->showSpecificMassiveActionsParameters($input);
case "add_userprofile":
Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities']));
echo ". " . _n('Profile', 'Profiles', 1) . " ";
Profile::dropdownUnder();
echo ". " . __('Recursive') . " ";
Dropdown::showYesNo("is_recursive", 0);
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Add') . "'>";
return true;
default:
return parent::showSpecificMassiveActionsParameters($input);
}
return false;
}
示例2: showForm
//.........这里部分代码省略.........
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Phone') . "</td><td>";
Html::autocompletionTextField($this, "phone");
echo "</td>";
//Authentications information : auth method used and server used
//don't display is creation of a new user'
if (!empty($ID)) {
if (Session::haveRight(self::$rightname, self::READAUTHENT)) {
echo "<td>" . __('Authentication') . "</td><td>";
echo Auth::getMethodName($this->fields["authtype"], $this->fields["auths_id"]);
if (!empty($this->fields["date_sync"])) {
//TRANS: %s is the date of last sync
echo '<br>' . sprintf(__('Last synchronization on %s'), HTML::convDateTime($this->fields["date_sync"]));
}
if (!empty($this->fields["user_dn"])) {
//TRANS: %s is the user dn
echo '<br>' . sprintf(__('%1$s: %2$s'), __('User DN'), $this->fields["user_dn"]);
}
if ($this->fields['is_deleted_ldap']) {
echo '<br>' . __('User missing in LDAP directory');
}
echo "</td>";
} else {
echo "<td colspan='2'> </td>";
}
} else {
echo "<td colspan='2'><input type='hidden' name='authtype' value='1'></td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Mobile phone') . "</td><td>";
Html::autocompletionTextField($this, "mobile");
echo "</td>";
echo "<td>" . __('Category') . "</td><td>";
UserCategory::dropdown(array('value' => $this->fields["usercategories_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Phone 2') . "</td><td>";
Html::autocompletionTextField($this, "phone2");
echo "</td>";
echo "<td rowspan='4' class='middle'>" . __('Comments') . "</td>";
echo "<td class='center middle' rowspan='4'>";
echo "<textarea cols='45' rows='6' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'><td>" . __('Administrative number') . "</td><td>";
Html::autocompletionTextField($this, "registration_number");
echo "</td></tr>";
echo "<tr class='tab_bg_1'><td>" . _x('person', 'Title') . " :</td><td>";
UserTitle::dropdown(array('value' => $this->fields["usertitles_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
if (!empty($ID)) {
echo "<td>" . __('Location') . "</td><td>";
$entities = Profile_User::getUserEntities($ID, true);
if (count($entities) <= 0) {
$entities = -1;
}
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $entities));
echo "</td>";
}
echo "</tr>";
if (empty($ID)) {
echo "<tr class='tab_bg_1'>";
echo "<th colspan='2'>" . _n('Authorization', 'Authorizations', 1) . "</th>";
echo "<td>" . __('Recursive') . "</td><td>";
Dropdown::showYesNo("_is_recursive", 0);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Profile') . "</td><td>";
Profile::dropdownUnder(array('name' => '_profiles_id', 'value' => Profile::getDefault()));
echo "</td><td>" . __('Entity') . "</td><td>";
Entity::dropdown(array('name' => '_entities_id', 'display_emptychoice' => false, 'entity' => $_SESSION['glpiactiveentities']));
echo "</td></tr>";
} else {
if ($caneditpassword) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Default profile') . "</td><td>";
$options = Dropdown::getDropdownArrayNames('glpi_profiles', Profile_User::getUserProfiles($this->fields['id']));
Dropdown::showFromArray("profiles_id", $options, array('value' => $this->fields["profiles_id"], 'display_emptychoice' => true));
echo "</td><td>" . __('Default entity') . "</td><td>";
$entities = Profile_User::getUserEntities($this->fields['id'], 1);
Entity::dropdown(array('value' => $this->fields["entities_id"], 'entity' => $entities));
echo "</td></tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2' class='center'>";
//TRANS: %s is the date
printf(__('Last update on %s'), HTML::convDateTime($this->fields["date_mod"]));
echo "<br>";
printf(__('Last login on %s'), HTML::convDateTime($this->fields["last_login"]));
echo "</td><td colspan='2'class='center'>";
if ($ID > 0) {
echo "<a target='_blank' href='" . $CFG_GLPI["root_doc"] . "/front/user.form.php?getvcard=1&id={$ID}'>" . __('Vcard') . "</a>";
}
echo "</td></tr>";
}
$this->showFormButtons($options);
return true;
}
示例3: showForEntity
/**
* Show users of an entity
*
* @param $entity Entity object
**/
static function showForEntity(Entity $entity)
{
global $DB, $CFG_GLPI, $LANG;
$ID = $entity->getField('id');
if (!$entity->can($ID, "r")) {
return false;
}
$canedit = $entity->can($ID, "w");
$canshowuser = haveRight("user", "r");
$nb_per_line = 3;
$rand = mt_rand();
if ($canedit) {
echo "<form name='entityuser_form{$rand}' id='entityuser_form{$rand}' method='post' action='";
echo getItemTypeFormURL(__CLASS__) . "'>";
$headerspan = $nb_per_line * 2;
} else {
$headerspan = $nb_per_line;
}
if ($canedit) {
echo "<div class='firstbloc'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th colspan='5'>" . $LANG['setup'][605] . "</tr>";
echo "<tr><td class='tab_bg_2 center'>" . $LANG['common'][34] . " : ";
echo "<input type='hidden' name='entities_id' value='{$ID}'>";
User::dropdown(array('right' => 'all'));
echo "</td><td class='tab_bg_2 center'>" . $LANG['profiles'][22] . " : ";
Profile::dropdownUnder(array('value' => Profile::getDefault()));
echo "</td><td class='tab_bg_2 center'>" . $LANG['profiles'][28] . " : ";
Dropdown::showYesNo("is_recursive", 0);
echo "</td><td class='tab_bg_2 center'>";
echo "<input type='submit' name='add' value=\"" . $LANG['buttons'][8] . "\" class='submit'>";
echo "</td></tr>";
echo "</table></div>";
}
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixehov'>";
echo "<tr><th colspan='{$headerspan}'>" . $LANG['Menu'][14] . " (D=" . $LANG['profiles'][29] . ", R=" . $LANG['profiles'][28] . ")</th></tr>";
$query = "SELECT DISTINCT `glpi_profiles`.`id`, `glpi_profiles`.`name`\n FROM `glpi_profiles_users`\n LEFT JOIN `glpi_profiles`\n ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`)\n LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)\n WHERE `glpi_profiles_users`.`entities_id` = '{$ID}'\n AND `glpi_users`.`is_deleted` = '0'";
$result = $DB->query($query);
if ($DB->numrows($result) > 0) {
initNavigateListItems('User', $LANG['entity'][0] . " = " . $entity->fields['name']);
while ($data = $DB->fetch_array($result)) {
echo "<tr><th colspan='{$headerspan}'>" . $LANG['profiles'][22] . " : " . $data["name"];
echo "</th></tr>";
$query = "SELECT `glpi_users`.*,\n `glpi_profiles_users`.`id` AS linkID,\n `glpi_profiles_users`.`is_recursive`,\n `glpi_profiles_users`.`is_dynamic`\n FROM `glpi_profiles_users`\n LEFT JOIN `glpi_users`\n ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)\n WHERE `glpi_profiles_users`.`entities_id` = '{$ID}'\n AND `glpi_users`.`is_deleted` = '0'\n AND `glpi_profiles_users`.`profiles_id` = '" . $data['id'] . "'\n ORDER BY `glpi_profiles_users`.`profiles_id`,\n `glpi_users`.`name`,\n `glpi_users`.`realname`,\n `glpi_users`.`firstname`";
$result2 = $DB->query($query);
if ($DB->numrows($result2) > 0) {
$i = 0;
while ($data2 = $DB->fetch_array($result2)) {
addToNavigateListItems('User', $data2["id"]);
if ($i % $nb_per_line == 0) {
if ($i != 0) {
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
}
if ($canedit) {
echo "<td width='10'>";
echo "<input type='checkbox' name='item[" . $data2["linkID"] . "]' value='1'>";
echo "</td>";
}
echo "<td>";
echo formatUserName($data2["id"], $data2["name"], $data2["realname"], $data2["firstname"], $canshowuser);
if ($data2["is_dynamic"] || $data2["is_recursive"]) {
echo "<strong> (";
if ($data2["is_dynamic"]) {
echo "D";
}
if ($data2["is_dynamic"] && $data2["is_recursive"]) {
echo ", ";
}
if ($data2["is_recursive"]) {
echo "R";
}
echo ")</strong>";
}
echo "</td>";
$i++;
}
while ($i % $nb_per_line != 0) {
echo "<td> </td>";
if ($canedit) {
echo "<td> </td>";
}
$i++;
}
echo "</tr>";
} else {
echo "<tr colspan='{$headerspan}'>" . $LANG['common'][54] . "</tr>";
}
}
}
echo "</table>";
if ($canedit) {
openArrowMassive("entityuser_form{$rand}", true);
//.........这里部分代码省略.........
示例4: showForEntity
/**
* Show users of an entity
*
* @param $entity Entity object
**/
static function showForEntity(Entity $entity)
{
global $DB;
$ID = $entity->getField('id');
if (!$entity->can($ID, READ)) {
return false;
}
$canedit = $entity->canEdit($ID);
$canshowuser = User::canView();
$nb_per_line = 3;
$rand = mt_rand();
if ($canedit) {
$headerspan = $nb_per_line * 2;
} else {
$headerspan = $nb_per_line;
}
if ($canedit) {
echo "<div class='firstbloc'>";
echo "<form name='entityuser_form{$rand}' id='entityuser_form{$rand}' method='post' action='";
echo Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th colspan='6'>" . __('Add an authorization to a user') . "</tr>";
echo "<tr class='tab_bg_1'><td class='tab_bg_2 center'>" . __('User') . " ";
echo "<input type='hidden' name='entities_id' value='{$ID}'>";
User::dropdown(array('right' => 'all'));
echo "</td><td class='tab_bg_2 center'>" . self::getTypeName(1) . "</td><td>";
Profile::dropdownUnder(array('value' => Profile::getDefault()));
echo "</td><td class='tab_bg_2 center'>" . __('Recursive') . "</td><td>";
Dropdown::showYesNo("is_recursive", 0);
echo "</td><td class='tab_bg_2 center'>";
echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
$query = "SELECT DISTINCT `glpi_profiles`.`id`, `glpi_profiles`.`name`\n FROM `glpi_profiles_users`\n LEFT JOIN `glpi_profiles`\n ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`)\n LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)\n WHERE `glpi_profiles_users`.`entities_id` = '{$ID}'\n AND `glpi_users`.`is_deleted` = '0'";
$result = $DB->query($query);
$nb = $DB->numrows($result);
echo "<div class='spaced'>";
if ($canedit && $nb) {
Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
$massiveactionparams = array('container' => 'mass' . __CLASS__ . $rand, 'specific_actions' => array('purge' => _x('button', 'Delete permanently')));
Html::showMassiveActions($massiveactionparams);
}
echo "<table class='tab_cadre_fixehov'>";
echo "<thead><tr>";
echo "<th class='noHover' colspan='{$headerspan}'>";
printf(__('%1$s (%2$s)'), _n('User', 'Users', Session::getPluralNumber()), __('D=Dynamic, R=Recursive'));
echo "</th></tr></thead>";
if ($nb) {
Session::initNavigateListItems('User', sprintf(__('%1$s = %2$s'), Entity::getTypeName(1), $entity->getName()));
while ($data = $DB->fetch_assoc($result)) {
echo "<tbody><tr class='noHover'>";
$reduce_header = 0;
if ($canedit && $nb) {
echo "<th width='10'>";
echo Html::checkAllAsCheckbox("profile" . $data['id'] . "_{$rand}");
echo "</th>";
$reduce_header++;
}
echo "<th colspan='" . ($headerspan - $reduce_header) . "'>";
printf(__('%1$s: %2$s'), __('Profile'), $data["name"]);
echo "</th></tr></tbody>";
echo "<tbody id='profile" . $data['id'] . "_{$rand}'>";
$query = "SELECT `glpi_users`.*,\n `glpi_profiles_users`.`id` AS linkID,\n `glpi_profiles_users`.`is_recursive`,\n `glpi_profiles_users`.`is_dynamic`\n FROM `glpi_profiles_users`\n LEFT JOIN `glpi_users`\n ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)\n WHERE `glpi_profiles_users`.`entities_id` = '{$ID}'\n AND `glpi_users`.`is_deleted` = '0'\n AND `glpi_profiles_users`.`profiles_id` = '" . $data['id'] . "'\n ORDER BY `glpi_profiles_users`.`profiles_id`,\n `glpi_users`.`name`,\n `glpi_users`.`realname`,\n `glpi_users`.`firstname`";
$result2 = $DB->query($query);
if ($DB->numrows($result2) > 0) {
$i = 0;
while ($data2 = $DB->fetch_assoc($result2)) {
Session::addToNavigateListItems('User', $data2["id"]);
if ($i % $nb_per_line == 0) {
if ($i != 0) {
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
}
if ($canedit) {
echo "<td width='10'>";
Html::showMassiveActionCheckBox(__CLASS__, $data2["linkID"]);
echo "</td>";
}
$username = formatUserName($data2["id"], $data2["name"], $data2["realname"], $data2["firstname"], $canshowuser);
if ($data2["is_dynamic"] || $data2["is_recursive"]) {
$username = sprintf(__('%1$s %2$s'), $username, "<span class='b'>(");
if ($data2["is_dynamic"]) {
$username = sprintf(__('%1$s%2$s'), $username, __('D'));
}
if ($data2["is_dynamic"] && $data2["is_recursive"]) {
$username = sprintf(__('%1$s%2$s'), $username, ", ");
}
if ($data2["is_recursive"]) {
$username = sprintf(__('%1$s%2$s'), $username, __('R'));
}
$username = sprintf(__('%1$s%2$s'), $username, ")</span>");
//.........这里部分代码省略.........
示例5: array
break;
case "connect_to_computer":
Dropdown::showAllItems("connect_item", 0, 0, $_SESSION["glpiactive_entity"], array('Monitor', 'Peripheral', 'Phone', 'Printer'), true);
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "disconnect":
echo "<input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "add_group":
Dropdown::show('Group');
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "add_userprofile":
Dropdown::show('Entity', array('entity' => $_SESSION['glpiactiveentities']));
echo ". " . $LANG['profiles'][22] . " : ";
Profile::dropdownUnder();
echo ". " . $LANG['profiles'][28] . " : ";
Dropdown::showYesNo("is_recursive", 0);
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "add_document":
Document::dropdown(array('name' => 'docID'));
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "add_contract":
Contract::dropdown(array('name' => "conID"));
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "add_contact":
Dropdown::show('Contact', array('name' => "conID"));
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";