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


PHP countElementsInTable函数代码示例

本文整理汇总了PHP中countElementsInTable函数的典型用法代码示例。如果您正苦于以下问题:PHP countElementsInTable函数的具体用法?PHP countElementsInTable怎么用?PHP countElementsInTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了countElementsInTable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugin_barcode_install

function plugin_barcode_install()
{
    global $DB;
    $migration = new Migration(PLUGIN_BARCODE_VERSION);
    if (!file_exists(GLPI_PLUGIN_DOC_DIR . "/barcode")) {
        mkdir(GLPI_PLUGIN_DOC_DIR . "/barcode");
    }
    $migration->renameTable("glpi_plugin_barcode_config", "glpi_plugin_barcode_configs");
    if (!TableExists("glpi_plugin_barcode_configs")) {
        $query = "CREATE TABLE `glpi_plugin_barcode_configs` (\n                  `id` int(11) NOT NULL auto_increment,\n                  `type` varchar(20) collate utf8_unicode_ci default NULL,\n                  PRIMARY KEY  (`ID`)\n               ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
        $DB->query($query) or die("error creating glpi_plugin_barcode_configs " . $DB->error());
        $query = "INSERT INTO `glpi_plugin_barcode_configs` \n                     (`id`, `type`)\n                VALUES\n                     ('1', 'code128')";
        $DB->query($query) or die("error populate glpi_plugin_barcode_configs " . $DB->error());
    }
    $migration->renameTable("glpi_plugin_barcode_config_type", "glpi_plugin_barcode_configs_types");
    if (!TableExists("glpi_plugin_barcode_configs_types")) {
        $query = "CREATE TABLE `glpi_plugin_barcode_configs_types` (\n                  `id` int(11) NOT NULL auto_increment,\n                  `type` varchar(20) collate utf8_unicode_ci default NULL,\n                  `size` varchar(20) collate utf8_unicode_ci default NULL,\n                  `orientation` varchar(9) collate utf8_unicode_ci default NULL,\n                  `marginTop` int(11) NULL,\n                  `marginBottom` int(11) NULL,\n                  `marginLeft` int(11) NULL,\n                  `marginRight` int(11) NULL,\n                  `marginHorizontal` int(11) NULL,\n                  `marginVertical` int(11) NULL,\n                  `maxCodeWidth` int(11) NULL,\n                  `maxCodeHeight` int(11) NULL,\n                  PRIMARY KEY  (`ID`),\n                  UNIQUE  (`type`)\n               ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
        $DB->query($query) or die("error creating glpi_plugin_barcode_configs_types " . $DB->error());
        $query = "INSERT INTO `glpi_plugin_barcode_configs_types`\n                     (`type`, `size`, `orientation`,\n                     `marginTop`, `marginBottom`, `marginLeft`, `marginRight`,\n                     `marginHorizontal`, `marginVertical`, `maxCodeWidth`, `maxCodeHeight`)\n                VALUES\n                     ('Code39', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '128', '50'),\n                     ('code128', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '70'),\n                     ('ean13', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '70'),\n                     ('int25', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '70'),\n                     ('postnet', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '70'),\n                     ('upca', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '70'),\n                     ('QRcode', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '100')";
        $DB->query($query) or die("error populate glpi_plugin_barcode_configs_types " . $DB->error());
    }
    if (countElementsInTable("glpi_plugin_barcode_configs_types", "`type`='QRcode'") == 0) {
        $query = "INSERT INTO `glpi_plugin_barcode_configs_types`\n                     (`type`, `size`, `orientation`,\n                     `marginTop`, `marginBottom`, `marginLeft`, `marginRight`,\n                     `marginHorizontal`, `marginVertical`, `maxCodeWidth`, `maxCodeHeight`)\n                VALUES\n                     ('QRcode', 'A4', 'Portrait',\n                     '30', '30', '30', '30',\n                     '25', '30', '110', '100')";
        $DB->query($query) or die("error populate glpi_plugin_barcode_configs_types " . $DB->error());
    }
    include_once GLPI_ROOT . '/plugins/barcode/inc/profile.class.php';
    include_once GLPI_ROOT . '/plugins/barcode/inc/config.class.php';
    PluginBarcodeProfile::initProfile();
    if (TableExists("glpi_plugin_barcode_profiles")) {
        $query = "DROP TABLE `glpi_plugin_barcode_profiles`";
        $DB->query($query) or die("error deleting glpi_plugin_barcode_profiles");
    }
    return true;
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:34,代码来源:hook.php

示例2: getTabNameForItem

 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getID() > 0) {
         if (get_class($item) == 'PluginFusioninventoryCollect') {
             if ($item->fields['type'] == 'wmi') {
                 $a_colregs = getAllDatasFromTable('glpi_plugin_fusioninventory_collects_wmis', "`plugin_fusioninventory_collects_id`='" . $item->getID() . "'");
                 if (count($a_colregs) == 0) {
                     return array();
                 }
                 $in = array();
                 foreach ($a_colregs as $id => $data) {
                     $in[] = $id;
                 }
                 if (countElementsInTable('glpi_plugin_fusioninventory_collects_wmis_contents', "`plugin_fusioninventory_collects_wmis_id` IN ('" . implode("','", $in) . "')") > 0) {
                     return array(__('Windows WMI content', 'fusioninventory'));
                 }
             }
         } else {
             if (get_class($item) == 'Computer') {
                 if (countElementsInTable('glpi_plugin_fusioninventory_collects_wmis_contents', "`computers_id`='" . $item->getID() . "'") > 0) {
                     return array(__('Windows WMI content', 'fusioninventory'));
                 }
             }
         }
     }
     return array();
 }
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:27,代码来源:collect_wmi_content.class.php

