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


PHP Document_Item::cloneItem方法代码示例

本文整理汇总了PHP中Document_Item::cloneItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Document_Item::cloneItem方法的具体用法?PHP Document_Item::cloneItem怎么用?PHP Document_Item::cloneItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document_Item的用法示例。


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

示例1: 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

示例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()
 {
     // 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

示例4: post_addItem

 function post_addItem()
 {
     global $CFG_GLPI;
     $projet_projet = new PluginProjetProjet_Projet();
     // From interface
     if (isset($this->input['_link'])) {
         $this->input['_link']['plugin_projet_projets_id_1'] = $this->fields['id'];
         // message if projet doesn't exist
         if (!empty($this->input['_link']['plugin_projet_projets_id_2'])) {
             if ($projet_projet->can(-1, 'w', $this->input['_link'])) {
                 $projet_projet->add($this->input['_link']);
             } else {
                 Session::addMessageAfterRedirect(__('Unknown project', 'projet'), false, ERROR);
             }
         }
     }
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         //add parent
         PluginProjetProjet_Projet::cloneItem($this->input["_oldID"], $this->fields['id']);
         // ADD Documents
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD Contracts
         Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD items
         PluginProjetProjet_Item::cloneItem($this->input["_oldID"], $this->fields['id']);
         // ADD tasks
         PluginProjetTask::cloneItem($this->input["_oldID"], $this->fields['id']);
     }
     if (isset($this->input['withtemplate']) && $this->input["withtemplate"] != 1 && isset($this->input['send_notification']) && $this->input['send_notification'] == 1) {
         if ($CFG_GLPI["use_mailing"]) {
             NotificationEvent::raiseEvent("new", $this);
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:35,代码来源:projet.class.php

示例5: 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

示例6: 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

示例7: post_addItem

 function post_addItem()
 {
     global $CFG_GLPI;
     // Manage add from template
     if (isset($this->input["_oldID"])) {
         // ADD choices
         PluginResourcesChoice::cloneItem($this->input["_oldID"], $this->fields['id']);
         // ADD items
         PluginResourcesResource_Item::cloneItem($this->input["_oldID"], $this->fields['id']);
         // ADD reports
         PluginResourcesReportConfig::cloneItem($this->input["_oldID"], $this->fields['id']);
         //manage template from helpdesk (no employee to add : resource.form.php)
         if (!isset($this->input["add_from_helpdesk"])) {
             PluginResourcesEmployee::cloneItem($this->input["_oldID"], $this->fields['id']);
         }
         // ADD Documents
         Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']);
         // ADD tasks
         PluginResourcesTask::cloneItem($this->input["_oldID"], $this->fields['id']);
     }
     //Launch notification
     if (isset($this->input['withtemplate']) && $this->input["withtemplate"] != 1 && isset($this->input['send_notification']) && $this->input['send_notification'] == 1) {
         if ($CFG_GLPI["use_mailing"]) {
             NotificationEvent::raiseEvent("new", $this);
         }
     }
     //ADD Checklists from rules
     $PluginResourcesChecklistconfig = new PluginResourcesChecklistconfig();
     $PluginResourcesChecklistconfig->addChecklistsFromRules($this, PluginResourcesChecklist::RESOURCES_CHECKLIST_IN);
     $PluginResourcesChecklistconfig->addChecklistsFromRules($this, PluginResourcesChecklist::RESOURCES_CHECKLIST_OUT);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:resource.class.php


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