本文整理汇总了PHP中Supplier::getField方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::getField方法的具体用法?PHP Supplier::getField怎么用?PHP Supplier::getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::getField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: countForSupplier
/**
* @param $item Supplier object
**/
static function countForSupplier(Supplier $item)
{
$restrict = "`glpi_infocoms`.`suppliers_id` = '" . $item->getField('id') . "'\n AND `itemtype` NOT IN ('ConsumableItem', 'CartridgeItem', 'Software') " . getEntitiesRestrictRequest(" AND ", "glpi_infocoms", '', $_SESSION['glpiactiveentities']);
return countElementsInTable(array('glpi_infocoms'), $restrict);
}
示例2: countForSupplier
/**
* @param $item string Supplier object
**/
static function countForSupplier(Supplier $item)
{
$restrict = "`glpi_contracts_suppliers`.`suppliers_id` = '" . $item->getField('id') . "'\n AND `glpi_contracts_suppliers`.`contracts_id` = `glpi_contracts`.`id` " . getEntitiesRestrictRequest(" AND ", "glpi_contracts", '', $_SESSION['glpiactiveentities']);
return countElementsInTable(array('glpi_contracts_suppliers', 'glpi_contracts'), $restrict);
}
示例3: showForSupplier
/**
* Show webapplications associated to an item
*
* @since version 0.84
*
* @param $item Supplier object for which associated webapplications must be displayed
* @param $withtemplate (default '')
**/
static function showForSupplier(Supplier $item, $withtemplate = '')
{
global $DB, $CFG_GLPI;
$ID = $item->getField('id');
if ($item->isNewID($ID)) {
return false;
}
if (!Session::haveRight("plugin_webapplications", READ)) {
return false;
}
if (!$item->can($item->fields['id'], READ)) {
return false;
}
if (empty($withtemplate)) {
$withtemplate = 0;
}
$rand = mt_rand();
$is_recursive = $item->isRecursive();
$query = "SELECT `glpi_entities`.`id` AS entity,\n `glpi_plugin_webapplications_webapplications`.`id` AS assocID,\n `glpi_plugin_webapplications_webapplications`.`name` AS assocName,\n `glpi_plugin_webapplications_webapplications`.*\n FROM `glpi_plugin_webapplications_webapplications`\n LEFT JOIN `glpi_entities` ON (`glpi_plugin_webapplications_webapplications`.`entities_id`=`glpi_entities`.`id`)\n WHERE `glpi_plugin_webapplications_webapplications`.`suppliers_id` = '{$ID}' ";
$query .= getEntitiesRestrictRequest(" AND", "glpi_plugin_webapplications_webapplications", '', '', true);
$query .= " ORDER BY `assocName`";
$result = $DB->query($query);
$number = $DB->numrows($result);
$i = 0;
$webs = array();
if ($numrows = $DB->numrows($result)) {
while ($data = $DB->fetch_assoc($result)) {
$webs[$data['assocID']] = $data;
}
}
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr>";
echo "<th>" . __('Name') . "</th>";
if (Session::isMultiEntitiesMode()) {
echo "<th>" . __('Entity') . "</th>";
}
echo "<th>" . PluginWebapplicationsWebapplicationType::getTypeName(1) . "</th>";
echo "<th>" . __('URL') . "</th>";
echo "<th>" . __('Server') . "</th>";
echo "<th>" . __('Language') . "</th>";
echo "<th>" . __('Version') . "</th>";
echo "<th>" . __('Comments') . "</th>";
echo "</tr>";
$used = array();
if ($number) {
Session::initNavigateListItems('PluginWebapplicationsWebapplication', sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
$web = new PluginWebapplicationsWebapplication();
foreach ($webs as $data) {
$webID = $data["id"];
$link = NOT_AVAILABLE;
if ($web->getFromDB($webID)) {
$link = $web->getLink();
}
Session::addToNavigateListItems('PluginWebapplicationsWebapplication', $webID);
$assocID = $data["assocID"];
echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
echo "<td class='center'>{$link}</td>";
if (Session::isMultiEntitiesMode()) {
echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) . "</td>";
}
echo "<td>" . Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationtypes", $data["plugin_webapplications_webapplicationtypes_id"]) . "</td>";
$link = Toolbox::substr($data["address"], 0, 30) . "...";
echo "<td class='center'>" . "<a href=\"" . str_replace("&", "&", $data["address"]) . "\" target=\"_blank\">" . "<u>" . $link . "</u></a></td>";
echo "<td>" . Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationservertypes", $data["plugin_webapplications_webapplicationservertypes_id"]) . "</td>";
echo "<td>" . Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationtechnics", $data["plugin_webapplications_webapplicationtechnics_id"]) . "</td>";
echo "<td>" . $data["version"] . "</td>";
echo "<td>" . $data["comment"] . "</td>";
echo "</tr>";
$i++;
}
}
echo "</table>";
echo "</div>";
}