Commit a6b52eec authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added a new feature to force all UIDs in the "impexp" extension.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@535 709f56b5-9817-0410-a4d7-c38de5d9e867
parent b23e6976
2005-01-21 Kasper Skårhøj,,, <kasper@typo3.com>
* Added a new feature to force all UIDs in the "impexp" extension.
2005-01-14 Kasper Skårhøj,,, <kasper@typo3.com>
* import/export: CSH for the whole module, localization of all labels
......
......@@ -88,7 +88,7 @@ $TYPO3_CONF_VARS = Array(
'requiredExt' => 'cms,lang,sv', // String list: List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
'extCache' => 1, // Int. 0,1,2: 0: ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time. 1: scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP-A), 2: scripts cached and prefix includes a hash based on the 'extList' string, 3: scripts cached to typo3conf/temp_CACHED_* (no hash included at all...)
'extList' => 'tsconfig_help,context_help,extra_page_cm_options,impexp,belog,aboutmodules,setup', // String list: List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
'extList' => 'tsconfig_help,context_help,extra_page_cm_options,impexp,belog,aboutmodules,setup,install', // String list: List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
'extConf' => array( // Config-options for extensions, stored as serialized arrays by extension-keys. Handled automatically by the EM.
// '--key--' => array()
)
......
......@@ -943,7 +943,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
'*',
'tx_impexp_presets',
'(public>0 || user_uid='.intval($GLOBALS['BE_USER']->user['uid']).')'.
($inData['pagetree']['id'] ? ' AND item_uid='.intval($inData['pagetree']['id']) : '')
($inData['pagetree']['id'] ? ' AND (item_uid='.intval($inData['pagetree']['id']).' OR item_uid=0)' : '')
);
if (is_array($presets)) {
......@@ -1084,6 +1084,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
$import->import_mode = $inData['import_mode'];
$import->enableLogging = $inData['enableLogging'];
$import->global_ignore_pid = $inData['global_ignore_pid'];
$import->force_all_UIDS = $inData['force_all_UIDS'];
$import->showDiff = !$inData['notShowDiff'];
$import->allowPHPScripts = $inData['allowPHPScripts'];
$import->softrefInputValues = $inData['softrefInputValues'];
......@@ -1139,7 +1140,6 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
<input type="checkbox" name="tx_impexp[global_ignore_pid]" value="1"'.($inData['global_ignore_pid'] ? ' checked="checked"' : '').' />
'.$LANG->getLL('importdata_ignorePidDifferencesGlobally',1).'<br/>
<em>('.$LANG->getLL('importdata_ifYouSetThis',1).')</em>
' : ''
).'</td>
</tr>';
......@@ -1154,7 +1154,14 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
'.($GLOBALS['BE_USER']->isAdmin() ? '
<input type="checkbox" name="tx_impexp[allowPHPScripts]" value="1"'.($inData['allowPHPScripts'] ? ' checked="checked"' : '').' />
'.$LANG->getLL('importdata_allowToWriteBanned',1).'<br/>' : '').'
'.$LANG->getLL('importdata_allowToWriteBanned',1).'<br/>' : '').
(!$inData['do_update'] && $GLOBALS['BE_USER']->isAdmin() ? '
<br/>
<input type="checkbox" name="tx_impexp[force_all_UIDS]" value="1"'.($inData['force_all_UIDS'] ? ' checked="checked"' : '').' />
<span class="typo3-red">'.$LANG->getLL('importdata_force_all_UIDS',1).'</span><br/>
<em>('.$LANG->getLL('importdata_force_all_UIDS_descr',1).')</em>' : '').
'
</td>
</tr>';
......@@ -1411,18 +1418,16 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
$inData_temp = unserialize($preset['preset_data']);
if (is_array($inData_temp)) {
if (isset($presetData['merge'])) {
// Merge records in:
if (is_array($inData_temp['record'])) {
$inData_temp['record'] = array_merge($inData_temp['record'], $inData['record']);
} else $inData_temp['record'] = $inData['record'];
$inData['record'] = array_merge((array)$inData['record'], $inData_temp['record']);
}
// Merge lists in:
if (is_array($inData_temp['list'])) {
$inData_temp['list'] = array_merge($inData_temp['list'], $inData['list']);
} else $inData_temp['list'] = $inData['list'];
$inData_temp['listCfg'] = $inData['listCfg'];
// Swap:
$inData = $inData_temp;
$inData['list'] = array_merge((array)$inData['list'], $inData_temp['list']);
}
} else {
$msg = 'Preset #'.$preset['uid'].' loaded!';
$inData = $inData_temp;
......
......@@ -96,6 +96,10 @@
<label index="importdata_thisOptionRequiresThat">This option requires that the structure you import already exists on this server and only needs to be updated with new content!</label>
<label index="importdata_ignorePidDifferencesGlobally">Ignore PID differences globally</label>
<label index="importdata_ifYouSetThis">If you set this option, the position of updated elements will not be updated to match the structure of the input file.</label>
<label index="importdata_force_all_UIDS">Force ALL UIDs values</label>
<label index="importdata_force_all_UIDS_descr">With this option the original UID value of all imported records are forced to be the same. BE VERY CAREFUL WITH THIS! (Admin Only).</label>
<label index="importdata_options">Options:</label>
<label index="importdata_doNotShowDifferences">Do not show differences in records</label>
<label index="importdata_greenValuesAreFrom">Green values are from the import file, red values from the current database record and black values are similar in both versions.</label>
......
......@@ -214,6 +214,7 @@ class tx_impexp {
var $suggestedInsertUids = array(); // Used to register the forged UID values for imported records that we want to create with the same UIDs as in the import file. Admin-only feature.
var $import_mode = array(); // Setting import modes during update state: as_new, exclude, force_uid
var $global_ignore_pid = FALSE; // If set, PID correct is ignored globally
var $force_all_UIDS = FALSE; // If set, all UID values are forced! (update or import)
var $showDiff = FALSE; // If set, a diff-view column is added to the overview.
var $allowPHPScripts = FALSE; // If set, and if the user is admin, allow the writing of PHP scripts to fileadmin/ area.
var $enableLogging = FALSE; // Disable logging when importing
......@@ -1651,7 +1652,7 @@ class tx_impexp {
} else { // Inserts:
$this->import_data[$table][$ID]['pid'] = $pid;
if ($this->import_mode[$table.':'.$uid]==='force_uid' && $GLOBALS['BE_USER']->isAdmin()) {
if ((($this->import_mode[$table.':'.$uid]==='force_uid' && $this->update) || $this->force_all_UIDS) && $GLOBALS['BE_USER']->isAdmin()) {
#debug($this->import_mode[$table.':'.$uid],$table.':'.$uid);
$this->import_data[$table][$ID]['uid'] = $uid;
$this->suggestedInsertUids[$table.':'.$uid] = 'DELETE';
......
......@@ -2,9 +2,9 @@
########################################################################
# Extension Manager/Repository config file for ext: "impexp"
#
#
# Auto generated 17-11-2004 17:48
#
#
# Manual updates:
# Only the data in the array - anything else is removed by next write
########################################################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment