Bug #21211 » 0012162.patch

Administrator Admin, 2009-10-09 10:36

View differences:

ChangeLog (Revision 6122)
1
2009-10-09  Kasper Sk?rh?j <kasper@typo3.org>
2
	* Tiny bug with date function in t3lib_befunc. Casted timestamp to integer.
3
	* Added User TSconfig option "options.checkPageLanguageOverlay" so flexforms only show language fields for languages available on the page.
4
	* Fixed problem with notification emails to users when a workspace review rejection happens. Now it works
5
	* Added possibility to reset the diff-information for localizations so translators or admins can click a button that will mark a record so it appears to be in need of translation again.
6
	* Fixed problem with "Save and view" for new pages: Simply removed the button for new pages because it didn't choose the right PID anyway.
7
	* Implemented an override of allowed language per workspace. This is an expert feature available as a USER TSconfig option "options.workspaces.allowed_languages" 
8
	* Expanded the feature that disables/enables login in a branch so now you can allow a login but force the usergroups to be "0,-2" (basically, that no usergroups are set for the user). This can help to reduce multiple caching of similar pages in case of many usergroup combinations in a system. 
9
	* Implemented a simple hook after retrieval of a page from cache.
10
	* Fixed bug in Addwizard: It didn't work properly with wizard for other pages. Took the wrong table name. Thanks to Hassan AIT ABDELLAH, Dassault Systemes, for the fix.
11

  
1 12
2009-10-08  Rupert Germann  <rupi@gmx.li>
2 13

  
3 14
	* Fixed bug #12121: "Installation Type: L" - tell the user, what's "L" (thanks to Steffen Gebert)
t3lib/class.t3lib_tceforms.php (Revision 6122)
2419 2419
			$langDisabled = $dataStructArray['meta']['langDisable'] ? 1 : 0;
2420 2420

  
2421 2421
			$editData['meta']['currentLangId']=array();
2422

  
2423
				// Look up page overlays:
2424
			$checkPageLanguageOverlay = $GLOBALS['BE_USER']->getTSConfigVal('options.checkPageLanguageOverlay')?TRUE:FALSE;
2425
			if ($checkPageLanguageOverlay)	{
2426
				$pageOverlays = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
2427
					'*',
2428
					'pages_language_overlay',
2429
					'pid='.intval($row['pid']).
2430
						t3lib_BEfunc::deleteClause('pages_language_overlay').
2431
						t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'),
2432
					'',
2433
					'',
2434
					'',
2435
					'sys_language_uid'
2436
				);
2437
			}
2422 2438
			$languages = $this->getAvailableLanguages();
2423 2439

  
2424 2440
			foreach($languages as $lInfo)	{
2425
				if ($GLOBALS['BE_USER']->checkLanguageAccess($lInfo['uid']))	{
2441
				if ($GLOBALS['BE_USER']->checkLanguageAccess($lInfo['uid']) && (!$checkPageLanguageOverlay || $lInfo['uid']<=0 || is_array($pageOverlays[$lInfo['uid']])))	{
2426 2442
					$editData['meta']['currentLangId'][] = 	$lInfo['ISOcode'];
2427 2443
				}
2428 2444
			}
t3lib/class.t3lib_befunc.php (Revision 6122)
1610 1610
	 * @return	string		Formatted time
1611 1611
	 */
1612 1612
	public static function date($tstamp) {
1613
		return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $tstamp);
1613
		return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], (int)$tstamp);
1614 1614
	}
