Changeset View
Changeset View
Standalone View
Standalone View
core/install/upgrade_helper.php
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
function _updateDetailTemplate($prefix, $from_template, $to_template) | function _updateDetailTemplate($prefix, $from_template, $to_template) | ||||
{ | { | ||||
$sql = 'SELECT CustomFieldId | $sql = 'SELECT CustomFieldId | ||||
FROM ' . TABLE_PREFIX . 'CustomField | FROM ' . TABLE_PREFIX . 'CustomField | ||||
WHERE FieldName = "' . $prefix . '_ItemTemplate"'; | WHERE FieldName = "' . $prefix . '_ItemTemplate"'; | ||||
$custom_field_id = $this->Conn->GetOne($sql); | $custom_field_id = $this->Conn->GetOne($sql); | ||||
/** @var kMultiLanguage $ml_formatter */ | |||||
$ml_formatter = $this->Application->recallObject('kMultiLanguage'); | $ml_formatter = $this->Application->recallObject('kMultiLanguage'); | ||||
/* @var $ml_formatter kMultiLanguage */ | |||||
$field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true); | $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true); | ||||
$sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData | $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData | ||||
SET ' . $field . ' = "' . $to_template . '" | SET ' . $field . ' = "' . $to_template . '" | ||||
WHERE ' . $field . ' = "' . $from_template . '"'; | WHERE ' . $field . ' = "' . $from_template . '"'; | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
} | } |