當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Infocom::cloneItem方法代碼示例

本文整理匯總了PHP中Infocom::cloneItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP Infocom::cloneItem方法的具體用法?PHP Infocom::cloneItem怎麽用?PHP Infocom::cloneItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Infocom的用法示例。


在下文中一共展示了Infocom::cloneItem方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Infocom

 function post_addItem()
 {
     global $CFG_GLPI;
     $itemtype = 'Software';
     $dupid = $this->fields["softwares_id"];
     if (isset($this->input["_duplicate_license"])) {
         $itemtype = 'SoftwareLicense';
         $dupid = $this->input["_duplicate_license"];
     }
     // Add infocoms if exists for the licence
     $ic = new Infocom();
     $ic->cloneItem('Software', $dupid, $this->fields['id'], $this->getType());
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:13,代碼來源:softwarelicense.class.php

示例2: post_addItem

 function post_addItem()
 {
     global $DB, $CFG_GLPI;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD Devices
         Item_devices::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Infocoms
         Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Ports
         NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Contract
         Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Documents
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Computers
         Computer_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
     }
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:19,代碼來源:phone.class.php

示例3: post_addItem

 function post_addItem()
 {
     global $DB;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD Devices
         Item_devices::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Infocoms
         Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD volumes
         ComputerDisk::cloneComputer($this->input["_oldID"], $this->fields['id']);
         // ADD software
         Computer_SoftwareVersion::cloneComputer($this->input["_oldID"], $this->fields['id']);
         Computer_SoftwareLicense::cloneComputer($this->input["_oldID"], $this->fields['id']);
         // ADD Contract
         Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Documents
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Ports
         NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // Add connected devices
         Computer_Item::cloneComputer($this->input["_oldID"], $this->fields['id']);
     }
 }
開發者ID:pvasener,項目名稱:glpi,代碼行數:24,代碼來源:computer.class.php

示例4: post_addItem

 function post_addItem()
 {
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD Documents
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Infocoms
         Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
     }
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:10,代碼來源:rack.class.php

示例5: post_addItem

 function post_addItem()
 {
     Infocom::cloneItem('CartridgeItem', $this->fields["cartridgeitems_id"], $this->fields['id'], $this->getType());
     parent::post_addItem();
 }
開發者ID:JULIO8,項目名稱:respaldo_glpi,代碼行數:5,代碼來源:cartridge.class.php

示例6: post_addItem

 function post_addItem()
 {
     Infocom::cloneItem('ConsumableItem', $this->fields["consumableitems_id"], $this->fields['id'], $this->getType());
 }
開發者ID:jose-martins,項目名稱:glpi,代碼行數:4,代碼來源:consumable.class.php

示例7: Infocom

 function post_addItem()
 {
     global $DB, $CFG_GLPI;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD Infocoms
         $ic = new Infocom();
         $ic->cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Ports
         $query = "SELECT `id`\n                   FROM `glpi_networkports`\n                   WHERE `items_id` = '" . $this->input["_oldID"] . "'\n                         AND `itemtype` = '" . $this->getType() . "'";
         $result = $DB->query($query);
         if ($DB->numrows($result) > 0) {
             while ($data = $DB->fetch_array($result)) {
                 $np = new NetworkPort();
                 $npv = new NetworkPort_Vlan();
                 $np->getFromDB($data["id"]);
                 unset($np->fields["id"]);
                 unset($np->fields["ip"]);
                 unset($np->fields["mac"]);
                 unset($np->fields["netpoints_id"]);
                 $np->fields["items_id"] = $this->fields['id'];
                 $portid = $np->addToDB();
                 foreach ($DB->request('glpi_networkports_vlans', array('networkports_id' => $data["id"])) as $vlan) {
                     $npv->assignVlan($portid, $vlan['vlans_id']);
                 }
             }
         }
         // ADD Contract
         $query = "SELECT `contracts_id`\n                   FROM `glpi_contracts_items`\n                   WHERE `items_id` = '" . $this->input["_oldID"] . "'\n                         AND `itemtype` = '" . $this->getType() . "'";
         $result = $DB->query($query);
         if ($DB->numrows($result) > 0) {
             $contractitem = new Contract_Item();
             while ($data = $DB->fetch_array($result)) {
                 $contractitem->add(array('contracts_id' => $data["contracts_id"], 'itemtype' => $this->getType(), 'items_id' => $this->fields['id']));
             }
         }
         // ADD Documents
         $query = "SELECT `documents_id`\n                   FROM `glpi_documents_items`\n                   WHERE `items_id` = '" . $this->input["_oldID"] . "'\n                         AND `itemtype` = '" . $this->getType() . "'";
         $result = $DB->query($query);
         if ($DB->numrows($result) > 0) {
             $docitem = new Document_Item();
             while ($data = $DB->fetch_array($result)) {
                 $docitem->add(array('documents_id' => $data["documents_id"], 'itemtype' => $this->getType(), 'items_id' => $this->fields['id']));
             }
         }
     }
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:47,代碼來源:phone.class.php