示例3: showSummary

 static function showSummary()
 {
     echo "<div class='center'><table class='tab_cadre' cellpadding='5' width='50%'>";
     echo "<tr><th>" . __('Summary') . "</th></tr>";
     if (countElementsInTable('glpi_plugin_archires_views', "`entities_id`='" . $_SESSION["glpiactive_entity"] . "'") > 0) {
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='view.php'>" . PluginArchiresView::getTypeName(2) . "</a>";
         echo "</td></tr>";
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='locationquery.php'>" . sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginArchiresLocationQuery::getTypeName(1)) . "</a>";
         echo "</td></tr>";
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='networkequipmentquery.php'>" . sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginArchiresNetworkEquipmentQuery::getTypeName(1)) . "</a>";
         echo "</td></tr>";
         $plugin = new Plugin();
         if ($plugin->isActivated("appliances")) {
             echo "<tr class='tab_bg_1'><td>";
             echo "<a href='appliancequery.php'>" . sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginAppliancesAppliance::getTypeName(1)) . "</a>";
             echo "</td></tr>";
         }
     } else {
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='view.form.php?new=1'>" . __('Add view', 'archires') . "</a>";
         echo "</td></tr>";
     }
     echo "</table></div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:27,代码来源:archires.class.php

示例4: countForResourceTask

 static function countForResourceTask(PluginResourcesTask $item)
 {
     $types = implode("','", PluginResourcesResource::getTypes());
     if (empty($types)) {
         return 0;
     }
     return countElementsInTable('glpi_plugin_resources_tasks_items', "`itemtype` IN ('{$types}')\n                                   AND `plugin_resources_tasks_id` = '" . $item->getID() . "'");
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:8,代码来源:task_item.class.php

示例5: setUp

   protected function setUp() {
      global $DB;
      
      $DB->connect();

      // Store Max(id) for each glpi tables
      $result = $DB->list_tables();
      while ($data=$DB->fetch_row($result)) {
         $query = "SELECT MAX(`id`) AS MAXID
                   FROM `".$data[0]."`";
         foreach ($DB->request($query) as $row) {
            $this->tables[$data[0]] = (empty($row['MAXID']) ? 0 : $row['MAXID']);
         }
      }
      $DB->free_result($result);

      $tab  = array();
      $auth = new Auth();
      // First session
      $auth->Login('glpi', 'glpi') ;

      // Create entity tree
      $entity = new Entity();
      $tab['entity'][0] = $entity->add(array('name' => 'PHP Unit root',
                                             'entities_id' => 0));

      if (!$tab['entity'][0]                                   // Crash detection
          || !FieldExists('glpi_profiles','notification')   // Schema detection
          || countElementsInTable('glpi_rules')!=6) {    // Old rules

         if (!$tab['entity'][0]) {
            echo "Couldn't run test (previous run not cleaned)\n";
         } else {
            echo "Schema need to be updated\n";
         }
         echo "Loading a fresh empty database:";
         $DB->runFile(GLPI_ROOT ."/install/mysql/glpi-0.84-empty.sql");
         die(" done\nTry again\n");
      }

      $tab['entity'][1] = $entity->add(array('name'        => 'PHP Unit Child 1',
                                             'entities_id' => $tab['entity'][0]));

      $tab['entity'][2] = $entity->add(array('name'        => 'PHP Unit Child 2',
                                             'entities_id' => $tab['entity'][0]));

      $tab['entity'][3] = $entity->add(array('name'        => 'PHP Unit Child 2.1',
                                             'entities_id' => $tab['entity'][2]));

      $tab['entity'][4] = $entity->add(array('name'        => 'PHP Unit Child 2.2',
                                             'entities_id' => $tab['entity'][2]));

      // New session with all the entities
      $auth->Login('glpi', 'glpi') or die("Login glpi/glpi invalid !\n");

      // Shared this with all tests
      $this->sharedFixture = $tab;
   }
开发者ID:KaneoGmbH,项目名称:glpi,代码行数:58,代码来源:AllTests.php

示例6: isMonitoredNetworkport

 static function isMonitoredNetworkport($networkports_id)
 {
     global $DB;
     $nb = countElementsInTable("glpi_plugin_monitoring_networkports", "`networkports_id` = '" . $networkports_id . "'");
     if ($nb > 0) {
         return true;
     }
     return false;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:9,代码来源:networkport.class.php

示例7: testLog

 public function testLog()
 {
     global $DB;
     $DB->connect();
     $pfFormatconvert = new PluginFusioninventoryFormatconvert();
     $computer = new Computer();
     $pfiComputerLib = new PluginFusioninventoryInventoryComputerLib();
     $date = date('Y-m-d H:i:s');
     $_SESSION["plugin_fusioninventory_entity"] = 0;
     $_SESSION['glpiactiveentities_string'] = 0;
     $_SESSION['glpishowallentities'] = 1;
     $_SESSION["glpiname"] = 'Plugin_FusionInventory';
     $this->a_inventory = array('fusioninventorycomputer' => array('winowner' => 'test', 'wincompany' => 'siprossii', 'operatingsystem_installationdate' => '2012-10-16 08:12:56', 'last_fusioninventory_update' => $date), 'soundcard' => array(), 'graphiccard' => array(), 'controller' => array(), 'processor' => array(), 'computerdisk' => array(), 'memory' => array(), 'monitor' => array(), 'printer' => array(), 'peripheral' => array(), 'networkport' => array(), 'SOFTWARES' => array(), 'harddrive' => array(), 'virtualmachine' => array(), 'antivirus' => array(), 'storage' => array(), 'licenseinfo' => array(), 'networkcard' => array(), 'drive' => array(), 'batteries' => array(), 'itemtype' => 'Computer');
     $this->a_inventory['Computer'] = array('name' => 'pc', 'users_id' => 0, 'operatingsystems_id' => 'freebsd', 'operatingsystemversions_id' => '9.1-RELEASE', 'uuid' => '68405E00-E5BE-11DF-801C-B05981201220', 'domains_id' => 'mydomain.local', 'os_licenseid' => '', 'os_license_number' => '', 'operatingsystemservicepacks_id' => 'GENERIC ()root@farrell.cse.buffalo.edu', 'manufacturers_id' => '', 'computermodels_id' => '', 'serial' => 'XB63J7D', 'computertypes_id' => 'Notebook', 'is_dynamic' => 1, 'contact' => 'ddurieux');
     $this->a_inventory['processor'] = array(array('nbcores' => 2, 'manufacturers_id' => 'Intel Corporation', 'designation' => 'Core i3', 'frequence' => 2400, 'nbthreads' => 2, 'serial' => '', 'frequency' => 2400, 'frequency_default' => 2400), array('nbcores' => 2, 'manufacturers_id' => 'Intel Corporation', 'designation' => 'Core i3', 'frequence' => 2400, 'nbthreads' => 2, 'serial' => '', 'frequency' => 2400, 'frequency_default' => 2400), array('nbcores' => 2, 'manufacturers_id' => 'Intel Corporation', 'designation' => 'Core i3', 'frequence' => 2400, 'nbthreads' => 2, 'serial' => '', 'frequency' => 2400, 'frequency_default' => 2400), array('nbcores' => 2, 'manufacturers_id' => 'Intel Corporation', 'designation' => 'Core i3', 'frequence' => 2400, 'nbthreads' => 2, 'serial' => '', 'frequency' => 2400, 'frequency_default' => 2400));
     $this->a_inventory['memory'] = array(array('size' => 2048, 'serial' => '98F6FF18', 'frequence' => '1067 MHz', 'devicememorytypes_id' => 'DDR3', 'designation' => 'DDR3 - SODIMM (None)', 'busID' => 1), array('size' => 2048, 'serial' => '95F1833E', 'frequence' => '1067 MHz', 'devicememorytypes_id' => 'DDR3', 'designation' => 'DDR3 - SODIMM (None)', 'busID' => 2));
     $this->a_inventory['monitor'] = array(array('name' => '', 'serial' => '', 'manufacturers_id' => ''));
     $this->a_inventory['networkport'] = array('em0-00:23:18:cf:0d:93' => array('name' => 'em0', 'netmask' => '255.255.255.0', 'subnet' => '192.168.30.0', 'mac' => '00:23:18:cf:0d:93', 'instantiation_type' => 'NetworkPortEthernet', 'virtualdev' => 0, 'ssid' => '', 'gateway' => '', 'dhcpserver' => '', 'logical_number' => 0, 'ipaddress' => array('192.168.30.198')), 'lo0-' => array('name' => 'lo0', 'virtualdev' => 1, 'mac' => '', 'instantiation_type' => 'NetworkPortLocal', 'subnet' => '', 'ssid' => '', 'gateway' => '', 'netmask' => '', 'dhcpserver' => '', 'logical_number' => 1, 'ipaddress' => array('::1', 'fe80::1', '127.0.0.1')));
     $this->a_inventory['software'] = array('gentiumbasic$$$$110$$$$1$$$$0' => array('name' => 'GentiumBasic', 'version' => 110, 'manufacturers_id' => 1, 'entities_id' => 0, 'is_template_computer' => 0, 'is_deleted_computer' => 0, 'is_dynamic' => 1), 'imagemagick$$$$6.8.0.7_1$$$$2$$$$0' => array('name' => 'ImageMagick', 'version' => '6.8.0.7_1', 'manufacturers_id' => 2, 'entities_id' => 0, 'is_template_computer' => 0, 'is_deleted_computer' => 0, 'is_dynamic' => 1), 'orbit2$$$$2.14.19$$$$3$$$$0' => array('name' => 'ORBit2', 'version' => '2.14.19', 'manufacturers_id' => 3, 'entities_id' => 0, 'is_template_computer' => 0, 'is_deleted_computer' => 0, 'is_dynamic' => 1));
     $this->a_inventory = $pfFormatconvert->replaceids($this->a_inventory);
     $serialized = gzcompress(serialize($this->a_inventory));
     $this->a_inventory['fusioninventorycomputer']['serialized_inventory'] = Toolbox::addslashes_deep($serialized);
     $computer->add(array('serial' => 'XB63J7D', 'entities_id' => 0));
     // truncate glpi_logs
     $DB->query('TRUNCATE TABLE `glpi_logs`;');
     $this->assertEquals(0, countElementsInTable('glpi_logs'), "Log must be empty (truncate)");
     $_SESSION['glpiactive_entity'] = 0;
     $pfiComputerLib->updateComputer($this->a_inventory, 1, TRUE);
     $a_logs = getAllDatasFromTable('glpi_logs');
     foreach ($a_logs as $id => $data) {
         unset($data['date_mod']);
         $a_logs[$id] = $data;
     }
     $a_reference = array(1 => array('id' => 1, 'itemtype' => 'Software', 'items_id' => 1, 'itemtype_link' => '', 'linked_action' => 20, 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => 0, 'old_value' => '', 'new_value' => ''), 2 => array('id' => 2, 'itemtype' => 'Software', 'items_id' => 2, 'itemtype_link' => '', 'linked_action' => 20, 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => 0, 'old_value' => '', 'new_value' => ''), 3 => array('id' => 3, 'itemtype' => 'Software', 'items_id' => 3, 'itemtype_link' => '', 'linked_action' => 20, 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => 0, 'old_value' => '', 'new_value' => ''), 4 => array('id' => 4, 'itemtype' => 'SoftwareVersion', 'items_id' => 1, 'itemtype_link' => '', 'linked_action' => 20, 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => 0, 'old_value' => '', 'new_value' => ''), 5 => array('id' => 5, 'itemtype' => 'SoftwareVersion', 'items_id' => 2, 'itemtype_link' => '', 'linked_action' => 20, 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => 0, 'old_value' => '', 'new_value' => ''), 6 => array('id' => 6, 'itemtype' => 'SoftwareVersion', 'items_id' => 3, 'itemtype_link' => '', 'linked_action' => 20, 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => 0, 'old_value' => '', 'new_value' => ''));
     $this->assertEquals($a_reference, $a_logs, "Log must be 6 " . print_r($a_logs, true));
     $DB->query('TRUNCATE `glpi_logs`');
     // Update a second time and must not have any new lines in glpi_logs
     $pfiComputerLib->updateComputer($this->a_inventory, 1, FALSE);
     $a_logs = getAllDatasFromTable('glpi_logs');
     $a_reference = array();
     $this->assertEquals($a_reference, $a_logs, "Log may be empty at second update " . print_r($a_logs, true));
     // * Modify: contact
     // * remove a processor
     // * Remove a software
     $this->a_inventory['Computer']['contact'] = 'root';
     unset($this->a_inventory['processor'][3]);
     unset($this->a_inventory['software']['orbit2$$$$2.14.19$$$$3$$$$0']);
     $DB->query('TRUNCATE `glpi_logs`');
     $pfiComputerLib->updateComputer($this->a_inventory, 1, FALSE);
     $a_logs = getAllDatasFromTable('glpi_logs');
     foreach ($a_logs as $id => $data) {
         unset($data['date_mod']);
         $a_logs[$id] = $data;
     }
     $a_reference = array(1 => array('id' => '1', 'itemtype' => 'Computer', 'items_id' => '1', 'itemtype_link' => '', 'linked_action' => '0', 'user_name' => '', 'id_search_option' => '7', 'old_value' => 'ddurieux', 'new_value' => 'root'), 2 => array('id' => '2', 'itemtype' => 'Computer', 'items_id' => '1', 'itemtype_link' => 'DeviceProcessor', 'linked_action' => '3', 'user_name' => '', 'id_search_option' => '0', 'old_value' => 'Core i3 (1)', 'new_value' => ''), 3 => array('id' => '3', 'itemtype' => 'Computer', 'items_id' => '1', 'itemtype_link' => 'SoftwareVersion', 'linked_action' => '5', 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => '0', 'old_value' => 'ORBit2 - 2.14.19 (3)', 'new_value' => ''), 4 => array('id' => '4', 'itemtype' => 'SoftwareVersion', 'items_id' => '3', 'itemtype_link' => 'Computer', 'linked_action' => '5', 'user_name' => 'Plugin_FusionInventory', 'id_search_option' => '0', 'old_value' => 'pc (1)', 'new_value' => ''));
     $this->assertEquals($a_reference, $a_logs, "May have 5 logs (update contact, remove processor\n         and remove a software)");
 }
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:57,代码来源:ComputerLogTest.php

示例8: getTabNameForItem

 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (self::canView()) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(_n('Link', 'Links', Session::getPluralNumber()), countElementsInTable('glpi_links_itemtypes', "`itemtype` = '" . $item->getType() . "'"));
         }
         return _n('Link', 'Links', Session::getPluralNumber());
     }
     return '';
 }
