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

Implemented versioning API, phase 1 (tcemain). See changelog


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@439 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 5680eb5f
2004-08-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Implemented versioning API in tcemain plus other places. Still not functional for the broad public (will be in 3.8.0). Missing conceptual testing, implementation in the backend interface (still to be discussed how that is best done and fitting workflow) and not at all in the frontend.
* Tables configured for versioning by default is pages, tt_content, pages_language_overlay and sys_template
* !!!Notice that the type of integer for uid/pid fields of the above mentioned tables changed from "unsigned" to "signed". This should only mean something if you have uid/pid values over 2 billion - but then PHP will fail you anyways. So the impact should be nothing.
* For testers: Ask me (kasper) for the "version" extension which is my test bench and future management tool for the final implementation.
* !!!Fieldnames 't3ver_oid', 't3ver_id' and 't3ver_label' has been reserved for versioning adminstration
2004-08-22 Ingmar Schlecht <ingmars@web.de>
* Changed the way how the EM and the Kickstarter interact
......@@ -22,7 +30,7 @@
* Added "sleep(5)" when a false login was detected in the login-screen. This makes trying lots of username/passwords in the login screen boooooring...
* Added new GUI type: Dynamic TAB menu which can switch between a number of sheets of content dynamically with tabs. Used in flexforms and also in TemplaVoila.
* Set-locale issue for USER_INT objects should be fixed. Please test this someone!!!
2004-08-20 Ingmar Schlecht <ingmars@web.de>
......
......@@ -10,6 +10,7 @@ General:
- Feature: Controlling access to function menu modules as well (thus we could have a user-module inside ?Template? which could edit the constants field)
- Feature: Web >plugins -> to be a main module where people can place modules for their extension.
- Substitute "->include_once[] = ...." with "require_once()" directly in classes - BUT the problem is that class files accesses $TYPO3_CONF_VARS (for XCLASS inclusion) and that is not accessible from the function including the script unless "global $TYPO3_CONF_VARS" is set before inclusion. THEN all XCLASSes of that class will break!!!
- Backend Interface: Dont show edit icons if editing cannot be performed due to recordEditAccessInternals() / editlock for pages (pid)
TCEmain:
- Commenting of the class.
......@@ -40,7 +41,7 @@ TCEmain:
- Support that the content of a single field can be stored in an external file instead.
- Support that a list of fields can be stored in an external XML file instead.
- VERSIONING:
- Swapping API: A page can be copied for making modifications. Afterwards swapped with the original (page/tt_content uids preserved if possible). The original page is stored in archive of some kind.
- See description in appendix.
- LOGGING:
- Finish the logging of TCEmain actions (delete/copy) + finally define the API to the "sys_log" table!
- CLEAN_UP:
......@@ -166,6 +167,7 @@ Interface:
- See DHs mail: Message-ID: <mailman.1060763871.6396.typo3-metadev@lists.netfielders.de>
- Links could be going directly to the function menus inside modules as well!
Context Sensitive Help (CSH):
- Add multimedia?
......@@ -599,42 +601,20 @@ debug_backtrace() - nice function for debug-output.
APPENDIX: Versioning thoughts:
Authors: Julle and Kasper.
*****************
- Versions can be done on page level or element level
- In any case a pure copy of the element is produced
- For pages only configured tables will be copied, eg:
- Page
- tt_content
- pages_lang_overlay
- Versioning (for single elements including single "pages" record) is based on
- ONE element having an official position in the TYPO3 page tree, thus holding the official "uid" of the element! (If this element was deleted from the system, so are all versions of that element!)
- All versions of this one element being a) at pid "-1" and b) a field "real_id" pointing to the official UID
- Pages-versioning: For all elements belonging to a version of a page; They are just copied and has no official new version or binding back to whatever element they came from. They just came along. And in fact, they could even have their own version history for them selves!
OK - ONE element having an official position in the TYPO3 page tree, thus holding the official "uid" of the element! (If this element was deleted from the system, so are all versions of that element!)
OK - All versions of this one element being a) at pid "-1" and b) a field "real_id" pointing to the official UID
OK - Pages-versioning: For all elements belonging to a version of a page; They are just copied and has no official new version or binding back to whatever element they came from. They just came along. And in fact, they could even have their own version history for them selves!
- Backend user access to elements is based on the access restrictions for the official element. THis must be implemented on core level.
- Tables supporting versioning will have these fields:
- real_id - Pointing back to official in-tree version
- ver_id - Incremental integer (version number)
- ver_label - Version label, eg. "1.1.1" or "Christmas edition"
- editlock - Flag (core support independant of versioning) which IF SET makes it impossible for anyone to edit the record. The flag must be unset before editing can occur. (Is a feature which can be used to write-protect a version)
- pid/uid should have "signed" attributes in MySQL (pid = -1, uid =-xxxx for swapping).
- Preview in fronend
- At page level, done with a simple selector in the AdminPanel. Just like date/user/hidden is done.
- For other element, time will show.
- Backend module for versioning:
- Diff-ing between versions.
- Version-swapping log?
- clear-cache actions when swapping?
- TODO: When swapping; Check "unique" fields (like pages.alias) etc.
- ID-swapping for versioned elements
- Version from archive (future/past) will get the uid of the "real_id", the official element with "real_id" will get the new versions old uid.
- For pages-records: We will have to swap the "pid" values of all (versioning-included) elements on the pages.
- Swapping three-step process:
uid uid real_id
PUB: 13 --> -13 247
247 --> 13 -
-13 --> 247 13
- Pages-versioning and the impact of NOT swapping tt_content element uids:
- Loose anchor-points, manually made (could be hack-fixed by some intelligent copying tracking)
- TemplaVoila references to elements from other pages (will break, however bad practice to reference elements not in some sort of central library which will NEVER be page-versioned anyways)
......@@ -642,8 +622,8 @@ Authors: Julle and Kasper.
- Impact assesment: Low.
- Clean-up module (in templavoila?) could also track such things
- Problems for non-templavoila sites would be low.
- Swapping might need to exclude fields like "sorting" etc. Others could be imagined.
- copies:
OK - Swapping might need to exclude fields like "sorting" etc. Others could be imagined.
OK - copies:
- What about a page alias?
- Trunk/Branch:
- Create version of single page (as above)
......
......@@ -268,6 +268,38 @@ class t3lib_BEfunc {
}
}
/**
* Find page-tree PID for versionized record
* Will look if the "pid" value of the input record is -1 and if the table supports versioning - if so, it will translate the -1 PID into the PID of the original record
*
* @param string Table name
* @param array Record array passed by reference. As minimum, "pid" and "uid" fields must exist! "t3ver_oid" is nice and will save you a DB query.
* @return void (Passed by ref).
*/
function fixVersioningPid($table,&$rr) {
global $TCA;
if ($rr['pid']==-1 && $TCA[$table]['ctrl']['versioning']) {
if ($rr['t3ver_oid']>0) { // If "t3ver_oid" is already a field, just set this:
$oid = $rr['t3ver_oid'];
} else { // Otherwise we have to expect "uid" to be in the record and look up based on this:
$newPidRec = t3lib_BEfunc::getRecord($table,$rr['uid'],'t3ver_oid');
if (is_array($newPidRec)) {
$oid = $newPidRec['t3ver_oid'];
}
}
// If ID of current online version is found, look up the PID value of that:
if ($oid) {
$oidRec = t3lib_BEfunc::getRecord($table,$oid,'pid');
if (is_array($oidRec)) {
$rr['_ORIG_pid'] = $rr['pid'];
$rr['pid'] = $oidRec['pid'];
}
}
}
}
/**
* Returns a WHERE clause which will make an AND search for the words in the $searchWords array in any of the fields in array $fields.
* Usage: 0
......@@ -494,6 +526,7 @@ class t3lib_BEfunc {
debug($GLOBALS['TYPO3_DB']->sql_error(),1);
}
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
t3lib_BEfunc::fixVersioningPid('pages',$row);
$uid = $row['pid'];
$theRowArray[]=$row;
} else {
......@@ -507,6 +540,8 @@ class t3lib_BEfunc {
while(list($key,$val)=each($theRowArray)) {
$c--;
$output[$c]['uid'] = $val['uid'];
$output[$c]['pid'] = $val['pid'];
if (isset($val['_ORIG_pid'])) $output[$c]['_ORIG_pid'] = $val['_ORIG_pid'];
$output[$c]['title'] = $val['title'];
$output[$c]['TSconfig'] = $val['TSconfig'];
$output[$c]['is_siteroot'] = $val['is_siteroot'];
......@@ -576,13 +611,18 @@ class t3lib_BEfunc {
while ($uid!=0 && $loopCheck>0) {
$loopCheck--;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid,title',
'uid,pid,title',
'pages',
'uid='.intval($uid).
t3lib_BEfunc::deleteClause('pages').
(strlen(trim($clause)) ? ' AND '.$clause : '')
);
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
t3lib_BEfunc::fixVersioningPid('pages',$row);
if ($row['_ORIG_pid']) {
$output = ' [#VEP#]'.$output; // Adding visual token - Versioning Entry Point - that tells that THIS position was where the versionized branch got connected to the main tree. I will have to find a better name or something...
}
$uid = $row['pid'];
$output = '/'.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),$titleLimit).$output;
if ($fullTitleLimit) $fullOutput = '/'.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),$fullTitleLimit).$fullOutput;
......@@ -900,7 +940,6 @@ class t3lib_BEfunc {
$ds_tableField = $conf['ds_tableField'];
$ds_searchParentField = $conf['ds_pointerField_searchParent'];
// Find source value:
$dataStructArray='';
if (is_array($ds_array)) { // If there is a data source array, that takes precedence
......@@ -926,7 +965,8 @@ class t3lib_BEfunc {
// Searching recursively back if 'ds_pointerField_searchParent' is defined (typ. a page rootline, or maybe a tree-table):
if ($ds_searchParentField && !$srcPointer) {
$rr = t3lib_BEfunc::getRecord($table,$row['uid'],$ds_searchParentField); // Get the "pid" field - we cannot know that it is in the input record!
$rr = t3lib_BEfunc::getRecord($table,$row['uid'],'uid,'.$ds_searchParentField); // Get the "pid" field - we cannot know that it is in the input record!
t3lib_BEfunc::fixVersioningPid($table,$rr);
$uidAcc=array(); // Used to avoid looping, if any should happen.
$subFieldPointer = $conf['ds_pointerField_searchParent_subField'];
while(!$srcPointer) {
......@@ -936,9 +976,12 @@ class t3lib_BEfunc {
'uid='.intval($rr[$ds_searchParentField]).t3lib_BEfunc::deleteClause($table)
);
$rr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
if (!is_array($rr) || isset($uidAcc[$rr['uid']])) break; // break if no result from SQL db or if looping...
// break if no result from SQL db or if looping...
if (!is_array($rr) || isset($uidAcc[$rr['uid']])) break;
$uidAcc[$rr['uid']]=1;
t3lib_BEfunc::fixVersioningPid($table,$rr);
$srcPointer = ($subFieldPointer && $rr[$subFieldPointer]) ? $rr[$subFieldPointer] : $rr[$ds_pointerField];
}
}
......@@ -959,7 +1002,6 @@ class t3lib_BEfunc {
}
} else $dataStructArray='No source value in fieldname "'.$ds_pointerField.'"'; // Error message.
} else $dataStructArray='No proper configuration!';
return $dataStructArray;
}
......@@ -1548,6 +1590,7 @@ class t3lib_BEfunc {
$parts=array();
$parts[] = 'id='.$row['uid'];
if ($row['alias']) $parts[]=$LANG->sL($TCA['pages']['columns']['alias']['label']).' '.$row['alias'];
if ($row['t3ver_id']) $parts[] = 'v#'.$row['t3ver_id'];
if ($row['doktype']=='3') {
$parts[]=$LANG->sL($TCA['pages']['columns']['url']['label']).' '.$row['url'];
} elseif ($row['doktype']=='4') {
......@@ -1611,6 +1654,9 @@ class t3lib_BEfunc {
if ($table=='pages' && $row['alias']) {
$out.=' / '.$row['alias'];
}
if ($GLOBALS['TCA'][$table]['ctrl']['versioning'] && $row['t3ver_id']) {
$out.=' - v#'.$row['t3ver_id'];
}
if ($ctrl['disabled']) { // Hidden ...
$out.=($row[$ctrl['disabled']]?' - '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.hidden'):'');
}
......@@ -1866,6 +1912,9 @@ class t3lib_BEfunc {
$fields[] = $prefix.$fieldN;
}
}
if ($TCA[$table]['ctrl']['versioning']) {
$fields[] = $prefix.'t3ver_id';
}
if ($TCA[$table]['ctrl']['selicon_field']) $fields[] = $prefix.$TCA[$table]['ctrl']['selicon_field'];
if ($TCA[$table]['ctrl']['typeicon_column']) $fields[] = $prefix.$TCA[$table]['ctrl']['typeicon_column'];
......@@ -2679,6 +2728,42 @@ class t3lib_BEfunc {
}
}
/**
* Select all versions of a record, ordered by version id (DESC)
*
* @param string Table name to select from
* @param integer Record uid for which to find versions.
* @param string Field list to select
* @return array Array of versions of table/uid
*/
function selectVersionsOfRecord($table, $uid, $fields='*') {
global $TCA;
if ($TCA[$table] && $TCA[$table]['ctrl']['versioning']) {
// Select all versions of record:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
$fields,
$table,
'(t3ver_oid='.intval($uid).' || uid='.intval($uid).')'.
t3lib_BEfunc::deleteClause($table),
'',
't3ver_id DESC'
);
// Add rows to output array:
$outputRows = array();
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if ($uid==$row['uid']) {
$row['_CURRENT_VERSION']=TRUE;
}
$outputRows[] = $row;
}
return $outputRows;
}
}
/**
* Returns overlayered RTE setup from an array with TSconfig. Used in TCEforms and TCEmain
* Usage: 8
......
......@@ -91,7 +91,7 @@ class t3lib_browseTree extends t3lib_treeView {
$this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
$this->MOUNTS = $GLOBALS['WEBMOUNTS'];
$this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop'));
$this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop','t3ver_id'));
if (t3lib_extMgm::isLoaded('cms')) {
$this->fieldArray = array_merge($this->fieldArray,array('hidden','starttime','endtime','fe_group','module','extendToSubpages'));
}
......
......@@ -205,7 +205,7 @@ class t3lib_pageSelect {
*/
function getPageIdFromAlias($alias) {
$alias = strtolower($alias);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'alias="'.$GLOBALS['TYPO3_DB']->quoteStr($alias, 'pages').'" AND pages.deleted=0');
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'alias="'.$GLOBALS['TYPO3_DB']->quoteStr($alias, 'pages').'" AND pid>=0 AND pages.deleted=0'); // "AND pid>=0" is because of versioning...
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
return $row['uid'];
}
......
......@@ -1722,7 +1722,7 @@ class t3lib_TCEforms {
if ($show_thumbs) {
$rr = t3lib_BEfunc::getRecord($this_table,$this_uid);
$imgs[] = '<span class="nobr">'.
$this->getClickMenu(t3lib_iconWorks::getIconImage($this_table,$rr,$this->backPath,'align="top" title="'.htmlspecialchars(t3lib_BEfunc::getRecordPath($rr['pid'],$perms_clause,15)).'"'),$this_table, $this_uid).
$this->getClickMenu(t3lib_iconWorks::getIconImage($this_table,$rr,$this->backPath,'align="top" title="'.htmlspecialchars(t3lib_BEfunc::getRecordPath($rr['pid'],$perms_clause,15)).' [UID: '.$rr['uid'].']"'),$this_table, $this_uid).
'&nbsp;'.
$this->noTitle($rr[$GLOBALS['TCA'][$this_table]['ctrl']['label']],array('<em>','</em>')).
'</span>';
......@@ -4619,6 +4619,7 @@ class t3lib_TCEforms {
* @see t3lib_BEfunc::getRecordPath()
*/
function getRecordPath($table,$rec) {
t3lib_BEfunc::fixVersioningPid($table,$rec);
list($tscPID,$thePidValue)=$this->getTSCpid($table,$rec['uid'],$rec['pid']);
if ($thePidValue>=0) {
return t3lib_BEfunc::getRecordPath($tscPID,$this->readPerms(),15);
......
This diff is collapsed.
......@@ -512,6 +512,12 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
}
}
// Checking "editlock" feature
if ($TCA[$table]['ctrl']['editlock'] && $idOrRow[$TCA[$table]['ctrl']['editlock']]) {
$this->errorMsg = 'ERROR: Record was locked for editing. Only admin users can change this state.';
return FALSE;
}
// Checking record permissions
// THIS is where we can include a check for "perms_" fields for other records than pages...
......
......@@ -140,11 +140,13 @@ $TCA['pages'] = Array (
'sortby' => 'sorting',
'title' => 'LLL:EXT:lang/locallang_tca.php:pages',
'type' => 'doktype',
'versioning' => TRUE,
'delete' => 'deleted',
'crdate' => 'crdate',
'hideAtCopy' => 1,
'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
'cruser_id' => 'cruser_id',
'editlock' => 'editlock',
'useColumnsForDefaultValues' => 'doktype'
),
'interface' => Array (
......@@ -222,6 +224,21 @@ $TCA['pages'] = Array (
)
),
'tx_impexp_origuid' => Array('config'=>array('type'=>'passthrough')),
't3ver_label' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.versionLabel',
'config' => Array (
'type' => 'input',
'size' => '30',
'max' => '30',
)
),
'editlock' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_tca.php:editlock',
'config' => Array (
'type' => 'check'
)
),
),
'types' => Array (
'1' => Array('showitem' => 'doktype, title, TSconfig;;6;nowrap, storage_pid;;7'),
......@@ -229,7 +246,7 @@ $TCA['pages'] = Array (
'255' => Array('showitem' => 'doktype, title, TSconfig;;6;nowrap, storage_pid;;7')
),
'palettes' => Array (
'6' => Array('showitem' => 'php_tree_stop'),
'6' => Array('showitem' => 'php_tree_stop, editlock'),
'7' => Array('showitem' => 'is_siteroot')
)
);
......
......@@ -118,8 +118,11 @@ CREATE TABLE cache_imagesizes (
# Table structure for table 'pages'
#
CREATE TABLE pages (
uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
pid int(11) unsigned DEFAULT '0' NOT NULL,
uid int(11) DEFAULT '0' NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
t3ver_oid int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_id int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_label varchar(30) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
......@@ -128,6 +131,7 @@ CREATE TABLE pages (
perms_user tinyint(4) unsigned DEFAULT '0' NOT NULL,
perms_group tinyint(4) unsigned DEFAULT '0' NOT NULL,
perms_everybody tinyint(4) unsigned DEFAULT '0' NOT NULL,
editlock tinyint(4) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
title tinytext NOT NULL,
......@@ -138,6 +142,7 @@ CREATE TABLE pages (
php_tree_stop tinyint(4) DEFAULT '0' NOT NULL,
tx_impexp_origuid int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY t3ver_oid (t3ver_oid),
KEY parent (pid),
);
......
......@@ -589,6 +589,7 @@ class SC_alt_doc {
$this->dontStoreDocumentRef=1; // Don't save this document title in the document selector if the document is new.
} else { // Edit:
$calcPRec = t3lib_BEfunc::getRecord($table,$theUid);
t3lib_BEfunc::fixVersioningPid($table,$calcPRec);
if (is_array($calcPRec)) {
if ($table=='pages') { // If pages:
$CALC_PERMS = $BE_USER->calcPerms($calcPRec);
......
......@@ -624,6 +624,7 @@ class recordList extends t3lib_recordList {
if ($TCA[$table]['ctrl']['crdate']) $fieldListArr[]=$TCA[$table]['ctrl']['crdate'];
if ($TCA[$table]['ctrl']['cruser_id']) $fieldListArr[]=$TCA[$table]['ctrl']['cruser_id'];
if ($TCA[$table]['ctrl']['sortby']) $fieldListArr[]=$TCA[$table]['ctrl']['sortby'];
if ($TCA[$table]['ctrl']['versioning']) $fieldListArr[]='t3ver_id';
}
}
return $fieldListArr;
......
......@@ -343,6 +343,9 @@ class localRecordList extends recordList {
if ($TCA[$table]['ctrl']['typeicon_column']) {
$selectFields[] = $TCA[$table]['ctrl']['typeicon_column'];
}
if ($TCA[$table]['ctrl']['versioning']) {
$selectFields[] = 't3ver_id';
}
if ($TCA[$table]['ctrl']['label_alt']) {
$selectFields = array_merge($selectFields,t3lib_div::trimExplode(',',$TCA[$table]['ctrl']['label_alt'],1));
}
......
......@@ -495,6 +495,8 @@ $TCA['tt_content'] = Array (
'tstamp' => 'tstamp',
'title' => 'LLL:EXT:cms/locallang_tca.php:tt_content',
'delete' => 'deleted',
'versioning' => TRUE,
'versioning_followPages' => TRUE,
'type' => 'CType',
'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
'copyAfterDuplFields' => 'colPos,sys_language_uid',
......@@ -603,6 +605,8 @@ $TCA['pages_language_overlay'] = Array (
'label' => 'title',
'tstamp' => 'tstamp',
'title' => 'LLL:EXT:cms/locallang_tca.php:pages_language_overlay',
'versioning' => TRUE,
'versioning_followPages' => TRUE,
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'enablecolumns' => Array (
......@@ -630,6 +634,7 @@ $TCA['sys_template'] = Array (
'sortby' => 'sorting',
'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
'title' => 'LLL:EXT:cms/locallang_tca.php:sys_template',
'versioning' => TRUE,
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'delete' => 'deleted',
......
......@@ -165,8 +165,11 @@ CREATE TABLE fe_users (
# Table structure for table 'pages_language_overlay'
#
CREATE TABLE pages_language_overlay (
uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
pid int(11) unsigned DEFAULT '0' NOT NULL,
uid int(11) DEFAULT '0' NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
t3ver_oid int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_id int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_label varchar(30) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
......@@ -187,6 +190,7 @@ CREATE TABLE pages_language_overlay (
l18n_diffsource mediumblob NOT NULL,
PRIMARY KEY (uid),
KEY t3ver_oid (t3ver_oid),
KEY parent (pid)
);
......@@ -233,8 +237,11 @@ CREATE TABLE sys_domain (
# Table structure for table 'sys_template'
#
CREATE TABLE sys_template (
uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
pid int(11) unsigned DEFAULT '0' NOT NULL,
uid int(11) DEFAULT '0' NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
t3ver_oid int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_id int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_label varchar(30) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
......@@ -260,6 +267,7 @@ CREATE TABLE sys_template (
static_file_mode tinyint(4) unsigned DEFAULT '0' NOT NULL,
tx_impexp_origuid int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY t3ver_oid (t3ver_oid),
KEY parent (pid)
);
......@@ -268,8 +276,11 @@ CREATE TABLE sys_template (
# Table structure for table 'tt_content'
#
CREATE TABLE tt_content (
uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
pid int(11) unsigned DEFAULT '0' NOT NULL,
uid int(11) DEFAULT '0' NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
t3ver_oid int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_id int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_label varchar(30) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
......@@ -335,6 +346,7 @@ CREATE TABLE tt_content (
l18n_diffsource mediumblob NOT NULL,
PRIMARY KEY (uid),
KEY t3ver_oid (t3ver_oid),
KEY parent (pid)
);
......
......@@ -562,6 +562,14 @@ $TCA['pages_language_overlay'] = Array (
),
'tx_impexp_origuid' => Array('config'=>array('type'=>'passthrough')),
'l18n_diffsource' => Array('config'=>array('type'=>'passthrough')),
't3ver_label' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.versionLabel',
'config' => Array (
'type' => 'input',
'size' => '30',
'max' => '30',
)
),
),
'types' => Array (
'0' => Array('showitem' => 'hidden;;;;1-1-1, sys_language_uid, title;;;;2-2-2, subtitle, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4')
......@@ -804,6 +812,14 @@ $TCA['sys_template'] = Array (
)
),
'tx_impexp_origuid' => Array('config'=>array('type'=>'passthrough')),
't3ver_label' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.versionLabel',
'config' => Array (
'type' => 'input',
'size' => '30',
'max' => '30',
)
),
),
'types' => Array (
'1' => Array('showitem' => 'title;;1;;2-2-2, sitetitle, constants;;;;3-3-3, config, resources, clear, root, --div--, include_static;;2;;5-5-5, include_static_file;;2, basedOn;;2, static_file_mode, nextLevel, --div--, description;;;;5-5-5, editorcfg')
......
......@@ -913,6 +913,14 @@ $TCA['tt_content'] = Array (
),
'tx_impexp_origuid' => Array('config'=>array('type'=>'passthrough')),
'l18n_diffsource' => Array('config'=>array('type'=>'passthrough')),
't3ver_label' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.versionLabel',
'config' => Array (
'type' => 'input',
'size' => '30',
'max' => '30',
)
),
),
'types' => Array (
'1' => Array('showitem' => 'CType'),
......
......@@ -629,7 +629,7 @@
// Now it's investigated if the raw page-id points to a hidden page and if so, the flag is set.
// This does not require the preview flag to be set in the admin panel
if ($this->id) {
$idQ = t3lib_div::testInt($this->id) ? 'uid="'.intval($this->id).'"' : 'alias="'.$GLOBALS['TYPO3_DB']->quoteStr($this->id, 'pages').'"';
$idQ = t3lib_div::testInt($this->id) ? 'uid="'.intval($this->id).'"' : 'alias="'.$GLOBALS['TYPO3_DB']->quoteStr($this->id, 'pages').'" AND pid>=0'; // pid>=0 added for the sake of versioning...
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('hidden', 'pages', $idQ.' AND hidden AND NOT deleted');
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$this->fePreview = 1; // The preview flag is set only if the current page turns out to actually be hidden!
......
......@@ -78,6 +78,7 @@ If you click the red &quot;+&quot; you will get the page mounted temporarily in
A General Record Storage Page is typically a page of the &quot;SysFolder&quot; type.</label>
<label index="_storage_pid.seeAlso">The Storage Folder | http://typo3.org/documentation/document-library/doc_tut_ftb1/The_Storage_Folder/</label>
<label index="editlock.description">If set, non-Admin users cannot edit the page header or any records on the page (except subpages). They cannot create new records or pages on the page either.</label>
</languageKey>
<languageKey index="dk">EXT:csh_dk/lang/dk.locallang_csh_pages.xml</languageKey>
<languageKey index="lv">EXT:csh_lv/lang/lv.locallang_csh_pages.xml</languageKey>
......
......@@ -54,6 +54,7 @@
<label index="LGL.recursive">Recursive:</label>
<label index="LGL.l18n_parent">Transl.Orig:</label>
<label index="LGL.allLanguages">[All]</label>
<label index="LGL.versionLabel">Versioning Label:</label>
</languageKey>
<languageKey index="dk" type="array">
<label index="LGL.endtime">Stop:</label>
......