@@ -174,19 +174,19 @@ discard block |
||
| 174 | 174 | return $this->findByProjectAndStatus($state, $keyword, $issueMilestoneId, true); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - /** |
|
| 178 | - * @param type $project |
|
| 179 | - * |
|
| 180 | - * @return int |
|
| 181 | - */ |
|
| 182 | - public function countIssuesForProjectWithStatus($status = 'open', $keyword = false, $milestone = null) |
|
| 183 | - { |
|
| 184 | - $qb = $this->findByProjectAndStatus($status, $keyword, $milestone, true); |
|
| 185 | - |
|
| 186 | - $qb->select('count(a)'); |
|
| 187 | - |
|
| 188 | - return $qb->getQuery()->getSingleScalarResult(); |
|
| 189 | - } |
|
| 177 | + /** |
|
| 178 | + * @param type $project |
|
| 179 | + * |
|
| 180 | + * @return int |
|
| 181 | + */ |
|
| 182 | + public function countIssuesForProjectWithStatus($status = 'open', $keyword = false, $milestone = null) |
|
| 183 | + { |
|
| 184 | + $qb = $this->findByProjectAndStatus($status, $keyword, $milestone, true); |
|
| 185 | + |
|
| 186 | + $qb->select('count(a)'); |
|
| 187 | + |
|
| 188 | + return $qb->getQuery()->getSingleScalarResult(); |
|
| 189 | + } |
|
| 190 | 190 | |
| 191 | 191 | public function findByProjectAndStatus($status = 'open', $keyword = false, $milestone = null, $queryOnly = false) |
| 192 | 192 | { |
@@ -197,29 +197,29 @@ discard block |
||
| 197 | 197 | $parameters = array('project' => $this->project); |
| 198 | 198 | |
| 199 | 199 | $qb->select('a') |
| 200 | - ->from('VersionControlGitControlBundle:Issue', 'a') |
|
| 201 | - ->where($where) |
|
| 202 | - ->setParameters($parameters); |
|
| 200 | + ->from('VersionControlGitControlBundle:Issue', 'a') |
|
| 201 | + ->where($where) |
|
| 202 | + ->setParameters($parameters); |
|
| 203 | 203 | |
| 204 | 204 | if ($status) { |
| 205 | 205 | $qb->andWhere( |
| 206 | - $qb->expr()->like('a.status', ':status') |
|
| 207 | - )->setParameter('status', $status); |
|
| 206 | + $qb->expr()->like('a.status', ':status') |
|
| 207 | + )->setParameter('status', $status); |
|
| 208 | 208 | } |
| 209 | - //If keyword is set |
|
| 210 | - if ($keyword) { |
|
| 211 | - $qb->andWhere( |
|
| 209 | + //If keyword is set |
|
| 210 | + if ($keyword) { |
|
| 211 | + $qb->andWhere( |
|
| 212 | 212 | $qb->expr()->orX( |
| 213 | 213 | $qb->expr()->like('a.title', ':keyword'), |
| 214 | 214 | $qb->expr()->like('a.description', ':keyword') |
| 215 | 215 | ) |
| 216 | 216 | )->setParameter('keyword', '%'.$keyword.'%'); |
| 217 | - } |
|
| 217 | + } |
|
| 218 | 218 | |
| 219 | 219 | if ($milestone != null) { |
| 220 | 220 | $qb->andWhere( |
| 221 | - $qb->expr()->eq('a.issueMilestone', ':milestone') |
|
| 222 | - )->setParameter('milestone', $milestone); |
|
| 221 | + $qb->expr()->eq('a.issueMilestone', ':milestone') |
|
| 222 | + )->setParameter('milestone', $milestone); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $qb->orderBy('a.updatedAt', 'desc'); |
@@ -20,16 +20,16 @@ |
||
| 20 | 20 | $qb = $em->createQueryBuilder(); |
| 21 | 21 | |
| 22 | 22 | $qb->select('a') |
| 23 | - ->from('VersionControlGitControlBundle:UserProjects', 'a') |
|
| 23 | + ->from('VersionControlGitControlBundle:UserProjects', 'a') |
|
| 24 | 24 | ->leftJoin('a.project', 'b') |
| 25 | 25 | ->where('a.user = :user') |
| 26 | 26 | ->setParameter('user', $user); |
| 27 | 27 | |
| 28 | - //If keyword is set |
|
| 29 | - if ($keyword) { |
|
| 30 | - $qb->andWhere(' b.title LIKE :keyword OR b.description LIKE :keyword ') |
|
| 31 | - ->setParameter('keyword', '%'.$keyword.'%'); |
|
| 32 | - } |
|
| 28 | + //If keyword is set |
|
| 29 | + if ($keyword) { |
|
| 30 | + $qb->andWhere(' b.title LIKE :keyword OR b.description LIKE :keyword ') |
|
| 31 | + ->setParameter('keyword', '%'.$keyword.'%'); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | if ($queryOnly === true) { |
| 35 | 35 | return $qb; |
@@ -190,19 +190,19 @@ discard block |
||
| 190 | 190 | return $issueMilestone; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - /** |
|
| 194 | - * @param type $project |
|
| 195 | - * |
|
| 196 | - * @return int |
|
| 197 | - */ |
|
| 198 | - public function countForProjectWithStatus($status = 'open') |
|
| 199 | - { |
|
| 200 | - $qb = $this->findByProjectAndStatus($status, true); |
|
| 193 | + /** |
|
| 194 | + * @param type $project |
|
| 195 | + * |
|
| 196 | + * @return int |
|
| 197 | + */ |
|
| 198 | + public function countForProjectWithStatus($status = 'open') |
|
| 199 | + { |
|
| 200 | + $qb = $this->findByProjectAndStatus($status, true); |
|
| 201 | 201 | |
| 202 | - $qb->select('count(a)'); |
|
| 202 | + $qb->select('count(a)'); |
|
| 203 | 203 | |
| 204 | - return $qb->getQuery()->getSingleScalarResult(); |
|
| 205 | - } |
|
| 204 | + return $qb->getQuery()->getSingleScalarResult(); |
|
| 205 | + } |
|
| 206 | 206 | |
| 207 | 207 | public function findByProjectAndStatus($status = 'open', $queryOnly = false) |
| 208 | 208 | { |
@@ -213,14 +213,14 @@ discard block |
||
| 213 | 213 | $parameters = array('project' => $this->project); |
| 214 | 214 | |
| 215 | 215 | $qb->select('a') |
| 216 | - ->from('VersionControlGitControlBundle:IssueMilestone', 'a') |
|
| 217 | - ->where($where) |
|
| 218 | - ->setParameters($parameters); |
|
| 216 | + ->from('VersionControlGitControlBundle:IssueMilestone', 'a') |
|
| 217 | + ->where($where) |
|
| 218 | + ->setParameters($parameters); |
|
| 219 | 219 | |
| 220 | 220 | if ($status) { |
| 221 | 221 | $qb->andWhere( |
| 222 | 222 | $qb->expr()->like('a.state', ':status') |
| 223 | - )->setParameter('status', $status); |
|
| 223 | + )->setParameter('status', $status); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | if ($queryOnly === true) { |
@@ -20,13 +20,13 @@ |
||
| 20 | 20 | $qb = $em->createQueryBuilder(); |
| 21 | 21 | |
| 22 | 22 | $qb->select('a') |
| 23 | - ->from('VersionControlGitControlBundle:Project', 'a'); |
|
| 23 | + ->from('VersionControlGitControlBundle:Project', 'a'); |
|
| 24 | 24 | |
| 25 | - //If keyword is set |
|
| 26 | - if ($keyword) { |
|
| 27 | - $qb->andWhere('a.title LIKE :keyword OR a.title LIKE :keyword') |
|
| 28 | - ->setParameter('keyword', '%'.$keyword.'%'); |
|
| 29 | - } |
|
| 25 | + //If keyword is set |
|
| 26 | + if ($keyword) { |
|
| 27 | + $qb->andWhere('a.title LIKE :keyword OR a.title LIKE :keyword') |
|
| 28 | + ->setParameter('keyword', '%'.$keyword.'%'); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | if ($queryOnly === true) { |
| 32 | 32 | return $qb; |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | return null; |
| 47 | 47 | } |
| 48 | 48 | $entity = $this->objectManager |
| 49 | - ->getRepository($this->class) |
|
| 50 | - ->find($id); |
|
| 49 | + ->getRepository($this->class) |
|
| 50 | + ->find($id); |
|
| 51 | 51 | if (null === $entity) { |
| 52 | 52 | throw new TransformationFailedException(); |
| 53 | 53 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | ->add('comment', TextareaType::class, array( |
| 41 | 41 | 'label' => 'Comment', 'required' => false, |
| 42 | 42 | //,'constraints' => array( |
| 43 | - // new NotBlank(array('message'=>'Please add a commit comment.')) |
|
| 43 | + // new NotBlank(array('message'=>'Please add a commit comment.')) |
|
| 44 | 44 | //) |
| 45 | 45 | )) |
| 46 | 46 | ->add('statushash', HiddenType::class, array( |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | 'choice_label' => function ($gitFile) { |
| 61 | 61 | return $gitFile->getPath1(); |
| 62 | 62 | }, |
| 63 | - 'choice_value' => function ($gitFile) { |
|
| 64 | - return $gitFile->getPath1(); |
|
| 65 | - }, |
|
| 63 | + 'choice_value' => function ($gitFile) { |
|
| 64 | + return $gitFile->getPath1(); |
|
| 65 | + }, |
|
| 66 | 66 | //'constraints' => array( |
| 67 | 67 | // new NotBlank() |
| 68 | 68 | // ,new \VersionControl\GitControlBundle\Validator\Constraints\StatusHash() |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | public function configureOptions(OptionsResolver $resolver) |
| 39 | 39 | { |
| 40 | 40 | $resolver->setDefaults(array( |
| 41 | - //'data_class' => 'Lre\MetadataBundle\Entity\Curriculum\ResourceCurriculum', |
|
| 41 | + //'data_class' => 'Lre\MetadataBundle\Entity\Curriculum\ResourceCurriculum', |
|
| 42 | 42 | //'data_class' => NULL, |
| 43 | 43 | //'cascade_validation' => true, |
| 44 | 44 | )); |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | 'property' => 'title', // Assuming that the entity has a "name" property |
| 38 | 38 | 'class' => 'VersionControl\GitControlBundle\Entity\IssueMilestone', |
| 39 | 39 | )) |
| 40 | - ->add('issueLabel', EntityType::class, array( |
|
| 40 | + ->add('issueLabel', EntityType::class, array( |
|
| 41 | 41 | 'multiple' => true, // Multiple selection allowed |
| 42 | 42 | 'expanded' => true, // Render as checkboxes |
| 43 | 43 | 'property' => 'title', // Assuming that the entity has a "name" property |
@@ -135,12 +135,12 @@ |
||
| 135 | 135 | $listPages = ''; |
| 136 | 136 | for ($i = ($this->currentPage - $this->midRange); $i < (($this->currentPage + $this->midRange) + 1); ++$i) { |
| 137 | 137 | if (($i > 0) && ($i <= $this->numPages)) { // if page number are within page range |
| 138 | - if ($i == $this->currentPage) { |
|
| 139 | - $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 140 | - } // if we're on current page |
|
| 141 | - else { |
|
| 142 | - $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 143 | - } // if not current page |
|
| 138 | + if ($i == $this->currentPage) { |
|
| 139 | + $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 140 | + } // if we're on current page |
|
| 141 | + else { |
|
| 142 | + $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 143 | + } // if not current page |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |