/** * Used to update the ForeignKeyField * * @param $input datas used to add the item * * @return the modified $input array **/ function prepareInputForUpdate($input) { $input[$this->getForeignKeyField()] = $this->getNewAncestor(); // We call the parent to manage tree return parent::prepareInputForUpdate($input); }
/** * @since version 0.84 (before in entitydata.class) **/ function prepareInputForUpdate($input) { $input = parent::prepareInputForUpdate($input); // Si on change le taux de déclenchement de l'enquête (enquête activée) ou le type de l'enquete, // cela s'applique aux prochains tickets - Pas à l'historique if (isset($input['inquest_rate']) && ($this->fields['inquest_rate'] == 0 || is_null($this->fields['max_closedate'])) && $input['inquest_rate'] != $this->fields['inquest_rate'] || isset($input['inquest_config']) && ($this->fields['inquest_config'] == self::CONFIG_PARENT || is_null($this->fields['max_closedate'])) && $input['inquest_config'] != $this->fields['inquest_config']) { $input['max_closedate'] = $_SESSION["glpi_currenttime"]; } // Force entities_id = -1 for root entity if ($input['id'] == 0) { $input['entities_id'] = -1; $input['level'] = 1; } if (!Session::isCron()) { // Filter input for connected $input = $this->checkRightDatas($input); } return $input; }