1615 1615

  
1616 1616
	/**
t3lib/class.t3lib_userauthgroup.php (Revision 6122)
1472 1472
				$this->addFileMount($row['title'], $row['path'], $row['path'], $row['base']?1:0, '');
1473 1473
			}
1474 1474
		}
1475

  
1476
		if ($allowed_languages = $this->getTSConfigVal('options.workspaces.allowed_languages.'.$this->workspace))	{
1477
			$this->groupData['allowed_languages'] = $allowed_languages;
1478
			$this->groupData['allowed_languages'] = t3lib_div::uniqueList($this->groupData['allowed_languages']);
1479
		}
1475 1480
	}
1476 1481

  
1477 1482
	/**
t3lib/class.t3lib_tcemain.php (Revision 6122)
249 249
	var $dontProcessTransformations = FALSE;	// Boolean: If set, then transformations are NOT performed on the input.
250 250
	var $clear_flexFormData_vDEFbase = FALSE;	// Boolean: If set, .vDEFbase values are unset in flexforms.
251 251
	var $updateModeL10NdiffData = TRUE;		// Boolean/Mixed: TRUE: (traditional) Updates when record is saved. For flexforms, updates if change is made to the localized value. FALSE: Will not update anything. "FORCE_FFUPD" (string): Like TRUE, but will force update to the FlexForm Field
252
	var $updateModeL10NdiffDataClear = FALSE;	// Boolean: If true, the translation diff. fields will in fact be reset so that they indicate that all needs to change again! It's meant as the opposite of declaring the record translated.	
252 253
	var $bypassWorkspaceRestrictions = FALSE;	// Boolean: If true, workspace restrictions are bypassed on edit an create actions (process_datamap()). YOU MUST KNOW what you do if you use this feature!
253 254
	var $bypassFileHandling = FALSE;			// Boolean: If true, file handling of attached files (addition, deletion etc) is bypassed - the value is saved straight away. YOU MUST KNOW what you are doing with this feature!
254 255
	var $bypassAccessCheckForRecords = FALSE;	// Boolean: If true, access check, check for deleted etc. for records is bypassed. YOU MUST KNOW what you are doing if you use this feature!
......
1114 1115

  
1115 1116
									// Add the value of the original record to the diff-storage content:
1116 1117
								if ($this->updateModeL10NdiffData && $TCA[$table]['ctrl']['transOrigDiffSourceField'])	{
1117
									$originalLanguage_diffStorage[$field] = $originalLanguageRecord[$field];
1118
									$originalLanguage_diffStorage[$field] = $this->updateModeL10NdiffDataClear ? '' : $originalLanguageRecord[$field];
1118 1119
									$diffStorageFlag = TRUE;
1119 1120
								}
1120 1121

  
......
2415 2416
										$diffValue = $dataValues_current[$key]['vDEF'];
2416 2417
									}
2417 2418
										// Setting the reference value for vDEF for this translation. This will be used for translation tools to make a diff between the vDEF and vDEFbase to see if an update would be fitting.
2418
									$dataValues[$key][$vKey.'.vDEFbase'] = $diffValue;
2419
									$dataValues[$key][$vKey.'.vDEFbase'] = $this->updateModeL10NdiffDataClear ? '' : $diffValue;
2419 2420
								}
2420 2421
							}
2421 2422
						}
......
6895 6896
								foreach($rows as $dat)	{
6896 6897
									$data = unserialize($dat['log_data']);
6897 6898

  
6898
									debug($dat['userid'],'Adds user at stage: '.$data['stage']);
6899
									$emails = array_merge($emails,$this->notifyStageChange_getEmails($dat['userid']));
6899
									//debug($dat['userid'],'Adds user at stage: '.$data['stage']);
6900
									$emails = array_merge($emails,$this->notifyStageChange_getEmails($dat['userid'],TRUE));
6900 6901

  
6901 6902
									if ($data['stage']==1)	{
6902 6903
										break;
......
6967 6968
					sprintf($subject,$elementName),
6968 6969
					trim($message)
6969 6970
				);
6971
				
6972
				$this->newlog2('Notification email for stage change was sent to "'.implode(', ',$emails).'"',$table,$id);
6970 6973
			}
6971 6974
		}
6972 6975
	}
typo3/alt_doc.php (Revision 6122)
246 246
	 * @return	boolean		True, then save the document (data submitted)
247 247
	 */
248 248
	function doProcessData()	{
249
		$out = $this->doSave || isset($_POST['_savedok_x']) || isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) || isset($_POST['_savedoknew_x']) || isset($_POST['_translation_savedok_x']);
249
		$out = $this->doSave || isset($_POST['_savedok_x']) || isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) || isset($_POST['_savedoknew_x']) || isset($_POST['_translation_savedok_x']) || isset($_POST['_translation_savedokclear_x']);
250 250
		return $out;
251 251
	}
252 252

  
......
272 272
			// Only options related to $this->data submission are included here.
273 273
		$tce = t3lib_div::makeInstance('t3lib_TCEmain');
274 274
		$tce->stripslashes_values=0;
275
		
275 276
		if (isset($_POST['_translation_savedok_x']))	{
276 277
			$tce->updateModeL10NdiffData = 'FORCE_FFUPD';
277 278
		}
279
		if (isset($_POST['_translation_savedokclear_x']))	{
280
			$tce->updateModeL10NdiffData = 'FORCE_FFUPD';
281
			$tce->updateModeL10NdiffDataClear = TRUE;
282
		}
278 283

  
279 284
			// Setting default values specific for the user:
280 285
		$TCAdefaultOverride = $BE_USER->getTSConfigProp('TCAdefaults');
......
663 668
										$CALC_PERMS = $BE_USER->calcPerms($calcPRec);	// Permissions for the parent page
