Project

General

Profile

Feature #17274 » 0005555_versionizelabels.patch

Administrator Admin, 2009-11-11 23:58

View differences:

t3lib/class.t3lib_tcemain.php (working copy)
// Create raw-copy and return result:
return $this->copyRecord_raw($table,$id,-1,$overrideArray);
} else $this->newlog('Record "'.$table.':'.$id.'" you wanted to versionize was already a version in the workspace (wsid='.$this->BE_USER->workspace.')!',1);
} else $this->newlog('Record cannot be deleted: '.$this->cannotDeleteRecord($table,$id),1);
} else $this->newlog('Record cannot be versioned because it is a placeholder for a moving operation',1);
} else $this->newlog('Record "'.$table.':'.$id.'" you wanted to versionize was already a version in archive (pid=-1)!',1);
} else $this->newlog('Record "'.$table.':'.$id.'" you wanted to versionize did not exist!',1);
} else $this->newlog('The versioning type '.$versionizeTree.' mode you requested was not allowed',1);
} else $this->newlog('You didnt have correct permissions to make a new version (copy) of this record "'.$table.'" / '.$id,1);
} else $this->newlog('Versioning is not supported for this table "'.$table.'" / '.$id,1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.version_exists'), $table, $id, $this->BE_USER->workspace), 1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.cant_delete_record') . $this->cannotDeleteRecord ($table, $id), 1);
} else $this->newlog ( $GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.cant_versionize_move_placeholder'), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.record_is_archived_version'), $table, $id), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.record_doesnt_exists'), $table, $id), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionize.type_not_allowed'), $versionizeTree), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.new_version_not_allowed'), $table, $id), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizeRecord.no_version_suppport'), $table, $id),1);
}
/**
......
$theNewRootID = $this->copyRecord_raw('pages',$thePageUid,$newPid);
$this->rawCopyPageContent($thePageUid,$theNewRootID,$verTablesArray);
} else {
$this->newlog('Something went wrong during copying branch (for versioning)',1);
$this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizePages.error_during_branch_creation'), 1);
break;
}
}
} // else the page was not copied. Too bad...
} else $this->newlog('The root version could not be created!',1);
} else $this->newlog('Versioning type "'.$versionizeTree.'" was not allowed in workspace',1);
} else $this->newlog('Attempt to versionize page without permission to this table',1);
} else $this->newlog('Could not read all subpages to versionize.',1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizePages.root_creation_failed'), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionize.type_not_allowed'), $versionizeTree), 1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizePages.cant_access_table'), 1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:versionizePages.cant_read_subpages'), 1);
}
/**
......
$this->deleteEl($table,$id,TRUE); // Force delete
}
$this->newlog2(($swapIntoWS ? 'Swapping' : 'Publishing').' successful for table "'.$table.'" uid '.$id.'=>'.$swapWith, $table, $id, $swapVersion['pid']);
if ($swapIntoWS) {
$label = sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.swap_successful'), $tabel, $id, $swapWith);
} else {
$label = sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.swap_successful'), $tabel, $id, $swapWith);
}
$this->newlog2( $label, $table, $id, $swapVersion['pid']);
// Update reference index:
$this->updateRefIndex($table,$id);
......
if ($GLOBALS['TYPO3_DB']->sql_error()) $sqlErrors[]=$GLOBALS['TYPO3_DB']->sql_error();
if (count($sqlErrors)) {
$this->newlog('During Swapping: SQL errors happened: '.implode('; ',$sqlErrors),2);
$this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.sql_error') . implode('; ',$sqlErrors), 2);
}
}
}
......
if (!$swapIntoWS && $t3ver_state['curVersion']>0) {
$this->deleteEl($table, $swapWith, TRUE, TRUE); // For delete + completely delete!
}
} else $this->newlog('During Swapping: SQL errors happened: '.implode('; ',$sqlErrors),2);
} else $this->newlog('A swapping lock file was present. Either another swap process is already running or a previous swap process failed. Ask your administrator to handle the situation.',2);
} else $this->newlog('In swap version, either pid was not -1 or the t3ver_oid didn\'t match the id of the online version as it must!',2);
} else $this->newlog('Workspace #'.$swapVersion['t3ver_wsid'].' does not support swapping.',1);
} else $this->newlog('You cannot publish a record you do not have edit and show permissions for',1);
} else $this->newlog('Records in workspace #'.$swapVersion['t3ver_wsid'].' can only be published when in "Publish" stage.',1);
} else $this->newlog('User could not publish records from workspace #'.$swapVersion['t3ver_wsid'],1);
} else $this->newlog('Error: Either online or swap version could not be selected!',2);
} else $this->newlog('Error: You cannot swap versions for a record you do not have access to edit!',1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.sql_error') . implode('; ',$sqlErrors), 2);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.swap_file_found'), 2);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.invalid_pid_or_wrong_oid'), 2);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.swap_disabled'), $swapVersion['t3ver_wsid']), 1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.missing_permissions'), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.wrong_stage'), $swapVersion['t3ver_wsid']), 1);
} else $this->newlog (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.missing_publishing_right'), $swapVersion['t3ver_wsid']), 1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.records_not_found'), 2);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_swap.missing_record_access'),1);
}
/**
......
global $TCA;
if ($errorCode = $this->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
$this->newlog('Attempt to reset workspace for record failed: '.$errorCode,1);
$this->newlog ( $GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_clearWSID.reset_error') . $errorCode, 1);
} elseif ($this->checkRecordUpdateAccess($table,$id)) {
if ($liveRec = t3lib_BEfunc::getLiveVersionOfRecord($table,$id,'uid,t3ver_state')) {
// Clear workspace ID:
......
}
}
}
} else $this->newlog('Attempt to reset workspace for record failed because you do not have edit access',1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_clearWSID.no_access'), 1);
}
/**
......
*/
function version_setStage($table,$id,$stageId,$comment='',$accumulateForNotifEmail=FALSE) {
if ($errorCode = $this->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
$this->newlog('Attempt to set stage for record failed: '.$errorCode,1);
$this->newlog ($this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_setStage.staging_error') . $errorCode, 1);
} elseif ($this->checkRecordUpdateAccess($table,$id)) {
$record = t3lib_BEfunc::getRecord($table, $id);
$stat = $this->BE_USER->checkWorkspace($record['t3ver_wsid']);
......
$sArray = array();
$sArray['t3ver_stage'] = $stageId;
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid='.intval($id), $sArray);
$this->newlog2('Stage for record was changed to '.$stageId.'. Comment was: "'.substr($comment,0,100).'"',$table,$id);
$this->newlog2 (sprintf ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_setStage.staging_error'), $stageId, substr ($comment, 0, 100)), $table, $id);
// TEMPORARY, except 6-30 as action/detail number which is observed elsewhere!
$this->log($table,$id,6,0,0,'Stage raised...',30,array('comment'=>$comment,'stage'=>$stageId));
$this->log ($table, $id, 6, 0, 0, $GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_setStage.stage_raised'), 30, array ('comment' => $comment, 'stage' => $stageId));
if ((int)$stat['stagechg_notification']>0) {
if ($accumulateForNotifEmail) {
......
$this->notifyStageChange($stat,$stageId,$table,$id,$comment);
}
}
} else $this->newlog('The member user tried to set a stage value "'.$stageId.'" that was not allowed',1);
} else $this->newlog('Attempt to set stage for record failed because you do not have edit access',1);
} else $this->newlog (sprintf($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_setStage.stage_not_allowed'), $stageId), 1);
} else $this->newlog ($GLOBALS['LANG']->sL ('LLL:EXT:lang/locallang_tcemain.xml:version_setStage.missing_edit_access'), 1);
}
/**
typo3/sysext/lang/locallang_tcemain.xml (revision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for all messages which are passed around within the tcemain-processing..</description>
<type>database</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="versionize.type_not_allowed">The versioning type %s mode you requested was not allowed.</label>
<label index="versionizeRecord.version_exists">Record "%s:%d" you wanted to versionize was already a version in the workspace (wsid=%s)!</label>
<label index="versionizeRecord.cant_delete_record">Record cannot be deleted: </label>
<label index="versionizeRecord.cant_versionize_move_placeholder">Record cannot be versioned because it is a placeholder for a moving operation</label>
<label index="versionizeRecord.record_is_archived_version">Record "%s:%d" you wanted to versionize was already a version in archive (pid=-1)!</label>
<label index="versionizeRecord.record_doesnt_exists">Record "%s:%d" you wanted to versionize did not exist!</label>
<label index="versionizeRecord.new_version_not_allowed">You didnt have correct permissions to make a new version (copy) of this record %s:%d"</label>
<label index="versionizeRecord.no_version_suppport">Versioning is not supported for this table "%s:%d"</label>
<label index="versionizePages.error_during_branch_creation">Something went wrong during copying branch (for versioning).</label>
<label index="versionizePages.root_creation_failed">The root version could not be created!</label>
<label index="versionizePages.cant_access_table">Attempt to versionize page without permission to this table.</label>
<label index="versionizePages.cant_read_subpages">Could not read all subpages to versionize.</label>
<label index="version_swap.swap_successful">Swapping successful for table "%s" uid %d=>%d</label>
<label index="version_swap.publish_successful">Publishing successful for table "%s" uid %d=>%d</label>
<label index="version_swap.online_record_updated">Record '%s' (%s) was updated. (Online version)</label>
<label index="version_swap.offline_record_updated">Record '%s' (%s) was updated. (Offline version)</label>
<label index="version_swap.sql_error">During Swapping: SQL errors happened: </label>
<label index="version_swap.swap_file_found">A swapping lock file was present. Either another swap process is already running or a previous swap process failed. Ask your administrator to handle the situation.</label>
<label index="version_swap.invalid_pid_or_wrong_oid">In swap version, either pid was not -1 or the t3ver_oid didn\'t match the id of the online version as it must! </label>
<label index="version_swap.swap_disabled">Workspace #%d does not support swapping.</label>
<label index="version_swap.missing_permissions">You cannot publish a record you do not have edit and show permissions for.</label>
<label index="version_swap.wrong_stage">Records in workspace #%d can only be published when in "Publish" stage.</label>
<label index="version_swap.missing_publishing_right">User could not publish records from workspace #%d.</label>
<label index="version_swap.records_not_found">Error: Either online or swap version could not be selected!</label>
<label index="version_swap.missing_record_access">Error: You cannot swap versions for a record you do not have access to edit!</label>
<label index="version_clearWSID.reset_error">'Attempt to reset workspace for record failed:</label>
<label index="version_clearWSID.no_access">Attempt to reset workspace for record failed because you do not have edit access.</label>
<label index="version_setStage.staging_error">Attempt to set stage for record failed: </label>
<label index="version_setStage.stage_changed">Stage for record was changed to %s. Comment was: "%s"</label>
<label index="version_setStage.stage_raised">Stage raised...</label>
<label index="version_setStage.stage_not_allowed">The member user tried to set a stage value "%s" that was not allowed.</label>
<label index="version_setStage.missing_edit_access">Attempt to set stage for record failed because you do not have edit access."</label>
</languageKey>
</data>
</T3locallang>
(1-1/2)