示例8: post_addItem

 function post_addItem()
 {
     global $DB, $CFG_GLPI;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
     }
     if (isset($this->input['_itemtype']) && isset($this->input['_items_id'])) {
         $simcard_item = new PluginSimcardSimcard_Item();
         $tmp['plugin_simcard_simcards_id'] = $this->getID();
         $tmp['itemtype'] = $this->input['_itemtype'];
         $tmp['items_id'] = $this->input['_items_id'];
         $simcard_item->add($tmp);
     }
 }
開發者ID:NandyJoshu,項目名稱:simcard,代碼行數:17,代碼來源:simcard.class.php

示例9: Infocom

 function post_addItem()
 {
     global $DB, $CFG_GLPI;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD Infocoms
         $ic = new Infocom();
         $ic->cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Contract
         $query = "SELECT `contracts_id`\n                   FROM `glpi_contracts_items`\n                   WHERE `items_id` = '" . $this->input["_oldID"] . "'\n                         AND `itemtype` = '" . $this->getType() . "'";
         $result = $DB->query($query);
         if ($DB->numrows($result) > 0) {
             $contractitem = new Contract_Item();
             while ($data = $DB->fetch_array($result)) {
                 $contractitem->add(array('contracts_id' => $data["contracts_id"], 'itemtype' => $this->getType(), 'items_id' => $this->fields['id']));
             }
         }
         // ADD Documents
         $query = "SELECT `documents_id`\n                   FROM `glpi_documents_items`\n                   WHERE `items_id` = '" . $this->input["_oldID"] . "'\n                         AND `itemtype` = '" . $this->getType() . "'";
         $result = $DB->query($query);
         if ($DB->numrows($result) > 0) {
             $docitem = new Document_Item();
             while ($data = $DB->fetch_array($result)) {
                 $docitem->add(array('documents_id' => $data["documents_id"], 'itemtype' => $this->getType(), 'items_id' => $this->fields['id']));
             }
         }
     }
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:28,代碼來源:software.class.php

示例10: post_addItem

 function post_addItem()
 {
     global $DB, $CFG_GLPI;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD Infocoms
         //   $ic = new Infocom();
         // $ic->cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         //test 0.84.3
         Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Contract
         //    $query = "SELECT `contracts_id`
         //     FROM `glpi_contracts_items`
         //       WHERE `items_id` = '".$this->input["_oldID"]."'
         //               AND `itemtype` = '".$this->getType()."'";
         // $result = $DB->query($query);
         // if ($DB->numrows($result)>0) {
         //  $contractitem = new Contract_Item();
         // while ($data=$DB->fetch_array($result)) {
         //  $contractitem->add(array('contracts_id' => $data["contracts_id"],
         //                         'itemtype'     => $this->getType(),
         //                       'items_id'     => $this->fields['id']));
         //  }
         //}
         // ADD Documents
         //  $query = "SELECT `documents_id`
         //          FROM `glpi_documents_items`
         //        WHERE `items_id` = '".$this->input["_oldID"]."'
         //            AND `itemtype` = '".$this->getType()."'";
         // $result = $DB->query($query);
         //
         //       if ($DB->numrows($result)>0) {
         //        $docitem = new Document_Item();
         //
         //          while ($data=$DB->fetch_array($result)) {
         //           $docitem->add(array('documents_id' => $data["documents_id"],
         //                             'itemtype'     => $this->getType(),
         //                           'items_id'     => $this->fields['id']));
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // }
         //      }
     }
     if (isset($this->input['_itemtype']) && isset($this->input['_items_id'])) {
         $simcard_item = new PluginSimcardSimcard_Item();
         $tmp['plugin_simcard_simcards_id'] = $this->getID();
         $tmp['itemtype'] = $this->input['_itemtype'];
         $tmp['items_id'] = $this->input['_items_id'];
         $simcard_item->add($tmp);
     }
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:51,代碼來源:simcard.class.php

示例11: Infocom

 function post_addItem()
 {
     $ic = new Infocom();
     $ic->cloneItem('CartridgeItem', $this->fields["cartridgeitems_id"], $this->fields['id'], $this->getType());
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:5,代碼來源:cartridge.class.php


注:本文中的Infocom::cloneItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。