public function storeValue($value, $type = 'default', $inputData = null) { $updatedField = new JUDownloadFieldCore_updated(null, $this->doc); $DBUpdatedFieldValue = $updatedField->doc->updated; $newUpdatedFieldValue = isset($this->fields_data[$updatedField->id]) ? $this->fields_data[$updatedField->id] : ""; if (!$this->is_new && ($newUpdatedFieldValue == $DBUpdatedFieldValue || $newUpdatedFieldValue == "")) { if ($this->doc->version != $value) { $date = JFactory::getDate(); $updatedValue = $date->toSql(); $updatedField->storeValue($updatedValue); } } parent::storeValue($value, $type, $inputData); }
public function storeValue($value, $type = 'default', $inputData = null) { $aliasField = new JUDownloadFieldCore_alias(null, $this->doc); $aliasField->fields_data = $this->fields_data; if (($this->is_new && (!$aliasField->canSubmit() || ($aliasField->canSubmit() && $this->fields_data[$aliasField->id] == ""))) || (!$this->is_new && (!$aliasField->canEdit() || ($aliasField->canEdit() && $this->fields_data[$aliasField->id] == ""))) ) { $aliasValue = $aliasField->filterField($value); $aliasField->storeValue($aliasValue); } if (parent::storeValue($value, $type, $inputData)) { JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judownload/tables'); $tableDocument = JTable::getInstance('Document', 'JUDownloadTable'); $tableDocument->load($this->doc_id); if (isset($tableDocument->asset_id) && $tableDocument->asset_id > 0) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->update('#__assets'); $query->set('title =' . $db->quote($value)); $query->where('id =' . $tableDocument->asset_id); $db->setQuery($query); $db->execute(); } } }