664 669
										if ($table=='pages')	{	// If pages:
665 670
											$hasAccess = $CALC_PERMS&8 ? 1 : 0;
666
											$this->viewId = $calcPRec['pid'];
671
											#$this->viewId = $calcPRec['pid'];
672
											$this->viewId = 0;
667 673
										} else {
668 674
											$hasAccess = $CALC_PERMS&16 ? 1 : 0;
669 675
											$this->viewId = $calcPRec['uid'];
......
811 817
			'history' => '',
812 818
			'columns_only' => '',
813 819
			'csh' => '',
814
			'translation_save' => ''
820
			'translation_save' => '',
821
			'translation_saveclear' => ''
815 822
		);
816 823

  
817 824
			// Render SAVE type buttons:
......
837 844
				// FINISH TRANSLATION / SAVE / CLOSE
838 845
			if ($GLOBALS['TYPO3_CONF_VARS']['BE']['explicitConfirmationOfTranslation'])	{
839 846
				$buttons['translation_save'] = '<input type="image" class="c-inputButton" name="_translation_savedok" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/translationsavedok.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.translationSaveDoc', 1) . '" />';
847
				$buttons['translation_saveclear'] = '<input type="image" class="c-inputButton" name="_translation_savedokclear" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/translationsavedok_clear.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.translationSaveDocClear', 1) . '" />';
840 848
			}
841 849
		}
842 850

  
typo3/wizard_add.php (Revision 6122)
113 113
		$this->table = $this->P['params']['table'];
114 114

  
115 115
			// Get TSconfig for it.
116
		$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->table,is_array($origRow)?$origRow:array('pid'=>$this->P['pid']));
116
		$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->P['table'],is_array($origRow)?$origRow:array('pid'=>$this->P['pid']));
117 117

  
118 118
			// Set [params][pid]
