* Fixed problem with notification emails to users when a workspace review rejection...
authorKasper Skårhøj <kasper@typo3.org>
Fri, 9 Oct 2009 07:05:38 +0000 (07:05 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Fri, 9 Oct 2009 07:05:38 +0000 (07:05 +0000)
* 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.
* 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.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6118 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_tcemain.php
typo3/alt_doc.php
typo3/gfx/translationsavedok_clear.gif [new file with mode: 0644]
typo3/sysext/lang/locallang_core.xml
typo3/templates/alt_doc.html

index a827f05..2b621eb 100644 (file)
@@ -249,6 +249,7 @@ class t3lib_TCEmain {
        var $dontProcessTransformations = FALSE;        // Boolean: If set, then transformations are NOT performed on the input.
        var $clear_flexFormData_vDEFbase = FALSE;       // Boolean: If set, .vDEFbase values are unset in flexforms.
        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
+       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.    
        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!
        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!
        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,7 +1115,7 @@ class t3lib_TCEmain       {
 
                                                                        // Add the value of the original record to the diff-storage content:
                                                                if ($this->updateModeL10NdiffData && $TCA[$table]['ctrl']['transOrigDiffSourceField'])  {
-                                                                       $originalLanguage_diffStorage[$field] = $originalLanguageRecord[$field];
+                                                                       $originalLanguage_diffStorage[$field] = $this->updateModeL10NdiffDataClear ? '' : $originalLanguageRecord[$field];
                                                                        $diffStorageFlag = TRUE;
                                                                }
 
@@ -2415,7 +2416,7 @@ class t3lib_TCEmain       {
                                                                                $diffValue = $dataValues_current[$key]['vDEF'];
                                                                        }
                                                                                // 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.
-                                                                       $dataValues[$key][$vKey.'.vDEFbase'] = $diffValue;
+                                                                       $dataValues[$key][$vKey.'.vDEFbase'] = $this->updateModeL10NdiffDataClear ? '' : $diffValue;
                                                                }
                                                        }
                                                }
@@ -6895,8 +6896,8 @@ $this->log($table,$id,6,0,0,'Stage raised...',30,array('comment'=>$comment,'stag
                                                                foreach($rows as $dat)  {
                                                                        $data = unserialize($dat['log_data']);
 
-                                                                       debug($dat['userid'],'Adds user at stage: '.$data['stage']);
-                                                                       $emails = array_merge($emails,$this->notifyStageChange_getEmails($dat['userid']));
+                                                                       //debug($dat['userid'],'Adds user at stage: '.$data['stage']);
+                                                                       $emails = array_merge($emails,$this->notifyStageChange_getEmails($dat['userid'],TRUE));
 
                                                                        if ($data['stage']==1)  {
                                                                                break;
@@ -6967,6 +6968,8 @@ State was change by %s (username: %s)
                                        sprintf($subject,$elementName),
                                        trim($message)
                                );
+                               
+                               $this->newlog2('Notification email for stage change was sent to "'.implode(', ',$emails).'"',$table,$id);
                        }
                }
        }
index 2254ea2..5fa036d 100644 (file)
@@ -246,7 +246,7 @@ class SC_alt_doc {
         * @return      boolean         True, then save the document (data submitted)
         */
        function doProcessData()        {
-               $out = $this->doSave || isset($_POST['_savedok_x']) || isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) || isset($_POST['_savedoknew_x']) || isset($_POST['_translation_savedok_x']);
+               $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']);
                return $out;
        }
 
@@ -272,9 +272,14 @@ class SC_alt_doc {
                        // Only options related to $this->data submission are included here.
                $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                $tce->stripslashes_values=0;
+               
                if (isset($_POST['_translation_savedok_x']))    {
                        $tce->updateModeL10NdiffData = 'FORCE_FFUPD';
                }
+               if (isset($_POST['_translation_savedokclear_x']))       {
+                       $tce->updateModeL10NdiffData = 'FORCE_FFUPD';
+                       $tce->updateModeL10NdiffDataClear = TRUE;
+               }
 
                        // Setting default values specific for the user:
                $TCAdefaultOverride = $BE_USER->getTSConfigProp('TCAdefaults');
@@ -663,7 +668,8 @@ class SC_alt_doc {
                                                                                $CALC_PERMS = $BE_USER->calcPerms($calcPRec);   // Permissions for the parent page
                                                                                if ($table=='pages')    {       // If pages:
                                                                                        $hasAccess = $CALC_PERMS&8 ? 1 : 0;
-                                                                                       $this->viewId = $calcPRec['pid'];
+                                                                                       #$this->viewId = $calcPRec['pid'];
+                                                                                       $this->viewId = 0;
                                                                                } else {
                                                                                        $hasAccess = $CALC_PERMS&16 ? 1 : 0;
                                                                                        $this->viewId = $calcPRec['uid'];
@@ -811,7 +817,8 @@ class SC_alt_doc {
                        'history' => '',
                        'columns_only' => '',
                        'csh' => '',
-                       'translation_save' => ''
+                       'translation_save' => '',
+                       'translation_saveclear' => ''
                );
 
                        // Render SAVE type buttons:
@@ -837,6 +844,7 @@ class SC_alt_doc {
                                // FINISH TRANSLATION / SAVE / CLOSE
                        if ($GLOBALS['TYPO3_CONF_VARS']['BE']['explicitConfirmationOfTranslation'])     {
                                $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) . '" />';
+                               $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) . '" />';
                        }
                }
 
diff --git a/typo3/gfx/translationsavedok_clear.gif b/typo3/gfx/translationsavedok_clear.gif
new file mode 100644 (file)
index 0000000..4e9b74b
Binary files /dev/null and b/typo3/gfx/translationsavedok_clear.gif differ
index f5da9ab..a622277 100755 (executable)
@@ -190,6 +190,7 @@ Would you like to save now in order to refresh the display?</label>
                        <label index="rm.saveDocShow">Save document and view page</label>
                        <label index="rm.saveCloseDoc">Save and close document</label>
                        <label index="rm.translationSaveDoc">Translation finished, save and close</label>
+                       <label index="rm.translationSaveDocClear">Translation NOT finished, Save</label>
                        <label index="rm.saveCloseAllDocs">Save and close all documents</label>
                        <label index="rm.saveNewDoc">Save document and create a new one</label>
                        <label index="rm.closeDoc">Close document</label>
index 46e4755..8978a0f 100644 (file)
@@ -33,7 +33,7 @@
 
 <!-- ###BUTTON_GROUPS_LEFT### -->
 <!-- ###BUTTON_GROUP1### -->###CLOSE###<!-- ###BUTTON_GROUP1### -->
-<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_VIEW######SAVE_CLOSE######SAVE_NEW######TRANSLATION_SAVE###<!-- ###BUTTON_GROUP2### -->
+<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_VIEW######SAVE_CLOSE######SAVE_NEW######TRANSLATION_SAVE######TRANSLATION_SAVECLEAR###<!-- ###BUTTON_GROUP2### -->
 <!-- ###BUTTON_GROUP3### -->###DELETE######UNDO######HISTORY###<!-- ###BUTTON_GROUP3### -->
 <!-- ###BUTTON_GROUPS_LEFT### -->