CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

ts_config_fix.patch

Felix Nagel, 2010-08-26 15:27

Download (3 kB)

 
Classes/Controller/Module/Tx_Formhandler_Controller_Backend.php (working copy)
375 375
						}
376 376
					}
377 377
				}
378

  
378
				$tsconfig = t3lib_BEfunc::getModTSconfig($this->id,'tx_formhandler_mod1'); 
379
				$configParams = array();
380
				// check if TSconfig filter is set
381
				if ($tsconfig['properties']['config.']['csv'] != "") {
382
					$configParams = t3lib_div::trimExplode(',', $tsconfig['properties']['config.']['csv'], 1);
383
					$generator = $this->componentManager->getComponent('Tx_Formhandler_Generator_CSV');
384
					$generator->generateModuleCSV($renderRecords, $configParams);	
385
				}
379 386
				//if fields were chosen in the selection view, perform the export
380
				if(isset($params['exportParams'])) {
387
				elseif(isset($params['exportParams'])) {
381 388
					$generator = $this->componentManager->getComponent('Tx_Formhandler_Generator_CSV');
382 389
					$generator->generateModuleCSV($renderRecords, $params['exportParams']);
383 390

  
......
591 598
					$formatMarkers['###HIDDEN_FIELDS###'] .= '<input type="hidden" name="formhandler[markedUids][]" value="' . $id . '" />';
592 599
				}
593 600
				$formatMarkers['###KEY###'] = $key;
594
				$formatMarkers['###UID###'] = 0;
601
				$formatMarkers['###UID###'] = $this->id;
595 602
				$formatMarkers['###LLL:export###'] = $LANG->getLL('export');
596 603
				$formatMarkers['###FORMAT###'] = implode(',', array_keys($format));
597 604
				$markers['###FORMATS###'] .= Tx_Formhandler_StaticFuncs::substituteMarkerArray($code, $formatMarkers);
......
607 614
			$formatMarkers['###HIDDEN_FIELDS###'] .= '<input type="hidden" name="formhandler[markedUids][]" value="' . $id . '" />';
608 615
		}
609 616
		$formatMarkers['###KEY###'] = '*';
610
		$formatMarkers['###UID###'] = 0;
617
		$formatMarkers['###UID###'] = $this->id;
611 618
		$formatMarkers['###LLL:export###'] = $LANG->getLL('export_all');
612 619
		$formatMarkers['###FORMAT###'] = '';
613 620
		$markers['###FORMATS###'] .= Tx_Formhandler_StaticFuncs::substituteMarkerArray($code, $formatMarkers);
Classes/Generator/Tx_Formhandler_Generator_CSV.php (working copy)
80 80
		}
81 81
		if(count($exportParams) > 0) {
82 82
			foreach($data as &$params) {
83
				// fill missing fields with empty value
84
				foreach($exportParams as $key => $param) {
85
                    if(!array_key_exists($param, $params)) {
86
                        $params[$param] = '';
87
					}
88
                 }
89
				// remove unwanted fields
83 90
				foreach($params as $key => $value) {
84 91
					if(!in_array($key, $exportParams)) {
85 92
						unset($params[$key]);
86
					}
93
					}	
87 94
				}
88 95
			}
89 96
		}
90 97
		
98
        array_unshift($data, $exportParams);
99
		
91 100
		// sort data
92 101
		$dataSorted = array();
93 102
		foreach($data as $array) {