本文整理汇总了PHP中Entity::dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::dropdown方法的具体用法?PHP Entity::dropdown怎么用?PHP Entity::dropdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::dropdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showComputersToAdd
//.........这里部分代码省略.........
echo "<th>" . __('Destination entity') . "</th>\n";
echo "<th>" . __('Target location', 'ocsinventoryng') . "</th>\n";
}
echo "<th width='20%'> </th></tr>\n";
$rule = new RuleImportEntityCollection();
foreach ($hardware as $ID => $tab) {
$comp = new Computer();
$comp->fields["id"] = $tab["id"];
$data = array();
if ($advanced && !$tolinked) {
$data = $rule->processAllRules(array('ocsservers_id' => $serverId, '_source' => 'ocsinventoryng'), array(), array('ocsid' => $tab["id"]));
}
echo "<tr class='tab_bg_2'><td>" . $tab["name"] . "</td>\n";
echo "<td>" . $tab["manufacturer"] . "</td><td>" . $tab["model"] . "</td>";
echo "<td>" . $tab["serial"] . "</td>\n";
echo "<td>" . Html::convDateTime($tab["date"]) . "</td>\n";
echo "<td>" . $tab["TAG"] . "</td>\n";
if ($advanced && !$tolinked) {
if (!isset($data['entities_id']) || $data['entities_id'] == -1) {
echo "<td class='center'><img src=\"" . $CFG_GLPI['root_doc'] . "/pics/redbutton.png\"></td>\n";
$data['entities_id'] = -1;
} else {
echo "<td class='center'>";
$tmprule = new RuleImportEntity();
if ($tmprule->can($data['_ruleid'], READ)) {
echo "<a href='" . $tmprule->getLinkURL() . "'>" . $tmprule->getName() . "</a>";
} else {
echo $tmprule->getName();
}
echo "</td>\n";
}
echo "<td width='30%'>";
$ent = "toimport_entities[" . $tab["id"] . "]";
Entity::dropdown(array('name' => $ent, 'value' => $data['entities_id'], 'comments' => 0));
echo "</td>\n";
echo "<td width='30%'>";
if (!isset($data['locations_id'])) {
$data['locations_id'] = 0;
}
$loc = "toimport_locations[" . $tab["id"] . "]";
Location::dropdown(array('name' => $loc, 'value' => $data['locations_id'], 'comments' => 0));
echo "</td>\n";
}
echo "<td>";
if (!$tolinked) {
echo "<input type='checkbox' name='toimport[" . $tab["id"] . "]' " . ($check == "all" ? "checked" : "") . ">";
} else {
$tab['entities_id'] = $entity;
$rulelink = new RuleImportComputerCollection();
$rulelink_results = array();
$params = array('entities_id' => $entity, 'plugin_ocsinventoryng_ocsservers_id' => $serverId);
$rulelink_results = $rulelink->processAllRules(Toolbox::stripslashes_deep($tab), array(), $params);
//Look for the computer using automatic link criterias as defined in OCSNG configuration
$options = array('name' => "tolink[" . $tab["id"] . "]");
$show_dropdown = true;
//If the computer is not explicitly refused by a rule
if (!isset($rulelink_results['action']) || $rulelink_results['action'] != self::LINK_RESULT_NO_IMPORT) {
if (!empty($rulelink_results['found_computers'])) {
$options['value'] = $rulelink_results['found_computers'][0];
$options['entity'] = $entity;
}
$options['width'] = "100%";
Computer::dropdown($options);
} else {
echo "<img src='" . $CFG_GLPI['root_doc'] . "/pics/redbutton.png'>";
}
示例2: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'import_email':
Entity::dropdown();
echo "<br><br>";
echo Html::submit(_x('button', 'Import'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例3: showSpecificMassiveActionsParameters
/**
* @see CommonDBTM::showSpecificMassiveActionsParameters()
**/
function showSpecificMassiveActionsParameters($input = array())
{
switch ($input['action']) {
case "import_email":
Entity::dropdown();
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Import') . "'>";
return true;
default:
return parent::showSpecificMassiveActionsParameters($input);
}
return false;
}
示例4: displayTabContentForItem
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
if (in_array(get_class($item), array("AuthLDAP"))) {
$AuthLDAP = new PluginMoreldapAuthLDAP();
if (!$AuthLDAP->getFromDB($item->fields['id'])) {
//The directory exists in GLPI but there is no data in the plugin
$AuthLDAP->preconfig();
}
$location_enabled = $AuthLDAP->fields['location_enabled'] == 'Y' ? ' checked' : '';
echo '<div class="spaced">';
echo '<form id="items" name="items" method="post" action="' . Toolbox::getItemTypeFormURL(__CLASS__) . '">';
echo '<table class="tab_cadre_fixehov">';
echo '<tr class="tab_bg_2">';
echo '<th colspan="2">' . __("MoreLDAP", "moreldap") . '</th>';
echo '</tr>';
echo '<tr class="tab_bg_1">';
echo '<td>' . __("LDAP attribute : location of users", "moreldap") . '</td>';
echo '<td>' . __("Enabled", "moreldap") . ' <input type="checkbox" name="location_enabled"' . $location_enabled . ' value="location_enabled"><br />';
echo '<input size="72" type="text" name="location" value="' . $AuthLDAP->fields['location'] . '"> ';
echo '<br />';
Entity::dropdown(array('value' => $AuthLDAP->fields['entities_id']));
echo ' ' . __("recursive", "moreldap") . " ";
Dropdown::showYesNo('is_recursive', $AuthLDAP->fields['is_recursive']);
echo ' </td>';
echo '</tr>';
echo '<tr class="tab_bg_1">';
echo '<td colspan="2" class="center">';
echo '<input type="hidden" value="' . $item->fields['id'] . '" name="id">';
echo '<input type="submit" class="submit" name="update" value="' . _sx('button', 'Save') . '">';
echo '</td>';
echo '</tr>';
echo '</table>';
Html::closeForm();
echo "</div>";
}
return true;
}
示例5: showForm
/**
* Print the transfer form
*
* @param $ID integer : Id of the contact to print
* @param $options array
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
* @return boolean item found
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$edit_form = true;
if (!strpos($_SERVER['PHP_SELF'], "transfer.form.php")) {
$edit_form = false;
}
$this->initForm($ID, $options);
$params = array();
if (!Session::haveRight("transfer", "w")) {
$params['readonly'] = true;
}
if ($edit_form) {
$this->showTabs($options);
$this->showFormHeader($options);
} else {
echo "<form method='post' name=form action='" . $options['target'] . "'>";
echo "<div class='center' id='tabsbody' >";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><td class='tab_bg_2 top' colspan='4'>";
echo "<div class='center'>";
Entity::dropdown(array('name' => 'to_entity'));
echo " <input type='submit' name='transfer' value=\"" . __s('Execute') . "\"\n class='submit'></div>";
echo "</td></tr>";
}
if ($edit_form) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td><td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td rowspan='3' class='middle right'>" . __('Comments') . "</td>";
echo "<td class='center middle' rowspan='3'>\n <textarea cols='45' rows='3' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Last update') . "</td>";
echo "<td>" . ($this->fields["date_mod"] ? Html::convDateTime($this->fields["date_mod"]) : __('Never'));
echo "</td></tr>";
}
$keep = array(0 => _x('button', 'Delete permanently'), 1 => __('Preserve'));
$clean = array(0 => __('Preserve'), 1 => _x('button', 'Put in dustbin'), 2 => _x('button', 'Delete permanently'));
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Historical') . "</td><td>";
$params['value'] = $this->fields['keep_history'];
Dropdown::showFromArray('keep_history', $keep, $params);
echo "</td>";
if (!$edit_form) {
echo "<td colspan='2'> </td>";
}
echo "</tr>";
echo "<tr class='tab_bg_2'>";
echo "<td colspan='4' class='center b'>" . __('Assets') . "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . _n('Network port', 'Network ports', 2) . "</td><td>";
$options = array(0 => _x('button', 'Delete permanently'), 1 => __('Disconnect'), 2 => __('Keep'));
$params['value'] = $this->fields['keep_networklink'];
Dropdown::showFromArray('keep_networklink', $options, $params);
echo "</td>";
echo "<td>" . _n('Ticket', 'Tickets', 2) . "</td><td>";
$options = array(0 => _x('button', 'Delete permanently'), 1 => __('Disconnect'), 2 => __('Keep'));
$params['value'] = $this->fields['keep_ticket'];
Dropdown::showFromArray('keep_ticket', $options, $params);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Software of computers') . "</td><td>";
$params['value'] = $this->fields['keep_software'];
Dropdown::showFromArray('keep_software', $keep, $params);
echo "</td>";
echo "<td>" . __('If software are no longer used') . "</td><td>";
$params['value'] = $this->fields['clean_software'];
Dropdown::showFromArray('clean_software', $clean, $params);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . _n('Reservation', 'Reservations', 2) . "</td><td>";
$params['value'] = $this->fields['keep_reservation'];
Dropdown::showFromArray('keep_reservation', $keep, $params);
echo "</td>";
echo "<td>" . __('Components of computers') . "</td><td>";
$params['value'] = $this->fields['keep_device'];
Dropdown::showFromArray('keep_device', $keep, $params);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Links between printers and cartridge types and cartridges');
echo "</td><td>";
$params['value'] = $this->fields['keep_cartridgeitem'];
Dropdown::showFromArray('keep_cartridgeitem', $keep, $params);
echo "</td>";
echo "<td>" . __('If the cartridge types are no longer used') . "</td><td>";
$params['value'] = $this->fields['clean_cartridgeitem'];
Dropdown::showFromArray('clean_cartridgeitem', $clean, $params);
echo "</td></tr>";
//.........这里部分代码省略.........
示例6: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
global $UNINSTALL_TYPES;
switch ($ma->getAction()) {
case 'transfert':
Entity::dropdown();
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
case 'copy_reference':
//useless ?
echo " <input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . _sx('button', 'Post') . "\" >";
return true;
}
return "";
}
示例7: header
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
}
Session::checkLoginUser();
if (isset($_POST['type']) && !empty($_POST['type']) && isset($_POST['items_id']) && $_POST['items_id'] > 0) {
$prefix = '';
$suffix = '';
if (isset($_POST['prefix']) && !empty($_POST['prefix'])) {
$prefix = $_POST['prefix'] . '[';
$suffix = ']';
}
switch ($_POST['type']) {
case 'Group':
case 'Profile':
$params = array('value' => $_SESSION['glpiactive_entity'], 'name' => $prefix . 'entities_id' . $suffix);
if (Session::isViewAllEntities()) {
$params['toadd'] = array(-1 => __('No restriction'));
}
echo "<table class='tab_format'><tr><td>";
_e('Entity');
echo "</td><td>";
Entity::dropdown($params);
echo "</td><td>";
_e('Child entities');
echo "</td><td>";
Dropdown::showYesNo($prefix . 'is_recursive' . $suffix);
echo "</td></tr></table>";
break;
}
}
示例8: showUserImportForm
/**
* @param $authldap AuthLDAP object
**/
static function showUserImportForm(AuthLDAP $authldap)
{
global $DB;
//Get data related to entity (directory and ldap filter)
$authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']);
echo "<div class='center'>";
echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4' class='middle'><div class='relative'>";
echo "<span>" . ($_SESSION['ldap_import']['mode'] ? __('Synchronizing already imported users') : __('Import new users'));
// Expert interface allow user to override configuration.
// If not coming from the ticket form, then give expert/simple link
if ((Config::canUpdate() || Entity::canUpdate()) && !isset($_SESSION['ldap_import']['no_expert_mode'])) {
echo "</span> <span class='floatright'><a href='" . $_SERVER['PHP_SELF'] . "?action=" . $_SESSION['ldap_import']['action'] . "&mode=" . $_SESSION['ldap_import']['mode'];
if ($_SESSION['ldap_import']['interface'] == self::SIMPLE_INTERFACE) {
echo "&interface=" . self::EXPERT_INTERFACE . "'>" . __('Expert mode') . "</a>";
} else {
echo "&interface=" . self::SIMPLE_INTERFACE . "'>" . __('Simple mode') . "</a>";
}
} else {
$_SESSION['ldap_import']['interface'] = self::SIMPLE_INTERFACE;
}
echo "</span></div>";
echo "</th></tr>";
switch ($_SESSION['ldap_import']['interface']) {
case self::EXPERT_INTERFACE:
//If more than one directory configured
//Display dropdown ldap servers
if ($_SESSION['ldap_import']['authldaps_id'] != NOT_AVAILABLE && $_SESSION['ldap_import']['authldaps_id'] > 0) {
if (self::getNumberOfServers() > 1) {
echo "<tr class='tab_bg_2'><td>" . __('LDAP directory choice') . "</td>";
echo "<td colspan='3'>";
self::dropdown(array('name' => 'authldaps_id', 'value' => $_SESSION['ldap_import']['authldaps_id'], 'condition' => "`is_active` = '1'", 'display_emptychoice' => false));
echo " <input class='submit' type='submit' name='change_directory'\n value=\"" . _sx('button', 'To change') . "\">";
echo "</td></tr>";
}
echo "<tr class='tab_bg_2'><td>" . __('BaseDN') . "</td><td colspan='3'>";
echo "<input type='text' class='form-control' name='basedn' value=\"" . $_SESSION['ldap_import']['basedn'] . "\" size='90' " . (!$_SESSION['ldap_import']['basedn'] ? "disabled" : "") . ">";
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Search filter for users') . "</td><td colspan='3'>";
echo "<input type='text' class='form-control' name='ldap_filter' value=\"" . $_SESSION['ldap_import']['ldap_filter'] . "\" size='90'>";
echo "</td></tr>";
}
break;
//case self::SIMPLE_INTERFACE :
//case self::SIMPLE_INTERFACE :
default:
//If multi-entity mode and more than one entity visible
//else no need to select entity
if (Session::isMultiEntitiesMode() && count($_SESSION['glpiactiveentities']) > 1) {
echo "<tr class='tab_bg_2'><td>" . __('Select the desired entity') . "</td>" . "<td colspan='3'>";
Entity::dropdown(array('value' => $_SESSION['ldap_import']['entities_id'], 'entity' => $_SESSION['glpiactiveentities'], 'on_change' => 'submit()'));
echo "</td></tr>";
} else {
//Only one entity is active, store it
echo "<tr><td><input type='hidden' name='entities_id' value='" . $_SESSION['glpiactive_entity'] . "'></td></tr>";
}
if (isset($_SESSION['ldap_import']['begin_date']) && !empty($_SESSION['ldap_import']['begin_date']) || isset($_SESSION['ldap_import']['end_date']) && !empty($_SESSION['ldap_import']['end_date'])) {
$enabled = 1;
} else {
$enabled = 0;
}
Dropdown::showAdvanceDateRestrictionSwitch($enabled);
echo "<table class='tab_cadre_fixe'>";
if ($_SESSION['ldap_import']['authldaps_id'] != NOT_AVAILABLE && $_SESSION['ldap_import']['authldaps_id'] > 0) {
$field_counter = 0;
$fields = array('login_field' => __('Login'), 'email1_field' => __('Email'), 'email2_field' => sprintf(__('%1$s %2$s'), _n('Email', 'Emails', 1), '2'), 'email3_field' => sprintf(__('%1$s %2$s'), _n('Email', 'Emails', 1), '3'), 'email4_field' => sprintf(__('%1$s %2$s'), _n('Email', 'Emails', 1), '4'), 'realname_field' => __('Surname'), 'firstname_field' => __('First name'), 'phone_field' => __('Phone'), 'phone2_field' => __('Phone 2'), 'mobile_field' => __('Mobile phone'), 'title_field' => _x('person', 'Title'), 'category_field' => __('Category'), 'picture_field' => __('Picture'));
$available_fields = array();
foreach ($fields as $field => $label) {
if (isset($authldap->fields[$field]) && $authldap->fields[$field] != '') {
$available_fields[$field] = $label;
}
}
echo "<tr><th colspan='4'>" . __('Search criteria for users') . "</th></tr>";
foreach ($available_fields as $field => $label) {
if ($field_counter == 0) {
echo "<tr class='tab_bg_1'>";
}
echo "<td>{$label}</td><td>";
$field_counter++;
echo "<input type='text' class='form-control' name='criterias[{$field}]' value='" . (isset($_SESSION['ldap_import']['criterias'][$field]) ? $_SESSION['ldap_import']['criterias'][$field] : '') . "'>";
echo "</td>";
if ($field_counter == 2) {
echo "</tr>";
$field_counter = 0;
}
}
if ($field_counter > 0) {
while ($field_counter < 2) {
echo "<td colspan='2'></td>";
$field_counter++;
}
$field_counter = 0;
echo "</tr>";
}
}
break;
//.........这里部分代码省略.........
示例9: showRelationMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBRelation::showRelationMassiveActionsSubForm()
**/
static function showRelationMassiveActionsSubForm(MassiveAction $ma, $peer_number)
{
if ($ma->getAction() == 'add' && $peer_number == 2) {
echo "<br><br>" . sprintf(__('%1$s: %2$s'), _n('Entity', 'Entities', 1), '');
Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities']));
echo "<br><br>" . sprintf(__('%1$s: %2$s'), __('Recursive'), '');
Html::showCheckbox(array('name' => 'is_recursive'));
}
}
示例10: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
global $UNINSTALL_TYPES;
switch ($ma->getAction()) {
case 'transfert':
Entity::dropdown();
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
}
return "";
}
示例11: showForUser
/**
* Show rights of a user
*
* @param $user User object
**/
static function showForUser(User $user)
{
global $DB, $CFG_GLPI;
$ID = $user->getField('id');
if (!$user->can($ID, 'r')) {
return false;
}
$canedit = $user->can($ID, 'w');
$strict_entities = self::getUserEntities($ID, false);
if (!Session::haveAccessToOneOfEntities($strict_entities) && !Session::isViewAllEntities()) {
$canedit = false;
}
$canshowentity = Session::haveRight("entity", "r");
$rand = mt_rand();
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_2'><td class='center'>";
echo "<input type='hidden' name='users_id' value='{$ID}'>";
Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities']));
echo "</td><td class='center'>" . self::getTypeName(1) . "</td><td>";
Profile::dropdownUnder(array('value' => Profile::getDefault()));
echo "</td><td>" . __('Recursive') . "</td><td>";
Dropdown::showYesNo("is_recursive", 0);
echo "</td><td class='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_users`.`id` AS linkID,\n `glpi_profiles`.`id`,\n `glpi_profiles`.`name`,\n `glpi_profiles_users`.`is_recursive`,\n `glpi_profiles_users`.`is_dynamic`,\n `glpi_entities`.`completename`,\n `glpi_profiles_users`.`entities_id`\n FROM `glpi_profiles_users`\n LEFT JOIN `glpi_profiles`\n ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`)\n LEFT JOIN `glpi_entities`\n ON (`glpi_profiles_users`.`entities_id` = `glpi_entities`.`id`)\n WHERE `glpi_profiles_users`.`users_id` = '{$ID}'\n ORDER BY `glpi_profiles`.`name`, `glpi_entities`.`completename`";
$result = $DB->query($query);
$num = $DB->numrows($result);
echo "<div class='spaced'>";
Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
if ($canedit && $num) {
$paramsma = array('num_displayed' => $num);
Html::showMassiveActions(__CLASS__, $paramsma);
}
if ($num > 0) {
echo "<table class='tab_cadre_fixehov'>";
echo "<tr>";
if ($canedit) {
echo "<th>";
Html::checkAllAsCheckbox('mass' . __CLASS__ . $rand);
echo "</th>";
}
echo "<th>" . _n('Entity', 'Entities', 2) . "</th>";
echo "<th>" . sprintf(__('%1$s (%2$s)'), self::getTypeName(2), __('D=Dynamic, R=Recursive'));
echo "</th></tr>";
while ($data = $DB->fetch_assoc($result)) {
echo "<tr class='tab_bg_1'>";
if ($canedit) {
echo "<td width='10'>";
if (in_array($data["entities_id"], $_SESSION['glpiactiveentities'])) {
Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]);
} else {
echo " ";
}
echo "</td>";
}
echo "<td>";
$link = $data["completename"];
if ($_SESSION["glpiis_ids_visible"]) {
$link = sprintf(__('%1$s (%2$s)'), $link, $data["entities_id"]);
}
if ($canshowentity) {
echo "<a href='" . Toolbox::getItemTypeFormURL('Entity') . "?id=" . $data["entities_id"] . "'>";
}
echo $link . ($canshowentity ? "</a>" : '');
echo "</td>";
if (Session::haveRight('profile', 'r')) {
$entname = "<a href='" . Toolbox::getItemTypeFormURL('Profile') . "?id=" . $data["id"] . "'>" . $data["name"] . "</a>";
} else {
$entname = $data["name"];
}
if ($data["is_dynamic"] || $data["is_recursive"]) {
$entname = sprintf(__('%1$s %2$s'), $entname, "<span class='b'>(");
if ($data["is_dynamic"]) {
//TRANS: letter 'D' for Dynamic
$entname = sprintf(__('%1$s%2$s'), $entname, __('D'));
}
if ($data["is_dynamic"] && $data["is_recursive"]) {
$entname = sprintf(__('%1$s%2$s'), $entname, ", ");
}
if ($data["is_recursive"]) {
//TRANS: letter 'R' for Recursive
$entname = sprintf(__('%1$s%2$s'), $entname, __('R'));
}
$entname = sprintf(__('%1$s%2$s'), $entname, ")</span>");
}
//.........这里部分代码省略.........
示例12: plugin_ocsinventoryng_MassiveActionsDisplay
/**
* @param $options array
*/
function plugin_ocsinventoryng_MassiveActionsDisplay($options = array())
{
switch ($options['itemtype']) {
case 'PluginOcsinventoryngNotimportedcomputer':
switch ($options['action']) {
case "plugin_ocsinventoryng_import":
Entity::dropdown(array('name' => 'entity'));
break;
case "plugin_ocsinventoryng_link":
Computer::dropdown(array('name' => 'computers_id'));
break;
case "plugin_ocsinventoryng_replayrules":
case "plugin_ocsinventoryng_delete":
break;
}
echo " <input type='submit' name='massiveaction' class='submit' " . "value='" . _sx('button', 'Post') . "'>";
break;
case 'Computer':
switch ($options['action']) {
case "plugin_ocsinventoryng_force_ocsng_update":
echo "<input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Post') . "'>\n";
break;
case "plugin_ocsinventoryng_unlock_ocsng_field":
$fields['all'] = __('All');
$fields += PluginOcsinventoryngOcsServer::getLockableFields();
Dropdown::showFromArray("field", $fields);
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Post') . "'>";
break;
}
}
return "";
}
示例13: showSpecificMassiveActionsParameters
/**
* @see CommonDBTM::showSpecificMassiveActionsParameters()
**/
function showSpecificMassiveActionsParameters($input = array())
{
switch ($input['action']) {
case "duplicate":
if ($item->isEntityAssign()) {
Entity::dropdown();
}
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Duplicate') . "'>";
return true;
default:
return parent::showSpecificMassiveActionsParameters($input);
}
return false;
}
示例14: array
echo "</td>";
$display = true;
break;
case 'Group':
echo "<td>";
$params = array('rand' => $rand, 'name' => $prefix . 'groups_id' . $suffix);
$params['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "subvisibility{$rand}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/subvisibility.php", 'moreparams' => array('items_id' => '__VALUE__', 'type' => $_POST['type'], 'prefix' => $_POST['prefix']));
Group::dropdown($params);
echo "</td><td>";
echo "<span id='subvisibility{$rand}'></span>";
echo "</td>";
$display = true;
break;
case 'Entity':
echo "<td>";
Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities'], 'value' => $_SESSION['glpiactive_entity'], 'name' => $prefix . 'entities_id' . $suffix));
echo "</td><td>";
_e('Child entities');
echo "</td><td>";
Dropdown::showYesNo($prefix . 'is_recursive' . $suffix);
echo "</td>";
$display = true;
break;
case 'Profile':
echo "<td>";
$checkright = READ | CREATE | UPDATE | PURGE;
$righttocheck = $_POST['right'];
if ($_POST['right'] == 'faq') {
$righttocheck = 'knowbase';
$checkright = KnowbaseItem::READFAQ;
}
示例15: plugin_appliances_MassiveActionsDisplay
function plugin_appliances_MassiveActionsDisplay($options)
{
switch ($options['itemtype']) {
case 'PluginAppliancesAppliance':
switch ($options['action']) {
// No case for add_document : use GLPI core one
case "plugin_appliances_install":
Dropdown::showAllItems("item_item", 0, 0, -1, PluginAppliancesAppliance::getTypes());
echo "<input type='submit' name='massiveaction' class='submit' " . "value='" . _x('button', 'Post') . "'>";
break;
case "plugin_appliances_desinstall":
Dropdown::showAllItems("item_item", 0, 0, -1, PluginAppliancesAppliance::getTypes());
echo "<input type='submit' name='massiveaction' class='submit' " . "value='" . _x('button', 'Post') . "'>";
break;
case "plugin_appliances_transfert":
Entity::dropdown();
echo " <input type='submit' name='massiveaction' class='submit' " . "value='" . _x('button', 'Post') . "'>";
break;
}
break;
default:
if (in_array($options['itemtype'], PluginAppliancesAppliance::getTypes(true))) {
Dropdown::show('PluginAppliancesAppliance');
echo "<input type='submit' name='massiveaction' class='submit\\' " . "value='" . _x('button', 'Post') . "'>";
}
}
return "";
}