本文整理汇总了PHP中Dropdown::showForMassiveAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::showForMassiveAction方法的具体用法?PHP Dropdown::showForMassiveAction怎么用?PHP Dropdown::showForMassiveAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::showForMassiveAction方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showActions
/**
* @param $notimported PluginOcsinventoryngNotimportedcomputer object
**/
static function showActions(PluginOcsinventoryngNotimportedcomputer $notimported)
{
echo "<div class='spaced'>";
echo "<form name='actions' id='actions' method='post' value='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'>";
echo "<th class='center'>" . __('Actions to be made on the computer', 'ocsinventoryng') . "</th></tr>";
echo "<tr class='tab_bg_2'><td class='center'>";
echo "<input type='hidden' name='id' value='" . $notimported->fields['id'] . "'>";
echo "<input type='hidden' name='action' value='massive'>";
Dropdown::showForMassiveAction('PluginOcsinventoryngNotimportedcomputer', 0, array('action' => 'massive'));
echo "</td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
示例2: getLastOcsUpdate
}
echo "<td class='blue'>" . getLastOcsUpdate($data['BID']) . "</td>";
echo "</tr>\n";
}
echo "<tr class='tab_bg_4'><td class='center' colspan='{$colspan}'>";
if ($i) {
printf(__('%1$s: %2$s'), __('Duplicate computers', 'reports'), $i);
} else {
_e('No item found');
}
echo "</td></tr>\n";
echo "</table>";
if ($canedit) {
if ($i) {
Html::openArrowMassives("massiveaction_form");
Dropdown::showForMassiveAction('Computer');
$options = array();
Html::closeArrowMassives($options);
}
Html::closeForm();
}
}
Html::footer();
function buildBookmarkUrl($url, $crit)
{
return $url . "?crit=" . $crit;
}
function getLastOcsUpdate($computers_id)
{
global $DB;
$query = "SELECT `last_ocs_update`\n FROM `glpi_ocslinks`\n WHERE `computers_id` = '{$computers_id}'";
示例3: showForSoftware
//.........这里部分代码省略.........
} else {
$sort = "`entity` {$order}, `name`";
}
// Righ type is enough. Can add a License on a software we have Read access
$canedit = haveRight("software", "w");
// Total Number of events
$number = countElementsInTable("glpi_softwarelicenses", "glpi_softwarelicenses.softwares_id = {$softwares_id} " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true));
echo "<div class='spaced'>";
if ($number < 1) {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th>" . $LANG['search'][15] . "</th></tr>\n";
if ($canedit) {
echo "<tr class='tab_bg_2'><td class='center'>";
echo "<a href='softwarelicense.form.php?softwares_id={$softwares_id}'>" . $LANG['software'][8] . "</a>";
echo "</td></tr>\n";
}
echo "</table></div>\n";
return;
}
// Display the pager
printAjaxPager($LANG['software'][11], $start, $number);
$rand = mt_rand();
$query = "SELECT `glpi_softwarelicenses`.*,\n `buyvers`.`name` AS buyname,\n `usevers`.`name` AS usename,\n `glpi_entities`.`completename` AS entity,\n `glpi_softwarelicensetypes`.`name` AS typename\n FROM `glpi_softwarelicenses`\n LEFT JOIN `glpi_softwareversions` AS buyvers\n ON (`buyvers`.`id` = `glpi_softwarelicenses`.`softwareversions_id_buy`)\n LEFT JOIN `glpi_softwareversions` AS usevers\n ON (`usevers`.`id` = `glpi_softwarelicenses`.`softwareversions_id_use`)\n LEFT JOIN `glpi_entities`\n ON (`glpi_entities`.`id` = `glpi_softwarelicenses`.`entities_id`)\n LEFT JOIN `glpi_softwarelicensetypes`\n ON (`glpi_softwarelicensetypes`.`id`\n = `glpi_softwarelicenses`.`softwarelicensetypes_id`)\n WHERE (`glpi_softwarelicenses`.`softwares_id` = '{$softwares_id}') " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true) . "\n ORDER BY {$sort} {$order}\n LIMIT " . intval($start) . "," . intval($_SESSION['glpilist_limit']);
initNavigateListItems('SoftwareLicense', $LANG['help'][31] . " = " . $software->fields["name"]);
if ($result = $DB->query($query)) {
if ($DB->numrows($result)) {
if ($canedit) {
echo "<form method='post' name='massiveactionlicense_form{$rand}' id='" . "massiveactionlicense_form{$rand}' action=\"" . $CFG_GLPI["root_doc"] . "/front/massiveaction.php\">";
}
$sort_img = "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . ($order == "DESC" ? "puce-down.png" : "puce-up.png") . "\" alt='' title=''>";
echo "<table class='tab_cadre_fixehov'><tr>";
echo "<th> </th>";
echo "<th>" . ($sort == "`name`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=name&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][16] . "</a></th>";
if ($software->isRecursive()) {
// Ereg to search entity in string for match default order
echo "<th>" . (strstr($sort, "entity") ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=entity&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['entity'][0] . "</a></th>";
}
echo "<th>" . ($sort == "`serial`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=serial&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][19] . "</a></th>";
echo "<th>" . ($sort == "`number`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=number&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['tracking'][29] . "</a></th>";
echo "<th>" . $LANG['software'][9] . "</th>";
echo "<th>" . ($sort == "`typename`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=typename&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['common'][17] . "</a></th>";
echo "<th>" . ($sort == "`buyname`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=buyname&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['software'][1] . "</a></th>";
echo "<th>" . ($sort == "`usename`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=usename&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['software'][2] . "</a></th>";
echo "<th>" . ($sort == "`expire`" ? $sort_img : "") . "<a href='javascript:reloadTab(\"sort=expire&order=" . ($order == "ASC" ? "DESC" : "ASC") . "&start=0\");'>" . $LANG['software'][32] . "</a></th>";
echo "</tr>\n";
$tot_assoc = 0;
for ($tot = 0; $data = $DB->fetch_assoc($result);) {
addToNavigateListItems('SoftwareLicense', $data['id']);
echo "<tr class='tab_bg_2'>";
if ($license->can($data['id'], "w")) {
echo "<td><input type='checkbox' name='item[" . $data["id"] . "]' value='1'></td>";
} else {
echo "<td> </td>";
}
echo "<td><a href='softwarelicense.form.php?id=" . $data['id'] . "'>" . $data['name'] . (empty($data['name']) ? $data['id'] : "") . "</a></td>";
if ($software->isRecursive()) {
echo "<td>" . $data['entity'] . "</td>";
}
echo "<td>" . $data['serial'] . "</td>";
echo "<td class='right'>" . ($data['number'] > 0 ? $data['number'] . " " : $LANG['software'][4]) . "</td>";
$nb_assoc = Computer_SoftwareLicense::countForLicense($data['id']);
$tot_assoc += $nb_assoc;
echo "<td class='right'>{$nb_assoc} </td>";
echo "<td>" . $data['typename'] . "</td>";
echo "<td>" . $data['buyname'] . "</td>";
echo "<td>" . $data['usename'] . "</td>";
echo "<td class='center'>" . convDate($data['expire']) . "</td>";
echo "</tr>";
if ($data['number'] < 0) {
// One illimited license, total is illimited
$tot = -1;
} else {
if ($tot >= 0) {
// Not illimited, add the current number
$tot += $data['number'];
}
}
}
echo "<tr class='tab_bg_1'>";
echo "<td colspan='" . ($software->isRecursive() ? 4 : 3) . "' class='right b'>" . $LANG['common'][33] . "</td>";
echo "<td class='right b'>" . ($tot > 0 ? $tot . " " : $LANG['software'][4]) . "</td>";
echo "<td class='right b'>{$tot_assoc} </td>";
echo "<td colspan='4' class='center'>";
if ($canedit) {
echo "<a href='softwarelicense.form.php?softwares_id={$softwares_id}'>" . $LANG['software'][8] . "</a>";
}
echo "</td></tr>";
echo "</table>\n";
if ($canedit) {
openArrowMassive("massiveactionlicense_form{$rand}", true);
Dropdown::showForMassiveAction('SoftwareLicense', 0, array('softwares_id' => $softwares_id));
closeArrowMassive();
echo "</form>";
}
} else {
echo $LANG['search'][15];
}
}
echo "</div>";
}
示例4: showList
//.........这里部分代码省略.........
if ($itemtype == 'States' || $itemtype == 'ReservationItem') {
$typename = $data["TYPE"];
if (class_exists($data["TYPE"])) {
$itemtmp = new $data["TYPE"]();
$typename = $itemtmp->getTypeName();
}
$itemsToShow[] = PluginMobileSearch::showItem($output_type, $typename, $item_num, $row_num);
}
if ($itemtype == 'ReservationItem' && $output_type == Search::HTML_OUTPUT) {
if (Session::haveRight("reservation_central", UPDATE)) {
if (!haveAccessToEntity($data["ENTITY"])) {
$itemsToShow[] = PluginMobileSearch::showItem($output_type, " ", $item_num, $row_num);
$itemsToShow[] = PluginMobileSearch::showItem($output_type, " ", $item_num, $row_num);
} else {
$itemsToShow[] = PluginMobileSearch::showItem($output_type, "<a href=\"" . getItemTypeFormURLMobile($itemtype) . "?id=" . $data["refID"] . "&is_active=" . ($data["ACTIVE"] ? 0 : 1) . "&update=update\" " . "title='" . ($data["ACTIVE"] ? $LANG['buttons'][42] : $LANG['buttons'][41]) . "' data-back='false'><img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . ($data["ACTIVE"] ? "moins" : "plus") . ".png\" alt='' title=''></a>", $item_num, $row_num, "class='center'");
/*echo PluginMobileSearch::showItem($output_type,"<a href=\"javascript:confirmAction('".
addslashes($LANG['reservation'][38])."\\n".
addslashes($LANG['reservation'][39])."','".
Toolbox::getItemTypeFormURL($itemtype)."?id=".$data["refID"].
"&delete=delete')\" title='".
$LANG['reservation'][6]."'><img src=\"".
$CFG_GLPI["root_doc"]."/pics/delete.png\" alt='' title=''></a>",
$item_num,$row_num,"class='center'");*/
}
}
if ($data["ACTIVE"]) {
$itemsToShow[] = PluginMobileSearch::showItem($output_type, "<a href='reservation.php?reservationitems_id=" . $data["refID"] . "' title='" . $LANG['reservation'][21] . "' data-back='false'><img src=\"" . $CFG_GLPI["root_doc"] . "/pics/reservation-3.png\" alt='' title=''></a>", $item_num, $row_num, "class='center'");
} else {
$itemsToShow[] = PluginMobileSearch::showItem($output_type, " ", $item_num, $row_num);
}
}
echo PluginMobileSearch::showNewLine($output_type, $i % 2);
foreach ($itemsToShow as $item) {
echo $item;
}
// End Line
echo PluginMobileSearch::showEndLine($output_type);
}
$title = "";
// Create title
if ($output_type == Search::PDF_OUTPUT_LANDSCAPE || $output_type == Search::PDF_OUTPUT_PORTRAIT) {
if ($_SESSION["glpisearchcount"][$itemtype] > 0 && count($p['contains']) > 0) {
for ($key = 0; $key < $_SESSION["glpisearchcount"][$itemtype]; $key++) {
if (strlen($p['contains'][$key]) > 0) {
if (isset($p["link"][$key])) {
$title .= " " . $p["link"][$key] . " ";
}
switch ($p['field'][$key]) {
case "all":
$title .= $LANG['common'][66];
break;
case "view":
$title .= $LANG['search'][11];
break;
default:
$title .= $searchopt[$itemtype][$p['field'][$key]]["name"];
}
$title .= " = " . $p['contains'][$key];
}
}
}
if ($_SESSION["glpisearchcount2"][$itemtype] > 0 && count($p['contains2']) > 0) {
for ($key = 0; $key < $_SESSION["glpisearchcount2"][$itemtype]; $key++) {
if (strlen($p['contains2'][$key]) > 0) {
if (isset($p['link2'][$key])) {
$title .= " " . $p['link2'][$key] . " ";
}
$title .= $metanames[$p['itemtype2'][$key]] . "/";
$title .= $searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["name"];
$title .= " = " . $p['contains2'][$key];
}
}
}
}
// Display footer
echo PluginMobileSearch::showFooter($output_type, $title);
// Delete selected item
if ($output_type == Search::HTML_OUTPUT) {
if ($isadmin) {
openArrowMassives("massiveaction_form");
Dropdown::showForMassiveAction($itemtype, $p['is_deleted']);
closeArrowMassives();
// End form for delete item
//echo "</form>\n";
Html::closeForm();
} else {
echo "<br>";
}
}
} else {
echo Search::showError($output_type);
}
} else {
echo $DBread > error();
}
// Clean selection
$_SESSION['glpimassiveactionselected'] = array();
//echo $QUERY;
return $numrows;
}
示例5: showForItem
//.........这里部分代码省略.........
$canedit = $item->can($ID, 'w');
// Show Add Form
if ($canedit && (empty($withtemplate) || $withtemplate != 2)) {
echo "\n<div class='firstbloc'><table class='tab_cadre_fixe'>";
echo "<tr><td class='tab_bg_2 center'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/networkport.form.php?items_id={$ID}&itemtype={$itemtype}'><strong>" . $LANG['networking'][19] . "</strong></a></td>\n";
echo "<td class='tab_bg_2 center' width='50%'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/networkport.form.php?items_id={$ID}&itemtype={$itemtype}&several=1'>\n <strong>" . $LANG['networking'][46] . "</strong></a></td>\n";
echo "</tr></table></div>\n";
}
initNavigateListItems('NetworkPort', $item->getTypeName() . " = " . $item->getName());
$query = "SELECT `id`\n FROM `glpi_networkports`\n WHERE `items_id` = '{$ID}'\n AND `itemtype` = '{$itemtype}'\n ORDER BY `name`,\n `logical_number`";
if ($result = $DB->query($query)) {
echo "<div class='spaced'>";
if ($DB->numrows($result) != 0) {
$colspan = 9;
if ($withtemplate != 2) {
if ($canedit) {
$colspan++;
echo "\n<form id='networking_ports{$rand}' name='networking_ports{$rand}' method='post'\n action='" . $CFG_GLPI["root_doc"] . "/front/networkport.form.php'>\n";
}
}
echo "<table class='tab_cadre_fixe'>\n";
echo "<tr><th colspan='{$colspan}'>\n";
if ($DB->numrows($result) == 1) {
echo $LANG['networking'][12];
} else {
echo $LANG['networking'][11];
}
echo " : " . $DB->numrows($result) . "</th></tr>\n";
echo "<tr>";
if ($withtemplate != 2 && $canedit) {
echo "<th> </th>\n";
}
echo "<th>#</th>\n";
echo "<th>" . $LANG['common'][16] . "</th>\n";
echo "<th>" . $LANG['networking'][51] . "</th>\n";
echo "<th>" . $LANG['networking'][14] . "<br>" . $LANG['networking'][15] . "</th>\n";
echo "<th>" . $LANG['networking'][60] . " / " . $LANG['networking'][61] . "<br>" . $LANG['networking'][59] . "</th>\n";
echo "<th>" . $LANG['networking'][56] . "</th>\n";
echo "<th>" . $LANG['common'][65] . "</th>\n";
echo "<th>" . $LANG['networking'][17] . " :</th>\n";
echo "<th>" . $LANG['networking'][14] . "<br>" . $LANG['networking'][15] . "</th></tr>\n";
$i = 0;
$netport = new NetworkPort();
while ($devid = $DB->fetch_row($result)) {
$netport->getFromDB(current($devid));
addToNavigateListItems('NetworkPort', $netport->fields["id"]);
echo "<tr class='tab_bg_1'>\n";
if ($withtemplate != 2 && $canedit) {
echo "<td class='center' width='20'>";
echo "<input type='checkbox' name='del_port[" . $netport->fields["id"] . "]' value='1'>";
echo "</td>\n";
}
echo "<td class='center'><strong>";
if ($canedit && $withtemplate != 2) {
echo "<a href=\"" . $CFG_GLPI["root_doc"] . "/front/networkport.form.php?id=" . $netport->fields["id"] . "\">";
}
echo $netport->fields["logical_number"];
if ($canedit && $withtemplate != 2) {
echo "</a>";
}
echo "</strong>";
showToolTip($netport->fields['comment']);
echo "</td>\n";
echo "<td>" . $netport->fields["name"] . "</td>\n";
echo "<td>" . Dropdown::getDropdownName("glpi_netpoints", $netport->fields["netpoints_id"]) . "</td>\n";
echo "<td>" . $netport->fields["ip"] . "<br>" . $netport->fields["mac"] . "</td>\n";
echo "<td>" . $netport->fields["netmask"] . " / " . $netport->fields["subnet"] . "<br>" . $netport->fields["gateway"] . "</td>\n";
// VLANs
echo "<td>";
NetworkPort_Vlan::showForNetworkPort($netport->fields["id"], $canedit, $withtemplate);
echo "</td>\n";
echo "<td>" . Dropdown::getDropdownName("glpi_networkinterfaces", $netport->fields["networkinterfaces_id"]) . "</td>\n";
echo "<td width='300' class='tab_bg_2'>";
self::showConnection($item, $netport, $withtemplate);
echo "</td>\n";
echo "<td class='tab_bg_2'>";
if ($netport->getContact($netport->fields["id"])) {
echo $netport->fields["ip"] . "<br>";
echo $netport->fields["mac"];
}
echo "</td></tr>\n";
}
echo "</table>\n";
if ($canedit && $withtemplate != 2) {
openArrowMassive("networking_ports{$rand}", true);
Dropdown::showForMassiveAction('NetworkPort');
closeArrowMassive();
}
if ($canedit && $withtemplate != 2) {
echo "</form>";
}
} else {
echo "<table class='tab_cadre_fixe'><tr><th>" . $LANG['networking'][10] . "</th></tr>";
echo "</table>";
}
echo "</div>";
}
}
示例6: execute
//.........这里部分代码省略.........
$param .= "{$key}=" . urlencode($val);
}
}
Dropdown::showOutputFormat();
Html::closeForm();
echo "</td></tr>";
echo "</table></div>";
Html::printPager($start, $nbtot, $_SERVER['PHP_SELF'], $param);
}
}
}
if (!isset($_POST["display_type"]) || $_POST["display_type"] == Search::HTML_OUTPUT) {
if (isset($options['withmassiveaction']) && class_exists($options['withmassiveaction'])) {
echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action=\"" . $CFG_GLPI["root_doc"] . "/front/massiveaction.php\">";
}
}
plugin_reports_checkRight($this->plug, $this->name, "r");
if ($res && $nbtot > 0) {
$nbcols = $DB->num_fields($res);
$nbrows = $DB->numrows($res);
echo Search::showHeader($output_type, $nbrows, $nbcols, true);
echo Search::showNewLine($output_type);
$num = 1;
// fill $sqlcols with default sql query fields so we can validate $columns
$sqlcols = array();
for ($i = 0; $i < $nbcols; $i++) {
$colname = $DB->field_name($res, $i);
$sqlcols[] = $colname;
}
$colsname = array();
// if $columns is not empty, display $columns
if (count($this->columns) > 0) {
foreach ($this->columns as $colname => $column) {
// display only $columns that are valid
if (in_array($colname, $sqlcols)) {
$column->showTitle($output_type, $num);
$colsname[$colname] = $column;
}
}
} else {
// else display default columns from SQL query
foreach ($sqlcols as $colname) {
$column = new PluginReportsColumn($colname, $colname);
$column->showTitle($output_type, $num);
$colsname[$colname] = $column;
}
}
echo Search::showEndLine($output_type);
$prev = "";
for ($row_num = 2; $row = $DB->fetch_assoc($res); $row_num++) {
$crt = "";
foreach ($this->group_by as $colname) {
if (isset($row[$colname])) {
$crt .= $row[$colname] . "####";
}
}
echo Search::showNewLine($output_type);
$num = 1;
foreach ($colsname as $colname => $column) {
//If value needs to be modified on the fly
if (isset($this->columns_mapping[$colname]) && isset($this->columns_mapping[$colname][$row[$colname]])) {
$new_value = $this->columns_mapping[$colname][$row[$colname]];
$row[$colname] = $new_value;
}
if (!in_array($colname, $this->group_by)) {
$column->showValue($output_type, $row, $num, $row_num);
} else {
if ($crt == $prev) {
$column->showValue($output_type, $output_type == Search::CSV_OUTPUT ? $row : array(), $num, $row_num);
} else {
$column->showValue($output_type, $row, $num, $row_num, true);
}
}
}
// Each column
echo Search::showEndLine($output_type);
$prev = $crt;
}
// Each row
if (isset($options['withtotal']) && $options['withtotal']) {
echo Search::showNewLine($output_type);
$num = 1;
foreach ($colsname as $colname => $column) {
$column->showTotal($output_type, $num, $row_num);
}
echo Search::showEndLine($output_type);
}
}
echo Search::showFooter($output_type, $title);
if (!isset($_POST["display_type"]) || $_POST["display_type"] == Search::HTML_OUTPUT) {
if (isset($options['withmassiveaction']) && class_exists($options['withmassiveaction'])) {
Html::openArrowMassives("massiveaction_form", true);
Dropdown::showForMassiveAction($options['withmassiveaction']);
$options = array();
Html::closeArrowMassives($options);
Html::closeForm();
}
Html::footer();
}
}