Duplicate connected items to computer from an item template to its clone
static public cloneComputer ( $oldid, $newid ) | ||
$oldid | ID of the item to clone | |
$newid | ID of the item cloned |
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']); } }