Project

General

Profile

Bug #18269 » irre_7611_rev8536.patch

Administrator Admin, 2010-08-09 11:35

View differences:

t3lib/class.t3lib_tceforms.php (working copy)
$inlineParent = $this->inline->getStructureLevel(-1);
if(is_array($inlineParent) && $inlineParent['uid']) {
if ($inlineParent['config']['foreign_table'] == $table && $inlineParent['config']['foreign_unique'] == $field) {
$uniqueIds = $this->inline->inlineData['unique'][$this->inline->inlineNames['object'].'['.$table.']']['used'];
$PA['fieldChangeFunc']['inlineUnique'] = "inline.updateUnique(this,'".$this->inline->inlineNames['object'].'['.$table."]','".$this->inline->inlineNames['form']."','".$row['uid']."');";
$uniqueIds = $this->inline->inlineData['unique'][$this->inline->inlineNames['object'].'-'.$table]['used'];
$PA['fieldChangeFunc']['inlineUnique'] = "inline.updateUnique(this,'".$this->inline->inlineNames['object'].'-'.$table."','".$this->inline->inlineNames['form']."','".$row['uid']."');";
}
// hide uid of parent record for symmetric relations
if ($inlineParent['config']['foreign_table'] == $table && ($inlineParent['config']['foreign_field'] == $field || $inlineParent['config']['symmetric_field'] == $field)) {
......
$inlineParent = $this->inline->getStructureLevel(-1);
if(is_array($inlineParent) && $inlineParent['uid']) {
if ($inlineParent['config']['foreign_table'] == $table && $inlineParent['config']['foreign_unique'] == $field) {
$objectPrefix = $this->inline->inlineNames['object'].'['.$table.']';
$objectPrefix = $this->inline->inlineNames['object'].'-'.$table;
$aOnClickInline = $objectPrefix.'|inline.checkUniqueElement|inline.setUniqueElement';
$rOnClickInline = 'inline.revertUnique(\''.$objectPrefix.'\',null,\''.$uid.'\');';
}
t3lib/class.t3lib_tceforms_inline.php (working copy)
// Render the level links (create new record, localize all, synchronize):
if ($config['appearance']['levelLinksPosition']!='none') {
$levelLinks = $this->getLevelInteractionLink('newRecord', $nameObject . self::Structure_Separator . $foreign_table, $config);
if ($language>0) {
// Add the "Localize all records" link before all child records:
if (isset($config['appearance']['showAllLocalizationLink']) && $config['appearance']['showAllLocalizationLink']) {
$levelLinks.= $this->getLevelInteractionLink('localize', $nameObject . self::Structure_Separator . $foreign_table, $config);
}
// Add the "Synchronize with default language" link before all child records:
if (isset($config['appearance']['showSynchronizationLink']) && $config['appearance']['showSynchronizationLink']) {
$levelLinks.= $this->getLevelInteractionLink('synchronize', $nameObject . self::Structure_Separator . $foreign_table, $config);
}
}
}
// Add the level links before all child records:
if (in_array($config['appearance']['levelLinksPosition'], array('both', 'top'))) {
$item.= $levelLinks;
}
if ($language>0) {
$localizationLinks = "";
// Add the "Localize all records" link before all child records:
if (isset($config['appearance']['showAllLocalizationLink']) && $config['appearance']['showAllLocalizationLink']) {
$localizationLinks .= $this->getLevelInteractionLink('localize', $nameObject . self::Structure_Separator . $foreign_table, $config);
}
// Add the "Synchronize with default language" link before all child records:
if (isset($config['appearance']['showSynchronizationLink']) && $config['appearance']['showSynchronizationLink']) {
$localizationLinks .= $this->getLevelInteractionLink('synchronize', $nameObject . self::Structure_Separator . $foreign_table, $config);
}
}
$item.=$localizationLinks;
$item .= '<div id="'.$nameObject.'_records">';
$relationList = array();
......
}
// Encode TCEforms AJAX response with utf-8:
$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
//$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
if (!$current['uid']) {
$jsonArray = array(
......
}
// Encode TCEforms AJAX response with utf-8:
$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
//$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
$jsonArray = array(
'data' => $item,
t3lib/jsfunc.inline.js (working copy)
if (!(unique.selector && unique.max == -1)) {
var formName = this.prependFormFieldNames+this.parseObjectId('parts', objectId, 3, 1, true);
var fieldObj = document.getElementsByName(elName);
var selector = $(objectId+'_selector');
var values = $H(unique.used).values();
if (fieldObj.length) {
if (selector) {
// remove all items from the new select-item which are already used in other children
for (var i=0; i<values.length; i++) this.removeSelectOption(fieldObj[0], values[i]);
for (var i=0; i<values.length; i++) this.removeSelectOption(selector, values[i]);
// set the selected item automatically to the first of the remaining items if no selector is used
if (!unique.selector) {
selectedValue = fieldObj[0].options[0].value;
fieldObj[0].options[0].selected = true;
this.updateUnique(fieldObj[0], objectId, formName, recordUid);
this.handleChangedField(fieldObj[0], objectId+'['+recordUid+']');
selectedValue = selector.options[0].value;
selector.options[0].selected = true;
this.updateUnique(selector, objectId, formName, recordUid);
this.handleChangedField(selector, objectId+'['+recordUid+']');
}
if (typeof this.data.unique[objectId].used.length != 'undefined') {
this.data.unique[objectId].used = {};
(2-2/3)