[BUGFIX] Workspace state change notification email is always in English
authorXavier Perseguers <xavier@typo3.org>
Thu, 3 May 2012 09:28:48 +0000 (11:28 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 14 Jun 2012 06:36:54 +0000 (08:36 +0200)
Bugfix I433a744bb377590de444ac8cf960ccfd0b1430db in EXT:workspaces
slightly changed the way the list of recipient email is generated.

Change-Id: I39b23787e6123cfafbd0586952412c029b475b6a
Depends: I433a744bb377590de444ac8cf960ccfd0b1430db
Fixes: #25434
Branches: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/10948
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/version/class.tx_version_tcemain.php

index b1830b5..15faf63 100644 (file)
@@ -371,10 +371,10 @@ class tx_version_tcemain {
         * @param integer $id Record uid of element (if zero, then $table is used as reference to element(s) alone)
         * @param string $comment User comment sent along with action
         * @param t3lib_TCEmain $tcemainObj TCEmain object
-        * @param string $notificationAlternativeRecipients Comma separated list of recipients to notificate instead of be_users selected by sys_workspace, list is generated by workspace extension module
+        * @param array $notificationAlternativeRecipients List of recipients to notify instead of be_users selected by sys_workspace, list is generated by workspace extension module
         * @return void
         */
-       protected function notifyStageChange(array $stat, $stageId, $table, $id, $comment, t3lib_TCEmain $tcemainObj, $notificationAlternativeRecipients = FALSE) {
+       protected function notifyStageChange(array $stat, $stageId, $table, $id, $comment, t3lib_TCEmain $tcemainObj, array $notificationAlternativeRecipients = array()) {
                $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $stat['uid']);
                        // So, if $id is not set, then $table is taken to be the complete element name!
                $elementName = $id ? $table . ':' . $id : $table;
@@ -408,7 +408,7 @@ class tx_version_tcemain {
                                }
                        }
 
-                       if ($notificationAlternativeRecipients === FALSE) {
+                       if (count($notificationAlternativeRecipients) == 0) {
                                        // Compile list of recipients:
                                $emails = array();
                                switch ((int)$stat['stagechg_notification']) {
@@ -468,10 +468,7 @@ class tx_version_tcemain {
                                        break;
                                }
                        } else {
-                               $emails = array();
-                               foreach ($notificationAlternativeRecipients as $emailAddress) {
-                                       $emails[] = array('email' => $emailAddress);
-                               }
+                               $emails = $notificationAlternativeRecipients;
                        }
 
                                // prepare and then send the emails
@@ -645,10 +642,10 @@ class tx_version_tcemain {
         * @param string $comment Comment that goes into log
         * @param boolean $notificationEmailInfo Accumulate state changes in memory for compiled notification email?
         * @param t3lib_TCEmain $tcemainObj TCEmain object
-        * @param string $notificationAlternativeRecipients comma separated list of recipients to notificate instead of normal be_users
+        * @param array $notificationAlternativeRecipients comma separated list of recipients to notify instead of normal be_users
         * @return void
         */
-       protected function version_setStage($table, $id, $stageId, $comment = '', $notificationEmailInfo = FALSE, t3lib_TCEmain $tcemainObj, $notificationAlternativeRecipients = FALSE) {
+       protected function version_setStage($table, $id, $stageId, $comment = '', $notificationEmailInfo = FALSE, t3lib_TCEmain $tcemainObj, array $notificationAlternativeRecipients = array()) {
                if ($errorCode = $tcemainObj->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
                        $tcemainObj->newlog('Attempt to set stage for record failed: ' . $errorCode, 1);
                } elseif ($tcemainObj->checkRecordUpdateAccess($table, $id)) {