Project

General

Profile

Bug #21102 » irre_15400_rev8536.patch

Administrator Admin, 2010-08-19 19:09

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/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 = {};
(1-1/5)