* fix render-call for partials (behaviour seems to have changed during Extbase-upgrade) 52/11152/1
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 12 May 2012 19:38:19 +0000 (21:38 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 12 May 2012 19:38:19 +0000 (21:38 +0200)
* fix some empty/correct-checks in the process
* discussionMessage should show date as well (additional to just time)

Change-Id: I95d6938a5489179bc8c6f71ad2f03e2be0001ddb

Classes/Utils/Repository/XmlitemRepository.php
Classes/Utils/Xmlitem.php
Resources/Private/Partials/discussionMessage.html
Resources/Private/Templates/Question/ShowStep3.html

index 70c6cc0..9efc47e 100644 (file)
@@ -73,7 +73,7 @@ class Tx_Questionrating_Utils_Repository_XmlitemRepository {
                                $xmlitem = t3lib_div::makeInstance('Tx_Questionrating_Utils_Xmlitem');
                                $xmlitem->loadXml($this->uploadFolder, $currentFile);
                                $question = $questionRepository->findByXmlId($xmlitem->getId());
-                               if (!empty($question)) {
+                               if (count($question) > 0) {
                                        $xmlitem->setInDb(1);
                                } else {
                                        $xmlitem->setInDb(0);
index b75416a..d8113eb 100644 (file)
@@ -100,7 +100,7 @@ class Tx_Questionrating_Utils_Xmlitem {
                foreach ($this->xml->answers->option as $answer) {
                        $currentAnswer = array();
                        $currentAnswer['text'] = $this->getTextandCode($answer);
-                       $currentAnswer['correct'] = ($answer['correct'] === 'true');
+                       $currentAnswer['correct'] = ((string) $answer['correct'] === 'true');
                        $this->answers[] = $currentAnswer;
                }
        }
index ed6c1e3..8fae342 100644 (file)
@@ -38,7 +38,7 @@
                                                                                </f:if>
                                                                        </f:else>
                                                                </f:if>
-                                                                       <br/><f:format.date format="H:i:s">{discussion.crdate}</f:format.date></td>
+                                                                       <br/><f:format.date format="d.m.Y, H:i:s">{discussion.crdate}</f:format.date></td>
                                                        <td class="messagetext">{discussion.message}</td>
                                                        <td class="small-right button">
                                                        <f:if condition="{qr:inArray(needle:'{leaderGroup}' array:'{discussion.fromUser.usergroups}')}">
index c7eb044..9705d45 100644 (file)
 
                                                <f:if condition="{renderFinalRatingReviewBox}">
                                                        <f:then>
-                                                               <f:render section="ratingDetailReview" />
+                                                               <f:render section="ratingDetailReview" arguments="{question: question, ratingArray: ratingArray, currentUser: currentUser}" />
                                                        </f:then>
                                                        <f:else>
-                                                               <f:render section="ratingDetailNormal" />
+                                                               <f:render section="ratingDetailNormal" arguments="{question: question, ratingArray: ratingArray, currentUser: currentUser, renderFinalRatingBox: renderFinalRatingBox, renderFinalViewBox: renderFinalViewBox, finalRating: finalRating}" />
                                                        </f:else>
                                                </f:if>
+                               <f:render partial="rating2" arguments="{currentStep: 3}" />
+                               <f:render partial="discussion" arguments="{question: question, leaderGroup: leaderGroup, isLeader: isLeader, currentUser: currentUser, allowDiscussion: 0}"/>
 </f:section>
 
 <f:section name="ratingDetailNormal">
@@ -36,7 +38,7 @@
                                                                                </f:if>
                                                                        </td>
                                                                        <!-- ###STEP2_CELL### end -->
-                                                               </f:for>
+                                                                       </f:for>
                                                                </tr>
                                                        </table>
                                                        <!-- ###STEP2### end -->
@@ -68,8 +70,5 @@
                                                        </table>
 </f:form>
                                                        <!-- ###STEP2### end -->
-
-                               <f:render partial="rating2" arguments="{currentStep: 3}" />
-                               <f:render partial="discussion" arguments="{question: question, leaderGroup: leaderGroup, isLeader: isLeader, currentUser: currentUser, allowDiscussion: 0}"/>
 </f:section>