irre_7611_rev8536.patch

Administrator Admin, 2010-08-09 11:35

Download (6.21 KB)

View differences:

t3lib/class.t3lib_tceforms.php (working copy)
1579 1579
		$inlineParent = $this->inline->getStructureLevel(-1);
1580 1580
		if(is_array($inlineParent) && $inlineParent['uid']) {
1581 1581
			if ($inlineParent['config']['foreign_table'] == $table && $inlineParent['config']['foreign_unique'] == $field) {
1582
				$uniqueIds = $this->inline->inlineData['unique'][$this->inline->inlineNames['object'].'['.$table.']']['used'];
1583
				$PA['fieldChangeFunc']['inlineUnique'] = "inline.updateUnique(this,'".$this->inline->inlineNames['object'].'['.$table."]','".$this->inline->inlineNames['form']."','".$row['uid']."');";
1582
				$uniqueIds = $this->inline->inlineData['unique'][$this->inline->inlineNames['object'].'-'.$table]['used'];
1583
				$PA['fieldChangeFunc']['inlineUnique'] = "inline.updateUnique(this,'".$this->inline->inlineNames['object'].'-'.$table."','".$this->inline->inlineNames['form']."','".$row['uid']."');";
1584 1584
			}
1585 1585
				// hide uid of parent record for symmetric relations
1586 1586
			if ($inlineParent['config']['foreign_table'] == $table && ($inlineParent['config']['foreign_field'] == $field || $inlineParent['config']['symmetric_field'] == $field)) {
......
3643 3643
				$inlineParent = $this->inline->getStructureLevel(-1);
3644 3644
				if(is_array($inlineParent) && $inlineParent['uid']) {
3645 3645
					if ($inlineParent['config']['foreign_table'] == $table && $inlineParent['config']['foreign_unique'] == $field) {
3646
						$objectPrefix = $this->inline->inlineNames['object'].'['.$table.']';
3646
						$objectPrefix = $this->inline->inlineNames['object'].'-'.$table;
3647 3647
						$aOnClickInline = $objectPrefix.'|inline.checkUniqueElement|inline.setUniqueElement';
3648 3648
						$rOnClickInline = 'inline.revertUnique(\''.$objectPrefix.'\',null,\''.$uid.'\');';
3649 3649
					}
t3lib/class.t3lib_tceforms_inline.php (working copy)
288 288
			// Render the level links (create new record, localize all, synchronize):
289 289
		if ($config['appearance']['levelLinksPosition']!='none') {
290 290
			$levelLinks = $this->getLevelInteractionLink('newRecord', $nameObject . self::Structure_Separator . $foreign_table, $config);
291
			if ($language>0) {
292
					// Add the "Localize all records" link before all child records:
293
				if (isset($config['appearance']['showAllLocalizationLink']) && $config['appearance']['showAllLocalizationLink']) {
294
					$levelLinks.= $this->getLevelInteractionLink('localize', $nameObject . self::Structure_Separator . $foreign_table, $config);
295
				}
296
					// Add the "Synchronize with default language" link before all child records:
297
				if (isset($config['appearance']['showSynchronizationLink']) && $config['appearance']['showSynchronizationLink']) {
298
					$levelLinks.= $this->getLevelInteractionLink('synchronize', $nameObject . self::Structure_Separator . $foreign_table, $config);
299
				}
300
			}
301 291
		}
302 292
			// Add the level links before all child records:
303 293
		if (in_array($config['appearance']['levelLinksPosition'], array('both', 'top'))) {
304 294
			$item.= $levelLinks;
305 295
		}
296
		
297
		if ($language>0) {
298
			$localizationLinks = "";
299
				// Add the "Localize all records" link before all child records:
300
			if (isset($config['appearance']['showAllLocalizationLink']) && $config['appearance']['showAllLocalizationLink']) {
301
				$localizationLinks .= $this->getLevelInteractionLink('localize', $nameObject . self::Structure_Separator . $foreign_table, $config);
302
			}
303
				// Add the "Synchronize with default language" link before all child records:
304
			if (isset($config['appearance']['showSynchronizationLink']) && $config['appearance']['showSynchronizationLink']) {
305
				$localizationLinks .= $this->getLevelInteractionLink('synchronize', $nameObject . self::Structure_Separator . $foreign_table, $config);
306
			}
307
		}
308
		$item.=$localizationLinks;
309
		
306 310

  
307 311
		$item .= '<div id="'.$nameObject.'_records">';
308 312
		$relationList = array();
......
1202 1206
		}
1203 1207

  
1204 1208
			// Encode TCEforms AJAX response with utf-8:
1205
		$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
1209
		//$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
1206 1210

  
1207 1211
		if (!$current['uid']) {
1208 1212
			$jsonArray = array(
......
1313 1317
		}
1314 1318

  
1315 1319
			// Encode TCEforms AJAX response with utf-8:
1316
		$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
1320
		//$item = $GLOBALS['LANG']->csConvObj->utf8_encode($item, $GLOBALS['LANG']->charSet);
1317 1321

  
1318 1322
		$jsonArray = array(
1319 1323
			'data'	=> $item,
t3lib/jsfunc.inline.js (working copy)
330 330
				if (!(unique.selector && unique.max == -1)) {
331 331
					var formName = this.prependFormFieldNames+this.parseObjectId('parts', objectId, 3, 1, true);
332 332

  
333
					var fieldObj = document.getElementsByName(elName);
333
					var selector = $(objectId+'_selector');
334 334
					var values = $H(unique.used).values();
335 335

  
336
					if (fieldObj.length) {
336
					if (selector) {
337 337
							// remove all items from the new select-item which are already used in other children
338
						for (var i=0; i<values.length; i++) this.removeSelectOption(fieldObj[0], values[i]);
338
						for (var i=0; i<values.length; i++) this.removeSelectOption(selector, values[i]);
339 339
							// set the selected item automatically to the first of the remaining items if no selector is used
340 340
						if (!unique.selector) {
341
							selectedValue = fieldObj[0].options[0].value;
342
							fieldObj[0].options[0].selected = true;
343
							this.updateUnique(fieldObj[0], objectId, formName, recordUid);
344
							this.handleChangedField(fieldObj[0], objectId+'['+recordUid+']');
341
							selectedValue = selector.options[0].value;
342
							selector.options[0].selected = true;
343
							this.updateUnique(selector, objectId, formName, recordUid);
344
							this.handleChangedField(selector, objectId+'['+recordUid+']');
345 345
						}
346 346
						if (typeof this.data.unique[objectId].used.length != 'undefined') {
347 347
							this.data.unique[objectId].used = {};