开发者ID:KaneoGmbH,项目名称:glpi,代码行数:10,代码来源:link.class.php

示例9: haveChildren

 /**
  * Report if a dropdown have Child
  * Used to (dis)allow delete action
  **/
 function haveChildren()
 {
     if (parent::haveChildren()) {
         return true;
     }
     $kb = new KnowbaseItem();
     $fk = $this->getForeignKeyField();
     $id = $this->fields['id'];
     return countElementsInTable($kb->getTable(), "`{$fk}`='{$id}'") > 0;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:14,代码来源:knowbaseitemcategory.class.php

示例10: getTabNameForItem

 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && $item->getType() == 'Computer' && Session::haveRight("computer", "r")) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_computervirtualmachines', "computers_id = '" . $item->getID() . "'\n                                                                 AND `is_deleted`='0'"));
         }
         return self::getTypeName(2);
     }
     return '';
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:13,代码来源:computervirtualmachine.class.php

示例11: getTabNameForItem

 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (Session::haveRight("link", "r")) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(_n('Link', 'Links', 2), countElementsInTable('glpi_links_itemtypes', "`itemtype` = '" . $item->getType() . "'"));
         }
         return _n('Link', 'Links', 2);
     }
     return '';
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:10,代码来源:link.class.php

示例12: getTabNameForItem

 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (self::canView()) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             $restrict = "`glpi_links_itemtypes`.`links_id` = `glpi_links`.`id`\n                         AND `glpi_links_itemtypes`.`itemtype` = '" . $item->getType() . "'" . getEntitiesRestrictRequest(" AND ", "glpi_links", '', '', true);
             return self::createTabEntry(_n('Link', 'Links', Session::getPluralNumber()), countElementsInTable(array('glpi_links_itemtypes', 'glpi_links'), $restrict));
         }
         return _n('Link', 'Links', Session::getPluralNumber());
     }
     return '';
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:11,代码来源:link.class.php

