File tree Expand file tree Collapse file tree 1 file changed +14
-21
lines changed
webapp/src/Controller/Jury Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -77,33 +77,26 @@ public function indexAction(
7777 ->setParameter ('queue ' , $ currentQueue );
7878 }
7979
80+ $ clarifications = $ queryBuilder
81+ ->getQuery ()
82+ ->getResult ();
83+
8084 /** @var Clarification[] $newClarifications */
8185 $ newClarifications = [];
8286 /** @var Clarification[] $oldClarifications */
8387 $ oldClarifications = [];
8488 /** @var Clarification[] $generalClarifications */
8589 $ generalClarifications = [];
86- $ wheres = [
87- 'new ' => 'clar.sender IS NOT NULL AND clar.answered = 0 ' ,
88- 'old ' => 'clar.sender IS NOT NULL AND clar.answered != 0 ' ,
89- 'general ' => 'clar.sender IS NULL AND clar.in_reply_to IS NULL ' ,
90- ];
91- foreach ($ wheres as $ type => $ where ) {
92- $ clarifications = (clone $ queryBuilder )
93- ->andWhere ($ where )
94- ->getQuery ()
95- ->getResult ();
96-
97- switch ($ type ) {
98- case 'new ' :
99- $ newClarifications = $ clarifications ;
100- break ;
101- case 'old ' :
102- $ oldClarifications = $ clarifications ;
103- break ;
104- case 'general ' :
105- $ generalClarifications = $ clarifications ;
106- break ;
90+
91+ foreach ($ clarifications as $ clar ) {
92+ if ($ clar ->getSender () !== null ) {
93+ if ($ clar ->getAnswered ()) {
94+ $ oldClarifications [] = $ clar ;
95+ } else {
96+ $ newClarifications [] = $ clar ;
97+ }
98+ } elseif ($ clar ->getInReplyTo () === null ) {
99+ $ generalClarifications [] = $ clar ;
107100 }
108101 }
109102
You can’t perform that action at this time.
0 commit comments