119 119
		if (substr($this->P['params']['pid'],0,3)=='###' && substr($this->P['params']['pid'],-3)=='###')	{
......
137 137

  
138 138
					// ... and if everything seems OK we will register some classes for inclusion and instruct the object to perform processing later.
139 139
				if ($this->P['params']['setValue'] && $cmd=='edit' && $this->id && $this->P['table'] && $this->P['field'] && $this->P['uid'])	{
140
					
141
					if ($LiveRec=t3lib_BEfunc::getLiveVersionOfRecord($this->table, $this->id, 'uid'))	{ $this->id=$LiveRec['uid'];}
142
					
143
					
140 144
					$this->include_once[]=PATH_t3lib.'class.t3lib_loaddbgroup.php';
141 145
					$this->include_once[]=PATH_t3lib.'class.t3lib_transferdata.php';
142 146
					$this->include_once[]=PATH_t3lib.'class.t3lib_tcemain.php';
typo3/templates/alt_doc.html (Revision 6122)
33 33

  
34 34
<!-- ###BUTTON_GROUPS_LEFT### -->
35 35
<!-- ###BUTTON_GROUP1### -->###CLOSE###<!-- ###BUTTON_GROUP1### -->
36
<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_VIEW######SAVE_CLOSE######SAVE_NEW######TRANSLATION_SAVE###<!-- ###BUTTON_GROUP2### -->
36
<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_VIEW######SAVE_CLOSE######SAVE_NEW######TRANSLATION_SAVE######TRANSLATION_SAVECLEAR###<!-- ###BUTTON_GROUP2### -->
37 37
<!-- ###BUTTON_GROUP3### -->###DELETE######UNDO######HISTORY###<!-- ###BUTTON_GROUP3### -->
38 38
<!-- ###BUTTON_GROUPS_LEFT### -->
39 39

  
typo3/sysext/lang/locallang_core.xml (Revision 6122)
190 190
			<label index="rm.saveDocShow">Save document and view page</label>
191 191
			<label index="rm.saveCloseDoc">Save and close document</label>
192 192
			<label index="rm.translationSaveDoc">Translation finished, save and close</label>
193
			<label index="rm.translationSaveDocClear">Translation NOT finished, Save</label>
193 194
			<label index="rm.saveCloseAllDocs">Save and close all documents</label>
194 195
			<label index="rm.saveNewDoc">Save document and create a new one</label>
195 196
			<label index="rm.closeDoc">Close document</label>
typo3/sysext/cms/ext_tables.php (Revision 6122)
483 483
				'type' => 'select',
484 484
				'items' => array (
485 485
					array('', 0),
486
					array('LLL:EXT:cms/locallang_tca.xml:pages.fe_login_mode.disable', 1),
486
					array('LLL:EXT:cms/locallang_tca.xml:pages.fe_login_mode.disableall', 1),
487
					array('LLL:EXT:cms/locallang_tca.xml:pages.fe_login_mode.disablegroups', 3),
487 488
					array('LLL:EXT:cms/locallang_tca.xml:pages.fe_login_mode.enable', 2),
488 489
				)
489 490
			)
typo3/sysext/cms/locallang_tca.xml (Revision 6122)
73 73
			<label index="pages.l18n_cfg.I.2">Hide page if no translation for current language exists</label>
74 74
			<label index="pages.l18n_cfg.I.2a">Show page even if no translation exists</label>
75 75
			<label index="pages.fe_login_mode">Login Mode:</label>
76
			<label index="pages.fe_login_mode.disable">Disable</label>
77
			<label index="pages.fe_login_mode.enable">Enable</label>
76
			<label index="pages.fe_login_mode.disableall">Disable user login completely</label>
77
			<label index="pages.fe_login_mode.disablegroups">Allow logins, but not usergroups</label>
78
			<label index="pages.fe_login_mode.enable">(Re-)Enable logins</label>
78 79
			<label index="tt_content">Pagecontent</label>
79 80
			<label index="fe_users">Website user</label>
80 81
			<label index="fe_users.username">Username:</label>
typo3/sysext/cms/tslib/class.tslib_fe.php (Revision 6122)
231 231
	var $beUserLogin='';				// Flag that indicates if a Backend user is logged in!
232 232
	var $workspacePreview='';			// Integer, that indicates which workspace is being previewed.
233 233
	var $loginAllowedInBranch = TRUE;	// Shows whether logins are allowed in branch
234
	var $loginAllowedInBranch_mode = '';	// Shows specific mode (all or groups)
234 235
	var $ADMCMD_preview_BEUSER_uid = 0;	// Integer, set to backend user ID to initialize when keyword-based preview is used.
235 236

  
236 237
		// PREVIEW
......
697 698
			// Clean up.
698 699
		$gr_array = array_unique($gr_array);	// Make unique...
699 700
		sort($gr_array);	// sort
700
		if (count($gr_array))	{
701
		if (count($gr_array) && !$this->loginAllowedInBranch_mode)	{
701 702
			$this->gr_list.=','.implode(',',$gr_array);
702 703
		}
703 704

  
......
852 853
		$this->loginAllowedInBranch = $this->checkIfLoginAllowedInBranch();
853 854
		if (!$this->loginAllowedInBranch)	{	// Logins are not allowed:
854 855
			if ($this->isUserOrGroupSet())	{	// Only if there is a login will we run this...
856
				if ($this->loginAllowedInBranch_mode=='all')	{
857
						// Clear out user and group:
858
					unset($this->fe_user->user);
859
					$this->gr_list = '0,-1';
860
				} else {
861
					$this->gr_list = '0,-2';
862
				}
855 863

  
856
					// Clear out user and group:
857
				unset($this->fe_user->user);
858
				$this->gr_list = '0,-1';
859

  
860 864
					// Fetching the id again, now with the preview settings reset.
861 865
				$this->fetch_the_id();
862 866
			}
......
1257 1261
			if ($this->rootLine[$a]['fe_login_mode'] > 0)	{
1258 1262

  
1259 1263
					// Determine state from value:
1260
				$disable = (int)$this->rootLine[$a]['fe_login_mode'] === 1 ? TRUE : FALSE;
1264
				if ((int)$this->rootLine[$a]['fe_login_mode'] === 1)	{
1265
					$disable = TRUE;
1266
					$this->loginAllowedInBranch_mode = 'all';
1267
				} elseif ((int)$this->rootLine[$a]['fe_login_mode'] === 3)	{
1268
					$disable = TRUE;
1269
					$this->loginAllowedInBranch_mode = 'groups';
1270
				} else {
1271
					$disable = FALSE;
1272
				}
1261 1273
			}
1262 1274
		}
1263 1275

  
......
1881 1893
					if (is_array($row)) {
1882 1894
							// Release this lock
1883 1895
						$this->releasePageGenerationLock($this->pages_lockObj);
1896

  
1897
							// Call hook when a page is retrieved from cache:
1898
						if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache']))	{
1899
							$_params = array('pObj' => &$this, 'cache_pages_row' => &$row);
1900
							foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'] as $_funcRef)	{
1901
								t3lib_div::callUserFunction($_funcRef,$_params,$this);
1902
							}
1903
						}
1904

  
1884 1905
						$this->config = (array)unserialize($row['cache_data']);		// Fetches the lowlevel config stored with the cached data
1885 1906
						$this->content = (TYPO3_UseCachingFramework ? $row['content'] : $row['HTML']);	// Getting the content
1886 1907
						$this->tempContent = $row['temp_content'];	// Flag for temp content
1887 1908
						$this->cacheContentFlag = 1;	// Setting flag, so we know, that some cached content has been loaded
1888 1909
						$this->cacheExpires = $row['expires'];
1889

  
1910
						
1890 1911
						if ($this->TYPO3_CONF_VARS['FE']['debug'] || (isset($this->config['config']['debug']) && $this->config['config']['debug'])) {
1891 1912
							$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
1892 1913
							$timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
(1-1/2)