示例13: getTabNameForItem

 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && $item->getType() == 'Computer' && Computer::canView()) {
         $nb = 0;
         if ($_SESSION['glpishow_count_on_tabs']) {
             $nb = countElementsInTable('glpi_computervirtualmachines', "computers_id = '" . $item->getID() . "' AND `is_deleted`='0'");
         }
         return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
     }
     return '';
 }
开发者ID:btry,项目名称:glpi,代码行数:14,代码来源:computervirtualmachine.class.php

示例14: addTimeslot

 /**
  * @test
  */
 public function addTimeslot()
 {
     $pfTimeslot = new PluginFusioninventoryTimeslot();
     $input = array('entities_id' => 0, 'is_recursive' => 0, 'name' => 'unitdefault');
     $pfTimeslot->add($input);
     $cnt = countElementsInTable('glpi_plugin_fusioninventory_timeslots');
     $this->assertEquals(1, $cnt, "Timeslot may be added");
     $GLPIlog = new GLPIlogs();
     $GLPIlog->testSQLlogs();
     $GLPIlog->testPHPlogs();
 }
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:14,代码来源:TimeslotTest.php

示例15: getTabNameForItem

 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     // can exists for template
     if ($item->getType() == 'TicketTemplate' && Session::haveRight("tickettemplate", READ)) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), countElementsInTable($this->getTable(), "`tickettemplates_id`\n                                                               = '" . $item->getID() . "'"));
         }
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:11,代码来源:tickettemplatemandatoryfield.class.php


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