当前位置: 首页>>代码示例>>PHP>>正文


PHP Supplier::getField方法代码示例

本文整理汇总了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);
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:8,代码来源:infocom.class.php

示例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);
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:8,代码来源:contract_supplier.class.php

示例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("&", "&amp;", $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>";
 }
开发者ID:wittwerch,项目名称:webapplications,代码行数:83,代码来源:webapplication_item.class.php


注:本文中的Supplier::getField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。