本文整理汇总了PHP中Computer_Item::dropdownConnect方法的典型用法代码示例。如果您正苦于以下问题:PHP Computer_Item::dropdownConnect方法的具体用法?PHP Computer_Item::dropdownConnect怎么用?PHP Computer_Item::dropdownConnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Computer_Item
的用法示例。
在下文中一共展示了Computer_Item::dropdownConnect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
if (strpos($_SERVER['PHP_SELF'], "dropdownConnect.php")) {
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
} else {
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}
}
if (!isset($_POST['fromtype']) || !($fromitem = getItemForItemtype($_POST['fromtype']))) {
exit;
}
$fromitem->checkGlobal(UPDATE);
$used = array();
if (isset($_POST["used"])) {
$used = $_POST["used"];
}
Computer_Item::dropdownConnect($_POST["itemtype"], $_POST['fromtype'], $_POST['myname'], $_POST["entity_restrict"], $_POST["onlyglobal"], $used);
示例2: array
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "unlock_ocsng_monitor":
case "unlock_ocsng_peripheral":
case "unlock_ocsng_software":
case "unlock_ocsng_printer":
case "unlock_ocsng_disk":
case "unlock_ocsng_ip":
echo "<input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
break;
case "install":
Software::dropdownSoftwareToInstall("softwareversions_id", $_SESSION["glpiactive_entity"], 1);
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][4] . "'>";
break;
case "connect":
Computer_Item::dropdownConnect('Computer', $_POST["itemtype"], "connect_item");
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>";
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']));
示例3: showForm
function showForm($target, $ID = '')
{
global $DB, $CFG_GLPI, $LANG;
if ($ID != '') {
$this->getFromDB($ID);
} else {
$this->getEmpty();
}
$CommonItem = new CommonItem();
$ptcm = new PluginFusioninventoryConfigModules();
echo "<div align='center'><form method='post' name='' id='' action=\"" . $target . "\">";
echo "<table class='tab_cadre' cellpadding='5' width='950'>";
echo "<tr>";
echo "<th colspan='4'>";
echo $LANG['plugin_fusioninventory']["agents"][0];
echo " :</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG["common"][16] . " :</td>";
echo "<td align='center'>";
echo "<input type='text' name='name' size='40' value='" . $this->fields["name"] . "'/>";
echo "</td>";
if ($ptcm->getValue('inventoryocs') == "1") {
echo "<td>" . $LANG['plugin_fusioninventory']['config'][3] . " :</td>";
echo "<td align='center'>";
Dropdown::showYesNo("module_inventory", $this->fields["module_inventory"]);
echo "</td>";
} else {
echo "<td colspan='2'></td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_fusioninventory']["agents"][5] . " :</td>";
echo "<td align='center'>";
echo $this->fields["fusioninventory_agent_version"];
echo "</td>";
if ($ptcm->getValue('netdiscovery') == "1") {
echo "<td>" . $LANG['plugin_fusioninventory']['config'][4] . " :</td>";
echo "<td align='center'>";
Dropdown::showYesNo("module_netdiscovery", $this->fields["module_netdiscovery"]);
echo "</td>";
} else {
echo "<td colspan='2'></td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_fusioninventory']["agents"][6] . " :</td>";
echo "<td align='center'>";
Dropdown::showYesNo("lock", $this->fields["lock"]);
echo "</td>";
if ($ptcm->getValue('snmp') == "1") {
echo "<td>" . $LANG['plugin_fusioninventory']['config'][7] . " :</td>";
echo "<td align='center'>";
Dropdown::showYesNo("module_snmpquery", $this->fields["module_snmpquery"]);
echo "</td>";
} else {
echo "<td colspan='2'></td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_fusioninventory']["agents"][23] . " :</td>";
echo "<td align='center'>";
if ($this->fields["on_device"] != "0" and $this->fields["on_device"] != "") {
$CommonItem->getFromDB(COMPUTER_TYPE, $this->fields["on_device"]);
echo $CommonItem->getLink(1);
echo "<input type='hidden' name='on_device' value='" . $this->fields["on_device"] . "'/>";
} else {
Computer_Item::dropdownConnect(COMPUTER_TYPE, COMPUTER_TYPE, 'on_device', $_SESSION['glpiactive_entity']);
}
echo "</td>";
if ($ptcm->getValue('wol') == "1") {
echo "<td>" . $LANG['plugin_fusioninventory']['config'][6] . " :</td>";
echo "<td align='center'>";
Dropdown::showYesNo("module_wakeonlan", $this->fields["module_wakeonlan"]);
echo "</td>";
} else {
echo "<td colspan='2'></td>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>Token :</td>";
echo "<td align='center' colspan='3'>";
echo $this->fields["token"];
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_2'>";
if (PluginFusioninventory::haveRight("agents", "w")) {
if ($ID == '') {
echo "<td align='center' colspan='4'>";
echo "<div align='center'><input type='submit' name='add' value=\"" . $LANG["buttons"][8] . "\" class='submit' >";
echo "</td>";
} else {
echo "<td align='center' colspan='2'>";
echo "<input type='hidden' name='ID' value='" . $ID . "'/>";
echo "<div align='center'><input type='submit' name='update' value=\"" . $LANG["buttons"][7] . "\" class='submit' >";
echo "</td>";
echo "<td align='center' colspan='2'>";
echo "<input type='submit' name='delete' value=\"" . $LANG["buttons"][6] . "\" class='submit'>";
echo "</td>";
}
}
//.........这里部分代码省略.........
示例4: showSpecificMassiveActionsParameters
/**
* @see CommonDBTM::showSpecificMassiveActionsParameters()
**/
function showSpecificMassiveActionsParameters($input = array())
{
switch ($input['action']) {
case "connect":
if ($input['itemtype'] == 'Computer') {
Dropdown::showAllItems("items_id", 0, 0, $_SESSION["glpiactive_entity"], array('Monitor', 'Peripheral', 'Phone', 'Printer'), true, true, 'item_itemtype');
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . __s('Connect') . "'>";
} else {
Computer_Item::dropdownConnect('Computer', $input["itemtype"], "computers_id");
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . __s('Connect') . "'>";
}
return true;
case "disconnect":
echo "<input type='submit' name='massiveaction' class='submit' value='" . __s('Disconnect') . "'>";
return true;
default:
return parent::showSpecificMassiveActionsParameters($input);
}
return false;
}
示例5: showForm
/**
* Display form for agent configuration
*
* @param $computers_id integer ID of the agent
* @param $options array
*
* @return bool TRUE if form is ok
*
**/
function showForm($computers_id, $options = array())
{
if ($computers_id != '') {
$this->getFromDB($computers_id);
} else {
$this->getEmpty();
$pfConfig = new PluginFusioninventoryConfig();
unset($this->fields['id']);
$this->fields['threads_networkdiscovery'] = $pfConfig->getValue('threads_networkdiscovery');
$this->fields['timeout_networkdiscovery'] = $pfConfig->getValue('timeout_networkdiscovery');
$this->fields['threads_networkinventory'] = $pfConfig->getValue('threads_networkinventory');
$this->fields['timeout_networkinventory'] = $pfConfig->getValue('timeout_networkinventory');
$this->fields['senddico'] = 0;
}
$this->initForm($computers_id, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . " :</td>";
echo "<td align='center'>";
Html::autocompletionTextField($this, 'name', array('size' => 40));
echo "</td>";
echo "<td>" . __('Device_id', 'fusioninventory') . " :</td>";
echo "<td align='center'>";
echo $this->fields["device_id"];
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Computer link', 'fusioninventory') . " :</td>";
echo "<td align='center'>";
if (!empty($this->fields["computers_id"])) {
$oComputer = new Computer();
$oComputer->getFromDB($this->fields["computers_id"]);
echo $oComputer->getLink(1);
echo Html::hidden('computers_id', array('value' => $this->fields["computers_id"]));
} else {
Computer_Item::dropdownConnect("Computer", "Computer", 'computers_id', $_SESSION['glpiactive_entity']);
}
echo "</td>";
echo "<td>" . __('Token') . " :</td>";
echo "<td align='center'>";
echo $this->fields["token"];
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('locked', 'fusioninventory') . " :</td>";
echo "<td align='center'>";
Dropdown::showYesNo('lock', $this->fields["lock"]);
echo "</td>";
echo "<td>" . __('Version') . " :</td>";
echo "<td align='center'>";
$a_versions = importArrayFromDB($this->fields["version"]);
foreach ($a_versions as $module => $version) {
echo "<strong>" . $module . "</strong>: " . $version . "<br/>";
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Threads number', 'fusioninventory') . " " . "(" . strtolower(__('Network discovery', 'fusioninventory')) . ") :</td>";
echo "<td align='center'>";
Dropdown::showNumber("threads_networkdiscovery", array('value' => $this->fields["threads_networkdiscovery"], 'min' => 1, 'max' => 400));
echo "</td>";
echo "<td>" . __('Useragent', 'fusioninventory') . " :</td>";
echo "<td align='center'>";
echo $this->fields["useragent"];
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('SNMP timeout', 'fusioninventory') . " " . "(" . strtolower(__('Network discovery', 'fusioninventory')) . ") :</td>";
echo "<td align='center'>";
Dropdown::showNumber("timeout_networkdiscovery", array('value' => $this->fields["timeout_networkdiscovery"], 'min' => 0, 'max' => 60));
echo "</td>";
echo "<td>" . __('Last contact', 'fusioninventory') . " :</td>";
echo "<td align='center'>";
echo Html::convDateTime($this->fields["last_contact"]);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Threads number', 'fusioninventory') . " " . "(" . strtolower(__('Network inventory (SNMP)', 'fusioninventory')) . ") :</td>";
echo "<td align='center'>";
Dropdown::showNumber("threads_networkinventory", array('value' => $this->fields["threads_networkinventory"], 'min' => 1, 'max' => 400));
echo "</td>";
echo "<td>" . __('FusionInventory tag', 'fusioninventory') . " :</td>";
echo "<td align='center'>";
echo $this->fields["tag"];
echo "</td>";
echo "</tr>";
echo "<td>" . __('SNMP timeout', 'fusioninventory') . " " . "(" . strtolower(__('Network inventory (SNMP)', 'fusioninventory')) . ") :</td>";
echo "<td align='center'>";
Dropdown::showNumber("timeout_networkinventory", array('value' => $this->fields["timeout_networkinventory"], 'min' => 0, 'max' => 60));
echo "</td>";
echo "<td colspan='2'>";
//.........这里部分代码省略.........
示例6: showFormPrinter_graph
//.........这里部分代码省略.........
if (isset($_SESSION['glpi_plugin_fusioninventory_graph_printerCompAdd'])) {
$printerCompAdd = $_SESSION['glpi_plugin_fusioninventory_graph_printerCompAdd'];
if (!key_exists($printerCompAdd, $_SESSION['glpi_plugin_fusioninventory_graph_printersComp'])) {
$ci = new CommonItem();
if ($ci->getFromDB(PRINTER_TYPE, $printerCompAdd)) {
$_SESSION['glpi_plugin_fusioninventory_graph_printersComp'][$printerCompAdd] = $ci->getField('name');
}
}
} elseif (isset($_SESSION['glpi_plugin_fusioninventory_graph_printerCompRemove'])) {
unset($_SESSION['glpi_plugin_fusioninventory_graph_printersComp'][$_SESSION['glpi_plugin_fusioninventory_graph_printerCompRemove']]);
}
$printers = $_SESSION['glpi_plugin_fusioninventory_graph_printersComp'];
$printersView = $printers;
// printers without the current printer
if (isset($printersView[$p_ID])) {
unset($printersView[$p_ID]);
} else {
$ci = new CommonItem();
if ($ci->getFromDB(PRINTER_TYPE, $p_ID)) {
$printers[$p_ID] = $ci->getField('name');
}
}
$printersList = '';
foreach ($printers as $printer) {
if ($printersList != '') {
$printersList .= '<BR>';
}
$printersList .= $printer;
}
$printersIds = "";
foreach (array_keys($printers) as $printerId) {
if ($printersIds != '') {
$printersIds .= ', ';
}
$printersIds .= $printerId;
}
$where = " WHERE `FK_printers` IN(" . $printersIds . ")";
if ($begin != '' || $end != '') {
$where .= " AND " . $this->getDateRequest("`date`", $begin, $end);
}
switch ($timeUnit) {
case 'date':
$group = "GROUP BY `FK_printers`, `year`, `month`, `date`";
break;
case 'week':
$group = "GROUP BY `FK_printers`, `year`, `month`, `week`";
break;
case 'month':
$group = "GROUP BY `FK_printers`, `year`, `month`";
break;
case 'year':
$group = "GROUP BY `FK_printers`, `year`";
break;
}
$query = "SELECT `FK_printers`, `date`, WEEK(`date`) AS `week`,\n MONTH(`date`) AS `month`, YEAR(`date`) AS `year`,\n SUM(`{$graphField}`) AS `{$graphField}`\n FROM `glpi_plugin_fusioninventory_printers_history`" . $where . $group . "\n ORDER BY `date`, `FK_printers`";
echo "<form method='post' name='printerGraph_form' id='printerGraph_form'\n action='" . $p_target . "'>";
echo "<table class='tab_cadre_fixe' cellpadding='2'>";
echo "<tr>";
echo "<th colspan='4'>" . $LANG['plugin_fusioninventory']["prt_history"][20] . "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['plugin_fusioninventory']["prt_history"][30] . " :</td><td class='left' colspan='2'>";
$elementsField = array('pages_total' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountertotalpages']['shortname'], 'pages_n_b' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecounterblackpages']['shortname'], 'pages_color' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountercolorpages']['shortname'], 'pages_recto_verso' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecounterrectoversopages']['shortname'], 'scanned' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecounterscannedpages']['shortname'], 'pages_total_print' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountertotalpages_print']['shortname'], 'pages_n_b_print' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecounterblackpages_print']['shortname'], 'pages_color_print' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountercolorpages_print']['shortname'], 'pages_total_copy' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountertotalpages_copy']['shortname'], 'pages_n_b_copy' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecounterblackpages_copy']['shortname'], 'pages_color_copy' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountercolorpages_copy']['shortname'], 'pages_total_fax' => $FUSIONINVENTORY_MAPPING[PRINTER_TYPE]['pagecountertotalpages_fax']['shortname']);
Dropdown::showFromArray('graph_graphField', $elementsField, array('value' => $graphField));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['search'][8] . " :</td>\n <td class='left' colspan='2'>";
showDateFormItem("graph_begin", $begin);
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['search'][9] . " :</td>\n <td class='left' colspan='2'>";
showDateFormItem("graph_end", $end);
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['plugin_fusioninventory']["prt_history"][31] . " :</td>\n <td class='left' colspan='2'>";
$elementsTime = array('date' => $LANG['plugin_fusioninventory']["prt_history"][34], 'week' => $LANG['plugin_fusioninventory']["prt_history"][35], 'month' => $LANG['plugin_fusioninventory']["prt_history"][36], 'year' => $LANG['plugin_fusioninventory']["prt_history"][37]);
Dropdown::showFromArray('graph_timeUnit', $elementsTime, array('value' => $timeUnit));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['Menu'][2] . " :</td>\n <td class='left' colspan='2'>";
echo $printersList;
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'><td class='center' colspan='3'>\n <input type='submit' class=\"submit\" name='graph_plugin_fusioninventory_printer_period'\n value='" . $LANG["buttons"][7] . "'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['plugin_fusioninventory']["prt_history"][32] . " :</td><td class='left'>";
Computer_Item::dropdownConnect(PRINTER_TYPE, PRINTER_TYPE, "graph_printerCompAdd", -1, 0, array_keys($printers));
echo "</td><td class='left'>\n";
echo "<input type='submit' value=\"" . $LANG['buttons'][8] . "\" class='submit' name='graph_plugin_fusioninventory_printer_add'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'><td class='left'>" . $LANG['plugin_fusioninventory']["prt_history"][33] . " :</td>\n <td class='left'>";
$printersTmp = $printersView;
$printersTmp[0] = "-----";
asort($printersTmp);
Dropdown::showFromArray('graph_printerCompRemove', $printersTmp);
echo "</td><td class='left'>\n";
echo "<input type='submit' value=\"" . $LANG['buttons'][6] . "\" class='submit' name='graph_plugin_fusioninventory_printer_remove'>";
echo "</td></tr>\n";
echo "</table>";
echo "</form>";
echo "<div class=center>";
$title = $elementsField[$graphField];
if (count($printers)) {
$ptg = new PluginFusioninventoryGraph($query, $graphField, $timeUnit, $printers, $title);
}
echo '</div>';
}