本文整理汇总了PHP中Report::getTypeName方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::getTypeName方法的具体用法?PHP Report::getTypeName怎么用?PHP Report::getTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::getTypeName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 show network port by network equipment
*/
include '../inc/includes.php';
Session::checkRight("reports", READ);
// Titre
if (isset($_POST["switch"]) && $_POST["switch"]) {
Html::header(Report::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "tools", "report");
Report::title();
$name = Dropdown::getDropdownName("glpi_networkequipments", $_POST["switch"]);
echo "<div class='center spaced'><h2>" . sprintf(__('Network report by hardware: %s'), $name) . "</h2></div>";
Report::reportForNetworkInformations("`glpi_networkequipments` AS ITEM", "PORT_1.`itemtype` = 'NetworkEquipment'\n AND PORT_1.`items_id` = ITEM.`id`", "ITEM.`id` = '" . $_POST["switch"] . "'");
Html::footer();
} else {
Html::redirect($CFG_GLPI['root_doc'] . "/front/report.networking.php");
}
示例2: array
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
*/
include '../inc/includes.php';
Session::checkRight("reports", "r");
Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report");
Report::title();
$items = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software');
# Titre
echo "<span class='big b'>" . __('List of the hardware under contract') . "</span><br><br>";
# Request All
if (isset($_POST["item_type"][0]) && $_POST["item_type"][0] == '0' || !isset($_POST["item_type"])) {
$_POST["item_type"] = $items;
}
if (isset($_POST["item_type"]) && is_array($_POST["item_type"])) {
$query = array();
foreach ($_POST["item_type"] as $key => $val) {
if (in_array($val, $items)) {
$itemtable = getTableForItemType($val);
$query[$val] = "SELECT `{$itemtable}`.`name` AS itemname,\n `{$itemtable}`.`is_deleted` AS itemdeleted,\n `glpi_locations`.`completename` AS location,\n `glpi_contracttypes`.`name` AS type,\n `glpi_infocoms`.`buy_date`,\n `glpi_infocoms`.`warranty_duration`,\n `glpi_contracts`.`begin_date`,\n `glpi_contracts`.`duration`,\n `glpi_entities`.`completename` AS entname,\n `glpi_entities`.`id` AS entID\n FROM `glpi_contracts_items`\n INNER JOIN `glpi_contracts`\n ON (`glpi_contracts_items`.`contracts_id` = `glpi_contracts`.`id`)\n INNER JOIN `{$itemtable}`\n ON (`glpi_contracts_items`.`itemtype` = '{$val}'\n AND `{$itemtable}`.`id` = `glpi_contracts_items`.`items_id`)\n LEFT JOIN `glpi_infocoms`\n ON (`glpi_infocoms`.`itemtype` = '{$val}'\n AND `{$itemtable}`.`id` = `glpi_infocoms`.`items_id`)\n LEFT JOIN `glpi_contracttypes`\n ON (`glpi_contracts`.`contracttypes_id` = `glpi_contracttypes`.`id`)\n LEFT JOIN `glpi_locations`\n ON (`{$itemtable}`.`locations_id` = `glpi_locations`.`id`)\n LEFT JOIN `glpi_entities`\n ON (`{$itemtable}`.`entities_id` = `glpi_entities`.`id`)\n WHERE `{$itemtable}`.`is_template` ='0' " . getEntitiesRestrictRequest("AND", $itemtable);
if (isset($_POST["annee"][0]) && $_POST["annee"][0] != 'toutes') {
示例3: showDefaultReport
/**
* Show Default Report
*
* @since version 0.84
**/
static function showDefaultReport()
{
global $DB;
# Title
echo "<span class='big b'>GLPI " . Report::getTypeName(2) . "</span><br><br>";
# 1. Get counts of itemtype
$items = array('Computer', 'Printer', 'NetworkEquipment', 'Software', 'Monitor', 'Peripheral', 'Phone');
$linkitems = array('Printer', 'Monitor', 'Peripheral', 'Phone');
echo "<table class='tab_cadrehov'>";
foreach ($items as $itemtype) {
$table_item = getTableForItemType($itemtype);
$where = "WHERE `" . $table_item . "`.`is_deleted` = '0'\n AND `" . $table_item . "`.`is_template` = '0' ";
$join = "";
if (in_array($itemtype, $linkitems)) {
$join = "LEFT JOIN `glpi_computers_items`\n ON (`glpi_computers_items`.`itemtype` = '" . $itemtype . "'\n AND `glpi_computers_items`.`items_id` = `" . $table_item . "`.`id`)";
}
$query = "SELECT COUNT(*)\n FROM `" . $table_item . "`\n {$join}\n {$where} " . getEntitiesRestrictRequest("AND", $table_item);
$result = $DB->query($query);
$number = $DB->result($result, 0, 0);
echo "<tr class='tab_bg_2'><td>" . $itemtype::getTypeName(2) . "</td>";
echo "<td class='numeric'>{$number}</td></tr>";
}
echo "<tr class='tab_bg_1'><td colspan='2' class='b'>" . __('Operating system') . "</td></tr>";
# 2. Get some more number data (operating systems per computer)
$where = "WHERE `is_deleted` = '0'\n AND `is_template` = '0' ";
$query = "SELECT COUNT(*) AS count, `glpi_operatingsystems`.`name` AS name\n FROM `glpi_computers`\n LEFT JOIN `glpi_operatingsystems`\n ON (`glpi_computers`.`operatingsystems_id` = `glpi_operatingsystems`.`id`)\n {$where} " . getEntitiesRestrictRequest("AND", "glpi_computers") . "\n GROUP BY `glpi_operatingsystems`.`name`";
$result = $DB->query($query);
while ($data = $DB->fetch_assoc($result)) {
if (empty($data['name'])) {
$data['name'] = Dropdown::EMPTY_VALUE;
}
echo "<tr class='tab_bg_2'><td>" . $data['name'] . "</td>";
echo "<td class='numeric'>" . $data['count'] . "</td></tr>";
}
# Get counts of types
$val = array_flip($items);
unset($val["Software"]);
$items = array_flip($val);
foreach ($items as $itemtype) {
echo "<tr class='tab_bg_1'><td colspan='2' class='b'>" . $itemtype::getTypeName(2) . "</td></tr>";
$table_item = getTableForItemType($itemtype);
$typeclass = $itemtype . "Type";
$type_table = getTableForItemType($typeclass);
$typefield = getForeignKeyFieldForTable(getTableForItemType($typeclass));
$where = "WHERE `" . $table_item . "`.`is_deleted` = '0'\n AND `" . $table_item . "`.`is_template` = '0' ";
$join = "";
if (in_array($itemtype, $linkitems)) {
$join = "LEFT JOIN `glpi_computers_items`\n ON (`glpi_computers_items`.`itemtype` = '" . $itemtype . "'\n AND `glpi_computers_items`.`items_id` = `" . $table_item . "`.`id`)";
}
$query = "SELECT COUNT(*) AS count, `" . $type_table . "`.`name` AS name\n FROM `" . $table_item . "`\n LEFT JOIN `" . $type_table . "`\n ON (`" . $table_item . "`.`" . $typefield . "`\n = `" . $type_table . "`.`id`)\n {$join}\n {$where} " . getEntitiesRestrictRequest("AND", $table_item) . "\n GROUP BY `" . $type_table . "`.`name`";
$result = $DB->query($query);
while ($data = $DB->fetch_assoc($result)) {
if (empty($data['name'])) {
$data['name'] = Dropdown::EMPTY_VALUE;
}
echo "<tr class='tab_bg_2'><td>" . $data['name'] . "</td>";
echo "<td class='numeric'>" . $data['count'] . "</td></tr>";
}
}
echo "</table>";
}
示例4: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
return array(Report::getTypeName(1));
}